diff --git a/console/embedded/native_css.cpp b/console/embedded/native_css.cpp index a2a4b57b..b73f88e1 100644 --- a/console/embedded/native_css.cpp +++ b/console/embedded/native_css.cpp @@ -22,11 +22,11 @@ namespace libbitcoin { namespace server { DEFINE_EMBEDDED_PAGE(native_pages, char, css, -R"DELIM(@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xl:36rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select{appearance:none;--tw-shadow:0 0 #0000;background-color:#fff;border-width:1px;border-color:#6a7282;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem}:is(input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);)DELIM" -R"DELIM(box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#155dfc;outline:2px solid #0000}input::placeholder,textarea::placeholder{color:#6a7282;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}::-webkit-date-and-time-value{text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-year-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-month-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-day-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-hour-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-minute-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-second-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-millisecond-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{-webkit-print-color-adjust:exact;print-color-adjust:exact;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='oklch(55.1%25 0.027 264.364)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem}select:where([multiple]),select:where([size]:not([size="1"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;-webkit-print-color-adjust:unset;print-color-adjust:unset;padding-right:.75rem}input:where([type=checkbox]),input:where([type=radio]){appearance:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;vertical-align:middle;-webkit-user-select:none;user-select:none;color:#155dfc;--tw-shadow:0 0 #0000;background-color:#fff;background-origin:border-box;border-width:1px;border-color:#6a7282;flex-shrink:0;width:1rem;height:1rem;padding:0;display:inline-block}input:where([type=checkbox]){border-radius:0}input:where([type=radio]){border-radius:100%}input:where([type=checkbox]):focus,input:where([type=radio]):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid #0000}input:where([type=checkbox]):checked,input:where([type=radio]):checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}input:where([type=checkbox]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=checkbox]):checked{appearance:auto}}input:where([type=radio]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=radio]):checked{appearance:auto}}input:where([type=checkbox]):checked:hover,input:where([type=checkbox]):checked:focus,input:where([type=radio]):checked:hover,input:where([type=radio]):checked:focus{background-color:currentColor;border-color:#0000}input:where([type=checkbox]):indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}@media(forced-colors:active){input:where([type=checkbox]):indeterminate{appearance:auto}}input:where([type=checkbox]):indeterminate:hover,input:where([type=checkbox]):indeterminate:focus{background-color:currentColor;border-color:#0000}input:where([type=file]){background:unset;border-color:inherit;font-size:unset;line-height:inherit;border-width:0;border-radius:0;padding:0}input:where([type=file]):focus{outline:1px solid buttontext;outline:1px auto -webkit-focus-ring-color}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.inset-y-0{inset-block:0}.left-0{left:0}.z-50{z-index:50}.order-1{order:1}.order-2{order:2}.order-3{order:3}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-8{height:calc(var(--spacing) * 8)}.h-full{height:100%}.max-h-\[60vh\]{max-height:60vh}.min-h-\[calc\(100vh-4rem\)\]{min-height:calc(100vh - 4rem)}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-4{width:calc(var(--spacing) * 4)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-0{max-width:0}.max-w-7xl{max-width:var(--container-7xl)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-\[12rem\]{min-width:12rem}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0{gap:0}.gap-1{gap:var(--spacing)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;)DELIM" -R"DELIM(margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-accentSecondary\/30>:not(:last-child)){border-color:#c856374d}.place-self-start{place-self:start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-accent{border-color:#ffa022}.border-accent\/20{border-color:#ffa02233}.border-accent\/30{border-color:#ffa0224d}.border-accent\/40{border-color:#ffa02266}.border-accent\/50{border-color:#ffa02280}.border-accentSecondary\/20{border-color:#c8563733}.border-accentSecondary\/30{border-color:#c856374d}.border-accentSecondary\/40{border-color:#c8563766}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500) 50%,transparent)}}.border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/50{border-color:color-mix(in oklab,var(--color-emerald-500) 50%,transparent)}}.border-rose-500\/50{border-color:#ff235780}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/50{border-color:color-mix(in oklab,var(--color-rose-500) 50%,transparent)}}.border-slate-500\/50{border-color:#62748e80}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/50{border-color:color-mix(in oklab,var(--color-slate-500) 50%,transparent)}}.border-textMuted\/30{border-color:#cfcfcf4d}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-accent{background-color:#ffa022}.bg-accent\/5{background-color:#ffa0220d}.bg-accentSecondary{background-color:#c85637}.bg-accentSecondary\/10{background-color:#c856371a}.bg-accentSecondary\/20{background-color:#c8563733}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.bg-background{background-color:#272822}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-current{background-color:currentColor}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.bg-rose-400{background-color:var(--color-rose-400)}.bg-rose-500\/15{background-color:#ff235726}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/15{background-color:color-mix(in oklab,var(--color-rose-500) 15%,transparent)}}.bg-rose-500\/20{background-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/20{background-color:color-mix(in oklab,var(--color-rose-500) 20%,transparent)}}.bg-slate-400{background-color:var(--color-slate-400)}.bg-slate-500\/15{background-color:#62748e26}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/15{background-color:color-mix(in oklab,var(--color-slate-500) 15%,transparent)}}.bg-slate-500\/20{background-color:#62748e33}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/20{background-color:color-mix(in oklab,var(--color-slate-500) 20%,transparent)}}.bg-surface\/60{background-color:#1f211c99}.bg-surface\/80{background-color:#1f211ccc}.bg-surface\/90{background-color:#1f211ce6}.bg-surface\/95{background-color:#1f211cf2}.bg-textPrimary{background-color:#ededed}.bg-transparent{background-color:#0000}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-\[linear-gradient\(180deg\,rgba\(255\,255\,255\,0\.18\)\,rgba\(255\,255\,255\,0\)\)\]{background-image:linear-gradient(#ffffff2e,#fff0)}.from-accent\/8{--tw-gradient-from:oklab(78.4754% .0670866 .152134/.08);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-surface\/60{--tw-gradient-to:oklab(24.3789% -.00557161 .00797938/.6);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-1{padding-block:var(--spacing)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-accent{color:#ffa022}.text-accentSecondary{color:#c85637}.text-amber-300{color:var(--color-amber-300)}.text-emerald-300{color:var(--color-emerald-300)}.text-rose-300{color:var(--color-rose-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:#cfcfcf}.text-textPrimary{color:#ededed})DELIM" -R"DELIM(.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.filter{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,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-focus-within\:max-w-\[18rem\]:is(:where(.group):focus-within *){max-width:18rem}.group-focus-within\:translate-x-0:is(:where(.group):focus-within *){--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:max-w-\[18rem\]:is(:where(.group):hover *){max-width:18rem}.group-hover\:translate-x-0:is(:where(.group):hover *){--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-textMuted::placeholder{color:#cfcfcf}.first\:text-left:first-child{text-align:left}.last\:text-right:last-child{text-align:right}.focus-within\:justify-start:focus-within{justify-content:flex-start}.focus-within\:gap-2:focus-within{gap:calc(var(--spacing) * 2)}.focus-within\:px-3:focus-within{padding-inline:calc(var(--spacing) * 3)}@media(hover:hover){.hover\:justify-start:hover{justify-content:flex-start}.hover\:gap-2:hover{gap:calc(var(--spacing) * 2)}.hover\:border-accent:hover{border-color:#ffa022}.hover\:border-accentSecondary:hover{border-color:#c85637}.hover\:bg-accentSecondary\/10:hover{background-color:#c856371a}.hover\:px-3:hover{padding-inline:calc(var(--spacing) * 3)}.hover\:text-accent:hover{color:#ffa022}.hover\:text-accentSecondary:hover{color:#c85637}}.focus\:border-accent:focus{border-color:#ffa022}.focus\:ring-accent:focus{--tw-ring-color:#ffa022}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-60:disabled{opacity:.6}@media(prefers-reduced-motion:no-preference){.motion-safe\:-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.motion-safe\:transition-\[max-width\,opacity\,transform\]{transition-property:max-width,opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:transition-\[padding\,gap\]{transition-property:padding,gap;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:duration-200{--tw-duration:.2s;transition-duration:.2s}.motion-safe\:ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}}@media(min-width:40rem){.sm\:block{display:block}.sm\:inline{display:inline}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}@media(min-width:48rem){.md\:order-2{order:2}.md\:order-3{order:3}.md\:order-4{order:4}.md\:ml-auto{margin-left:auto}.md\:hidden{display:none}.md\:inline{display:inline}.md\:w-72{width:calc(var(--spacing) * 72)}.md\:w-auto{width:auto}.md\:flex-none{flex:none}.md\:flex-nowrap{flex-wrap:nowrap}}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}}@media(min-width:80rem){.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-\[minmax\(0\,1\.5fr\)_minmax\(20rem\,1fr\)\]{grid-template-columns:minmax(0,1.5fr) minmax(20rem,1fr)}}}:root{color-scheme:dark}body{font-family:var(--font-sans);color:#ededed;background-color:#272822}::selection{color:#272822;background-color:#ffa022}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%})DELIM" -R"DELIM(@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false} +R"DELIM(@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xl:36rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select{appearance:none;--tw-shadow:0 0 #0000;background-color:#fff;border-width:1px;border-color:#6a7282;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem}:is(input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var)DELIM" +R"DELIM((--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#155dfc;outline:2px solid #0000}input::placeholder,textarea::placeholder{color:#6a7282;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}::-webkit-date-and-time-value{text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-year-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-month-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-day-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-hour-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-minute-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-second-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-millisecond-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{-webkit-print-color-adjust:exact;print-color-adjust:exact;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='oklch(55.1%25 0.027 264.364)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem}select:where([multiple]),select:where([size]:not([size="1"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;-webkit-print-color-adjust:unset;print-color-adjust:unset;padding-right:.75rem}input:where([type=checkbox]),input:where([type=radio]){appearance:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;vertical-align:middle;-webkit-user-select:none;user-select:none;color:#155dfc;--tw-shadow:0 0 #0000;background-color:#fff;background-origin:border-box;border-width:1px;border-color:#6a7282;flex-shrink:0;width:1rem;height:1rem;padding:0;display:inline-block}input:where([type=checkbox]){border-radius:0}input:where([type=radio]){border-radius:100%}input:where([type=checkbox]):focus,input:where([type=radio]):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid #0000}input:where([type=checkbox]):checked,input:where([type=radio]):checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}input:where([type=checkbox]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=checkbox]):checked{appearance:auto}}input:where([type=radio]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=radio]):checked{appearance:auto}}input:where([type=checkbox]):checked:hover,input:where([type=checkbox]):checked:focus,input:where([type=radio]):checked:hover,input:where([type=radio]):checked:focus{background-color:currentColor;border-color:#0000}input:where([type=checkbox]):indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}@media(forced-colors:active){input:where([type=checkbox]):indeterminate{appearance:auto}}input:where([type=checkbox]):indeterminate:hover,input:where([type=checkbox]):indeterminate:focus{background-color:currentColor;border-color:#0000}input:where([type=file]){background:unset;border-color:inherit;font-size:unset;line-height:inherit;border-width:0;border-radius:0;padding:0}input:where([type=file]):focus{outline:1px solid buttontext;outline:1px auto -webkit-focus-ring-color}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.inset-y-0{inset-block:0}.left-0{left:0}.z-50{z-index:50}.order-1{order:1}.order-2{order:2}.order-3{order:3}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-8{height:calc(var(--spacing) * 8)}.h-full{height:100%}.max-h-\[60vh\]{max-height:60vh}.min-h-\[calc\(100vh-4rem\)\]{min-height:calc(100vh - 4rem)}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-4{width:calc(var(--spacing) * 4)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-0{max-width:0}.max-w-7xl{max-width:var(--container-7xl)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-\[12rem\]{min-width:12rem}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0{gap:0}.gap-1{gap:var(--spacing)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) *)DELIM" +R"DELIM( calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-accentSecondary\/30>:not(:last-child)){border-color:#c856374d}.place-self-start{place-self:start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-accent{border-color:#ffa022}.border-accent\/20{border-color:#ffa02233}.border-accent\/30{border-color:#ffa0224d}.border-accent\/40{border-color:#ffa02266}.border-accent\/50{border-color:#ffa02280}.border-accentSecondary\/20{border-color:#c8563733}.border-accentSecondary\/30{border-color:#c856374d}.border-accentSecondary\/40{border-color:#c8563766}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500) 50%,transparent)}}.border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/50{border-color:color-mix(in oklab,var(--color-emerald-500) 50%,transparent)}}.border-rose-500\/50{border-color:#ff235780}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/50{border-color:color-mix(in oklab,var(--color-rose-500) 50%,transparent)}}.border-slate-500\/50{border-color:#62748e80}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/50{border-color:color-mix(in oklab,var(--color-slate-500) 50%,transparent)}}.border-textMuted\/30{border-color:#cfcfcf4d}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-accent{background-color:#ffa022}.bg-accent\/5{background-color:#ffa0220d}.bg-accentSecondary{background-color:#c85637}.bg-accentSecondary\/10{background-color:#c856371a}.bg-accentSecondary\/20{background-color:#c8563733}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.bg-background{background-color:#272822}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-current{background-color:currentColor}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.bg-rose-400{background-color:var(--color-rose-400)}.bg-rose-500\/15{background-color:#ff235726}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/15{background-color:color-mix(in oklab,var(--color-rose-500) 15%,transparent)}}.bg-rose-500\/20{background-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/20{background-color:color-mix(in oklab,var(--color-rose-500) 20%,transparent)}}.bg-slate-400{background-color:var(--color-slate-400)}.bg-slate-500\/15{background-color:#62748e26}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/15{background-color:color-mix(in oklab,var(--color-slate-500) 15%,transparent)}}.bg-slate-500\/20{background-color:#62748e33}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/20{background-color:color-mix(in oklab,var(--color-slate-500) 20%,transparent)}}.bg-surface\/60{background-color:#1f211c99}.bg-surface\/80{background-color:#1f211ccc}.bg-surface\/90{background-color:#1f211ce6}.bg-surface\/95{background-color:#1f211cf2}.bg-textPrimary{background-color:#ededed}.bg-transparent{background-color:#0000}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-\[linear-gradient\(180deg\,rgba\(255\,255\,255\,0\.18\)\,rgba\(255\,255\,255\,0\)\)\]{background-image:linear-gradient(#ffffff2e,#fff0)}.from-accent\/8{--tw-gradient-from:oklab(78.4754% .0670866 .152134/.08);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-surface\/60{--tw-gradient-to:oklab(24.3789% -.00557161 .00797938/.6);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.text-accent{color:#ffa022}.text-accentSecondary{color:#c85637}.text-amber-300{color:var(--color-amber-300)}.text-emerald-300{color:var(--color-emerald-300)DELIM" +R"DELIM()}.text-rose-300{color:var(--color-rose-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:#cfcfcf}.text-textPrimary{color:#ededed}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.filter{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,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-focus-within\:max-w-\[18rem\]:is(:where(.group):focus-within *){max-width:18rem}.group-focus-within\:translate-x-0:is(:where(.group):focus-within *){--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:max-w-\[18rem\]:is(:where(.group):hover *){max-width:18rem}.group-hover\:translate-x-0:is(:where(.group):hover *){--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-textMuted::placeholder{color:#cfcfcf}.first\:text-left:first-child{text-align:left}.last\:text-right:last-child{text-align:right}.focus-within\:justify-start:focus-within{justify-content:flex-start}.focus-within\:gap-2:focus-within{gap:calc(var(--spacing) * 2)}.focus-within\:px-3:focus-within{padding-inline:calc(var(--spacing) * 3)}@media(hover:hover){.hover\:justify-start:hover{justify-content:flex-start}.hover\:gap-2:hover{gap:calc(var(--spacing) * 2)}.hover\:border-accent:hover{border-color:#ffa022}.hover\:border-accentSecondary:hover{border-color:#c85637}.hover\:bg-accentSecondary\/10:hover{background-color:#c856371a}.hover\:px-3:hover{padding-inline:calc(var(--spacing) * 3)}.hover\:text-accent:hover{color:#ffa022}.hover\:text-accentSecondary:hover{color:#c85637}}.focus\:border-accent:focus{border-color:#ffa022}.focus\:ring-accent:focus{--tw-ring-color:#ffa022}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-60:disabled{opacity:.6}@media(prefers-reduced-motion:no-preference){.motion-safe\:-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.motion-safe\:transition-\[max-width\,opacity\,transform\]{transition-property:max-width,opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:transition-\[padding\,gap\]{transition-property:padding,gap;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:duration-200{--tw-duration:.2s;transition-duration:.2s}.motion-safe\:ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}}@media(min-width:40rem){.sm\:block{display:block}.sm\:inline{display:inline}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}@media(min-width:48rem){.md\:order-2{order:2}.md\:order-3{order:3}.md\:order-4{order:4}.md\:ml-auto{margin-left:auto}.md\:hidden{display:none}.md\:inline{display:inline}.md\:w-72{width:calc(var(--spacing) * 72)}.md\:w-auto{width:auto}.md\:flex-none{flex:none}.md\:flex-nowrap{flex-wrap:nowrap}}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}}@media(min-width:80rem){.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-\[minmax\(0\,1\.5fr\)_minmax\(20rem\,1fr\)\]{grid-template-columns:minmax(0,1.5fr) minmax(20rem,1fr)}}}:root{color-scheme:dark}body{font-family:var(--font-sans);color:#ededed;background-color:#272822}::selection{color:#272822;background-color:#ffa022}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-s)DELIM" +R"DELIM(hadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false} )DELIM" ) diff --git a/console/embedded/native_ecma.cpp b/console/embedded/native_ecma.cpp index cac966f5..c660c208 100644 --- a/console/embedded/native_ecma.cpp +++ b/console/embedded/native_ecma.cpp @@ -22,149 +22,149 @@ namespace libbitcoin { namespace server { DEFINE_EMBEDDED_PAGE(native_pages, char, ecma, -R"DELIM(function ew(e,a){for(var i=0;il[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&l(c)}).observe(document,{childList:!0,subtree:!0});function i(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(s){if(s.ep)return;s.ep=!0;const u=i(s);fetch(s.href,u)}})();function Sh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bd={exports:{}},so={};var Xg;function tw(){if(Xg)return so;Xg=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(l,s,u){var c=null;if(u!==void 0&&(c=""+u),s.key!==void 0&&(c=""+s.key),"key"in s){u={};for(var d in s)d!=="key"&&(u[d]=s[d])}else u=s;return s=u.ref,{$$typeof:e,type:l,key:c,ref:s!==void 0?s:null,props:u}}return so.Fragment=a,so.jsx=i,so.jsxs=i,so}var Ig;function nw(){return Ig||(Ig=1,bd.exports=tw()),bd.exports}var v=nw(),xd={exports:{}},ke={};var Jg;function aw(){if(Jg)return ke;Jg=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function w(C){return C===null||typeof C!="object"?null:(C=x&&C[x]||C["@@iterator"],typeof C=="function"?C:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,N={};function F(C,K,oe){this.props=C,this.context=K,this.refs=N,this.updater=oe||E}F.prototype.isReactComponent={},F.prototype.setState=function(C,K){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,K,"setState")},F.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function V(){}V.prototype=F.prototype;function J(C,K,oe){this.props=C,this.context=K,this.refs=N,this.updater=oe||E}var ue=J.prototype=new V;ue.constructor=J,R(ue,F.prototype),ue.isPureReactComponent=!0;var ae=Array.isArray;function xe(){}var j={H:null,A:null,T:null,S:null},_=Object.prototype.hasOwnProperty;function D(C,K,oe){var he=oe.ref;return{$$typeof:e,type:C,key:K,ref:he!==void 0?he:null,props:oe}}function B(C,K){return D(C.type,K,C.props)}function Q(C){return typeof C=="object"&&C!==null&&C.$$typeof===e}function q(C){var K={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(oe){return K[oe]})}var G=/\/+/g;function re(C,K){return typeof C=="object"&&C!==null&&C.key!=null?q(""+C.key):K.toString(36)}function fe(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(xe,xe):(C.status="pending",C.then(function(K){C.status==="pending"&&(C.status="fulfilled",C.value=K)},function(K){C.status==="pending"&&(C.status="rejected",C.reason=K)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function M(C,K,oe,he,Ee){var Te=typeof C;(Te==="undefined"||Te==="boolean")&&(C=null);var W=!1;if(C===null)W=!0;else switch(Te){case"bigint":case"string":case"number":W=!0;break;case"object":switch(C.$$typeof){case e:case a:W=!0;break;case b:return W=C._init,M(W(C._payload),K,oe,he,Ee)}}if(W)return Ee=Ee(C),W=he===""?"."+re(C,0):he,ae(Ee)?(oe="",W!=null&&(oe=W.replace(G,"$&/")+"/"),M(Ee,K,oe,"",function(ge){return ge})):Ee!=null&&(Q(Ee)&&(Ee=B(Ee,oe+(Ee.key==null||C&&C.key===Ee.key?"":(""+Ee.key).replace(G,"$&/")+"/")+W)),K.push(Ee)),1;W=0;var de=he===""?".":he+":";if(ae(C))for(var X=0;X>>1,we=M[ce];if(0>>1;ces(oe,le))hes(Ee,oe)?(M[ce]=Ee,M[he]=le,ce=he):(M[ce]=oe,M[K]=le,ce=K);else if(hes(Ee,le))M[ce]=Ee,M[he]=le,ce=he;else break e}}return k}function s(M,k){var le=M.sortIndex-k.sortIndex;return le!==0?le:M.id-k.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var m=[],p=[],b=1,g=null,x=3,w=!1,E=!1,R=!1,N=!1,F=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;function ue(M){for(var k=i(p);k!==null;){if(k.callback===null)l(p);else if(k.startTime<=M)l(p),k.sortIndex=k.expirationTime,a(m,k);else break;k=i(p)}}function ae(M){if(R=!1,ue(M),!E)if(i(m)!==null)E=!0,xe||(xe=!0,q());else{var k=i(p);k!==null&&fe(ae,k.startTime-M)}}var xe=!1,j=-1,_=5,D=-1;function B(){return N?!0:!(e.unstable_now()-D<_)}function Q(){if(N=!1,xe){var M=e.unstable_now();D=M;var k=!0;try{e:{E=!1,R&&(R=!1,V(j),j=-1),w=!0;var le=x;try{t:{for(ue(M),g=i(m);g!==null&&!(g.expirationTime>M&&B());){var ce=g.callback;if(typeof ce=="function"){g.callback=null,x=g.priorityLevel;var we=ce(g.expirationTime<=M);if(M=e.unstable_now(),typeof we=="function"){g.callback=we,ue(M),k=!0;break t}g===i(m)&&l(m),ue(M)}else l(m);g=i(m)}if(g!==null)k=!0;else{var C=i(p);C!==null&&fe(ae,C.startTime-M),k=!1}}break e}finally{g=null,x=le,w=!1}k=void 0}}finally{k?q():xe=!1}}}var q;if(typeof J=="function")q=function(){J(Q)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,re=G.port2;G.port1.onmessage=Q,q=function(){re.postMessage(null)}}else q=function(){F(Q,0)};function fe(M,k){j=F(function(){M(e.unstable_now())},k)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125ce?(M.sortIndex=le,a(p,M),i(m)===null&&M===i(p)&&(R?(V(j),j=-1):R=!0,fe(ae,le-ce))):(M.sortIndex=we,a(m,M),E||w||(E=!0,xe||(xe=!0,q()))),M},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(M){var k=x;return function(){var le=x;x=k;try{return M.apply(this,arguments)}finally{x=le}}}})(_d)),_d}var tv;function lw(){return tv||(tv=1,wd.exports=iw()),wd.exports}var Ed={exports:{}},Jt={};var nv;function ow(){if(nv)return Jt;nv=1;var e=wh();function a(m){var p="https://react.dev/errors/"+m;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),Ed.exports=ow(),Ed.exports}var rv;function sw(){if(rv)return uo;rv=1;var e=lw(),a=wh(),i=Q0();function l(t){var n="https://react.dev/errors/"+t;if(1we||(t.current=ce[we],ce[we]=null,we--)}function oe(t,n){we++,ce[we]=t.current,t.current=n}var he=C(null),Ee=C(null),Te=C(null),W=C(null);function de(t,n){switch(oe(Te,n),oe(Ee,t),oe(he,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?bg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=bg(n),t=xg(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}K(he),oe(he,t)}function X(){K(he),K(Ee),K(Te)}function ge(t){t.memoizedState!==null&&oe(W,t);var n=he.current,r=xg(n,t.type);n!==r&&(oe(Ee,t),oe(he,r))}function pe(t){Ee.current===t&&(K(he),K(Ee)),W.current===t&&(K(W),ro._currentValue=le)}var Ue,je;function He(t){if(Ue===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Ue=n&&n[1]||"",je=-1l[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&l(c)}).observe(document,{childList:!0,subtree:!0});function i(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(s){if(s.ep)return;s.ep=!0;const u=i(s);fetch(s.href,u)}})();function wh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bd={exports:{}},so={};var Wg;function sw(){if(Wg)return so;Wg=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(l,s,u){var c=null;if(u!==void 0&&(c=""+u),s.key!==void 0&&(c=""+s.key),"key"in s){u={};for(var d in s)d!=="key"&&(u[d]=s[d])}else u=s;return s=u.ref,{$$typeof:e,type:l,key:c,ref:s!==void 0?s:null,props:u}}return so.Fragment=a,so.jsx=i,so.jsxs=i,so}var ev;function uw(){return ev||(ev=1,bd.exports=sw()),bd.exports}var y=uw(),xd={exports:{}},Le={};var tv;function cw(){if(tv)return Le;tv=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function w(j){return j===null||typeof j!="object"?null:(j=x&&j[x]||j["@@iterator"],typeof j=="function"?j:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,C={};function Y(j,K,ae){this.props=j,this.context=K,this.refs=C,this.updater=ae||E}Y.prototype.isReactComponent={},Y.prototype.setState=function(j,K){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,K,"setState")},Y.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function V(){}V.prototype=Y.prototype;function I(j,K,ae){this.props=j,this.context=K,this.refs=C,this.updater=ae||E}var oe=I.prototype=new V;oe.constructor=I,R(oe,Y.prototype),oe.isPureReactComponent=!0;var re=Array.isArray;function xe(){}var N={H:null,A:null,T:null,S:null},_=Object.prototype.hasOwnProperty;function D(j,K,ae){var de=ae.ref;return{$$typeof:e,type:j,key:K,ref:de!==void 0?de:null,props:ae}}function B(j,K){return D(j.type,K,j.props)}function Q(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function P(j){var K={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(ae){return K[ae]})}var ne=/\/+/g;function ue(j,K){return typeof j=="object"&&j!==null&&j.key!=null?P(""+j.key):K.toString(36)}function pe(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(xe,xe):(j.status="pending",j.then(function(K){j.status==="pending"&&(j.status="fulfilled",j.value=K)},function(K){j.status==="pending"&&(j.status="rejected",j.reason=K)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function M(j,K,ae,de,te){var ye=typeof j;(ye==="undefined"||ye==="boolean")&&(j=null);var Ce=!1;if(j===null)Ce=!0;else switch(ye){case"bigint":case"string":case"number":Ce=!0;break;case"object":switch(j.$$typeof){case e:case a:Ce=!0;break;case b:return Ce=j._init,M(Ce(j._payload),K,ae,de,te)}}if(Ce)return te=te(j),Ce=de===""?"."+ue(j,0):de,re(te)?(ae="",Ce!=null&&(ae=Ce.replace(ne,"$&/")+"/"),M(te,K,ae,"",function(fe){return fe})):te!=null&&(Q(te)&&(te=B(te,ae+(te.key==null||j&&j.key===te.key?"":(""+te.key).replace(ne,"$&/")+"/")+Ce)),K.push(te)),1;Ce=0;var wt=de===""?".":de+":";if(re(j))for(var H=0;H>>1,Se=M[ce];if(0>>1;ces(ae,le))des(te,ae)?(M[ce]=te,M[de]=le,ce=de):(M[ce]=ae,M[K]=le,ce=K);else if(des(te,le))M[ce]=te,M[de]=le,ce=de;else break e}}return O}function s(M,O){var le=M.sortIndex-O.sortIndex;return le!==0?le:M.id-O.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var m=[],p=[],b=1,v=null,x=3,w=!1,E=!1,R=!1,C=!1,Y=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function oe(M){for(var O=i(p);O!==null;){if(O.callback===null)l(p);else if(O.startTime<=M)l(p),O.sortIndex=O.expirationTime,a(m,O);else break;O=i(p)}}function re(M){if(R=!1,oe(M),!E)if(i(m)!==null)E=!0,xe||(xe=!0,P());else{var O=i(p);O!==null&&pe(re,O.startTime-M)}}var xe=!1,N=-1,_=5,D=-1;function B(){return C?!0:!(e.unstable_now()-D<_)}function Q(){if(C=!1,xe){var M=e.unstable_now();D=M;var O=!0;try{e:{E=!1,R&&(R=!1,V(N),N=-1),w=!0;var le=x;try{t:{for(oe(M),v=i(m);v!==null&&!(v.expirationTime>M&&B());){var ce=v.callback;if(typeof ce=="function"){v.callback=null,x=v.priorityLevel;var Se=ce(v.expirationTime<=M);if(M=e.unstable_now(),typeof Se=="function"){v.callback=Se,oe(M),O=!0;break t}v===i(m)&&l(m),oe(M)}else l(m);v=i(m)}if(v!==null)O=!0;else{var j=i(p);j!==null&&pe(re,j.startTime-M),O=!1}}break e}finally{v=null,x=le,w=!1}O=void 0}}finally{O?P():xe=!1}}}var P;if(typeof I=="function")P=function(){I(Q)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,ue=ne.port2;ne.port1.onmessage=Q,P=function(){ue.postMessage(null)}}else P=function(){Y(Q,0)};function pe(M,O){N=Y(function(){M(e.unstable_now())},O)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125ce?(M.sortIndex=le,a(p,M),i(m)===null&&M===i(p)&&(R?(V(N),N=-1):R=!0,pe(re,le-ce))):(M.sortIndex=Se,a(m,M),E||w||(E=!0,xe||(xe=!0,P()))),M},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(M){var O=x;return function(){var le=x;x=O;try{return M.apply(this,arguments)}finally{x=le}}}})(_d)),_d}var rv;function hw(){return rv||(rv=1,wd.exports=dw()),wd.exports}var Ed={exports:{}},Wt={};var iv;function mw(){if(iv)return Wt;iv=1;var e=_h();function a(m){var p="https://react.dev/errors/"+m;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),Ed.exports=mw(),Ed.exports}var ov;function pw(){if(ov)return uo;ov=1;var e=hw(),a=_h(),i=G0();function l(t){var n="https://react.dev/errors/"+t;if(1Se||(t.current=ce[Se],ce[Se]=null,Se--)}function ae(t,n){Se++,ce[Se]=t.current,t.current=n}var de=j(null),te=j(null),ye=j(null),Ce=j(null);function wt(t,n){switch(ae(ye,n),ae(te,t),ae(de,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?wg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=wg(n),t=_g(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}K(de),ae(de,t)}function H(){K(de),K(te),K(ye)}function fe(t){t.memoizedState!==null&&ae(Ce,t);var n=de.current,r=_g(n,t.type);n!==r&&(ae(te,t),ae(de,r))}function he(t){te.current===t&&(K(de),K(te)),Ce.current===t&&(K(Ce),ro._currentValue=le)}var Ee,me;function Ae(t){if(Ee===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Ee=n&&n[1]||"",me=-1)":-1f||A[o]!==$[f]){var I=` -`+A[o].replace(" at new "," at ");return t.displayName&&I.includes("")&&(I=I.replace("",t.displayName)),I}while(1<=o&&0<=f);break}}}finally{Mt=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?He(r):""}function qe(t,n){switch(t.tag){case 26:case 27:case 5:return He(t.type);case 16:return He("Lazy");case 13:return t.child!==n&&n!==null?He("Suspense Fallback"):He("Suspense");case 19:return He("SuspenseList");case 0:case 15:return Ve(t.type,!1);case 11:return Ve(t.type.render,!1);case 1:return Ve(t.type,!0);case 31:return He("Activity");default:return""}}function st(t){try{var n="",r=null;do n+=qe(t,r),r=t,t=t.return;while(t);return n}catch(o){return` +`+Ee+t+me}var Je=!1;function ke(t,n){if(!t||Je)return"";Je=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(G){var F=G}Reflect.construct(t,[],W)}else{try{W.call()}catch(G){F=G}t.call(W.prototype)}}else{try{throw Error()}catch(G){F=G}(W=t())&&typeof W.catch=="function"&&W.catch(function(){})}}catch(G){if(G&&F&&typeof G.stack=="string")return[G.stack,F.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),g=h[0],S=h[1];if(g&&S){var A=g.split(` +`),Z=S.split(` +`);for(f=o=0;of||A[o]!==Z[f]){var X=` +`+A[o].replace(" at new "," at ");return t.displayName&&X.includes("")&&(X=X.replace("",t.displayName)),X}while(1<=o&&0<=f);break}}}finally{Je=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?Ae(r):""}function qe(t,n){switch(t.tag){case 26:case 27:case 5:return Ae(t.type);case 16:return Ae("Lazy");case 13:return t.child!==n&&n!==null?Ae("Suspense Fallback"):Ae("Suspense");case 19:return Ae("SuspenseList");case 0:case 15:return ke(t.type,!1);case 11:return ke(t.type.render,!1);case 1:return ke(t.type,!0);case 31:return Ae("Activity");default:return""}}function Fe(t){try{var n="",r=null;do n+=qe(t,r),r=t,t=t.return;while(t);return n}catch(o){return` Error generating stack: `+o.message+` -`+o.stack}}var Fe=Object.prototype.hasOwnProperty,pt=e.unstable_scheduleCallback,nn=e.unstable_cancelCallback,Mn=e.unstable_shouldYield,vl=e.unstable_requestPaint,Qt=e.unstable_now,$t=e.unstable_getCurrentPriorityLevel,On=e.unstable_ImmediatePriority,wa=e.unstable_UserBlockingPriority,sa=e.unstable_NormalPriority,In=e.unstable_LowPriority,kn=e.unstable_IdlePriority,uc=e.log,cc=e.unstable_setDisableYieldValue,_a=null,an=null;function qt(t){if(typeof uc=="function"&&cc(t),an&&typeof an.setStrictMode=="function")try{an.setStrictMode(_a,t)}catch{}})DELIM" -R"DELIM(var It=Math.clz32?Math.clz32:fc,Io=Math.log,Jo=Math.LN2;function fc(t){return t>>>=0,t===0?32:31-(Io(t)/Jo|0)|0}var Lr=256,Ea=262144,Br=4194304;function Jn(t){var n=t&42;if(n!==0)return n;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function hi(t,n,r){var o=t.pendingLanes;if(o===0)return 0;var f=0,h=t.suspendedLanes,y=t.pingedLanes;t=t.warmLanes;var S=o&134217727;return S!==0?(o=S&~h,o!==0?f=Jn(o):(y&=S,y!==0?f=Jn(y):r||(r=S&~t,r!==0&&(f=Jn(r))))):(S=o&~h,S!==0?f=Jn(S):y!==0?f=Jn(y):r||(r=o&~t,r!==0&&(f=Jn(r)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,r=n&-n,h>=r||h===32&&(r&4194048)!==0)?n:f}function Va(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function dc(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bl(){var t=Br;return Br<<=1,(Br&62914560)===0&&(Br=4194304),t}function Xa(t){for(var n=[],r=0;31>r;r++)n.push(t);return n}function ua(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Wo(t,n,r,o,f,h){var y=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var S=t.entanglements,A=t.expirationTimes,$=t.hiddenUpdates;for(r=y&~r;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Aa=/[\n"\\]/g;function ln(t){return t.replace(Aa,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function xl(t,n,r,o,f,h,y,S){t.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.type=y:t.removeAttribute("type"),n!=null?y==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+ht(n)):t.value!==""+ht(n)&&(t.value=""+ht(n)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),n!=null?hc(t,y,ht(n)):r!=null?hc(t,y,ht(r)):o!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.name=""+ht(S):t.removeAttribute("name")}function hm(t,n,r,o,f,h,y,S){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),n!=null||r!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){yi(t);return}r=r!=null?""+ht(r):"",n=n!=null?""+ht(n):r,S||n===t.value||(t.value=n),t.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=S?t.checked:!!o,t.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),yi(t)}function hc(t,n,r){n==="number"&&it(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function vi(t,n,r,o){if(t=t.options,n){n={};)DELIM" -R"DELIM(for(var f=0;f"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vc=!1;if(Ca)try{var wl={};Object.defineProperty(wl,"passive",{get:function(){vc=!0}}),window.addEventListener("test",wl,wl),window.removeEventListener("test",wl,wl)}catch{vc=!1}var Ja=null,bc=null,as=null;function xm(){if(as)return as;var t,n=bc,r=n.length,o,f="value"in Ja?Ja.value:Ja.textContent,h=f.length;for(t=0;t=Tl),Rm=" ",Am=!1;function zm(t,n){switch(t){case"keyup":return w1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var wi=!1;function E1(t,n){switch(t){case"compositionend":return Cm(n);case"keypress":return n.which!==32?null:(Am=!0,Rm);case"textInput":return t=n.data,t===Rm&&Am?null:t;default:return null}}function T1(t,n){if(wi)return t==="compositionend"||!Ec&&zm(t,n)?(t=xm(),as=bc=Ja=null,wi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:r,offset:n-t};t=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Bm(r)}}function Hm(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Hm(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function $m(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=it(t.document);n instanceof t.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)t=n.contentWindow;else break;n=it(t.document)}return n}function Ac(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var O1=Ca&&"documentMode"in document&&11>=document.documentMode,_i=null,zc=null,Cl=null,Cc=!1;function Zm(t,n,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Cc||_i==null||_i!==it(o)||(o=_i,"selectionStart"in o&&Ac(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Cl&&zl(Cl,o)||(Cl=o,o=Xs(zc,"onSelect"),0>=y,f-=y,ca=1<<32-It(n)+f|r<$e?(Ge=_e,_e=null):Ge=_e.sibling;var tt=P(U,_e,H[$e],ee);if(tt===null){_e===null&&(_e=Ge);break}t&&_e&&tt.alternate===null&&n(U,_e),O=h(tt,O,$e),et===null?Re=tt:et.sibling=tt,et=tt,_e=Ge}if($e===H.length)return r(U,_e),Ke&&Na(U,$e),Re;if(_e===null){for(;$e$e?(Ge=_e,_e=null):Ge=_e.sibling;var xr=P(U,_e,tt.value,ee);if(xr===null){_e===null&&(_e=Ge);break}t&&_e&&xr.alternate===null&&n(U,_e),O=h(xr,O,$e),et===null?Re=xr:et.sibling=xr,et=xr,_e=Ge}if(tt.done)return r(U,_e),Ke&&Na(U,$e),Re;if(_e===null){for(;!tt.done;$e++,tt=H.next())tt=te(U,tt.value,ee),tt!==null&&(O=h(tt,O,$e),et===null?Re=tt:et.sibling=tt,et=tt);return Ke&&Na(U,$e),Re}for(_e=o(_e);!tt.done;$e++,tt=H.next())tt=Y(_e,U,$e,tt.value,ee),tt!==null&&(t&&tt.alternate!==null&&_e.delete(tt.key===null?$e:tt.key),O=h(tt,O,$e),et===null?Re=tt:et.sibling=tt,et=tt);return t&&_e.forEach(function(WS){return n(U,WS)}),Ke&&Na(U,$e),Re}function ft(U,O,H,ee){if(typeof H=="object"&&H!==null&&H.type===R&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case w:e:{for(var Re=H.key;O!==null;){if(O.key===Re){if(Re=H.type,Re===R){if(O.tag===7){r(U,O.sibling),ee=f(O,H.props.children),ee.return=U,U=ee;break e}}else if(O.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===_&&Gr(Re)===O.type){r(U,O.sibling),ee=f(O,H.props),Dl(ee,H),ee.return=U,U=ee;break e}r(U,O);break}else n(U,O);O=O.sibling}H.type===R?(ee=qr(H.props.children,U.mode,ee,H.key),ee.return=U,U=ee):(ee=hs(H.type,H.key,H.props,null,U.mode,ee),Dl(ee,H),ee.return=U,U=ee)}return y(U);case E:e:{for(Re=H.key;O!==null;){if(O.key===Re)if(O.tag===4&&O.stateNode.containerInfo===H.containerInfo&&O.stateNode.implementation===H.implementation){r(U,O.sibling),ee=f(O,H.children||[]),ee.return=U,U=ee;break e}else{r(U,O);break}else n(U,O);O=O.sibling}ee=Lc(H,U.mode,ee),ee.return=U,U=ee}return y(U);case _:return H=Gr(H),ft(U,O,H,ee)}if(fe(H))return Se(U,O,H,ee);if(q(H)){if(Re=q(H),typeof Re!="function")throw Error(l(150));return H=Re.call(H),Ne(U,O,H,ee)}if(typeof H.then=="function")return ft(U,O,xs(H),ee);if(H.$$typeof===J)return ft(U,O,ys(U,H),ee);Ss(U,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,O!==null&&O.tag===6?(r(U,O.sibling),ee=f(O,H),ee.return=U,U=ee):(r(U,O),ee=Dc(H,U.mode,ee),ee.return=U,U=ee),y(U)):r(U,O)}return function(U,O,H,ee){try{kl=0;var Re=ft(U,O,H,ee);return ki=null,Re}catch(_e){if(_e===Oi||_e===vs)throw _e;var et=wn(29,_e,null,U.mode);return et.lanes=ee,et.return=U,et}}}var Vr=cp(!0),fp=cp(!1),ar=!1;function Kc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vc(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function rr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ir(t,n,r){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(nt&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=ds(t),Km(t,null,r),n}return fs(t,o,n,r),ds(t)}function Ll(t,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,ts(t,r)}}function Xc(t,n){var r=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var f=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var y={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};h===null?f=h=y:h=h.next=y,r=r.next}while(r!==null);h===null?f=h=n:h=h.next=n}else f=h=n;r={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=n:t.next=n,r.lastBaseUpdate=n}var Ic=!1;function Bl(){if(Ic){var t=Mi;if(t!==null)throw t}}function Ul(t,n,r,o){Ic=!1;var f=t.updateQueue;ar=!1;var h=f.firstBaseUpdate,y=f.lastBaseUpdate,S=f.shared.pending;if(S!==null){f.shared.pending=null;var A=S,$=A.next;A.next=null,y===null?h=$:y.next=$,y=A;var I=t.alternate;I!==null&&(I=I.updateQueue,S=I.lastBaseUpdate,S!==y&&(S===null?I.firstBaseUpdate=$:S.next=$,I.lastBaseUpdate=A))}if(h!==null){var te=f.baseState;y=0,I=$=A=null,S=h;do{var P=S.lane&-536870913,Y=P!==S.lane;if(Y?(Ye&P)===P:(o&P)===P){P!==0&&P===Ni&&(Ic=!0),I!==null&&(I=I.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var Se=t,Ne=S;P=n;var ft=r;switch(Ne.tag){case 1:if(Se=Ne.payload,typeof Se=="function"){te=Se.call(ft,te,P);break e}te=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Ne.payload,P=typeof Se=="function"?Se.call(ft,te,P):Se,P==null)break e;te=g({},te,P);break e;case 2:ar=!0}}P=S.callback,P!==null&&(t.flags|=64,Y&&(t.flags|=8192),Y=f.callbacks,Y===null?f.callbacks=[P]:Y.push(P))}else Y={lane:P,tag:S.tag,payload:S.payload,callback:S.callback,next:null},I===null?($=I=Y,A=te):I=I.next=Y,y|=P;if(S=S.next,S===null){if(S=f.shared.pending,S===null)break;Y=S,S=Y.next,Y.next=null,f.lastBaseUpdate=Y,f.shared.pending=null}}while(!0);I===null&&(A=te),f.baseState=A,f.firstBaseUpdate=$,f.lastBaseUpdate=I,h===null&&(f.shared.lanes=0),cr|=y,t.lanes=y,t.memoizedState=te}}function dp(t,n){if(typeof t!="function")throw Error(l(191,t));t.call(n)}function hp(t,n){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;th?h:8;var y=M.T,S={};M.T=S,gf(t,!1,n,r);try{var A=f(),$=M.S;if($!==null&&$(S,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var I=q1(A,o);Zl(t,n,I,An(t))}else Zl(t,n,o,An(t))}catch(te){Zl(t,n,{then:function(){},status:"rejected",reason:te},An())}finally{k.p=h,y!==null&&S.types!==null&&(y.types=S.types),M.T=y}}function K1(){}function pf(t,n,r,o){if(t.tag!==5)throw Error(l(476));var f=Fp(t).queue;Qp(t,f,n,le,r===null?K1:function(){return Yp(t),r(o)})}function Fp(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Da,lastRenderedState:le},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Da,lastRenderedState:r},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function Yp(t){var n=Fp(t);n.next===null&&(n=t.alternate.memoizedState),Zl(t,n.next.queue,{},An())}function yf(){return Yt(ro)}function Gp(){return zt().memoizedState}function Kp(){return zt().memoizedState}function V1(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var r=An();t=rr(r);var o=ir(n,t,r);o!==null&&(yn(o,n,r),Ll(o,n,r)),n={cache:Qc()},t.payload=n;return}n=n.return}}function X1(t,n,r){var o=An();r={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(t)?Xp(n,r):(r=Oc(t,n,r,o),r!==null&&(yn(r,t,o),Ip(r,n,o)))}function Vp(t,n,r){var o=An();Zl(t,n,r,o)}function Zl(t,n,r,o){var f={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Ns(t))Xp(n,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var y=n.lastRenderedState,S=h(y,r);if(f.hasEagerState=!0,f.eagerState=S,Sn(S,y))return fs(t,n,f,0),mt===null&&cs(),!1}catch{}if(r=Oc(t,n,f,o),r!==null)return yn(r,t,o),Ip(r,n,o),!0}return!1}function gf(t,n,r,o){if(o={lane:2,revertLane:Vf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Ns(t)){if(n)throw Error(l(479))}else n=Oc(t,r,o,2),n!==null&&yn(n,t,2)}function Ns(t){var n=t.alternate;return t===Be||n!==null&&n===Be}function Xp(t,n){Li=Es=!0;var r=t.pending;r===null?n.next=n:(n.next=r.next,r.next=n),t.pending=n}function Ip(t,n,r){if((r&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,ts(t,r)}}var ql={readContext:Yt,use:As,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useLayoutEffect:_t,useInsertionEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useSyncExternalStore:_t,useId:_t,useHostTransitionStatus:_t,useFormState:_t,useActionState:_t,useOptimistic:_t,useMemoCache:_t,useCacheRefresh:_t};ql.useEffectEvent=_t;var Jp={readContext:Yt,use:As,useCallback:function(t,n){return on().memoizedState=[t,n===void 0?null:n],t},useContext:Yt,useEffect:Dp,useImperativeHandle:function(t,n,r){r=r!=null?r.concat([t]):null,Cs(4194308,4,Hp.bind(null,n,t),r)},useLayoutEffect:function(t,n){return Cs(4194308,4,t,n)},useInsertionEffect:function(t,n){Cs(4,2,t,n)},useMemo:function(t,n){var r=on();n=n===void 0?null:n;var o=t();if(Xr){qt(!0);try{t()}finally{qt(!1)}}return r.memoizedState=[o,n],o},useReducer:function(t,n,r){var o=on();if(r!==void 0){var f=r(n);if(Xr){qt(!0);try{r(n)}finally{qt(!1)}}}else f=n;return o.memoizedState=o.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},o.queue=t,t=t.dispatch=X1.bind(null,Be,t),[o.memoizedState,t]},useRef:function(t){var n=on();return t={current:t},n.memoizedState=t},useState:function(t){t=cf(t);var n=t.queue,r=Vp.bind(null,Be,n);return n.dispatch=r,[t.memoizedState,r]},useDebugValue:hf,useDeferredValue:function(t,n){var r=on();return mf(r,t,n)},useTransition:function(){var t=cf(!1);return t=Qp.bind(null,Be,t.queue,!0,!1),on().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,r){var o=Be,f=on();if(Ke){if(r===void 0)throw Error(l(407));r=r()}else{if(r=n(),mt===null)throw Error(l(349));(Ye&127)!==0||bp(o,n,r)}f.memoizedState=r;var h={value:r,getSnapshot:n};return f.queue=h,Dp(Sp.bind(null,o,h,t),[t]),o.flags|=2048,Ui(9,{destroy:void 0},xp.bind(null,o,h,r,n),null),r},useId:function(){var t=on(),n=mt.identifierPrefix;if(Ke){var r=fa,o=ca;r=(o&~(1<<32-It(o)-1)).toString(32)+r,n="_"+n+"R_"+r,r=Ts++,0<\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?y.createElement("select",{is:o.is}):y.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?y.createElement(f,{is:o.is}):y.createElement(f)}}h[me]=n,h[ve]=o;e:for(y=n.child;y!==null;){if(y.tag===5||y.tag===6)h.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===n)break e;for(;y.sibling===null;){if(y.return===null||y.return===n)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}n.stateNode=h;e:switch(Kt(h,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Ba(n)}}return vt(n),Nf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,r),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&Ba(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(l(166));if(t=Te.current,Ci(n)){if(t=n.stateNode,r=n.memoizedProps,o=null,f=Ft,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[me]=n,t=!!(t.nodeValue===r||o!==null&&o.suppressHydrationWarning===!0||gg(t.nodeValue,r)),t||tr(n,!0)}else t=Is(t).createTextNode(o),t[me]=n,n.stateNode=t})DELIM" -R"DELIM(return vt(n),null;case 31:if(r=n.memoizedState,t===null||t.memoizedState!==null){if(o=Ci(n),r!==null){if(t===null){if(!o)throw Error(l(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[me]=n}else Pr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vt(n),t=!1}else r=$c(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return n.flags&256?(En(n),n):(En(n),null);if((n.flags&128)!==0)throw Error(l(558))}return vt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=Ci(n),o!==null&&o.dehydrated!==null){if(t===null){if(!f)throw Error(l(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(l(317));f[me]=n}else Pr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vt(n),f=!1}else f=$c(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(En(n),n):(En(n),null)}return En(n),(n.flags&128)!==0?(n.lanes=r,n):(r=o!==null,t=t!==null&&t.memoizedState!==null,r&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==f&&(o.flags|=2048)),r!==t&&r&&(n.child.flags|=8192),Ls(n,n.updateQueue),vt(n),null);case 4:return X(),t===null&&Wf(n.stateNode.containerInfo),vt(n),null;case 10:return Oa(n.type),vt(n),null;case 19:if(K(At),o=n.memoizedState,o===null)return vt(n),null;if(f=(n.flags&128)!==0,h=o.rendering,h===null)if(f)Ql(o,!1);else{if(Et!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=_s(t),h!==null){for(n.flags|=128,Ql(o,!1),t=h.updateQueue,n.updateQueue=t,Ls(n,t),n.subtreeFlags=0,t=r,r=n.child;r!==null;)Vm(r,t),r=r.sibling;return oe(At,At.current&1|2),Ke&&Na(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Qt()>Zs&&(n.flags|=128,f=!0,Ql(o,!1),n.lanes=4194304)}else{if(!f)if(t=_s(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,Ls(n,t),Ql(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Ke)return vt(n),null}else 2*Qt()-o.renderingStartTime>Zs&&r!==536870912&&(n.flags|=128,f=!0,Ql(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(t=o.last,t!==null?t.sibling=h:n.child=h,o.last=h)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Qt(),t.sibling=null,r=At.current,oe(At,f?r&1|2:r&1),Ke&&Na(n,o.treeForkCount),t):(vt(n),null);case 22:case 23:return En(n),Wc(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(r&536870912)!==0&&(n.flags&128)===0&&(vt(n),n.subtreeFlags&6&&(n.flags|=8192)):vt(n),r=n.updateQueue,r!==null&&Ls(n,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048),t!==null&&K(Yr),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Oa(Ot),vt(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function tS(t,n){switch(Uc(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Oa(Ot),X(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return pe(n),null;case 31:if(n.memoizedState!==null){if(En(n),n.alternate===null)throw Error(l(340));Pr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(En(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(l(340));Pr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return K(At),null;case 4:return X(),null;case 10:return Oa(n.type),null;case 22:case 23:return En(n),Wc(),t!==null&&K(Yr),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Oa(Ot),null;case 25:return null;default:return null}}function wy(t,n){switch(Uc(n),n.tag){case 3:Oa(Ot),X();break;case 26:case 27:case 5:pe(n);break;case 4:X();break;case 31:n.memoizedState!==null&&En(n);break;case 13:En(n);break;case 19:K(At);break;case 10:Oa(n.type);break;case 22:case 23:En(n),Wc(),t!==null&&K(Yr);break;case 24:Oa(Ot)}}function Fl(t,n){try{var r=n.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var f=o.next;r=f;do{if((r.tag&t)===t){o=void 0;var h=r.create,y=r.inst;o=h(),y.destroy=o}r=r.next}while(r!==f)}}catch(S){ot(n,n.return,S)}}function sr(t,n,r){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var h=f.next;o=h;do{if((o.tag&t)===t){var y=o.inst,S=y.destroy;if(S!==void 0){y.destroy=void 0,f=n;var A=r,$=S;try{$()}catch(I){ot(f,A,I)}}}o=o.next}while(o!==h)}}catch(I){ot(n,n.return,I)}}function _y(t){var n=t.updateQueue;if(n!==null){var r=t.stateNode;try{hp(n,r)}catch(o){ot(t,t.return,o)}}}function Ey(t,n,r){r.props=Ir(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(o){ot(t,n,o)}}function Yl(t,n){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof r=="function"?t.refCleanup=r(o):r.current=o}}catch(f){ot(t,n,f)}}function da(t,n){var r=t.ref,o=t.refCleanup;if(r!==null)if(typeof o=="function")try{o()}catch(f){ot(t,n,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(f){ot(t,n,f)}else r.current=null}function Ty(t){var n=t.type,r=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&o.focus();break e;case"img":r.src?o.src=r.src:r.srcSet&&(o.srcset=r.srcSet)}}catch(f){ot(t,t.return,f)}}function Mf(t,n,r){try{var o=t.stateNode;_S(o,t.type,r,n),o[ve]=n}catch(f){ot(t,t.return,f)}}function Ry(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&pr(t.type)||t.tag===4}function Of(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Ry(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&pr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function kf(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(t),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=za));else if(o!==4&&(o===27&&pr(t.type)&&(r=t.stateNode,n=null),t=t.child,t!==null))for(kf(t,n,r),t=t.sibling;t!==null;)kf(t,n,r),t=t.sibling}function Bs(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?r.insertBefore(t,n):r.appendChild(t);else if(o!==4&&(o===27&&pr(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(Bs(t,n,r),t=t.sibling;t!==null;)Bs(t,n,r),t=t.sibling}function Ay(t){var n=t.stateNode,r=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);Kt(n,o,r),n[me]=t,n[ve]=r}catch(h){ot(t,t.return,h)}}var Ua=!1,Lt=!1,Df=!1,zy=typeof WeakSet=="function"?WeakSet:Set,Pt=null;function nS(t,n){if(t=t.containerInfo,nd=ru,t=$m(t),Ac(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var f=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var y=0,S=-1,A=-1,$=0,I=0,te=t,P=null;t:for(;;){for(var Y;te!==r||f!==0&&te.nodeType!==3||(S=y+f),te!==h||o!==0&&te.nodeType!==3||(A=y+o),te.nodeType===3&&(y+=te.nodeValue.length),(Y=te.firstChild)!==null;)P=te,te=Y;for(;;){if(te===t)break t;if(P===r&&++$===f&&(S=y),P===h&&++I===o&&(A=y),(Y=te.nextSibling)!==null)break;te=P,P=te.parentNode}te=Y}r=S===-1||A===-1?null:{start:S,end:A}}else r=null}r=r||{start:0,end:0}}else r=null;)DELIM" -R"DELIM(for(ad={focusedElem:t,selectionRange:r},ru=!1,Pt=n;Pt!==null;)if(n=Pt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Pt=t;else for(;Pt!==null;){switch(n=Pt,h=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(r=0;r title"))),Kt(h,o,r),h[me]=t,Ie(h),o=h;break e;case"link":var y=kg("link","href",f).get(o+(r.href||""));if(y){for(var S=0;Sft&&(y=ft,ft=Ne,Ne=y);var U=Um(S,Ne),O=Um(S,ft);if(U&&O&&(Y.rangeCount!==1||Y.anchorNode!==U.node||Y.anchorOffset!==U.offset||Y.focusNode!==O.node||Y.focusOffset!==O.offset)){var H=te.createRange();H.setStart(U.node,U.offset),Y.removeAllRanges(),Ne>ft?(Y.addRange(H),Y.extend(O.node,O.offset)):(H.setEnd(O.node,O.offset),Y.addRange(H))}}}}for(te=[],Y=S;Y=Y.parentNode;)Y.nodeType===1&&te.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;Sr?32:r,M.T=null,r=qf,qf=null;var h=dr,y=Pa;if(Zt=0,Pi=dr=null,Pa=0,(nt&6)!==0)throw Error(l(331));var S=nt;if(nt|=4,Hy(h.current),Ly(h,h.current,y,r),nt=S,Jl(0,!1),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(_a,h)}catch{}return!0}finally{k.p=f,M.T=o,ag(t,n)}}function ig(t,n,r){n=Bn(r,n),n=Sf(t.stateNode,n,2),t=ir(t,n,2),t!==null&&(ua(t,2),ha(t))}function ot(t,n,r){if(t.tag===3)ig(t,t,r);else for(;n!==null;){if(n.tag===3){ig(n,t,r);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(fr===null||!fr.has(o))){t=Bn(r,t),r=ly(2),o=ir(n,r,2),o!==null&&(oy(r,o,n,t),ua(o,2),ha(o));break}}n=n.return}}function Yf(t,n,r){var o=t.pingCache;if(o===null){o=t.pingCache=new iS;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(r)||(Uf=!0,f.add(r),t=cS.bind(null,t,n,r),n.then(t,t))}function cS(t,n,r){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,mt===t&&(Ye&r)===r&&(Et===4||Et===3&&(Ye&62914560)===Ye&&300>Qt()-$s?(nt&2)===0&&Qi(t,0):Hf|=r,qi===Ye&&(qi=0)),ha(t)}function lg(t,n){n===0&&(n=bl()),t=Zr(t,n),t!==null&&(ua(t,n),ha(t))}function fS(t){var n=t.memoizedState,r=0;n!==null&&(r=n.retryLane),lg(t,r)}function dS(t,n){var r=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(r=f.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(n),lg(t,r)}function hS(t,n){return pt(t,n)}var Gs=null,Yi=null,Gf=!1,Ks=!1,Kf=!1,mr=0;function ha(t){t!==Yi&&t.next===null&&(Yi===null?Gs=Yi=t:Yi=Yi.next=t),Ks=!0,Gf||(Gf=!0,pS())}function Jl(t,n){if(!Kf&&Ks){Kf=!0;do for(var r=!1,o=Gs;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var h=0;else{var y=o.suspendedLanes,S=o.pingedLanes;h=(1<<31-It(42|t)+1)-1,h&=f&~(y&~S),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,cg(o,h))}else h=Ye,h=hi(o,o===mt?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||Va(o,h)||(r=!0,cg(o,h));o=o.next}while(r);Kf=!1}}function mS(){og()}function og(){Ks=Gf=!1;var t=0;mr!==0&&TS()&&(t=mr);for(var n=Qt(),r=null,o=Gs;o!==null;){var f=o.next,h=sg(o,n);h===0?(o.next=null,r===null?Gs=f:r.next=f,f===null&&(Yi=r)):(r=o,(t!==0||(h&3)!==0)&&(Ks=!0)),o=f}Zt!==0&&Zt!==5||Jl(t),mr!==0&&(mr=0)}function sg(t,n){for(var r=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0S)break;var I=A.transferSize,te=A.initiatorType;I&&vg(te)&&(A=A.responseEnd,y+=I*(A"u"?null:document;function jg(t,n,r){var o=Gi;if(o&&typeof n=="string"&&n){var f=ln(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof r=="string"&&(f+='[crossorigin="'+r+'"]'),Cg.has(f)||(Cg.add(f),t={rel:t,crossOrigin:r,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),Kt(n,"link",t),Ie(n),o.head.appendChild(n)))}}function kS(t){Qa.D(t),jg("dns-prefetch",t,null)}function DS(t,n){Qa.C(t,n),jg("preconnect",t,n)}function LS(t,n,r){Qa.L(t,n,r);var o=Gi;if(o&&t&&n){var f='link[rel="preload"][as="'+ln(n)+'"]';n==="image"&&r&&r.imageSrcSet?(f+='[imagesrcset="'+ln(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(f+='[imagesizes="'+ln(r.imageSizes)+'"]')):f+='[href="'+ln(t)+'"]';var h=f;switch(n){case"style":h=Ki(t);break;case"script":h=Vi(t)}Pn.has(h)||(t=g({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:t,as:n},r),Pn.set(h,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(no(h))||n==="script"&&o.querySelector(ao(h))||(n=o.createElement("link"),Kt(n,"link",t),Ie(n),o.head.appendChild(n)))}}function BS(t,n){Qa.m(t,n);var r=Gi;if(r&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+ln(o)+'"][href="'+ln(t)+'"]',h=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Vi(t)}if(!Pn.has(h)&&(t=g({rel:"modulepreload",href:t},n),Pn.set(h,t),r.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(ao(h)))return}o=r.createElement("link"),Kt(o,"link",t),Ie(o),r.head.appendChild(o)}}}function US(t,n,r){Qa.S(t,n,r);var o=Gi;)DELIM" -R"DELIM(if(o&&t){var f=Rt(o).hoistableStyles,h=Ki(t);n=n||"default";var y=f.get(h);if(!y){var S={loading:0,preload:null};if(y=o.querySelector(no(h)))S.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":n},r),(r=Pn.get(h))&&cd(t,r);var A=y=o.createElement("link");Ie(A),Kt(A,"link",t),A._p=new Promise(function($,I){A.onload=$,A.onerror=I}),A.addEventListener("load",function(){S.loading|=1}),A.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Ws(y,n,o)}y={type:"stylesheet",instance:y,count:1,state:S},f.set(h,y)}}}function HS(t,n){Qa.X(t,n);var r=Gi;if(r&&t){var o=Rt(r).hoistableScripts,f=Vi(t),h=o.get(f);h||(h=r.querySelector(ao(f)),h||(t=g({src:t,async:!0},n),(n=Pn.get(f))&&fd(t,n),h=r.createElement("script"),Ie(h),Kt(h,"link",t),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function $S(t,n){Qa.M(t,n);var r=Gi;if(r&&t){var o=Rt(r).hoistableScripts,f=Vi(t),h=o.get(f);h||(h=r.querySelector(ao(f)),h||(t=g({src:t,async:!0,type:"module"},n),(n=Pn.get(f))&&fd(t,n),h=r.createElement("script"),Ie(h),Kt(h,"link",t),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function Ng(t,n,r,o){var f=(f=Te.current)?Js(f):null;if(!f)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=Ki(r.href),r=Rt(f).hoistableStyles,o=r.get(n),o||(o={type:"style",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Ki(r.href);var h=Rt(f).hoistableStyles,y=h.get(t);if(y||(f=f.ownerDocument||f,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,y),(h=f.querySelector(no(t)))&&!h._p&&(y.instance=h,y.state.loading=5),Pn.has(t)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Pn.set(t,r),h||ZS(f,t,r,y.state))),n&&o===null)throw Error(l(528,""));return y}if(n&&o!==null)throw Error(l(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Vi(r),r=Rt(f).hoistableScripts,o=r.get(n),o||(o={type:"script",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function Ki(t){return'href="'+ln(t)+'"'}function no(t){return'link[rel="stylesheet"]['+t+"]"}function Mg(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function ZS(t,n,r,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),Kt(n,"link",r),Ie(n),t.head.appendChild(n))}function Vi(t){return'[src="'+ln(t)+'"]'}function ao(t){return"script[async]"+t}function Og(t,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+ln(r.href)+'"]');if(o)return n.instance=o,Ie(o),o;var f=g({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),Ie(o),Kt(o,"style",f),Ws(o,r.precedence,t),n.instance=o;case"stylesheet":f=Ki(r.href);var h=t.querySelector(no(f));if(h)return n.state.loading|=4,n.instance=h,Ie(h),h;o=Mg(r),(f=Pn.get(f))&&cd(o,f),h=(t.ownerDocument||t).createElement("link"),Ie(h);var y=h;return y._p=new Promise(function(S,A){y.onload=S,y.onerror=A}),Kt(h,"link",o),n.state.loading|=4,Ws(h,r.precedence,t),n.instance=h;case"script":return h=Vi(r.src),(f=t.querySelector(ao(h)))?(n.instance=f,Ie(f),f):(o=r,(f=Pn.get(h))&&(o=g({},r),fd(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),Ie(f),Kt(f,"link",o),t.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Ws(o,r.precedence,t));return n.instance}function Ws(t,n,r){for(var o=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,h=f,y=0;y title"):null)}function qS(t,n,r){if(r===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Lg(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function PS(t,n,r,o){if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var f=Ki(o.href),h=n.querySelector(no(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=tu.bind(t),n.then(t,t)),r.state.loading|=4,r.instance=h,Ie(h);return}h=n.ownerDocument||n,o=Mg(o),(f=Pn.get(f))&&cd(o,f),h=h.createElement("link"),Ie(h);var y=h;y._p=new Promise(function(S,A){y.onload=S,y.onerror=A}),Kt(h,"link",o),r.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(t.count++,r=tu.bind(t),n.addEventListener("load",r),n.addEventListener("error",r))}}var dd=0;function QS(t,n){return t.stylesheets&&t.count===0&&au(t,t.stylesheets),0dd?50:800)+n);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function tu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)au(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var nu=null;function au(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,nu=new Map,n.forEach(FS,t),nu=null,tu.call(t))}function FS(t,n){if(!(n.state.loading&4)){var r=nu.get(t);if(r)var o=r.get(null);else{r=new Map,nu.set(t,r);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),Sd.exports=sw(),Sd.exports}var cw=uw();const fw=Sh(cw);var Ho=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},dw=class extends Ho{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const a=()=>e();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(a=>{a(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},_h=new dw,hw={setTimeout:(e,a)=>setTimeout(e,a),clearTimeout:e=>clearTimeout(e),setInterval:(e,a)=>setInterval(e,a),clearInterval:e=>clearInterval(e)},mw=class{#e=hw;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,a){return this.#e.setTimeout(e,a)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,a){return this.#e.setInterval(e,a)}clearInterval(e){this.#e.clearInterval(e)}},ri=new mw;function pw(e){setTimeout(e,0)}var yw=typeof window>"u"||"Deno"in globalThis;function vn(){}function gw(e,a){return typeof e=="function"?e(a):e}function Wd(e){return typeof e=="number"&&e>=0&&e!==1/0}function F0(e,a){return Math.max(e+(a||0)-Date.now(),0)}function Nr(e,a){return typeof e=="function"?e(a):e}function zn(e,a){return typeof e=="function"?e(a):e}function lv(e,a){const{type:i="all",exact:l,fetchStatus:s,predicate:u,queryKey:c,stale:d}=e;if(c){if(l){if(a.queryHash!==Eh(c,a.options))return!1}else if(!Ao(a.queryKey,c))return!1}if(i!=="all"){const m=a.isActive();if(i==="active"&&!m||i==="inactive"&&m)return!1}return!(typeof d=="boolean"&&a.isStale()!==d||s&&s!==a.state.fetchStatus||u&&!u(a))}function ov(e,a){const{exact:i,status:l,predicate:s,mutationKey:u}=e;if(u){if(!a.options.mutationKey)return!1;if(i){if(Ro(a.options.mutationKey)!==Ro(u))return!1}else if(!Ao(a.options.mutationKey,u))return!1}return!(l&&a.state.status!==l||s&&!s(a))}function Eh(e,a){return(a?.queryKeyHashFn||Ro)(e)}function Ro(e){return JSON.stringify(e,(a,i)=>th(i)?Object.keys(i).sort().reduce((l,s)=>(l[s]=i[s],l),{}):i)}function Ao(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(i=>Ao(e[i],a[i])):!1}var vw=Object.prototype.hasOwnProperty;function Y0(e,a,i=0){if(e===a)return e;if(i>500)return a;const l=sv(e)&&sv(a);if(!l&&!(th(e)&&th(a)))return a;const u=(l?e:Object.keys(e)).length,c=l?a:Object.keys(a),d=c.length,m=l?new Array(d):{};let p=0;for(let b=0;b{ri.setTimeout(a,e)})}function nh(e,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,a):i.structuralSharing!==!1?Y0(e,a):a}function xw(e,a,i=0){const l=[...e,a];return i&&l.length>i?l.slice(1):l}function Sw(e,a,i=0){const l=[a,...e];return i&&l.length>i?l.slice(0,-1):l}var Th=Symbol();function G0(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===Th?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function K0(e,a){return typeof e=="function"?e(...a):!!e}function ww(e,a,i){let l=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=a(),l||(l=!0,s.aborted?i():s.addEventListener("abort",i,{once:!0})),s)}),e}var zo=(()=>{let e=()=>yw;return{isServer(){return e()},setIsServer(a){e=a}}})();function ah(){let e,a;const i=new Promise((s,u)=>{e=s,a=u});i.status="pending",i.catch(()=>{});function l(s){Object.assign(i,s),delete i.resolve,delete i.reject}return i.resolve=s=>{l({status:"fulfilled",value:s}),e(s)},i.reject=s=>{l({status:"rejected",reason:s}),a(s)},i}var _w=pw;function Ew(){let e=[],a=0,i=d=>{d()},l=d=>{d()},s=_w;const u=d=>{a?e.push(d):s(()=>{i(d)})},c=()=>{const d=e;e=[],d.length&&s(()=>{l(()=>{d.forEach(m=>{i(m)})})})};return{batch:d=>{let m;a++;try{m=d()}finally{a--,a||c()}return m},batchCalls:d=>(...m)=>{u(()=>{d(...m)})},schedule:u,setNotifyFunction:d=>{i=d},setBatchNotifyFunction:d=>{l=d},setScheduler:d=>{s=d}}}var Vt=Ew(),Tw=class extends Ho{#e=!0;#t;#n;)DELIM" -R"DELIM(constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const a=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#e}},Bu=new Tw;function Rw(e){return Math.min(1e3*2**e,3e4)}function V0(e){return(e??"online")==="online"?Bu.isOnline():!0}var rh=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function X0(e){let a=!1,i=0,l;const s=ah(),u=()=>s.status!=="pending",c=R=>{if(!u()){const N=new rh(R);x(N),e.onCancel?.(N)}},d=()=>{a=!0},m=()=>{a=!1},p=()=>_h.isFocused()&&(e.networkMode==="always"||Bu.isOnline())&&e.canRun(),b=()=>V0(e.networkMode)&&e.canRun(),g=R=>{u()||(l?.(),s.resolve(R))},x=R=>{u()||(l?.(),s.reject(R))},w=()=>new Promise(R=>{l=N=>{(u()||p())&&R(N)},e.onPause?.()}).then(()=>{l=void 0,u()||e.onContinue?.()}),E=()=>{if(u())return;let R;const N=i===0?e.initialPromise:void 0;try{R=N??e.fn()}catch(F){R=Promise.reject(F)}Promise.resolve(R).then(g).catch(F=>{if(u())return;const V=e.retry??(zo.isServer()?0:3),J=e.retryDelay??Rw,ue=typeof J=="function"?J(i,F):J,ae=V===!0||typeof V=="number"&&ip()?void 0:w()).then(()=>{a?x(F):E()})})};return{promise:s,status:()=>s.status,cancel:c,continue:()=>(l?.(),s),cancelRetry:d,continueRetry:m,canStart:b,start:()=>(b()?E():w().then(E),s)}}var I0=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Wd(this.gcTime)&&(this.#e=ri.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(zo.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(ri.clearTimeout(this.#e),this.#e=void 0)}};function Aw(e){return{onFetch:(a,i)=>{const l=a.options,s=a.fetchOptions?.meta?.fetchMore?.direction,u=a.state.data?.pages||[],c=a.state.data?.pageParams||[];let d={pages:[],pageParams:[]},m=0;const p=async()=>{let b=!1;const g=E=>{ww(E,()=>a.signal,()=>b=!0)},x=G0(a.options,a.fetchOptions),w=async(E,R,N)=>{if(b)return Promise.reject(a.signal.reason);if(R==null&&E.pages.length)return Promise.resolve(E);const V=(()=>{const xe={client:a.client,queryKey:a.queryKey,pageParam:R,direction:N?"backward":"forward",meta:a.options.meta};return g(xe),xe})(),J=await x(V),{maxPages:ue}=a.options,ae=N?Sw:xw;return{pages:ae(E.pages,J,ue),pageParams:ae(E.pageParams,R,ue)}};if(s&&u.length){const E=s==="backward",R=E?zw:cv,N={pages:u,pageParams:c},F=R(l,N);d=await w(N,F,E)}else{const E=e??u.length;do{const R=m===0?c[0]??l.initialPageParam:cv(l,d);if(m>0&&R==null)break;d=await w(d,R),m++}while(ma.options.persister?.(p,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=p}}}function cv(e,{pages:a,pageParams:i}){const l=a.length-1;return a.length>0?e.getNextPageParam(a[l],a,i[l],i):void 0}function zw(e,{pages:a,pageParams:i}){return a.length>0?e.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var Cw=class extends I0{#e;#t;#n;#a;#i;#r;#o;#l;constructor(e){super(),this.#l=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#a=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=dv(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=dv(this.options);a.data!==void 0&&(this.setState(fv(a.data,a.dataUpdatedAt)),this.#t=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(e,a){const i=nh(this.state.data,e,this.options);return this.#s({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}setState(e){this.#s({type:"setState",state:e})}cancel(e){const a=this.#r?.promise;return this.#r?.cancel(e),a?a.then(vn).catch(vn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>zn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Th||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Nr(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!F0(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(a=>a!==e),this.observers.length||(this.#r&&(this.#l||this.#c()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,a){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const i=new AbortController,l=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#l=!0,i.signal)})},s=()=>{const m=G0(this.options,a),b=(()=>{const g={client:this.#i,queryKey:this.queryKey,meta:this.meta};return l(g),g})();return this.#l=!1,this.options.persister?this.options.persister(m,b,this):m(b)},c=(()=>{const m={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:s};return l(m),m})();(this.#e==="infinite"?Aw(this.options.pages):this.options.behavior)?.onFetch(c,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#s({type:"fetch",meta:c.fetchOptions?.meta}),this.#r=X0({initialPromise:a?.initialPromise,fn:c.fetchFn,onCancel:m=>{m instanceof rh&&m.revert&&this.setState({...this.#n,fetchStatus:"idle"}),i.abort()},onFail:(m,p)=>{this.#s({type:"failed",failureCount:m,error:p})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const m=await this.#r.start();if(m===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(m),this.#a.config.onSuccess?.(m,this),this.#a.config.onSettled?.(m,this.state.error,this),m}catch(m){if(m instanceof rh){if(m.silent)return this.#r.promise;if(m.revert){if(this.state.data===void 0)throw m;return this.state.data}}throw this.#s({type:"error",error:m}),this.#a.config.onError?.(m,this),)DELIM" -R"DELIM(this.#a.config.onSettled?.(this.state.data,m,this),m}finally{this.scheduleGc()}}#s(e){const a=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...J0(i.data,this.options),fetchMeta:e.meta??null};case"success":const l={...i,...fv(e.data,e.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?l:void 0,l;case"error":const s=e.error;return{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=a(this.state),Vt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:e})})}};function J0(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:V0(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function fv(e,a){return{data:e,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function dv(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,i=a!==void 0,l=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var jw=class extends Ho{constructor(e,a){super(),this.options=a,this.#e=e,this.#l=null,this.#o=ah(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#a=void 0;#i;#r;#o;#l;#c;#s;#m;#f;#d;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),hv(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ih(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ih(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const a=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof zn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),a._defaulted&&!eh(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const l=this.hasListeners();l&&mv(this.#t,i,this.options,a)&&this.#h(),this.updateResult(),l&&(this.#t!==i||zn(this.options.enabled,this.#t)!==zn(a.enabled,this.#t)||Nr(this.options.staleTime,this.#t)!==Nr(a.staleTime,this.#t))&&this.#y();const s=this.#g();l&&(this.#t!==i||zn(this.options.enabled,this.#t)!==zn(a.enabled,this.#t)||s!==this.#u)&&this.#v(s)}getOptimisticResult(e){const a=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(a,e);return Mw(this,i)&&(this.#a=i,this.#r=this.options,this.#i=this.#t.state),i}getCurrentResult(){return this.#a}trackResult(e,a){return new Proxy(e,{get:(i,l)=>(this.trackProp(l),a?.(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,l))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=this.#e.defaultQueryOptions(e),i=this.#e.getQueryCache().build(this.#e,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#h(e){this.#w();let a=this.#t.fetch(this.options,e);return e?.throwOnError||(a=a.catch(vn)),a}#y(){this.#x();const e=Nr(this.options.staleTime,this.#t);if(zo.isServer()||this.#a.isStale||!Wd(e))return;const i=F0(this.#a.dataUpdatedAt,e)+1;this.#f=ri.setTimeout(()=>{this.#a.isStale||this.updateResult()},i)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#u=e,!(zo.isServer()||zn(this.options.enabled,this.#t)===!1||!Wd(this.#u)||this.#u===0)&&(this.#d=ri.setInterval(()=>{(this.options.refetchIntervalInBackground||_h.isFocused())&&this.#h()},this.#u))}#b(){this.#y(),this.#v(this.#g())}#x(){this.#f!==void 0&&(ri.clearTimeout(this.#f),this.#f=void 0)}#S(){this.#d!==void 0&&(ri.clearInterval(this.#d),this.#d=void 0)}createResult(e,a){const i=this.#t,l=this.options,s=this.#a,u=this.#i,c=this.#r,m=e!==i?e.state:this.#n,{state:p}=e;let b={...p},g=!1,x;if(a._optimisticResults){const _=this.hasListeners(),D=!_&&hv(e,a),B=_&&mv(e,i,a,l);(D||B)&&(b={...b,...J0(p.data,e.options)}),a._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:w,errorUpdatedAt:E,status:R}=b;x=b.data;let N=!1;if(a.placeholderData!==void 0&&x===void 0&&R==="pending"){let _;s?.isPlaceholderData&&a.placeholderData===c?.placeholderData?(_=s.data,N=!0):_=typeof a.placeholderData=="function"?a.placeholderData(this.#m?.state.data,this.#m):a.placeholderData,_!==void 0&&(R="success",x=nh(s?.data,_,a),g=!0)}if(a.select&&x!==void 0&&!N)if(s&&x===u?.data&&a.select===this.#c)x=this.#s;else try{this.#c=a.select,x=a.select(x),x=nh(s?.data,x,a),this.#s=x,this.#l=null}catch(_){this.#l=_}this.#l&&(w=this.#l,x=this.#s,E=Date.now(),R="error");const F=b.fetchStatus==="fetching",V=R==="pending",J=R==="error",ue=V&&F,ae=x!==void 0,j={status:R,fetchStatus:b.fetchStatus,isPending:V,isSuccess:R==="success",isError:J,isInitialLoading:ue,isLoading:ue,data:x,dataUpdatedAt:b.dataUpdatedAt,error:w,errorUpdatedAt:E,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:b.dataUpdateCount>m.dataUpdateCount||b.errorUpdateCount>m.errorUpdateCount,isFetching:F,isRefetching:F&&!V,isLoadingError:J&&!ae,isPaused:b.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:J&&ae,isStale:Rh(e,a),refetch:this.refetch,promise:this.#o,isEnabled:zn(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const _=j.data!==void 0,D=j.status==="error"&&!_,B=G=>{D?G.reject(j.error):_&&G.resolve(j.data)},Q=()=>{const G=this.#o=j.promise=ah();B(G)},q=this.#o;switch(q.status){case"pending":e.queryHash===i.queryHash&&B(q);break;case"fulfilled":(D||j.data!==q.value)&&Q();break;case"rejected":(!D||j.error!==q.reason)&&Q();break}}return j}updateResult(){const e=this.#a,a=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#r=this.options,this.#i.data!==void 0&&(this.#m=this.#t),eh(a,e))return;this.#a=a;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:l}=this.options,s=typeof l=="function"?l():l;if(s==="all"||!s&&!this.#p.size)return!0;const u=new Set(s??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#a).some(c=>{const d=c;return this.#a[d]!==e[d]&&u.has(d)})};this.#_({listeners:i()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const a=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(a?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){Vt.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#a)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Nw(e,a){return zn(a.enabled,)DELIM" -R"DELIM(e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&zn(a.retryOnMount,e)===!1)}function hv(e,a){return Nw(e,a)||e.state.data!==void 0&&ih(e,a,a.refetchOnMount)}function ih(e,a,i){if(zn(a.enabled,e)!==!1&&Nr(a.staleTime,e)!=="static"){const l=typeof i=="function"?i(e):i;return l==="always"||l!==!1&&Rh(e,a)}return!1}function mv(e,a,i,l){return(e!==a||zn(l.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&Rh(e,i)}function Rh(e,a){return zn(a.enabled,e)!==!1&&e.isStaleByTime(Nr(a.staleTime,e))}function Mw(e,a){return!eh(e.getCurrentResult(),a)}var Ow=class extends I0{#e;#t;#n;#a;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||kw(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(a=>a!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){const a=()=>{this.#i({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=X0({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(u,c)=>{this.#i({type:"failed",failureCount:u,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const l=this.state.status==="pending",s=!this.#a.canStart();try{if(l)a();else{this.#i({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,i);const c=await this.options.onMutate?.(e,i);c!==this.state.context&&this.#i({type:"pending",context:c,variables:e,isPaused:s})}const u=await this.#a.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,i),await this.options.onSuccess?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(u,null,e,this.state.context,i),this.#i({type:"success",data:u}),u}catch(u){try{await this.#n.config.onError?.(u,e,this.state.context,this,i)}catch(c){Promise.reject(c)}try{await this.options.onError?.(u,e,this.state.context,i)}catch(c){Promise.reject(c)}try{await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,i)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,u,e,this.state.context,i)}catch(c){Promise.reject(c)}throw this.#i({type:"error",error:u}),u}finally{this.#n.runNext(this)}}#i(e){const a=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=a(this.state),Vt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function kw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Dw=class extends Ho{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,a,i){const l=new Ow({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:i});return this.add(l),l}add(e){this.#e.add(e);const a=fu(e);if(typeof a=="string"){const i=this.#t.get(a);i?i.push(e):this.#t.set(a,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const a=fu(e);if(typeof a=="string"){const i=this.#t.get(a);if(i)if(i.length>1){const l=i.indexOf(e);l!==-1&&i.splice(l,1)}else i[0]===e&&this.#t.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=fu(e);if(typeof a=="string"){const l=this.#t.get(a)?.find(s=>s.state.status==="pending");return!l||l===e}else return!0}runNext(e){const a=fu(e);return typeof a=="string"?this.#t.get(a)?.find(l=>l!==e&&l.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Vt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const a={exact:!0,...e};return this.getAll().find(i=>ov(a,i))}findAll(e={}){return this.getAll().filter(a=>ov(e,a))}notify(e){Vt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return Vt.batch(()=>Promise.all(e.map(a=>a.continue().catch(vn))))}};function fu(e){return e.options.scope?.id}var Lw=class extends Ho{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,a,i){const l=a.queryKey,s=a.queryHash??Eh(l,a);let u=this.get(s);return u||(u=new Cw({client:e,queryKey:l,queryHash:s,options:e.defaultQueryOptions(a),state:i,defaultOptions:e.getQueryDefaults(l)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=this.#e.get(e.queryHash);a&&(e.destroy(),a===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Vt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const a={exact:!0,...e};return this.getAll().find(i=>lv(a,i))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(i=>lv(e,i)):a}notify(e){Vt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){Vt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Vt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Bw=class{#e;#t;#n;#a;#i;#r;#o;#l;constructor(e={}){this.#e=e.queryCache||new Lw,this.#t=e.mutationCache||new Dw,this.#n=e.defaultOptions||{},this.#a=new Map,this.#i=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=_h.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=Bu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#o?.(),this.#o=void 0,this.#l?.(),this.#l=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state.data}ensureQueryData(e){const a=this.defaultQueryOptions(e),i=this.#e.build(this,a),l=i.state.data;return l===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(Nr(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(l))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:a,state:i})=>{const l=i.data;return[a,l]})}setQueryData(e,a,i){const l=this.defaultQueryOptions({queryKey:e}),u=this.#e.get(l.queryHash)?.state.data,c=gw(a,u);if(c!==void 0)return this.#e.build(this,l).setData(c,{...i,manual:!0})}setQueriesData(e,a,i){return Vt.batch(()=>this.#e.findAll(e).map(({queryKey:l})=>[l,this.setQueryData(l,a,i)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state}removeQueries(e){const a=this.#e;Vt.batch(()=>{a.findAll(e).forEach(i=>{a.remove(i)})})}resetQueries(e,a){const i=this.#e;)DELIM" -R"DELIM(return Vt.batch(()=>(i.findAll(e).forEach(l=>{l.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const i={revert:!0,...a},l=Vt.batch(()=>this.#e.findAll(e).map(s=>s.cancel(i)));return Promise.all(l).then(vn).catch(vn)}invalidateQueries(e,a={}){return Vt.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},a)))}refetchQueries(e,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},l=Vt.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let u=s.fetch(void 0,i);return i.throwOnError||(u=u.catch(vn)),s.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(l).then(vn)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const i=this.#e.build(this,a);return i.isStaleByTime(Nr(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vn).catch(vn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vn).catch(vn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Bu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,a){this.#a.set(Ro(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#a.values()],i={};return a.forEach(l=>{Ao(e,l.queryKey)&&Object.assign(i,l.defaultOptions)}),i}setMutationDefaults(e,a){this.#i.set(Ro(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#i.values()],i={};return a.forEach(l=>{Ao(e,l.mutationKey)&&Object.assign(i,l.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const a={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=Eh(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===Th&&(a.enabled=!1),a}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},W0=T.createContext(void 0),Iu=e=>{const a=T.useContext(W0);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},Uw=({client:e,children:a})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(W0.Provider,{value:e,children:a})),eb=T.createContext(!1),Hw=()=>T.useContext(eb);eb.Provider;function $w(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Zw=T.createContext($w()),qw=()=>T.useContext(Zw),Pw=(e,a,i)=>{const l=i?.state.error&&typeof e.throwOnError=="function"?K0(e.throwOnError,[i.state.error,i]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||l)&&(a.isReset()||(e.retryOnMount=!1))},Qw=e=>{T.useEffect(()=>{e.clearReset()},[e])},Fw=({result:e,errorResetBoundary:a,throwOnError:i,query:l,suspense:s})=>e.isError&&!a.isReset()&&!e.isFetching&&l&&(s&&e.data===void 0||K0(i,[e.error,l])),Yw=e=>{if(e.suspense){const i=s=>s==="static"?s:Math.max(s??1e3,1e3),l=e.staleTime;e.staleTime=typeof l=="function"?(...s)=>i(l(...s)):i(l),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Gw=(e,a)=>e.isLoading&&e.isFetching&&!a,Kw=(e,a)=>e?.suspense&&a.isPending,pv=(e,a,i)=>a.fetchOptimistic(e).catch(()=>{i.clearReset()});function Vw(e,a,i){const l=Hw(),s=qw(),u=Iu(),c=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(c);const d=u.getQueryCache().get(c.queryHash),m=e.subscribed!==!1;c._optimisticResults=l?"isRestoring":m?"optimistic":void 0,Yw(c),Pw(c,s,d),Qw(s);const p=!u.getQueryCache().get(c.queryHash),[b]=T.useState(()=>new a(u,c)),g=b.getOptimisticResult(c),x=!l&&m;if(T.useSyncExternalStore(T.useCallback(w=>{const E=x?b.subscribe(Vt.batchCalls(w)):vn;return b.updateResult(),E},[b,x]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),T.useEffect(()=>{b.setOptions(c)},[c,b]),Kw(c,g))throw pv(c,b,s);if(Fw({result:g,errorResetBoundary:s,throwOnError:c.throwOnError,query:d,suspense:c.suspense}))throw g.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(c,g),c.experimental_prefetchInRender&&!zo.isServer()&&Gw(g,l)&&(p?pv(c,b,s):d?.promise)?.catch(vn).finally(()=>{b.updateResult()}),c.notifyOnChangeProps?g:b.trackResult(g)}function Xw(e,a){return Vw(e,jw)}var yv;function ne(e,a,i){function l(d,m){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),a(d,m);const p=c.prototype,b=Object.keys(p);for(let g=0;gi?.Parent&&d instanceof i.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(c,"name",{value:e}),c}class sl extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class tb extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}(yv=globalThis).__zod_globalConfig??(yv.__zod_globalConfig={});const Ah=globalThis.__zod_globalConfig;function oi(e){return Ah}function nb(e){const a=Object.values(e).filter(l=>typeof l=="number");return Object.entries(e).filter(([l,s])=>a.indexOf(+l)===-1).map(([l,s])=>s)}function lh(e,a){return typeof a=="bigint"?a.toString():a}function zh(e){return{get value(){{const a=e();return Object.defineProperty(this,"value",{value:a}),a}}}}function Ch(e){return e==null}function jh(e){const a=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(a,i)}function Iw(e,a){const i=e/a,l=Math.round(i),s=Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-l){};function Uu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Ww=zh(()=>{if(Ah.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Co(e){if(Uu(e)===!1)return!1;const a=e.constructor;if(a===void 0||typeof a!="function")return!0;const i=a.prototype;return!(Uu(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function rb(e){return Co(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const e_=new Set(["string","number","symbol"]);function Ju(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kr(e,a,i){const l=new e._zod.constr(a??e._zod.def);return(!a||i?.parent)&&(l._zod.parent=e),l}function Ce(e){const a=e;if(!a)return{};if(typeof a=="string")return{error:()=>a};)DELIM" -R"DELIM(if(a?.message!==void 0){if(a?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");a.error=a.message}return delete a.message,typeof a.error=="string"?{...a,error:()=>a.error}:a}function t_(e){return Object.keys(e).filter(a=>e[a]._zod.optin==="optional"&&e[a]._zod.optout==="optional")}const n_={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function a_(e,a){const i=e._zod.def,l=i.checks;if(l&&l.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=Or(e._zod.def,{get shape(){const c={};for(const d in a){if(!(d in i.shape))throw new Error(`Unrecognized key: "${d}"`);a[d]&&(c[d]=i.shape[d])}return ci(this,"shape",c),c},checks:[]});return kr(e,u)}function r_(e,a){const i=e._zod.def,l=i.checks;if(l&&l.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=Or(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const d in a){if(!(d in i.shape))throw new Error(`Unrecognized key: "${d}"`);a[d]&&delete c[d]}return ci(this,"shape",c),c},checks:[]});return kr(e,u)}function i_(e,a){if(!Co(a))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const u=e._zod.def.shape;for(const c in a)if(Object.getOwnPropertyDescriptor(u,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Or(e._zod.def,{get shape(){const u={...e._zod.def.shape,...a};return ci(this,"shape",u),u}});return kr(e,s)}function l_(e,a){if(!Co(a))throw new Error("Invalid input to safeExtend: expected a plain object");const i=Or(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a};return ci(this,"shape",l),l}});return kr(e,i)}function o_(e,a){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const i=Or(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a._zod.def.shape};return ci(this,"shape",l),l},get catchall(){return a._zod.def.catchall},checks:a._zod.def.checks??[]});return kr(e,i)}function s_(e,a,i){const s=a._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const c=Or(a._zod.def,{get shape(){const d=a._zod.def.shape,m={...d};if(i)for(const p in i){if(!(p in d))throw new Error(`Unrecognized key: "${p}"`);i[p]&&(m[p]=e?new e({type:"optional",innerType:d[p]}):d[p])}else for(const p in d)m[p]=e?new e({type:"optional",innerType:d[p]}):d[p];return ci(this,"shape",m),m},checks:[]});return kr(a,c)}function u_(e,a,i){const l=Or(a._zod.def,{get shape(){const s=a._zod.def.shape,u={...s};if(i)for(const c in i){if(!(c in u))throw new Error(`Unrecognized key: "${c}"`);i[c]&&(u[c]=new e({type:"nonoptional",innerType:s[c]}))}else for(const c in s)u[c]=new e({type:"nonoptional",innerType:s[c]});return ci(this,"shape",u),u}});return kr(a,l)}function il(e,a=0){if(e.aborted===!0)return!0;for(let i=a;i{var l;return(l=i).path??(l.path=[]),i.path.unshift(e),i})}function du(e){return typeof e=="string"?e:e?.message}function si(e,a,i){const l=e.message?e.message:du(e.inst?._zod.def?.error?.(e))??du(a?.error?.(e))??du(i.customError?.(e))??du(i.localeError?.(e))??"Invalid input",{inst:s,continue:u,input:c,...d}=e;return d.path??(d.path=[]),d.message=l,a?.reportInput&&(d.input=c),d}function Nh(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function jo(...e){const[a,i,l]=e;return typeof a=="string"?{message:a,code:"custom",input:i,inst:l}:{...a}}const lb=(e,a)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:a,enumerable:!1}),e.message=JSON.stringify(a,lh,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ob=ne("$ZodError",lb),sb=ne("$ZodError",lb,{Parent:Error});function f_(e,a=i=>i.message){const i={},l=[];for(const s of e.issues)s.path.length>0?(i[s.path[0]]=i[s.path[0]]||[],i[s.path[0]].push(a(s))):l.push(a(s));return{formErrors:l,fieldErrors:i}}function d_(e,a=i=>i.message){const i={_errors:[]},l=(s,u=[])=>{for(const c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>l({issues:d},[...u,...c.path]));else if(c.code==="invalid_key")l({issues:c.issues},[...u,...c.path]);else if(c.code==="invalid_element")l({issues:c.issues},[...u,...c.path]);else{const d=[...u,...c.path];if(d.length===0)i._errors.push(a(c));else{let m=i,p=0;for(;p(a,i,l,s)=>{const u=l?{...l,async:!1}:{async:!1},c=a._zod.run({value:i,issues:[]},u);if(c instanceof Promise)throw new sl;if(c.issues.length){const d=new(s?.Err??e)(c.issues.map(m=>si(m,u,oi())));throw ab(d,s?.callee),d}return c.value},Oh=e=>async(a,i,l,s)=>{const u=l?{...l,async:!0}:{async:!0};let c=a._zod.run({value:i,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){const d=new(s?.Err??e)(c.issues.map(m=>si(m,u,oi())));throw ab(d,s?.callee),d}return c.value},Wu=e=>(a,i,l)=>{const s=l?{...l,async:!1}:{async:!1},u=a._zod.run({value:i,issues:[]},s);if(u instanceof Promise)throw new sl;return u.issues.length?{success:!1,error:new(e??ob)(u.issues.map(c=>si(c,s,oi())))}:{success:!0,data:u.value}},h_=Wu(sb),ec=e=>async(a,i,l)=>{const s=l?{...l,async:!0}:{async:!0};let u=a._zod.run({value:i,issues:[]},s);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>si(c,s,oi())))}:{success:!0,data:u.value}},m_=ec(sb),p_=e=>(a,i,l)=>{const s=l?{...l,direction:"backward"}:{direction:"backward"};return Mh(e)(a,i,s)},y_=e=>(a,i,l)=>Mh(e)(a,i,l),g_=e=>async(a,i,l)=>{const s=l?{...l,direction:"backward"}:{direction:"backward"};return Oh(e)(a,i,s)},v_=e=>async(a,i,l)=>Oh(e)(a,i,l),b_=e=>(a,i,l)=>{const s=l?{...l,direction:"backward"}:{direction:"backward"};return Wu(e)(a,i,s)},x_=e=>(a,i,l)=>Wu(e)(a,i,l),S_=e=>async(a,i,l)=>{const s=l?{...l,direction:"backward"}:{direction:"backward"};return ec(e)(a,i,s)},w_=e=>async(a,i,l)=>ec(e)(a,i,l),__=/^[cC][0-9a-z]{6,}$/,E_=/^[0-9a-z]+$/,T_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,R_=/^[0-9a-vA-V]{20}$/,A_=/^[A-Za-z0-9]{27}$/,z_=/^[a-zA-Z0-9_-]{21}$/,C_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,j_=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,bv=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,N_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,M_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function O_(){return new RegExp(M_,"u")}const k_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,D_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,L_=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3})DELIM" -R"DELIM((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,B_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,U_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ub=/^[A-Za-z0-9_-]*$/,H_=/^https?$/,$_=/^\+[1-9]\d{6,14}$/,cb="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Z_=new RegExp(`^${cb}$`);function fb(e){const a="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${a}`:e.precision===0?`${a}:[0-5]\\d`:`${a}:[0-5]\\d\\.\\d{${e.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function q_(e){return new RegExp(`^${fb(e)}$`)}function P_(e){const a=fb({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const l=`${a}(?:${i.join("|")})`;return new RegExp(`^${cb}T(?:${l})$`)}const Q_=e=>{const a=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},F_=/^-?\d+$/,Y_=/^-?\d+(?:\.\d+)?$/,G_=/^(?:true|false)$/i,K_=/^[^A-Z]*$/,V_=/^[^a-z]*$/,bn=ne("$ZodCheck",(e,a)=>{var i;e._zod??(e._zod={}),e._zod.def=a,(i=e._zod).onattach??(i.onattach=[])}),db={number:"number",bigint:"bigint",object:"date"},hb=ne("$ZodCheckLessThan",(e,a)=>{bn.init(e,a);const i=db[typeof a.value];e._zod.onattach.push(l=>{const s=l._zod.bag,u=(a.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value{(a.inclusive?l.value<=a.value:l.value{bn.init(e,a);const i=db[typeof a.value];e._zod.onattach.push(l=>{const s=l._zod.bag,u=(a.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;a.value>u&&(a.inclusive?s.minimum=a.value:s.exclusiveMinimum=a.value)}),e._zod.check=l=>{(a.inclusive?l.value>=a.value:l.value>a.value)||l.issues.push({origin:i,code:"too_small",minimum:typeof a.value=="object"?a.value.getTime():a.value,input:l.value,inclusive:a.inclusive,inst:e,continue:!a.abort})}}),X_=ne("$ZodCheckMultipleOf",(e,a)=>{bn.init(e,a),e._zod.onattach.push(i=>{var l;(l=i._zod.bag).multipleOf??(l.multipleOf=a.value)}),e._zod.check=i=>{if(typeof i.value!=typeof a.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%a.value===BigInt(0):Iw(i.value,a.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:a.value,input:i.value,inst:e,continue:!a.abort})}}),I_=ne("$ZodCheckNumberFormat",(e,a)=>{bn.init(e,a),a.format=a.format||"float64";const i=a.format?.includes("int"),l=i?"int":"number",[s,u]=n_[a.format];e._zod.onattach.push(c=>{const d=c._zod.bag;d.format=a.format,d.minimum=s,d.maximum=u,i&&(d.pattern=F_)}),e._zod.check=c=>{const d=c.value;if(i){if(!Number.isInteger(d)){c.issues.push({expected:l,format:a.format,code:"invalid_type",continue:!1,input:d,inst:e});return}if(!Number.isSafeInteger(d)){d>0?c.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!a.abort}):c.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!a.abort});return}}du&&c.issues.push({origin:"number",input:d,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!a.abort})}}),J_=ne("$ZodCheckMaxLength",(e,a)=>{var i;bn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!Ch(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum{const s=l.value;if(s.length<=a.maximum)return;const c=Nh(s);l.issues.push({origin:c,code:"too_big",maximum:a.maximum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),W_=ne("$ZodCheckMinLength",(e,a)=>{var i;bn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!Ch(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>s&&(l._zod.bag.minimum=a.minimum)}),e._zod.check=l=>{const s=l.value;if(s.length>=a.minimum)return;const c=Nh(s);l.issues.push({origin:c,code:"too_small",minimum:a.minimum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),e2=ne("$ZodCheckLengthEquals",(e,a)=>{var i;bn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!Ch(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag;s.minimum=a.length,s.maximum=a.length,s.length=a.length}),e._zod.check=l=>{const s=l.value,u=s.length;if(u===a.length)return;const c=Nh(s),d=u>a.length;l.issues.push({origin:c,...d?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:l.value,inst:e,continue:!a.abort})}}),tc=ne("$ZodCheckStringFormat",(e,a)=>{var i,l;bn.init(e,a),e._zod.onattach.push(s=>{const u=s._zod.bag;u.format=a.format,a.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(a.pattern))}),a.pattern?(i=e._zod).check??(i.check=s=>{a.pattern.lastIndex=0,!a.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:a.format,input:s.value,...a.pattern?{pattern:a.pattern.toString()}:{},inst:e,continue:!a.abort})}):(l=e._zod).check??(l.check=()=>{})}),t2=ne("$ZodCheckRegex",(e,a)=>{tc.init(e,a),e._zod.check=i=>{a.pattern.lastIndex=0,!a.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:a.pattern.toString(),inst:e,continue:!a.abort})}}),n2=ne("$ZodCheckLowerCase",(e,a)=>{a.pattern??(a.pattern=K_),tc.init(e,a)}),a2=ne("$ZodCheckUpperCase",(e,a)=>{a.pattern??(a.pattern=V_),tc.init(e,a)}),r2=ne("$ZodCheckIncludes",(e,a)=>{bn.init(e,a);const i=Ju(a.includes),l=new RegExp(typeof a.position=="number"?`^.{${a.position}}${i}`:i);a.pattern=l,e._zod.onattach.push(s=>{const u=s._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(l)}),e._zod.check=s=>{s.value.includes(a.includes,a.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:a.includes,input:s.value,inst:e,continue:!a.abort})}}),i2=ne("$ZodCheckStartsWith",(e,a)=>{bn.init(e,a);const i=new RegExp(`^${Ju(a.prefix)}.*`);a.pattern??(a.pattern=i),e._zod.onattach.push(l=>{const s=l._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=l=>{l.value.startsWith(a.prefix)||l.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:l.value,inst:e,continue:!a.abort})}}),l2=ne("$ZodCheckEndsWith",(e,a)=>{bn.init(e,a);const i=new RegExp(`.*${Ju(a.suffix)}$`);a.pattern??(a.pattern=i),e._zod.onattach.push(l=>{const s=l._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=l=>{l.value.endsWith(a.suffix)||l.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:l.value,inst:e,continue:!a.abort})}}),o2=ne("$ZodCheckOverwrite",(e,a)=>{bn.init(e,a),e._zod.check=i=>{i.value=a.tx(i.value)}});class s2{constructor(a=[]){this.content=[],this.indent=0,this&&(this.args=a)}indented(a){this.indent+=1,a(this),this.indent-=1}write(a){if(typeof a=="function"){a(this,{execution:"sync"}),a(this,{execution:"async"});return}const l=a.split(` -`).filter(c=>c),s=Math.min(...l.map(c=>c.length-c.trimStart().length)),u=l.map(c=>c.slice(s)).map(c=>" ".repeat(this.indent*2)+c);for(const c of u)this.content.push(c)}compile(){const a=Function,i=this?.args,s=[...(this?.content??[""]).map(u=>` ${u}`)];return new a(...i,)DELIM" -R"DELIM(s.join(` -`))}}const u2={major:4,minor:4,patch:3},jt=ne("$ZodType",(e,a)=>{var i;e??(e={}),e._zod.def=a,e._zod.bag=e._zod.bag||{},e._zod.version=u2;const l=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&l.unshift(e);for(const s of l)for(const u of s._zod.onattach)u(e);if(l.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(c,d,m)=>{let p=il(c),b;for(const g of d){if(g._zod.def.when){if(c_(c)||!g._zod.def.when(c))continue}else if(p)continue;const x=c.issues.length,w=g._zod.check(c);if(w instanceof Promise&&m?.async===!1)throw new sl;if(b||w instanceof Promise)b=(b??Promise.resolve()).then(async()=>{await w,c.issues.length!==x&&(p||(p=il(c,x)))});else{if(c.issues.length===x)continue;p||(p=il(c,x))}}return b?b.then(()=>c):c},u=(c,d,m)=>{if(il(c))return c.aborted=!0,c;const p=s(d,l,m);if(p instanceof Promise){if(m.async===!1)throw new sl;return p.then(b=>e._zod.parse(b,m))}return e._zod.parse(p,m)};e._zod.run=(c,d)=>{if(d.skipChecks)return e._zod.parse(c,d);if(d.direction==="backward"){const p=e._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return p instanceof Promise?p.then(b=>u(b,c,d)):u(p,c,d)}const m=e._zod.parse(c,d);if(m instanceof Promise){if(d.async===!1)throw new sl;return m.then(p=>s(p,l,d))}return s(m,l,d)}}dt(e,"~standard",()=>({validate:s=>{try{const u=h_(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return m_(e,s).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},vendor:"zod",version:1}))}),kh=ne("$ZodString",(e,a)=>{jt.init(e,a),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Q_(e._zod.bag),e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),xt=ne("$ZodStringFormat",(e,a)=>{tc.init(e,a),kh.init(e,a)}),c2=ne("$ZodGUID",(e,a)=>{a.pattern??(a.pattern=j_),xt.init(e,a)}),f2=ne("$ZodUUID",(e,a)=>{if(a.version){const l={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(l===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=bv(l))}else a.pattern??(a.pattern=bv());xt.init(e,a)}),d2=ne("$ZodEmail",(e,a)=>{a.pattern??(a.pattern=N_),xt.init(e,a)}),h2=ne("$ZodURL",(e,a)=>{xt.init(e,a),e._zod.check=i=>{try{const l=i.value.trim();if(!a.normalize&&a.protocol?.source===H_.source&&!/^https?:\/\//i.test(l)){i.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:i.value,inst:e,continue:!a.abort});return}const s=new URL(l);a.hostname&&(a.hostname.lastIndex=0,a.hostname.test(s.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:a.hostname.source,input:i.value,inst:e,continue:!a.abort})),a.protocol&&(a.protocol.lastIndex=0,a.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:a.protocol.source,input:i.value,inst:e,continue:!a.abort})),a.normalize?i.value=s.href:i.value=l;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!a.abort})}}}),m2=ne("$ZodEmoji",(e,a)=>{a.pattern??(a.pattern=O_()),xt.init(e,a)}),p2=ne("$ZodNanoID",(e,a)=>{a.pattern??(a.pattern=z_),xt.init(e,a)}),y2=ne("$ZodCUID",(e,a)=>{a.pattern??(a.pattern=__),xt.init(e,a)}),g2=ne("$ZodCUID2",(e,a)=>{a.pattern??(a.pattern=E_),xt.init(e,a)}),v2=ne("$ZodULID",(e,a)=>{a.pattern??(a.pattern=T_),xt.init(e,a)}),b2=ne("$ZodXID",(e,a)=>{a.pattern??(a.pattern=R_),xt.init(e,a)}),x2=ne("$ZodKSUID",(e,a)=>{a.pattern??(a.pattern=A_),xt.init(e,a)}),S2=ne("$ZodISODateTime",(e,a)=>{a.pattern??(a.pattern=P_(a)),xt.init(e,a)}),w2=ne("$ZodISODate",(e,a)=>{a.pattern??(a.pattern=Z_),xt.init(e,a)}),_2=ne("$ZodISOTime",(e,a)=>{a.pattern??(a.pattern=q_(a)),xt.init(e,a)}),E2=ne("$ZodISODuration",(e,a)=>{a.pattern??(a.pattern=C_),xt.init(e,a)}),T2=ne("$ZodIPv4",(e,a)=>{a.pattern??(a.pattern=k_),xt.init(e,a),e._zod.bag.format="ipv4"}),R2=ne("$ZodIPv6",(e,a)=>{a.pattern??(a.pattern=D_),xt.init(e,a),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!a.abort})}}}),A2=ne("$ZodCIDRv4",(e,a)=>{a.pattern??(a.pattern=L_),xt.init(e,a)}),z2=ne("$ZodCIDRv6",(e,a)=>{a.pattern??(a.pattern=B_),xt.init(e,a),e._zod.check=i=>{const l=i.value.split("/");try{if(l.length!==2)throw new Error;const[s,u]=l;if(!u)throw new Error;const c=Number(u);if(`${c}`!==u)throw new Error;if(c<0||c>128)throw new Error;new URL(`http://[${s}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!a.abort})}}});function pb(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const C2=ne("$ZodBase64",(e,a)=>{a.pattern??(a.pattern=U_),xt.init(e,a),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{pb(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!a.abort})}});function j2(e){if(!ub.test(e))return!1;const a=e.replace(/[-_]/g,l=>l==="-"?"+":"/"),i=a.padEnd(Math.ceil(a.length/4)*4,"=");return pb(i)}const N2=ne("$ZodBase64URL",(e,a)=>{a.pattern??(a.pattern=ub),xt.init(e,a),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{j2(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!a.abort})}}),M2=ne("$ZodE164",(e,a)=>{a.pattern??(a.pattern=$_),xt.init(e,a)});function O2(e,a=null){try{const i=e.split(".");if(i.length!==3)return!1;const[l]=i;if(!l)return!1;const s=JSON.parse(atob(l));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||a&&(!("alg"in s)||s.alg!==a))}catch{return!1}}const k2=ne("$ZodJWT",(e,a)=>{xt.init(e,a),e._zod.check=i=>{O2(i.value,a.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!a.abort})}}),yb=ne("$ZodNumber",(e,a)=>{jt.init(e,a),e._zod.pattern=e._zod.bag.pattern??Y_,e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=Number(i.value)}catch{}const s=i.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return i;const u=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...u?{received:u}:{}}),i}}),D2=ne("$ZodNumberFormat",(e,a)=>{I_.init(e,a),yb.init(e,a)}),L2=ne("$ZodBoolean",(e,a)=>{jt.init(e,a),e._zod.pattern=G_,e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=!!i.value}catch{}const s=i.value;return typeof s=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),i}}),B2=ne("$ZodUnknown",(e,a)=>{jt.init(e,a),e._zod.parse=i=>i}),U2=ne("$ZodNever",(e,a)=>{jt.init(e,a),e._zod.parse=(i,l)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function xv(e,a,i){e.issues.length&&a.issues.push(...ib(i,e.issues)),a.value[i]=e.value}const H2=ne("$ZodArray",(e,a)=>{jt.init(e,a),e._zod.parse=(i,l)=>{const s=i.value;if(!Array.isArray(s))return i.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),i;i.value=Array(s.length);const u=[];for(let c=0;cxv(p,i,c))):xv(m,i,c)}return u.length?Promise.all(u).then(()=>i):i}});function Hu(e,a,i,l,s,u){const c=i in l;if(e.issues.length){if(s&&u&&!c)return;a.issues.push(...ib(i,e.issues))}if(!c&&!s){e.issues.length||a.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[i]});return}e.value===void 0?c&&(a.value[i]=void 0):a.value[i]=e.value}function gb(e){const a=Object.keys(e.shape);for(const l of a)if(!e.shape?.[l]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const i=t_(e.shape);return{...e,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(i)}}function vb(e,a,i,l,s,u){const c=[],d=s.keySet,m=s.catchall._zod,p=m.def.type,)DELIM" -R"DELIM(b=m.optin==="optional",g=m.optout==="optional";for(const x in a){if(x==="__proto__"||d.has(x))continue;if(p==="never"){c.push(x);continue}const w=m.run({value:a[x],issues:[]},l);w instanceof Promise?e.push(w.then(E=>Hu(E,i,x,a,b,g))):Hu(w,i,x,a,b,g)}return c.length&&i.issues.push({code:"unrecognized_keys",keys:c,input:a,inst:u}),e.length?Promise.all(e).then(()=>i):i}const $2=ne("$ZodObject",(e,a)=>{if(jt.init(e,a),!Object.getOwnPropertyDescriptor(a,"shape")?.get){const d=a.shape;Object.defineProperty(a,"shape",{get:()=>{const m={...d};return Object.defineProperty(a,"shape",{value:m}),m}})}const l=zh(()=>gb(a));dt(e._zod,"propValues",()=>{const d=a.shape,m={};for(const p in d){const b=d[p]._zod;if(b.values){m[p]??(m[p]=new Set);for(const g of b.values)m[p].add(g)}}return m});const s=Uu,u=a.catchall;let c;e._zod.parse=(d,m)=>{c??(c=l.value);const p=d.value;if(!s(p))return d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d;d.value={};const b=[],g=c.shape;for(const x of c.keys){const w=g[x],E=w._zod.optin==="optional",R=w._zod.optout==="optional",N=w._zod.run({value:p[x],issues:[]},m);N instanceof Promise?b.push(N.then(F=>Hu(F,d,x,p,E,R))):Hu(N,d,x,p,E,R)}return u?vb(b,p,d,m,l.value,e):b.length?Promise.all(b).then(()=>d):d}}),Z2=ne("$ZodObjectJIT",(e,a)=>{$2.init(e,a);const i=e._zod.parse,l=zh(()=>gb(a)),s=x=>{const w=new s2(["shape","payload","ctx"]),E=l.value,R=J=>{const ue=vv(J);return`shape[${ue}]._zod.run({ value: input[${ue}], issues: [] }, ctx)`};w.write("const input = payload.value;");const N=Object.create(null);let F=0;for(const J of E.keys)N[J]=`key_${F++}`;w.write("const newResult = {};");for(const J of E.keys){const ue=N[J],ae=vv(J),xe=x[J],j=xe?._zod?.optin==="optional",_=xe?._zod?.optout==="optional";w.write(`const ${ue} = ${R(J)};`),j&&_?w.write(` - if (${ue}.issues.length) { - if (${ae} in input) { - payload.issues = payload.issues.concat(${ue}.issues.map(iss => ({ +`+o.stack}}var Xe=Object.prototype.hasOwnProperty,pt=e.unstable_scheduleCallback,It=e.unstable_cancelCallback,xn=e.unstable_shouldYield,Xa=e.unstable_requestPaint,qt=e.unstable_now,Wn=e.unstable_getCurrentPriorityLevel,cn=e.unstable_ImmediatePriority,_a=e.unstable_UserBlockingPriority,Dn=e.unstable_NormalPriority,Sn=e.unstable_LowPriority,Ln=e.unstable_IdlePriority,uc=e.log,cc=e.unstable_setDisableYieldValue,Ea=null,nn=null;function $t(t){if(typeof uc=="function"&&cc(t),nn&&typeof nn.setStrictMode=="function")try{nn.setStrictMode(Ea,t)}catch{}}var Jt=Math.clz32?Math.clz32:fc,Jo=Math.l)DELIM" +R"DELIM(og,Wo=Math.LN2;function fc(t){return t>>>=0,t===0?32:31-(Jo(t)/Wo|0)|0}var Ur=256,Ta=262144,Hr=4194304;function ea(t){var n=t&42;if(n!==0)return n;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function pi(t,n,r){var o=t.pendingLanes;if(o===0)return 0;var f=0,h=t.suspendedLanes,g=t.pingedLanes;t=t.warmLanes;var S=o&134217727;return S!==0?(o=S&~h,o!==0?f=ea(o):(g&=S,g!==0?f=ea(g):r||(r=S&~t,r!==0&&(f=ea(r))))):(S=o&~h,S!==0?f=ea(S):g!==0?f=ea(g):r||(r=o&~t,r!==0&&(f=ea(r)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,r=n&-n,h>=r||h===32&&(r&4194048)!==0)?n:f}function Ia(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function dc(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bl(){var t=Hr;return Hr<<=1,(Hr&62914560)===0&&(Hr=4194304),t}function Ja(t){for(var n=[],r=0;31>r;r++)n.push(t);return n}function fa(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function es(t,n,r,o,f,h){var g=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var S=t.entanglements,A=t.expirationTimes,Z=t.hiddenUpdates;for(r=g&~r;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var za=/[\n"\\]/g;function rn(t){return t.replace(za,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function xl(t,n,r,o,f,h,g,S){t.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?t.type=g:t.removeAttribute("type"),n!=null?g==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+ht(n)):t.value!==""+ht(n)&&(t.value=""+ht(n)):g!=="submit"&&g!=="reset"||t.removeAttribute("value"),n!=null?hc(t,g,ht(n)):r!=null?hc(t,g,ht(r)):o!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.name=""+ht(S):t.removeAttribute("name")}function ym(t,n,r,o,f,h,g,S){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),n!=null||r!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){vi(t);return}r=r!=null?""+ht(r):"",n=n!=null?""+ht(n):r,S||n===t.value||(t.value=n),t.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=S?t.checked:!!o,t.defaultChecked=!!o,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.name=g),vi(t)}function hc(t,n,r){n==="number"&<(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function xi(t,n,r,o){if(t=t.options,n){n={};for(var f=0;f"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vc=!1;if(Na)try{var wl={};Object.defineProperty(wl,"passive",{get:function(){vc=!0}}),window.addEventListener("test",wl,wl),window.removeEventListener("test",wl,wl)}catch{vc=!1}var er=null,bc=null,rs=null;function _m(){if(rs)return rs;var t,n=bc,r=n.length,o,f="value"in er?er.value:er.textContent,h=f.length;for(t=0;t=Tl),jm=" ",Nm=!1;function Cm(t,n){switch(t){case"keyup":return j1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ei=!1;function C1(t,n){switch(t){case"compositionend":return Mm(n);case"keypress":return n.which!==32?null:(Nm=!0,jm);case"textInput":return t=n.data,t===jm&&Nm?null:t;default:return null}}function M1(t,n){if(Ei)return t==="compositionend"||!Ec&&Cm(t,n)?(t=_m(),rs=bc=er=null,Ei=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:r,offset:n-t};t=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=$m(r)}}function qm(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?qm(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Pm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=lt(t.document);n instanceof t.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)t=n.contentWindow;else break;n=lt(t.document)}return n}function Ac(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var $1=Na&&"documentMode"in document&&11>=document.documentMode,Ti=null,zc=null,jl=null,jc=!1;function Qm(t,n,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;jc||Ti==null||Ti!==lt(o)||(o=Ti,"selectionStart"in o&&Ac(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),jl&&zl(jl,o)||(jl=o,o=Is(zc,"onSelect"),0>=g,f-=g,da=1<<32-Jt(n)+f|r<$e?(Ge=Te,Te=null):Ge=Te.sibling;var at=F(U,Te,$[$e],J);if(at===null){Te===null&&(Te=Ge);break}t&&Te&&at.alternate===null&&n(U,Te),k=h(at,k,$e),nt===null?Re=at:nt.sibling=at,nt=at,Te=Ge}if($e===$.length)return r(U,Te),Ke&&Ma(U,$e),Re;if(Te===null){for(;$e<$.length;$e++)Te=W(U,$[$e],J),Te!==null&&(k=h(Te,k,$e),nt===null?Re=Te:nt.sibling=Te,nt=Te);return Ke&&Ma(U,$e),Re}for(Te=o(Te);$e<$.length;$e++)Ge=G(Te,U,$e,$[$e],J),Ge!==null&&(t&&Ge.alternate!==null&&Te.delete(Ge.key===null?$e:Ge.key),k=h(Ge,k,$e),nt===null?Re=Ge:nt.sibling=Ge,nt=Ge);return t&&Te.forEach(function(wr){return n(U,wr)}),Ke&&Ma(U,$e),Re}function Me(U,k,$,J){if($==null)throw Error(l(151));for(var Re=null,nt=null,Te=k,$e=k=0,Ge=null,at=$.next();Te!==null&&!at.done;$e++,at=$.next()){Te.index>$e?(Ge=Te,Te=null):Ge=Te.sibling;var wr=F(U,Te,at.value,J);if(wr===null){Te===null&&(Te=Ge);break}t&&Te&&wr.alternate===null&&n(U,Te),k=h(wr,k,$e),nt===null?Re=wr:nt.sibling=wr,nt=wr,Te=Ge}if(at.done)return r(U,Te),Ke&&Ma(U,$e),Re;if(Te===null){for(;!at.done;$e++,at=$.next())at=W(U,at.value,J),at!==null&&(k=h(at,k,$e),nt===null?Re=at:nt.sibling=at,nt=at);return Ke&&Ma(U,$e),Re}for(Te=o(Te);!at.done;$e++,at=$.next())at=G(Te,U,$e,at.value,J),at!==null&&(t&&at.alternate!==null&&Te.delete(at.key===null?$e:at.key),k=h(at,k,$e),nt===null?Re=at:nt.sibling=at,nt=at);return t&&Te.forEach(function(lw){return n(U,lw)}),Ke&&Ma(U,$e),Re}function ft(U,k,$,J){if(typeof $=="object"&&$!==null&&$.type===R&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case w:e:{for(var Re=$.key;k!==null;){if(k.key===Re){if(Re=$.type,Re===R){if(k.tag===7){r(U,k.sibling),J=f(k,$.props.children),J.return=U,U=J;break e}}else if(k.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===_&&Vr(Re)===k.type){r(U,k.sibling),J=f(k,$.props),Dl(J,$),J.return=U,U=J;break e}r(U,k);break}else n(U,k);k=k.sibling}$.type===R?(J=Qr($.props.children,U.mode,J,$.key),J.return=U,U=J):(J=ms($.type,$.key,$.props,null,U.mode,J),Dl(J,$),J.return=U,U=J)}return g(U);case E:e:{for(Re=$.key;k!==null;){if(k.key===Re)if(k.tag===4&&k.stateNode.containerInfo===$.containerInfo&&k.stateNode.implementation===$.implementation){r(U,k.sibling),J=f(k,$.children||[]),J.return=U,U=J;break e}else{r(U,k);break}else n(U,k);k=k.sibling}J=Lc($,U.mode,J),J.return=U,U=J}return g(U);case _:return $=Vr($),ft(U,k,$,J)}if(pe($))return _e(U,k,$,J);if(P($)){if(Re=P($),typeof Re!="function")throw Error(l(150));return $=Re.call($),Me(U,k,$,J)}if(typeof $.then=="function")return ft(U,k,Ss($),J);if($.$$typeof===I)return ft(U,k,gs(U,$),J);ws(U,$)}return typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint"?($=""+$,k!==null&&k.tag===6?(r(U,k.sibling),J=f(k,$),J.return=U,U=J):(r(U,k),J=Dc($,U.mode,J),J.return=U,U=J),g(U)):r(U,k)}return function(U,k,$,J){try{kl=0;var Re=ft(U,k,$,J);return Li=null,Re}catch(Te){if(Te===Di||Te===bs)throw Te;var nt=En(29,Te,null,U.mode);return nt.lanes=J,nt.return=U,nt}}}var Ir=hp(!0),mp=hp(!1),ir=!1;function Kc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vc(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function lr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function or(t,n,r){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(rt&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=hs(t),Im(t,null,r),n}return ds(t,o,n,r),hs(t)}function Ll(t,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,ns(t,r)}}function Xc(t,n){var r=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var f=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var g={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};h===null?f=h=g:h=h.next=g,r=r.next}while(r!==null);h===null?f=h=n:h=h.next=n}else f=h=n;r={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=n:t.next=n,r.lastBaseUpdate=n}var Ic=!1;function Bl(){if(Ic){var t=ki;if(t!==null)throw t}}function Ul(t,n,r,o){Ic=!1;var f=t.updateQueue;ir=!1;var h=f.firstBaseUpdate,g=f.lastBaseUpdate,S=f.shared.pending;if(S!==null){f.shared.pending=null;var A=S,Z=A.next;A.next=null,g===null?h=Z:g.next=Z,g=A;var X=t.alternate;X!==null&&(X=X.updateQueue,S=X.lastBaseUpdate,S!==g&&(S===null?X.firstBaseUpdate=Z:S.next=Z,X.lastBaseUpdate=A))}if(h!==null){var W=f.baseState;g=0,X=Z=A=null,S=h;do{var F=S.lane&-536870913,G=F!==S.lane;if(G?(Ye&F)===F:(o&F)===F){F!==0&&F===Oi&&(Ic=!0),X!==null&&(X=X.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var _e=t,Me=S;F=n;var ft=r;switch(Me.tag){case 1:if(_e=Me.payload,typeof _e=="function"){W=_e.call(ft,W,F);break e}W=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=Me.payload,F=typeof _e=="function"?_e.call(ft,W,F):_e,F==null)break e;W=v({},W,F);break e;case 2:ir=!0}}F=S.callback,F!==null&&(t.flags|=64,G&&(t.flags|=8192),G=f.callbacks,G===null?f.callbacks=[F]:G.push(F))}else G={lane:F,tag:S.tag,payload:S.payload,callback:S.callback,next:null},X===null?(Z=X=G,A=W):X=X.next=G,g|=F;if(S=S.next,S===null){if(S=f.shared.pending,S===null)break;G=S,S=G.next,G.next=null,f.lastBaseUpdate=G,f.shared.pending=null}}while(!0);X===null&&(A=W),f.baseState=A,f.firstBaseUpdate=Z,f.lastBaseUpdate=X,h===null&&(f.shared.lanes=0),dr|=g,t.lanes=g,t.memoizedState=W}}function pp(t,n){if(typeof t!="function")throw Error(l(191,t));t.call(n)}function yp(t,n){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;th?h:8;var g=M.T,S={};M.T=S,gf(t,!1,n,r);try{var A=f(),Z=M.S;if(Z!==null&&Z(S,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var X=V1(A,o);Zl(t,n,X,jn(t))}else Zl(t,n,o,jn(t))}catch(W){Zl(t,n,{then:function(){},status:"rejected",reason:W},jn())}finally{O.p=h,g!==null&&S.types!==null&&(g.types=S.types),M.T=g}}function tS(){}function pf(t,n,r,o){if(t.tag!==5)throw Error(l(476));var f=Kp(t).queue;Gp(t,f,n,le,r===null?tS:function(){return Vp(t),r(o)})}function Kp(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:le},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:r},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function Vp(t){var n=Kp(t);n.next===null&&(n=t.alternate.memoizedState),Zl(t,n.next.queue,{},jn())}function yf(){return Qt(ro)}function Xp(){return jt().memoizedState}function Ip(){return jt().memoizedState}function nS(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var r=jn();t=lr(r);var o=or(n,t,r);o!==null&&(gn(o,n,r),Ll(o,n,r)),n={cache:Qc()},t.payload=n;return}n=n.return}}function aS(t,n,r){var o=jn();r={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(t)?Wp(n,r):(r=Oc(t,n,r,o),r!==null&&(gn(r,t,o),ey(r,n,o)))}function Jp(t,n,r){var o=jn();Zl(t,n,r,o)}function Zl(t,n,r,o){var f={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Ms(t))Wp(n,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var g=n.lastRenderedState,S=h(g,r);if(f.hasEagerState=!0,f.eagerState=S,_n(S,g))return ds(t,n,f,0),mt===null&&fs(),!1}catch{}if(r=Oc(t,n,f,o),r!==null)return gn(r,t,o),ey(r,n,o),!0}return!1}function gf(t,n,r,o){if(o={lane:2,revertLane:Vf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Ms(t)){if(n)throw Error(l(479))}else n=Oc(t,r,o,2),n!==null&&gn(n,t,2)}function Ms(t){var n=t.alternate;return t===He||n!==null&&n===He}function Wp(t,n){Ui=Ts=!0;var r=t.pending;r===null?n.next=n:(n.next=r.next,r.next=n),t.pending=n}function ey(t,n,r){if((r&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,ns(t,r)}}var ql={readContext:Qt,use:zs,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};ql.useEffectEvent=Et;var ty={readContext:Qt,use:zs,useCallback:function(t,n){return ln().memoizedState=[t,n===void 0?null:n],t},useContext:Qt,useEffect:Up,useImperativeHandle:function(t,n,r){r=r!=null?r.concat([t]):null,Ns(4194308,4,qp.bind(null,n,t),r)},useLayoutEffect:function(t,n){return Ns(4194308,4,t,n)},useInsertionEffect:function(t,n){Ns(4,2,t,n)},useMemo:function(t,n){var r=ln();n=n===void 0?null:n;var o=t();if(Jr){$t(!0);try{t()}finally{$t(!1)}}return r.memoizedState=[o,n],o},useReducer:function(t,n,r){var o=ln();if(r!==void 0){var f=r(n);if(Jr){$t(!0);try{r(n)}finally{$t(!1)}}}else f=n;return o.memoizedState=o.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},o.queue=t,t=t.dispatch=aS.bind(null,He,t),[o.memoizedState,t]},useRef:function(t){var n=ln();return t={current:t},n.memoizedState=t},useState:function(t){t=cf(t);var n=t.queue,r=Jp.bind(null,He,n);return n.dispatch=r,[t.memoizedState,r]},useDebugValue:hf,useDeferredValue:function(t,n){var r=ln();return mf(r,t,n)},useTransition:function(){var t=cf(!1);return t=Gp.bind(null,He,t.queue,!0,!1),ln().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,r){var o=He,f=ln();if(Ke){if(r===void 0)throw Error(l(407));r=r()}else{if(r=n(),mt===null)throw Error(l(349));(Ye&127)!==0||wp(o,n,r)}f.memoizedState=r;var h={value:r,getSnapshot:n};return f.queue=h,Up(Ep.bind(null,o,h,t),[t]),o.flags|=2048,$i(9,{destroy:void 0},_p.bind(null,o,h,r,n),null),r},useId:function(){var t=ln(),n=mt.identifierPrefix;if(Ke){var r=ha,o=da;r=(o&~(1<<32-Jt(o)-1)).toString(32)+r,n="_"+n+"R_"+r,r=Rs++,0<\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?g.createElement("select",{is:o.is}):g.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?g.createElement(f,{is:o.is}):g.createElement(f)}}h[ge]=n,h[be]=o;e:for(g=n.child;g!==null;){if(g.tag===5||g.tag===6)h.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===n)break e;for(;g.sibling===null;){if(g.return===null||g.return===n)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}n.stateNode=h;e:switch(Yt(h,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Ua(n)}}return vt(n),Cf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,r),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&Ua(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(l(166));if(t=ye.current,Ci(n)){if(t=n.stateNode,r=n.memoizedProps,o=null,f=Pt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[ge]=n,t=!!(t.nodeValue===r||o!==null&&o.suppressHydrationWarning===!0||xg(t.nodeValue,r)),t||ar(n,!0)}else t=Js(t).createTextNode(o),t[ge]=n,n.stateNode=t}return vt(n),null;case 31:if(r=n.memoizedState,t===null||t.memoizedState!==null){if(o=Ci(n),r!==null){if(t===null){if(!o)throw Error(l(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[ge]=n}else Fr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vt)DELIM" +R"DELIM((n),t=!1}else r=$c(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return n.flags&256?(Rn(n),n):(Rn(n),null);if((n.flags&128)!==0)throw Error(l(558))}return vt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=Ci(n),o!==null&&o.dehydrated!==null){if(t===null){if(!f)throw Error(l(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(l(317));f[ge]=n}else Fr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vt(n),f=!1}else f=$c(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Rn(n),n):(Rn(n),null)}return Rn(n),(n.flags&128)!==0?(n.lanes=r,n):(r=o!==null,t=t!==null&&t.memoizedState!==null,r&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==f&&(o.flags|=2048)),r!==t&&r&&(n.child.flags|=8192),Bs(n,n.updateQueue),vt(n),null);case 4:return H(),t===null&&Wf(n.stateNode.containerInfo),vt(n),null;case 10:return ka(n.type),vt(n),null;case 19:if(K(zt),o=n.memoizedState,o===null)return vt(n),null;if(f=(n.flags&128)!==0,h=o.rendering,h===null)if(f)Ql(o,!1);else{if(Tt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=Es(t),h!==null){for(n.flags|=128,Ql(o,!1),t=h.updateQueue,n.updateQueue=t,Bs(n,t),n.subtreeFlags=0,t=r,r=n.child;r!==null;)Jm(r,t),r=r.sibling;return ae(zt,zt.current&1|2),Ke&&Ma(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&qt()>qs&&(n.flags|=128,f=!0,Ql(o,!1),n.lanes=4194304)}else{if(!f)if(t=Es(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,Bs(n,t),Ql(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Ke)return vt(n),null}else 2*qt()-o.renderingStartTime>qs&&r!==536870912&&(n.flags|=128,f=!0,Ql(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(t=o.last,t!==null?t.sibling=h:n.child=h,o.last=h)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=qt(),t.sibling=null,r=zt.current,ae(zt,f?r&1|2:r&1),Ke&&Ma(n,o.treeForkCount),t):(vt(n),null);case 22:case 23:return Rn(n),Wc(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(r&536870912)!==0&&(n.flags&128)===0&&(vt(n),n.subtreeFlags&6&&(n.flags|=8192)):vt(n),r=n.updateQueue,r!==null&&Bs(n,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048),t!==null&&K(Kr),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),ka(kt),vt(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function sS(t,n){switch(Uc(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return ka(kt),H(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return he(n),null;case 31:if(n.memoizedState!==null){if(Rn(n),n.alternate===null)throw Error(l(340));Fr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Rn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(l(340));Fr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return K(zt),null;case 4:return H(),null;case 10:return ka(n.type),null;case 22:case 23:return Rn(n),Wc(),t!==null&&K(Kr),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return ka(kt),null;case 25:return null;default:return null}}function Ty(t,n){switch(Uc(n),n.tag){case 3:ka(kt),H();break;case 26:case 27:case 5:he(n);break;case 4:H();break;case 31:n.memoizedState!==null&&Rn(n);break;case 13:Rn(n);break;case 19:K(zt);break;case 10:ka(n.type);break;case 22:case 23:Rn(n),Wc(),t!==null&&K(Kr);break;case 24:ka(kt)}}function Fl(t,n){try{var r=n.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var f=o.next;r=f;do{if((r.tag&t)===t){o=void 0;var h=r.create,g=r.inst;o=h(),g.destroy=o}r=r.next}while(r!==f)}}catch(S){st(n,n.return,S)}}function cr(t,n,r){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var h=f.next;o=h;do{if((o.tag&t)===t){var g=o.inst,S=g.destroy;if(S!==void 0){g.destroy=void 0,f=n;var A=r,Z=S;try{Z()}catch(X){st(f,A,X)}}}o=o.next}while(o!==h)}}catch(X){st(n,n.return,X)}}function Ry(t){var n=t.updateQueue;if(n!==null){var r=t.stateNode;try{yp(n,r)}catch(o){st(t,t.return,o)}}}function Ay(t,n,r){r.props=Wr(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(o){st(t,n,o)}}function Yl(t,n){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof r=="function"?t.refCleanup=r(o):r.current=o}}catch(f){st(t,n,f)}}function ma(t,n){var r=t.ref,o=t.refCleanup;if(r!==null)if(typeof o=="function")try{o()}catch(f){st(t,n,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(f){st(t,n,f)}else r.current=null}function zy(t){var n=t.type,r=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&o.focus();break e;case"img":r.src?o.src=r.src:r.srcSet&&(o.srcset=r.srcSet)}}catch(f){st(t,t.return,f)}}function Mf(t,n,r){try{var o=t.stateNode;NS(o,t.type,r,n),o[be]=n}catch(f){st(t,t.return,f)}}function jy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&gr(t.type)||t.tag===4}function Of(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||jy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&gr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function kf(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(t),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=ja));else if(o!==4&&(o===27&&gr(t.type)&&(r=t.stateNode,n=null),t=t.child,t!==null))for(kf(t,n,r),t=t.sibling;t!==null;)kf(t,n,r),t=t.sibling}function Us(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?r.insertBefore(t,n):r.appendChild(t);else if(o!==4&&(o===27&&gr(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(Us(t,n,r),t=t.sibling;t!==null;)Us(t,n,r),t=t.sibling}function Ny(t){var n=t.stateNode,r=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);Yt(n,o,r),n[ge]=t,n[be]=r}catch(h){st(t,t.return,h)}}var Ha=!1,Bt=!1,Df=!1,Cy=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function uS(t,n){if(t=t.containerInfo,nd=iu,t=Pm(t),Ac(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var f=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var g=0,S=-1,A=-1,Z=0,X=0,W=t,F=null;t:for(;;){for(var G;W!==r||f!==0&&W.nodeType!==3||(S=g+f),W!==h||o!==0&&W.nodeType!==3||(A=g+o),W.nodeType===3&&(g+=W.nodeValue.length),(G=W.firstChild)!==null;)F=W,W=G;for(;;){if(W===t)break t;if(F===r&&++Z===f&&(S=g),F===h&&++X===o&&(A=g),(G=W.nextSibling)!==null)break;W=F,F=W.parentNode}W=G}r=S===-1||A===-1?null:{start:S,end:A}}else r=null}r=r||{start:0,end:0}}else r=null;for(ad={focusedElem:t,selectionRange:r},iu=!1,Zt=n;Zt!==null;)if(n=Zt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Zt=t;else for(;Zt!==null;){switch(n=Zt,h=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(r=0;r title"))),Yt(h,o,r),h[ge]=t,et(h),o=h;break e;case"link":var g=Bg("link","href",f).get(o+(r.href||""));if(g){for(var S=0;Sft&&(g=ft,ft=Me,Me=g);var U=Zm(S,Me),k=Zm(S,ft);if(U&&k&&(G.rangeCount!==1||G.anchorNode!==U.node||G.anchorOffset!==U.offset||G.focusNode!==k.node||G.focusOffset!==k.offset)){var $=W.createRange();$.setStart(U.node,U.offset),G.removeAllRanges(),Me>ft?(G.addRange($),G.extend(k.node,k.offset)):($.setEnd(k.node,k.offset),G.addRange($))}}}}for(W=[],G=S;G=G.parentNode;)G.nodeType===1&&W.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;Sr?32:r,M.T=null,r=qf,qf=null;var h=mr,g=Qa;if(Ht=0,Fi=mr=null,Qa=0,(rt&6)!==0)throw Error(l(331));var S=rt;if(rt|=4,qy(h.current),Hy(h,h.current,g,r),rt=S,Jl(0,!1),nn&&typeof nn.onPostCommitFiberRoot=="function")try{nn.onPostCommitFiberRoot(Ea,h)}catch{}return!0}finally{O.p=f,M.T=o,lg(t,n)}}function sg(t,n,r){n=Hn(r,n),n=Sf(t.stateNode,n,2),t=or(t,n,2),t!==null&&(fa(t,2),pa(t))}function st(t,n,r){if(t.tag===3)sg(t,t,r);else for(;n!==null;){if(n.tag===3){sg(n,t,r);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(hr===null||!hr.has(o))){t=Hn(r,t),r=uy(2),o=or(n,r,2),o!==null&&(cy(r,o,n,t),fa(o,2),pa(o));break}}n=n.return}}function Yf(t,n,r){var o=t.pingCache;if(o===null){o=t.pingCache=new dS;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(r)||(Uf=!0,f.add(r),t=gS.bind(null,t,n,r),n.then(t,t))}function gS(t,n,r){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,mt===t&&(Ye&r)===r&&(Tt===4||Tt===3&&(Ye&62914560)===Ye&&300>qt()-Zs?(rt&2)===0&&Yi(t,0):Hf|=r,Qi===Ye&&(Qi=0)),pa(t)}function ug(t,n){n===0&&(n=bl()),t=Pr(t,n),t!==null&&(fa(t,n),pa(t))}function vS(t){var n=t.memoizedState,r=0;n!==null&&(r=n.retryLane),ug(t,r)}function bS(t,n){var r=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(r=f.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(n),ug(t,r)}function xS(t,n){return pt(t,n)}var Ks=null,Ki=null,Gf=!1,Vs=!1,Kf=!1,yr=0;function pa(t){t!==Ki&&t.next===null&&(Ki===null?Ks=Ki=t:Ki=Ki.next=t),Vs=!0,Gf||(Gf=!0,wS())}function Jl(t,n){if(!Kf&&Vs){Kf=!0;do for(var r=!1,o=Ks;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var h=0;else{var g=o.suspendedLanes,S=o.pingedLanes;h=(1<<31-Jt(42|t)+1)-1,h&=f&~(g&~S),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,hg(o,h))}else h=Ye,h=pi(o,o===mt?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||Ia(o,h)||(r=!0,hg(o,h));o=o.next}while(r);Kf=!1}}function SS(){cg()}function cg(){Vs=Gf=!1;var t=0;yr!==0&&MS()&&(t=yr);for(var n=qt(),r=null,o=Ks;o!==null;){var f=o.next,h=fg(o,n);h===0?(o.next=null,r===null?Ks=f:r.next=f,f===null&&(Ki=r)):(r=o,(t!==0||(h&3)!==0)&&(Vs=!0)),o=f}Ht!==0&&Ht!==5||Jl(t),yr!==0&&(yr=0)}function fg(t,n){for(var r=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0S)break;var X=)DELIM" +R"DELIM(A.transferSize,W=A.initiatorType;X&&Sg(W)&&(A=A.responseEnd,g+=X*(A"u"?null:document;function Og(t,n,r){var o=Vi;if(o&&typeof n=="string"&&n){var f=rn(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof r=="string"&&(f+='[crossorigin="'+r+'"]'),Mg.has(f)||(Mg.add(f),t={rel:t,crossOrigin:r,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),Yt(n,"link",t),et(n),o.head.appendChild(n)))}}function ZS(t){Fa.D(t),Og("dns-prefetch",t,null)}function qS(t,n){Fa.C(t,n),Og("preconnect",t,n)}function PS(t,n,r){Fa.L(t,n,r);var o=Vi;if(o&&t&&n){var f='link[rel="preload"][as="'+rn(n)+'"]';n==="image"&&r&&r.imageSrcSet?(f+='[imagesrcset="'+rn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(f+='[imagesizes="'+rn(r.imageSizes)+'"]')):f+='[href="'+rn(t)+'"]';var h=f;switch(n){case"style":h=Xi(t);break;case"script":h=Ii(t)}Fn.has(h)||(t=v({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:t,as:n},r),Fn.set(h,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(no(h))||n==="script"&&o.querySelector(ao(h))||(n=o.createElement("link"),Yt(n,"link",t),et(n),o.head.appendChild(n)))}}function QS(t,n){Fa.m(t,n);var r=Vi;if(r&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+rn(o)+'"][href="'+rn(t)+'"]',h=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ii(t)}if(!Fn.has(h)&&(t=v({rel:"modulepreload",href:t},n),Fn.set(h,t),r.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(ao(h)))return}o=r.createElement("link"),Yt(o,"link",t),et(o),r.head.appendChild(o)}}}function FS(t,n,r){Fa.S(t,n,r);var o=Vi;if(o&&t){var f=At(o).hoistableStyles,h=Xi(t);n=n||"default";var g=f.get(h);if(!g){var S={loading:0,preload:null};if(g=o.querySelector(no(h)))S.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":n},r),(r=Fn.get(h))&&cd(t,r);var A=g=o.createElement("link");et(A),Yt(A,"link",t),A._p=new Promise(function(Z,X){A.onload=Z,A.onerror=X}),A.addEventListener("load",function(){S.loading|=1}),A.addEventListener("error",function(){S.loading|=2}),S.loading|=4,eu(g,n,o)}g={type:"stylesheet",instance:g,count:1,state:S},f.set(h,g)}}}function YS(t,n){Fa.X(t,n);var r=Vi;i)DELIM" +R"DELIM(f(r&&t){var o=At(r).hoistableScripts,f=Ii(t),h=o.get(f);h||(h=r.querySelector(ao(f)),h||(t=v({src:t,async:!0},n),(n=Fn.get(f))&&fd(t,n),h=r.createElement("script"),et(h),Yt(h,"link",t),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function GS(t,n){Fa.M(t,n);var r=Vi;if(r&&t){var o=At(r).hoistableScripts,f=Ii(t),h=o.get(f);h||(h=r.querySelector(ao(f)),h||(t=v({src:t,async:!0,type:"module"},n),(n=Fn.get(f))&&fd(t,n),h=r.createElement("script"),et(h),Yt(h,"link",t),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function kg(t,n,r,o){var f=(f=ye.current)?Ws(f):null;if(!f)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=Xi(r.href),r=At(f).hoistableStyles,o=r.get(n),o||(o={type:"style",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Xi(r.href);var h=At(f).hoistableStyles,g=h.get(t);if(g||(f=f.ownerDocument||f,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,g),(h=f.querySelector(no(t)))&&!h._p&&(g.instance=h,g.state.loading=5),Fn.has(t)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Fn.set(t,r),h||KS(f,t,r,g.state))),n&&o===null)throw Error(l(528,""));return g}if(n&&o!==null)throw Error(l(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ii(r),r=At(f).hoistableScripts,o=r.get(n),o||(o={type:"script",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function Xi(t){return'href="'+rn(t)+'"'}function no(t){return'link[rel="stylesheet"]['+t+"]"}function Dg(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function KS(t,n,r,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),Yt(n,"link",r),et(n),t.head.appendChild(n))}function Ii(t){return'[src="'+rn(t)+'"]'}function ao(t){return"script[async]"+t}function Lg(t,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+rn(r.href)+'"]');if(o)return n.instance=o,et(o),o;var f=v({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),et(o),Yt(o,"style",f),eu(o,r.precedence,t),n.instance=o;case"stylesheet":f=Xi(r.href);var h=t.querySelector(no(f));if(h)return n.state.loading|=4,n.instance=h,et(h),h;o=Dg(r),(f=Fn.get(f))&&cd(o,f),h=(t.ownerDocument||t).createElement("link"),et(h);var g=h;return g._p=new Promise(function(S,A){g.onload=S,g.onerror=A}),Yt(h,"link",o),n.state.loading|=4,eu(h,r.precedence,t),n.instance=h;case"script":return h=Ii(r.src),(f=t.querySelector(ao(h)))?(n.instance=f,et(f),f):(o=r,(f=Fn.get(h))&&(o=v({},r),fd(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),et(f),Yt(f,"link",o),t.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,eu(o,r.precedence,t));return n.instance}function eu(t,n,r){for(var o=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,h=f,g=0;g title"):null)}function VS(t,n,r){if(r===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Hg(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function XS(t,n,r,o){if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var f=Xi(o.href),h=n.querySelector(no(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=nu.bind(t),n.then(t,t)),r.state.loading|=4,r.instance=h,et(h);return}h=n.ownerDocument||n,o=Dg(o),(f=Fn.get(f))&&cd(o,f),h=h.createElement("link"),et(h);var g=h;g._p=new Promise(function(S,A){g.onload=S,g.onerror=A}),Yt(h,"link",o),r.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(t.count++,r=nu.bind(t),n.addEventListener("load",r),n.addEventListener("error",r))}}var dd=0;function IS(t,n){return t.stylesheets&&t.count===0&&ru(t,t.stylesheets),0dd?50:800)+n);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function nu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ru(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var au=null;function ru(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,au=new Map,n.forEach(JS,t),au=null,nu.call(t))}function JS(t,n){if(!(n.state.loading&4)){var r=au.get(t);if(r)var o=r.get(null);else{r=new Map,au.set(t,r);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),Sd.exports=pw(),Sd.exports}var gw=yw();const vw=wh(gw);var Ho=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},bw=class extends Ho{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const a=()=>e();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(a=>{a(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Eh=new bw,xw={setTimeout:(e,a)=>setTimeout(e,a),clearTimeout:e=>clearTimeout(e),setInterval:(e,a)=>setInterval(e,a),clearInterval:e=>clearInterval(e)},Sw=class{#e=xw;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,a){return this.#e.setTimeout(e,a)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,a){return this.#e.setInterval(e,a)}clearInterval(e){this.#e.clearInterval(e)}},ii=new Sw;function ww(e){setTimeout(e,0)}var _w=typeof window>"u"||"Deno"in globalThis;function vn(){}function Ew(e,a){return typeof e=="function"?e(a):e}function eh(e){return typeof e=="number"&&e>=0&&e!==1/0}function K0(e,a){return Math.max(e+(a||0)-Date.now(),0)}function Or(e,a){return typeof e=="function"?e(a):e}function Nn(e,a){return typeof e=="function"?e(a):e}function uv(e,a){const{type:i="all",exact:l,fetchStatus:s,predicate:u,queryKey:c,stale:d}=e;if(c){if(l){if(a.queryHash!==Th(c,a.options))return!1}else if(!zo(a.queryKey,c))return!1}if(i!=="all"){const m=a.isActive();if(i==="active"&&!m||i==="inactive"&&m)return!1}return!(typeof d=="boolean"&&a.isStale()!==d||s&&s!==a.state.fetchStatus||u&&!u(a))}function cv(e,a){const{exact:i,status:l,predicate:s,mutationKey:u}=e;if(u){if(!a.options.mutationKey)return!1;if(i){if(Ao(a.options.mutationKey)!==Ao(u))return!1}else if(!zo(a.options.mutationKey,u))return!1}return!(l&&a.state.status!==l||s&&!s(a))}function Th(e,a){return(a?.queryKeyHashFn||Ao)(e)}function Ao(e){return JSON.stringify(e,(a,i)=>nh(i)?Object.keys(i).sort().reduce((l,s)=>(l[s]=i[s],l),{}):i)}function zo(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(i=>zo(e[i],a[i])):!1}var Tw=Object.prototype.hasOwnProperty;function V0(e,a,i=0){if(e===a)return e;if(i>500)return a;const l=fv(e)&&fv(a);if(!l&&!(nh(e)&&nh(a)))return a;const u=(l?e:Object.keys(e)).length,c=l?a:Object.keys(a),d=c.length,m=l?new Array(d):{};let p=0;for(let b=0;b{ii.setTimeout(a,e)})}function ah(e,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,a):i.structuralSharing!==!1?V0(e,a):a}function Aw(e,a,i=0){const l=[...e,a];return i&&l.length>i?l.slice(1):l}function zw(e,a,i=0){const l=[a,...e];return i&&l.length>i?l.slice(0,-1):l}var Rh=Symbol();function X0(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===Rh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function I0(e,a){return typeof e=="function"?e(...a):!!e}function jw(e,a,i){let l=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=a(),l||(l=!0,s.aborted?i():s.addEventListener("abort",i,{once:!0})),s)}),e}var jo=(()=>{let e=()=>_w;return{isServer(){return e()},setIsServer(a){e=a}}})();function rh(){let e,a;const i=new Promise((s,u)=>{e=s,a=u});i.status="pending",i.catch(()=>{});function l(s){Object.assign(i,s),delete i.resolve,delete i.reject}return i.resolve=s=>{l({status:"fulfilled",value:s}),e(s)},i.reject=s=>{l({status:"rejected",reason:s}),a(s)},i}var Nw=ww;function Cw(){let e=[],a=0,i=d=>{d()},l=d=>{d()},s=Nw;const u=d=>{a?e.push(d):s(()=>{i(d)})},c=()=>{const d=e;e=[],d.length&&s(()=>{l(()=>{d.forEach(m=>{i(m)})})})};return{batch:d=>{let m;a++;try{m=d()}finally{a--,a||c()}return m},batchCalls:d=>(...m)=>{u(()=>{d(...m)})},schedule:u,setNotifyFunction:d=>{i=d},setBatchNotifyFunction:d=>{l=d},setScheduler:d=>{s=d}}}var Vt=Cw(),Mw=class extends Ho{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const a=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#e}},Uu=new Mw;function Ow()DELIM" +R"DELIM(e){return Math.min(1e3*2**e,3e4)}function J0(e){return(e??"online")==="online"?Uu.isOnline():!0}var ih=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function W0(e){let a=!1,i=0,l;const s=rh(),u=()=>s.status!=="pending",c=R=>{if(!u()){const C=new ih(R);x(C),e.onCancel?.(C)}},d=()=>{a=!0},m=()=>{a=!1},p=()=>Eh.isFocused()&&(e.networkMode==="always"||Uu.isOnline())&&e.canRun(),b=()=>J0(e.networkMode)&&e.canRun(),v=R=>{u()||(l?.(),s.resolve(R))},x=R=>{u()||(l?.(),s.reject(R))},w=()=>new Promise(R=>{l=C=>{(u()||p())&&R(C)},e.onPause?.()}).then(()=>{l=void 0,u()||e.onContinue?.()}),E=()=>{if(u())return;let R;const C=i===0?e.initialPromise:void 0;try{R=C??e.fn()}catch(Y){R=Promise.reject(Y)}Promise.resolve(R).then(v).catch(Y=>{if(u())return;const V=e.retry??(jo.isServer()?0:3),I=e.retryDelay??Ow,oe=typeof I=="function"?I(i,Y):I,re=V===!0||typeof V=="number"&&ip()?void 0:w()).then(()=>{a?x(Y):E()})})};return{promise:s,status:()=>s.status,cancel:c,continue:()=>(l?.(),s),cancelRetry:d,continueRetry:m,canStart:b,start:()=>(b()?E():w().then(E),s)}}var eb=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),eh(this.gcTime)&&(this.#e=ii.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(jo.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(ii.clearTimeout(this.#e),this.#e=void 0)}};function kw(e){return{onFetch:(a,i)=>{const l=a.options,s=a.fetchOptions?.meta?.fetchMore?.direction,u=a.state.data?.pages||[],c=a.state.data?.pageParams||[];let d={pages:[],pageParams:[]},m=0;const p=async()=>{let b=!1;const v=E=>{jw(E,()=>a.signal,()=>b=!0)},x=X0(a.options,a.fetchOptions),w=async(E,R,C)=>{if(b)return Promise.reject(a.signal.reason);if(R==null&&E.pages.length)return Promise.resolve(E);const V=(()=>{const xe={client:a.client,queryKey:a.queryKey,pageParam:R,direction:C?"backward":"forward",meta:a.options.meta};return v(xe),xe})(),I=await x(V),{maxPages:oe}=a.options,re=C?zw:Aw;return{pages:re(E.pages,I,oe),pageParams:re(E.pageParams,R,oe)}};if(s&&u.length){const E=s==="backward",R=E?Dw:hv,C={pages:u,pageParams:c},Y=R(l,C);d=await w(C,Y,E)}else{const E=e??u.length;do{const R=m===0?c[0]??l.initialPageParam:hv(l,d);if(m>0&&R==null)break;d=await w(d,R),m++}while(ma.options.persister?.(p,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=p}}}function hv(e,{pages:a,pageParams:i}){const l=a.length-1;return a.length>0?e.getNextPageParam(a[l],a,i[l],i):void 0}function Dw(e,{pages:a,pageParams:i}){return a.length>0?e.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var Lw=class extends eb{#e;#t;#n;#a;#i;#r;#o;#l;constructor(e){super(),this.#l=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#a=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=pv(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=pv(this.options);a.data!==void 0&&(this.setState(mv(a.data,a.dataUpdatedAt)),this.#t=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(e,a){const i=ah(this.state.data,e,this.options);return this.#s({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}setState(e){this.#s({type:"setState",state:e})}cancel(e){const a=this.#r?.promise;return this.#r?.cancel(e),a?a.then(vn).catch(vn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Nn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Rh||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Or(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!K0(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(a=>a!==e),this.observers.length||(this.#r&&(this.#l||this.#c()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,a){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const i=new AbortController,l=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#l=!0,i.signal)})},s=()=>{const m=X0(this.options,a),b=(()=>{const v={client:this.#i,queryKey:this.queryKey,meta:this.meta};return l(v),v})();return this.#l=!1,this.options.persister?this.options.persister(m,b,this):m(b)},c=(()=>{const m={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:s};return l(m),m})();(this.#e==="infinite"?kw(this.options.pages):this.options.behavior)?.onFetch(c,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#s({type:"fetch",meta:c.fetchOptions?.meta}),this.#r=W0({initialPromise:a?.initialPromise,fn:c.fetchFn,onCancel:m=>{m instanceof ih&&m.revert&&this.setState({...this.#n,fetchStatus:"idle"}),i.abort()},onFail:(m,p)=>{this.#s({type:"failed",failureCount:m,error:p})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const m=await this.#r.start();if(m===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(m),this.#a.config.onSuccess?.(m,this),this.#a.config.onSettled?.(m,this.state.error,this),m}catch(m){if(m instanceof ih){if(m.silent)return this.#r.promise;if(m.revert){if(this.state.data===void 0)throw m;return this.state.data}}throw this.#s({type:"error",error:m}),this.#a.config.onError?.(m,this),this.#a.config.onSettled?.(this.state.data,m,this),m}finally{this.scheduleGc()}}#s(e){const a=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...tb(i.data,this.options),fetchMeta:e.meta??null};case"success":const l={...i,...mv(e.data,e.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?l:void 0,l;case"error":const s=e.error;return{...i,error:s,errorU)DELIM" +R"DELIM(pdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=a(this.state),Vt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:e})})}};function tb(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:J0(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function mv(e,a){return{data:e,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function pv(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,i=a!==void 0,l=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var Bw=class extends Ho{constructor(e,a){super(),this.options=a,this.#e=e,this.#l=null,this.#o=rh(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#a=void 0;#i;#r;#o;#l;#c;#s;#m;#f;#d;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),yv(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return lh(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return lh(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const a=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Nn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),a._defaulted&&!th(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const l=this.hasListeners();l&&gv(this.#t,i,this.options,a)&&this.#h(),this.updateResult(),l&&(this.#t!==i||Nn(this.options.enabled,this.#t)!==Nn(a.enabled,this.#t)||Or(this.options.staleTime,this.#t)!==Or(a.staleTime,this.#t))&&this.#y();const s=this.#g();l&&(this.#t!==i||Nn(this.options.enabled,this.#t)!==Nn(a.enabled,this.#t)||s!==this.#u)&&this.#v(s)}getOptimisticResult(e){const a=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(a,e);return Hw(this,i)&&(this.#a=i,this.#r=this.options,this.#i=this.#t.state),i}getCurrentResult(){return this.#a}trackResult(e,a){return new Proxy(e,{get:(i,l)=>(this.trackProp(l),a?.(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,l))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=this.#e.defaultQueryOptions(e),i=this.#e.getQueryCache().build(this.#e,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#h(e){this.#w();let a=this.#t.fetch(this.options,e);return e?.throwOnError||(a=a.catch(vn)),a}#y(){this.#x();const e=Or(this.options.staleTime,this.#t);if(jo.isServer()||this.#a.isStale||!eh(e))return;const i=K0(this.#a.dataUpdatedAt,e)+1;this.#f=ii.setTimeout(()=>{this.#a.isStale||this.updateResult()},i)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#u=e,!(jo.isServer()||Nn(this.options.enabled,this.#t)===!1||!eh(this.#u)||this.#u===0)&&(this.#d=ii.setInterval(()=>{(this.options.refetchIntervalInBackground||Eh.isFocused())&&this.#h()},this.#u))}#b(){this.#y(),this.#v(this.#g())}#x(){this.#f!==void 0&&(ii.clearTimeout(this.#f),this.#f=void 0)}#S(){this.#d!==void 0&&(ii.clearInterval(this.#d),this.#d=void 0)}createResult(e,a){const i=this.#t,l=this.options,s=this.#a,u=this.#i,c=this.#r,m=e!==i?e.state:this.#n,{state:p}=e;let b={...p},v=!1,x;if(a._optimisticResults){const _=this.hasListeners(),D=!_&&yv(e,a),B=_&&gv(e,i,a,l);(D||B)&&(b={...b,...tb(p.data,e.options)}),a._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:w,errorUpdatedAt:E,status:R}=b;x=b.data;let C=!1;if(a.placeholderData!==void 0&&x===void 0&&R==="pending"){let _;s?.isPlaceholderData&&a.placeholderData===c?.placeholderData?(_=s.data,C=!0):_=typeof a.placeholderData=="function"?a.placeholderData(this.#m?.state.data,this.#m):a.placeholderData,_!==void 0&&(R="success",x=ah(s?.data,_,a),v=!0)}if(a.select&&x!==void 0&&!C)if(s&&x===u?.data&&a.select===this.#c)x=this.#s;else try{this.#c=a.select,x=a.select(x),x=ah(s?.data,x,a),this.#s=x,this.#l=null}catch(_){this.#l=_}this.#l&&(w=this.#l,x=this.#s,E=Date.now(),R="error");const Y=b.fetchStatus==="fetching",V=R==="pending",I=R==="error",oe=V&&Y,re=x!==void 0,N={status:R,fetchStatus:b.fetchStatus,isPending:V,isSuccess:R==="success",isError:I,isInitialLoading:oe,isLoading:oe,data:x,dataUpdatedAt:b.dataUpdatedAt,error:w,errorUpdatedAt:E,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:b.dataUpdateCount>m.dataUpdateCount||b.errorUpdateCount>m.errorUpdateCount,isFetching:Y,isRefetching:Y&&!V,isLoadingError:I&&!re,isPaused:b.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:I&&re,isStale:Ah(e,a),refetch:this.refetch,promise:this.#o,isEnabled:Nn(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const _=N.data!==void 0,D=N.status==="error"&&!_,B=ne=>{D?ne.reject(N.error):_&&ne.resolve(N.data)},Q=()=>{const ne=this.#o=N.promise=rh();B(ne)},P=this.#o;switch(P.status){case"pending":e.queryHash===i.queryHash&&B(P);break;case"fulfilled":(D||N.data!==P.value)&&Q();break;case"rejected":(!D||N.error!==P.reason)&&Q();break}}return N}updateResult(){const e=this.#a,a=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#r=this.options,this.#i.data!==void 0&&(this.#m=this.#t),th(a,e))return;this.#a=a;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:l}=this.options,s=typeof l=="function"?l():l;if(s==="all"||!s&&!this.#p.size)return!0;const u=new Set(s??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#a).some(c=>{const d=c;return this.#a[d]!==e[d]&&u.has(d)})};this.#_({listeners:i()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const a=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(a?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){Vt.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#a)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Uw(e,a){return Nn(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Nn(a.retryOnMount,e)===!1)}function yv(e,a){return Uw(e,a)||e.state.data!==void 0&&lh(e,a,a.refetchOnMount)}function lh(e,a,i){if(Nn(a.enabled,e)!==!1&&Or(a.staleTime,e)!=="static"){const l=typeof i=="function"?i(e):i;return l==="always"||l!==!1&&Ah(e,a)}return!1}function gv(e,a,i,l){return(e!==a||Nn(l.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&Ah(e,i)}function Ah(e,a){return Nn(a.enabled,e)!==!1&&e.isStaleByTime(Or(a.staleTime,e))}function Hw(e,a){return!th(e.getCurrentResult(),a)}var $w=class extends eb{#e;#t;#n;#a;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e)DELIM" +R"DELIM(.mutationCache,this.#t=[],this.state=e.state||Zw(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(a=>a!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){const a=()=>{this.#i({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=W0({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(u,c)=>{this.#i({type:"failed",failureCount:u,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const l=this.state.status==="pending",s=!this.#a.canStart();try{if(l)a();else{this.#i({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,i);const c=await this.options.onMutate?.(e,i);c!==this.state.context&&this.#i({type:"pending",context:c,variables:e,isPaused:s})}const u=await this.#a.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,i),await this.options.onSuccess?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(u,null,e,this.state.context,i),this.#i({type:"success",data:u}),u}catch(u){try{await this.#n.config.onError?.(u,e,this.state.context,this,i)}catch(c){Promise.reject(c)}try{await this.options.onError?.(u,e,this.state.context,i)}catch(c){Promise.reject(c)}try{await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,i)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,u,e,this.state.context,i)}catch(c){Promise.reject(c)}throw this.#i({type:"error",error:u}),u}finally{this.#n.runNext(this)}}#i(e){const a=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=a(this.state),Vt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Zw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var qw=class extends Ho{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,a,i){const l=new $w({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:i});return this.add(l),l}add(e){this.#e.add(e);const a=du(e);if(typeof a=="string"){const i=this.#t.get(a);i?i.push(e):this.#t.set(a,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const a=du(e);if(typeof a=="string"){const i=this.#t.get(a);if(i)if(i.length>1){const l=i.indexOf(e);l!==-1&&i.splice(l,1)}else i[0]===e&&this.#t.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=du(e);if(typeof a=="string"){const l=this.#t.get(a)?.find(s=>s.state.status==="pending");return!l||l===e}else return!0}runNext(e){const a=du(e);return typeof a=="string"?this.#t.get(a)?.find(l=>l!==e&&l.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Vt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const a={exact:!0,...e};return this.getAll().find(i=>cv(a,i))}findAll(e={}){return this.getAll().filter(a=>cv(e,a))}notify(e){Vt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return Vt.batch(()=>Promise.all(e.map(a=>a.continue().catch(vn))))}};function du(e){return e.options.scope?.id}var Pw=class extends Ho{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,a,i){const l=a.queryKey,s=a.queryHash??Th(l,a);let u=this.get(s);return u||(u=new Lw({client:e,queryKey:l,queryHash:s,options:e.defaultQueryOptions(a),state:i,defaultOptions:e.getQueryDefaults(l)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=this.#e.get(e.queryHash);a&&(e.destroy(),a===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Vt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const a={exact:!0,...e};return this.getAll().find(i=>uv(a,i))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(i=>uv(e,i)):a}notify(e){Vt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){Vt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Vt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Qw=class{#e;#t;#n;#a;#i;#r;#o;#l;constructor(e={}){this.#e=e.queryCache||new Pw,this.#t=e.mutationCache||new qw,this.#n=e.defaultOptions||{},this.#a=new Map,this.#i=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=Eh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=Uu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#o?.(),this.#o=void 0,this.#l?.(),this.#l=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state.data}ensureQueryData(e){const a=this.defaultQueryOptions(e),i=this.#e.build(this,a),l=i.state.data;return l===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(Or(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(l))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:a,state:i})=>{const l=i.data;return[a,l]})}setQueryData(e,a,i){const l=this.defaultQueryOptions({queryKey:e}),u=this.#e.get(l.queryHash)?.state.data,c=Ew(a,u);if(c!==void 0)return this.#e.build(this,l).setData(c,{...i,manual:!0})}setQueriesData(e,a,i){return Vt.batch(()=>this.#e.findAll(e).map(({queryKey:l})=>[l,this.setQueryData(l,a,i)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state}removeQueries(e){const a=this.#e;Vt.batch(()=>{a.findAll(e).forEach(i=>{a.remove(i)})})}resetQueries(e,a){const i=this.#e;return Vt.batch(()=>(i.findAll(e).forEach(l=>{l.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const i={revert:!0,...a},l=Vt.batch(()=>this.#e.findAll(e).map(s=>s.cancel(i)));return Promise.all(l).then(vn).catch(vn)}invalidateQueries(e,a={}){return Vt.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},a)))}refetchQueries(e,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},l=Vt.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let u=s.fetch(void 0,i);return i.throwOnError||(u=u.catch(vn)),s.state.fetchStatus==="paused"?Promise.resolve():)DELIM" +R"DELIM(u}));return Promise.all(l).then(vn)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const i=this.#e.build(this,a);return i.isStaleByTime(Or(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vn).catch(vn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vn).catch(vn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Uu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,a){this.#a.set(Ao(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#a.values()],i={};return a.forEach(l=>{zo(e,l.queryKey)&&Object.assign(i,l.defaultOptions)}),i}setMutationDefaults(e,a){this.#i.set(Ao(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#i.values()],i={};return a.forEach(l=>{zo(e,l.mutationKey)&&Object.assign(i,l.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const a={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=Th(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===Rh&&(a.enabled=!1),a}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},nb=T.createContext(void 0),Ju=e=>{const a=T.useContext(nb);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},Fw=({client:e,children:a})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(nb.Provider,{value:e,children:a})),ab=T.createContext(!1),Yw=()=>T.useContext(ab);ab.Provider;function Gw(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Kw=T.createContext(Gw()),Vw=()=>T.useContext(Kw),Xw=(e,a,i)=>{const l=i?.state.error&&typeof e.throwOnError=="function"?I0(e.throwOnError,[i.state.error,i]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||l)&&(a.isReset()||(e.retryOnMount=!1))},Iw=e=>{T.useEffect(()=>{e.clearReset()},[e])},Jw=({result:e,errorResetBoundary:a,throwOnError:i,query:l,suspense:s})=>e.isError&&!a.isReset()&&!e.isFetching&&l&&(s&&e.data===void 0||I0(i,[e.error,l])),Ww=e=>{if(e.suspense){const i=s=>s==="static"?s:Math.max(s??1e3,1e3),l=e.staleTime;e.staleTime=typeof l=="function"?(...s)=>i(l(...s)):i(l),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},e_=(e,a)=>e.isLoading&&e.isFetching&&!a,t_=(e,a)=>e?.suspense&&a.isPending,vv=(e,a,i)=>a.fetchOptimistic(e).catch(()=>{i.clearReset()});function n_(e,a,i){const l=Yw(),s=Vw(),u=Ju(),c=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(c);const d=u.getQueryCache().get(c.queryHash),m=e.subscribed!==!1;c._optimisticResults=l?"isRestoring":m?"optimistic":void 0,Ww(c),Xw(c,s,d),Iw(s);const p=!u.getQueryCache().get(c.queryHash),[b]=T.useState(()=>new a(u,c)),v=b.getOptimisticResult(c),x=!l&&m;if(T.useSyncExternalStore(T.useCallback(w=>{const E=x?b.subscribe(Vt.batchCalls(w)):vn;return b.updateResult(),E},[b,x]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),T.useEffect(()=>{b.setOptions(c)},[c,b]),t_(c,v))throw vv(c,b,s);if(Jw({result:v,errorResetBoundary:s,throwOnError:c.throwOnError,query:d,suspense:c.suspense}))throw v.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(c,v),c.experimental_prefetchInRender&&!jo.isServer()&&e_(v,l)&&(p?vv(c,b,s):d?.promise)?.catch(vn).finally(()=>{b.updateResult()}),c.notifyOnChangeProps?v:b.trackResult(v)}function a_(e,a){return n_(e,Bw)}var bv;function ee(e,a,i){function l(d,m){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),a(d,m);const p=c.prototype,b=Object.keys(p);for(let v=0;vi?.Parent&&d instanceof i.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(c,"name",{value:e}),c}class ul extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class rb extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}(bv=globalThis).__zod_globalConfig??(bv.__zod_globalConfig={});const zh=globalThis.__zod_globalConfig;function oi(e){return zh}function ib(e){const a=Object.values(e).filter(l=>typeof l=="number");return Object.entries(e).filter(([l,s])=>a.indexOf(+l)===-1).map(([l,s])=>s)}function oh(e,a){return typeof a=="bigint"?a.toString():a}function jh(e){return{get value(){{const a=e();return Object.defineProperty(this,"value",{value:a}),a}}}}function Nh(e){return e==null}function Ch(e){const a=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(a,i)}function r_(e,a){const i=e/a,l=Math.round(i),s=Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-l){};function Hu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const l_=jh(()=>{if(zh.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function No(e){if(Hu(e)===!1)return!1;const a=e.constructor;if(a===void 0||typeof a!="function")return!0;const i=a.prototype;return!(Hu(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function ob(e){return No(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const o_=new Set(["string","number","symbol"]);function Wu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Lr(e,a,i){const l=new e._zod.constr(a??e._zod.def);return(!a||i?.parent)&&(l._zod.parent=e),l}function Ne(e){const a=e;if(!a)return{};if(typeof a=="string")return{error:()=>a};if(a?.message!==void 0){if(a?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");a.error=a.message}return delete a.message,typeof a.error=="string"?{...a,error:()=>a.error}:a}function s_(e){return Object.keys(e).filter(a=>e[a]._zod.optin==="optional"&&e[a]._zod.optout==="optional")}const u_={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function c_(e,a){const i=e._zod.def,l=i.checks;if(l&&l.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=Dr(e._zod.def,{get shape(){const c={};for(const d in a){if(!(d in i.shape))throw new Error(`Unrecognized key: "${d}"`);a[d]&&(c[d]=i.s)DELIM" +R"DELIM(hape[d])}return di(this,"shape",c),c},checks:[]});return Lr(e,u)}function f_(e,a){const i=e._zod.def,l=i.checks;if(l&&l.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=Dr(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const d in a){if(!(d in i.shape))throw new Error(`Unrecognized key: "${d}"`);a[d]&&delete c[d]}return di(this,"shape",c),c},checks:[]});return Lr(e,u)}function d_(e,a){if(!No(a))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const u=e._zod.def.shape;for(const c in a)if(Object.getOwnPropertyDescriptor(u,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Dr(e._zod.def,{get shape(){const u={...e._zod.def.shape,...a};return di(this,"shape",u),u}});return Lr(e,s)}function h_(e,a){if(!No(a))throw new Error("Invalid input to safeExtend: expected a plain object");const i=Dr(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a};return di(this,"shape",l),l}});return Lr(e,i)}function m_(e,a){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const i=Dr(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a._zod.def.shape};return di(this,"shape",l),l},get catchall(){return a._zod.def.catchall},checks:a._zod.def.checks??[]});return Lr(e,i)}function p_(e,a,i){const s=a._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const c=Dr(a._zod.def,{get shape(){const d=a._zod.def.shape,m={...d};if(i)for(const p in i){if(!(p in d))throw new Error(`Unrecognized key: "${p}"`);i[p]&&(m[p]=e?new e({type:"optional",innerType:d[p]}):d[p])}else for(const p in d)m[p]=e?new e({type:"optional",innerType:d[p]}):d[p];return di(this,"shape",m),m},checks:[]});return Lr(a,c)}function y_(e,a,i){const l=Dr(a._zod.def,{get shape(){const s=a._zod.def.shape,u={...s};if(i)for(const c in i){if(!(c in u))throw new Error(`Unrecognized key: "${c}"`);i[c]&&(u[c]=new e({type:"nonoptional",innerType:s[c]}))}else for(const c in s)u[c]=new e({type:"nonoptional",innerType:s[c]});return di(this,"shape",u),u}});return Lr(a,l)}function ll(e,a=0){if(e.aborted===!0)return!0;for(let i=a;i{var l;return(l=i).path??(l.path=[]),i.path.unshift(e),i})}function hu(e){return typeof e=="string"?e:e?.message}function si(e,a,i){const l=e.message?e.message:hu(e.inst?._zod.def?.error?.(e))??hu(a?.error?.(e))??hu(i.customError?.(e))??hu(i.localeError?.(e))??"Invalid input",{inst:s,continue:u,input:c,...d}=e;return d.path??(d.path=[]),d.message=l,a?.reportInput&&(d.input=c),d}function Mh(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Co(...e){const[a,i,l]=e;return typeof a=="string"?{message:a,code:"custom",input:i,inst:l}:{...a}}const ub=(e,a)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:a,enumerable:!1}),e.message=JSON.stringify(a,oh,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},cb=ee("$ZodError",ub),fb=ee("$ZodError",ub,{Parent:Error});function v_(e,a=i=>i.message){const i={},l=[];for(const s of e.issues)s.path.length>0?(i[s.path[0]]=i[s.path[0]]||[],i[s.path[0]].push(a(s))):l.push(a(s));return{formErrors:l,fieldErrors:i}}function b_(e,a=i=>i.message){const i={_errors:[]},l=(s,u=[])=>{for(const c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>l({issues:d},[...u,...c.path]));else if(c.code==="invalid_key")l({issues:c.issues},[...u,...c.path]);else if(c.code==="invalid_element")l({issues:c.issues},[...u,...c.path]);else{const d=[...u,...c.path];if(d.length===0)i._errors.push(a(c));else{let m=i,p=0;for(;p(a,i,l,s)=>{const u=l?{...l,async:!1}:{async:!1},c=a._zod.run({value:i,issues:[]},u);if(c instanceof Promise)throw new ul;if(c.issues.length){const d=new(s?.Err??e)(c.issues.map(m=>si(m,u,oi())));throw lb(d,s?.callee),d}return c.value},kh=e=>async(a,i,l,s)=>{const u=l?{...l,async:!0}:{async:!0};let c=a._zod.run({value:i,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){const d=new(s?.Err??e)(c.issues.map(m=>si(m,u,oi())));throw lb(d,s?.callee),d}return c.value},ec=e=>(a,i,l)=>{const s=l?{...l,async:!1}:{async:!1},u=a._zod.run({value:i,issues:[]},s);if(u instanceof Promise)throw new ul;return u.issues.length?{success:!1,error:new(e??cb)(u.issues.map(c=>si(c,s,oi())))}:{success:!0,data:u.value}},x_=ec(fb),tc=e=>async(a,i,l)=>{const s=l?{...l,async:!0}:{async:!0};let u=a._zod.run({value:i,issues:[]},s);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>si(c,s,oi())))}:{success:!0,data:u.value}},S_=tc(fb),w_=e=>(a,i,l)=>{const s=l?{...l,direction:"backward"}:{direction:"backward"};return Oh(e)(a,i,s)},__=e=>(a,i,l)=>Oh(e)(a,i,l),E_=e=>async(a,i,l)=>{const s=l?{...l,direction:"backward"}:{direction:"backward"};return kh(e)(a,i,s)},T_=e=>async(a,i,l)=>kh(e)(a,i,l),R_=e=>(a,i,l)=>{const s=l?{...l,direction:"backward"}:{direction:"backward"};return ec(e)(a,i,s)},A_=e=>(a,i,l)=>ec(e)(a,i,l),z_=e=>async(a,i,l)=>{const s=l?{...l,direction:"backward"}:{direction:"backward"};return tc(e)(a,i,s)},j_=e=>async(a,i,l)=>tc(e)(a,i,l),N_=/^[cC][0-9a-z]{6,}$/,C_=/^[0-9a-z]+$/,M_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,O_=/^[0-9a-vA-V]{20}$/,k_=/^[A-Za-z0-9]{27}$/,D_=/^[a-zA-Z0-9_-]{21}$/,L_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,B_=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,wv=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,U_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,H_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function $_(){return new RegExp(H_,"u")}const Z_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,q_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,P_=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Q_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,F_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,db=/^[A-Za-z0-9_-]*$/,Y_=/^https?$/,G_=/^\+[1-9]\d{6,14}$/,hb="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",K_=new RegExp(`^${hb}$`);function mb(e){const a="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${a}`:e.precision===0?`${a}:[0-5]\\d`:`${a}:[0-5]\\d\\.\\d{${e.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function V_(e){return new RegExp(`^${mb(e)}$`)}function X)DELIM" +R"DELIM(_(e){const a=mb({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const l=`${a}(?:${i.join("|")})`;return new RegExp(`^${hb}T(?:${l})$`)}const I_=e=>{const a=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},J_=/^-?\d+$/,W_=/^-?\d+(?:\.\d+)?$/,eE=/^(?:true|false)$/i,tE=/^[^A-Z]*$/,nE=/^[^a-z]*$/,bn=ee("$ZodCheck",(e,a)=>{var i;e._zod??(e._zod={}),e._zod.def=a,(i=e._zod).onattach??(i.onattach=[])}),pb={number:"number",bigint:"bigint",object:"date"},yb=ee("$ZodCheckLessThan",(e,a)=>{bn.init(e,a);const i=pb[typeof a.value];e._zod.onattach.push(l=>{const s=l._zod.bag,u=(a.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value{(a.inclusive?l.value<=a.value:l.value{bn.init(e,a);const i=pb[typeof a.value];e._zod.onattach.push(l=>{const s=l._zod.bag,u=(a.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;a.value>u&&(a.inclusive?s.minimum=a.value:s.exclusiveMinimum=a.value)}),e._zod.check=l=>{(a.inclusive?l.value>=a.value:l.value>a.value)||l.issues.push({origin:i,code:"too_small",minimum:typeof a.value=="object"?a.value.getTime():a.value,input:l.value,inclusive:a.inclusive,inst:e,continue:!a.abort})}}),aE=ee("$ZodCheckMultipleOf",(e,a)=>{bn.init(e,a),e._zod.onattach.push(i=>{var l;(l=i._zod.bag).multipleOf??(l.multipleOf=a.value)}),e._zod.check=i=>{if(typeof i.value!=typeof a.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%a.value===BigInt(0):r_(i.value,a.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:a.value,input:i.value,inst:e,continue:!a.abort})}}),rE=ee("$ZodCheckNumberFormat",(e,a)=>{bn.init(e,a),a.format=a.format||"float64";const i=a.format?.includes("int"),l=i?"int":"number",[s,u]=u_[a.format];e._zod.onattach.push(c=>{const d=c._zod.bag;d.format=a.format,d.minimum=s,d.maximum=u,i&&(d.pattern=J_)}),e._zod.check=c=>{const d=c.value;if(i){if(!Number.isInteger(d)){c.issues.push({expected:l,format:a.format,code:"invalid_type",continue:!1,input:d,inst:e});return}if(!Number.isSafeInteger(d)){d>0?c.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!a.abort}):c.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!a.abort});return}}du&&c.issues.push({origin:"number",input:d,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!a.abort})}}),iE=ee("$ZodCheckMaxLength",(e,a)=>{var i;bn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!Nh(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum{const s=l.value;if(s.length<=a.maximum)return;const c=Mh(s);l.issues.push({origin:c,code:"too_big",maximum:a.maximum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),lE=ee("$ZodCheckMinLength",(e,a)=>{var i;bn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!Nh(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>s&&(l._zod.bag.minimum=a.minimum)}),e._zod.check=l=>{const s=l.value;if(s.length>=a.minimum)return;const c=Mh(s);l.issues.push({origin:c,code:"too_small",minimum:a.minimum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),oE=ee("$ZodCheckLengthEquals",(e,a)=>{var i;bn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!Nh(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag;s.minimum=a.length,s.maximum=a.length,s.length=a.length}),e._zod.check=l=>{const s=l.value,u=s.length;if(u===a.length)return;const c=Mh(s),d=u>a.length;l.issues.push({origin:c,...d?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:l.value,inst:e,continue:!a.abort})}}),nc=ee("$ZodCheckStringFormat",(e,a)=>{var i,l;bn.init(e,a),e._zod.onattach.push(s=>{const u=s._zod.bag;u.format=a.format,a.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(a.pattern))}),a.pattern?(i=e._zod).check??(i.check=s=>{a.pattern.lastIndex=0,!a.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:a.format,input:s.value,...a.pattern?{pattern:a.pattern.toString()}:{},inst:e,continue:!a.abort})}):(l=e._zod).check??(l.check=()=>{})}),sE=ee("$ZodCheckRegex",(e,a)=>{nc.init(e,a),e._zod.check=i=>{a.pattern.lastIndex=0,!a.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:a.pattern.toString(),inst:e,continue:!a.abort})}}),uE=ee("$ZodCheckLowerCase",(e,a)=>{a.pattern??(a.pattern=tE),nc.init(e,a)}),cE=ee("$ZodCheckUpperCase",(e,a)=>{a.pattern??(a.pattern=nE),nc.init(e,a)}),fE=ee("$ZodCheckIncludes",(e,a)=>{bn.init(e,a);const i=Wu(a.includes),l=new RegExp(typeof a.position=="number"?`^.{${a.position}}${i}`:i);a.pattern=l,e._zod.onattach.push(s=>{const u=s._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(l)}),e._zod.check=s=>{s.value.includes(a.includes,a.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:a.includes,input:s.value,inst:e,continue:!a.abort})}}),dE=ee("$ZodCheckStartsWith",(e,a)=>{bn.init(e,a);const i=new RegExp(`^${Wu(a.prefix)}.*`);a.pattern??(a.pattern=i),e._zod.onattach.push(l=>{const s=l._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=l=>{l.value.startsWith(a.prefix)||l.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:l.value,inst:e,continue:!a.abort})}}),hE=ee("$ZodCheckEndsWith",(e,a)=>{bn.init(e,a);const i=new RegExp(`.*${Wu(a.suffix)}$`);a.pattern??(a.pattern=i),e._zod.onattach.push(l=>{const s=l._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=l=>{l.value.endsWith(a.suffix)||l.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:l.value,inst:e,continue:!a.abort})}}),mE=ee("$ZodCheckOverwrite",(e,a)=>{bn.init(e,a),e._zod.check=i=>{i.value=a.tx(i.value)}});class pE{constructor(a=[]){this.content=[],this.indent=0,this&&(this.args=a)}indented(a){this.indent+=1,a(this),this.indent-=1}write(a){if(typeof a=="function"){a(this,{execution:"sync"}),a(this,{execution:"async"});return}const l=a.split(` +`).filter(c=>c),s=Math.min(...l.map(c=>c.length-c.trimStart().length)),u=l.map(c=>c.slice(s)).map(c=>" ".repeat(this.indent*2)+c);for(const c of u)this.content.push(c)}compile(){const a=Function,i=this?.args,s=[...(this?.content??[""]).map(u=>` ${u}`)];return new a(...i,s.join(` +`))}}const yE={major:4,minor:4,patch:3},Mt=ee("$ZodType",(e,a)=>{var i;e??(e={}),e._zod.def=a,e._zod.bag=e._zod.bag||{},e._zod.version=yE;const l=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&l.unshift(e);for(const s of l)for(const u of s._zod.onattach)u(e);if(l.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(c,d,m)=>{let p=ll(c),b;for(const v of d){if(v._zod.def.when){if(g_(c)||!v._zod.def.when(c))continue}else if(p)continue;const x=c.issues.length,w=v._zod.check(c);if(w instanceof Promise&&m?.async===!1)throw new ul;if(b||w instanceof Promise)b=(b??Promise.resolve()).then(async()=>{await w,c.issues.length!==x&&(p||(p=ll(c,x)))});else{if(c.issues.length===x)continue;p||(p=ll(c,x))}}return b?b.then(()=>c):c},u=(c,d,m)=>{if(ll(c))return c.aborted=!0,c;const p=s(d,l,m);if(p instanc)DELIM" +R"DELIM(eof Promise){if(m.async===!1)throw new ul;return p.then(b=>e._zod.parse(b,m))}return e._zod.parse(p,m)};e._zod.run=(c,d)=>{if(d.skipChecks)return e._zod.parse(c,d);if(d.direction==="backward"){const p=e._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return p instanceof Promise?p.then(b=>u(b,c,d)):u(p,c,d)}const m=e._zod.parse(c,d);if(m instanceof Promise){if(d.async===!1)throw new ul;return m.then(p=>s(p,l,d))}return s(m,l,d)}}dt(e,"~standard",()=>({validate:s=>{try{const u=x_(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return S_(e,s).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},vendor:"zod",version:1}))}),Dh=ee("$ZodString",(e,a)=>{Mt.init(e,a),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??I_(e._zod.bag),e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),St=ee("$ZodStringFormat",(e,a)=>{nc.init(e,a),Dh.init(e,a)}),gE=ee("$ZodGUID",(e,a)=>{a.pattern??(a.pattern=B_),St.init(e,a)}),vE=ee("$ZodUUID",(e,a)=>{if(a.version){const l={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(l===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=wv(l))}else a.pattern??(a.pattern=wv());St.init(e,a)}),bE=ee("$ZodEmail",(e,a)=>{a.pattern??(a.pattern=U_),St.init(e,a)}),xE=ee("$ZodURL",(e,a)=>{St.init(e,a),e._zod.check=i=>{try{const l=i.value.trim();if(!a.normalize&&a.protocol?.source===Y_.source&&!/^https?:\/\//i.test(l)){i.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:i.value,inst:e,continue:!a.abort});return}const s=new URL(l);a.hostname&&(a.hostname.lastIndex=0,a.hostname.test(s.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:a.hostname.source,input:i.value,inst:e,continue:!a.abort})),a.protocol&&(a.protocol.lastIndex=0,a.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:a.protocol.source,input:i.value,inst:e,continue:!a.abort})),a.normalize?i.value=s.href:i.value=l;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!a.abort})}}}),SE=ee("$ZodEmoji",(e,a)=>{a.pattern??(a.pattern=$_()),St.init(e,a)}),wE=ee("$ZodNanoID",(e,a)=>{a.pattern??(a.pattern=D_),St.init(e,a)}),_E=ee("$ZodCUID",(e,a)=>{a.pattern??(a.pattern=N_),St.init(e,a)}),EE=ee("$ZodCUID2",(e,a)=>{a.pattern??(a.pattern=C_),St.init(e,a)}),TE=ee("$ZodULID",(e,a)=>{a.pattern??(a.pattern=M_),St.init(e,a)}),RE=ee("$ZodXID",(e,a)=>{a.pattern??(a.pattern=O_),St.init(e,a)}),AE=ee("$ZodKSUID",(e,a)=>{a.pattern??(a.pattern=k_),St.init(e,a)}),zE=ee("$ZodISODateTime",(e,a)=>{a.pattern??(a.pattern=X_(a)),St.init(e,a)}),jE=ee("$ZodISODate",(e,a)=>{a.pattern??(a.pattern=K_),St.init(e,a)}),NE=ee("$ZodISOTime",(e,a)=>{a.pattern??(a.pattern=V_(a)),St.init(e,a)}),CE=ee("$ZodISODuration",(e,a)=>{a.pattern??(a.pattern=L_),St.init(e,a)}),ME=ee("$ZodIPv4",(e,a)=>{a.pattern??(a.pattern=Z_),St.init(e,a),e._zod.bag.format="ipv4"}),OE=ee("$ZodIPv6",(e,a)=>{a.pattern??(a.pattern=q_),St.init(e,a),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!a.abort})}}}),kE=ee("$ZodCIDRv4",(e,a)=>{a.pattern??(a.pattern=P_),St.init(e,a)}),DE=ee("$ZodCIDRv6",(e,a)=>{a.pattern??(a.pattern=Q_),St.init(e,a),e._zod.check=i=>{const l=i.value.split("/");try{if(l.length!==2)throw new Error;const[s,u]=l;if(!u)throw new Error;const c=Number(u);if(`${c}`!==u)throw new Error;if(c<0||c>128)throw new Error;new URL(`http://[${s}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!a.abort})}}});function vb(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const LE=ee("$ZodBase64",(e,a)=>{a.pattern??(a.pattern=F_),St.init(e,a),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{vb(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!a.abort})}});function BE(e){if(!db.test(e))return!1;const a=e.replace(/[-_]/g,l=>l==="-"?"+":"/"),i=a.padEnd(Math.ceil(a.length/4)*4,"=");return vb(i)}const UE=ee("$ZodBase64URL",(e,a)=>{a.pattern??(a.pattern=db),St.init(e,a),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{BE(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!a.abort})}}),HE=ee("$ZodE164",(e,a)=>{a.pattern??(a.pattern=G_),St.init(e,a)});function $E(e,a=null){try{const i=e.split(".");if(i.length!==3)return!1;const[l]=i;if(!l)return!1;const s=JSON.parse(atob(l));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||a&&(!("alg"in s)||s.alg!==a))}catch{return!1}}const ZE=ee("$ZodJWT",(e,a)=>{St.init(e,a),e._zod.check=i=>{$E(i.value,a.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!a.abort})}}),bb=ee("$ZodNumber",(e,a)=>{Mt.init(e,a),e._zod.pattern=e._zod.bag.pattern??W_,e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=Number(i.value)}catch{}const s=i.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return i;const u=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...u?{received:u}:{}}),i}}),qE=ee("$ZodNumberFormat",(e,a)=>{rE.init(e,a),bb.init(e,a)}),PE=ee("$ZodBoolean",(e,a)=>{Mt.init(e,a),e._zod.pattern=eE,e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=!!i.value}catch{}const s=i.value;return typeof s=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),i}}),QE=ee("$ZodUnknown",(e,a)=>{Mt.init(e,a),e._zod.parse=i=>i}),FE=ee("$ZodNever",(e,a)=>{Mt.init(e,a),e._zod.parse=(i,l)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function _v(e,a,i){e.issues.length&&a.issues.push(...sb(i,e.issues)),a.value[i]=e.value}const YE=ee("$ZodArray",(e,a)=>{Mt.init(e,a),e._zod.parse=(i,l)=>{const s=i.value;if(!Array.isArray(s))return i.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),i;i.value=Array(s.length);const u=[];for(let c=0;c_v(p,i,c))):_v(m,i,c)}return u.length?Promise.all(u).then(()=>i):i}});function $u(e,a,i,l,s,u){const c=i in l;if(e.issues.length){if(s&&u&&!c)return;a.issues.push(...sb(i,e.issues))}if(!c&&!s){e.issues.length||a.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[i]});return}e.value===void 0?c&&(a.value[i]=void 0):a.value[i]=e.value}function xb(e){const a=Object.keys(e.shape);for(const l of a)if(!e.shape?.[l]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const i=s_(e.shape);return{...e,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(i)}}function Sb(e,a,i,l,s,u){const c=[],d=s.keySet,m=s.catchall._zod,p=m.def.type,b=m.optin==="optional",v=m.optout==="optional";for(const x in a){if(x==="__proto__"||d.has(x))continue;if(p==="never"){c.push(x);continue}const w=m.run({value:a[x],issues:[]},l);w instanceof Promise?e.push(w.then(E=>$u(E,i,x,a,b,v))):$u(w,i,x,a,b,v)}return c.length&&i.issues.push({code:"unrecognized_keys",keys:c,input:a,inst:u}),e.length?Promise.all(e).then(()=>i):i}const GE=ee("$ZodObject",(e,a)=>{if(Mt.init(e,a),!Object.getOwnPropertyDescriptor(a,"shape")?.get){const d=a.shape;Object.defineProperty(a,"shape",{get:()=>{const m={...d};return Object.defineProperty(a,"shape",{value:m}),m}})}const l=jh(()=>xb(a));dt(e._zod,"propValues",()=>{const d=a.shape,m={};for(const p in d){const b=d[p]._zod;if(b.values){m[p]??(m[p]=new Set);for(const v of b.values)m[p].add(v)}}return m});const s=Hu,u=a.catchall;let c;e._zod.parse=(d,m)=>{c??(c=l.value);const p=d.value;if(!s(p))return d.issues.)DELIM" +R"DELIM(push({expected:"object",code:"invalid_type",input:p,inst:e}),d;d.value={};const b=[],v=c.shape;for(const x of c.keys){const w=v[x],E=w._zod.optin==="optional",R=w._zod.optout==="optional",C=w._zod.run({value:p[x],issues:[]},m);C instanceof Promise?b.push(C.then(Y=>$u(Y,d,x,p,E,R))):$u(C,d,x,p,E,R)}return u?Sb(b,p,d,m,l.value,e):b.length?Promise.all(b).then(()=>d):d}}),KE=ee("$ZodObjectJIT",(e,a)=>{GE.init(e,a);const i=e._zod.parse,l=jh(()=>xb(a)),s=x=>{const w=new pE(["shape","payload","ctx"]),E=l.value,R=I=>{const oe=Sv(I);return`shape[${oe}]._zod.run({ value: input[${oe}], issues: [] }, ctx)`};w.write("const input = payload.value;");const C=Object.create(null);let Y=0;for(const I of E.keys)C[I]=`key_${Y++}`;w.write("const newResult = {};");for(const I of E.keys){const oe=C[I],re=Sv(I),xe=x[I],N=xe?._zod?.optin==="optional",_=xe?._zod?.optout==="optional";w.write(`const ${oe} = ${R(I)};`),N&&_?w.write(` + if (${oe}.issues.length) { + if (${re} in input) { + payload.issues = payload.issues.concat(${oe}.issues.map(iss => ({ ...iss, - path: iss.path ? [${ae}, ...iss.path] : [${ae}] + path: iss.path ? [${re}, ...iss.path] : [${re}] }))); } } - if (${ue}.value === undefined) { - if (${ae} in input) { - newResult[${ae}] = undefined; + if (${oe}.value === undefined) { + if (${re} in input) { + newResult[${re}] = undefined; } } else { - newResult[${ae}] = ${ue}.value; + newResult[${re}] = ${oe}.value; } - `):j?w.write(` - if (${ue}.issues.length) { - payload.issues = payload.issues.concat(${ue}.issues.map(iss => ({ + `):N?w.write(` + if (${oe}.issues.length) { + payload.issues = payload.issues.concat(${oe}.issues.map(iss => ({ ...iss, - path: iss.path ? [${ae}, ...iss.path] : [${ae}] + path: iss.path ? [${re}, ...iss.path] : [${re}] }))); } - if (${ue}.value === undefined) { - if (${ae} in input) { - newResult[${ae}] = undefined; + if (${oe}.value === undefined) { + if (${re} in input) { + newResult[${re}] = undefined; } } else { - newResult[${ae}] = ${ue}.value; + newResult[${re}] = ${oe}.value; } `):w.write(` - const ${ue}_present = ${ae} in input; - if (${ue}.issues.length) { - payload.issues = payload.issues.concat(${ue}.issues.map(iss => ({ + const ${oe}_present = ${re} in input; + if (${oe}.issues.length) { + payload.issues = payload.issues.concat(${oe}.issues.map(iss => ({ ...iss, - path: iss.path ? [${ae}, ...iss.path] : [${ae}] + path: iss.path ? [${re}, ...iss.path] : [${re}] }))); } - if (!${ue}_present && !${ue}.issues.length) { + if (!${oe}_present && !${oe}.issues.length) { payload.issues.push({ code: "invalid_type", expected: "nonoptional", input: undefined, - path: [${ae}] + path: [${re}] }); } - if (${ue}_present) { - if (${ue}.value === undefined) { - newResult[${ae}] = undefined; + if (${oe}_present) { + if (${oe}.value === undefined) { + newResult[${re}] = undefined; } else { - newResult[${ae}] = ${ue}.value; + newResult[${re}] = ${oe}.value; } } - `)}w.write("payload.value = newResult;"),w.write("return payload;");const V=w.compile();return(J,ue)=>V(x,J,ue)};let u;const c=Uu,d=!Ah.jitless,p=d&&Ww.value,b=a.catchall;let g;e._zod.parse=(x,w)=>{g??(g=l.value);const E=x.value;return c(E)?d&&p&&w?.async===!1&&w.jitless!==!0?(u||(u=s(a.shape)),x=u(x,w),b?vb([],E,x,w,g,e):x):i(x,w):(x.issues.push({expected:"object",code:"invalid_type",input:E,inst:e}),x)}});function Sv(e,a,i,l){for(const u of e)if(u.issues.length===0)return a.value=u.value,a;const s=e.filter(u=>!il(u));return s.length===1?(a.value=s[0].value,s[0]):(a.issues.push({code:"invalid_union",input:a.value,inst:i,errors:e.map(u=>u.issues.map(c=>si(c,l,oi())))}),a)}const q2=ne("$ZodUnion",(e,a)=>{jt.init(e,a),dt(e._zod,"optin",()=>a.options.some(l=>l._zod.optin==="optional")?"optional":void 0),dt(e._zod,"optout",()=>a.options.some(l=>l._zod.optout==="optional")?"optional":void 0),dt(e._zod,"values",()=>{if(a.options.every(l=>l._zod.values))return new Set(a.options.flatMap(l=>Array.from(l._zod.values)))}),dt(e._zod,"pattern",()=>{if(a.options.every(l=>l._zod.pattern)){const l=a.options.map(s=>s._zod.pattern);return new RegExp(`^(${l.map(s=>jh(s.source)).join("|")})$`)}});const i=a.options.length===1?a.options[0]._zod.run:null;e._zod.parse=(l,s)=>{if(i)return i(l,s);let u=!1;const c=[];for(const d of a.options){const m=d._zod.run({value:l.value,issues:[]},s);if(m instanceof Promise)c.push(m),u=!0;else{if(m.issues.length===0)return m;c.push(m)}}return u?Promise.all(c).then(d=>Sv(d,l,e,s)):Sv(c,l,e,s)}}),P2=ne("$ZodIntersection",(e,a)=>{jt.init(e,a),e._zod.parse=(i,l)=>{const s=i.value,u=a.left._zod.run({value:s,issues:[]},l),c=a.right._zod.run({value:s,issues:[]},l);return u instanceof Promise||c instanceof Promise?Promise.all([u,c]).then(([m,p])=>wv(i,m,p)):wv(i,u,c)}});function oh(e,a){if(e===a)return{valid:!0,data:e};if(e instanceof Date&&a instanceof Date&&+e==+a)return{valid:!0,data:e};if(Co(e)&&Co(a)){const i=Object.keys(a),l=Object.keys(e).filter(u=>i.indexOf(u)!==-1),s={...e,...a};for(const u of l){const c=oh(e[u],a[u]);if(!c.valid)return{valid:!1,mergeErrorPath:[u,...c.mergeErrorPath]};s[u]=c.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(a)){if(e.length!==a.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let l=0;ld.l&&d.r).map(([d])=>d);if(u.length&&s&&e.issues.push({...s,keys:u}),il(e))return e;const c=oh(a.value,i.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return e.value=c.data,e}const Q2=ne("$ZodEnum",(e,a)=>{jt.init(e,a);const i=nb(a.entries),l=new Set(i);e._zod.values=l,e._zod.pattern=new RegExp(`^(${i.filter(s=>e_.has(typeof s)).map(s=>typeof s=="string"?Ju(s):s.toString()).join("|")})$`),e._zod.parse=(s,u)=>{const c=s.value;return l.has(c)||s.issues.push({code:"invalid_value",values:i,input:c,inst:e}),s}}),F2=ne("$ZodTransform",(e,a)=>{jt.init(e,a),e._zod.optin="optional",e._zod.parse=(i,l)=>{if(l.direction==="backward")throw new tb(e.constructor.name);const s=a.transform(i.value,i);if(l.async)return(s instanceof Promise?s:Promise.resolve(s)).then(c=>(i.value=c,i.fallback=!0,i));if(s instanceof Promise)throw new sl;return i.value=s,i.fallback=!0,i}});function _v(e,a){return a===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const bb=ne("$ZodOptional",(e,a)=>{jt.init(e,a),e._zod.optin="optional",e._zod.optout="optional",dt(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),dt(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${jh(i.source)})?$`):void 0}),e._zod.parse=(i,l)=>{if(a.innerType._zod.optin==="optional"){const s=i.value,u=a.innerType._zod.run(i,l);return u instanceof Promise?u.then(c=>_v(c,s)):_v(u,s)}return i.value===void 0?i:a.innerType._zod.run(i,l)}}),Y2=ne("$ZodExactOptional",(e,a)=>{bb.init(e,a),dt(e._zod,"values",)DELIM" -R"DELIM(()=>a.innerType._zod.values),dt(e._zod,"pattern",()=>a.innerType._zod.pattern),e._zod.parse=(i,l)=>a.innerType._zod.run(i,l)}),G2=ne("$ZodNullable",(e,a)=>{jt.init(e,a),dt(e._zod,"optin",()=>a.innerType._zod.optin),dt(e._zod,"optout",()=>a.innerType._zod.optout),dt(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${jh(i.source)}|null)$`):void 0}),dt(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),e._zod.parse=(i,l)=>i.value===null?i:a.innerType._zod.run(i,l)}),K2=ne("$ZodDefault",(e,a)=>{jt.init(e,a),e._zod.optin="optional",dt(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);if(i.value===void 0)return i.value=a.defaultValue,i;const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Ev(u,a)):Ev(s,a)}});function Ev(e,a){return e.value===void 0&&(e.value=a.defaultValue),e}const V2=ne("$ZodPrefault",(e,a)=>{jt.init(e,a),e._zod.optin="optional",dt(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>(l.direction==="backward"||i.value===void 0&&(i.value=a.defaultValue),a.innerType._zod.run(i,l))}),X2=ne("$ZodNonOptional",(e,a)=>{jt.init(e,a),dt(e._zod,"values",()=>{const i=a.innerType._zod.values;return i?new Set([...i].filter(l=>l!==void 0)):void 0}),e._zod.parse=(i,l)=>{const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Tv(u,e)):Tv(s,e)}});function Tv(e,a){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:a}),e}const I2=ne("$ZodCatch",(e,a)=>{jt.init(e,a),e._zod.optin="optional",dt(e._zod,"optout",()=>a.innerType._zod.optout),dt(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>(i.value=u.value,u.issues.length&&(i.value=a.catchValue({...i,error:{issues:u.issues.map(c=>si(c,l,oi()))},input:i.value}),i.issues=[],i.fallback=!0),i)):(i.value=s.value,s.issues.length&&(i.value=a.catchValue({...i,error:{issues:s.issues.map(u=>si(u,l,oi()))},input:i.value}),i.issues=[],i.fallback=!0),i)}}),J2=ne("$ZodPipe",(e,a)=>{jt.init(e,a),dt(e._zod,"values",()=>a.in._zod.values),dt(e._zod,"optin",()=>a.in._zod.optin),dt(e._zod,"optout",()=>a.out._zod.optout),dt(e._zod,"propValues",()=>a.in._zod.propValues),e._zod.parse=(i,l)=>{if(l.direction==="backward"){const u=a.out._zod.run(i,l);return u instanceof Promise?u.then(c=>hu(c,a.in,l)):hu(u,a.in,l)}const s=a.in._zod.run(i,l);return s instanceof Promise?s.then(u=>hu(u,a.out,l)):hu(s,a.out,l)}});function hu(e,a,i){return e.issues.length?(e.aborted=!0,e):a._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},i)}const W2=ne("$ZodReadonly",(e,a)=>{jt.init(e,a),dt(e._zod,"propValues",()=>a.innerType._zod.propValues),dt(e._zod,"values",()=>a.innerType._zod.values),dt(e._zod,"optin",()=>a.innerType?._zod?.optin),dt(e._zod,"optout",()=>a.innerType?._zod?.optout),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(Rv):Rv(s)}});function Rv(e){return e.value=Object.freeze(e.value),e}const eE=ne("$ZodCustom",(e,a)=>{bn.init(e,a),jt.init(e,a),e._zod.parse=(i,l)=>i,e._zod.check=i=>{const l=i.value,s=a.fn(l);if(s instanceof Promise)return s.then(u=>Av(u,i,l,e));Av(s,i,l,e)}});function Av(e,a,i,l){if(!e){const s={code:"custom",input:i,inst:l,path:[...l._zod.def.path??[]],continue:!l._zod.def.abort};l._zod.def.params&&(s.params=l._zod.def.params),a.issues.push(jo(s))}}var zv;class tE{constructor(){this._map=new WeakMap,this._idmap=new Map}add(a,...i){const l=i[0];return this._map.set(a,l),l&&typeof l=="object"&&"id"in l&&this._idmap.set(l.id,a),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(a){const i=this._map.get(a);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(a),this}get(a){const i=a._zod.parent;if(i){const l={...this.get(i)??{}};delete l.id;const s={...l,...this._map.get(a)};return Object.keys(s).length?s:void 0}return this._map.get(a)}has(a){return this._map.has(a)}}function nE(){return new tE}(zv=globalThis).__zod_globalRegistry??(zv.__zod_globalRegistry=nE());const vo=globalThis.__zod_globalRegistry;function aE(e,a){return new e({type:"string",...Ce(a)})}function rE(e,a){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ce(a)})}function Cv(e,a){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(a)})}function iE(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(a)})}function lE(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(a)})}function oE(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(a)})}function sE(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(a)})}function uE(e,a){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ce(a)})}function cE(e,a){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(a)})}function fE(e,a){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(a)})}function dE(e,a){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(a)})}function hE(e,a){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(a)})}function mE(e,a){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(a)})}function pE(e,a){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(a)})}function yE(e,a){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(a)})}function gE(e,a){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(a)})}function vE(e,a){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(a)})}function bE(e,a){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(a)})}function xE(e,a){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(a)})}function SE(e,a){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(a)})}function wE(e,a){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(a)})}function _E(e,a){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(a)})}function EE(e,a){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(a)})}function TE(e,a){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(a)})}function RE(e,a){return new e({type:"string",format:"date",check:"string_format",...Ce(a)})}function AE(e,a){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ce(a)})}function zE(e,a){return new e({type:"string",format:"duration",check:"string_format",...Ce(a)})}function CE(e,a){return new e({type:"number",checks:[],...Ce(a)})}function jE(e,a){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ce(a)})}function NE(e,a){return new e({type:"boolean",...Ce(a)})}function ME(e){return new e({type:"unknown"})}function OE(e,a){return new e({type:"never",...Ce(a)})}function jv(e,a){return new hb({check:"less_than",...Ce(a),value:e,inclusive:!1})}function Td(e,a){return new hb({check:"less_than",...Ce(a),value:e,inclusive:!0})}function Nv(e,a){return new mb({check:"greater_than",...Ce(a),value:e,inclusive:!1})}function Rd(e,a){return new mb({check:"greater_than",...Ce(a),value:e,inclusive:!0})}function Mv(e,a){return new X_({check:"multiple_of",...Ce(a),value:e})}function xb(e,a){return new J_({check:"max_length",...Ce(a),maximum:e})}function $u(e,a){return new W_({check:"min_length",...Ce(a),)DELIM" -R"DELIM(minimum:e})}function Sb(e,a){return new e2({check:"length_equals",...Ce(a),length:e})}function kE(e,a){return new t2({check:"string_format",format:"regex",...Ce(a),pattern:e})}function DE(e){return new n2({check:"string_format",format:"lowercase",...Ce(e)})}function LE(e){return new a2({check:"string_format",format:"uppercase",...Ce(e)})}function BE(e,a){return new r2({check:"string_format",format:"includes",...Ce(a),includes:e})}function UE(e,a){return new i2({check:"string_format",format:"starts_with",...Ce(a),prefix:e})}function HE(e,a){return new l2({check:"string_format",format:"ends_with",...Ce(a),suffix:e})}function pl(e){return new o2({check:"overwrite",tx:e})}function $E(e){return pl(a=>a.normalize(e))}function ZE(){return pl(e=>e.trim())}function qE(){return pl(e=>e.toLowerCase())}function PE(){return pl(e=>e.toUpperCase())}function QE(){return pl(e=>Jw(e))}function FE(e,a,i){return new e({type:"array",element:a,...Ce(i)})}function YE(e,a,i){return new e({type:"custom",check:"custom",fn:a,...Ce(i)})}function GE(e,a){const i=KE(l=>(l.addIssue=s=>{if(typeof s=="string")l.issues.push(jo(s,l.value,i._zod.def));else{const u=s;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=l.value),u.inst??(u.inst=i),u.continue??(u.continue=!i._zod.def.abort),l.issues.push(jo(u))}},e(l.value,l)),a);return i}function KE(e,a){const i=new bn({check:"custom",...Ce(a)});return i._zod.check=e,i}function wb(e){let a=e?.target??"draft-2020-12";return a==="draft-4"&&(a="draft-04"),a==="draft-7"&&(a="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??vo,target:a,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Xt(e,a,i={path:[],schemaPath:[]}){var l;const s=e._zod.def,u=a.seen.get(e);if(u)return u.count++,i.schemaPath.includes(e)&&(u.cycle=i.path),u.schema;const c={schema:{},count:1,cycle:void 0,path:i.path};a.seen.set(e,c);const d=e._zod.toJSONSchema?.();if(d)c.schema=d;else{const b={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(a,c.schema,b);else{const x=c.schema,w=a.processors[s.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);w(e,a,x,b)}const g=e._zod.parent;g&&(c.ref||(c.ref=g),Xt(g,a,b),a.seen.get(g).isParent=!0)}const m=a.metadataRegistry.get(e);return m&&Object.assign(c.schema,m),a.io==="input"&&sn(e)&&(delete c.schema.examples,delete c.schema.default),a.io==="input"&&"_prefault"in c.schema&&((l=c.schema).default??(l.default=c.schema._prefault)),delete c.schema._prefault,a.seen.get(e).schema}function _b(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=new Map;for(const c of e.seen.entries()){const d=e.metadataRegistry.get(c[0])?.id;if(d){const m=l.get(d);if(m&&m!==c[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);l.set(d,c[0])}}const s=c=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=e.external.registry.get(c[0])?.id,x=e.external.uri??(E=>E);if(g)return{ref:x(g)};const w=c[1].defId??c[1].schema.id??`schema${e.counter++}`;return c[1].defId=w,{defId:w,ref:`${x("__shared")}#/${d}/${w}`}}if(c[1]===i)return{ref:"#"};const p=`#/${d}/`,b=c[1].schema.id??`__schema${e.counter++}`;return{defId:b,ref:p+b}},u=c=>{if(c[1].schema.$ref)return;const d=c[1],{ref:m,defId:p}=s(c);d.def={...d.schema},p&&(d.defId=p);const b=d.schema;for(const g in b)delete b[g];b.$ref=m};if(e.cycles==="throw")for(const c of e.seen.entries()){const d=c[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/ + `)}w.write("payload.value = newResult;"),w.write("return payload;");const V=w.compile();return(I,oe)=>V(x,I,oe)};let u;const c=Hu,d=!zh.jitless,p=d&&l_.value,b=a.catchall;let v;e._zod.parse=(x,w)=>{v??(v=l.value);const E=x.value;return c(E)?d&&p&&w?.async===!1&&w.jitless!==!0?(u||(u=s(a.shape)),x=u(x,w),b?Sb([],E,x,w,v,e):x):i(x,w):(x.issues.push({expected:"object",code:"invalid_type",input:E,inst:e}),x)}});function Ev(e,a,i,l){for(const u of e)if(u.issues.length===0)return a.value=u.value,a;const s=e.filter(u=>!ll(u));return s.length===1?(a.value=s[0].value,s[0]):(a.issues.push({code:"invalid_union",input:a.value,inst:i,errors:e.map(u=>u.issues.map(c=>si(c,l,oi())))}),a)}const VE=ee("$ZodUnion",(e,a)=>{Mt.init(e,a),dt(e._zod,"optin",()=>a.options.some(l=>l._zod.optin==="optional")?"optional":void 0),dt(e._zod,"optout",()=>a.options.some(l=>l._zod.optout==="optional")?"optional":void 0),dt(e._zod,"values",()=>{if(a.options.every(l=>l._zod.values))return new Set(a.options.flatMap(l=>Array.from(l._zod.values)))}),dt(e._zod,"pattern",()=>{if(a.options.every(l=>l._zod.pattern)){const l=a.options.map(s=>s._zod.pattern);return new RegExp(`^(${l.map(s=>Ch(s.source)).join("|")})$`)}});const i=a.options.length===1?a.options[0]._zod.run:null;e._zod.parse=(l,s)=>{if(i)return i(l,s);let u=!1;const c=[];for(const d of a.options){const m=d._zod.run({value:l.value,issues:[]},s);if(m instanceof Promise)c.push(m),u=!0;else{if(m.issues.length===0)return m;c.push(m)}}return u?Promise.all(c).then(d=>Ev(d,l,e,s)):Ev(c,l,e,s)}}),XE=ee("$ZodIntersection",(e,a)=>{Mt.init(e,a),e._zod.parse=(i,l)=>{const s=i.value,u=a.left._zod.run({value:s,issues:[]},l),c=a.right._zod.run({value:s,issues:[]},l);return u instanceof Promise||c instanceof Promise?Promise.all([u,c]).then(([m,p])=>Tv(i,m,p)):Tv(i,u,c)}});function sh(e,a){if(e===a)return{valid:!0,data:e};if(e instanceof Date&&a instanceof Date&&+e==+a)return{valid:!0,data:e};if(No(e)&&No(a)){const i=Object.keys(a),l=Object.keys(e).filter(u=>i.indexOf(u)!==-1),s={...e,...a};for(const u of l){const c=sh(e[u],a[u]);if(!c.valid)return{valid:!1,mergeErrorPath:[u,...c.mergeErrorPath]};s[u]=c.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(a)){if(e.length!==a.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let l=0;ld.l&&d.r).map(([d])=>d);if(u.length&&s&&e.issues.push({...s,keys:u}),ll(e))return e;const c=sh(a.value,i.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return e.value=c.data,e}const IE=ee("$ZodEnum",(e,a)=>{Mt.init(e,a);const i=ib(a.entries),l=new Set(i);e._zod.values=l,e._zod.pattern=new RegExp(`^(${i.filter(s=>o_.has(typeof s)).map(s=>typeof s=="string"?Wu(s):s.toString()).join("|")})$`),e._zod.parse=(s,u)=>{const c=s.value;return l.has(c)||s.issues.push({code:"invalid_value",values:i,input:c,inst:e}),s}}),JE=ee("$ZodTransform",(e,a)=>{Mt.init(e,a),e._zod.optin="optional",e._zod.parse=(i,l)=>{if(l.direction==="backward")throw new rb(e.constructor.name);const s=a.transform(i.value,i);if(l.async)return(s instanceof Promise?s:Promise.resolve(s)).then(c=>(i.value=c,i.fallback=!0,i));if(s instanceof Promise)throw new ul;return i.value=s,i.fallback=!0,i}});function Rv(e,a){return a===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const wb=ee("$ZodOptional",(e,a)=>{Mt.init(e,a),e._zod.optin="optional",e._zod.optout="optional",dt(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),dt(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${Ch(i.source)})?$`):void 0}),e._zod.parse=(i,l)=>{if(a.innerType._zod.optin==="optional"){const s=i.value,u=a.innerType._zod.run(i,l);return u instanceof Promise?u.then(c=>Rv(c,s)):Rv(u,s)}return i.value===void 0?i:a.innerType._zod.run(i,l)}}),WE=ee("$ZodExactOptional",(e,a)=>{wb.init(e,a),dt(e._zod,"values",()=>a.innerType._zod.values),dt(e._zod,"pattern",()=>a.innerType._zod.pattern),e._zod.parse=(i,l)=>a.innerType._zod.run(i,l)}),e2=ee("$ZodNullable",(e,a)=>{Mt.init(e,a),dt(e._zod,"optin",()=>a.innerType._zod.optin),dt(e._zod,"optout",()=>a.innerType._zod.optout),dt(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${Ch(i.source)}|null)$`):void 0}),dt(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),e._zod.parse=(i,l)=>i.value===null?i:a.innerType._zod.run(i,l)}),t2=ee("$ZodDefault",(e,a)=>{Mt.init(e,a),e._zod.optin="optional",dt(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);if(i.value===void 0)return i.value=a.defaultValue,i;const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Av(u,a)):Av(s,a)}});function Av(e,a){return e.value===void 0&&(e.value=a.defaultValue),e}const n2=ee("$ZodPrefault",()DELIM" +R"DELIM(e,a)=>{Mt.init(e,a),e._zod.optin="optional",dt(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>(l.direction==="backward"||i.value===void 0&&(i.value=a.defaultValue),a.innerType._zod.run(i,l))}),a2=ee("$ZodNonOptional",(e,a)=>{Mt.init(e,a),dt(e._zod,"values",()=>{const i=a.innerType._zod.values;return i?new Set([...i].filter(l=>l!==void 0)):void 0}),e._zod.parse=(i,l)=>{const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>zv(u,e)):zv(s,e)}});function zv(e,a){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:a}),e}const r2=ee("$ZodCatch",(e,a)=>{Mt.init(e,a),e._zod.optin="optional",dt(e._zod,"optout",()=>a.innerType._zod.optout),dt(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>(i.value=u.value,u.issues.length&&(i.value=a.catchValue({...i,error:{issues:u.issues.map(c=>si(c,l,oi()))},input:i.value}),i.issues=[],i.fallback=!0),i)):(i.value=s.value,s.issues.length&&(i.value=a.catchValue({...i,error:{issues:s.issues.map(u=>si(u,l,oi()))},input:i.value}),i.issues=[],i.fallback=!0),i)}}),i2=ee("$ZodPipe",(e,a)=>{Mt.init(e,a),dt(e._zod,"values",()=>a.in._zod.values),dt(e._zod,"optin",()=>a.in._zod.optin),dt(e._zod,"optout",()=>a.out._zod.optout),dt(e._zod,"propValues",()=>a.in._zod.propValues),e._zod.parse=(i,l)=>{if(l.direction==="backward"){const u=a.out._zod.run(i,l);return u instanceof Promise?u.then(c=>mu(c,a.in,l)):mu(u,a.in,l)}const s=a.in._zod.run(i,l);return s instanceof Promise?s.then(u=>mu(u,a.out,l)):mu(s,a.out,l)}});function mu(e,a,i){return e.issues.length?(e.aborted=!0,e):a._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},i)}const l2=ee("$ZodReadonly",(e,a)=>{Mt.init(e,a),dt(e._zod,"propValues",()=>a.innerType._zod.propValues),dt(e._zod,"values",()=>a.innerType._zod.values),dt(e._zod,"optin",()=>a.innerType?._zod?.optin),dt(e._zod,"optout",()=>a.innerType?._zod?.optout),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(jv):jv(s)}});function jv(e){return e.value=Object.freeze(e.value),e}const o2=ee("$ZodCustom",(e,a)=>{bn.init(e,a),Mt.init(e,a),e._zod.parse=(i,l)=>i,e._zod.check=i=>{const l=i.value,s=a.fn(l);if(s instanceof Promise)return s.then(u=>Nv(u,i,l,e));Nv(s,i,l,e)}});function Nv(e,a,i,l){if(!e){const s={code:"custom",input:i,inst:l,path:[...l._zod.def.path??[]],continue:!l._zod.def.abort};l._zod.def.params&&(s.params=l._zod.def.params),a.issues.push(Co(s))}}var Cv;class s2{constructor(){this._map=new WeakMap,this._idmap=new Map}add(a,...i){const l=i[0];return this._map.set(a,l),l&&typeof l=="object"&&"id"in l&&this._idmap.set(l.id,a),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(a){const i=this._map.get(a);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(a),this}get(a){const i=a._zod.parent;if(i){const l={...this.get(i)??{}};delete l.id;const s={...l,...this._map.get(a)};return Object.keys(s).length?s:void 0}return this._map.get(a)}has(a){return this._map.has(a)}}function u2(){return new s2}(Cv=globalThis).__zod_globalRegistry??(Cv.__zod_globalRegistry=u2());const vo=globalThis.__zod_globalRegistry;function c2(e,a){return new e({type:"string",...Ne(a)})}function f2(e,a){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ne(a)})}function Mv(e,a){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ne(a)})}function d2(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ne(a)})}function h2(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ne(a)})}function m2(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ne(a)})}function p2(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ne(a)})}function y2(e,a){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ne(a)})}function g2(e,a){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ne(a)})}function v2(e,a){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ne(a)})}function b2(e,a){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ne(a)})}function x2(e,a){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ne(a)})}function S2(e,a){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ne(a)})}function w2(e,a){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ne(a)})}function _2(e,a){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ne(a)})}function E2(e,a){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ne(a)})}function T2(e,a){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ne(a)})}function R2(e,a){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ne(a)})}function A2(e,a){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ne(a)})}function z2(e,a){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ne(a)})}function j2(e,a){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ne(a)})}function N2(e,a){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ne(a)})}function C2(e,a){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ne(a)})}function M2(e,a){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ne(a)})}function O2(e,a){return new e({type:"string",format:"date",check:"string_format",...Ne(a)})}function k2(e,a){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ne(a)})}function D2(e,a){return new e({type:"string",format:"duration",check:"string_format",...Ne(a)})}function L2(e,a){return new e({type:"number",checks:[],...Ne(a)})}function B2(e,a){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ne(a)})}function U2(e,a){return new e({type:"boolean",...Ne(a)})}function H2(e){return new e({type:"unknown"})}function $2(e,a){return new e({type:"never",...Ne(a)})}function Ov(e,a){return new yb({check:"less_than",...Ne(a),value:e,inclusive:!1})}function Td(e,a){return new yb({check:"less_than",...Ne(a),value:e,inclusive:!0})}function kv(e,a){return new gb({check:"greater_than",...Ne(a),value:e,inclusive:!1})}function Rd(e,a){return new gb({check:"greater_than",...Ne(a),value:e,inclusive:!0})}function Dv(e,a){return new aE({check:"multiple_of",...Ne(a),value:e})}function _b(e,a){return new iE({check:"max_length",...Ne(a),maximum:e})}function Zu(e,a){return new lE({check:"min_length",...Ne(a),minimum:e})}function Eb(e,a){return new oE({check:"length_equals",...Ne(a),length:e})}function Z2(e,a){return new sE({check:"string_format",format:"regex",...Ne(a),pattern:e})}function q2(e){return new uE({check:"string_format",format:"lowercase",...Ne(e)})}function P2(e){return new cE({check:"string_format",format:"uppercase",...Ne(e)})}function Q2(e,a){return new fE({check:"string_format",format:"includes",...Ne(a),includes:e})}function F2(e,a){return new dE({check:"string_format",format:"starts_with",...Ne(a),prefix:e})}function Y2(e,a){return new hE({check:"string_format",format:"ends_with",...Ne(a),suffix:e})}function gl(e){return new mE({check:"overwrite",tx:e})}function G2(e){return gl(a=>a.normalize(e))}function K2(){return gl(e=>e.trim())}function V2(){return gl(e=>e.toLowerCase())}function X2(){return gl(e=>e.toUpperCase())}function I2(){return gl(e=>i_(e))}function J2(e,a,i){return new e({type:"array",element:a,...Ne(i)})}function W2(e,a,i){return new e({ty)DELIM" +R"DELIM(pe:"custom",check:"custom",fn:a,...Ne(i)})}function eT(e,a){const i=tT(l=>(l.addIssue=s=>{if(typeof s=="string")l.issues.push(Co(s,l.value,i._zod.def));else{const u=s;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=l.value),u.inst??(u.inst=i),u.continue??(u.continue=!i._zod.def.abort),l.issues.push(Co(u))}},e(l.value,l)),a);return i}function tT(e,a){const i=new bn({check:"custom",...Ne(a)});return i._zod.check=e,i}function Tb(e){let a=e?.target??"draft-2020-12";return a==="draft-4"&&(a="draft-04"),a==="draft-7"&&(a="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??vo,target:a,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Xt(e,a,i={path:[],schemaPath:[]}){var l;const s=e._zod.def,u=a.seen.get(e);if(u)return u.count++,i.schemaPath.includes(e)&&(u.cycle=i.path),u.schema;const c={schema:{},count:1,cycle:void 0,path:i.path};a.seen.set(e,c);const d=e._zod.toJSONSchema?.();if(d)c.schema=d;else{const b={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(a,c.schema,b);else{const x=c.schema,w=a.processors[s.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);w(e,a,x,b)}const v=e._zod.parent;v&&(c.ref||(c.ref=v),Xt(v,a,b),a.seen.get(v).isParent=!0)}const m=a.metadataRegistry.get(e);return m&&Object.assign(c.schema,m),a.io==="input"&&on(e)&&(delete c.schema.examples,delete c.schema.default),a.io==="input"&&"_prefault"in c.schema&&((l=c.schema).default??(l.default=c.schema._prefault)),delete c.schema._prefault,a.seen.get(e).schema}function Rb(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=new Map;for(const c of e.seen.entries()){const d=e.metadataRegistry.get(c[0])?.id;if(d){const m=l.get(d);if(m&&m!==c[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);l.set(d,c[0])}}const s=c=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=e.external.registry.get(c[0])?.id,x=e.external.uri??(E=>E);if(v)return{ref:x(v)};const w=c[1].defId??c[1].schema.id??`schema${e.counter++}`;return c[1].defId=w,{defId:w,ref:`${x("__shared")}#/${d}/${w}`}}if(c[1]===i)return{ref:"#"};const p=`#/${d}/`,b=c[1].schema.id??`__schema${e.counter++}`;return{defId:b,ref:p+b}},u=c=>{if(c[1].schema.$ref)return;const d=c[1],{ref:m,defId:p}=s(c);d.def={...d.schema},p&&(d.defId=p);const b=d.schema;for(const v in b)delete b[v];b.$ref=m};if(e.cycles==="throw")for(const c of e.seen.entries()){const d=c[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const c of e.seen.entries()){const d=c[1];if(a===c[0]){u(c);continue}if(e.external){const p=e.external.registry.get(c[0])?.id;if(a!==c[0]&&p){u(c);continue}}if(e.metadataRegistry.get(c[0])?.id){u(c);continue}if(d.cycle){u(c);continue}if(d.count>1&&e.reused==="ref"){u(c);continue}}}function Eb(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=d=>{const m=e.seen.get(d);if(m.ref===null)return;const p=m.def??m.schema,b={...p},g=m.ref;if(m.ref=null,g){l(g);const w=e.seen.get(g),E=w.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(E)):Object.assign(p,E),Object.assign(p,b),d._zod.parent===g)for(const N in p)N==="$ref"||N==="allOf"||N in b||delete p[N];if(E.$ref&&w.def)for(const N in p)N==="$ref"||N==="allOf"||N in w.def&&JSON.stringify(p[N])===JSON.stringify(w.def[N])&&delete p[N]}const x=d._zod.parent;if(x&&x!==g){l(x);const w=e.seen.get(x);if(w?.schema.$ref&&(p.$ref=w.schema.$ref,w.def))for(const E in p)E==="$ref"||E==="allOf"||E in w.def&&JSON.stringify(p[E])===JSON.stringify(w.def[E])&&delete p[E]}e.override({zodSchema:d,jsonSchema:p,path:m.path??[]})};for(const d of[...e.seen.entries()].reverse())l(d[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(a)?.id;if(!d)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(d)}Object.assign(s,i.def??i.schema);const u=e.metadataRegistry.get(a)?.id;u!==void 0&&s.id===u&&delete s.id;const c=e.external?.defs??{};for(const d of e.seen.entries()){const m=d[1];m.def&&m.defId&&(m.def.id===m.defId&&delete m.def.id,c[m.defId]=m.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?s.$defs=c:s.definitions=c);try{const d=JSON.parse(JSON.stringify(s));return Object.defineProperty(d,"~standard",{value:{...a["~standard"],jsonSchema:{input:Zu(a,"input",e.processors),output:Zu(a,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function sn(e,a){const i=a??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const l=e._zod.def;if(l.type==="transform")return!0;if(l.type==="array")return sn(l.element,i);if(l.type==="set")return sn(l.valueType,i);if(l.type==="lazy")return sn(l.getter(),i);if(l.type==="promise"||l.type==="optional"||l.type==="nonoptional"||l.type==="nullable"||l.type==="readonly"||l.type==="default"||l.type==="prefault")return sn(l.innerType,i);if(l.type==="intersection")return sn(l.left,i)||sn(l.right,i);if(l.type==="record"||l.type==="map")return sn(l.keyType,i)||sn(l.valueType,i);if(l.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:sn(l.in,i)||sn(l.out,i);if(l.type==="object"){for(const s in l.shape)if(sn(l.shape[s],i))return!0;return!1}if(l.type==="union"){for(const s of l.options)if(sn(s,i))return!0;return!1}if(l.type==="tuple"){for(const s of l.items)if(sn(s,i))return!0;return!!(l.rest&&sn(l.rest,i))}return!1}const VE=(e,a={})=>i=>{const l=wb({...i,processors:a});return Xt(e,l),_b(l,e),Eb(l,e)},Zu=(e,a,i={})=>l=>{const{libraryOptions:s,target:u}=l??{},c=wb({...s??{},target:u,io:a,processors:i});return Xt(e,c),_b(c,e),Eb(c,e)},XE={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},IE=(e,a,i,l)=>{const s=i;s.type="string";const{minimum:u,maximum:c,format:d,patterns:m,contentEncoding:p}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof c=="number"&&(s.maxLength=c),d&&(s.format=XE[d]??d,s.format===""&&delete s.format,d==="time"&&delete s.format),p&&(s.contentEncoding=p),m&&m.size>0){const b=[...m];b.length===1?s.pattern=b[0].source:b.length>1&&(s.allOf=[...b.map(g=>({...a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},JE=(e,a,i,l)=>{const s=i,{minimum:u,maximum:c,format:d,)DELIM" -R"DELIM(multipleOf:m,exclusiveMaximum:p,exclusiveMinimum:b}=e._zod.bag;typeof d=="string"&&d.includes("int")?s.type="integer":s.type="number";const g=typeof b=="number"&&b>=(u??Number.NEGATIVE_INFINITY),x=typeof p=="number"&&p<=(c??Number.POSITIVE_INFINITY),w=a.target==="draft-04"||a.target==="openapi-3.0";g?w?(s.minimum=b,s.exclusiveMinimum=!0):s.exclusiveMinimum=b:typeof u=="number"&&(s.minimum=u),x?w?(s.maximum=p,s.exclusiveMaximum=!0):s.exclusiveMaximum=p:typeof c=="number"&&(s.maximum=c),typeof m=="number"&&(s.multipleOf=m)},WE=(e,a,i,l)=>{i.type="boolean"},eT=(e,a,i,l)=>{i.not={}},tT=(e,a,i,l)=>{},nT=(e,a,i,l)=>{const s=e._zod.def,u=nb(s.entries);u.every(c=>typeof c=="number")&&(i.type="number"),u.every(c=>typeof c=="string")&&(i.type="string"),i.enum=u},aT=(e,a,i,l)=>{if(a.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},rT=(e,a,i,l)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},iT=(e,a,i,l)=>{const s=i,u=e._zod.def,{minimum:c,maximum:d}=e._zod.bag;typeof c=="number"&&(s.minItems=c),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=Xt(u.element,a,{...l,path:[...l.path,"items"]})},lT=(e,a,i,l)=>{const s=i,u=e._zod.def;s.type="object",s.properties={};const c=u.shape;for(const p in c)s.properties[p]=Xt(c[p],a,{...l,path:[...l.path,"properties",p]});const d=new Set(Object.keys(c)),m=new Set([...d].filter(p=>{const b=u.shape[p]._zod;return a.io==="input"?b.optin===void 0:b.optout===void 0}));m.size>0&&(s.required=Array.from(m)),u.catchall?._zod.def.type==="never"?s.additionalProperties=!1:u.catchall?u.catchall&&(s.additionalProperties=Xt(u.catchall,a,{...l,path:[...l.path,"additionalProperties"]})):a.io==="output"&&(s.additionalProperties=!1)},oT=(e,a,i,l)=>{const s=e._zod.def,u=s.inclusive===!1,c=s.options.map((d,m)=>Xt(d,a,{...l,path:[...l.path,u?"oneOf":"anyOf",m]}));u?i.oneOf=c:i.anyOf=c},sT=(e,a,i,l)=>{const s=e._zod.def,u=Xt(s.left,a,{...l,path:[...l.path,"allOf",0]}),c=Xt(s.right,a,{...l,path:[...l.path,"allOf",1]}),d=p=>"allOf"in p&&Object.keys(p).length===1,m=[...d(u)?u.allOf:[u],...d(c)?c.allOf:[c]];i.allOf=m},uT=(e,a,i,l)=>{const s=e._zod.def,u=Xt(s.innerType,a,l),c=a.seen.get(e);a.target==="openapi-3.0"?(c.ref=s.innerType,i.nullable=!0):i.anyOf=[u,{type:"null"}]},cT=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType},fT=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,i.default=JSON.parse(JSON.stringify(s.defaultValue))},dT=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,a.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},hT=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType;let c;try{c=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=c},mT=(e,a,i,l)=>{const s=e._zod.def,u=s.in._zod.traits.has("$ZodTransform"),c=a.io==="input"?u?s.out:s.in:s.out;Xt(c,a,l);const d=a.seen.get(e);d.ref=c},pT=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,i.readOnly=!0},Tb=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType},yT=ne("ZodISODateTime",(e,a)=>{S2.init(e,a),wt.init(e,a)});function gT(e){return TE(yT,e)}const vT=ne("ZodISODate",(e,a)=>{w2.init(e,a),wt.init(e,a)});function bT(e){return RE(vT,e)}const xT=ne("ZodISOTime",(e,a)=>{_2.init(e,a),wt.init(e,a)});function ST(e){return AE(xT,e)}const wT=ne("ZodISODuration",(e,a)=>{E2.init(e,a),wt.init(e,a)});function _T(e){return zE(wT,e)}const ET=(e,a)=>{ob.init(e,a),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>d_(e,i)},flatten:{value:i=>f_(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,lh,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,lh,2)}},isEmpty:{get(){return e.issues.length===0}}})},Kn=ne("ZodError",ET,{Parent:Error}),TT=Mh(Kn),RT=Oh(Kn),AT=Wu(Kn),zT=ec(Kn),CT=p_(Kn),jT=y_(Kn),NT=g_(Kn),MT=v_(Kn),OT=b_(Kn),kT=x_(Kn),DT=S_(Kn),LT=w_(Kn),Ov=new WeakMap;function $o(e,a,i){const l=Object.getPrototypeOf(e);let s=Ov.get(l);if(s||(s=new Set,Ov.set(l,s)),!s.has(a)){s.add(a);for(const u in i){const c=i[u];Object.defineProperty(l,u,{configurable:!0,enumerable:!1,get(){const d=c.bind(this);return Object.defineProperty(this,u,{configurable:!0,writable:!0,enumerable:!0,value:d}),d},set(d){Object.defineProperty(this,u,{configurable:!0,writable:!0,enumerable:!0,value:d})}})}}}const Nt=ne("ZodType",(e,a)=>(jt.init(e,a),Object.assign(e["~standard"],{jsonSchema:{input:Zu(e,"input"),output:Zu(e,"output")}}),e.toJSONSchema=VE(e,{}),e.def=a,e.type=a.type,Object.defineProperty(e,"_def",{value:a}),e.parse=(i,l)=>TT(e,i,l,{callee:e.parse}),e.safeParse=(i,l)=>AT(e,i,l),e.parseAsync=async(i,l)=>RT(e,i,l,{callee:e.parseAsync}),e.safeParseAsync=async(i,l)=>zT(e,i,l),e.spa=e.safeParseAsync,e.encode=(i,l)=>CT(e,i,l),e.decode=(i,l)=>jT(e,i,l),e.encodeAsync=async(i,l)=>NT(e,i,l),e.decodeAsync=async(i,l)=>MT(e,i,l),e.safeEncode=(i,l)=>OT(e,i,l),e.safeDecode=(i,l)=>kT(e,i,l),e.safeEncodeAsync=async(i,l)=>DT(e,i,l),e.safeDecodeAsync=async(i,l)=>LT(e,i,l),$o(e,"ZodType",{check(...i){const l=this.def;return this.clone(Or(l,{checks:[...l.checks??[],...i.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...i){return this.check(...i)},clone(i,l){return kr(this,i,l)},brand(){return this},register(i,l){return i.add(this,l),this},refine(i,l){return this.check(C4(i,l))},superRefine(i,l){return this.check(j4(i,l))},overwrite(i){return this.check(pl(i))},optional(){return Bv(this)},exactOptional(){return y4(this)},nullable(){return Uv(this)},nullish(){return Bv(Uv(this))},nonoptional(i){return w4(this,i)},array(){return dl(this)},or(i){return u4([this,i])},and(i){return f4(this,i)},transform(i){return Hv(this,m4(i))},default(i){return b4(this,i)},prefault(i){return S4(this,i)},catch(i){return E4(this,i)},pipe(i){return Hv(this,i)},readonly(){return A4(this)},describe(i){const l=this.clone();return vo.add(l,{description:i}),l},meta(...i){if(i.length===0)return vo.get(this);const l=this.clone();return vo.add(l,i[0]),l},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(i){return i(this)}}),Object.defineProperty(e,"description",{get(){return vo.get(e)?.description},configurable:!0}),e)),Rb=ne("_ZodString",(e,a)=>{kh.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(l,s,u)=>IE(e,l,s);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,$o(e,"_ZodString",{regex(...l){return this.check(kE(...l))},includes(...l){return this.check(BE(...l))},startsWith(...l){return this.check(UE(...l))},endsWith(...l){return this.check(HE(...l))},min(...l){return this.check($u(...l))},max(...l){return this.check(xb(...l))},length(...l){return this.check(Sb(...l))},nonempty(...l){return this.check($u(1,...l))},lowercase(l){return this.check(DE(l))},uppercase(l){return this.check(LE(l))},trim(){return this.check(ZE())},normalize(...l){return this.check($E(...l))},toLowerCase(){return this.check(qE())},toUpperCase(){return this.check(PE())},slugify(){return this.check(QE())}})}),BT=ne("ZodString",(e,a)=>{kh.init(e,a),Rb.init(e,a),e.email=i=>e.check(rE(UT,i)),e.url=i=>e.check(uE(HT,i)),e.jwt=i=>e.check(EE(e4,i)),e.emoji=i=>e.check(cE($T,i)),e.guid=i=>e.check(Cv(kv,i)),e.uuid=i=>e.check(iE(mu,i)),e.uuidv4=i=>e.check(lE(mu,i)),e.uuidv6=i=>e.check(oE(mu,i)),e.uuidv7=i=>e.check(sE(mu,i)),e.nanoid=i=>e.check(fE(ZT,i)),e.guid=i=>e.check(Cv(kv,i)),e.cuid=i=>e.check(dE(qT,i)),e.cuid2=i=>e.check(hE(PT,i)),e.ulid=i=>e.check(mE(QT,i)),e.base64=i=>e.check(SE(IT,i)),e.base64url=i=>e.check(wE(JT,i)),e.xid=i=>e.check(pE(FT,i)),e.ksuid=i=>e.check(yE(YT,i)),e.ipv4=i=>e.check(gE(GT,i)),e.ipv6=i=>e.check(vE(KT,i)),)DELIM" -R"DELIM(e.cidrv4=i=>e.check(bE(VT,i)),e.cidrv6=i=>e.check(xE(XT,i)),e.e164=i=>e.check(_E(WT,i)),e.datetime=i=>e.check(gT(i)),e.date=i=>e.check(bT(i)),e.time=i=>e.check(ST(i)),e.duration=i=>e.check(_T(i))});function Ht(e){return aE(BT,e)}const wt=ne("ZodStringFormat",(e,a)=>{xt.init(e,a),Rb.init(e,a)}),UT=ne("ZodEmail",(e,a)=>{d2.init(e,a),wt.init(e,a)}),kv=ne("ZodGUID",(e,a)=>{c2.init(e,a),wt.init(e,a)}),mu=ne("ZodUUID",(e,a)=>{f2.init(e,a),wt.init(e,a)}),HT=ne("ZodURL",(e,a)=>{h2.init(e,a),wt.init(e,a)}),$T=ne("ZodEmoji",(e,a)=>{m2.init(e,a),wt.init(e,a)}),ZT=ne("ZodNanoID",(e,a)=>{p2.init(e,a),wt.init(e,a)}),qT=ne("ZodCUID",(e,a)=>{y2.init(e,a),wt.init(e,a)}),PT=ne("ZodCUID2",(e,a)=>{g2.init(e,a),wt.init(e,a)}),QT=ne("ZodULID",(e,a)=>{v2.init(e,a),wt.init(e,a)}),FT=ne("ZodXID",(e,a)=>{b2.init(e,a),wt.init(e,a)}),YT=ne("ZodKSUID",(e,a)=>{x2.init(e,a),wt.init(e,a)}),GT=ne("ZodIPv4",(e,a)=>{T2.init(e,a),wt.init(e,a)}),KT=ne("ZodIPv6",(e,a)=>{R2.init(e,a),wt.init(e,a)}),VT=ne("ZodCIDRv4",(e,a)=>{A2.init(e,a),wt.init(e,a)}),XT=ne("ZodCIDRv6",(e,a)=>{z2.init(e,a),wt.init(e,a)}),IT=ne("ZodBase64",(e,a)=>{C2.init(e,a),wt.init(e,a)}),JT=ne("ZodBase64URL",(e,a)=>{N2.init(e,a),wt.init(e,a)}),WT=ne("ZodE164",(e,a)=>{M2.init(e,a),wt.init(e,a)}),e4=ne("ZodJWT",(e,a)=>{k2.init(e,a),wt.init(e,a)}),Ab=ne("ZodNumber",(e,a)=>{yb.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(l,s,u)=>JE(e,l,s),$o(e,"ZodNumber",{gt(l,s){return this.check(Nv(l,s))},gte(l,s){return this.check(Rd(l,s))},min(l,s){return this.check(Rd(l,s))},lt(l,s){return this.check(jv(l,s))},lte(l,s){return this.check(Td(l,s))},max(l,s){return this.check(Td(l,s))},int(l){return this.check(Dv(l))},safe(l){return this.check(Dv(l))},positive(l){return this.check(Nv(0,l))},nonnegative(l){return this.check(Rd(0,l))},negative(l){return this.check(jv(0,l))},nonpositive(l){return this.check(Td(0,l))},multipleOf(l,s){return this.check(Mv(l,s))},step(l,s){return this.check(Mv(l,s))},finite(){return this}});const i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function Je(e){return CE(Ab,e)}const t4=ne("ZodNumberFormat",(e,a)=>{D2.init(e,a),Ab.init(e,a)});function Dv(e){return jE(t4,e)}const n4=ne("ZodBoolean",(e,a)=>{L2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>WE(e,i,l)});function Dh(e){return NE(n4,e)}const a4=ne("ZodUnknown",(e,a)=>{B2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>tT()});function Lv(){return ME(a4)}const r4=ne("ZodNever",(e,a)=>{U2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>eT(e,i,l)});function i4(e){return OE(r4,e)}const l4=ne("ZodArray",(e,a)=>{H2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>iT(e,i,l,s),e.element=a.element,$o(e,"ZodArray",{min(i,l){return this.check($u(i,l))},nonempty(i){return this.check($u(1,i))},max(i,l){return this.check(xb(i,l))},length(i,l){return this.check(Sb(i,l))},unwrap(){return this.element}})});function dl(e,a){return FE(l4,e,a)}const o4=ne("ZodObject",(e,a)=>{Z2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>lT(e,i,l,s),dt(e,"shape",()=>a.shape),$o(e,"ZodObject",{keyof(){return d4(Object.keys(this._zod.def.shape))},catchall(i){return this.clone({...this._zod.def,catchall:i})},passthrough(){return this.clone({...this._zod.def,catchall:Lv()})},loose(){return this.clone({...this._zod.def,catchall:Lv()})},strict(){return this.clone({...this._zod.def,catchall:i4()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(i){return i_(this,i)},safeExtend(i){return l_(this,i)},merge(i){return o_(this,i)},pick(i){return a_(this,i)},omit(i){return r_(this,i)},partial(...i){return s_(zb,this,i[0])},required(...i){return u_(Cb,this,i[0])}})});function va(e,a){const i={type:"object",shape:e??{},...Ce(a)};return new o4(i)}const s4=ne("ZodUnion",(e,a)=>{q2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>oT(e,i,l,s),e.options=a.options});function u4(e,a){return new s4({type:"union",options:e,...Ce(a)})}const c4=ne("ZodIntersection",(e,a)=>{P2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>sT(e,i,l,s)});function f4(e,a){return new c4({type:"intersection",left:e,right:a})}const sh=ne("ZodEnum",(e,a)=>{Q2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(l,s,u)=>nT(e,l,s),e.enum=a.entries,e.options=Object.values(a.entries);const i=new Set(Object.keys(a.entries));e.extract=(l,s)=>{const u={};for(const c of l)if(i.has(c))u[c]=a.entries[c];else throw new Error(`Key ${c} not found in enum`);return new sh({...a,checks:[],...Ce(s),entries:u})},e.exclude=(l,s)=>{const u={...a.entries};for(const c of l)if(i.has(c))delete u[c];else throw new Error(`Key ${c} not found in enum`);return new sh({...a,checks:[],...Ce(s),entries:u})}});function d4(e,a){const i=Array.isArray(e)?Object.fromEntries(e.map(l=>[l,l])):e;return new sh({type:"enum",entries:i,...Ce(a)})}const h4=ne("ZodTransform",(e,a)=>{F2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>rT(e,i),e._zod.parse=(i,l)=>{if(l.direction==="backward")throw new tb(e.constructor.name);i.addIssue=u=>{if(typeof u=="string")i.issues.push(jo(u,i.value,a));else{const c=u;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=i.value),c.inst??(c.inst=e),i.issues.push(jo(c))}};const s=a.transform(i.value,i);return s instanceof Promise?s.then(u=>(i.value=u,i.fallback=!0,i)):(i.value=s,i.fallback=!0,i)}});function m4(e){return new h4({type:"transform",transform:e})}const zb=ne("ZodOptional",(e,a)=>{bb.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>Tb(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function Bv(e){return new zb({type:"optional",innerType:e})}const p4=ne("ZodExactOptional",(e,a)=>{Y2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>Tb(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function y4(e){return new p4({type:"optional",innerType:e})}const g4=ne("ZodNullable",(e,a)=>{G2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>uT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function Uv(e){return new g4({type:"nullable",innerType:e})}const v4=ne("ZodDefault",(e,a)=>{K2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>fT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function b4(e,a){return new v4({type:"default",innerType:e,get defaultValue(){return typeof a=="function"?a():rb(a)}})}const x4=ne("ZodPrefault",(e,a)=>{V2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>dT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function S4(e,a){return new x4({type:"prefault",innerType:e,get defaultValue(){return typeof a=="function"?a():rb(a)}})}const Cb=ne("ZodNonOptional",(e,a)=>{X2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>cT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function w4(e,a){return new Cb({type:"nonoptional",innerType:e,...Ce(a)})}const _4=ne("ZodCatch",(e,a)=>{I2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>hT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function E4(e,a){return new _4({type:"catch",innerType:e,catchValue:typeof a=="function"?a:()=>a})}const T4=ne("ZodPipe",(e,a)=>{J2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>mT(e,i,l,s),e.in=a.in,e.out=a.out});function Hv(e,a){return new T4({type:"pipe",in:e,out:a})}const R4=ne("ZodReadonly",(e,a)=>{W2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>pT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function A4(e){return new R4({type:"readonly",innerType:e})}const z4=ne("ZodCustom",(e,a)=>{eE.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>aT(e,i)});function C4(e,a={}){return YE(z4,e,a)}function j4(e,a){return GE(e,a)}function ui(e){if(!e)return;const a=e.trim();if(!a)return;const i=a.toLowerCase(),l=i.indexOf("1");if(l>0){const c=i.slice(0,l);)DELIM" -R"DELIM(if(["bc","tb","bcrt","ltc","sb"].includes(c)){const d=i.slice(l+1);if(!d)return;const m=d.charAt(0);return m==="p"?"p2tr":m==="q"?d.length===39||d.length===40||e.length===42?"p2wpkh":d.length===59||d.length===60||e.length===62?"p2wsh":"segwit":"segwit"}}const s=/^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/u.test(a)&&a.length>=26&&a.length<=35;switch(i[0]){case"1":case"m":case"n":return s?"p2pkh":void 0;case"3":case"2":return s?"p2sh":void 0;default:return}}class Lh extends Error{constructor(a,i){super(a),this.status=i}status}const uh=va({id:Ht(),height:Je(),timestamp:Je().optional(),mediantime:Je().optional(),tx_count:Je().optional(),size:Je().optional(),weight:Je().optional(),difficulty:Je().optional(),bits:Je().optional(),merkle_root:Ht().optional(),previousblockhash:Ht().nullable().optional(),nonce:Je().optional(),version:Je().optional()}).loose(),N4=va({confirmed:Dh(),block_height:Je().optional(),block_hash:Ht().optional(),block_time:Je().optional()}),M4=va({txid:Ht().optional().nullable(),vout:Je().optional().nullable(),sequence:Je().optional(),scriptsig:Ht().optional().nullable(),scriptsig_asm:Ht().optional().nullable(),witness:dl(Ht()).optional(),is_coinbase:Dh().optional(),prevout:va({scriptpubkey_type:Ht().optional(),scriptpubkey_address:Ht().optional(),scriptpubkey:Ht().optional(),scriptpubkey_asm:Ht().optional(),value:Je().optional()}).partial().nullable().optional()}).loose(),O4=va({scriptpubkey_type:Ht().optional(),scriptpubkey_address:Ht().optional(),scriptpubkey:Ht().optional(),scriptpubkey_asm:Ht().optional(),value:Je(),n:Je().optional()}).loose(),Tu=va({txid:Ht(),hash:Ht().optional(),fee:Je().optional(),version:Je(),locktime:Je(),vin:dl(M4),vout:dl(O4),size:Je(),weight:Je(),status:N4}).loose(),Bh=dl(uh),qu=dl(Tu),$v=va({in_best_chain:Dh(),next_best:Ht().optional(),height:Je().optional()}),Zv=va({address:Ht(),chain_stats:va({funded_txo_count:Je().optional(),funded_txo_sum:Je().optional(),spent_txo_count:Je().optional(),spent_txo_sum:Je().optional(),tx_count:Je().optional()}),mempool_stats:va({funded_txo_count:Je().optional(),funded_txo_sum:Je().optional(),spent_txo_count:Je().optional(),spent_txo_sum:Je().optional(),tx_count:Je().optional()})});async function en(e,a,i){const l=a.startsWith("/")?a:`/${a}`,s=await fetch(`${e}${l}`);if(!s.ok)throw new Lh(`Request to ${a} failed with status ${String(s.status)}`,s.status);const u=await s.json();return i.parse(u)}async function qv(e,a,i){if(i<=0)return[];const l=[];let s=a;for(;s&&l.lengthu.scriptpubkey_address===e?s+u.value:s,0),l=a.vin.reduce((s,u)=>{const c=u.prevout;return c?.scriptpubkey_address===e&&typeof c.value=="number"?s+c.value:s},0);return i-l}async function Ad(e,a){if(a==="latest"||a==="tip"){const i=await en(e,"/blocks",Bh);if(i.length===0)throw new Error("No blocks returned from API");return i[0].id}if(/^\d+$/.test(a)){const i=await fetch(`${e}/block-height/${a}`);if(!i.ok)throw new Lh("Unable to resolve block height",i.status);return(await i.text()).trim()}return a}async function Qv(e,a,i){if(i.lastKnownHeight==null||a>=i.lastKnownHeight)return null;const l=a+1;try{const s=await fetch(`${e}/block-height/${String(l)}`);return s.ok&&(await s.text()).trim()||null}catch(s){return console.warn(`Failed to resolve hash for height ${String(l)}`,s),null}}function co(e){return{hash:e.id,height:e.height,timestamp:e.timestamp??e.mediantime??0,txCount:e.tx_count??0,size:e.size??0,weight:e.weight??0,difficulty:e.difficulty,previousBlockHash:e.previousblockhash??null}}function zd(e,a){const i=e.status.confirmed?"confirmed":"unconfirmed",l=e.vin.map((m,p)=>{const b=m.is_coinbase||m.txid==null?void 0:typeof m.vout=="number"&&m.vout!==4294967295?m.vout:void 0;return{index:p,prevTxId:m.txid??void 0,prevOutputIndex:b,address:m.prevout?.scriptpubkey_address??void 0,valueSats:m.prevout?.value,scriptType:m.prevout?.scriptpubkey_type,isCoinbase:m.is_coinbase??!1,script:m.scriptsig||m.scriptsig_asm?{hex:m.scriptsig??void 0,mnemonic:m.scriptsig_asm??void 0}:void 0,witness:m.witness??void 0,sequence:m.sequence}}),s=e.vout.map((m,p)=>({index:p,address:m.scriptpubkey_address??void 0,valueSats:m.value,scriptType:m.scriptpubkey_type,spent:void 0,script:m.scriptpubkey||m.scriptpubkey_asm?{hex:m.scriptpubkey??void 0,mnemonic:m.scriptpubkey_asm??void 0}:void 0})),u=s.reduce((m,p)=>m+p.valueSats,0),c=a.lastKnownHeight;let d=0;return e.status.block_height&&i==="confirmed"&&(d=c&&c>=e.status.block_height?c-e.status.block_height+1:1),{txid:e.txid,hash:e.hash??e.txid,status:i,confirmations:d,blockHeight:e.status.block_height,blockHash:e.status.block_hash,receivedTime:e.status.block_time,feeSats:e.fee??null,feeRate:e.fee?e.fee/e.weight*4:null,size:e.size,weight:e.weight,version:e.version,locktime:e.locktime,totalInput:null,totalOutput:u,inputs:l,outputs:s}}function D4(e,a){const i=e.chain_stats,l=e.mempool_stats,s=(i.funded_txo_sum??0)-(i.spent_txo_sum??0),u=jb(e.address,a.slice(0,25));return{address:e.address,addressType:ui(e.address),balance:s,totalReceived:(i.funded_txo_sum??0)+(l.funded_txo_sum??0),totalSent:(i.spent_txo_sum??0)+(l.spent_txo_sum??0),txCount:(i.tx_count??0)+(l.tx_count??0),utxoCount:(i.funded_txo_count??0)-(i.spent_txo_count??0),transactions:u}}function L4(e){const a=e.chain_stats,i=e.mempool_stats,l=(a.funded_txo_sum??0)-(a.spent_txo_sum??0);return{address:e.address,addressType:ui(e.address),balance:l,totalReceived:(a.funded_txo_sum??0)+(i.funded_txo_sum??0),totalSent:(a.spent_txo_sum??0)+(i.spent_txo_sum??0),txCount:(a.tx_count??0)+(i.tx_count??0),utxoCount:(a.funded_txo_count??0)-(a.spent_txo_count??0)}}function jb(e,a){return a.map(i=>({txid:i.txid,timestamp:i.status.block_time,valueChange:k4(e,i),blockHeight:i.status.block_height}))}async function Fv(e,a,i=0){const l=i>0?`/block/${a}/txs/${String(i)}`:`/block/${a}/txs`;return en(e,l,qu)}async function B4(e,a,i){return i?en(e,`/address/${a}/txs/chain/${i}`,qu):en(e,`/address/${a}/txs`,qu)}function Nb({baseUrl:e}){const a=new Set;let i=null;const l={lastBlockHash:null,lastKnownHeight:null};async function s(d){const m=await en(e,`/tx/${d}`,Tu);return await(m.status.block_height?Ii(e,l,m.status.block_height):Ii(e,l)),zd(m,l)}function u(){i||a.size===0||(i=setInterval(async()=>{try{const d=await en(e,"/blocks",Bh);if(d.length===0)return;const m=d[0];if(m.id!==l.lastBlockHash){l.lastBlockHash=m.id,l.lastKnownHeight=Math.max(m.height,l.lastKnownHeight??0);const p=co(m);for(const b of a)b({type:"block.new",payload:p})}}catch(d){console.warn("Block polling failed",d)}},15e3))}function c(){i&&(clearInterval(i),i=null)}return{metadata:{id:"blockstream",label:"Blockstream.info",type:"external",connectionState:"connected",supportsWebsocket:!1,endpoint:e,description:"Read-only adapter using Blockstream public REST API."},getConfiguration(){return Promise.resolve({address:!0,filter:!1,turbo:!1,witness:!0,retarget:!1,difficult:!1})},async getLatestBlocks(d=10){const m=await qv(e,"/blocks",d);return m.length>0&&(l.lastBlockHash=m[0].id,l.lastKnownHeight=Math.max(m[0].height,l.lastKnownHeight??0)),m.map(p=>co(p))},async getBlocksBefore(d,m=10){const p=Math.max(d,0),b=await qv(e,`/blocks/${String(p)}`,m);return b.length>0&&(l.lastKnownHeight=Math.max(b[0].height,l.lastKnownHeight??0)),b.map(g=>co(g))},async getBlockHeader(d){const m=await Ad(e,d);await Ii(e,l);const[p,b]=await Promise.all([en(e,`/block/${m}`,uh),en(e,`/block/${m})DELIM" -R"DELIM(/status`,$v).catch(()=>null)]),g=co(p);l.lastBlockHash=g.hash,l.lastKnownHeight=Math.max(g.height,l.lastKnownHeight??g.height);let x=b?.next_best??null;return x||(x=await Qv(e,g.height,l)),{...g,merkleRoot:p.merkle_root,nonce:p.nonce,bits:p.bits,version:p.version,nextBlockHash:x}},getBlockStats(d){return Promise.resolve({})},async getBlock(d){const m=await Ad(e,d);await Ii(e,l);const p=await en(e,`/block/${m}`,uh),[b,g]=await Promise.allSettled([Fv(e,m),en(e,`/block/${m}/status`,$v)]);b.status==="rejected"&&console.warn("Failed to load block transactions, defaulting to empty set",b.reason),g.status==="rejected"&&console.warn("Failed to load block status, defaulting to unknown",g.reason);const x=co(p);l.lastBlockHash=x.hash,l.lastKnownHeight=Math.max(x.height,l.lastKnownHeight??x.height);const w=b.status==="fulfilled"?b.value:[];let R=(g.status==="fulfilled"?g.value:null)?.next_best??null;return R||(R=await Qv(e,x.height,l)),{...x,merkleRoot:p.merkle_root,nonce:p.nonce,bits:p.bits,version:p.version,nextBlockHash:R,transactions:w.map(F=>zd(F,l))}},async getBlockTransactions(d,m=0){const p=await Ad(e,d),b=await Fv(e,p,m),g=b.reduce((x,w)=>w.status.block_height?x===null?w.status.block_height:Math.max(x,w.status.block_height):x,null);return await(typeof g=="number"?Ii(e,l,g):Ii(e,l)),b.map(x=>zd(x,l))},async getTransactionHeader(d){return s(d)},async getTransaction(d){return s(d)},async getTransactionInputScriptHex(d,m){const p=await en(e,`/tx/${d}`,Tu);if(m<0||m>=p.vin.length)throw new RangeError(`Input index ${String(m)} not found`);const g=p.vin[m].scriptsig;return typeof g=="string"?g:""},async getTransactionOutputScriptHex(d,m){const p=await en(e,`/tx/${d}`,Tu);if(m<0||m>=p.vout.length)throw new RangeError(`Output index ${String(m)} not found`);const g=p.vout[m].scriptpubkey;if(typeof g!="string")throw new TypeError("Output script missing in provider response");return g},async getAddressSummary(d){const m=await en(e,`/address/${d}`,Zv);return L4(m)},async getAddress(d){const m=await en(e,`/address/${d}`,Zv),p=await en(e,`/address/${d}/txs`,qu);return D4(m,p)},async getAddressTransactions(d,m){const p=await B4(e,d,m);return jb(d,p)},subscribeToEvents(d){return a.add(d),u(),()=>{a.delete(d),a.size===0&&c()}}}}function U4({baseUrl:e}){const a=Nb({baseUrl:e});return{...a,metadata:{...a.metadata,id:"mempool",label:"mempool.space",endpoint:e,description:"Adapter backed by mempool.space REST API."}}}function No(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function Mb(e,a){return Array.isArray(a)?a.length===0?!0:e?a.every(i=>typeof i=="string"):a.every(i=>Number.isSafeInteger(i)):!1}function Uh(e){if(typeof e!="function")throw new TypeError("function expected");return!0}function Mo(e,a){if(typeof a!="string")throw new TypeError(`${e}: string expected`);return!0}function Zo(e){if(typeof e!="number")throw new TypeError(`number expected, got ${typeof e}`);if(!Number.isSafeInteger(e))throw new RangeError(`invalid integer: ${e}`)}function Pu(e){if(!Array.isArray(e))throw new TypeError("array expected")}function Ob(e,a){if(!Mb(!0,a))throw new TypeError(`${e}: array of strings expected`)}function Hh(e,a){if(!Mb(!1,a))throw new TypeError(`${e}: array of numbers expected`)}function $h(...e){const a=u=>u,i=(u,c)=>d=>u(c(d)),l=e.map(u=>u.encode).reduceRight(i,a),s=e.map(u=>u.decode).reduce(i,a);return{encode:l,decode:s}}function kb(e){const a=typeof e=="string"?e.split(""):e,i=a.length;Ob("alphabet",a);const l=new Map(a.map((s,u)=>[s,u]));return{encode:s=>(Pu(s),s.map(u=>{if(!Number.isSafeInteger(u)||u<0||u>=i)throw new Error(`alphabet.encode: digit index outside alphabet "${u}". Allowed: ${e}`);return a[u]})),decode:s=>(Pu(s),s.map(u=>{Mo("alphabet.decode",u);const c=l.get(u);if(c===void 0)throw new Error(`Unknown letter: "${u}". Allowed: ${e}`);return c}))}}function Db(e=""){return Mo("join",e),{encode:a=>(Ob("join.decode",a),a.join(e)),decode:a=>(Mo("join.decode",a),a.split(e))}}function Yv(e,a,i){if(a<2)throw new RangeError(`convertRadix: invalid from=${a}, base cannot be less than 2`);if(i<2)throw new RangeError(`convertRadix: invalid to=${i}, base cannot be less than 2`);if(Pu(e),!e.length)return[];let l=0;const s=[],u=Array.from(e,d=>{if(Zo(d),d<0||d>=a)throw new Error(`invalid integer: ${d}`);return d}),c=u.length;for(;;){let d=0,m=!0;for(let p=l;pa===0?e:Lb(a,e%a),Qu=(e,a)=>e+(a-Lb(e,a)),Ru=(()=>{let e=[];for(let a=0;a<40;a++)e.push(2**a);return e})();function ch(e,a,i,l){if(Pu(e),a<=0||a>32)throw new RangeError(`convertRadix2: wrong from=${a}`);if(i<=0||i>32)throw new RangeError(`convertRadix2: wrong to=${i}`);if(Qu(a,i)>32)throw new Error(`convertRadix2: carry overflow from=${a} to=${i} carryBits=${Qu(a,i)}`);let s=0,u=0;const c=Ru[a],d=Ru[i]-1,m=[];for(const p of e){if(Zo(p),p>=c)throw new Error(`convertRadix2: invalid data word=${p} from=${a}`);if(s=s<32)throw new Error(`convertRadix2: carry overflow pos=${u} from=${a}`);for(u+=a;u>=i;u-=i)m.push((s>>u-i&d)>>>0);const b=Ru[u];if(b===void 0)throw new Error("invalid carry");s&=b-1}if(s=s<=a)throw new Error("Excess padding");if(!l&&s>0)throw new Error(`Non-zero padding: ${s}`);return l&&u>0&&m.push(s>>>0),m}function H4(e){Zo(e);const a=2**8;return{encode:i=>{if(!No(i))throw new TypeError("radix.encode input should be Uint8Array");return Yv(Array.from(i),a,e)},decode:i=>(Hh("radix.decode",i),Uint8Array.from(Yv(i,e,a)))}}function $4(e,a=!1){if(Zo(e),e<=0||e>32)throw new RangeError("radix2: bits should be in (0..32]");if(Qu(8,e)>32||Qu(e,8)>32)throw new RangeError("radix2: carry overflow");return{encode:i=>{if(!No(i))throw new TypeError("radix2.encode input should be Uint8Array");return ch(Array.from(i),8,e,!a)},decode:i=>(Hh("radix2.decode",i),Uint8Array.from(ch(i,e,8,a)))}}function Gv(e){return Uh(e),function(...a){try{return e.apply(null,a)}catch{}}}function Z4(e,a){if(Zo(e),e<=0)throw new RangeError(`checksum length must be positive: ${e}`);Uh(a);const i=a;return{encode(l){if(!No(l))throw new TypeError("checksum.encode: input should be Uint8Array");const s=i(l).slice(0,e),u=new Uint8Array(l.length+e);return u.set(l),u.set(s,l.length),u},decode(l){if(!No(l))throw new TypeError("checksum.decode: input should be Uint8Array");const s=l.slice(0,-e),u=l.slice(-e),c=i(s).slice(0,e);for(let d=0;d$h(H4(58),kb(e),Db("")),P4=Object.freeze(q4("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),Q4=e=>{Uh(e);const a=e;return $h(Z4(4,i=>a(a(i))),P4)},fh=$h(kb("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Db("")),Kv=[996825010,642813549,513874426,1027748829,705979059];function fo(e){const a=e>>25;let i=(e&33554431)<<5;for(let l=0;l>l&1)===1&&(i^=Kv[l]);return i}function Vv(e,a,i=1){const l=e.length;let s=1;for(let u=0;u126)throw new Error(`Invalid prefix (${e})`);s=fo(s)^c>>5}s=fo(s);for(let u=0;uw)throw new TypeError(`Length ${R} exceeds limit ${w}`);const N=g.toLowerCase(),F=Vv(N,x,a);return`${N}1${fh.encode(x)}${F}`}function d(g,)DELIM" -R"DELIM(x=90){Mo("bech32.decode input",g);const w=g.length;if(w<8||x!==!1&&w>x)throw new TypeError(`invalid string length: ${w} (${g}). Expected (8..${x})`);const E=g.toLowerCase();if(g!==E&&g!==g.toUpperCase())throw new Error("String must be lowercase or uppercase");const R=E.lastIndexOf("1");if(R===0||R===-1)throw new Error('Letter "1" must be present between prefix and data only');const N=E.slice(0,R),F=E.slice(R+1);if(F.length<6)throw new Error("Data must be at least 6 characters long");const V=fh.decode(F).slice(0,-6),J=Vv(N,V,a);if(!F.endsWith(J))throw new Error(`Invalid checksum in ${g}: expected "${J}"`);return{prefix:N,words:V}}const m=Gv(d);function p(g){const{prefix:x,words:w}=d(g,!1);return{prefix:x,words:w,bytes:l(w)}}function b(g,x){return c(g,s(x))}return{encode:c,decode:d,encodeFromBytes:b,decodeToBytes:p,decodeUnsafe:m,fromWords:l,fromWordsUnsafe:u,toWords:s}}const Fu=Object.freeze(Bb("bech32")),dh=Object.freeze(Bb("bech32m"));function F4(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function Zh(e,a,i=""){const l=F4(e),s=e?.length;if(!l||a!==void 0){const c=i&&`"${i}" `,d="",m=l?`length=${s}`:`type=${typeof e}`,p=c+"expected Uint8Array"+d+", got "+m;throw l?new RangeError(p):new TypeError(p)}return e}function Xv(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function Y4(e,a){Zh(e,void 0,"digestInto() output");const i=a.outputLen;if(e.length='+i)}function hh(...e){for(let a=0;a>>a}const G4=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",K4=Array.from({length:256},(e,a)=>a.toString(16).padStart(2,"0"));function Au(e){if(Zh(e),G4)return e.toHex();let a="";for(let i=0;ie(u).update(s).digest(),l=e(void 0);return i.outputLen=l.outputLen,i.blockLen=l.blockLen,i.canXOF=l.canXOF,i.create=s=>e(s),Object.assign(i,a),Object.freeze(i)}const X4=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function I4(e,a,i){return e&a^~e&i}function J4(e,a,i){return e&a^e&i^a&i}class W4{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(a,i,l,s){this.blockLen=a,this.outputLen=i,this.padOffset=l,this.isLE=s,this.buffer=new Uint8Array(a),this.view=Cd(this.buffer)}update(a){Xv(this),Zh(a);const{view:i,buffer:l,blockLen:s}=this,u=a.length;for(let c=0;cs-c&&(this.process(l,0),c=0);for(let g=c;gb.length)throw new Error("_sha2: outputLen bigger than state");for(let g=0;g>>3,R=ma(w,17)^ma(w,19)^w>>>10;wr[g]=R+wr[g-7]+E+wr[g-16]|0}let{A:l,B:s,C:u,D:c,E:d,F:m,G:p,H:b}=this;for(let g=0;g<64;g++){const x=ma(d,6)^ma(d,11)^ma(d,25),w=b+x+I4(d,m,p)+eR[g]+wr[g]|0,R=(ma(l,2)^ma(l,13)^ma(l,22))+J4(l,s,u)|0;b=p,p=m,m=d,d=c+w|0,c=u,u=s,s=l,l=w+R|0}l=l+this.A|0,s=s+this.B|0,u=u+this.C|0,c=c+this.D|0,d=d+this.E|0,m=m+this.F|0,p=p+this.G|0,b=b+this.H|0,this.set(l,s,u,c,d,m,p,b)}roundClean(){hh(wr)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),hh(this.buffer)}}class nR extends tR{A=Sr[0]|0;B=Sr[1]|0;C=Sr[2]|0;D=Sr[3]|0;E=Sr[4]|0;F=Sr[5]|0;G=Sr[6]|0;H=Sr[7]|0;constructor(){super(32)}}const Ub=V4(()=>new nR,X4(1)),Hb=Q4(Ub),aR=0x00000000ffff0000000000000000000000000000000000000000000000000000n;function qh(e){if(e.length%2!==0)throw new Error("Invalid hex string");const a=new Uint8Array(e.length/2);for(let i=0;i>>24,i=e&8388607;if(i===0||a<3)return;const l=BigInt(i)*(1n<i[1]).filter(Boolean);return a.length>0?a:[e]}function Ph(e){const a=e.toLowerCase();if(a.includes("dup hash160")&&a.includes("equalverify checksig"))return"p2pkh";if(a.startsWith("hash160")&&a.includes("equal"))return"p2sh";if(a.startsWith("zero [")){const l=a.match(/zero \[([0-9a-f]+)\]/)?.[1]??"";return l.length===40?"p2wpkh":l.length===64?"p2wsh":"segwit"}if(a.startsWith("1 ["))return"p2tr"}function qo(){return"mainnet"}function Po(e){return e==="testnet"||e==="regtest"?{p2pkh:111,p2sh:196,hrp:e==="regtest"?"bcrt":"tb"}:{p2pkh:0,p2sh:5,hrp:"bc"}}function Iv(e,a){const i=new Uint8Array(a.length/2+1);return i[0]=e,i.set(qh(a),1),Hb.encode(i)}function jd(e,a,i){const l=qh(i),s=Fu.toWords(l);return s.unshift(a),(a===0?Fu:dh).encode(e,s)}function $b(e,a){const i=e.toLowerCase(),l=i.match(/dup hash160 \[([0-9a-f]{40})\] equalverify checksig/);if(l)return{address:Iv(a.p2pkh,l[1]),type:"p2pkh"};const s=i.match(/^hash160 \[([0-9a-f]{40})\] equal$/);if(s)return{address:Iv(a.p2sh,s[1]),type:"p2sh"};const u=i.match(/^zero \[([0-9a-f]{40})\]/);if(u)return{address:jd(a.hrp,0,u[1]),type:"p2wpkh"};const c=i.match(/^zero \[([0-9a-f]{64})\]/);if(c)return{address:jd(a.hrp,0,c[1]),type:"p2wsh"};const d=i.match(/^1 \[([0-9a-f]{64})\]/);return d?{address:jd(a.hrp,1,d[1]),type:"p2tr"}:{type:Ph(e)}}function lR(e,a){try{const s=Hb.decode(e),u=s[0],c=Au(s.slice(1));if(c.length===40&&u===a.p2pkh)return{scriptHex:`76a914${c}88ac`,type:"p2pkh"};if(c.length===40&&u===a.p2sh)return{scriptHex:`a914${c}87`,type:"p2sh"}}catch{}const i=e.toLowerCase();if(i.indexOf("1")>0&&i.startsWith(`${a.hrp}1`)){const s=i,u=m=>{try{return m.decode(s,90)}catch{return null}},c=u(Fu);if(c&&c.prefix===a.hrp){const m=c.words[0],)DELIM" -R"DELIM(p=Fu.fromWords(c.words.slice(1)),b=Au(p),g=p.length.toString(16).padStart(2,"0");if(m===0&&(p.length===20||p.length===32))return{scriptHex:`00${g}${b}`,type:p.length===20?"p2wpkh":"p2wsh"}}const d=u(dh);if(d&&d.prefix===a.hrp){const m=d.words[0],p=dh.fromWords(d.words.slice(1)),b=Au(p),g=p.length.toString(16).padStart(2,"0");if(m===1&&p.length===32)return{scriptHex:`51${g}${b}`,type:"p2tr"}}}return null}function Mr(e,a){const i=e.toLowerCase();if(/^[0-9a-f]{64}$/.test(i))return{hash:i,type:"script-hash"};const l=lR(e,a);if(!l)return null;const s=Ub(qh(l.scriptHex)),u=Uint8Array.from(s).reverse();return{hash:Au(u),type:l.type}}function zu(e,a){return{hash:e.hash,height:e.height,timestamp:e.timestamp,txCount:a,size:void 0,weight:void 0,difficulty:rR(e.bits),previousBlockHash:e.previous}}function oR(e){const a=iR(e);return a&&a.length>0?a:void 0}function sR(e,a,i,l){const s=/^0{64}$/u.test(e.point.hash),u=a?$b(a.script,i):{address:void 0,type:void 0},c=a?a.value:void 0,d=a?a.script:void 0;return{index:l,prevTxId:s?void 0:e.point.hash,prevOutputIndex:s?void 0:e.point.index,address:u.address,valueSats:c,scriptType:u.type??Ph(d??e.script),isCoinbase:s,script:e.script?{mnemonic:e.script}:void 0,witness:oR(e.witness),sequence:e.sequence}}function uR(e,a,i){const l=$b(e.script,i);return{index:a,address:l.address,valueSats:e.value,scriptType:l.type??Ph(e.script),spent:void 0,script:e.script?{mnemonic:e.script}:void 0}}function cR(e,a){return typeof e!="number"||typeof a!="number"?0:Math.max(0,e-a+1)}function pu(e,a,i,l,s){const u=e.outputs.map((b,g)=>uR(b,g,i)),c=u.reduce((b,g)=>b+g.valueSats,0),d=a.reduce((b,g)=>g?(b??0)+g.value:b,null),m=cR(l.tipHeight,l.blockHeight),p=typeof l.blockHeight=="number"?"confirmed":"unconfirmed";return{txid:e.hash,hash:e.hash,status:p,confirmations:m,blockHeight:l.blockHeight,blockHash:l.blockHash,receivedTime:l.timestamp,feeSats:Number.isFinite(s)?s:void 0,feeRate:null,size:void 0,weight:void 0,version:e.version,locktime:e.locktime,totalInput:d,totalOutput:c,inputs:e.inputs.map((b,g)=>sR(b,a[g],i,g)),outputs:u}}const yu=25,tl=8,fR="/v1/top/subscribe?format=json",dR="/v1/top/subscribe?format=json&stop=true",hR=5e3,mR=2500,Nd=5e3,pR=3e5,Jv=5e3,ho=new Map,Md=new Map,Yu={address:!0,filter:!1,turbo:!0,witness:!0,retarget:!1,difficult:!1};function yR(e){if(!e||typeof e!="object"||Array.isArray(e))return Yu;const a=e,i=l=>typeof a[l]=="boolean"?a[l]:Yu[l];return{address:i("address"),filter:i("filter"),turbo:i("turbo"),witness:i("witness"),retarget:i("retarget"),difficult:i("difficult")}}function bo(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const i=e.state;if(!i||typeof i!="object"||Array.isArray(i))return null;const l=i,s=typeof l.count=="number"?l.count:void 0,u=typeof l.size=="number"?l.size:void 0,c=typeof l.weight=="number"?l.weight:void 0;return s===void 0&&u===void 0&&c===void 0?null:{count:s,size:u,weight:c}}function Cu(e){return e?.weight??e?.size}function gR(e,a){return!Number.isFinite(e)||!Number.isFinite(a)||a<=0?null:e/a*4}function gu(e,a){if(!a)return e;const i=typeof a.fee=="number"?a.fee:void 0,l=typeof a.weight=="number"?a.weight:void 0,s=typeof i=="number"&&typeof l=="number"?gR(i,l):e.feeRate;return{...e,wtxid:a.wtxid||e.wtxid,feeSats:typeof a.fee=="number"?a.fee:e.feeSats,feeRate:s,size:typeof a.maximal=="number"?a.maximal:e.size,weight:typeof a.weight=="number"?a.weight:e.weight,sigops:typeof a.confirmed?.sigops=="number"?a.confirmed.sigops:e.sigops,totalInput:typeof a.value=="number"?a.value:e.totalInput,totalOutput:typeof a.spend=="number"?a.spend:e.totalOutput}}async function gn(e,a,i){const l=a.startsWith("/")?a:`/${a}`;let s=l.includes("?")?`${e}${l}`:`${e}${l}?format=json`;i&&(s+=s.includes("?")?"&turbo=true":"?turbo=true");const u=Md.get(s);if(u)return u;const c=(async()=>{const d=await fetch(s,{headers:{Accept:"application/json"}});if(!d.ok){const p=await d.text().catch(()=>"");throw new Error(`Request failed ${String(d.status)}: ${p||d.statusText}`)}const m=await d.text();try{return JSON.parse(m)}catch{return m}})();Md.set(s,c);try{return await c}finally{Md.delete(s)}}async function Ut(e,a,i){try{return await gn(e,a,i)}catch{return null}}async function Zb(e,a){const i=await gn(e,"/v1/top?format=json",a),l=typeof i=="number"?i:Number(i);if(!Number.isFinite(l))throw new Error("Invalid top height");return l}function vR(e){return/^[0-9a-f]{64}$/iu.test(e)}function bR(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0?e:typeof e=="string"&&/^\d+$/u.test(e.trim())?Number(e.trim()):null}function mh(e){const a=bR(e);if(a!==null)return a;if(typeof e=="string"){const s=e.trim();return vR(s)?s:null}if(!e||typeof e!="object"||Array.isArray(e))return null;const i=e,l=[i.payload,i.top,i.block,i.header,i.hash,i.height];for(const s of l){if(s===e)continue;const u=mh(s);if(u!==null)return u}return null}function xR(e){return typeof e=="string"?Promise.resolve(e):e instanceof ArrayBuffer?Promise.resolve(new TextDecoder().decode(e)):e instanceof Blob?e.text():Promise.resolve(null)}function SR(e){const a=e.trim();if(!a)return null;try{return mh(JSON.parse(a))}catch{return mh(a)}}function wR(e){const a=e.trim();if(!a)return null;const l=/^[a-z][a-z\d+\-.]*:\/\//iu.test(a)?a:`http://${a}`,s=globalThis.window;try{const u=new URL(l,s?.location.href??"http://localhost");if(u.protocol==="http:")u.protocol="ws:";else if(u.protocol==="https:")u.protocol="wss:";else if(u.protocol!=="ws:"&&u.protocol!=="wss:")return null;return u.hash="",u.search="",u.toString()}catch{return null}}async function ei(e,a){const i=Date.now(),l=`${e}|0`,s=ho.get(l);if(s&&s.expiresAt>i)return s.promise;const u=Zb(e,a).then(c=>(ho.set(l,{promise:u,value:c,expiresAt:Date.now()+Jv}),c),c=>{throw ho.get(l)?.promise===u&&ho.delete(l),c});return ho.set(l,{promise:u,value:s?.value??null,expiresAt:i+Jv}),u}async function vu(e,a,i){if(a==="latest"||a==="tip"){const l=await ei(e,i);return{path:`/v1/block/height/${String(l)}`,height:l}}return/^\d+$/u.test(a)?{path:`/v1/block/height/${a}`}:{path:`/v1/block/hash/${a}`}}function _R(e,a){const i=new Map;return(l,s)=>{const u=`${l}:${String(s)}`,c=i.get(u);if(c)return c;const d=gn(e,`/v1/output/${l}/${String(s)}?format=json`,a).catch(()=>null);return i.set(u,d),d}}async function Wv(e,a,i,l){return gn(e,`${a}/tx/${String(i)}?format=json`,l)}async function e0(e,a){return ni(a,tl,async i=>{const[l,s]=await Promise.all([gn(e,`/v1/block/height/${String(i)}/header?format=json`),Ut(e,`/v1/block/height/${String(i)}/header/context?format=json`)]),u=bo(s);return{...zu(l,u?.count),size:Cu(u)}})}async function t0(e,a,i){const l=await Ut(e,`/v1/address/${a}/confirmed?format=json`,i);return Array.isArray(l)?l:[]}async function ER(e,a,i){const l=await Ut(e,`/v1/address/${a}?format=json`,i);return Array.isArray(l)?l:[]}const n0=25,TR=8,RR=3e4;function AR(e){if(e===void 0)return 0;const a=Number(e);return Number.isInteger(a)&&a>0?a:0}async function zR(e,a,i){const l=await Ut(e,`/v1/output/${a}/${String(i)}/spender?format=json`);return l&&typeof l.hash=="string"?l:null}async function ni(e,a,i){const l=Array.from({length:e.length});let s=0;async function u(){for(;su())),l}async function CR(e,a,i){const l=await ni(a,TR,u=>zR(e,u.point.hash,u.point.index)),s=[];for(const[u,c]of a.entries()){const{hash:d,index:m}=c.point,p=l[u];s.push({id:`in:${d}:${String(m)}`,txid:d,outputIndex:m,valueChange:c.value,direction:"received",spent:p!==null,...i===null?{}:{cursor:i}}),p&&s.push({id:`out:${d}:${String(m)}`,txid:p.hash,valueChange:-c.value,direction:"sent",...i===null?{}:{cursor:i}})}return s}function a0(e,a){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const l=Number(e);if(Number.isFinite(l))return l}let i=0;for(const l of a)i+=l.value;return i}function Od({baseUrl:e,pollIntervalMs:a=15e3,turbo:i=!1}){const l=new Set,s=new Set;let u=null,c=null,d=null,m=null,)DELIM" -R"DELIM(p=null,b=Nd,g=!1,x=!1,w="idle",E=null,R=null;const N=Po(qo());let F=null,V=null;const J=wR(e),ue=!!(J&&globalThis.WebSocket),ae=new Map;async function xe(W,de){const X=Date.now(),ge=ae.get(W);if(ge&&ge.expiresAt>X)return ge.outputs;const pe=await ER(e,W,de);return ae.set(W,{outputs:pe,expiresAt:X+RR}),pe}async function j(W,de,X){const ge=await xe(W,de),pe=AR(X),Ue=ge.slice(pe,pe+n0),je=pe+n0,He=je{const de=yR(W);return F=de,de}).catch(W=>(console.warn("Libbitcoin configuration fetch failed",W),F=Yu,Yu)),V)}function D(W){return W.address}function B(W){return D(W)&&W.turbo}function Q(){return{transport:w,websocketAvailable:ue&&!g}}function q(W){if(w===W)return;w=W;const de=Q();for(const X of s)X(de)}async function G(W){const de=typeof W=="number"?`/v1/block/height/${String(W)}`:`/v1/block/hash/${W}`,[X,ge]=await Promise.all([gn(e,`${de}/header?format=json`),Ut(e,`${de}/header/context?format=json`)]);if(R===X.hash||E!==null&&X.heightE&&await G(W)}catch(W){console.warn("Libbitcoin poller failed",W)}}function fe(){l.size!==0&&(u||(u=setInterval(()=>{re()},a)),q("polling"))}function M(){u&&(clearInterval(u),u=null)}function k(){d&&(clearTimeout(d),d=null)}function le(){m&&(clearTimeout(m),m=null)}function ce(){p&&(clearTimeout(p),p=null)}function we(){if(p||!ue||l.size===0)return;const W=b;b=Math.min(b*2,pR),p=setTimeout(()=>{p=null,!(c||l.size===0)&&(g=!1,oe())},W)}function C(){g=!0,K(!1),fe(),we()}function K(W){if(k(),!!c){x=!0;try{W&&c.readyState===1&&c.send(dR),c.close()}catch{}finally{c=null}}}function oe(){if(le(),c)return!0;if(!ue||!J||g||l.size===0)return!1;try{x=!1,c=new WebSocket(J),q("connecting")}catch(de){return console.warn("Libbitcoin websocket unavailable, falling back to polling",de),C(),!1}const W=c;return d=setTimeout(()=>{c===W&&(console.warn("Libbitcoin websocket connect timed out, falling back to polling"),C())},hR),W.addEventListener("open",()=>{if(c===W){k();try{W.send(fR),M(),g=!1,b=Nd,q("websocket")}catch(de){console.warn("Libbitcoin websocket subscribe failed, falling back to polling",de),C()}}}),W.addEventListener("message",de=>{(async()=>{try{const X=await xR(de.data);if(X===null)return;const ge=SR(X);if(ge===null)return;await G(ge)}catch(X){console.warn("Libbitcoin websocket event handling failed",X)}})()}),W.addEventListener("error",de=>{x||c!==W||(console.warn("Libbitcoin websocket failed, falling back to polling",de),C())}),W.addEventListener("close",()=>{if(!(c!==null&&c!==W)){if(k(),c===W&&(c=null),x){x=!1;return}l.size!==0&&C()}}),!0}function he(){oe()||(fe(),we())}function Ee(){le(),ce(),b=Nd,g=!1,M(),K(!0),q("idle")}function Te(){l.size>0||m||(m=setTimeout(()=>{m=null,l.size===0&&Ee()},mR))}return{metadata:{id:"libbitcoin",label:"Server",type:"local",connectionState:"connected",supportsWebsocket:ue,endpoint:e,description:"Adapter for the libbitcoin embedded REST API."},getConfiguration(){return _()},async getLatestBlocks(W=10){const de=await ei(e);E=de;const X=Array.from({length:W},(pe,Ue)=>de-Ue).filter(pe=>pe>=0),ge=await e0(e,X);return ge.length>0&&(R=ge[0].hash),ge},async getBlocksBefore(W,de=10){const X=Array.from({length:de},(ge,pe)=>W-pe).filter(ge=>ge>=0);return e0(e,X)},async getBlockHeader(W){const{path:de,height:X}=await vu(e,W),ge=X===void 0?ei(e):Promise.resolve(X),[pe,Ue,je]=await Promise.all([gn(e,`${de}/header?format=json`),ge,Ut(e,`${de}/header/context?format=json`)]);E=Math.max(E??0,Ue);let He=null;pe.heightOn),Mn=(await ni(pt,tl,$t=>Wv(e,de,$t).catch(()=>null))).filter($t=>$t!==null),vl=await ni(Mn,tl,$t=>Ut(e,`/v1/tx/${$t.hash}/details?format=json`)),Qt=Mn.map(($t,On)=>{const wa=vl[On],sa=pu($t,[],N,{blockHeight:pe.height,blockHash:pe.hash,tipHeight:Ue,timestamp:pe.timestamp},typeof wa?.fee=="number"?wa.fee:void 0);return gu(sa,wa)});return{...st,size:He?.maximal??Cu(Ve),weight:He?.weight,merkleRoot:pe.merkle_root,nonce:pe.nonce,bits:pe.bits,version:pe.version,nextBlockHash:Mt,feesSats:He?.fees,subsidySats:He?.subsidy,sigops:He?.sigops,transactions:Qt}},async getBlockTransactions(W,de=0){const{path:X}=await vu(e,W),[ge,pe,Ue]=await Promise.all([gn(e,`${X}/header?format=json`),ei(e),Ut(e,`${X}/header/context?format=json`)]);E=Math.max(E??0,pe);const je=bo(Ue)?.count;if(typeof je=="number"&&de>=je)return[];const He=typeof je=="number"?Math.min(de+yu,je):de+yu,Mt=Array.from({length:Math.max(0,He-de)},(Fe,pt)=>de+pt),qe=(await ni(Mt,tl,Fe=>Wv(e,X,Fe).catch(()=>null))).filter(Fe=>Fe!==null);if(qe.length===0)return[];const st=await ni(qe,tl,Fe=>Ut(e,`/v1/tx/${Fe.hash}/details?format=json`));return qe.map((Fe,pt)=>{const nn=st[pt],Mn=pu(Fe,[],N,{blockHeight:ge.height,blockHash:ge.hash,tipHeight:pe,timestamp:ge.timestamp},typeof nn?.fee=="number"?nn.fee:void 0);return gu(Mn,nn)})},async getTransaction(W){const de=await gn(e,`/v1/tx/${W}?format=json`),X=_R(e),ge=ni(de.inputs,tl,Ve=>/^0{64}$/u.test(Ve.point.hash)?Promise.resolve(null):X(Ve.point.hash,Ve.point.index)),[pe,Ue,je,He]=await Promise.all([Ut(e,`/v1/tx/${W}/header?format=json`),ei(e).catch(()=>null),Ut(e,`/v1/tx/${W}/details?format=json`),ge]);typeof Ue=="number"&&(E=Math.max(E??0,Ue));const Mt=pu(de,He,N,{blockHeight:pe?.height,blockHash:pe?.hash,tipHeight:typeof Ue=="number"?Ue:void 0,timestamp:pe?.timestamp},typeof je?.fee=="number"?je.fee:void 0);return gu(Mt,je)},async getTransactionHeader(W){const de=await gn(e,`/v1/tx/${W}?format=json`),[X,ge,pe]=await Promise.all([Ut(e,`/v1/tx/${W}/header?format=json`),ei(e).catch(()=>null),Ut(e,`/v1/tx/${W}/details?format=json`)]);typeof ge=="number"&&(E=Math.max(E??0,ge));const Ue=pu(de,[],N,{blockHeight:X?.height,blockHash:X?.hash,tipHeight:typeof ge=="number"?ge:void 0,timestamp:X?.timestamp},typeof pe?.fee=="number"?pe.fee:void 0);return gu(Ue,pe)},async getTransactionInputScriptHex(W,de){return(await gn(e,`/v1/input/${W}/${String(de)}/script?format=text`)).trim()},async getTransactionOutputScriptHex(W,de){return(await gn(e,`/v1/output/${W}/${String(de)}/script?format=text`)).trim()},async getAddress(W){const de=Mr(W,N);if(!de)throw new Error("Unsupported address format for libbitcoin adapter");const X=F??await _();if(!D(X))throw new Error("Address endpoints are disabled by server configuration");const ge=i&&B(X),[pe,Ue]=await Promise.all([Ut(e,`/v1/address/${de.hash}/balance?format=json`,ge),t0(e,de.hash,ge)]),je=a0(pe,Ue),He=await j(de.hash,ge);return{address:W,addressType:de.type,balance:je,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:Ue.length,transactions:He}},async getAddressSummary(W){const de=Mr(W,N);if(!de)throw new Error("Unsupported address format for libbitcoin adapter");const X=F??await _();)DELIM" -R"DELIM(if(!D(X))throw new Error("Address endpoints are disabled by server configuration");const ge=i&&B(X),[pe,Ue]=await Promise.all([Ut(e,`/v1/address/${de.hash}/balance?format=json`,ge),t0(e,de.hash,ge)]),je=a0(pe,Ue);return{address:W,addressType:de.type,balance:je,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:Ue.length}},async getAddressTransactions(W,de){const X=Mr(W,N);if(!X)return[];const ge=F??await _();if(!D(ge))return[];const pe=i&&B(ge);return j(X.hash,pe,de)},subscribeToEvents(W){return le(),l.add(W),he(),()=>{l.delete(W),Te()}},getEventStatus:Q,subscribeToEventStatus(W){return s.add(W),W(Q()),()=>{s.delete(W)}}}}const qb=T.createContext(null),Pb=T.createContext(null),Qb=T.createContext(null);function jR({children:e,client:a}){return v.jsx(qb.Provider,{value:a,children:e})}function NR({children:e,provider:a,setProvider:i,availableProviders:l,selectorVisible:s,setSelectorVisible:u}){return v.jsx(Pb.Provider,{value:{provider:a,setProvider:i,availableProviders:l,selectorVisible:s,setSelectorVisible:u},children:e})}function MR({children:e,turbo:a,setTurbo:i}){return v.jsx(Qb.Provider,{value:{turbo:a,setTurbo:i},children:e})}function Ka(){const e=T.useContext(qb);if(!e)throw new Error("BlockchainClientProvider missing in component tree");return e}function Qo(){return Ka().metadata}function Fb(){const e=T.useContext(Pb);if(!e)throw new Error("ProviderSwitcherProvider missing in component tree");return e}function Yb(){const e=T.useContext(Qb);if(!e)throw new Error("TurboProvider missing in component tree");return e}function kd(){const e=globalThis.window;return e?.location.origin?e.location.origin:"http://localhost:8080"}function OR(e,a){if(e==="blockstream")return Nb({baseUrl:"https://blockstream.info/api"});if(e==="mempool")return U4({baseUrl:"https://mempool.space/api"});if(e==="libbitcoin"){const l=kd();return Od({baseUrl:l,turbo:a?.turboEnabled})}if(e==="external"){console.warn("No external API URL provided, falling back to libbitcoin provider");const l=kd();return Od({baseUrl:l,turbo:a?.turboEnabled})}console.warn(`Unknown provider "${e}", falling back to libbitcoin provider`);const i=kd();return Od({baseUrl:i,turbo:a?.turboEnabled})}function kR(){return[...new Set(["libbitcoin","blockstream","mempool"])]}const Dd=10,DR=20;function Gb(e){return e.metadata.endpoint?{providerId:e.metadata.id,endpoint:e.metadata.endpoint}:{providerId:e.metadata.id}}function LR(e,a){if(!e||typeof e!="object"||Array.isArray(e))return!1;const i=e;return i.providerId===a.providerId&&i.endpoint===a.endpoint}function BR(e,a){if(!e||typeof e!="object"||Array.isArray(e))return a;const i=e.limit;return typeof i=="number"&&Number.isFinite(i)&&i>0?i:a}function UR(e,a,i){const l=e.getQueryCache().findAll({predicate:s=>{const u=s.queryKey;return u.length>=4&&LR(u[0],a)&&u[1]==="blocks"&&u[2]==="latest"}});for(const s of l){const u=BR(s.queryKey[3],Dd);e.setQueryData(s.queryKey,c=>[i,...(c??[]).filter(p=>p.hash!==i.hash)].slice(0,u))}e.setQueryData([a,"blocks","latest",{limit:Dd}],s=>[i,...(s??[]).filter(d=>d.hash!==i.hash)].slice(0,Dd))}function HR(e,a,i){e.setQueryData([a,"transactions","recent"],l=>[i,...(l??[]).filter(c=>c.txid!==i.txid)].slice(0,DR))}function $R(e,a,i){i.type==="block.new"&&UR(e,a,i.payload),i.type==="tx.new"&&HR(e,a,i.payload)}function Vn({queryKey:e,queryFn:a,enabled:i,staleTime:l,initialData:s}){const u=Ka();return Xw({queryKey:[Gb(u),...e],queryFn:()=>a(u),enabled:i,staleTime:l,initialData:s})}function Kb(e=10){return Vn({queryKey:["blocks","latest",{limit:e}],queryFn:a=>a.getLatestBlocks(e)})}function Vb(){return Vn({queryKey:["configuration"],queryFn:e=>e.getConfiguration(),staleTime:6e4})}function Xb(e){return Vn({queryKey:["block",e,"header"],queryFn:a=>a.getBlockHeader(e)})}function Ib(e,a){return Vn({queryKey:["block",e,"stats"],queryFn:i=>i.getBlockStats(e),enabled:(a?.enabled??!0)&&!!e.trim(),staleTime:1/0})}function ZR(e,a=0){return Vn({queryKey:["block",e,"transactions",{startIndex:a}],queryFn:i=>i.getBlockTransactions(e,a)})}function qR(e){return Vn({queryKey:["transaction",e,"header"],queryFn:a=>a.getTransactionHeader(e),enabled:!!e.trim()})}function PR(e,a){return Vn({queryKey:["transaction",e],queryFn:i=>i.getTransaction(e),enabled:a?.enabled??!!e.trim()})}function QR(e,a,i){return Vn({queryKey:["transaction",e,"input",a,"scriptHex"],queryFn:l=>l.getTransactionInputScriptHex(e,a),enabled:(i?.enabled??!0)&&!!e.trim()})}function FR(e,a,i){return Vn({queryKey:["transaction",e,"output",a,"scriptHex"],queryFn:l=>l.getTransactionOutputScriptHex(e,a),enabled:(i?.enabled??!0)&&!!e.trim()})}function YR(e){return Vn({queryKey:["address",e,"summary"],queryFn:a=>a.getAddressSummary(e),enabled:!!e.trim()})}function GR(e,a){return Vn({queryKey:["address",e,"transactions",{lastSeenTxid:null}],queryFn:i=>i.getAddressTransactions(e,a),enabled:!!e.trim()})}function KR(e){const a=Ka(),i=T.useRef(e);T.useEffect(()=>{i.current=e},[e]),T.useEffect(()=>{const l=a.subscribeToEvents(s=>{i.current(s)});return()=>{l()}},[a])}function VR(){const e=Ka(),a=T.useMemo(()=>({transport:e.metadata.supportsWebsocket?"websocket":"polling",websocketAvailable:e.metadata.supportsWebsocket}),[e.metadata.supportsWebsocket]),[i,l]=T.useState(()=>e.getEventStatus?e.getEventStatus():a);return T.useEffect(()=>{const s=e.getEventStatus?e.getEventStatus():a;return l(s),e.subscribeToEventStatus?.(l)},[e,a]),i}function XR(){const e=Ka(),a=T.useMemo(()=>Gb(e),[e]),i=Iu(),l=T.useCallback(s=>{$R(i,a,s)},[i,a]);return KR(l),null}function IR(e=10){const{data:a,isLoading:i,isError:l,error:s}=Kb(e),{data:u=[]}=Vn({queryKey:["transactions","recent"],queryFn:()=>Promise.resolve([]),enabled:!1,initialData:[]});return{data:a,recentTransactions:u,isLoading:i,isError:l,error:s}}function Ld(e){return globalThis.window?.localStorage.getItem(e)??null}function Bd(e,a){globalThis.window?.localStorage.setItem(e,a)}function JR({children:e}){const a="libbitcoin",i=kR(),[l,s]=T.useState(()=>Ld("turboEnabled")==="true"),[u,c]=T.useState(()=>{const g=Ld("blockchainProvider");return g&&i.includes(g)?g:a}),[d,m]=T.useState(()=>Ld("providerSelectorVisible")==="true"),[p]=T.useState(()=>new Bw({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}})),b=T.useMemo(()=>OR(u,{turboEnabled:l}),[u,l]);return T.useEffect(()=>{Bd("turboEnabled",l?"true":"false")},[l]),T.useEffect(()=>{Bd("blockchainProvider",u)},[u]),T.useEffect(()=>{Bd("providerSelectorVisible",d?"true":"false")},[d]),v.jsx(NR,{provider:u,setProvider:c,availableProviders:i,selectorVisible:d,setSelectorVisible:m,children:v.jsx(MR,{turbo:l,setTurbo:s,children:v.jsx(jR,{client:b,children:v.jsxs(Uw,{client:p,children:[v.jsx(XR,{}),e,null]})})})})}var Jb=e=>{throw TypeError(e)},Wb=(e,a,i)=>a.has(e)||Jb("Cannot "+i),Qn=(e,a,i)=>(Wb(e,a,"read from private field"),i?i.call(e):a.get(e)),xo=(e,a,i)=>a.has(e)?Jb("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(e):a.set(e,i),pa=(e,a,i,l)=>(Wb(e,a,"write to private field"),a.set(e,i),i),nc=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Qh=/^[\\/]{2}/;function ex(e,a){return a+e.replace(/\\/g,"/")}var r0="popstate";function i0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function WR(e={}){function a(l,s){let u=s.state?.masked,{pathname:c,search:d,hash:m}=u||l.location;return Oo("",{pathname:c,search:d,hash:m},s.state&&s.state.usr||null,s.state&&s.state.key||"default",u?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,s){return typeof s=="string"?s:ba(s)}return t3(a,i,null,e)}function De(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function Tt(e,a){if(!e){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function e3(){return Math.random().toString(36).substring(2,10)}function l0(e,a){return{usr:e.state,key:e.key,idx:a,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Oo(e,a,i=null,l,)DELIM" -R"DELIM(s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof a=="string"?xa(a):a,state:i,key:a&&a.key||l||e3(),mask:s}}function ba({pathname:e="/",search:a="",hash:i=""}){return a&&a!=="?"&&(e+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function xa(e){let a={};if(e){let i=e.indexOf("#");i>=0&&(a.hash=e.substring(i),e=e.substring(0,i));let l=e.indexOf("?");l>=0&&(a.search=e.substring(l),e=e.substring(0,l)),e&&(a.pathname=e)}return a}function t3(e,a,i,l={}){let{window:s=document.defaultView,v5Compat:u=!1}=l,c=s.history,d="POP",m=null,p=b();p==null&&(p=0,c.replaceState({...c.state,idx:p},""));function b(){return(c.state||{idx:null}).idx}function g(){d="POP";let N=b(),F=N==null?null:N-p;p=N,m&&m({action:d,location:R.location,delta:F})}function x(N,F){d="PUSH";let V=i0(N)?N:Oo(R.location,N,F);p=b()+1;let J=l0(V,p),ue=R.createHref(V.mask||V);try{c.pushState(J,"",ue)}catch(ae){if(ae instanceof DOMException&&ae.name==="DataCloneError")throw ae;s.location.assign(ue)}u&&m&&m({action:d,location:R.location,delta:1})}function w(N,F){d="REPLACE";let V=i0(N)?N:Oo(R.location,N,F);p=b();let J=l0(V,p),ue=R.createHref(V.mask||V);c.replaceState(J,"",ue),u&&m&&m({action:d,location:R.location,delta:0})}function E(N){return tx(s,N)}let R={get action(){return d},get location(){return e(s,c)},listen(N){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(r0,g),m=N,()=>{s.removeEventListener(r0,g),m=null}},createHref(N){return a(s,N)},createURL:E,encodeLocation(N){let F=E(N);return{pathname:F.pathname,search:F.search,hash:F.hash}},push:x,replace:w,go(N){return c.go(N)}};return R}function tx(e,a,i=!1){let l="http://localhost";e&&(l=e.location.origin!=="null"?e.location.origin:e.location.href),De(l,"No window.location.(origin|href) available to create URL");let s=typeof a=="string"?a:ba(a);return s=s.replace(/ $/,"%20"),!i&&Qh.test(s)&&(s=l+s),new URL(s,l)}var So,o0=class{constructor(e){if(xo(this,So,new Map),e)for(let[a,i]of e)this.set(a,i)}get(e){if(Qn(this,So).has(e))return Qn(this,So).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,a){Qn(this,So).set(e,a)}};So=new WeakMap;var n3=new Set(["lazy","caseSensitive","path","id","index","children"]);function a3(e){return n3.has(e)}var r3=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function i3(e){return r3.has(e)}function l3(e){return e.index===!0}function ko(e,a,i=[],l={},s=!1){return e.map((u,c)=>{let d=[...i,String(c)],m=typeof u.id=="string"?u.id:d.join("-");if(De(u.index!==!0||!u.children,"Cannot specify children on an index route"),De(s||!l[m],`Found a route id collision on id "${m}". Route id's must be globally unique within Data Router usages`),l3(u)){let p={...u,id:m};return l[m]=s0(p,a(p)),p}else{let p={...u,id:m,children:void 0};return l[m]=s0(p,a(p)),u.children&&(p.children=ko(u.children,a,d,l,s)),p}})}function s0(e,a){return Object.assign(e,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...e.lazy,...a.lazy}}:{}})}function nx(e,a,i="/"){return la(e,a,i,!1)}function la(e,a,i,l,s){let u=typeof a=="string"?xa(a):a,c=Gn(u.pathname||"/",i);if(c==null)return null;let d=s??ju(e),m=null,p=v3(c);for(let b=0;m==null&&b{let b={relativePath:p===void 0?c.path||"":p,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(l)&&m)return;De(b.relativePath.startsWith(l),`Absolute route path "${b.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(l.length)}let g=Yn([l,b.relativePath]),x=i.concat(b);c.children&&c.children.length>0&&(De(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),ax(c.children,a,x,g,m)),!(c.path==null&&!c.index)&&a.push({path:g,score:p3(g,c.index),routesMeta:x.map((w,E)=>{let[R,N]=lx(w.relativePath,w.caseSensitive,E===x.length-1);return{...w,matcher:R,compiledParams:N}})})};return e.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))u(c,d);else for(let m of rx(c.path))u(c,d,!0,m)}),a}function rx(e){let a=e.split("/");if(a.length===0)return[];let[i,...l]=a,s=i.endsWith("?"),u=i.replace(/\?$/,"");if(l.length===0)return s?[u,""]:[u];let c=rx(l.join("/")),d=[];return d.push(...c.map(m=>m===""?u:[u,m].join("/"))),s&&d.push(...c),d.map(m=>e.startsWith("/")&&m===""?"/":m)}function s3(e){e.sort((a,i)=>a.score!==i.score?i.score-a.score:y3(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var u3=/^:[\w-]+$/,c3=3,f3=2,d3=1,h3=10,m3=-2,u0=e=>e==="*";function p3(e,a){let i=e.split("/"),l=i.length;return i.some(u0)&&(l+=m3),a&&(l+=f3),i.filter(s=>!u0(s)).reduce((s,u)=>s+(u3.test(u)?c3:u===""?d3:h3),l)}function y3(e,a){return e.length===a.length&&e.slice(0,-1).every((l,s)=>l===a[s])?e[e.length-1]-a[a.length-1]:0}function g3(e,a,i=!1){let{routesMeta:l}=e,s={},u="/",c=[];for(let d=0;d{if(b==="*"){let E=d[x]||"";c=u.slice(0,u.length-E.length).replace(/(.)\/+$/,"$1")}const w=d[x];return g&&!w?p[b]=void 0:p[b]=(w||"").replace(/%2F/g,"/"),p},{}),pathname:u,pathnameBase:c,pattern:e}}function lx(e,a=!1,i=!0){Tt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let l=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,m,p,b)=>{if(l.push({paramName:d,isOptional:m!=null}),m){let g=b.charAt(p+c.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(l.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,a?void 0:"i"),l]}function v3(e){try{return e.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Tt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),e}}function Gn(e,a){if(a==="/")return e;if(!e.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,l=e.charAt(i);return l&&l!=="/"?null:e.slice(i)||"/"}function b3({basename:e,pathname:a}){return a==="/"?e:Yn([e,a])}var Fh=e=>nc.test(e);function x3(e,a="/"){let{pathname:i,search:l="",hash:s=""}=typeof e=="string"?xa(e):e,u;return i?(i=Yh(i),i.startsWith("/")?u=c0(i.substring(1),"/"):u=c0(i,a)):u=a,{pathname:u,search:w3(l),hash:_3(s)}}function c0(e,a){let i=Ku(a).split("/");)DELIM" -R"DELIM(return e.split("/").forEach(s=>{s===".."?i.length>1&&i.pop():s!=="."&&i.push(s)}),i.length>1?i.join("/"):"/"}function Ud(e,a,i,l){return`Cannot include a '${e}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function ox(e){return e.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function ac(e){let a=ox(e);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function Fo(e,a,i,l=!1){let s;typeof e=="string"?s=xa(e):(s={...e},De(!s.pathname||!s.pathname.includes("?"),Ud("?","pathname","search",s)),De(!s.pathname||!s.pathname.includes("#"),Ud("#","pathname","hash",s)),De(!s.search||!s.search.includes("#"),Ud("#","search","hash",s)));let u=e===""||s.pathname==="",c=u?"/":s.pathname,d;if(c==null)d=i;else{let g=a.length-1;if(!l&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),g-=1;s.pathname=x.join("/")}d=g>=0?a[g]:"/"}let m=x3(s,d),p=c&&c!=="/"&&c.endsWith("/"),b=(u||c===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(p||b)&&(m.pathname+="/"),m}var Yh=e=>e.replace(/[\\/]{2,}/g,"/"),Yn=e=>Yh(e.join("/")),Ku=e=>e.replace(/\/+$/,""),S3=e=>Ku(e).replace(/^\/*/,"/"),w3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,_3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,E3=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Yo=class{constructor(e,a,i,l=!1){this.status=e,this.statusText=a||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Do(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Go(e){let a=e.map(i=>i.route.path).filter(Boolean);return Yn(a)||"/"}var sx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ux(e,a){let i=e;if(typeof i!="string"||!nc.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,s=!1;if(sx)try{let u=new URL(window.location.href),c=Qh.test(i)?new URL(ex(i,u.protocol)):new URL(i),d=Gn(c.pathname,a);c.origin===u.origin&&d!=null?i=d+c.search+c.hash:s=!0}catch{Tt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:s,to:i}}var jr=Symbol("Uninstrumented");function T3(e,a){let i={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({id:a.id,index:a.index,path:a.path,instrument(u){let c=Object.keys(i);for(let d of c)u[d]&&i[d].push(u[d])}}));let l={};if(typeof a.lazy=="function"&&i.lazy.length>0){let s=ll(i.lazy,a.lazy,()=>{});s&&(l.lazy=s)}if(typeof a.lazy=="object"){let s=a.lazy;["middleware","loader","action"].forEach(u=>{let c=s[u],d=i[`lazy.${u}`];if(typeof c=="function"&&d.length>0){let m=ll(d,c,()=>{});m&&(l.lazy=Object.assign(l.lazy||{},{[u]:m}))}})}return["loader","action"].forEach(s=>{let u=a[s];if(typeof u=="function"&&i[s].length>0){let c=u[jr]??u,d=ll(i[s],c,(...m)=>f0(m[0]));d&&(s==="loader"&&c.hydrate===!0&&(d.hydrate=!0),d[jr]=c,l[s]=d)}}),a.middleware&&a.middleware.length>0&&i.middleware.length>0&&(l.middleware=a.middleware.map(s=>{let u=s[jr]??s,c=ll(i.middleware,u,(...d)=>f0(d[0]));return c?(c[jr]=u,c):s})),l}function R3(e,a){let i={navigate:[],fetch:[]};if(a.forEach(l=>l({instrument(s){let u=Object.keys(s);for(let c of u)s[c]&&i[c].push(s[c])}})),i.navigate.length>0){let l=e.navigate[jr]??e.navigate,s=ll(i.navigate,l,(...u)=>{let[c,d]=u;return{to:typeof c=="number"||typeof c=="string"?c:c?ba(c):".",...d0(e,d??{})}});s&&(s[jr]=l,e.navigate=s)}if(i.fetch.length>0){let l=e.fetch[jr]??e.fetch,s=ll(i.fetch,l,(...u)=>{let[c,,d,m]=u;return{href:d??".",fetcherKey:c,...d0(e,m??{})}});s&&(s[jr]=l,e.fetch=s)}return e}function ll(e,a,i){return e.length===0?null:async(...l)=>{let s=await cx(e,i(...l),()=>a(...l),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function cx(e,a,i,l){let s=e[l],u;if(s){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=cx(e,a,i,l-1),u=await c,De(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await s(d,a)}catch(m){console.error("An instrumentation function threw an error:",m)}c||await d(),await c}else try{u={type:"success",value:await i()}}catch(c){u={type:"error",value:c}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function f0(e){let{request:a,context:i,params:l,pattern:s}=e;return{request:A3(a),params:{...l},pattern:s,context:z3(i)}}function d0(e,a){return{currentUrl:ba(e.state.location),..."formMethod"in a?{formMethod:a.formMethod}:{},..."formEncType"in a?{formEncType:a.formEncType}:{},..."formData"in a?{formData:a.formData}:{},..."body"in a?{body:a.body}:{}}}function A3(e){return{method:e.method,url:e.url,headers:{get:(...a)=>e.headers.get(...a)}}}function z3(e){if(j3(e)){let a={...e};return Object.freeze(a),a}else return{get:a=>e.get(a)}}var C3=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function j3(e){if(e===null||typeof e!="object")return!1;const a=Object.getPrototypeOf(e);return a===Object.prototype||a===null||Object.getOwnPropertyNames(a).sort().join("\0")===C3}var fx=["POST","PUT","PATCH","DELETE"],N3=new Set(fx),M3=["GET",...fx],O3=new Set(M3),dx=new Set([301,302,303,307,308]),k3=new Set([307,308]),Hd={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},D3={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},mo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},L3=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),hx="remix-router-transitions",mx=Symbol("ResetLoaderData"),ti,nl,Rr,al,B3=class{constructor(e){xo(this,ti),xo(this,nl),xo(this,Rr),xo(this,al),pa(this,ti,e),pa(this,nl,ju(e))}get stableRoutes(){return Qn(this,ti)}get activeRoutes(){return Qn(this,Rr)??Qn(this,ti)}get branches(){return Qn(this,al)??Qn(this,nl)}get hasHMRRoutes(){return Qn(this,Rr)!=null}setRoutes(e){pa(this,ti,e),pa(this,nl,ju(e))}setHmrRoutes(e){pa(this,Rr,e),pa(this,al,ju(e))}commitHmrRoutes(){Qn(this,Rr)&&(pa(this,ti,Qn(this,Rr)),pa(this,nl,Qn(this,al)),pa(this,Rr,void 0),pa(this,al,void 0))}};ti=new WeakMap;nl=new WeakMap;Rr=new WeakMap;al=new WeakMap;function U3(e){const a=e.window?e.window:typeof window<"u"?window:void 0,i=typeof a<"u"&&typeof a.document<"u"&&typeof a.document.createElement<"u";De(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let l=e.hydrationRouteProperties||[],s=e.mapRouteProperties||L3,u=s;if(e.instrumentations){let z=e.instrumentations;u=L=>({...s(L),...T3(z.map(Z=>Z.route).filter(Boolean),L)})}let c={},d=new B3(ko(e.routes,u,void 0,c)),m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let p=e.dataStrategy||P3,b={...e.future},g=null,x=new Set,w=null,E=null,R=null,N=null,F=e.hydrationData!=null,V=la(d.activeRoutes,e.history.location,m,!1,d.branches),J=!1,ue=null,ae,xe;if(V==null&&!e.patchRoutesOnNavigation){let z=Fn(404,{pathname:e.history.location.pathname}),{matches:L,route:Z}=bu(d.activeRoutes);ae=!0,xe=!ae,V=L,ue={[Z.id]:z}}else if(V&&!e.hydrationData&&Xa(V,d.activeRoutes,e.history.location.pathname).active&&(V=null),V)if(V.some(z=>z.route.lazy))ae=!1,xe=!ae;else if(!V.some(z=>Gh(z.route)))ae=!0,xe=!ae;else{let z=e.hydrationData?e.hydrationData.loaderData:null,L=e.hydrationData?e.hydrationData.errors:null,Z=V;if(L){let ie=V.findIndex(se=>L[se.route.id]!==void 0);Z=Z.slice(0,ie+1)}xe=!1,ae=!0,Z.forEach(ie=>{let se=px(ie.route,z,L);xe=xe||se.renderFallback,ae=ae&&!se.shouldLoad})}else{ae=!1,xe=!ae,V=[];let z=Xa(null,d.activeRoutes,e.history.location.pathname);)DELIM" -R"DELIM(z.active&&z.matches&&(J=!0,V=z.matches)}let j,_={historyAction:e.history.action,location:e.history.location,matches:V,initialized:ae,renderFallback:xe,navigation:Hd,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||ue,fetchers:new Map,blockers:new Map},D="POP",B=null,Q=!1,q,G=!1,re=new Map,fe=null,M=!1,k=!1,le=new Set,ce=new Map,we=0,C=-1,K=new Map,oe=new Set,he=new Map,Ee=new Map,Te=new Set,W=new Map,de,X=null;function ge(){if(g=e.history.listen(({action:z,location:L,delta:Z})=>{if(de){de(),de=void 0;return}Tt(W.size===0||Z!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ie=Br({currentLocation:_.location,nextLocation:L,historyAction:z});if(ie&&Z!=null){let se=new Promise(be=>{de=be});e.history.go(Z*-1),Ea(ie,{state:"blocked",location:L,proceed(){Ea(ie,{state:"proceeding",proceed:void 0,reset:void 0,location:L}),se.then(()=>e.history.go(Z))},reset(){let be=new Map(_.blockers);be.set(ie,mo),je({blockers:be})}}),B?.resolve(),B=null;return}return qe(z,L)}),i){sA(a,re);let z=()=>uA(a,re);a.addEventListener("pagehide",z),fe=()=>a.removeEventListener("pagehide",z)}return _.initialized||qe("POP",_.location,{initialHydration:!0}),j}function pe(){g&&g(),fe&&fe(),x.clear(),q&&q.abort(),_.fetchers.forEach((z,L)=>_a(_.fetchers,L)),_.blockers.forEach((z,L)=>Lr(L))}function Ue(z){if(x.add(z),w){let{newErrors:L}=w;w=null,z(_,{deletedFetchers:[],newErrors:L,viewTransitionOpts:void 0,flushSync:!1})}return()=>x.delete(z)}function je(z,L={}){z.matches&&(z.matches=z.matches.map(se=>{let be=c[se.route.id],me=se.route;return me.element!==be.element||me.errorElement!==be.errorElement||me.hydrateFallbackElement!==be.hydrateFallbackElement?{...se,route:be}:se})),_={..._,...z};let Z=[],ie=[];_.fetchers.forEach((se,be)=>{se.state==="idle"&&(Te.has(be)?Z.push(be):ie.push(be))}),Te.forEach(se=>{!_.fetchers.has(se)&&!ce.has(se)&&Z.push(se)}),x.size===0&&(w={newErrors:z.errors??null}),[...x].forEach(se=>se(_,{deletedFetchers:Z,newErrors:z.errors??null,viewTransitionOpts:L.viewTransitionOpts,flushSync:L.flushSync===!0})),Z.forEach(se=>_a(_.fetchers,se)),ie.forEach(se=>_.fetchers.delete(se))}function He(z,L,{flushSync:Z}={}){let ie=_.actionData!=null&&_.navigation.formMethod!=null&&tn(_.navigation.formMethod)&&_.navigation.state==="loading"&&z.state?._isRedirect!==!0,se;L.actionData?Object.keys(L.actionData).length>0?se=L.actionData:se=null:ie?se=_.actionData:se=null;let be=L.loaderData?w0(_.loaderData,L.loaderData,L.matches||[],L.errors):_.loaderData,me=_.blockers;me.size>0&&(me=new Map(me),me.forEach((ze,Le)=>me.set(Le,mo)));let ve=M?!1:bl(z,L.matches||_.matches),ye=Q===!0||_.navigation.formMethod!=null&&tn(_.navigation.formMethod)&&z.state?._isRedirect!==!0;d.commitHmrRoutes(),M||D==="POP"||(D==="PUSH"?e.history.push(z,z.state):D==="REPLACE"&&e.history.replace(z,z.state));let Ae;if(D==="POP"){let ze=re.get(_.location.pathname);ze&&ze.has(z.pathname)?Ae={currentLocation:_.location,nextLocation:z}:re.has(z.pathname)&&(Ae={currentLocation:z,nextLocation:_.location})}else if(G){let ze=re.get(_.location.pathname);ze?ze.add(z.pathname):(ze=new Set([z.pathname]),re.set(_.location.pathname,ze)),Ae={currentLocation:_.location,nextLocation:z}}je({...L,actionData:se,loaderData:be,historyAction:D,location:z,initialized:!0,renderFallback:!1,navigation:Hd,revalidation:"idle",restoreScrollPosition:ve,preventScrollReset:ye,blockers:me},{viewTransitionOpts:Ae,flushSync:Z===!0}),D="POP",Q=!1,G=!1,M=!1,k=!1,B?.resolve(),B=null,X?.resolve(),X=null}async function Mt(z,L){if(B?.resolve(),B=null,typeof z=="number"){B||(B=R0());let We=B.promise;return e.history.go(z),We}let Z=ph(_.location,_.matches,m,z,L?.fromRouteId,L?.relative),{path:ie,submission:se,error:be}=h0(!1,Z,L),me;L?.mask&&(me={pathname:"",search:"",hash:"",...typeof L.mask=="string"?xa(L.mask):{..._.location.mask,...L.mask}});let ve=_.location,ye=Oo(ve,ie,L&&L.state,void 0,me);ye={...ye,...e.history.encodeLocation(ye)};let Ae=L&&L.replace!=null?L.replace:void 0,ze="PUSH";Ae===!0?ze="REPLACE":Ae===!1||se!=null&&tn(se.formMethod)&&se.formAction===_.location.pathname+_.location.search&&(ze="REPLACE");let Le=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,Me=(L&&L.flushSync)===!0,Ze=Br({currentLocation:ve,nextLocation:ye,historyAction:ze});if(Ze){Ea(Ze,{state:"blocked",location:ye,proceed(){Ea(Ze,{state:"proceeding",proceed:void 0,reset:void 0,location:ye}),Mt(z,L)},reset(){let We=new Map(_.blockers);We.set(Ze,mo),je({blockers:We})}});return}await qe(ze,ye,{submission:se,pendingError:be,preventScrollReset:Le,replace:L&&L.replace,enableViewTransition:L&&L.viewTransition,flushSync:Me,callSiteDefaultShouldRevalidate:L&&L.defaultShouldRevalidate})}function Ve(){X||(X=R0()),sa(),je({revalidation:"loading"});let z=X.promise;return _.navigation.state==="submitting"?z:_.navigation.state==="idle"?(qe(_.historyAction,_.location,{startUninterruptedRevalidation:!0}),z):(qe(D||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:G===!0}),z)}async function qe(z,L,Z){q&&q.abort(),q=null,D=z,M=(Z&&Z.startUninterruptedRevalidation)===!0,dc(_.location,_.matches),Q=(Z&&Z.preventScrollReset)===!0,G=(Z&&Z.enableViewTransition)===!0;let ie=d.activeRoutes,se=Z?.initialHydration&&_.matches&&_.matches.length>0&&!J?_.matches:la(ie,L,m,!1,d.branches),be=(Z&&Z.flushSync)===!0;if(se&&_.initialized&&!k&&J3(_.location,L)&&!(Z&&Z.submission&&tn(Z.submission.formMethod))){He(L,{matches:se},{flushSync:be});return}let me=Xa(se,ie,L.pathname);if(me.active&&me.matches&&(se=me.matches),!se){let{error:rt,notFoundMatches:Xe,route:Rt}=Jn(L.pathname);He(L,{matches:Xe,loaderData:{},errors:{[Rt.id]:rt}},{flushSync:be});return}let ve=Z&&Z.overrideNavigation?{...Z.overrideNavigation,matches:se,historyAction:z}:void 0;q=new AbortController;let ye=rl(e.history,L,q.signal,Z&&Z.submission),Ae=e.getContext?await e.getContext():new o0,ze;if(Z&&Z.pendingError)ze=[Cr(se).route.id,{type:"error",error:Z.pendingError}];else if(Z&&Z.submission&&tn(Z.submission.formMethod)){let rt=await st(ye,L,Z.submission,se,z,Ae,me.active,Z&&Z.initialHydration===!0,{replace:Z.replace,flushSync:be});if(rt.shortCircuited)return;if(rt.pendingActionResult){let[Xe,Rt]=rt.pendingActionResult;if(Cn(Rt)&&Do(Rt.error)&&Rt.error.status===404){q=null,He(L,{matches:rt.matches,loaderData:{},errors:{[Xe]:Rt.error}});return}}se=rt.matches||se,ze=rt.pendingActionResult,ve=$d(L,se,z,Z.submission),be=!1,me.active=!1,ye=rl(e.history,ye.url,ye.signal)}let{shortCircuited:Le,matches:Me,loaderData:Ze,errors:We,workingFetchers:yt}=await Fe(ye,L,se,z,Ae,me.active,ve,Z&&Z.submission,Z&&Z.fetcherSubmission,Z&&Z.replace,Z&&Z.initialHydration===!0,be,ze,Z&&Z.callSiteDefaultShouldRevalidate);Le||(q=null,He(L,{matches:Me||se,..._0(ze),loaderData:Ze,errors:We,...yt?{fetchers:yt}:{}}))}async function st(z,L,Z,ie,se,be,me,ve,ye={}){sa();let Ae=lA(L,ie,se,Z);if(je({navigation:Ae},{flushSync:ye.flushSync===!0}),me){let Me=await ua(ie,L.pathname,z.signal);if(Me.type==="aborted")return{shortCircuited:!0};if(Me.type==="error"){if(Me.partialMatches.length===0){let{matches:We,route:yt}=bu(d.activeRoutes);return{matches:We,pendingActionResult:[yt.id,{type:"error",error:Me.error}]}}let Ze=Cr(Me.partialMatches).route.id;return{matches:Me.partialMatches,pendingActionResult:[Ze,{type:"error",error:Me.error}]}}else if(Me.matches)ie=Me.matches;else{let{notFoundMatches:Ze,error:We,route:yt}=Jn(L.pathname);return{matches:Ze,)DELIM" -R"DELIM(pendingActionResult:[yt.id,{type:"error",error:We}]}}}let ze,Le=Nu(ie,L);if(!Le.route.action&&!Le.route.lazy)ze={type:"error",error:Fn(405,{method:z.method,pathname:L.pathname,routeId:Le.route.id})};else{let Me=ul(u,c,z,L,ie,Le,ve?[]:l,be),Ze=await On(z,L,Me,be,null);if(ze=Ze[Le.route.id],!ze){for(let We of ie)if(Ze[We.route.id]){ze=Ze[We.route.id];break}}if(z.signal.aborted)return{shortCircuited:!0}}if(ii(ze)){let Me;return ye&&ye.replace!=null?Me=ye.replace:Me=b0(ze.response.headers.get("Location"),new URL(z.url),m,e.history)===_.location.pathname+_.location.search,await $t(z,ze,!0,{submission:Z,replace:Me}),{shortCircuited:!0}}if(Cn(ze)){let Me=Cr(ie,Le.route.id);return(ye&&ye.replace)!==!0&&(D="PUSH"),{matches:ie,pendingActionResult:[Me.route.id,ze,Le.route.id]}}return{matches:ie,pendingActionResult:[Le.route.id,ze]}}async function Fe(z,L,Z,ie,se,be,me,ve,ye,Ae,ze,Le,Me,Ze){let We=me||$d(L,Z,ie,ve),yt=ve||ye||T0(We),rt=!M&&!ze;if(be){if(rt){let ht=pt(Me);je({navigation:We,...ht!==void 0?{actionData:ht}:{}},{flushSync:Le})}let Oe=await ua(Z,L.pathname,z.signal);if(Oe.type==="aborted")return{shortCircuited:!0};if(Oe.type==="error"){if(Oe.partialMatches.length===0){let{matches:xn,route:ta}=bu(d.activeRoutes);return{matches:xn,loaderData:{},errors:{[ta.id]:Oe.error}}}let ht=Cr(Oe.partialMatches).route.id;return{matches:Oe.partialMatches,loaderData:{},errors:{[ht]:Oe.error}}}else if(Oe.matches)Z=Oe.matches;else{let{error:ht,notFoundMatches:xn,route:ta}=Jn(L.pathname);return{matches:xn,loaderData:{},errors:{[ta.id]:ht}}}}let Xe=d.activeRoutes,{dsMatches:Rt,revalidatingFetchers:Ie}=m0(z,se,u,c,e.history,_,Z,yt,L,ze?[]:l,ze===!0,k,le,Te,he,oe,Xe,m,e.patchRoutesOnNavigation!=null,d.branches,Me,Ze);if(C=++we,!e.dataStrategy&&!Rt.some(Oe=>Oe.shouldLoad)&&!Rt.some(Oe=>Oe.route.middleware&&Oe.route.middleware.length>0)&&Ie.length===0){let Oe=new Map(_.fetchers),ht=Io(Oe);return He(L,{matches:Z,loaderData:{},errors:Me&&Cn(Me[1])?{[Me[0]]:Me[1].error}:null,..._0(Me),...ht?{fetchers:Oe}:{}},{flushSync:Le}),{shortCircuited:!0}}if(rt){let Oe={};if(!be){Oe.navigation=We;let ht=pt(Me);ht!==void 0&&(Oe.actionData=ht)}Ie.length>0&&(Oe.fetchers=nn(Ie)),je(Oe,{flushSync:Le})}Ie.forEach(Oe=>{qt(Oe.key),Oe.controller&&ce.set(Oe.key,Oe.controller)});let Ia=()=>Ie.forEach(Oe=>qt(Oe.key));q&&q.signal.addEventListener("abort",Ia);let{loaderResults:Wn,fetcherResults:cn}=await wa(Rt,Ie,z,L,se);if(z.signal.aborted)return{shortCircuited:!0};q&&q.signal.removeEventListener("abort",Ia),Ie.forEach(Oe=>ce.delete(Oe.key));let rn=xu(Wn);if(rn)return await $t(z,rn.result,!0,{replace:Ae}),{shortCircuited:!0};if(rn=xu(cn),rn)return oe.add(rn.key),await $t(z,rn.result,!0,{replace:Ae}),{shortCircuited:!0};let Dn=new Map(_.fetchers),{loaderData:mi,errors:ea}=S0(_,Z,Wn,Me,Ie,cn,Dn);ze&&_.errors&&(ea={..._.errors,...ea});let pi=Io(Dn),Ta=Jo(C,Dn),Ra=pi||Ta||Ie.length>0;return{matches:Z,loaderData:mi,errors:ea,...Ra?{workingFetchers:Dn}:{}}}function pt(z){if(z&&!Cn(z[1]))return{[z[0]]:z[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function nn(z){let L=new Map(_.fetchers);return z.forEach(Z=>{let ie=L.get(Z.key),se=po(void 0,ie?ie.data:void 0);L.set(Z.key,se)}),L}async function Mn(z,L,Z,ie){qt(z);let se=(ie&&ie.flushSync)===!0,be=d.activeRoutes,me=ph(_.location,_.matches,m,Z,L,ie?.relative),ve=la(be,me,m,!1,d.branches),ye=Xa(ve,be,me);if(ye.active&&ye.matches&&(ve=ye.matches),!ve){kn(z,L,Fn(404,{pathname:me}),{flushSync:se});return}let{path:Ae,submission:ze,error:Le}=h0(!0,me,ie);if(Le){kn(z,L,Le,{flushSync:se});return}let Me=e.getContext?await e.getContext():new o0,Ze=(ie&&ie.preventScrollReset)===!0;if(ze&&tn(ze.formMethod)){await vl(z,L,Ae,ve,Me,ye.active,se,Ze,ze,ie&&ie.defaultShouldRevalidate);return}he.set(z,{routeId:L,path:Ae}),await Qt(z,L,Ae,ve,Me,ye.active,se,Ze,ze)}async function vl(z,L,Z,ie,se,be,me,ve,ye,Ae){sa(),he.delete(z);let ze=_.fetchers.get(z);In(z,oA(ye,ze),{flushSync:me});let Le=new AbortController,Me=rl(e.history,Z,Le.signal,ye);if(be){let it=await ua(ie,new URL(Me.url).pathname,Me.signal,z);if(it.type==="aborted")return;if(it.type==="error"){kn(z,L,it.error,{flushSync:me});return}else if(it.matches)ie=it.matches;else{kn(z,L,Fn(404,{pathname:Z}),{flushSync:me});return}}let Ze=Nu(ie,Z);if(!Ze.route.action&&!Ze.route.lazy){let it=Fn(405,{method:ye.formMethod,pathname:Z,routeId:L});kn(z,L,it,{flushSync:me});return}ce.set(z,Le);let We=we,yt=ul(u,c,Me,Z,ie,Ze,l,se),rt=await On(Me,Z,yt,se,z),Xe=rt[Ze.route.id];if(!Xe){for(let it of yt)if(rt[it.route.id]){Xe=rt[it.route.id];break}}if(Me.signal.aborted){ce.get(z)===Le&&ce.delete(z);return}if(Te.has(z)){if(ii(Xe)||Cn(Xe)){In(z,ga(void 0));return}}else{if(ii(Xe))if(ce.delete(z),C>We){In(z,ga(void 0));return}else return oe.add(z),In(z,po(ye)),$t(Me,Xe,!1,{fetcherSubmission:ye,preventScrollReset:ve});if(Cn(Xe)){kn(z,L,Xe.error);return}}let Rt=_.navigation.location||_.location,Ie=rl(e.history,Rt,Le.signal),Ia=d.activeRoutes,Wn=_.navigation.state!=="idle"?la(Ia,_.navigation.location,m,!1,d.branches):_.matches;De(Wn,"Didn't find any matches after fetcher action");let cn=++we;K.set(z,cn);let{dsMatches:rn,revalidatingFetchers:Dn}=m0(Ie,se,u,c,e.history,_,Wn,ye,Rt,l,!1,k,le,Te,he,oe,Ia,m,e.patchRoutesOnNavigation!=null,d.branches,[Ze.route.id,Xe],Ae),mi=po(ye,Xe.data),ea=new Map(_.fetchers);ea.set(z,mi),Dn.filter(it=>it.key!==z).forEach(it=>{let Aa=it.key,ln=ea.get(Aa),xl=po(void 0,ln?ln.data:void 0);ea.set(Aa,xl),qt(Aa),it.controller&&ce.set(Aa,it.controller)}),je({fetchers:ea});let pi=()=>Dn.forEach(it=>qt(it.key));Le.signal.addEventListener("abort",pi);let{loaderResults:Ta,fetcherResults:Ra}=await wa(rn,Dn,Ie,Rt,se);if(Le.signal.aborted)return;Le.signal.removeEventListener("abort",pi),K.delete(z),ce.delete(z),Dn.forEach(it=>ce.delete(it.key));let Oe=_.fetchers.has(z),ht=it=>{if(!Oe)return it;let Aa=new Map(it.fetchers);return Aa.set(z,ga(Xe.data)),{...it,fetchers:Aa}},xn=xu(Ta);if(xn)return _=ht(_),$t(Ie,xn.result,!1,{preventScrollReset:ve});if(xn=xu(Ra),xn)return oe.add(xn.key),_=ht(_),$t(Ie,xn.result,!1,{preventScrollReset:ve});let ta=new Map(_.fetchers);Oe&&ta.set(z,ga(Xe.data));let{loaderData:yi,errors:gi}=S0(_,Wn,Ta,void 0,Dn,Ra,ta);Jo(cn,ta),_.navigation.state==="loading"&&cn>C?(De(D,"Expected pending action"),q&&q.abort(),He(_.navigation.location,{matches:Wn,loaderData:yi,errors:gi,fetchers:ta})):(je({errors:gi,loaderData:w0(_.loaderData,yi,Wn,gi),fetchers:ta}),k=!1)}async function Qt(z,L,Z,ie,se,be,me,ve,ye){let Ae=_.fetchers.get(z);In(z,po(ye,Ae?Ae.data:void 0),{flushSync:me});let ze=new AbortController,Le=rl(e.history,Z,ze.signal);if(be){let Xe=await ua(ie,new URL(Le.url).pathname,Le.signal,z);if(Xe.type==="aborted")return;if(Xe.type==="error"){kn(z,L,Xe.error,{flushSync:me});return}else if(Xe.matches)ie=Xe.matches;else{kn(z,L,Fn(404,{pathname:Z}),{flushSync:me});return}}let Me=Nu(ie,Z);ce.set(z,ze);let Ze=we,We=ul(u,c,Le,Z,ie,Me,l,se),yt=await On(Le,Z,We,se,z),rt=yt[Me.route.id];if(!rt){for(let Xe of ie)if(yt[Xe.route.id]){rt=yt[Xe.route.id];break}}if(ce.get(z)===ze&&ce.delete(z),!Le.signal.aborted){if(Te.has(z)){In(z,ga(void 0));return}if(ii(rt))if(C>Ze){In(z,ga(void 0));return}else{oe.add(z),await $t(Le,rt,!1,{preventScrollReset:ve});return}if(Cn(rt)){kn(z,L,rt.error);return}In(z,ga(rt.data))}}async function $t(z,L,Z,{submission:ie,fetcherSubmission:se,preventScrollReset:be,replace:me}={}){Z||(B?.resolve(),B=null),L.response.headers.has("X-Remix-Revalidate")&&(k=!0);let ve=L.response.headers.get("Location");De(ve,"Expected a Location header on the redirect Response"),ve=b0(ve,new URL(z.url),m,e.history);let ye=Oo(_.location,ve,{_isRedirect:!0});if(i){let We=!1;if(L.response.headers.has("X-Remix-Reload-Document"))We=!0;else if(Fh(ve)){const yt=tx(a,ve,!0);We=yt.origin!==a.location.origin||Gn(yt.pathname,m)==null}if(We){me?a.location.replace(ve):a.location.assign(ve);return}}q=null;let Ae=me===!0||L.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:ze,)DELIM" -R"DELIM(formAction:Le,formEncType:Me}=_.navigation;!ie&&!se&&ze&&Le&&Me&&(ie=T0(_.navigation));let Ze=ie||se;if(k3.has(L.response.status)&&Ze&&tn(Ze.formMethod))await qe(Ae,ye,{submission:{...Ze,formAction:ve},preventScrollReset:be||Q,enableViewTransition:Z?G:void 0});else{let We=$d(ye,[],Ae,ie);await qe(Ae,ye,{overrideNavigation:We,fetcherSubmission:se,preventScrollReset:be||Q,enableViewTransition:Z?G:void 0})}}async function On(z,L,Z,ie,se){let be,me={};try{be=await F3(p,z,L,Z,se,ie,!1)}catch(ve){return Z.filter(ye=>ye.shouldLoad).forEach(ye=>{me[ye.route.id]={type:"error",error:ve}}),me}if(z.signal.aborted)return me;if(!tn(z.method))for(let ve of Z){if(be[ve.route.id]?.type==="error")break;!be.hasOwnProperty(ve.route.id)&&!_.loaderData.hasOwnProperty(ve.route.id)&&(!_.errors||!_.errors.hasOwnProperty(ve.route.id))&&ve.shouldCallHandler()&&(be[ve.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${ve.route.id}`)})}for(let[ve,ye]of Object.entries(be))if(nA(ye)){let Ae=ye.result;me[ve]={type:"redirect",response:V3(Ae,z,ve,Z,m)}}else me[ve]=await K3(ye);return me}async function wa(z,L,Z,ie,se){let be=On(Z,ie,z,se,null),me=Promise.all(L.map(async Ae=>{if(Ae.matches&&Ae.match&&Ae.request&&Ae.controller){let Le=(await On(Ae.request,Ae.path,Ae.matches,se,Ae.key))[Ae.match.route.id];return{[Ae.key]:Le}}else return Promise.resolve({[Ae.key]:{type:"error",error:Fn(404,{pathname:Ae.path})}})})),ve=await be,ye=(await me).reduce((Ae,ze)=>Object.assign(Ae,ze),{});return{loaderResults:ve,fetcherResults:ye}}function sa(){k=!0,he.forEach((z,L)=>{ce.has(L)&&le.add(L),qt(L)})}function In(z,L,Z={}){let ie=new Map(_.fetchers);ie.set(z,L),je({fetchers:ie},{flushSync:(Z&&Z.flushSync)===!0})}function kn(z,L,Z,ie={}){let se=Cr(_.matches,L),be=new Map(_.fetchers);_a(be,z),je({errors:{[se.route.id]:Z},fetchers:be},{flushSync:(ie&&ie.flushSync)===!0})}function uc(z){return Ee.set(z,(Ee.get(z)||0)+1),Te.has(z)&&Te.delete(z),_.fetchers.get(z)||D3}function cc(z,L){qt(z,L?.reason),In(z,ga(null))}function _a(z,L){let Z=_.fetchers.get(L);ce.has(L)&&!(Z&&Z.state==="loading"&&K.has(L))&&qt(L),he.delete(L),K.delete(L),oe.delete(L),Te.delete(L),le.delete(L),z.delete(L)}function an(z){let L=(Ee.get(z)||0)-1;L<=0?(Ee.delete(z),Te.add(z)):Ee.set(z,L),je({fetchers:new Map(_.fetchers)})}function qt(z,L){let Z=ce.get(z);Z&&(Z.abort(L),ce.delete(z))}function It(z,L){for(let Z of z){let ie=L.get(Z);De(ie,`Expected fetcher: ${Z}`);let se=ga(ie.data);L.set(Z,se)}}function Io(z){let L=[],Z=!1;for(let ie of oe){let se=z.get(ie);De(se,`Expected fetcher: ${ie}`),se.state==="loading"&&(oe.delete(ie),L.push(ie),Z=!0)}return It(L,z),Z}function Jo(z,L){let Z=[];for(let[ie,se]of K)if(se0}function fc(z,L){let Z=_.blockers.get(z)||mo;return W.get(z)!==L&&W.set(z,L),Z}function Lr(z){_.blockers.delete(z),W.delete(z)}function Ea(z,L){let Z=_.blockers.get(z)||mo;De(Z.state==="unblocked"&&L.state==="blocked"||Z.state==="blocked"&&L.state==="blocked"||Z.state==="blocked"&&L.state==="proceeding"||Z.state==="blocked"&&L.state==="unblocked"||Z.state==="proceeding"&&L.state==="unblocked",`Invalid blocker state transition: ${Z.state} -> ${L.state}`);let ie=new Map(_.blockers);ie.set(z,L),je({blockers:ie})}function Br({currentLocation:z,nextLocation:L,historyAction:Z}){if(W.size===0)return;W.size>1&&Tt(!1,"A router only supports one blocker at a time");let ie=Array.from(W.entries()),[se,be]=ie[ie.length-1],me=_.blockers.get(se);if(!(me&&me.state==="proceeding")&&be({currentLocation:z,nextLocation:L,historyAction:Z}))return se}function Jn(z){let L=Fn(404,{pathname:z}),Z=d.activeRoutes,{matches:ie,route:se}=bu(Z);return{notFoundMatches:ie,route:se,error:L}}function hi(z,L,Z){if(E=z,N=L,R=Z||null,!F&&_.navigation===Hd){F=!0;let ie=bl(_.location,_.matches);ie!=null&&je({restoreScrollPosition:ie})}return()=>{E=null,N=null,R=null}}function Va(z,L){return R&&R(z,L.map(ie=>o3(ie,_.loaderData)))||z.key}function dc(z,L){if(E&&N){let Z=Va(z,L);E[Z]=N()}}function bl(z,L){if(E){let Z=Va(z,L),ie=E[Z];if(typeof ie=="number")return ie}return null}function Xa(z,L,Z){if(e.patchRoutesOnNavigation){let ie=d.branches;if(z){if(Object.keys(z[0].params).length>0)return{active:!0,matches:la(L,Z,m,!0,ie)}}else return{active:!0,matches:la(L,Z,m,!0,ie)||[]}}return{active:!1,matches:null}}async function ua(z,L,Z,ie){if(!e.patchRoutesOnNavigation)return{type:"success",matches:z};let se=z;for(;;){let be=c;try{await e.patchRoutesOnNavigation({signal:Z,path:L,matches:se,fetcherKey:ie,patch:(Ae,ze)=>{Z.aborted||p0(Ae,ze,d,be,u,!1)}})}catch(Ae){return{type:"error",error:Ae,partialMatches:se}}if(Z.aborted)return{type:"aborted"};let me=d.branches,ve=la(d.activeRoutes,L,m,!1,me),ye=null;if(ve){if(Object.keys(ve[0].params).length===0)return{type:"success",matches:ve};if(ye=la(d.activeRoutes,L,m,!0,me),!(ye&&se.lengthZ.route.id===L[ie].route.id)}function es(z){c={},d.setHmrRoutes(ko(z,u,void 0,c))}function ts(z,L,Z=!1){p0(z,L,d,c,u,Z),d.hasHMRRoutes||je({})}return j={get basename(){return m},get future(){return b},get state(){return _},get routes(){return d.stableRoutes},get branches(){return d.branches},get manifest(){return c},get window(){return a},initialize:ge,subscribe:Ue,enableScrollRestoration:hi,navigate:Mt,fetch:Mn,revalidate:Ve,createHref:z=>e.history.createHref(z),encodeLocation:z=>e.history.encodeLocation(z),getFetcher:uc,resetFetcher:cc,deleteFetcher:an,dispose:pe,getBlocker:fc,deleteBlocker:Lr,patchRoutes:ts,_internalFetchControllers:ce,_internalSetRoutes:es,_internalSetStateDoNotUseOrYouWillBreakYourApp(z){je(z)}},e.instrumentations&&(j=R3(j,e.instrumentations.map(z=>z.router).filter(Boolean))),j}function H3(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ph(e,a,i,l,s,u){let c,d;if(s){c=[];for(let p of a)if(c.push(p),p.route.id===s){d=p;break}}else c=a,d=a[a.length-1];let m=Fo(l||".",ac(c),Gn(e.pathname,i)||e.pathname,u==="path");if(l==null&&(m.search=e.search,m.hash=e.hash),(l==null||l===""||l===".")&&d){let p=Vh(m.search);if(d.route.index&&!p)m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&p){let b=new URLSearchParams(m.search),g=b.getAll("index");b.delete("index"),g.filter(w=>w).forEach(w=>b.append("index",w));let x=b.toString();m.search=x?`?${x}`:""}}return i!=="/"&&(m.pathname=b3({basename:i,pathname:m.pathname})),ba(m)}function h0(e,a,i){if(!i||!H3(i))return{path:a};if(i.formMethod&&!iA(i.formMethod))return{path:a,error:Fn(405,{method:i.formMethod})};let l=()=>({path:a,error:Fn(400,{type:"invalid-body"})}),u=(i.formMethod||"get").toUpperCase(),c=wx(a);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!tn(u))return l();let g=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((x,[w,E])=>`${x}${w}=${E} -`,""):String(i.body);return{path:a,submission:{formMethod:u,formAction:c,formEncType:i.formEncType,formData:void 0,json:void 0,text:g}}}else if(i.formEncType==="application/json"){if(!tn(u))return l();try{let g=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:a,submission:{formMethod:u,formAction:c,formEncType:i.formEncType,formData:void 0,json:g,text:void 0}}}catch{return l()}}}De(typeof FormData=="function","FormData is not available in this environment");let d,m;if(i.formData)d=vh(i.formData),m=i.formData;else if(i.body instanceof FormData)d=vh(i.body),m=i.body;else if(i.body instanceof URLSearchParams)d=i.body,m=x0(d);else if(i.body==null)d=new URLSearchParams,m=new FormData;else try{d=new URLSearchParams(i.body),m=x0(d)}catch{return l()}let p={formMethod:u,)DELIM" -R"DELIM(formAction:c,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:m,json:void 0,text:void 0};if(tn(p.formMethod))return{path:a,submission:p};let b=xa(a);return e&&b.search&&Vh(b.search)&&d.append("index",""),b.search=`?${d}`,{path:ba(b),submission:p}}function m0(e,a,i,l,s,u,c,d,m,p,b,g,x,w,E,R,N,F,V,J,ue,ae){let xe=ue?Cn(ue[1])?ue[1].error:ue[1].data:void 0,j=s.createURL(u.location),_=s.createURL(m),D;if(b&&u.errors){let M=Object.keys(u.errors)[0];D=c.findIndex(k=>k.route.id===M)}else if(ue&&Cn(ue[1])){let M=ue[0];D=c.findIndex(k=>k.route.id===M)-1}let B=ue?ue[1].statusCode:void 0,Q=B&&B>=400,q={currentUrl:j,currentParams:u.matches[0]?.params||{},nextUrl:_,nextParams:c[0].params,...d,actionResult:xe,actionStatus:B},G=Go(c),re=c.map((M,k)=>{let{route:le}=M,ce=null;if(D!=null&&k>D)ce=!1;else if(le.lazy)ce=!0;else if(!Gh(le))ce=!1;else if(b){let{shouldLoad:oe}=px(le,u.loaderData,u.errors);ce=oe}else $3(u.loaderData,u.matches[k],M)&&(ce=!0);if(ce!==null)return yh(i,l,e,m,G,M,p,a,ce);let we=!1;typeof ae=="boolean"?we=ae:Q?we=!1:(g||j.pathname+j.search===_.pathname+_.search||j.search!==_.search||Z3(u.matches[k],M))&&(we=!0);let C={...q,defaultShouldRevalidate:we},K=_o(M,C);return yh(i,l,e,m,G,M,p,a,K,C,ae)}),fe=[];return E.forEach((M,k)=>{if(b||!c.some(Ee=>Ee.route.id===M.routeId)||w.has(k))return;let le=u.fetchers.get(k),ce=le&&le.state!=="idle"&&le.data===void 0,we=la(N,M.path,F??"/",!1,J);if(!we){if(V&&ce)return;fe.push({key:k,routeId:M.routeId,path:M.path,matches:null,match:null,request:null,controller:null});return}if(R.has(k))return;let C=Nu(we,M.path),K=new AbortController,oe=rl(s,M.path,K.signal),he=null;if(x.has(k))x.delete(k),he=ul(i,l,oe,M.path,we,C,p,a);else if(ce)g&&(he=ul(i,l,oe,M.path,we,C,p,a));else{let Ee;typeof ae=="boolean"?Ee=ae:Q?Ee=!1:Ee=g;let Te={...q,defaultShouldRevalidate:Ee};_o(C,Te)&&(he=ul(i,l,oe,M.path,we,C,p,a,Te))}he&&fe.push({key:k,routeId:M.routeId,path:M.path,matches:he,match:C,request:oe,controller:K})}),{dsMatches:re,revalidatingFetchers:fe}}function Gh(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function px(e,a,i){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Gh(e))return{shouldLoad:!1,renderFallback:!1};let l=a!=null&&e.id in a,s=i!=null&&i[e.id]!==void 0;if(!l&&s)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!l};let u=!l&&!s;return{shouldLoad:u,renderFallback:u}}function $3(e,a,i){let l=!a||i.route.id!==a.route.id,s=!e.hasOwnProperty(i.route.id);return l||s}function Z3(e,a){let i=e.route.path;return e.pathname!==a.pathname||i!=null&&i.endsWith("*")&&e.params["*"]!==a.params["*"]}function _o(e,a){if(e.route.shouldRevalidate){let i=e.route.shouldRevalidate(a);if(typeof i=="boolean")return i}return a.defaultShouldRevalidate}function p0(e,a,i,l,s,u){let c;if(e){let p=l[e];De(p,`No route found to patch children into: routeId = ${e}`),p.children||(p.children=[]),c=p.children}else c=i.activeRoutes;let d=[],m=[];if(a.forEach(p=>{let b=c.find(g=>yx(p,g));b?m.push({existingRoute:b,newRoute:p}):d.push(p)}),d.length>0){let p=ko(d,s,[e||"_","patch",String(c?.length||"0")],l);c.push(...p)}if(u&&m.length>0)for(let p=0;pa.children?.some(s=>yx(i,s)))??!1:!1}var y0=new WeakMap,gx=({key:e,route:a,manifest:i,mapRouteProperties:l})=>{let s=i[a.id];if(De(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let u=s.lazy[e];if(!u)return;let c=y0.get(s);c||(c={},y0.set(s,c));let d=c[e];if(d)return d;let m=(async()=>{let p=a3(e),g=s[e]!==void 0&&e!=="hasErrorBoundary";if(p)Tt(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)Tt(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await u();x!=null&&(Object.assign(s,{[e]:x}),Object.assign(s,l(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(x=>x===void 0)&&(s.lazy=void 0))})();return c[e]=m,m},g0=new WeakMap;function q3(e,a,i,l,s){let u=i[e.id];if(De(u,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let b=g0.get(u);if(b)return{lazyRoutePromise:b,lazyHandlerPromise:b};let g=(async()=>{De(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),w={};for(let E in x){let R=x[E];if(R===void 0)continue;let N=i3(E),V=u[E]!==void 0&&E!=="hasErrorBoundary";N?Tt(!N,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):V?Tt(!V,`Route "${u.id}" has a static property "${E}" defined but its lazy function is also returning a value for this property. The lazy route property "${E}" will be ignored.`):w[E]=R}Object.assign(u,w),Object.assign(u,{...l(u),lazy:void 0})})();return g0.set(u,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),d=[],m;for(let b of c){if(s&&s.includes(b))continue;let g=gx({key:b,route:e,manifest:i,mapRouteProperties:l});g&&(d.push(g),b===a&&(m=g))}let p=d.length>0?Promise.all(d).then(()=>{}):void 0;return p?.catch(()=>{}),m?.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:m}}async function v0(e){let a=e.matches.filter(s=>s.shouldLoad),i={};return(await Promise.all(a.map(s=>s.resolve()))).forEach((s,u)=>{i[a[u].route.id]=s}),i}async function P3(e){return e.matches.some(a=>a.route.middleware)?vx(e,()=>v0(e)):v0(e)}function vx(e,a){return Q3(e,a,l=>{if(rA(l))throw l;return l},eA,i);function i(l,s,u){if(u)return Promise.resolve(Object.assign(u.value,{[s]:{type:"error",result:l}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(p=>p.route.id===s),0),Math.max(c.findIndex(p=>p.shouldCallHandler()),0)),m=Cr(c,c[d].route.id).route.id;return Promise.resolve({[m]:{type:"error",result:l}})}}}async function Q3(e,a,i,l,s){let{matches:u,...c}=e,d=u.flatMap(p=>p.route.middleware?p.route.middleware.map(b=>[p.route.id,b]):[]);return await bx(c,d,a,i,l,s)}async function bx(e,a,i,l,s,u,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let m=a[c];if(!m)return await i();let[p,b]=m,g,x=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await bx(e,a,i,l,s,u,c+1)},g.value}catch(w){return g={value:await u(w,p,g)},g.value}};try{let w=await b(e,x),E=w!=null?l(w):void 0;return s(E)?E:g?E??g.value:(g={value:await x()},g.value)}catch(w){return await u(w,p,g)}}function xx(e,a,i,l,s){let u=gx({key:"middleware",route:l.route,manifest:a,mapRouteProperties:e}),c=q3(l.route,tn(i.method)?"action":"loader",a,e,s);return{middleware:u,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function yh(e,a,i,l,s,u,c,d,m,p=null,b){let g=!1,x=xx(e,a,i,u,c);return{...u,_lazyPromises:x,shouldLoad:m,shouldRevalidateArgs:p,shouldCallHandler(w){return g=!0,p?typeof b=="boolean"?_o(u,{...p,defaultShouldRevalidate:b}):typeof w=="boolean"?_o(u,{...p,defaultShouldRevalidate:w}):_o(u,p):m},resolve(w){let{lazy:E,loader:R,middleware:N}=u.route,F=g||m||w&&!tn(i.method)&&(E||R),V=N&&N.length>0&&!R&&!E;return F&&(tn(i.method)||!V)?Y3({request:i,path:l,pattern:s,match:u,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:w,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function ul(e,a,i,l,s,u,c,d,)DELIM" -R"DELIM(m=null){return s.map(p=>p.route.id!==u.route.id?{...p,shouldLoad:!1,shouldRevalidateArgs:m,shouldCallHandler:()=>!1,_lazyPromises:xx(e,a,i,p,c),resolve:()=>Promise.resolve({type:"data",result:void 0})}:yh(e,a,i,l,Go(s),p,c,d,!0,m))}async function F3(e,a,i,l,s,u,c){l.some(b=>b._lazyPromises?.middleware)&&await Promise.all(l.map(b=>b._lazyPromises?.middleware));let d={request:a,url:Sx(a,i),pattern:Go(l),params:l[0].params,context:u,matches:l},p=await e({...d,fetcherKey:s,runClientMiddleware:b=>{let g=d;return vx(g,()=>b({...g,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(l.flatMap(b=>[b._lazyPromises?.handler,b._lazyPromises?.route]))}catch{}return p}async function Y3({request:e,path:a,pattern:i,match:l,lazyHandlerPromise:s,lazyRoutePromise:u,handlerOverride:c,scopedContext:d}){let m,p,b=tn(e.method),g=b?"action":"loader",x=w=>{let E,R=new Promise((V,J)=>E=J);p=()=>E(),e.signal.addEventListener("abort",p);let N=V=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${l.route.id}]`)):w({request:e,url:Sx(e,a),pattern:i,params:l.params,context:d},...V!==void 0?[V]:[]),F=(async()=>{try{return{type:"data",result:await(c?c(J=>N(J)):N())}}catch(V){return{type:"error",result:V}}})();return Promise.race([F,R])};try{let w=b?l.route.action:l.route.loader;if(s||u)if(w){let E,[R]=await Promise.all([x(w).catch(N=>{E=N}),s,u]);if(E!==void 0)throw E;m=R}else{await s;let E=b?l.route.action:l.route.loader;if(E)[m]=await Promise.all([x(E),u]);else if(g==="action"){let R=new URL(e.url),N=R.pathname+R.search;throw Fn(405,{method:e.method,pathname:N,routeId:l.route.id})}else return{type:"data",result:void 0}}else if(w)m=await x(w);else{let E=new URL(e.url),R=E.pathname+E.search;throw Fn(404,{pathname:R})}}catch(w){return{type:"error",result:w}}finally{p&&e.signal.removeEventListener("abort",p)}return m}async function G3(e){let a=e.headers.get("Content-Type");return a&&/\bapplication\/json\b/.test(a)?e.body==null?null:e.json():e.text()}async function K3(e){let{result:a,type:i}=e;if(Kh(a)){let l;try{l=await G3(a)}catch(s){return{type:"error",error:s}}return i==="error"?{type:"error",error:new Yo(a.status,a.statusText,l),statusCode:a.status,headers:a.headers}:{type:"data",data:l,statusCode:a.status,headers:a.headers}}return i==="error"?E0(a)?a.data instanceof Error?{type:"error",error:a.data,statusCode:a.init?.status,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"error",error:W3(a),statusCode:Do(a)?a.status:void 0,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:Do(a)?a.status:void 0}:E0(a)?{type:"data",data:a.data,statusCode:a.init?.status,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"data",data:a}}function V3(e,a,i,l,s){let u=e.headers.get("Location");if(De(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!Fh(u)){let c=l.slice(0,l.findIndex(d=>d.route.id===i)+1);u=ph(new URL(a.url),c,s,u),e.headers.set("Location",u)}return e}var X3=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function gh(e){try{return X3.includes(new URL(e).protocol)}catch{return!1}}function b0(e,a,i,l){if(Fh(e)){let s=e,u=Qh.test(s)?new URL(ex(s,a.protocol)):new URL(s);if(gh(u.toString()))throw new Error("Invalid redirect location");let c=Gn(u.pathname,i)!=null;if(u.origin===a.origin&&c)return Yh(u.pathname)+u.search+u.hash}try{let s=l.createURL(e);if(gh(s.toString()))throw new Error("Invalid redirect location")}catch{}return e}function rl(e,a,i,l){let s=e.createURL(wx(a)).toString(),u={signal:i};if(l&&tn(l.formMethod)){let{formMethod:c,formEncType:d}=l;u.method=c.toUpperCase(),d==="application/json"?(u.headers=new Headers({"Content-Type":d}),u.body=JSON.stringify(l.json)):d==="text/plain"?u.body=l.text:d==="application/x-www-form-urlencoded"&&l.formData?u.body=vh(l.formData):u.body=l.formData}return new Request(s,u)}function Sx(e,a){let i=new URL(e.url),l=typeof a=="string"?xa(a):a;if(i.pathname=l.pathname||"/",l.search){let s=new URLSearchParams(l.search),u=s.getAll("index");s.delete("index");for(let c of u.filter(Boolean))s.append("index",c);i.search=s.size?`?${s.toString()}`:""}else i.search="";return i.hash=l.hash||"",i}function vh(e){let a=new URLSearchParams;for(let[i,l]of e.entries())a.append(i,typeof l=="string"?l:l.name);return a}function x0(e){let a=new FormData;for(let[i,l]of e.entries())a.append(i,l);return a}function I3(e,a,i,l=!1,s=!1){let u={},c=null,d,m=!1,p={},b=i&&Cn(i[1])?i[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in a))return;let x=g.route.id,w=a[x];if(De(!ii(w),"Cannot handle redirect results in processLoaderData"),Cn(w)){let E=w.error;if(b!==void 0&&(E=b,b=void 0),c=c||{},s)c[x]=E;else{let R=Cr(e,x);c[R.route.id]==null&&(c[R.route.id]=E)}l||(u[x]=mx),m||(m=!0,d=Do(w.error)?w.error.status:500),w.headers&&(p[x]=w.headers)}else u[x]=w.data,w.statusCode&&w.statusCode!==200&&!m&&(d=w.statusCode),w.headers&&(p[x]=w.headers)}),b!==void 0&&i&&(c={[i[0]]:b},i[2]&&(u[i[2]]=void 0)),{loaderData:u,errors:c,statusCode:d||200,loaderHeaders:p}}function S0(e,a,i,l,s,u,c){let{loaderData:d,errors:m}=I3(a,i,l);return s.filter(p=>!p.matches||p.matches.some(b=>b.shouldLoad)).forEach(p=>{let{key:b,match:g,controller:x}=p;if(x&&x.signal.aborted)return;let w=u[b];if(De(w,"Did not find corresponding fetcher result"),Cn(w)){let E=Cr(e.matches,g?.route.id);m&&m[E.route.id]||(m={...m,[E.route.id]:w.error}),c.delete(b)}else if(ii(w))De(!1,"Unhandled fetcher revalidation redirect");else{let E=ga(w.data);c.set(b,E)}}),{loaderData:d,errors:m}}function w0(e,a,i,l){let s=Object.entries(a).filter(([,u])=>u!==mx).reduce((u,[c,d])=>(u[c]=d,u),{});for(let u of i){let c=u.route.id;if(!a.hasOwnProperty(c)&&e.hasOwnProperty(c)&&u.route.loader&&(s[c]=e[c]),l&&l.hasOwnProperty(c))break}return s}function _0(e){return e?Cn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Cr(e,a){return(a?e.slice(0,e.findIndex(l=>l.route.id===a)+1):[...e]).reverse().find(l=>l.route.hasErrorBoundary===!0)||e[0]}function bu(e){let a=e.length===1?e[0]:e.find(i=>i.index||!i.path||i.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:a}],route:a}}function Fn(e,{pathname:a,routeId:i,method:l,type:s,message:u}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",l&&a&&i?d=`You made a ${l} request to "${a}" but did not provide a \`loader\` for route "${i}", so there is no way to handle the request.`:s==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${i}" does not match URL "${a}"`):e===404?(c="Not Found",d=`No route matches URL "${a}"`):e===405&&(c="Method Not Allowed",l&&a&&i?d=`You made a ${l.toUpperCase()} request to "${a}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:l&&(d=`Invalid request method "${l.toUpperCase()}"`)),new Yo(e||500,c,new Error(d),!0)}function xu(e){let a=Object.entries(e);for(let i=a.length-1;i>=0;i--){let[l,s]=a[i];if(ii(s))return{key:l,result:s}}}function wx(e){let a=typeof e=="string"?xa(e):e;return ba({...a,hash:""})}function J3(e,a){return e.pathname!==a.pathname||e.search!==a.search?!1:e.hash===""?a.hash!=="":e.hash===a.hash?!0:a.hash!==""}function W3(e){return new Yo(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function eA(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([a,i])=>typeof a=="string"&&tA(i))}function tA(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function nA(e){return Kh(e.result)&&dx.has(e.result.status)}function Cn(e){return e.type==="error"}function ii(e){return(e&&e.type)==="redirect"})DELIM" -R"DELIM(function E0(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Kh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function aA(e){return dx.has(e)}function rA(e){return Kh(e)&&aA(e.status)&&e.headers.has("Location")}function iA(e){return O3.has(e.toUpperCase())}function tn(e){return N3.has(e.toUpperCase())}function Vh(e){return new URLSearchParams(e).getAll("index").some(a=>a==="")}function Nu(e,a){let i=typeof a=="string"?xa(a).search:a.search;if(e[e.length-1].route.index&&Vh(i||""))return e[e.length-1];let l=ox(e);return l[l.length-1]}function T0(e){let{formMethod:a,formAction:i,formEncType:l,text:s,formData:u,json:c}=e;if(!(!a||!i||!l)){if(s!=null)return{formMethod:a,formAction:i,formEncType:l,formData:void 0,json:void 0,text:s};if(u!=null)return{formMethod:a,formAction:i,formEncType:l,formData:u,json:void 0,text:void 0};if(c!==void 0)return{formMethod:a,formAction:i,formEncType:l,formData:void 0,json:c,text:void 0}}}function $d(e,a,i,l){return l?{state:"loading",location:e,matches:a,historyAction:i,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}:{state:"loading",location:e,matches:a,historyAction:i,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function lA(e,a,i,l){return{state:"submitting",location:e,matches:a,historyAction:i,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}}function po(e,a){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:a}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:a}}function oA(e,a){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:a?a.data:void 0}}function ga(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function sA(e,a){try{let i=e.sessionStorage.getItem(hx);if(i){let l=JSON.parse(i);for(let[s,u]of Object.entries(l||{}))u&&Array.isArray(u)&&a.set(s,new Set(u||[]))}}catch{}}function uA(e,a){if(a.size>0){let i={};for(let[l,s]of a)i[l]=[...s];try{e.sessionStorage.setItem(hx,JSON.stringify(i))}catch(l){Tt(!1,`Failed to save applied view transitions in sessionStorage (${l}).`)}}}function R0(){let e,a,i=new Promise((l,s)=>{e=async u=>{l(u);try{await i}catch{}},a=async u=>{s(u);try{await i}catch{}}});return{promise:i,resolve:e,reject:a}}var fi=T.createContext(null);fi.displayName="DataRouter";var Ko=T.createContext(null);Ko.displayName="DataRouterState";var _x=T.createContext(!1);function Ex(){return T.useContext(_x)}var Xh=T.createContext({isTransitioning:!1});Xh.displayName="ViewTransition";var Tx=T.createContext(new Map);Tx.displayName="Fetchers";var cA=T.createContext(null);cA.displayName="Await";var jn=T.createContext(null);jn.displayName="Navigation";var rc=T.createContext(null);rc.displayName="Location";var Xn=T.createContext({outlet:null,matches:[],isDataRoute:!1});Xn.displayName="Route";var Ih=T.createContext(null);Ih.displayName="RouteError";var Rx="REACT_ROUTER_ERROR",fA="REDIRECT",dA="ROUTE_ERROR_RESPONSE";function hA(e){if(e.startsWith(`${Rx}:${fA}:{`))try{let a=JSON.parse(e.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function mA(e){if(e.startsWith(`${Rx}:${dA}:{`))try{let a=JSON.parse(e.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new Yo(a.status,a.statusText,a.data)}catch{}}function pA(e,{relative:a}={}){De(yl(),"useHref() may be used only in the context of a component.");let{basename:i,navigator:l}=T.useContext(jn),{hash:s,pathname:u,search:c}=Vo(e,{relative:a}),d=u;return i!=="/"&&(d=u==="/"?i:Yn([i,u])),l.createHref({pathname:d,search:c,hash:s})}function yl(){return T.useContext(rc)!=null}function Nn(){return De(yl(),"useLocation() may be used only in the context of a component."),T.useContext(rc).location}var Ax="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function zx(e){T.useContext(jn).static||T.useLayoutEffect(e)}function Sa(){let{isDataRoute:e}=T.useContext(Xn);return e?CA():yA()}function yA(){De(yl(),"useNavigate() may be used only in the context of a component.");let e=T.useContext(fi),{basename:a,navigator:i}=T.useContext(jn),{matches:l}=T.useContext(Xn),{pathname:s}=Nn(),u=JSON.stringify(ac(l)),c=T.useRef(!1);return zx(()=>{c.current=!0}),T.useCallback((m,p={})=>{if(Tt(c.current,Ax),!c.current)return;if(typeof m=="number"){i.go(m);return}let b=Fo(m,JSON.parse(u),s,p.relative==="path");e==null&&a!=="/"&&(b.pathname=b.pathname==="/"?a:Yn([a,b.pathname])),(p.replace?i.replace:i.push)(b,p.state,p)},[a,i,u,s,e])}var gA=T.createContext(null);function vA(e){let a=T.useContext(Xn).outlet;return T.useMemo(()=>a&&T.createElement(gA.Provider,{value:e},a),[a,e])}function Jh(){let{matches:e}=T.useContext(Xn);return e[e.length-1]?.params??{}}function Vo(e,{relative:a}={}){let{matches:i}=T.useContext(Xn),{pathname:l}=Nn(),s=JSON.stringify(ac(i));return T.useMemo(()=>Fo(e,JSON.parse(s),l,a==="path"),[e,s,l,a])}function bA(e,a,i){De(yl(),"useRoutes() may be used only in the context of a component.");let{navigator:l}=T.useContext(jn),{matches:s}=T.useContext(Xn),u=s[s.length-1],c=u?u.params:{},d=u?u.pathname:"/",m=u?u.pathnameBase:"/",p=u&&u.route;{let N=p&&p.path||"";Nx(d,!p||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${d}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const c of e.seen.entries()){const d=c[1];if(a===c[0]){u(c);continue}if(e.external){const p=e.external.registry.get(c[0])?.id;if(a!==c[0]&&p){u(c);continue}}if(e.metadataRegistry.get(c[0])?.id){u(c);continue}if(d.cycle){u(c);continue}if(d.count>1&&e.reused==="ref"){u(c);continue}}}function Ab(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=d=>{const m=e.seen.get(d);if(m.ref===null)return;const p=m.def??m.schema,b={...p},v=m.ref;if(m.ref=null,v){l(v);const w=e.seen.get(v),E=w.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(E)):Object.assign(p,E),Object.assign(p,b),d._zod.parent===v)for(const C in p)C==="$ref"||C==="allOf"||C in b||delete p[C];if(E.$ref&&w.def)for(const C in p)C==="$ref"||C==="allOf"||C in w.def&&JSON.stringify(p[C])===JSON.stringify(w.def[C])&&delete p[C]}const x=d._zod.parent;if(x&&x!==v){l(x);const w=e.seen.get(x);if(w?.schema.$ref&&(p.$ref=w.schema.$ref,w.def))for(const E in p)E==="$ref"||E==="allOf"||E in w.def&&JSON.stringify(p[E])===JSON.stringify(w.def[E])&&delete p[E]}e.override({zodSchema:d,jsonSchema:p,path:m.path??[]})};for(const d of[...e.seen.entries()].reverse())l(d[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(a)?.id;if(!d)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(d)}Object.assign(s,i.def??i.schema);const u=e.metadataRegistry.get(a)?.id;u!==void 0&&s.id===u&&delete s.id;const c=e.external?.defs??{};for(const d of e.seen.entries()){const m=d[1];m.def&&m.defId&&(m.def.id===m.defId&&delete m.def.id,c[m.defId]=m.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?s.$defs=c:s.definitions=c);try{const d=JSON.parse(JSON.stringify(s));return Object.defineProperty(d,"~standard",{value:{...a["~standard"],jsonSchema:{input:qu(a,"input",e.processors),output:qu(a,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function on(e,a){const i=a??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const l=e._zod.def;if(l.type==="transform")return!0;if(l.type==="array")return on(l.element,i);if(l.type==="set")return on(l.valueType,i);if(l.type==="lazy")return on(l.getter(),i);if(l.type==="promise"||l.type==="optional"||l.type==="nonoptional"||l.type==="nullable"||l.type==="readonly"||l.type==="default"||l.type==="prefault")return on(l.innerType,i);if(l.type==="intersection")return on(l.left,i)||on(l.right,i);if(l.type==="record"||l.type==="map")return on(l.keyType,i)||on(l.valueType,i);if(l.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:on(l.in,i)||on(l.out,i);if(l.type==="object"){for(const s in l.shape)if(on(l.shape[s],i))return!0;return!1}if(l.type==="union"){for(const s of l.options)if(on(s,i))return!0;return!1}if(l.type==="tuple"){for(const s of l.items)if(on(s,i))return!0;return!!(l.rest&&on(l.rest,i))}return!1}const nT=(e,a={})=>i=>{const l=Tb({...i,processors:a});return Xt(e,l),Rb(l,e),Ab(l,e)},qu=(e,a,i={})=>l=>{const{libraryOptions:s,target:u}=l??{},c=Tb({...s??{},target:u,io:a,processors:i});return Xt(e,c),Rb(c,e),Ab(c,e)},aT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},rT=(e,a,i,l)=>{const s=i;s.type="string";const{minimum:u,maximum:c,format:d,patterns:m,contentEncoding:p}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof c=="number"&&(s.maxLength=c),d&&(s.format=aT[d]??d,s.format===""&&delete s.format,d==="time"&&delete s.format),p&&(s.contentEncoding=p),m&&m.size>0){const b=[...m];b.length===1?s.pattern=b[0].source:b.length>1&&(s.allOf=[...b.map(v=>({...a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},iT=(e,a,i,l)=>{const s=i,{minimum:u,maximum:c,format:d,multipleOf:m,exclusiveMaximum:p,exclusiveMinimum:b}=e._zod.bag;typeof d=="string"&&d.includes("int")?s.type="integer":s.type="number";const v=typeof b=="number"&&b>=(u??Number.NEGATIVE_INFINITY),x=typeof p=="number"&&p<=(c??Number.POSITIVE_INFINITY),w=a.target==="draft-04"||a.target==="openapi-3.0";v?w?(s.minimum=b,s.exclusiveMinimum=!0):s.exclusiveMinimum=b:typeof u=="number"&&(s.minimum=u),x?w?(s.maximum=p,s.exclusiveMaximum=!0):s.exclusiveMaximum=p:typeof c=="number"&&(s.maximum=c),typeof m=="number"&&(s.multipleOf=m)},lT=(e,a,i,l)=>{i.type="boolean"},oT=(e,a,i,l)=>{i.not={}},sT=(e,a,i,l)=>{},uT=(e,a,i,l)=>{const s=e._zod.def,u=ib(s.entries);u.every(c=>typeof c=="number")&&(i.type="number"),u.every(c=>typeof c=="string")&&(i.type="string"),i.enum=u},cT=(e,a,i,l)=>{if(a.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},fT=(e,a,i,l)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema)DELIM" +R"DELIM(")},dT=(e,a,i,l)=>{const s=i,u=e._zod.def,{minimum:c,maximum:d}=e._zod.bag;typeof c=="number"&&(s.minItems=c),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=Xt(u.element,a,{...l,path:[...l.path,"items"]})},hT=(e,a,i,l)=>{const s=i,u=e._zod.def;s.type="object",s.properties={};const c=u.shape;for(const p in c)s.properties[p]=Xt(c[p],a,{...l,path:[...l.path,"properties",p]});const d=new Set(Object.keys(c)),m=new Set([...d].filter(p=>{const b=u.shape[p]._zod;return a.io==="input"?b.optin===void 0:b.optout===void 0}));m.size>0&&(s.required=Array.from(m)),u.catchall?._zod.def.type==="never"?s.additionalProperties=!1:u.catchall?u.catchall&&(s.additionalProperties=Xt(u.catchall,a,{...l,path:[...l.path,"additionalProperties"]})):a.io==="output"&&(s.additionalProperties=!1)},mT=(e,a,i,l)=>{const s=e._zod.def,u=s.inclusive===!1,c=s.options.map((d,m)=>Xt(d,a,{...l,path:[...l.path,u?"oneOf":"anyOf",m]}));u?i.oneOf=c:i.anyOf=c},pT=(e,a,i,l)=>{const s=e._zod.def,u=Xt(s.left,a,{...l,path:[...l.path,"allOf",0]}),c=Xt(s.right,a,{...l,path:[...l.path,"allOf",1]}),d=p=>"allOf"in p&&Object.keys(p).length===1,m=[...d(u)?u.allOf:[u],...d(c)?c.allOf:[c]];i.allOf=m},yT=(e,a,i,l)=>{const s=e._zod.def,u=Xt(s.innerType,a,l),c=a.seen.get(e);a.target==="openapi-3.0"?(c.ref=s.innerType,i.nullable=!0):i.anyOf=[u,{type:"null"}]},gT=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType},vT=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,i.default=JSON.parse(JSON.stringify(s.defaultValue))},bT=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,a.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},xT=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType;let c;try{c=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=c},ST=(e,a,i,l)=>{const s=e._zod.def,u=s.in._zod.traits.has("$ZodTransform"),c=a.io==="input"?u?s.out:s.in:s.out;Xt(c,a,l);const d=a.seen.get(e);d.ref=c},wT=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,i.readOnly=!0},zb=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType},_T=ee("ZodISODateTime",(e,a)=>{zE.init(e,a),_t.init(e,a)});function ET(e){return M2(_T,e)}const TT=ee("ZodISODate",(e,a)=>{jE.init(e,a),_t.init(e,a)});function RT(e){return O2(TT,e)}const AT=ee("ZodISOTime",(e,a)=>{NE.init(e,a),_t.init(e,a)});function zT(e){return k2(AT,e)}const jT=ee("ZodISODuration",(e,a)=>{CE.init(e,a),_t.init(e,a)});function NT(e){return D2(jT,e)}const CT=(e,a)=>{cb.init(e,a),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>b_(e,i)},flatten:{value:i=>v_(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,oh,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,oh,2)}},isEmpty:{get(){return e.issues.length===0}}})},In=ee("ZodError",CT,{Parent:Error}),MT=Oh(In),OT=kh(In),kT=ec(In),DT=tc(In),LT=w_(In),BT=__(In),UT=E_(In),HT=T_(In),$T=R_(In),ZT=A_(In),qT=z_(In),PT=j_(In),Lv=new WeakMap;function $o(e,a,i){const l=Object.getPrototypeOf(e);let s=Lv.get(l);if(s||(s=new Set,Lv.set(l,s)),!s.has(a)){s.add(a);for(const u in i){const c=i[u];Object.defineProperty(l,u,{configurable:!0,enumerable:!1,get(){const d=c.bind(this);return Object.defineProperty(this,u,{configurable:!0,writable:!0,enumerable:!0,value:d}),d},set(d){Object.defineProperty(this,u,{configurable:!0,writable:!0,enumerable:!0,value:d})}})}}}const Ot=ee("ZodType",(e,a)=>(Mt.init(e,a),Object.assign(e["~standard"],{jsonSchema:{input:qu(e,"input"),output:qu(e,"output")}}),e.toJSONSchema=nT(e,{}),e.def=a,e.type=a.type,Object.defineProperty(e,"_def",{value:a}),e.parse=(i,l)=>MT(e,i,l,{callee:e.parse}),e.safeParse=(i,l)=>kT(e,i,l),e.parseAsync=async(i,l)=>OT(e,i,l,{callee:e.parseAsync}),e.safeParseAsync=async(i,l)=>DT(e,i,l),e.spa=e.safeParseAsync,e.encode=(i,l)=>LT(e,i,l),e.decode=(i,l)=>BT(e,i,l),e.encodeAsync=async(i,l)=>UT(e,i,l),e.decodeAsync=async(i,l)=>HT(e,i,l),e.safeEncode=(i,l)=>$T(e,i,l),e.safeDecode=(i,l)=>ZT(e,i,l),e.safeEncodeAsync=async(i,l)=>qT(e,i,l),e.safeDecodeAsync=async(i,l)=>PT(e,i,l),$o(e,"ZodType",{check(...i){const l=this.def;return this.clone(Dr(l,{checks:[...l.checks??[],...i.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...i){return this.check(...i)},clone(i,l){return Lr(this,i,l)},brand(){return this},register(i,l){return i.add(this,l),this},refine(i,l){return this.check(L4(i,l))},superRefine(i,l){return this.check(B4(i,l))},overwrite(i){return this.check(gl(i))},optional(){return $v(this)},exactOptional(){return _4(this)},nullable(){return Zv(this)},nullish(){return $v(Zv(this))},nonoptional(i){return j4(this,i)},array(){return ui(this)},or(i){return y4([this,i])},and(i){return v4(this,i)},transform(i){return qv(this,S4(i))},default(i){return R4(this,i)},prefault(i){return z4(this,i)},catch(i){return C4(this,i)},pipe(i){return qv(this,i)},readonly(){return k4(this)},describe(i){const l=this.clone();return vo.add(l,{description:i}),l},meta(...i){if(i.length===0)return vo.get(this);const l=this.clone();return vo.add(l,i[0]),l},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(i){return i(this)}}),Object.defineProperty(e,"description",{get(){return vo.get(e)?.description},configurable:!0}),e)),jb=ee("_ZodString",(e,a)=>{Dh.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(l,s,u)=>rT(e,l,s);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,$o(e,"_ZodString",{regex(...l){return this.check(Z2(...l))},includes(...l){return this.check(Q2(...l))},startsWith(...l){return this.check(F2(...l))},endsWith(...l){return this.check(Y2(...l))},min(...l){return this.check(Zu(...l))},max(...l){return this.check(_b(...l))},length(...l){return this.check(Eb(...l))},nonempty(...l){return this.check(Zu(1,...l))},lowercase(l){return this.check(q2(l))},uppercase(l){return this.check(P2(l))},trim(){return this.check(K2())},normalize(...l){return this.check(G2(...l))},toLowerCase(){return this.check(V2())},toUpperCase(){return this.check(X2())},slugify(){return this.check(I2())}})}),QT=ee("ZodString",(e,a)=>{Dh.init(e,a),jb.init(e,a),e.email=i=>e.check(f2(FT,i)),e.url=i=>e.check(y2(YT,i)),e.jwt=i=>e.check(C2(o4,i)),e.emoji=i=>e.check(g2(GT,i)),e.guid=i=>e.check(Mv(Bv,i)),e.uuid=i=>e.check(d2(pu,i)),e.uuidv4=i=>e.check(h2(pu,i)),e.uuidv6=i=>e.check(m2(pu,i)),e.uuidv7=i=>e.check(p2(pu,i)),e.nanoid=i=>e.check(v2(KT,i)),e.guid=i=>e.check(Mv(Bv,i)),e.cuid=i=>e.check(b2(VT,i)),e.cuid2=i=>e.check(x2(XT,i)),e.ulid=i=>e.check(S2(IT,i)),e.base64=i=>e.check(z2(r4,i)),e.base64url=i=>e.check(j2(i4,i)),e.xid=i=>e.check(w2(JT,i)),e.ksuid=i=>e.check(_2(WT,i)),e.ipv4=i=>e.check(E2(e4,i)),e.ipv6=i=>e.check(T2(t4,i)),e.cidrv4=i=>e.check(R2(n4,i)),e.cidrv6=i=>e.check(A2(a4,i)),e.e164=i=>e.check(N2(l4,i)),e.datetime=i=>e.check(ET(i)),e.date=i=>e.check(RT(i)),e.time=i=>e.check(zT(i)),e.duration=i=>e.check(NT(i))});function Ct(e){return c2(QT,e)}const _t=ee("ZodStringFormat",(e,a)=>{St.init(e,a),jb.init(e,a)}),FT=ee("ZodEmail",(e,a)=>{bE.init(e,a),_t.init(e,a)}),Bv=ee("ZodGUID",(e,a)=>{gE.init(e,a),_t.init(e,a)}),pu=ee("ZodUUID",(e,a)=>{vE.init(e,a),_t.init(e,a)}),YT=ee("ZodURL",(e,a)=>{xE.init(e,a),_t.init(e,a)}),GT=ee("ZodEmoji",(e,a)=>{SE.init(e,a),_t.init(e,a)}),KT=ee("ZodNanoID",(e,a)=>{wE.init(e,a),_t.init(e,a)}),VT=ee("ZodCUID",(e,a)=>{_E.init(e,a),_t.init(e,a)}),XT=ee("ZodCUID2",(e,a)=>{EE.init(e,a),_t.init(e,a)}),IT=ee("ZodULID",(e,a)=>{TE.init(e,a),_t.init(e,a)}),JT=ee("ZodXID",(e,a)=>{RE.init(e,a),_t.init(e,a)}),WT=ee("ZodKSUID",(e,a)=>{AE.init(e,a),_t.init(e,a)}),e4=ee("ZodIPv4",(e,a)=>{ME.init(e,a),_t.init(e,a)}),t4=ee("ZodIPv6",(e,a)=>{OE.init(e,a),_t.init(e,a)}),n4=ee("ZodCIDRv4",(e,a)=>{kE.init(e)DELIM" +R"DELIM(,a),_t.init(e,a)}),a4=ee("ZodCIDRv6",(e,a)=>{DE.init(e,a),_t.init(e,a)}),r4=ee("ZodBase64",(e,a)=>{LE.init(e,a),_t.init(e,a)}),i4=ee("ZodBase64URL",(e,a)=>{UE.init(e,a),_t.init(e,a)}),l4=ee("ZodE164",(e,a)=>{HE.init(e,a),_t.init(e,a)}),o4=ee("ZodJWT",(e,a)=>{ZE.init(e,a),_t.init(e,a)}),Nb=ee("ZodNumber",(e,a)=>{bb.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(l,s,u)=>iT(e,l,s),$o(e,"ZodNumber",{gt(l,s){return this.check(kv(l,s))},gte(l,s){return this.check(Rd(l,s))},min(l,s){return this.check(Rd(l,s))},lt(l,s){return this.check(Ov(l,s))},lte(l,s){return this.check(Td(l,s))},max(l,s){return this.check(Td(l,s))},int(l){return this.check(Uv(l))},safe(l){return this.check(Uv(l))},positive(l){return this.check(kv(0,l))},nonnegative(l){return this.check(Rd(0,l))},negative(l){return this.check(Ov(0,l))},nonpositive(l){return this.check(Td(0,l))},multipleOf(l,s){return this.check(Dv(l,s))},step(l,s){return this.check(Dv(l,s))},finite(){return this}});const i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function Ve(e){return L2(Nb,e)}const s4=ee("ZodNumberFormat",(e,a)=>{qE.init(e,a),Nb.init(e,a)});function Uv(e){return B2(s4,e)}const u4=ee("ZodBoolean",(e,a)=>{PE.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>lT(e,i,l)});function Lh(e){return U2(u4,e)}const c4=ee("ZodUnknown",(e,a)=>{QE.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>sT()});function Hv(){return H2(c4)}const f4=ee("ZodNever",(e,a)=>{FE.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>oT(e,i,l)});function d4(e){return $2(f4,e)}const h4=ee("ZodArray",(e,a)=>{YE.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>dT(e,i,l,s),e.element=a.element,$o(e,"ZodArray",{min(i,l){return this.check(Zu(i,l))},nonempty(i){return this.check(Zu(1,i))},max(i,l){return this.check(_b(i,l))},length(i,l){return this.check(Eb(i,l))},unwrap(){return this.element}})});function ui(e,a){return J2(h4,e,a)}const m4=ee("ZodObject",(e,a)=>{KE.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>hT(e,i,l,s),dt(e,"shape",()=>a.shape),$o(e,"ZodObject",{keyof(){return b4(Object.keys(this._zod.def.shape))},catchall(i){return this.clone({...this._zod.def,catchall:i})},passthrough(){return this.clone({...this._zod.def,catchall:Hv()})},loose(){return this.clone({...this._zod.def,catchall:Hv()})},strict(){return this.clone({...this._zod.def,catchall:d4()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(i){return d_(this,i)},safeExtend(i){return h_(this,i)},merge(i){return m_(this,i)},pick(i){return c_(this,i)},omit(i){return f_(this,i)},partial(...i){return p_(Cb,this,i[0])},required(...i){return y_(Mb,this,i[0])}})});function ua(e,a){const i={type:"object",shape:e??{},...Ne(a)};return new m4(i)}const p4=ee("ZodUnion",(e,a)=>{VE.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>mT(e,i,l,s),e.options=a.options});function y4(e,a){return new p4({type:"union",options:e,...Ne(a)})}const g4=ee("ZodIntersection",(e,a)=>{XE.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>pT(e,i,l,s)});function v4(e,a){return new g4({type:"intersection",left:e,right:a})}const uh=ee("ZodEnum",(e,a)=>{IE.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(l,s,u)=>uT(e,l,s),e.enum=a.entries,e.options=Object.values(a.entries);const i=new Set(Object.keys(a.entries));e.extract=(l,s)=>{const u={};for(const c of l)if(i.has(c))u[c]=a.entries[c];else throw new Error(`Key ${c} not found in enum`);return new uh({...a,checks:[],...Ne(s),entries:u})},e.exclude=(l,s)=>{const u={...a.entries};for(const c of l)if(i.has(c))delete u[c];else throw new Error(`Key ${c} not found in enum`);return new uh({...a,checks:[],...Ne(s),entries:u})}});function b4(e,a){const i=Array.isArray(e)?Object.fromEntries(e.map(l=>[l,l])):e;return new uh({type:"enum",entries:i,...Ne(a)})}const x4=ee("ZodTransform",(e,a)=>{JE.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>fT(e,i),e._zod.parse=(i,l)=>{if(l.direction==="backward")throw new rb(e.constructor.name);i.addIssue=u=>{if(typeof u=="string")i.issues.push(Co(u,i.value,a));else{const c=u;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=i.value),c.inst??(c.inst=e),i.issues.push(Co(c))}};const s=a.transform(i.value,i);return s instanceof Promise?s.then(u=>(i.value=u,i.fallback=!0,i)):(i.value=s,i.fallback=!0,i)}});function S4(e){return new x4({type:"transform",transform:e})}const Cb=ee("ZodOptional",(e,a)=>{wb.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>zb(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function $v(e){return new Cb({type:"optional",innerType:e})}const w4=ee("ZodExactOptional",(e,a)=>{WE.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>zb(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function _4(e){return new w4({type:"optional",innerType:e})}const E4=ee("ZodNullable",(e,a)=>{e2.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>yT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function Zv(e){return new E4({type:"nullable",innerType:e})}const T4=ee("ZodDefault",(e,a)=>{t2.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>vT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function R4(e,a){return new T4({type:"default",innerType:e,get defaultValue(){return typeof a=="function"?a():ob(a)}})}const A4=ee("ZodPrefault",(e,a)=>{n2.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>bT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function z4(e,a){return new A4({type:"prefault",innerType:e,get defaultValue(){return typeof a=="function"?a():ob(a)}})}const Mb=ee("ZodNonOptional",(e,a)=>{a2.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>gT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function j4(e,a){return new Mb({type:"nonoptional",innerType:e,...Ne(a)})}const N4=ee("ZodCatch",(e,a)=>{r2.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>xT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function C4(e,a){return new N4({type:"catch",innerType:e,catchValue:typeof a=="function"?a:()=>a})}const M4=ee("ZodPipe",(e,a)=>{i2.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>ST(e,i,l,s),e.in=a.in,e.out=a.out});function qv(e,a){return new M4({type:"pipe",in:e,out:a})}const O4=ee("ZodReadonly",(e,a)=>{l2.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>wT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function k4(e){return new O4({type:"readonly",innerType:e})}const D4=ee("ZodCustom",(e,a)=>{o2.init(e,a),Ot.init(e,a),e._zod.processJSONSchema=(i,l,s)=>cT(e,i)});function L4(e,a={}){return W2(D4,e,a)}function B4(e,a){return eT(e,a)}function ci(e){if(!e)return;const a=e.trim();if(!a)return;const i=a.toLowerCase(),l=i.indexOf("1");if(l>0){const c=i.slice(0,l);if(["bc","tb","bcrt","ltc","sb"].includes(c)){const d=i.slice(l+1);if(!d)return;const m=d.charAt(0);return m==="p"?"p2tr":m==="q"?d.length===39||d.length===40||e.length===42?"p2wpkh":d.length===59||d.length===60||e.length===62?"p2wsh":"segwit":"segwit"}}const s=/^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/u.test(a)&&a.length>=26&&a.length<=35;switch(i[0]){case"1":case"m":case"n":return s?"p2pkh":void 0;case"3":case"2":return s?"p2sh":void 0;default:return}}class Bh extends Error{constructor(a,i){super(a),this.status=i}status}const ch=ua({id:Ct(),height:Ve(),timestamp:Ve().optional(),mediantime:Ve().optional(),tx_count:Ve().optional(),size:Ve().optional(),weight:Ve().optional(),difficulty:Ve().optional(),bits:Ve().optional(),merkle_root:Ct().optional(),previousblockhash:Ct().nullable().optional(),nonce:Ve().optional(),version:Ve().optional()}).loose(),Ob=ua({confirmed:Lh(),block_height:Ve().optional(),block_hash:Ct().optional(),block_time:Ve().optional()}),U4=ua({txid:Ct().optional()DELIM" +R"DELIM().nullable(),vout:Ve().optional().nullable(),sequence:Ve().optional(),scriptsig:Ct().optional().nullable(),scriptsig_asm:Ct().optional().nullable(),witness:ui(Ct()).optional(),is_coinbase:Lh().optional(),prevout:ua({scriptpubkey_type:Ct().optional(),scriptpubkey_address:Ct().optional(),scriptpubkey:Ct().optional(),scriptpubkey_asm:Ct().optional(),value:Ve().optional()}).partial().nullable().optional()}).loose(),H4=ua({scriptpubkey_type:Ct().optional(),scriptpubkey_address:Ct().optional(),scriptpubkey:Ct().optional(),scriptpubkey_asm:Ct().optional(),value:Ve(),n:Ve().optional()}).loose(),Ru=ua({txid:Ct(),hash:Ct().optional(),fee:Ve().optional(),version:Ve(),locktime:Ve(),vin:ui(U4),vout:ui(H4),size:Ve(),weight:Ve(),status:Ob}).loose(),Uh=ui(ch),Pu=ui(Ru),Pv=ua({in_best_chain:Lh(),next_best:Ct().optional(),height:Ve().optional()}),Qv=ua({address:Ct(),chain_stats:ua({funded_txo_count:Ve().optional(),funded_txo_sum:Ve().optional(),spent_txo_count:Ve().optional(),spent_txo_sum:Ve().optional(),tx_count:Ve().optional()}),mempool_stats:ua({funded_txo_count:Ve().optional(),funded_txo_sum:Ve().optional(),spent_txo_count:Ve().optional(),spent_txo_sum:Ve().optional(),tx_count:Ve().optional()})}),$4=ua({txid:Ct(),vout:Ve().int().nonnegative(),value:Ve().nonnegative(),status:Ob}).loose(),Z4=ui($4);async function Kt(e,a,i){const l=a.startsWith("/")?a:`/${a}`,s=await fetch(`${e}${l}`);if(!s.ok)throw new Bh(`Request to ${a} failed with status ${String(s.status)}`,s.status);const u=await s.json();return i.parse(u)}async function Fv(e,a,i){if(i<=0)return[];const l=[];let s=a;for(;s&&l.lengthu.scriptpubkey_address===e?s+u.value:s,0),l=a.vin.reduce((s,u)=>{const c=u.prevout;return c?.scriptpubkey_address===e&&typeof c.value=="number"?s+c.value:s},0);return i-l}async function Ad(e,a){if(a==="latest"||a==="tip"){const i=await Kt(e,"/blocks",Uh);if(i.length===0)throw new Error("No blocks returned from API");return i[0].id}if(/^\d+$/.test(a)){const i=await fetch(`${e}/block-height/${a}`);if(!i.ok)throw new Bh("Unable to resolve block height",i.status);return(await i.text()).trim()}return a}async function Gv(e,a,i){if(i.lastKnownHeight==null||a>=i.lastKnownHeight)return null;const l=a+1;try{const s=await fetch(`${e}/block-height/${String(l)}`);return s.ok&&(await s.text()).trim()||null}catch(s){return console.warn(`Failed to resolve hash for height ${String(l)}`,s),null}}function co(e){return{hash:e.id,height:e.height,timestamp:e.timestamp??e.mediantime??0,txCount:e.tx_count??0,size:e.size??0,weight:e.weight??0,difficulty:e.difficulty,previousBlockHash:e.previousblockhash??null}}function zd(e,a){const i=e.status.confirmed?"confirmed":"unconfirmed",l=e.vin.map((m,p)=>{const b=m.is_coinbase||m.txid==null?void 0:typeof m.vout=="number"&&m.vout!==4294967295?m.vout:void 0;return{index:p,prevTxId:m.txid??void 0,prevOutputIndex:b,address:m.prevout?.scriptpubkey_address??void 0,valueSats:m.prevout?.value,scriptType:m.prevout?.scriptpubkey_type,isCoinbase:m.is_coinbase??!1,script:m.scriptsig||m.scriptsig_asm?{hex:m.scriptsig??void 0,mnemonic:m.scriptsig_asm??void 0}:void 0,witness:m.witness??void 0,sequence:m.sequence}}),s=e.vout.map((m,p)=>({index:p,address:m.scriptpubkey_address??void 0,valueSats:m.value,scriptType:m.scriptpubkey_type,spent:void 0,script:m.scriptpubkey||m.scriptpubkey_asm?{hex:m.scriptpubkey??void 0,mnemonic:m.scriptpubkey_asm??void 0}:void 0})),u=s.reduce((m,p)=>m+p.valueSats,0),c=a.lastKnownHeight;let d=0;return e.status.block_height&&i==="confirmed"&&(d=c&&c>=e.status.block_height?c-e.status.block_height+1:1),{txid:e.txid,hash:e.hash??e.txid,status:i,confirmations:d,blockHeight:e.status.block_height,blockHash:e.status.block_hash,receivedTime:e.status.block_time,feeSats:e.fee??null,feeRate:e.fee?e.fee/e.weight*4:null,size:e.size,weight:e.weight,version:e.version,locktime:e.locktime,totalInput:null,totalOutput:u,inputs:l,outputs:s}}function P4(e,a){const i=e.chain_stats,l=e.mempool_stats,s=(i.funded_txo_sum??0)-(i.spent_txo_sum??0),u=kb(e.address,a.slice(0,25));return{address:e.address,addressType:ci(e.address),balance:s,totalReceived:(i.funded_txo_sum??0)+(l.funded_txo_sum??0),totalSent:(i.spent_txo_sum??0)+(l.spent_txo_sum??0),txCount:(i.tx_count??0)+(l.tx_count??0),utxoCount:(i.funded_txo_count??0)-(i.spent_txo_count??0),transactions:u}}function Q4(e){const a=e.chain_stats,i=e.mempool_stats,l=(a.funded_txo_sum??0)-(a.spent_txo_sum??0);return{address:e.address,addressType:ci(e.address),balance:l,totalReceived:(a.funded_txo_sum??0)+(i.funded_txo_sum??0),totalSent:(a.spent_txo_sum??0)+(i.spent_txo_sum??0),txCount:(a.tx_count??0)+(i.tx_count??0),utxoCount:(a.funded_txo_count??0)-(a.spent_txo_count??0)}}function kb(e,a){return a.map(i=>({txid:i.txid,timestamp:i.status.block_time,valueChange:q4(e,i),blockHeight:i.status.block_height}))}async function Kv(e,a,i=0){const l=i>0?`/block/${a}/txs/${String(i)}`:`/block/${a}/txs`;return Kt(e,l,Pu)}async function F4(e,a,i){return i?Kt(e,`/address/${a}/txs/chain/${i}`,Pu):Kt(e,`/address/${a}/txs`,Pu)}function Db({baseUrl:e}){const a=new Set;let i=null;const l={lastBlockHash:null,lastKnownHeight:null};async function s(d){const m=await Kt(e,`/tx/${d}`,Ru);return await(m.status.block_height?Wi(e,l,m.status.block_height):Wi(e,l)),zd(m,l)}function u(){i||a.size===0||(i=setInterval(async()=>{try{const d=await Kt(e,"/blocks",Uh);if(d.length===0)return;const m=d[0];if(m.id!==l.lastBlockHash){l.lastBlockHash=m.id,l.lastKnownHeight=Math.max(m.height,l.lastKnownHeight??0);const p=co(m);for(const b of a)b({type:"block.new",payload:p})}}catch(d){console.warn("Block polling failed",d)}},15e3))}function c(){i&&(clearInterval(i),i=null)}return{metadata:{id:"blockstream",label:"Blockstream.info",type:"external",connectionState:"connected",supportsWebsocket:!1,endpoint:e,description:"Read-only adapter using Blockstream public REST API."},getConfiguration(){return Promise.resolve({address:!0,filter:!1,turbo:!1,witness:!0,retarget:!1,difficult:!1})},async getLatestBlocks(d=10){const m=await Fv(e,"/blocks",d);return m.length>0&&(l.lastBlockHash=m[0].id,l.lastKnownHeight=Math.max(m[0].height,l.lastKnownHeight??0)),m.map(p=>co(p))},async getBlocksBefore(d,m=10){const p=Math.max(d,0),b=await Fv(e,`/blocks/${String(p)}`,m);return b.length>0&&(l.lastKnownHeight=Math.max(b[0].height,l.lastKnownHeight??0)),b.map(v=>co(v))},async getBlockHeader(d){const m=await Ad(e,d);await Wi(e,l);const[p,b]=await Promise.all([Kt(e,`/block/${m}`,ch),Kt(e,`/block/${m}/status`,Pv).catch(()=>null)]),v=co(p);l.lastBlockHash=v.hash,l.lastKnownHeight=Math.max(v.height,l.lastKnownHeight??v.height);let x=b?.next_best??null;return x||(x=await Gv(e,v.height,l)),{...v,merkleRoot:p.merkle_root,nonce:p.nonce,bits:p.bits,version:p.version,nextBlockHash:x}},getBlockStats(d){return Promise.resolve({})},async getBlock(d){const m=await Ad(e,d);await Wi(e,l);const p=await Kt(e,`/block/${m}`,ch),[b,v]=await Promise.allSettled([Kv(e,m),Kt(e,`/block/${m}/status`,Pv)]);b.status==="rejected"&&console.warn("Failed to load block transactions, defaulting to empty set",b.reason),v.status==="rejected"&&console.warn("Failed to load block status, defaulting to unknown",v.reason);const x=co(p);l.lastBlockHash=x.hash,l.lastKnownHeight=Math.max(x.height,l.lastKnownHeight??x.height);const w=b.status==="fulfilled"?b.value:[];let R=(v.status==="fulfilled"?v.value:null)?.next_best??null;return R||(R=await )DELIM" +R"DELIM(Gv(e,x.height,l)),{...x,merkleRoot:p.merkle_root,nonce:p.nonce,bits:p.bits,version:p.version,nextBlockHash:R,transactions:w.map(Y=>zd(Y,l))}},async getBlockTransactions(d,m=0){const p=await Ad(e,d),b=await Kv(e,p,m),v=b.reduce((x,w)=>w.status.block_height?x===null?w.status.block_height:Math.max(x,w.status.block_height):x,null);return await(typeof v=="number"?Wi(e,l,v):Wi(e,l)),b.map(x=>zd(x,l))},async getTransactionHeader(d){return s(d)},async getTransaction(d){return s(d)},async getTransactionInputScriptHex(d,m){const p=await Kt(e,`/tx/${d}`,Ru);if(m<0||m>=p.vin.length)throw new RangeError(`Input index ${String(m)} not found`);const v=p.vin[m].scriptsig;return typeof v=="string"?v:""},async getTransactionOutputScriptHex(d,m){const p=await Kt(e,`/tx/${d}`,Ru);if(m<0||m>=p.vout.length)throw new RangeError(`Output index ${String(m)} not found`);const v=p.vout[m].scriptpubkey;if(typeof v!="string")throw new TypeError("Output script missing in provider response");return v},async getAddressSummary(d){const m=await Kt(e,`/address/${d}`,Qv);return Q4(m)},async getAddressUtxos(d){return(await Kt(e,`/address/${d}/utxo`,Z4)).map(p=>({txid:p.txid,outputIndex:p.vout,valueSats:p.value,status:p.status.confirmed?"confirmed":"unconfirmed",blockHeight:p.status.block_height,blockHash:p.status.block_hash,timestamp:p.status.block_time}))},async getAddress(d){const m=await Kt(e,`/address/${d}`,Qv),p=await Kt(e,`/address/${d}/txs`,Pu);return P4(m,p)},async getAddressTransactions(d,m){const p=await F4(e,d,m);return kb(d,p)},subscribeToEvents(d){return a.add(d),u(),()=>{a.delete(d),a.size===0&&c()}}}}function Y4({baseUrl:e}){const a=Db({baseUrl:e});return{...a,metadata:{...a.metadata,id:"mempool",label:"mempool.space",endpoint:e,description:"Adapter backed by mempool.space REST API."}}}function Mo(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function Lb(e,a){return Array.isArray(a)?a.length===0?!0:e?a.every(i=>typeof i=="string"):a.every(i=>Number.isSafeInteger(i)):!1}function Hh(e){if(typeof e!="function")throw new TypeError("function expected");return!0}function Oo(e,a){if(typeof a!="string")throw new TypeError(`${e}: string expected`);return!0}function Zo(e){if(typeof e!="number")throw new TypeError(`number expected, got ${typeof e}`);if(!Number.isSafeInteger(e))throw new RangeError(`invalid integer: ${e}`)}function Qu(e){if(!Array.isArray(e))throw new TypeError("array expected")}function Bb(e,a){if(!Lb(!0,a))throw new TypeError(`${e}: array of strings expected`)}function $h(e,a){if(!Lb(!1,a))throw new TypeError(`${e}: array of numbers expected`)}function Zh(...e){const a=u=>u,i=(u,c)=>d=>u(c(d)),l=e.map(u=>u.encode).reduceRight(i,a),s=e.map(u=>u.decode).reduce(i,a);return{encode:l,decode:s}}function Ub(e){const a=typeof e=="string"?e.split(""):e,i=a.length;Bb("alphabet",a);const l=new Map(a.map((s,u)=>[s,u]));return{encode:s=>(Qu(s),s.map(u=>{if(!Number.isSafeInteger(u)||u<0||u>=i)throw new Error(`alphabet.encode: digit index outside alphabet "${u}". Allowed: ${e}`);return a[u]})),decode:s=>(Qu(s),s.map(u=>{Oo("alphabet.decode",u);const c=l.get(u);if(c===void 0)throw new Error(`Unknown letter: "${u}". Allowed: ${e}`);return c}))}}function Hb(e=""){return Oo("join",e),{encode:a=>(Bb("join.decode",a),a.join(e)),decode:a=>(Oo("join.decode",a),a.split(e))}}function Vv(e,a,i){if(a<2)throw new RangeError(`convertRadix: invalid from=${a}, base cannot be less than 2`);if(i<2)throw new RangeError(`convertRadix: invalid to=${i}, base cannot be less than 2`);if(Qu(e),!e.length)return[];let l=0;const s=[],u=Array.from(e,d=>{if(Zo(d),d<0||d>=a)throw new Error(`invalid integer: ${d}`);return d}),c=u.length;for(;;){let d=0,m=!0;for(let p=l;pa===0?e:$b(a,e%a),Fu=(e,a)=>e+(a-$b(e,a)),Au=(()=>{let e=[];for(let a=0;a<40;a++)e.push(2**a);return e})();function fh(e,a,i,l){if(Qu(e),a<=0||a>32)throw new RangeError(`convertRadix2: wrong from=${a}`);if(i<=0||i>32)throw new RangeError(`convertRadix2: wrong to=${i}`);if(Fu(a,i)>32)throw new Error(`convertRadix2: carry overflow from=${a} to=${i} carryBits=${Fu(a,i)}`);let s=0,u=0;const c=Au[a],d=Au[i]-1,m=[];for(const p of e){if(Zo(p),p>=c)throw new Error(`convertRadix2: invalid data word=${p} from=${a}`);if(s=s<32)throw new Error(`convertRadix2: carry overflow pos=${u} from=${a}`);for(u+=a;u>=i;u-=i)m.push((s>>u-i&d)>>>0);const b=Au[u];if(b===void 0)throw new Error("invalid carry");s&=b-1}if(s=s<=a)throw new Error("Excess padding");if(!l&&s>0)throw new Error(`Non-zero padding: ${s}`);return l&&u>0&&m.push(s>>>0),m}function G4(e){Zo(e);const a=2**8;return{encode:i=>{if(!Mo(i))throw new TypeError("radix.encode input should be Uint8Array");return Vv(Array.from(i),a,e)},decode:i=>($h("radix.decode",i),Uint8Array.from(Vv(i,e,a)))}}function K4(e,a=!1){if(Zo(e),e<=0||e>32)throw new RangeError("radix2: bits should be in (0..32]");if(Fu(8,e)>32||Fu(e,8)>32)throw new RangeError("radix2: carry overflow");return{encode:i=>{if(!Mo(i))throw new TypeError("radix2.encode input should be Uint8Array");return fh(Array.from(i),8,e,!a)},decode:i=>($h("radix2.decode",i),Uint8Array.from(fh(i,e,8,a)))}}function Xv(e){return Hh(e),function(...a){try{return e.apply(null,a)}catch{}}}function V4(e,a){if(Zo(e),e<=0)throw new RangeError(`checksum length must be positive: ${e}`);Hh(a);const i=a;return{encode(l){if(!Mo(l))throw new TypeError("checksum.encode: input should be Uint8Array");const s=i(l).slice(0,e),u=new Uint8Array(l.length+e);return u.set(l),u.set(s,l.length),u},decode(l){if(!Mo(l))throw new TypeError("checksum.decode: input should be Uint8Array");const s=l.slice(0,-e),u=l.slice(-e),c=i(s).slice(0,e);for(let d=0;dZh(G4(58),Ub(e),Hb("")),I4=Object.freeze(X4("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),J4=e=>{Hh(e);const a=e;return Zh(V4(4,i=>a(a(i))),I4)},dh=Zh(Ub("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Hb("")),Iv=[996825010,642813549,513874426,1027748829,705979059];function fo(e){const a=e>>25;let i=(e&33554431)<<5;for(let l=0;l>l&1)===1&&(i^=Iv[l]);return i}function Jv(e,a,i=1){const l=e.length;let s=1;for(let u=0;u126)throw new Error(`Invalid prefix (${e})`);s=fo(s)^c>>5}s=fo(s);for(let u=0;uw)throw new TypeError(`Length ${R} exceeds limit ${w}`);const C=v.toLowerCase(),Y=Jv(C,x,a);return`${C}1${dh.encode(x)}${Y}`}function d(v,x=90){Oo("bech32.decode input",v);const w=v.length;if(w<8||x!==!1&&w>x)throw new TypeError(`invalid string length: ${w} (${v}). Expected (8..${x})`);const E=v.toLowerCase();if(v!==E&&v!==v.toUpperCase())throw new Error("String must be lowercase or uppercase");const R=E.lastIndexOf("1");if(R===0||R===-1)throw new Error('Letter "1" must be present between prefix and data only');const C=E.slice(0,R),Y=E.slice(R+1);if(Y.length<6)throw new Error("Data must be at least 6 characters long");const V=dh.decode(Y).slice(0,-6),I=Jv(C,V,a);if(!Y.endsWith(I))throw new Error(`Invalid checksum in ${v}: expected "${I}"`);return{prefix:C,words:V}}const m=Xv(d);function p(v){const)DELIM" +R"DELIM({prefix:x,words:w}=d(v,!1);return{prefix:x,words:w,bytes:l(w)}}function b(v,x){return c(v,s(x))}return{encode:c,decode:d,encodeFromBytes:b,decodeToBytes:p,decodeUnsafe:m,fromWords:l,fromWordsUnsafe:u,toWords:s}}const Yu=Object.freeze(Zb("bech32")),hh=Object.freeze(Zb("bech32m"));function W4(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function qh(e,a,i=""){const l=W4(e),s=e?.length;if(!l||a!==void 0){const c=i&&`"${i}" `,d="",m=l?`length=${s}`:`type=${typeof e}`,p=c+"expected Uint8Array"+d+", got "+m;throw l?new RangeError(p):new TypeError(p)}return e}function Wv(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function eR(e,a){qh(e,void 0,"digestInto() output");const i=a.outputLen;if(e.length='+i)}function mh(...e){for(let a=0;a>>a}const tR=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",nR=Array.from({length:256},(e,a)=>a.toString(16).padStart(2,"0"));function zu(e){if(qh(e),tR)return e.toHex();let a="";for(let i=0;ie(u).update(s).digest(),l=e(void 0);return i.outputLen=l.outputLen,i.blockLen=l.blockLen,i.canXOF=l.canXOF,i.create=s=>e(s),Object.assign(i,a),Object.freeze(i)}const rR=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function iR(e,a,i){return e&a^~e&i}function lR(e,a,i){return e&a^e&i^a&i}class oR{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(a,i,l,s){this.blockLen=a,this.outputLen=i,this.padOffset=l,this.isLE=s,this.buffer=new Uint8Array(a),this.view=jd(this.buffer)}update(a){Wv(this),qh(a);const{view:i,buffer:l,blockLen:s}=this,u=a.length;for(let c=0;cs-c&&(this.process(l,0),c=0);for(let v=c;vb.length)throw new Error("_sha2: outputLen bigger than state");for(let v=0;v>>3,R=ya(w,17)^ya(w,19)^w>>>10;Er[v]=R+Er[v-7]+E+Er[v-16]|0}let{A:l,B:s,C:u,D:c,E:d,F:m,G:p,H:b}=this;for(let v=0;v<64;v++){const x=ya(d,6)^ya(d,11)^ya(d,25),w=b+x+iR(d,m,p)+sR[v]+Er[v]|0,R=(ya(l,2)^ya(l,13)^ya(l,22))+lR(l,s,u)|0;b=p,p=m,m=d,d=c+w|0,c=u,u=s,s=l,l=w+R|0}l=l+this.A|0,s=s+this.B|0,u=u+this.C|0,c=c+this.D|0,d=d+this.E|0,m=m+this.F|0,p=p+this.G|0,b=b+this.H|0,this.set(l,s,u,c,d,m,p,b)}roundClean(){mh(Er)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),mh(this.buffer)}}class cR extends uR{A=_r[0]|0;B=_r[1]|0;C=_r[2]|0;D=_r[3]|0;E=_r[4]|0;F=_r[5]|0;G=_r[6]|0;H=_r[7]|0;constructor(){super(32)}}const qb=aR(()=>new cR,rR(1)),Pb=J4(qb),fR=0x00000000ffff0000000000000000000000000000000000000000000000000000n;function Ph(e){if(e.length%2!==0)throw new Error("Invalid hex string");const a=new Uint8Array(e.length/2);for(let i=0;i>>24,i=e&8388607;if(i===0||a<3)return;const l=BigInt(i)*(1n<i[1]).filter(Boolean);return a.length>0?a:[e]}function Qh(e){const a=e.toLowerCase();if(a.includes("dup hash160")&&a.includes("equalverify checksig"))return"p2pkh";if(a.startsWith("hash160")&&a.includes("equal"))return"p2sh";if(a.startsWith("zero [")){const l=a.match(/zero \[([0-9a-f]+)\]/)?.[1]??"";return l.length===40?"p2wpkh":l.length===64?"p2wsh":"segwit"}if(a.startsWith("1 ["))return"p2tr"}function qo(){return"mainnet"}function Po(e){return e==="testnet"||e==="regtest"?{p2pkh:111,p2sh:196,hrp:e==="regtest"?"bcrt":"tb"}:{p2pkh:0,p2sh:5,hrp:"bc"}}function e0(e,a){const i=new Uint8Array(a.length/2+1);return i[0]=e,i.set(Ph(a),1),Pb.encode(i)}function Nd(e,a,i){const l=Ph(i),s=Yu.toWords(l);return s.unshift(a),(a===0?Yu:hh).encode(e,s)}function Qb(e,a){const i=e.toLowerCase(),l=i.match(/dup hash160 \[([0-9a-f]{40})\] equalverify checksig/);if(l)return{address:e0(a.p2pkh,l[1]),type:"p2pkh"};const s=i.match(/^hash160 \[([0-9a-f]{40})\] equal$/);if(s)return{address:e0(a.p2sh,s[1]),type:"p2sh"};const u=i.match(/^zero \[([0-9a-f]{40})\]/);if(u)return{address:Nd(a.hrp,0,u[1]),type:"p2wpkh"};const c=i.match(/^zero \[([0-9a-f]{64})\]/);if(c)return{address:Nd(a.hrp,0,c[1]),type:"p2wsh"};const d=i.match(/^1 \[([0-9a-f]{64})\]/);return d?{address:Nd(a.hrp,1,d[1]),type:"p2tr"}:{type:Qh(e)}}function mR(e,a){try{const s=Pb.decode(e),u=s[0],c=zu(s.slice(1));if(c.length===40&&u===a.p2pkh)return{scriptHex:`76a914${c}88ac`,type:"p2pkh"};if(c.length===40&&u===a.p2sh)return{scriptHex:`a914${c}87`,type:"p2sh"}}catch{}const i=e.toLowerCase();if(i.indexOf("1")>0&&i.startsWith(`${a.hrp}1`)){const s=i,u=m=>{try{return m.decode(s,90)}catch{return null}},c=u(Yu);if(c&&c.prefix===a.hrp){const m=c.words[0],p=Yu.fromWords(c.words.slice(1)),b=zu(p),v=p.length.toString(16).padStart(2,"0");if(m===0&&(p.length===20||p.length===32))return{scriptHex:`00${v}${b}`,type:p.length===20?"p2wpkh":"p2wsh"}}const d=u(hh);if(d&&d.prefix===a.hrp){const m=d.words[0],p=hh.fromWords(d.words.slice(1)),b=zu(p),v=p.length.toString(16).padStart(2,"0");if(m===1&&p.length===32)return{scriptHex:`51${v}${b}`,type:"p2tr"}}}return null}function Ga(e,a){const i=e.toLowerCase();if(/^[0-9a-f]{64}$/.test(i))return{hash:i,type:"script-hash"};const l=mR(e,a);if(!l)return null;const s=qb(Ph(l.scriptHex)),u=Uint8Array.from(s).reverse();return{hash:zu(u),type:l.type}}function ju(e,a){return{hash:e.hash,height:e.height)DELIM" +R"DELIM(,timestamp:e.timestamp,txCount:a,size:void 0,weight:void 0,difficulty:dR(e.bits),previousBlockHash:e.previous}}function pR(e){const a=hR(e);return a&&a.length>0?a:void 0}function yR(e,a,i,l){const s=/^0{64}$/u.test(e.point.hash),u=a?Qb(a.script,i):{address:void 0,type:void 0},c=a?a.value:void 0,d=a?a.script:void 0;return{index:l,prevTxId:s?void 0:e.point.hash,prevOutputIndex:s?void 0:e.point.index,address:u.address,valueSats:c,scriptType:u.type??Qh(d??e.script),isCoinbase:s,script:e.script?{mnemonic:e.script}:void 0,witness:pR(e.witness),sequence:e.sequence}}function gR(e,a,i){const l=Qb(e.script,i);return{index:a,address:l.address,valueSats:e.value,scriptType:l.type??Qh(e.script),spent:void 0,script:e.script?{mnemonic:e.script}:void 0}}function vR(e,a){return typeof e!="number"||typeof a!="number"?0:Math.max(0,e-a+1)}function yu(e,a,i,l,s){const u=e.outputs.map((b,v)=>gR(b,v,i)),c=u.reduce((b,v)=>b+v.valueSats,0),d=a.reduce((b,v)=>v?(b??0)+v.value:b,null),m=vR(l.tipHeight,l.blockHeight),p=typeof l.blockHeight=="number"?"confirmed":"unconfirmed";return{txid:e.hash,hash:e.hash,status:p,confirmations:m,blockHeight:l.blockHeight,blockHash:l.blockHash,receivedTime:l.timestamp,feeSats:Number.isFinite(s)?s:void 0,feeRate:null,size:void 0,weight:void 0,version:e.version,locktime:e.locktime,totalInput:d,totalOutput:c,inputs:e.inputs.map((b,v)=>yR(b,a[v],i,v)),outputs:u}}const gu=25,_o=8,bR="/v1/top/subscribe?format=json",xR="/v1/top/subscribe?format=json&stop=true",SR=5e3,wR=2500,Cd=5e3,_R=3e5,t0=5e3,ho=new Map,Md=new Map;class Fh extends Error{constructor(a,i){super(a),this.status=i,this.name="LibbitcoinApiError"}status}const Gu={address:!0,filter:!1,turbo:!0,witness:!0,retarget:!1,difficult:!1};function ER(e){if(!e||typeof e!="object"||Array.isArray(e))return Gu;const a=e,i=l=>typeof a[l]=="boolean"?a[l]:Gu[l];return{address:i("address"),filter:i("filter"),turbo:i("turbo"),witness:i("witness"),retarget:i("retarget"),difficult:i("difficult")}}function bo(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const i=e.state;if(!i||typeof i!="object"||Array.isArray(i))return null;const l=i,s=typeof l.count=="number"?l.count:void 0,u=typeof l.size=="number"?l.size:void 0,c=typeof l.weight=="number"?l.weight:void 0;return s===void 0&&u===void 0&&c===void 0?null:{count:s,size:u,weight:c}}function Nu(e){return e?.weight??e?.size}function TR(e,a){return!Number.isFinite(e)||!Number.isFinite(a)||a<=0?null:e/a*4}function vu(e,a){if(!a)return e;const i=typeof a.fee=="number"?a.fee:void 0,l=typeof a.weight=="number"?a.weight:void 0,s=typeof i=="number"&&typeof l=="number"?TR(i,l):e.feeRate;return{...e,wtxid:a.wtxid||e.wtxid,feeSats:typeof a.fee=="number"?a.fee:e.feeSats,feeRate:s,size:typeof a.maximal=="number"?a.maximal:e.size,weight:typeof a.weight=="number"?a.weight:e.weight,sigops:typeof a.confirmed?.sigops=="number"?a.confirmed.sigops:e.sigops,totalInput:typeof a.value=="number"?a.value:e.totalInput,totalOutput:typeof a.spend=="number"?a.spend:e.totalOutput}}async function sn(e,a,i){const l=a.startsWith("/")?a:`/${a}`;let s=l.includes("?")?`${e}${l}`:`${e}${l}?format=json`;i&&(s+=s.includes("?")?"&turbo=true":"?turbo=true");const u=Md.get(s);if(u)return u;const c=(async()=>{const d=await fetch(s,{headers:{Accept:"application/json"}});if(!d.ok){const p=await d.text().catch(()=>"");throw new Fh(`Request failed ${String(d.status)}: ${p||d.statusText}`,d.status)}const m=await d.text();try{return JSON.parse(m)}catch{return m}})();Md.set(s,c);try{return await c}finally{Md.delete(s)}}async function Gt(e,a,i){try{return await sn(e,a,i)}catch{return null}}async function Yh(e,a,i){try{return await sn(e,a,i)}catch(l){if(l instanceof Fh&&l.status===404)return null;throw l}}async function Fb(e,a){const i=await sn(e,"/v1/top?format=json",a),l=typeof i=="number"?i:Number(i);if(!Number.isFinite(l))throw new Error("Invalid top height");return l}function RR(e){return/^[0-9a-f]{64}$/iu.test(e)}function AR(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0?e:typeof e=="string"&&/^\d+$/u.test(e.trim())?Number(e.trim()):null}function ph(e){const a=AR(e);if(a!==null)return a;if(typeof e=="string"){const s=e.trim();return RR(s)?s:null}if(!e||typeof e!="object"||Array.isArray(e))return null;const i=e,l=[i.payload,i.top,i.block,i.header,i.hash,i.height];for(const s of l){if(s===e)continue;const u=ph(s);if(u!==null)return u}return null}function zR(e){return typeof e=="string"?Promise.resolve(e):e instanceof ArrayBuffer?Promise.resolve(new TextDecoder().decode(e)):e instanceof Blob?e.text():Promise.resolve(null)}function jR(e){const a=e.trim();if(!a)return null;try{return ph(JSON.parse(a))}catch{return ph(a)}}function NR(e){const a=e.trim();if(!a)return null;const l=/^[a-z][a-z\d+\-.]*:\/\//iu.test(a)?a:`http://${a}`,s=globalThis.window;try{const u=new URL(l,s?.location.href??"http://localhost");if(u.protocol==="http:")u.protocol="ws:";else if(u.protocol==="https:")u.protocol="wss:";else if(u.protocol!=="ws:"&&u.protocol!=="wss:")return null;return u.hash="",u.search="",u.toString()}catch{return null}}async function ni(e,a){const i=Date.now(),l=`${e}|0`,s=ho.get(l);if(s&&s.expiresAt>i)return s.promise;const u=Fb(e,a).then(c=>(ho.set(l,{promise:u,value:c,expiresAt:Date.now()+t0}),c),c=>{throw ho.get(l)?.promise===u&&ho.delete(l),c});return ho.set(l,{promise:u,value:s?.value??null,expiresAt:i+t0}),u}async function bu(e,a,i){if(a==="latest"||a==="tip"){const l=await ni(e,i);return{path:`/v1/block/height/${String(l)}`,height:l}}return/^\d+$/u.test(a)?{path:`/v1/block/height/${a}`}:{path:`/v1/block/hash/${a}`}}function CR(e,a){const i=new Map;return(l,s)=>{const u=`${l}:${String(s)}`,c=i.get(u);if(c)return c;const d=sn(e,`/v1/output/${l}/${String(s)}?format=json`,a).catch(()=>null);return i.set(u,d),d}}async function MR(e,a,i,l){return sn(e,`${a}/tx/${String(i)}?format=json`,l)}async function n0(e,a,i,l){const s=await cl(i,_o,async c=>{try{return await MR(e,a,c)}catch(d){if(l&&d instanceof Fh&&d.status===404)return null;throw d}}),u=s.indexOf(null);if(u===-1)return s.filter(c=>c!==null);if(s.slice(u+1).some(c=>c!==null))throw new Error("Libbitcoin returned a non-contiguous block transaction page");return s.slice(0,u).filter(c=>c!==null)}async function a0(e,a){return cl(a,_o,async i=>{const[l,s]=await Promise.all([sn(e,`/v1/block/height/${String(i)}/header?format=json`),Gt(e,`/v1/block/height/${String(i)}/header/context?format=json`)]),u=bo(s);return{...ju(l,u?.count),size:Nu(u)}})}function Yb(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Gb(e){return Yb(e)?typeof e.hash=="string"&&e.hash.length>0&&typeof e.index=="number"&&Number.isInteger(e.index)&&e.index>=0:!1}function Kb(e,a){if(!Array.isArray(e)||!e.every(i=>Yb(i)&&Gb(i.point)&&typeof i.value=="number"&&Number.isFinite(i.value)&&i.value>=0))throw new TypeError(`Invalid response from ${a}`);return e}async function OR(e,a,i){const l=`/v1/address/${a}/confirmed?format=json`,s=await Yh(e,l,i);return s===null?[]:Kb(s,l)}async function kR(e,a,i){const l=`/v1/address/${a}?format=json`,s=await Yh(e,l,i);return s===null?[]:Kb(s,l)}const r0=25,DR=8,i0=3e4;function LR(e){if(e===void 0)return 0;const a=Number(e);return Number.isInteger(a)&&a>0?a:0}async function BR(e,a,i){const l=`/v1/output/${a}/${String(i)}/spender?format=json`,s=await Yh(e,l);if(s===null)return null;if(!Gb(s))throw new TypeError(`Invalid response from ${l}`);return s}async function cl(e,a,i){const l=Array.from({length:e.length});let s=0;async function u(){for(;su())),l}async function UR(e,a,i){const l=await cl(a,DR,u=>BR(e,u.point.hash,u.point.index)),s=[];for(const[u,c]of a.entries()){const{hash:d,index:m}=c.point,p=l[u];s.push({id:`in:${d}:${String(m)}`,txid:d,outputIndex:m,valueChange:c.value,direction:"received",spent:p!==null,...i===null?{}:{cursor:i}}),p&&s.push({id:`out:${d}:${String(m)}`,txid:p.hash,valueChange:-c.value,di)DELIM" +R"DELIM(rection:"sent",...i===null?{}:{cursor:i}})}return s}function l0(e,a){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const l=Number(e);if(Number.isFinite(l))return l}let i=0;for(const l of a)i+=l.value;return i}function Od({baseUrl:e,pollIntervalMs:a=15e3,turbo:i=!1}){const l=new Set,s=new Set;let u=null,c=null,d=null,m=null,p=null,b=Cd,v=!1,x=!1,w="idle",E=null,R=null;const C=Po(qo());let Y=null,V=null;const I=NR(e),oe=!!(I&&globalThis.WebSocket),re=new Map,xe=new Map;async function N(H,fe){const he=Date.now(),Ee=re.get(H);if(Ee&&Ee.expiresAt>he)return Ee.outputs;const me=await kR(e,H,fe);return re.set(H,{outputs:me,expiresAt:he+i0}),me}async function _(H,fe){const he=Date.now(),Ee=xe.get(H);if(Ee&&Ee.expiresAt>he)return Ee.request;const me=OR(e,H,fe);xe.set(H,{request:me,expiresAt:he+i0});try{return await me}catch(Ae){throw xe.get(H)?.request===me&&xe.delete(H),Ae}}async function D(H,fe,he){const Ee=await N(H,fe),me=LR(he),Ae=Ee.slice(me,me+r0),Je=me+r0,ke=Je{const fe=ER(H);return Y=fe,fe}).catch(H=>(console.warn("Libbitcoin configuration fetch failed",H),Y=Gu,Gu)),V)}function Q(H){return H.address}function P(H){return Q(H)&&H.turbo}function ne(){return{transport:w,websocketAvailable:oe&&!v}}function ue(H){if(w===H)return;w=H;const fe=ne();for(const he of s)he(fe)}async function pe(H){const fe=typeof H=="number"?`/v1/block/height/${String(H)}`:`/v1/block/hash/${H}`,[he,Ee]=await Promise.all([sn(e,`${fe}/header?format=json`),Gt(e,`${fe}/header/context?format=json`)]);if(R===he.hash||E!==null&&he.heightE&&await pe(H)}catch(H){console.warn("Libbitcoin poller failed",H)}}function O(){l.size!==0&&(u||(u=setInterval(()=>{M()},a)),ue("polling"))}function le(){u&&(clearInterval(u),u=null)}function ce(){d&&(clearTimeout(d),d=null)}function Se(){m&&(clearTimeout(m),m=null)}function j(){p&&(clearTimeout(p),p=null)}function K(){if(p||!oe||l.size===0)return;const H=b;b=Math.min(b*2,_R),p=setTimeout(()=>{p=null,!(c||l.size===0)&&(v=!1,te())},H)}function ae(){v=!0,de(!1),O(),K()}function de(H){if(ce(),!!c){x=!0;try{H&&c.readyState===1&&c.send(xR),c.close()}catch{}finally{c=null}}}function te(){if(Se(),c)return!0;if(!oe||!I||v||l.size===0)return!1;try{x=!1,c=new WebSocket(I),ue("connecting")}catch(fe){return console.warn("Libbitcoin websocket unavailable, falling back to polling",fe),ae(),!1}const H=c;return d=setTimeout(()=>{c===H&&(console.warn("Libbitcoin websocket connect timed out, falling back to polling"),ae())},SR),H.addEventListener("open",()=>{if(c===H){ce();try{H.send(bR),le(),v=!1,b=Cd,ue("websocket")}catch(fe){console.warn("Libbitcoin websocket subscribe failed, falling back to polling",fe),ae()}}}),H.addEventListener("message",fe=>{(async()=>{try{const he=await zR(fe.data);if(he===null)return;const Ee=jR(he);if(Ee===null)return;await pe(Ee)}catch(he){console.warn("Libbitcoin websocket event handling failed",he)}})()}),H.addEventListener("error",fe=>{x||c!==H||(console.warn("Libbitcoin websocket failed, falling back to polling",fe),ae())}),H.addEventListener("close",()=>{if(!(c!==null&&c!==H)){if(ce(),c===H&&(c=null),x){x=!1;return}l.size!==0&&ae()}}),!0}function ye(){te()||(O(),K())}function Ce(){Se(),j(),b=Cd,v=!1,le(),de(!0),ue("idle")}function wt(){l.size>0||m||(m=setTimeout(()=>{m=null,l.size===0&&Ce()},wR))}return{metadata:{id:"libbitcoin",label:"Server",type:"local",connectionState:"connected",supportsWebsocket:oe,endpoint:e,description:"Adapter for the libbitcoin embedded REST API."},getConfiguration(){return B()},async getLatestBlocks(H=10){const fe=await ni(e);E=fe;const he=Array.from({length:H},(me,Ae)=>fe-Ae).filter(me=>me>=0),Ee=await a0(e,he);return Ee.length>0&&(R=Ee[0].hash),Ee},async getBlocksBefore(H,fe=10){const he=Array.from({length:fe},(Ee,me)=>H-me).filter(Ee=>Ee>=0);return a0(e,he)},async getBlockHeader(H){const{path:fe,height:he}=await bu(e,H),Ee=he===void 0?ni(e):Promise.resolve(he),[me,Ae,Je]=await Promise.all([sn(e,`${fe}/header?format=json`),Ee,Gt(e,`${fe}/header/context?format=json`)]);E=Math.max(E??0,Ae);let ke=null;me.height_a),Xa=await n0(e,fe,xn,typeof Xe!="number"),qt=await cl(Xa,_o,cn=>Gt(e,`/v1/tx/${cn.hash}/details?format=json`)),Wn=Xa.map((cn,_a)=>{const Dn=qt[_a],Sn=yu(cn,[],C,{blockHeight:me.height,blockHash:me.hash,tipHeight:Ae,timestamp:me.timestamp},typeof Dn?.fee=="number"?Dn.fee:void 0);return vu(Sn,Dn)});return{...pt,size:ke?.maximal??Nu(Fe),weight:ke?.weight,merkleRoot:me.merkle_root,nonce:me.nonce,bits:me.bits,version:me.version,nextBlockHash:qe,feesSats:ke?.fees,subsidySats:ke?.subsidy,sigops:ke?.sigops,transactions:Wn}},async getBlockTransactions(H,fe=0){const{path:he}=await bu(e,H),[Ee,me,Ae]=await Promise.all([sn(e,`${he}/header?format=json`),ni(e),Gt(e,`${he}/header/context?format=json`)]);E=Math.max(E??0,me);const Je=bo(Ae)?.count;if(typeof Je=="number"&&fe>=Je)return[];const ke=typeof Je=="number"?Math.min(fe+gu,Je):fe+gu,qe=Array.from({length:Math.max(0,ke-fe)},(pt,It)=>fe+It),Fe=await n0(e,he,qe,typeof Je!="number");if(Fe.length===0)return[];const Xe=await cl(Fe,_o,pt=>Gt(e,`/v1/tx/${pt.hash}/details?format=json`));return Fe.map((pt,It)=>{const xn=Xe[It],Xa=yu(pt,[],C,{blockHeight:Ee.height,blockHash:Ee.hash,tipHeight:me,timestamp:Ee.timestamp},typeof xn?.fee=="number"?xn.fee:void 0);return vu(Xa,xn)})},async getTransaction(H){const fe=await sn(e,`/v1/tx/${H}?format=json`),he=CR(e),Ee=cl(fe.inputs,_o,Fe=>/^0{64}$/u.test(Fe.point.hash)?Promise.resolve(null):he(Fe.point.hash,Fe.point.index)),[me,Ae,Je,ke]=await Promise.all([Gt(e,`/v1/tx/${H}/header?format=json`),ni(e).catch(()=>null),Gt(e,`/v1/tx/${H}/details?format=json`),Ee]);typeof Ae=="number"&&(E=Math.max(E??0,Ae));const qe=yu(fe,ke,C,{blockHeight:me?.height,blockHash:me?.hash,tipHeight:typeof Ae=="number"?Ae:void 0,timestamp:me?.timestamp},typeof Je?.fee=="number"?Je.fee:void 0);return vu(qe,Je)},async getTransactionHeader(H){const fe=await sn(e,`/v1/tx/${H}?format=json`),[he,Ee,me]=await Promise.all([Gt(e,`/v1/tx/${H}/header?format=json`),ni(e).catch(()=>null),Gt(e,`/v1/tx/${H}/details?format=json`)]);typeof Ee=="number"&&(E=Math.max(E??0,Ee));const Ae=yu(fe,[],C,{blockHeight:he?.height,blockHash:he?.hash,tipHeight:typeof Ee=="number"?Ee:void 0,timestamp:he?.timestamp},typeof me?.fee=="number"?me.fee:void 0);return vu(Ae,me)},async getTransactionInputScriptHex(H,fe){return(await sn(e,`/v1/input/${H}/${String(fe)}/script?format=text`)).trim()},async getTransactionOutputScriptHex(H,fe){return(await sn(e,`/v1/output/${H}/${String(fe)}/script?format=text`)).trim()},async getAddress(H){const fe=Ga(H,C);if(!fe)throw new Error("Unsupported address format for libbitcoin adapter");const)DELIM" +R"DELIM( he=Y??await B();if(!Q(he))throw new Error("Address endpoints are disabled by server configuration");const Ee=i&&P(he),[me,Ae]=await Promise.all([Gt(e,`/v1/address/${fe.hash}/balance?format=json`,Ee),_(fe.hash,Ee)]),Je=l0(me,Ae),ke=await D(fe.hash,Ee);return{address:H,addressType:fe.type,balance:Je,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:Ae.length,transactions:ke}},async getAddressSummary(H){const fe=Ga(H,C);if(!fe)throw new Error("Unsupported address format for libbitcoin adapter");const he=Y??await B();if(!Q(he))throw new Error("Address endpoints are disabled by server configuration");const Ee=i&&P(he),[me,Ae]=await Promise.all([Gt(e,`/v1/address/${fe.hash}/balance?format=json`,Ee),_(fe.hash,Ee)]),Je=l0(me,Ae);return{address:H,addressType:fe.type,balance:Je,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:Ae.length}},async getAddressUtxos(H){const fe=Ga(H,C);if(!fe)throw new Error("Unsupported address format for libbitcoin adapter");const he=Y??await B();if(!Q(he))throw new Error("Address endpoints are disabled by server configuration");const Ee=i&&P(he);return(await _(fe.hash,Ee)).map(Ae=>({txid:Ae.point.hash,outputIndex:Ae.point.index,valueSats:Ae.value,status:"confirmed"}))},async getAddressTransactions(H,fe){const he=Ga(H,C);if(!he)return[];const Ee=Y??await B();if(!Q(Ee))return[];const me=i&&P(Ee);return D(he.hash,me,fe)},subscribeToEvents(H){return Se(),l.add(H),ye(),()=>{l.delete(H),wt()}},getEventStatus:ne,subscribeToEventStatus(H){return s.add(H),H(ne()),()=>{s.delete(H)}}}}const Vb=T.createContext(null),Xb=T.createContext(null),Ib=T.createContext(null);function HR({children:e,client:a}){return y.jsx(Vb.Provider,{value:a,children:e})}function $R({children:e,provider:a,setProvider:i,availableProviders:l,selectorVisible:s,setSelectorVisible:u}){return y.jsx(Xb.Provider,{value:{provider:a,setProvider:i,availableProviders:l,selectorVisible:s,setSelectorVisible:u},children:e})}function ZR({children:e,turbo:a,setTurbo:i}){return y.jsx(Ib.Provider,{value:{turbo:a,setTurbo:i},children:e})}function Va(){const e=T.useContext(Vb);if(!e)throw new Error("BlockchainClientProvider missing in component tree");return e}function Qo(){return Va().metadata}function Jb(){const e=T.useContext(Xb);if(!e)throw new Error("ProviderSwitcherProvider missing in component tree");return e}function Wb(){const e=T.useContext(Ib);if(!e)throw new Error("TurboProvider missing in component tree");return e}function kd(){const e=globalThis.window;return e?.location.origin?e.location.origin:"http://localhost:8080"}function qR(e,a){if(e==="blockstream")return Db({baseUrl:"https://blockstream.info/api"});if(e==="mempool")return Y4({baseUrl:"https://mempool.space/api"});if(e==="libbitcoin"){const l=kd();return Od({baseUrl:l,turbo:a?.turboEnabled})}if(e==="external"){console.warn("No external API URL provided, falling back to libbitcoin provider");const l=kd();return Od({baseUrl:l,turbo:a?.turboEnabled})}console.warn(`Unknown provider "${e}", falling back to libbitcoin provider`);const i=kd();return Od({baseUrl:i,turbo:a?.turboEnabled})}function PR(){return[...new Set(["libbitcoin","blockstream","mempool"])]}const Dd=10,QR=20;function ex(e){return e.metadata.endpoint?{providerId:e.metadata.id,endpoint:e.metadata.endpoint}:{providerId:e.metadata.id}}function FR(e,a){if(!e||typeof e!="object"||Array.isArray(e))return!1;const i=e;return i.providerId===a.providerId&&i.endpoint===a.endpoint}function YR(e,a){if(!e||typeof e!="object"||Array.isArray(e))return a;const i=e.limit;return typeof i=="number"&&Number.isFinite(i)&&i>0?i:a}function GR(e,a,i){const l=e.getQueryCache().findAll({predicate:s=>{const u=s.queryKey;return u.length>=4&&FR(u[0],a)&&u[1]==="blocks"&&u[2]==="latest"}});for(const s of l){const u=YR(s.queryKey[3],Dd);e.setQueryData(s.queryKey,c=>[i,...(c??[]).filter(p=>p.hash!==i.hash)].slice(0,u))}e.setQueryData([a,"blocks","latest",{limit:Dd}],s=>[i,...(s??[]).filter(d=>d.hash!==i.hash)].slice(0,Dd))}function KR(e,a,i){e.setQueryData([a,"transactions","recent"],l=>[i,...(l??[]).filter(c=>c.txid!==i.txid)].slice(0,QR))}function VR(e,a,i){i.type==="block.new"&&GR(e,a,i.payload),i.type==="tx.new"&&KR(e,a,i.payload)}function Mn({queryKey:e,queryFn:a,enabled:i,staleTime:l,initialData:s}){const u=Va();return a_({queryKey:[ex(u),...e],queryFn:()=>a(u),enabled:i,staleTime:l,initialData:s})}function tx(e=10){return Mn({queryKey:["blocks","latest",{limit:e}],queryFn:a=>a.getLatestBlocks(e)})}function nx(){return Mn({queryKey:["configuration"],queryFn:e=>e.getConfiguration(),staleTime:6e4})}function ax(e){return Mn({queryKey:["block",e,"header"],queryFn:a=>a.getBlockHeader(e)})}function rx(e,a){return Mn({queryKey:["block",e,"stats"],queryFn:i=>i.getBlockStats(e),enabled:(a?.enabled??!0)&&!!e.trim(),staleTime:1/0})}function XR(e,a=0){return Mn({queryKey:["block",e,"transactions",{startIndex:a}],queryFn:i=>i.getBlockTransactions(e,a)})}function IR(e){return Mn({queryKey:["transaction",e,"header"],queryFn:a=>a.getTransactionHeader(e),enabled:!!e.trim()})}function JR(e,a){return Mn({queryKey:["transaction",e],queryFn:i=>i.getTransaction(e),enabled:a?.enabled??!!e.trim()})}function WR(e,a,i){return Mn({queryKey:["transaction",e,"input",a,"scriptHex"],queryFn:l=>l.getTransactionInputScriptHex(e,a),enabled:(i?.enabled??!0)&&!!e.trim()})}function e3(e,a,i){return Mn({queryKey:["transaction",e,"output",a,"scriptHex"],queryFn:l=>l.getTransactionOutputScriptHex(e,a),enabled:(i?.enabled??!0)&&!!e.trim()})}function t3(e){return Mn({queryKey:["address",e,"summary"],queryFn:a=>a.getAddressSummary(e),enabled:!!e.trim()})}function n3(e){return Mn({queryKey:["address",e,"utxos"],queryFn:a=>a.getAddressUtxos(e),enabled:!!e.trim()})}function a3(e,a){return Mn({queryKey:["address",e,"transactions",{lastSeenTxid:null}],queryFn:i=>i.getAddressTransactions(e,a),enabled:!!e.trim()})}function r3(e){const a=Va(),i=T.useRef(e);T.useEffect(()=>{i.current=e},[e]),T.useEffect(()=>{const l=a.subscribeToEvents(s=>{i.current(s)});return()=>{l()}},[a])}function i3(){const e=Va(),a=T.useMemo(()=>({transport:e.metadata.supportsWebsocket?"websocket":"polling",websocketAvailable:e.metadata.supportsWebsocket}),[e.metadata.supportsWebsocket]),[i,l]=T.useState(()=>e.getEventStatus?e.getEventStatus():a);return T.useEffect(()=>{const s=e.getEventStatus?e.getEventStatus():a;return l(s),e.subscribeToEventStatus?.(l)},[e,a]),i}function l3(){const e=Va(),a=T.useMemo(()=>ex(e),[e]),i=Ju(),l=T.useCallback(s=>{VR(i,a,s)},[i,a]);return r3(l),null}function o3(e=10){const{data:a,isLoading:i,isError:l,error:s}=tx(e),{data:u=[]}=Mn({queryKey:["transactions","recent"],queryFn:()=>Promise.resolve([]),enabled:!1,initialData:[]});return{data:a,recentTransactions:u,isLoading:i,isError:l,error:s}}function Ld(e){return globalThis.window?.localStorage.getItem(e)??null}function Bd(e,a){globalThis.window?.localStorage.setItem(e,a)}function s3({children:e}){const a="libbitcoin",i=PR(),[l,s]=T.useState(()=>Ld("turboEnabled")==="true"),[u,c]=T.useState(()=>{const v=Ld("blockchainProvider");return v&&i.includes(v)?v:a}),[d,m]=T.useState(()=>Ld("providerSelectorVisible")==="true"),[p]=T.useState(()=>new Qw({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}})),b=T.useMemo(()=>qR(u,{turboEnabled:l}),[u,l]);return T.useEffect(()=>{Bd("turboEnabled",l?"true":"false")},[l]),T.useEffect(()=>{Bd("blockchainProvider",u)},[u]),T.useEffect(()=>{Bd("providerSelectorVisible",d?"true":"false")},[d]),y.jsx($R,{provider:u,setProvider:c,availableProviders:i,selectorVisible:d,setSelectorVisible:m,children:y.jsx(ZR,{turbo:l,setTurbo:s,children:y.jsx(HR,{client:b,children:y.jsxs(Fw,{client:p,children:[y.jsx(l3,{}),e,null]})})})})}var ix=e=>{throw TypeError(e)},lx=(e,a,i)=>a.has(e)||ix("Cannot "+i),Yn=(e,a,i)=>(lx(e,a,"read from private field"),i?i.call(e):a.get(e)),xo=(e,a,i)=>a.has(e)?ix("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(e):a.set(e,i),ga=(e,a,i,l)=>(lx(e,a,"write to )DELIM" +R"DELIM(private field"),a.set(e,i),i),ac=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Gh=/^[\\/]{2}/;function ox(e,a){return a+e.replace(/\\/g,"/")}var o0="popstate";function s0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function u3(e={}){function a(l,s){let u=s.state?.masked,{pathname:c,search:d,hash:m}=u||l.location;return ko("",{pathname:c,search:d,hash:m},s.state&&s.state.usr||null,s.state&&s.state.key||"default",u?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,s){return typeof s=="string"?s:xa(s)}return f3(a,i,null,e)}function Be(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function Rt(e,a){if(!e){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function c3(){return Math.random().toString(36).substring(2,10)}function u0(e,a){return{usr:e.state,key:e.key,idx:a,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ko(e,a,i=null,l,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof a=="string"?Sa(a):a,state:i,key:a&&a.key||l||c3(),mask:s}}function xa({pathname:e="/",search:a="",hash:i=""}){return a&&a!=="?"&&(e+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function Sa(e){let a={};if(e){let i=e.indexOf("#");i>=0&&(a.hash=e.substring(i),e=e.substring(0,i));let l=e.indexOf("?");l>=0&&(a.search=e.substring(l),e=e.substring(0,l)),e&&(a.pathname=e)}return a}function f3(e,a,i,l={}){let{window:s=document.defaultView,v5Compat:u=!1}=l,c=s.history,d="POP",m=null,p=b();p==null&&(p=0,c.replaceState({...c.state,idx:p},""));function b(){return(c.state||{idx:null}).idx}function v(){d="POP";let C=b(),Y=C==null?null:C-p;p=C,m&&m({action:d,location:R.location,delta:Y})}function x(C,Y){d="PUSH";let V=s0(C)?C:ko(R.location,C,Y);p=b()+1;let I=u0(V,p),oe=R.createHref(V.mask||V);try{c.pushState(I,"",oe)}catch(re){if(re instanceof DOMException&&re.name==="DataCloneError")throw re;s.location.assign(oe)}u&&m&&m({action:d,location:R.location,delta:1})}function w(C,Y){d="REPLACE";let V=s0(C)?C:ko(R.location,C,Y);p=b();let I=u0(V,p),oe=R.createHref(V.mask||V);c.replaceState(I,"",oe),u&&m&&m({action:d,location:R.location,delta:0})}function E(C){return sx(s,C)}let R={get action(){return d},get location(){return e(s,c)},listen(C){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(o0,v),m=C,()=>{s.removeEventListener(o0,v),m=null}},createHref(C){return a(s,C)},createURL:E,encodeLocation(C){let Y=E(C);return{pathname:Y.pathname,search:Y.search,hash:Y.hash}},push:x,replace:w,go(C){return c.go(C)}};return R}function sx(e,a,i=!1){let l="http://localhost";e&&(l=e.location.origin!=="null"?e.location.origin:e.location.href),Be(l,"No window.location.(origin|href) available to create URL");let s=typeof a=="string"?a:xa(a);return s=s.replace(/ $/,"%20"),!i&&Gh.test(s)&&(s=l+s),new URL(s,l)}var So,c0=class{constructor(e){if(xo(this,So,new Map),e)for(let[a,i]of e)this.set(a,i)}get(e){if(Yn(this,So).has(e))return Yn(this,So).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,a){Yn(this,So).set(e,a)}};So=new WeakMap;var d3=new Set(["lazy","caseSensitive","path","id","index","children"]);function h3(e){return d3.has(e)}var m3=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function p3(e){return m3.has(e)}function y3(e){return e.index===!0}function Do(e,a,i=[],l={},s=!1){return e.map((u,c)=>{let d=[...i,String(c)],m=typeof u.id=="string"?u.id:d.join("-");if(Be(u.index!==!0||!u.children,"Cannot specify children on an index route"),Be(s||!l[m],`Found a route id collision on id "${m}". Route id's must be globally unique within Data Router usages`),y3(u)){let p={...u,id:m};return l[m]=f0(p,a(p)),p}else{let p={...u,id:m,children:void 0};return l[m]=f0(p,a(p)),u.children&&(p.children=Do(u.children,a,d,l,s)),p}})}function f0(e,a){return Object.assign(e,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...e.lazy,...a.lazy}}:{}})}function ux(e,a,i="/"){return sa(e,a,i,!1)}function sa(e,a,i,l,s){let u=typeof a=="string"?Sa(a):a,c=Xn(u.pathname||"/",i);if(c==null)return null;let d=s??Cu(e),m=null,p=z3(c);for(let b=0;m==null&&b{let b={relativePath:p===void 0?c.path||"":p,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(l)&&m)return;Be(b.relativePath.startsWith(l),`Absolute route path "${b.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(l.length)}let v=Kn([l,b.relativePath]),x=i.concat(b);c.children&&c.children.length>0&&(Be(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),cx(c.children,a,x,v,m)),!(c.path==null&&!c.index)&&a.push({path:v,score:T3(v,c.index),routesMeta:x.map((w,E)=>{let[R,C]=hx(w.relativePath,w.caseSensitive,E===x.length-1);return{...w,matcher:R,compiledParams:C}})})};return e.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))u(c,d);else for(let m of fx(c.path))u(c,d,!0,m)}),a}function fx(e){let a=e.split("/");if(a.length===0)return[];let[i,...l]=a,s=i.endsWith("?"),u=i.replace(/\?$/,"");if(l.length===0)return s?[u,""]:[u];let c=fx(l.join("/")),d=[];return d.push(...c.map(m=>m===""?u:[u,m].join("/"))),s&&d.push(...c),d.map(m=>e.startsWith("/")&&m===""?"/":m)}function v3(e){e.sort((a,i)=>a.score!==i.score?i.score-a.score:R3(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var b3=/^:[\w-]+$/,x3=3,S3=2,w3=1,_3=10,E3=-2,d0=e=>e==="*";function T3(e,a){let i=e.split("/"),l=i.length;return i.some(d0)&&(l+=E3),a&&(l+=S3),i.filter(s=>!d0(s)).reduce((s,u)=>s+(b3.test(u)?x3:u===""?w3:_3),l)}function R3(e,a){return e.length===a.length&&e.slice(0,-1).every((l,s)=>l===a[s])?e[e.length-1]-a[a.length-1]:0}function A3(e,a,i=!1){let{routesMeta:l}=e,s={},u="/",c=[];for(let d=0;d{if(b==="*"){let E=d[x]||"";c=u.slice(0,u.length-E.length).replace(/(.)\/+$/,"$1")}const w=d[x];return v&&!w?p[b]=void 0:p[b]=(w||"").replace(/%2F/g,"/"),p},{}),pathname:u,pathnameBase:c,pattern:e}}function hx(e,a=!1,i=!0){Rt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let l=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,m,p,b)=>{if(l.push({paramName:d,isOptional:m!=null}),m){let v=b.charAt(p+c.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.en)DELIM" +R"DELIM(dsWith("*")?(l.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,a?void 0:"i"),l]}function z3(e){try{return e.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Rt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),e}}function Xn(e,a){if(a==="/")return e;if(!e.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,l=e.charAt(i);return l&&l!=="/"?null:e.slice(i)||"/"}function j3({basename:e,pathname:a}){return a==="/"?e:Kn([e,a])}var Kh=e=>ac.test(e);function N3(e,a="/"){let{pathname:i,search:l="",hash:s=""}=typeof e=="string"?Sa(e):e,u;return i?(i=Vh(i),i.startsWith("/")?u=h0(i.substring(1),"/"):u=h0(i,a)):u=a,{pathname:u,search:M3(l),hash:O3(s)}}function h0(e,a){let i=Vu(a).split("/");return e.split("/").forEach(s=>{s===".."?i.length>1&&i.pop():s!=="."&&i.push(s)}),i.length>1?i.join("/"):"/"}function Ud(e,a,i,l){return`Cannot include a '${e}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function mx(e){return e.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function rc(e){let a=mx(e);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function Fo(e,a,i,l=!1){let s;typeof e=="string"?s=Sa(e):(s={...e},Be(!s.pathname||!s.pathname.includes("?"),Ud("?","pathname","search",s)),Be(!s.pathname||!s.pathname.includes("#"),Ud("#","pathname","hash",s)),Be(!s.search||!s.search.includes("#"),Ud("#","search","hash",s)));let u=e===""||s.pathname==="",c=u?"/":s.pathname,d;if(c==null)d=i;else{let v=a.length-1;if(!l&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),v-=1;s.pathname=x.join("/")}d=v>=0?a[v]:"/"}let m=N3(s,d),p=c&&c!=="/"&&c.endsWith("/"),b=(u||c===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(p||b)&&(m.pathname+="/"),m}var Vh=e=>e.replace(/[\\/]{2,}/g,"/"),Kn=e=>Vh(e.join("/")),Vu=e=>e.replace(/\/+$/,""),C3=e=>Vu(e).replace(/^\/*/,"/"),M3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,O3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,k3=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Yo=class{constructor(e,a,i,l=!1){this.status=e,this.statusText=a||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Lo(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Go(e){let a=e.map(i=>i.route.path).filter(Boolean);return Kn(a)||"/"}var px=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function yx(e,a){let i=e;if(typeof i!="string"||!ac.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,s=!1;if(px)try{let u=new URL(window.location.href),c=Gh.test(i)?new URL(ox(i,u.protocol)):new URL(i),d=Xn(c.pathname,a);c.origin===u.origin&&d!=null?i=d+c.search+c.hash:s=!0}catch{Rt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:s,to:i}}var Mr=Symbol("Uninstrumented");function D3(e,a){let i={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({id:a.id,index:a.index,path:a.path,instrument(u){let c=Object.keys(i);for(let d of c)u[d]&&i[d].push(u[d])}}));let l={};if(typeof a.lazy=="function"&&i.lazy.length>0){let s=ol(i.lazy,a.lazy,()=>{});s&&(l.lazy=s)}if(typeof a.lazy=="object"){let s=a.lazy;["middleware","loader","action"].forEach(u=>{let c=s[u],d=i[`lazy.${u}`];if(typeof c=="function"&&d.length>0){let m=ol(d,c,()=>{});m&&(l.lazy=Object.assign(l.lazy||{},{[u]:m}))}})}return["loader","action"].forEach(s=>{let u=a[s];if(typeof u=="function"&&i[s].length>0){let c=u[Mr]??u,d=ol(i[s],c,(...m)=>m0(m[0]));d&&(s==="loader"&&c.hydrate===!0&&(d.hydrate=!0),d[Mr]=c,l[s]=d)}}),a.middleware&&a.middleware.length>0&&i.middleware.length>0&&(l.middleware=a.middleware.map(s=>{let u=s[Mr]??s,c=ol(i.middleware,u,(...d)=>m0(d[0]));return c?(c[Mr]=u,c):s})),l}function L3(e,a){let i={navigate:[],fetch:[]};if(a.forEach(l=>l({instrument(s){let u=Object.keys(s);for(let c of u)s[c]&&i[c].push(s[c])}})),i.navigate.length>0){let l=e.navigate[Mr]??e.navigate,s=ol(i.navigate,l,(...u)=>{let[c,d]=u;return{to:typeof c=="number"||typeof c=="string"?c:c?xa(c):".",...p0(e,d??{})}});s&&(s[Mr]=l,e.navigate=s)}if(i.fetch.length>0){let l=e.fetch[Mr]??e.fetch,s=ol(i.fetch,l,(...u)=>{let[c,,d,m]=u;return{href:d??".",fetcherKey:c,...p0(e,m??{})}});s&&(s[Mr]=l,e.fetch=s)}return e}function ol(e,a,i){return e.length===0?null:async(...l)=>{let s=await gx(e,i(...l),()=>a(...l),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function gx(e,a,i,l){let s=e[l],u;if(s){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=gx(e,a,i,l-1),u=await c,Be(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await s(d,a)}catch(m){console.error("An instrumentation function threw an error:",m)}c||await d(),await c}else try{u={type:"success",value:await i()}}catch(c){u={type:"error",value:c}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function m0(e){let{request:a,context:i,params:l,pattern:s}=e;return{request:B3(a),params:{...l},pattern:s,context:U3(i)}}function p0(e,a){return{currentUrl:xa(e.state.location),..."formMethod"in a?{formMethod:a.formMethod}:{},..."formEncType"in a?{formEncType:a.formEncType}:{},..."formData"in a?{formData:a.formData}:{},..."body"in a?{body:a.body}:{}}}function B3(e){return{method:e.method,url:e.url,headers:{get:(...a)=>e.headers.get(...a)}}}function U3(e){if($3(e)){let a={...e};return Object.freeze(a),a}else return{get:a=>e.get(a)}}var H3=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function $3(e){if(e===null||typeof e!="object")return!1;const a=Object.getPrototypeOf(e);return a===Object.prototype||a===null||Object.getOwnPropertyNames(a).sort().join("\0")===H3}var vx=["POST","PUT","PATCH","DELETE"],Z3=new Set(vx),q3=["GET",...vx],P3=new Set(q3),bx=new Set([301,302,303,307,308]),Q3=new Set([307,308]),Hd={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},F3={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},mo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Y3=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),xx="remix-router-transitions",Sx=Symbol("ResetLoaderData"),ai,al,zr,rl,G3=class{constructor(e){xo(this,ai),xo(this,al),xo(this,zr),xo(this,rl),ga(this,ai,e),ga(this,al,Cu(e))}get stableRoutes(){return Yn(this,ai)}get activeRoutes(){return Yn(this,zr)??Yn(this,ai)}get branches(){return Yn(this,rl)??Yn(this,al)}get hasHMRRoutes(){return Yn(this,zr)!=null}setRoutes(e){ga(this,ai,e),ga(this,al,Cu(e))}setHmrRoutes(e){ga(this,zr,e),ga(this,rl,Cu(e))}commitHmrRoutes(){Yn(this,zr)&&(ga(this,ai,Yn(this,zr)),ga(this,al,Yn(this,rl)),ga(this,zr,void 0),ga(this,rl,void 0))}};ai=new WeakMap;al=new WeakMap;zr=new WeakMap;rl=new WeakMap;function K3(e){const a=e.window?e.window:typeof window<"u"?window:void 0,i=typeof a<"u"&&typeof a.document<"u"&&typeof a.document.createElement<"u";Be(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let l=e.hydrationRouteProperties||[],s=e.mapRouteProperties||Y3,u=s;if(e.instrumentations){let z=e.instrumentations;u=L=>({...s(L),...D3(z.map(q=>q.route).filter(Boolean),L)})}let c={},d=new G3(Do(e.routes,u,void 0,c)),m=e.basename)DELIM" +R"DELIM(||"/";m.startsWith("/")||(m=`/${m}`);let p=e.dataStrategy||W3,b={...e.future},v=null,x=new Set,w=null,E=null,R=null,C=null,Y=e.hydrationData!=null,V=sa(d.activeRoutes,e.history.location,m,!1,d.branches),I=!1,oe=null,re,xe;if(V==null&&!e.patchRoutesOnNavigation){let z=Gn(404,{pathname:e.history.location.pathname}),{matches:L,route:q}=xu(d.activeRoutes);re=!0,xe=!re,V=L,oe={[q.id]:z}}else if(V&&!e.hydrationData&&Ja(V,d.activeRoutes,e.history.location.pathname).active&&(V=null),V)if(V.some(z=>z.route.lazy))re=!1,xe=!re;else if(!V.some(z=>Xh(z.route)))re=!0,xe=!re;else{let z=e.hydrationData?e.hydrationData.loaderData:null,L=e.hydrationData?e.hydrationData.errors:null,q=V;if(L){let ie=V.findIndex(se=>L[se.route.id]!==void 0);q=q.slice(0,ie+1)}xe=!1,re=!0,q.forEach(ie=>{let se=wx(ie.route,z,L);xe=xe||se.renderFallback,re=re&&!se.shouldLoad})}else{re=!1,xe=!re,V=[];let z=Ja(null,d.activeRoutes,e.history.location.pathname);z.active&&z.matches&&(I=!0,V=z.matches)}let N,_={historyAction:e.history.action,location:e.history.location,matches:V,initialized:re,renderFallback:xe,navigation:Hd,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||oe,fetchers:new Map,blockers:new Map},D="POP",B=null,Q=!1,P,ne=!1,ue=new Map,pe=null,M=!1,O=!1,le=new Set,ce=new Map,Se=0,j=-1,K=new Map,ae=new Set,de=new Map,te=new Map,ye=new Set,Ce=new Map,wt,H=null;function fe(){if(v=e.history.listen(({action:z,location:L,delta:q})=>{if(wt){wt(),wt=void 0;return}Rt(Ce.size===0||q!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ie=Hr({currentLocation:_.location,nextLocation:L,historyAction:z});if(ie&&q!=null){let se=new Promise(we=>{wt=we});e.history.go(q*-1),Ta(ie,{state:"blocked",location:L,proceed(){Ta(ie,{state:"proceeding",proceed:void 0,reset:void 0,location:L}),se.then(()=>e.history.go(q))},reset(){let we=new Map(_.blockers);we.set(ie,mo),me({blockers:we})}}),B?.resolve(),B=null;return}return qe(z,L)}),i){vA(a,ue);let z=()=>bA(a,ue);a.addEventListener("pagehide",z),pe=()=>a.removeEventListener("pagehide",z)}return _.initialized||qe("POP",_.location,{initialHydration:!0}),N}function he(){v&&v(),pe&&pe(),x.clear(),P&&P.abort(),_.fetchers.forEach((z,L)=>Ea(_.fetchers,L)),_.blockers.forEach((z,L)=>Ur(L))}function Ee(z){if(x.add(z),w){let{newErrors:L}=w;w=null,z(_,{deletedFetchers:[],newErrors:L,viewTransitionOpts:void 0,flushSync:!1})}return()=>x.delete(z)}function me(z,L={}){z.matches&&(z.matches=z.matches.map(se=>{let we=c[se.route.id],ge=se.route;return ge.element!==we.element||ge.errorElement!==we.errorElement||ge.hydrateFallbackElement!==we.hydrateFallbackElement?{...se,route:we}:se})),_={..._,...z};let q=[],ie=[];_.fetchers.forEach((se,we)=>{se.state==="idle"&&(ye.has(we)?q.push(we):ie.push(we))}),ye.forEach(se=>{!_.fetchers.has(se)&&!ce.has(se)&&q.push(se)}),x.size===0&&(w={newErrors:z.errors??null}),[...x].forEach(se=>se(_,{deletedFetchers:q,newErrors:z.errors??null,viewTransitionOpts:L.viewTransitionOpts,flushSync:L.flushSync===!0})),q.forEach(se=>Ea(_.fetchers,se)),ie.forEach(se=>_.fetchers.delete(se))}function Ae(z,L,{flushSync:q}={}){let ie=_.actionData!=null&&_.navigation.formMethod!=null&&tn(_.navigation.formMethod)&&_.navigation.state==="loading"&&z.state?._isRedirect!==!0,se;L.actionData?Object.keys(L.actionData).length>0?se=L.actionData:se=null:ie?se=_.actionData:se=null;let we=L.loaderData?T0(_.loaderData,L.loaderData,L.matches||[],L.errors):_.loaderData,ge=_.blockers;ge.size>0&&(ge=new Map(ge),ge.forEach((je,Ue)=>ge.set(Ue,mo)));let be=M?!1:bl(z,L.matches||_.matches),ve=Q===!0||_.navigation.formMethod!=null&&tn(_.navigation.formMethod)&&z.state?._isRedirect!==!0;d.commitHmrRoutes(),M||D==="POP"||(D==="PUSH"?e.history.push(z,z.state):D==="REPLACE"&&e.history.replace(z,z.state));let ze;if(D==="POP"){let je=ue.get(_.location.pathname);je&&je.has(z.pathname)?ze={currentLocation:_.location,nextLocation:z}:ue.has(z.pathname)&&(ze={currentLocation:z,nextLocation:_.location})}else if(ne){let je=ue.get(_.location.pathname);je?je.add(z.pathname):(je=new Set([z.pathname]),ue.set(_.location.pathname,je)),ze={currentLocation:_.location,nextLocation:z}}me({...L,actionData:se,loaderData:we,historyAction:D,location:z,initialized:!0,renderFallback:!1,navigation:Hd,revalidation:"idle",restoreScrollPosition:be,preventScrollReset:ve,blockers:ge},{viewTransitionOpts:ze,flushSync:q===!0}),D="POP",Q=!1,ne=!1,M=!1,O=!1,B?.resolve(),B=null,H?.resolve(),H=null}async function Je(z,L){if(B?.resolve(),B=null,typeof z=="number"){B||(B=j0());let tt=B.promise;return e.history.go(z),tt}let q=yh(_.location,_.matches,m,z,L?.fromRouteId,L?.relative),{path:ie,submission:se,error:we}=y0(!1,q,L),ge;L?.mask&&(ge={pathname:"",search:"",hash:"",...typeof L.mask=="string"?Sa(L.mask):{..._.location.mask,...L.mask}});let be=_.location,ve=ko(be,ie,L&&L.state,void 0,ge);ve={...ve,...e.history.encodeLocation(ve)};let ze=L&&L.replace!=null?L.replace:void 0,je="PUSH";ze===!0?je="REPLACE":ze===!1||se!=null&&tn(se.formMethod)&&se.formAction===_.location.pathname+_.location.search&&(je="REPLACE");let Ue=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,Oe=(L&&L.flushSync)===!0,Ze=Hr({currentLocation:be,nextLocation:ve,historyAction:je});if(Ze){Ta(Ze,{state:"blocked",location:ve,proceed(){Ta(Ze,{state:"proceeding",proceed:void 0,reset:void 0,location:ve}),Je(z,L)},reset(){let tt=new Map(_.blockers);tt.set(Ze,mo),me({blockers:tt})}});return}await qe(je,ve,{submission:se,pendingError:we,preventScrollReset:Ue,replace:L&&L.replace,enableViewTransition:L&&L.viewTransition,flushSync:Oe,callSiteDefaultShouldRevalidate:L&&L.defaultShouldRevalidate})}function ke(){H||(H=j0()),Dn(),me({revalidation:"loading"});let z=H.promise;return _.navigation.state==="submitting"?z:_.navigation.state==="idle"?(qe(_.historyAction,_.location,{startUninterruptedRevalidation:!0}),z):(qe(D||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:ne===!0}),z)}async function qe(z,L,q){P&&P.abort(),P=null,D=z,M=(q&&q.startUninterruptedRevalidation)===!0,dc(_.location,_.matches),Q=(q&&q.preventScrollReset)===!0,ne=(q&&q.enableViewTransition)===!0;let ie=d.activeRoutes,se=q?.initialHydration&&_.matches&&_.matches.length>0&&!I?_.matches:sa(ie,L,m,!1,d.branches),we=(q&&q.flushSync)===!0;if(se&&_.initialized&&!O&&sA(_.location,L)&&!(q&&q.submission&&tn(q.submission.formMethod))){Ae(L,{matches:se},{flushSync:we});return}let ge=Ja(se,ie,L.pathname);if(ge.active&&ge.matches&&(se=ge.matches),!se){let{error:it,notFoundMatches:We,route:At}=ea(L.pathname);Ae(L,{matches:We,loaderData:{},errors:{[At.id]:it}},{flushSync:we});return}let be=q&&q.overrideNavigation?{...q.overrideNavigation,matches:se,historyAction:z}:void 0;P=new AbortController;let ve=il(e.history,L,P.signal,q&&q.submission),ze=e.getContext?await e.getContext():new c0,je;if(q&&q.pendingError)je=[Cr(se).route.id,{type:"error",error:q.pendingError}];else if(q&&q.submission&&tn(q.submission.formMethod)){let it=await Fe(ve,L,q.submission,se,z,ze,ge.active,q&&q.initialHydration===!0,{replace:q.replace,flushSync:we});if(it.shortCircuited)return;if(it.pendingActionResult){let[We,At]=it.pendingActionResult;if(Cn(At)&&Lo(At.error)&&At.error.status===404){P=null,Ae(L,{matches:it.matches,loaderData:{},errors:{[We]:At.error}});return}}se=it.matches||se,je=it.pendingActionResult,be=$d(L,se,z,q.submission),we=!1,ge.active=!1,ve=il(e.history,ve.url,ve.signal)}let{shortCircuited:Ue,matches:Oe,loaderData:Ze,error)DELIM" +R"DELIM(s:tt,workingFetchers:yt}=await Xe(ve,L,se,z,ze,ge.active,be,q&&q.submission,q&&q.fetcherSubmission,q&&q.replace,q&&q.initialHydration===!0,we,je,q&&q.callSiteDefaultShouldRevalidate);Ue||(P=null,Ae(L,{matches:Oe||se,...R0(je),loaderData:Ze,errors:tt,...yt?{fetchers:yt}:{}}))}async function Fe(z,L,q,ie,se,we,ge,be,ve={}){Dn();let ze=yA(L,ie,se,q);if(me({navigation:ze},{flushSync:ve.flushSync===!0}),ge){let Oe=await fa(ie,L.pathname,z.signal);if(Oe.type==="aborted")return{shortCircuited:!0};if(Oe.type==="error"){if(Oe.partialMatches.length===0){let{matches:tt,route:yt}=xu(d.activeRoutes);return{matches:tt,pendingActionResult:[yt.id,{type:"error",error:Oe.error}]}}let Ze=Cr(Oe.partialMatches).route.id;return{matches:Oe.partialMatches,pendingActionResult:[Ze,{type:"error",error:Oe.error}]}}else if(Oe.matches)ie=Oe.matches;else{let{notFoundMatches:Ze,error:tt,route:yt}=ea(L.pathname);return{matches:Ze,pendingActionResult:[yt.id,{type:"error",error:tt}]}}}let je,Ue=Mu(ie,L);if(!Ue.route.action&&!Ue.route.lazy)je={type:"error",error:Gn(405,{method:z.method,pathname:L.pathname,routeId:Ue.route.id})};else{let Oe=fl(u,c,z,L,ie,Ue,be?[]:l,we),Ze=await cn(z,L,Oe,we,null);if(je=Ze[Ue.route.id],!je){for(let tt of ie)if(Ze[tt.route.id]){je=Ze[tt.route.id];break}}if(z.signal.aborted)return{shortCircuited:!0}}if(li(je)){let Oe;return ve&&ve.replace!=null?Oe=ve.replace:Oe=w0(je.response.headers.get("Location"),new URL(z.url),m,e.history)===_.location.pathname+_.location.search,await Wn(z,je,!0,{submission:q,replace:Oe}),{shortCircuited:!0}}if(Cn(je)){let Oe=Cr(ie,Ue.route.id);return(ve&&ve.replace)!==!0&&(D="PUSH"),{matches:ie,pendingActionResult:[Oe.route.id,je,Ue.route.id]}}return{matches:ie,pendingActionResult:[Ue.route.id,je]}}async function Xe(z,L,q,ie,se,we,ge,be,ve,ze,je,Ue,Oe,Ze){let tt=ge||$d(L,q,ie,be),yt=be||ve||z0(tt),it=!M&&!je;if(we){if(it){let ht=pt(Oe);me({navigation:tt,...ht!==void 0?{actionData:ht}:{}},{flushSync:Ue})}let De=await fa(q,L.pathname,z.signal);if(De.type==="aborted")return{shortCircuited:!0};if(De.type==="error"){if(De.partialMatches.length===0){let{matches:wn,route:aa}=xu(d.activeRoutes);return{matches:wn,loaderData:{},errors:{[aa.id]:De.error}}}let ht=Cr(De.partialMatches).route.id;return{matches:De.partialMatches,loaderData:{},errors:{[ht]:De.error}}}else if(De.matches)q=De.matches;else{let{error:ht,notFoundMatches:wn,route:aa}=ea(L.pathname);return{matches:wn,loaderData:{},errors:{[aa.id]:ht}}}}let We=d.activeRoutes,{dsMatches:At,revalidatingFetchers:et}=g0(z,se,u,c,e.history,_,q,yt,L,je?[]:l,je===!0,O,le,ye,de,ae,We,m,e.patchRoutesOnNavigation!=null,d.branches,Oe,Ze);if(j=++Se,!e.dataStrategy&&!At.some(De=>De.shouldLoad)&&!At.some(De=>De.route.middleware&&De.route.middleware.length>0)&&et.length===0){let De=new Map(_.fetchers),ht=Jo(De);return Ae(L,{matches:q,loaderData:{},errors:Oe&&Cn(Oe[1])?{[Oe[0]]:Oe[1].error}:null,...R0(Oe),...ht?{fetchers:De}:{}},{flushSync:Ue}),{shortCircuited:!0}}if(it){let De={};if(!we){De.navigation=tt;let ht=pt(Oe);ht!==void 0&&(De.actionData=ht)}et.length>0&&(De.fetchers=It(et)),me(De,{flushSync:Ue})}et.forEach(De=>{$t(De.key),De.controller&&ce.set(De.key,De.controller)});let Wa=()=>et.forEach(De=>$t(De.key));P&&P.signal.addEventListener("abort",Wa);let{loaderResults:ta,fetcherResults:fn}=await _a(At,et,z,L,se);if(z.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener("abort",Wa),et.forEach(De=>ce.delete(De.key));let an=Su(ta);if(an)return await Wn(z,an.result,!0,{replace:ze}),{shortCircuited:!0};if(an=Su(fn),an)return ae.add(an.key),await Wn(z,an.result,!0,{replace:ze}),{shortCircuited:!0};let Bn=new Map(_.fetchers),{loaderData:yi,errors:na}=E0(_,q,ta,Oe,et,fn,Bn);je&&_.errors&&(na={..._.errors,...na});let gi=Jo(Bn),Ra=Wo(j,Bn),Aa=gi||Ra||et.length>0;return{matches:q,loaderData:yi,errors:na,...Aa?{workingFetchers:Bn}:{}}}function pt(z){if(z&&!Cn(z[1]))return{[z[0]]:z[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function It(z){let L=new Map(_.fetchers);return z.forEach(q=>{let ie=L.get(q.key),se=po(void 0,ie?ie.data:void 0);L.set(q.key,se)}),L}async function xn(z,L,q,ie){$t(z);let se=(ie&&ie.flushSync)===!0,we=d.activeRoutes,ge=yh(_.location,_.matches,m,q,L,ie?.relative),be=sa(we,ge,m,!1,d.branches),ve=Ja(be,we,ge);if(ve.active&&ve.matches&&(be=ve.matches),!be){Ln(z,L,Gn(404,{pathname:ge}),{flushSync:se});return}let{path:ze,submission:je,error:Ue}=y0(!0,ge,ie);if(Ue){Ln(z,L,Ue,{flushSync:se});return}let Oe=e.getContext?await e.getContext():new c0,Ze=(ie&&ie.preventScrollReset)===!0;if(je&&tn(je.formMethod)){await Xa(z,L,ze,be,Oe,ve.active,se,Ze,je,ie&&ie.defaultShouldRevalidate);return}de.set(z,{routeId:L,path:ze}),await qt(z,L,ze,be,Oe,ve.active,se,Ze,je)}async function Xa(z,L,q,ie,se,we,ge,be,ve,ze){Dn(),de.delete(z);let je=_.fetchers.get(z);Sn(z,gA(ve,je),{flushSync:ge});let Ue=new AbortController,Oe=il(e.history,q,Ue.signal,ve);if(we){let lt=await fa(ie,new URL(Oe.url).pathname,Oe.signal,z);if(lt.type==="aborted")return;if(lt.type==="error"){Ln(z,L,lt.error,{flushSync:ge});return}else if(lt.matches)ie=lt.matches;else{Ln(z,L,Gn(404,{pathname:q}),{flushSync:ge});return}}let Ze=Mu(ie,q);if(!Ze.route.action&&!Ze.route.lazy){let lt=Gn(405,{method:ve.formMethod,pathname:q,routeId:L});Ln(z,L,lt,{flushSync:ge});return}ce.set(z,Ue);let tt=Se,yt=fl(u,c,Oe,q,ie,Ze,l,se),it=await cn(Oe,q,yt,se,z),We=it[Ze.route.id];if(!We){for(let lt of yt)if(it[lt.route.id]){We=it[lt.route.id];break}}if(Oe.signal.aborted){ce.get(z)===Ue&&ce.delete(z);return}if(ye.has(z)){if(li(We)||Cn(We)){Sn(z,ba(void 0));return}}else{if(li(We))if(ce.delete(z),j>tt){Sn(z,ba(void 0));return}else return ae.add(z),Sn(z,po(ve)),Wn(Oe,We,!1,{fetcherSubmission:ve,preventScrollReset:be});if(Cn(We)){Ln(z,L,We.error);return}}let At=_.navigation.location||_.location,et=il(e.history,At,Ue.signal),Wa=d.activeRoutes,ta=_.navigation.state!=="idle"?sa(Wa,_.navigation.location,m,!1,d.branches):_.matches;Be(ta,"Didn't find any matches after fetcher action");let fn=++Se;K.set(z,fn);let{dsMatches:an,revalidatingFetchers:Bn}=g0(et,se,u,c,e.history,_,ta,ve,At,l,!1,O,le,ye,de,ae,Wa,m,e.patchRoutesOnNavigation!=null,d.branches,[Ze.route.id,We],ze),yi=po(ve,We.data),na=new Map(_.fetchers);na.set(z,yi),Bn.filter(lt=>lt.key!==z).forEach(lt=>{let za=lt.key,rn=na.get(za),xl=po(void 0,rn?rn.data:void 0);na.set(za,xl),$t(za),lt.controller&&ce.set(za,lt.controller)}),me({fetchers:na});let gi=()=>Bn.forEach(lt=>$t(lt.key));Ue.signal.addEventListener("abort",gi);let{loaderResults:Ra,fetcherResults:Aa}=await _a(an,Bn,et,At,se);if(Ue.signal.aborted)return;Ue.signal.removeEventListener("abort",gi),K.delete(z),ce.delete(z),Bn.forEach(lt=>ce.delete(lt.key));let De=_.fetchers.has(z),ht=lt=>{if(!De)return lt;let za=new Map(lt.fetchers);return za.set(z,ba(We.data)),{...lt,fetchers:za}},wn=Su(Ra);if(wn)return _=ht(_),Wn(et,wn.result,!1,{preventScrollReset:be});if(wn=Su(Aa),wn)return ae.add(wn.key),_=ht(_),Wn(et,wn.result,!1,{preventScrollReset:be});let aa=new Map(_.fetchers);De&&aa.set(z,ba(We.data));let{loaderData:vi,errors:bi}=E0(_,ta,Ra,void 0,Bn,Aa,aa);Wo(fn,aa),_.navigation.state==="loading"&&fn>j?(Be(D,"Expected pending action"),P&&P.abort(),Ae(_.navigation.location,{matches:ta,loaderData:vi,errors:bi,fetchers:aa})):(me({errors:bi,loaderData:T0(_.loaderData,vi,ta,bi),fetchers:aa}),O=!1)}async function qt(z,L,q,ie,se,we,ge,be,ve){let ze=_.fetchers.get(z);Sn(z,po(ve,ze?ze.data:void 0),{flushSync:ge});let je=new AbortController,Ue=il(e.history,q,je.signal);if(we){let We=await fa(ie,new URL(Ue.url).pathname,Ue.signal,z);if(We.type==="aborted")return;if(We.type==="error"){Ln(z,L,We.error,{flushSync:ge});return}else if(We.matches)ie=We.matches;else{Ln(z,L,Gn(404,{pathname:q}),{flushSync:ge});return}}let Oe=Mu(ie,q);ce.set(z,je);let Ze=Se,tt=fl(u,c,Ue,q,ie,Oe,l,se),yt=await cn(Ue,q,tt,se,z),it=yt[Oe.route.id];if(!it){for(let We of ie)if(yt[We.route.id]){it=yt[We.route.id];break}}if(ce.get(z)===je&&ce.delete(z),!Ue.signal.)DELIM" +R"DELIM(aborted){if(ye.has(z)){Sn(z,ba(void 0));return}if(li(it))if(j>Ze){Sn(z,ba(void 0));return}else{ae.add(z),await Wn(Ue,it,!1,{preventScrollReset:be});return}if(Cn(it)){Ln(z,L,it.error);return}Sn(z,ba(it.data))}}async function Wn(z,L,q,{submission:ie,fetcherSubmission:se,preventScrollReset:we,replace:ge}={}){q||(B?.resolve(),B=null),L.response.headers.has("X-Remix-Revalidate")&&(O=!0);let be=L.response.headers.get("Location");Be(be,"Expected a Location header on the redirect Response"),be=w0(be,new URL(z.url),m,e.history);let ve=ko(_.location,be,{_isRedirect:!0});if(i){let tt=!1;if(L.response.headers.has("X-Remix-Reload-Document"))tt=!0;else if(Kh(be)){const yt=sx(a,be,!0);tt=yt.origin!==a.location.origin||Xn(yt.pathname,m)==null}if(tt){ge?a.location.replace(be):a.location.assign(be);return}}P=null;let ze=ge===!0||L.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:je,formAction:Ue,formEncType:Oe}=_.navigation;!ie&&!se&&je&&Ue&&Oe&&(ie=z0(_.navigation));let Ze=ie||se;if(Q3.has(L.response.status)&&Ze&&tn(Ze.formMethod))await qe(ze,ve,{submission:{...Ze,formAction:be},preventScrollReset:we||Q,enableViewTransition:q?ne:void 0});else{let tt=$d(ve,[],ze,ie);await qe(ze,ve,{overrideNavigation:tt,fetcherSubmission:se,preventScrollReset:we||Q,enableViewTransition:q?ne:void 0})}}async function cn(z,L,q,ie,se){let we,ge={};try{we=await tA(p,z,L,q,se,ie,!1)}catch(be){return q.filter(ve=>ve.shouldLoad).forEach(ve=>{ge[ve.route.id]={type:"error",error:be}}),ge}if(z.signal.aborted)return ge;if(!tn(z.method))for(let be of q){if(we[be.route.id]?.type==="error")break;!we.hasOwnProperty(be.route.id)&&!_.loaderData.hasOwnProperty(be.route.id)&&(!_.errors||!_.errors.hasOwnProperty(be.route.id))&&be.shouldCallHandler()&&(we[be.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${be.route.id}`)})}for(let[be,ve]of Object.entries(we))if(dA(ve)){let ze=ve.result;ge[be]={type:"redirect",response:iA(ze,z,be,q,m)}}else ge[be]=await rA(ve);return ge}async function _a(z,L,q,ie,se){let we=cn(q,ie,z,se,null),ge=Promise.all(L.map(async ze=>{if(ze.matches&&ze.match&&ze.request&&ze.controller){let Ue=(await cn(ze.request,ze.path,ze.matches,se,ze.key))[ze.match.route.id];return{[ze.key]:Ue}}else return Promise.resolve({[ze.key]:{type:"error",error:Gn(404,{pathname:ze.path})}})})),be=await we,ve=(await ge).reduce((ze,je)=>Object.assign(ze,je),{});return{loaderResults:be,fetcherResults:ve}}function Dn(){O=!0,de.forEach((z,L)=>{ce.has(L)&&le.add(L),$t(L)})}function Sn(z,L,q={}){let ie=new Map(_.fetchers);ie.set(z,L),me({fetchers:ie},{flushSync:(q&&q.flushSync)===!0})}function Ln(z,L,q,ie={}){let se=Cr(_.matches,L),we=new Map(_.fetchers);Ea(we,z),me({errors:{[se.route.id]:q},fetchers:we},{flushSync:(ie&&ie.flushSync)===!0})}function uc(z){return te.set(z,(te.get(z)||0)+1),ye.has(z)&&ye.delete(z),_.fetchers.get(z)||F3}function cc(z,L){$t(z,L?.reason),Sn(z,ba(null))}function Ea(z,L){let q=_.fetchers.get(L);ce.has(L)&&!(q&&q.state==="loading"&&K.has(L))&&$t(L),de.delete(L),K.delete(L),ae.delete(L),ye.delete(L),le.delete(L),z.delete(L)}function nn(z){let L=(te.get(z)||0)-1;L<=0?(te.delete(z),ye.add(z)):te.set(z,L),me({fetchers:new Map(_.fetchers)})}function $t(z,L){let q=ce.get(z);q&&(q.abort(L),ce.delete(z))}function Jt(z,L){for(let q of z){let ie=L.get(q);Be(ie,`Expected fetcher: ${q}`);let se=ba(ie.data);L.set(q,se)}}function Jo(z){let L=[],q=!1;for(let ie of ae){let se=z.get(ie);Be(se,`Expected fetcher: ${ie}`),se.state==="loading"&&(ae.delete(ie),L.push(ie),q=!0)}return Jt(L,z),q}function Wo(z,L){let q=[];for(let[ie,se]of K)if(se0}function fc(z,L){let q=_.blockers.get(z)||mo;return Ce.get(z)!==L&&Ce.set(z,L),q}function Ur(z){_.blockers.delete(z),Ce.delete(z)}function Ta(z,L){let q=_.blockers.get(z)||mo;Be(q.state==="unblocked"&&L.state==="blocked"||q.state==="blocked"&&L.state==="blocked"||q.state==="blocked"&&L.state==="proceeding"||q.state==="blocked"&&L.state==="unblocked"||q.state==="proceeding"&&L.state==="unblocked",`Invalid blocker state transition: ${q.state} -> ${L.state}`);let ie=new Map(_.blockers);ie.set(z,L),me({blockers:ie})}function Hr({currentLocation:z,nextLocation:L,historyAction:q}){if(Ce.size===0)return;Ce.size>1&&Rt(!1,"A router only supports one blocker at a time");let ie=Array.from(Ce.entries()),[se,we]=ie[ie.length-1],ge=_.blockers.get(se);if(!(ge&&ge.state==="proceeding")&&we({currentLocation:z,nextLocation:L,historyAction:q}))return se}function ea(z){let L=Gn(404,{pathname:z}),q=d.activeRoutes,{matches:ie,route:se}=xu(q);return{notFoundMatches:ie,route:se,error:L}}function pi(z,L,q){if(E=z,C=L,R=q||null,!Y&&_.navigation===Hd){Y=!0;let ie=bl(_.location,_.matches);ie!=null&&me({restoreScrollPosition:ie})}return()=>{E=null,C=null,R=null}}function Ia(z,L){return R&&R(z,L.map(ie=>g3(ie,_.loaderData)))||z.key}function dc(z,L){if(E&&C){let q=Ia(z,L);E[q]=C()}}function bl(z,L){if(E){let q=Ia(z,L),ie=E[q];if(typeof ie=="number")return ie}return null}function Ja(z,L,q){if(e.patchRoutesOnNavigation){let ie=d.branches;if(z){if(Object.keys(z[0].params).length>0)return{active:!0,matches:sa(L,q,m,!0,ie)}}else return{active:!0,matches:sa(L,q,m,!0,ie)||[]}}return{active:!1,matches:null}}async function fa(z,L,q,ie){if(!e.patchRoutesOnNavigation)return{type:"success",matches:z};let se=z;for(;;){let we=c;try{await e.patchRoutesOnNavigation({signal:q,path:L,matches:se,fetcherKey:ie,patch:(ze,je)=>{q.aborted||v0(ze,je,d,we,u,!1)}})}catch(ze){return{type:"error",error:ze,partialMatches:se}}if(q.aborted)return{type:"aborted"};let ge=d.branches,be=sa(d.activeRoutes,L,m,!1,ge),ve=null;if(be){if(Object.keys(be[0].params).length===0)return{type:"success",matches:be};if(ve=sa(d.activeRoutes,L,m,!0,ge),!(ve&&se.lengthq.route.id===L[ie].route.id)}function ts(z){c={},d.setHmrRoutes(Do(z,u,void 0,c))}function ns(z,L,q=!1){v0(z,L,d,c,u,q),d.hasHMRRoutes||me({})}return N={get basename(){return m},get future(){return b},get state(){return _},get routes(){return d.stableRoutes},get branches(){return d.branches},get manifest(){return c},get window(){return a},initialize:fe,subscribe:Ee,enableScrollRestoration:pi,navigate:Je,fetch:xn,revalidate:ke,createHref:z=>e.history.createHref(z),encodeLocation:z=>e.history.encodeLocation(z),getFetcher:uc,resetFetcher:cc,deleteFetcher:nn,dispose:he,getBlocker:fc,deleteBlocker:Ur,patchRoutes:ns,_internalFetchControllers:ce,_internalSetRoutes:ts,_internalSetStateDoNotUseOrYouWillBreakYourApp(z){me(z)}},e.instrumentations&&(N=L3(N,e.instrumentations.map(z=>z.router).filter(Boolean))),N}function V3(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function yh(e,a,i,l,s,u){let c,d;if(s){c=[];for(let p of a)if(c.push(p),p.route.id===s){d=p;break}}else c=a,d=a[a.length-1];let m=Fo(l||".",rc(c),Xn(e.pathname,i)||e.pathname,u==="path");if(l==null&&(m.search=e.search,m.hash=e.hash),(l==null||l===""||l===".")&&d){let p=Jh(m.search);if(d.route.index&&!p)m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&p){let b=new URLSearchParams(m.search),v=b.getAll("index");b.delete("index"),v.filter(w=>w).forEach(w=>b.append("index",w));let x=b.toString();m.search=x?`?${x}`:""}}return i!=="/"&&(m.pathname=j3({basename:i,pathname:m.pathname})),xa(m)}function y0(e,a,i){if(!i||!V3(i))return{path:a};if(i.formMethod&&!pA(i.formMethod))return{path:a,error:Gn(405,{method:i.formMethod})};let l=()=>({path:a,error:Gn(400,{type:"invalid-body"})}),u=(i.formMethod||"get").toUpperCase(),c=jx(a);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!tn(u))return l();let v=typeof i.body=="string"?i.body:i.body instanc)DELIM" +R"DELIM(eof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((x,[w,E])=>`${x}${w}=${E} +`,""):String(i.body);return{path:a,submission:{formMethod:u,formAction:c,formEncType:i.formEncType,formData:void 0,json:void 0,text:v}}}else if(i.formEncType==="application/json"){if(!tn(u))return l();try{let v=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:a,submission:{formMethod:u,formAction:c,formEncType:i.formEncType,formData:void 0,json:v,text:void 0}}}catch{return l()}}}Be(typeof FormData=="function","FormData is not available in this environment");let d,m;if(i.formData)d=bh(i.formData),m=i.formData;else if(i.body instanceof FormData)d=bh(i.body),m=i.body;else if(i.body instanceof URLSearchParams)d=i.body,m=_0(d);else if(i.body==null)d=new URLSearchParams,m=new FormData;else try{d=new URLSearchParams(i.body),m=_0(d)}catch{return l()}let p={formMethod:u,formAction:c,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:m,json:void 0,text:void 0};if(tn(p.formMethod))return{path:a,submission:p};let b=Sa(a);return e&&b.search&&Jh(b.search)&&d.append("index",""),b.search=`?${d}`,{path:xa(b),submission:p}}function g0(e,a,i,l,s,u,c,d,m,p,b,v,x,w,E,R,C,Y,V,I,oe,re){let xe=oe?Cn(oe[1])?oe[1].error:oe[1].data:void 0,N=s.createURL(u.location),_=s.createURL(m),D;if(b&&u.errors){let M=Object.keys(u.errors)[0];D=c.findIndex(O=>O.route.id===M)}else if(oe&&Cn(oe[1])){let M=oe[0];D=c.findIndex(O=>O.route.id===M)-1}let B=oe?oe[1].statusCode:void 0,Q=B&&B>=400,P={currentUrl:N,currentParams:u.matches[0]?.params||{},nextUrl:_,nextParams:c[0].params,...d,actionResult:xe,actionStatus:B},ne=Go(c),ue=c.map((M,O)=>{let{route:le}=M,ce=null;if(D!=null&&O>D)ce=!1;else if(le.lazy)ce=!0;else if(!Xh(le))ce=!1;else if(b){let{shouldLoad:ae}=wx(le,u.loaderData,u.errors);ce=ae}else X3(u.loaderData,u.matches[O],M)&&(ce=!0);if(ce!==null)return gh(i,l,e,m,ne,M,p,a,ce);let Se=!1;typeof re=="boolean"?Se=re:Q?Se=!1:(v||N.pathname+N.search===_.pathname+_.search||N.search!==_.search||I3(u.matches[O],M))&&(Se=!0);let j={...P,defaultShouldRevalidate:Se},K=Eo(M,j);return gh(i,l,e,m,ne,M,p,a,K,j,re)}),pe=[];return E.forEach((M,O)=>{if(b||!c.some(te=>te.route.id===M.routeId)||w.has(O))return;let le=u.fetchers.get(O),ce=le&&le.state!=="idle"&&le.data===void 0,Se=sa(C,M.path,Y??"/",!1,I);if(!Se){if(V&&ce)return;pe.push({key:O,routeId:M.routeId,path:M.path,matches:null,match:null,request:null,controller:null});return}if(R.has(O))return;let j=Mu(Se,M.path),K=new AbortController,ae=il(s,M.path,K.signal),de=null;if(x.has(O))x.delete(O),de=fl(i,l,ae,M.path,Se,j,p,a);else if(ce)v&&(de=fl(i,l,ae,M.path,Se,j,p,a));else{let te;typeof re=="boolean"?te=re:Q?te=!1:te=v;let ye={...P,defaultShouldRevalidate:te};Eo(j,ye)&&(de=fl(i,l,ae,M.path,Se,j,p,a,ye))}de&&pe.push({key:O,routeId:M.routeId,path:M.path,matches:de,match:j,request:ae,controller:K})}),{dsMatches:ue,revalidatingFetchers:pe}}function Xh(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function wx(e,a,i){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Xh(e))return{shouldLoad:!1,renderFallback:!1};let l=a!=null&&e.id in a,s=i!=null&&i[e.id]!==void 0;if(!l&&s)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!l};let u=!l&&!s;return{shouldLoad:u,renderFallback:u}}function X3(e,a,i){let l=!a||i.route.id!==a.route.id,s=!e.hasOwnProperty(i.route.id);return l||s}function I3(e,a){let i=e.route.path;return e.pathname!==a.pathname||i!=null&&i.endsWith("*")&&e.params["*"]!==a.params["*"]}function Eo(e,a){if(e.route.shouldRevalidate){let i=e.route.shouldRevalidate(a);if(typeof i=="boolean")return i}return a.defaultShouldRevalidate}function v0(e,a,i,l,s,u){let c;if(e){let p=l[e];Be(p,`No route found to patch children into: routeId = ${e}`),p.children||(p.children=[]),c=p.children}else c=i.activeRoutes;let d=[],m=[];if(a.forEach(p=>{let b=c.find(v=>_x(p,v));b?m.push({existingRoute:b,newRoute:p}):d.push(p)}),d.length>0){let p=Do(d,s,[e||"_","patch",String(c?.length||"0")],l);c.push(...p)}if(u&&m.length>0)for(let p=0;pa.children?.some(s=>_x(i,s)))??!1:!1}var b0=new WeakMap,Ex=({key:e,route:a,manifest:i,mapRouteProperties:l})=>{let s=i[a.id];if(Be(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let u=s.lazy[e];if(!u)return;let c=b0.get(s);c||(c={},b0.set(s,c));let d=c[e];if(d)return d;let m=(async()=>{let p=h3(e),v=s[e]!==void 0&&e!=="hasErrorBoundary";if(p)Rt(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(v)Rt(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await u();x!=null&&(Object.assign(s,{[e]:x}),Object.assign(s,l(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(x=>x===void 0)&&(s.lazy=void 0))})();return c[e]=m,m},x0=new WeakMap;function J3(e,a,i,l,s){let u=i[e.id];if(Be(u,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let b=x0.get(u);if(b)return{lazyRoutePromise:b,lazyHandlerPromise:b};let v=(async()=>{Be(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),w={};for(let E in x){let R=x[E];if(R===void 0)continue;let C=p3(E),V=u[E]!==void 0&&E!=="hasErrorBoundary";C?Rt(!C,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):V?Rt(!V,`Route "${u.id}" has a static property "${E}" defined but its lazy function is also returning a value for this property. The lazy route property "${E}" will be ignored.`):w[E]=R}Object.assign(u,w),Object.assign(u,{...l(u),lazy:void 0})})();return x0.set(u,v),v.catch(()=>{}),{lazyRoutePromise:v,lazyHandlerPromise:v}}let c=Object.keys(e.lazy),d=[],m;for(let b of c){if(s&&s.includes(b))continue;let v=Ex({key:b,route:e,manifest:i,mapRouteProperties:l});v&&(d.push(v),b===a&&(m=v))}let p=d.length>0?Promise.all(d).then(()=>{}):void 0;return p?.catch(()=>{}),m?.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:m}}async function S0(e){let a=e.matches.filter(s=>s.shouldLoad),i={};return(await Promise.all(a.map(s=>s.resolve()))).forEach((s,u)=>{i[a[u].route.id]=s}),i}async function W3(e){return e.matches.some(a=>a.route.middleware)?Tx(e,()=>S0(e)):S0(e)}function Tx(e,a){return eA(e,a,l=>{if(mA(l))throw l;return l},cA,i);function i(l,s,u){if(u)return Promise.resolve(Object.assign(u.value,{[s]:{type:"error",result:l}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(p=>p.route.id===s),0),Math.max(c.findIndex(p=>p.shouldCallHandler()),0)),m=Cr(c,c[d].route.id).route.id;return Promise.resolve({[m]:{type:"error",result:l}})}}}async function eA(e,a,i,l,s){let{matches:u,...c}=e,d=u.flatMap(p=>p.route.middleware?p.route.middleware.map(b=>[p.route.id,b]):[]);return await Rx(c,d,a,i,l,s)}async function Rx(e,a,i,l,s,u,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let m=a[c];if(!m)return await i();let[p,b]=m,v,x=async()=>{if(v)throw new Error("You may only call `next()` once per middleware");try{return v={value:await Rx(e,a,i,l,s,u,c+1)},v.value}catch(w){return v={value:await u(w,p,v)},v.value}};try{let w=await b(e,x),E=w!=null?l(w):void 0;return s(E)?E:v?E??v.value:(v={value:await x()},v.value)}catch(w){r)DELIM" +R"DELIM(eturn await u(w,p,v)}}function Ax(e,a,i,l,s){let u=Ex({key:"middleware",route:l.route,manifest:a,mapRouteProperties:e}),c=J3(l.route,tn(i.method)?"action":"loader",a,e,s);return{middleware:u,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function gh(e,a,i,l,s,u,c,d,m,p=null,b){let v=!1,x=Ax(e,a,i,u,c);return{...u,_lazyPromises:x,shouldLoad:m,shouldRevalidateArgs:p,shouldCallHandler(w){return v=!0,p?typeof b=="boolean"?Eo(u,{...p,defaultShouldRevalidate:b}):typeof w=="boolean"?Eo(u,{...p,defaultShouldRevalidate:w}):Eo(u,p):m},resolve(w){let{lazy:E,loader:R,middleware:C}=u.route,Y=v||m||w&&!tn(i.method)&&(E||R),V=C&&C.length>0&&!R&&!E;return Y&&(tn(i.method)||!V)?nA({request:i,path:l,pattern:s,match:u,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:w,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function fl(e,a,i,l,s,u,c,d,m=null){return s.map(p=>p.route.id!==u.route.id?{...p,shouldLoad:!1,shouldRevalidateArgs:m,shouldCallHandler:()=>!1,_lazyPromises:Ax(e,a,i,p,c),resolve:()=>Promise.resolve({type:"data",result:void 0})}:gh(e,a,i,l,Go(s),p,c,d,!0,m))}async function tA(e,a,i,l,s,u,c){l.some(b=>b._lazyPromises?.middleware)&&await Promise.all(l.map(b=>b._lazyPromises?.middleware));let d={request:a,url:zx(a,i),pattern:Go(l),params:l[0].params,context:u,matches:l},p=await e({...d,fetcherKey:s,runClientMiddleware:b=>{let v=d;return Tx(v,()=>b({...v,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(l.flatMap(b=>[b._lazyPromises?.handler,b._lazyPromises?.route]))}catch{}return p}async function nA({request:e,path:a,pattern:i,match:l,lazyHandlerPromise:s,lazyRoutePromise:u,handlerOverride:c,scopedContext:d}){let m,p,b=tn(e.method),v=b?"action":"loader",x=w=>{let E,R=new Promise((V,I)=>E=I);p=()=>E(),e.signal.addEventListener("abort",p);let C=V=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${v}" [routeId: ${l.route.id}]`)):w({request:e,url:zx(e,a),pattern:i,params:l.params,context:d},...V!==void 0?[V]:[]),Y=(async()=>{try{return{type:"data",result:await(c?c(I=>C(I)):C())}}catch(V){return{type:"error",result:V}}})();return Promise.race([Y,R])};try{let w=b?l.route.action:l.route.loader;if(s||u)if(w){let E,[R]=await Promise.all([x(w).catch(C=>{E=C}),s,u]);if(E!==void 0)throw E;m=R}else{await s;let E=b?l.route.action:l.route.loader;if(E)[m]=await Promise.all([x(E),u]);else if(v==="action"){let R=new URL(e.url),C=R.pathname+R.search;throw Gn(405,{method:e.method,pathname:C,routeId:l.route.id})}else return{type:"data",result:void 0}}else if(w)m=await x(w);else{let E=new URL(e.url),R=E.pathname+E.search;throw Gn(404,{pathname:R})}}catch(w){return{type:"error",result:w}}finally{p&&e.signal.removeEventListener("abort",p)}return m}async function aA(e){let a=e.headers.get("Content-Type");return a&&/\bapplication\/json\b/.test(a)?e.body==null?null:e.json():e.text()}async function rA(e){let{result:a,type:i}=e;if(Ih(a)){let l;try{l=await aA(a)}catch(s){return{type:"error",error:s}}return i==="error"?{type:"error",error:new Yo(a.status,a.statusText,l),statusCode:a.status,headers:a.headers}:{type:"data",data:l,statusCode:a.status,headers:a.headers}}return i==="error"?A0(a)?a.data instanceof Error?{type:"error",error:a.data,statusCode:a.init?.status,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"error",error:uA(a),statusCode:Lo(a)?a.status:void 0,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:Lo(a)?a.status:void 0}:A0(a)?{type:"data",data:a.data,statusCode:a.init?.status,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"data",data:a}}function iA(e,a,i,l,s){let u=e.headers.get("Location");if(Be(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!Kh(u)){let c=l.slice(0,l.findIndex(d=>d.route.id===i)+1);u=yh(new URL(a.url),c,s,u),e.headers.set("Location",u)}return e}var lA=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function vh(e){try{return lA.includes(new URL(e).protocol)}catch{return!1}}function w0(e,a,i,l){if(Kh(e)){let s=e,u=Gh.test(s)?new URL(ox(s,a.protocol)):new URL(s);if(vh(u.toString()))throw new Error("Invalid redirect location");let c=Xn(u.pathname,i)!=null;if(u.origin===a.origin&&c)return Vh(u.pathname)+u.search+u.hash}try{let s=l.createURL(e);if(vh(s.toString()))throw new Error("Invalid redirect location")}catch{}return e}function il(e,a,i,l){let s=e.createURL(jx(a)).toString(),u={signal:i};if(l&&tn(l.formMethod)){let{formMethod:c,formEncType:d}=l;u.method=c.toUpperCase(),d==="application/json"?(u.headers=new Headers({"Content-Type":d}),u.body=JSON.stringify(l.json)):d==="text/plain"?u.body=l.text:d==="application/x-www-form-urlencoded"&&l.formData?u.body=bh(l.formData):u.body=l.formData}return new Request(s,u)}function zx(e,a){let i=new URL(e.url),l=typeof a=="string"?Sa(a):a;if(i.pathname=l.pathname||"/",l.search){let s=new URLSearchParams(l.search),u=s.getAll("index");s.delete("index");for(let c of u.filter(Boolean))s.append("index",c);i.search=s.size?`?${s.toString()}`:""}else i.search="";return i.hash=l.hash||"",i}function bh(e){let a=new URLSearchParams;for(let[i,l]of e.entries())a.append(i,typeof l=="string"?l:l.name);return a}function _0(e){let a=new FormData;for(let[i,l]of e.entries())a.append(i,l);return a}function oA(e,a,i,l=!1,s=!1){let u={},c=null,d,m=!1,p={},b=i&&Cn(i[1])?i[1].error:void 0;return e.forEach(v=>{if(!(v.route.id in a))return;let x=v.route.id,w=a[x];if(Be(!li(w),"Cannot handle redirect results in processLoaderData"),Cn(w)){let E=w.error;if(b!==void 0&&(E=b,b=void 0),c=c||{},s)c[x]=E;else{let R=Cr(e,x);c[R.route.id]==null&&(c[R.route.id]=E)}l||(u[x]=Sx),m||(m=!0,d=Lo(w.error)?w.error.status:500),w.headers&&(p[x]=w.headers)}else u[x]=w.data,w.statusCode&&w.statusCode!==200&&!m&&(d=w.statusCode),w.headers&&(p[x]=w.headers)}),b!==void 0&&i&&(c={[i[0]]:b},i[2]&&(u[i[2]]=void 0)),{loaderData:u,errors:c,statusCode:d||200,loaderHeaders:p}}function E0(e,a,i,l,s,u,c){let{loaderData:d,errors:m}=oA(a,i,l);return s.filter(p=>!p.matches||p.matches.some(b=>b.shouldLoad)).forEach(p=>{let{key:b,match:v,controller:x}=p;if(x&&x.signal.aborted)return;let w=u[b];if(Be(w,"Did not find corresponding fetcher result"),Cn(w)){let E=Cr(e.matches,v?.route.id);m&&m[E.route.id]||(m={...m,[E.route.id]:w.error}),c.delete(b)}else if(li(w))Be(!1,"Unhandled fetcher revalidation redirect");else{let E=ba(w.data);c.set(b,E)}}),{loaderData:d,errors:m}}function T0(e,a,i,l){let s=Object.entries(a).filter(([,u])=>u!==Sx).reduce((u,[c,d])=>(u[c]=d,u),{});for(let u of i){let c=u.route.id;if(!a.hasOwnProperty(c)&&e.hasOwnProperty(c)&&u.route.loader&&(s[c]=e[c]),l&&l.hasOwnProperty(c))break}return s}function R0(e){return e?Cn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Cr(e,a){return(a?e.slice(0,e.findIndex(l=>l.route.id===a)+1):[...e]).reverse().find(l=>l.route.hasErrorBoundary===!0)||e[0]}function xu(e){let a=e.length===1?e[0]:e.find(i=>i.index||!i.path||i.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:a}],route:a}}function Gn(e,{pathname:a,routeId:i,method:l,type:s,message:u}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",l&&a&&i?d=`You made a ${l} request to "${a}" but did not provide a \`loader\` for route "${i}", so there is no way to handle the request.`:s==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${i}" does not match URL "${a}"`):e===404?(c="Not Found",d=`No route matches URL "${a}"`):e===405&&(c="Method Not Allowed",l&&a&&i?d=`You made a ${l.toUpperCase()} request to "${a}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:l&&(d=`Invalid request)DELIM" +R"DELIM( method "${l.toUpperCase()}"`)),new Yo(e||500,c,new Error(d),!0)}function Su(e){let a=Object.entries(e);for(let i=a.length-1;i>=0;i--){let[l,s]=a[i];if(li(s))return{key:l,result:s}}}function jx(e){let a=typeof e=="string"?Sa(e):e;return xa({...a,hash:""})}function sA(e,a){return e.pathname!==a.pathname||e.search!==a.search?!1:e.hash===""?a.hash!=="":e.hash===a.hash?!0:a.hash!==""}function uA(e){return new Yo(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function cA(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([a,i])=>typeof a=="string"&&fA(i))}function fA(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function dA(e){return Ih(e.result)&&bx.has(e.result.status)}function Cn(e){return e.type==="error"}function li(e){return(e&&e.type)==="redirect"}function A0(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Ih(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function hA(e){return bx.has(e)}function mA(e){return Ih(e)&&hA(e.status)&&e.headers.has("Location")}function pA(e){return P3.has(e.toUpperCase())}function tn(e){return Z3.has(e.toUpperCase())}function Jh(e){return new URLSearchParams(e).getAll("index").some(a=>a==="")}function Mu(e,a){let i=typeof a=="string"?Sa(a).search:a.search;if(e[e.length-1].route.index&&Jh(i||""))return e[e.length-1];let l=mx(e);return l[l.length-1]}function z0(e){let{formMethod:a,formAction:i,formEncType:l,text:s,formData:u,json:c}=e;if(!(!a||!i||!l)){if(s!=null)return{formMethod:a,formAction:i,formEncType:l,formData:void 0,json:void 0,text:s};if(u!=null)return{formMethod:a,formAction:i,formEncType:l,formData:u,json:void 0,text:void 0};if(c!==void 0)return{formMethod:a,formAction:i,formEncType:l,formData:void 0,json:c,text:void 0}}}function $d(e,a,i,l){return l?{state:"loading",location:e,matches:a,historyAction:i,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}:{state:"loading",location:e,matches:a,historyAction:i,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function yA(e,a,i,l){return{state:"submitting",location:e,matches:a,historyAction:i,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}}function po(e,a){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:a}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:a}}function gA(e,a){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:a?a.data:void 0}}function ba(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function vA(e,a){try{let i=e.sessionStorage.getItem(xx);if(i){let l=JSON.parse(i);for(let[s,u]of Object.entries(l||{}))u&&Array.isArray(u)&&a.set(s,new Set(u||[]))}}catch{}}function bA(e,a){if(a.size>0){let i={};for(let[l,s]of a)i[l]=[...s];try{e.sessionStorage.setItem(xx,JSON.stringify(i))}catch(l){Rt(!1,`Failed to save applied view transitions in sessionStorage (${l}).`)}}}function j0(){let e,a,i=new Promise((l,s)=>{e=async u=>{l(u);try{await i}catch{}},a=async u=>{s(u);try{await i}catch{}}});return{promise:i,resolve:e,reject:a}}var hi=T.createContext(null);hi.displayName="DataRouter";var Ko=T.createContext(null);Ko.displayName="DataRouterState";var Nx=T.createContext(!1);function Cx(){return T.useContext(Nx)}var Wh=T.createContext({isTransitioning:!1});Wh.displayName="ViewTransition";var Mx=T.createContext(new Map);Mx.displayName="Fetchers";var xA=T.createContext(null);xA.displayName="Await";var On=T.createContext(null);On.displayName="Navigation";var ic=T.createContext(null);ic.displayName="Location";var Jn=T.createContext({outlet:null,matches:[],isDataRoute:!1});Jn.displayName="Route";var em=T.createContext(null);em.displayName="RouteError";var Ox="REACT_ROUTER_ERROR",SA="REDIRECT",wA="ROUTE_ERROR_RESPONSE";function _A(e){if(e.startsWith(`${Ox}:${SA}:{`))try{let a=JSON.parse(e.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function EA(e){if(e.startsWith(`${Ox}:${wA}:{`))try{let a=JSON.parse(e.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new Yo(a.status,a.statusText,a.data)}catch{}}function TA(e,{relative:a}={}){Be(vl(),"useHref() may be used only in the context of a component.");let{basename:i,navigator:l}=T.useContext(On),{hash:s,pathname:u,search:c}=Vo(e,{relative:a}),d=u;return i!=="/"&&(d=u==="/"?i:Kn([i,u])),l.createHref({pathname:d,search:c,hash:s})}function vl(){return T.useContext(ic)!=null}function kn(){return Be(vl(),"useLocation() may be used only in the context of a component."),T.useContext(ic).location}var kx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Dx(e){T.useContext(On).static||T.useLayoutEffect(e)}function wa(){let{isDataRoute:e}=T.useContext(Jn);return e?HA():RA()}function RA(){Be(vl(),"useNavigate() may be used only in the context of a component.");let e=T.useContext(hi),{basename:a,navigator:i}=T.useContext(On),{matches:l}=T.useContext(Jn),{pathname:s}=kn(),u=JSON.stringify(rc(l)),c=T.useRef(!1);return Dx(()=>{c.current=!0}),T.useCallback((m,p={})=>{if(Rt(c.current,kx),!c.current)return;if(typeof m=="number"){i.go(m);return}let b=Fo(m,JSON.parse(u),s,p.relative==="path");e==null&&a!=="/"&&(b.pathname=b.pathname==="/"?a:Kn([a,b.pathname])),(p.replace?i.replace:i.push)(b,p.state,p)},[a,i,u,s,e])}var AA=T.createContext(null);function zA(e){let a=T.useContext(Jn).outlet;return T.useMemo(()=>a&&T.createElement(AA.Provider,{value:e},a),[a,e])}function tm(){let{matches:e}=T.useContext(Jn);return e[e.length-1]?.params??{}}function Vo(e,{relative:a}={}){let{matches:i}=T.useContext(Jn),{pathname:l}=kn(),s=JSON.stringify(rc(i));return T.useMemo(()=>Fo(e,JSON.parse(s),l,a==="path"),[e,s,l,a])}function jA(e,a,i){Be(vl(),"useRoutes() may be used only in the context of a component.");let{navigator:l}=T.useContext(On),{matches:s}=T.useContext(Jn),u=s[s.length-1],c=u?u.params:{},d=u?u.pathname:"/",m=u?u.pathnameBase:"/",p=u&&u.route;{let C=p&&p.path||"";Ux(d,!p||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${d}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. -Please change the parent to .`)}let b=Nn(),g;g=b;let x=g.pathname||"/",w=x;if(m!=="/"){let N=m.replace(/^\//,"").split("/");w="/"+x.replace(/^\//,"").split("/").slice(N.length).join("/")}let E=i&&i.state.matches.length?i.state.matches.map(N=>Object.assign(N,{route:i.manifest[N.route.id]||N.route})):nx(e,{pathname:w});return Tt(p||E!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Tt(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`),EA(E&&E.map(N=>Object.assign({},N,{params:Object.assign({},c,N.params),pathname:Yn([m,l.encodeLocation?l.encodeLocation(N.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?m:Yn([m,l.encodeLocation?l.encodeLocation(N.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),s,i)}function xA(){let e=jx(),a=Do(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),i=e instanceof Error?e.stack:null,l="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:l},u={padding:"2px 4px",backgroundColor:l},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:u},"ErrorBoundary")," or"," ",)DELIM" -R"DELIM(T.createElement("code",{style:u},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},a),i?T.createElement("pre",{style:s},i):null,c)}var SA=T.createElement(xA,null),Cx=class extends T.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,a){return a.location!==e.location||a.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:a.error,location:a.location,revalidation:e.revalidation||a.revalidation}}componentDidCatch(e,a){this.props.onError?this.props.onError(e,a):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const i=mA(e.digest);i&&(e=i)}let a=e!==void 0?T.createElement(Xn.Provider,{value:this.props.routeContext},T.createElement(Ih.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?T.createElement(wA,{error:e},a):a}};Cx.contextType=_x;var Zd=new WeakMap;function wA({children:e,error:a}){let{basename:i}=T.useContext(jn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=hA(a.digest);if(l){let s=Zd.get(a);if(s)throw s;let u=ux(l.location,i),c=u.absoluteURL||u.to;if(gh(c))throw new Error("Invalid redirect location");if(sx&&!Zd.get(a))if(u.isExternal||l.reloadDocument)window.location.href=c;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:l.replace}));throw Zd.set(a,d),d}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c}`})}}return e}function _A({routeContext:e,match:a,children:i}){let l=T.useContext(fi);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),T.createElement(Xn.Provider,{value:e},i)}function EA(e,a=[],i){let l=i?.state;if(e==null){if(!l)return null;if(l.errors)e=l.matches;else if(a.length===0&&!l.initialized&&l.matches.length>0)e=l.matches;else return null}let s=e,u=l?.errors;if(u!=null){let b=s.findIndex(g=>g.route.id&&u?.[g.route.id]!==void 0);De(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),s=s.slice(0,Math.min(s.length,b+1))}let c=!1,d=-1;if(i&&l){c=l.renderFallback;for(let b=0;b=0?s=s.slice(0,d+1):s=[s[0]];break}}}}let m=i?.onError,p=l&&m?(b,g)=>{m(b,{location:l.location,params:l.matches?.[0]?.params??{},pattern:Go(l.matches),errorInfo:g})}:void 0;return s.reduceRight((b,g,x)=>{let w,E=!1,R=null,N=null;l&&(w=u&&g.route.id?u[g.route.id]:void 0,R=g.route.errorElement||SA,c&&(d<0&&x===0?(Nx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,N=null):d===x&&(E=!0,N=g.route.hydrateFallbackElement||null)));let F=a.concat(s.slice(0,x+1)),V=()=>{let J;return w?J=R:E?J=N:g.route.Component?J=T.createElement(g.route.Component,null):g.route.element?J=g.route.element:J=b,T.createElement(_A,{match:g,routeContext:{outlet:b,matches:F,isDataRoute:l!=null},children:J})};return l&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?T.createElement(Cx,{location:l.location,revalidation:l.revalidation,component:R,error:w,children:V(),routeContext:{outlet:null,matches:F,isDataRoute:!0},onError:p}):V()},null)}function Wh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function TA(e){let a=T.useContext(fi);return De(a,Wh(e)),a}function RA(e){let a=T.useContext(Ko);return De(a,Wh(e)),a}function AA(e){let a=T.useContext(Xn);return De(a,Wh(e)),a}function em(e){let a=AA(e),i=a.matches[a.matches.length-1];return De(i.route.id,`${e} can only be used on routes that contain a unique "id"`),i.route.id}function zA(){return em("useRouteId")}function jx(){let e=T.useContext(Ih),a=RA("useRouteError"),i=em("useRouteError");return e!==void 0?e:a.errors?.[i]}function CA(){let{router:e}=TA("useNavigate"),a=em("useNavigate"),i=T.useRef(!1);return zx(()=>{i.current=!0}),T.useCallback(async(s,u={})=>{Tt(i.current,Ax),i.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:a,...u}))},[e,a])}var A0={};function Nx(e,a,i){!a&&!A0[e]&&(A0[e]=!0,Tt(!1,i))}var z0={};function C0(e,a){!e&&!z0[a]&&(z0[a]=!0,console.warn(a))}var jA="useOptimistic",j0=rw[jA],NA=()=>{};function MA(e){return j0?j0(e):[e,NA]}function OA(e){let a={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Tt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(a,{element:T.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Tt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(a,{hydrateFallbackElement:T.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Tt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(a,{errorElement:T.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),a}var kA=["HydrateFallback","hydrateFallbackElement"],DA=class{constructor(){this.status="pending",this.promise=new Promise((e,a)=>{this.resolve=i=>{this.status==="pending"&&(this.status="resolved",e(i))},this.reject=i=>{this.status==="pending"&&(this.status="rejected",a(i))}})}};function LA({router:e,flushSync:a,onError:i,useTransitions:l}){l=Ex()||l;let[u,c]=T.useState(e.state),[d,m]=MA(u),[p,b]=T.useState(),[g,x]=T.useState({isTransitioning:!1}),[w,E]=T.useState(),[R,N]=T.useState(),[F,V]=T.useState(),J=T.useRef(new Map),ue=T.useCallback((_,{deletedFetchers:D,newErrors:B,flushSync:Q,viewTransitionOpts:q})=>{B&&i&&Object.values(B).forEach(re=>i(re,{location:_.location,params:_.matches[0]?.params??{},pattern:Go(_.matches)})),_.fetchers.forEach((re,fe)=>{re.data!==void 0&&J.current.set(fe,re.data)}),D.forEach(re=>J.current.delete(re)),C0(Q===!1||a!=null,'You provided the `flushSync` option to a router update, but you are not using the `` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let G=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(C0(q==null||G,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!q||!G){a&&Q?a(()=>c(_)):l===!1?c(_):T.startTransition(()=>{l===!0&&m(re=>N0(re,_)),c(_)});return}if(a&&Q){a(()=>{R&&(w?.resolve(),R.skipTransition()),x({isTransitioning:!0,flushSync:!0,currentLocation:q.currentLocation,nextLocation:q.nextLocation})});let re=e.window.document.startViewTransition(()=>{a(()=>c(_))});re.finished.finally(()=>{a(()=>{E(void 0),N(void 0),b(void 0),x({isTransitioning:!1})})}),a(()=>N(re));return}R?(w?.resolve(),R.skipTransition(),V({state:_,currentLocation:q.currentLocation,nextLocation:q.nextLocation})):(b(_),x({isTransitioning:!0,flushSync:!1,currentLocation:q.currentLocation,nextLocation:q.nextLocation}))},[e.window,a,R,w,l,m,i]);T.useLayoutEffect(()=>e.subscribe(ue),[e,ue]),T.useEffect(()=>{g.isTransitioning&&!g.flushSync&&E(new DA)},[g]),)DELIM" -R"DELIM(T.useEffect(()=>{if(w&&p&&e.window){let _=p,D=w.promise,B=e.window.document.startViewTransition(async()=>{l===!1?c(_):T.startTransition(()=>{l===!0&&m(Q=>N0(Q,_)),c(_)}),await D});B.finished.finally(()=>{E(void 0),N(void 0),b(void 0),x({isTransitioning:!1})}),N(B)}},[p,w,e.window,l,m]),T.useEffect(()=>{w&&p&&d.location.key===p.location.key&&w.resolve()},[w,R,d.location,p]),T.useEffect(()=>{!g.isTransitioning&&F&&(b(F.state),x({isTransitioning:!0,flushSync:!1,currentLocation:F.currentLocation,nextLocation:F.nextLocation}),V(void 0))},[g.isTransitioning,F]);let ae=T.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:_=>e.navigate(_),push:(_,D,B)=>e.navigate(_,{state:D,preventScrollReset:B?.preventScrollReset}),replace:(_,D,B)=>e.navigate(_,{replace:!0,state:D,preventScrollReset:B?.preventScrollReset})}),[e]),xe=e.basename||"/",j=T.useMemo(()=>({router:e,navigator:ae,static:!1,basename:xe,onError:i}),[e,ae,xe,i]);return T.createElement(T.Fragment,null,T.createElement(fi.Provider,{value:j},T.createElement(Ko.Provider,{value:d},T.createElement(Tx.Provider,{value:J.current},T.createElement(Xh.Provider,{value:g},T.createElement(ZA,{basename:xe,location:d.location,navigationType:d.historyAction,navigator:ae,useTransitions:l},T.createElement(BA,{routes:e.routes,manifest:e.manifest,future:e.future,state:d,isStatic:!1,onError:i})))))),null)}function N0(e,a){return{...e,navigation:a.navigation.state!=="idle"?a.navigation:e.navigation,revalidation:a.revalidation!=="idle"?a.revalidation:e.revalidation,actionData:a.navigation.state!=="submitting"?a.actionData:e.actionData,fetchers:a.fetchers}}var BA=T.memo(UA);function UA({routes:e,manifest:a,future:i,state:l,isStatic:s,onError:u}){return bA(e,void 0,{manifest:a,state:l,isStatic:s,onError:u})}function HA({to:e,replace:a,state:i,relative:l}){De(yl()," may be used only in the context of a component.");let{static:s}=T.useContext(jn);Tt(!s," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:u}=T.useContext(Xn),{pathname:c}=Nn(),d=Sa(),m=Fo(e,ac(u),c,l==="path"),p=JSON.stringify(m);return T.useEffect(()=>{d(JSON.parse(p),{replace:a,state:i,relative:l})},[d,p,l,a,i]),null}function $A(e){return vA(e.context)}function Bt(e){De(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function ZA({basename:e="/",children:a=null,location:i,navigationType:l="POP",navigator:s,static:u=!1,useTransitions:c}){De(!yl(),"You cannot render a inside another . You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),m=T.useMemo(()=>({basename:d,navigator:s,static:u,useTransitions:c,future:{}}),[d,s,u,c]);typeof i=="string"&&(i=xa(i));let{pathname:p="/",search:b="",hash:g="",state:x=null,key:w="default",mask:E}=i,R=T.useMemo(()=>{let N=Gn(p,d);return N==null?null:{location:{pathname:N,search:b,hash:g,state:x,key:w,mask:E},navigationType:l}},[d,p,b,g,x,w,l,E]);return Tt(R!=null,` is not able to match the URL "${p}${b}${g}" because it does not start with the basename, so the won't render anything.`),R==null?null:T.createElement(jn.Provider,{value:m},T.createElement(rc.Provider,{children:a,value:R}))}function bh(e,a=[]){let i=[];return T.Children.forEach(e,(l,s)=>{if(!T.isValidElement(l))return;let u=[...a,s];if(l.type===T.Fragment){i.push.apply(i,bh(l.props.children,u));return}De(l.type===Bt,`[${typeof l.type=="string"?l.type:l.type.name}] is not a component. All component children of must be a or `),De(!l.props.index||!l.props.children,"An index route cannot have child routes.");let c={id:l.props.id||u.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(c.children=bh(l.props.children,u)),i.push(c)}),i}var qA=bh,Mu="get",Ou="application/x-www-form-urlencoded";function ic(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function PA(e){return ic(e)&&e.tagName.toLowerCase()==="button"}function QA(e){return ic(e)&&e.tagName.toLowerCase()==="form"}function FA(e){return ic(e)&&e.tagName.toLowerCase()==="input"}function YA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function GA(e,a){return e.button===0&&(!a||a==="_self")&&!YA(e)}function xh(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((a,i)=>{let l=e[i];return a.concat(Array.isArray(l)?l.map(s=>[i,s]):[[i,l]])},[]))}function KA(e,a){let i=xh(e);return a&&a.forEach((l,s)=>{i.has(s)||a.getAll(s).forEach(u=>{i.append(s,u)})}),i}var Su=null;function VA(){if(Su===null)try{new FormData(document.createElement("form"),0),Su=!1}catch{Su=!0}return Su}var XA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function qd(e){return e!=null&&!XA.has(e)?(Tt(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Ou}"`),null):e}function IA(e,a){let i,l,s,u,c;if(QA(e)){let d=e.getAttribute("action");l=d?Gn(d,a):null,i=e.getAttribute("method")||Mu,s=qd(e.getAttribute("enctype"))||Ou,u=new FormData(e)}else if(PA(e)||FA(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a