@latticexyz/entrykit 2.2.22-6bb6a79dff407a5adf951343d9c37315816bac4b → 2.2.22-725f1aed27b397ad153bec254b2530eb20d2d743
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tsup/exports/internal.d.ts +2 -18
- package/dist/tsup/exports/internal.js +1552 -406
- package/dist/tsup/exports/internal.js.map +1 -1
- package/package.json +14 -12
|
@@ -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\\.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-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\\.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.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-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\\/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-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\\: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\\: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
|
|
@@ -201,6 +204,7 @@ function getBundlerTransport(chain) {
|
|
|
201
204
|
}
|
|
202
205
|
|
|
203
206
|
// src/EntryKitConfigProvider.tsx
|
|
207
|
+
import { ConnectKitProvider } from "connectkit";
|
|
204
208
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
205
209
|
var Context2 = createContext2(null);
|
|
206
210
|
function EntryKitConfigProvider({ config, children }) {
|
|
@@ -211,14 +215,14 @@ function EntryKitConfigProvider({ config, children }) {
|
|
|
211
215
|
if (!chain) throw new Error(`Could not find configured chain for chain ID ${config.chainId}.`);
|
|
212
216
|
getBundlerTransport(chain);
|
|
213
217
|
return /* @__PURE__ */ jsx2(
|
|
214
|
-
|
|
218
|
+
ConnectKitProvider,
|
|
215
219
|
{
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
//
|
|
220
|
+
theme: "midnight",
|
|
221
|
+
options: {
|
|
222
|
+
// Prevent Wagmi trying to switch chains after connection
|
|
223
|
+
// https://github.com/wevm/wagmi/blob/f5b717ccf8a5b283263cadc984ba00b354bcefae/packages/core/src/connectors/injected.ts#L174-L182
|
|
224
|
+
initialChainId: 0
|
|
220
225
|
},
|
|
221
|
-
theme: midnightTheme({ borderRadius: "none" }),
|
|
222
226
|
children: /* @__PURE__ */ jsx2(Context2.Provider, { value: { ...config, chain }, children })
|
|
223
227
|
}
|
|
224
228
|
);
|
|
@@ -269,7 +273,9 @@ var Shadow = forwardRef(function Shadow2({ mode, children }, forwardedRef) {
|
|
|
269
273
|
inset: "0",
|
|
270
274
|
width: "100%",
|
|
271
275
|
height: "100%",
|
|
272
|
-
|
|
276
|
+
// one less than ConnectKit's modal z-index
|
|
277
|
+
// so that ConnectKit can overlap properly
|
|
278
|
+
zIndex: "2147483645"
|
|
273
279
|
} : frameSize.width && frameSize.height ? {
|
|
274
280
|
all: "unset",
|
|
275
281
|
display: "inline-grid",
|
|
@@ -368,13 +374,10 @@ function useAccountModal() {
|
|
|
368
374
|
}
|
|
369
375
|
|
|
370
376
|
// src/AccountModal.tsx
|
|
371
|
-
import { twMerge as
|
|
377
|
+
import { twMerge as twMerge19 } from "tailwind-merge";
|
|
372
378
|
|
|
373
379
|
// src/AccountModalContent.tsx
|
|
374
|
-
import { useAccount as
|
|
375
|
-
|
|
376
|
-
// src/ConnectWallet.tsx
|
|
377
|
-
import { useAccount } from "wagmi";
|
|
380
|
+
import { useAccount as useAccount7, useConnectorClient } from "wagmi";
|
|
378
381
|
|
|
379
382
|
// src/ui/Button.tsx
|
|
380
383
|
import { twMerge as twMerge3 } from "tailwind-merge";
|
|
@@ -441,7 +444,7 @@ var Button = ({ pending, variant, type, className, children, disabled, ...props
|
|
|
441
444
|
};
|
|
442
445
|
|
|
443
446
|
// src/ConnectWallet.tsx
|
|
444
|
-
import {
|
|
447
|
+
import { useModal } from "connectkit";
|
|
445
448
|
|
|
446
449
|
// src/icons/Logo.tsx
|
|
447
450
|
import { twMerge as twMerge4 } from "tailwind-merge";
|
|
@@ -501,7 +504,7 @@ function AppInfo() {
|
|
|
501
504
|
return /* @__PURE__ */ jsxs6("div", { className: "flex-grow flex flex-col items-center justify-center gap-2", children: [
|
|
502
505
|
/* @__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
506
|
// TODO: swap with favicon
|
|
504
|
-
/* @__PURE__ */ jsx8(Logo, { className: "w-full h-full text-orange-500
|
|
507
|
+
/* @__PURE__ */ jsx8(Logo, { className: "w-full h-full text-orange-500 bg-neutral-800" })
|
|
505
508
|
) : null }),
|
|
506
509
|
/* @__PURE__ */ jsx8("div", { className: "text-2xl text-white text-center", children: appName })
|
|
507
510
|
] });
|
|
@@ -509,18 +512,17 @@ function AppInfo() {
|
|
|
509
512
|
|
|
510
513
|
// src/ConnectWallet.tsx
|
|
511
514
|
import { twMerge as twMerge5 } from "tailwind-merge";
|
|
512
|
-
import { useEffect as useEffect3,
|
|
515
|
+
import { useEffect as useEffect3, useRef as useRef2 } from "react";
|
|
513
516
|
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
514
517
|
function ConnectWallet() {
|
|
515
|
-
const
|
|
516
|
-
const
|
|
517
|
-
const [hasAutoOpened, setHasAutoOpened] = useState2(false);
|
|
518
|
+
const { open, setOpen } = useModal();
|
|
519
|
+
const hasAutoOpenedRef = useRef2(false);
|
|
518
520
|
useEffect3(() => {
|
|
519
|
-
if (!
|
|
520
|
-
|
|
521
|
-
|
|
521
|
+
if (!open && !hasAutoOpenedRef.current) {
|
|
522
|
+
setOpen(true);
|
|
523
|
+
hasAutoOpenedRef.current = true;
|
|
522
524
|
}
|
|
523
|
-
}, [
|
|
525
|
+
}, [open, setOpen]);
|
|
524
526
|
return /* @__PURE__ */ jsxs7(
|
|
525
527
|
"div",
|
|
526
528
|
{
|
|
@@ -532,8 +534,7 @@ function ConnectWallet() {
|
|
|
532
534
|
{
|
|
533
535
|
variant: "secondary",
|
|
534
536
|
className: "self-auto flex justify-center",
|
|
535
|
-
|
|
536
|
-
onClick: openConnectModal,
|
|
537
|
+
onClick: () => setOpen(true),
|
|
537
538
|
autoFocus: true,
|
|
538
539
|
children: "Connect wallet"
|
|
539
540
|
},
|
|
@@ -545,16 +546,39 @@ function ConnectWallet() {
|
|
|
545
546
|
}
|
|
546
547
|
|
|
547
548
|
// src/onboarding/ConnectedSteps.tsx
|
|
548
|
-
import { useEffect as
|
|
549
|
-
import { twMerge as
|
|
549
|
+
import { useEffect as useEffect15, useMemo as useMemo4, useRef as useRef5, useState as useState5 } from "react";
|
|
550
|
+
import { twMerge as twMerge17 } from "tailwind-merge";
|
|
550
551
|
|
|
551
|
-
// src/onboarding/
|
|
552
|
-
import {
|
|
553
|
-
|
|
552
|
+
// src/onboarding/usePrerequisites.ts
|
|
553
|
+
import { useClient as useClient6, useConfig } from "wagmi";
|
|
554
|
+
import { getBalanceQueryOptions as getBalanceQueryOptions2 } from "wagmi/query";
|
|
555
|
+
import { queryOptions as queryOptions6, skipToken as skipToken6, useQuery as useQuery7, useQueryClient } from "@tanstack/react-query";
|
|
556
|
+
|
|
557
|
+
// src/getPaymaster.ts
|
|
558
|
+
function getPaymaster(chain) {
|
|
559
|
+
const contracts = chain.contracts ?? {};
|
|
560
|
+
if ("quarryPaymaster" in contracts && contracts.quarryPaymaster != null) {
|
|
561
|
+
if ("address" in contracts.quarryPaymaster) {
|
|
562
|
+
return {
|
|
563
|
+
type: "quarry",
|
|
564
|
+
address: contracts.quarryPaymaster.address,
|
|
565
|
+
isGasPass: !!chain.rpcUrls.quarryPassIssuer?.http?.[0]
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
if ("paymaster" in contracts && contracts.paymaster != null) {
|
|
570
|
+
if ("address" in contracts.paymaster) {
|
|
571
|
+
return {
|
|
572
|
+
type: "simple",
|
|
573
|
+
address: contracts.paymaster.address
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
554
578
|
|
|
555
579
|
// src/onboarding/quarry/useAllowance.ts
|
|
556
580
|
import { useClient } from "wagmi";
|
|
557
|
-
import { queryOptions, useQuery as useQuery2 } from "@tanstack/react-query";
|
|
581
|
+
import { queryOptions, skipToken, useQuery as useQuery2 } from "@tanstack/react-query";
|
|
558
582
|
|
|
559
583
|
// src/quarry/getAllowance.ts
|
|
560
584
|
import { numberToHex as numberToHex2 } from "viem";
|
|
@@ -565,7 +589,10 @@ import { parseAbi } from "viem";
|
|
|
565
589
|
var paymasterAbi = parseAbi([
|
|
566
590
|
"error SpenderSystem_AlreadyRegistered(address spender, address user)",
|
|
567
591
|
"error SpenderSystem_HasOwnBalance(address spender)",
|
|
568
|
-
"
|
|
592
|
+
"error BalanceSystem_BalanceTooHigh(address user, uint256 balance, uint256 max)",
|
|
593
|
+
"error BalanceSystem_InsufficientBalance(address user, uint256 amount, uint256 balance)",
|
|
594
|
+
"function registerSpender(address spender)",
|
|
595
|
+
"function depositTo(address to) payable"
|
|
569
596
|
]);
|
|
570
597
|
var paymasterConfig = defineStore({
|
|
571
598
|
namespaces: {
|
|
@@ -579,6 +606,13 @@ var paymasterConfig = defineStore({
|
|
|
579
606
|
},
|
|
580
607
|
key: ["user"]
|
|
581
608
|
},
|
|
609
|
+
Balance: {
|
|
610
|
+
schema: {
|
|
611
|
+
user: "address",
|
|
612
|
+
balance: "uint256"
|
|
613
|
+
},
|
|
614
|
+
key: ["user"]
|
|
615
|
+
},
|
|
582
616
|
Grantor: {
|
|
583
617
|
schema: {
|
|
584
618
|
grantor: "address",
|
|
@@ -628,29 +662,6 @@ var paymasterTables = paymasterConfig.namespaces.root.tables;
|
|
|
628
662
|
import { getRecord, getStaticDataLocation } from "@latticexyz/store/internal";
|
|
629
663
|
import { getKeyTuple } from "@latticexyz/protocol-parser/internal";
|
|
630
664
|
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
665
|
async function getAllowance({ client, userAddress }) {
|
|
655
666
|
const paymaster = getPaymaster(client.chain);
|
|
656
667
|
if (paymaster?.type !== "quarry") return null;
|
|
@@ -684,13 +695,10 @@ function getAllowanceQueryOptions({
|
|
|
684
695
|
client,
|
|
685
696
|
userAddress
|
|
686
697
|
}) {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
client && userAddress ? {
|
|
690
|
-
|
|
691
|
-
queryFn: () => getAllowance({ client, userAddress })
|
|
692
|
-
} : { queryKey, enabled: false }
|
|
693
|
-
);
|
|
698
|
+
return queryOptions({
|
|
699
|
+
queryKey: ["getAllowance", client?.uid, userAddress],
|
|
700
|
+
queryFn: client && userAddress ? () => getAllowance({ client, userAddress }) : skipToken
|
|
701
|
+
});
|
|
694
702
|
}
|
|
695
703
|
function useAllowance(userAddress) {
|
|
696
704
|
const { chainId } = useEntryKitConfig();
|
|
@@ -700,7 +708,7 @@ function useAllowance(userAddress) {
|
|
|
700
708
|
|
|
701
709
|
// src/onboarding/quarry/useSpender.ts
|
|
702
710
|
import { useClient as useClient2 } from "wagmi";
|
|
703
|
-
import { queryOptions as queryOptions2, useQuery as useQuery3 } from "@tanstack/react-query";
|
|
711
|
+
import { queryOptions as queryOptions2, skipToken as skipToken2, useQuery as useQuery3 } from "@tanstack/react-query";
|
|
704
712
|
|
|
705
713
|
// src/onboarding/quarry/getSpender.ts
|
|
706
714
|
import { getRecord as getRecord2 } from "@latticexyz/store/internal";
|
|
@@ -722,18 +730,15 @@ function getSpenderQueryOptions({
|
|
|
722
730
|
userAddress,
|
|
723
731
|
sessionAddress
|
|
724
732
|
}) {
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
client && userAddress && sessionAddress ? {
|
|
728
|
-
|
|
729
|
-
queryFn: () => getSpender({ client, userAddress, sessionAddress })
|
|
730
|
-
} : { queryKey, enabled: false }
|
|
731
|
-
);
|
|
733
|
+
return queryOptions2({
|
|
734
|
+
queryKey: ["getSpender", client?.uid, userAddress, sessionAddress],
|
|
735
|
+
queryFn: client && userAddress && sessionAddress ? () => getSpender({ client, userAddress, sessionAddress }) : skipToken2
|
|
736
|
+
});
|
|
732
737
|
}
|
|
733
738
|
|
|
734
739
|
// src/onboarding/useDelegation.ts
|
|
735
740
|
import { useClient as useClient3 } from "wagmi";
|
|
736
|
-
import { queryOptions as queryOptions3, useQuery as useQuery4 } from "@tanstack/react-query";
|
|
741
|
+
import { queryOptions as queryOptions3, skipToken as skipToken3, useQuery as useQuery4 } from "@tanstack/react-query";
|
|
737
742
|
|
|
738
743
|
// src/onboarding/getDelegation.ts
|
|
739
744
|
import { getRecord as getRecord3 } from "@latticexyz/store/internal";
|
|
@@ -776,22 +781,15 @@ function getDelegationQueryOptions({
|
|
|
776
781
|
userAddress,
|
|
777
782
|
sessionAddress
|
|
778
783
|
}) {
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
client && userAddress && sessionAddress ? {
|
|
782
|
-
|
|
783
|
-
queryFn: () => getDelegation({ client, worldAddress, userAddress, sessionAddress })
|
|
784
|
-
} : { queryKey, enabled: false }
|
|
785
|
-
);
|
|
784
|
+
return queryOptions3({
|
|
785
|
+
queryKey: ["getDelegation", client?.uid, worldAddress, userAddress, sessionAddress],
|
|
786
|
+
queryFn: client && userAddress && sessionAddress ? () => getDelegation({ client, worldAddress, userAddress, sessionAddress }) : skipToken3
|
|
787
|
+
});
|
|
786
788
|
}
|
|
787
789
|
|
|
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
790
|
// src/useSessionAccount.ts
|
|
793
791
|
import { useClient as useClient4 } from "wagmi";
|
|
794
|
-
import { queryOptions as queryOptions4, useQuery as useQuery5 } from "@tanstack/react-query";
|
|
792
|
+
import { queryOptions as queryOptions4, skipToken as skipToken4, useQuery as useQuery5 } from "@tanstack/react-query";
|
|
795
793
|
|
|
796
794
|
// src/getSessionAccount.ts
|
|
797
795
|
import { toSimpleSmartAccount } from "permissionless/accounts";
|
|
@@ -855,20 +853,50 @@ function getSessionAccountQueryOptions({
|
|
|
855
853
|
client,
|
|
856
854
|
userAddress
|
|
857
855
|
}) {
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
client && userAddress ? {
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
856
|
+
return queryOptions4({
|
|
857
|
+
queryKey: ["getSessionAccount", client?.uid, userAddress],
|
|
858
|
+
queryFn: client && userAddress ? () => getSessionAccount({ client, userAddress }) : skipToken4,
|
|
859
|
+
staleTime: Infinity,
|
|
860
|
+
// TODO: replace with function to retry only connection errors
|
|
861
|
+
retry: false
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
// src/onboarding/quarry/useBalance.ts
|
|
866
|
+
import { useClient as useClient5 } from "wagmi";
|
|
867
|
+
import { queryOptions as queryOptions5, skipToken as skipToken5, useQuery as useQuery6 } from "@tanstack/react-query";
|
|
868
|
+
|
|
869
|
+
// src/quarry/getBalance.ts
|
|
870
|
+
import { getRecord as getRecord4 } from "@latticexyz/store/internal";
|
|
871
|
+
async function getBalance({ client, userAddress }) {
|
|
872
|
+
const paymaster = getPaymaster(client.chain);
|
|
873
|
+
if (paymaster?.type !== "quarry") return null;
|
|
874
|
+
const record = await getRecord4(client, {
|
|
875
|
+
address: paymaster.address,
|
|
876
|
+
table: paymasterTables.Balance,
|
|
877
|
+
key: { user: userAddress },
|
|
878
|
+
blockTag: "pending"
|
|
879
|
+
});
|
|
880
|
+
return record.balance;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
// src/onboarding/quarry/useBalance.ts
|
|
884
|
+
function getBalanceQueryOptions({
|
|
885
|
+
client,
|
|
886
|
+
userAddress
|
|
887
|
+
}) {
|
|
888
|
+
return queryOptions5({
|
|
889
|
+
queryKey: ["getBalance", client?.uid, userAddress],
|
|
890
|
+
queryFn: client && userAddress ? () => getBalance({ client, userAddress }) : skipToken5
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
function useBalance(userAddress) {
|
|
894
|
+
const { chainId } = useEntryKitConfig();
|
|
895
|
+
const client = useClient5({ chainId });
|
|
896
|
+
return useQuery6(getBalanceQueryOptions({ client, userAddress }));
|
|
868
897
|
}
|
|
869
898
|
|
|
870
899
|
// src/onboarding/usePrerequisites.ts
|
|
871
|
-
import { getBalanceQueryOptions } from "wagmi/query";
|
|
872
900
|
function getPrequisitesQueryOptions({
|
|
873
901
|
queryClient,
|
|
874
902
|
config,
|
|
@@ -876,46 +904,46 @@ function getPrequisitesQueryOptions({
|
|
|
876
904
|
userAddress,
|
|
877
905
|
worldAddress
|
|
878
906
|
}) {
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
client && userAddress ? {
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
);
|
|
907
|
+
return queryOptions6({
|
|
908
|
+
queryKey: ["getPrerequisites", client?.uid, userAddress],
|
|
909
|
+
queryFn: client && userAddress ? async () => {
|
|
910
|
+
const paymaster = getPaymaster(client.chain);
|
|
911
|
+
const {
|
|
912
|
+
account: { address: sessionAddress }
|
|
913
|
+
} = await queryClient.fetchQuery(getSessionAccountQueryOptions({ client, userAddress }));
|
|
914
|
+
const [sessionBalance, allowance, spender, quarryBalance, hasDelegation] = await Promise.all([
|
|
915
|
+
!paymaster ? queryClient.fetchQuery(
|
|
916
|
+
getBalanceQueryOptions2(config, { chainId: client.chain.id, address: sessionAddress })
|
|
917
|
+
) : null,
|
|
918
|
+
paymaster?.type === "quarry" ? queryClient.fetchQuery(getAllowanceQueryOptions({ client, userAddress })) : null,
|
|
919
|
+
paymaster?.type === "quarry" ? queryClient.fetchQuery(getSpenderQueryOptions({ client, userAddress, sessionAddress })) : null,
|
|
920
|
+
paymaster?.type === "quarry" ? queryClient.fetchQuery(getBalanceQueryOptions({ client, userAddress })) : null,
|
|
921
|
+
queryClient.fetchQuery(getDelegationQueryOptions({ client, worldAddress, userAddress, sessionAddress }))
|
|
922
|
+
]);
|
|
923
|
+
const hasAllowance = allowance == null || allowance > 0n;
|
|
924
|
+
const isSpender = spender == null ? true : spender;
|
|
925
|
+
const hasGasBalance = sessionBalance == null || sessionBalance.value > 0n;
|
|
926
|
+
const hasQuarryGasBalance = quarryBalance == null || quarryBalance > 0n;
|
|
927
|
+
return {
|
|
928
|
+
sessionAddress,
|
|
929
|
+
hasAllowance,
|
|
930
|
+
isSpender,
|
|
931
|
+
hasGasBalance,
|
|
932
|
+
hasQuarryGasBalance,
|
|
933
|
+
hasDelegation,
|
|
934
|
+
// we intentionally don't enforce an allowance/gas balance here
|
|
935
|
+
complete: isSpender && hasDelegation
|
|
936
|
+
};
|
|
937
|
+
} : skipToken6,
|
|
938
|
+
retry: false
|
|
939
|
+
});
|
|
912
940
|
}
|
|
913
941
|
function usePrerequisites(userAddress) {
|
|
914
942
|
const queryClient = useQueryClient();
|
|
915
943
|
const config = useConfig();
|
|
916
944
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
917
|
-
const client =
|
|
918
|
-
const prereqs =
|
|
945
|
+
const client = useClient6({ chainId });
|
|
946
|
+
const prereqs = useQuery7(
|
|
919
947
|
getPrequisitesQueryOptions({
|
|
920
948
|
queryClient,
|
|
921
949
|
config,
|
|
@@ -932,10 +960,10 @@ function usePrerequisites(userAddress) {
|
|
|
932
960
|
import { useDisconnect } from "wagmi";
|
|
933
961
|
|
|
934
962
|
// src/useENS.ts
|
|
935
|
-
import { useQuery as
|
|
963
|
+
import { useQuery as useQuery8 } from "@tanstack/react-query";
|
|
936
964
|
function useENS(address) {
|
|
937
965
|
const normalizedAddress = address?.toLowerCase();
|
|
938
|
-
return
|
|
966
|
+
return useQuery8({
|
|
939
967
|
enabled: !!normalizedAddress,
|
|
940
968
|
queryKey: ["ens", normalizedAddress],
|
|
941
969
|
queryFn: async () => {
|
|
@@ -1054,8 +1082,11 @@ function Wallet({ isActive, isExpanded, userAddress }) {
|
|
|
1054
1082
|
] });
|
|
1055
1083
|
}
|
|
1056
1084
|
|
|
1057
|
-
// src/onboarding/quarry/
|
|
1085
|
+
// src/onboarding/quarry/Allowance.tsx
|
|
1058
1086
|
import { parseEther as parseEther3 } from "viem";
|
|
1087
|
+
|
|
1088
|
+
// src/onboarding/quarry/useClaimGasPass.ts
|
|
1089
|
+
import { parseEther as parseEther2 } from "viem";
|
|
1059
1090
|
import { useMutation, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
1060
1091
|
|
|
1061
1092
|
// src/quarry/transports/quarryPassIssuer.ts
|
|
@@ -1085,11 +1116,11 @@ async function claimGasPass({ chain, userAddress }) {
|
|
|
1085
1116
|
}
|
|
1086
1117
|
|
|
1087
1118
|
// src/onboarding/quarry/useClaimGasPass.ts
|
|
1088
|
-
import { useClient as
|
|
1119
|
+
import { useClient as useClient7 } from "wagmi";
|
|
1089
1120
|
function useClaimGasPass() {
|
|
1090
1121
|
const queryClient = useQueryClient2();
|
|
1091
1122
|
const { chain } = useEntryKitConfig();
|
|
1092
|
-
const client =
|
|
1123
|
+
const client = useClient7({ chainId: chain.id });
|
|
1093
1124
|
const mutationKey = ["claimGasPass", chain.id];
|
|
1094
1125
|
return useMutation({
|
|
1095
1126
|
retry: 0,
|
|
@@ -1097,7 +1128,7 @@ function useClaimGasPass() {
|
|
|
1097
1128
|
mutationFn: async (userAddress) => {
|
|
1098
1129
|
if (chain.id === 31337) {
|
|
1099
1130
|
if (!client) throw new Error("No client?");
|
|
1100
|
-
await setAllowanceSlot({ client, userAddress, allowance:
|
|
1131
|
+
await setAllowanceSlot({ client, userAddress, allowance: parseEther2("1") });
|
|
1101
1132
|
} else {
|
|
1102
1133
|
await claimGasPass({ chain, userAddress });
|
|
1103
1134
|
}
|
|
@@ -1172,7 +1203,7 @@ function Allowance({ isActive, isExpanded, userAddress }) {
|
|
|
1172
1203
|
const claimGasPass2 = useShowMutationError(useClaimGasPass());
|
|
1173
1204
|
useEffect6(() => {
|
|
1174
1205
|
const timer = setTimeout(() => {
|
|
1175
|
-
if (isActive && claimGasPass2.status === "idle" && allowance.isSuccess && allowance.data != null && allowance.data <
|
|
1206
|
+
if (isActive && claimGasPass2.status === "idle" && allowance.isSuccess && allowance.data != null && allowance.data < parseEther3("0.01")) {
|
|
1176
1207
|
claimGasPass2.mutate(userAddress);
|
|
1177
1208
|
}
|
|
1178
1209
|
});
|
|
@@ -1200,6 +1231,9 @@ function Allowance({ isActive, isExpanded, userAddress }) {
|
|
|
1200
1231
|
] });
|
|
1201
1232
|
}
|
|
1202
1233
|
|
|
1234
|
+
// src/onboarding/Session.tsx
|
|
1235
|
+
import { useEffect as useEffect7 } from "react";
|
|
1236
|
+
|
|
1203
1237
|
// src/onboarding/useSetupSession.ts
|
|
1204
1238
|
import { encodeFunctionData } from "viem";
|
|
1205
1239
|
import { useMutation as useMutation2, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
|
|
@@ -1213,11 +1247,12 @@ function defineCall(call) {
|
|
|
1213
1247
|
}
|
|
1214
1248
|
|
|
1215
1249
|
// src/onboarding/useSetupSession.ts
|
|
1216
|
-
import { useClient as
|
|
1250
|
+
import { useClient as useClient8 } from "wagmi";
|
|
1217
1251
|
import { resourceToHex as resourceToHex2 } from "@latticexyz/common";
|
|
1218
1252
|
import IBaseWorldAbi from "@latticexyz/world/out/IBaseWorld.sol/IBaseWorld.abi.json";
|
|
1219
1253
|
|
|
1220
1254
|
// src/utils/callWithSignature.ts
|
|
1255
|
+
import { parseErc6492Signature } from "viem";
|
|
1221
1256
|
import { writeContract as viem_writeContract } from "viem/actions";
|
|
1222
1257
|
import { getAction as getAction3 } from "viem/utils";
|
|
1223
1258
|
|
|
@@ -1225,7 +1260,7 @@ import { getAction as getAction3 } from "viem/utils";
|
|
|
1225
1260
|
import { toHex } from "viem";
|
|
1226
1261
|
import { signTypedData } from "viem/actions";
|
|
1227
1262
|
import { callWithSignatureTypes } from "@latticexyz/world-module-callwithsignature/internal";
|
|
1228
|
-
import { getRecord as
|
|
1263
|
+
import { getRecord as getRecord5 } from "@latticexyz/store/internal";
|
|
1229
1264
|
import moduleConfig from "@latticexyz/world-module-callwithsignature/mud.config";
|
|
1230
1265
|
import { hexToResource } from "@latticexyz/common";
|
|
1231
1266
|
import { getAction as getAction2 } from "viem/utils";
|
|
@@ -1237,7 +1272,7 @@ async function signCall({
|
|
|
1237
1272
|
nonce: initialNonce,
|
|
1238
1273
|
client
|
|
1239
1274
|
}) {
|
|
1240
|
-
const nonce = initialNonce ?? (client ? (await
|
|
1275
|
+
const nonce = initialNonce ?? (client ? (await getRecord5(client, {
|
|
1241
1276
|
address: worldAddress,
|
|
1242
1277
|
table: moduleConfig.tables.CallWithSignatureNonces,
|
|
1243
1278
|
key: { signer: userClient.account.address },
|
|
@@ -1272,7 +1307,13 @@ async function callWithSignature({
|
|
|
1272
1307
|
sessionClient,
|
|
1273
1308
|
...opts
|
|
1274
1309
|
}) {
|
|
1275
|
-
const
|
|
1310
|
+
const rawSignature = await signCall(opts);
|
|
1311
|
+
const { address, signature } = parseErc6492Signature(rawSignature);
|
|
1312
|
+
if (address != null) {
|
|
1313
|
+
throw new Error(
|
|
1314
|
+
"ERC-6492 signatures, like from Coinbase Smart Wallet, are not yet supported. Try using a different wallet?"
|
|
1315
|
+
);
|
|
1316
|
+
}
|
|
1276
1317
|
return getAction3(
|
|
1277
1318
|
sessionClient,
|
|
1278
1319
|
viem_writeContract,
|
|
@@ -1290,7 +1331,7 @@ import { systemsConfig as worldSystemsConfig } from "@latticexyz/world/mud.confi
|
|
|
1290
1331
|
function useSetupSession({ userClient }) {
|
|
1291
1332
|
const queryClient = useQueryClient3();
|
|
1292
1333
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
1293
|
-
const client =
|
|
1334
|
+
const client = useClient8({ chainId });
|
|
1294
1335
|
const mutationKey = ["setupSession", client?.chain.id, userClient.account.address];
|
|
1295
1336
|
return useMutation2({
|
|
1296
1337
|
retry: 0,
|
|
@@ -1396,14 +1437,12 @@ function useSetupSession({ userClient }) {
|
|
|
1396
1437
|
});
|
|
1397
1438
|
}
|
|
1398
1439
|
|
|
1399
|
-
// src/onboarding/Session.tsx
|
|
1400
|
-
import { useEffect as useEffect7 } from "react";
|
|
1401
|
-
|
|
1402
1440
|
// src/useSessionClient.ts
|
|
1403
|
-
import { useClient as
|
|
1441
|
+
import { useClient as useClient9 } from "wagmi";
|
|
1404
1442
|
import {
|
|
1405
|
-
queryOptions as
|
|
1406
|
-
|
|
1443
|
+
queryOptions as queryOptions7,
|
|
1444
|
+
skipToken as skipToken7,
|
|
1445
|
+
useQuery as useQuery9,
|
|
1407
1446
|
useQueryClient as useQueryClient4
|
|
1408
1447
|
} from "@tanstack/react-query";
|
|
1409
1448
|
|
|
@@ -1488,32 +1527,29 @@ function getSessionClientQueryOptions({
|
|
|
1488
1527
|
userAddress,
|
|
1489
1528
|
worldAddress
|
|
1490
1529
|
}) {
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
userAddress ? {
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
retry: false
|
|
1509
|
-
} : { queryKey, enabled: false }
|
|
1510
|
-
);
|
|
1530
|
+
return queryOptions7({
|
|
1531
|
+
queryKey: ["getSessionClient", client?.uid, userAddress, worldAddress],
|
|
1532
|
+
queryFn: userAddress ? async () => {
|
|
1533
|
+
const { account: sessionAccount, signer: sessionSigner } = await queryClient.fetchQuery(
|
|
1534
|
+
getSessionAccountQueryOptions({ client, userAddress })
|
|
1535
|
+
);
|
|
1536
|
+
return await getSessionClient({
|
|
1537
|
+
sessionAccount,
|
|
1538
|
+
sessionSigner,
|
|
1539
|
+
userAddress,
|
|
1540
|
+
worldAddress
|
|
1541
|
+
});
|
|
1542
|
+
} : skipToken7,
|
|
1543
|
+
staleTime: Infinity,
|
|
1544
|
+
// TODO: replace with function to retry only connection errors
|
|
1545
|
+
retry: false
|
|
1546
|
+
});
|
|
1511
1547
|
}
|
|
1512
1548
|
function useSessionClient(userAddress) {
|
|
1513
1549
|
const queryClient = useQueryClient4();
|
|
1514
1550
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
1515
|
-
const client =
|
|
1516
|
-
return
|
|
1551
|
+
const client = useClient9({ chainId });
|
|
1552
|
+
return useQuery9(
|
|
1517
1553
|
getSessionClientQueryOptions({
|
|
1518
1554
|
queryClient,
|
|
1519
1555
|
client,
|
|
@@ -1529,9 +1565,11 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
|
|
|
1529
1565
|
const sessionClient = useShowQueryError(useSessionClient(userClient.account.address));
|
|
1530
1566
|
const setup = useShowMutationError(useSetupSession({ userClient }));
|
|
1531
1567
|
const hasSession = !registerDelegation && !registerDelegation;
|
|
1568
|
+
const { data: prerequisites } = usePrerequisites(userClient.account.address);
|
|
1569
|
+
const { hasAllowance, hasGasBalance, hasQuarryGasBalance } = prerequisites ?? {};
|
|
1532
1570
|
useEffect7(() => {
|
|
1533
1571
|
const timer = setTimeout(() => {
|
|
1534
|
-
if (isActive && setup.status === "idle" && sessionClient.data && !hasSession) {
|
|
1572
|
+
if (isActive && setup.status === "idle" && sessionClient.data && !hasSession && (hasAllowance || hasGasBalance || hasQuarryGasBalance)) {
|
|
1535
1573
|
setup.mutate({
|
|
1536
1574
|
sessionClient: sessionClient.data,
|
|
1537
1575
|
registerSpender,
|
|
@@ -1540,7 +1578,17 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
|
|
|
1540
1578
|
}
|
|
1541
1579
|
});
|
|
1542
1580
|
return () => clearTimeout(timer);
|
|
1543
|
-
}, [
|
|
1581
|
+
}, [
|
|
1582
|
+
hasSession,
|
|
1583
|
+
isActive,
|
|
1584
|
+
registerDelegation,
|
|
1585
|
+
registerSpender,
|
|
1586
|
+
sessionClient,
|
|
1587
|
+
setup,
|
|
1588
|
+
hasAllowance,
|
|
1589
|
+
hasGasBalance,
|
|
1590
|
+
hasQuarryGasBalance
|
|
1591
|
+
]);
|
|
1544
1592
|
return /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-4", children: [
|
|
1545
1593
|
/* @__PURE__ */ jsxs13("div", { className: "flex justify-between gap-4", children: [
|
|
1546
1594
|
/* @__PURE__ */ jsxs13("div", { children: [
|
|
@@ -1568,7 +1616,10 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
|
|
|
1568
1616
|
}
|
|
1569
1617
|
|
|
1570
1618
|
// src/onboarding/GasBalance.tsx
|
|
1571
|
-
import {
|
|
1619
|
+
import { useEffect as useEffect9, useState as useState2 } from "react";
|
|
1620
|
+
import { parseEther as parseEther4 } from "viem";
|
|
1621
|
+
import { useQueryClient as useQueryClient6 } from "@tanstack/react-query";
|
|
1622
|
+
import { useBalance as useBalance2, useWatchBlockNumber } from "wagmi";
|
|
1572
1623
|
|
|
1573
1624
|
// src/data/relayChains.json
|
|
1574
1625
|
var relayChains_default = {
|
|
@@ -1853,11 +1904,11 @@ var relayChains_default = {
|
|
|
1853
1904
|
// src/onboarding/useSetBalance.ts
|
|
1854
1905
|
import { useQueryClient as useQueryClient5, useMutation as useMutation3 } from "@tanstack/react-query";
|
|
1855
1906
|
import { setBalance as setBalance2 } from "viem/actions";
|
|
1856
|
-
import { useClient as
|
|
1907
|
+
import { useClient as useClient10 } from "wagmi";
|
|
1857
1908
|
function useSetBalance() {
|
|
1858
1909
|
const queryClient = useQueryClient5();
|
|
1859
1910
|
const { chainId } = useEntryKitConfig();
|
|
1860
|
-
const client =
|
|
1911
|
+
const client = useClient10({ chainId });
|
|
1861
1912
|
return useMutation3({
|
|
1862
1913
|
retry: 0,
|
|
1863
1914
|
mutationKey: ["setBalance", chainId],
|
|
@@ -1873,21 +1924,93 @@ function useSetBalance() {
|
|
|
1873
1924
|
});
|
|
1874
1925
|
}
|
|
1875
1926
|
|
|
1927
|
+
// src/errors/usePrevious.ts
|
|
1928
|
+
import { useEffect as useEffect8, useRef as useRef3 } from "react";
|
|
1929
|
+
function usePrevious(value, initialValue) {
|
|
1930
|
+
const ref = useRef3();
|
|
1931
|
+
useEffect8(() => {
|
|
1932
|
+
ref.current = { value };
|
|
1933
|
+
}, [value]);
|
|
1934
|
+
return ref.current ? ref.current.value : initialValue;
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
// src/icons/IconSVG.tsx
|
|
1938
|
+
import { twMerge as twMerge7 } from "tailwind-merge";
|
|
1939
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1940
|
+
function IconSVG({ className, children, ...props }) {
|
|
1941
|
+
return /* @__PURE__ */ jsx16(
|
|
1942
|
+
"svg",
|
|
1943
|
+
{
|
|
1944
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1945
|
+
viewBox: "0 0 24 24",
|
|
1946
|
+
fill: "currentColor",
|
|
1947
|
+
className: twMerge7("-my-[0.125em] h-[1.25em] w-[1.25em]", className),
|
|
1948
|
+
...props,
|
|
1949
|
+
children
|
|
1950
|
+
}
|
|
1951
|
+
);
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
// src/icons/CopyIcon.tsx
|
|
1955
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1956
|
+
function CopyIcon(props) {
|
|
1957
|
+
return /* @__PURE__ */ jsx17(IconSVG, { ...props, children: /* @__PURE__ */ jsx17(
|
|
1958
|
+
"path",
|
|
1959
|
+
{
|
|
1960
|
+
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",
|
|
1961
|
+
fill: "none",
|
|
1962
|
+
stroke: "currentColor",
|
|
1963
|
+
strokeWidth: "2",
|
|
1964
|
+
strokeLinecap: "round",
|
|
1965
|
+
strokeLinejoin: "round"
|
|
1966
|
+
}
|
|
1967
|
+
) });
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
// src/icons/CheckIcon.tsx
|
|
1971
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1972
|
+
function CheckIcon(props) {
|
|
1973
|
+
return /* @__PURE__ */ jsx18(IconSVG, { ...props, children: /* @__PURE__ */ jsx18(
|
|
1974
|
+
"path",
|
|
1975
|
+
{
|
|
1976
|
+
d: "M5 13L9 17L19 7",
|
|
1977
|
+
fill: "none",
|
|
1978
|
+
stroke: "currentColor",
|
|
1979
|
+
strokeWidth: "2",
|
|
1980
|
+
strokeLinecap: "round",
|
|
1981
|
+
strokeLinejoin: "round"
|
|
1982
|
+
}
|
|
1983
|
+
) });
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1876
1986
|
// src/onboarding/GasBalance.tsx
|
|
1877
|
-
import { Fragment, jsx as
|
|
1987
|
+
import { Fragment, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1878
1988
|
function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
1989
|
+
const queryClient = useQueryClient6();
|
|
1879
1990
|
const { chain } = useEntryKitConfig();
|
|
1880
|
-
const
|
|
1991
|
+
const [copied, setCopied] = useState2(false);
|
|
1992
|
+
const balance = useShowQueryError(useBalance2({ chainId: chain.id, address: sessionAddress }));
|
|
1993
|
+
const prevBalance = usePrevious(balance.data);
|
|
1881
1994
|
useWatchBlockNumber({ onBlockNumber: () => balance.refetch() });
|
|
1882
1995
|
const setBalance3 = useShowMutationError(useSetBalance());
|
|
1883
1996
|
const relayChain = relayChains_default[chain.id];
|
|
1997
|
+
const handleCopy = () => {
|
|
1998
|
+
navigator.clipboard.writeText(sessionAddress);
|
|
1999
|
+
setCopied(true);
|
|
2000
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
2001
|
+
};
|
|
2002
|
+
useEffect9(() => {
|
|
2003
|
+
if (balance.data != null && prevBalance?.value === 0n && balance.data.value > 0n) {
|
|
2004
|
+
queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] });
|
|
2005
|
+
}
|
|
2006
|
+
}, [balance.data, prevBalance, setBalance3, sessionAddress, queryClient]);
|
|
1884
2007
|
return /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-4", children: [
|
|
1885
2008
|
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between gap-4", children: [
|
|
1886
2009
|
/* @__PURE__ */ jsxs14("div", { children: [
|
|
1887
|
-
/* @__PURE__ */
|
|
1888
|
-
/* @__PURE__ */
|
|
2010
|
+
/* @__PURE__ */ jsx19("div", { children: "Gas balance" }),
|
|
2011
|
+
/* @__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" }) })
|
|
1889
2012
|
] }),
|
|
1890
|
-
chain.id === 31337 ? /* @__PURE__ */
|
|
2013
|
+
chain.id === 31337 ? /* @__PURE__ */ jsx19(
|
|
1891
2014
|
Button,
|
|
1892
2015
|
{
|
|
1893
2016
|
variant: isActive ? "primary" : "tertiary",
|
|
@@ -1896,19 +2019,19 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
1896
2019
|
pending: balance.status === "pending" || setBalance3.status === "pending",
|
|
1897
2020
|
onClick: () => setBalance3.mutate({
|
|
1898
2021
|
address: sessionAddress,
|
|
1899
|
-
value:
|
|
2022
|
+
value: parseEther4("0.01") + (balance.data?.value ?? 0n)
|
|
1900
2023
|
}),
|
|
1901
2024
|
children: "Top up"
|
|
1902
2025
|
}
|
|
1903
2026
|
) : relayChain != null ? (
|
|
1904
2027
|
// TODO: convert this to a <ButtonLink>
|
|
1905
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ jsx19(
|
|
1906
2029
|
"a",
|
|
1907
2030
|
{
|
|
1908
|
-
href: `${relayChain.bridgeUrl}?${new URLSearchParams({ toAddress: sessionAddress })}`,
|
|
2031
|
+
href: `${relayChain.bridgeUrl}?${new URLSearchParams({ toAddress: sessionAddress, amount: "0.01" })}`,
|
|
1909
2032
|
target: "_blank",
|
|
1910
2033
|
rel: "noopener noreferrer",
|
|
1911
|
-
children: /* @__PURE__ */
|
|
2034
|
+
children: /* @__PURE__ */ jsx19(
|
|
1912
2035
|
Button,
|
|
1913
2036
|
{
|
|
1914
2037
|
variant: isActive ? "primary" : "tertiary",
|
|
@@ -1923,11 +2046,23 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
1923
2046
|
) : null
|
|
1924
2047
|
] }),
|
|
1925
2048
|
isExpanded ? /* @__PURE__ */ jsxs14(Fragment, { children: [
|
|
1926
|
-
/* @__PURE__ */
|
|
2049
|
+
/* @__PURE__ */ jsx19("p", { className: "text-sm", children: "Your session's gas balance is used to pay for onchain computation." }),
|
|
1927
2050
|
/* @__PURE__ */ jsxs14("p", { className: "text-sm", children: [
|
|
1928
2051
|
"Send funds to",
|
|
1929
2052
|
" ",
|
|
1930
|
-
/* @__PURE__ */
|
|
2053
|
+
/* @__PURE__ */ jsxs14(
|
|
2054
|
+
"span",
|
|
2055
|
+
{
|
|
2056
|
+
className: "inline-flex items-center gap-1 font-mono text-white cursor-pointer hover:text-white/80 transition-colors",
|
|
2057
|
+
onClick: handleCopy,
|
|
2058
|
+
title: "Click to copy",
|
|
2059
|
+
children: [
|
|
2060
|
+
/* @__PURE__ */ jsx19(TruncatedHex, { hex: sessionAddress }),
|
|
2061
|
+
" ",
|
|
2062
|
+
copied ? /* @__PURE__ */ jsx19(CheckIcon, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ jsx19(CopyIcon, { className: "w-3.5 h-3.5" })
|
|
2063
|
+
]
|
|
2064
|
+
}
|
|
2065
|
+
),
|
|
1931
2066
|
" ",
|
|
1932
2067
|
"on ",
|
|
1933
2068
|
chain.name,
|
|
@@ -1937,133 +2072,723 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
1937
2072
|
] });
|
|
1938
2073
|
}
|
|
1939
2074
|
|
|
1940
|
-
// src/onboarding/
|
|
1941
|
-
import {
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
{
|
|
1971
|
-
id: "wallet",
|
|
1972
|
-
isComplete: false,
|
|
1973
|
-
content: () => null
|
|
1974
|
-
}
|
|
1975
|
-
];
|
|
1976
|
-
}
|
|
1977
|
-
const steps2 = [
|
|
1978
|
-
{
|
|
1979
|
-
id: "wallet",
|
|
1980
|
-
isComplete: true,
|
|
1981
|
-
content: (props) => /* @__PURE__ */ jsx17(Wallet, { ...props, userAddress })
|
|
1982
|
-
}
|
|
1983
|
-
];
|
|
1984
|
-
if (!paymaster) {
|
|
1985
|
-
if (sessionAddress != null) {
|
|
1986
|
-
steps2.push({
|
|
1987
|
-
id: "gasBalance",
|
|
1988
|
-
isComplete: !!hasGasBalance,
|
|
1989
|
-
content: (props) => /* @__PURE__ */ jsx17(GasBalance, { ...props, sessionAddress })
|
|
1990
|
-
});
|
|
1991
|
-
}
|
|
1992
|
-
} else if (paymaster.type === "quarry") {
|
|
1993
|
-
steps2.push({
|
|
1994
|
-
id: "allowance",
|
|
1995
|
-
isComplete: !!hasAllowance,
|
|
1996
|
-
content: (props) => /* @__PURE__ */ jsx17(Allowance, { ...props, userAddress })
|
|
1997
|
-
});
|
|
2075
|
+
// src/onboarding/deposit/DepositFormContainer.tsx
|
|
2076
|
+
import { useState as useState4 } from "react";
|
|
2077
|
+
import { useChains as useChains4, useChainId } from "wagmi";
|
|
2078
|
+
|
|
2079
|
+
// src/onboarding/deposit/DepositViaTransferForm.tsx
|
|
2080
|
+
import { useAccount as useAccount4, useWriteContract, usePrepareTransactionRequest, usePublicClient } from "wagmi";
|
|
2081
|
+
import { encodeFunctionData as encodeFunctionData2 } from "viem";
|
|
2082
|
+
import { useMutation as useMutation4, useQuery as useQuery11 } from "@tanstack/react-query";
|
|
2083
|
+
|
|
2084
|
+
// src/onboarding/deposit/DepositForm.tsx
|
|
2085
|
+
import { useEffect as useEffect11, useRef as useRef4 } from "react";
|
|
2086
|
+
import { useAccount as useAccount3, useBalance as useBalance5, useWatchBlockNumber as useWatchBlockNumber2 } from "wagmi";
|
|
2087
|
+
import { useIsMounted } from "usehooks-ts";
|
|
2088
|
+
import { twMerge as twMerge15 } from "tailwind-merge";
|
|
2089
|
+
|
|
2090
|
+
// src/onboarding/deposit/ChainSelect.tsx
|
|
2091
|
+
import { useEffect as useEffect10, useMemo as useMemo2 } from "react";
|
|
2092
|
+
import { useAccount, useSwitchChain } from "wagmi";
|
|
2093
|
+
import { twMerge as twMerge12 } from "tailwind-merge";
|
|
2094
|
+
import * as Select from "@radix-ui/react-select";
|
|
2095
|
+
|
|
2096
|
+
// src/icons/ChevronUpIcon.tsx
|
|
2097
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2098
|
+
function ChevronUpIcon(props) {
|
|
2099
|
+
return /* @__PURE__ */ jsx20(IconSVG, { viewBox: "0 0 20 20", ...props, children: /* @__PURE__ */ jsx20(
|
|
2100
|
+
"path",
|
|
2101
|
+
{
|
|
2102
|
+
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",
|
|
2103
|
+
fillRule: "evenodd",
|
|
2104
|
+
clipRule: "evenodd"
|
|
1998
2105
|
}
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
const nextStep = steps.find((step) => step.content != null && !step.isComplete);
|
|
2008
|
-
const completedSteps = steps.filter((step) => step.isComplete);
|
|
2009
|
-
const activeStep = (selectedStepId != null ? steps.find((step) => step.id === selectedStepId) : null) ?? nextStep ?? (completedSteps.length < steps.length ? completedSteps.at(-1) : null);
|
|
2010
|
-
const activeStepIndex = activeStep ? steps.indexOf(activeStep) : -1;
|
|
2011
|
-
return /* @__PURE__ */ jsx17(
|
|
2012
|
-
"div",
|
|
2106
|
+
) });
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
// src/icons/ChevronDownIcon.tsx
|
|
2110
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2111
|
+
function ChevronDownIcon(props) {
|
|
2112
|
+
return /* @__PURE__ */ jsx21(IconSVG, { viewBox: "0 0 20 20", ...props, children: /* @__PURE__ */ jsx21(
|
|
2113
|
+
"path",
|
|
2013
2114
|
{
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
"animate-in animate-duration-300 fade-in slide-in-from-bottom-8"
|
|
2018
|
-
),
|
|
2019
|
-
children: steps.map((step, i) => {
|
|
2020
|
-
const isActive = step === activeStep;
|
|
2021
|
-
const isExpanded = isActive || completedSteps.length === steps.length;
|
|
2022
|
-
const isDisabled = !step.isComplete && activeStepIndex !== -1 && i > activeStepIndex;
|
|
2023
|
-
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);
|
|
2024
|
-
})
|
|
2115
|
+
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",
|
|
2116
|
+
fillRule: "evenodd",
|
|
2117
|
+
clipRule: "evenodd"
|
|
2025
2118
|
}
|
|
2026
|
-
);
|
|
2119
|
+
) });
|
|
2027
2120
|
}
|
|
2028
2121
|
|
|
2029
|
-
// src/
|
|
2030
|
-
import {
|
|
2031
|
-
import {
|
|
2032
|
-
function
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2122
|
+
// src/ui/Slot.tsx
|
|
2123
|
+
import { isValidElement, cloneElement, Children } from "react";
|
|
2124
|
+
import { twMerge as twMerge8 } from "tailwind-merge";
|
|
2125
|
+
function Slot({
|
|
2126
|
+
children,
|
|
2127
|
+
...props
|
|
2128
|
+
}) {
|
|
2129
|
+
if (isValidElement(children)) {
|
|
2130
|
+
return cloneElement(children, {
|
|
2131
|
+
...props,
|
|
2132
|
+
...children.props,
|
|
2133
|
+
style: {
|
|
2134
|
+
...props.style,
|
|
2135
|
+
...children.props.style
|
|
2136
|
+
},
|
|
2137
|
+
className: twMerge8(props.className, children.props.className)
|
|
2138
|
+
});
|
|
2139
|
+
}
|
|
2140
|
+
if (Children.count(children) > 1) {
|
|
2141
|
+
Children.only(null);
|
|
2039
2142
|
}
|
|
2040
|
-
return
|
|
2143
|
+
return null;
|
|
2041
2144
|
}
|
|
2042
2145
|
|
|
2043
|
-
// src/
|
|
2044
|
-
import {
|
|
2146
|
+
// src/ui/Input.tsx
|
|
2147
|
+
import { twMerge as twMerge9 } from "tailwind-merge";
|
|
2148
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2149
|
+
function Input({ asChild, className, ...props }) {
|
|
2150
|
+
const Child = asChild ? Slot : "input";
|
|
2151
|
+
return /* @__PURE__ */ jsx22(
|
|
2152
|
+
Child,
|
|
2153
|
+
{
|
|
2154
|
+
className: twMerge9(
|
|
2155
|
+
"p-2.5 gap-1 border text-lg font-medium transition",
|
|
2156
|
+
"outline-none ring-2 ring-transparent focus-within:ring-orange-500 focus-within:border-transparent",
|
|
2157
|
+
"bg-neutral-900 border-neutral-700 text-white placeholder:text-neutral-500",
|
|
2158
|
+
className
|
|
2159
|
+
),
|
|
2160
|
+
...props
|
|
2161
|
+
}
|
|
2162
|
+
);
|
|
2163
|
+
}
|
|
2045
2164
|
|
|
2046
|
-
// src/
|
|
2047
|
-
import {
|
|
2048
|
-
import { jsx as
|
|
2049
|
-
function
|
|
2050
|
-
|
|
2051
|
-
|
|
2165
|
+
// src/onboarding/deposit/ChainBalance.tsx
|
|
2166
|
+
import { useBalance as useBalance3 } from "wagmi";
|
|
2167
|
+
import { Fragment as Fragment2, jsx as jsx23 } from "react/jsx-runtime";
|
|
2168
|
+
function ChainBalance({ chainId, address }) {
|
|
2169
|
+
const balance = useBalance3({ chainId, address });
|
|
2170
|
+
return /* @__PURE__ */ jsx23(Fragment2, { children: balance.data ? /* @__PURE__ */ jsx23(Balance, { wei: balance.data.value }) : /* @__PURE__ */ jsx23(PendingIcon, {}) });
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
// src/onboarding/deposit/ChainIcon.tsx
|
|
2174
|
+
import { twMerge as twMerge11 } from "tailwind-merge";
|
|
2175
|
+
|
|
2176
|
+
// src/onboarding/deposit/PreloadedImage.tsx
|
|
2177
|
+
import { twMerge as twMerge10 } from "tailwind-merge";
|
|
2178
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2179
|
+
function PreloadedImage({ url, fallback: fallback2, className }) {
|
|
2180
|
+
const { isSuccess, isLoading } = usePreloadImage(url);
|
|
2181
|
+
return /* @__PURE__ */ jsx24("span", { className: twMerge10("inline-flex w-full h-full items-center justify-center overflow-clip", className), children: !isLoading ? isSuccess ? /* @__PURE__ */ jsx24("img", { src: url, className: "w-full h-full object-cover" }) : fallback2 : null });
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
// src/onboarding/deposit/ChainIcon.tsx
|
|
2185
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
2186
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2187
|
+
var ChainIcon = forwardRef2(function ChainIcon2({ name, url, className }, forwardedRef) {
|
|
2188
|
+
return /* @__PURE__ */ jsx25(
|
|
2189
|
+
"span",
|
|
2052
2190
|
{
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2191
|
+
ref: forwardedRef,
|
|
2192
|
+
className: twMerge11("flex-shrink-0 inline-flex w-6 aspect-square rounded-full overflow-clip", className),
|
|
2193
|
+
children: url ? /* @__PURE__ */ jsx25(PreloadedImage, { url }) : (
|
|
2194
|
+
// TODO: better placeholder
|
|
2195
|
+
/* @__PURE__ */ jsx25(
|
|
2196
|
+
"span",
|
|
2197
|
+
{
|
|
2198
|
+
className: twMerge11(
|
|
2199
|
+
"inline-flex items-center justify-center w-full h-full rounded-full",
|
|
2200
|
+
"border-2 border-dashed border-white/50 opacity-50"
|
|
2201
|
+
),
|
|
2202
|
+
children: name?.slice(0, 1)
|
|
2203
|
+
}
|
|
2204
|
+
)
|
|
2205
|
+
)
|
|
2206
|
+
}
|
|
2207
|
+
);
|
|
2208
|
+
});
|
|
2209
|
+
|
|
2210
|
+
// src/onboarding/deposit/useRelay.ts
|
|
2211
|
+
import {
|
|
2212
|
+
MAINNET_RELAY_API,
|
|
2213
|
+
TESTNET_RELAY_API,
|
|
2214
|
+
fetchChainConfigs,
|
|
2215
|
+
createClient as createClient2,
|
|
2216
|
+
LogLevel
|
|
2217
|
+
} from "@reservoir0x/relay-sdk";
|
|
2218
|
+
import { useQuery as useQuery10 } from "@tanstack/react-query";
|
|
2219
|
+
function useRelay() {
|
|
2220
|
+
const { chain } = useEntryKitConfig();
|
|
2221
|
+
const appOrigin = location.host;
|
|
2222
|
+
const baseApiUrl = chain.testnet ? TESTNET_RELAY_API : MAINNET_RELAY_API;
|
|
2223
|
+
return useQuery10({
|
|
2224
|
+
queryKey: ["relayChains", baseApiUrl, appOrigin],
|
|
2225
|
+
queryFn: async () => {
|
|
2226
|
+
debug("fetching relay chains from", baseApiUrl);
|
|
2227
|
+
const chains = await fetchChainConfigs(baseApiUrl);
|
|
2228
|
+
debug("got relay chains", chains);
|
|
2229
|
+
const client = createClient2({
|
|
2230
|
+
baseApiUrl,
|
|
2231
|
+
source: appOrigin,
|
|
2232
|
+
chains,
|
|
2233
|
+
logLevel: LogLevel.Verbose
|
|
2234
|
+
});
|
|
2235
|
+
return { client, chains };
|
|
2236
|
+
},
|
|
2237
|
+
refetchOnMount: false,
|
|
2238
|
+
refetchOnReconnect: false,
|
|
2239
|
+
refetchOnWindowFocus: false,
|
|
2240
|
+
staleTime: Infinity
|
|
2241
|
+
});
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
// src/onboarding/deposit/ChainSelect.tsx
|
|
2245
|
+
import { Fragment as Fragment3, jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2246
|
+
function ChainSelect({ value, onChange }) {
|
|
2247
|
+
const theme = useTheme();
|
|
2248
|
+
const { frame } = useFrame();
|
|
2249
|
+
const userAccount = useAccount();
|
|
2250
|
+
const { chains, switchChain } = useSwitchChain();
|
|
2251
|
+
const relay = useRelay();
|
|
2252
|
+
const relayChains = relay.data?.chains;
|
|
2253
|
+
const sourceChains = useMemo2(() => {
|
|
2254
|
+
return chains.map((sourceChain) => {
|
|
2255
|
+
const relayChain = relayChains?.find((c) => c.id === sourceChain.id);
|
|
2256
|
+
return {
|
|
2257
|
+
...sourceChain,
|
|
2258
|
+
relayChain
|
|
2259
|
+
};
|
|
2260
|
+
}).filter((c) => c.relayChain);
|
|
2261
|
+
}, [chains, relayChains]);
|
|
2262
|
+
const selectedChain = sourceChains.find((c) => c.id === value);
|
|
2263
|
+
useEffect10(() => {
|
|
2264
|
+
if (sourceChains.length > 0 && !selectedChain) {
|
|
2265
|
+
const defaultChain = sourceChains[0];
|
|
2266
|
+
onChange(defaultChain.id);
|
|
2267
|
+
switchChain({ chainId: defaultChain.id });
|
|
2268
|
+
}
|
|
2269
|
+
}, [value, selectedChain, sourceChains, onChange, switchChain]);
|
|
2270
|
+
return /* @__PURE__ */ jsxs15(
|
|
2271
|
+
Select.Root,
|
|
2272
|
+
{
|
|
2273
|
+
value: value.toString(),
|
|
2274
|
+
onValueChange: (value2) => {
|
|
2275
|
+
if (value2) {
|
|
2276
|
+
const chain = sourceChains.find((chain2) => chain2.id.toString() === value2);
|
|
2277
|
+
if (!chain) throw new Error(`Unknown chain selected: ${value2}`);
|
|
2278
|
+
onChange(chain.id);
|
|
2279
|
+
}
|
|
2280
|
+
},
|
|
2281
|
+
children: [
|
|
2282
|
+
/* @__PURE__ */ jsx26(Input, { asChild: true, children: /* @__PURE__ */ jsxs15(Select.Trigger, { className: "group inline-flex items-center justify-center", children: [
|
|
2283
|
+
/* @__PURE__ */ jsx26(Select.Value, { asChild: true, children: /* @__PURE__ */ jsx26(
|
|
2284
|
+
ChainIcon,
|
|
2285
|
+
{
|
|
2286
|
+
id: selectedChain?.id,
|
|
2287
|
+
name: selectedChain?.name,
|
|
2288
|
+
url: selectedChain?.relayChain?.icon?.[theme],
|
|
2289
|
+
className: "w-8"
|
|
2290
|
+
}
|
|
2291
|
+
) }),
|
|
2292
|
+
/* @__PURE__ */ jsx26(Select.Icon, { asChild: true, children: /* @__PURE__ */ jsxs15(Fragment3, { children: [
|
|
2293
|
+
/* @__PURE__ */ jsx26(ChevronDownIcon, { className: "text-sm -mr-1 group-aria-expanded:hidden" }),
|
|
2294
|
+
/* @__PURE__ */ jsx26(ChevronUpIcon, { className: "text-sm -mr-1 hidden group-aria-expanded:inline" })
|
|
2295
|
+
] }) })
|
|
2296
|
+
] }) }),
|
|
2297
|
+
frame.contentDocument ? /* @__PURE__ */ jsx26(Select.Portal, { container: frame.contentDocument.body, children: /* @__PURE__ */ jsx26(Select.Content, { position: "popper", className: "w-[352px] mt-1 animate-in fade-in slide-in-from-top-2", children: /* @__PURE__ */ jsx26(Select.Viewport, { children: /* @__PURE__ */ jsx26(
|
|
2298
|
+
Select.Group,
|
|
2299
|
+
{
|
|
2300
|
+
className: twMerge12(
|
|
2301
|
+
"flex flex-col border divide-y",
|
|
2302
|
+
"bg-neutral-800 text-neutral-300 border-neutral-700 divide-neutral-700"
|
|
2303
|
+
),
|
|
2304
|
+
children: sourceChains.map((chain) => (
|
|
2305
|
+
// TODO: figure out why up/down arrow jump to top/bottom rather than cycling through items
|
|
2306
|
+
/* @__PURE__ */ jsxs15(
|
|
2307
|
+
Select.Item,
|
|
2308
|
+
{
|
|
2309
|
+
value: chain.id.toString(),
|
|
2310
|
+
className: twMerge12(
|
|
2311
|
+
"group flex p-2.5 gap-2.5 items-center cursor-pointer outline-none",
|
|
2312
|
+
// TODO: different style for checked/active state
|
|
2313
|
+
"text-white focus:bg-neutral-700 data-[state=checked]:bg-neutral-900"
|
|
2314
|
+
),
|
|
2315
|
+
children: [
|
|
2316
|
+
/* @__PURE__ */ jsx26(ChainIcon, { id: chain.id, name: chain.name, url: chain.relayChain?.icon?.[theme] }),
|
|
2317
|
+
/* @__PURE__ */ jsx26("span", { className: "flex-grow flex-shrink-0", children: chain.name }),
|
|
2318
|
+
/* @__PURE__ */ jsx26("span", { className: "flex-shrink-0 font-mono text-sm text-neutral-400", children: /* @__PURE__ */ jsx26(ChainBalance, { chainId: chain.id, address: userAccount.address }) })
|
|
2319
|
+
]
|
|
2320
|
+
},
|
|
2321
|
+
chain.id
|
|
2322
|
+
)
|
|
2323
|
+
))
|
|
2324
|
+
}
|
|
2325
|
+
) }) }) }) : null
|
|
2326
|
+
]
|
|
2059
2327
|
}
|
|
2060
2328
|
);
|
|
2061
2329
|
}
|
|
2062
2330
|
|
|
2331
|
+
// src/onboarding/deposit/AmountInput.tsx
|
|
2332
|
+
import { formatEther as formatEther3, parseEther as parseEther5 } from "viem";
|
|
2333
|
+
import { twMerge as twMerge13 } from "tailwind-merge";
|
|
2334
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
2335
|
+
import { jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2336
|
+
var AmountInput = forwardRef3(function AmountInput2({ initialAmount, onChange }, forwardedRef) {
|
|
2337
|
+
return /* @__PURE__ */ jsx27(Input, { asChild: true, className: "w-full cursor-text flex items-center", children: /* @__PURE__ */ jsxs16("label", { children: [
|
|
2338
|
+
/* @__PURE__ */ jsx27(
|
|
2339
|
+
"input",
|
|
2340
|
+
{
|
|
2341
|
+
ref: forwardedRef,
|
|
2342
|
+
className: twMerge13("peer flex-grow outline-none bg-transparent", "placeholder:text-neutral-500"),
|
|
2343
|
+
placeholder: "0.005",
|
|
2344
|
+
required: true,
|
|
2345
|
+
autoFocus: true,
|
|
2346
|
+
defaultValue: initialAmount == null ? "" : formatEther3(initialAmount),
|
|
2347
|
+
onChange: (event) => {
|
|
2348
|
+
const input = event.currentTarget;
|
|
2349
|
+
if (input.value.trim() === "") {
|
|
2350
|
+
input.setCustomValidity("");
|
|
2351
|
+
onChange(void 0);
|
|
2352
|
+
return;
|
|
2353
|
+
}
|
|
2354
|
+
const value = input.value.trim().replace(/\.$/, ".0");
|
|
2355
|
+
if (!/^\d*(\.\d+)?$/.test(value)) {
|
|
2356
|
+
return input.setCustomValidity("Invalid amount.");
|
|
2357
|
+
}
|
|
2358
|
+
input.setCustomValidity("");
|
|
2359
|
+
onChange(parseEther5(value));
|
|
2360
|
+
}
|
|
2361
|
+
}
|
|
2362
|
+
),
|
|
2363
|
+
/* @__PURE__ */ jsx27("span", { className: twMerge13("flex-shrink-0 text-2xl", "peer-placeholder-shown:text-neutral-500"), children: /* @__PURE__ */ jsx27(EthIcon, {}) })
|
|
2364
|
+
] }) });
|
|
2365
|
+
});
|
|
2366
|
+
|
|
2367
|
+
// src/onboarding/deposit/SubmitButton.tsx
|
|
2368
|
+
import { useAccount as useAccount2, useBalance as useBalance4, useSwitchChain as useSwitchChain2 } from "wagmi";
|
|
2369
|
+
import { twMerge as twMerge14 } from "tailwind-merge";
|
|
2370
|
+
import { parseEther as parseEther6 } from "viem";
|
|
2371
|
+
import { jsx as jsx28, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2372
|
+
var MAX_DEPOSIT_AMOUNT = "0.1";
|
|
2373
|
+
function SubmitButton({ amount, chainId, className, ...buttonProps }) {
|
|
2374
|
+
const { chainId: userChainId, address: userAddress } = useAccount2();
|
|
2375
|
+
const { data: userBalance } = useBalance4({ address: userAddress });
|
|
2376
|
+
const shouldSwitchChain = chainId != null && chainId !== userChainId;
|
|
2377
|
+
const switchChain = useSwitchChain2();
|
|
2378
|
+
if (shouldSwitchChain) {
|
|
2379
|
+
return /* @__PURE__ */ jsx28(
|
|
2380
|
+
Button,
|
|
2381
|
+
{
|
|
2382
|
+
type: "button",
|
|
2383
|
+
variant: "primary",
|
|
2384
|
+
className: twMerge14("w-full", className),
|
|
2385
|
+
pending: switchChain.isPending,
|
|
2386
|
+
onClick: () => switchChain.switchChain({ chainId }),
|
|
2387
|
+
children: "Switch chain"
|
|
2388
|
+
}
|
|
2389
|
+
);
|
|
2390
|
+
} else if (amount) {
|
|
2391
|
+
if (amount > parseEther6(MAX_DEPOSIT_AMOUNT)) {
|
|
2392
|
+
return /* @__PURE__ */ jsxs17(Button, { type: "button", className: twMerge14("w-full", className), disabled: true, children: [
|
|
2393
|
+
"Max amount is ",
|
|
2394
|
+
MAX_DEPOSIT_AMOUNT,
|
|
2395
|
+
" ETH"
|
|
2396
|
+
] });
|
|
2397
|
+
} else if (amount > (userBalance?.value ?? 0n)) {
|
|
2398
|
+
return /* @__PURE__ */ jsx28(Button, { type: "button", className: twMerge14("w-full", className), disabled: true, children: "Insufficient balance" });
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
return /* @__PURE__ */ jsx28(Button, { type: "submit", className: twMerge14("w-full", className), ...buttonProps });
|
|
2402
|
+
}
|
|
2403
|
+
|
|
2404
|
+
// src/icons/WarningIcon.tsx
|
|
2405
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2406
|
+
function WarningIcon(props) {
|
|
2407
|
+
return /* @__PURE__ */ jsx29(IconSVG, { fill: "none", ...props, children: /* @__PURE__ */ jsx29(
|
|
2408
|
+
"path",
|
|
2409
|
+
{
|
|
2410
|
+
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",
|
|
2411
|
+
stroke: "currentColor",
|
|
2412
|
+
strokeWidth: "2",
|
|
2413
|
+
strokeLinecap: "round",
|
|
2414
|
+
strokeLinejoin: "round"
|
|
2415
|
+
}
|
|
2416
|
+
) });
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
// src/formatGas.ts
|
|
2420
|
+
import { formatGwei } from "viem";
|
|
2421
|
+
function formatGas(wei) {
|
|
2422
|
+
const formatted = formatGwei(wei);
|
|
2423
|
+
const magnitude = Math.floor(parseFloat(formatted)).toString().length;
|
|
2424
|
+
return parseFloat(formatted).toLocaleString("en-US", { maximumFractionDigits: Math.max(0, 6 - magnitude) });
|
|
2425
|
+
}
|
|
2426
|
+
|
|
2427
|
+
// src/onboarding/deposit/DepositForm.tsx
|
|
2428
|
+
import { Fragment as Fragment4, jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2429
|
+
function DepositForm({
|
|
2430
|
+
sourceChain,
|
|
2431
|
+
setSourceChainId,
|
|
2432
|
+
amount,
|
|
2433
|
+
setAmount,
|
|
2434
|
+
estimatedFee,
|
|
2435
|
+
estimatedTime,
|
|
2436
|
+
onSubmit,
|
|
2437
|
+
submitButton
|
|
2438
|
+
}) {
|
|
2439
|
+
const amountInputRef = useRef4(null);
|
|
2440
|
+
const isMounted = useIsMounted();
|
|
2441
|
+
const { address: userAddress, chainId: userChainId } = useAccount3();
|
|
2442
|
+
const balance = useShowQueryError(useBalance5({ chainId: sourceChain.id, address: userAddress }));
|
|
2443
|
+
const quarryBalance = useShowQueryError(useBalance(userAddress));
|
|
2444
|
+
useWatchBlockNumber2({
|
|
2445
|
+
onBlockNumber: () => {
|
|
2446
|
+
balance.refetch();
|
|
2447
|
+
quarryBalance.refetch();
|
|
2448
|
+
}
|
|
2449
|
+
});
|
|
2450
|
+
const minimumBalance = amount != null ? amount + (estimatedFee?.fee ?? 0n) : void 0;
|
|
2451
|
+
const hasMinimumBalance = balance.data != null ? balance.data.value > (minimumBalance ?? 0n) : void 0;
|
|
2452
|
+
useEffect11(() => {
|
|
2453
|
+
amountInputRef.current?.focus();
|
|
2454
|
+
}, [userChainId]);
|
|
2455
|
+
return /* @__PURE__ */ jsxs18(
|
|
2456
|
+
"form",
|
|
2457
|
+
{
|
|
2458
|
+
className: "flex flex-col gap-5",
|
|
2459
|
+
onSubmit: async (event) => {
|
|
2460
|
+
event.preventDefault();
|
|
2461
|
+
try {
|
|
2462
|
+
await onSubmit();
|
|
2463
|
+
if (isMounted()) {
|
|
2464
|
+
setAmount(void 0);
|
|
2465
|
+
if (amountInputRef.current) {
|
|
2466
|
+
amountInputRef.current.value = "";
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
} catch (error2) {
|
|
2470
|
+
console.error("Error during deposit", error2);
|
|
2471
|
+
} finally {
|
|
2472
|
+
amountInputRef.current?.focus();
|
|
2473
|
+
}
|
|
2474
|
+
},
|
|
2475
|
+
children: [
|
|
2476
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex gap-2", children: [
|
|
2477
|
+
/* @__PURE__ */ jsx30(ChainSelect, { value: sourceChain.id, onChange: setSourceChainId }),
|
|
2478
|
+
/* @__PURE__ */ jsx30(AmountInput, { ref: amountInputRef, initialAmount: amount, onChange: setAmount })
|
|
2479
|
+
] }),
|
|
2480
|
+
/* @__PURE__ */ jsxs18(
|
|
2481
|
+
"dl",
|
|
2482
|
+
{
|
|
2483
|
+
className: twMerge15(
|
|
2484
|
+
"grid grid-cols-2 divide-y text-sm leading-loose [&_>_:is(dt,dd)]:px-1 [&_>_dd]:text-right",
|
|
2485
|
+
"divide-neutral-700 text-neutral-400"
|
|
2486
|
+
),
|
|
2487
|
+
children: [
|
|
2488
|
+
/* @__PURE__ */ jsx30("dt", { children: "Available to deposit" }),
|
|
2489
|
+
/* @__PURE__ */ jsx30("dd", { children: balance.isSuccess ? /* @__PURE__ */ jsx30(Balance, { wei: balance.data.value }) : balance.isError ? /* @__PURE__ */ jsx30("span", { title: String(balance.error), children: /* @__PURE__ */ jsx30(WarningIcon, { className: "inline-block text-amber-500" }) }) : balance.isLoading ? /* @__PURE__ */ jsx30(PendingIcon, { className: "inline-block text-xs" }) : null }),
|
|
2490
|
+
/* @__PURE__ */ jsx30("dt", { children: "Gas balance after deposit" }),
|
|
2491
|
+
/* @__PURE__ */ jsx30("dd", { children: /* @__PURE__ */ jsx30(Balance, { wei: (quarryBalance.data ?? 0n) + (amount ?? 0n) }) }),
|
|
2492
|
+
/* @__PURE__ */ jsx30("dt", { children: "Estimated fee" }),
|
|
2493
|
+
/* @__PURE__ */ jsx30("dd", { children: estimatedFee.fee ? /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
2494
|
+
formatGas(estimatedFee.fee),
|
|
2495
|
+
" gwei"
|
|
2496
|
+
] }) : estimatedFee.error ? /* @__PURE__ */ jsx30("span", { title: String(estimatedFee.error), children: /* @__PURE__ */ jsx30(WarningIcon, { className: "inline-block text-amber-500" }) }) : estimatedFee.isLoading ? /* @__PURE__ */ jsx30(PendingIcon, { className: "inline-block text-xs" }) : null }),
|
|
2497
|
+
/* @__PURE__ */ jsx30("dt", { children: "Time to deposit" }),
|
|
2498
|
+
/* @__PURE__ */ jsx30("dd", { children: estimatedTime })
|
|
2499
|
+
]
|
|
2500
|
+
}
|
|
2501
|
+
),
|
|
2502
|
+
hasMinimumBalance ? submitButton : /* @__PURE__ */ jsx30(SubmitButton, { disabled: true, children: "Not enough funds" })
|
|
2503
|
+
]
|
|
2504
|
+
}
|
|
2505
|
+
);
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2508
|
+
// src/onboarding/deposit/useDeposits.ts
|
|
2509
|
+
import { createStore as createStore4 } from "zustand/vanilla";
|
|
2510
|
+
import { useStore as useStore2 } from "zustand";
|
|
2511
|
+
import { useCallback as useCallback2, useMemo as useMemo3 } from "react";
|
|
2512
|
+
var store4 = createStore4(() => ({
|
|
2513
|
+
count: 0,
|
|
2514
|
+
deposits: []
|
|
2515
|
+
}));
|
|
2516
|
+
function useDeposits() {
|
|
2517
|
+
const deposits = useStore2(store4, (state) => state.deposits);
|
|
2518
|
+
const addDeposit = useCallback2((transaction) => {
|
|
2519
|
+
store4.setState((state) => {
|
|
2520
|
+
if (transaction.type === "relay") {
|
|
2521
|
+
const existingDeposit = state.deposits.find(
|
|
2522
|
+
(deposit) => deposit.type === "relay" && deposit.requestId === transaction.requestId
|
|
2523
|
+
);
|
|
2524
|
+
if (existingDeposit) {
|
|
2525
|
+
return state;
|
|
2526
|
+
}
|
|
2527
|
+
}
|
|
2528
|
+
return {
|
|
2529
|
+
count: state.count + 1,
|
|
2530
|
+
deposits: [
|
|
2531
|
+
...state.deposits,
|
|
2532
|
+
{
|
|
2533
|
+
...transaction,
|
|
2534
|
+
uid: `deposit-${state.count}`
|
|
2535
|
+
}
|
|
2536
|
+
]
|
|
2537
|
+
};
|
|
2538
|
+
});
|
|
2539
|
+
}, []);
|
|
2540
|
+
const removeDeposit = useCallback2((uid) => {
|
|
2541
|
+
store4.setState((state) => ({
|
|
2542
|
+
deposits: state.deposits.filter((deposit) => deposit.uid !== uid)
|
|
2543
|
+
}));
|
|
2544
|
+
}, []);
|
|
2545
|
+
return useMemo3(
|
|
2546
|
+
() => ({
|
|
2547
|
+
deposits,
|
|
2548
|
+
addDeposit,
|
|
2549
|
+
removeDeposit
|
|
2550
|
+
}),
|
|
2551
|
+
[addDeposit, deposits, removeDeposit]
|
|
2552
|
+
);
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
// src/onboarding/deposit/DepositViaTransferForm.tsx
|
|
2556
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2557
|
+
function DepositViaTransferForm({ amount, setAmount, sourceChain, setSourceChainId }) {
|
|
2558
|
+
const { chain } = useEntryKitConfig();
|
|
2559
|
+
const paymaster = getPaymaster(chain);
|
|
2560
|
+
const publicClient = usePublicClient();
|
|
2561
|
+
const { address: userAddress } = useAccount4();
|
|
2562
|
+
const { writeContractAsync } = useWriteContract();
|
|
2563
|
+
const { addDeposit } = useDeposits();
|
|
2564
|
+
if (!userAddress) {
|
|
2565
|
+
throw new Error("User address not found");
|
|
2566
|
+
}
|
|
2567
|
+
const { data: gasPrice } = useQuery11({
|
|
2568
|
+
queryKey: ["gasPrice", sourceChain.id],
|
|
2569
|
+
queryFn: async () => {
|
|
2570
|
+
if (!publicClient) throw new Error("Public client not available");
|
|
2571
|
+
return publicClient.getGasPrice();
|
|
2572
|
+
},
|
|
2573
|
+
refetchInterval: 15e3,
|
|
2574
|
+
enabled: !!publicClient
|
|
2575
|
+
});
|
|
2576
|
+
const { data: prepareData, error: prepareError } = usePrepareTransactionRequest({
|
|
2577
|
+
to: paymaster?.address,
|
|
2578
|
+
data: encodeFunctionData2({
|
|
2579
|
+
abi: paymasterAbi,
|
|
2580
|
+
functionName: "depositTo",
|
|
2581
|
+
args: [userAddress]
|
|
2582
|
+
}),
|
|
2583
|
+
value: amount
|
|
2584
|
+
});
|
|
2585
|
+
const deposit = useMutation4({
|
|
2586
|
+
mutationKey: ["depositViaTransfer", amount?.toString()],
|
|
2587
|
+
mutationFn: async () => {
|
|
2588
|
+
if (!paymaster) throw new Error("Paymaster not found");
|
|
2589
|
+
if (!publicClient) throw new Error("Public client not found");
|
|
2590
|
+
if (!amount) throw new Error("Amount cannot be 0");
|
|
2591
|
+
try {
|
|
2592
|
+
const hash = await writeContractAsync({
|
|
2593
|
+
address: paymaster.address,
|
|
2594
|
+
abi: paymasterAbi,
|
|
2595
|
+
functionName: "depositTo",
|
|
2596
|
+
args: [userAddress],
|
|
2597
|
+
value: amount
|
|
2598
|
+
});
|
|
2599
|
+
const receipt = publicClient.waitForTransactionReceipt({ hash }).then((receipt2) => {
|
|
2600
|
+
if (receipt2.status === "reverted") {
|
|
2601
|
+
throw new Error("Transfer transaction reverted.");
|
|
2602
|
+
}
|
|
2603
|
+
return receipt2;
|
|
2604
|
+
});
|
|
2605
|
+
const pendingDeposit = {
|
|
2606
|
+
type: "transfer",
|
|
2607
|
+
amount,
|
|
2608
|
+
chainL1Id: sourceChain.id,
|
|
2609
|
+
chainL2Id: chain.id,
|
|
2610
|
+
hash,
|
|
2611
|
+
receipt,
|
|
2612
|
+
start: /* @__PURE__ */ new Date(),
|
|
2613
|
+
estimatedTime: 1e3 * 12,
|
|
2614
|
+
isComplete: receipt.then(() => void 0)
|
|
2615
|
+
};
|
|
2616
|
+
addDeposit(pendingDeposit);
|
|
2617
|
+
} catch (error2) {
|
|
2618
|
+
console.error("Error while depositing via bridge", error2);
|
|
2619
|
+
throw error2;
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
});
|
|
2623
|
+
const estimatedFee = prepareData?.gas && gasPrice ? prepareData.gas * gasPrice : void 0;
|
|
2624
|
+
return /* @__PURE__ */ jsx31(
|
|
2625
|
+
DepositForm,
|
|
2626
|
+
{
|
|
2627
|
+
sourceChain,
|
|
2628
|
+
setSourceChainId,
|
|
2629
|
+
amount,
|
|
2630
|
+
setAmount,
|
|
2631
|
+
estimatedFee: {
|
|
2632
|
+
fee: estimatedFee,
|
|
2633
|
+
isLoading: !prepareData && !prepareError || !gasPrice,
|
|
2634
|
+
error: prepareError instanceof Error ? prepareError : void 0
|
|
2635
|
+
},
|
|
2636
|
+
estimatedTime: "A few seconds",
|
|
2637
|
+
onSubmit: async () => {
|
|
2638
|
+
await deposit.mutateAsync();
|
|
2639
|
+
},
|
|
2640
|
+
submitButton: /* @__PURE__ */ jsx31(
|
|
2641
|
+
SubmitButton,
|
|
2642
|
+
{
|
|
2643
|
+
variant: "primary",
|
|
2644
|
+
amount,
|
|
2645
|
+
chainId: sourceChain.id,
|
|
2646
|
+
disabled: !!prepareError || !amount || !userAddress,
|
|
2647
|
+
pending: deposit.isPending,
|
|
2648
|
+
children: "Deposit"
|
|
2649
|
+
}
|
|
2650
|
+
)
|
|
2651
|
+
}
|
|
2652
|
+
);
|
|
2653
|
+
}
|
|
2654
|
+
|
|
2655
|
+
// src/onboarding/deposit/DepositViaRelayForm.tsx
|
|
2656
|
+
import { encodeFunctionData as encodeFunctionData3 } from "viem";
|
|
2657
|
+
import { useAccount as useAccount5, useWalletClient } from "wagmi";
|
|
2658
|
+
import { useMutation as useMutation5, useQuery as useQuery12 } from "@tanstack/react-query";
|
|
2659
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2660
|
+
var ETH_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
2661
|
+
function DepositViaRelayForm({ amount, setAmount, sourceChain, setSourceChainId }) {
|
|
2662
|
+
const { chain, chainId: destinationChainId } = useEntryKitConfig();
|
|
2663
|
+
const paymaster = getPaymaster(chain);
|
|
2664
|
+
const { data: wallet } = useWalletClient();
|
|
2665
|
+
const { address: userAddress } = useAccount5();
|
|
2666
|
+
const { addDeposit } = useDeposits();
|
|
2667
|
+
const { data: relay } = useRelay();
|
|
2668
|
+
const relayClient = relay?.client;
|
|
2669
|
+
const quote = useQuery12({
|
|
2670
|
+
queryKey: ["relayBridgeQuote", sourceChain.id, amount?.toString()],
|
|
2671
|
+
queryFn: async () => {
|
|
2672
|
+
if (!relayClient) throw new Error("No Relay client found.");
|
|
2673
|
+
if (!userAddress) throw new Error("No user address found.");
|
|
2674
|
+
const result = await relayClient.actions.getQuote({
|
|
2675
|
+
chainId: sourceChain.id,
|
|
2676
|
+
toChainId: destinationChainId,
|
|
2677
|
+
currency: ETH_ADDRESS,
|
|
2678
|
+
toCurrency: ETH_ADDRESS,
|
|
2679
|
+
amount: amount?.toString(),
|
|
2680
|
+
tradeType: "EXACT_OUTPUT",
|
|
2681
|
+
recipient: paymaster?.address,
|
|
2682
|
+
wallet,
|
|
2683
|
+
txs: [
|
|
2684
|
+
{
|
|
2685
|
+
to: paymaster?.address,
|
|
2686
|
+
data: encodeFunctionData3({
|
|
2687
|
+
abi: paymasterAbi,
|
|
2688
|
+
functionName: "depositTo",
|
|
2689
|
+
args: [userAddress]
|
|
2690
|
+
}),
|
|
2691
|
+
value: amount?.toString()
|
|
2692
|
+
}
|
|
2693
|
+
]
|
|
2694
|
+
});
|
|
2695
|
+
if (!result) {
|
|
2696
|
+
throw new Error("Failed to get relay quote");
|
|
2697
|
+
}
|
|
2698
|
+
return result;
|
|
2699
|
+
},
|
|
2700
|
+
retry: 1,
|
|
2701
|
+
refetchInterval: 15e3,
|
|
2702
|
+
enabled: !!amount && !!userAddress && !!relayClient
|
|
2703
|
+
});
|
|
2704
|
+
const deposit = useMutation5({
|
|
2705
|
+
mutationKey: ["depositViaRelay", sourceChain.id, amount?.toString()],
|
|
2706
|
+
mutationFn: async ({ quote: quote2, amount: amount2 }) => {
|
|
2707
|
+
if (!relayClient) throw new Error("No Relay client found.");
|
|
2708
|
+
if (!wallet) throw new Error("No wallet found.");
|
|
2709
|
+
try {
|
|
2710
|
+
return new Promise((resolve) => {
|
|
2711
|
+
const pendingDeposit = relayClient.actions.execute({
|
|
2712
|
+
quote: quote2,
|
|
2713
|
+
wallet,
|
|
2714
|
+
onProgress(progress) {
|
|
2715
|
+
const currentStep = progress.currentStep;
|
|
2716
|
+
const requestId = currentStep?.requestId;
|
|
2717
|
+
const currentState = currentStep?.items[0]?.progressState;
|
|
2718
|
+
if (requestId && currentState === "validating") {
|
|
2719
|
+
addDeposit({
|
|
2720
|
+
type: "relay",
|
|
2721
|
+
requestId,
|
|
2722
|
+
amount: amount2,
|
|
2723
|
+
chainL1Id: sourceChain.id,
|
|
2724
|
+
chainL2Id: destinationChainId,
|
|
2725
|
+
start: /* @__PURE__ */ new Date(),
|
|
2726
|
+
estimatedTime: 1e3 * 30,
|
|
2727
|
+
depositPromise: pendingDeposit,
|
|
2728
|
+
isComplete: pendingDeposit.then(() => void 0)
|
|
2729
|
+
});
|
|
2730
|
+
resolve(void 0);
|
|
2731
|
+
}
|
|
2732
|
+
}
|
|
2733
|
+
});
|
|
2734
|
+
});
|
|
2735
|
+
} catch (error2) {
|
|
2736
|
+
console.error("Error while depositing via Relay", error2);
|
|
2737
|
+
throw error2;
|
|
2738
|
+
}
|
|
2739
|
+
}
|
|
2740
|
+
});
|
|
2741
|
+
const fees = quote.data?.fees;
|
|
2742
|
+
const gasFee = BigInt(fees?.gas?.amount ?? 0);
|
|
2743
|
+
const relayerFee = BigInt(fees?.relayer?.amount ?? 0);
|
|
2744
|
+
const fee = gasFee + relayerFee;
|
|
2745
|
+
return /* @__PURE__ */ jsx32(
|
|
2746
|
+
DepositForm,
|
|
2747
|
+
{
|
|
2748
|
+
sourceChain,
|
|
2749
|
+
setSourceChainId,
|
|
2750
|
+
amount,
|
|
2751
|
+
setAmount,
|
|
2752
|
+
estimatedFee: {
|
|
2753
|
+
fee: fee != null ? BigInt(fee) : void 0,
|
|
2754
|
+
isLoading: quote.isLoading,
|
|
2755
|
+
error: quote.error instanceof Error ? quote.error : void 0
|
|
2756
|
+
},
|
|
2757
|
+
estimatedTime: "A few seconds",
|
|
2758
|
+
onSubmit: async () => {
|
|
2759
|
+
if (!quote.data || !amount) return;
|
|
2760
|
+
await deposit.mutateAsync({ quote: quote.data, amount });
|
|
2761
|
+
},
|
|
2762
|
+
submitButton: /* @__PURE__ */ jsx32(
|
|
2763
|
+
SubmitButton,
|
|
2764
|
+
{
|
|
2765
|
+
variant: "primary",
|
|
2766
|
+
amount,
|
|
2767
|
+
chainId: sourceChain.id,
|
|
2768
|
+
disabled: quote.isError || !amount,
|
|
2769
|
+
pending: deposit.isPending,
|
|
2770
|
+
children: "Deposit"
|
|
2771
|
+
}
|
|
2772
|
+
)
|
|
2773
|
+
}
|
|
2774
|
+
);
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2777
|
+
// src/onboarding/deposit/Deposits.tsx
|
|
2778
|
+
import { useEffect as useEffect13 } from "react";
|
|
2779
|
+
import { useQuery as useQuery15, useQueryClient as useQueryClient7 } from "@tanstack/react-query";
|
|
2780
|
+
|
|
2781
|
+
// src/onboarding/deposit/TransferDepositStatus.tsx
|
|
2782
|
+
import { useQuery as useQuery13 } from "@tanstack/react-query";
|
|
2783
|
+
|
|
2784
|
+
// src/onboarding/deposit/DepositStatus.tsx
|
|
2785
|
+
import { useEffect as useEffect12, useState as useState3 } from "react";
|
|
2786
|
+
import { twMerge as twMerge16 } from "tailwind-merge";
|
|
2787
|
+
|
|
2063
2788
|
// src/icons/CloseIcon.tsx
|
|
2064
|
-
import { jsx as
|
|
2789
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2065
2790
|
function CloseIcon(props) {
|
|
2066
|
-
return /* @__PURE__ */
|
|
2791
|
+
return /* @__PURE__ */ jsx33(IconSVG, { strokeWidth: "2", stroke: "currentColor", ...props, children: /* @__PURE__ */ jsx33(
|
|
2067
2792
|
"path",
|
|
2068
2793
|
{
|
|
2069
2794
|
d: "M6 18L18 6M6 6L18 18",
|
|
@@ -2076,52 +2801,501 @@ function CloseIcon(props) {
|
|
|
2076
2801
|
) });
|
|
2077
2802
|
}
|
|
2078
2803
|
|
|
2804
|
+
// src/onboarding/deposit/DepositStatus.tsx
|
|
2805
|
+
import { jsx as jsx34, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2806
|
+
function DepositStatus({ status, progress, children, onDismiss }) {
|
|
2807
|
+
const [appear, setAppear] = useState3(false);
|
|
2808
|
+
useEffect12(() => {
|
|
2809
|
+
setAppear(true);
|
|
2810
|
+
}, []);
|
|
2811
|
+
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: [
|
|
2812
|
+
/* @__PURE__ */ jsxs19("div", { className: "py-1 text-sm flex items-center gap-2", children: [
|
|
2813
|
+
/* @__PURE__ */ jsx34("div", { className: "flex-grow", children }),
|
|
2814
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex-shrink-0 grid", children: [
|
|
2815
|
+
/* @__PURE__ */ jsx34("span", { className: "col-start-1 row-start-1 transition opacity-100 group-hover:opacity-0 group-hover:pointer-events-none", children: status === "success" ? /* @__PURE__ */ jsx34(CheckIcon, { className: "text-green-600" }) : status === "error" ? /* @__PURE__ */ jsx34(WarningIcon, { className: "text-amber-500" }) : /* @__PURE__ */ jsx34(PendingIcon, { className: "text-neutral-500 transition" }) }),
|
|
2816
|
+
/* @__PURE__ */ jsx34(
|
|
2817
|
+
"button",
|
|
2818
|
+
{
|
|
2819
|
+
type: "button",
|
|
2820
|
+
className: twMerge16(
|
|
2821
|
+
"col-start-1 row-start-1 flex items-center justify-center transition",
|
|
2822
|
+
"opacity-0 pointer-events-none",
|
|
2823
|
+
"group-hover:opacity-100 group-hover:pointer-events-auto",
|
|
2824
|
+
"text-neutral-500 hover:text-white"
|
|
2825
|
+
),
|
|
2826
|
+
title: "Dismiss",
|
|
2827
|
+
onClick: onDismiss,
|
|
2828
|
+
children: /* @__PURE__ */ jsx34(CloseIcon, {})
|
|
2829
|
+
}
|
|
2830
|
+
)
|
|
2831
|
+
] })
|
|
2832
|
+
] }),
|
|
2833
|
+
/* @__PURE__ */ jsx34("div", { className: "w-full h-[2px] -mt-full overflow-clip", children: /* @__PURE__ */ jsx34(
|
|
2834
|
+
"div",
|
|
2835
|
+
{
|
|
2836
|
+
className: twMerge16(
|
|
2837
|
+
"w-full h-full transition ease-linear",
|
|
2838
|
+
status === "success" ? "bg-green-600" : status === "error" ? "bg-red-600" : "bg-blue-600",
|
|
2839
|
+
status === "pending" ? "opacity-100" : "opacity-0"
|
|
2840
|
+
),
|
|
2841
|
+
style: status === "pending" ? {
|
|
2842
|
+
transform: appear ? `translateX(0)` : "translate(-100%)",
|
|
2843
|
+
transitionDuration: `${progress.duration}ms`,
|
|
2844
|
+
transitionDelay: `-${Math.min(progress.duration, progress.elapsed)}ms`
|
|
2845
|
+
} : void 0
|
|
2846
|
+
}
|
|
2847
|
+
) })
|
|
2848
|
+
] });
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2851
|
+
// src/onboarding/deposit/TransferDepositStatus.tsx
|
|
2852
|
+
import { useChains as useChains2 } from "wagmi";
|
|
2853
|
+
import { Fragment as Fragment5, jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2854
|
+
function TransferDepositStatus({
|
|
2855
|
+
amount,
|
|
2856
|
+
chainL1Id,
|
|
2857
|
+
hash,
|
|
2858
|
+
receipt: receiptPromise,
|
|
2859
|
+
start,
|
|
2860
|
+
estimatedTime,
|
|
2861
|
+
onDismiss
|
|
2862
|
+
}) {
|
|
2863
|
+
const chains = useChains2();
|
|
2864
|
+
const chain = chains.find((chain2) => chain2.id === chainL1Id);
|
|
2865
|
+
const receipt = useQuery13({
|
|
2866
|
+
queryKey: ["transferDepositStatus", hash],
|
|
2867
|
+
queryFn: () => receiptPromise
|
|
2868
|
+
});
|
|
2869
|
+
return /* @__PURE__ */ jsx35(
|
|
2870
|
+
DepositStatus,
|
|
2871
|
+
{
|
|
2872
|
+
status: receipt.status,
|
|
2873
|
+
progress: {
|
|
2874
|
+
duration: estimatedTime,
|
|
2875
|
+
elapsed: Math.min(estimatedTime, Date.now() - start.getTime())
|
|
2876
|
+
},
|
|
2877
|
+
onDismiss,
|
|
2878
|
+
children: (() => {
|
|
2879
|
+
const blockExplorer = chain.blockExplorers?.default.url;
|
|
2880
|
+
if (receipt.status === "pending") {
|
|
2881
|
+
return /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
2882
|
+
"Confirming deposit on",
|
|
2883
|
+
" ",
|
|
2884
|
+
/* @__PURE__ */ jsx35(
|
|
2885
|
+
"a",
|
|
2886
|
+
{
|
|
2887
|
+
href: blockExplorer ? `${blockExplorer}/tx/${hash}` : void 0,
|
|
2888
|
+
target: "_blank",
|
|
2889
|
+
rel: "noreferrer noopener",
|
|
2890
|
+
children: chain.name
|
|
2891
|
+
}
|
|
2892
|
+
),
|
|
2893
|
+
"\u2026"
|
|
2894
|
+
] });
|
|
2895
|
+
}
|
|
2896
|
+
if (receipt.status === "error") {
|
|
2897
|
+
return /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
2898
|
+
"Could not find deposit on",
|
|
2899
|
+
" ",
|
|
2900
|
+
/* @__PURE__ */ jsx35(
|
|
2901
|
+
"a",
|
|
2902
|
+
{
|
|
2903
|
+
href: blockExplorer ? `${blockExplorer}/tx/${hash}` : void 0,
|
|
2904
|
+
target: "_blank",
|
|
2905
|
+
rel: "noreferrer noopener",
|
|
2906
|
+
children: chain.name
|
|
2907
|
+
}
|
|
2908
|
+
),
|
|
2909
|
+
"."
|
|
2910
|
+
] });
|
|
2911
|
+
}
|
|
2912
|
+
return /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
2913
|
+
"Successfully",
|
|
2914
|
+
" ",
|
|
2915
|
+
/* @__PURE__ */ jsx35(
|
|
2916
|
+
"a",
|
|
2917
|
+
{
|
|
2918
|
+
href: blockExplorer ? `${blockExplorer}/tx/${receipt.data.transactionHash}` : void 0,
|
|
2919
|
+
target: "_blank",
|
|
2920
|
+
rel: "noreferrer noopener",
|
|
2921
|
+
children: "deposited"
|
|
2922
|
+
}
|
|
2923
|
+
),
|
|
2924
|
+
" ",
|
|
2925
|
+
/* @__PURE__ */ jsx35(Balance, { wei: amount })
|
|
2926
|
+
] });
|
|
2927
|
+
})()
|
|
2928
|
+
}
|
|
2929
|
+
);
|
|
2930
|
+
}
|
|
2931
|
+
|
|
2932
|
+
// src/onboarding/deposit/RelayDepositStatus.tsx
|
|
2933
|
+
import { useQuery as useQuery14 } from "@tanstack/react-query";
|
|
2934
|
+
import { useChains as useChains3 } from "wagmi";
|
|
2935
|
+
import { Fragment as Fragment6, jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2936
|
+
function RelayDepositStatus({
|
|
2937
|
+
amount,
|
|
2938
|
+
chainL1Id,
|
|
2939
|
+
chainL2Id,
|
|
2940
|
+
start,
|
|
2941
|
+
estimatedTime,
|
|
2942
|
+
depositPromise,
|
|
2943
|
+
onDismiss
|
|
2944
|
+
}) {
|
|
2945
|
+
const chains = useChains3();
|
|
2946
|
+
const chainL1 = chains.find((chain) => chain.id === chainL1Id);
|
|
2947
|
+
const chainL2 = chains.find((chain) => chain.id === chainL2Id);
|
|
2948
|
+
const deposit = useQuery14({
|
|
2949
|
+
queryKey: ["relayDepositPromise", chainL1Id, chainL2Id, amount.toString(), start.toISOString()],
|
|
2950
|
+
queryFn: () => depositPromise
|
|
2951
|
+
});
|
|
2952
|
+
return /* @__PURE__ */ jsx36(
|
|
2953
|
+
DepositStatus,
|
|
2954
|
+
{
|
|
2955
|
+
status: deposit.status,
|
|
2956
|
+
progress: {
|
|
2957
|
+
duration: estimatedTime,
|
|
2958
|
+
elapsed: Math.min(estimatedTime, Date.now() - start.getTime())
|
|
2959
|
+
},
|
|
2960
|
+
onDismiss,
|
|
2961
|
+
children: (() => {
|
|
2962
|
+
if (deposit.status === "pending") {
|
|
2963
|
+
return /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
2964
|
+
"Relay bridge deposit pending on ",
|
|
2965
|
+
chainL1.name,
|
|
2966
|
+
"\u2026"
|
|
2967
|
+
] });
|
|
2968
|
+
}
|
|
2969
|
+
if (deposit.status === "error") {
|
|
2970
|
+
return /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
2971
|
+
"Relay bridge deposit to ",
|
|
2972
|
+
chainL2.name,
|
|
2973
|
+
" failed."
|
|
2974
|
+
] });
|
|
2975
|
+
}
|
|
2976
|
+
return /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
2977
|
+
"Successfully bridged ",
|
|
2978
|
+
/* @__PURE__ */ jsx36(Balance, { wei: amount }),
|
|
2979
|
+
" to ",
|
|
2980
|
+
chainL2.name,
|
|
2981
|
+
"!"
|
|
2982
|
+
] });
|
|
2983
|
+
})()
|
|
2984
|
+
}
|
|
2985
|
+
);
|
|
2986
|
+
}
|
|
2987
|
+
|
|
2988
|
+
// src/onboarding/deposit/Deposits.tsx
|
|
2989
|
+
import { useAccount as useAccount6, useClient as useClient11 } from "wagmi";
|
|
2990
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
2991
|
+
function Deposits() {
|
|
2992
|
+
const queryClient = useQueryClient7();
|
|
2993
|
+
const { chainId } = useEntryKitConfig();
|
|
2994
|
+
const client = useClient11({ chainId });
|
|
2995
|
+
const { address: userAddress } = useAccount6();
|
|
2996
|
+
const { deposits, removeDeposit } = useDeposits();
|
|
2997
|
+
const { data: isComplete } = useQuery15({
|
|
2998
|
+
queryKey: ["depositsComplete", deposits.map((deposit) => deposit.uid)],
|
|
2999
|
+
queryFn: async () => {
|
|
3000
|
+
if (!deposits.length) return false;
|
|
3001
|
+
await Promise.all(deposits.map((deposit) => deposit.isComplete));
|
|
3002
|
+
return true;
|
|
3003
|
+
}
|
|
3004
|
+
});
|
|
3005
|
+
useEffect13(() => {
|
|
3006
|
+
if (isComplete) {
|
|
3007
|
+
queryClient.invalidateQueries({ queryKey: ["balance"] });
|
|
3008
|
+
queryClient.invalidateQueries({ queryKey: ["getBalance", client?.uid, userAddress] });
|
|
3009
|
+
}
|
|
3010
|
+
}, [client?.uid, isComplete, queryClient, userAddress]);
|
|
3011
|
+
if (!deposits.length) return null;
|
|
3012
|
+
return /* @__PURE__ */ jsx37("div", { className: "flex flex-col gap-1 mt-4", children: deposits.map((deposit) => {
|
|
3013
|
+
if (deposit.type === "transfer") {
|
|
3014
|
+
return /* @__PURE__ */ jsx37(TransferDepositStatus, { ...deposit, onDismiss: () => removeDeposit(deposit.uid) }, deposit.uid);
|
|
3015
|
+
} else if (deposit.type === "relay") {
|
|
3016
|
+
return /* @__PURE__ */ jsx37(RelayDepositStatus, { ...deposit, onDismiss: () => removeDeposit(deposit.uid) }, deposit.uid);
|
|
3017
|
+
}
|
|
3018
|
+
}) });
|
|
3019
|
+
}
|
|
3020
|
+
|
|
3021
|
+
// src/onboarding/deposit/DepositFormContainer.tsx
|
|
3022
|
+
import { jsx as jsx38, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3023
|
+
function DepositFormContainer() {
|
|
3024
|
+
const { chainId: destinationChainId } = useEntryKitConfig();
|
|
3025
|
+
const chainId = useChainId();
|
|
3026
|
+
const chains = useChains4();
|
|
3027
|
+
const [amount, setAmount] = useState4(void 0);
|
|
3028
|
+
const [sourceChainId, setSourceChainId] = useState4(chainId);
|
|
3029
|
+
const sourceChain = chains.find(({ id }) => id === sourceChainId);
|
|
3030
|
+
return /* @__PURE__ */ jsxs22("div", { className: "pt-10 pb-2", children: [
|
|
3031
|
+
destinationChainId === sourceChainId ? /* @__PURE__ */ jsx38(
|
|
3032
|
+
DepositViaTransferForm,
|
|
3033
|
+
{
|
|
3034
|
+
amount,
|
|
3035
|
+
setAmount,
|
|
3036
|
+
sourceChain,
|
|
3037
|
+
setSourceChainId
|
|
3038
|
+
}
|
|
3039
|
+
) : /* @__PURE__ */ jsx38(
|
|
3040
|
+
DepositViaRelayForm,
|
|
3041
|
+
{
|
|
3042
|
+
amount,
|
|
3043
|
+
setAmount,
|
|
3044
|
+
sourceChain,
|
|
3045
|
+
setSourceChainId
|
|
3046
|
+
}
|
|
3047
|
+
),
|
|
3048
|
+
/* @__PURE__ */ jsx38(Deposits, {})
|
|
3049
|
+
] });
|
|
3050
|
+
}
|
|
3051
|
+
|
|
3052
|
+
// src/icons/ArrowLeftIcon.tsx
|
|
3053
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3054
|
+
function ArrowLeftIcon(props) {
|
|
3055
|
+
return /* @__PURE__ */ jsx39(IconSVG, { ...props, children: /* @__PURE__ */ jsx39(
|
|
3056
|
+
"path",
|
|
3057
|
+
{
|
|
3058
|
+
d: "M19 12H5M12 19l-7-7 7-7",
|
|
3059
|
+
fill: "none",
|
|
3060
|
+
stroke: "currentColor",
|
|
3061
|
+
strokeWidth: "2",
|
|
3062
|
+
strokeLinecap: "round",
|
|
3063
|
+
strokeLinejoin: "round"
|
|
3064
|
+
}
|
|
3065
|
+
) });
|
|
3066
|
+
}
|
|
3067
|
+
|
|
3068
|
+
// src/onboarding/quarry/GasBalance.tsx
|
|
3069
|
+
import { useEffect as useEffect14 } from "react";
|
|
3070
|
+
import { useQueryClient as useQueryClient8 } from "@tanstack/react-query";
|
|
3071
|
+
import { Fragment as Fragment7, jsx as jsx40, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3072
|
+
function GasBalance2({ isActive, isExpanded, isFocused, setFocused, userAddress }) {
|
|
3073
|
+
const queryClient = useQueryClient8();
|
|
3074
|
+
const balance = useShowQueryError(useBalance(userAddress));
|
|
3075
|
+
const prevBalance = usePrevious(balance.data || 0n);
|
|
3076
|
+
useEffect14(() => {
|
|
3077
|
+
if (balance.data != null && prevBalance === 0n && balance.data > 0n) {
|
|
3078
|
+
queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] });
|
|
3079
|
+
setFocused(false);
|
|
3080
|
+
}
|
|
3081
|
+
}, [balance.data, prevBalance, setFocused, queryClient, userAddress]);
|
|
3082
|
+
if (isFocused) {
|
|
3083
|
+
return /* @__PURE__ */ jsxs23(Fragment7, { children: [
|
|
3084
|
+
isFocused && /* @__PURE__ */ jsx40("div", { className: "absolute top-0 left-0", children: /* @__PURE__ */ jsx40(
|
|
3085
|
+
"div",
|
|
3086
|
+
{
|
|
3087
|
+
className: "flex items-center justify-center w-10 h-10 text-white/20 hover:text-white/40 cursor-pointer",
|
|
3088
|
+
onClick: () => setFocused(false),
|
|
3089
|
+
children: /* @__PURE__ */ jsx40(ArrowLeftIcon, { className: "m-0" })
|
|
3090
|
+
}
|
|
3091
|
+
) }),
|
|
3092
|
+
/* @__PURE__ */ jsx40(DepositFormContainer, {})
|
|
3093
|
+
] });
|
|
3094
|
+
}
|
|
3095
|
+
return /* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-4", children: [
|
|
3096
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex justify-between gap-4", children: [
|
|
3097
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
3098
|
+
/* @__PURE__ */ jsx40("div", { children: "Gas balance" }),
|
|
3099
|
+
/* @__PURE__ */ jsx40("div", { className: "font-mono text-white", children: balance.data != null ? /* @__PURE__ */ jsx40(Balance, { wei: balance.data }) : /* @__PURE__ */ jsx40(PendingIcon, { className: "text-sm" }) })
|
|
3100
|
+
] }),
|
|
3101
|
+
/* @__PURE__ */ jsx40(
|
|
3102
|
+
Button,
|
|
3103
|
+
{
|
|
3104
|
+
variant: isActive ? "primary" : "tertiary",
|
|
3105
|
+
className: "flex-shrink-0 text-sm p-1 w-28",
|
|
3106
|
+
autoFocus: isActive || isExpanded,
|
|
3107
|
+
pending: balance.status === "pending",
|
|
3108
|
+
onClick: () => setFocused(true),
|
|
3109
|
+
children: "Top up"
|
|
3110
|
+
}
|
|
3111
|
+
)
|
|
3112
|
+
] }),
|
|
3113
|
+
isExpanded ? /* @__PURE__ */ jsx40("p", { className: "text-sm", children: "Your gas balance is used to pay for onchain computation." }) : null
|
|
3114
|
+
] });
|
|
3115
|
+
}
|
|
3116
|
+
|
|
3117
|
+
// src/onboarding/ConnectedSteps.tsx
|
|
3118
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3119
|
+
function ConnectedSteps({ userClient, initialUserAddress }) {
|
|
3120
|
+
const { chain } = useEntryKitConfig();
|
|
3121
|
+
const paymaster = getPaymaster(chain);
|
|
3122
|
+
const [focusedId, setFocusedId] = useState5(null);
|
|
3123
|
+
const userAddress = userClient.account.address;
|
|
3124
|
+
const { data: prerequisites, error: prerequisitesError } = usePrerequisites(userAddress);
|
|
3125
|
+
useEffect15(() => {
|
|
3126
|
+
if (prerequisitesError) {
|
|
3127
|
+
console.error("Could not get prerequisites", prerequisitesError);
|
|
3128
|
+
}
|
|
3129
|
+
}, [prerequisitesError]);
|
|
3130
|
+
const { closeAccountModal } = useAccountModal();
|
|
3131
|
+
const isNewConnection = userAddress !== initialUserAddress;
|
|
3132
|
+
const initialPrerequisites = useRef5(prerequisites);
|
|
3133
|
+
useEffect15(() => {
|
|
3134
|
+
if (prerequisites == null) return;
|
|
3135
|
+
if (initialPrerequisites.current == null) {
|
|
3136
|
+
initialPrerequisites.current = prerequisites;
|
|
3137
|
+
}
|
|
3138
|
+
if (prerequisites.complete) {
|
|
3139
|
+
if (isNewConnection || !initialPrerequisites.current.complete) {
|
|
3140
|
+
closeAccountModal();
|
|
3141
|
+
}
|
|
3142
|
+
}
|
|
3143
|
+
}, [closeAccountModal, isNewConnection, prerequisites]);
|
|
3144
|
+
const { sessionAddress, hasAllowance, isSpender, hasDelegation, hasGasBalance, hasQuarryGasBalance } = prerequisites ?? {};
|
|
3145
|
+
const steps = useMemo4(() => {
|
|
3146
|
+
if (!userAddress) {
|
|
3147
|
+
return [
|
|
3148
|
+
{
|
|
3149
|
+
id: "wallet",
|
|
3150
|
+
isComplete: false,
|
|
3151
|
+
content: () => null
|
|
3152
|
+
}
|
|
3153
|
+
];
|
|
3154
|
+
}
|
|
3155
|
+
const steps2 = [
|
|
3156
|
+
{
|
|
3157
|
+
id: "wallet",
|
|
3158
|
+
isComplete: true,
|
|
3159
|
+
content: (props) => /* @__PURE__ */ jsx41(Wallet, { ...props, userAddress })
|
|
3160
|
+
}
|
|
3161
|
+
];
|
|
3162
|
+
if (!paymaster) {
|
|
3163
|
+
if (sessionAddress != null) {
|
|
3164
|
+
steps2.push({
|
|
3165
|
+
id: "gasBalance",
|
|
3166
|
+
isComplete: !!hasGasBalance,
|
|
3167
|
+
content: (props) => /* @__PURE__ */ jsx41(GasBalance, { ...props, sessionAddress })
|
|
3168
|
+
});
|
|
3169
|
+
}
|
|
3170
|
+
} else if (paymaster.type === "quarry") {
|
|
3171
|
+
if (paymaster.isGasPass) {
|
|
3172
|
+
steps2.push({
|
|
3173
|
+
id: "allowance",
|
|
3174
|
+
isComplete: !!hasAllowance,
|
|
3175
|
+
content: (props) => /* @__PURE__ */ jsx41(Allowance, { ...props, userAddress })
|
|
3176
|
+
});
|
|
3177
|
+
} else {
|
|
3178
|
+
steps2.push({
|
|
3179
|
+
id: "gasBalanceQuarry",
|
|
3180
|
+
isComplete: !!hasQuarryGasBalance,
|
|
3181
|
+
content: (props) => /* @__PURE__ */ jsx41(GasBalance2, { ...props, userAddress })
|
|
3182
|
+
});
|
|
3183
|
+
}
|
|
3184
|
+
}
|
|
3185
|
+
steps2.push({
|
|
3186
|
+
id: "session",
|
|
3187
|
+
isComplete: !!isSpender && !!hasDelegation,
|
|
3188
|
+
content: (props) => /* @__PURE__ */ jsx41(Session, { ...props, userClient, registerSpender: !isSpender, registerDelegation: !hasDelegation })
|
|
3189
|
+
});
|
|
3190
|
+
return steps2;
|
|
3191
|
+
}, [
|
|
3192
|
+
hasAllowance,
|
|
3193
|
+
hasDelegation,
|
|
3194
|
+
hasGasBalance,
|
|
3195
|
+
hasQuarryGasBalance,
|
|
3196
|
+
isSpender,
|
|
3197
|
+
paymaster,
|
|
3198
|
+
sessionAddress,
|
|
3199
|
+
userAddress,
|
|
3200
|
+
userClient
|
|
3201
|
+
]);
|
|
3202
|
+
const [selectedStepId] = useState5(null);
|
|
3203
|
+
const nextStep = steps.find((step) => step.content != null && !step.isComplete);
|
|
3204
|
+
const completedSteps = steps.filter((step) => step.isComplete);
|
|
3205
|
+
const activeStep = (selectedStepId != null ? steps.find((step) => step.id === selectedStepId) : null) ?? nextStep ?? (completedSteps.length < steps.length ? completedSteps.at(-1) : null);
|
|
3206
|
+
const activeStepIndex = activeStep ? steps.indexOf(activeStep) : -1;
|
|
3207
|
+
return /* @__PURE__ */ jsx41(
|
|
3208
|
+
"div",
|
|
3209
|
+
{
|
|
3210
|
+
className: twMerge17(
|
|
3211
|
+
"px-8 flex flex-col",
|
|
3212
|
+
focusedId && "divide-y divide-neutral-800",
|
|
3213
|
+
"animate-in animate-duration-300 fade-in slide-in-from-bottom-8"
|
|
3214
|
+
),
|
|
3215
|
+
children: steps.map((step, i) => {
|
|
3216
|
+
const isActive = step === activeStep;
|
|
3217
|
+
const isExpanded = isActive || completedSteps.length === steps.length;
|
|
3218
|
+
const isDisabled = !step.isComplete && activeStepIndex !== -1 && i > activeStepIndex;
|
|
3219
|
+
const isFocused = focusedId === step.id;
|
|
3220
|
+
const content = step.content({
|
|
3221
|
+
isActive,
|
|
3222
|
+
isExpanded,
|
|
3223
|
+
isFocused,
|
|
3224
|
+
setFocused: (focused) => setFocusedId(focused ? step.id : null)
|
|
3225
|
+
});
|
|
3226
|
+
if (focusedId) {
|
|
3227
|
+
if (step.id === focusedId) {
|
|
3228
|
+
return content;
|
|
3229
|
+
}
|
|
3230
|
+
return null;
|
|
3231
|
+
}
|
|
3232
|
+
return /* @__PURE__ */ jsx41("div", { className: twMerge17("py-8 flex flex-col justify-center", isActive ? "flex-grow" : null), children: /* @__PURE__ */ jsx41("div", { className: twMerge17("flex flex-col", isDisabled ? "opacity-30 pointer-events-none" : null), children: content }) }, step.id);
|
|
3233
|
+
})
|
|
3234
|
+
}
|
|
3235
|
+
);
|
|
3236
|
+
}
|
|
3237
|
+
|
|
3238
|
+
// src/AccountModalContent.tsx
|
|
3239
|
+
import { useRef as useRef6 } from "react";
|
|
3240
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
3241
|
+
function AccountModalContent() {
|
|
3242
|
+
const { chainId } = useEntryKitConfig();
|
|
3243
|
+
const userClient = useConnectorClient({ chainId });
|
|
3244
|
+
const { address: userAddress } = useAccount7();
|
|
3245
|
+
const initialUserAddress = useRef6(userAddress);
|
|
3246
|
+
if (userClient.status !== "success") {
|
|
3247
|
+
return /* @__PURE__ */ jsx42(ConnectWallet, {});
|
|
3248
|
+
}
|
|
3249
|
+
return /* @__PURE__ */ jsx42(ConnectedSteps, { userClient: userClient.data, initialUserAddress: initialUserAddress.current });
|
|
3250
|
+
}
|
|
3251
|
+
|
|
2079
3252
|
// src/AccountModal.tsx
|
|
3253
|
+
import { DialogClose } from "@radix-ui/react-dialog";
|
|
2080
3254
|
import { ErrorBoundary } from "react-error-boundary";
|
|
2081
3255
|
|
|
2082
3256
|
// src/errors/ErrorOverlay.tsx
|
|
2083
3257
|
import { wait } from "@latticexyz/common/utils";
|
|
2084
|
-
import { useEffect as
|
|
2085
|
-
import { twMerge as
|
|
2086
|
-
import { Fragment as
|
|
3258
|
+
import { useEffect as useEffect16 } from "react";
|
|
3259
|
+
import { twMerge as twMerge18 } from "tailwind-merge";
|
|
3260
|
+
import { Fragment as Fragment8, jsx as jsx43, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2087
3261
|
function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
2088
|
-
|
|
3262
|
+
useEffect16(() => {
|
|
2089
3263
|
if (error2) {
|
|
2090
3264
|
console.error(error2);
|
|
2091
3265
|
}
|
|
2092
3266
|
}, [error2]);
|
|
2093
|
-
return /* @__PURE__ */
|
|
2094
|
-
/* @__PURE__ */
|
|
3267
|
+
return /* @__PURE__ */ jsxs24("div", { className: "pointer-events-none absolute inset-0 overflow-clip", children: [
|
|
3268
|
+
/* @__PURE__ */ jsx43(
|
|
2095
3269
|
"div",
|
|
2096
3270
|
{
|
|
2097
|
-
className:
|
|
3271
|
+
className: twMerge18(
|
|
2098
3272
|
"absolute inset-0 bg-blue-700/60",
|
|
2099
3273
|
"transition duration-300",
|
|
2100
3274
|
error2 ? "opacity-100 pointer-events-auto" : "opacity-0"
|
|
2101
3275
|
)
|
|
2102
3276
|
}
|
|
2103
3277
|
),
|
|
2104
|
-
/* @__PURE__ */
|
|
3278
|
+
/* @__PURE__ */ jsx43(
|
|
2105
3279
|
"div",
|
|
2106
3280
|
{
|
|
2107
|
-
className:
|
|
3281
|
+
className: twMerge18(
|
|
2108
3282
|
"absolute inset-0 pb-8",
|
|
2109
3283
|
"transition duration-300",
|
|
2110
3284
|
error2 ? "translate-y-0 opacity-100 pointer-events-auto" : "-translate-y-4 opacity-0"
|
|
2111
3285
|
),
|
|
2112
|
-
children: error2 ? /* @__PURE__ */
|
|
2113
|
-
/* @__PURE__ */
|
|
2114
|
-
/* @__PURE__ */
|
|
2115
|
-
/* @__PURE__ */
|
|
2116
|
-
/* @__PURE__ */
|
|
3286
|
+
children: error2 ? /* @__PURE__ */ jsx43(Fragment8, { children: /* @__PURE__ */ jsxs24("div", { className: "w-full max-h-full bg-blue-700 text-white/80 overflow-auto", children: [
|
|
3287
|
+
/* @__PURE__ */ jsxs24("div", { className: "space-y-6 px-8 pt-8", children: [
|
|
3288
|
+
/* @__PURE__ */ jsx43("div", { className: "text-white text-lg font-bold", children: "Oops! It broke :(" }),
|
|
3289
|
+
/* @__PURE__ */ jsx43("div", { className: "font-mono text-xs whitespace-pre-wrap", children: error2.message.trim() }),
|
|
3290
|
+
/* @__PURE__ */ jsx43("div", { className: "text-sm", children: "See the console for more info." })
|
|
2117
3291
|
] }),
|
|
2118
|
-
/* @__PURE__ */
|
|
2119
|
-
/* @__PURE__ */
|
|
2120
|
-
retry ? /* @__PURE__ */
|
|
3292
|
+
/* @__PURE__ */ jsxs24("div", { className: "pointer-events-none sticky bottom-0 left-0 -mt-2", children: [
|
|
3293
|
+
/* @__PURE__ */ jsx43("div", { className: "w-full h-12 bg-gradient-to-b from-transparent to-blue-700" }),
|
|
3294
|
+
retry ? /* @__PURE__ */ jsx43("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsxs24(
|
|
2121
3295
|
"button",
|
|
2122
3296
|
{
|
|
2123
3297
|
type: "button",
|
|
2124
|
-
className:
|
|
3298
|
+
className: twMerge18(
|
|
2125
3299
|
"pointer-events-auto group w-24 p-1 -translate-y-2 transition",
|
|
2126
3300
|
"bg-blue-600 hover:bg-blue-500 aria-busy:bg-blue-500",
|
|
2127
3301
|
"text-white text-sm font-medium",
|
|
@@ -2136,15 +3310,15 @@ function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
|
2136
3310
|
}
|
|
2137
3311
|
},
|
|
2138
3312
|
children: [
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
/* @__PURE__ */
|
|
3313
|
+
/* @__PURE__ */ jsx43("span", { className: "group-aria-busy:hidden", children: "Retry" }),
|
|
3314
|
+
/* @__PURE__ */ jsx43("span", { className: "hidden group-aria-busy:inline", children: "Retrying\u2026" })
|
|
2141
3315
|
]
|
|
2142
3316
|
}
|
|
2143
|
-
) }) : dismiss ? /* @__PURE__ */
|
|
3317
|
+
) }) : dismiss ? /* @__PURE__ */ jsx43("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsx43(
|
|
2144
3318
|
"button",
|
|
2145
3319
|
{
|
|
2146
3320
|
type: "button",
|
|
2147
|
-
className:
|
|
3321
|
+
className: twMerge18(
|
|
2148
3322
|
"pointer-events-auto group w-24 p-1 -translate-y-2 transition",
|
|
2149
3323
|
"bg-blue-600 hover:bg-blue-500 aria-busy:bg-blue-500",
|
|
2150
3324
|
"text-white text-sm font-medium",
|
|
@@ -2162,27 +3336,27 @@ function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
|
2162
3336
|
}
|
|
2163
3337
|
|
|
2164
3338
|
// src/errors/ErrorFallback.tsx
|
|
2165
|
-
import { jsx as
|
|
3339
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2166
3340
|
function ErrorFallback({ error: error2, resetErrorBoundary }) {
|
|
2167
|
-
return /* @__PURE__ */
|
|
3341
|
+
return /* @__PURE__ */ jsx44("div", { className: "h-64", children: /* @__PURE__ */ jsx44(ErrorOverlay, { error: error2, retry: resetErrorBoundary }) });
|
|
2168
3342
|
}
|
|
2169
3343
|
|
|
2170
3344
|
// src/errors/ErrorsOverlay.tsx
|
|
2171
|
-
import { useStore as
|
|
2172
|
-
import { jsx as
|
|
3345
|
+
import { useStore as useStore3 } from "zustand";
|
|
3346
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
2173
3347
|
function ErrorsOverlay() {
|
|
2174
|
-
const error2 =
|
|
2175
|
-
return /* @__PURE__ */
|
|
3348
|
+
const error2 = useStore3(store3, (state) => state.errors.at(0));
|
|
3349
|
+
return /* @__PURE__ */ jsx45(ErrorOverlay, { error: error2?.error, retry: error2?.retry, dismiss: error2?.dismiss });
|
|
2176
3350
|
}
|
|
2177
3351
|
|
|
2178
3352
|
// src/AccountModal.tsx
|
|
2179
|
-
import { jsx as
|
|
3353
|
+
import { jsx as jsx46, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2180
3354
|
function AccountModal() {
|
|
2181
3355
|
const { accountModalOpen, toggleAccountModal } = useAccountModal();
|
|
2182
|
-
return /* @__PURE__ */
|
|
3356
|
+
return /* @__PURE__ */ jsx46(Modal, { open: accountModalOpen, onOpenChange: toggleAccountModal, children: accountModalOpen ? /* @__PURE__ */ jsxs25(
|
|
2183
3357
|
"div",
|
|
2184
3358
|
{
|
|
2185
|
-
className:
|
|
3359
|
+
className: twMerge19(
|
|
2186
3360
|
"relative py-2 ring-1",
|
|
2187
3361
|
"bg-neutral-900 text-neutral-400 ring-neutral-700/50",
|
|
2188
3362
|
"links:font-medium links:underline links:underline-offset-4",
|
|
@@ -2190,11 +3364,11 @@ function AccountModal() {
|
|
|
2190
3364
|
"links:decoration-neutral-500 hover:links:decoration-orange-500"
|
|
2191
3365
|
),
|
|
2192
3366
|
children: [
|
|
2193
|
-
/* @__PURE__ */
|
|
2194
|
-
/* @__PURE__ */
|
|
2195
|
-
/* @__PURE__ */
|
|
3367
|
+
/* @__PURE__ */ jsxs25(ErrorBoundary, { FallbackComponent: ErrorFallback, children: [
|
|
3368
|
+
/* @__PURE__ */ jsx46(AccountModalContent, {}),
|
|
3369
|
+
/* @__PURE__ */ jsx46(ErrorsOverlay, {})
|
|
2196
3370
|
] }),
|
|
2197
|
-
/* @__PURE__ */
|
|
3371
|
+
/* @__PURE__ */ jsxs25(
|
|
2198
3372
|
"a",
|
|
2199
3373
|
{
|
|
2200
3374
|
href: "https://mud.dev",
|
|
@@ -2202,20 +3376,20 @@ function AccountModal() {
|
|
|
2202
3376
|
rel: "noreferrer noopener",
|
|
2203
3377
|
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",
|
|
2204
3378
|
children: [
|
|
2205
|
-
/* @__PURE__ */
|
|
2206
|
-
/* @__PURE__ */
|
|
3379
|
+
/* @__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" }) }),
|
|
3380
|
+
/* @__PURE__ */ jsx46("span", { children: "Powered by MUD" })
|
|
2207
3381
|
]
|
|
2208
3382
|
}
|
|
2209
3383
|
),
|
|
2210
|
-
/* @__PURE__ */
|
|
3384
|
+
/* @__PURE__ */ jsx46("div", { className: "absolute top-0 right-0", children: /* @__PURE__ */ jsx46(
|
|
2211
3385
|
DialogClose,
|
|
2212
3386
|
{
|
|
2213
|
-
className:
|
|
3387
|
+
className: twMerge19(
|
|
2214
3388
|
"pointer-events-auto leading-none p-2 transition",
|
|
2215
3389
|
"text-white/20 hover:text-white/40"
|
|
2216
3390
|
),
|
|
2217
3391
|
title: "Close",
|
|
2218
|
-
children: /* @__PURE__ */
|
|
3392
|
+
children: /* @__PURE__ */ jsx46(CloseIcon, { className: "m-0" })
|
|
2219
3393
|
}
|
|
2220
3394
|
) })
|
|
2221
3395
|
]
|
|
@@ -2224,31 +3398,31 @@ function AccountModal() {
|
|
|
2224
3398
|
}
|
|
2225
3399
|
|
|
2226
3400
|
// src/EntryKitProvider.tsx
|
|
2227
|
-
import { jsx as
|
|
3401
|
+
import { jsx as jsx47, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2228
3402
|
function EntryKitProvider({ config, children }) {
|
|
2229
|
-
return /* @__PURE__ */
|
|
3403
|
+
return /* @__PURE__ */ jsxs26(EntryKitConfigProvider, { config, children: [
|
|
2230
3404
|
children,
|
|
2231
|
-
/* @__PURE__ */
|
|
3405
|
+
/* @__PURE__ */ jsx47(AccountModal, {})
|
|
2232
3406
|
] });
|
|
2233
3407
|
}
|
|
2234
3408
|
|
|
2235
3409
|
// src/AccountButton.tsx
|
|
2236
|
-
import { useAccount as
|
|
2237
|
-
import { twMerge as
|
|
3410
|
+
import { useAccount as useAccount8 } from "wagmi";
|
|
3411
|
+
import { twMerge as twMerge21 } from "tailwind-merge";
|
|
2238
3412
|
|
|
2239
3413
|
// src/AccountName.tsx
|
|
2240
|
-
import { twMerge as
|
|
2241
|
-
import { Fragment as
|
|
3414
|
+
import { twMerge as twMerge20 } from "tailwind-merge";
|
|
3415
|
+
import { Fragment as Fragment9, jsx as jsx48, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2242
3416
|
function AccountName({ address }) {
|
|
2243
3417
|
const { data: ens } = useENS(address);
|
|
2244
3418
|
const avatar = usePreloadImage(ens?.avatar);
|
|
2245
|
-
return /* @__PURE__ */
|
|
2246
|
-
/* @__PURE__ */
|
|
2247
|
-
/* @__PURE__ */
|
|
3419
|
+
return /* @__PURE__ */ jsxs27(Fragment9, { children: [
|
|
3420
|
+
/* @__PURE__ */ jsxs27("span", { className: "flex-shrink-0 w-6 h-6 -my-1 -mx-0.5 grid place-items-center", children: [
|
|
3421
|
+
/* @__PURE__ */ jsx48(
|
|
2248
3422
|
"img",
|
|
2249
3423
|
{
|
|
2250
3424
|
src: ens?.avatar && avatar.isSuccess ? ens.avatar : void 0,
|
|
2251
|
-
className:
|
|
3425
|
+
className: twMerge20(
|
|
2252
3426
|
"col-start-1 row-start-1",
|
|
2253
3427
|
"inline-flex w-full h-full rounded-full bg-black/10 dark:bg-white/10 bg-cover bg-no-repeat bg-center",
|
|
2254
3428
|
"transtion duration-300",
|
|
@@ -2256,10 +3430,10 @@ function AccountName({ address }) {
|
|
|
2256
3430
|
)
|
|
2257
3431
|
}
|
|
2258
3432
|
),
|
|
2259
|
-
/* @__PURE__ */
|
|
3433
|
+
/* @__PURE__ */ jsx48(
|
|
2260
3434
|
Logo,
|
|
2261
3435
|
{
|
|
2262
|
-
className:
|
|
3436
|
+
className: twMerge20(
|
|
2263
3437
|
"col-start-1 row-start-1 text-orange-500",
|
|
2264
3438
|
"transition duration-300",
|
|
2265
3439
|
ens && (!ens.avatar || avatar.isError) ? "opacity-100" : "opacity-0"
|
|
@@ -2267,29 +3441,29 @@ function AccountName({ address }) {
|
|
|
2267
3441
|
}
|
|
2268
3442
|
)
|
|
2269
3443
|
] }),
|
|
2270
|
-
/* @__PURE__ */
|
|
3444
|
+
/* @__PURE__ */ jsx48("span", { className: "flex-grow", children: ens?.name ?? /* @__PURE__ */ jsx48(TruncatedHex, { hex: address }) })
|
|
2271
3445
|
] });
|
|
2272
3446
|
}
|
|
2273
3447
|
|
|
2274
3448
|
// src/AccountButton.tsx
|
|
2275
|
-
import { useRef as
|
|
2276
|
-
import { jsx as
|
|
2277
|
-
var containerClassNames =
|
|
3449
|
+
import { useRef as useRef7 } from "react";
|
|
3450
|
+
import { jsx as jsx49, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3451
|
+
var containerClassNames = twMerge21(
|
|
2278
3452
|
"w-48 p-3 inline-flex outline-none transition",
|
|
2279
3453
|
"border border-transparent",
|
|
2280
3454
|
"text-base leading-none"
|
|
2281
3455
|
);
|
|
2282
|
-
var secondaryClassNames =
|
|
3456
|
+
var secondaryClassNames = twMerge21(
|
|
2283
3457
|
"bg-neutral-100 border-neutral-300 text-black",
|
|
2284
3458
|
"dark:bg-neutral-800 dark:border-neutral-700 dark:text-white"
|
|
2285
3459
|
);
|
|
2286
|
-
var secondaryInteractiveClassNames =
|
|
3460
|
+
var secondaryInteractiveClassNames = twMerge21(
|
|
2287
3461
|
"cursor-pointer outline-none hover:bg-neutral-200 data-[highlighted]:bg-neutral-200 dark:hover:bg-neutral-700"
|
|
2288
3462
|
);
|
|
2289
3463
|
function AccountButton() {
|
|
2290
3464
|
const { openAccountModal, accountModalOpen } = useAccountModal();
|
|
2291
|
-
const { status, address: userAddress } =
|
|
2292
|
-
const initialUserAddress =
|
|
3465
|
+
const { status, address: userAddress } = useAccount8();
|
|
3466
|
+
const initialUserAddress = useRef7(userAddress);
|
|
2293
3467
|
const prereqs = usePrerequisites(userAddress);
|
|
2294
3468
|
const isConnected = status === "connected" || status === "reconnecting" && userAddress;
|
|
2295
3469
|
const isNewConnection = userAddress !== initialUserAddress.current;
|
|
@@ -2301,20 +3475,20 @@ function AccountButton() {
|
|
|
2301
3475
|
}
|
|
2302
3476
|
return "Sign in";
|
|
2303
3477
|
})();
|
|
2304
|
-
return /* @__PURE__ */
|
|
3478
|
+
return /* @__PURE__ */ jsx49(Shadow, { mode: "child", children: isSignedIn ? /* @__PURE__ */ jsx49(
|
|
2305
3479
|
"button",
|
|
2306
3480
|
{
|
|
2307
3481
|
type: "button",
|
|
2308
|
-
className:
|
|
3482
|
+
className: twMerge21(containerClassNames, secondaryClassNames, secondaryInteractiveClassNames),
|
|
2309
3483
|
onClick: openAccountModal,
|
|
2310
|
-
children: /* @__PURE__ */
|
|
3484
|
+
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 })
|
|
2311
3485
|
},
|
|
2312
3486
|
"connected"
|
|
2313
|
-
) : /* @__PURE__ */
|
|
3487
|
+
) : /* @__PURE__ */ jsxs28(
|
|
2314
3488
|
"button",
|
|
2315
3489
|
{
|
|
2316
3490
|
type: "button",
|
|
2317
|
-
className:
|
|
3491
|
+
className: twMerge21(
|
|
2318
3492
|
containerClassNames,
|
|
2319
3493
|
"group",
|
|
2320
3494
|
"items-center justify-center gap-2.5",
|
|
@@ -2325,32 +3499,32 @@ function AccountButton() {
|
|
|
2325
3499
|
"aria-busy": accountModalOpen,
|
|
2326
3500
|
onClick: openAccountModal,
|
|
2327
3501
|
children: [
|
|
2328
|
-
/* @__PURE__ */
|
|
2329
|
-
/* @__PURE__ */
|
|
3502
|
+
/* @__PURE__ */ jsxs28("span", { className: "pointer-events-none inline-grid place-items-center -ml-3", children: [
|
|
3503
|
+
/* @__PURE__ */ jsx49(
|
|
2330
3504
|
"span",
|
|
2331
3505
|
{
|
|
2332
|
-
className:
|
|
3506
|
+
className: twMerge21(
|
|
2333
3507
|
"col-start-1 row-start-1 leading-none",
|
|
2334
3508
|
"scale-100 opacity-100 transition duration-300",
|
|
2335
3509
|
"group-aria-busy:scale-125 group-aria-busy:opacity-0"
|
|
2336
3510
|
),
|
|
2337
|
-
children: /* @__PURE__ */
|
|
3511
|
+
children: /* @__PURE__ */ jsx49(Logo, {})
|
|
2338
3512
|
}
|
|
2339
3513
|
),
|
|
2340
|
-
/* @__PURE__ */
|
|
3514
|
+
/* @__PURE__ */ jsx49(
|
|
2341
3515
|
"span",
|
|
2342
3516
|
{
|
|
2343
3517
|
"aria-hidden": true,
|
|
2344
|
-
className:
|
|
3518
|
+
className: twMerge21(
|
|
2345
3519
|
"col-start-1 row-start-1",
|
|
2346
3520
|
"scale-50 opacity-0 transition duration-300 delay-50",
|
|
2347
3521
|
"group-aria-busy:scale-100 group-aria-busy:opacity-100"
|
|
2348
3522
|
),
|
|
2349
|
-
children: /* @__PURE__ */
|
|
3523
|
+
children: /* @__PURE__ */ jsx49(PendingIcon, {})
|
|
2350
3524
|
}
|
|
2351
3525
|
)
|
|
2352
3526
|
] }),
|
|
2353
|
-
/* @__PURE__ */
|
|
3527
|
+
/* @__PURE__ */ jsx49("span", { className: "font-medium", children: buttonLabel })
|
|
2354
3528
|
]
|
|
2355
3529
|
},
|
|
2356
3530
|
"sign in"
|
|
@@ -2372,44 +3546,18 @@ function useSessionClientReady() {
|
|
|
2372
3546
|
}
|
|
2373
3547
|
|
|
2374
3548
|
// src/createWagmiConfig.ts
|
|
2375
|
-
import { connectorsForWallets } from "@rainbow-me/rainbowkit";
|
|
2376
3549
|
import { createConfig } from "wagmi";
|
|
2377
|
-
|
|
2378
|
-
// src/getWallets.ts
|
|
2379
|
-
import { getDefaultWallets } from "@rainbow-me/rainbowkit";
|
|
2380
|
-
function getWallets(_config) {
|
|
2381
|
-
const { wallets: defaultWallets } = getDefaultWallets();
|
|
2382
|
-
return [
|
|
2383
|
-
// TODO: passkey wallet
|
|
2384
|
-
...defaultWallets
|
|
2385
|
-
];
|
|
2386
|
-
}
|
|
2387
|
-
|
|
2388
|
-
// src/createWagmiConfig.ts
|
|
3550
|
+
import { getDefaultConfig } from "connectkit";
|
|
2389
3551
|
function createWagmiConfig(config) {
|
|
2390
|
-
const
|
|
2391
|
-
const connectors = connectorsForWallets(wallets, {
|
|
2392
|
-
appName: config.appName,
|
|
2393
|
-
projectId: config.walletConnectProjectId
|
|
2394
|
-
});
|
|
2395
|
-
return createConfig({
|
|
2396
|
-
connectors,
|
|
3552
|
+
const configParams = getDefaultConfig({
|
|
2397
3553
|
chains: config.chains,
|
|
2398
3554
|
transports: config.transports,
|
|
2399
|
-
pollingInterval: config.pollingInterval
|
|
2400
|
-
});
|
|
2401
|
-
}
|
|
2402
|
-
|
|
2403
|
-
// src/getConnectors.ts
|
|
2404
|
-
import { connectorsForWallets as connectorsForWallets2 } from "@rainbow-me/rainbowkit";
|
|
2405
|
-
function getConnectors({
|
|
2406
|
-
wallets,
|
|
2407
|
-
...config
|
|
2408
|
-
}) {
|
|
2409
|
-
return connectorsForWallets2(wallets ?? getWallets(config), {
|
|
3555
|
+
pollingInterval: config.pollingInterval,
|
|
2410
3556
|
appName: config.appName,
|
|
2411
|
-
|
|
3557
|
+
walletConnectProjectId: config.walletConnectProjectId,
|
|
3558
|
+
enableFamily: false
|
|
2412
3559
|
});
|
|
3560
|
+
return createConfig(configParams);
|
|
2413
3561
|
}
|
|
2414
3562
|
|
|
2415
3563
|
// src/validateSigner.ts
|
|
@@ -2460,8 +3608,6 @@ export {
|
|
|
2460
3608
|
EntryKitProvider,
|
|
2461
3609
|
createWagmiConfig,
|
|
2462
3610
|
defineConfig,
|
|
2463
|
-
getConnectors,
|
|
2464
|
-
getWallets,
|
|
2465
3611
|
internal_validateSigner,
|
|
2466
3612
|
useAccountModal,
|
|
2467
3613
|
useEntryKitConfig,
|