@latticexyz/entrykit 2.2.22-26d2e3acd8fc0a0852f530e8e1574a68d2baa3d2 → 2.2.22-2fe59091a36e3ace2e5ec143138e801fadcdc707

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.
@@ -22,7 +22,7 @@ import { forwardRef, useEffect, useRef, useState } from "react";
22
22
  import ReactDOM from "react-dom";
23
23
 
24
24
  // ../../node_modules/.pnpm/tailwindcss@3.4.13/node_modules/tailwindcss/tailwind.css?inline
25
- var tailwind_default = '*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}/*\n! tailwindcss v3.4.13 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: \'\';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user\'s configured `sans` font-family by default.\n5. Use the user\'s configured `sans` font-feature-settings by default.\n6. Use the user\'s configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */ /* 3 */\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user\'s configured `mono` font-family by default.\n2. Use the user\'s configured `mono` font-feature-settings by default.\n3. Use the user\'s configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type=\'button\']),\ninput:where([type=\'reset\']),\ninput:where([type=\'submit\']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type=\'search\'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user\'s configured gray 400 color.\n*/\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role="button"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don\'t get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n[hidden] {\n display: none;\n}\n\n.container {\n width: 100%;\n}\n\n@media (min-width: 640px) {\n\n .container {\n max-width: 640px;\n }\n}\n\n@media (min-width: 768px) {\n\n .container {\n max-width: 768px;\n }\n}\n\n@media (min-width: 1024px) {\n\n .container {\n max-width: 1024px;\n }\n}\n\n@media (min-width: 1280px) {\n\n .container {\n max-width: 1280px;\n }\n}\n\n@media (min-width: 1536px) {\n\n .container {\n max-width: 1536px;\n }\n}\n\n.grid-cols-2.divide-y > :not([hidden]) ~ :not([hidden]):nth-child(-n + 2) {\n border-top-width: 0;\n border-bottom-width: 0;\n}\n\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.pointer-events-none {\n pointer-events: none;\n}\n\n.pointer-events-auto {\n pointer-events: auto;\n}\n\n.fixed {\n position: fixed;\n}\n\n.absolute {\n position: absolute;\n}\n\n.relative {\n position: relative;\n}\n\n.sticky {\n position: sticky;\n}\n\n.inset-0 {\n inset: 0px;\n}\n\n.bottom-0 {\n bottom: 0px;\n}\n\n.left-0 {\n left: 0px;\n}\n\n.right-0 {\n right: 0px;\n}\n\n.top-0 {\n top: 0px;\n}\n\n.col-start-1 {\n grid-column-start: 1;\n}\n\n.row-start-1 {\n grid-row-start: 1;\n}\n\n.m-0 {\n margin: 0px;\n}\n\n.m-2 {\n margin: 0.5rem;\n}\n\n.-mx-0\\.5 {\n margin-left: -0.125rem;\n margin-right: -0.125rem;\n}\n\n.-my-1 {\n margin-top: -0.25rem;\n margin-bottom: -0.25rem;\n}\n\n.-my-\\[0\\.125em\\] {\n margin-top: -0.125em;\n margin-bottom: -0.125em;\n}\n\n.mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n\n.-ml-3 {\n margin-left: -0.75rem;\n}\n\n.-mt-2 {\n margin-top: -0.5rem;\n}\n\n.block {\n display: block;\n}\n\n.flex {\n display: flex;\n}\n\n.inline-flex {\n display: inline-flex;\n}\n\n.table {\n display: table;\n}\n\n.grid {\n display: grid;\n}\n\n.inline-grid {\n display: inline-grid;\n}\n\n.contents {\n display: contents;\n}\n\n.hidden {\n display: none;\n}\n\n.h-12 {\n height: 3rem;\n}\n\n.h-16 {\n height: 4rem;\n}\n\n.h-4 {\n height: 1rem;\n}\n\n.h-6 {\n height: 1.5rem;\n}\n\n.h-64 {\n height: 16rem;\n}\n\n.h-\\[1\\.25em\\] {\n height: 1.25em;\n}\n\n.h-\\[1em\\] {\n height: 1em;\n}\n\n.h-full {\n height: 100%;\n}\n\n.max-h-full {\n max-height: 100%;\n}\n\n.min-h-\\[22rem\\] {\n min-height: 22rem;\n}\n\n.min-h-\\[26rem\\] {\n min-height: 26rem;\n}\n\n.w-16 {\n width: 4rem;\n}\n\n.w-24 {\n width: 6rem;\n}\n\n.w-28 {\n width: 7rem;\n}\n\n.w-4 {\n width: 1rem;\n}\n\n.w-48 {\n width: 12rem;\n}\n\n.w-6 {\n width: 1.5rem;\n}\n\n.w-60 {\n width: 15rem;\n}\n\n.w-\\[0\\.6em\\] {\n width: 0.6em;\n}\n\n.w-\\[1\\.25em\\] {\n width: 1.25em;\n}\n\n.w-full {\n width: 100%;\n}\n\n.max-w-\\[26rem\\] {\n max-width: 26rem;\n}\n\n.flex-shrink-0 {\n flex-shrink: 0;\n}\n\n.flex-grow {\n flex-grow: 1;\n}\n\n.-translate-y-2 {\n --tw-translate-y: -0.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.-translate-y-4 {\n --tw-translate-y: -1rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-x-2 {\n --tw-translate-x: 0.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-y-0 {\n --tw-translate-y: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-50 {\n --tw-scale-x: .5;\n --tw-scale-y: .5;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n@keyframes spin {\n\n to {\n transform: rotate(360deg);\n }\n}\n\n.animate-spin {\n animation: spin 1s linear infinite;\n}\n\n.cursor-pointer {\n cursor: pointer;\n}\n\n.grid-cols-\\[1fr_auto_1fr\\] {\n grid-template-columns: 1fr auto 1fr;\n}\n\n.flex-col {\n flex-direction: column;\n}\n\n.place-items-center {\n place-items: center;\n}\n\n.items-end {\n align-items: flex-end;\n}\n\n.items-center {\n align-items: center;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.justify-center {\n justify-content: center;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.gap-1 {\n gap: 0.25rem;\n}\n\n.gap-2 {\n gap: 0.5rem;\n}\n\n.gap-2\\.5 {\n gap: 0.625rem;\n}\n\n.gap-4 {\n gap: 1rem;\n}\n\n.gap-6 {\n gap: 1.5rem;\n}\n\n.space-y-6 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));\n}\n\n.divide-y > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-y-reverse: 0;\n border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));\n border-bottom-width: calc(1px * var(--tw-divide-y-reverse));\n}\n\n.divide-neutral-800 > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(38 38 38 / var(--tw-divide-opacity));\n}\n\n.self-auto {\n align-self: auto;\n}\n\n.self-center {\n align-self: center;\n}\n\n.overflow-auto {\n overflow: auto;\n}\n\n.overflow-clip {\n overflow: clip;\n}\n\n.whitespace-pre-wrap {\n white-space: pre-wrap;\n}\n\n.rounded-full {\n border-radius: 9999px;\n}\n\n.border {\n border-width: 1px;\n}\n\n.border-4 {\n border-width: 4px;\n}\n\n.border-neutral-300 {\n --tw-border-opacity: 1;\n border-color: rgb(212 212 212 / var(--tw-border-opacity));\n}\n\n.border-transparent {\n border-color: transparent;\n}\n\n.bg-black\\/10 {\n background-color: rgb(0 0 0 / 0.1);\n}\n\n.bg-blue-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity));\n}\n\n.bg-blue-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(29 78 216 / var(--tw-bg-opacity));\n}\n\n.bg-blue-700\\/60 {\n background-color: rgb(29 78 216 / 0.6);\n}\n\n.bg-neutral-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(245 245 245 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-800 {\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-800\\/85 {\n background-color: rgb(38 38 38 / 0.85);\n}\n\n.bg-neutral-900 {\n --tw-bg-opacity: 1;\n background-color: rgb(23 23 23 / var(--tw-bg-opacity));\n}\n\n.bg-orange-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(249 115 22 / var(--tw-bg-opacity));\n}\n\n.bg-orange-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(234 88 12 / var(--tw-bg-opacity));\n}\n\n.bg-gradient-to-b {\n background-image: linear-gradient(to bottom, var(--tw-gradient-stops));\n}\n\n.from-transparent {\n --tw-gradient-from: transparent var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n\n.to-blue-700 {\n --tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position);\n}\n\n.bg-cover {\n background-size: cover;\n}\n\n.bg-center {\n background-position: center;\n}\n\n.bg-no-repeat {\n background-repeat: no-repeat;\n}\n\n.object-cover {\n object-fit: cover;\n}\n\n.p-1 {\n padding: 0.25rem;\n}\n\n.p-2 {\n padding: 0.5rem;\n}\n\n.p-3 {\n padding: 0.75rem;\n}\n\n.p-4 {\n padding: 1rem;\n}\n\n.p-6 {\n padding: 1.5rem;\n}\n\n.p-\\[\\.75em\\] {\n padding: .75em;\n}\n\n.px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\n}\n\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n\n.py-8 {\n padding-top: 2rem;\n padding-bottom: 2rem;\n}\n\n.pb-8 {\n padding-bottom: 2rem;\n}\n\n.pt-8 {\n padding-top: 2rem;\n}\n\n.text-left {\n text-align: left;\n}\n\n.text-center {\n text-align: center;\n}\n\n.font-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;\n}\n\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n\n.text-\\[\\.75em\\] {\n font-size: .75em;\n}\n\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.font-bold {\n font-weight: 700;\n}\n\n.font-medium {\n font-weight: 500;\n}\n\n.leading-none {\n line-height: 1;\n}\n\n.tracking-\\[-1ch\\] {\n letter-spacing: -1ch;\n}\n\n.text-black {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity));\n}\n\n.text-neutral-400 {\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / var(--tw-text-opacity));\n}\n\n.text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity));\n}\n\n.text-transparent {\n color: transparent;\n}\n\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.text-white\\/20 {\n color: rgb(255 255 255 / 0.2);\n}\n\n.text-white\\/80 {\n color: rgb(255 255 255 / 0.8);\n}\n\n.opacity-0 {\n opacity: 0;\n}\n\n.opacity-100 {\n opacity: 1;\n}\n\n.opacity-25 {\n opacity: 0.25;\n}\n\n.opacity-30 {\n opacity: 0.3;\n}\n\n.opacity-75 {\n opacity: 0.75;\n}\n\n.outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n.ring-1 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.ring-neutral-700\\/50 {\n --tw-ring-color: rgb(64 64 64 / 0.5);\n}\n\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.duration-100 {\n transition-duration: 100ms;\n}\n\n.duration-300 {\n transition-duration: 300ms;\n}\n\n@keyframes enter {\n\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n\n@keyframes exit {\n\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n\n.animate-in {\n animation-name: enter;\n animation-duration: 150ms;\n --tw-enter-opacity: initial;\n --tw-enter-scale: initial;\n --tw-enter-rotate: initial;\n --tw-enter-translate-x: initial;\n --tw-enter-translate-y: initial;\n}\n\n.fade-in {\n --tw-enter-opacity: 0;\n}\n\n.slide-in-from-bottom-16 {\n --tw-enter-translate-y: 4rem;\n}\n\n.slide-in-from-bottom-8 {\n --tw-enter-translate-y: 2rem;\n}\n\n.animate-duration-300 {\n animation-duration: 300ms;\n}\n\n@property --tw-border-gradient-angle {\n syntax: \'<angle>\';\n inherits: true;\n initial-value: 0deg;\n}\n\n@property --tw-conic-gradient-angle {\n syntax: \'<angle>\';\n inherits: true;\n initial-value: 0deg;\n}\n\n@keyframes border-gradient {\n\n to {\n --tw-border-gradient-angle: 360deg;\n }\n}\n\n.after\\:select-none::after {\n content: var(--tw-content);\n -webkit-user-select: none;\n user-select: none;\n}\n\n.after\\:content-\\[\\\'\\2026\\\'\\]::after {\n --tw-content: \'\u2026\';\n content: var(--tw-content);\n}\n\n.hover\\:bg-blue-500:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.hover\\:bg-neutral-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.hover\\:bg-orange-400:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(251 146 60 / var(--tw-bg-opacity));\n}\n\n.hover\\:text-white:hover {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.hover\\:text-white\\/40:hover {\n color: rgb(255 255 255 / 0.4);\n}\n\n.hover\\:brightness-125:hover {\n --tw-brightness: brightness(1.25);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.focus\\:border-orange-500:focus {\n --tw-border-opacity: 1;\n border-color: rgb(249 115 22 / var(--tw-border-opacity));\n}\n\n.focus\\:border-yellow-400:focus {\n --tw-border-opacity: 1;\n border-color: rgb(250 204 21 / var(--tw-border-opacity));\n}\n\n.active\\:bg-orange-600:active {\n --tw-bg-opacity: 1;\n background-color: rgb(234 88 12 / var(--tw-bg-opacity));\n}\n\n.active\\:brightness-150:active {\n --tw-brightness: brightness(1.5);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.group:hover .group-hover\\:rotate-90 {\n --tw-rotate: 90deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.aria-busy\\:pointer-events-none[aria-busy="true"] {\n pointer-events: none;\n}\n\n.aria-busy\\:bg-blue-500[aria-busy="true"] {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.aria-disabled\\:pointer-events-none[aria-disabled="true"] {\n pointer-events: none;\n}\n\n.aria-disabled\\:opacity-50[aria-disabled="true"] {\n opacity: 0.5;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:inline {\n display: inline;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:hidden {\n display: none;\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:translate-x-0 {\n --tw-translate-x: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:scale-125 {\n --tw-scale-x: 1.25;\n --tw-scale-y: 1.25;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:opacity-100 {\n opacity: 1;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:opacity-0 {\n opacity: 0;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:opacity-100 {\n opacity: 1;\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:duration-300 {\n transition-duration: 300ms;\n}\n\n.data-\\[highlighted\\]\\:bg-neutral-200[data-highlighted] {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.links\\:font-medium a[href]:not(.links-unset) {\n font-weight: 500;\n}\n\n.links\\:text-white a[href]:not(.links-unset) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.links\\:underline a[href]:not(.links-unset) {\n text-decoration-line: underline;\n}\n\n.links\\:decoration-neutral-500 a[href]:not(.links-unset) {\n text-decoration-color: #737373;\n}\n\n.links\\:underline-offset-4 a[href]:not(.links-unset) {\n text-underline-offset: 4px;\n}\n\n.hover\\:links\\:decoration-orange-500 a[href]:not(.links-unset):hover {\n text-decoration-color: #f97316;\n}\n\n@media (min-width: 640px) {\n\n .sm\\:items-center {\n align-items: center;\n }\n}\n\n.dark\\:border-neutral-700:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-border-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-border-opacity));\n}\n\n.dark\\:bg-neutral-800:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.dark\\:bg-white\\/10:where([data-theme="dark"], [data-theme="dark"] *) {\n background-color: rgb(255 255 255 / 0.1);\n}\n\n.dark\\:text-white:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.dark\\:hover\\:bg-neutral-700:hover:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n';
25
+ var tailwind_default = '*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}/*\n! tailwindcss v3.4.13 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: \'\';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user\'s configured `sans` font-family by default.\n5. Use the user\'s configured `sans` font-feature-settings by default.\n6. Use the user\'s configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */ /* 3 */\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user\'s configured `mono` font-family by default.\n2. Use the user\'s configured `mono` font-feature-settings by default.\n3. Use the user\'s configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type=\'button\']),\ninput:where([type=\'reset\']),\ninput:where([type=\'submit\']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type=\'search\'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user\'s configured gray 400 color.\n*/\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role="button"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don\'t get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n[hidden] {\n display: none;\n}\n\n.container {\n width: 100%;\n}\n\n@media (min-width: 640px) {\n\n .container {\n max-width: 640px;\n }\n}\n\n@media (min-width: 768px) {\n\n .container {\n max-width: 768px;\n }\n}\n\n@media (min-width: 1024px) {\n\n .container {\n max-width: 1024px;\n }\n}\n\n@media (min-width: 1280px) {\n\n .container {\n max-width: 1280px;\n }\n}\n\n@media (min-width: 1536px) {\n\n .container {\n max-width: 1536px;\n }\n}\n\n.grid-cols-2.divide-y > :not([hidden]) ~ :not([hidden]):nth-child(-n + 2) {\n border-top-width: 0;\n border-bottom-width: 0;\n}\n\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.pointer-events-none {\n pointer-events: none;\n}\n\n.pointer-events-auto {\n pointer-events: auto;\n}\n\n.fixed {\n position: fixed;\n}\n\n.absolute {\n position: absolute;\n}\n\n.relative {\n position: relative;\n}\n\n.sticky {\n position: sticky;\n}\n\n.inset-0 {\n inset: 0px;\n}\n\n.bottom-0 {\n bottom: 0px;\n}\n\n.left-0 {\n left: 0px;\n}\n\n.right-0 {\n right: 0px;\n}\n\n.top-0 {\n top: 0px;\n}\n\n.col-start-1 {\n grid-column-start: 1;\n}\n\n.row-start-1 {\n grid-row-start: 1;\n}\n\n.m-0 {\n margin: 0px;\n}\n\n.m-2 {\n margin: 0.5rem;\n}\n\n.-mx-0\\.5 {\n margin-left: -0.125rem;\n margin-right: -0.125rem;\n}\n\n.-my-1 {\n margin-top: -0.25rem;\n margin-bottom: -0.25rem;\n}\n\n.-my-\\[0\\.125em\\] {\n margin-top: -0.125em;\n margin-bottom: -0.125em;\n}\n\n.mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n\n.-ml-3 {\n margin-left: -0.75rem;\n}\n\n.-mr-1 {\n margin-right: -0.25rem;\n}\n\n.-mt-2 {\n margin-top: -0.5rem;\n}\n\n.mt-1 {\n margin-top: 0.25rem;\n}\n\n.mt-4 {\n margin-top: 1rem;\n}\n\n.block {\n display: block;\n}\n\n.inline-block {\n display: inline-block;\n}\n\n.flex {\n display: flex;\n}\n\n.inline-flex {\n display: inline-flex;\n}\n\n.table {\n display: table;\n}\n\n.grid {\n display: grid;\n}\n\n.inline-grid {\n display: inline-grid;\n}\n\n.contents {\n display: contents;\n}\n\n.hidden {\n display: none;\n}\n\n.aspect-square {\n aspect-ratio: 1 / 1;\n}\n\n.h-10 {\n height: 2.5rem;\n}\n\n.h-12 {\n height: 3rem;\n}\n\n.h-16 {\n height: 4rem;\n}\n\n.h-3 {\n height: 0.75rem;\n}\n\n.h-3\\.5 {\n height: 0.875rem;\n}\n\n.h-4 {\n height: 1rem;\n}\n\n.h-6 {\n height: 1.5rem;\n}\n\n.h-64 {\n height: 16rem;\n}\n\n.h-\\[1\\.25em\\] {\n height: 1.25em;\n}\n\n.h-\\[1em\\] {\n height: 1em;\n}\n\n.h-\\[2px\\] {\n height: 2px;\n}\n\n.h-full {\n height: 100%;\n}\n\n.max-h-\\[230px\\] {\n max-height: 230px;\n}\n\n.max-h-full {\n max-height: 100%;\n}\n\n.w-10 {\n width: 2.5rem;\n}\n\n.w-16 {\n width: 4rem;\n}\n\n.w-24 {\n width: 6rem;\n}\n\n.w-28 {\n width: 7rem;\n}\n\n.w-3 {\n width: 0.75rem;\n}\n\n.w-3\\.5 {\n width: 0.875rem;\n}\n\n.w-4 {\n width: 1rem;\n}\n\n.w-48 {\n width: 12rem;\n}\n\n.w-6 {\n width: 1.5rem;\n}\n\n.w-60 {\n width: 15rem;\n}\n\n.w-8 {\n width: 2rem;\n}\n\n.w-\\[0\\.6em\\] {\n width: 0.6em;\n}\n\n.w-\\[1\\.25em\\] {\n width: 1.25em;\n}\n\n.w-\\[352px\\] {\n width: 352px;\n}\n\n.w-full {\n width: 100%;\n}\n\n.max-w-\\[26rem\\] {\n max-width: 26rem;\n}\n\n.flex-shrink-0 {\n flex-shrink: 0;\n}\n\n.flex-grow {\n flex-grow: 1;\n}\n\n.-translate-y-2 {\n --tw-translate-y: -0.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.-translate-y-4 {\n --tw-translate-y: -1rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-x-2 {\n --tw-translate-x: 0.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-y-0 {\n --tw-translate-y: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-50 {\n --tw-scale-x: .5;\n --tw-scale-y: .5;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n@keyframes spin {\n\n to {\n transform: rotate(360deg);\n }\n}\n\n.animate-spin {\n animation: spin 1s linear infinite;\n}\n\n.cursor-pointer {\n cursor: pointer;\n}\n\n.cursor-text {\n cursor: text;\n}\n\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n\n.grid-cols-\\[1fr_auto_1fr\\] {\n grid-template-columns: 1fr auto 1fr;\n}\n\n.flex-col {\n flex-direction: column;\n}\n\n.place-items-center {\n place-items: center;\n}\n\n.items-end {\n align-items: flex-end;\n}\n\n.items-center {\n align-items: center;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.justify-center {\n justify-content: center;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.gap-1 {\n gap: 0.25rem;\n}\n\n.gap-2 {\n gap: 0.5rem;\n}\n\n.gap-2\\.5 {\n gap: 0.625rem;\n}\n\n.gap-4 {\n gap: 1rem;\n}\n\n.gap-5 {\n gap: 1.25rem;\n}\n\n.gap-6 {\n gap: 1.5rem;\n}\n\n.space-y-6 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));\n}\n\n.divide-y > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-y-reverse: 0;\n border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));\n border-bottom-width: calc(1px * var(--tw-divide-y-reverse));\n}\n\n.divide-neutral-700 > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-divide-opacity));\n}\n\n.divide-neutral-800 > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(38 38 38 / var(--tw-divide-opacity));\n}\n\n.self-auto {\n align-self: auto;\n}\n\n.self-center {\n align-self: center;\n}\n\n.overflow-auto {\n overflow: auto;\n}\n\n.overflow-clip {\n overflow: clip;\n}\n\n.overflow-y-auto {\n overflow-y: auto;\n}\n\n.whitespace-nowrap {\n white-space: nowrap;\n}\n\n.whitespace-pre-wrap {\n white-space: pre-wrap;\n}\n\n.rounded-full {\n border-radius: 9999px;\n}\n\n.border {\n border-width: 1px;\n}\n\n.border-2 {\n border-width: 2px;\n}\n\n.border-4 {\n border-width: 4px;\n}\n\n.border-dashed {\n border-style: dashed;\n}\n\n.border-neutral-300 {\n --tw-border-opacity: 1;\n border-color: rgb(212 212 212 / var(--tw-border-opacity));\n}\n\n.border-neutral-700 {\n --tw-border-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-border-opacity));\n}\n\n.border-transparent {\n border-color: transparent;\n}\n\n.border-white\\/50 {\n border-color: rgb(255 255 255 / 0.5);\n}\n\n.bg-black\\/10 {\n background-color: rgb(0 0 0 / 0.1);\n}\n\n.bg-blue-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity));\n}\n\n.bg-blue-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(29 78 216 / var(--tw-bg-opacity));\n}\n\n.bg-blue-700\\/60 {\n background-color: rgb(29 78 216 / 0.6);\n}\n\n.bg-green-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(22 163 74 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(245 245 245 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-800 {\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-800\\/85 {\n background-color: rgb(38 38 38 / 0.85);\n}\n\n.bg-neutral-900 {\n --tw-bg-opacity: 1;\n background-color: rgb(23 23 23 / var(--tw-bg-opacity));\n}\n\n.bg-orange-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(249 115 22 / var(--tw-bg-opacity));\n}\n\n.bg-orange-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(234 88 12 / var(--tw-bg-opacity));\n}\n\n.bg-red-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(220 38 38 / var(--tw-bg-opacity));\n}\n\n.bg-transparent {\n background-color: transparent;\n}\n\n.bg-gradient-to-b {\n background-image: linear-gradient(to bottom, var(--tw-gradient-stops));\n}\n\n.from-transparent {\n --tw-gradient-from: transparent var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n\n.to-blue-700 {\n --tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position);\n}\n\n.bg-cover {\n background-size: cover;\n}\n\n.bg-center {\n background-position: center;\n}\n\n.bg-no-repeat {\n background-repeat: no-repeat;\n}\n\n.object-cover {\n object-fit: cover;\n}\n\n.p-1 {\n padding: 0.25rem;\n}\n\n.p-2 {\n padding: 0.5rem;\n}\n\n.p-2\\.5 {\n padding: 0.625rem;\n}\n\n.p-3 {\n padding: 0.75rem;\n}\n\n.p-4 {\n padding: 1rem;\n}\n\n.p-6 {\n padding: 1.5rem;\n}\n\n.p-\\[\\.75em\\] {\n padding: .75em;\n}\n\n.px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\n}\n\n.py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n\n.py-8 {\n padding-top: 2rem;\n padding-bottom: 2rem;\n}\n\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n\n.pb-8 {\n padding-bottom: 2rem;\n}\n\n.pt-10 {\n padding-top: 2.5rem;\n}\n\n.pt-8 {\n padding-top: 2rem;\n}\n\n.text-left {\n text-align: left;\n}\n\n.text-center {\n text-align: center;\n}\n\n.font-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;\n}\n\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n\n.text-\\[\\.75em\\] {\n font-size: .75em;\n}\n\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.font-bold {\n font-weight: 700;\n}\n\n.font-medium {\n font-weight: 500;\n}\n\n.leading-loose {\n line-height: 2;\n}\n\n.leading-none {\n line-height: 1;\n}\n\n.tracking-\\[-1ch\\] {\n letter-spacing: -1ch;\n}\n\n.text-amber-500 {\n --tw-text-opacity: 1;\n color: rgb(245 158 11 / var(--tw-text-opacity));\n}\n\n.text-black {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity));\n}\n\n.text-gray-400 {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity));\n}\n\n.text-green-600 {\n --tw-text-opacity: 1;\n color: rgb(22 163 74 / var(--tw-text-opacity));\n}\n\n.text-neutral-300 {\n --tw-text-opacity: 1;\n color: rgb(212 212 212 / var(--tw-text-opacity));\n}\n\n.text-neutral-400 {\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / var(--tw-text-opacity));\n}\n\n.text-neutral-500 {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity));\n}\n\n.text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity));\n}\n\n.text-transparent {\n color: transparent;\n}\n\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.text-white\\/20 {\n color: rgb(255 255 255 / 0.2);\n}\n\n.text-white\\/50 {\n color: rgb(255 255 255 / 0.5);\n}\n\n.text-white\\/80 {\n color: rgb(255 255 255 / 0.8);\n}\n\n.underline {\n text-decoration-line: underline;\n}\n\n.decoration-neutral-500 {\n text-decoration-color: #737373;\n}\n\n.underline-offset-4 {\n text-underline-offset: 4px;\n}\n\n.opacity-0 {\n opacity: 0;\n}\n\n.opacity-100 {\n opacity: 1;\n}\n\n.opacity-25 {\n opacity: 0.25;\n}\n\n.opacity-30 {\n opacity: 0.3;\n}\n\n.opacity-50 {\n opacity: 0.5;\n}\n\n.opacity-75 {\n opacity: 0.75;\n}\n\n.outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n.ring-1 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.ring-2 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.ring-neutral-700\\/50 {\n --tw-ring-color: rgb(64 64 64 / 0.5);\n}\n\n.ring-transparent {\n --tw-ring-color: transparent;\n}\n\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.transition-colors {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.duration-100 {\n transition-duration: 100ms;\n}\n\n.duration-300 {\n transition-duration: 300ms;\n}\n\n.ease-linear {\n transition-timing-function: linear;\n}\n\n@keyframes enter {\n\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n\n@keyframes exit {\n\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n\n.animate-in {\n animation-name: enter;\n animation-duration: 150ms;\n --tw-enter-opacity: initial;\n --tw-enter-scale: initial;\n --tw-enter-rotate: initial;\n --tw-enter-translate-x: initial;\n --tw-enter-translate-y: initial;\n}\n\n.animate-out {\n animation-name: exit;\n animation-duration: 150ms;\n --tw-exit-opacity: initial;\n --tw-exit-scale: initial;\n --tw-exit-rotate: initial;\n --tw-exit-translate-x: initial;\n --tw-exit-translate-y: initial;\n}\n\n.fade-in {\n --tw-enter-opacity: 0;\n}\n\n.fade-out {\n --tw-exit-opacity: 0;\n}\n\n.slide-in-from-bottom-16 {\n --tw-enter-translate-y: 4rem;\n}\n\n.slide-in-from-bottom-2 {\n --tw-enter-translate-y: 0.5rem;\n}\n\n.slide-in-from-bottom-8 {\n --tw-enter-translate-y: 2rem;\n}\n\n.slide-in-from-top-2 {\n --tw-enter-translate-y: -0.5rem;\n}\n\n.animate-duration-300 {\n animation-duration: 300ms;\n}\n\n.ease-linear {\n animation-timing-function: linear;\n}\n\n@property --tw-border-gradient-angle {\n syntax: \'<angle>\';\n inherits: true;\n initial-value: 0deg;\n}\n\n@property --tw-conic-gradient-angle {\n syntax: \'<angle>\';\n inherits: true;\n initial-value: 0deg;\n}\n\n@keyframes border-gradient {\n\n to {\n --tw-border-gradient-angle: 360deg;\n }\n}\n\n.placeholder\\:text-neutral-500::placeholder {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity));\n}\n\n.after\\:select-none::after {\n content: var(--tw-content);\n -webkit-user-select: none;\n user-select: none;\n}\n\n.after\\:content-\\[\\\'\\2026\\\'\\]::after {\n --tw-content: \'\u2026\';\n content: var(--tw-content);\n}\n\n.focus-within\\:border-transparent:focus-within {\n border-color: transparent;\n}\n\n.focus-within\\:ring-orange-500:focus-within {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(249 115 22 / var(--tw-ring-opacity));\n}\n\n.hover\\:bg-blue-500:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.hover\\:bg-neutral-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.hover\\:bg-orange-400:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(251 146 60 / var(--tw-bg-opacity));\n}\n\n.hover\\:text-white:hover {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.hover\\:text-white\\/40:hover {\n color: rgb(255 255 255 / 0.4);\n}\n\n.hover\\:text-white\\/80:hover {\n color: rgb(255 255 255 / 0.8);\n}\n\n.hover\\:decoration-orange-500:hover {\n text-decoration-color: #f97316;\n}\n\n.hover\\:brightness-125:hover {\n --tw-brightness: brightness(1.25);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.focus\\:border-orange-500:focus {\n --tw-border-opacity: 1;\n border-color: rgb(249 115 22 / var(--tw-border-opacity));\n}\n\n.focus\\:border-yellow-400:focus {\n --tw-border-opacity: 1;\n border-color: rgb(250 204 21 / var(--tw-border-opacity));\n}\n\n.focus\\:bg-neutral-700:focus {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.active\\:bg-orange-600:active {\n --tw-bg-opacity: 1;\n background-color: rgb(234 88 12 / var(--tw-bg-opacity));\n}\n\n.active\\:brightness-150:active {\n --tw-brightness: brightness(1.5);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.group:hover .group-hover\\:pointer-events-none {\n pointer-events: none;\n}\n\n.group:hover .group-hover\\:pointer-events-auto {\n pointer-events: auto;\n}\n\n.group:hover .group-hover\\:inline-block {\n display: inline-block;\n}\n\n.group:hover .group-hover\\:hidden {\n display: none;\n}\n\n.group:hover .group-hover\\:rotate-90 {\n --tw-rotate: 90deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group:hover .group-hover\\:opacity-0 {\n opacity: 0;\n}\n\n.group:hover .group-hover\\:opacity-100 {\n opacity: 1;\n}\n\n.peer:placeholder-shown ~ .peer-placeholder-shown\\:text-neutral-500 {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity));\n}\n\n.aria-busy\\:pointer-events-none[aria-busy="true"] {\n pointer-events: none;\n}\n\n.aria-busy\\:bg-blue-500[aria-busy="true"] {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.aria-disabled\\:pointer-events-none[aria-disabled="true"] {\n pointer-events: none;\n}\n\n.aria-disabled\\:opacity-50[aria-disabled="true"] {\n opacity: 0.5;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:inline {\n display: inline;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:hidden {\n display: none;\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:translate-x-0 {\n --tw-translate-x: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:scale-125 {\n --tw-scale-x: 1.25;\n --tw-scale-y: 1.25;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:opacity-100 {\n opacity: 1;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:opacity-0 {\n opacity: 0;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:opacity-100 {\n opacity: 1;\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:duration-300 {\n transition-duration: 300ms;\n}\n\n.group[aria-expanded="true"] .group-aria-expanded\\:inline {\n display: inline;\n}\n\n.group[aria-expanded="true"] .group-aria-expanded\\:hidden {\n display: none;\n}\n\n.data-\\[highlighted\\]\\:bg-neutral-200[data-highlighted] {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.data-\\[state\\=checked\\]\\:bg-neutral-900[data-state="checked"] {\n --tw-bg-opacity: 1;\n background-color: rgb(23 23 23 / var(--tw-bg-opacity));\n}\n\n.links\\:font-medium a[href]:not(.links-unset) {\n font-weight: 500;\n}\n\n.links\\:text-white a[href]:not(.links-unset) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.links\\:underline a[href]:not(.links-unset) {\n text-decoration-line: underline;\n}\n\n.links\\:decoration-neutral-500 a[href]:not(.links-unset) {\n text-decoration-color: #737373;\n}\n\n.links\\:underline-offset-4 a[href]:not(.links-unset) {\n text-underline-offset: 4px;\n}\n\n.hover\\:links\\:decoration-orange-500 a[href]:not(.links-unset):hover {\n text-decoration-color: #f97316;\n}\n\n@media (min-width: 640px) {\n\n .sm\\:items-center {\n align-items: center;\n }\n}\n\n.dark\\:border-neutral-700:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-border-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-border-opacity));\n}\n\n.dark\\:bg-neutral-800:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.dark\\:bg-white\\/10:where([data-theme="dark"], [data-theme="dark"] *) {\n background-color: rgb(255 255 255 / 0.1);\n}\n\n.dark\\:text-white:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.dark\\:hover\\:bg-neutral-700:hover:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.\\[\\&_\\>_\\:is\\(dt\\2c dd\\)\\]\\:px-1 > :is(dt,dd) {\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n}\n\n.\\[\\&_\\>_dd\\]\\:text-right > dd {\n text-align: right;\n}\n';
26
26
 
27
27
  // src/ui/Shadow.tsx
28
28
  import { useResizeObserver } from "usehooks-ts";
@@ -37,14 +37,17 @@ function FrameProvider({ frame, children }) {
37
37
  if (value) throw new Error("`FrameProvider` can only be used once.");
38
38
  return /* @__PURE__ */ jsx(Context.Provider, { value: { frame }, children });
39
39
  }
40
+ function useFrame() {
41
+ const value = useContext(Context);
42
+ if (!value) throw new Error("`useFrame` can only be used within a `FrameProvider`.");
43
+ return value;
44
+ }
40
45
 
41
46
  // src/useTheme.ts
42
47
  import { useMediaQuery } from "usehooks-ts";
43
48
 
44
49
  // src/EntryKitConfigProvider.tsx
45
- import "@rainbow-me/rainbowkit/styles.css";
46
50
  import { createContext as createContext2, useContext as useContext2 } from "react";
47
- import { RainbowKitProvider, midnightTheme } from "@rainbow-me/rainbowkit";
48
51
  import { useChains } from "wagmi";
49
52
 
50
53
  // src/getBundlerTransport.ts
@@ -136,8 +139,11 @@ var debug2 = debug.extend("quarry");
136
139
 
137
140
  // src/quarry/transports/userOpExecutor.ts
138
141
  import { setBalance } from "viem/actions";
139
- function userOpExecutor({ executor }) {
140
- return () => {
142
+ function userOpExecutor({
143
+ executor,
144
+ fallbackDefaultTransport
145
+ }) {
146
+ return (opts) => {
141
147
  debug2("using a local user op executor", executor.account.address);
142
148
  if (executor.chain.id === 31337) {
143
149
  debug2("setting executor balance");
@@ -172,7 +178,9 @@ function userOpExecutor({ executor }) {
172
178
  if (method === "eth_estimateUserOperationGas") {
173
179
  return await estimateUserOperationGas(params);
174
180
  }
175
- throw new Error(`userOpExecutor: method "${method}" not supported`);
181
+ debug2(`userOpExecutor: method "${method}" not overridden, falling back to fallback transport`);
182
+ const { request: fallbackRequest } = fallbackDefaultTransport(opts);
183
+ return fallbackRequest({ method, params });
176
184
  };
177
185
  return createTransport({
178
186
  key: "userOpExecutor",
@@ -184,23 +192,31 @@ function userOpExecutor({ executor }) {
184
192
  }
185
193
 
186
194
  // src/getBundlerTransport.ts
195
+ import { wiresaw } from "@latticexyz/common/internal";
187
196
  function getBundlerTransport(chain) {
197
+ if ("wiresaw" in chain.rpcUrls) {
198
+ return wiresaw();
199
+ }
188
200
  const bundlerHttpUrl = chain.rpcUrls.bundler?.http[0];
189
- const bundlerTransport = bundlerHttpUrl ? http(bundlerHttpUrl) : chain.id === 31337 ? userOpExecutor({
190
- executor: createClient({
191
- chain,
192
- transport: fallback([webSocket(), http()]),
193
- account: privateKeyToAccount(keccak256(stringToHex("local user op executor"))),
194
- pollingInterval: 10
195
- }).extend(transactionQueue())
196
- }) : null;
197
- if (!bundlerTransport) {
198
- throw new Error(`Chain ${chain.id} config did not include a bundler RPC URL.`);
201
+ if (bundlerHttpUrl) {
202
+ return http(bundlerHttpUrl);
203
+ }
204
+ if (chain.id === 31337) {
205
+ return userOpExecutor({
206
+ executor: createClient({
207
+ chain,
208
+ transport: fallback([webSocket(), http()]),
209
+ account: privateKeyToAccount(keccak256(stringToHex("local user op executor"))),
210
+ pollingInterval: 10
211
+ }).extend(transactionQueue()),
212
+ fallbackDefaultTransport: http()
213
+ });
199
214
  }
200
- return bundlerTransport;
215
+ throw new Error(`Chain ${chain.id} config did not include a bundler RPC URL.`);
201
216
  }
202
217
 
203
218
  // src/EntryKitConfigProvider.tsx
219
+ import { ConnectKitProvider } from "connectkit";
204
220
  import { jsx as jsx2 } from "react/jsx-runtime";
205
221
  var Context2 = createContext2(null);
206
222
  function EntryKitConfigProvider({ config, children }) {
@@ -211,14 +227,14 @@ function EntryKitConfigProvider({ config, children }) {
211
227
  if (!chain) throw new Error(`Could not find configured chain for chain ID ${config.chainId}.`);
212
228
  getBundlerTransport(chain);
213
229
  return /* @__PURE__ */ jsx2(
214
- RainbowKitProvider,
230
+ ConnectKitProvider,
215
231
  {
216
- initialChain: 0,
217
- appInfo: {
218
- appName: config.appName
219
- // TODO: learn more and disclaimer
232
+ theme: "midnight",
233
+ options: {
234
+ // Prevent Wagmi trying to switch chains after connection
235
+ // https://github.com/wevm/wagmi/blob/f5b717ccf8a5b283263cadc984ba00b354bcefae/packages/core/src/connectors/injected.ts#L174-L182
236
+ initialChainId: 0
220
237
  },
221
- theme: midnightTheme({ borderRadius: "none" }),
222
238
  children: /* @__PURE__ */ jsx2(Context2.Provider, { value: { ...config, chain }, children })
223
239
  }
224
240
  );
@@ -269,7 +285,9 @@ var Shadow = forwardRef(function Shadow2({ mode, children }, forwardedRef) {
269
285
  inset: "0",
270
286
  width: "100%",
271
287
  height: "100%",
272
- zIndex: "2147483646"
288
+ // one less than ConnectKit's modal z-index
289
+ // so that ConnectKit can overlap properly
290
+ zIndex: "2147483645"
273
291
  } : frameSize.width && frameSize.height ? {
274
292
  all: "unset",
275
293
  display: "inline-grid",
@@ -368,13 +386,10 @@ function useAccountModal() {
368
386
  }
369
387
 
370
388
  // src/AccountModal.tsx
371
- import { twMerge as twMerge10 } from "tailwind-merge";
389
+ import { twMerge as twMerge20 } from "tailwind-merge";
372
390
 
373
391
  // src/AccountModalContent.tsx
374
- import { useAccount as useAccount2, useConnectorClient } from "wagmi";
375
-
376
- // src/ConnectWallet.tsx
377
- import { useAccount } from "wagmi";
392
+ import { useAccount as useAccount8, useConnectorClient } from "wagmi";
378
393
 
379
394
  // src/ui/Button.tsx
380
395
  import { twMerge as twMerge3 } from "tailwind-merge";
@@ -441,7 +456,7 @@ var Button = ({ pending, variant, type, className, children, disabled, ...props
441
456
  };
442
457
 
443
458
  // src/ConnectWallet.tsx
444
- import { useConnectModal } from "@rainbow-me/rainbowkit";
459
+ import { useModal } from "connectkit";
445
460
 
446
461
  // src/icons/Logo.tsx
447
462
  import { twMerge as twMerge4 } from "tailwind-merge";
@@ -501,7 +516,7 @@ function AppInfo() {
501
516
  return /* @__PURE__ */ jsxs6("div", { className: "flex-grow flex flex-col items-center justify-center gap-2", children: [
502
517
  /* @__PURE__ */ jsx8("div", { className: "w-16 h-16 m-2", children: !appIconLoading ? hasAppIcon ? /* @__PURE__ */ jsx8("img", { src: appIcon, className: "w-full h-full object-cover" }) : (
503
518
  // TODO: swap with favicon
504
- /* @__PURE__ */ jsx8(Logo, { className: "w-full h-full text-orange-500 dark:bg-neutral-800" })
519
+ /* @__PURE__ */ jsx8(Logo, { className: "w-full h-full text-orange-500 bg-neutral-800" })
505
520
  ) : null }),
506
521
  /* @__PURE__ */ jsx8("div", { className: "text-2xl text-white text-center", children: appName })
507
522
  ] });
@@ -509,18 +524,17 @@ function AppInfo() {
509
524
 
510
525
  // src/ConnectWallet.tsx
511
526
  import { twMerge as twMerge5 } from "tailwind-merge";
512
- import { useEffect as useEffect3, useState as useState2 } from "react";
527
+ import { useEffect as useEffect3, useRef as useRef2 } from "react";
513
528
  import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
514
529
  function ConnectWallet() {
515
- const userAccount = useAccount();
516
- const { openConnectModal, connectModalOpen } = useConnectModal();
517
- const [hasAutoOpened, setHasAutoOpened] = useState2(false);
530
+ const { open, setOpen } = useModal();
531
+ const hasAutoOpenedRef = useRef2(false);
518
532
  useEffect3(() => {
519
- if (!connectModalOpen && !hasAutoOpened) {
520
- openConnectModal?.();
521
- setHasAutoOpened(true);
533
+ if (!open && !hasAutoOpenedRef.current) {
534
+ setOpen(true);
535
+ hasAutoOpenedRef.current = true;
522
536
  }
523
- }, [connectModalOpen, hasAutoOpened, openConnectModal]);
537
+ }, [open, setOpen]);
524
538
  return /* @__PURE__ */ jsxs7(
525
539
  "div",
526
540
  {
@@ -532,8 +546,7 @@ function ConnectWallet() {
532
546
  {
533
547
  variant: "secondary",
534
548
  className: "self-auto flex justify-center",
535
- disabled: userAccount.status === "connecting",
536
- onClick: openConnectModal,
549
+ onClick: () => setOpen(true),
537
550
  autoFocus: true,
538
551
  children: "Connect wallet"
539
552
  },
@@ -545,16 +558,39 @@ function ConnectWallet() {
545
558
  }
546
559
 
547
560
  // src/onboarding/ConnectedSteps.tsx
548
- import { useEffect as useEffect8, useMemo as useMemo2, useRef as useRef2, useState as useState3 } from "react";
549
- import { twMerge as twMerge7 } from "tailwind-merge";
561
+ import { useEffect as useEffect15, useMemo as useMemo4, useRef as useRef5, useState as useState5 } from "react";
562
+ import { twMerge as twMerge18 } from "tailwind-merge";
550
563
 
551
- // src/onboarding/common.ts
552
- import { parseEther as parseEther2 } from "viem";
553
- var minGasBalance = parseEther2("0.01");
564
+ // src/onboarding/usePrerequisites.ts
565
+ import { useClient as useClient6, useConfig } from "wagmi";
566
+ import { getBalanceQueryOptions as getBalanceQueryOptions2 } from "wagmi/query";
567
+ import { queryOptions as queryOptions6, useQuery as useQuery7, useQueryClient } from "@tanstack/react-query";
568
+
569
+ // src/getPaymaster.ts
570
+ function getPaymaster(chain) {
571
+ const contracts = chain.contracts ?? {};
572
+ if ("quarryPaymaster" in contracts && contracts.quarryPaymaster != null) {
573
+ if ("address" in contracts.quarryPaymaster) {
574
+ return {
575
+ type: "quarry",
576
+ address: contracts.quarryPaymaster.address,
577
+ isGasPass: !!chain.rpcUrls.quarryPassIssuer?.http?.[0]
578
+ };
579
+ }
580
+ }
581
+ if ("paymaster" in contracts && contracts.paymaster != null) {
582
+ if ("address" in contracts.paymaster) {
583
+ return {
584
+ type: "simple",
585
+ address: contracts.paymaster.address
586
+ };
587
+ }
588
+ }
589
+ }
554
590
 
555
591
  // src/onboarding/quarry/useAllowance.ts
556
592
  import { useClient } from "wagmi";
557
- import { queryOptions, useQuery as useQuery2 } from "@tanstack/react-query";
593
+ import { queryOptions, skipToken, useQuery as useQuery2 } from "@tanstack/react-query";
558
594
 
559
595
  // src/quarry/getAllowance.ts
560
596
  import { numberToHex as numberToHex2 } from "viem";
@@ -565,7 +601,11 @@ import { parseAbi } from "viem";
565
601
  var paymasterAbi = parseAbi([
566
602
  "error SpenderSystem_AlreadyRegistered(address spender, address user)",
567
603
  "error SpenderSystem_HasOwnBalance(address spender)",
568
- "function registerSpender(address spender)"
604
+ "error BalanceSystem_BalanceTooHigh(address user, uint256 balance, uint256 max)",
605
+ "error BalanceSystem_InsufficientBalance(address user, uint256 amount, uint256 balance)",
606
+ "function registerSpender(address spender)",
607
+ "function depositTo(address to) payable",
608
+ "function withdrawTo(address to, uint256 amount)"
569
609
  ]);
570
610
  var paymasterConfig = defineStore({
571
611
  namespaces: {
@@ -579,6 +619,13 @@ var paymasterConfig = defineStore({
579
619
  },
580
620
  key: ["user"]
581
621
  },
622
+ Balance: {
623
+ schema: {
624
+ user: "address",
625
+ balance: "uint256"
626
+ },
627
+ key: ["user"]
628
+ },
582
629
  Grantor: {
583
630
  schema: {
584
631
  grantor: "address",
@@ -628,29 +675,6 @@ var paymasterTables = paymasterConfig.namespaces.root.tables;
628
675
  import { getRecord, getStaticDataLocation } from "@latticexyz/store/internal";
629
676
  import { getKeyTuple } from "@latticexyz/protocol-parser/internal";
630
677
  import { setStorageAt } from "viem/actions";
631
-
632
- // src/getPaymaster.ts
633
- function getPaymaster(chain) {
634
- const contracts = chain.contracts ?? {};
635
- if ("quarryPaymaster" in contracts && contracts.quarryPaymaster != null) {
636
- if ("address" in contracts.quarryPaymaster) {
637
- return {
638
- type: "quarry",
639
- address: contracts.quarryPaymaster.address
640
- };
641
- }
642
- }
643
- if ("paymaster" in contracts && contracts.paymaster != null) {
644
- if ("address" in contracts.paymaster) {
645
- return {
646
- type: "simple",
647
- address: contracts.paymaster.address
648
- };
649
- }
650
- }
651
- }
652
-
653
- // src/quarry/getAllowance.ts
654
678
  async function getAllowance({ client, userAddress }) {
655
679
  const paymaster = getPaymaster(client.chain);
656
680
  if (paymaster?.type !== "quarry") return null;
@@ -684,13 +708,10 @@ function getAllowanceQueryOptions({
684
708
  client,
685
709
  userAddress
686
710
  }) {
687
- const queryKey = ["getAllowance", client?.uid, userAddress];
688
- return queryOptions(
689
- client && userAddress ? {
690
- queryKey,
691
- queryFn: () => getAllowance({ client, userAddress })
692
- } : { queryKey, enabled: false }
693
- );
711
+ return queryOptions({
712
+ queryKey: ["getAllowance", client?.uid, userAddress],
713
+ queryFn: client && userAddress ? () => getAllowance({ client, userAddress }) : skipToken
714
+ });
694
715
  }
695
716
  function useAllowance(userAddress) {
696
717
  const { chainId } = useEntryKitConfig();
@@ -700,7 +721,7 @@ function useAllowance(userAddress) {
700
721
 
701
722
  // src/onboarding/quarry/useSpender.ts
702
723
  import { useClient as useClient2 } from "wagmi";
703
- import { queryOptions as queryOptions2, useQuery as useQuery3 } from "@tanstack/react-query";
724
+ import { queryOptions as queryOptions2, skipToken as skipToken2, useQuery as useQuery3 } from "@tanstack/react-query";
704
725
 
705
726
  // src/onboarding/quarry/getSpender.ts
706
727
  import { getRecord as getRecord2 } from "@latticexyz/store/internal";
@@ -722,18 +743,15 @@ function getSpenderQueryOptions({
722
743
  userAddress,
723
744
  sessionAddress
724
745
  }) {
725
- const queryKey = ["getSpender", client?.uid, userAddress, sessionAddress];
726
- return queryOptions2(
727
- client && userAddress && sessionAddress ? {
728
- queryKey,
729
- queryFn: () => getSpender({ client, userAddress, sessionAddress })
730
- } : { queryKey, enabled: false }
731
- );
746
+ return queryOptions2({
747
+ queryKey: ["getSpender", client?.uid, userAddress, sessionAddress],
748
+ queryFn: client && userAddress && sessionAddress ? () => getSpender({ client, userAddress, sessionAddress }) : skipToken2
749
+ });
732
750
  }
733
751
 
734
752
  // src/onboarding/useDelegation.ts
735
753
  import { useClient as useClient3 } from "wagmi";
736
- import { queryOptions as queryOptions3, useQuery as useQuery4 } from "@tanstack/react-query";
754
+ import { queryOptions as queryOptions3, skipToken as skipToken3, useQuery as useQuery4 } from "@tanstack/react-query";
737
755
 
738
756
  // src/onboarding/getDelegation.ts
739
757
  import { getRecord as getRecord3 } from "@latticexyz/store/internal";
@@ -776,22 +794,15 @@ function getDelegationQueryOptions({
776
794
  userAddress,
777
795
  sessionAddress
778
796
  }) {
779
- const queryKey = ["getDelegation", client?.uid, worldAddress, userAddress, sessionAddress];
780
- return queryOptions3(
781
- client && userAddress && sessionAddress ? {
782
- queryKey,
783
- queryFn: () => getDelegation({ client, worldAddress, userAddress, sessionAddress })
784
- } : { queryKey, enabled: false }
785
- );
797
+ return queryOptions3({
798
+ queryKey: ["getDelegation", client?.uid, worldAddress, userAddress, sessionAddress],
799
+ queryFn: client && userAddress && sessionAddress ? () => getDelegation({ client, worldAddress, userAddress, sessionAddress }) : skipToken3
800
+ });
786
801
  }
787
802
 
788
- // src/onboarding/usePrerequisites.ts
789
- import { queryOptions as queryOptions5, useQuery as useQuery6, useQueryClient } from "@tanstack/react-query";
790
- import { useClient as useClient5, useConfig } from "wagmi";
791
-
792
803
  // src/useSessionAccount.ts
793
804
  import { useClient as useClient4 } from "wagmi";
794
- import { queryOptions as queryOptions4, useQuery as useQuery5 } from "@tanstack/react-query";
805
+ import { queryOptions as queryOptions4, skipToken as skipToken4, useQuery as useQuery5 } from "@tanstack/react-query";
795
806
 
796
807
  // src/getSessionAccount.ts
797
808
  import { toSimpleSmartAccount } from "permissionless/accounts";
@@ -855,20 +866,50 @@ function getSessionAccountQueryOptions({
855
866
  client,
856
867
  userAddress
857
868
  }) {
858
- const queryKey = ["getSessionAccount", client?.uid, userAddress];
859
- return queryOptions4(
860
- client && userAddress ? {
861
- queryKey,
862
- queryFn: () => getSessionAccount({ client, userAddress }),
863
- staleTime: Infinity,
864
- // TODO: replace with function to retry only connection errors
865
- retry: false
866
- } : { queryKey, enabled: false }
867
- );
869
+ return queryOptions4({
870
+ queryKey: ["getSessionAccount", client?.uid, userAddress],
871
+ queryFn: client && userAddress ? () => getSessionAccount({ client, userAddress }) : skipToken4,
872
+ staleTime: Infinity,
873
+ // TODO: replace with function to retry only connection errors
874
+ retry: false
875
+ });
876
+ }
877
+
878
+ // src/onboarding/quarry/useBalance.ts
879
+ import { useClient as useClient5 } from "wagmi";
880
+ import { queryOptions as queryOptions5, skipToken as skipToken5, useQuery as useQuery6 } from "@tanstack/react-query";
881
+
882
+ // src/quarry/getBalance.ts
883
+ import { getRecord as getRecord4 } from "@latticexyz/store/internal";
884
+ async function getBalance({ client, userAddress }) {
885
+ const paymaster = getPaymaster(client.chain);
886
+ if (paymaster?.type !== "quarry") return null;
887
+ const record = await getRecord4(client, {
888
+ address: paymaster.address,
889
+ table: paymasterTables.Balance,
890
+ key: { user: userAddress },
891
+ blockTag: "pending"
892
+ });
893
+ return record.balance;
894
+ }
895
+
896
+ // src/onboarding/quarry/useBalance.ts
897
+ function getBalanceQueryOptions({
898
+ client,
899
+ userAddress
900
+ }) {
901
+ return queryOptions5({
902
+ queryKey: ["getBalance", client?.uid, userAddress],
903
+ queryFn: client && userAddress ? () => getBalance({ client, userAddress }) : skipToken5
904
+ });
905
+ }
906
+ function useBalance(userAddress) {
907
+ const { chainId } = useEntryKitConfig();
908
+ const client = useClient5({ chainId });
909
+ return useQuery6(getBalanceQueryOptions({ client, userAddress }));
868
910
  }
869
911
 
870
912
  // src/onboarding/usePrerequisites.ts
871
- import { getBalanceQueryOptions } from "wagmi/query";
872
913
  function getPrequisitesQueryOptions({
873
914
  queryClient,
874
915
  config,
@@ -876,46 +917,48 @@ function getPrequisitesQueryOptions({
876
917
  userAddress,
877
918
  worldAddress
878
919
  }) {
879
- const queryKey = ["getPrerequisites", client?.uid, userAddress];
880
- return queryOptions5(
881
- client && userAddress ? {
882
- queryKey,
883
- async queryFn() {
884
- const paymaster = getPaymaster(client.chain);
885
- const {
886
- account: { address: sessionAddress }
887
- } = await queryClient.fetchQuery(getSessionAccountQueryOptions({ client, userAddress }));
888
- const [sessionBalance, allowance, spender, hasDelegation] = await Promise.all([
889
- !paymaster ? queryClient.fetchQuery(
890
- getBalanceQueryOptions(config, { chainId: client.chain.id, address: sessionAddress })
891
- ) : null,
892
- paymaster?.type === "quarry" ? queryClient.fetchQuery(getAllowanceQueryOptions({ client, userAddress })) : null,
893
- paymaster?.type === "quarry" ? queryClient.fetchQuery(getSpenderQueryOptions({ client, userAddress, sessionAddress })) : null,
894
- queryClient.fetchQuery(getDelegationQueryOptions({ client, worldAddress, userAddress, sessionAddress }))
895
- ]);
896
- const hasAllowance = allowance == null || allowance >= minGasBalance;
897
- const isSpender = spender == null ? true : spender;
898
- const hasGasBalance = sessionBalance == null || sessionBalance.value >= minGasBalance;
899
- return {
900
- sessionAddress,
901
- hasAllowance,
902
- isSpender,
903
- hasGasBalance,
904
- hasDelegation,
905
- // we intentionally don't enforce an allowance/gas balance here
906
- complete: isSpender && hasDelegation
907
- };
908
- },
909
- retry: false
910
- } : { queryKey, enabled: false }
911
- );
920
+ return queryOptions6({
921
+ queryKey: ["getPrerequisites", client?.uid, userAddress],
922
+ queryFn: async () => {
923
+ if (!client) throw new Error("Viem client not ready.");
924
+ if (!userAddress) throw new Error("User not connected.");
925
+ const paymaster = getPaymaster(client.chain);
926
+ const {
927
+ account: { address: sessionAddress }
928
+ } = await queryClient.fetchQuery(getSessionAccountQueryOptions({ client, userAddress }));
929
+ const [sessionBalance, allowance, spender, quarryBalance, hasDelegation] = await Promise.all([
930
+ !paymaster ? queryClient.fetchQuery(
931
+ getBalanceQueryOptions2(config, { chainId: client.chain.id, address: sessionAddress })
932
+ ) : null,
933
+ paymaster?.type === "quarry" ? queryClient.fetchQuery(getAllowanceQueryOptions({ client, userAddress })) : null,
934
+ paymaster?.type === "quarry" ? queryClient.fetchQuery(getSpenderQueryOptions({ client, userAddress, sessionAddress })) : null,
935
+ paymaster?.type === "quarry" ? queryClient.fetchQuery(getBalanceQueryOptions({ client, userAddress })) : null,
936
+ queryClient.fetchQuery(getDelegationQueryOptions({ client, worldAddress, userAddress, sessionAddress }))
937
+ ]);
938
+ const hasAllowance = allowance == null || allowance > 0n;
939
+ const isSpender = spender == null ? true : spender;
940
+ const hasGasBalance = sessionBalance == null || sessionBalance.value > 0n;
941
+ const hasQuarryGasBalance = quarryBalance == null || quarryBalance > 0n;
942
+ return {
943
+ sessionAddress,
944
+ hasAllowance,
945
+ isSpender,
946
+ hasGasBalance,
947
+ hasQuarryGasBalance,
948
+ hasDelegation,
949
+ // we intentionally don't enforce an allowance/gas balance here
950
+ complete: isSpender && hasDelegation
951
+ };
952
+ },
953
+ retry: false
954
+ });
912
955
  }
913
956
  function usePrerequisites(userAddress) {
914
957
  const queryClient = useQueryClient();
915
958
  const config = useConfig();
916
959
  const { chainId, worldAddress } = useEntryKitConfig();
917
- const client = useClient5({ chainId });
918
- const prereqs = useQuery6(
960
+ const client = useClient6({ chainId });
961
+ const prereqs = useQuery7(
919
962
  getPrequisitesQueryOptions({
920
963
  queryClient,
921
964
  config,
@@ -932,10 +975,10 @@ function usePrerequisites(userAddress) {
932
975
  import { useDisconnect } from "wagmi";
933
976
 
934
977
  // src/useENS.ts
935
- import { useQuery as useQuery7 } from "@tanstack/react-query";
978
+ import { useQuery as useQuery8 } from "@tanstack/react-query";
936
979
  function useENS(address) {
937
980
  const normalizedAddress = address?.toLowerCase();
938
- return useQuery7({
981
+ return useQuery8({
939
982
  enabled: !!normalizedAddress,
940
983
  queryKey: ["ens", normalizedAddress],
941
984
  queryFn: async () => {
@@ -1054,8 +1097,11 @@ function Wallet({ isActive, isExpanded, userAddress }) {
1054
1097
  ] });
1055
1098
  }
1056
1099
 
1057
- // src/onboarding/quarry/useClaimGasPass.ts
1100
+ // src/onboarding/quarry/Allowance.tsx
1058
1101
  import { parseEther as parseEther3 } from "viem";
1102
+
1103
+ // src/onboarding/quarry/useClaimGasPass.ts
1104
+ import { parseEther as parseEther2 } from "viem";
1059
1105
  import { useMutation, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
1060
1106
 
1061
1107
  // src/quarry/transports/quarryPassIssuer.ts
@@ -1085,11 +1131,11 @@ async function claimGasPass({ chain, userAddress }) {
1085
1131
  }
1086
1132
 
1087
1133
  // src/onboarding/quarry/useClaimGasPass.ts
1088
- import { useClient as useClient6 } from "wagmi";
1134
+ import { useClient as useClient7 } from "wagmi";
1089
1135
  function useClaimGasPass() {
1090
1136
  const queryClient = useQueryClient2();
1091
1137
  const { chain } = useEntryKitConfig();
1092
- const client = useClient6({ chainId: chain.id });
1138
+ const client = useClient7({ chainId: chain.id });
1093
1139
  const mutationKey = ["claimGasPass", chain.id];
1094
1140
  return useMutation({
1095
1141
  retry: 0,
@@ -1097,7 +1143,7 @@ function useClaimGasPass() {
1097
1143
  mutationFn: async (userAddress) => {
1098
1144
  if (chain.id === 31337) {
1099
1145
  if (!client) throw new Error("No client?");
1100
- await setAllowanceSlot({ client, userAddress, allowance: parseEther3("1") });
1146
+ await setAllowanceSlot({ client, userAddress, allowance: parseEther2("1") });
1101
1147
  } else {
1102
1148
  await claimGasPass({ chain, userAddress });
1103
1149
  }
@@ -1135,8 +1181,12 @@ function EthIcon({ className, ...props }) {
1135
1181
  import { formatEther } from "viem";
1136
1182
  function formatBalance(wei) {
1137
1183
  const formatted = formatEther(wei);
1138
- const magnitude = Math.floor(parseFloat(formatted)).toString().length;
1139
- return parseFloat(formatted).toLocaleString("en-US", { maximumFractionDigits: Math.max(0, 6 - magnitude) });
1184
+ const parsed = parseFloat(formatted);
1185
+ if (parsed > 0 && parsed < 1e-5) {
1186
+ return "<0.00001";
1187
+ }
1188
+ const magnitude = Math.floor(parsed).toString().length;
1189
+ return parsed.toLocaleString("en-US", { maximumFractionDigits: Math.max(0, 6 - magnitude) });
1140
1190
  }
1141
1191
 
1142
1192
  // src/ui/Balance.tsx
@@ -1172,7 +1222,7 @@ function Allowance({ isActive, isExpanded, userAddress }) {
1172
1222
  const claimGasPass2 = useShowMutationError(useClaimGasPass());
1173
1223
  useEffect6(() => {
1174
1224
  const timer = setTimeout(() => {
1175
- if (isActive && claimGasPass2.status === "idle" && allowance.isSuccess && allowance.data != null && allowance.data < minGasBalance) {
1225
+ if (isActive && claimGasPass2.status === "idle" && allowance.isSuccess && allowance.data != null && allowance.data < parseEther3("0.01")) {
1176
1226
  claimGasPass2.mutate(userAddress);
1177
1227
  }
1178
1228
  });
@@ -1200,6 +1250,9 @@ function Allowance({ isActive, isExpanded, userAddress }) {
1200
1250
  ] });
1201
1251
  }
1202
1252
 
1253
+ // src/onboarding/Session.tsx
1254
+ import { useEffect as useEffect7 } from "react";
1255
+
1203
1256
  // src/onboarding/useSetupSession.ts
1204
1257
  import { encodeFunctionData } from "viem";
1205
1258
  import { useMutation as useMutation2, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
@@ -1213,11 +1266,12 @@ function defineCall(call) {
1213
1266
  }
1214
1267
 
1215
1268
  // src/onboarding/useSetupSession.ts
1216
- import { useClient as useClient7 } from "wagmi";
1269
+ import { useClient as useClient8 } from "wagmi";
1217
1270
  import { resourceToHex as resourceToHex2 } from "@latticexyz/common";
1218
1271
  import IBaseWorldAbi from "@latticexyz/world/out/IBaseWorld.sol/IBaseWorld.abi.json";
1219
1272
 
1220
1273
  // src/utils/callWithSignature.ts
1274
+ import { parseErc6492Signature } from "viem";
1221
1275
  import { writeContract as viem_writeContract } from "viem/actions";
1222
1276
  import { getAction as getAction3 } from "viem/utils";
1223
1277
 
@@ -1225,7 +1279,7 @@ import { getAction as getAction3 } from "viem/utils";
1225
1279
  import { toHex } from "viem";
1226
1280
  import { signTypedData } from "viem/actions";
1227
1281
  import { callWithSignatureTypes } from "@latticexyz/world-module-callwithsignature/internal";
1228
- import { getRecord as getRecord4 } from "@latticexyz/store/internal";
1282
+ import { getRecord as getRecord5 } from "@latticexyz/store/internal";
1229
1283
  import moduleConfig from "@latticexyz/world-module-callwithsignature/mud.config";
1230
1284
  import { hexToResource } from "@latticexyz/common";
1231
1285
  import { getAction as getAction2 } from "viem/utils";
@@ -1237,7 +1291,7 @@ async function signCall({
1237
1291
  nonce: initialNonce,
1238
1292
  client
1239
1293
  }) {
1240
- const nonce = initialNonce ?? (client ? (await getRecord4(client, {
1294
+ const nonce = initialNonce ?? (client ? (await getRecord5(client, {
1241
1295
  address: worldAddress,
1242
1296
  table: moduleConfig.tables.CallWithSignatureNonces,
1243
1297
  key: { signer: userClient.account.address },
@@ -1272,7 +1326,13 @@ async function callWithSignature({
1272
1326
  sessionClient,
1273
1327
  ...opts
1274
1328
  }) {
1275
- const signature = await signCall(opts);
1329
+ const rawSignature = await signCall(opts);
1330
+ const { address, signature } = parseErc6492Signature(rawSignature);
1331
+ if (address != null) {
1332
+ throw new Error(
1333
+ "ERC-6492 signatures, like from Coinbase Smart Wallet, are not yet supported. Try using a different wallet?"
1334
+ );
1335
+ }
1276
1336
  return getAction3(
1277
1337
  sessionClient,
1278
1338
  viem_writeContract,
@@ -1290,7 +1350,7 @@ import { systemsConfig as worldSystemsConfig } from "@latticexyz/world/mud.confi
1290
1350
  function useSetupSession({ userClient }) {
1291
1351
  const queryClient = useQueryClient3();
1292
1352
  const { chainId, worldAddress } = useEntryKitConfig();
1293
- const client = useClient7({ chainId });
1353
+ const client = useClient8({ chainId });
1294
1354
  const mutationKey = ["setupSession", client?.chain.id, userClient.account.address];
1295
1355
  return useMutation2({
1296
1356
  retry: 0,
@@ -1396,20 +1456,17 @@ function useSetupSession({ userClient }) {
1396
1456
  });
1397
1457
  }
1398
1458
 
1399
- // src/onboarding/Session.tsx
1400
- import { useEffect as useEffect7 } from "react";
1401
-
1402
1459
  // src/useSessionClient.ts
1403
- import { useClient as useClient8 } from "wagmi";
1460
+ import { useClient as useClient9 } from "wagmi";
1404
1461
  import {
1405
- queryOptions as queryOptions6,
1406
- useQuery as useQuery8,
1462
+ queryOptions as queryOptions7,
1463
+ useQuery as useQuery9,
1407
1464
  useQueryClient as useQueryClient4
1408
1465
  } from "@tanstack/react-query";
1409
1466
 
1410
1467
  // src/getSessionClient.ts
1411
1468
  import { smartAccountActions } from "permissionless";
1412
- import { callFrom } from "@latticexyz/world/internal";
1469
+ import { callFrom, sendUserOperationFrom } from "@latticexyz/world/internal";
1413
1470
 
1414
1471
  // src/createBundlerClient.ts
1415
1472
  import {
@@ -1468,6 +1525,12 @@ async function getSessionClient({
1468
1525
  delegatorAddress: userAddress,
1469
1526
  publicClient: client
1470
1527
  })
1528
+ ).extend(
1529
+ sendUserOperationFrom({
1530
+ worldAddress,
1531
+ delegatorAddress: userAddress,
1532
+ publicClient: client
1533
+ })
1471
1534
  ).extend(() => ({ userAddress, worldAddress, internal_signer: sessionSigner }));
1472
1535
  return sessionClient;
1473
1536
  }
@@ -1482,32 +1545,30 @@ function getSessionClientQueryOptions({
1482
1545
  userAddress,
1483
1546
  worldAddress
1484
1547
  }) {
1485
- const queryKey = ["getSessionClient", client?.uid, userAddress, worldAddress];
1486
- return queryOptions6(
1487
- userAddress ? {
1488
- queryKey,
1489
- async queryFn() {
1490
- const { account: sessionAccount, signer: sessionSigner } = await queryClient.fetchQuery(
1491
- getSessionAccountQueryOptions({ client, userAddress })
1492
- );
1493
- return await getSessionClient({
1494
- sessionAccount,
1495
- sessionSigner,
1496
- userAddress,
1497
- worldAddress
1498
- });
1499
- },
1500
- staleTime: Infinity,
1501
- // TODO: replace with function to retry only connection errors
1502
- retry: false
1503
- } : { queryKey, enabled: false }
1504
- );
1548
+ return queryOptions7({
1549
+ queryKey: ["getSessionClient", client?.uid, userAddress, worldAddress],
1550
+ queryFn: async () => {
1551
+ if (!userAddress) throw new Error("User not connected.");
1552
+ const { account: sessionAccount, signer: sessionSigner } = await queryClient.fetchQuery(
1553
+ getSessionAccountQueryOptions({ client, userAddress })
1554
+ );
1555
+ return await getSessionClient({
1556
+ sessionAccount,
1557
+ sessionSigner,
1558
+ userAddress,
1559
+ worldAddress
1560
+ });
1561
+ },
1562
+ staleTime: Infinity,
1563
+ // TODO: replace with function to retry only connection errors
1564
+ retry: false
1565
+ });
1505
1566
  }
1506
1567
  function useSessionClient(userAddress) {
1507
1568
  const queryClient = useQueryClient4();
1508
1569
  const { chainId, worldAddress } = useEntryKitConfig();
1509
- const client = useClient8({ chainId });
1510
- return useQuery8(
1570
+ const client = useClient9({ chainId });
1571
+ return useQuery9(
1511
1572
  getSessionClientQueryOptions({
1512
1573
  queryClient,
1513
1574
  client,
@@ -1523,9 +1584,11 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
1523
1584
  const sessionClient = useShowQueryError(useSessionClient(userClient.account.address));
1524
1585
  const setup = useShowMutationError(useSetupSession({ userClient }));
1525
1586
  const hasSession = !registerDelegation && !registerDelegation;
1587
+ const { data: prerequisites } = usePrerequisites(userClient.account.address);
1588
+ const { hasAllowance, hasGasBalance, hasQuarryGasBalance } = prerequisites ?? {};
1526
1589
  useEffect7(() => {
1527
1590
  const timer = setTimeout(() => {
1528
- if (isActive && setup.status === "idle" && sessionClient.data && !hasSession) {
1591
+ if (isActive && setup.status === "idle" && sessionClient.data && !hasSession && (hasAllowance || hasGasBalance || hasQuarryGasBalance)) {
1529
1592
  setup.mutate({
1530
1593
  sessionClient: sessionClient.data,
1531
1594
  registerSpender,
@@ -1534,7 +1597,17 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
1534
1597
  }
1535
1598
  });
1536
1599
  return () => clearTimeout(timer);
1537
- }, [hasSession, isActive, registerDelegation, registerSpender, sessionClient, setup]);
1600
+ }, [
1601
+ hasSession,
1602
+ isActive,
1603
+ registerDelegation,
1604
+ registerSpender,
1605
+ sessionClient,
1606
+ setup,
1607
+ hasAllowance,
1608
+ hasGasBalance,
1609
+ hasQuarryGasBalance
1610
+ ]);
1538
1611
  return /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-4", children: [
1539
1612
  /* @__PURE__ */ jsxs13("div", { className: "flex justify-between gap-4", children: [
1540
1613
  /* @__PURE__ */ jsxs13("div", { children: [
@@ -1562,7 +1635,10 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
1562
1635
  }
1563
1636
 
1564
1637
  // src/onboarding/GasBalance.tsx
1565
- import { useBalance, useWatchBlockNumber } from "wagmi";
1638
+ import { useEffect as useEffect9, useState as useState2 } from "react";
1639
+ import { parseEther as parseEther4 } from "viem";
1640
+ import { useQueryClient as useQueryClient6 } from "@tanstack/react-query";
1641
+ import { useBalance as useBalance2, useWatchBlockNumber } from "wagmi";
1566
1642
 
1567
1643
  // src/data/relayChains.json
1568
1644
  var relayChains_default = {
@@ -1847,11 +1923,11 @@ var relayChains_default = {
1847
1923
  // src/onboarding/useSetBalance.ts
1848
1924
  import { useQueryClient as useQueryClient5, useMutation as useMutation3 } from "@tanstack/react-query";
1849
1925
  import { setBalance as setBalance2 } from "viem/actions";
1850
- import { useClient as useClient9 } from "wagmi";
1926
+ import { useClient as useClient10 } from "wagmi";
1851
1927
  function useSetBalance() {
1852
1928
  const queryClient = useQueryClient5();
1853
1929
  const { chainId } = useEntryKitConfig();
1854
- const client = useClient9({ chainId });
1930
+ const client = useClient10({ chainId });
1855
1931
  return useMutation3({
1856
1932
  retry: 0,
1857
1933
  mutationKey: ["setBalance", chainId],
@@ -1867,21 +1943,93 @@ function useSetBalance() {
1867
1943
  });
1868
1944
  }
1869
1945
 
1946
+ // src/errors/usePrevious.ts
1947
+ import { useEffect as useEffect8, useRef as useRef3 } from "react";
1948
+ function usePrevious(value, initialValue) {
1949
+ const ref = useRef3();
1950
+ useEffect8(() => {
1951
+ ref.current = { value };
1952
+ }, [value]);
1953
+ return ref.current ? ref.current.value : initialValue;
1954
+ }
1955
+
1956
+ // src/icons/IconSVG.tsx
1957
+ import { twMerge as twMerge7 } from "tailwind-merge";
1958
+ import { jsx as jsx16 } from "react/jsx-runtime";
1959
+ function IconSVG({ className, children, ...props }) {
1960
+ return /* @__PURE__ */ jsx16(
1961
+ "svg",
1962
+ {
1963
+ xmlns: "http://www.w3.org/2000/svg",
1964
+ viewBox: "0 0 24 24",
1965
+ fill: "currentColor",
1966
+ className: twMerge7("-my-[0.125em] h-[1.25em] w-[1.25em]", className),
1967
+ ...props,
1968
+ children
1969
+ }
1970
+ );
1971
+ }
1972
+
1973
+ // src/icons/CopyIcon.tsx
1974
+ import { jsx as jsx17 } from "react/jsx-runtime";
1975
+ function CopyIcon(props) {
1976
+ return /* @__PURE__ */ jsx17(IconSVG, { ...props, children: /* @__PURE__ */ jsx17(
1977
+ "path",
1978
+ {
1979
+ d: "M8 5H6C4.89543 5 4 5.89543 4 7V19C4 20.1046 4.89543 21 6 21H16C17.1046 21 18 20.1046 18 19V18M8 5C8 6.10457 8.89543 7 10 7H12C13.1046 7 14 6.10457 14 5M8 5C8 3.89543 8.89543 3 10 3H12C13.1046 3 14 3.89543 14 5M14 5H16C17.1046 5 18 5.89543 18 7V10M20 14H10M10 14L13 11M10 14L13 17",
1980
+ fill: "none",
1981
+ stroke: "currentColor",
1982
+ strokeWidth: "2",
1983
+ strokeLinecap: "round",
1984
+ strokeLinejoin: "round"
1985
+ }
1986
+ ) });
1987
+ }
1988
+
1989
+ // src/icons/CheckIcon.tsx
1990
+ import { jsx as jsx18 } from "react/jsx-runtime";
1991
+ function CheckIcon(props) {
1992
+ return /* @__PURE__ */ jsx18(IconSVG, { ...props, children: /* @__PURE__ */ jsx18(
1993
+ "path",
1994
+ {
1995
+ d: "M5 13L9 17L19 7",
1996
+ fill: "none",
1997
+ stroke: "currentColor",
1998
+ strokeWidth: "2",
1999
+ strokeLinecap: "round",
2000
+ strokeLinejoin: "round"
2001
+ }
2002
+ ) });
2003
+ }
2004
+
1870
2005
  // src/onboarding/GasBalance.tsx
1871
- import { Fragment, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
2006
+ import { Fragment, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
1872
2007
  function GasBalance({ isActive, isExpanded, sessionAddress }) {
2008
+ const queryClient = useQueryClient6();
1873
2009
  const { chain } = useEntryKitConfig();
1874
- const balance = useShowQueryError(useBalance({ chainId: chain.id, address: sessionAddress }));
2010
+ const [copied, setCopied] = useState2(false);
2011
+ const balance = useShowQueryError(useBalance2({ chainId: chain.id, address: sessionAddress }));
2012
+ const prevBalance = usePrevious(balance.data);
1875
2013
  useWatchBlockNumber({ onBlockNumber: () => balance.refetch() });
1876
2014
  const setBalance3 = useShowMutationError(useSetBalance());
1877
2015
  const relayChain = relayChains_default[chain.id];
2016
+ const handleCopy = () => {
2017
+ navigator.clipboard.writeText(sessionAddress);
2018
+ setCopied(true);
2019
+ setTimeout(() => setCopied(false), 2e3);
2020
+ };
2021
+ useEffect9(() => {
2022
+ if (balance.data != null && prevBalance?.value === 0n && balance.data.value > 0n) {
2023
+ queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] });
2024
+ }
2025
+ }, [balance.data, prevBalance, setBalance3, sessionAddress, queryClient]);
1878
2026
  return /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-4", children: [
1879
2027
  /* @__PURE__ */ jsxs14("div", { className: "flex justify-between gap-4", children: [
1880
2028
  /* @__PURE__ */ jsxs14("div", { children: [
1881
- /* @__PURE__ */ jsx16("div", { children: "Gas balance" }),
1882
- /* @__PURE__ */ jsx16("div", { className: "font-mono text-white", children: balance.data != null ? /* @__PURE__ */ jsx16(Balance, { wei: balance.data.value }) : /* @__PURE__ */ jsx16(PendingIcon, { className: "text-sm" }) })
2029
+ /* @__PURE__ */ jsx19("div", { children: "Gas balance" }),
2030
+ /* @__PURE__ */ jsx19("div", { className: "font-mono text-white", children: balance.data != null ? /* @__PURE__ */ jsx19(Balance, { wei: balance.data.value }) : /* @__PURE__ */ jsx19(PendingIcon, { className: "text-sm" }) })
1883
2031
  ] }),
1884
- chain.id === 31337 ? /* @__PURE__ */ jsx16(
2032
+ chain.id === 31337 ? /* @__PURE__ */ jsx19(
1885
2033
  Button,
1886
2034
  {
1887
2035
  variant: isActive ? "primary" : "tertiary",
@@ -1890,19 +2038,19 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
1890
2038
  pending: balance.status === "pending" || setBalance3.status === "pending",
1891
2039
  onClick: () => setBalance3.mutate({
1892
2040
  address: sessionAddress,
1893
- value: minGasBalance + (balance.data?.value ?? 0n)
2041
+ value: parseEther4("0.01") + (balance.data?.value ?? 0n)
1894
2042
  }),
1895
2043
  children: "Top up"
1896
2044
  }
1897
2045
  ) : relayChain != null ? (
1898
2046
  // TODO: convert this to a <ButtonLink>
1899
- /* @__PURE__ */ jsx16(
2047
+ /* @__PURE__ */ jsx19(
1900
2048
  "a",
1901
2049
  {
1902
- href: `${relayChain.bridgeUrl}?${new URLSearchParams({ toAddress: sessionAddress })}`,
2050
+ href: `${relayChain.bridgeUrl}?${new URLSearchParams({ toAddress: sessionAddress, amount: "0.01" })}`,
1903
2051
  target: "_blank",
1904
2052
  rel: "noopener noreferrer",
1905
- children: /* @__PURE__ */ jsx16(
2053
+ children: /* @__PURE__ */ jsx19(
1906
2054
  Button,
1907
2055
  {
1908
2056
  variant: isActive ? "primary" : "tertiary",
@@ -1917,11 +2065,23 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
1917
2065
  ) : null
1918
2066
  ] }),
1919
2067
  isExpanded ? /* @__PURE__ */ jsxs14(Fragment, { children: [
1920
- /* @__PURE__ */ jsx16("p", { className: "text-sm", children: "Your session's gas balance is used to pay for onchain computation." }),
2068
+ /* @__PURE__ */ jsx19("p", { className: "text-sm", children: "Your session's gas balance is used to pay for onchain computation." }),
1921
2069
  /* @__PURE__ */ jsxs14("p", { className: "text-sm", children: [
1922
2070
  "Send funds to",
1923
2071
  " ",
1924
- /* @__PURE__ */ jsx16("span", { className: "font-mono text-white", children: /* @__PURE__ */ jsx16(TruncatedHex, { hex: sessionAddress }) }),
2072
+ /* @__PURE__ */ jsxs14(
2073
+ "span",
2074
+ {
2075
+ className: "inline-flex items-center gap-1 font-mono text-white cursor-pointer hover:text-white/80 transition-colors",
2076
+ onClick: handleCopy,
2077
+ title: "Click to copy",
2078
+ children: [
2079
+ /* @__PURE__ */ jsx19(TruncatedHex, { hex: sessionAddress }),
2080
+ " ",
2081
+ copied ? /* @__PURE__ */ jsx19(CheckIcon, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ jsx19(CopyIcon, { className: "w-3.5 h-3.5" })
2082
+ ]
2083
+ }
2084
+ ),
1925
2085
  " ",
1926
2086
  "on ",
1927
2087
  chain.name,
@@ -1931,48 +2091,1204 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
1931
2091
  ] });
1932
2092
  }
1933
2093
 
1934
- // src/onboarding/ConnectedSteps.tsx
1935
- import { jsx as jsx17 } from "react/jsx-runtime";
1936
- function ConnectedSteps({ userClient, initialUserAddress }) {
1937
- const { chain } = useEntryKitConfig();
1938
- const paymaster = getPaymaster(chain);
1939
- const userAddress = userClient.account.address;
1940
- const { data: prerequisites, error: prerequisitesError } = usePrerequisites(userAddress);
1941
- useEffect8(() => {
1942
- if (prerequisitesError) {
1943
- console.error("Could not get prerequisites", prerequisitesError);
1944
- }
1945
- }, [prerequisitesError]);
1946
- const { closeAccountModal } = useAccountModal();
1947
- const isNewConnection = userAddress !== initialUserAddress;
1948
- const initialPrerequisites = useRef2(prerequisites);
1949
- useEffect8(() => {
1950
- if (prerequisites == null) return;
1951
- if (initialPrerequisites.current == null) {
1952
- initialPrerequisites.current = prerequisites;
2094
+ // src/onboarding/quarry/GasBalance.tsx
2095
+ import { useEffect as useEffect14 } from "react";
2096
+ import { useQueryClient as useQueryClient9 } from "@tanstack/react-query";
2097
+
2098
+ // src/onboarding/deposit/DepositFormContainer.tsx
2099
+ import { useState as useState4 } from "react";
2100
+ import { useChains as useChains4, useChainId } from "wagmi";
2101
+
2102
+ // src/onboarding/deposit/DepositViaTransferForm.tsx
2103
+ import { useAccount as useAccount4, useWriteContract, usePrepareTransactionRequest, usePublicClient } from "wagmi";
2104
+ import { encodeFunctionData as encodeFunctionData2 } from "viem";
2105
+ import { useMutation as useMutation4, useQuery as useQuery12 } from "@tanstack/react-query";
2106
+
2107
+ // src/onboarding/deposit/DepositForm.tsx
2108
+ import { useEffect as useEffect11, useRef as useRef4 } from "react";
2109
+ import { useAccount as useAccount3, useBalance as useBalance4, useWatchBlockNumber as useWatchBlockNumber2 } from "wagmi";
2110
+ import { useIsMounted } from "usehooks-ts";
2111
+ import { twMerge as twMerge15 } from "tailwind-merge";
2112
+
2113
+ // src/onboarding/deposit/ChainSelect.tsx
2114
+ import { useEffect as useEffect10, useMemo as useMemo2 } from "react";
2115
+ import { useSwitchChain } from "wagmi";
2116
+ import { twMerge as twMerge12 } from "tailwind-merge";
2117
+ import * as Select from "@radix-ui/react-select";
2118
+
2119
+ // src/icons/ChevronUpIcon.tsx
2120
+ import { jsx as jsx20 } from "react/jsx-runtime";
2121
+ function ChevronUpIcon(props) {
2122
+ return /* @__PURE__ */ jsx20(IconSVG, { viewBox: "0 0 20 20", ...props, children: /* @__PURE__ */ jsx20(
2123
+ "path",
2124
+ {
2125
+ d: "M14.7071 12.7071C14.3166 13.0976 13.6834 13.0976 13.2929 12.7071L10 9.41421L6.70711 12.7071C6.31658 13.0976 5.68342 13.0976 5.29289 12.7071C4.90237 12.3166 4.90237 11.6834 5.29289 11.2929L9.29289 7.29289C9.68342 6.90237 10.3166 6.90237 10.7071 7.29289L14.7071 11.2929C15.0976 11.6834 15.0976 12.3166 14.7071 12.7071Z",
2126
+ fillRule: "evenodd",
2127
+ clipRule: "evenodd"
1953
2128
  }
1954
- if (prerequisites.complete) {
1955
- if (isNewConnection || !initialPrerequisites.current.complete) {
1956
- closeAccountModal();
1957
- }
2129
+ ) });
2130
+ }
2131
+
2132
+ // src/icons/ChevronDownIcon.tsx
2133
+ import { jsx as jsx21 } from "react/jsx-runtime";
2134
+ function ChevronDownIcon(props) {
2135
+ return /* @__PURE__ */ jsx21(IconSVG, { viewBox: "0 0 20 20", ...props, children: /* @__PURE__ */ jsx21(
2136
+ "path",
2137
+ {
2138
+ d: "M5.29289 7.29289C5.68342 6.90237 6.31658 6.90237 6.70711 7.29289L10 10.5858L13.2929 7.29289C13.6834 6.90237 14.3166 6.90237 14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L10.7071 12.7071C10.3166 13.0976 9.68342 13.0976 9.29289 12.7071L5.29289 8.70711C4.90237 8.31658 4.90237 7.68342 5.29289 7.29289Z",
2139
+ fillRule: "evenodd",
2140
+ clipRule: "evenodd"
1958
2141
  }
1959
- }, [closeAccountModal, isNewConnection, prerequisites]);
1960
- const { sessionAddress, hasAllowance, isSpender, hasDelegation, hasGasBalance } = prerequisites ?? {};
1961
- const steps = useMemo2(() => {
1962
- if (!userAddress) {
1963
- return [
1964
- {
1965
- id: "wallet",
1966
- isComplete: false,
1967
- content: () => null
1968
- }
1969
- ];
2142
+ ) });
2143
+ }
2144
+
2145
+ // src/ui/Slot.tsx
2146
+ import { isValidElement, cloneElement, Children } from "react";
2147
+ import { twMerge as twMerge8 } from "tailwind-merge";
2148
+ function Slot({
2149
+ children,
2150
+ ...props
2151
+ }) {
2152
+ if (isValidElement(children)) {
2153
+ return cloneElement(children, {
2154
+ ...props,
2155
+ ...children.props,
2156
+ style: {
2157
+ ...props.style,
2158
+ ...children.props.style
2159
+ },
2160
+ className: twMerge8(props.className, children.props.className)
2161
+ });
2162
+ }
2163
+ if (Children.count(children) > 1) {
2164
+ Children.only(null);
2165
+ }
2166
+ return null;
2167
+ }
2168
+
2169
+ // src/ui/Input.tsx
2170
+ import { twMerge as twMerge9 } from "tailwind-merge";
2171
+ import { jsx as jsx22 } from "react/jsx-runtime";
2172
+ function Input({ asChild, className, ...props }) {
2173
+ const Child = asChild ? Slot : "input";
2174
+ return /* @__PURE__ */ jsx22(
2175
+ Child,
2176
+ {
2177
+ className: twMerge9(
2178
+ "p-2.5 gap-1 border text-lg font-medium transition",
2179
+ "outline-none ring-2 ring-transparent focus-within:ring-orange-500 focus-within:border-transparent",
2180
+ "bg-neutral-900 border-neutral-700 text-white placeholder:text-neutral-500",
2181
+ className
2182
+ ),
2183
+ ...props
1970
2184
  }
1971
- const steps2 = [
1972
- {
1973
- id: "wallet",
2185
+ );
2186
+ }
2187
+
2188
+ // src/onboarding/deposit/ChainIcon.tsx
2189
+ import { twMerge as twMerge11 } from "tailwind-merge";
2190
+
2191
+ // src/onboarding/deposit/PreloadedImage.tsx
2192
+ import { twMerge as twMerge10 } from "tailwind-merge";
2193
+ import { jsx as jsx23 } from "react/jsx-runtime";
2194
+ function PreloadedImage({ url, fallback: fallback2, className }) {
2195
+ const { isSuccess, isLoading } = usePreloadImage(url);
2196
+ return /* @__PURE__ */ jsx23("span", { className: twMerge10("inline-flex w-full h-full items-center justify-center overflow-clip", className), children: !isLoading ? isSuccess ? /* @__PURE__ */ jsx23("img", { src: url, className: "w-full h-full object-cover" }) : fallback2 : null });
2197
+ }
2198
+
2199
+ // src/onboarding/deposit/ChainIcon.tsx
2200
+ import { forwardRef as forwardRef2 } from "react";
2201
+ import { jsx as jsx24 } from "react/jsx-runtime";
2202
+ var ChainIcon = forwardRef2(function ChainIcon2({ name, url, className }, forwardedRef) {
2203
+ return /* @__PURE__ */ jsx24(
2204
+ "span",
2205
+ {
2206
+ ref: forwardedRef,
2207
+ className: twMerge11("flex-shrink-0 inline-flex w-6 aspect-square rounded-full overflow-clip", className),
2208
+ children: url ? /* @__PURE__ */ jsx24(PreloadedImage, { url }) : (
2209
+ // TODO: better placeholder
2210
+ /* @__PURE__ */ jsx24(
2211
+ "span",
2212
+ {
2213
+ className: twMerge11(
2214
+ "inline-flex items-center justify-center w-full h-full rounded-full",
2215
+ "border-2 border-dashed border-white/50 opacity-50"
2216
+ ),
2217
+ children: name?.slice(0, 1)
2218
+ }
2219
+ )
2220
+ )
2221
+ }
2222
+ );
2223
+ });
2224
+
2225
+ // src/onboarding/deposit/useRelay.ts
2226
+ import {
2227
+ MAINNET_RELAY_API,
2228
+ TESTNET_RELAY_API,
2229
+ fetchChainConfigs,
2230
+ createClient as createClient2,
2231
+ LogLevel
2232
+ } from "@reservoir0x/relay-sdk";
2233
+ import { useQuery as useQuery10 } from "@tanstack/react-query";
2234
+ function useRelay() {
2235
+ const { chain } = useEntryKitConfig();
2236
+ const appOrigin = location.host;
2237
+ const baseApiUrl = chain.testnet ? TESTNET_RELAY_API : MAINNET_RELAY_API;
2238
+ return useQuery10({
2239
+ queryKey: ["relayChains", baseApiUrl, appOrigin],
2240
+ queryFn: async () => {
2241
+ debug("fetching relay chains from", baseApiUrl);
2242
+ const chains = await fetchChainConfigs(baseApiUrl);
2243
+ debug("got relay chains", chains);
2244
+ const client = createClient2({
2245
+ baseApiUrl,
2246
+ source: appOrigin,
2247
+ chains,
2248
+ logLevel: LogLevel.Verbose
2249
+ });
2250
+ return { client, chains };
2251
+ },
2252
+ refetchOnMount: false,
2253
+ refetchOnReconnect: false,
2254
+ refetchOnWindowFocus: false,
2255
+ staleTime: Infinity
2256
+ });
2257
+ }
2258
+
2259
+ // src/onboarding/deposit/useChainBalances.ts
2260
+ import { useAccount, useConfig as useWagmiConfig } from "wagmi";
2261
+ import { getBalance as getBalance2 } from "wagmi/actions";
2262
+ import { useQuery as useQuery11, skipToken as skipToken6 } from "@tanstack/react-query";
2263
+ import { isNotNull } from "@latticexyz/common/utils";
2264
+ function useChainBalances({ chains }) {
2265
+ const { address: userAddress } = useAccount();
2266
+ const wagmiConfig = useWagmiConfig();
2267
+ const chainIds = chains.map((chain) => chain.id);
2268
+ return useQuery11({
2269
+ queryKey: ["chainBalances", chainIds, userAddress],
2270
+ queryFn: userAddress ? async () => {
2271
+ const chainBalances = await Promise.allSettled(
2272
+ chains.map(async (chain) => {
2273
+ const balance = await getBalance2(wagmiConfig, { chainId: chain.id, address: userAddress });
2274
+ return { chain, balance };
2275
+ })
2276
+ );
2277
+ return chainBalances.map((result) => result.status === "fulfilled" ? result.value : null).filter(isNotNull);
2278
+ } : skipToken6,
2279
+ refetchInterval: 1e3 * 60,
2280
+ retry: 1
2281
+ });
2282
+ }
2283
+
2284
+ // src/onboarding/deposit/ChainSelect.tsx
2285
+ import { Fragment as Fragment2, jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
2286
+ function ChainSelect({ value, onChange }) {
2287
+ const theme = useTheme();
2288
+ const { frame } = useFrame();
2289
+ const { chains, switchChain } = useSwitchChain();
2290
+ const relay = useRelay();
2291
+ const relayChains = relay.data?.chains;
2292
+ const sourceChains = useMemo2(() => {
2293
+ return chains.map((sourceChain) => {
2294
+ const relayChain = relayChains?.find((c) => c.id === sourceChain.id);
2295
+ return {
2296
+ ...sourceChain,
2297
+ relayChain
2298
+ };
2299
+ }).filter((c) => c.relayChain);
2300
+ }, [chains, relayChains]);
2301
+ const selectedChain = sourceChains.find((c) => c.id === value);
2302
+ const { data: chainsBalances, isLoading } = useShowQueryError(useChainBalances({ chains: sourceChains }));
2303
+ const renderedChains = useMemo2(() => {
2304
+ if (!chainsBalances) return [];
2305
+ const chainsWithBalance = chainsBalances.filter(({ balance }) => balance.value > 0n).map(({ chain, balance }) => ({ chain, balance: balance.value }));
2306
+ return chainsWithBalance.length > 0 ? chainsWithBalance : sourceChains.map((chain) => ({ chain, balance: 0n }));
2307
+ }, [chainsBalances, sourceChains]);
2308
+ useEffect10(() => {
2309
+ if (renderedChains.length > 0 && (!selectedChain || !renderedChains.find((c) => c.chain.id === selectedChain?.id))) {
2310
+ const defaultChain = renderedChains[0].chain;
2311
+ onChange(defaultChain.id);
2312
+ switchChain({ chainId: defaultChain.id });
2313
+ }
2314
+ }, [value, selectedChain, renderedChains, onChange, switchChain]);
2315
+ return /* @__PURE__ */ jsxs15(
2316
+ Select.Root,
2317
+ {
2318
+ value: value.toString(),
2319
+ onValueChange: (value2) => {
2320
+ if (value2) {
2321
+ const chain = renderedChains.find((item) => item.chain.id.toString() === value2)?.chain;
2322
+ if (!chain) throw new Error(`Unknown chain selected: ${value2}`);
2323
+ onChange(chain.id);
2324
+ }
2325
+ },
2326
+ children: [
2327
+ /* @__PURE__ */ jsx25(Input, { asChild: true, children: /* @__PURE__ */ jsxs15(Select.Trigger, { className: "group inline-flex items-center justify-center", children: [
2328
+ /* @__PURE__ */ jsx25(Select.Value, { asChild: true, children: /* @__PURE__ */ jsx25(
2329
+ ChainIcon,
2330
+ {
2331
+ id: selectedChain?.id,
2332
+ name: selectedChain?.name,
2333
+ url: selectedChain?.relayChain?.icon?.[theme],
2334
+ className: "w-8"
2335
+ }
2336
+ ) }),
2337
+ /* @__PURE__ */ jsx25(Select.Icon, { asChild: true, children: /* @__PURE__ */ jsxs15(Fragment2, { children: [
2338
+ /* @__PURE__ */ jsx25(ChevronDownIcon, { className: "text-sm -mr-1 group-aria-expanded:hidden" }),
2339
+ /* @__PURE__ */ jsx25(ChevronUpIcon, { className: "text-sm -mr-1 hidden group-aria-expanded:inline" })
2340
+ ] }) })
2341
+ ] }) }),
2342
+ frame.contentDocument ? /* @__PURE__ */ jsx25(Select.Portal, { container: frame.contentDocument.body, children: /* @__PURE__ */ jsx25(
2343
+ Select.Content,
2344
+ {
2345
+ position: "popper",
2346
+ className: "w-[352px] max-h-[230px] overflow-y-auto mt-1 animate-in fade-in slide-in-from-top-2",
2347
+ children: /* @__PURE__ */ jsx25(Select.Viewport, { children: /* @__PURE__ */ jsx25(
2348
+ Select.Group,
2349
+ {
2350
+ className: twMerge12(
2351
+ "flex flex-col border divide-y",
2352
+ "bg-neutral-800 text-neutral-300 border-neutral-700 divide-neutral-700"
2353
+ ),
2354
+ children: isLoading ? /* @__PURE__ */ jsx25("div", { className: "flex items-center justify-center p-4", children: /* @__PURE__ */ jsx25(PendingIcon, { className: "h-6 w-6 animate-spin text-gray-400" }) }) : renderedChains.map(({ chain, balance }) => {
2355
+ return /* @__PURE__ */ jsxs15(
2356
+ Select.Item,
2357
+ {
2358
+ value: chain.id.toString(),
2359
+ className: twMerge12(
2360
+ "group flex p-2.5 gap-2.5 items-center cursor-pointer outline-none",
2361
+ "text-white focus:bg-neutral-700 data-[state=checked]:bg-neutral-900"
2362
+ ),
2363
+ children: [
2364
+ /* @__PURE__ */ jsx25(ChainIcon, { id: chain.id, name: chain.name, url: chain.relayChain?.icon?.[theme] }),
2365
+ /* @__PURE__ */ jsx25("span", { className: "flex-grow flex-shrink-0", children: chain.name }),
2366
+ /* @__PURE__ */ jsx25("span", { className: "flex-shrink-0 font-mono text-sm text-neutral-400", children: /* @__PURE__ */ jsx25(Balance, { wei: balance }) })
2367
+ ]
2368
+ },
2369
+ chain.id
2370
+ );
2371
+ })
2372
+ }
2373
+ ) })
2374
+ }
2375
+ ) }) : null
2376
+ ]
2377
+ }
2378
+ );
2379
+ }
2380
+
2381
+ // src/onboarding/deposit/AmountInput.tsx
2382
+ import { formatEther as formatEther3, parseEther as parseEther5 } from "viem";
2383
+ import { twMerge as twMerge13 } from "tailwind-merge";
2384
+ import { forwardRef as forwardRef3 } from "react";
2385
+ import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
2386
+ var AmountInput = forwardRef3(function AmountInput2({ initialAmount, onChange }, forwardedRef) {
2387
+ return /* @__PURE__ */ jsx26(Input, { asChild: true, className: "w-full cursor-text flex items-center", children: /* @__PURE__ */ jsxs16("label", { children: [
2388
+ /* @__PURE__ */ jsx26(
2389
+ "input",
2390
+ {
2391
+ ref: forwardedRef,
2392
+ className: twMerge13("peer flex-grow outline-none bg-transparent", "placeholder:text-neutral-500"),
2393
+ placeholder: "0.005",
2394
+ required: true,
2395
+ autoFocus: true,
2396
+ defaultValue: initialAmount == null ? "" : formatEther3(initialAmount),
2397
+ onChange: (event) => {
2398
+ const input = event.currentTarget;
2399
+ if (input.value.trim() === "") {
2400
+ input.setCustomValidity("");
2401
+ onChange(void 0);
2402
+ return;
2403
+ }
2404
+ const value = input.value.trim().replace(/\.$/, ".0");
2405
+ if (!/^\d*(\.\d+)?$/.test(value)) {
2406
+ return input.setCustomValidity("Invalid amount.");
2407
+ }
2408
+ input.setCustomValidity("");
2409
+ onChange(parseEther5(value));
2410
+ }
2411
+ }
2412
+ ),
2413
+ /* @__PURE__ */ jsx26("span", { className: twMerge13("flex-shrink-0 text-2xl", "peer-placeholder-shown:text-neutral-500"), children: /* @__PURE__ */ jsx26(EthIcon, {}) })
2414
+ ] }) });
2415
+ });
2416
+
2417
+ // src/onboarding/deposit/SubmitButton.tsx
2418
+ import { useAccount as useAccount2, useBalance as useBalance3, useSwitchChain as useSwitchChain2 } from "wagmi";
2419
+ import { twMerge as twMerge14 } from "tailwind-merge";
2420
+ import { parseEther as parseEther6 } from "viem";
2421
+ import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
2422
+ var MAX_DEPOSIT_AMOUNT = "0.1";
2423
+ function SubmitButton({ amount, chainId, className, ...buttonProps }) {
2424
+ const { chainId: userChainId, address: userAddress } = useAccount2();
2425
+ const { data: userBalance } = useBalance3({ address: userAddress });
2426
+ const shouldSwitchChain = chainId != null && chainId !== userChainId;
2427
+ const switchChain = useSwitchChain2();
2428
+ if (shouldSwitchChain) {
2429
+ return /* @__PURE__ */ jsx27(
2430
+ Button,
2431
+ {
2432
+ type: "button",
2433
+ variant: "primary",
2434
+ className: twMerge14("w-full", className),
2435
+ pending: switchChain.isPending,
2436
+ onClick: () => switchChain.switchChain({ chainId }),
2437
+ children: "Switch chain"
2438
+ }
2439
+ );
2440
+ } else if (amount) {
2441
+ if (amount > parseEther6(MAX_DEPOSIT_AMOUNT)) {
2442
+ return /* @__PURE__ */ jsxs17(Button, { type: "button", className: twMerge14("w-full", className), disabled: true, children: [
2443
+ "Max amount is ",
2444
+ MAX_DEPOSIT_AMOUNT,
2445
+ " ETH"
2446
+ ] });
2447
+ } else if (amount > (userBalance?.value ?? 0n)) {
2448
+ return /* @__PURE__ */ jsx27(Button, { type: "button", className: twMerge14("w-full", className), disabled: true, children: "Insufficient balance" });
2449
+ }
2450
+ }
2451
+ return /* @__PURE__ */ jsx27(Button, { type: "submit", className: twMerge14("w-full", className), ...buttonProps });
2452
+ }
2453
+
2454
+ // src/icons/WarningIcon.tsx
2455
+ import { jsx as jsx28 } from "react/jsx-runtime";
2456
+ function WarningIcon(props) {
2457
+ return /* @__PURE__ */ jsx28(IconSVG, { fill: "none", ...props, children: /* @__PURE__ */ jsx28(
2458
+ "path",
2459
+ {
2460
+ d: "M12 9V11M12 15H12.01M5.07183 19H18.9282C20.4678 19 21.4301 17.3333 20.6603 16L13.7321 4C12.9623 2.66667 11.0378 2.66667 10.268 4L3.33978 16C2.56998 17.3333 3.53223 19 5.07183 19Z",
2461
+ stroke: "currentColor",
2462
+ strokeWidth: "2",
2463
+ strokeLinecap: "round",
2464
+ strokeLinejoin: "round"
2465
+ }
2466
+ ) });
2467
+ }
2468
+
2469
+ // src/formatGas.ts
2470
+ import { formatGwei } from "viem";
2471
+ function formatGas(wei) {
2472
+ const formatted = formatGwei(wei);
2473
+ const magnitude = Math.floor(parseFloat(formatted)).toString().length;
2474
+ return parseFloat(formatted).toLocaleString("en-US", { maximumFractionDigits: Math.max(0, 6 - magnitude) });
2475
+ }
2476
+
2477
+ // src/onboarding/deposit/DepositForm.tsx
2478
+ import { Fragment as Fragment3, jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
2479
+ function DepositForm({
2480
+ sourceChain,
2481
+ setSourceChainId,
2482
+ amount,
2483
+ setAmount,
2484
+ estimatedFee,
2485
+ estimatedTime,
2486
+ onSubmit,
2487
+ submitButton
2488
+ }) {
2489
+ const amountInputRef = useRef4(null);
2490
+ const isMounted = useIsMounted();
2491
+ const { address: userAddress, chainId: userChainId } = useAccount3();
2492
+ const balance = useShowQueryError(useBalance4({ chainId: sourceChain.id, address: userAddress }));
2493
+ const quarryBalance = useShowQueryError(useBalance(userAddress));
2494
+ useWatchBlockNumber2({
2495
+ onBlockNumber: () => {
2496
+ balance.refetch();
2497
+ quarryBalance.refetch();
2498
+ }
2499
+ });
2500
+ const minimumBalance = amount != null ? amount + (estimatedFee?.fee ?? 0n) : void 0;
2501
+ const hasMinimumBalance = balance.data != null ? balance.data.value > (minimumBalance ?? 0n) : void 0;
2502
+ useEffect11(() => {
2503
+ amountInputRef.current?.focus();
2504
+ }, [userChainId]);
2505
+ return /* @__PURE__ */ jsxs18(
2506
+ "form",
2507
+ {
2508
+ className: "flex flex-col gap-5",
2509
+ onSubmit: async (event) => {
2510
+ event.preventDefault();
2511
+ try {
2512
+ await onSubmit();
2513
+ if (isMounted()) {
2514
+ setAmount(void 0);
2515
+ if (amountInputRef.current) {
2516
+ amountInputRef.current.value = "";
2517
+ }
2518
+ }
2519
+ } catch (error2) {
2520
+ console.error("Error during deposit", error2);
2521
+ } finally {
2522
+ amountInputRef.current?.focus();
2523
+ }
2524
+ },
2525
+ children: [
2526
+ /* @__PURE__ */ jsxs18("div", { className: "flex gap-2", children: [
2527
+ /* @__PURE__ */ jsx29(ChainSelect, { value: sourceChain.id, onChange: setSourceChainId }),
2528
+ /* @__PURE__ */ jsx29(AmountInput, { ref: amountInputRef, initialAmount: amount, onChange: setAmount })
2529
+ ] }),
2530
+ /* @__PURE__ */ jsxs18(
2531
+ "dl",
2532
+ {
2533
+ className: twMerge15(
2534
+ "grid grid-cols-2 divide-y text-sm leading-loose [&_>_:is(dt,dd)]:px-1 [&_>_dd]:text-right",
2535
+ "divide-neutral-700 text-neutral-400"
2536
+ ),
2537
+ children: [
2538
+ /* @__PURE__ */ jsx29("dt", { children: "Available to deposit" }),
2539
+ /* @__PURE__ */ jsx29("dd", { children: balance.isSuccess ? /* @__PURE__ */ jsx29(Balance, { wei: balance.data.value }) : balance.isError ? /* @__PURE__ */ jsx29("span", { title: String(balance.error), children: /* @__PURE__ */ jsx29(WarningIcon, { className: "inline-block text-amber-500" }) }) : balance.isLoading ? /* @__PURE__ */ jsx29(PendingIcon, { className: "inline-block text-xs" }) : null }),
2540
+ /* @__PURE__ */ jsx29("dt", { children: "Gas balance after deposit" }),
2541
+ /* @__PURE__ */ jsx29("dd", { children: /* @__PURE__ */ jsx29(Balance, { wei: (quarryBalance.data ?? 0n) + (amount ?? 0n) }) }),
2542
+ /* @__PURE__ */ jsx29("dt", { children: "Estimated fee" }),
2543
+ /* @__PURE__ */ jsx29("dd", { children: estimatedFee.fee ? /* @__PURE__ */ jsxs18(Fragment3, { children: [
2544
+ formatGas(estimatedFee.fee),
2545
+ " gwei"
2546
+ ] }) : estimatedFee.error ? /* @__PURE__ */ jsx29("span", { title: String(estimatedFee.error), children: /* @__PURE__ */ jsx29(WarningIcon, { className: "inline-block text-amber-500" }) }) : estimatedFee.isLoading ? /* @__PURE__ */ jsx29(PendingIcon, { className: "inline-block text-xs" }) : null }),
2547
+ /* @__PURE__ */ jsx29("dt", { children: "Time to deposit" }),
2548
+ /* @__PURE__ */ jsx29("dd", { children: estimatedTime })
2549
+ ]
2550
+ }
2551
+ ),
2552
+ hasMinimumBalance ? submitButton : /* @__PURE__ */ jsx29(SubmitButton, { disabled: true, children: "Not enough funds" })
2553
+ ]
2554
+ }
2555
+ );
2556
+ }
2557
+
2558
+ // src/onboarding/deposit/useDeposits.ts
2559
+ import { createStore as createStore4 } from "zustand/vanilla";
2560
+ import { useStore as useStore2 } from "zustand";
2561
+ import { useCallback as useCallback2, useMemo as useMemo3 } from "react";
2562
+ var store4 = createStore4(() => ({
2563
+ count: 0,
2564
+ deposits: []
2565
+ }));
2566
+ function useDeposits() {
2567
+ const deposits = useStore2(store4, (state) => state.deposits);
2568
+ const addDeposit = useCallback2((transaction) => {
2569
+ store4.setState((state) => {
2570
+ if (transaction.type === "relay") {
2571
+ const existingDeposit = state.deposits.find(
2572
+ (deposit) => deposit.type === "relay" && deposit.requestId === transaction.requestId
2573
+ );
2574
+ if (existingDeposit) {
2575
+ return state;
2576
+ }
2577
+ }
2578
+ return {
2579
+ count: state.count + 1,
2580
+ deposits: [
2581
+ ...state.deposits,
2582
+ {
2583
+ ...transaction,
2584
+ uid: `deposit-${state.count}`
2585
+ }
2586
+ ]
2587
+ };
2588
+ });
2589
+ }, []);
2590
+ const removeDeposit = useCallback2((uid) => {
2591
+ store4.setState((state) => ({
2592
+ deposits: state.deposits.filter((deposit) => deposit.uid !== uid)
2593
+ }));
2594
+ }, []);
2595
+ return useMemo3(
2596
+ () => ({
2597
+ deposits,
2598
+ addDeposit,
2599
+ removeDeposit
2600
+ }),
2601
+ [addDeposit, deposits, removeDeposit]
2602
+ );
2603
+ }
2604
+
2605
+ // src/onboarding/deposit/DepositViaTransferForm.tsx
2606
+ import { jsx as jsx30 } from "react/jsx-runtime";
2607
+ function DepositViaTransferForm({ amount, setAmount, sourceChain, setSourceChainId }) {
2608
+ const { chain } = useEntryKitConfig();
2609
+ const paymaster = getPaymaster(chain);
2610
+ const publicClient = usePublicClient();
2611
+ const { address: userAddress } = useAccount4();
2612
+ const { writeContractAsync } = useWriteContract();
2613
+ const { addDeposit } = useDeposits();
2614
+ if (!userAddress) {
2615
+ throw new Error("User address not found");
2616
+ }
2617
+ const { data: gasPrice } = useQuery12({
2618
+ queryKey: ["gasPrice", sourceChain.id],
2619
+ queryFn: async () => {
2620
+ if (!publicClient) throw new Error("Public client not available");
2621
+ return publicClient.getGasPrice();
2622
+ },
2623
+ refetchInterval: 15e3,
2624
+ enabled: !!publicClient
2625
+ });
2626
+ const { data: prepareData, error: prepareError } = usePrepareTransactionRequest({
2627
+ to: paymaster?.address,
2628
+ data: encodeFunctionData2({
2629
+ abi: paymasterAbi,
2630
+ functionName: "depositTo",
2631
+ args: [userAddress]
2632
+ }),
2633
+ value: amount
2634
+ });
2635
+ const deposit = useMutation4({
2636
+ mutationKey: ["depositViaTransfer", amount?.toString()],
2637
+ mutationFn: async () => {
2638
+ if (!paymaster) throw new Error("Paymaster not found");
2639
+ if (!publicClient) throw new Error("Public client not found");
2640
+ if (!amount) throw new Error("Amount cannot be 0");
2641
+ try {
2642
+ const hash = await writeContractAsync({
2643
+ address: paymaster.address,
2644
+ abi: paymasterAbi,
2645
+ functionName: "depositTo",
2646
+ args: [userAddress],
2647
+ value: amount
2648
+ });
2649
+ const receipt = publicClient.waitForTransactionReceipt({ hash }).then((receipt2) => {
2650
+ if (receipt2.status === "reverted") {
2651
+ throw new Error("Transfer transaction reverted.");
2652
+ }
2653
+ return receipt2;
2654
+ });
2655
+ const pendingDeposit = {
2656
+ type: "transfer",
2657
+ amount,
2658
+ chainL1Id: sourceChain.id,
2659
+ chainL2Id: chain.id,
2660
+ hash,
2661
+ receipt,
2662
+ start: /* @__PURE__ */ new Date(),
2663
+ estimatedTime: 1e3 * 12,
2664
+ isComplete: receipt.then(() => void 0)
2665
+ };
2666
+ addDeposit(pendingDeposit);
2667
+ } catch (error2) {
2668
+ console.error("Error while depositing via bridge", error2);
2669
+ throw error2;
2670
+ }
2671
+ }
2672
+ });
2673
+ const estimatedFee = prepareData?.gas && gasPrice ? prepareData.gas * gasPrice : void 0;
2674
+ return /* @__PURE__ */ jsx30(
2675
+ DepositForm,
2676
+ {
2677
+ sourceChain,
2678
+ setSourceChainId,
2679
+ amount,
2680
+ setAmount,
2681
+ estimatedFee: {
2682
+ fee: estimatedFee,
2683
+ isLoading: !prepareData && !prepareError || !gasPrice,
2684
+ error: prepareError instanceof Error ? prepareError : void 0
2685
+ },
2686
+ estimatedTime: "A few seconds",
2687
+ onSubmit: async () => {
2688
+ await deposit.mutateAsync();
2689
+ },
2690
+ submitButton: /* @__PURE__ */ jsx30(
2691
+ SubmitButton,
2692
+ {
2693
+ variant: "primary",
2694
+ amount,
2695
+ chainId: sourceChain.id,
2696
+ disabled: !!prepareError || !amount || !userAddress,
2697
+ pending: deposit.isPending,
2698
+ children: "Deposit"
2699
+ }
2700
+ )
2701
+ }
2702
+ );
2703
+ }
2704
+
2705
+ // src/onboarding/deposit/DepositViaRelayForm.tsx
2706
+ import { encodeFunctionData as encodeFunctionData3 } from "viem";
2707
+ import { useAccount as useAccount5, useWalletClient } from "wagmi";
2708
+ import { useMutation as useMutation5, useQuery as useQuery13 } from "@tanstack/react-query";
2709
+ import { jsx as jsx31 } from "react/jsx-runtime";
2710
+ var ETH_ADDRESS = "0x0000000000000000000000000000000000000000";
2711
+ function DepositViaRelayForm({ amount, setAmount, sourceChain, setSourceChainId }) {
2712
+ const { chain, chainId: destinationChainId } = useEntryKitConfig();
2713
+ const paymaster = getPaymaster(chain);
2714
+ const { data: wallet } = useWalletClient();
2715
+ const { address: userAddress } = useAccount5();
2716
+ const { addDeposit } = useDeposits();
2717
+ const { data: relay } = useRelay();
2718
+ const relayClient = relay?.client;
2719
+ const quote = useQuery13({
2720
+ queryKey: ["relayBridgeQuote", sourceChain.id, amount?.toString()],
2721
+ queryFn: async () => {
2722
+ if (!relayClient) throw new Error("No Relay client found.");
2723
+ if (!userAddress) throw new Error("No user address found.");
2724
+ const result = await relayClient.actions.getQuote({
2725
+ chainId: sourceChain.id,
2726
+ toChainId: destinationChainId,
2727
+ currency: ETH_ADDRESS,
2728
+ toCurrency: ETH_ADDRESS,
2729
+ amount: amount?.toString(),
2730
+ tradeType: "EXACT_OUTPUT",
2731
+ recipient: paymaster?.address,
2732
+ wallet,
2733
+ txs: [
2734
+ {
2735
+ to: paymaster?.address,
2736
+ data: encodeFunctionData3({
2737
+ abi: paymasterAbi,
2738
+ functionName: "depositTo",
2739
+ args: [userAddress]
2740
+ }),
2741
+ value: amount?.toString()
2742
+ }
2743
+ ]
2744
+ });
2745
+ if (!result) {
2746
+ throw new Error("Failed to get relay quote");
2747
+ }
2748
+ return result;
2749
+ },
2750
+ retry: 1,
2751
+ refetchInterval: 15e3,
2752
+ enabled: !!amount && !!userAddress && !!relayClient
2753
+ });
2754
+ const deposit = useMutation5({
2755
+ mutationKey: ["depositViaRelay", sourceChain.id, amount?.toString()],
2756
+ mutationFn: async ({ quote: quote2, amount: amount2 }) => {
2757
+ if (!relayClient) throw new Error("No Relay client found.");
2758
+ if (!wallet) throw new Error("No wallet found.");
2759
+ try {
2760
+ return new Promise((resolve) => {
2761
+ const pendingDeposit = relayClient.actions.execute({
2762
+ quote: quote2,
2763
+ wallet,
2764
+ onProgress(progress) {
2765
+ const currentStep = progress.currentStep;
2766
+ const requestId = currentStep?.requestId;
2767
+ const currentState = currentStep?.items[0]?.progressState;
2768
+ if (requestId && currentState === "validating") {
2769
+ addDeposit({
2770
+ type: "relay",
2771
+ requestId,
2772
+ amount: amount2,
2773
+ chainL1Id: sourceChain.id,
2774
+ chainL2Id: destinationChainId,
2775
+ start: /* @__PURE__ */ new Date(),
2776
+ estimatedTime: 1e3 * 30,
2777
+ depositPromise: pendingDeposit,
2778
+ isComplete: pendingDeposit.then(() => void 0)
2779
+ });
2780
+ resolve(void 0);
2781
+ }
2782
+ }
2783
+ });
2784
+ });
2785
+ } catch (error2) {
2786
+ console.error("Error while depositing via Relay", error2);
2787
+ throw error2;
2788
+ }
2789
+ }
2790
+ });
2791
+ const fees = quote.data?.fees;
2792
+ const gasFee = BigInt(fees?.gas?.amount ?? 0);
2793
+ const relayerFee = BigInt(fees?.relayer?.amount ?? 0);
2794
+ const fee = gasFee + relayerFee;
2795
+ return /* @__PURE__ */ jsx31(
2796
+ DepositForm,
2797
+ {
2798
+ sourceChain,
2799
+ setSourceChainId,
2800
+ amount,
2801
+ setAmount,
2802
+ estimatedFee: {
2803
+ fee: fee != null ? BigInt(fee) : void 0,
2804
+ isLoading: quote.isLoading,
2805
+ error: quote.error instanceof Error ? quote.error : void 0
2806
+ },
2807
+ estimatedTime: "A few seconds",
2808
+ onSubmit: async () => {
2809
+ if (!quote.data || !amount) return;
2810
+ await deposit.mutateAsync({ quote: quote.data, amount });
2811
+ },
2812
+ submitButton: /* @__PURE__ */ jsx31(
2813
+ SubmitButton,
2814
+ {
2815
+ variant: "primary",
2816
+ amount,
2817
+ chainId: sourceChain.id,
2818
+ disabled: quote.isError || !amount,
2819
+ pending: deposit.isPending,
2820
+ children: "Deposit"
2821
+ }
2822
+ )
2823
+ }
2824
+ );
2825
+ }
2826
+
2827
+ // src/onboarding/deposit/Deposits.tsx
2828
+ import { useEffect as useEffect13 } from "react";
2829
+ import { useQuery as useQuery16, useQueryClient as useQueryClient7 } from "@tanstack/react-query";
2830
+
2831
+ // src/onboarding/deposit/TransferDepositStatus.tsx
2832
+ import { useQuery as useQuery14 } from "@tanstack/react-query";
2833
+
2834
+ // src/onboarding/deposit/DepositStatus.tsx
2835
+ import { useEffect as useEffect12, useState as useState3 } from "react";
2836
+ import { twMerge as twMerge16 } from "tailwind-merge";
2837
+
2838
+ // src/icons/CloseIcon.tsx
2839
+ import { jsx as jsx32 } from "react/jsx-runtime";
2840
+ function CloseIcon(props) {
2841
+ return /* @__PURE__ */ jsx32(IconSVG, { strokeWidth: "2", stroke: "currentColor", ...props, children: /* @__PURE__ */ jsx32(
2842
+ "path",
2843
+ {
2844
+ d: "M6 18L18 6M6 6L18 18",
2845
+ fill: "none",
2846
+ stroke: "currentColor",
2847
+ strokeWidth: "2",
2848
+ strokeLinecap: "round",
2849
+ strokeLinejoin: "round"
2850
+ }
2851
+ ) });
2852
+ }
2853
+
2854
+ // src/onboarding/deposit/DepositStatus.tsx
2855
+ import { jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
2856
+ function DepositStatus({ status, progress, children, onDismiss }) {
2857
+ const [appear, setAppear] = useState3(false);
2858
+ useEffect12(() => {
2859
+ setAppear(true);
2860
+ }, []);
2861
+ return /* @__PURE__ */ jsxs19("div", { className: "group bg-neutral-900 flex flex-col animate-in fade-in slide-in-from-bottom-2 animate-out fade-out", children: [
2862
+ /* @__PURE__ */ jsxs19("div", { className: "py-1 text-sm flex items-center gap-2", children: [
2863
+ /* @__PURE__ */ jsx33("div", { className: "flex-grow", children }),
2864
+ /* @__PURE__ */ jsxs19("div", { className: "flex-shrink-0 grid", children: [
2865
+ /* @__PURE__ */ jsx33("span", { className: "col-start-1 row-start-1 transition opacity-100 group-hover:opacity-0 group-hover:pointer-events-none", children: status === "success" ? /* @__PURE__ */ jsx33(CheckIcon, { className: "text-green-600" }) : status === "error" ? /* @__PURE__ */ jsx33(WarningIcon, { className: "text-amber-500" }) : /* @__PURE__ */ jsx33(PendingIcon, { className: "text-neutral-500 transition" }) }),
2866
+ /* @__PURE__ */ jsx33(
2867
+ "button",
2868
+ {
2869
+ type: "button",
2870
+ className: twMerge16(
2871
+ "col-start-1 row-start-1 flex items-center justify-center transition",
2872
+ "opacity-0 pointer-events-none",
2873
+ "group-hover:opacity-100 group-hover:pointer-events-auto",
2874
+ "text-neutral-500 hover:text-white"
2875
+ ),
2876
+ title: "Dismiss",
2877
+ onClick: onDismiss,
2878
+ children: /* @__PURE__ */ jsx33(CloseIcon, {})
2879
+ }
2880
+ )
2881
+ ] })
2882
+ ] }),
2883
+ /* @__PURE__ */ jsx33("div", { className: "w-full h-[2px] -mt-full overflow-clip", children: /* @__PURE__ */ jsx33(
2884
+ "div",
2885
+ {
2886
+ className: twMerge16(
2887
+ "w-full h-full transition ease-linear",
2888
+ status === "success" ? "bg-green-600" : status === "error" ? "bg-red-600" : "bg-blue-600",
2889
+ status === "pending" ? "opacity-100" : "opacity-0"
2890
+ ),
2891
+ style: status === "pending" ? {
2892
+ transform: appear ? `translateX(0)` : "translate(-100%)",
2893
+ transitionDuration: `${progress.duration}ms`,
2894
+ transitionDelay: `-${Math.min(progress.duration, progress.elapsed)}ms`
2895
+ } : void 0
2896
+ }
2897
+ ) })
2898
+ ] });
2899
+ }
2900
+
2901
+ // src/onboarding/deposit/TransferDepositStatus.tsx
2902
+ import { useChains as useChains2 } from "wagmi";
2903
+ import { Fragment as Fragment4, jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
2904
+ function TransferDepositStatus({
2905
+ amount,
2906
+ chainL1Id,
2907
+ hash,
2908
+ receipt: receiptPromise,
2909
+ start,
2910
+ estimatedTime,
2911
+ onDismiss
2912
+ }) {
2913
+ const chains = useChains2();
2914
+ const chain = chains.find((chain2) => chain2.id === chainL1Id);
2915
+ const receipt = useQuery14({
2916
+ queryKey: ["transferDepositStatus", hash],
2917
+ queryFn: () => receiptPromise
2918
+ });
2919
+ return /* @__PURE__ */ jsx34(
2920
+ DepositStatus,
2921
+ {
2922
+ status: receipt.status,
2923
+ progress: {
2924
+ duration: estimatedTime,
2925
+ elapsed: Math.min(estimatedTime, Date.now() - start.getTime())
2926
+ },
2927
+ onDismiss,
2928
+ children: (() => {
2929
+ const blockExplorer = chain.blockExplorers?.default.url;
2930
+ if (receipt.status === "pending") {
2931
+ return /* @__PURE__ */ jsxs20(Fragment4, { children: [
2932
+ "Confirming deposit on",
2933
+ " ",
2934
+ /* @__PURE__ */ jsx34(
2935
+ "a",
2936
+ {
2937
+ href: blockExplorer ? `${blockExplorer}/tx/${hash}` : void 0,
2938
+ target: "_blank",
2939
+ rel: "noreferrer noopener",
2940
+ children: chain.name
2941
+ }
2942
+ ),
2943
+ "\u2026"
2944
+ ] });
2945
+ }
2946
+ if (receipt.status === "error") {
2947
+ return /* @__PURE__ */ jsxs20(Fragment4, { children: [
2948
+ "Could not find deposit on",
2949
+ " ",
2950
+ /* @__PURE__ */ jsx34(
2951
+ "a",
2952
+ {
2953
+ href: blockExplorer ? `${blockExplorer}/tx/${hash}` : void 0,
2954
+ target: "_blank",
2955
+ rel: "noreferrer noopener",
2956
+ children: chain.name
2957
+ }
2958
+ ),
2959
+ "."
2960
+ ] });
2961
+ }
2962
+ return /* @__PURE__ */ jsxs20(Fragment4, { children: [
2963
+ "Successfully",
2964
+ " ",
2965
+ /* @__PURE__ */ jsx34(
2966
+ "a",
2967
+ {
2968
+ href: blockExplorer ? `${blockExplorer}/tx/${receipt.data.transactionHash}` : void 0,
2969
+ target: "_blank",
2970
+ rel: "noreferrer noopener",
2971
+ children: "deposited"
2972
+ }
2973
+ ),
2974
+ " ",
2975
+ /* @__PURE__ */ jsx34(Balance, { wei: amount })
2976
+ ] });
2977
+ })()
2978
+ }
2979
+ );
2980
+ }
2981
+
2982
+ // src/onboarding/deposit/RelayDepositStatus.tsx
2983
+ import { useQuery as useQuery15 } from "@tanstack/react-query";
2984
+ import { useChains as useChains3 } from "wagmi";
2985
+ import { Fragment as Fragment5, jsx as jsx35, jsxs as jsxs21 } from "react/jsx-runtime";
2986
+ function RelayDepositStatus({
2987
+ amount,
2988
+ chainL1Id,
2989
+ chainL2Id,
2990
+ start,
2991
+ estimatedTime,
2992
+ depositPromise,
2993
+ onDismiss
2994
+ }) {
2995
+ const chains = useChains3();
2996
+ const chainL1 = chains.find((chain) => chain.id === chainL1Id);
2997
+ const chainL2 = chains.find((chain) => chain.id === chainL2Id);
2998
+ const deposit = useQuery15({
2999
+ queryKey: ["relayDepositPromise", chainL1Id, chainL2Id, amount.toString(), start.toISOString()],
3000
+ queryFn: () => depositPromise
3001
+ });
3002
+ return /* @__PURE__ */ jsx35(
3003
+ DepositStatus,
3004
+ {
3005
+ status: deposit.status,
3006
+ progress: {
3007
+ duration: estimatedTime,
3008
+ elapsed: Math.min(estimatedTime, Date.now() - start.getTime())
3009
+ },
3010
+ onDismiss,
3011
+ children: (() => {
3012
+ if (deposit.status === "pending") {
3013
+ return /* @__PURE__ */ jsxs21(Fragment5, { children: [
3014
+ "Relay bridge deposit pending on ",
3015
+ chainL1.name,
3016
+ "\u2026"
3017
+ ] });
3018
+ }
3019
+ if (deposit.status === "error") {
3020
+ return /* @__PURE__ */ jsxs21(Fragment5, { children: [
3021
+ "Relay bridge deposit to ",
3022
+ chainL2.name,
3023
+ " failed."
3024
+ ] });
3025
+ }
3026
+ return /* @__PURE__ */ jsxs21(Fragment5, { children: [
3027
+ "Successfully bridged ",
3028
+ /* @__PURE__ */ jsx35(Balance, { wei: amount }),
3029
+ " to ",
3030
+ chainL2.name,
3031
+ "!"
3032
+ ] });
3033
+ })()
3034
+ }
3035
+ );
3036
+ }
3037
+
3038
+ // src/onboarding/deposit/Deposits.tsx
3039
+ import { useAccount as useAccount6, useClient as useClient11 } from "wagmi";
3040
+ import { jsx as jsx36 } from "react/jsx-runtime";
3041
+ function Deposits() {
3042
+ const queryClient = useQueryClient7();
3043
+ const { chainId } = useEntryKitConfig();
3044
+ const client = useClient11({ chainId });
3045
+ const { address: userAddress } = useAccount6();
3046
+ const { deposits, removeDeposit } = useDeposits();
3047
+ const { data: isComplete } = useQuery16({
3048
+ queryKey: ["depositsComplete", deposits.map((deposit) => deposit.uid)],
3049
+ queryFn: async () => {
3050
+ if (!deposits.length) return false;
3051
+ await Promise.all(deposits.map((deposit) => deposit.isComplete));
3052
+ return true;
3053
+ }
3054
+ });
3055
+ useEffect13(() => {
3056
+ if (isComplete) {
3057
+ queryClient.invalidateQueries({ queryKey: ["balance"] });
3058
+ queryClient.invalidateQueries({ queryKey: ["getBalance", client?.uid, userAddress] });
3059
+ }
3060
+ }, [client?.uid, isComplete, queryClient, userAddress]);
3061
+ if (!deposits.length) return null;
3062
+ return /* @__PURE__ */ jsx36("div", { className: "flex flex-col gap-1 mt-4", children: deposits.map((deposit) => {
3063
+ if (deposit.type === "transfer") {
3064
+ return /* @__PURE__ */ jsx36(TransferDepositStatus, { ...deposit, onDismiss: () => removeDeposit(deposit.uid) }, deposit.uid);
3065
+ } else if (deposit.type === "relay") {
3066
+ return /* @__PURE__ */ jsx36(RelayDepositStatus, { ...deposit, onDismiss: () => removeDeposit(deposit.uid) }, deposit.uid);
3067
+ }
3068
+ }) });
3069
+ }
3070
+
3071
+ // src/onboarding/deposit/DepositFormContainer.tsx
3072
+ import { jsx as jsx37, jsxs as jsxs22 } from "react/jsx-runtime";
3073
+ function DepositFormContainer() {
3074
+ const { chainId: destinationChainId } = useEntryKitConfig();
3075
+ const chainId = useChainId();
3076
+ const chains = useChains4();
3077
+ const [amount, setAmount] = useState4(void 0);
3078
+ const [sourceChainId, setSourceChainId] = useState4(chainId);
3079
+ const sourceChain = chains.find(({ id }) => id === sourceChainId);
3080
+ return /* @__PURE__ */ jsxs22("div", { className: "pt-10 pb-2", children: [
3081
+ destinationChainId === sourceChainId ? /* @__PURE__ */ jsx37(
3082
+ DepositViaTransferForm,
3083
+ {
3084
+ amount,
3085
+ setAmount,
3086
+ sourceChain,
3087
+ setSourceChainId
3088
+ }
3089
+ ) : /* @__PURE__ */ jsx37(
3090
+ DepositViaRelayForm,
3091
+ {
3092
+ amount,
3093
+ setAmount,
3094
+ sourceChain,
3095
+ setSourceChainId
3096
+ }
3097
+ ),
3098
+ /* @__PURE__ */ jsx37(Deposits, {})
3099
+ ] });
3100
+ }
3101
+
3102
+ // src/icons/ArrowLeftIcon.tsx
3103
+ import { jsx as jsx38 } from "react/jsx-runtime";
3104
+ function ArrowLeftIcon(props) {
3105
+ return /* @__PURE__ */ jsx38(IconSVG, { ...props, children: /* @__PURE__ */ jsx38(
3106
+ "path",
3107
+ {
3108
+ d: "M19 12H5M12 19l-7-7 7-7",
3109
+ fill: "none",
3110
+ stroke: "currentColor",
3111
+ strokeWidth: "2",
3112
+ strokeLinecap: "round",
3113
+ strokeLinejoin: "round"
3114
+ }
3115
+ ) });
3116
+ }
3117
+
3118
+ // src/onboarding/quarry/WithdrawGasBalanceButton.tsx
3119
+ import { getAction as getAction6 } from "viem/utils";
3120
+ import { waitForTransactionReceipt as waitForTransactionReceipt3 } from "viem/actions";
3121
+ import { useAccount as useAccount7, useClient as useClient12, useSwitchChain as useSwitchChain3, useWriteContract as useWriteContract2 } from "wagmi";
3122
+ import { twMerge as twMerge17 } from "tailwind-merge";
3123
+ import { useMutation as useMutation6 } from "@tanstack/react-query";
3124
+ import { useQueryClient as useQueryClient8 } from "@tanstack/react-query";
3125
+ import { jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
3126
+ function WithdrawGasBalanceButton({ userAddress }) {
3127
+ const { writeContractAsync } = useWriteContract2();
3128
+ const { switchChain } = useSwitchChain3();
3129
+ const { chain, chainId } = useEntryKitConfig();
3130
+ const { chainId: userChainId } = useAccount7();
3131
+ const queryClient = useQueryClient8();
3132
+ const client = useClient12({ chainId });
3133
+ const paymaster = getPaymaster(chain);
3134
+ const balance = useShowQueryError(useBalance(userAddress));
3135
+ const shouldSwitchChain = chainId != null && chainId !== userChainId;
3136
+ const withdraw = useMutation6({
3137
+ mutationKey: ["withdraw", userAddress],
3138
+ mutationFn: async () => {
3139
+ if (!client) throw new Error("Client not ready.");
3140
+ if (!paymaster) throw new Error("Paymaster not found");
3141
+ if (!balance.data) throw new Error("No gas balance to withdraw.");
3142
+ try {
3143
+ const hash = await writeContractAsync({
3144
+ address: paymaster.address,
3145
+ abi: paymasterAbi,
3146
+ functionName: "withdrawTo",
3147
+ args: [userAddress, balance.data],
3148
+ chainId
3149
+ });
3150
+ await getAction6(client, waitForTransactionReceipt3, "waitForTransactionReceipt")({ hash });
3151
+ await Promise.all([
3152
+ queryClient.invalidateQueries({ queryKey: ["balance"] }),
3153
+ queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] })
3154
+ ]);
3155
+ } catch (error2) {
3156
+ console.error("Error while withdrawing", error2);
3157
+ throw error2;
3158
+ }
3159
+ }
3160
+ });
3161
+ if (balance.data == null || balance.data === 0n) {
3162
+ return null;
3163
+ }
3164
+ return /* @__PURE__ */ jsx39(
3165
+ "button",
3166
+ {
3167
+ onClick: () => {
3168
+ if (shouldSwitchChain) {
3169
+ return switchChain({ chainId });
3170
+ }
3171
+ withdraw.mutate();
3172
+ },
3173
+ className: twMerge17(
3174
+ "text-sm font-medium text-white/50 group whitespace-nowrap",
3175
+ withdraw.isPending ? "opacity-50 pointer-events-none" : "cursor-pointer hover:text-white"
3176
+ ),
3177
+ disabled: withdraw.isPending,
3178
+ children: /* @__PURE__ */ jsxs23("span", { className: "inline-block", children: [
3179
+ /* @__PURE__ */ jsxs23(
3180
+ "span",
3181
+ {
3182
+ className: twMerge17(
3183
+ "inline-flex items-center gap-1 underline decoration-neutral-500 underline-offset-4",
3184
+ !withdraw.isPending && "hover:decoration-orange-500",
3185
+ shouldSwitchChain && "group-hover:hidden"
3186
+ ),
3187
+ children: [
3188
+ withdraw.isPending && /* @__PURE__ */ jsx39(PendingIcon, { className: "w-3 h-3" }),
3189
+ "Withdraw"
3190
+ ]
3191
+ }
3192
+ ),
3193
+ shouldSwitchChain && /* @__PURE__ */ jsx39("span", { className: "hidden group-hover:inline-block underline decoration-neutral-500 underline-offset-4 hover:decoration-orange-500", children: "Switch chain" })
3194
+ ] })
3195
+ }
3196
+ );
3197
+ }
3198
+
3199
+ // src/onboarding/quarry/GasBalance.tsx
3200
+ import { jsx as jsx40, jsxs as jsxs24 } from "react/jsx-runtime";
3201
+ function GasBalance2({ isActive, isExpanded, isFocused, setFocused, userAddress }) {
3202
+ const queryClient = useQueryClient9();
3203
+ const balance = useShowQueryError(useBalance(userAddress));
3204
+ const prevBalance = usePrevious(balance.data || 0n);
3205
+ useEffect14(() => {
3206
+ if (balance.data != null && prevBalance === 0n && balance.data > 0n) {
3207
+ queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] });
3208
+ setFocused(false);
3209
+ }
3210
+ }, [balance.data, prevBalance, setFocused, queryClient, userAddress]);
3211
+ if (isFocused) {
3212
+ return /* @__PURE__ */ jsxs24("div", { children: [
3213
+ isFocused && /* @__PURE__ */ jsx40("div", { className: "absolute top-0 left-0", children: /* @__PURE__ */ jsx40(
3214
+ "div",
3215
+ {
3216
+ className: "flex items-center justify-center w-10 h-10 text-white/20 hover:text-white/40 cursor-pointer",
3217
+ onClick: () => setFocused(false),
3218
+ children: /* @__PURE__ */ jsx40(ArrowLeftIcon, { className: "m-0" })
3219
+ }
3220
+ ) }),
3221
+ /* @__PURE__ */ jsx40(DepositFormContainer, {})
3222
+ ] });
3223
+ }
3224
+ return /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-4", children: [
3225
+ /* @__PURE__ */ jsxs24("div", { className: "flex justify-between gap-4", children: [
3226
+ /* @__PURE__ */ jsxs24("div", { children: [
3227
+ /* @__PURE__ */ jsx40("div", { children: "Gas balance" }),
3228
+ /* @__PURE__ */ jsx40("div", { className: "font-mono text-white", children: balance.data != null ? /* @__PURE__ */ jsx40(Balance, { wei: balance.data }) : /* @__PURE__ */ jsx40(PendingIcon, { className: "text-sm" }) })
3229
+ ] }),
3230
+ /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-1 justify-center items-center", children: [
3231
+ /* @__PURE__ */ jsx40(
3232
+ Button,
3233
+ {
3234
+ variant: isActive ? "primary" : "tertiary",
3235
+ className: "flex-shrink-0 text-sm p-1 w-28",
3236
+ autoFocus: isActive || isExpanded,
3237
+ pending: balance.status === "pending",
3238
+ onClick: () => setFocused(true),
3239
+ children: "Top up"
3240
+ }
3241
+ ),
3242
+ /* @__PURE__ */ jsx40(WithdrawGasBalanceButton, { userAddress })
3243
+ ] })
3244
+ ] }),
3245
+ isExpanded ? /* @__PURE__ */ jsx40("p", { className: "text-sm", children: "Your gas balance is used to pay for onchain computation." }) : null
3246
+ ] });
3247
+ }
3248
+
3249
+ // src/onboarding/ConnectedSteps.tsx
3250
+ import { jsx as jsx41 } from "react/jsx-runtime";
3251
+ function ConnectedSteps({ userClient, initialUserAddress }) {
3252
+ const { chain } = useEntryKitConfig();
3253
+ const paymaster = getPaymaster(chain);
3254
+ const [focusedId, setFocusedId] = useState5(null);
3255
+ const userAddress = userClient.account.address;
3256
+ const { data: prerequisites, error: prerequisitesError } = usePrerequisites(userAddress);
3257
+ useEffect15(() => {
3258
+ if (prerequisitesError) {
3259
+ console.error("Could not get prerequisites", prerequisitesError);
3260
+ }
3261
+ }, [prerequisitesError]);
3262
+ const { closeAccountModal } = useAccountModal();
3263
+ const isNewConnection = userAddress !== initialUserAddress;
3264
+ const initialPrerequisites = useRef5(prerequisites);
3265
+ useEffect15(() => {
3266
+ if (prerequisites == null) return;
3267
+ if (initialPrerequisites.current == null) {
3268
+ initialPrerequisites.current = prerequisites;
3269
+ }
3270
+ if (prerequisites.complete) {
3271
+ if (isNewConnection || !initialPrerequisites.current.complete) {
3272
+ closeAccountModal();
3273
+ }
3274
+ }
3275
+ }, [closeAccountModal, isNewConnection, prerequisites]);
3276
+ const { sessionAddress, hasAllowance, isSpender, hasDelegation, hasGasBalance, hasQuarryGasBalance } = prerequisites ?? {};
3277
+ const steps = useMemo4(() => {
3278
+ if (!userAddress) {
3279
+ return [
3280
+ {
3281
+ id: "wallet",
3282
+ isComplete: false,
3283
+ content: () => null
3284
+ }
3285
+ ];
3286
+ }
3287
+ const steps2 = [
3288
+ {
3289
+ id: "wallet",
1974
3290
  isComplete: true,
1975
- content: (props) => /* @__PURE__ */ jsx17(Wallet, { ...props, userAddress })
3291
+ content: (props) => /* @__PURE__ */ jsx41(Wallet, { ...props, userAddress })
1976
3292
  }
1977
3293
  ];
1978
3294
  if (!paymaster) {
@@ -1980,142 +3296,138 @@ function ConnectedSteps({ userClient, initialUserAddress }) {
1980
3296
  steps2.push({
1981
3297
  id: "gasBalance",
1982
3298
  isComplete: !!hasGasBalance,
1983
- content: (props) => /* @__PURE__ */ jsx17(GasBalance, { ...props, sessionAddress })
3299
+ content: (props) => /* @__PURE__ */ jsx41(GasBalance, { ...props, sessionAddress })
1984
3300
  });
1985
3301
  }
1986
3302
  } else if (paymaster.type === "quarry") {
1987
- steps2.push({
1988
- id: "allowance",
1989
- isComplete: !!hasAllowance,
1990
- content: (props) => /* @__PURE__ */ jsx17(Allowance, { ...props, userAddress })
1991
- });
3303
+ if (paymaster.isGasPass) {
3304
+ steps2.push({
3305
+ id: "allowance",
3306
+ isComplete: !!hasAllowance,
3307
+ content: (props) => /* @__PURE__ */ jsx41(Allowance, { ...props, userAddress })
3308
+ });
3309
+ } else {
3310
+ steps2.push({
3311
+ id: "gasBalanceQuarry",
3312
+ isComplete: !!hasQuarryGasBalance,
3313
+ content: (props) => /* @__PURE__ */ jsx41(GasBalance2, { ...props, userAddress })
3314
+ });
3315
+ }
1992
3316
  }
1993
3317
  steps2.push({
1994
3318
  id: "session",
1995
3319
  isComplete: !!isSpender && !!hasDelegation,
1996
- content: (props) => /* @__PURE__ */ jsx17(Session, { ...props, userClient, registerSpender: !isSpender, registerDelegation: !hasDelegation })
3320
+ content: (props) => /* @__PURE__ */ jsx41(Session, { ...props, userClient, registerSpender: !isSpender, registerDelegation: !hasDelegation })
1997
3321
  });
1998
3322
  return steps2;
1999
- }, [hasAllowance, hasDelegation, hasGasBalance, isSpender, paymaster, sessionAddress, userAddress, userClient]);
2000
- const [selectedStepId] = useState3(null);
3323
+ }, [
3324
+ hasAllowance,
3325
+ hasDelegation,
3326
+ hasGasBalance,
3327
+ hasQuarryGasBalance,
3328
+ isSpender,
3329
+ paymaster,
3330
+ sessionAddress,
3331
+ userAddress,
3332
+ userClient
3333
+ ]);
3334
+ const [selectedStepId] = useState5(null);
2001
3335
  const nextStep = steps.find((step) => step.content != null && !step.isComplete);
2002
3336
  const completedSteps = steps.filter((step) => step.isComplete);
2003
3337
  const activeStep = (selectedStepId != null ? steps.find((step) => step.id === selectedStepId) : null) ?? nextStep ?? (completedSteps.length < steps.length ? completedSteps.at(-1) : null);
2004
3338
  const activeStepIndex = activeStep ? steps.indexOf(activeStep) : -1;
2005
- return /* @__PURE__ */ jsx17(
3339
+ return /* @__PURE__ */ jsx41(
2006
3340
  "div",
2007
3341
  {
2008
- className: twMerge7(
2009
- // steps.length === 2 ? "min-h-[22rem]" : "min-h-[26rem]",
2010
- "px-8 flex flex-col divide-y divide-neutral-800",
3342
+ className: twMerge18(
3343
+ "px-8 flex flex-col",
3344
+ "divide-y divide-neutral-800",
2011
3345
  "animate-in animate-duration-300 fade-in slide-in-from-bottom-8"
2012
3346
  ),
2013
3347
  children: steps.map((step, i) => {
2014
3348
  const isActive = step === activeStep;
2015
3349
  const isExpanded = isActive || completedSteps.length === steps.length;
2016
3350
  const isDisabled = !step.isComplete && activeStepIndex !== -1 && i > activeStepIndex;
2017
- return /* @__PURE__ */ jsx17("div", { className: twMerge7("py-8 flex flex-col justify-center", isActive ? "flex-grow" : null), children: /* @__PURE__ */ jsx17("div", { className: twMerge7("flex flex-col", isDisabled ? "opacity-30 pointer-events-none" : null), children: step.content({ isActive, isExpanded }) }) }, step.id);
3351
+ const isFocused = focusedId === step.id;
3352
+ const content = step.content({
3353
+ isActive,
3354
+ isExpanded,
3355
+ isFocused,
3356
+ setFocused: (focused) => setFocusedId(focused ? step.id : null)
3357
+ });
3358
+ if (focusedId) {
3359
+ if (step.id === focusedId) {
3360
+ return content;
3361
+ }
3362
+ return null;
3363
+ }
3364
+ return /* @__PURE__ */ jsx41("div", { className: twMerge18("py-8 flex flex-col justify-center", isActive ? "flex-grow" : null), children: /* @__PURE__ */ jsx41("div", { className: twMerge18("flex flex-col", isDisabled ? "opacity-30 pointer-events-none" : null), children: content }) }, step.id);
2018
3365
  })
2019
3366
  }
2020
3367
  );
2021
3368
  }
2022
3369
 
2023
3370
  // src/AccountModalContent.tsx
2024
- import { useRef as useRef3 } from "react";
2025
- import { jsx as jsx18 } from "react/jsx-runtime";
3371
+ import { useRef as useRef6 } from "react";
3372
+ import { jsx as jsx42 } from "react/jsx-runtime";
2026
3373
  function AccountModalContent() {
2027
3374
  const { chainId } = useEntryKitConfig();
2028
3375
  const userClient = useConnectorClient({ chainId });
2029
- const { address: userAddress } = useAccount2();
2030
- const initialUserAddress = useRef3(userAddress);
3376
+ const { address: userAddress } = useAccount8();
3377
+ const initialUserAddress = useRef6(userAddress);
2031
3378
  if (userClient.status !== "success") {
2032
- return /* @__PURE__ */ jsx18(ConnectWallet, {});
3379
+ return /* @__PURE__ */ jsx42(ConnectWallet, {});
2033
3380
  }
2034
- return /* @__PURE__ */ jsx18(ConnectedSteps, { userClient: userClient.data, initialUserAddress: initialUserAddress.current });
3381
+ return /* @__PURE__ */ jsx42(ConnectedSteps, { userClient: userClient.data, initialUserAddress: initialUserAddress.current });
2035
3382
  }
2036
3383
 
2037
3384
  // src/AccountModal.tsx
2038
3385
  import { DialogClose } from "@radix-ui/react-dialog";
2039
-
2040
- // src/icons/IconSVG.tsx
2041
- import { twMerge as twMerge8 } from "tailwind-merge";
2042
- import { jsx as jsx19 } from "react/jsx-runtime";
2043
- function IconSVG({ className, children, ...props }) {
2044
- return /* @__PURE__ */ jsx19(
2045
- "svg",
2046
- {
2047
- xmlns: "http://www.w3.org/2000/svg",
2048
- viewBox: "0 0 24 24",
2049
- fill: "currentColor",
2050
- className: twMerge8("-my-[0.125em] h-[1.25em] w-[1.25em]", className),
2051
- ...props,
2052
- children
2053
- }
2054
- );
2055
- }
2056
-
2057
- // src/icons/CloseIcon.tsx
2058
- import { jsx as jsx20 } from "react/jsx-runtime";
2059
- function CloseIcon(props) {
2060
- return /* @__PURE__ */ jsx20(IconSVG, { strokeWidth: "2", stroke: "currentColor", ...props, children: /* @__PURE__ */ jsx20(
2061
- "path",
2062
- {
2063
- d: "M6 18L18 6M6 6L18 18",
2064
- fill: "none",
2065
- stroke: "currentColor",
2066
- strokeWidth: "2",
2067
- strokeLinecap: "round",
2068
- strokeLinejoin: "round"
2069
- }
2070
- ) });
2071
- }
2072
-
2073
- // src/AccountModal.tsx
2074
3386
  import { ErrorBoundary } from "react-error-boundary";
2075
3387
 
2076
3388
  // src/errors/ErrorOverlay.tsx
2077
3389
  import { wait } from "@latticexyz/common/utils";
2078
- import { useEffect as useEffect9 } from "react";
2079
- import { twMerge as twMerge9 } from "tailwind-merge";
2080
- import { Fragment as Fragment2, jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
3390
+ import { useEffect as useEffect16 } from "react";
3391
+ import { twMerge as twMerge19 } from "tailwind-merge";
3392
+ import { Fragment as Fragment6, jsx as jsx43, jsxs as jsxs25 } from "react/jsx-runtime";
2081
3393
  function ErrorOverlay({ error: error2, retry, dismiss }) {
2082
- useEffect9(() => {
3394
+ useEffect16(() => {
2083
3395
  if (error2) {
2084
3396
  console.error(error2);
2085
3397
  }
2086
3398
  }, [error2]);
2087
- return /* @__PURE__ */ jsxs15("div", { className: "pointer-events-none absolute inset-0 overflow-clip", children: [
2088
- /* @__PURE__ */ jsx21(
3399
+ return /* @__PURE__ */ jsxs25("div", { className: "pointer-events-none absolute inset-0 overflow-clip", children: [
3400
+ /* @__PURE__ */ jsx43(
2089
3401
  "div",
2090
3402
  {
2091
- className: twMerge9(
3403
+ className: twMerge19(
2092
3404
  "absolute inset-0 bg-blue-700/60",
2093
3405
  "transition duration-300",
2094
3406
  error2 ? "opacity-100 pointer-events-auto" : "opacity-0"
2095
3407
  )
2096
3408
  }
2097
3409
  ),
2098
- /* @__PURE__ */ jsx21(
3410
+ /* @__PURE__ */ jsx43(
2099
3411
  "div",
2100
3412
  {
2101
- className: twMerge9(
3413
+ className: twMerge19(
2102
3414
  "absolute inset-0 pb-8",
2103
3415
  "transition duration-300",
2104
3416
  error2 ? "translate-y-0 opacity-100 pointer-events-auto" : "-translate-y-4 opacity-0"
2105
3417
  ),
2106
- children: error2 ? /* @__PURE__ */ jsx21(Fragment2, { children: /* @__PURE__ */ jsxs15("div", { className: "w-full max-h-full bg-blue-700 text-white/80 overflow-auto", children: [
2107
- /* @__PURE__ */ jsxs15("div", { className: "space-y-6 px-8 pt-8", children: [
2108
- /* @__PURE__ */ jsx21("div", { className: "text-white text-lg font-bold", children: "Oops! It broke :(" }),
2109
- /* @__PURE__ */ jsx21("div", { className: "font-mono text-xs whitespace-pre-wrap", children: error2.message.trim() }),
2110
- /* @__PURE__ */ jsx21("div", { className: "text-sm", children: "See the console for more info." })
3418
+ children: error2 ? /* @__PURE__ */ jsx43(Fragment6, { children: /* @__PURE__ */ jsxs25("div", { className: "w-full max-h-full bg-blue-700 text-white/80 overflow-auto", children: [
3419
+ /* @__PURE__ */ jsxs25("div", { className: "space-y-6 px-8 pt-8", children: [
3420
+ /* @__PURE__ */ jsx43("div", { className: "text-white text-lg font-bold", children: "Oops! It broke :(" }),
3421
+ /* @__PURE__ */ jsx43("div", { className: "font-mono text-xs whitespace-pre-wrap", children: error2.message.trim() }),
3422
+ /* @__PURE__ */ jsx43("div", { className: "text-sm", children: "See the console for more info." })
2111
3423
  ] }),
2112
- /* @__PURE__ */ jsxs15("div", { className: "pointer-events-none sticky bottom-0 left-0 -mt-2", children: [
2113
- /* @__PURE__ */ jsx21("div", { className: "w-full h-12 bg-gradient-to-b from-transparent to-blue-700" }),
2114
- retry ? /* @__PURE__ */ jsx21("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsxs15(
3424
+ /* @__PURE__ */ jsxs25("div", { className: "pointer-events-none sticky bottom-0 left-0 -mt-2", children: [
3425
+ /* @__PURE__ */ jsx43("div", { className: "w-full h-12 bg-gradient-to-b from-transparent to-blue-700" }),
3426
+ retry ? /* @__PURE__ */ jsx43("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsxs25(
2115
3427
  "button",
2116
3428
  {
2117
3429
  type: "button",
2118
- className: twMerge9(
3430
+ className: twMerge19(
2119
3431
  "pointer-events-auto group w-24 p-1 -translate-y-2 transition",
2120
3432
  "bg-blue-600 hover:bg-blue-500 aria-busy:bg-blue-500",
2121
3433
  "text-white text-sm font-medium",
@@ -2130,15 +3442,15 @@ function ErrorOverlay({ error: error2, retry, dismiss }) {
2130
3442
  }
2131
3443
  },
2132
3444
  children: [
2133
- /* @__PURE__ */ jsx21("span", { className: "group-aria-busy:hidden", children: "Retry" }),
2134
- /* @__PURE__ */ jsx21("span", { className: "hidden group-aria-busy:inline", children: "Retrying\u2026" })
3445
+ /* @__PURE__ */ jsx43("span", { className: "group-aria-busy:hidden", children: "Retry" }),
3446
+ /* @__PURE__ */ jsx43("span", { className: "hidden group-aria-busy:inline", children: "Retrying\u2026" })
2135
3447
  ]
2136
3448
  }
2137
- ) }) : dismiss ? /* @__PURE__ */ jsx21("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsx21(
3449
+ ) }) : dismiss ? /* @__PURE__ */ jsx43("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsx43(
2138
3450
  "button",
2139
3451
  {
2140
3452
  type: "button",
2141
- className: twMerge9(
3453
+ className: twMerge19(
2142
3454
  "pointer-events-auto group w-24 p-1 -translate-y-2 transition",
2143
3455
  "bg-blue-600 hover:bg-blue-500 aria-busy:bg-blue-500",
2144
3456
  "text-white text-sm font-medium",
@@ -2156,27 +3468,27 @@ function ErrorOverlay({ error: error2, retry, dismiss }) {
2156
3468
  }
2157
3469
 
2158
3470
  // src/errors/ErrorFallback.tsx
2159
- import { jsx as jsx22 } from "react/jsx-runtime";
3471
+ import { jsx as jsx44 } from "react/jsx-runtime";
2160
3472
  function ErrorFallback({ error: error2, resetErrorBoundary }) {
2161
- return /* @__PURE__ */ jsx22("div", { className: "h-64", children: /* @__PURE__ */ jsx22(ErrorOverlay, { error: error2, retry: resetErrorBoundary }) });
3473
+ return /* @__PURE__ */ jsx44("div", { className: "h-64", children: /* @__PURE__ */ jsx44(ErrorOverlay, { error: error2, retry: resetErrorBoundary }) });
2162
3474
  }
2163
3475
 
2164
3476
  // src/errors/ErrorsOverlay.tsx
2165
- import { useStore as useStore2 } from "zustand";
2166
- import { jsx as jsx23 } from "react/jsx-runtime";
3477
+ import { useStore as useStore3 } from "zustand";
3478
+ import { jsx as jsx45 } from "react/jsx-runtime";
2167
3479
  function ErrorsOverlay() {
2168
- const error2 = useStore2(store3, (state) => state.errors.at(0));
2169
- return /* @__PURE__ */ jsx23(ErrorOverlay, { error: error2?.error, retry: error2?.retry, dismiss: error2?.dismiss });
3480
+ const error2 = useStore3(store3, (state) => state.errors.at(0));
3481
+ return /* @__PURE__ */ jsx45(ErrorOverlay, { error: error2?.error, retry: error2?.retry, dismiss: error2?.dismiss });
2170
3482
  }
2171
3483
 
2172
3484
  // src/AccountModal.tsx
2173
- import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
3485
+ import { jsx as jsx46, jsxs as jsxs26 } from "react/jsx-runtime";
2174
3486
  function AccountModal() {
2175
3487
  const { accountModalOpen, toggleAccountModal } = useAccountModal();
2176
- return /* @__PURE__ */ jsx24(Modal, { open: accountModalOpen, onOpenChange: toggleAccountModal, children: accountModalOpen ? /* @__PURE__ */ jsxs16(
3488
+ return /* @__PURE__ */ jsx46(Modal, { open: accountModalOpen, onOpenChange: toggleAccountModal, children: accountModalOpen ? /* @__PURE__ */ jsxs26(
2177
3489
  "div",
2178
3490
  {
2179
- className: twMerge10(
3491
+ className: twMerge20(
2180
3492
  "relative py-2 ring-1",
2181
3493
  "bg-neutral-900 text-neutral-400 ring-neutral-700/50",
2182
3494
  "links:font-medium links:underline links:underline-offset-4",
@@ -2184,11 +3496,11 @@ function AccountModal() {
2184
3496
  "links:decoration-neutral-500 hover:links:decoration-orange-500"
2185
3497
  ),
2186
3498
  children: [
2187
- /* @__PURE__ */ jsxs16(ErrorBoundary, { FallbackComponent: ErrorFallback, children: [
2188
- /* @__PURE__ */ jsx24(AccountModalContent, {}),
2189
- /* @__PURE__ */ jsx24(ErrorsOverlay, {})
3499
+ /* @__PURE__ */ jsxs26(ErrorBoundary, { FallbackComponent: ErrorFallback, children: [
3500
+ /* @__PURE__ */ jsx46(AccountModalContent, {}),
3501
+ /* @__PURE__ */ jsx46(ErrorsOverlay, {})
2190
3502
  ] }),
2191
- /* @__PURE__ */ jsxs16(
3503
+ /* @__PURE__ */ jsxs26(
2192
3504
  "a",
2193
3505
  {
2194
3506
  href: "https://mud.dev",
@@ -2196,20 +3508,20 @@ function AccountModal() {
2196
3508
  rel: "noreferrer noopener",
2197
3509
  className: "group self-center p-3 flex items-center justify-center gap-2 links-unset text-sm font-mono transition text-neutral-400 hover:text-white",
2198
3510
  children: [
2199
- /* @__PURE__ */ jsx24("span", { className: "block w-4 h-4", children: /* @__PURE__ */ jsx24(Logo, { className: "w-full h-full text-orange-500 group-hover:rotate-90 transition duration-300" }) }),
2200
- /* @__PURE__ */ jsx24("span", { children: "Powered by MUD" })
3511
+ /* @__PURE__ */ jsx46("span", { className: "block w-4 h-4", children: /* @__PURE__ */ jsx46(Logo, { className: "w-full h-full text-orange-500 group-hover:rotate-90 transition duration-300" }) }),
3512
+ /* @__PURE__ */ jsx46("span", { children: "Powered by MUD" })
2201
3513
  ]
2202
3514
  }
2203
3515
  ),
2204
- /* @__PURE__ */ jsx24("div", { className: "absolute top-0 right-0", children: /* @__PURE__ */ jsx24(
3516
+ /* @__PURE__ */ jsx46("div", { className: "absolute top-0 right-0", children: /* @__PURE__ */ jsx46(
2205
3517
  DialogClose,
2206
3518
  {
2207
- className: twMerge10(
3519
+ className: twMerge20(
2208
3520
  "pointer-events-auto leading-none p-2 transition",
2209
3521
  "text-white/20 hover:text-white/40"
2210
3522
  ),
2211
3523
  title: "Close",
2212
- children: /* @__PURE__ */ jsx24(CloseIcon, { className: "m-0" })
3524
+ children: /* @__PURE__ */ jsx46(CloseIcon, { className: "m-0" })
2213
3525
  }
2214
3526
  ) })
2215
3527
  ]
@@ -2218,31 +3530,31 @@ function AccountModal() {
2218
3530
  }
2219
3531
 
2220
3532
  // src/EntryKitProvider.tsx
2221
- import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
3533
+ import { jsx as jsx47, jsxs as jsxs27 } from "react/jsx-runtime";
2222
3534
  function EntryKitProvider({ config, children }) {
2223
- return /* @__PURE__ */ jsxs17(EntryKitConfigProvider, { config, children: [
3535
+ return /* @__PURE__ */ jsxs27(EntryKitConfigProvider, { config, children: [
2224
3536
  children,
2225
- /* @__PURE__ */ jsx25(AccountModal, {})
3537
+ /* @__PURE__ */ jsx47(AccountModal, {})
2226
3538
  ] });
2227
3539
  }
2228
3540
 
2229
3541
  // src/AccountButton.tsx
2230
- import { useAccount as useAccount3 } from "wagmi";
2231
- import { twMerge as twMerge12 } from "tailwind-merge";
3542
+ import { useAccount as useAccount9 } from "wagmi";
3543
+ import { twMerge as twMerge22 } from "tailwind-merge";
2232
3544
 
2233
3545
  // src/AccountName.tsx
2234
- import { twMerge as twMerge11 } from "tailwind-merge";
2235
- import { Fragment as Fragment3, jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
3546
+ import { twMerge as twMerge21 } from "tailwind-merge";
3547
+ import { Fragment as Fragment7, jsx as jsx48, jsxs as jsxs28 } from "react/jsx-runtime";
2236
3548
  function AccountName({ address }) {
2237
3549
  const { data: ens } = useENS(address);
2238
3550
  const avatar = usePreloadImage(ens?.avatar);
2239
- return /* @__PURE__ */ jsxs18(Fragment3, { children: [
2240
- /* @__PURE__ */ jsxs18("span", { className: "flex-shrink-0 w-6 h-6 -my-1 -mx-0.5 grid place-items-center", children: [
2241
- /* @__PURE__ */ jsx26(
3551
+ return /* @__PURE__ */ jsxs28(Fragment7, { children: [
3552
+ /* @__PURE__ */ jsxs28("span", { className: "flex-shrink-0 w-6 h-6 -my-1 -mx-0.5 grid place-items-center", children: [
3553
+ /* @__PURE__ */ jsx48(
2242
3554
  "img",
2243
3555
  {
2244
3556
  src: ens?.avatar && avatar.isSuccess ? ens.avatar : void 0,
2245
- className: twMerge11(
3557
+ className: twMerge21(
2246
3558
  "col-start-1 row-start-1",
2247
3559
  "inline-flex w-full h-full rounded-full bg-black/10 dark:bg-white/10 bg-cover bg-no-repeat bg-center",
2248
3560
  "transtion duration-300",
@@ -2250,10 +3562,10 @@ function AccountName({ address }) {
2250
3562
  )
2251
3563
  }
2252
3564
  ),
2253
- /* @__PURE__ */ jsx26(
3565
+ /* @__PURE__ */ jsx48(
2254
3566
  Logo,
2255
3567
  {
2256
- className: twMerge11(
3568
+ className: twMerge21(
2257
3569
  "col-start-1 row-start-1 text-orange-500",
2258
3570
  "transition duration-300",
2259
3571
  ens && (!ens.avatar || avatar.isError) ? "opacity-100" : "opacity-0"
@@ -2261,29 +3573,29 @@ function AccountName({ address }) {
2261
3573
  }
2262
3574
  )
2263
3575
  ] }),
2264
- /* @__PURE__ */ jsx26("span", { className: "flex-grow", children: ens?.name ?? /* @__PURE__ */ jsx26(TruncatedHex, { hex: address }) })
3576
+ /* @__PURE__ */ jsx48("span", { className: "flex-grow", children: ens?.name ?? /* @__PURE__ */ jsx48(TruncatedHex, { hex: address }) })
2265
3577
  ] });
2266
3578
  }
2267
3579
 
2268
3580
  // src/AccountButton.tsx
2269
- import { useRef as useRef4 } from "react";
2270
- import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
2271
- var containerClassNames = twMerge12(
3581
+ import { useRef as useRef7 } from "react";
3582
+ import { jsx as jsx49, jsxs as jsxs29 } from "react/jsx-runtime";
3583
+ var containerClassNames = twMerge22(
2272
3584
  "w-48 p-3 inline-flex outline-none transition",
2273
3585
  "border border-transparent",
2274
3586
  "text-base leading-none"
2275
3587
  );
2276
- var secondaryClassNames = twMerge12(
3588
+ var secondaryClassNames = twMerge22(
2277
3589
  "bg-neutral-100 border-neutral-300 text-black",
2278
3590
  "dark:bg-neutral-800 dark:border-neutral-700 dark:text-white"
2279
3591
  );
2280
- var secondaryInteractiveClassNames = twMerge12(
3592
+ var secondaryInteractiveClassNames = twMerge22(
2281
3593
  "cursor-pointer outline-none hover:bg-neutral-200 data-[highlighted]:bg-neutral-200 dark:hover:bg-neutral-700"
2282
3594
  );
2283
3595
  function AccountButton() {
2284
3596
  const { openAccountModal, accountModalOpen } = useAccountModal();
2285
- const { status, address: userAddress } = useAccount3();
2286
- const initialUserAddress = useRef4(userAddress);
3597
+ const { status, address: userAddress } = useAccount9();
3598
+ const initialUserAddress = useRef7(userAddress);
2287
3599
  const prereqs = usePrerequisites(userAddress);
2288
3600
  const isConnected = status === "connected" || status === "reconnecting" && userAddress;
2289
3601
  const isNewConnection = userAddress !== initialUserAddress.current;
@@ -2295,20 +3607,20 @@ function AccountButton() {
2295
3607
  }
2296
3608
  return "Sign in";
2297
3609
  })();
2298
- return /* @__PURE__ */ jsx27(Shadow, { mode: "child", children: isSignedIn ? /* @__PURE__ */ jsx27(
3610
+ return /* @__PURE__ */ jsx49(Shadow, { mode: "child", children: isSignedIn ? /* @__PURE__ */ jsx49(
2299
3611
  "button",
2300
3612
  {
2301
3613
  type: "button",
2302
- className: twMerge12(containerClassNames, secondaryClassNames, secondaryInteractiveClassNames),
3614
+ className: twMerge22(containerClassNames, secondaryClassNames, secondaryInteractiveClassNames),
2303
3615
  onClick: openAccountModal,
2304
- children: /* @__PURE__ */ jsx27("span", { className: "flex-grow inline-flex gap-2.5 items-center text-left font-medium", children: userAddress ? /* @__PURE__ */ jsx27(AccountName, { address: userAddress }) : null })
3616
+ children: /* @__PURE__ */ jsx49("span", { className: "flex-grow inline-flex gap-2.5 items-center text-left font-medium", children: userAddress ? /* @__PURE__ */ jsx49(AccountName, { address: userAddress }) : null })
2305
3617
  },
2306
3618
  "connected"
2307
- ) : /* @__PURE__ */ jsxs19(
3619
+ ) : /* @__PURE__ */ jsxs29(
2308
3620
  "button",
2309
3621
  {
2310
3622
  type: "button",
2311
- className: twMerge12(
3623
+ className: twMerge22(
2312
3624
  containerClassNames,
2313
3625
  "group",
2314
3626
  "items-center justify-center gap-2.5",
@@ -2316,35 +3628,35 @@ function AccountButton() {
2316
3628
  "hover:bg-orange-400",
2317
3629
  "active:bg-orange-600"
2318
3630
  ),
2319
- "aria-busy": accountModalOpen,
3631
+ "aria-busy": accountModalOpen || prereqs.isPending,
2320
3632
  onClick: openAccountModal,
2321
3633
  children: [
2322
- /* @__PURE__ */ jsxs19("span", { className: "pointer-events-none inline-grid place-items-center -ml-3", children: [
2323
- /* @__PURE__ */ jsx27(
3634
+ /* @__PURE__ */ jsxs29("span", { className: "pointer-events-none inline-grid place-items-center -ml-3", children: [
3635
+ /* @__PURE__ */ jsx49(
2324
3636
  "span",
2325
3637
  {
2326
- className: twMerge12(
3638
+ className: twMerge22(
2327
3639
  "col-start-1 row-start-1 leading-none",
2328
3640
  "scale-100 opacity-100 transition duration-300",
2329
3641
  "group-aria-busy:scale-125 group-aria-busy:opacity-0"
2330
3642
  ),
2331
- children: /* @__PURE__ */ jsx27(Logo, {})
3643
+ children: /* @__PURE__ */ jsx49(Logo, {})
2332
3644
  }
2333
3645
  ),
2334
- /* @__PURE__ */ jsx27(
3646
+ /* @__PURE__ */ jsx49(
2335
3647
  "span",
2336
3648
  {
2337
3649
  "aria-hidden": true,
2338
- className: twMerge12(
3650
+ className: twMerge22(
2339
3651
  "col-start-1 row-start-1",
2340
3652
  "scale-50 opacity-0 transition duration-300 delay-50",
2341
3653
  "group-aria-busy:scale-100 group-aria-busy:opacity-100"
2342
3654
  ),
2343
- children: /* @__PURE__ */ jsx27(PendingIcon, {})
3655
+ children: /* @__PURE__ */ jsx49(PendingIcon, {})
2344
3656
  }
2345
3657
  )
2346
3658
  ] }),
2347
- /* @__PURE__ */ jsx27("span", { className: "font-medium", children: buttonLabel })
3659
+ /* @__PURE__ */ jsx49("span", { className: "font-medium", children: buttonLabel })
2348
3660
  ]
2349
3661
  },
2350
3662
  "sign in"
@@ -2360,50 +3672,386 @@ function useSessionClientReady() {
2360
3672
  const userAddress = userClient.data?.account.address;
2361
3673
  const prerequisites = usePrerequisites(userAddress);
2362
3674
  const sessionClient = useSessionClient(userAddress);
2363
- if (!userClient.isSuccess) return { ...userClient, data: void 0 };
2364
- if (!prerequisites.isSuccess || !prerequisites.data.complete) return { ...prerequisites, data: void 0 };
3675
+ if (!prerequisites.isSuccess || !prerequisites.data.complete) {
3676
+ return { ...prerequisites, data: void 0 };
3677
+ }
2365
3678
  return sessionClient;
2366
3679
  }
2367
3680
 
2368
3681
  // src/createWagmiConfig.ts
2369
- import { connectorsForWallets } from "@rainbow-me/rainbowkit";
2370
3682
  import { createConfig } from "wagmi";
3683
+ import { getDefaultConfig } from "connectkit";
3684
+ import { injected, coinbaseWallet, safe } from "wagmi/connectors";
2371
3685
 
2372
- // src/getWallets.ts
2373
- import { getDefaultWallets } from "@rainbow-me/rainbowkit";
2374
- function getWallets(_config) {
2375
- const { wallets: defaultWallets } = getDefaultWallets();
2376
- return [
2377
- // TODO: passkey wallet
2378
- ...defaultWallets
2379
- ];
3686
+ // src/connectors/walletConnect.ts
3687
+ import { ChainNotConfiguredError, ProviderNotFoundError, createConnector } from "wagmi";
3688
+ import {
3689
+ SwitchChainError,
3690
+ UserRejectedRequestError,
3691
+ getAddress,
3692
+ numberToHex as numberToHex3
3693
+ } from "viem";
3694
+ walletConnect.type = "walletConnect";
3695
+ function walletConnect(parameters) {
3696
+ const isNewChainsStale = parameters.isNewChainsStale ?? true;
3697
+ let provider_;
3698
+ let providerPromise;
3699
+ const NAMESPACE = "eip155";
3700
+ let accountsChanged;
3701
+ let chainChanged;
3702
+ let connect;
3703
+ let displayUri;
3704
+ let sessionDelete;
3705
+ let disconnect;
3706
+ return createConnector((config) => ({
3707
+ id: "walletConnect",
3708
+ name: "WalletConnect",
3709
+ type: walletConnect.type,
3710
+ async setup() {
3711
+ const provider = await this.getProvider().catch(() => null);
3712
+ if (!provider) return;
3713
+ if (!connect) {
3714
+ connect = this.onConnect.bind(this);
3715
+ provider.on("connect", connect);
3716
+ }
3717
+ if (!sessionDelete) {
3718
+ sessionDelete = this.onSessionDelete.bind(this);
3719
+ provider.on("session_delete", sessionDelete);
3720
+ }
3721
+ },
3722
+ async connect({ chainId, ...rest } = {}) {
3723
+ try {
3724
+ const provider = await this.getProvider();
3725
+ if (!provider) throw new ProviderNotFoundError();
3726
+ if (!displayUri) {
3727
+ displayUri = this.onDisplayUri;
3728
+ provider.on("display_uri", displayUri);
3729
+ }
3730
+ let targetChainId = chainId;
3731
+ if (!targetChainId) {
3732
+ const state = await config.storage?.getItem("state") ?? {};
3733
+ const isChainSupported = config.chains.some((x) => x.id === state.chainId);
3734
+ if (isChainSupported) targetChainId = state.chainId;
3735
+ else targetChainId = config.chains[0]?.id;
3736
+ }
3737
+ if (!targetChainId) throw new Error("No chains found on connector.");
3738
+ const isChainsStale = await this.isChainsStale();
3739
+ if (provider.session && isChainsStale) await provider.disconnect();
3740
+ if (!provider.session || isChainsStale) {
3741
+ const optionalChains = config.chains.filter((chain) => chain.id !== targetChainId).map((optionalChain) => optionalChain.id);
3742
+ await provider.connect({
3743
+ optionalChains: [targetChainId, ...optionalChains],
3744
+ ..."pairingTopic" in rest ? { pairingTopic: rest.pairingTopic } : {}
3745
+ });
3746
+ this.setRequestedChainsIds(config.chains.map((x) => x.id));
3747
+ }
3748
+ const accounts = (await provider.enable()).map((x) => getAddress(x));
3749
+ let currentChainId = await this.getChainId();
3750
+ if (chainId && currentChainId !== chainId) {
3751
+ const chain = await this.switchChain({ chainId }).catch((error2) => {
3752
+ if (error2.code === UserRejectedRequestError.code) throw error2;
3753
+ return { id: currentChainId };
3754
+ });
3755
+ currentChainId = chain?.id ?? currentChainId;
3756
+ }
3757
+ if (displayUri) {
3758
+ provider.removeListener("display_uri", displayUri);
3759
+ displayUri = void 0;
3760
+ }
3761
+ if (connect) {
3762
+ provider.removeListener("connect", connect);
3763
+ connect = void 0;
3764
+ }
3765
+ if (!accountsChanged) {
3766
+ accountsChanged = this.onAccountsChanged.bind(this);
3767
+ provider.on("accountsChanged", accountsChanged);
3768
+ }
3769
+ if (!chainChanged) {
3770
+ chainChanged = this.onChainChanged.bind(this);
3771
+ provider.on("chainChanged", chainChanged);
3772
+ }
3773
+ if (!disconnect) {
3774
+ disconnect = this.onDisconnect.bind(this);
3775
+ provider.on("disconnect", disconnect);
3776
+ }
3777
+ if (!sessionDelete) {
3778
+ sessionDelete = this.onSessionDelete.bind(this);
3779
+ provider.on("session_delete", sessionDelete);
3780
+ }
3781
+ return { accounts, chainId: currentChainId };
3782
+ } catch (error2) {
3783
+ if (/(user rejected|connection request reset)/i.test(error2?.message)) {
3784
+ throw new UserRejectedRequestError(error2);
3785
+ }
3786
+ throw error2;
3787
+ }
3788
+ },
3789
+ async disconnect() {
3790
+ const provider = await this.getProvider();
3791
+ try {
3792
+ await provider?.disconnect();
3793
+ } catch (error2) {
3794
+ if (!/No matching key/i.test(error2.message)) throw error2;
3795
+ } finally {
3796
+ if (chainChanged) {
3797
+ provider?.removeListener("chainChanged", chainChanged);
3798
+ chainChanged = void 0;
3799
+ }
3800
+ if (disconnect) {
3801
+ provider?.removeListener("disconnect", disconnect);
3802
+ disconnect = void 0;
3803
+ }
3804
+ if (!connect) {
3805
+ connect = this.onConnect.bind(this);
3806
+ provider?.on("connect", connect);
3807
+ }
3808
+ if (accountsChanged) {
3809
+ provider?.removeListener("accountsChanged", accountsChanged);
3810
+ accountsChanged = void 0;
3811
+ }
3812
+ if (sessionDelete) {
3813
+ provider?.removeListener("session_delete", sessionDelete);
3814
+ sessionDelete = void 0;
3815
+ }
3816
+ this.setRequestedChainsIds([]);
3817
+ }
3818
+ },
3819
+ async getAccounts() {
3820
+ const provider = await this.getProvider();
3821
+ return provider.accounts.map((x) => getAddress(x));
3822
+ },
3823
+ async getProvider() {
3824
+ async function initProvider() {
3825
+ const optionalChains = config.chains.map((x) => x.id);
3826
+ if (!optionalChains.length) return;
3827
+ const { EthereumProvider } = await import("@walletconnect/ethereum-provider");
3828
+ return await EthereumProvider.init({
3829
+ ...parameters,
3830
+ disableProviderPing: true,
3831
+ optionalChains,
3832
+ projectId: parameters.projectId,
3833
+ rpcMap: Object.fromEntries(
3834
+ config.chains.map((chain) => {
3835
+ const [url] = extractRpcUrls({
3836
+ chain,
3837
+ transports: config.transports
3838
+ });
3839
+ return [chain.id, url];
3840
+ })
3841
+ ),
3842
+ showQrModal: parameters.showQrModal ?? true
3843
+ });
3844
+ }
3845
+ if (!provider_) {
3846
+ if (!providerPromise) providerPromise = initProvider();
3847
+ provider_ = await providerPromise;
3848
+ provider_?.events.setMaxListeners(Number.POSITIVE_INFINITY);
3849
+ }
3850
+ return provider_;
3851
+ },
3852
+ async getChainId() {
3853
+ const provider = await this.getProvider();
3854
+ return provider.chainId;
3855
+ },
3856
+ async isAuthorized() {
3857
+ try {
3858
+ const [accounts, provider] = await Promise.all([this.getAccounts(), this.getProvider()]);
3859
+ if (!accounts.length) return false;
3860
+ const isChainsStale = await this.isChainsStale();
3861
+ if (isChainsStale && provider.session) {
3862
+ await provider.disconnect().catch(() => {
3863
+ });
3864
+ return false;
3865
+ }
3866
+ return true;
3867
+ } catch {
3868
+ return false;
3869
+ }
3870
+ },
3871
+ async switchChain({ addEthereumChainParameter, chainId }) {
3872
+ const provider = await this.getProvider();
3873
+ if (!provider) throw new ProviderNotFoundError();
3874
+ const chain = config.chains.find((x) => x.id === chainId);
3875
+ if (!chain) throw new SwitchChainError(new ChainNotConfiguredError());
3876
+ try {
3877
+ await Promise.all([
3878
+ new Promise((resolve) => {
3879
+ const listener2 = ({ chainId: currentChainId }) => {
3880
+ if (currentChainId === chainId) {
3881
+ config.emitter.off("change", listener2);
3882
+ resolve();
3883
+ }
3884
+ };
3885
+ config.emitter.on("change", listener2);
3886
+ }),
3887
+ provider.request({
3888
+ method: "wallet_switchEthereumChain",
3889
+ params: [{ chainId: numberToHex3(chainId) }]
3890
+ })
3891
+ ]);
3892
+ const requestedChains = await this.getRequestedChainsIds();
3893
+ this.setRequestedChainsIds([...requestedChains, chainId]);
3894
+ return chain;
3895
+ } catch (err) {
3896
+ const error2 = err;
3897
+ if (/(user rejected)/i.test(error2.message)) throw new UserRejectedRequestError(error2);
3898
+ try {
3899
+ let blockExplorerUrls;
3900
+ if (addEthereumChainParameter?.blockExplorerUrls)
3901
+ blockExplorerUrls = addEthereumChainParameter.blockExplorerUrls;
3902
+ else blockExplorerUrls = chain.blockExplorers?.default.url ? [chain.blockExplorers?.default.url] : [];
3903
+ let rpcUrls;
3904
+ if (addEthereumChainParameter?.rpcUrls?.length) rpcUrls = addEthereumChainParameter.rpcUrls;
3905
+ else rpcUrls = [...chain.rpcUrls.default.http];
3906
+ const addEthereumChain = {
3907
+ blockExplorerUrls,
3908
+ chainId: numberToHex3(chainId),
3909
+ chainName: addEthereumChainParameter?.chainName ?? chain.name,
3910
+ iconUrls: addEthereumChainParameter?.iconUrls,
3911
+ nativeCurrency: addEthereumChainParameter?.nativeCurrency ?? chain.nativeCurrency,
3912
+ rpcUrls
3913
+ };
3914
+ await provider.request({
3915
+ method: "wallet_addEthereumChain",
3916
+ params: [addEthereumChain]
3917
+ });
3918
+ const requestedChains = await this.getRequestedChainsIds();
3919
+ this.setRequestedChainsIds([...requestedChains, chainId]);
3920
+ return chain;
3921
+ } catch (error3) {
3922
+ throw new UserRejectedRequestError(error3);
3923
+ }
3924
+ }
3925
+ },
3926
+ onAccountsChanged(accounts) {
3927
+ if (accounts.length === 0) this.onDisconnect();
3928
+ else
3929
+ config.emitter.emit("change", {
3930
+ accounts: accounts.map((x) => getAddress(x))
3931
+ });
3932
+ },
3933
+ onChainChanged(chain) {
3934
+ const chainId = Number(chain);
3935
+ config.emitter.emit("change", { chainId });
3936
+ },
3937
+ async onConnect(connectInfo) {
3938
+ const chainId = Number(connectInfo.chainId);
3939
+ const accounts = await this.getAccounts();
3940
+ config.emitter.emit("connect", { accounts, chainId });
3941
+ },
3942
+ async onDisconnect(_error) {
3943
+ this.setRequestedChainsIds([]);
3944
+ config.emitter.emit("disconnect");
3945
+ const provider = await this.getProvider();
3946
+ if (accountsChanged) {
3947
+ provider.removeListener("accountsChanged", accountsChanged);
3948
+ accountsChanged = void 0;
3949
+ }
3950
+ if (chainChanged) {
3951
+ provider.removeListener("chainChanged", chainChanged);
3952
+ chainChanged = void 0;
3953
+ }
3954
+ if (disconnect) {
3955
+ provider.removeListener("disconnect", disconnect);
3956
+ disconnect = void 0;
3957
+ }
3958
+ if (sessionDelete) {
3959
+ provider.removeListener("session_delete", sessionDelete);
3960
+ sessionDelete = void 0;
3961
+ }
3962
+ if (!connect) {
3963
+ connect = this.onConnect.bind(this);
3964
+ provider.on("connect", connect);
3965
+ }
3966
+ },
3967
+ onDisplayUri(uri) {
3968
+ config.emitter.emit("message", { type: "display_uri", data: uri });
3969
+ },
3970
+ onSessionDelete() {
3971
+ this.onDisconnect();
3972
+ },
3973
+ getNamespaceChainsIds() {
3974
+ if (!provider_) return [];
3975
+ const chainIds = provider_.session?.namespaces[NAMESPACE]?.accounts?.map(
3976
+ (account) => Number.parseInt(account.split(":")[1] || "")
3977
+ );
3978
+ return chainIds ?? [];
3979
+ },
3980
+ async getRequestedChainsIds() {
3981
+ return await config.storage?.getItem(this.requestedChainsStorageKey) ?? [];
3982
+ },
3983
+ /**
3984
+ * Checks if the target chains match the chains that were
3985
+ * initially requested by the connector for the WalletConnect session.
3986
+ * If there is a mismatch, this means that the chains on the connector
3987
+ * are considered stale, and need to be revalidated at a later point (via
3988
+ * connection).
3989
+ *
3990
+ * There may be a scenario where a dapp adds a chain to the
3991
+ * connector later on, however, this chain will not have been approved or rejected
3992
+ * by the wallet. In this case, the chain is considered stale.
3993
+ */
3994
+ async isChainsStale() {
3995
+ if (!isNewChainsStale) return false;
3996
+ const connectorChains = config.chains.map((x) => x.id);
3997
+ const namespaceChains = this.getNamespaceChainsIds();
3998
+ if (namespaceChains.length && !namespaceChains.some((id) => connectorChains.includes(id))) return false;
3999
+ const requestedChains = await this.getRequestedChainsIds();
4000
+ return !connectorChains.every((id) => requestedChains.includes(id));
4001
+ },
4002
+ async setRequestedChainsIds(chains) {
4003
+ await config.storage?.setItem(this.requestedChainsStorageKey, chains);
4004
+ },
4005
+ get requestedChainsStorageKey() {
4006
+ return `${this.id}.requestedChains`;
4007
+ }
4008
+ }));
4009
+ }
4010
+ function extractRpcUrls(parameters) {
4011
+ const { chain } = parameters;
4012
+ const fallbackUrl = chain.rpcUrls.default.http[0];
4013
+ if (!parameters.transports) return [fallbackUrl];
4014
+ const transport = parameters.transports?.[chain.id]?.({ chain });
4015
+ const transports = transport?.value?.transports || [transport];
4016
+ return transports.map(({ value }) => value?.url || fallbackUrl);
2380
4017
  }
2381
4018
 
2382
4019
  // src/createWagmiConfig.ts
2383
4020
  function createWagmiConfig(config) {
2384
- const wallets = getWallets(config);
2385
- const connectors = connectorsForWallets(wallets, {
2386
- appName: config.appName,
2387
- projectId: config.walletConnectProjectId
2388
- });
2389
- return createConfig({
2390
- connectors,
4021
+ const connectors = [];
4022
+ const shouldUseSafeConnector = !(typeof window === "undefined") && window?.parent !== window;
4023
+ if (shouldUseSafeConnector) {
4024
+ connectors.push(
4025
+ safe({
4026
+ allowedDomains: [/gnosis-safe.io$/, /app.safe.global$/]
4027
+ })
4028
+ );
4029
+ }
4030
+ connectors.push(
4031
+ injected({ target: "metaMask" }),
4032
+ coinbaseWallet({
4033
+ appName: config.appName,
4034
+ overrideIsMetaMask: false
4035
+ })
4036
+ );
4037
+ if (config.walletConnectProjectId) {
4038
+ connectors.push(
4039
+ walletConnect({
4040
+ showQrModal: false,
4041
+ projectId: config.walletConnectProjectId
4042
+ })
4043
+ );
4044
+ }
4045
+ const configParams = getDefaultConfig({
2391
4046
  chains: config.chains,
2392
4047
  transports: config.transports,
2393
- pollingInterval: config.pollingInterval
2394
- });
2395
- }
2396
-
2397
- // src/getConnectors.ts
2398
- import { connectorsForWallets as connectorsForWallets2 } from "@rainbow-me/rainbowkit";
2399
- function getConnectors({
2400
- wallets,
2401
- ...config
2402
- }) {
2403
- return connectorsForWallets2(wallets ?? getWallets(config), {
4048
+ pollingInterval: config.pollingInterval,
2404
4049
  appName: config.appName,
2405
- projectId: config.walletConnectProjectId
4050
+ walletConnectProjectId: config.walletConnectProjectId,
4051
+ enableFamily: false,
4052
+ connectors
2406
4053
  });
4054
+ return createConfig(configParams);
2407
4055
  }
2408
4056
 
2409
4057
  // src/validateSigner.ts
@@ -2454,8 +4102,6 @@ export {
2454
4102
  EntryKitProvider,
2455
4103
  createWagmiConfig,
2456
4104
  defineConfig,
2457
- getConnectors,
2458
- getWallets,
2459
4105
  internal_validateSigner,
2460
4106
  useAccountModal,
2461
4107
  useEntryKitConfig,