@latticexyz/entrykit 2.2.22-d621dc7c427a59eb74f4d379862646355a149338 → 2.2.22-daa34f06d070200c1aaf0bba78ba9f2dd8662a76
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.js +1399 -214
- package/dist/tsup/exports/internal.js.map +1 -1
- package/package.json +10 -8
|
@@ -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-200 > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(229 229 229 / var(--tw-divide-opacity));\n}\n\n.divide-neutral-300 > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(212 212 212 / 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-black\\/20 {\n border-color: rgb(0 0 0 / 0.2);\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-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\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-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(34 197 94 / 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-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(239 68 68 / var(--tw-bg-opacity));\n}\n\n.bg-transparent {\n background-color: transparent;\n}\n\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / 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-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-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-neutral-700 {\n --tw-text-opacity: 1;\n color: rgb(64 64 64 / 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-400::placeholder {\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / 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-black:hover {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-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-white:focus {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / 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-400 {\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / 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-200[data-state="checked"] {\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\\:divide-neutral-700:where([data-theme="dark"], [data-theme="dark"] *) > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-divide-opacity));\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\\:border-white\\/50:where([data-theme="dark"], [data-theme="dark"] *) {\n border-color: rgb(255 255 255 / 0.5);\n}\n\n.dark\\:bg-blue-600:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity));\n}\n\n.dark\\:bg-green-600:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(22 163 74 / var(--tw-bg-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-neutral-900:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(23 23 23 / var(--tw-bg-opacity));\n}\n\n.dark\\:bg-red-600:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(220 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-neutral-300:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(212 212 212 / var(--tw-text-opacity));\n}\n\n.dark\\:text-neutral-400:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / var(--tw-text-opacity));\n}\n\n.dark\\:text-neutral-500:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity));\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\\:placeholder\\:text-neutral-500:where([data-theme="dark"], [data-theme="dark"] *)::placeholder {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / 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.dark\\:hover\\:text-white:hover: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\\:focus\\:bg-neutral-700:focus: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.peer:placeholder-shown ~ .dark\\:peer-placeholder-shown\\:text-neutral-500:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity));\n}\n\n.dark\\:data-\\[state\\=checked\\]\\:bg-neutral-900[data-state="checked"]:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(23 23 23 / 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,6 +37,11 @@ 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";
|
|
@@ -368,10 +373,10 @@ function useAccountModal() {
|
|
|
368
373
|
}
|
|
369
374
|
|
|
370
375
|
// src/AccountModal.tsx
|
|
371
|
-
import { twMerge as
|
|
376
|
+
import { twMerge as twMerge19 } from "tailwind-merge";
|
|
372
377
|
|
|
373
378
|
// src/AccountModalContent.tsx
|
|
374
|
-
import { useAccount as
|
|
379
|
+
import { useAccount as useAccount8, useConnectorClient } from "wagmi";
|
|
375
380
|
|
|
376
381
|
// src/ConnectWallet.tsx
|
|
377
382
|
import { useAccount } from "wagmi";
|
|
@@ -545,12 +550,35 @@ function ConnectWallet() {
|
|
|
545
550
|
}
|
|
546
551
|
|
|
547
552
|
// src/onboarding/ConnectedSteps.tsx
|
|
548
|
-
import { useEffect as
|
|
549
|
-
import { twMerge as
|
|
553
|
+
import { useEffect as useEffect13, useMemo as useMemo4, useRef as useRef4, useState as useState6 } from "react";
|
|
554
|
+
import { twMerge as twMerge17 } from "tailwind-merge";
|
|
550
555
|
|
|
551
|
-
// src/onboarding/
|
|
552
|
-
import {
|
|
553
|
-
|
|
556
|
+
// src/onboarding/usePrerequisites.ts
|
|
557
|
+
import { useClient as useClient6, useConfig } from "wagmi";
|
|
558
|
+
import { getBalanceQueryOptions as getBalanceQueryOptions2 } from "wagmi/query";
|
|
559
|
+
import { queryOptions as queryOptions6, skipToken as skipToken6, useQuery as useQuery7, useQueryClient } from "@tanstack/react-query";
|
|
560
|
+
|
|
561
|
+
// src/getPaymaster.ts
|
|
562
|
+
function getPaymaster(chain) {
|
|
563
|
+
const contracts = chain.contracts ?? {};
|
|
564
|
+
if ("quarryPaymaster" in contracts && contracts.quarryPaymaster != null) {
|
|
565
|
+
if ("address" in contracts.quarryPaymaster) {
|
|
566
|
+
return {
|
|
567
|
+
type: "quarry",
|
|
568
|
+
address: contracts.quarryPaymaster.address,
|
|
569
|
+
isGasPass: !!chain.rpcUrls.quarryPassIssuer?.http?.[0]
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
if ("paymaster" in contracts && contracts.paymaster != null) {
|
|
574
|
+
if ("address" in contracts.paymaster) {
|
|
575
|
+
return {
|
|
576
|
+
type: "simple",
|
|
577
|
+
address: contracts.paymaster.address
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
554
582
|
|
|
555
583
|
// src/onboarding/quarry/useAllowance.ts
|
|
556
584
|
import { useClient } from "wagmi";
|
|
@@ -565,7 +593,10 @@ import { parseAbi } from "viem";
|
|
|
565
593
|
var paymasterAbi = parseAbi([
|
|
566
594
|
"error SpenderSystem_AlreadyRegistered(address spender, address user)",
|
|
567
595
|
"error SpenderSystem_HasOwnBalance(address spender)",
|
|
568
|
-
"
|
|
596
|
+
"error BalanceSystem_BalanceTooHigh(address user, uint256 balance, uint256 max)",
|
|
597
|
+
"error BalanceSystem_InsufficientBalance(address user, uint256 amount, uint256 balance)",
|
|
598
|
+
"function registerSpender(address spender)",
|
|
599
|
+
"function depositTo(address to) payable"
|
|
569
600
|
]);
|
|
570
601
|
var paymasterConfig = defineStore({
|
|
571
602
|
namespaces: {
|
|
@@ -579,6 +610,13 @@ var paymasterConfig = defineStore({
|
|
|
579
610
|
},
|
|
580
611
|
key: ["user"]
|
|
581
612
|
},
|
|
613
|
+
Balance: {
|
|
614
|
+
schema: {
|
|
615
|
+
user: "address",
|
|
616
|
+
balance: "uint256"
|
|
617
|
+
},
|
|
618
|
+
key: ["user"]
|
|
619
|
+
},
|
|
582
620
|
Grantor: {
|
|
583
621
|
schema: {
|
|
584
622
|
grantor: "address",
|
|
@@ -628,29 +666,6 @@ var paymasterTables = paymasterConfig.namespaces.root.tables;
|
|
|
628
666
|
import { getRecord, getStaticDataLocation } from "@latticexyz/store/internal";
|
|
629
667
|
import { getKeyTuple } from "@latticexyz/protocol-parser/internal";
|
|
630
668
|
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
669
|
async function getAllowance({ client, userAddress }) {
|
|
655
670
|
const paymaster = getPaymaster(client.chain);
|
|
656
671
|
if (paymaster?.type !== "quarry") return null;
|
|
@@ -776,10 +791,6 @@ function getDelegationQueryOptions({
|
|
|
776
791
|
});
|
|
777
792
|
}
|
|
778
793
|
|
|
779
|
-
// src/onboarding/usePrerequisites.ts
|
|
780
|
-
import { queryOptions as queryOptions5, skipToken as skipToken5, useQuery as useQuery6, useQueryClient } from "@tanstack/react-query";
|
|
781
|
-
import { useClient as useClient5, useConfig } from "wagmi";
|
|
782
|
-
|
|
783
794
|
// src/useSessionAccount.ts
|
|
784
795
|
import { useClient as useClient4 } from "wagmi";
|
|
785
796
|
import { queryOptions as queryOptions4, skipToken as skipToken4, useQuery as useQuery5 } from "@tanstack/react-query";
|
|
@@ -855,8 +866,41 @@ function getSessionAccountQueryOptions({
|
|
|
855
866
|
});
|
|
856
867
|
}
|
|
857
868
|
|
|
869
|
+
// src/onboarding/quarry/useBalance.ts
|
|
870
|
+
import { useClient as useClient5 } from "wagmi";
|
|
871
|
+
import { queryOptions as queryOptions5, skipToken as skipToken5, useQuery as useQuery6 } from "@tanstack/react-query";
|
|
872
|
+
|
|
873
|
+
// src/quarry/getBalance.ts
|
|
874
|
+
import { getRecord as getRecord4 } from "@latticexyz/store/internal";
|
|
875
|
+
async function getBalance({ client, userAddress }) {
|
|
876
|
+
const paymaster = getPaymaster(client.chain);
|
|
877
|
+
if (paymaster?.type !== "quarry") return null;
|
|
878
|
+
const record = await getRecord4(client, {
|
|
879
|
+
address: paymaster.address,
|
|
880
|
+
table: paymasterTables.Balance,
|
|
881
|
+
key: { user: userAddress },
|
|
882
|
+
blockTag: "pending"
|
|
883
|
+
});
|
|
884
|
+
return record.balance;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
// src/onboarding/quarry/useBalance.ts
|
|
888
|
+
function getBalanceQueryOptions({
|
|
889
|
+
client,
|
|
890
|
+
userAddress
|
|
891
|
+
}) {
|
|
892
|
+
return queryOptions5({
|
|
893
|
+
queryKey: ["getBalance", client?.uid, userAddress],
|
|
894
|
+
queryFn: client && userAddress ? () => getBalance({ client, userAddress }) : skipToken5
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
function useBalance(userAddress) {
|
|
898
|
+
const { chainId } = useEntryKitConfig();
|
|
899
|
+
const client = useClient5({ chainId });
|
|
900
|
+
return useQuery6(getBalanceQueryOptions({ client, userAddress }));
|
|
901
|
+
}
|
|
902
|
+
|
|
858
903
|
// src/onboarding/usePrerequisites.ts
|
|
859
|
-
import { getBalanceQueryOptions } from "wagmi/query";
|
|
860
904
|
function getPrequisitesQueryOptions({
|
|
861
905
|
queryClient,
|
|
862
906
|
config,
|
|
@@ -864,34 +908,37 @@ function getPrequisitesQueryOptions({
|
|
|
864
908
|
userAddress,
|
|
865
909
|
worldAddress
|
|
866
910
|
}) {
|
|
867
|
-
return
|
|
911
|
+
return queryOptions6({
|
|
868
912
|
queryKey: ["getPrerequisites", client?.uid, userAddress],
|
|
869
913
|
queryFn: client && userAddress ? async () => {
|
|
870
914
|
const paymaster = getPaymaster(client.chain);
|
|
871
915
|
const {
|
|
872
916
|
account: { address: sessionAddress }
|
|
873
917
|
} = await queryClient.fetchQuery(getSessionAccountQueryOptions({ client, userAddress }));
|
|
874
|
-
const [sessionBalance, allowance, spender, hasDelegation] = await Promise.all([
|
|
918
|
+
const [sessionBalance, allowance, spender, quarryBalance, hasDelegation] = await Promise.all([
|
|
875
919
|
!paymaster ? queryClient.fetchQuery(
|
|
876
|
-
|
|
920
|
+
getBalanceQueryOptions2(config, { chainId: client.chain.id, address: sessionAddress })
|
|
877
921
|
) : null,
|
|
878
922
|
paymaster?.type === "quarry" ? queryClient.fetchQuery(getAllowanceQueryOptions({ client, userAddress })) : null,
|
|
879
923
|
paymaster?.type === "quarry" ? queryClient.fetchQuery(getSpenderQueryOptions({ client, userAddress, sessionAddress })) : null,
|
|
924
|
+
paymaster?.type === "quarry" ? queryClient.fetchQuery(getBalanceQueryOptions({ client, userAddress })) : null,
|
|
880
925
|
queryClient.fetchQuery(getDelegationQueryOptions({ client, worldAddress, userAddress, sessionAddress }))
|
|
881
926
|
]);
|
|
882
|
-
const hasAllowance = allowance == null || allowance
|
|
927
|
+
const hasAllowance = allowance == null || allowance > 0n;
|
|
883
928
|
const isSpender = spender == null ? true : spender;
|
|
884
|
-
const hasGasBalance = sessionBalance == null || sessionBalance.value
|
|
929
|
+
const hasGasBalance = sessionBalance == null || sessionBalance.value > 0n;
|
|
930
|
+
const hasQuarryBalance = quarryBalance == null || quarryBalance > 0n;
|
|
885
931
|
return {
|
|
886
932
|
sessionAddress,
|
|
887
933
|
hasAllowance,
|
|
888
934
|
isSpender,
|
|
889
935
|
hasGasBalance,
|
|
936
|
+
hasQuarryBalance,
|
|
890
937
|
hasDelegation,
|
|
891
938
|
// we intentionally don't enforce an allowance/gas balance here
|
|
892
939
|
complete: isSpender && hasDelegation
|
|
893
940
|
};
|
|
894
|
-
} :
|
|
941
|
+
} : skipToken6,
|
|
895
942
|
retry: false
|
|
896
943
|
});
|
|
897
944
|
}
|
|
@@ -899,8 +946,8 @@ function usePrerequisites(userAddress) {
|
|
|
899
946
|
const queryClient = useQueryClient();
|
|
900
947
|
const config = useConfig();
|
|
901
948
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
902
|
-
const client =
|
|
903
|
-
const prereqs =
|
|
949
|
+
const client = useClient6({ chainId });
|
|
950
|
+
const prereqs = useQuery7(
|
|
904
951
|
getPrequisitesQueryOptions({
|
|
905
952
|
queryClient,
|
|
906
953
|
config,
|
|
@@ -917,10 +964,10 @@ function usePrerequisites(userAddress) {
|
|
|
917
964
|
import { useDisconnect } from "wagmi";
|
|
918
965
|
|
|
919
966
|
// src/useENS.ts
|
|
920
|
-
import { useQuery as
|
|
967
|
+
import { useQuery as useQuery8 } from "@tanstack/react-query";
|
|
921
968
|
function useENS(address) {
|
|
922
969
|
const normalizedAddress = address?.toLowerCase();
|
|
923
|
-
return
|
|
970
|
+
return useQuery8({
|
|
924
971
|
enabled: !!normalizedAddress,
|
|
925
972
|
queryKey: ["ens", normalizedAddress],
|
|
926
973
|
queryFn: async () => {
|
|
@@ -1039,8 +1086,11 @@ function Wallet({ isActive, isExpanded, userAddress }) {
|
|
|
1039
1086
|
] });
|
|
1040
1087
|
}
|
|
1041
1088
|
|
|
1042
|
-
// src/onboarding/quarry/
|
|
1089
|
+
// src/onboarding/quarry/Allowance.tsx
|
|
1043
1090
|
import { parseEther as parseEther3 } from "viem";
|
|
1091
|
+
|
|
1092
|
+
// src/onboarding/quarry/useClaimGasPass.ts
|
|
1093
|
+
import { parseEther as parseEther2 } from "viem";
|
|
1044
1094
|
import { useMutation, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
1045
1095
|
|
|
1046
1096
|
// src/quarry/transports/quarryPassIssuer.ts
|
|
@@ -1070,11 +1120,11 @@ async function claimGasPass({ chain, userAddress }) {
|
|
|
1070
1120
|
}
|
|
1071
1121
|
|
|
1072
1122
|
// src/onboarding/quarry/useClaimGasPass.ts
|
|
1073
|
-
import { useClient as
|
|
1123
|
+
import { useClient as useClient7 } from "wagmi";
|
|
1074
1124
|
function useClaimGasPass() {
|
|
1075
1125
|
const queryClient = useQueryClient2();
|
|
1076
1126
|
const { chain } = useEntryKitConfig();
|
|
1077
|
-
const client =
|
|
1127
|
+
const client = useClient7({ chainId: chain.id });
|
|
1078
1128
|
const mutationKey = ["claimGasPass", chain.id];
|
|
1079
1129
|
return useMutation({
|
|
1080
1130
|
retry: 0,
|
|
@@ -1082,7 +1132,7 @@ function useClaimGasPass() {
|
|
|
1082
1132
|
mutationFn: async (userAddress) => {
|
|
1083
1133
|
if (chain.id === 31337) {
|
|
1084
1134
|
if (!client) throw new Error("No client?");
|
|
1085
|
-
await setAllowanceSlot({ client, userAddress, allowance:
|
|
1135
|
+
await setAllowanceSlot({ client, userAddress, allowance: parseEther2("1") });
|
|
1086
1136
|
} else {
|
|
1087
1137
|
await claimGasPass({ chain, userAddress });
|
|
1088
1138
|
}
|
|
@@ -1157,7 +1207,7 @@ function Allowance({ isActive, isExpanded, userAddress }) {
|
|
|
1157
1207
|
const claimGasPass2 = useShowMutationError(useClaimGasPass());
|
|
1158
1208
|
useEffect6(() => {
|
|
1159
1209
|
const timer = setTimeout(() => {
|
|
1160
|
-
if (isActive && claimGasPass2.status === "idle" && allowance.isSuccess && allowance.data != null && allowance.data <
|
|
1210
|
+
if (isActive && claimGasPass2.status === "idle" && allowance.isSuccess && allowance.data != null && allowance.data < parseEther3("0.01")) {
|
|
1161
1211
|
claimGasPass2.mutate(userAddress);
|
|
1162
1212
|
}
|
|
1163
1213
|
});
|
|
@@ -1198,7 +1248,7 @@ function defineCall(call) {
|
|
|
1198
1248
|
}
|
|
1199
1249
|
|
|
1200
1250
|
// src/onboarding/useSetupSession.ts
|
|
1201
|
-
import { useClient as
|
|
1251
|
+
import { useClient as useClient8 } from "wagmi";
|
|
1202
1252
|
import { resourceToHex as resourceToHex2 } from "@latticexyz/common";
|
|
1203
1253
|
import IBaseWorldAbi from "@latticexyz/world/out/IBaseWorld.sol/IBaseWorld.abi.json";
|
|
1204
1254
|
|
|
@@ -1210,7 +1260,7 @@ import { getAction as getAction3 } from "viem/utils";
|
|
|
1210
1260
|
import { toHex } from "viem";
|
|
1211
1261
|
import { signTypedData } from "viem/actions";
|
|
1212
1262
|
import { callWithSignatureTypes } from "@latticexyz/world-module-callwithsignature/internal";
|
|
1213
|
-
import { getRecord as
|
|
1263
|
+
import { getRecord as getRecord5 } from "@latticexyz/store/internal";
|
|
1214
1264
|
import moduleConfig from "@latticexyz/world-module-callwithsignature/mud.config";
|
|
1215
1265
|
import { hexToResource } from "@latticexyz/common";
|
|
1216
1266
|
import { getAction as getAction2 } from "viem/utils";
|
|
@@ -1222,7 +1272,7 @@ async function signCall({
|
|
|
1222
1272
|
nonce: initialNonce,
|
|
1223
1273
|
client
|
|
1224
1274
|
}) {
|
|
1225
|
-
const nonce = initialNonce ?? (client ? (await
|
|
1275
|
+
const nonce = initialNonce ?? (client ? (await getRecord5(client, {
|
|
1226
1276
|
address: worldAddress,
|
|
1227
1277
|
table: moduleConfig.tables.CallWithSignatureNonces,
|
|
1228
1278
|
key: { signer: userClient.account.address },
|
|
@@ -1275,7 +1325,7 @@ import { systemsConfig as worldSystemsConfig } from "@latticexyz/world/mud.confi
|
|
|
1275
1325
|
function useSetupSession({ userClient }) {
|
|
1276
1326
|
const queryClient = useQueryClient3();
|
|
1277
1327
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
1278
|
-
const client =
|
|
1328
|
+
const client = useClient8({ chainId });
|
|
1279
1329
|
const mutationKey = ["setupSession", client?.chain.id, userClient.account.address];
|
|
1280
1330
|
return useMutation2({
|
|
1281
1331
|
retry: 0,
|
|
@@ -1385,11 +1435,11 @@ function useSetupSession({ userClient }) {
|
|
|
1385
1435
|
import { useEffect as useEffect7 } from "react";
|
|
1386
1436
|
|
|
1387
1437
|
// src/useSessionClient.ts
|
|
1388
|
-
import { useClient as
|
|
1438
|
+
import { useClient as useClient9 } from "wagmi";
|
|
1389
1439
|
import {
|
|
1390
|
-
queryOptions as
|
|
1391
|
-
skipToken as
|
|
1392
|
-
useQuery as
|
|
1440
|
+
queryOptions as queryOptions7,
|
|
1441
|
+
skipToken as skipToken7,
|
|
1442
|
+
useQuery as useQuery9,
|
|
1393
1443
|
useQueryClient as useQueryClient4
|
|
1394
1444
|
} from "@tanstack/react-query";
|
|
1395
1445
|
|
|
@@ -1474,7 +1524,7 @@ function getSessionClientQueryOptions({
|
|
|
1474
1524
|
userAddress,
|
|
1475
1525
|
worldAddress
|
|
1476
1526
|
}) {
|
|
1477
|
-
return
|
|
1527
|
+
return queryOptions7({
|
|
1478
1528
|
queryKey: ["getSessionClient", client?.uid, userAddress, worldAddress],
|
|
1479
1529
|
queryFn: userAddress ? async () => {
|
|
1480
1530
|
const { account: sessionAccount, signer: sessionSigner } = await queryClient.fetchQuery(
|
|
@@ -1486,7 +1536,7 @@ function getSessionClientQueryOptions({
|
|
|
1486
1536
|
userAddress,
|
|
1487
1537
|
worldAddress
|
|
1488
1538
|
});
|
|
1489
|
-
} :
|
|
1539
|
+
} : skipToken7,
|
|
1490
1540
|
staleTime: Infinity,
|
|
1491
1541
|
// TODO: replace with function to retry only connection errors
|
|
1492
1542
|
retry: false
|
|
@@ -1495,8 +1545,8 @@ function getSessionClientQueryOptions({
|
|
|
1495
1545
|
function useSessionClient(userAddress) {
|
|
1496
1546
|
const queryClient = useQueryClient4();
|
|
1497
1547
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
1498
|
-
const client =
|
|
1499
|
-
return
|
|
1548
|
+
const client = useClient9({ chainId });
|
|
1549
|
+
return useQuery9(
|
|
1500
1550
|
getSessionClientQueryOptions({
|
|
1501
1551
|
queryClient,
|
|
1502
1552
|
client,
|
|
@@ -1551,7 +1601,9 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
|
|
|
1551
1601
|
}
|
|
1552
1602
|
|
|
1553
1603
|
// src/onboarding/GasBalance.tsx
|
|
1554
|
-
import {
|
|
1604
|
+
import { useState as useState3 } from "react";
|
|
1605
|
+
import { parseEther as parseEther4 } from "viem";
|
|
1606
|
+
import { useBalance as useBalance2, useWatchBlockNumber } from "wagmi";
|
|
1555
1607
|
|
|
1556
1608
|
// src/data/relayChains.json
|
|
1557
1609
|
var relayChains_default = {
|
|
@@ -1836,11 +1888,11 @@ var relayChains_default = {
|
|
|
1836
1888
|
// src/onboarding/useSetBalance.ts
|
|
1837
1889
|
import { useQueryClient as useQueryClient5, useMutation as useMutation3 } from "@tanstack/react-query";
|
|
1838
1890
|
import { setBalance as setBalance2 } from "viem/actions";
|
|
1839
|
-
import { useClient as
|
|
1891
|
+
import { useClient as useClient10 } from "wagmi";
|
|
1840
1892
|
function useSetBalance() {
|
|
1841
1893
|
const queryClient = useQueryClient5();
|
|
1842
1894
|
const { chainId } = useEntryKitConfig();
|
|
1843
|
-
const client =
|
|
1895
|
+
const client = useClient10({ chainId });
|
|
1844
1896
|
return useMutation3({
|
|
1845
1897
|
retry: 0,
|
|
1846
1898
|
mutationKey: ["setBalance", chainId],
|
|
@@ -1856,21 +1908,76 @@ function useSetBalance() {
|
|
|
1856
1908
|
});
|
|
1857
1909
|
}
|
|
1858
1910
|
|
|
1911
|
+
// src/icons/IconSVG.tsx
|
|
1912
|
+
import { twMerge as twMerge7 } from "tailwind-merge";
|
|
1913
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1914
|
+
function IconSVG({ className, children, ...props }) {
|
|
1915
|
+
return /* @__PURE__ */ jsx16(
|
|
1916
|
+
"svg",
|
|
1917
|
+
{
|
|
1918
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1919
|
+
viewBox: "0 0 24 24",
|
|
1920
|
+
fill: "currentColor",
|
|
1921
|
+
className: twMerge7("-my-[0.125em] h-[1.25em] w-[1.25em]", className),
|
|
1922
|
+
...props,
|
|
1923
|
+
children
|
|
1924
|
+
}
|
|
1925
|
+
);
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
// src/icons/CopyIcon.tsx
|
|
1929
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1930
|
+
function CopyIcon(props) {
|
|
1931
|
+
return /* @__PURE__ */ jsx17(IconSVG, { ...props, children: /* @__PURE__ */ jsx17(
|
|
1932
|
+
"path",
|
|
1933
|
+
{
|
|
1934
|
+
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",
|
|
1935
|
+
fill: "none",
|
|
1936
|
+
stroke: "currentColor",
|
|
1937
|
+
strokeWidth: "2",
|
|
1938
|
+
strokeLinecap: "round",
|
|
1939
|
+
strokeLinejoin: "round"
|
|
1940
|
+
}
|
|
1941
|
+
) });
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
// src/icons/CheckIcon.tsx
|
|
1945
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1946
|
+
function CheckIcon(props) {
|
|
1947
|
+
return /* @__PURE__ */ jsx18(IconSVG, { ...props, children: /* @__PURE__ */ jsx18(
|
|
1948
|
+
"path",
|
|
1949
|
+
{
|
|
1950
|
+
d: "M5 13L9 17L19 7",
|
|
1951
|
+
fill: "none",
|
|
1952
|
+
stroke: "currentColor",
|
|
1953
|
+
strokeWidth: "2",
|
|
1954
|
+
strokeLinecap: "round",
|
|
1955
|
+
strokeLinejoin: "round"
|
|
1956
|
+
}
|
|
1957
|
+
) });
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1859
1960
|
// src/onboarding/GasBalance.tsx
|
|
1860
|
-
import { Fragment, jsx as
|
|
1961
|
+
import { Fragment, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1861
1962
|
function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
1862
1963
|
const { chain } = useEntryKitConfig();
|
|
1863
|
-
const
|
|
1964
|
+
const [copied, setCopied] = useState3(false);
|
|
1965
|
+
const balance = useShowQueryError(useBalance2({ chainId: chain.id, address: sessionAddress }));
|
|
1864
1966
|
useWatchBlockNumber({ onBlockNumber: () => balance.refetch() });
|
|
1865
1967
|
const setBalance3 = useShowMutationError(useSetBalance());
|
|
1866
1968
|
const relayChain = relayChains_default[chain.id];
|
|
1969
|
+
const handleCopy = () => {
|
|
1970
|
+
navigator.clipboard.writeText(sessionAddress);
|
|
1971
|
+
setCopied(true);
|
|
1972
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
1973
|
+
};
|
|
1867
1974
|
return /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-4", children: [
|
|
1868
1975
|
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between gap-4", children: [
|
|
1869
1976
|
/* @__PURE__ */ jsxs14("div", { children: [
|
|
1870
|
-
/* @__PURE__ */
|
|
1871
|
-
/* @__PURE__ */
|
|
1977
|
+
/* @__PURE__ */ jsx19("div", { children: "Gas balance" }),
|
|
1978
|
+
/* @__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" }) })
|
|
1872
1979
|
] }),
|
|
1873
|
-
chain.id === 31337 ? /* @__PURE__ */
|
|
1980
|
+
chain.id === 31337 ? /* @__PURE__ */ jsx19(
|
|
1874
1981
|
Button,
|
|
1875
1982
|
{
|
|
1876
1983
|
variant: isActive ? "primary" : "tertiary",
|
|
@@ -1879,19 +1986,19 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
1879
1986
|
pending: balance.status === "pending" || setBalance3.status === "pending",
|
|
1880
1987
|
onClick: () => setBalance3.mutate({
|
|
1881
1988
|
address: sessionAddress,
|
|
1882
|
-
value:
|
|
1989
|
+
value: parseEther4("0.01") + (balance.data?.value ?? 0n)
|
|
1883
1990
|
}),
|
|
1884
1991
|
children: "Top up"
|
|
1885
1992
|
}
|
|
1886
1993
|
) : relayChain != null ? (
|
|
1887
1994
|
// TODO: convert this to a <ButtonLink>
|
|
1888
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ jsx19(
|
|
1889
1996
|
"a",
|
|
1890
1997
|
{
|
|
1891
|
-
href: `${relayChain.bridgeUrl}?${new URLSearchParams({ toAddress: sessionAddress })}`,
|
|
1998
|
+
href: `${relayChain.bridgeUrl}?${new URLSearchParams({ toAddress: sessionAddress, amount: "0.01" })}`,
|
|
1892
1999
|
target: "_blank",
|
|
1893
2000
|
rel: "noopener noreferrer",
|
|
1894
|
-
children: /* @__PURE__ */
|
|
2001
|
+
children: /* @__PURE__ */ jsx19(
|
|
1895
2002
|
Button,
|
|
1896
2003
|
{
|
|
1897
2004
|
variant: isActive ? "primary" : "tertiary",
|
|
@@ -1906,11 +2013,23 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
1906
2013
|
) : null
|
|
1907
2014
|
] }),
|
|
1908
2015
|
isExpanded ? /* @__PURE__ */ jsxs14(Fragment, { children: [
|
|
1909
|
-
/* @__PURE__ */
|
|
2016
|
+
/* @__PURE__ */ jsx19("p", { className: "text-sm", children: "Your session's gas balance is used to pay for onchain computation." }),
|
|
1910
2017
|
/* @__PURE__ */ jsxs14("p", { className: "text-sm", children: [
|
|
1911
2018
|
"Send funds to",
|
|
1912
2019
|
" ",
|
|
1913
|
-
/* @__PURE__ */
|
|
2020
|
+
/* @__PURE__ */ jsxs14(
|
|
2021
|
+
"span",
|
|
2022
|
+
{
|
|
2023
|
+
className: "inline-flex items-center gap-1 font-mono text-white cursor-pointer hover:text-white/80 transition-colors",
|
|
2024
|
+
onClick: handleCopy,
|
|
2025
|
+
title: "Click to copy",
|
|
2026
|
+
children: [
|
|
2027
|
+
/* @__PURE__ */ jsx19(TruncatedHex, { hex: sessionAddress }),
|
|
2028
|
+
" ",
|
|
2029
|
+
copied ? /* @__PURE__ */ jsx19(CheckIcon, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ jsx19(CopyIcon, { className: "w-3.5 h-3.5" })
|
|
2030
|
+
]
|
|
2031
|
+
}
|
|
2032
|
+
),
|
|
1914
2033
|
" ",
|
|
1915
2034
|
"on ",
|
|
1916
2035
|
chain.name,
|
|
@@ -1920,22 +2039,1092 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
1920
2039
|
] });
|
|
1921
2040
|
}
|
|
1922
2041
|
|
|
2042
|
+
// src/onboarding/deposit/DepositFormContainer.tsx
|
|
2043
|
+
import { useState as useState5 } from "react";
|
|
2044
|
+
import { useChains as useChains5, useChainId } from "wagmi";
|
|
2045
|
+
|
|
2046
|
+
// src/onboarding/deposit/DepositViaTransferForm.tsx
|
|
2047
|
+
import { useAccount as useAccount5, useWriteContract, usePrepareTransactionRequest, usePublicClient } from "wagmi";
|
|
2048
|
+
import { encodeFunctionData as encodeFunctionData2 } from "viem";
|
|
2049
|
+
import { useMutation as useMutation4, useQuery as useQuery11 } from "@tanstack/react-query";
|
|
2050
|
+
|
|
2051
|
+
// src/onboarding/deposit/DepositForm.tsx
|
|
2052
|
+
import { useEffect as useEffect8, useRef as useRef2 } from "react";
|
|
2053
|
+
import { useAccount as useAccount4, useBalance as useBalance5, useWatchBlockNumber as useWatchBlockNumber2 } from "wagmi";
|
|
2054
|
+
import { useIsMounted } from "usehooks-ts";
|
|
2055
|
+
import { twMerge as twMerge15 } from "tailwind-merge";
|
|
2056
|
+
|
|
2057
|
+
// src/onboarding/deposit/ChainSelect.tsx
|
|
2058
|
+
import { useMemo as useMemo2 } from "react";
|
|
2059
|
+
import { twMerge as twMerge12 } from "tailwind-merge";
|
|
2060
|
+
import * as Select from "@radix-ui/react-select";
|
|
2061
|
+
import { useAccount as useAccount2, useChains as useChains2 } from "wagmi";
|
|
2062
|
+
|
|
2063
|
+
// src/icons/ChevronUpIcon.tsx
|
|
2064
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2065
|
+
function ChevronUpIcon(props) {
|
|
2066
|
+
return /* @__PURE__ */ jsx20(IconSVG, { viewBox: "0 0 20 20", ...props, children: /* @__PURE__ */ jsx20(
|
|
2067
|
+
"path",
|
|
2068
|
+
{
|
|
2069
|
+
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",
|
|
2070
|
+
fillRule: "evenodd",
|
|
2071
|
+
clipRule: "evenodd"
|
|
2072
|
+
}
|
|
2073
|
+
) });
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
// src/icons/ChevronDownIcon.tsx
|
|
2077
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2078
|
+
function ChevronDownIcon(props) {
|
|
2079
|
+
return /* @__PURE__ */ jsx21(IconSVG, { viewBox: "0 0 20 20", ...props, children: /* @__PURE__ */ jsx21(
|
|
2080
|
+
"path",
|
|
2081
|
+
{
|
|
2082
|
+
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",
|
|
2083
|
+
fillRule: "evenodd",
|
|
2084
|
+
clipRule: "evenodd"
|
|
2085
|
+
}
|
|
2086
|
+
) });
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
// src/ui/Slot.tsx
|
|
2090
|
+
import { isValidElement, cloneElement, Children } from "react";
|
|
2091
|
+
import { twMerge as twMerge8 } from "tailwind-merge";
|
|
2092
|
+
function Slot({
|
|
2093
|
+
children,
|
|
2094
|
+
...props
|
|
2095
|
+
}) {
|
|
2096
|
+
if (isValidElement(children)) {
|
|
2097
|
+
return cloneElement(children, {
|
|
2098
|
+
...props,
|
|
2099
|
+
...children.props,
|
|
2100
|
+
style: {
|
|
2101
|
+
...props.style,
|
|
2102
|
+
...children.props.style
|
|
2103
|
+
},
|
|
2104
|
+
className: twMerge8(props.className, children.props.className)
|
|
2105
|
+
});
|
|
2106
|
+
}
|
|
2107
|
+
if (Children.count(children) > 1) {
|
|
2108
|
+
Children.only(null);
|
|
2109
|
+
}
|
|
2110
|
+
return null;
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
// src/ui/Input.tsx
|
|
2114
|
+
import { twMerge as twMerge9 } from "tailwind-merge";
|
|
2115
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2116
|
+
function Input({ asChild, className, ...props }) {
|
|
2117
|
+
const Child = asChild ? Slot : "input";
|
|
2118
|
+
return /* @__PURE__ */ jsx22(
|
|
2119
|
+
Child,
|
|
2120
|
+
{
|
|
2121
|
+
className: twMerge9(
|
|
2122
|
+
"p-2.5 gap-1 border text-lg font-medium transition",
|
|
2123
|
+
"outline-none ring-2 ring-transparent focus-within:ring-orange-500 focus-within:border-transparent",
|
|
2124
|
+
"bg-white border-neutral-300 text-black placeholder:text-neutral-400",
|
|
2125
|
+
"dark:bg-neutral-900 dark:border-neutral-700 dark:text-white dark:placeholder:text-neutral-500",
|
|
2126
|
+
className
|
|
2127
|
+
),
|
|
2128
|
+
...props
|
|
2129
|
+
}
|
|
2130
|
+
);
|
|
2131
|
+
}
|
|
2132
|
+
|
|
2133
|
+
// src/onboarding/deposit/ChainBalance.tsx
|
|
2134
|
+
import { useBalance as useBalance3 } from "wagmi";
|
|
2135
|
+
import { Fragment as Fragment2, jsx as jsx23 } from "react/jsx-runtime";
|
|
2136
|
+
function ChainBalance({ chainId, address }) {
|
|
2137
|
+
const balance = useBalance3({ chainId, address });
|
|
2138
|
+
return /* @__PURE__ */ jsx23(Fragment2, { children: balance.data ? /* @__PURE__ */ jsx23(Balance, { wei: balance.data.value }) : /* @__PURE__ */ jsx23(PendingIcon, {}) });
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
// src/onboarding/deposit/ChainIcon.tsx
|
|
2142
|
+
import { twMerge as twMerge11 } from "tailwind-merge";
|
|
2143
|
+
|
|
2144
|
+
// src/onboarding/deposit/PreloadedImage.tsx
|
|
2145
|
+
import { twMerge as twMerge10 } from "tailwind-merge";
|
|
2146
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2147
|
+
function PreloadedImage({ url, fallback: fallback2, className }) {
|
|
2148
|
+
const { isSuccess, isLoading } = usePreloadImage(url);
|
|
2149
|
+
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 });
|
|
2150
|
+
}
|
|
2151
|
+
|
|
2152
|
+
// src/onboarding/deposit/ChainIcon.tsx
|
|
2153
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
2154
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2155
|
+
var ChainIcon = forwardRef2(function ChainIcon2({ name, url, className }, forwardedRef) {
|
|
2156
|
+
return /* @__PURE__ */ jsx25(
|
|
2157
|
+
"span",
|
|
2158
|
+
{
|
|
2159
|
+
ref: forwardedRef,
|
|
2160
|
+
className: twMerge11("flex-shrink-0 inline-flex w-6 aspect-square rounded-full overflow-clip", className),
|
|
2161
|
+
children: url ? /* @__PURE__ */ jsx25(PreloadedImage, { url }) : (
|
|
2162
|
+
// TODO: better placeholder
|
|
2163
|
+
/* @__PURE__ */ jsx25(
|
|
2164
|
+
"span",
|
|
2165
|
+
{
|
|
2166
|
+
className: twMerge11(
|
|
2167
|
+
"inline-flex items-center justify-center w-full h-full rounded-full",
|
|
2168
|
+
"border-2 border-dashed border-black/20 dark:border-white/50 opacity-50"
|
|
2169
|
+
),
|
|
2170
|
+
children: name?.slice(0, 1)
|
|
2171
|
+
}
|
|
2172
|
+
)
|
|
2173
|
+
)
|
|
2174
|
+
}
|
|
2175
|
+
);
|
|
2176
|
+
});
|
|
2177
|
+
|
|
2178
|
+
// src/onboarding/deposit/useRelay.ts
|
|
2179
|
+
import {
|
|
2180
|
+
MAINNET_RELAY_API,
|
|
2181
|
+
TESTNET_RELAY_API,
|
|
2182
|
+
fetchChainConfigs,
|
|
2183
|
+
createClient as createClient2,
|
|
2184
|
+
LogLevel
|
|
2185
|
+
} from "@reservoir0x/relay-sdk";
|
|
2186
|
+
import { useQuery as useQuery10 } from "@tanstack/react-query";
|
|
2187
|
+
function useRelay() {
|
|
2188
|
+
const { chain } = useEntryKitConfig();
|
|
2189
|
+
const appOrigin = location.host;
|
|
2190
|
+
const baseApiUrl = chain.testnet ? TESTNET_RELAY_API : MAINNET_RELAY_API;
|
|
2191
|
+
return useQuery10({
|
|
2192
|
+
queryKey: ["relayChains", baseApiUrl, appOrigin],
|
|
2193
|
+
queryFn: async () => {
|
|
2194
|
+
debug("fetching relay chains from", baseApiUrl);
|
|
2195
|
+
const chains = await fetchChainConfigs(baseApiUrl);
|
|
2196
|
+
debug("got relay chains", chains);
|
|
2197
|
+
const client = createClient2({
|
|
2198
|
+
baseApiUrl,
|
|
2199
|
+
source: appOrigin,
|
|
2200
|
+
chains,
|
|
2201
|
+
logLevel: LogLevel.Verbose
|
|
2202
|
+
});
|
|
2203
|
+
return { client, chains };
|
|
2204
|
+
},
|
|
2205
|
+
refetchOnMount: false,
|
|
2206
|
+
refetchOnReconnect: false,
|
|
2207
|
+
refetchOnWindowFocus: false,
|
|
2208
|
+
staleTime: Infinity
|
|
2209
|
+
});
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
// src/onboarding/deposit/ChainSelect.tsx
|
|
2213
|
+
import { Fragment as Fragment3, jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2214
|
+
function ChainSelect({ value, onChange }) {
|
|
2215
|
+
const theme = useTheme();
|
|
2216
|
+
const { frame } = useFrame();
|
|
2217
|
+
const userAccount = useAccount2();
|
|
2218
|
+
const chains = useChains2();
|
|
2219
|
+
const relay = useRelay();
|
|
2220
|
+
const relayChains = relay.data?.chains;
|
|
2221
|
+
const sourceChains = useMemo2(() => {
|
|
2222
|
+
return chains.map((sourceChain) => {
|
|
2223
|
+
const relayChain = relayChains?.find((c) => c.id === sourceChain.id);
|
|
2224
|
+
return {
|
|
2225
|
+
...sourceChain,
|
|
2226
|
+
relayChain
|
|
2227
|
+
};
|
|
2228
|
+
}).filter((c) => c.relayChain);
|
|
2229
|
+
}, [chains, relayChains]);
|
|
2230
|
+
const selectedChain = sourceChains.find((c) => c.id === value);
|
|
2231
|
+
return /* @__PURE__ */ jsxs15(
|
|
2232
|
+
Select.Root,
|
|
2233
|
+
{
|
|
2234
|
+
value: value.toString(),
|
|
2235
|
+
onValueChange: (value2) => {
|
|
2236
|
+
if (value2) {
|
|
2237
|
+
const chain = sourceChains.find((chain2) => chain2.id.toString() === value2);
|
|
2238
|
+
if (!chain) throw new Error(`Unknown chain selected: ${value2}`);
|
|
2239
|
+
onChange(chain.id);
|
|
2240
|
+
}
|
|
2241
|
+
},
|
|
2242
|
+
children: [
|
|
2243
|
+
/* @__PURE__ */ jsx26(Input, { asChild: true, children: /* @__PURE__ */ jsxs15(Select.Trigger, { className: "group inline-flex items-center justify-center", children: [
|
|
2244
|
+
/* @__PURE__ */ jsx26(Select.Value, { asChild: true, children: /* @__PURE__ */ jsx26(
|
|
2245
|
+
ChainIcon,
|
|
2246
|
+
{
|
|
2247
|
+
id: selectedChain?.id,
|
|
2248
|
+
name: selectedChain?.name,
|
|
2249
|
+
url: selectedChain?.relayChain?.icon?.[theme],
|
|
2250
|
+
className: "w-8"
|
|
2251
|
+
}
|
|
2252
|
+
) }),
|
|
2253
|
+
/* @__PURE__ */ jsx26(Select.Icon, { asChild: true, children: /* @__PURE__ */ jsxs15(Fragment3, { children: [
|
|
2254
|
+
/* @__PURE__ */ jsx26(ChevronDownIcon, { className: "text-sm -mr-1 group-aria-expanded:hidden" }),
|
|
2255
|
+
/* @__PURE__ */ jsx26(ChevronUpIcon, { className: "text-sm -mr-1 hidden group-aria-expanded:inline" })
|
|
2256
|
+
] }) })
|
|
2257
|
+
] }) }),
|
|
2258
|
+
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(
|
|
2259
|
+
Select.Group,
|
|
2260
|
+
{
|
|
2261
|
+
className: twMerge12(
|
|
2262
|
+
"flex flex-col border divide-y",
|
|
2263
|
+
"bg-neutral-100 text-neutral-700 border-neutral-300 divide-neutral-300",
|
|
2264
|
+
"dark:bg-neutral-800 dark:text-neutral-300 dark:border-neutral-700 dark:divide-neutral-700"
|
|
2265
|
+
),
|
|
2266
|
+
children: sourceChains.map((chain) => (
|
|
2267
|
+
// TODO: figure out why up/down arrow jump to top/bottom rather than cycling through items
|
|
2268
|
+
/* @__PURE__ */ jsxs15(
|
|
2269
|
+
Select.Item,
|
|
2270
|
+
{
|
|
2271
|
+
value: chain.id.toString(),
|
|
2272
|
+
className: twMerge12(
|
|
2273
|
+
"group flex p-2.5 gap-2.5 items-center cursor-pointer outline-none",
|
|
2274
|
+
// TODO: different style for checked/active state
|
|
2275
|
+
"text-black focus:bg-white data-[state=checked]:bg-neutral-200",
|
|
2276
|
+
"dark:text-white dark:focus:bg-neutral-700 dark:data-[state=checked]:bg-neutral-900"
|
|
2277
|
+
),
|
|
2278
|
+
children: [
|
|
2279
|
+
/* @__PURE__ */ jsx26(ChainIcon, { id: chain.id, name: chain.name, url: chain.relayChain?.icon?.[theme] }),
|
|
2280
|
+
/* @__PURE__ */ jsx26("span", { className: "flex-grow flex-shrink-0", children: chain.name }),
|
|
2281
|
+
/* @__PURE__ */ jsx26("span", { className: "flex-shrink-0 font-mono text-sm text-neutral-500 dark:text-neutral-400", children: /* @__PURE__ */ jsx26(ChainBalance, { chainId: chain.id, address: userAccount.address }) })
|
|
2282
|
+
]
|
|
2283
|
+
},
|
|
2284
|
+
chain.id
|
|
2285
|
+
)
|
|
2286
|
+
))
|
|
2287
|
+
}
|
|
2288
|
+
) }) }) }) : null
|
|
2289
|
+
]
|
|
2290
|
+
}
|
|
2291
|
+
);
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
// src/onboarding/deposit/AmountInput.tsx
|
|
2295
|
+
import { formatEther as formatEther3, parseEther as parseEther5 } from "viem";
|
|
2296
|
+
import { twMerge as twMerge13 } from "tailwind-merge";
|
|
2297
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
2298
|
+
import { jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2299
|
+
var AmountInput = forwardRef3(function AmountInput2({ initialAmount, onChange }, forwardedRef) {
|
|
2300
|
+
return /* @__PURE__ */ jsx27(Input, { asChild: true, className: "w-full cursor-text flex items-center", children: /* @__PURE__ */ jsxs16("label", { children: [
|
|
2301
|
+
/* @__PURE__ */ jsx27(
|
|
2302
|
+
"input",
|
|
2303
|
+
{
|
|
2304
|
+
ref: forwardedRef,
|
|
2305
|
+
className: twMerge13(
|
|
2306
|
+
"peer flex-grow outline-none bg-transparent",
|
|
2307
|
+
"placeholder:text-neutral-400",
|
|
2308
|
+
"dark:placeholder:text-neutral-500"
|
|
2309
|
+
),
|
|
2310
|
+
placeholder: "0.005",
|
|
2311
|
+
required: true,
|
|
2312
|
+
autoFocus: true,
|
|
2313
|
+
defaultValue: initialAmount == null ? "" : formatEther3(initialAmount),
|
|
2314
|
+
onChange: (event) => {
|
|
2315
|
+
const input = event.currentTarget;
|
|
2316
|
+
if (input.value.trim() === "") {
|
|
2317
|
+
input.setCustomValidity("");
|
|
2318
|
+
onChange(void 0);
|
|
2319
|
+
return;
|
|
2320
|
+
}
|
|
2321
|
+
const value = input.value.trim().replace(/\.$/, ".0");
|
|
2322
|
+
if (!/^\d*(\.\d+)?$/.test(value)) {
|
|
2323
|
+
return input.setCustomValidity("Invalid amount.");
|
|
2324
|
+
}
|
|
2325
|
+
input.setCustomValidity("");
|
|
2326
|
+
onChange(parseEther5(value));
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
),
|
|
2330
|
+
/* @__PURE__ */ jsx27(
|
|
2331
|
+
"span",
|
|
2332
|
+
{
|
|
2333
|
+
className: twMerge13(
|
|
2334
|
+
"flex-shrink-0 text-2xl",
|
|
2335
|
+
"peer-placeholder-shown:text-neutral-400",
|
|
2336
|
+
"dark:peer-placeholder-shown:text-neutral-500"
|
|
2337
|
+
),
|
|
2338
|
+
children: /* @__PURE__ */ jsx27(EthIcon, {})
|
|
2339
|
+
}
|
|
2340
|
+
)
|
|
2341
|
+
] }) });
|
|
2342
|
+
});
|
|
2343
|
+
|
|
2344
|
+
// src/onboarding/deposit/SubmitButton.tsx
|
|
2345
|
+
import { useAccount as useAccount3, useBalance as useBalance4, useSwitchChain } from "wagmi";
|
|
2346
|
+
import { twMerge as twMerge14 } from "tailwind-merge";
|
|
2347
|
+
import { parseEther as parseEther6 } from "viem";
|
|
2348
|
+
import { jsx as jsx28, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2349
|
+
var MAX_DEPOSIT_AMOUNT = "0.1";
|
|
2350
|
+
function SubmitButton({ amount, chainId, className, ...buttonProps }) {
|
|
2351
|
+
const { chainId: userChainId, address: userAddress } = useAccount3();
|
|
2352
|
+
const { data: userBalance } = useBalance4({ address: userAddress });
|
|
2353
|
+
const shouldSwitchChain = chainId != null && chainId !== userChainId;
|
|
2354
|
+
const switchChain = useSwitchChain();
|
|
2355
|
+
if (shouldSwitchChain) {
|
|
2356
|
+
return /* @__PURE__ */ jsx28(
|
|
2357
|
+
Button,
|
|
2358
|
+
{
|
|
2359
|
+
type: "button",
|
|
2360
|
+
className: twMerge14("w-full", className),
|
|
2361
|
+
pending: switchChain.isPending,
|
|
2362
|
+
onClick: () => switchChain.switchChain({ chainId }),
|
|
2363
|
+
children: "Switch chain"
|
|
2364
|
+
}
|
|
2365
|
+
);
|
|
2366
|
+
} else if (amount) {
|
|
2367
|
+
if (amount > parseEther6(MAX_DEPOSIT_AMOUNT)) {
|
|
2368
|
+
return /* @__PURE__ */ jsxs17(Button, { type: "button", className: twMerge14("w-full", className), disabled: true, children: [
|
|
2369
|
+
"Max amount is ",
|
|
2370
|
+
MAX_DEPOSIT_AMOUNT,
|
|
2371
|
+
" ETH"
|
|
2372
|
+
] });
|
|
2373
|
+
} else if (amount > (userBalance?.value ?? 0n)) {
|
|
2374
|
+
return /* @__PURE__ */ jsx28(Button, { type: "button", className: twMerge14("w-full", className), disabled: true, children: "Insufficient balance" });
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
return /* @__PURE__ */ jsx28(Button, { type: "submit", className: twMerge14("w-full", className), ...buttonProps });
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
// src/icons/WarningIcon.tsx
|
|
2381
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2382
|
+
function WarningIcon(props) {
|
|
2383
|
+
return /* @__PURE__ */ jsx29(IconSVG, { fill: "none", ...props, children: /* @__PURE__ */ jsx29(
|
|
2384
|
+
"path",
|
|
2385
|
+
{
|
|
2386
|
+
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",
|
|
2387
|
+
stroke: "currentColor",
|
|
2388
|
+
strokeWidth: "2",
|
|
2389
|
+
strokeLinecap: "round",
|
|
2390
|
+
strokeLinejoin: "round"
|
|
2391
|
+
}
|
|
2392
|
+
) });
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
// src/formatGas.ts
|
|
2396
|
+
import { formatGwei } from "viem";
|
|
2397
|
+
function formatGas(wei) {
|
|
2398
|
+
const formatted = formatGwei(wei);
|
|
2399
|
+
const magnitude = Math.floor(parseFloat(formatted)).toString().length;
|
|
2400
|
+
return parseFloat(formatted).toLocaleString("en-US", { maximumFractionDigits: Math.max(0, 6 - magnitude) });
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
// src/onboarding/deposit/DepositForm.tsx
|
|
2404
|
+
import { Fragment as Fragment4, jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2405
|
+
function DepositForm({
|
|
2406
|
+
sourceChain,
|
|
2407
|
+
setSourceChainId,
|
|
2408
|
+
amount,
|
|
2409
|
+
setAmount,
|
|
2410
|
+
estimatedFee,
|
|
2411
|
+
estimatedTime,
|
|
2412
|
+
onSubmit,
|
|
2413
|
+
submitButton
|
|
2414
|
+
}) {
|
|
2415
|
+
const amountInputRef = useRef2(null);
|
|
2416
|
+
const isMounted = useIsMounted();
|
|
2417
|
+
const { address: userAddress, chainId: userChainId } = useAccount4();
|
|
2418
|
+
const balance = useShowQueryError(useBalance5({ chainId: sourceChain.id, address: userAddress }));
|
|
2419
|
+
const quarryBalance = useShowQueryError(useBalance(userAddress));
|
|
2420
|
+
useWatchBlockNumber2({
|
|
2421
|
+
onBlockNumber: () => {
|
|
2422
|
+
balance.refetch();
|
|
2423
|
+
quarryBalance.refetch();
|
|
2424
|
+
}
|
|
2425
|
+
});
|
|
2426
|
+
const minimumBalance = amount != null ? amount + (estimatedFee?.fee ?? 0n) : void 0;
|
|
2427
|
+
const hasMinimumBalance = balance.data != null ? balance.data.value > (minimumBalance ?? 0n) : void 0;
|
|
2428
|
+
useEffect8(() => {
|
|
2429
|
+
amountInputRef.current?.focus();
|
|
2430
|
+
}, [userChainId]);
|
|
2431
|
+
return /* @__PURE__ */ jsxs18(
|
|
2432
|
+
"form",
|
|
2433
|
+
{
|
|
2434
|
+
className: "flex flex-col gap-5",
|
|
2435
|
+
onSubmit: async (event) => {
|
|
2436
|
+
event.preventDefault();
|
|
2437
|
+
try {
|
|
2438
|
+
await onSubmit();
|
|
2439
|
+
if (isMounted()) {
|
|
2440
|
+
setAmount(void 0);
|
|
2441
|
+
if (amountInputRef.current) {
|
|
2442
|
+
amountInputRef.current.value = "";
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2445
|
+
} catch (error2) {
|
|
2446
|
+
console.error("Error during deposit", error2);
|
|
2447
|
+
} finally {
|
|
2448
|
+
amountInputRef.current?.focus();
|
|
2449
|
+
}
|
|
2450
|
+
},
|
|
2451
|
+
children: [
|
|
2452
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex gap-2", children: [
|
|
2453
|
+
/* @__PURE__ */ jsx30(ChainSelect, { value: sourceChain.id, onChange: setSourceChainId }),
|
|
2454
|
+
/* @__PURE__ */ jsx30(AmountInput, { ref: amountInputRef, initialAmount: amount, onChange: setAmount })
|
|
2455
|
+
] }),
|
|
2456
|
+
/* @__PURE__ */ jsxs18(
|
|
2457
|
+
"dl",
|
|
2458
|
+
{
|
|
2459
|
+
className: twMerge15(
|
|
2460
|
+
"grid grid-cols-2 divide-y text-sm leading-loose [&_>_:is(dt,dd)]:px-1 [&_>_dd]:text-right",
|
|
2461
|
+
"divide-neutral-200 text-neutral-500",
|
|
2462
|
+
"dark:divide-neutral-700 dark:text-neutral-400"
|
|
2463
|
+
),
|
|
2464
|
+
children: [
|
|
2465
|
+
/* @__PURE__ */ jsx30("dt", { children: "Available to deposit" }),
|
|
2466
|
+
/* @__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 }),
|
|
2467
|
+
/* @__PURE__ */ jsx30("dt", { children: "Gas balance after deposit" }),
|
|
2468
|
+
/* @__PURE__ */ jsx30("dd", { children: /* @__PURE__ */ jsx30(Balance, { wei: (quarryBalance.data ?? 0n) + (amount ?? 0n) }) }),
|
|
2469
|
+
/* @__PURE__ */ jsx30("dt", { children: "Estimated fee" }),
|
|
2470
|
+
/* @__PURE__ */ jsx30("dd", { children: estimatedFee.fee ? /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
2471
|
+
formatGas(estimatedFee.fee),
|
|
2472
|
+
" gwei"
|
|
2473
|
+
] }) : 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 }),
|
|
2474
|
+
/* @__PURE__ */ jsx30("dt", { children: "Time to deposit" }),
|
|
2475
|
+
/* @__PURE__ */ jsx30("dd", { children: estimatedTime })
|
|
2476
|
+
]
|
|
2477
|
+
}
|
|
2478
|
+
),
|
|
2479
|
+
hasMinimumBalance ? submitButton : /* @__PURE__ */ jsx30(SubmitButton, { disabled: true, children: "Not enough funds" })
|
|
2480
|
+
]
|
|
2481
|
+
}
|
|
2482
|
+
);
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2485
|
+
// src/onboarding/deposit/useDeposits.ts
|
|
2486
|
+
import { createStore as createStore4 } from "zustand/vanilla";
|
|
2487
|
+
import { useStore as useStore2 } from "zustand";
|
|
2488
|
+
import { useCallback as useCallback2, useMemo as useMemo3 } from "react";
|
|
2489
|
+
var store4 = createStore4(() => ({
|
|
2490
|
+
count: 0,
|
|
2491
|
+
deposits: []
|
|
2492
|
+
}));
|
|
2493
|
+
function useDeposits() {
|
|
2494
|
+
const deposits = useStore2(store4, (state) => state.deposits);
|
|
2495
|
+
const addDeposit = useCallback2((transaction) => {
|
|
2496
|
+
store4.setState((state) => {
|
|
2497
|
+
if (transaction.type === "relay") {
|
|
2498
|
+
const existingDeposit = state.deposits.find(
|
|
2499
|
+
(deposit) => deposit.type === "relay" && deposit.requestId === transaction.requestId
|
|
2500
|
+
);
|
|
2501
|
+
if (existingDeposit) {
|
|
2502
|
+
return state;
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
return {
|
|
2506
|
+
count: state.count + 1,
|
|
2507
|
+
deposits: [
|
|
2508
|
+
...state.deposits,
|
|
2509
|
+
{
|
|
2510
|
+
...transaction,
|
|
2511
|
+
uid: `deposit-${state.count}`
|
|
2512
|
+
}
|
|
2513
|
+
]
|
|
2514
|
+
};
|
|
2515
|
+
});
|
|
2516
|
+
}, []);
|
|
2517
|
+
const removeDeposit = useCallback2((uid) => {
|
|
2518
|
+
store4.setState((state) => ({
|
|
2519
|
+
deposits: state.deposits.filter((deposit) => deposit.uid !== uid)
|
|
2520
|
+
}));
|
|
2521
|
+
}, []);
|
|
2522
|
+
return useMemo3(
|
|
2523
|
+
() => ({
|
|
2524
|
+
deposits,
|
|
2525
|
+
addDeposit,
|
|
2526
|
+
removeDeposit
|
|
2527
|
+
}),
|
|
2528
|
+
[addDeposit, deposits, removeDeposit]
|
|
2529
|
+
);
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2532
|
+
// src/onboarding/deposit/DepositViaTransferForm.tsx
|
|
2533
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2534
|
+
function DepositViaTransferForm({ amount, setAmount, sourceChain, setSourceChainId }) {
|
|
2535
|
+
const { chain } = useEntryKitConfig();
|
|
2536
|
+
const paymaster = getPaymaster(chain);
|
|
2537
|
+
const publicClient = usePublicClient();
|
|
2538
|
+
const { address: userAddress } = useAccount5();
|
|
2539
|
+
const { writeContractAsync } = useWriteContract();
|
|
2540
|
+
const { addDeposit } = useDeposits();
|
|
2541
|
+
if (!userAddress) {
|
|
2542
|
+
throw new Error("User address not found");
|
|
2543
|
+
}
|
|
2544
|
+
const { data: gasPrice } = useQuery11({
|
|
2545
|
+
queryKey: ["gasPrice", sourceChain.id],
|
|
2546
|
+
queryFn: async () => {
|
|
2547
|
+
if (!publicClient) throw new Error("Public client not available");
|
|
2548
|
+
return publicClient.getGasPrice();
|
|
2549
|
+
},
|
|
2550
|
+
refetchInterval: 15e3,
|
|
2551
|
+
enabled: !!publicClient
|
|
2552
|
+
});
|
|
2553
|
+
const { data: prepareData, error: prepareError } = usePrepareTransactionRequest({
|
|
2554
|
+
to: paymaster?.address,
|
|
2555
|
+
data: encodeFunctionData2({
|
|
2556
|
+
abi: paymasterAbi,
|
|
2557
|
+
functionName: "depositTo",
|
|
2558
|
+
args: [userAddress]
|
|
2559
|
+
}),
|
|
2560
|
+
value: amount
|
|
2561
|
+
});
|
|
2562
|
+
const deposit = useMutation4({
|
|
2563
|
+
mutationKey: ["depositViaTransfer", amount?.toString()],
|
|
2564
|
+
mutationFn: async () => {
|
|
2565
|
+
if (!paymaster) throw new Error("Paymaster not found");
|
|
2566
|
+
if (!publicClient) throw new Error("Public client not found");
|
|
2567
|
+
if (!amount) throw new Error("Amount cannot be 0");
|
|
2568
|
+
try {
|
|
2569
|
+
const hash = await writeContractAsync({
|
|
2570
|
+
address: paymaster.address,
|
|
2571
|
+
abi: paymasterAbi,
|
|
2572
|
+
functionName: "depositTo",
|
|
2573
|
+
args: [userAddress],
|
|
2574
|
+
value: amount
|
|
2575
|
+
});
|
|
2576
|
+
const receipt = publicClient.waitForTransactionReceipt({ hash }).then((receipt2) => {
|
|
2577
|
+
if (receipt2.status === "reverted") {
|
|
2578
|
+
throw new Error("Transfer transaction reverted.");
|
|
2579
|
+
}
|
|
2580
|
+
return receipt2;
|
|
2581
|
+
});
|
|
2582
|
+
const pendingDeposit = {
|
|
2583
|
+
type: "transfer",
|
|
2584
|
+
amount,
|
|
2585
|
+
chainL1Id: sourceChain.id,
|
|
2586
|
+
chainL2Id: chain.id,
|
|
2587
|
+
hash,
|
|
2588
|
+
receipt,
|
|
2589
|
+
start: /* @__PURE__ */ new Date(),
|
|
2590
|
+
estimatedTime: 1e3 * 12,
|
|
2591
|
+
isComplete: receipt.then(() => void 0)
|
|
2592
|
+
};
|
|
2593
|
+
addDeposit(pendingDeposit);
|
|
2594
|
+
} catch (error2) {
|
|
2595
|
+
console.error("Error while depositing via bridge", error2);
|
|
2596
|
+
throw error2;
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2599
|
+
});
|
|
2600
|
+
const estimatedFee = prepareData?.gas && gasPrice ? prepareData.gas * gasPrice : void 0;
|
|
2601
|
+
return /* @__PURE__ */ jsx31(
|
|
2602
|
+
DepositForm,
|
|
2603
|
+
{
|
|
2604
|
+
sourceChain,
|
|
2605
|
+
setSourceChainId,
|
|
2606
|
+
amount,
|
|
2607
|
+
setAmount,
|
|
2608
|
+
estimatedFee: {
|
|
2609
|
+
fee: estimatedFee,
|
|
2610
|
+
isLoading: !prepareData && !prepareError || !gasPrice,
|
|
2611
|
+
error: prepareError instanceof Error ? prepareError : void 0
|
|
2612
|
+
},
|
|
2613
|
+
estimatedTime: "A few seconds",
|
|
2614
|
+
onSubmit: async () => {
|
|
2615
|
+
await deposit.mutateAsync();
|
|
2616
|
+
},
|
|
2617
|
+
submitButton: /* @__PURE__ */ jsx31(
|
|
2618
|
+
SubmitButton,
|
|
2619
|
+
{
|
|
2620
|
+
variant: "primary",
|
|
2621
|
+
amount,
|
|
2622
|
+
chainId: sourceChain.id,
|
|
2623
|
+
disabled: !!prepareError || !amount || !userAddress,
|
|
2624
|
+
pending: deposit.isPending,
|
|
2625
|
+
children: "Deposit"
|
|
2626
|
+
}
|
|
2627
|
+
)
|
|
2628
|
+
}
|
|
2629
|
+
);
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
// src/onboarding/deposit/DepositViaRelayForm.tsx
|
|
2633
|
+
import { encodeFunctionData as encodeFunctionData3 } from "viem";
|
|
2634
|
+
import { useAccount as useAccount6, useWalletClient } from "wagmi";
|
|
2635
|
+
import { useMutation as useMutation5, useQuery as useQuery12 } from "@tanstack/react-query";
|
|
2636
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2637
|
+
var ETH_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
2638
|
+
function DepositViaRelayForm({ amount, setAmount, sourceChain, setSourceChainId }) {
|
|
2639
|
+
const { chain, chainId: destinationChainId } = useEntryKitConfig();
|
|
2640
|
+
const paymaster = getPaymaster(chain);
|
|
2641
|
+
const { data: wallet } = useWalletClient();
|
|
2642
|
+
const { address: userAddress } = useAccount6();
|
|
2643
|
+
const { addDeposit } = useDeposits();
|
|
2644
|
+
const { data: relay } = useRelay();
|
|
2645
|
+
const relayClient = relay?.client;
|
|
2646
|
+
const quote = useQuery12({
|
|
2647
|
+
queryKey: ["relayBridgeQuote", sourceChain.id, amount?.toString()],
|
|
2648
|
+
queryFn: async () => {
|
|
2649
|
+
if (!relayClient) throw new Error("No Relay client found.");
|
|
2650
|
+
if (!userAddress) throw new Error("No user address found.");
|
|
2651
|
+
const result = await relayClient.actions.getQuote({
|
|
2652
|
+
chainId: sourceChain.id,
|
|
2653
|
+
toChainId: destinationChainId,
|
|
2654
|
+
currency: ETH_ADDRESS,
|
|
2655
|
+
toCurrency: ETH_ADDRESS,
|
|
2656
|
+
amount: amount?.toString(),
|
|
2657
|
+
tradeType: "EXACT_OUTPUT",
|
|
2658
|
+
recipient: paymaster?.address,
|
|
2659
|
+
wallet,
|
|
2660
|
+
txs: [
|
|
2661
|
+
{
|
|
2662
|
+
to: paymaster?.address,
|
|
2663
|
+
data: encodeFunctionData3({
|
|
2664
|
+
abi: paymasterAbi,
|
|
2665
|
+
functionName: "depositTo",
|
|
2666
|
+
args: [userAddress]
|
|
2667
|
+
}),
|
|
2668
|
+
value: amount?.toString()
|
|
2669
|
+
}
|
|
2670
|
+
]
|
|
2671
|
+
});
|
|
2672
|
+
if (!result) {
|
|
2673
|
+
throw new Error("Failed to get relay quote");
|
|
2674
|
+
}
|
|
2675
|
+
return result;
|
|
2676
|
+
},
|
|
2677
|
+
retry: 1,
|
|
2678
|
+
refetchInterval: 15e3,
|
|
2679
|
+
enabled: !!amount && !!userAddress && !!relayClient
|
|
2680
|
+
});
|
|
2681
|
+
const deposit = useMutation5({
|
|
2682
|
+
mutationKey: ["depositViaRelay", sourceChain.id, amount?.toString()],
|
|
2683
|
+
mutationFn: async ({ quote: quote2, amount: amount2 }) => {
|
|
2684
|
+
if (!relayClient) throw new Error("No Relay client found.");
|
|
2685
|
+
if (!wallet) throw new Error("No wallet found.");
|
|
2686
|
+
try {
|
|
2687
|
+
return new Promise((resolve) => {
|
|
2688
|
+
const pendingDeposit = relayClient.actions.execute({
|
|
2689
|
+
quote: quote2,
|
|
2690
|
+
wallet,
|
|
2691
|
+
onProgress(progress) {
|
|
2692
|
+
const currentStep = progress.currentStep;
|
|
2693
|
+
const requestId = currentStep?.requestId;
|
|
2694
|
+
const currentState = currentStep?.items[0]?.progressState;
|
|
2695
|
+
if (requestId && currentState === "validating") {
|
|
2696
|
+
addDeposit({
|
|
2697
|
+
type: "relay",
|
|
2698
|
+
requestId,
|
|
2699
|
+
amount: amount2,
|
|
2700
|
+
chainL1Id: sourceChain.id,
|
|
2701
|
+
chainL2Id: destinationChainId,
|
|
2702
|
+
start: /* @__PURE__ */ new Date(),
|
|
2703
|
+
estimatedTime: 1e3 * 30,
|
|
2704
|
+
depositPromise: pendingDeposit,
|
|
2705
|
+
isComplete: pendingDeposit.then(() => void 0)
|
|
2706
|
+
});
|
|
2707
|
+
resolve(void 0);
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
});
|
|
2711
|
+
});
|
|
2712
|
+
} catch (error2) {
|
|
2713
|
+
console.error("Error while depositing via Relay", error2);
|
|
2714
|
+
throw error2;
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
});
|
|
2718
|
+
const fees = quote.data?.fees;
|
|
2719
|
+
const gasFee = BigInt(fees?.gas?.amount ?? 0);
|
|
2720
|
+
const relayerFee = BigInt(fees?.relayer?.amount ?? 0);
|
|
2721
|
+
const fee = gasFee + relayerFee;
|
|
2722
|
+
return /* @__PURE__ */ jsx32(
|
|
2723
|
+
DepositForm,
|
|
2724
|
+
{
|
|
2725
|
+
sourceChain,
|
|
2726
|
+
setSourceChainId,
|
|
2727
|
+
amount,
|
|
2728
|
+
setAmount,
|
|
2729
|
+
estimatedFee: {
|
|
2730
|
+
fee: fee != null ? BigInt(fee) : void 0,
|
|
2731
|
+
isLoading: quote.isLoading,
|
|
2732
|
+
error: quote.error instanceof Error ? quote.error : void 0
|
|
2733
|
+
},
|
|
2734
|
+
estimatedTime: "A few seconds",
|
|
2735
|
+
onSubmit: async () => {
|
|
2736
|
+
if (!quote.data || !amount) return;
|
|
2737
|
+
await deposit.mutateAsync({ quote: quote.data, amount });
|
|
2738
|
+
},
|
|
2739
|
+
submitButton: /* @__PURE__ */ jsx32(
|
|
2740
|
+
SubmitButton,
|
|
2741
|
+
{
|
|
2742
|
+
variant: "primary",
|
|
2743
|
+
amount,
|
|
2744
|
+
chainId: sourceChain.id,
|
|
2745
|
+
disabled: quote.isError || !amount,
|
|
2746
|
+
pending: deposit.isPending,
|
|
2747
|
+
children: "Deposit"
|
|
2748
|
+
}
|
|
2749
|
+
)
|
|
2750
|
+
}
|
|
2751
|
+
);
|
|
2752
|
+
}
|
|
2753
|
+
|
|
2754
|
+
// src/onboarding/deposit/Deposits.tsx
|
|
2755
|
+
import { useEffect as useEffect10 } from "react";
|
|
2756
|
+
import { useQuery as useQuery15, useQueryClient as useQueryClient6 } from "@tanstack/react-query";
|
|
2757
|
+
|
|
2758
|
+
// src/onboarding/deposit/TransferDepositStatus.tsx
|
|
2759
|
+
import { useQuery as useQuery13 } from "@tanstack/react-query";
|
|
2760
|
+
|
|
2761
|
+
// src/onboarding/deposit/DepositStatus.tsx
|
|
2762
|
+
import { useEffect as useEffect9, useState as useState4 } from "react";
|
|
2763
|
+
import { twMerge as twMerge16 } from "tailwind-merge";
|
|
2764
|
+
|
|
2765
|
+
// src/icons/CloseIcon.tsx
|
|
2766
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2767
|
+
function CloseIcon(props) {
|
|
2768
|
+
return /* @__PURE__ */ jsx33(IconSVG, { strokeWidth: "2", stroke: "currentColor", ...props, children: /* @__PURE__ */ jsx33(
|
|
2769
|
+
"path",
|
|
2770
|
+
{
|
|
2771
|
+
d: "M6 18L18 6M6 6L18 18",
|
|
2772
|
+
fill: "none",
|
|
2773
|
+
stroke: "currentColor",
|
|
2774
|
+
strokeWidth: "2",
|
|
2775
|
+
strokeLinecap: "round",
|
|
2776
|
+
strokeLinejoin: "round"
|
|
2777
|
+
}
|
|
2778
|
+
) });
|
|
2779
|
+
}
|
|
2780
|
+
|
|
2781
|
+
// src/onboarding/deposit/DepositStatus.tsx
|
|
2782
|
+
import { jsx as jsx34, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2783
|
+
function DepositStatus({ status, progress, children, onDismiss }) {
|
|
2784
|
+
const [appear, setAppear] = useState4(false);
|
|
2785
|
+
useEffect9(() => {
|
|
2786
|
+
setAppear(true);
|
|
2787
|
+
}, []);
|
|
2788
|
+
return /* @__PURE__ */ jsxs19("div", { className: "group bg-white dark:bg-neutral-900 flex flex-col animate-in fade-in slide-in-from-bottom-2 animate-out fade-out", children: [
|
|
2789
|
+
/* @__PURE__ */ jsxs19("div", { className: "py-1 text-sm flex items-center gap-2", children: [
|
|
2790
|
+
/* @__PURE__ */ jsx34("div", { className: "flex-grow", children }),
|
|
2791
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex-shrink-0 grid", children: [
|
|
2792
|
+
/* @__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-400 dark:text-neutral-500 transition" }) }),
|
|
2793
|
+
/* @__PURE__ */ jsx34(
|
|
2794
|
+
"button",
|
|
2795
|
+
{
|
|
2796
|
+
type: "button",
|
|
2797
|
+
className: twMerge16(
|
|
2798
|
+
"col-start-1 row-start-1 flex items-center justify-center transition",
|
|
2799
|
+
"opacity-0 pointer-events-none",
|
|
2800
|
+
"group-hover:opacity-100 group-hover:pointer-events-auto",
|
|
2801
|
+
"text-neutral-400 hover:text-black",
|
|
2802
|
+
"dark:text-neutral-500 dark:hover:text-white"
|
|
2803
|
+
),
|
|
2804
|
+
title: "Dismiss",
|
|
2805
|
+
onClick: onDismiss,
|
|
2806
|
+
children: /* @__PURE__ */ jsx34(CloseIcon, {})
|
|
2807
|
+
}
|
|
2808
|
+
)
|
|
2809
|
+
] })
|
|
2810
|
+
] }),
|
|
2811
|
+
/* @__PURE__ */ jsx34("div", { className: "w-full h-[2px] -mt-full overflow-clip", children: /* @__PURE__ */ jsx34(
|
|
2812
|
+
"div",
|
|
2813
|
+
{
|
|
2814
|
+
className: twMerge16(
|
|
2815
|
+
"w-full h-full transition ease-linear",
|
|
2816
|
+
status === "success" ? "bg-green-500 dark:bg-green-600" : status === "error" ? "bg-red-500 dark:bg-red-600" : "bg-blue-500 dark:bg-blue-600",
|
|
2817
|
+
status === "pending" ? "opacity-100" : "opacity-0"
|
|
2818
|
+
),
|
|
2819
|
+
style: status === "pending" ? {
|
|
2820
|
+
transform: appear ? `translateX(0)` : "translate(-100%)",
|
|
2821
|
+
transitionDuration: `${progress.duration}ms`,
|
|
2822
|
+
transitionDelay: `-${Math.min(progress.duration, progress.elapsed)}ms`
|
|
2823
|
+
} : void 0
|
|
2824
|
+
}
|
|
2825
|
+
) })
|
|
2826
|
+
] });
|
|
2827
|
+
}
|
|
2828
|
+
|
|
2829
|
+
// src/onboarding/deposit/TransferDepositStatus.tsx
|
|
2830
|
+
import { useChains as useChains3 } from "wagmi";
|
|
2831
|
+
import { Fragment as Fragment5, jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2832
|
+
function TransferDepositStatus({
|
|
2833
|
+
amount,
|
|
2834
|
+
chainL1Id,
|
|
2835
|
+
hash,
|
|
2836
|
+
receipt: receiptPromise,
|
|
2837
|
+
start,
|
|
2838
|
+
estimatedTime,
|
|
2839
|
+
onDismiss
|
|
2840
|
+
}) {
|
|
2841
|
+
const chains = useChains3();
|
|
2842
|
+
const chain = chains.find((chain2) => chain2.id === chainL1Id);
|
|
2843
|
+
const receipt = useQuery13({
|
|
2844
|
+
queryKey: ["transferDepositStatus", hash],
|
|
2845
|
+
queryFn: () => receiptPromise
|
|
2846
|
+
});
|
|
2847
|
+
return /* @__PURE__ */ jsx35(
|
|
2848
|
+
DepositStatus,
|
|
2849
|
+
{
|
|
2850
|
+
status: receipt.status,
|
|
2851
|
+
progress: {
|
|
2852
|
+
duration: estimatedTime,
|
|
2853
|
+
elapsed: Math.min(estimatedTime, Date.now() - start.getTime())
|
|
2854
|
+
},
|
|
2855
|
+
onDismiss,
|
|
2856
|
+
children: (() => {
|
|
2857
|
+
const blockExplorer = chain.blockExplorers?.default.url;
|
|
2858
|
+
if (receipt.status === "pending") {
|
|
2859
|
+
return /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
2860
|
+
"Confirming deposit on",
|
|
2861
|
+
" ",
|
|
2862
|
+
/* @__PURE__ */ jsx35(
|
|
2863
|
+
"a",
|
|
2864
|
+
{
|
|
2865
|
+
href: blockExplorer ? `${blockExplorer}/tx/${hash}` : void 0,
|
|
2866
|
+
target: "_blank",
|
|
2867
|
+
rel: "noreferrer noopener",
|
|
2868
|
+
children: chain.name
|
|
2869
|
+
}
|
|
2870
|
+
),
|
|
2871
|
+
"\u2026"
|
|
2872
|
+
] });
|
|
2873
|
+
}
|
|
2874
|
+
if (receipt.status === "error") {
|
|
2875
|
+
return /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
2876
|
+
"Could not find deposit on",
|
|
2877
|
+
" ",
|
|
2878
|
+
/* @__PURE__ */ jsx35(
|
|
2879
|
+
"a",
|
|
2880
|
+
{
|
|
2881
|
+
href: blockExplorer ? `${blockExplorer}/tx/${hash}` : void 0,
|
|
2882
|
+
target: "_blank",
|
|
2883
|
+
rel: "noreferrer noopener",
|
|
2884
|
+
children: chain.name
|
|
2885
|
+
}
|
|
2886
|
+
),
|
|
2887
|
+
"."
|
|
2888
|
+
] });
|
|
2889
|
+
}
|
|
2890
|
+
return /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
2891
|
+
"Successfully",
|
|
2892
|
+
" ",
|
|
2893
|
+
/* @__PURE__ */ jsx35(
|
|
2894
|
+
"a",
|
|
2895
|
+
{
|
|
2896
|
+
href: blockExplorer ? `${blockExplorer}/tx/${receipt.data.transactionHash}` : void 0,
|
|
2897
|
+
target: "_blank",
|
|
2898
|
+
rel: "noreferrer noopener",
|
|
2899
|
+
children: "deposited"
|
|
2900
|
+
}
|
|
2901
|
+
),
|
|
2902
|
+
" ",
|
|
2903
|
+
/* @__PURE__ */ jsx35(Balance, { wei: amount }),
|
|
2904
|
+
" !"
|
|
2905
|
+
] });
|
|
2906
|
+
})()
|
|
2907
|
+
}
|
|
2908
|
+
);
|
|
2909
|
+
}
|
|
2910
|
+
|
|
2911
|
+
// src/onboarding/deposit/RelayDepositStatus.tsx
|
|
2912
|
+
import { useQuery as useQuery14 } from "@tanstack/react-query";
|
|
2913
|
+
import { useChains as useChains4 } from "wagmi";
|
|
2914
|
+
import { Fragment as Fragment6, jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2915
|
+
function RelayDepositStatus({
|
|
2916
|
+
amount,
|
|
2917
|
+
chainL1Id,
|
|
2918
|
+
chainL2Id,
|
|
2919
|
+
start,
|
|
2920
|
+
estimatedTime,
|
|
2921
|
+
depositPromise,
|
|
2922
|
+
onDismiss
|
|
2923
|
+
}) {
|
|
2924
|
+
const chains = useChains4();
|
|
2925
|
+
const chainL1 = chains.find((chain) => chain.id === chainL1Id);
|
|
2926
|
+
const chainL2 = chains.find((chain) => chain.id === chainL2Id);
|
|
2927
|
+
const deposit = useQuery14({
|
|
2928
|
+
queryKey: ["relayDepositPromise", chainL1Id, chainL2Id, amount.toString(), start.toISOString()],
|
|
2929
|
+
queryFn: () => depositPromise
|
|
2930
|
+
});
|
|
2931
|
+
return /* @__PURE__ */ jsx36(
|
|
2932
|
+
DepositStatus,
|
|
2933
|
+
{
|
|
2934
|
+
status: deposit.status,
|
|
2935
|
+
progress: {
|
|
2936
|
+
duration: estimatedTime,
|
|
2937
|
+
elapsed: Math.min(estimatedTime, Date.now() - start.getTime())
|
|
2938
|
+
},
|
|
2939
|
+
onDismiss,
|
|
2940
|
+
children: (() => {
|
|
2941
|
+
if (deposit.status === "pending") {
|
|
2942
|
+
return /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
2943
|
+
"Relay bridge deposit pending on ",
|
|
2944
|
+
chainL1.name,
|
|
2945
|
+
"\u2026"
|
|
2946
|
+
] });
|
|
2947
|
+
}
|
|
2948
|
+
if (deposit.status === "error") {
|
|
2949
|
+
return /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
2950
|
+
"Relay bridge deposit to ",
|
|
2951
|
+
chainL2.name,
|
|
2952
|
+
" failed."
|
|
2953
|
+
] });
|
|
2954
|
+
}
|
|
2955
|
+
return /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
2956
|
+
"Successfully bridged ",
|
|
2957
|
+
/* @__PURE__ */ jsx36(Balance, { wei: amount }),
|
|
2958
|
+
" to ",
|
|
2959
|
+
chainL2.name,
|
|
2960
|
+
"!"
|
|
2961
|
+
] });
|
|
2962
|
+
})()
|
|
2963
|
+
}
|
|
2964
|
+
);
|
|
2965
|
+
}
|
|
2966
|
+
|
|
2967
|
+
// src/onboarding/deposit/Deposits.tsx
|
|
2968
|
+
import { useAccount as useAccount7, useClient as useClient11 } from "wagmi";
|
|
2969
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
2970
|
+
function Deposits() {
|
|
2971
|
+
const queryClient = useQueryClient6();
|
|
2972
|
+
const { chainId } = useEntryKitConfig();
|
|
2973
|
+
const client = useClient11({ chainId });
|
|
2974
|
+
const { address: userAddress } = useAccount7();
|
|
2975
|
+
const { deposits, removeDeposit } = useDeposits();
|
|
2976
|
+
const { data: isComplete } = useQuery15({
|
|
2977
|
+
queryKey: ["depositsComplete", deposits.map((deposit) => deposit.uid)],
|
|
2978
|
+
queryFn: async () => {
|
|
2979
|
+
if (!deposits.length) return false;
|
|
2980
|
+
await Promise.all(deposits.map((deposit) => deposit.isComplete));
|
|
2981
|
+
return true;
|
|
2982
|
+
}
|
|
2983
|
+
});
|
|
2984
|
+
useEffect10(() => {
|
|
2985
|
+
if (isComplete) {
|
|
2986
|
+
queryClient.invalidateQueries({ queryKey: ["balance"] });
|
|
2987
|
+
queryClient.invalidateQueries({ queryKey: ["getBalance", client?.uid, userAddress] });
|
|
2988
|
+
}
|
|
2989
|
+
}, [client?.uid, isComplete, queryClient, userAddress]);
|
|
2990
|
+
if (!deposits.length) return null;
|
|
2991
|
+
return /* @__PURE__ */ jsx37("div", { className: "flex flex-col gap-1 mt-4", children: deposits.map((deposit) => {
|
|
2992
|
+
if (deposit.type === "transfer") {
|
|
2993
|
+
return /* @__PURE__ */ jsx37(TransferDepositStatus, { ...deposit, onDismiss: () => removeDeposit(deposit.uid) }, deposit.uid);
|
|
2994
|
+
} else if (deposit.type === "relay") {
|
|
2995
|
+
return /* @__PURE__ */ jsx37(RelayDepositStatus, { ...deposit, onDismiss: () => removeDeposit(deposit.uid) }, deposit.uid);
|
|
2996
|
+
}
|
|
2997
|
+
}) });
|
|
2998
|
+
}
|
|
2999
|
+
|
|
3000
|
+
// src/onboarding/deposit/DepositFormContainer.tsx
|
|
3001
|
+
import { jsx as jsx38, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3002
|
+
function DepositFormContainer() {
|
|
3003
|
+
const { chainId: destinationChainId } = useEntryKitConfig();
|
|
3004
|
+
const chainId = useChainId();
|
|
3005
|
+
const chains = useChains5();
|
|
3006
|
+
const [amount, setAmount] = useState5(void 0);
|
|
3007
|
+
const [sourceChainId, setSourceChainId] = useState5(chainId);
|
|
3008
|
+
const sourceChain = chains.find(({ id }) => id === sourceChainId);
|
|
3009
|
+
return /* @__PURE__ */ jsxs22("div", { className: "pt-10 pb-2", children: [
|
|
3010
|
+
destinationChainId === sourceChainId ? /* @__PURE__ */ jsx38(
|
|
3011
|
+
DepositViaTransferForm,
|
|
3012
|
+
{
|
|
3013
|
+
amount,
|
|
3014
|
+
setAmount,
|
|
3015
|
+
sourceChain,
|
|
3016
|
+
setSourceChainId
|
|
3017
|
+
}
|
|
3018
|
+
) : /* @__PURE__ */ jsx38(
|
|
3019
|
+
DepositViaRelayForm,
|
|
3020
|
+
{
|
|
3021
|
+
amount,
|
|
3022
|
+
setAmount,
|
|
3023
|
+
sourceChain,
|
|
3024
|
+
setSourceChainId
|
|
3025
|
+
}
|
|
3026
|
+
),
|
|
3027
|
+
/* @__PURE__ */ jsx38(Deposits, {})
|
|
3028
|
+
] });
|
|
3029
|
+
}
|
|
3030
|
+
|
|
3031
|
+
// src/icons/ArrowLeftIcon.tsx
|
|
3032
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3033
|
+
function ArrowLeftIcon(props) {
|
|
3034
|
+
return /* @__PURE__ */ jsx39(IconSVG, { ...props, children: /* @__PURE__ */ jsx39(
|
|
3035
|
+
"path",
|
|
3036
|
+
{
|
|
3037
|
+
d: "M19 12H5M12 19l-7-7 7-7",
|
|
3038
|
+
fill: "none",
|
|
3039
|
+
stroke: "currentColor",
|
|
3040
|
+
strokeWidth: "2",
|
|
3041
|
+
strokeLinecap: "round",
|
|
3042
|
+
strokeLinejoin: "round"
|
|
3043
|
+
}
|
|
3044
|
+
) });
|
|
3045
|
+
}
|
|
3046
|
+
|
|
3047
|
+
// src/onboarding/quarry/GasBalance.tsx
|
|
3048
|
+
import { useEffect as useEffect12 } from "react";
|
|
3049
|
+
import { useQueryClient as useQueryClient7 } from "@tanstack/react-query";
|
|
3050
|
+
|
|
3051
|
+
// src/errors/usePrevious.ts
|
|
3052
|
+
import { useEffect as useEffect11, useRef as useRef3 } from "react";
|
|
3053
|
+
function usePrevious(value, initialValue) {
|
|
3054
|
+
const ref = useRef3();
|
|
3055
|
+
useEffect11(() => {
|
|
3056
|
+
ref.current = { value };
|
|
3057
|
+
}, [value]);
|
|
3058
|
+
return ref.current ? ref.current.value : initialValue;
|
|
3059
|
+
}
|
|
3060
|
+
|
|
3061
|
+
// src/onboarding/quarry/GasBalance.tsx
|
|
3062
|
+
import { Fragment as Fragment7, jsx as jsx40, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3063
|
+
function GasBalance2({ isActive, isExpanded, isFocused, setFocused, userAddress }) {
|
|
3064
|
+
const queryClient = useQueryClient7();
|
|
3065
|
+
const balance = useShowQueryError(useBalance(userAddress));
|
|
3066
|
+
const prevBalance = usePrevious(balance.data || 0n);
|
|
3067
|
+
useEffect12(() => {
|
|
3068
|
+
const checkBalance = async () => {
|
|
3069
|
+
if (balance.data != null && prevBalance === 0n && balance.data > 0n) {
|
|
3070
|
+
await queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] });
|
|
3071
|
+
setFocused(false);
|
|
3072
|
+
}
|
|
3073
|
+
};
|
|
3074
|
+
checkBalance();
|
|
3075
|
+
}, [balance.data, prevBalance, setFocused, queryClient, userAddress]);
|
|
3076
|
+
if (isFocused) {
|
|
3077
|
+
return /* @__PURE__ */ jsxs23(Fragment7, { children: [
|
|
3078
|
+
isFocused && /* @__PURE__ */ jsx40("div", { className: "absolute top-0 left-0", children: /* @__PURE__ */ jsx40(
|
|
3079
|
+
"div",
|
|
3080
|
+
{
|
|
3081
|
+
className: "flex items-center justify-center w-10 h-10 text-white/20 hover:text-white/40 cursor-pointer",
|
|
3082
|
+
onClick: () => setFocused(false),
|
|
3083
|
+
children: /* @__PURE__ */ jsx40(ArrowLeftIcon, { className: "m-0" })
|
|
3084
|
+
}
|
|
3085
|
+
) }),
|
|
3086
|
+
/* @__PURE__ */ jsx40(DepositFormContainer, {})
|
|
3087
|
+
] });
|
|
3088
|
+
}
|
|
3089
|
+
return /* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-4", children: [
|
|
3090
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex justify-between gap-4", children: [
|
|
3091
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
3092
|
+
/* @__PURE__ */ jsx40("div", { children: "Gas balance" }),
|
|
3093
|
+
/* @__PURE__ */ jsx40("div", { className: "font-mono text-white", children: balance.data != null ? /* @__PURE__ */ jsx40(Balance, { wei: balance.data }) : /* @__PURE__ */ jsx40(PendingIcon, { className: "text-sm" }) })
|
|
3094
|
+
] }),
|
|
3095
|
+
/* @__PURE__ */ jsx40(
|
|
3096
|
+
Button,
|
|
3097
|
+
{
|
|
3098
|
+
variant: isActive ? "primary" : "tertiary",
|
|
3099
|
+
className: "flex-shrink-0 text-sm p-1 w-28",
|
|
3100
|
+
autoFocus: isActive || isExpanded,
|
|
3101
|
+
pending: balance.status === "pending",
|
|
3102
|
+
onClick: () => setFocused(true),
|
|
3103
|
+
children: "Top up"
|
|
3104
|
+
}
|
|
3105
|
+
)
|
|
3106
|
+
] }),
|
|
3107
|
+
isExpanded ? /* @__PURE__ */ jsx40("p", { className: "text-sm", children: "Your gas balance is used to pay for onchain computation." }) : null
|
|
3108
|
+
] });
|
|
3109
|
+
}
|
|
3110
|
+
|
|
1923
3111
|
// src/onboarding/ConnectedSteps.tsx
|
|
1924
|
-
import { jsx as
|
|
3112
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
1925
3113
|
function ConnectedSteps({ userClient, initialUserAddress }) {
|
|
1926
3114
|
const { chain } = useEntryKitConfig();
|
|
1927
3115
|
const paymaster = getPaymaster(chain);
|
|
3116
|
+
const [focusedId, setFocusedId] = useState6(null);
|
|
1928
3117
|
const userAddress = userClient.account.address;
|
|
1929
3118
|
const { data: prerequisites, error: prerequisitesError } = usePrerequisites(userAddress);
|
|
1930
|
-
|
|
3119
|
+
useEffect13(() => {
|
|
1931
3120
|
if (prerequisitesError) {
|
|
1932
3121
|
console.error("Could not get prerequisites", prerequisitesError);
|
|
1933
3122
|
}
|
|
1934
3123
|
}, [prerequisitesError]);
|
|
1935
3124
|
const { closeAccountModal } = useAccountModal();
|
|
1936
3125
|
const isNewConnection = userAddress !== initialUserAddress;
|
|
1937
|
-
const initialPrerequisites =
|
|
1938
|
-
|
|
3126
|
+
const initialPrerequisites = useRef4(prerequisites);
|
|
3127
|
+
useEffect13(() => {
|
|
1939
3128
|
if (prerequisites == null) return;
|
|
1940
3129
|
if (initialPrerequisites.current == null) {
|
|
1941
3130
|
initialPrerequisites.current = prerequisites;
|
|
@@ -1946,8 +3135,8 @@ function ConnectedSteps({ userClient, initialUserAddress }) {
|
|
|
1946
3135
|
}
|
|
1947
3136
|
}
|
|
1948
3137
|
}, [closeAccountModal, isNewConnection, prerequisites]);
|
|
1949
|
-
const { sessionAddress, hasAllowance, isSpender, hasDelegation, hasGasBalance } = prerequisites ?? {};
|
|
1950
|
-
const steps =
|
|
3138
|
+
const { sessionAddress, hasAllowance, isSpender, hasDelegation, hasGasBalance, hasQuarryBalance } = prerequisites ?? {};
|
|
3139
|
+
const steps = useMemo4(() => {
|
|
1951
3140
|
if (!userAddress) {
|
|
1952
3141
|
return [
|
|
1953
3142
|
{
|
|
@@ -1961,7 +3150,7 @@ function ConnectedSteps({ userClient, initialUserAddress }) {
|
|
|
1961
3150
|
{
|
|
1962
3151
|
id: "wallet",
|
|
1963
3152
|
isComplete: true,
|
|
1964
|
-
content: (props) => /* @__PURE__ */
|
|
3153
|
+
content: (props) => /* @__PURE__ */ jsx41(Wallet, { ...props, userAddress })
|
|
1965
3154
|
}
|
|
1966
3155
|
];
|
|
1967
3156
|
if (!paymaster) {
|
|
@@ -1969,142 +3158,138 @@ function ConnectedSteps({ userClient, initialUserAddress }) {
|
|
|
1969
3158
|
steps2.push({
|
|
1970
3159
|
id: "gasBalance",
|
|
1971
3160
|
isComplete: !!hasGasBalance,
|
|
1972
|
-
content: (props) => /* @__PURE__ */
|
|
3161
|
+
content: (props) => /* @__PURE__ */ jsx41(GasBalance, { ...props, sessionAddress })
|
|
1973
3162
|
});
|
|
1974
3163
|
}
|
|
1975
3164
|
} else if (paymaster.type === "quarry") {
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
3165
|
+
if (paymaster.isGasPass) {
|
|
3166
|
+
steps2.push({
|
|
3167
|
+
id: "allowance",
|
|
3168
|
+
isComplete: !!hasAllowance,
|
|
3169
|
+
content: (props) => /* @__PURE__ */ jsx41(Allowance, { ...props, userAddress })
|
|
3170
|
+
});
|
|
3171
|
+
} else {
|
|
3172
|
+
steps2.push({
|
|
3173
|
+
id: "gasBalanceQuarry",
|
|
3174
|
+
isComplete: !!hasQuarryBalance,
|
|
3175
|
+
content: (props) => /* @__PURE__ */ jsx41(GasBalance2, { ...props, userAddress })
|
|
3176
|
+
});
|
|
3177
|
+
}
|
|
1981
3178
|
}
|
|
1982
3179
|
steps2.push({
|
|
1983
3180
|
id: "session",
|
|
1984
3181
|
isComplete: !!isSpender && !!hasDelegation,
|
|
1985
|
-
content: (props) => /* @__PURE__ */
|
|
3182
|
+
content: (props) => /* @__PURE__ */ jsx41(Session, { ...props, userClient, registerSpender: !isSpender, registerDelegation: !hasDelegation })
|
|
1986
3183
|
});
|
|
1987
3184
|
return steps2;
|
|
1988
|
-
}, [
|
|
1989
|
-
|
|
3185
|
+
}, [
|
|
3186
|
+
hasAllowance,
|
|
3187
|
+
hasDelegation,
|
|
3188
|
+
hasGasBalance,
|
|
3189
|
+
hasQuarryBalance,
|
|
3190
|
+
isSpender,
|
|
3191
|
+
paymaster,
|
|
3192
|
+
sessionAddress,
|
|
3193
|
+
userAddress,
|
|
3194
|
+
userClient
|
|
3195
|
+
]);
|
|
3196
|
+
const [selectedStepId] = useState6(null);
|
|
1990
3197
|
const nextStep = steps.find((step) => step.content != null && !step.isComplete);
|
|
1991
3198
|
const completedSteps = steps.filter((step) => step.isComplete);
|
|
1992
3199
|
const activeStep = (selectedStepId != null ? steps.find((step) => step.id === selectedStepId) : null) ?? nextStep ?? (completedSteps.length < steps.length ? completedSteps.at(-1) : null);
|
|
1993
3200
|
const activeStepIndex = activeStep ? steps.indexOf(activeStep) : -1;
|
|
1994
|
-
return /* @__PURE__ */
|
|
3201
|
+
return /* @__PURE__ */ jsx41(
|
|
1995
3202
|
"div",
|
|
1996
3203
|
{
|
|
1997
|
-
className:
|
|
1998
|
-
|
|
1999
|
-
|
|
3204
|
+
className: twMerge17(
|
|
3205
|
+
"px-8 flex flex-col",
|
|
3206
|
+
focusedId && "divide-y divide-neutral-800",
|
|
2000
3207
|
"animate-in animate-duration-300 fade-in slide-in-from-bottom-8"
|
|
2001
3208
|
),
|
|
2002
3209
|
children: steps.map((step, i) => {
|
|
2003
3210
|
const isActive = step === activeStep;
|
|
2004
3211
|
const isExpanded = isActive || completedSteps.length === steps.length;
|
|
2005
3212
|
const isDisabled = !step.isComplete && activeStepIndex !== -1 && i > activeStepIndex;
|
|
2006
|
-
|
|
3213
|
+
const isFocused = focusedId === step.id;
|
|
3214
|
+
const content = step.content({
|
|
3215
|
+
isActive,
|
|
3216
|
+
isExpanded,
|
|
3217
|
+
isFocused,
|
|
3218
|
+
setFocused: (focused) => setFocusedId(focused ? step.id : null)
|
|
3219
|
+
});
|
|
3220
|
+
if (focusedId) {
|
|
3221
|
+
if (step.id === focusedId) {
|
|
3222
|
+
return content;
|
|
3223
|
+
}
|
|
3224
|
+
return null;
|
|
3225
|
+
}
|
|
3226
|
+
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);
|
|
2007
3227
|
})
|
|
2008
3228
|
}
|
|
2009
3229
|
);
|
|
2010
3230
|
}
|
|
2011
3231
|
|
|
2012
3232
|
// src/AccountModalContent.tsx
|
|
2013
|
-
import { useRef as
|
|
2014
|
-
import { jsx as
|
|
3233
|
+
import { useRef as useRef5 } from "react";
|
|
3234
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
2015
3235
|
function AccountModalContent() {
|
|
2016
3236
|
const { chainId } = useEntryKitConfig();
|
|
2017
3237
|
const userClient = useConnectorClient({ chainId });
|
|
2018
|
-
const { address: userAddress } =
|
|
2019
|
-
const initialUserAddress =
|
|
3238
|
+
const { address: userAddress } = useAccount8();
|
|
3239
|
+
const initialUserAddress = useRef5(userAddress);
|
|
2020
3240
|
if (userClient.status !== "success") {
|
|
2021
|
-
return /* @__PURE__ */
|
|
3241
|
+
return /* @__PURE__ */ jsx42(ConnectWallet, {});
|
|
2022
3242
|
}
|
|
2023
|
-
return /* @__PURE__ */
|
|
3243
|
+
return /* @__PURE__ */ jsx42(ConnectedSteps, { userClient: userClient.data, initialUserAddress: initialUserAddress.current });
|
|
2024
3244
|
}
|
|
2025
3245
|
|
|
2026
3246
|
// src/AccountModal.tsx
|
|
2027
3247
|
import { DialogClose } from "@radix-ui/react-dialog";
|
|
2028
|
-
|
|
2029
|
-
// src/icons/IconSVG.tsx
|
|
2030
|
-
import { twMerge as twMerge8 } from "tailwind-merge";
|
|
2031
|
-
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2032
|
-
function IconSVG({ className, children, ...props }) {
|
|
2033
|
-
return /* @__PURE__ */ jsx19(
|
|
2034
|
-
"svg",
|
|
2035
|
-
{
|
|
2036
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2037
|
-
viewBox: "0 0 24 24",
|
|
2038
|
-
fill: "currentColor",
|
|
2039
|
-
className: twMerge8("-my-[0.125em] h-[1.25em] w-[1.25em]", className),
|
|
2040
|
-
...props,
|
|
2041
|
-
children
|
|
2042
|
-
}
|
|
2043
|
-
);
|
|
2044
|
-
}
|
|
2045
|
-
|
|
2046
|
-
// src/icons/CloseIcon.tsx
|
|
2047
|
-
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2048
|
-
function CloseIcon(props) {
|
|
2049
|
-
return /* @__PURE__ */ jsx20(IconSVG, { strokeWidth: "2", stroke: "currentColor", ...props, children: /* @__PURE__ */ jsx20(
|
|
2050
|
-
"path",
|
|
2051
|
-
{
|
|
2052
|
-
d: "M6 18L18 6M6 6L18 18",
|
|
2053
|
-
fill: "none",
|
|
2054
|
-
stroke: "currentColor",
|
|
2055
|
-
strokeWidth: "2",
|
|
2056
|
-
strokeLinecap: "round",
|
|
2057
|
-
strokeLinejoin: "round"
|
|
2058
|
-
}
|
|
2059
|
-
) });
|
|
2060
|
-
}
|
|
2061
|
-
|
|
2062
|
-
// src/AccountModal.tsx
|
|
2063
3248
|
import { ErrorBoundary } from "react-error-boundary";
|
|
2064
3249
|
|
|
2065
3250
|
// src/errors/ErrorOverlay.tsx
|
|
2066
3251
|
import { wait } from "@latticexyz/common/utils";
|
|
2067
|
-
import { useEffect as
|
|
2068
|
-
import { twMerge as
|
|
2069
|
-
import { Fragment as
|
|
3252
|
+
import { useEffect as useEffect14 } from "react";
|
|
3253
|
+
import { twMerge as twMerge18 } from "tailwind-merge";
|
|
3254
|
+
import { Fragment as Fragment8, jsx as jsx43, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2070
3255
|
function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
2071
|
-
|
|
3256
|
+
useEffect14(() => {
|
|
2072
3257
|
if (error2) {
|
|
2073
3258
|
console.error(error2);
|
|
2074
3259
|
}
|
|
2075
3260
|
}, [error2]);
|
|
2076
|
-
return /* @__PURE__ */
|
|
2077
|
-
/* @__PURE__ */
|
|
3261
|
+
return /* @__PURE__ */ jsxs24("div", { className: "pointer-events-none absolute inset-0 overflow-clip", children: [
|
|
3262
|
+
/* @__PURE__ */ jsx43(
|
|
2078
3263
|
"div",
|
|
2079
3264
|
{
|
|
2080
|
-
className:
|
|
3265
|
+
className: twMerge18(
|
|
2081
3266
|
"absolute inset-0 bg-blue-700/60",
|
|
2082
3267
|
"transition duration-300",
|
|
2083
3268
|
error2 ? "opacity-100 pointer-events-auto" : "opacity-0"
|
|
2084
3269
|
)
|
|
2085
3270
|
}
|
|
2086
3271
|
),
|
|
2087
|
-
/* @__PURE__ */
|
|
3272
|
+
/* @__PURE__ */ jsx43(
|
|
2088
3273
|
"div",
|
|
2089
3274
|
{
|
|
2090
|
-
className:
|
|
3275
|
+
className: twMerge18(
|
|
2091
3276
|
"absolute inset-0 pb-8",
|
|
2092
3277
|
"transition duration-300",
|
|
2093
3278
|
error2 ? "translate-y-0 opacity-100 pointer-events-auto" : "-translate-y-4 opacity-0"
|
|
2094
3279
|
),
|
|
2095
|
-
children: error2 ? /* @__PURE__ */
|
|
2096
|
-
/* @__PURE__ */
|
|
2097
|
-
/* @__PURE__ */
|
|
2098
|
-
/* @__PURE__ */
|
|
2099
|
-
/* @__PURE__ */
|
|
3280
|
+
children: error2 ? /* @__PURE__ */ jsx43(Fragment8, { children: /* @__PURE__ */ jsxs24("div", { className: "w-full max-h-full bg-blue-700 text-white/80 overflow-auto", children: [
|
|
3281
|
+
/* @__PURE__ */ jsxs24("div", { className: "space-y-6 px-8 pt-8", children: [
|
|
3282
|
+
/* @__PURE__ */ jsx43("div", { className: "text-white text-lg font-bold", children: "Oops! It broke :(" }),
|
|
3283
|
+
/* @__PURE__ */ jsx43("div", { className: "font-mono text-xs whitespace-pre-wrap", children: error2.message.trim() }),
|
|
3284
|
+
/* @__PURE__ */ jsx43("div", { className: "text-sm", children: "See the console for more info." })
|
|
2100
3285
|
] }),
|
|
2101
|
-
/* @__PURE__ */
|
|
2102
|
-
/* @__PURE__ */
|
|
2103
|
-
retry ? /* @__PURE__ */
|
|
3286
|
+
/* @__PURE__ */ jsxs24("div", { className: "pointer-events-none sticky bottom-0 left-0 -mt-2", children: [
|
|
3287
|
+
/* @__PURE__ */ jsx43("div", { className: "w-full h-12 bg-gradient-to-b from-transparent to-blue-700" }),
|
|
3288
|
+
retry ? /* @__PURE__ */ jsx43("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsxs24(
|
|
2104
3289
|
"button",
|
|
2105
3290
|
{
|
|
2106
3291
|
type: "button",
|
|
2107
|
-
className:
|
|
3292
|
+
className: twMerge18(
|
|
2108
3293
|
"pointer-events-auto group w-24 p-1 -translate-y-2 transition",
|
|
2109
3294
|
"bg-blue-600 hover:bg-blue-500 aria-busy:bg-blue-500",
|
|
2110
3295
|
"text-white text-sm font-medium",
|
|
@@ -2119,15 +3304,15 @@ function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
|
2119
3304
|
}
|
|
2120
3305
|
},
|
|
2121
3306
|
children: [
|
|
2122
|
-
/* @__PURE__ */
|
|
2123
|
-
/* @__PURE__ */
|
|
3307
|
+
/* @__PURE__ */ jsx43("span", { className: "group-aria-busy:hidden", children: "Retry" }),
|
|
3308
|
+
/* @__PURE__ */ jsx43("span", { className: "hidden group-aria-busy:inline", children: "Retrying\u2026" })
|
|
2124
3309
|
]
|
|
2125
3310
|
}
|
|
2126
|
-
) }) : dismiss ? /* @__PURE__ */
|
|
3311
|
+
) }) : dismiss ? /* @__PURE__ */ jsx43("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsx43(
|
|
2127
3312
|
"button",
|
|
2128
3313
|
{
|
|
2129
3314
|
type: "button",
|
|
2130
|
-
className:
|
|
3315
|
+
className: twMerge18(
|
|
2131
3316
|
"pointer-events-auto group w-24 p-1 -translate-y-2 transition",
|
|
2132
3317
|
"bg-blue-600 hover:bg-blue-500 aria-busy:bg-blue-500",
|
|
2133
3318
|
"text-white text-sm font-medium",
|
|
@@ -2145,27 +3330,27 @@ function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
|
2145
3330
|
}
|
|
2146
3331
|
|
|
2147
3332
|
// src/errors/ErrorFallback.tsx
|
|
2148
|
-
import { jsx as
|
|
3333
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2149
3334
|
function ErrorFallback({ error: error2, resetErrorBoundary }) {
|
|
2150
|
-
return /* @__PURE__ */
|
|
3335
|
+
return /* @__PURE__ */ jsx44("div", { className: "h-64", children: /* @__PURE__ */ jsx44(ErrorOverlay, { error: error2, retry: resetErrorBoundary }) });
|
|
2151
3336
|
}
|
|
2152
3337
|
|
|
2153
3338
|
// src/errors/ErrorsOverlay.tsx
|
|
2154
|
-
import { useStore as
|
|
2155
|
-
import { jsx as
|
|
3339
|
+
import { useStore as useStore3 } from "zustand";
|
|
3340
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
2156
3341
|
function ErrorsOverlay() {
|
|
2157
|
-
const error2 =
|
|
2158
|
-
return /* @__PURE__ */
|
|
3342
|
+
const error2 = useStore3(store3, (state) => state.errors.at(0));
|
|
3343
|
+
return /* @__PURE__ */ jsx45(ErrorOverlay, { error: error2?.error, retry: error2?.retry, dismiss: error2?.dismiss });
|
|
2159
3344
|
}
|
|
2160
3345
|
|
|
2161
3346
|
// src/AccountModal.tsx
|
|
2162
|
-
import { jsx as
|
|
3347
|
+
import { jsx as jsx46, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2163
3348
|
function AccountModal() {
|
|
2164
3349
|
const { accountModalOpen, toggleAccountModal } = useAccountModal();
|
|
2165
|
-
return /* @__PURE__ */
|
|
3350
|
+
return /* @__PURE__ */ jsx46(Modal, { open: accountModalOpen, onOpenChange: toggleAccountModal, children: accountModalOpen ? /* @__PURE__ */ jsxs25(
|
|
2166
3351
|
"div",
|
|
2167
3352
|
{
|
|
2168
|
-
className:
|
|
3353
|
+
className: twMerge19(
|
|
2169
3354
|
"relative py-2 ring-1",
|
|
2170
3355
|
"bg-neutral-900 text-neutral-400 ring-neutral-700/50",
|
|
2171
3356
|
"links:font-medium links:underline links:underline-offset-4",
|
|
@@ -2173,11 +3358,11 @@ function AccountModal() {
|
|
|
2173
3358
|
"links:decoration-neutral-500 hover:links:decoration-orange-500"
|
|
2174
3359
|
),
|
|
2175
3360
|
children: [
|
|
2176
|
-
/* @__PURE__ */
|
|
2177
|
-
/* @__PURE__ */
|
|
2178
|
-
/* @__PURE__ */
|
|
3361
|
+
/* @__PURE__ */ jsxs25(ErrorBoundary, { FallbackComponent: ErrorFallback, children: [
|
|
3362
|
+
/* @__PURE__ */ jsx46(AccountModalContent, {}),
|
|
3363
|
+
/* @__PURE__ */ jsx46(ErrorsOverlay, {})
|
|
2179
3364
|
] }),
|
|
2180
|
-
/* @__PURE__ */
|
|
3365
|
+
/* @__PURE__ */ jsxs25(
|
|
2181
3366
|
"a",
|
|
2182
3367
|
{
|
|
2183
3368
|
href: "https://mud.dev",
|
|
@@ -2185,20 +3370,20 @@ function AccountModal() {
|
|
|
2185
3370
|
rel: "noreferrer noopener",
|
|
2186
3371
|
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",
|
|
2187
3372
|
children: [
|
|
2188
|
-
/* @__PURE__ */
|
|
2189
|
-
/* @__PURE__ */
|
|
3373
|
+
/* @__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" }) }),
|
|
3374
|
+
/* @__PURE__ */ jsx46("span", { children: "Powered by MUD" })
|
|
2190
3375
|
]
|
|
2191
3376
|
}
|
|
2192
3377
|
),
|
|
2193
|
-
/* @__PURE__ */
|
|
3378
|
+
/* @__PURE__ */ jsx46("div", { className: "absolute top-0 right-0", children: /* @__PURE__ */ jsx46(
|
|
2194
3379
|
DialogClose,
|
|
2195
3380
|
{
|
|
2196
|
-
className:
|
|
3381
|
+
className: twMerge19(
|
|
2197
3382
|
"pointer-events-auto leading-none p-2 transition",
|
|
2198
3383
|
"text-white/20 hover:text-white/40"
|
|
2199
3384
|
),
|
|
2200
3385
|
title: "Close",
|
|
2201
|
-
children: /* @__PURE__ */
|
|
3386
|
+
children: /* @__PURE__ */ jsx46(CloseIcon, { className: "m-0" })
|
|
2202
3387
|
}
|
|
2203
3388
|
) })
|
|
2204
3389
|
]
|
|
@@ -2207,31 +3392,31 @@ function AccountModal() {
|
|
|
2207
3392
|
}
|
|
2208
3393
|
|
|
2209
3394
|
// src/EntryKitProvider.tsx
|
|
2210
|
-
import { jsx as
|
|
3395
|
+
import { jsx as jsx47, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2211
3396
|
function EntryKitProvider({ config, children }) {
|
|
2212
|
-
return /* @__PURE__ */
|
|
3397
|
+
return /* @__PURE__ */ jsxs26(EntryKitConfigProvider, { config, children: [
|
|
2213
3398
|
children,
|
|
2214
|
-
/* @__PURE__ */
|
|
3399
|
+
/* @__PURE__ */ jsx47(AccountModal, {})
|
|
2215
3400
|
] });
|
|
2216
3401
|
}
|
|
2217
3402
|
|
|
2218
3403
|
// src/AccountButton.tsx
|
|
2219
|
-
import { useAccount as
|
|
2220
|
-
import { twMerge as
|
|
3404
|
+
import { useAccount as useAccount9 } from "wagmi";
|
|
3405
|
+
import { twMerge as twMerge21 } from "tailwind-merge";
|
|
2221
3406
|
|
|
2222
3407
|
// src/AccountName.tsx
|
|
2223
|
-
import { twMerge as
|
|
2224
|
-
import { Fragment as
|
|
3408
|
+
import { twMerge as twMerge20 } from "tailwind-merge";
|
|
3409
|
+
import { Fragment as Fragment9, jsx as jsx48, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2225
3410
|
function AccountName({ address }) {
|
|
2226
3411
|
const { data: ens } = useENS(address);
|
|
2227
3412
|
const avatar = usePreloadImage(ens?.avatar);
|
|
2228
|
-
return /* @__PURE__ */
|
|
2229
|
-
/* @__PURE__ */
|
|
2230
|
-
/* @__PURE__ */
|
|
3413
|
+
return /* @__PURE__ */ jsxs27(Fragment9, { children: [
|
|
3414
|
+
/* @__PURE__ */ jsxs27("span", { className: "flex-shrink-0 w-6 h-6 -my-1 -mx-0.5 grid place-items-center", children: [
|
|
3415
|
+
/* @__PURE__ */ jsx48(
|
|
2231
3416
|
"img",
|
|
2232
3417
|
{
|
|
2233
3418
|
src: ens?.avatar && avatar.isSuccess ? ens.avatar : void 0,
|
|
2234
|
-
className:
|
|
3419
|
+
className: twMerge20(
|
|
2235
3420
|
"col-start-1 row-start-1",
|
|
2236
3421
|
"inline-flex w-full h-full rounded-full bg-black/10 dark:bg-white/10 bg-cover bg-no-repeat bg-center",
|
|
2237
3422
|
"transtion duration-300",
|
|
@@ -2239,10 +3424,10 @@ function AccountName({ address }) {
|
|
|
2239
3424
|
)
|
|
2240
3425
|
}
|
|
2241
3426
|
),
|
|
2242
|
-
/* @__PURE__ */
|
|
3427
|
+
/* @__PURE__ */ jsx48(
|
|
2243
3428
|
Logo,
|
|
2244
3429
|
{
|
|
2245
|
-
className:
|
|
3430
|
+
className: twMerge20(
|
|
2246
3431
|
"col-start-1 row-start-1 text-orange-500",
|
|
2247
3432
|
"transition duration-300",
|
|
2248
3433
|
ens && (!ens.avatar || avatar.isError) ? "opacity-100" : "opacity-0"
|
|
@@ -2250,29 +3435,29 @@ function AccountName({ address }) {
|
|
|
2250
3435
|
}
|
|
2251
3436
|
)
|
|
2252
3437
|
] }),
|
|
2253
|
-
/* @__PURE__ */
|
|
3438
|
+
/* @__PURE__ */ jsx48("span", { className: "flex-grow", children: ens?.name ?? /* @__PURE__ */ jsx48(TruncatedHex, { hex: address }) })
|
|
2254
3439
|
] });
|
|
2255
3440
|
}
|
|
2256
3441
|
|
|
2257
3442
|
// src/AccountButton.tsx
|
|
2258
|
-
import { useRef as
|
|
2259
|
-
import { jsx as
|
|
2260
|
-
var containerClassNames =
|
|
3443
|
+
import { useRef as useRef6 } from "react";
|
|
3444
|
+
import { jsx as jsx49, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3445
|
+
var containerClassNames = twMerge21(
|
|
2261
3446
|
"w-48 p-3 inline-flex outline-none transition",
|
|
2262
3447
|
"border border-transparent",
|
|
2263
3448
|
"text-base leading-none"
|
|
2264
3449
|
);
|
|
2265
|
-
var secondaryClassNames =
|
|
3450
|
+
var secondaryClassNames = twMerge21(
|
|
2266
3451
|
"bg-neutral-100 border-neutral-300 text-black",
|
|
2267
3452
|
"dark:bg-neutral-800 dark:border-neutral-700 dark:text-white"
|
|
2268
3453
|
);
|
|
2269
|
-
var secondaryInteractiveClassNames =
|
|
3454
|
+
var secondaryInteractiveClassNames = twMerge21(
|
|
2270
3455
|
"cursor-pointer outline-none hover:bg-neutral-200 data-[highlighted]:bg-neutral-200 dark:hover:bg-neutral-700"
|
|
2271
3456
|
);
|
|
2272
3457
|
function AccountButton() {
|
|
2273
3458
|
const { openAccountModal, accountModalOpen } = useAccountModal();
|
|
2274
|
-
const { status, address: userAddress } =
|
|
2275
|
-
const initialUserAddress =
|
|
3459
|
+
const { status, address: userAddress } = useAccount9();
|
|
3460
|
+
const initialUserAddress = useRef6(userAddress);
|
|
2276
3461
|
const prereqs = usePrerequisites(userAddress);
|
|
2277
3462
|
const isConnected = status === "connected" || status === "reconnecting" && userAddress;
|
|
2278
3463
|
const isNewConnection = userAddress !== initialUserAddress.current;
|
|
@@ -2284,20 +3469,20 @@ function AccountButton() {
|
|
|
2284
3469
|
}
|
|
2285
3470
|
return "Sign in";
|
|
2286
3471
|
})();
|
|
2287
|
-
return /* @__PURE__ */
|
|
3472
|
+
return /* @__PURE__ */ jsx49(Shadow, { mode: "child", children: isSignedIn ? /* @__PURE__ */ jsx49(
|
|
2288
3473
|
"button",
|
|
2289
3474
|
{
|
|
2290
3475
|
type: "button",
|
|
2291
|
-
className:
|
|
3476
|
+
className: twMerge21(containerClassNames, secondaryClassNames, secondaryInteractiveClassNames),
|
|
2292
3477
|
onClick: openAccountModal,
|
|
2293
|
-
children: /* @__PURE__ */
|
|
3478
|
+
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 })
|
|
2294
3479
|
},
|
|
2295
3480
|
"connected"
|
|
2296
|
-
) : /* @__PURE__ */
|
|
3481
|
+
) : /* @__PURE__ */ jsxs28(
|
|
2297
3482
|
"button",
|
|
2298
3483
|
{
|
|
2299
3484
|
type: "button",
|
|
2300
|
-
className:
|
|
3485
|
+
className: twMerge21(
|
|
2301
3486
|
containerClassNames,
|
|
2302
3487
|
"group",
|
|
2303
3488
|
"items-center justify-center gap-2.5",
|
|
@@ -2308,32 +3493,32 @@ function AccountButton() {
|
|
|
2308
3493
|
"aria-busy": accountModalOpen,
|
|
2309
3494
|
onClick: openAccountModal,
|
|
2310
3495
|
children: [
|
|
2311
|
-
/* @__PURE__ */
|
|
2312
|
-
/* @__PURE__ */
|
|
3496
|
+
/* @__PURE__ */ jsxs28("span", { className: "pointer-events-none inline-grid place-items-center -ml-3", children: [
|
|
3497
|
+
/* @__PURE__ */ jsx49(
|
|
2313
3498
|
"span",
|
|
2314
3499
|
{
|
|
2315
|
-
className:
|
|
3500
|
+
className: twMerge21(
|
|
2316
3501
|
"col-start-1 row-start-1 leading-none",
|
|
2317
3502
|
"scale-100 opacity-100 transition duration-300",
|
|
2318
3503
|
"group-aria-busy:scale-125 group-aria-busy:opacity-0"
|
|
2319
3504
|
),
|
|
2320
|
-
children: /* @__PURE__ */
|
|
3505
|
+
children: /* @__PURE__ */ jsx49(Logo, {})
|
|
2321
3506
|
}
|
|
2322
3507
|
),
|
|
2323
|
-
/* @__PURE__ */
|
|
3508
|
+
/* @__PURE__ */ jsx49(
|
|
2324
3509
|
"span",
|
|
2325
3510
|
{
|
|
2326
3511
|
"aria-hidden": true,
|
|
2327
|
-
className:
|
|
3512
|
+
className: twMerge21(
|
|
2328
3513
|
"col-start-1 row-start-1",
|
|
2329
3514
|
"scale-50 opacity-0 transition duration-300 delay-50",
|
|
2330
3515
|
"group-aria-busy:scale-100 group-aria-busy:opacity-100"
|
|
2331
3516
|
),
|
|
2332
|
-
children: /* @__PURE__ */
|
|
3517
|
+
children: /* @__PURE__ */ jsx49(PendingIcon, {})
|
|
2333
3518
|
}
|
|
2334
3519
|
)
|
|
2335
3520
|
] }),
|
|
2336
|
-
/* @__PURE__ */
|
|
3521
|
+
/* @__PURE__ */ jsx49("span", { className: "font-medium", children: buttonLabel })
|
|
2337
3522
|
]
|
|
2338
3523
|
},
|
|
2339
3524
|
"sign in"
|