From 21d59ef62ebbbab5a8356faab7679e047c2640ed Mon Sep 17 00:00:00 2001 From: BOB450 Date: Thu, 10 Sep 2026 13:48:24 -0600 Subject: [PATCH] Updated embedded native block explorer Added a expandable section in the block page that shows the active/inactive consensus rule flags with BIP references. --- console/embedded/native_css.cpp | 8 +- console/embedded/native_ecma.cpp | 217 ++++++++++++++++--------------- 2 files changed, 113 insertions(+), 112 deletions(-) diff --git a/console/embedded/native_css.cpp b/console/embedded/native_css.cpp index f45e5e6c..765a1c7a 100644 --- a/console/embedded/native_css.cpp +++ b/console/embedded/native_css.cpp @@ -23,10 +23,10 @@ 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);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}.scroll-mt-24{scroll-margin-top:calc(var(--spacing) * 24)}.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-)DELIM" -R"DELIM(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;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-accent\/10{background-color:#ffa0221a}.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:)DELIM" -R"DELIM(#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}.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)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-accent{--tw-ring-color:#ffa022}.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}.block-101{block-size:calc(var(--spacing) * 101)}.block-102{block-size:calc(var(--spacing) * 102)}.block-103{block-size:calc(var(--spacing) * 103)}.ring-inset{--tw-ring-inset:inset}.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\:cursor-wait:disabled{cursor:wait}.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-v)DELIM" -R"DELIM(alue: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%}@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((--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-5{height:calc(var(--spacing) * 5)}.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-5{width:calc(var(--spacing) * 5)}.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}.rotate-180{rotate:180deg}.scroll-mt-24{scroll-margin-top:calc(var(--spacing) * 24)}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.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:ca)DELIM" +R"DELIM(lc(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-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * 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-accent\/10{background-color:#ffa0221a}.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-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.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.3788% -.00557154 .00797936/.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)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.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))}.)DELIM" +R"DELIM(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)}.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)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-accent{--tw-ring-color:#ffa022}.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))}.transition-transform{transition-property:transform,translate,scale,rotate;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}.block-101{block-size:calc(var(--spacing) * 101)}.block-102{block-size:calc(var(--spacing) * 102)}.block-103{block-size:calc(var(--spacing) * 103)}.ring-inset{--tw-ring-inset:inset}.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\:cursor-wait:disabled{cursor:wait}.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\:grid-cols-4{grid-template-columns:repeat(4,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-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols)DELIM" +R"DELIM(-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%}@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 74146a03..6ba475a7 100644 --- a/console/embedded/native_ecma.cpp +++ b/console/embedded/native_ecma.cpp @@ -22,151 +22,152 @@ namespace libbitcoin { namespace server { DEFINE_EMBEDDED_PAGE(native_pages, char, ecma, -R"DELIM(function Cw(e,a){for(var i=0;io[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"]'))o(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"&&o(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 o(s){if(s.ep)return;s.ep=!0;const u=i(s);fetch(s.href,u)}})();function Mh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _d={exports:{}},fl={};var sv;function Mw(){if(sv)return fl;sv=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(o,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:o,key:c,ref:s!==void 0?s:null,props:u}}return fl.Fragment=a,fl.jsx=i,fl.jsxs=i,fl}var uv;function Ow(){return uv||(uv=1,_d.exports=Mw()),_d.exports}var y=Ow(),Td={exports:{}},Le={};var cv;function kw(){if(cv)return Le;cv=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=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(j){return j===null||typeof j!="object"?null:(j=x&&j[x]||j["@@iterator"],typeof j=="function"?j:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,R={};function q(j,K,I){this.props=j,this.context=K,this.refs=R,this.updater=I||T}q.prototype.isReactComponent={},q.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")},q.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function G(){}G.prototype=q.prototype;function X(j,K,I){this.props=j,this.context=K,this.refs=R,this.updater=I||T}var le=X.prototype=new G;le.constructor=X,C(le,q.prototype),le.isPureReactComponent=!0;var ne=Array.isArray;function ge(){}var z={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function k(j,K,I){var se=I.ref;return{$$typeof:e,type:j,key:K,ref:se!==void 0?se:null,props:I}}function B(j,K){return k(j.type,K,j.props)}function Q(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function F(j){var K={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(I){return K[I]})}var re=/\/+/g;function fe(j,K){return typeof j=="object"&&j!==null&&j.key!=null?F(""+j.key):K.toString(36)}function be(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(ge,ge):(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 L(j,K,I,se,W){var pe=typeof j;(pe==="undefined"||pe==="boolean")&&(j=null);var Ce=!1;if(j===null)Ce=!0;else switch(pe){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,L(Ce(j._payload),K,I,se,W)}}if(Ce)return W=W(j),Ce=se===""?"."+fe(j,0):se,ne(W)?(I="",Ce!=null&&(I=Ce.replace(re,"$&/")+"/"),L(W,K,I,"",function(ce){return ce})):W!=null&&(Q(W)&&(W=B(W,I+(W.key==null||j&&j.key===W.key?"":(""+W.key).replace(re,"$&/")+"/")+Ce)),K.push(W)),1;Ce=0;var Et=se===""?".":se+":";if(ne(j))for(var H=0;H>>1,we=L[de];if(0>>1;des(I,ie))ses(W,I)?(L[de]=W,L[se]=ie,de=se):(L[de]=I,L[K]=ie,de=K);else if(ses(W,ie))L[de]=W,L[se]=ie,de=se;else break e}}return O}function s(L,O){var ie=L.sortIndex-O.sortIndex;return ie!==0?ie:L.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,g=null,x=3,w=!1,T=!1,C=!1,R=!1,q=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function le(L){for(var O=i(p);O!==null;){if(O.callback===null)o(p);else if(O.startTime<=L)o(p),O.sortIndex=O.expirationTime,a(m,O);else break;O=i(p)}}function ne(L){if(C=!1,le(L),!T)if(i(m)!==null)T=!0,ge||(ge=!0,F());else{var O=i(p);O!==null&&be(ne,O.startTime-L)}}var ge=!1,z=-1,E=5,k=-1;function B(){return R?!0:!(e.unstable_now()-kL&&B());){var de=g.callback;if(typeof de=="function"){g.callback=null,x=g.priorityLevel;var we=de(g.expirationTime<=L);if(L=e.unstable_now(),typeof we=="function"){g.callback=we,le(L),O=!0;break t}g===i(m)&&o(m),le(L)}else o(m);g=i(m)}if(g!==null)O=!0;else{var j=i(p);j!==null&&be(ne,j.startTime-L),O=!1}}break e}finally{g=null,x=ie,w=!1}O=void 0}}finally{O?F():ge=!1}}}var F;if(typeof X=="function")F=function(){X(Q)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,fe=re.port2;re.port1.onmessage=Q,F=function(){fe.postMessage(null)}}else F=function(){q(Q,0)};function be(L,O){z=q(function(){L(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(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125de?(L.sortIndex=ie,a(p,L),i(m)===null&&L===i(p)&&(C?(G(z),z=-1):C=!0,be(ne,ie-de))):(L.sortIndex=we,a(m,L),T||w||(T=!0,ge||(ge=!0,F()))),L},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(L){var O=x;return function(){var ie=x;x=O;try{return L.apply(this,arguments)}finally{x=ie}}}})(Nd)),Nd}var hv;function Bw(){return hv||(hv=1,Ad.exports=Lw()),Ad.exports}var jd={exports:{}},en={};var mv;function Uw(){if(mv)return en;mv=1;var e=Oh();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(),jd.exports=Uw(),jd.exports}var yv;function Hw(){if(yv)return dl;yv=1;var e=Bw(),a=Oh(),i=ob();function o(t){var n="https://react.dev/errors/"+t;if(1we||(t.current=de[we],de[we]=null,we--)}function I(t,n){we++,de[we]=t.current,t.current=n}var se=j(null),W=j(null),pe=j(null),Ce=j(null);function Et(t,n){switch(I(pe,n),I(W,t),I(se,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Cg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Cg(n),t=Mg(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}K(se),I(se,t)}function H(){K(se),K(W),K(pe)}function ce(t){t.memoizedState!==null&&I(Ce,t);var n=se.current,r=Mg(n,t.type);n!==r&&(I(W,t),I(se,r))}function he(t){W.current===t&&(K(se),K(W)),Ce.current===t&&(K(Ce),ll._currentValue=ie)}var xe,me;function Ne(t){if(xe===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);xe=n&&n[1]||"",me=-1o[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"]'))o(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&o(u)}).observe(document,{childList:!0,subtree:!0});function i(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(s){if(s.ep)return;s.ep=!0;const c=i(s);fetch(s.href,c)}})();function Lh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rd={exports:{}},pl={};var fv;function Bw(){if(fv)return pl;fv=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(o,s,c){var u=null;if(c!==void 0&&(u=""+c),s.key!==void 0&&(u=""+s.key),"key"in s){c={};for(var d in s)d!=="key"&&(c[d]=s[d])}else c=s;return s=c.ref,{$$typeof:e,type:o,key:u,ref:s!==void 0?s:null,props:c}}return pl.Fragment=a,pl.jsx=i,pl.jsxs=i,pl}var dv;function Uw(){return dv||(dv=1,Rd.exports=Bw()),Rd.exports}var y=Uw(),jd={exports:{}},Le={};var hv;function $w(){if(hv)return Le;hv=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=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(k){return k===null||typeof k!="object"?null:(k=x&&k[x]||k["@@iterator"],typeof k=="function"?k:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,R={};function q(k,K,I){this.props=k,this.context=K,this.refs=R,this.updater=I||T}q.prototype.isReactComponent={},q.prototype.setState=function(k,K){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,K,"setState")},q.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function G(){}G.prototype=q.prototype;function J(k,K,I){this.props=k,this.context=K,this.refs=R,this.updater=I||T}var oe=J.prototype=new G;oe.constructor=J,z(oe,q.prototype),oe.isPureReactComponent=!0;var ee=Array.isArray;function be(){}var A={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(k,K,I){var le=I.ref;return{$$typeof:e,type:k,key:K,ref:le!==void 0?le:null,props:I}}function B(k,K){return D(k.type,K,k.props)}function Q(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function F(k){var K={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(I){return K[I]})}var ue=/\/+/g;function he(k,K){return typeof k=="object"&&k!==null&&k.key!=null?F(""+k.key):K.toString(36)}function pe(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(be,be):(k.status="pending",k.then(function(K){k.status==="pending"&&(k.status="fulfilled",k.value=K)},function(K){k.status==="pending"&&(k.status="rejected",k.reason=K)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function O(k,K,I,le,W){var ye=typeof k;(ye==="undefined"||ye==="boolean")&&(k=null);var ze=!1;if(k===null)ze=!0;else switch(ye){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(k.$$typeof){case e:case a:ze=!0;break;case b:return ze=k._init,O(ze(k._payload),K,I,le,W)}}if(ze)return W=W(k),ze=le===""?"."+he(k,0):le,ee(W)?(I="",ze!=null&&(I=ze.replace(ue,"$&/")+"/"),O(W,K,I,"",function(ce){return ce})):W!=null&&(Q(W)&&(W=B(W,I+(W.key==null||k&&k.key===W.key?"":(""+W.key).replace(ue,"$&/")+"/")+ze)),K.push(W)),1;ze=0;var _t=le===""?".":le+":";if(ee(k))for(var $=0;$>>1,we=O[fe];if(0>>1;fes(I,re))les(W,I)?(O[fe]=W,O[le]=re,fe=le):(O[fe]=I,O[K]=re,fe=K);else if(les(W,re))O[fe]=W,O[le]=re,fe=le;else break e}}return M}function s(O,M){var re=O.sortIndex-M.sortIndex;return re!==0?re:O.id-M.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var m=[],p=[],b=1,g=null,x=3,w=!1,T=!1,z=!1,R=!1,q=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;function oe(O){for(var M=i(p);M!==null;){if(M.callback===null)o(p);else if(M.startTime<=O)o(p),M.sortIndex=M.expirationTime,a(m,M);else break;M=i(p)}}function ee(O){if(z=!1,oe(O),!T)if(i(m)!==null)T=!0,be||(be=!0,F());else{var M=i(p);M!==null&&pe(ee,M.startTime-O)}}var be=!1,A=-1,E=5,D=-1;function B(){return R?!0:!(e.unstable_now()-DO&&B());){var fe=g.callback;if(typeof fe=="function"){g.callback=null,x=g.priorityLevel;var we=fe(g.expirationTime<=O);if(O=e.unstable_now(),typeof we=="function"){g.callback=we,oe(O),M=!0;break t}g===i(m)&&o(m),oe(O)}else o(m);g=i(m)}if(g!==null)M=!0;else{var k=i(p);k!==null&&pe(ee,k.startTime-O),M=!1}}break e}finally{g=null,x=re,w=!1}M=void 0}}finally{M?F():be=!1}}}var F;if(typeof J=="function")F=function(){J(Q)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,he=ue.port2;ue.port1.onmessage=Q,F=function(){he.postMessage(null)}}else F=function(){q(Q,0)};function pe(O,M){A=q(function(){O(e.unstable_now())},M)}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(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125fe?(O.sortIndex=re,a(p,O),i(m)===null&&O===i(p)&&(z?(G(A),A=-1):z=!0,pe(ee,re-fe))):(O.sortIndex=we,a(m,O),T||w||(T=!0,be||(be=!0,F()))),O},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(O){var M=x;return function(){var re=x;x=M;try{return O.apply(this,arguments)}finally{x=re}}}})(Ad)),Ad}var yv;function Pw(){return yv||(yv=1,kd.exports=Zw()),kd.exports}var zd={exports:{}},nn={};var gv;function qw(){if(gv)return nn;gv=1;var e=Bh();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(),zd.exports=qw(),zd.exports}var bv;function Fw(){if(bv)return yl;bv=1;var e=Pw(),a=Bh(),i=ub();function o(t){var n="https://react.dev/errors/"+t;if(1we||(t.current=fe[we],fe[we]=null,we--)}function I(t,n){we++,fe[we]=t.current,t.current=n}var le=k(null),W=k(null),ye=k(null),ze=k(null);function _t(t,n){switch(I(ye,n),I(W,t),I(le,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Og(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Og(n),t=Dg(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}K(le),I(le,t)}function $(){K(le),K(W),K(ye)}function ce(t){t.memoizedState!==null&&I(ze,t);var n=le.current,r=Dg(n,t.type);n!==r&&(I(W,t),I(le,r))}function de(t){W.current===t&&(K(le),K(W)),ze.current===t&&(K(ze),fl._currentValue=re)}var ge,me;function Ne(t){if(ge===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);ge=n&&n[1]||"",me=-1)":-1f||A[l]!==Z[f]){var J=` -`+A[l].replace(" at new "," at ");return t.displayName&&J.includes("")&&(J=J.replace("",t.displayName)),J}while(1<=l&&0<=f);break}}}finally{Je=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?Ne(r):""}function qe(t,n){switch(t.tag){case 26:case 27:case 5:return Ne(t.type);case 16:return Ne("Lazy");case 13:return t.child!==n&&n!==null?Ne("Suspense Fallback"):Ne("Suspense");case 19:return Ne("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 Ne("Activity");default:return""}}function Qe(t){try{var n="",r=null;do n+=qe(t,r),r=t,t=t.return;while(t);return n}catch(l){return` +`);for(f=l=0;lf||j[l]!==Z[f]){var X=` +`+j[l].replace(" at new "," at ");return t.displayName&&X.includes("")&&(X=X.replace("",t.displayName)),X}while(1<=l&&0<=f);break}}}finally{Je=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?Ne(r):""}function qe(t,n){switch(t.tag){case 26:case 27:case 5:return Ne(t.type);case 16:return Ne("Lazy");case 13:return t.child!==n&&n!==null?Ne("Suspense Fallback"):Ne("Suspense");case 19:return Ne("SuspenseList");case 0:case 15:return Oe(t.type,!1);case 11:return Oe(t.type.render,!1);case 1:return Oe(t.type,!0);case 31:return Ne("Activity");default:return""}}function Ye(t){try{var n="",r=null;do n+=qe(t,r),r=t,t=t.return;while(t);return n}catch(l){return` Error generating stack: `+l.message+` -`+l.stack}}var Ie=Object.prototype.hasOwnProperty,yt=e.unstable_scheduleCallback,Jt=e.unstable_cancelCallback,En=e.unstable_shouldYield,Ja=e.unstable_requestPaint,Pt=e.unstable_now,ea=e.unstable_getCurrentPriorityLevel,dn=e.unstable_ImmediatePriority,_a=e.unstable_UserBlockingPriority,Un=e.unstable_NormalPriority,_n=e.unstable_LowPriority,Hn=e.unstable_IdlePriority,mc=e.log,pc=e.unstable_setDisableYieldValue,Ta=null,on=null;function $t(t){if(typeof mc=="function"&&pc(t),on&&typeof on.setStrictMode=="function")try{on.setStrictMode(Ta,t)}catch{}}var Wt=Math.clz32?Math.clz32:yc,ts=Math.log,ns=Math.LN2;function yc(t){return t>>>=0,t===0?32:31-(ts(t)/ns|0)|0}var $r=256,Ra=2621)DELIM" -R"DELIM(44,Zr=4194304;function ta(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 yi(t,n,r){var l=t.pendingLanes;if(l===0)return 0;var f=0,h=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var S=l&134217727;return S!==0?(l=S&~h,l!==0?f=ta(l):(v&=S,v!==0?f=ta(v):r||(r=S&~t,r!==0&&(f=ta(r))))):(S=l&~h,S!==0?f=ta(S):v!==0?f=ta(v):r||(r=l&~t,r!==0&&(f=ta(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 Wa(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function gc(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 wo(){var t=Zr;return Zr<<=1,(Zr&62914560)===0&&(Zr=4194304),t}function er(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 as(t,n,r,l,f,h){var v=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=v&~r;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var ja=/[\n"\\]/g;function sn(t){return t.replace(ja,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Eo(t,n,r,l,f,h,v,S){t.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.type=v:t.removeAttribute("type"),n!=null?v==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+mt(n)):t.value!==""+mt(n)&&(t.value=""+mt(n)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),n!=null?vc(t,v,mt(n)):r!=null?vc(t,v,mt(r)):l!=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=""+mt(S):t.removeAttribute("name")}function Tm(t,n,r,l,f,h,v,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)){bi(t);return}r=r!=null?""+mt(r):"",n=n!=null?""+mt(n):r,S||n===t.value||(t.value=n),t.defaultValue=n}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=S?t.checked:!!l,t.defaultChecked=!!l,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),bi(t)}function vc(t,n,r){n==="number"&<(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function Si(t,n,r,l){if(t=t.options,n){n={};for(var f=0;f"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ec=!1;if(Ca)try{var To={};Object.defineProperty(To,"passive",{get:function(){Ec=!0}}),window.addEventListener("test",To,To),window.removeEventListener("test",To,To)}catch{Ec=!1}var nr=null,_c=null,ls=null;function Mm(){if(ls)return ls;var t,n=_c,r=n.length,l,f="value"in nr?nr.value:nr.textContent,h=f.length;for(t=0;t=No),Um=" ",Hm=!1;function $m(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 Zm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ti=!1;function tS(t,n){switch(t){case"compositionend":return Zm(n);case"keypress":return n.which!==32?null:(Hm=!0,Um);case"textInput":return t=n.data,t===Um&&Hm?null:t;default:return null}}function nS(t,n){if(Ti)return t==="compositionend"||!jc&&$m(t,n)?(t=Mm(),ls=_c=nr=null,Ti=!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=l}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Km(r)}}function Xm(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Xm(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Jm(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 Mc(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 cS=Ca&&"documentMode"in document&&11>=document.documentMode,Ri=null,Oc=null,Mo=null,kc=!1;function Wm(t,n,r){var l=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;kc||Ri==null||Ri!==lt(l)||(l=Ri,"selectionStart"in l&&Mc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Mo&&Co(Mo,l)||(Mo=l,l=eu(Oc,"onSelect"),0>=v,f-=v,da=1<<32-Wt(n)+f|r<$e?(Ge=Te,Te=null):Ge=Te.sibling;var at=Y(U,Te,$[$e],ee);if(at===null){Te===null&&(Te=Ge);break}t&&Te&&at.alternate===null&&n(U,Te),M=h(at,M,$e),nt===null?Ae=at:nt.sibling=at,nt=at,Te=Ge}if($e===$.length)return r(U,Te),Ke&&Oa(U,$e),Ae;if(Te===null){for(;$e<$.length;$e++)Te=ae(U,$[$e],ee),Te!==null&&(M=h(Te,M,$e),nt===null?Ae=Te:nt.sibling=Te,nt=Te);return Ke&&Oa(U,$e),Ae}for(Te=l(Te);$e<$.length;$e++)Ge=V(Te,U,$e,$[$e],ee),Ge!==null&&(t&&Ge.alternate!==null&&Te.delete(Ge.key===null?$e:Ge.key),M=h(Ge,M,$e),nt===null?Ae=Ge:nt.sibling=Ge,nt=Ge);return t&&Te.forEach(function(_r){return n(U,_r)}),Ke&&Oa(U,$e),Ae}function Me(U,M,$,ee){if($==null)throw Error(o(151));for(var Ae=null,nt=null,Te=M,$e=M=0,Ge=null,at=$.next();Te!==null&&!at.done;$e++,at=$.next()){Te.index>$e?(Ge=Te,Te=null):Ge=Te.sibling;var _r=Y(U,Te,at.value,ee);if(_r===null){Te===null&&(Te=Ge);break}t&&Te&&_r.alternate===null&&n(U,Te),M=h(_r,M,$e),nt===null?Ae=_r:nt.sibling=_r,nt=_r,Te=Ge}if(at.done)return r(U,Te),Ke&&Oa(U,$e),Ae;if(Te===null){for(;!at.done;$e++,at=$.next())at=ae(U,at.value,ee),at!==null&&(M=h(at,M,$e),nt===null?Ae=at:nt.sibling=at,nt=at);return Ke&&Oa(U,$e),Ae}for(Te=l(Te);!at.done;$e++,at=$.next())at=V(Te,U,$e,at.value,ee),at!==null&&(t&&at.alternate!==null&&Te.delete(at.key===null?$e:at.key),M=h(at,M,$e),nt===null?Ae=at:nt.sibling=at,nt=at);return t&&Te.forEach(function(zw){return n(U,zw)}),Ke&&Oa(U,$e),Ae}function ht(U,M,$,ee){if(typeof $=="object"&&$!==null&&$.type===C&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case w:e:{for(var Ae=$.key;M!==null;){if(M.key===Ae){if(Ae=$.type,Ae===C){if(M.tag===7){r(U,M.sibling),ee=f(M,$.props.children),ee.return=U,U=ee;break e}}else if(M.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===E&&Xr(Ae)===M.type){r(U,M.sibling),ee=f(M,$.props),Uo(ee,$),ee.return=U,U=ee;break e}r(U,M);break}else n(U,M);M=M.sibling}$.type===C?(ee=Yr($.props.children,U.mode,ee,$.key),ee.return=U,U=ee):(ee=gs($.type,$.key,$.props,null,U.mode,ee),Uo(ee,$),ee.return=U,U=ee)}return v(U);case T:e:{for(Ae=$.key;M!==null;){if(M.key===Ae)if(M.tag===4&&M.stateNode.containerInfo===$.containerInfo&&M.stateNode.implementation===$.implementation){r(U,M.sibling),ee=f(M,$.children||[]),ee.return=U,U=ee;break e}else{r(U,M);break}else n(U,M);M=M.sibling}ee=Zc($,U.mode,ee),ee.return=U,U=ee}return v(U);case E:return $=Xr($),ht(U,M,$,ee)}if(be($))return _e(U,M,$,ee);if(F($)){if(Ae=F($),typeof Ae!="function")throw Error(o(150));return $=Ae.call($),Me(U,M,$,ee)}if(typeof $.then=="function")return ht(U,M,_s($),ee);if($.$$typeof===X)return ht(U,M,xs(U,$),ee);Ts(U,$)}return typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint"?($=""+$,M!==null&&M.tag===6?(r(U,M.sibling),ee=f(M,$),ee.return=U,U=ee):(r(U,M),ee=$c($,U.mode,ee),ee.return=U,U=ee),v(U)):r(U,M)}return function(U,M,$,ee){try{Bo=0;var Ae=ht(U,M,$,ee);return Bi=null,Ae}catch(Te){if(Te===Li||Te===ws)throw Te;var nt=An(29,Te,null,U.mode);return nt.lanes=ee,nt.return=U,nt}}}var Wr=wp(!0),Ep=wp(!1),lr=!1;function Wc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ef(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 sr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ur(t,n,r){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(rt&2)!==0){var f=l.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),l.pending=n,n=ys(t),op(t,null,r),n}return ps(t,l,n,r),ys(t)}function Ho(t,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var l=n.lanes;l&=t.pendingLanes,r|=l,n.lanes=r,is(t,r)}}function tf(t,n){var r=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,r===l)){var f=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var v={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};h===null?f=h=v:h=h.next=v,r=r.next}while(r!==null);h===null?f=h=n:h=h.next=n}else f=h=n;r={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=n:t.next=n,r.lastBaseUpdate=n}var nf=!1;function $o(){if(nf){var t=Di;if(t!==null)throw t}}function Zo(t,n,r,l){nf=!1;var f=t.updateQueue;lr=!1;var h=f.firstBaseUpdate,v=f.lastBaseUpdate,S=f.shared.pending;if(S!==null){f.shared.pending=null;var A=S,Z=A.next;A.next=null,v===null?h=Z:v.next=Z,v=A;var J=t.alternate;J!==null&&(J=J.updateQueue,S=J.lastBaseUpdate,S!==v&&(S===null?J.firstBaseUpdate=Z:S.next=Z,J.lastBaseUpdate=A))}if(h!==null){var ae=f.baseState;v=0,J=Z=A=null,S=h;do{var Y=S.lane&-536870913,V=Y!==S.lane;if(V?(Ye&Y)===Y:(l&Y)===Y){Y!==0&&Y===ki&&(nf=!0),J!==null&&(J=J.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var _e=t,Me=S;Y=n;var ht=r;switch(Me.tag){case 1:if(_e=Me.payload,typeof _e=="function"){ae=_e.call(ht,ae,Y);break e}ae=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=Me.payload,Y=typeof _e=="function"?_e.call(ht,ae,Y):_e,Y==null)break e;ae=g({},ae,Y);break e;case 2:lr=!0}}Y=S.callback,Y!==null&&(t.flags|=64,V&&(t.flags|=8192),V=f.callbacks,V===null?f.callbacks=[Y]:V.push(Y))}else V={lane:Y,tag:S.tag,payload:S.payload,callback:S.callback,next:null},J===null?(Z=J=V,A=ae):J=J.next=V,v|=Y;if(S=S.next,S===null){if(S=f.shared.pending,S===null)break;V=S,S=V.next,V.next=null,f.lastBaseUpdate=V,f.shared.pending=null}}while(!0);J===null&&(A=ae),f.baseState=A,f.firstBaseUpdate=Z,f.lastBaseUpdate=J,h===null&&(f.shared.lanes=0),mr|=v,t.lanes=v,t.memoizedState=ae}}function _p(t,n){if(typeof t!="function")throw Error(o(191,t));t.call(n)}function Tp(t,n){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;th?h:8;var v=L.T,S={};L.T=S,wf(t,!1,n,r);try{var A=f(),Z=L.S;if(Z!==null&&Z(S,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var J=bS(A,l);Fo(t,n,J,Mn(t))}else Fo(t,n,l,Mn(t))}catch(ae){Fo(t,n,{then:function(){},status:"rejected",reason:ae},Mn())}finally{O.p=h,v!==null&&S.types!==null&&(v.types=S.types),L.T=v}}function TS(){}function xf(t,n,r,l){if(t.tag!==5)throw Error(o(476));var f=ay(t).queue;ny(t,f,n,ie,r===null?TS:function(){return ry(t),r(l)})}function ay(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ba,lastRenderedState:ie},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ba,lastRenderedState:r},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function ry(t){var n=ay(t);n.next===null&&(n=t.alternate.memoizedState),Fo(t,n.next.queue,{},Mn())}function Sf(){return Qt(ll)}function iy(){return Mt().memoizedState}function oy(){return Mt().memoizedState}function RS(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var r=Mn();t=sr(r);var l=ur(n,t,r);l!==null&&(bn(l,n,r),Ho(l,n,r)),n={cache:Kc()},t.payload=n;return}n=n.return}}function AS(t,n,r){var l=Mn();r={lane:l,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ds(t)?sy(n,r):(r=Uc(t,n,r,l),r!==null&&(bn(r,t,l),uy(r,n,l)))}function ly(t,n,r){var l=Mn();Fo(t,n,r,l)}function Fo(t,n,r,l){var f={lane:l,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Ds(t))sy(n,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var v=n.lastRenderedState,S=h(v,r);if(f.hasEagerState=!0,f.eagerState=S,Rn(S,v))return ps(t,n,f,0),pt===null&&ms(),!1}catch{}if(r=Uc(t,n,f,l),r!==null)return bn(r,t,l),uy(r,n,l),!0}return!1}function wf(t,n,r,l){if(l={lane:2,revertLane:ed(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ds(t)){if(n)throw Error(o(479))}else n=Uc(t,r,l,2),n!==null&&bn(n,t,2)}function Ds(t){var n=t.alternate;return t===He||n!==null&&n===He}function sy(t,n){Hi=Ns=!0;var r=t.pending;r===null?n.next=n:(n.next=r.next,r.next=n),t.pending=n}function uy(t,n,r){if((r&4194048)!==0){var l=n.lanes;l&=t.pendingLanes,r|=l,n.lanes=r,is(t,r)}}var Qo={readContext:Qt,use:Cs,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt};Qo.useEffectEvent=Tt;var cy={readContext:Qt,use:Cs,useCallback:function(t,n){return un().memoizedState=[t,n===void 0?null:n],t},useContext:Qt,useEffect:Gp,useImperativeHandle:function(t,n,r){r=r!=null?r.concat([t]):null,Os(4194308,4,Xp.bind(null,n,t),r)},useLayoutEffect:function(t,n){return Os(4194308,4,t,n)},useInsertionEffect:function(t,n){Os(4,2,t,n)},useMemo:function(t,n){var r=un();n=n===void 0?null:n;var l=t();if(ei){$t(!0);try{t()}finally{$t(!1)}}return r.memoizedState=[l,n],l},useReducer:function(t,n,r){var l=un();if(r!==void 0){var f=r(n);if(ei){$t(!0);try{r(n)}finally{$t(!1)}}}else f=n;return l.memoizedState=l.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},l.queue=t,t=t.dispatch=AS.bind(null,He,t),[l.memoizedState,t]},useRef:function(t){var n=un();return t={current:t},n.memoizedState=t},useState:function(t){t=pf(t);var n=t.queue,r=ly.bind(null,He,n);return n.dispatch=r,[t.memoizedState,r]},useDebugValue:vf,useDeferredValue:function(t,n){var r=un();return bf(r,t,n)},useTransition:function(){var t=pf(!1);return t=ny.bind(null,He,t.queue,!0,!1),un().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,r){var l=He,f=un();if(Ke){if(r===void 0)throw Error(o(407));r=r()}else{if(r=n(),pt===null)throw Error(o(349));(Ye&127)!==0||Cp(l,n,r)}f.memoizedState=r;var h={value:r,getSnapshot:n};return f.queue=h,Gp(Op.bind(null,l,h,t),[t]),l.flags|=2048,Zi(9,{destroy:void 0},Mp.bind(null,l,h,r,n),null),r},useId:function(){var t=un(),n=pt.identifierPrefix;if(Ke){var r=ha,l=da;r=(l&~(1<<32-Wt(l)-1)).toString(32)+r,n="_"+n+"R_"+r,r=js++,0<\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?v.createElement("select",{is:l.is}):v.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?v.createElement(f,{is:l.is}):v.createElement(f)}}h[ye]=n,h[Se]=l;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)h.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===n)break e;for(;v.sibling===null;){if(v.return===null||v.return===n)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}n.stateNode=h;e:switch(Gt(h,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Ha(n)}}return bt(n),Lf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,r),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==l&&Ha(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(o(166));if(t=pe.current,Mi(n)){if(t=n.stateNode,r=n.memoizedProps,l=null,f=Ft,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}t[ye]=n,t=!!(t.nodeValue===r||l!==null&&l.suppressHydrationWarning===!0||jg(t.nodeValue,r)),t||ir(n,!0)}else t=tu(t).createTextNode(l),t[ye]=n,n.stateNode=t}return bt(n),null;case 31:if(r=n.memoizedState,t===null||t.memoizedState!==null){if(l=Mi(n),r!==null){if(t===null){if(!l)throw Error(o(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[ye]=n}else Gr(),(n.flags&128)===0&&(n.memoiz)DELIM" -R"DELIM(edState=null),n.flags|=4;bt(n),t=!1}else r=Qc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return n.flags&256?(jn(n),n):(jn(n),null);if((n.flags&128)!==0)throw Error(o(558))}return bt(n),null;case 13:if(l=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=Mi(n),l!==null&&l.dehydrated!==null){if(t===null){if(!f)throw Error(o(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(o(317));f[ye]=n}else Gr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;bt(n),f=!1}else f=Qc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(jn(n),n):(jn(n),null)}return jn(n),(n.flags&128)!==0?(n.lanes=r,n):(r=l!==null,t=t!==null&&t.memoizedState!==null,r&&(l=n.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==f&&(l.flags|=2048)),r!==t&&r&&(n.child.flags|=8192),$s(n,n.updateQueue),bt(n),null);case 4:return H(),t===null&&rd(n.stateNode.containerInfo),bt(n),null;case 10:return Da(n.type),bt(n),null;case 19:if(K(Ct),l=n.memoizedState,l===null)return bt(n),null;if(f=(n.flags&128)!==0,h=l.rendering,h===null)if(f)Go(l,!1);else{if(Rt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=As(t),h!==null){for(n.flags|=128,Go(l,!1),t=h.updateQueue,n.updateQueue=t,$s(n,t),n.subtreeFlags=0,t=r,r=n.child;r!==null;)lp(r,t),r=r.sibling;return I(Ct,Ct.current&1|2),Ke&&Oa(n,l.treeForkCount),n.child}t=t.sibling}l.tail!==null&&Pt()>Qs&&(n.flags|=128,f=!0,Go(l,!1),n.lanes=4194304)}else{if(!f)if(t=As(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,$s(n,t),Go(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!Ke)return bt(n),null}else 2*Pt()-l.renderingStartTime>Qs&&r!==536870912&&(n.flags|=128,f=!0,Go(l,!1),n.lanes=4194304);l.isBackwards?(h.sibling=n.child,n.child=h):(t=l.last,t!==null?t.sibling=h:n.child=h,l.last=h)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Pt(),t.sibling=null,r=Ct.current,I(Ct,f?r&1|2:r&1),Ke&&Oa(n,l.treeForkCount),t):(bt(n),null);case 22:case 23:return jn(n),rf(),l=n.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(r&536870912)!==0&&(n.flags&128)===0&&(bt(n),n.subtreeFlags&6&&(n.flags|=8192)):bt(n),r=n.updateQueue,r!==null&&$s(n,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==r&&(n.flags|=2048),t!==null&&K(Ir),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Da(kt),bt(n),null;case 25:return null;case 30:return null}throw Error(o(156,n.tag))}function MS(t,n){switch(Pc(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Da(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(jn(n),n.alternate===null)throw Error(o(340));Gr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(jn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(o(340));Gr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return K(Ct),null;case 4:return H(),null;case 10:return Da(n.type),null;case 22:case 23:return jn(n),rf(),t!==null&&K(Ir),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Da(kt),null;case 25:return null;default:return null}}function ky(t,n){switch(Pc(n),n.tag){case 3:Da(kt),H();break;case 26:case 27:case 5:he(n);break;case 4:H();break;case 31:n.memoizedState!==null&&jn(n);break;case 13:jn(n);break;case 19:K(Ct);break;case 10:Da(n.type);break;case 22:case 23:jn(n),rf(),t!==null&&K(Ir);break;case 24:Da(kt)}}function Vo(t,n){try{var r=n.updateQueue,l=r!==null?r.lastEffect:null;if(l!==null){var f=l.next;r=f;do{if((r.tag&t)===t){l=void 0;var h=r.create,v=r.inst;l=h(),v.destroy=l}r=r.next}while(r!==f)}}catch(S){ut(n,n.return,S)}}function dr(t,n,r){try{var l=n.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var h=f.next;l=h;do{if((l.tag&t)===t){var v=l.inst,S=v.destroy;if(S!==void 0){v.destroy=void 0,f=n;var A=r,Z=S;try{Z()}catch(J){ut(f,A,J)}}}l=l.next}while(l!==h)}}catch(J){ut(n,n.return,J)}}function Dy(t){var n=t.updateQueue;if(n!==null){var r=t.stateNode;try{Tp(n,r)}catch(l){ut(t,t.return,l)}}}function Ly(t,n,r){r.props=ti(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(l){ut(t,n,l)}}function Ko(t,n){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof r=="function"?t.refCleanup=r(l):r.current=l}}catch(f){ut(t,n,f)}}function ma(t,n){var r=t.ref,l=t.refCleanup;if(r!==null)if(typeof l=="function")try{l()}catch(f){ut(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){ut(t,n,f)}else r.current=null}function By(t){var n=t.type,r=t.memoizedProps,l=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&l.focus();break e;case"img":r.src?l.src=r.src:r.srcSet&&(l.srcset=r.srcSet)}}catch(f){ut(t,t.return,f)}}function Bf(t,n,r){try{var l=t.stateNode;ew(l,t.type,r,n),l[Se]=n}catch(f){ut(t,t.return,f)}}function Uy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&br(t.type)||t.tag===4}function Uf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Uy(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&&br(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 Hf(t,n,r){var l=t.tag;if(l===5||l===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(l!==4&&(l===27&&br(t.type)&&(r=t.stateNode,n=null),t=t.child,t!==null))for(Hf(t,n,r),t=t.sibling;t!==null;)Hf(t,n,r),t=t.sibling}function Zs(t,n,r){var l=t.tag;if(l===5||l===6)t=t.stateNode,n?r.insertBefore(t,n):r.appendChild(t);else if(l!==4&&(l===27&&br(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(Zs(t,n,r),t=t.sibling;t!==null;)Zs(t,n,r),t=t.sibling}function Hy(t){var n=t.stateNode,r=t.memoizedProps;try{for(var l=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);Gt(n,l,r),n[ye]=t,n[Se]=r}catch(h){ut(t,t.return,h)}}var $a=!1,Bt=!1,$f=!1,$y=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function OS(t,n){if(t=t.containerInfo,ld=su,t=Jm(t),Mc(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var l=r.getSelection&&r.getSelection();if(l&&l.rangeCount!==0){r=l.anchorNode;var f=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var v=0,S=-1,A=-1,Z=0,J=0,ae=t,Y=null;t:for(;;){for(var V;ae!==r||f!==0&&ae.nodeType!==3||(S=v+f),ae!==h||l!==0&&ae.nodeType!==3||(A=v+l),ae.nodeType===3&&(v+=ae.nodeValue.length),(V=ae.firstChild)!==null;)Y=ae,ae=V;for(;;){if(ae===t)break t;if(Y===r&&++Z===f&&(S=v),Y===h&&++J===l&&(A=v),(V=ae.nextSibling)!==null)break;ae=Y,Y=ae.parentNode}ae=V}r=S===-1||A===-1?null:{start:S,end:A}}else r=null}r=r||{start:0,end:0}}else r=null;for(sd={focusedElem:t,selectionRange:r},su=!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)DELIM" -R"DELIM((r=0;r title"))),Gt(h,l,r),h[ye]=t,et(h),l=h;break e;case"link":var v=Yg("link","href",f).get(l+(r.href||""));if(v){for(var S=0;Sht&&(v=ht,ht=Me,Me=v);var U=Im(S,Me),M=Im(S,ht);if(U&&M&&(V.rangeCount!==1||V.anchorNode!==U.node||V.anchorOffset!==U.offset||V.focusNode!==M.node||V.focusOffset!==M.offset)){var $=ae.createRange();$.setStart(U.node,U.offset),V.removeAllRanges(),Me>ht?(V.addRange($),V.extend(M.node,M.offset)):($.setEnd(M.node,M.offset),V.addRange($))}}}}for(ae=[],V=S;V=V.parentNode;)V.nodeType===1&&ae.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;Sr?32:r,L.T=null,r=Gf,Gf=null;var h=yr,v=Qa;if(Ht=0,Yi=yr=null,Qa=0,(rt&6)!==0)throw Error(o(331));var S=rt;if(rt|=4,Xy(h.current),Vy(h,h.current,v,r),rt=S,tl(0,!1),on&&typeof on.onPostCommitFiberRoot=="function")try{on.onPostCommitFiberRoot(Ta,h)}catch{}return!0}finally{O.p=f,L.T=l,pg(t,n)}}function gg(t,n,r){n=qn(r,n),n=Rf(t.stateNode,n,2),t=ur(t,n,2),t!==null&&(fa(t,2),pa(t))}function ut(t,n,r){if(t.tag===3)gg(t,t,r);else for(;n!==null;){if(n.tag===3){gg(n,t,r);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(pr===null||!pr.has(l))){t=qn(r,t),r=vy(2),l=ur(n,r,2),l!==null&&(by(r,l,n,t),fa(l,2),pa(l));break}}n=n.return}}function Xf(t,n,r){var l=t.pingCache;if(l===null){l=t.pingCache=new LS;var f=new Set;l.set(n,f)}else f=l.get(n),f===void 0&&(f=new Set,l.set(n,f));f.has(r)||(Pf=!0,f.add(r),t=ZS.bind(null,t,n,r),n.then(t,t))}function ZS(t,n,r){var l=t.pingCache;l!==null&&l.delete(n),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,pt===t&&(Ye&r)===r&&(Rt===4||Rt===3&&(Ye&62914560)===Ye&&300>Pt()-Fs?(rt&2)===0&&Gi(t,0):Ff|=r,Qi===Ye&&(Qi=0)),pa(t)}function vg(t,n){n===0&&(n=wo()),t=Qr(t,n),t!==null&&(fa(t,n),pa(t))}function qS(t){var n=t.memoizedState,r=0;n!==null&&(r=n.retryLane),vg(t,r)}function PS(t,n){var r=0;switch(t.tag){case 31:case 13:var l=t.stateNode,f=t.memoizedState;f!==null&&(r=f.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(n),vg(t,r)}function FS(t,n){return yt(t,n)}var Xs=null,Ki=null,Jf=!1,Js=!1,Wf=!1,vr=0;function pa(t){t!==Ki&&t.next===null&&(Ki===null?Xs=Ki=t:Ki=Ki.next=t),Js=!0,Jf||(Jf=!0,YS())}function tl(t,n){if(!Wf&&Js){Wf=!0;do for(var r=!1,l=Xs;l!==null;){if(t!==0){var f=l.pendingLanes;if(f===0)var h=0;else{var v=l.suspendedLanes,S=l.pingedLanes;h=(1<<31-Wt(42|t)+1)-1,h&=f&~(v&~S),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,wg(l,h))}else h=Ye,h=yi(l,l===pt?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||Wa(l,h)||(r=!0,wg(l,h));l=l.next}while(r);Wf=!1}}function QS(){bg()}function bg(){Js=Jf=!1;var t=0;vr!==0&&nw()&&(t=vr);for(var n=Pt(),r=null,l=Xs;l!==null;){var f=l.next,h=xg(l,n);h===0?(l.next=null,r===null?Xs=f:r.next=f,f===null&&(Ki=r)):(r=l,(t!==0||(h&3)!==0)&&(Js=!0)),l=f}Ht!==0&&Ht!==5||tl(t),vr!==0&&(vr=0)}function xg(t,n){for(var r=t.suspendedLanes,l=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0S)break;var J=A.transferSize,ae=A.initiatorType;J&&zg(ae)&&(A=A.responseEnd,v+=J*(A"u"?null:document;function qg(t,n,r){var l=Ii;if(l&&typeof n=="string"&&n){var f=sn(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof r=="string"&&(f+='[crossorigin="'+r+'"]'),Zg.has(f)||(Zg.add(f),t={rel:t,crossOrigin:r,href:n},l.querySelector(f)===null&&(n=l.createElement("link"),Gt(n,"link",t),et(n),l.head.appendChild(n)))}}function fw(t){Ya.D(t),qg("dns-prefetch",t,null)}function dw(t,n){Ya.C(t,n),qg("preconnect",t,n)}function hw(t,n,r){Ya.L(t,n,r);var l=Ii;if(l&&t&&n){var f='link[rel="preload"][as="'+sn(n)+'"]';n==="image"&&r&&r.imageSrcSet?(f+='[imagesrcset="'+sn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(f+='[imagesizes="'+sn(r.imageSizes)+'"]')):f+='[href="'+sn(t)+'"]';var h=f;switch(n){case"style":h=Xi(t);break;case"script":h=Ji(t)}Vn.has(h)||(t=g({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:t,as:n},r),Vn.set(h,t),l.querySelector(f)!==null||n==="style"&&l.querySelector(il(h))||n==="script"&&l.querySelector(ol(h))||(n=l.createElement("link"),Gt(n,"link",t),et(n),l.head.appendChild(n)))}}function mw(t,n){Ya.m(t,n);var r=Ii;if(r&&t){var l=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+sn(l)+'"][href="'+sn(t)+'"]',h=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ji(t)}if(!Vn.has(h)&&(t=g({rel:"modulepreload",href:t},n),Vn.set(h,t),r.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(ol(h)))return}l=r.createElement("link"),Gt(l,"link",t),et(l),r.head.appendChild(l)}}}function pw(t,n,r){Ya.S(t,n,r);var l=Ii;if(l&&t){var f=zt(l).hoistableStyles,h=Xi(t);n=n||"default";var v=f.get(h);if(!v){var S={loading:0,preload:null};if(v=l.querySelector(il(h)))S.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":n},r),(r=Vn.get(h))&&pd(t,r);var A=v=l.createElement("link");et(A),Gt(A,"link",t),A._p=new Promise(function(Z,J){A.onload=Z,A.onerror=J}),A.addEventListener("load",function(){S.loading|=1}),A.addEventListener("error",function(){S.loading|=2}),S.load)DELIM" -R"DELIM(ing|=4,au(v,n,l)}v={type:"stylesheet",instance:v,count:1,state:S},f.set(h,v)}}}function yw(t,n){Ya.X(t,n);var r=Ii;if(r&&t){var l=zt(r).hoistableScripts,f=Ji(t),h=l.get(f);h||(h=r.querySelector(ol(f)),h||(t=g({src:t,async:!0},n),(n=Vn.get(f))&&yd(t,n),h=r.createElement("script"),et(h),Gt(h,"link",t),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function gw(t,n){Ya.M(t,n);var r=Ii;if(r&&t){var l=zt(r).hoistableScripts,f=Ji(t),h=l.get(f);h||(h=r.querySelector(ol(f)),h||(t=g({src:t,async:!0,type:"module"},n),(n=Vn.get(f))&&yd(t,n),h=r.createElement("script"),et(h),Gt(h,"link",t),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function Pg(t,n,r,l){var f=(f=pe.current)?nu(f):null;if(!f)throw Error(o(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=zt(f).hoistableStyles,l=r.get(n),l||(l={type:"style",instance:null,count:0,state:null},r.set(n,l)),l):{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=zt(f).hoistableStyles,v=h.get(t);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,v),(h=f.querySelector(il(t)))&&!h._p&&(v.instance=h,v.state.loading=5),Vn.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},Vn.set(t,r),h||vw(f,t,r,v.state))),n&&l===null)throw Error(o(528,""));return v}if(n&&l!==null)throw Error(o(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ji(r),r=zt(f).hoistableScripts,l=r.get(n),l||(l={type:"script",instance:null,count:0,state:null},r.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function Xi(t){return'href="'+sn(t)+'"'}function il(t){return'link[rel="stylesheet"]['+t+"]"}function Fg(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function vw(t,n,r,l){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?l.loading=1:(n=t.createElement("link"),l.preload=n,n.addEventListener("load",function(){return l.loading|=1}),n.addEventListener("error",function(){return l.loading|=2}),Gt(n,"link",r),et(n),t.head.appendChild(n))}function Ji(t){return'[src="'+sn(t)+'"]'}function ol(t){return"script[async]"+t}function Qg(t,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var l=t.querySelector('style[data-href~="'+sn(r.href)+'"]');if(l)return n.instance=l,et(l),l;var f=g({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),et(l),Gt(l,"style",f),au(l,r.precedence,t),n.instance=l;case"stylesheet":f=Xi(r.href);var h=t.querySelector(il(f));if(h)return n.state.loading|=4,n.instance=h,et(h),h;l=Fg(r),(f=Vn.get(f))&&pd(l,f),h=(t.ownerDocument||t).createElement("link"),et(h);var v=h;return v._p=new Promise(function(S,A){v.onload=S,v.onerror=A}),Gt(h,"link",l),n.state.loading|=4,au(h,r.precedence,t),n.instance=h;case"script":return h=Ji(r.src),(f=t.querySelector(ol(h)))?(n.instance=f,et(f),f):(l=r,(f=Vn.get(h))&&(l=g({},r),yd(l,f)),t=t.ownerDocument||t,f=t.createElement("script"),et(f),Gt(f,"link",l),t.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(o(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(l=n.instance,n.state.loading|=4,au(l,r.precedence,t));return n.instance}function au(t,n,r){for(var l=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,h=f,v=0;v title"):null)}function bw(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 Vg(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function xw(t,n,r,l){if(r.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var f=Xi(l.href),h=n.querySelector(il(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=iu.bind(t),n.then(t,t)),r.state.loading|=4,r.instance=h,et(h);return}h=n.ownerDocument||n,l=Fg(l),(f=Vn.get(f))&&pd(l,f),h=h.createElement("link"),et(h);var v=h;v._p=new Promise(function(S,A){v.onload=S,v.onerror=A}),Gt(h,"link",l),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=iu.bind(t),n.addEventListener("load",r),n.addEventListener("error",r))}}var gd=0;function Sw(t,n){return t.stylesheets&&t.count===0&&lu(t,t.stylesheets),0gd?50:800)+n);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function iu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var ou=null;function lu(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,ou=new Map,n.forEach(ww,t),ou=null,iu.call(t))}function ww(t,n){if(!(n.state.loading&4)){var r=ou.get(t);if(r)var l=r.get(null);else{r=new Map,ou.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(),Rd.exports=Hw(),Rd.exports}var Zw=$w();const qw=Mh(Zw);var ql=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(){}},Pw=class extends ql{#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"}},kh=new Pw,Fw={setTimeout:(e,a)=>setTimeout(e,a),clearTimeout:e=>clearTimeout(e),setInterval:(e,a)=>setInterval(e,a),clearInterval:e=>clearInterval(e)},Qw=class{#e=Fw;#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)}},li=new Qw;function Yw(e){setTimeout(e,0)}var Gw=typeof window>"u"||"Deno"in globalThis;function xn(){}function Vw(e,a){return typeof e=="function"?e(a):e}function ih(e){return typeof e=="number"&&e>=0&&e!==1/0}function lb(e,a){return Math.max(e+(a||0)-Date.now(),0)}function kr(e,a){return typeof e=="function"?e(a):e}function On(e,a){return typeof e=="function"?e(a):e}function vv(e,a){const{type:i="all",exact:o,fetchStatus:s,predicate:u,queryKey:c,stale:d}=e;if(c){if(o){if(a.queryHash!==Dh(c,a.options))return!1}else if(!zl(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 bv(e,a){const{exact:i,status:o,predicate:s,mutationKey:u}=e;if(u){if(!a.options.mutationKey)return!1;if(i){if(jl(a.options.mutationKey)!==jl(u))return!1}else if(!zl(a.options.mutationKey,u))return!1}return!(o&&a.state.status!==o||s&&!s(a))}function Dh(e,a){return(a?.queryKeyHashFn||jl)(e)}function jl(e){return JSON.stringify(e,(a,i)=>lh(i)?Object.keys(i).sort().reduce((o,s)=>(o[s]=i[s],o),{}):i)}function zl(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(i=>zl(e[i],a[i])):!1}var Kw=Object.prototype.hasOwnProperty;function sb(e,a,i=0){if(e===a)return e;if(i>500)return a;const o=xv(e)&&xv(a);if(!o&&!(lh(e)&&lh(a)))return a;const u=(o?e:Object.keys(e)).length,c=o?a:Object.keys(a),d=c.length,m=o?new Array(d):{};let p=0;for(let b=0;b{li.setTimeout(a,e)})}function sh(e,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,a):i.structuralSharing!==!1?sb(e,a):a}function Xw(e,a,i=0){const o=[...e,a];return i&&o.length>i?o.slice(1):o}function Jw(e,a,i=0){const o=[a,...e];return i&&o.length>i?o.slice(0,-1):o}var Lh=Symbol();function ub(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===Lh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function cb(e,a){return typeof e=="function"?e(...a):!!e}function Ww(e,a,i){let o=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=a(),o||(o=!0,s.aborted?i():s.addEventListener("abort",i,{once:!0})),s)}),e}var Cl=(()=>{let e=()=>Gw;return{isServer(){return e()},setIsServer(a){e=a}}})();function uh(){let e,a;const i=new Promise((s,u)=>{e=s,a=u});i.status="pending",i.catch(()=>{});function o(s){Object.assign(i,s),delete i.resolve,delete i.reject}return i.resolve=s=>{o({status:"fulfilled",value:s}),e(s)},i.reject=s=>{o({status:"rejected",reason:s}),a(s)},i}var eE=Yw;function tE(){let e=[],a=0,i=d=>{d()},o=d=>{d()},s=eE;const u=d=>{a?e.push(d):s(()=>{i(d)})},c=()=>{const d=e;e=[],d.length&&s(()=>{o(()=>{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=>{o=d},setScheduler:d=>{s=d}}}var Kt=tE(),nE=class extends ql{#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))}setO)DELIM" -R"DELIM(nline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#e}},qu=new nE;function aE(e){return Math.min(1e3*2**e,3e4)}function fb(e){return(e??"online")==="online"?qu.isOnline():!0}var ch=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function db(e){let a=!1,i=0,o;const s=uh(),u=()=>s.status!=="pending",c=C=>{if(!u()){const R=new ch(C);x(R),e.onCancel?.(R)}},d=()=>{a=!0},m=()=>{a=!1},p=()=>kh.isFocused()&&(e.networkMode==="always"||qu.isOnline())&&e.canRun(),b=()=>fb(e.networkMode)&&e.canRun(),g=C=>{u()||(o?.(),s.resolve(C))},x=C=>{u()||(o?.(),s.reject(C))},w=()=>new Promise(C=>{o=R=>{(u()||p())&&C(R)},e.onPause?.()}).then(()=>{o=void 0,u()||e.onContinue?.()}),T=()=>{if(u())return;let C;const R=i===0?e.initialPromise:void 0;try{C=R??e.fn()}catch(q){C=Promise.reject(q)}Promise.resolve(C).then(g).catch(q=>{if(u())return;const G=e.retry??(Cl.isServer()?0:3),X=e.retryDelay??aE,le=typeof X=="function"?X(i,q):X,ne=G===!0||typeof G=="number"&&ip()?void 0:w()).then(()=>{a?x(q):T()})})};return{promise:s,status:()=>s.status,cancel:c,continue:()=>(o?.(),s),cancelRetry:d,continueRetry:m,canStart:b,start:()=>(b()?T():w().then(T),s)}}var hb=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ih(this.gcTime)&&(this.#e=li.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Cl.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(li.clearTimeout(this.#e),this.#e=void 0)}};function rE(e){return{onFetch:(a,i)=>{const o=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=T=>{Ww(T,()=>a.signal,()=>b=!0)},x=ub(a.options,a.fetchOptions),w=async(T,C,R)=>{if(b)return Promise.reject(a.signal.reason);if(C==null&&T.pages.length)return Promise.resolve(T);const G=(()=>{const ge={client:a.client,queryKey:a.queryKey,pageParam:C,direction:R?"backward":"forward",meta:a.options.meta};return g(ge),ge})(),X=await x(G),{maxPages:le}=a.options,ne=R?Jw:Xw;return{pages:ne(T.pages,X,le),pageParams:ne(T.pageParams,C,le)}};if(s&&u.length){const T=s==="backward",C=T?iE:wv,R={pages:u,pageParams:c},q=C(o,R);d=await w(R,q,T)}else{const T=e??u.length;do{const C=m===0?c[0]??o.initialPageParam:wv(o,d);if(m>0&&C==null)break;d=await w(d,C),m++}while(ma.options.persister?.(p,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=p}}}function wv(e,{pages:a,pageParams:i}){const o=a.length-1;return a.length>0?e.getNextPageParam(a[o],a,i[o],i):void 0}function iE(e,{pages:a,pageParams:i}){return a.length>0?e.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var oE=class extends hb{#e;#t;#n;#a;#i;#r;#l;#o;constructor(e){super(),this.#o=!1,this.#l=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=_v(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.#l,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=_v(this.options);a.data!==void 0&&(this.setState(Ev(a.data,a.dataUpdatedAt)),this.#t=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(e,a){const i=sh(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(xn).catch(xn):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=>On(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Lh||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>kr(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:!lb(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.#o||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,o=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#o=!0,i.signal)})},s=()=>{const m=ub(this.options,a),b=(()=>{const g={client:this.#i,queryKey:this.queryKey,meta:this.meta};return o(g),g})();return this.#o=!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 o(m),m})();(this.#e==="infinite"?rE(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=db({initialPromise:a?.initialPromise,fn:c.fetchFn,onCancel:m=>{m instanceof ch&&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 ch){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,...mb(i.data,this.options),fetchMeta:e.meta??null};case"success":const o={...i,...Ev(e.data,e.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount)DELIM" -R"DELIM(:0,fetchFailureReason:null}};return this.#n=e.manual?o:void 0,o;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),Kt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:e})})}};function mb(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:fb(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ev(e,a){return{data:e,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function _v(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,i=a!==void 0,o=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var lE=class extends ql{constructor(e,a){super(),this.options=a,this.#e=e,this.#o=null,this.#l=uh(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#a=void 0;#i;#r;#l;#o;#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),Tv(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fh(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fh(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 On(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&&!oh(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&Rv(this.#t,i,this.options,a)&&this.#h(),this.updateResult(),o&&(this.#t!==i||On(this.options.enabled,this.#t)!==On(a.enabled,this.#t)||kr(this.options.staleTime,this.#t)!==kr(a.staleTime,this.#t))&&this.#y();const s=this.#g();o&&(this.#t!==i||On(this.options.enabled,this.#t)!==On(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 uE(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,o)=>(this.trackProp(o),a?.(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#l.status==="pending"&&this.#l.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,o))})}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(xn)),a}#y(){this.#x();const e=kr(this.options.staleTime,this.#t);if(Cl.isServer()||this.#a.isStale||!ih(e))return;const i=lb(this.#a.dataUpdatedAt,e)+1;this.#f=li.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,!(Cl.isServer()||On(this.options.enabled,this.#t)===!1||!ih(this.#u)||this.#u===0)&&(this.#d=li.setInterval(()=>{(this.options.refetchIntervalInBackground||kh.isFocused())&&this.#h()},this.#u))}#b(){this.#y(),this.#v(this.#g())}#x(){this.#f!==void 0&&(li.clearTimeout(this.#f),this.#f=void 0)}#S(){this.#d!==void 0&&(li.clearInterval(this.#d),this.#d=void 0)}createResult(e,a){const i=this.#t,o=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 E=this.hasListeners(),k=!E&&Tv(e,a),B=E&&Rv(e,i,a,o);(k||B)&&(b={...b,...mb(p.data,e.options)}),a._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:w,errorUpdatedAt:T,status:C}=b;x=b.data;let R=!1;if(a.placeholderData!==void 0&&x===void 0&&C==="pending"){let E;s?.isPlaceholderData&&a.placeholderData===c?.placeholderData?(E=s.data,R=!0):E=typeof a.placeholderData=="function"?a.placeholderData(this.#m?.state.data,this.#m):a.placeholderData,E!==void 0&&(C="success",x=sh(s?.data,E,a),g=!0)}if(a.select&&x!==void 0&&!R)if(s&&x===u?.data&&a.select===this.#c)x=this.#s;else try{this.#c=a.select,x=a.select(x),x=sh(s?.data,x,a),this.#s=x,this.#o=null}catch(E){this.#o=E}this.#o&&(w=this.#o,x=this.#s,T=Date.now(),C="error");const q=b.fetchStatus==="fetching",G=C==="pending",X=C==="error",le=G&&q,ne=x!==void 0,z={status:C,fetchStatus:b.fetchStatus,isPending:G,isSuccess:C==="success",isError:X,isInitialLoading:le,isLoading:le,data:x,dataUpdatedAt:b.dataUpdatedAt,error:w,errorUpdatedAt:T,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:b.dataUpdateCount>m.dataUpdateCount||b.errorUpdateCount>m.errorUpdateCount,isFetching:q,isRefetching:q&&!G,isLoadingError:X&&!ne,isPaused:b.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:X&&ne,isStale:Bh(e,a),refetch:this.refetch,promise:this.#l,isEnabled:On(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const E=z.data!==void 0,k=z.status==="error"&&!E,B=re=>{k?re.reject(z.error):E&&re.resolve(z.data)},Q=()=>{const re=this.#l=z.promise=uh();B(re)},F=this.#l;switch(F.status){case"pending":e.queryHash===i.queryHash&&B(F);break;case"fulfilled":(k||z.data!==F.value)&&Q();break;case"rejected":(!k||z.error!==F.reason)&&Q();break}}return z}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),oh(a,e))return;this.#a=a;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;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.#E({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(e){Kt.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#a)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function sE(e,a){return On(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&On(a.retryOnMount,e)===!1)}function Tv(e,a){return sE(e,a)||e.state.data!==void 0&&fh(e,a,a.refetchOnMount)}function fh(e,a,i){if(On(a.enabled,e)!==!1&&kr(a.staleTime,e)!=="static"){const o=typeof i=="function"?i(e):i;return o==="always"||o!==!1&&Bh(e,a)}return!1}function Rv(e,a,i,o){return(e!==a||On(o.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&Bh(e,i)}function Bh(e,a){return On(a.enabled,e)!==!1&&e.isStaleByTime(kr(a.staleTime,e))}function uE(e,a){return!oh(e.getCurrentResult())DELIM" -R"DELIM(,a)}var cE=class extends hb{#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||fE(),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=db({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 o=this.state.status==="pending",s=!this.#a.canStart();try{if(o)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),Kt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function fE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var dE=class extends ql{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 o=new cE({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:i});return this.add(o),o}add(e){this.#e.add(e);const a=pu(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=pu(e);if(typeof a=="string"){const i=this.#t.get(a);if(i)if(i.length>1){const o=i.indexOf(e);o!==-1&&i.splice(o,1)}else i[0]===e&&this.#t.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=pu(e);if(typeof a=="string"){const o=this.#t.get(a)?.find(s=>s.state.status==="pending");return!o||o===e}else return!0}runNext(e){const a=pu(e);return typeof a=="string"?this.#t.get(a)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Kt.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=>bv(a,i))}findAll(e={}){return this.getAll().filter(a=>bv(e,a))}notify(e){Kt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return Kt.batch(()=>Promise.all(e.map(a=>a.continue().catch(xn))))}};function pu(e){return e.options.scope?.id}var hE=class extends ql{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,a,i){const o=a.queryKey,s=a.queryHash??Dh(o,a);let u=this.get(s);return u||(u=new oE({client:e,queryKey:o,queryHash:s,options:e.defaultQueryOptions(a),state:i,defaultOptions:e.getQueryDefaults(o)}),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(){Kt.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=>vv(a,i))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(i=>vv(e,i)):a}notify(e){Kt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){Kt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Kt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},mE=class{#e;#t;#n;#a;#i;#r;#l;#o;constructor(e={}){this.#e=e.queryCache||new hE,this.#t=e.mutationCache||new dE,this.#n=e.defaultOptions||{},this.#a=new Map,this.#i=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#l=kh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=qu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#l?.(),this.#l=void 0,this.#o?.(),this.#o=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),o=i.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(kr(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(o))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:a,state:i})=>{const o=i.data;return[a,o]})}setQueryData(e,a,i){const o=this.defaultQueryOptions({queryKey:e}),u=this.#e.get(o.queryHash)?.state.data,c=Vw(a,u);if(c!==void 0)return this.#e.build(this,o).setData(c,{...i,manual:!0})}setQueriesData(e,a,i){return Kt.batch(()=>this.#e.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,a,i)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state}removeQueries(e){const a=this.#e;Kt.batch(()=>{a.findAll(e).forEach(i=>{a.remove(i)})})}resetQueries(e,a){const i=this.#e;return Kt.batch(()=>(i.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const i={revert:!0,...a},o=Kt.batch(()=>this.#e.findAll(e).map(s=>s.cancel(i)));return Promise.all(o).then(xn).catch(xn)}invalidateQueries(e,a={}){return Kt.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},o=Kt.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).ma)DELIM" -R"DELIM(p(s=>{let u=s.fetch(void 0,i);return i.throwOnError||(u=u.catch(xn)),s.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(o).then(xn)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const i=this.#e.build(this,a);return i.isStaleByTime(kr(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xn).catch(xn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xn).catch(xn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return qu.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(jl(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#a.values()],i={};return a.forEach(o=>{zl(e,o.queryKey)&&Object.assign(i,o.defaultOptions)}),i}setMutationDefaults(e,a){this.#i.set(jl(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#i.values()],i={};return a.forEach(o=>{zl(e,o.mutationKey)&&Object.assign(i,o.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=Dh(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===Lh&&(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()}},pb=_.createContext(void 0),tc=e=>{const a=_.useContext(pb);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},pE=({client:e,children:a})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(pb.Provider,{value:e,children:a})),yb=_.createContext(!1),yE=()=>_.useContext(yb);yb.Provider;function gE(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var vE=_.createContext(gE()),bE=()=>_.useContext(vE),xE=(e,a,i)=>{const o=i?.state.error&&typeof e.throwOnError=="function"?cb(e.throwOnError,[i.state.error,i]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||o)&&(a.isReset()||(e.retryOnMount=!1))},SE=e=>{_.useEffect(()=>{e.clearReset()},[e])},wE=({result:e,errorResetBoundary:a,throwOnError:i,query:o,suspense:s})=>e.isError&&!a.isReset()&&!e.isFetching&&o&&(s&&e.data===void 0||cb(i,[e.error,o])),EE=e=>{if(e.suspense){const i=s=>s==="static"?s:Math.max(s??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...s)=>i(o(...s)):i(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},_E=(e,a)=>e.isLoading&&e.isFetching&&!a,TE=(e,a)=>e?.suspense&&a.isPending,Av=(e,a,i)=>a.fetchOptimistic(e).catch(()=>{i.clearReset()});function RE(e,a,i){const o=yE(),s=bE(),u=tc(),c=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(c);const d=u.getQueryCache().get(c.queryHash),m=e.subscribed!==!1;c._optimisticResults=o?"isRestoring":m?"optimistic":void 0,EE(c),xE(c,s,d),SE(s);const p=!u.getQueryCache().get(c.queryHash),[b]=_.useState(()=>new a(u,c)),g=b.getOptimisticResult(c),x=!o&&m;if(_.useSyncExternalStore(_.useCallback(w=>{const T=x?b.subscribe(Kt.batchCalls(w)):xn;return b.updateResult(),T},[b,x]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),_.useEffect(()=>{b.setOptions(c)},[c,b]),TE(c,g))throw Av(c,b,s);if(wE({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&&!Cl.isServer()&&_E(g,o)&&(p?Av(c,b,s):d?.promise)?.catch(xn).finally(()=>{b.updateResult()}),c.notifyOnChangeProps?g:b.trackResult(g)}function AE(e,a){return RE(e,lE)}var Nv;function te(e,a,i){function o(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 co extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class gb extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}(Nv=globalThis).__zod_globalConfig??(Nv.__zod_globalConfig={});const Uh=globalThis.__zod_globalConfig;function ci(e){return Uh}function vb(e){const a=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,s])=>a.indexOf(+o)===-1).map(([o,s])=>s)}function dh(e,a){return typeof a=="bigint"?a.toString():a}function nc(e){return{get value(){{const a=e();return Object.defineProperty(this,"value",{value:a}),a}}}}function Hh(e){return e==null}function $h(e){const a=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(a,i)}function NE(e,a){const i=e/a,o=Math.round(i),s=Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-o){};function Ml(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const zE=nc(()=>{if(Uh.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ol(e){if(Ml(e)===!1)return!1;const a=e.constructor;if(a===void 0||typeof a!="function")return!0;const i=a.prototype;return!(Ml(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function xb(e){return Ol(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const CE=new Set(["string","number","symbol"]);function po(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ur(e,a,i){const o=new e._zod.constr(a??e._zod.def);return(!a||i?.parent)&&(o._zod.parent=e),o}function Re(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 ME(e){return Object.keys(e).filter(a=>e[a]._zod.optin==="optional"&&e[a]._zod.optout==="optional")}const OE={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 kE(e,a){const i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=Br(e._zod.def,{g)DELIM" -R"DELIM(et 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 hi(this,"shape",c),c},checks:[]});return Ur(e,u)}function DE(e,a){const i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=Br(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 hi(this,"shape",c),c},checks:[]});return Ur(e,u)}function LE(e,a){if(!Ol(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=Br(e._zod.def,{get shape(){const u={...e._zod.def.shape,...a};return hi(this,"shape",u),u}});return Ur(e,s)}function BE(e,a){if(!Ol(a))throw new Error("Invalid input to safeExtend: expected a plain object");const i=Br(e._zod.def,{get shape(){const o={...e._zod.def.shape,...a};return hi(this,"shape",o),o}});return Ur(e,i)}function UE(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=Br(e._zod.def,{get shape(){const o={...e._zod.def.shape,...a._zod.def.shape};return hi(this,"shape",o),o},get catchall(){return a._zod.def.catchall},checks:a._zod.def.checks??[]});return Ur(e,i)}function HE(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=Br(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 hi(this,"shape",m),m},checks:[]});return Ur(a,c)}function $E(e,a,i){const o=Br(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 hi(this,"shape",u),u}});return Ur(a,o)}function lo(e,a=0){if(e.aborted===!0)return!0;for(let i=a;i{var o;return(o=i).path??(o.path=[]),i.path.unshift(e),i})}function yu(e){return typeof e=="string"?e:e?.message}function fi(e,a,i){const o=e.message?e.message:yu(e.inst?._zod.def?.error?.(e))??yu(a?.error?.(e))??yu(i.customError?.(e))??yu(i.localeError?.(e))??"Invalid input",{inst:s,continue:u,input:c,...d}=e;return d.path??(d.path=[]),d.message=o,a?.reportInput&&(d.input=c),d}function Zh(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function kl(...e){const[a,i,o]=e;return typeof a=="string"?{message:a,code:"custom",input:i,inst:o}:{...a}}const wb=(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,dh,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Eb=te("$ZodError",wb),_b=te("$ZodError",wb,{Parent:Error});function qE(e,a=i=>i.message){const i={},o=[];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))):o.push(a(s));return{formErrors:o,fieldErrors:i}}function PE(e,a=i=>i.message){const i={_errors:[]},o=(s,u=[])=>{for(const c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>o({issues:d},[...u,...c.path]));else if(c.code==="invalid_key")o({issues:c.issues},[...u,...c.path]);else if(c.code==="invalid_element")o({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,o,s)=>{const u=o?{...o,async:!1}:{async:!1},c=a._zod.run({value:i,issues:[]},u);if(c instanceof Promise)throw new co;if(c.issues.length){const d=new(s?.Err??e)(c.issues.map(m=>fi(m,u,ci())));throw bb(d,s?.callee),d}return c.value},Ph=e=>async(a,i,o,s)=>{const u=o?{...o,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=>fi(m,u,ci())));throw bb(d,s?.callee),d}return c.value},ac=e=>(a,i,o)=>{const s=o?{...o,async:!1}:{async:!1},u=a._zod.run({value:i,issues:[]},s);if(u instanceof Promise)throw new co;return u.issues.length?{success:!1,error:new(e??Eb)(u.issues.map(c=>fi(c,s,ci())))}:{success:!0,data:u.value}},FE=ac(_b),rc=e=>async(a,i,o)=>{const s=o?{...o,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=>fi(c,s,ci())))}:{success:!0,data:u.value}},QE=rc(_b),YE=e=>(a,i,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return qh(e)(a,i,s)},GE=e=>(a,i,o)=>qh(e)(a,i,o),VE=e=>async(a,i,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return Ph(e)(a,i,s)},KE=e=>async(a,i,o)=>Ph(e)(a,i,o),IE=e=>(a,i,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return ac(e)(a,i,s)},XE=e=>(a,i,o)=>ac(e)(a,i,o),JE=e=>async(a,i,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return rc(e)(a,i,s)},WE=e=>async(a,i,o)=>rc(e)(a,i,o),e_=/^[cC][0-9a-z]{6,}$/,t_=/^[0-9a-z]+$/,n_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,a_=/^[0-9a-vA-V]{20}$/,r_=/^[A-Za-z0-9]{27}$/,i_=/^[a-zA-Z0-9_-]{21}$/,o_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,l_=/^([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})$/,Cv=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)$/,s_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,u_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function c_(){return new RegExp(u_,"u")}const f_=/^(?:(?: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}|:))$/,h_=/^((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])$/,m_=/^(([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])$/,p_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Tb=/^[A-Za-z0-9_-]*$/,y_=/^https?$/,g_=/^\+[1-9]\d{6,14}$/,Rb="(?:(?:\\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])))",v_=new RegExp(`^${Rb}$`);function Ab(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)DELIM" -R"DELIM(]\\d\\.\\d{${e.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function b_(e){return new RegExp(`^${Ab(e)}$`)}function x_(e){const a=Ab({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${a}(?:${i.join("|")})`;return new RegExp(`^${Rb}T(?:${o})$`)}const S_=e=>{const a=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},w_=/^-?\d+$/,E_=/^-?\d+(?:\.\d+)?$/,__=/^(?:true|false)$/i,T_=/^[^A-Z]*$/,R_=/^[^a-z]*$/,Sn=te("$ZodCheck",(e,a)=>{var i;e._zod??(e._zod={}),e._zod.def=a,(i=e._zod).onattach??(i.onattach=[])}),Nb={number:"number",bigint:"bigint",object:"date"},jb=te("$ZodCheckLessThan",(e,a)=>{Sn.init(e,a);const i=Nb[typeof a.value];e._zod.onattach.push(o=>{const s=o._zod.bag,u=(a.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value{(a.inclusive?o.value<=a.value:o.value{Sn.init(e,a);const i=Nb[typeof a.value];e._zod.onattach.push(o=>{const s=o._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=o=>{(a.inclusive?o.value>=a.value:o.value>a.value)||o.issues.push({origin:i,code:"too_small",minimum:typeof a.value=="object"?a.value.getTime():a.value,input:o.value,inclusive:a.inclusive,inst:e,continue:!a.abort})}}),A_=te("$ZodCheckMultipleOf",(e,a)=>{Sn.init(e,a),e._zod.onattach.push(i=>{var o;(o=i._zod.bag).multipleOf??(o.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):NE(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})}}),N_=te("$ZodCheckNumberFormat",(e,a)=>{Sn.init(e,a),a.format=a.format||"float64";const i=a.format?.includes("int"),o=i?"int":"number",[s,u]=OE[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=w_)}),e._zod.check=c=>{const d=c.value;if(i){if(!Number.isInteger(d)){c.issues.push({expected:o,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:o,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:o,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_=te("$ZodCheckMaxLength",(e,a)=>{var i;Sn.init(e,a),(i=e._zod.def).when??(i.when=o=>{const s=o.value;return!Hh(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum{const s=o.value;if(s.length<=a.maximum)return;const c=Zh(s);o.issues.push({origin:c,code:"too_big",maximum:a.maximum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),z_=te("$ZodCheckMinLength",(e,a)=>{var i;Sn.init(e,a),(i=e._zod.def).when??(i.when=o=>{const s=o.value;return!Hh(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>s&&(o._zod.bag.minimum=a.minimum)}),e._zod.check=o=>{const s=o.value;if(s.length>=a.minimum)return;const c=Zh(s);o.issues.push({origin:c,code:"too_small",minimum:a.minimum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),C_=te("$ZodCheckLengthEquals",(e,a)=>{var i;Sn.init(e,a),(i=e._zod.def).when??(i.when=o=>{const s=o.value;return!Hh(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag;s.minimum=a.length,s.maximum=a.length,s.length=a.length}),e._zod.check=o=>{const s=o.value,u=s.length;if(u===a.length)return;const c=Zh(s),d=u>a.length;o.issues.push({origin:c,...d?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!a.abort})}}),ic=te("$ZodCheckStringFormat",(e,a)=>{var i,o;Sn.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})}):(o=e._zod).check??(o.check=()=>{})}),M_=te("$ZodCheckRegex",(e,a)=>{ic.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})}}),O_=te("$ZodCheckLowerCase",(e,a)=>{a.pattern??(a.pattern=T_),ic.init(e,a)}),k_=te("$ZodCheckUpperCase",(e,a)=>{a.pattern??(a.pattern=R_),ic.init(e,a)}),D_=te("$ZodCheckIncludes",(e,a)=>{Sn.init(e,a);const i=po(a.includes),o=new RegExp(typeof a.position=="number"?`^.{${a.position}}${i}`:i);a.pattern=o,e._zod.onattach.push(s=>{const u=s._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(o)}),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})}}),L_=te("$ZodCheckStartsWith",(e,a)=>{Sn.init(e,a);const i=new RegExp(`^${po(a.prefix)}.*`);a.pattern??(a.pattern=i),e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.startsWith(a.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:o.value,inst:e,continue:!a.abort})}}),B_=te("$ZodCheckEndsWith",(e,a)=>{Sn.init(e,a);const i=new RegExp(`.*${po(a.suffix)}$`);a.pattern??(a.pattern=i),e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.endsWith(a.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:o.value,inst:e,continue:!a.abort})}}),U_=te("$ZodCheckOverwrite",(e,a)=>{Sn.init(e,a),e._zod.check=i=>{i.value=a.tx(i.value)}});class H_{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 o=a.split(` -`).filter(c=>c),s=Math.min(...o.map(c=>c.length-c.trimStart().length)),u=o.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 $_={major:4,minor:4,patch:3},Nt=te("$ZodType",(e,a)=>{var i;e??(e={}),e._zod.def=a,e._zod.bag=e._zod.bag||{},e._zod.version=$_;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const s of o)for(const u of s._zod.onattach)u(e);if(o.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=lo(c),b;for(const g of d){if(g._zod.def.when){if(ZE(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 co;if(b||w instanceof Promise)b=(b??Promise.resolve()).then(async()=>{await w,c.issues.length!==x&&(p||(p=lo(c,x)))});else{if(c.issues.length===x)conti)DELIM" -R"DELIM(nue;p||(p=lo(c,x))}}return b?b.then(()=>c):c},u=(c,d,m)=>{if(lo(c))return c.aborted=!0,c;const p=s(d,o,m);if(p instanceof Promise){if(m.async===!1)throw new co;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 co;return m.then(p=>s(p,o,d))}return s(m,o,d)}}ct(e,"~standard",()=>({validate:s=>{try{const u=FE(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return QE(e,s).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},vendor:"zod",version:1}))}),Fh=te("$ZodString",(e,a)=>{Nt.init(e,a),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??S_(e._zod.bag),e._zod.parse=(i,o)=>{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}}),wt=te("$ZodStringFormat",(e,a)=>{ic.init(e,a),Fh.init(e,a)}),Z_=te("$ZodGUID",(e,a)=>{a.pattern??(a.pattern=l_),wt.init(e,a)}),q_=te("$ZodUUID",(e,a)=>{if(a.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(o===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=Cv(o))}else a.pattern??(a.pattern=Cv());wt.init(e,a)}),P_=te("$ZodEmail",(e,a)=>{a.pattern??(a.pattern=s_),wt.init(e,a)}),F_=te("$ZodURL",(e,a)=>{wt.init(e,a),e._zod.check=i=>{try{const o=i.value.trim();if(!a.normalize&&a.protocol?.source===y_.source&&!/^https?:\/\//i.test(o)){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(o);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=o;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!a.abort})}}}),Q_=te("$ZodEmoji",(e,a)=>{a.pattern??(a.pattern=c_()),wt.init(e,a)}),Y_=te("$ZodNanoID",(e,a)=>{a.pattern??(a.pattern=i_),wt.init(e,a)}),G_=te("$ZodCUID",(e,a)=>{a.pattern??(a.pattern=e_),wt.init(e,a)}),V_=te("$ZodCUID2",(e,a)=>{a.pattern??(a.pattern=t_),wt.init(e,a)}),K_=te("$ZodULID",(e,a)=>{a.pattern??(a.pattern=n_),wt.init(e,a)}),I_=te("$ZodXID",(e,a)=>{a.pattern??(a.pattern=a_),wt.init(e,a)}),X_=te("$ZodKSUID",(e,a)=>{a.pattern??(a.pattern=r_),wt.init(e,a)}),J_=te("$ZodISODateTime",(e,a)=>{a.pattern??(a.pattern=x_(a)),wt.init(e,a)}),W_=te("$ZodISODate",(e,a)=>{a.pattern??(a.pattern=v_),wt.init(e,a)}),e2=te("$ZodISOTime",(e,a)=>{a.pattern??(a.pattern=b_(a)),wt.init(e,a)}),t2=te("$ZodISODuration",(e,a)=>{a.pattern??(a.pattern=o_),wt.init(e,a)}),n2=te("$ZodIPv4",(e,a)=>{a.pattern??(a.pattern=f_),wt.init(e,a),e._zod.bag.format="ipv4"}),a2=te("$ZodIPv6",(e,a)=>{a.pattern??(a.pattern=d_),wt.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})}}}),r2=te("$ZodCIDRv4",(e,a)=>{a.pattern??(a.pattern=h_),wt.init(e,a)}),i2=te("$ZodCIDRv6",(e,a)=>{a.pattern??(a.pattern=m_),wt.init(e,a),e._zod.check=i=>{const o=i.value.split("/");try{if(o.length!==2)throw new Error;const[s,u]=o;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 Cb(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const o2=te("$ZodBase64",(e,a)=>{a.pattern??(a.pattern=p_),wt.init(e,a),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{Cb(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!a.abort})}});function l2(e){if(!Tb.test(e))return!1;const a=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),i=a.padEnd(Math.ceil(a.length/4)*4,"=");return Cb(i)}const s2=te("$ZodBase64URL",(e,a)=>{a.pattern??(a.pattern=Tb),wt.init(e,a),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{l2(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!a.abort})}}),u2=te("$ZodE164",(e,a)=>{a.pattern??(a.pattern=g_),wt.init(e,a)});function c2(e,a=null){try{const i=e.split(".");if(i.length!==3)return!1;const[o]=i;if(!o)return!1;const s=JSON.parse(atob(o));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||a&&(!("alg"in s)||s.alg!==a))}catch{return!1}}const f2=te("$ZodJWT",(e,a)=>{wt.init(e,a),e._zod.check=i=>{c2(i.value,a.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!a.abort})}}),Mb=te("$ZodNumber",(e,a)=>{Nt.init(e,a),e._zod.pattern=e._zod.bag.pattern??E_,e._zod.parse=(i,o)=>{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=te("$ZodNumberFormat",(e,a)=>{N_.init(e,a),Mb.init(e,a)}),h2=te("$ZodBoolean",(e,a)=>{Nt.init(e,a),e._zod.pattern=__,e._zod.parse=(i,o)=>{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}}),m2=te("$ZodUnknown",(e,a)=>{Nt.init(e,a),e._zod.parse=i=>i}),p2=te("$ZodNever",(e,a)=>{Nt.init(e,a),e._zod.parse=(i,o)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function Mv(e,a,i){e.issues.length&&a.issues.push(...Sb(i,e.issues)),a.value[i]=e.value}const y2=te("$ZodArray",(e,a)=>{Nt.init(e,a),e._zod.parse=(i,o)=>{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;cMv(p,i,c))):Mv(m,i,c)}return u.length?Promise.all(u).then(()=>i):i}});function Pu(e,a,i,o,s,u){const c=i in o;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 Ob(e){const a=Object.keys(e.shape);for(const o of a)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const i=ME(e.shape);return{...e,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(i)}}function kb(e,a,i,o,s,u){const c=[],d=s.keySet,m=s.catchall._zod,p=m.def.type,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:[]},o);w instanceof Promise?e.push(w.then(T=>Pu(T,i,x,a,b,g))):Pu(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 g2=te("$ZodObject",(e,a)=>{if(Nt.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 o=nc(()=>Ob(a));ct(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)}})DELIM" -R"DELIM(return m});const s=Ml,u=a.catchall;let c;e._zod.parse=(d,m)=>{c??(c=o.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],T=w._zod.optin==="optional",C=w._zod.optout==="optional",R=w._zod.run({value:p[x],issues:[]},m);R instanceof Promise?b.push(R.then(q=>Pu(q,d,x,p,T,C))):Pu(R,d,x,p,T,C)}return u?kb(b,p,d,m,o.value,e):b.length?Promise.all(b).then(()=>d):d}}),v2=te("$ZodObjectJIT",(e,a)=>{g2.init(e,a);const i=e._zod.parse,o=nc(()=>Ob(a)),s=x=>{const w=new H_(["shape","payload","ctx"]),T=o.value,C=X=>{const le=zv(X);return`shape[${le}]._zod.run({ value: input[${le}], issues: [] }, ctx)`};w.write("const input = payload.value;");const R=Object.create(null);let q=0;for(const X of T.keys)R[X]=`key_${q++}`;w.write("const newResult = {};");for(const X of T.keys){const le=R[X],ne=zv(X),ge=x[X],z=ge?._zod?.optin==="optional",E=ge?._zod?.optout==="optional";w.write(`const ${le} = ${C(X)};`),z&&E?w.write(` - if (${le}.issues.length) { - if (${ne} in input) { - payload.issues = payload.issues.concat(${le}.issues.map(iss => ({ +`+l.stack}}var Ie=Object.prototype.hasOwnProperty,yt=e.unstable_scheduleCallback,en=e.unstable_cancelCallback,_n=e.unstable_shouldYield,er=e.unstable_requestPaint,Qt=e.unstable_now,ea=e.unstable_getCurrentPriorityLevel,mn=e.unstable_ImmediatePriority,_a=e.unstable_UserBlockingPriority,Un=e.unstable_NormalPriority,Tn=e.unstable_LowPriority,$n=e.unstable_IdlePriority,yu=e.log,gu=e.unstable_setDisableYieldValue,Ta=null,ln=null;function Pt(t){if(typeof yu=="function"&&gu(t),ln&&typeof ln.setStrictMode=="function")try{ln.setStrictMode(Ta,t)}catch{}}var tn=Math.clz32?Math.clz32:vu,as=Math.log,rs=Math.LN2;function vu(t){return t>>>=0,t===0?32:31-(as(t)/rs|0)|0}var qr=256,Ra=2621)DELIM" +R"DELIM(44,Fr=4194304;function ta(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 gi(t,n,r){var l=t.pendingLanes;if(l===0)return 0;var f=0,h=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var S=l&134217727;return S!==0?(l=S&~h,l!==0?f=ta(l):(v&=S,v!==0?f=ta(v):r||(r=S&~t,r!==0&&(f=ta(r))))):(S=l&~h,S!==0?f=ta(S):v!==0?f=ta(v):r||(r=l&~t,r!==0&&(f=ta(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 tr(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function bu(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 Ro(){var t=Fr;return Fr<<=1,(Fr&62914560)===0&&(Fr=4194304),t}function nr(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 is(t,n,r,l,f,h){var v=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,j=t.expirationTimes,Z=t.hiddenUpdates;for(r=v&~r;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var ka=/[\n"\\]/g;function cn(t){return t.replace(ka,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function jo(t,n,r,l,f,h,v,S){t.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.type=v:t.removeAttribute("type"),n!=null?v==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+mt(n)):t.value!==""+mt(n)&&(t.value=""+mt(n)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),n!=null?xu(t,v,mt(n)):r!=null?xu(t,v,mt(r)):l!=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=""+mt(S):t.removeAttribute("name")}function Nm(t,n,r,l,f,h,v,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)){xi(t);return}r=r!=null?""+mt(r):"",n=n!=null?""+mt(n):r,S||n===t.value||(t.value=n),t.defaultValue=n}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=S?t.checked:!!l,t.defaultChecked=!!l,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),xi(t)}function xu(t,n,r){n==="number"&<(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function wi(t,n,r,l){if(t=t.options,n){n={};for(var f=0;f"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tu=!1;if(za)try{var ko={};Object.defineProperty(ko,"passive",{get:function(){Tu=!0}}),window.addEventListener("test",ko,ko),window.removeEventListener("test",ko,ko)}catch{Tu=!1}var rr=null,Ru=null,cs=null;function Dm(){if(cs)return cs;var t,n=Ru,r=n.length,l,f="value"in rr?rr.value:rr.textContent,h=f.length;for(t=0;t=Co),Zm=" ",Pm=!1;function qm(t,n){switch(t){case"keyup":return rS.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ri=!1;function oS(t,n){switch(t){case"compositionend":return Fm(n);case"keypress":return n.which!==32?null:(Pm=!0,Zm);case"textInput":return t=n.data,t===Zm&&Pm?null:t;default:return null}}function lS(t,n){if(Ri)return t==="compositionend"||!zu&&qm(t,n)?(t=Dm(),cs=Ru=rr=null,Ri=!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=l}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jm(r)}}function ep(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?ep(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function tp(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 Ou(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 pS=za&&"documentMode"in document&&11>=document.documentMode,ji=null,Du=null,Lo=null,Lu=!1;function np(t,n,r){var l=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Lu||ji==null||ji!==lt(l)||(l=ji,"selectionStart"in l&&Ou(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Lo&&Do(Lo,l)||(Lo=l,l=nc(Du,"onSelect"),0>=v,f-=v,da=1<<32-tn(n)+f|r<He?(Ve=Te,Te=null):Ve=Te.sibling;var at=Y(U,Te,H[He],ne);if(at===null){Te===null&&(Te=Ve);break}t&&Te&&at.alternate===null&&n(U,Te),C=h(at,C,He),nt===null?je=at:nt.sibling=at,nt=at,Te=Ve}if(He===H.length)return r(U,Te),Ke&&Ma(U,He),je;if(Te===null){for(;HeHe?(Ve=Te,Te=null):Ve=Te.sibling;var Rr=Y(U,Te,at.value,ne);if(Rr===null){Te===null&&(Te=Ve);break}t&&Te&&Rr.alternate===null&&n(U,Te),C=h(Rr,C,He),nt===null?je=Rr:nt.sibling=Rr,nt=Rr,Te=Ve}if(at.done)return r(U,Te),Ke&&Ma(U,He),je;if(Te===null){for(;!at.done;He++,at=H.next())at=ae(U,at.value,ne),at!==null&&(C=h(at,C,He),nt===null?je=at:nt.sibling=at,nt=at);return Ke&&Ma(U,He),je}for(Te=l(Te);!at.done;He++,at=H.next())at=V(Te,U,He,at.value,ne),at!==null&&(t&&at.alternate!==null&&Te.delete(at.key===null?He:at.key),C=h(at,C,He),nt===null?je=at:nt.sibling=at,nt=at);return t&&Te.forEach(function(Dw){return n(U,Dw)}),Ke&&Ma(U,He),je}function ht(U,C,H,ne){if(typeof H=="object"&&H!==null&&H.type===z&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case w:e:{for(var je=H.key;C!==null;){if(C.key===je){if(je=H.type,je===z){if(C.tag===7){r(U,C.sibling),ne=f(C,H.props.children),ne.return=U,U=ne;break e}}else if(C.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===E&&ei(je)===C.type){r(U,C.sibling),ne=f(C,H.props),Po(ne,H),ne.return=U,U=ne;break e}r(U,C);break}else n(U,C);C=C.sibling}H.type===z?(ne=Kr(H.props.children,U.mode,ne,H.key),ne.return=U,U=ne):(ne=bs(H.type,H.key,H.props,null,U.mode,ne),Po(ne,H),ne.return=U,U=ne)}return v(U);case T:e:{for(je=H.key;C!==null;){if(C.key===je)if(C.tag===4&&C.stateNode.containerInfo===H.containerInfo&&C.stateNode.implementation===H.implementation){r(U,C.sibling),ne=f(C,H.children||[]),ne.return=U,U=ne;break e}else{r(U,C);break}else n(U,C);C=C.sibling}ne=qu(H,U.mode,ne),ne.return=U,U=ne}return v(U);case E:return H=ei(H),ht(U,C,H,ne)}if(pe(H))return _e(U,C,H,ne);if(F(H)){if(je=F(H),typeof je!="function")throw Error(o(150));return H=je.call(H),Ce(U,C,H,ne)}if(typeof H.then=="function")return ht(U,C,Rs(H),ne);if(H.$$typeof===J)return ht(U,C,ws(U,H),ne);js(U,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,C!==null&&C.tag===6?(r(U,C.sibling),ne=f(C,H),ne.return=U,U=ne):(r(U,C),ne=Pu(H,U.mode,ne),ne.return=U,U=ne),v(U)):r(U,C)}return function(U,C,H,ne){try{Zo=0;var je=ht(U,C,H,ne);return Ui=null,je}catch(Te){if(Te===Bi||Te===_s)throw Te;var nt=Nn(29,Te,null,U.mode);return nt.lanes=ne,nt.return=U,nt}}}var ni=Tp(!0),Rp=Tp(!1),cr=!1;function tf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nf(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 ur(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function fr(t,n,r){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(it&2)!==0){var f=l.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),l.pending=n,n=vs(t),cp(t,null,r),n}return gs(t,l,n,r),vs(t)}function qo(t,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var l=n.lanes;l&=t.pendingLanes,r|=l,n.lanes=r,ls(t,r)}}function af(t,n){var r=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,r===l)){var f=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var v={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};h===null?f=h=v:h=h.next=v,r=r.next}while(r!==null);h===null?f=h=n:h=h.next=n}else f=h=n;r={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=n:t.next=n,r.lastBaseUpdate=n}var rf=!1;function Fo(){if(rf){var t=Li;if(t!==null)throw t}}function Qo(t,n,r,l){rf=!1;var f=t.updateQueue;cr=!1;var h=f.firstBaseUpdate,v=f.lastBaseUpdate,S=f.shared.pending;if(S!==null){f.shared.pending=null;var j=S,Z=j.next;j.next=null,v===null?h=Z:v.next=Z,v=j;var X=t.alternate;X!==null&&(X=X.updateQueue,S=X.lastBaseUpdate,S!==v&&(S===null?X.firstBaseUpdate=Z:S.next=Z,X.lastBaseUpdate=j))}if(h!==null){var ae=f.baseState;v=0,X=Z=j=null,S=h;do{var Y=S.lane&-536870913,V=Y!==S.lane;if(V?(Ge&Y)===Y:(l&Y)===Y){Y!==0&&Y===Di&&(rf=!0),X!==null&&(X=X.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var _e=t,Ce=S;Y=n;var ht=r;switch(Ce.tag){case 1:if(_e=Ce.payload,typeof _e=="function"){ae=_e.call(ht,ae,Y);break e}ae=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=Ce.payload,Y=typeof _e=="function"?_e.call(ht,ae,Y):_e,Y==null)break e;ae=g({},ae,Y);break e;case 2:cr=!0}}Y=S.callback,Y!==null&&(t.flags|=64,V&&(t.flags|=8192),V=f.callbacks,V===null?f.callbacks=[Y]:V.push(Y))}else V={lane:Y,tag:S.tag,payload:S.payload,callback:S.callback,next:null},X===null?(Z=X=V,j=ae):X=X.next=V,v|=Y;if(S=S.next,S===null){if(S=f.shared.pending,S===null)break;V=S,S=V.next,V.next=null,f.lastBaseUpdate=V,f.shared.pending=null}}while(!0);X===null&&(j=ae),f.baseState=j,f.firstBaseUpdate=Z,f.lastBaseUpdate=X,h===null&&(f.shared.lanes=0),yr|=v,t.lanes=v,t.memoizedState=ae}}function jp(t,n){if(typeof t!="function")throw Error(o(191,t));t.call(n)}function Np(t,n){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;th?h:8;var v=O.T,S={};O.T=S,_f(t,!1,n,r);try{var j=f(),Z=O.S;if(Z!==null&&Z(S,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var X=_S(j,l);Vo(t,n,X,Mn(t))}else Vo(t,n,l,Mn(t))}catch(ae){Vo(t,n,{then:function(){},status:"rejected",reason:ae},Mn())}finally{M.p=h,v!==null&&S.types!==null&&(v.types=S.types),O.T=v}}function AS(){}function wf(t,n,r,l){if(t.tag!==5)throw Error(o(476));var f=oy(t).queue;iy(t,f,n,re,r===null?AS:function(){return ly(t),r(l)})}function oy(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ba,lastRenderedState:re},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ba,lastRenderedState:r},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function ly(t){var n=oy(t);n.next===null&&(n=t.alternate.memoizedState),Vo(t,n.next.queue,{},Mn())}function Ef(){return Gt(fl)}function sy(){return Ct().memoizedState}function cy(){return Ct().memoizedState}function zS(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var r=Mn();t=ur(r);var l=fr(n,t,r);l!==null&&(Sn(l,n,r),qo(l,n,r)),n={cache:Xu()},t.payload=n;return}n=n.return}}function CS(t,n,r){var l=Mn();r={lane:l,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Bs(t)?fy(n,r):(r=Hu(t,n,r,l),r!==null&&(Sn(r,t,l),dy(r,n,l)))}function uy(t,n,r){var l=Mn();Vo(t,n,r,l)}function Vo(t,n,r,l){var f={lane:l,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Bs(t))fy(n,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var v=n.lastRenderedState,S=h(v,r);if(f.hasEagerState=!0,f.eagerState=S,jn(S,v))return gs(t,n,f,0),pt===null&&ys(),!1}catch{}if(r=Hu(t,n,f,l),r!==null)return Sn(r,t,l),dy(r,n,l),!0}return!1}function _f(t,n,r,l){if(l={lane:2,revertLane:nd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Bs(t)){if(n)throw Error(o(479))}else n=Hu(t,r,l,2),n!==null&&Sn(n,t,2)}function Bs(t){var n=t.alternate;return t===$e||n!==null&&n===$e}function fy(t,n){Hi=As=!0;var r=t.pending;r===null?n.next=n:(n.next=r.next,r.next=n),t.pending=n}function dy(t,n,r){if((r&4194048)!==0){var l=n.lanes;l&=t.pendingLanes,r|=l,n.lanes=r,ls(t,r)}}var Ko={readContext:Gt,use:Ms,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useLayoutEffect:Nt,useInsertionEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useSyncExternalStore:Nt,useId:Nt,useHostTransitionStatus:Nt,useFormState:Nt,useActionState:Nt,useOptimistic:Nt,useMemoCache:Nt,useCacheRefresh:Nt};Ko.useEffectEvent=Nt;var hy={readContext:Gt,use:Ms,useCallback:function(t,n){return un().memoizedState=[t,n===void 0?null:n],t},useContext:Gt,useEffect:Ip,useImperativeHandle:function(t,n,r){r=r!=null?r.concat([t]):null,Ds(4194308,4,ey.bind(null,n,t),r)},useLayoutEffect:function(t,n){return Ds(4194308,4,t,n)},useInsertionEffect:function(t,n){Ds(4,2,t,n)},useMemo:function(t,n){var r=un();n=n===void 0?null:n;var l=t();if(ai){Pt(!0);try{t()}finally{Pt(!1)}}return r.memoizedState=[l,n],l},useReducer:function(t,n,r){var l=un();if(r!==void 0){var f=r(n);if(ai){Pt(!0);try{r(n)}finally{Pt(!1)}}}else f=n;return l.memoizedState=l.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},l.queue=t,t=t.dispatch=CS.bind(null,$e,t),[l.memoizedState,t]},useRef:function(t){var n=un();return t={current:t},n.memoizedState=t},useState:function(t){t=gf(t);var n=t.queue,r=uy.bind(null,$e,n);return n.dispatch=r,[t.memoizedState,r]},useDebugValue:xf,useDeferredValue:function(t,n){var r=un();return Sf(r,t,n)},useTransition:function(){var t=gf(!1);return t=iy.bind(null,$e,t.queue,!0,!1),un().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,r){var l=$e,f=un();if(Ke){if(r===void 0)throw Error(o(407));r=r()}else{if(r=n(),pt===null)throw Error(o(349));(Ge&127)!==0||Op(l,n,r)}f.memoizedState=r;var h={value:r,getSnapshot:n};return f.queue=h,Ip(Lp.bind(null,l,h,t),[t]),l.flags|=2048,Pi(9,{destroy:void 0},Dp.bind(null,l,h,r,n),null),r},useId:function(){var t=un(),n=pt.identifierPrefix;if(Ke){var r=ha,l=da;r=(l&~(1<<32-tn(l)-1)).toString(32)+r,n="_"+n+"R_"+r,r=zs++,0<\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?v.createElement("select",{is:l.is}):v.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?v.createElement(f,{is:l.is}):v.createElement(f)}}h[ve]=n,h[Se]=l;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)h.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===n)break e;for(;v.sibling===null;){if(v.return===null||v.return===n)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}n.stateNode=h;e:switch(Kt(h,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&$a(n)}}return xt(n),Uf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,r),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==l&&$a(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(o(166));if(t=ye.current,Mi(n)){if(t=n.stateNode,r=n.memoizedProps,l=null,f=Yt,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}t[ve]=n,t=!!(t.nodeValue===r||l!==null&&l.suppressHydrationWarning===!0||Cg(t.nodeValue,r)),t||lr(n,!0)}else t=ac(t).createTextNode(l),t[ve]=n,n.stateNode=t}return xt(n),null;case 31:if(r=n.memoizedState,t===null||t.memoizedState!==null){if(l=Mi(n),r!==null){if(t===null){if(!l)throw Error(o(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[ve]=n}else Ir(),(n.flags&128)===0&&(n.memoiz)DELIM" +R"DELIM(edState=null),n.flags|=4;xt(n),t=!1}else r=Gu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return n.flags&256?(An(n),n):(An(n),null);if((n.flags&128)!==0)throw Error(o(558))}return xt(n),null;case 13:if(l=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=Mi(n),l!==null&&l.dehydrated!==null){if(t===null){if(!f)throw Error(o(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(o(317));f[ve]=n}else Ir(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xt(n),f=!1}else f=Gu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(An(n),n):(An(n),null)}return An(n),(n.flags&128)!==0?(n.lanes=r,n):(r=l!==null,t=t!==null&&t.memoizedState!==null,r&&(l=n.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==f&&(l.flags|=2048)),r!==t&&r&&(n.child.flags|=8192),Ps(n,n.updateQueue),xt(n),null);case 4:return $(),t===null&&od(n.stateNode.containerInfo),xt(n),null;case 10:return Da(n.type),xt(n),null;case 19:if(K(zt),l=n.memoizedState,l===null)return xt(n),null;if(f=(n.flags&128)!==0,h=l.rendering,h===null)if(f)Xo(l,!1);else{if(kt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=ks(t),h!==null){for(n.flags|=128,Xo(l,!1),t=h.updateQueue,n.updateQueue=t,Ps(n,t),n.subtreeFlags=0,t=r,r=n.child;r!==null;)up(r,t),r=r.sibling;return I(zt,zt.current&1|2),Ke&&Ma(n,l.treeForkCount),n.child}t=t.sibling}l.tail!==null&&Qt()>Gs&&(n.flags|=128,f=!0,Xo(l,!1),n.lanes=4194304)}else{if(!f)if(t=ks(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,Ps(n,t),Xo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!Ke)return xt(n),null}else 2*Qt()-l.renderingStartTime>Gs&&r!==536870912&&(n.flags|=128,f=!0,Xo(l,!1),n.lanes=4194304);l.isBackwards?(h.sibling=n.child,n.child=h):(t=l.last,t!==null?t.sibling=h:n.child=h,l.last=h)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Qt(),t.sibling=null,r=zt.current,I(zt,f?r&1|2:r&1),Ke&&Ma(n,l.treeForkCount),t):(xt(n),null);case 22:case 23:return An(n),lf(),l=n.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(r&536870912)!==0&&(n.flags&128)===0&&(xt(n),n.subtreeFlags&6&&(n.flags|=8192)):xt(n),r=n.updateQueue,r!==null&&Ps(n,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==r&&(n.flags|=2048),t!==null&&K(Wr),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Da(Ot),xt(n),null;case 25:return null;case 30:return null}throw Error(o(156,n.tag))}function BS(t,n){switch(Qu(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Da(Ot),$(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return de(n),null;case 31:if(n.memoizedState!==null){if(An(n),n.alternate===null)throw Error(o(340));Ir()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(An(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(o(340));Ir()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return K(zt),null;case 4:return $(),null;case 10:return Da(n.type),null;case 22:case 23:return An(n),lf(),t!==null&&K(Wr),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Da(Ot),null;case 25:return null;default:return null}}function By(t,n){switch(Qu(n),n.tag){case 3:Da(Ot),$();break;case 26:case 27:case 5:de(n);break;case 4:$();break;case 31:n.memoizedState!==null&&An(n);break;case 13:An(n);break;case 19:K(zt);break;case 10:Da(n.type);break;case 22:case 23:An(n),lf(),t!==null&&K(Wr);break;case 24:Da(Ot)}}function Jo(t,n){try{var r=n.updateQueue,l=r!==null?r.lastEffect:null;if(l!==null){var f=l.next;r=f;do{if((r.tag&t)===t){l=void 0;var h=r.create,v=r.inst;l=h(),v.destroy=l}r=r.next}while(r!==f)}}catch(S){ct(n,n.return,S)}}function mr(t,n,r){try{var l=n.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var h=f.next;l=h;do{if((l.tag&t)===t){var v=l.inst,S=v.destroy;if(S!==void 0){v.destroy=void 0,f=n;var j=r,Z=S;try{Z()}catch(X){ct(f,j,X)}}}l=l.next}while(l!==h)}}catch(X){ct(n,n.return,X)}}function Uy(t){var n=t.updateQueue;if(n!==null){var r=t.stateNode;try{Np(n,r)}catch(l){ct(t,t.return,l)}}}function $y(t,n,r){r.props=ri(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(l){ct(t,n,l)}}function Wo(t,n){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof r=="function"?t.refCleanup=r(l):r.current=l}}catch(f){ct(t,n,f)}}function ma(t,n){var r=t.ref,l=t.refCleanup;if(r!==null)if(typeof l=="function")try{l()}catch(f){ct(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){ct(t,n,f)}else r.current=null}function Hy(t){var n=t.type,r=t.memoizedProps,l=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&l.focus();break e;case"img":r.src?l.src=r.src:r.srcSet&&(l.srcset=r.srcSet)}}catch(f){ct(t,t.return,f)}}function $f(t,n,r){try{var l=t.stateNode;iw(l,t.type,r,n),l[Se]=n}catch(f){ct(t,t.return,f)}}function Zy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Sr(t.type)||t.tag===4}function Hf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Zy(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&&Sr(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 Zf(t,n,r){var l=t.tag;if(l===5||l===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=Aa));else if(l!==4&&(l===27&&Sr(t.type)&&(r=t.stateNode,n=null),t=t.child,t!==null))for(Zf(t,n,r),t=t.sibling;t!==null;)Zf(t,n,r),t=t.sibling}function qs(t,n,r){var l=t.tag;if(l===5||l===6)t=t.stateNode,n?r.insertBefore(t,n):r.appendChild(t);else if(l!==4&&(l===27&&Sr(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(qs(t,n,r),t=t.sibling;t!==null;)qs(t,n,r),t=t.sibling}function Py(t){var n=t.stateNode,r=t.memoizedProps;try{for(var l=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);Kt(n,l,r),n[ve]=t,n[Se]=r}catch(h){ct(t,t.return,h)}}var Ha=!1,Bt=!1,Pf=!1,qy=typeof WeakSet=="function"?WeakSet:Set,qt=null;function US(t,n){if(t=t.containerInfo,cd=uc,t=tp(t),Ou(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var l=r.getSelection&&r.getSelection();if(l&&l.rangeCount!==0){r=l.anchorNode;var f=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var v=0,S=-1,j=-1,Z=0,X=0,ae=t,Y=null;t:for(;;){for(var V;ae!==r||f!==0&&ae.nodeType!==3||(S=v+f),ae!==h||l!==0&&ae.nodeType!==3||(j=v+l),ae.nodeType===3&&(v+=ae.nodeValue.length),(V=ae.firstChild)!==null;)Y=ae,ae=V;for(;;){if(ae===t)break t;if(Y===r&&++Z===f&&(S=v),Y===h&&++X===l&&(j=v),(V=ae.nextSibling)!==null)break;ae=Y,Y=ae.parentNode}ae=V}r=S===-1||j===-1?null:{start:S,end:j}}else r=null}r=r||{start:0,end:0}}else r=null;for(ud={focusedElem:t,selectionRange:r},uc=!1,qt=n;qt!==null;)if(n=qt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,qt=t;else for(;qt!==null;){switch(n=qt,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)DELIM" +R"DELIM((r=0;r title"))),Kt(h,l,r),h[ve]=t,et(h),l=h;break e;case"link":var v=Kg("link","href",f).get(l+(r.href||""));if(v){for(var S=0;Sht&&(v=ht,ht=Ce,Ce=v);var U=Wm(S,Ce),C=Wm(S,ht);if(U&&C&&(V.rangeCount!==1||V.anchorNode!==U.node||V.anchorOffset!==U.offset||V.focusNode!==C.node||V.focusOffset!==C.offset)){var H=ae.createRange();H.setStart(U.node,U.offset),V.removeAllRanges(),Ce>ht?(V.addRange(H),V.extend(C.node,C.offset)):(H.setEnd(C.node,C.offset),V.addRange(H))}}}}for(ae=[],V=S;V=V.parentNode;)V.nodeType===1&&ae.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;Sr?32:r,O.T=null,r=Kf,Kf=null;var h=vr,v=Qa;if(Zt=0,Gi=vr=null,Qa=0,(it&6)!==0)throw Error(o(331));var S=it;if(it|=4,eg(h.current),Xy(h,h.current,v,r),it=S,il(0,!1),ln&&typeof ln.onPostCommitFiberRoot=="function")try{ln.onPostCommitFiberRoot(Ta,h)}catch{}return!0}finally{M.p=f,O.T=l,vg(t,n)}}function xg(t,n,r){n=Pn(r,n),n=Nf(t.stateNode,n,2),t=fr(t,n,2),t!==null&&(fa(t,2),pa(t))}function ct(t,n,r){if(t.tag===3)xg(t,t,r);else for(;n!==null;){if(n.tag===3){xg(n,t,r);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(gr===null||!gr.has(l))){t=Pn(r,t),r=Sy(2),l=fr(n,r,2),l!==null&&(wy(r,l,n,t),fa(l,2),pa(l));break}}n=n.return}}function Wf(t,n,r){var l=t.pingCache;if(l===null){l=t.pingCache=new ZS;var f=new Set;l.set(n,f)}else f=l.get(n),f===void 0&&(f=new Set,l.set(n,f));f.has(r)||(Qf=!0,f.add(r),t=YS.bind(null,t,n,r),n.then(t,t))}function YS(t,n,r){var l=t.pingCache;l!==null&&l.delete(n),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,pt===t&&(Ge&r)===r&&(kt===4||kt===3&&(Ge&62914560)===Ge&&300>Qt()-Ys?(it&2)===0&&Vi(t,0):Yf|=r,Yi===Ge&&(Yi=0)),pa(t)}function Sg(t,n){n===0&&(n=Ro()),t=Vr(t,n),t!==null&&(fa(t,n),pa(t))}function GS(t){var n=t.memoizedState,r=0;n!==null&&(r=n.retryLane),Sg(t,r)}function VS(t,n){var r=0;switch(t.tag){case 31:case 13:var l=t.stateNode,f=t.memoizedState;f!==null&&(r=f.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(n),Sg(t,r)}function KS(t,n){return yt(t,n)}var Ws=null,Ii=null,ed=!1,ec=!1,td=!1,xr=0;function pa(t){t!==Ii&&t.next===null&&(Ii===null?Ws=Ii=t:Ii=Ii.next=t),ec=!0,ed||(ed=!0,XS())}function il(t,n){if(!td&&ec){td=!0;do for(var r=!1,l=Ws;l!==null;){if(t!==0){var f=l.pendingLanes;if(f===0)var h=0;else{var v=l.suspendedLanes,S=l.pingedLanes;h=(1<<31-tn(42|t)+1)-1,h&=f&~(v&~S),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,Tg(l,h))}else h=Ge,h=gi(l,l===pt?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||tr(l,h)||(r=!0,Tg(l,h));l=l.next}while(r);td=!1}}function IS(){wg()}function wg(){ec=ed=!1;var t=0;xr!==0&&lw()&&(t=xr);for(var n=Qt(),r=null,l=Ws;l!==null;){var f=l.next,h=Eg(l,n);h===0?(l.next=null,r===null?Ws=f:r.next=f,f===null&&(Ii=r)):(r=l,(t!==0||(h&3)!==0)&&(ec=!0)),l=f}Zt!==0&&Zt!==5||il(t),xr!==0&&(xr=0)}function Eg(t,n){for(var r=t.suspendedLanes,l=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0S)break;var X=j.transferSize,ae=j.initiatorType;X&&Mg(ae)&&(j=j.responseEnd,v+=X*(j"u"?null:document;function Qg(t,n,r){var l=Xi;if(l&&typeof n=="string"&&n){var f=cn(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof r=="string"&&(f+='[crossorigin="'+r+'"]'),Fg.has(f)||(Fg.add(f),t={rel:t,crossOrigin:r,href:n},l.querySelector(f)===null&&(n=l.createElement("link"),Kt(n,"link",t),et(n),l.head.appendChild(n)))}}function yw(t){Ya.D(t),Qg("dns-prefetch",t,null)}function gw(t,n){Ya.C(t,n),Qg("preconnect",t,n)}function vw(t,n,r){Ya.L(t,n,r);var l=Xi;if(l&&t&&n){var f='link[rel="preload"][as="'+cn(n)+'"]';n==="image"&&r&&r.imageSrcSet?(f+='[imagesrcset="'+cn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(f+='[imagesizes="'+cn(r.imageSizes)+'"]')):f+='[href="'+cn(t)+'"]';var h=f;switch(n){case"style":h=Ji(t);break;case"script":h=Wi(t)}Vn.has(h)||(t=g({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:t,as:n},r),Vn.set(h,t),l.querySelector(f)!==null||n==="style"&&l.querySelector(cl(h))||n==="script"&&l.querySelector(ul(h))||(n=l.createElement("link"),Kt(n,"link",t),et(n),l.head.appendChild(n)))}}function bw(t,n){Ya.m(t,n);var r=Xi;if(r&&t){var l=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+cn(l)+'"][href="'+cn(t)+'"]',h=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Wi(t)}if(!Vn.has(h)&&(t=g({rel:"modulepreload",href:t},n),Vn.set(h,t),r.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(ul(h)))return}l=r.createElement("link"),Kt(l,"link",t),et(l),r.head.appendChild(l)}}}function xw(t,n,r){Ya.S(t,n,r);var l=Xi;if(l&&t){var f=At(l).hoistableStyles,h=Ji(t);n=n||"default";var v=f.get(h);if(!v){var S={loading:0,preload:null};if(v=l.querySelector(cl(h)))S.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":n},r),(r=Vn.get(h))&&gd(t,r);var j=v=l.createElement("link");et(j),Kt(j,"link",t),j._p=new Promise(function(Z,X){j.onload=Z,j.onerror=X}),j.addEventListener("load",function(){S.loading|=1}),j.addEventListener("error",function(){S.loading|=2}),S.load)DELIM" +R"DELIM(ing|=4,ic(v,n,l)}v={type:"stylesheet",instance:v,count:1,state:S},f.set(h,v)}}}function Sw(t,n){Ya.X(t,n);var r=Xi;if(r&&t){var l=At(r).hoistableScripts,f=Wi(t),h=l.get(f);h||(h=r.querySelector(ul(f)),h||(t=g({src:t,async:!0},n),(n=Vn.get(f))&&vd(t,n),h=r.createElement("script"),et(h),Kt(h,"link",t),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function ww(t,n){Ya.M(t,n);var r=Xi;if(r&&t){var l=At(r).hoistableScripts,f=Wi(t),h=l.get(f);h||(h=r.querySelector(ul(f)),h||(t=g({src:t,async:!0,type:"module"},n),(n=Vn.get(f))&&vd(t,n),h=r.createElement("script"),et(h),Kt(h,"link",t),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function Yg(t,n,r,l){var f=(f=ye.current)?rc(f):null;if(!f)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=Ji(r.href),r=At(f).hoistableStyles,l=r.get(n),l||(l={type:"style",instance:null,count:0,state:null},r.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Ji(r.href);var h=At(f).hoistableStyles,v=h.get(t);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,v),(h=f.querySelector(cl(t)))&&!h._p&&(v.instance=h,v.state.loading=5),Vn.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},Vn.set(t,r),h||Ew(f,t,r,v.state))),n&&l===null)throw Error(o(528,""));return v}if(n&&l!==null)throw Error(o(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Wi(r),r=At(f).hoistableScripts,l=r.get(n),l||(l={type:"script",instance:null,count:0,state:null},r.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function Ji(t){return'href="'+cn(t)+'"'}function cl(t){return'link[rel="stylesheet"]['+t+"]"}function Gg(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function Ew(t,n,r,l){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?l.loading=1:(n=t.createElement("link"),l.preload=n,n.addEventListener("load",function(){return l.loading|=1}),n.addEventListener("error",function(){return l.loading|=2}),Kt(n,"link",r),et(n),t.head.appendChild(n))}function Wi(t){return'[src="'+cn(t)+'"]'}function ul(t){return"script[async]"+t}function Vg(t,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var l=t.querySelector('style[data-href~="'+cn(r.href)+'"]');if(l)return n.instance=l,et(l),l;var f=g({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),et(l),Kt(l,"style",f),ic(l,r.precedence,t),n.instance=l;case"stylesheet":f=Ji(r.href);var h=t.querySelector(cl(f));if(h)return n.state.loading|=4,n.instance=h,et(h),h;l=Gg(r),(f=Vn.get(f))&&gd(l,f),h=(t.ownerDocument||t).createElement("link"),et(h);var v=h;return v._p=new Promise(function(S,j){v.onload=S,v.onerror=j}),Kt(h,"link",l),n.state.loading|=4,ic(h,r.precedence,t),n.instance=h;case"script":return h=Wi(r.src),(f=t.querySelector(ul(h)))?(n.instance=f,et(f),f):(l=r,(f=Vn.get(h))&&(l=g({},r),vd(l,f)),t=t.ownerDocument||t,f=t.createElement("script"),et(f),Kt(f,"link",l),t.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(o(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(l=n.instance,n.state.loading|=4,ic(l,r.precedence,t));return n.instance}function ic(t,n,r){for(var l=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,h=f,v=0;v title"):null)}function _w(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 Xg(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Tw(t,n,r,l){if(r.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var f=Ji(l.href),h=n.querySelector(cl(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=lc.bind(t),n.then(t,t)),r.state.loading|=4,r.instance=h,et(h);return}h=n.ownerDocument||n,l=Gg(l),(f=Vn.get(f))&&gd(l,f),h=h.createElement("link"),et(h);var v=h;v._p=new Promise(function(S,j){v.onload=S,v.onerror=j}),Kt(h,"link",l),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=lc.bind(t),n.addEventListener("load",r),n.addEventListener("error",r))}}var bd=0;function Rw(t,n){return t.stylesheets&&t.count===0&&cc(t,t.stylesheets),0bd?50:800)+n);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function lc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var sc=null;function cc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,sc=new Map,n.forEach(jw,t),sc=null,lc.call(t))}function jw(t,n){if(!(n.state.loading&4)){var r=sc.get(t);if(r)var l=r.get(null);else{r=new Map,sc.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(),Nd.exports=Fw(),Nd.exports}var Yw=Qw();const Gw=Lh(Yw);var Ql=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(){}},Vw=class extends Ql{#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"}},Uh=new Vw,Kw={setTimeout:(e,a)=>setTimeout(e,a),clearTimeout:e=>clearTimeout(e),setInterval:(e,a)=>setInterval(e,a),clearInterval:e=>clearInterval(e)},Iw=class{#e=Kw;#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)}},ui=new Iw;function Xw(e){setTimeout(e,0)}var Jw=typeof window>"u"||"Deno"in globalThis;function wn(){}function Ww(e,a){return typeof e=="function"?e(a):e}function ch(e){return typeof e=="number"&&e>=0&&e!==1/0}function fb(e,a){return Math.max(e+(a||0)-Date.now(),0)}function Br(e,a){return typeof e=="function"?e(a):e}function On(e,a){return typeof e=="function"?e(a):e}function Sv(e,a){const{type:i="all",exact:o,fetchStatus:s,predicate:c,queryKey:u,stale:d}=e;if(u){if(o){if(a.queryHash!==$h(u,a.options))return!1}else if(!Ol(a.queryKey,u))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||c&&!c(a))}function wv(e,a){const{exact:i,status:o,predicate:s,mutationKey:c}=e;if(c){if(!a.options.mutationKey)return!1;if(i){if(Ml(a.options.mutationKey)!==Ml(c))return!1}else if(!Ol(a.options.mutationKey,c))return!1}return!(o&&a.state.status!==o||s&&!s(a))}function $h(e,a){return(a?.queryKeyHashFn||Ml)(e)}function Ml(e){return JSON.stringify(e,(a,i)=>fh(i)?Object.keys(i).sort().reduce((o,s)=>(o[s]=i[s],o),{}):i)}function Ol(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(i=>Ol(e[i],a[i])):!1}var eE=Object.prototype.hasOwnProperty;function db(e,a,i=0){if(e===a)return e;if(i>500)return a;const o=Ev(e)&&Ev(a);if(!o&&!(fh(e)&&fh(a)))return a;const c=(o?e:Object.keys(e)).length,u=o?a:Object.keys(a),d=u.length,m=o?new Array(d):{};let p=0;for(let b=0;b{ui.setTimeout(a,e)})}function dh(e,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,a):i.structuralSharing!==!1?db(e,a):a}function nE(e,a,i=0){const o=[...e,a];return i&&o.length>i?o.slice(1):o}function aE(e,a,i=0){const o=[a,...e];return i&&o.length>i?o.slice(0,-1):o}var Hh=Symbol();function hb(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===Hh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function mb(e,a){return typeof e=="function"?e(...a):!!e}function rE(e,a,i){let o=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=a(),o||(o=!0,s.aborted?i():s.addEventListener("abort",i,{once:!0})),s)}),e}var Dl=(()=>{let e=()=>Jw;return{isServer(){return e()},setIsServer(a){e=a}}})();function hh(){let e,a;const i=new Promise((s,c)=>{e=s,a=c});i.status="pending",i.catch(()=>{});function o(s){Object.assign(i,s),delete i.resolve,delete i.reject}return i.resolve=s=>{o({status:"fulfilled",value:s}),e(s)},i.reject=s=>{o({status:"rejected",reason:s}),a(s)},i}var iE=Xw;function oE(){let e=[],a=0,i=d=>{d()},o=d=>{d()},s=iE;const c=d=>{a?e.push(d):s(()=>{i(d)})},u=()=>{const d=e;e=[],d.length&&s(()=>{o(()=>{d.forEach(m=>{i(m)})})})};return{batch:d=>{let m;a++;try{m=d()}finally{a--,a||u()}return m},batchCalls:d=>(...m)=>{c(()=>{d(...m)})},schedule:c,setNotifyFunction:d=>{i=d},setBatchNotifyFunction:d=>{o=d},setScheduler:d=>{s=d}}}var Jt=oE(),lE=class extends Ql{#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))}setO)DELIM" +R"DELIM(nline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#e}},Fc=new lE;function sE(e){return Math.min(1e3*2**e,3e4)}function pb(e){return(e??"online")==="online"?Fc.isOnline():!0}var mh=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function yb(e){let a=!1,i=0,o;const s=hh(),c=()=>s.status!=="pending",u=z=>{if(!c()){const R=new mh(z);x(R),e.onCancel?.(R)}},d=()=>{a=!0},m=()=>{a=!1},p=()=>Uh.isFocused()&&(e.networkMode==="always"||Fc.isOnline())&&e.canRun(),b=()=>pb(e.networkMode)&&e.canRun(),g=z=>{c()||(o?.(),s.resolve(z))},x=z=>{c()||(o?.(),s.reject(z))},w=()=>new Promise(z=>{o=R=>{(c()||p())&&z(R)},e.onPause?.()}).then(()=>{o=void 0,c()||e.onContinue?.()}),T=()=>{if(c())return;let z;const R=i===0?e.initialPromise:void 0;try{z=R??e.fn()}catch(q){z=Promise.reject(q)}Promise.resolve(z).then(g).catch(q=>{if(c())return;const G=e.retry??(Dl.isServer()?0:3),J=e.retryDelay??sE,oe=typeof J=="function"?J(i,q):J,ee=G===!0||typeof G=="number"&&ip()?void 0:w()).then(()=>{a?x(q):T()})})};return{promise:s,status:()=>s.status,cancel:u,continue:()=>(o?.(),s),cancelRetry:d,continueRetry:m,canStart:b,start:()=>(b()?T():w().then(T),s)}}var gb=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ch(this.gcTime)&&(this.#e=ui.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Dl.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(ui.clearTimeout(this.#e),this.#e=void 0)}};function cE(e){return{onFetch:(a,i)=>{const o=a.options,s=a.fetchOptions?.meta?.fetchMore?.direction,c=a.state.data?.pages||[],u=a.state.data?.pageParams||[];let d={pages:[],pageParams:[]},m=0;const p=async()=>{let b=!1;const g=T=>{rE(T,()=>a.signal,()=>b=!0)},x=hb(a.options,a.fetchOptions),w=async(T,z,R)=>{if(b)return Promise.reject(a.signal.reason);if(z==null&&T.pages.length)return Promise.resolve(T);const G=(()=>{const be={client:a.client,queryKey:a.queryKey,pageParam:z,direction:R?"backward":"forward",meta:a.options.meta};return g(be),be})(),J=await x(G),{maxPages:oe}=a.options,ee=R?aE:nE;return{pages:ee(T.pages,J,oe),pageParams:ee(T.pageParams,z,oe)}};if(s&&c.length){const T=s==="backward",z=T?uE:Tv,R={pages:c,pageParams:u},q=z(o,R);d=await w(R,q,T)}else{const T=e??c.length;do{const z=m===0?u[0]??o.initialPageParam:Tv(o,d);if(m>0&&z==null)break;d=await w(d,z),m++}while(ma.options.persister?.(p,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=p}}}function Tv(e,{pages:a,pageParams:i}){const o=a.length-1;return a.length>0?e.getNextPageParam(a[o],a,i[o],i):void 0}function uE(e,{pages:a,pageParams:i}){return a.length>0?e.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var fE=class extends gb{#e;#t;#n;#a;#i;#r;#l;#o;constructor(e){super(),this.#o=!1,this.#l=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=jv(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.#l,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=jv(this.options);a.data!==void 0&&(this.setState(Rv(a.data,a.dataUpdatedAt)),this.#t=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(e,a){const i=dh(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(wn).catch(wn):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=>On(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Hh||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Br(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:!fb(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.#o||this.#u()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#u(){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,o=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#o=!0,i.signal)})},s=()=>{const m=hb(this.options,a),b=(()=>{const g={client:this.#i,queryKey:this.queryKey,meta:this.meta};return o(g),g})();return this.#o=!1,this.options.persister?this.options.persister(m,b,this):m(b)},u=(()=>{const m={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:s};return o(m),m})();(this.#e==="infinite"?cE(this.options.pages):this.options.behavior)?.onFetch(u,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#s({type:"fetch",meta:u.fetchOptions?.meta}),this.#r=yb({initialPromise:a?.initialPromise,fn:u.fetchFn,onCancel:m=>{m instanceof mh&&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:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.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 mh){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,...vb(i.data,this.options),fetchMeta:e.meta??null};case"success":const o={...i,...Rv(e.data,e.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount)DELIM" +R"DELIM(:0,fetchFailureReason:null}};return this.#n=e.manual?o:void 0,o;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),Jt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:e})})}};function vb(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pb(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Rv(e,a){return{data:e,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jv(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,i=a!==void 0,o=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var dE=class extends Ql{constructor(e,a){super(),this.options=a,this.#e=e,this.#o=null,this.#l=hh(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#a=void 0;#i;#r;#l;#o;#u;#s;#m;#f;#d;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Nv(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ph(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ph(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 On(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&&!uh(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&kv(this.#t,i,this.options,a)&&this.#h(),this.updateResult(),o&&(this.#t!==i||On(this.options.enabled,this.#t)!==On(a.enabled,this.#t)||Br(this.options.staleTime,this.#t)!==Br(a.staleTime,this.#t))&&this.#y();const s=this.#g();o&&(this.#t!==i||On(this.options.enabled,this.#t)!==On(a.enabled,this.#t)||s!==this.#c)&&this.#v(s)}getOptimisticResult(e){const a=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(a,e);return mE(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,o)=>(this.trackProp(o),a?.(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#l.status==="pending"&&this.#l.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,o))})}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(wn)),a}#y(){this.#x();const e=Br(this.options.staleTime,this.#t);if(Dl.isServer()||this.#a.isStale||!ch(e))return;const i=fb(this.#a.dataUpdatedAt,e)+1;this.#f=ui.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.#c=e,!(Dl.isServer()||On(this.options.enabled,this.#t)===!1||!ch(this.#c)||this.#c===0)&&(this.#d=ui.setInterval(()=>{(this.options.refetchIntervalInBackground||Uh.isFocused())&&this.#h()},this.#c))}#b(){this.#y(),this.#v(this.#g())}#x(){this.#f!==void 0&&(ui.clearTimeout(this.#f),this.#f=void 0)}#S(){this.#d!==void 0&&(ui.clearInterval(this.#d),this.#d=void 0)}createResult(e,a){const i=this.#t,o=this.options,s=this.#a,c=this.#i,u=this.#r,m=e!==i?e.state:this.#n,{state:p}=e;let b={...p},g=!1,x;if(a._optimisticResults){const E=this.hasListeners(),D=!E&&Nv(e,a),B=E&&kv(e,i,a,o);(D||B)&&(b={...b,...vb(p.data,e.options)}),a._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:w,errorUpdatedAt:T,status:z}=b;x=b.data;let R=!1;if(a.placeholderData!==void 0&&x===void 0&&z==="pending"){let E;s?.isPlaceholderData&&a.placeholderData===u?.placeholderData?(E=s.data,R=!0):E=typeof a.placeholderData=="function"?a.placeholderData(this.#m?.state.data,this.#m):a.placeholderData,E!==void 0&&(z="success",x=dh(s?.data,E,a),g=!0)}if(a.select&&x!==void 0&&!R)if(s&&x===c?.data&&a.select===this.#u)x=this.#s;else try{this.#u=a.select,x=a.select(x),x=dh(s?.data,x,a),this.#s=x,this.#o=null}catch(E){this.#o=E}this.#o&&(w=this.#o,x=this.#s,T=Date.now(),z="error");const q=b.fetchStatus==="fetching",G=z==="pending",J=z==="error",oe=G&&q,ee=x!==void 0,A={status:z,fetchStatus:b.fetchStatus,isPending:G,isSuccess:z==="success",isError:J,isInitialLoading:oe,isLoading:oe,data:x,dataUpdatedAt:b.dataUpdatedAt,error:w,errorUpdatedAt:T,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:b.dataUpdateCount>m.dataUpdateCount||b.errorUpdateCount>m.errorUpdateCount,isFetching:q,isRefetching:q&&!G,isLoadingError:J&&!ee,isPaused:b.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:J&&ee,isStale:Zh(e,a),refetch:this.refetch,promise:this.#l,isEnabled:On(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const E=A.data!==void 0,D=A.status==="error"&&!E,B=ue=>{D?ue.reject(A.error):E&&ue.resolve(A.data)},Q=()=>{const ue=this.#l=A.promise=hh();B(ue)},F=this.#l;switch(F.status){case"pending":e.queryHash===i.queryHash&&B(F);break;case"fulfilled":(D||A.data!==F.value)&&Q();break;case"rejected":(!D||A.error!==F.reason)&&Q();break}}return A}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),uh(a,e))return;this.#a=a;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!this.#p.size)return!0;const c=new Set(s??this.#p);return this.options.throwOnError&&c.add("error"),Object.keys(this.#a).some(u=>{const d=u;return this.#a[d]!==e[d]&&c.has(d)})};this.#E({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(e){Jt.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#a)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function hE(e,a){return On(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&On(a.retryOnMount,e)===!1)}function Nv(e,a){return hE(e,a)||e.state.data!==void 0&&ph(e,a,a.refetchOnMount)}function ph(e,a,i){if(On(a.enabled,e)!==!1&&Br(a.staleTime,e)!=="static"){const o=typeof i=="function"?i(e):i;return o==="always"||o!==!1&&Zh(e,a)}return!1}function kv(e,a,i,o){return(e!==a||On(o.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&Zh(e,i)}function Zh(e,a){return On(a.enabled,e)!==!1&&e.isStaleByTime(Br(a.staleTime,e))}function mE(e,a){return!uh(e.getCurrentResult())DELIM" +R"DELIM(,a)}var pE=class extends gb{#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||yE(),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=yb({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(c,u)=>{this.#i({type:"failed",failureCount:c,error:u})},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 o=this.state.status==="pending",s=!this.#a.canStart();try{if(o)a();else{this.#i({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,i);const u=await this.options.onMutate?.(e,i);u!==this.state.context&&this.#i({type:"pending",context:u,variables:e,isPaused:s})}const c=await this.#a.start();return await this.#n.config.onSuccess?.(c,e,this.state.context,this,i),await this.options.onSuccess?.(c,e,this.state.context,i),await this.#n.config.onSettled?.(c,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(c,null,e,this.state.context,i),this.#i({type:"success",data:c}),c}catch(c){try{await this.#n.config.onError?.(c,e,this.state.context,this,i)}catch(u){Promise.reject(u)}try{await this.options.onError?.(c,e,this.state.context,i)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,i)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,i)}catch(u){Promise.reject(u)}throw this.#i({type:"error",error:c}),c}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),Jt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function yE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var gE=class extends Ql{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 o=new pE({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:i});return this.add(o),o}add(e){this.#e.add(e);const a=gc(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=gc(e);if(typeof a=="string"){const i=this.#t.get(a);if(i)if(i.length>1){const o=i.indexOf(e);o!==-1&&i.splice(o,1)}else i[0]===e&&this.#t.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=gc(e);if(typeof a=="string"){const o=this.#t.get(a)?.find(s=>s.state.status==="pending");return!o||o===e}else return!0}runNext(e){const a=gc(e);return typeof a=="string"?this.#t.get(a)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Jt.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=>wv(a,i))}findAll(e={}){return this.getAll().filter(a=>wv(e,a))}notify(e){Jt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return Jt.batch(()=>Promise.all(e.map(a=>a.continue().catch(wn))))}};function gc(e){return e.options.scope?.id}var vE=class extends Ql{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,a,i){const o=a.queryKey,s=a.queryHash??$h(o,a);let c=this.get(s);return c||(c=new fE({client:e,queryKey:o,queryHash:s,options:e.defaultQueryOptions(a),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(c)),c}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(){Jt.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=>Sv(a,i))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(i=>Sv(e,i)):a}notify(e){Jt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){Jt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Jt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},bE=class{#e;#t;#n;#a;#i;#r;#l;#o;constructor(e={}){this.#e=e.queryCache||new vE,this.#t=e.mutationCache||new gE,this.#n=e.defaultOptions||{},this.#a=new Map,this.#i=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#l=Uh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Fc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#l?.(),this.#l=void 0,this.#o?.(),this.#o=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),o=i.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(Br(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(o))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:a,state:i})=>{const o=i.data;return[a,o]})}setQueryData(e,a,i){const o=this.defaultQueryOptions({queryKey:e}),c=this.#e.get(o.queryHash)?.state.data,u=Ww(a,c);if(u!==void 0)return this.#e.build(this,o).setData(u,{...i,manual:!0})}setQueriesData(e,a,i){return Jt.batch(()=>this.#e.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,a,i)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state}removeQueries(e){const a=this.#e;Jt.batch(()=>{a.findAll(e).forEach(i=>{a.remove(i)})})}resetQueries(e,a){const i=this.#e;return Jt.batch(()=>(i.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const i={revert:!0,...a},o=Jt.batch(()=>this.#e.findAll(e).map(s=>s.cancel(i)));return Promise.all(o).then(wn).catch(wn)}invalidateQueries(e,a={}){return Jt.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},o=Jt.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).ma)DELIM" +R"DELIM(p(s=>{let c=s.fetch(void 0,i);return i.throwOnError||(c=c.catch(wn)),s.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(o).then(wn)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const i=this.#e.build(this,a);return i.isStaleByTime(Br(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(wn).catch(wn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(wn).catch(wn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Fc.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(Ml(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#a.values()],i={};return a.forEach(o=>{Ol(e,o.queryKey)&&Object.assign(i,o.defaultOptions)}),i}setMutationDefaults(e,a){this.#i.set(Ml(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#i.values()],i={};return a.forEach(o=>{Ol(e,o.mutationKey)&&Object.assign(i,o.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=$h(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===Hh&&(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()}},bb=_.createContext(void 0),au=e=>{const a=_.useContext(bb);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},xE=({client:e,children:a})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(bb.Provider,{value:e,children:a})),xb=_.createContext(!1),SE=()=>_.useContext(xb);xb.Provider;function wE(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var EE=_.createContext(wE()),_E=()=>_.useContext(EE),TE=(e,a,i)=>{const o=i?.state.error&&typeof e.throwOnError=="function"?mb(e.throwOnError,[i.state.error,i]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||o)&&(a.isReset()||(e.retryOnMount=!1))},RE=e=>{_.useEffect(()=>{e.clearReset()},[e])},jE=({result:e,errorResetBoundary:a,throwOnError:i,query:o,suspense:s})=>e.isError&&!a.isReset()&&!e.isFetching&&o&&(s&&e.data===void 0||mb(i,[e.error,o])),NE=e=>{if(e.suspense){const i=s=>s==="static"?s:Math.max(s??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...s)=>i(o(...s)):i(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},kE=(e,a)=>e.isLoading&&e.isFetching&&!a,AE=(e,a)=>e?.suspense&&a.isPending,Av=(e,a,i)=>a.fetchOptimistic(e).catch(()=>{i.clearReset()});function zE(e,a,i){const o=SE(),s=_E(),c=au(),u=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const d=c.getQueryCache().get(u.queryHash),m=e.subscribed!==!1;u._optimisticResults=o?"isRestoring":m?"optimistic":void 0,NE(u),TE(u,s,d),RE(s);const p=!c.getQueryCache().get(u.queryHash),[b]=_.useState(()=>new a(c,u)),g=b.getOptimisticResult(u),x=!o&&m;if(_.useSyncExternalStore(_.useCallback(w=>{const T=x?b.subscribe(Jt.batchCalls(w)):wn;return b.updateResult(),T},[b,x]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),_.useEffect(()=>{b.setOptions(u)},[u,b]),AE(u,g))throw Av(u,b,s);if(jE({result:g,errorResetBoundary:s,throwOnError:u.throwOnError,query:d,suspense:u.suspense}))throw g.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(u,g),u.experimental_prefetchInRender&&!Dl.isServer()&&kE(g,o)&&(p?Av(u,b,s):d?.promise)?.catch(wn).finally(()=>{b.updateResult()}),u.notifyOnChangeProps?g:b.trackResult(g)}function CE(e,a){return zE(e,dE)}var zv;function te(e,a,i){function o(d,m){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:m,constr:u,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),a(d,m);const p=u.prototype,b=Object.keys(p);for(let g=0;gi?.Parent&&d instanceof i.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class ho extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Sb extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}(zv=globalThis).__zod_globalConfig??(zv.__zod_globalConfig={});const Ph=globalThis.__zod_globalConfig;function Xa(e){return Ph}function wb(e){const a=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,s])=>a.indexOf(+o)===-1).map(([o,s])=>s)}function yh(e,a){return typeof a=="bigint"?a.toString():a}function ru(e){return{get value(){{const a=e();return Object.defineProperty(this,"value",{value:a}),a}}}}function qh(e){return e==null}function Fh(e){const a=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(a,i)}function ME(e,a){const i=e/a,o=Math.round(i),s=Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-o){};function Ll(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const DE=ru(()=>{if(Ph.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function go(e){if(Ll(e)===!1)return!1;const a=e.constructor;if(a===void 0||typeof a!="function")return!0;const i=a.prototype;return!(Ll(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function _b(e){return go(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const LE=new Set(["string","number","symbol"]);function vo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zr(e,a,i){const o=new e._zod.constr(a??e._zod.def);return(!a||i?.parent)&&(o._zod.parent=e),o}function Re(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 BE(e){return Object.keys(e).filter(a=>e[a]._zod.optin==="optional"&&e[a]._zod.optout==="optional")}const UE={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 $E(e,a){const i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=Hr(e._zod.def,{g)DELIM" +R"DELIM(et shape(){const u={};for(const d in a){if(!(d in i.shape))throw new Error(`Unrecognized key: "${d}"`);a[d]&&(u[d]=i.shape[d])}return mi(this,"shape",u),u},checks:[]});return Zr(e,c)}function HE(e,a){const i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=Hr(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const d in a){if(!(d in i.shape))throw new Error(`Unrecognized key: "${d}"`);a[d]&&delete u[d]}return mi(this,"shape",u),u},checks:[]});return Zr(e,c)}function ZE(e,a){if(!go(a))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const c=e._zod.def.shape;for(const u in a)if(Object.getOwnPropertyDescriptor(c,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Hr(e._zod.def,{get shape(){const c={...e._zod.def.shape,...a};return mi(this,"shape",c),c}});return Zr(e,s)}function PE(e,a){if(!go(a))throw new Error("Invalid input to safeExtend: expected a plain object");const i=Hr(e._zod.def,{get shape(){const o={...e._zod.def.shape,...a};return mi(this,"shape",o),o}});return Zr(e,i)}function qE(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=Hr(e._zod.def,{get shape(){const o={...e._zod.def.shape,...a._zod.def.shape};return mi(this,"shape",o),o},get catchall(){return a._zod.def.catchall},checks:a._zod.def.checks??[]});return Zr(e,i)}function FE(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 u=Hr(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 mi(this,"shape",m),m},checks:[]});return Zr(a,u)}function QE(e,a,i){const o=Hr(a._zod.def,{get shape(){const s=a._zod.def.shape,c={...s};if(i)for(const u in i){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);i[u]&&(c[u]=new e({type:"nonoptional",innerType:s[u]}))}else for(const u in s)c[u]=new e({type:"nonoptional",innerType:s[u]});return mi(this,"shape",c),c}});return Zr(a,o)}function so(e,a=0){if(e.aborted===!0)return!0;for(let i=a;i{var o;return(o=i).path??(o.path=[]),i.path.unshift(e),i})}function vc(e){return typeof e=="string"?e:e?.message}function Ja(e,a,i){const o=e.message?e.message:vc(e.inst?._zod.def?.error?.(e))??vc(a?.error?.(e))??vc(i.customError?.(e))??vc(i.localeError?.(e))??"Invalid input",{inst:s,continue:c,input:u,...d}=e;return d.path??(d.path=[]),d.message=o,a?.reportInput&&(d.input=u),d}function Qh(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Bl(...e){const[a,i,o]=e;return typeof a=="string"?{message:a,code:"custom",input:i,inst:o}:{...a}}const Tb=(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,yh,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Rb=te("$ZodError",Tb),jb=te("$ZodError",Tb,{Parent:Error});function GE(e,a=i=>i.message){const i={},o=[];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))):o.push(a(s));return{formErrors:o,fieldErrors:i}}function VE(e,a=i=>i.message){const i={_errors:[]},o=(s,c=[])=>{for(const u of s.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>o({issues:d},[...c,...u.path]));else if(u.code==="invalid_key")o({issues:u.issues},[...c,...u.path]);else if(u.code==="invalid_element")o({issues:u.issues},[...c,...u.path]);else{const d=[...c,...u.path];if(d.length===0)i._errors.push(a(u));else{let m=i,p=0;for(;p(a,i,o,s)=>{const c=o?{...o,async:!1}:{async:!1},u=a._zod.run({value:i,issues:[]},c);if(u instanceof Promise)throw new ho;if(u.issues.length){const d=new(s?.Err??e)(u.issues.map(m=>Ja(m,c,Xa())));throw Eb(d,s?.callee),d}return u.value},Gh=e=>async(a,i,o,s)=>{const c=o?{...o,async:!0}:{async:!0};let u=a._zod.run({value:i,issues:[]},c);if(u instanceof Promise&&(u=await u),u.issues.length){const d=new(s?.Err??e)(u.issues.map(m=>Ja(m,c,Xa())));throw Eb(d,s?.callee),d}return u.value},iu=e=>(a,i,o)=>{const s=o?{...o,async:!1}:{async:!1},c=a._zod.run({value:i,issues:[]},s);if(c instanceof Promise)throw new ho;return c.issues.length?{success:!1,error:new(e??Rb)(c.issues.map(u=>Ja(u,s,Xa())))}:{success:!0,data:c.value}},KE=iu(jb),ou=e=>async(a,i,o)=>{const s=o?{...o,async:!0}:{async:!0};let c=a._zod.run({value:i,issues:[]},s);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(u=>Ja(u,s,Xa())))}:{success:!0,data:c.value}},IE=ou(jb),XE=e=>(a,i,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return Yh(e)(a,i,s)},JE=e=>(a,i,o)=>Yh(e)(a,i,o),WE=e=>async(a,i,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return Gh(e)(a,i,s)},e_=e=>async(a,i,o)=>Gh(e)(a,i,o),t_=e=>(a,i,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return iu(e)(a,i,s)},n_=e=>(a,i,o)=>iu(e)(a,i,o),a_=e=>async(a,i,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return ou(e)(a,i,s)},r_=e=>async(a,i,o)=>ou(e)(a,i,o),i_=/^[cC][0-9a-z]{6,}$/,o_=/^[0-9a-z]+$/,l_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,s_=/^[0-9a-vA-V]{20}$/,c_=/^[A-Za-z0-9]{27}$/,u_=/^[a-zA-Z0-9_-]{21}$/,f_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,d_=/^([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})$/,Ov=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)$/,h_=/^(?!\.)(?!.*\.\.)([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 p_(){return new RegExp(m_,"u")}const y_=/^(?:(?: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])$/,g_=/^(([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}|:))$/,v_=/^((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])$/,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])$/,x_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Nb=/^[A-Za-z0-9_-]*$/,S_=/^https?$/,w_=/^\+[1-9]\d{6,14}$/,kb="(?:(?:\\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])))",E_=new RegExp(`^${kb}$`);function Ab(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)DELIM" +R"DELIM(]\\d\\.\\d{${e.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function __(e){return new RegExp(`^${Ab(e)}$`)}function T_(e){const a=Ab({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${a}(?:${i.join("|")})`;return new RegExp(`^${kb}T(?:${o})$`)}const R_=e=>{const a=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},j_=/^-?\d+$/,zb=/^-?\d+(?:\.\d+)?$/,N_=/^(?:true|false)$/i,k_=/^[^A-Z]*$/,A_=/^[^a-z]*$/,En=te("$ZodCheck",(e,a)=>{var i;e._zod??(e._zod={}),e._zod.def=a,(i=e._zod).onattach??(i.onattach=[])}),Cb={number:"number",bigint:"bigint",object:"date"},Mb=te("$ZodCheckLessThan",(e,a)=>{En.init(e,a);const i=Cb[typeof a.value];e._zod.onattach.push(o=>{const s=o._zod.bag,c=(a.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value{(a.inclusive?o.value<=a.value:o.value{En.init(e,a);const i=Cb[typeof a.value];e._zod.onattach.push(o=>{const s=o._zod.bag,c=(a.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;a.value>c&&(a.inclusive?s.minimum=a.value:s.exclusiveMinimum=a.value)}),e._zod.check=o=>{(a.inclusive?o.value>=a.value:o.value>a.value)||o.issues.push({origin:i,code:"too_small",minimum:typeof a.value=="object"?a.value.getTime():a.value,input:o.value,inclusive:a.inclusive,inst:e,continue:!a.abort})}}),z_=te("$ZodCheckMultipleOf",(e,a)=>{En.init(e,a),e._zod.onattach.push(i=>{var o;(o=i._zod.bag).multipleOf??(o.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):ME(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})}}),C_=te("$ZodCheckNumberFormat",(e,a)=>{En.init(e,a),a.format=a.format||"float64";const i=a.format?.includes("int"),o=i?"int":"number",[s,c]=UE[a.format];e._zod.onattach.push(u=>{const d=u._zod.bag;d.format=a.format,d.minimum=s,d.maximum=c,i&&(d.pattern=j_)}),e._zod.check=u=>{const d=u.value;if(i){if(!Number.isInteger(d)){u.issues.push({expected:o,format:a.format,code:"invalid_type",continue:!1,input:d,inst:e});return}if(!Number.isSafeInteger(d)){d>0?u.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!a.abort}):u.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!a.abort});return}}dc&&u.issues.push({origin:"number",input:d,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!a.abort})}}),M_=te("$ZodCheckMaxLength",(e,a)=>{var i;En.init(e,a),(i=e._zod.def).when??(i.when=o=>{const s=o.value;return!qh(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum{const s=o.value;if(s.length<=a.maximum)return;const u=Qh(s);o.issues.push({origin:u,code:"too_big",maximum:a.maximum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),O_=te("$ZodCheckMinLength",(e,a)=>{var i;En.init(e,a),(i=e._zod.def).when??(i.when=o=>{const s=o.value;return!qh(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>s&&(o._zod.bag.minimum=a.minimum)}),e._zod.check=o=>{const s=o.value;if(s.length>=a.minimum)return;const u=Qh(s);o.issues.push({origin:u,code:"too_small",minimum:a.minimum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),D_=te("$ZodCheckLengthEquals",(e,a)=>{var i;En.init(e,a),(i=e._zod.def).when??(i.when=o=>{const s=o.value;return!qh(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag;s.minimum=a.length,s.maximum=a.length,s.length=a.length}),e._zod.check=o=>{const s=o.value,c=s.length;if(c===a.length)return;const u=Qh(s),d=c>a.length;o.issues.push({origin:u,...d?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!a.abort})}}),lu=te("$ZodCheckStringFormat",(e,a)=>{var i,o;En.init(e,a),e._zod.onattach.push(s=>{const c=s._zod.bag;c.format=a.format,a.pattern&&(c.patterns??(c.patterns=new Set),c.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})}):(o=e._zod).check??(o.check=()=>{})}),L_=te("$ZodCheckRegex",(e,a)=>{lu.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})}}),B_=te("$ZodCheckLowerCase",(e,a)=>{a.pattern??(a.pattern=k_),lu.init(e,a)}),U_=te("$ZodCheckUpperCase",(e,a)=>{a.pattern??(a.pattern=A_),lu.init(e,a)}),$_=te("$ZodCheckIncludes",(e,a)=>{En.init(e,a);const i=vo(a.includes),o=new RegExp(typeof a.position=="number"?`^.{${a.position}}${i}`:i);a.pattern=o,e._zod.onattach.push(s=>{const c=s._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(o)}),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})}}),H_=te("$ZodCheckStartsWith",(e,a)=>{En.init(e,a);const i=new RegExp(`^${vo(a.prefix)}.*`);a.pattern??(a.pattern=i),e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.startsWith(a.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:o.value,inst:e,continue:!a.abort})}}),Z_=te("$ZodCheckEndsWith",(e,a)=>{En.init(e,a);const i=new RegExp(`.*${vo(a.suffix)}$`);a.pattern??(a.pattern=i),e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.endsWith(a.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:o.value,inst:e,continue:!a.abort})}}),P_=te("$ZodCheckOverwrite",(e,a)=>{En.init(e,a),e._zod.check=i=>{i.value=a.tx(i.value)}});class q_{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 o=a.split(` +`).filter(u=>u),s=Math.min(...o.map(u=>u.length-u.trimStart().length)),c=o.map(u=>u.slice(s)).map(u=>" ".repeat(this.indent*2)+u);for(const u of c)this.content.push(u)}compile(){const a=Function,i=this?.args,s=[...(this?.content??[""]).map(c=>` ${c}`)];return new a(...i,s.join(` +`))}}const F_={major:4,minor:4,patch:3},Tt=te("$ZodType",(e,a)=>{var i;e??(e={}),e._zod.def=a,e._zod.bag=e._zod.bag||{},e._zod.version=F_;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const s of o)for(const c of s._zod.onattach)c(e);if(o.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(u,d,m)=>{let p=so(u),b;for(const g of d){if(g._zod.def.when){if(YE(u)||!g._zod.def.when(u))continue}else if(p)continue;const x=u.issues.length,w=g._zod.check(u);if(w instanceof Promise&&m?.async===!1)throw new ho;if(b||w instanceof Promise)b=(b??Promise.resolve()).then(async()=>{await w,u.issues.length!==x&&(p||(p=so(u,x)))});else{if(u.issues.length===x)conti)DELIM" +R"DELIM(nue;p||(p=so(u,x))}}return b?b.then(()=>u):u},c=(u,d,m)=>{if(so(u))return u.aborted=!0,u;const p=s(d,o,m);if(p instanceof Promise){if(m.async===!1)throw new ho;return p.then(b=>e._zod.parse(b,m))}return e._zod.parse(p,m)};e._zod.run=(u,d)=>{if(d.skipChecks)return e._zod.parse(u,d);if(d.direction==="backward"){const p=e._zod.parse({value:u.value,issues:[]},{...d,skipChecks:!0});return p instanceof Promise?p.then(b=>c(b,u,d)):c(p,u,d)}const m=e._zod.parse(u,d);if(m instanceof Promise){if(d.async===!1)throw new ho;return m.then(p=>s(p,o,d))}return s(m,o,d)}}ut(e,"~standard",()=>({validate:s=>{try{const c=KE(e,s);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return IE(e,s).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}))}),Vh=te("$ZodString",(e,a)=>{Tt.init(e,a),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??R_(e._zod.bag),e._zod.parse=(i,o)=>{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}}),Et=te("$ZodStringFormat",(e,a)=>{lu.init(e,a),Vh.init(e,a)}),Q_=te("$ZodGUID",(e,a)=>{a.pattern??(a.pattern=d_),Et.init(e,a)}),Y_=te("$ZodUUID",(e,a)=>{if(a.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(o===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=Ov(o))}else a.pattern??(a.pattern=Ov());Et.init(e,a)}),G_=te("$ZodEmail",(e,a)=>{a.pattern??(a.pattern=h_),Et.init(e,a)}),V_=te("$ZodURL",(e,a)=>{Et.init(e,a),e._zod.check=i=>{try{const o=i.value.trim();if(!a.normalize&&a.protocol?.source===S_.source&&!/^https?:\/\//i.test(o)){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(o);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=o;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!a.abort})}}}),K_=te("$ZodEmoji",(e,a)=>{a.pattern??(a.pattern=p_()),Et.init(e,a)}),I_=te("$ZodNanoID",(e,a)=>{a.pattern??(a.pattern=u_),Et.init(e,a)}),X_=te("$ZodCUID",(e,a)=>{a.pattern??(a.pattern=i_),Et.init(e,a)}),J_=te("$ZodCUID2",(e,a)=>{a.pattern??(a.pattern=o_),Et.init(e,a)}),W_=te("$ZodULID",(e,a)=>{a.pattern??(a.pattern=l_),Et.init(e,a)}),e2=te("$ZodXID",(e,a)=>{a.pattern??(a.pattern=s_),Et.init(e,a)}),t2=te("$ZodKSUID",(e,a)=>{a.pattern??(a.pattern=c_),Et.init(e,a)}),n2=te("$ZodISODateTime",(e,a)=>{a.pattern??(a.pattern=T_(a)),Et.init(e,a)}),a2=te("$ZodISODate",(e,a)=>{a.pattern??(a.pattern=E_),Et.init(e,a)}),r2=te("$ZodISOTime",(e,a)=>{a.pattern??(a.pattern=__(a)),Et.init(e,a)}),i2=te("$ZodISODuration",(e,a)=>{a.pattern??(a.pattern=f_),Et.init(e,a)}),o2=te("$ZodIPv4",(e,a)=>{a.pattern??(a.pattern=y_),Et.init(e,a),e._zod.bag.format="ipv4"}),l2=te("$ZodIPv6",(e,a)=>{a.pattern??(a.pattern=g_),Et.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})}}}),s2=te("$ZodCIDRv4",(e,a)=>{a.pattern??(a.pattern=v_),Et.init(e,a)}),c2=te("$ZodCIDRv6",(e,a)=>{a.pattern??(a.pattern=b_),Et.init(e,a),e._zod.check=i=>{const o=i.value.split("/");try{if(o.length!==2)throw new Error;const[s,c]=o;if(!c)throw new Error;const u=Number(c);if(`${u}`!==c)throw new Error;if(u<0||u>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 Db(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const u2=te("$ZodBase64",(e,a)=>{a.pattern??(a.pattern=x_),Et.init(e,a),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{Db(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!a.abort})}});function f2(e){if(!Nb.test(e))return!1;const a=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),i=a.padEnd(Math.ceil(a.length/4)*4,"=");return Db(i)}const d2=te("$ZodBase64URL",(e,a)=>{a.pattern??(a.pattern=Nb),Et.init(e,a),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{f2(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!a.abort})}}),h2=te("$ZodE164",(e,a)=>{a.pattern??(a.pattern=w_),Et.init(e,a)});function m2(e,a=null){try{const i=e.split(".");if(i.length!==3)return!1;const[o]=i;if(!o)return!1;const s=JSON.parse(atob(o));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||a&&(!("alg"in s)||s.alg!==a))}catch{return!1}}const p2=te("$ZodJWT",(e,a)=>{Et.init(e,a),e._zod.check=i=>{m2(i.value,a.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!a.abort})}}),Lb=te("$ZodNumber",(e,a)=>{Tt.init(e,a),e._zod.pattern=e._zod.bag.pattern??zb,e._zod.parse=(i,o)=>{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 c=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,...c?{received:c}:{}}),i}}),y2=te("$ZodNumberFormat",(e,a)=>{C_.init(e,a),Lb.init(e,a)}),g2=te("$ZodBoolean",(e,a)=>{Tt.init(e,a),e._zod.pattern=N_,e._zod.parse=(i,o)=>{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}}),v2=te("$ZodUnknown",(e,a)=>{Tt.init(e,a),e._zod.parse=i=>i}),b2=te("$ZodNever",(e,a)=>{Tt.init(e,a),e._zod.parse=(i,o)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function Dv(e,a,i){e.issues.length&&a.issues.push(...co(i,e.issues)),a.value[i]=e.value}const x2=te("$ZodArray",(e,a)=>{Tt.init(e,a),e._zod.parse=(i,o)=>{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 c=[];for(let u=0;uDv(p,i,u))):Dv(m,i,u)}return c.length?Promise.all(c).then(()=>i):i}});function Qc(e,a,i,o,s,c){const u=i in o;if(e.issues.length){if(s&&c&&!u)return;a.issues.push(...co(i,e.issues))}if(!u&&!s){e.issues.length||a.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[i]});return}e.value===void 0?u&&(a.value[i]=void 0):a.value[i]=e.value}function Bb(e){const a=Object.keys(e.shape);for(const o of a)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const i=BE(e.shape);return{...e,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(i)}}function Ub(e,a,i,o,s,c){const u=[],d=s.keySet,m=s.catchall._zod,p=m.def.type,b=m.optin==="optional",g=m.optout==="optional";for(const x in a){if(x==="__proto__"||d.has(x))continue;if(p==="never"){u.push(x);continue}const w=m.run({value:a[x],issues:[]},o);w instanceof Promise?e.push(w.then(T=>Qc(T,i,x,a,b,g))):Qc(w,i,x,a,b,g)}return u.length&&i.issues.push({code:"unrecognized_keys",keys:u,input:a,inst:c}),e.length?Promise.all(e).then(()=>i):i}const S2=te("$ZodObject",(e,a)=>{if(Tt.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 o=ru(()=>Bb(a));ut(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)}})DELIM" +R"DELIM(return m});const s=Ll,c=a.catchall;let u;e._zod.parse=(d,m)=>{u??(u=o.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=u.shape;for(const x of u.keys){const w=g[x],T=w._zod.optin==="optional",z=w._zod.optout==="optional",R=w._zod.run({value:p[x],issues:[]},m);R instanceof Promise?b.push(R.then(q=>Qc(q,d,x,p,T,z))):Qc(R,d,x,p,T,z)}return c?Ub(b,p,d,m,o.value,e):b.length?Promise.all(b).then(()=>d):d}}),w2=te("$ZodObjectJIT",(e,a)=>{S2.init(e,a);const i=e._zod.parse,o=ru(()=>Bb(a)),s=x=>{const w=new q_(["shape","payload","ctx"]),T=o.value,z=J=>{const oe=Mv(J);return`shape[${oe}]._zod.run({ value: input[${oe}], issues: [] }, ctx)`};w.write("const input = payload.value;");const R=Object.create(null);let q=0;for(const J of T.keys)R[J]=`key_${q++}`;w.write("const newResult = {};");for(const J of T.keys){const oe=R[J],ee=Mv(J),be=x[J],A=be?._zod?.optin==="optional",E=be?._zod?.optout==="optional";w.write(`const ${oe} = ${z(J)};`),A&&E?w.write(` + if (${oe}.issues.length) { + if (${ee} in input) { + payload.issues = payload.issues.concat(${oe}.issues.map(iss => ({ ...iss, - path: iss.path ? [${ne}, ...iss.path] : [${ne}] + path: iss.path ? [${ee}, ...iss.path] : [${ee}] }))); } } - if (${le}.value === undefined) { - if (${ne} in input) { - newResult[${ne}] = undefined; + if (${oe}.value === undefined) { + if (${ee} in input) { + newResult[${ee}] = undefined; } } else { - newResult[${ne}] = ${le}.value; + newResult[${ee}] = ${oe}.value; } - `):z?w.write(` - if (${le}.issues.length) { - payload.issues = payload.issues.concat(${le}.issues.map(iss => ({ + `):A?w.write(` + if (${oe}.issues.length) { + payload.issues = payload.issues.concat(${oe}.issues.map(iss => ({ ...iss, - path: iss.path ? [${ne}, ...iss.path] : [${ne}] + path: iss.path ? [${ee}, ...iss.path] : [${ee}] }))); } - if (${le}.value === undefined) { - if (${ne} in input) { - newResult[${ne}] = undefined; + if (${oe}.value === undefined) { + if (${ee} in input) { + newResult[${ee}] = undefined; } } else { - newResult[${ne}] = ${le}.value; + newResult[${ee}] = ${oe}.value; } `):w.write(` - const ${le}_present = ${ne} in input; - if (${le}.issues.length) { - payload.issues = payload.issues.concat(${le}.issues.map(iss => ({ + const ${oe}_present = ${ee} in input; + if (${oe}.issues.length) { + payload.issues = payload.issues.concat(${oe}.issues.map(iss => ({ ...iss, - path: iss.path ? [${ne}, ...iss.path] : [${ne}] + path: iss.path ? [${ee}, ...iss.path] : [${ee}] }))); } - if (!${le}_present && !${le}.issues.length) { + if (!${oe}_present && !${oe}.issues.length) { payload.issues.push({ code: "invalid_type", expected: "nonoptional", input: undefined, - path: [${ne}] + path: [${ee}] }); } - if (${le}_present) { - if (${le}.value === undefined) { - newResult[${ne}] = undefined; + if (${oe}_present) { + if (${oe}.value === undefined) { + newResult[${ee}] = undefined; } else { - newResult[${ne}] = ${le}.value; + newResult[${ee}] = ${oe}.value; } } - `)}w.write("payload.value = newResult;"),w.write("return payload;");const G=w.compile();return(X,le)=>G(x,X,le)};let u;const c=Ml,d=!Uh.jitless,p=d&&zE.value,b=a.catchall;let g;e._zod.parse=(x,w)=>{g??(g=o.value);const T=x.value;return c(T)?d&&p&&w?.async===!1&&w.jitless!==!0?(u||(u=s(a.shape)),x=u(x,w),b?kb([],T,x,w,g,e):x):i(x,w):(x.issues.push({expected:"object",code:"invalid_type",input:T,inst:e}),x)}});function Ov(e,a,i,o){for(const u of e)if(u.issues.length===0)return a.value=u.value,a;const s=e.filter(u=>!lo(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=>fi(c,o,ci())))}),a)}const Db=te("$ZodUnion",(e,a)=>{Nt.init(e,a),ct(e._zod,"optin",()=>a.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ct(e._zod,"optout",()=>a.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ct(e._zod,"values",()=>{if(a.options.every(o=>o._zod.values))return new Set(a.options.flatMap(o=>Array.from(o._zod.values)))}),ct(e._zod,"pattern",()=>{if(a.options.every(o=>o._zod.pattern)){const o=a.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>$h(s.source)).join("|")})$`)}});const i=a.options.length===1?a.options[0]._zod.run:null;e._zod.parse=(o,s)=>{if(i)return i(o,s);let u=!1;const c=[];for(const d of a.options){const m=d._zod.run({value:o.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=>Ov(d,o,e,s)):Ov(c,o,e,s)}}),b2=te("$ZodDiscriminatedUnion",(e,a)=>{a.inclusive=!1,Db.init(e,a);const i=e._zod.parse;ct(e._zod,"propValues",()=>{const s={};for(const u of a.options){const c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${a.options.indexOf(u)}"`);for(const[d,m]of Object.entries(c)){s[d]||(s[d]=new Set);for(const p of m)s[d].add(p)}}return s});const o=nc(()=>{const s=a.options,u=new Map;for(const c of s){const d=c._zod.propValues?.[a.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${a.options.indexOf(c)}"`);for(const m of d){if(u.has(m))throw new Error(`Duplicate discriminator value "${String(m)}"`);u.set(m,c)}}return u});e._zod.parse=(s,u)=>{const c=s.value;if(!Ml(c))return s.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),s;const d=o.value.get(c?.[a.discriminator]);return d?d._zod.run(s,u):a.unionFallback||u.direction==="backward"?i(s,u):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:a.discriminator,options:Array.from(o.value.keys()),input:c,path:[a.discriminator],inst:e}),s)}}),x2=te("$ZodIntersection",(e,a)=>{Nt.init(e,a),e._zod.parse=(i,o)=>{const s=i.value,u=a.left._zod.run({value:s,issues:[]},o),c=a.right._zod.run({value:s,issues:[]},o);return u instanceof Promise||c instanceof Promise?Promise.all([u,c]).then(([m,p])=>kv(i,m,p)):kv(i,u,c)}});function hh(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(Ol(e)&&Ol(a)){const i=Object.keys(a),o=Object.keys(e).filter(u=>i.indexOf(u)!==-1),s={...e,...a};for(const u of o){const c=hh(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 o=0;od.l&&d.r).map(([d])=>d);if(u.length&&s&&e.issues.push({...s,keys:u}),lo(e))return e;const c=hh(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 S2=te("$ZodEnum",(e,a)=>{Nt.init(e,a);const i=vb(a.entries),o=new Set(i);e._zod.values=o,e._zod.pattern=new RegExp(`^(${i.filter(s=>CE.has(typeof s)).map(s=>typeof s=="string"?po(s):s.toString()).join("|")})$`),e._zod.parse=(s,u)=>{const c=s.value;return o.has(c)||s.issues.push({code:"invalid_value",values:i,input:c,inst:e}),s}}),w2=te("$ZodLiteral",(e,a)=>{if(Nt.init(e,a),a.values.length===0)throw new Error("Cannot create literal schema with no valid values");const i=new Set(a.values);e._zod.values=i,e._zod.pattern=new RegExp(`^(${a.values.map(o=>typeof o=="string"?po(o):o?po(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,s)=>{const u=o.value;return i.has(u)||o.issues.push({code:"invalid_value",values:a.values,input:u,inst:e}),o}}),E2=te("$ZodTransform",(e,a)=>{Nt.init(e,a),e._zod.optin="optional",e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new gb(e.constructor.name);const s=a.transform(i.value,i);if(o.async)return(s instanceof Promise?s:Promise.resolve(s)).then(c=>(i.value=c,i.fallback=!0,i));if(s instanceof Promise)throw n)DELIM" -R"DELIM(ew co;return i.value=s,i.fallback=!0,i}});function Dv(e,a){return a===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Lb=te("$ZodOptional",(e,a)=>{Nt.init(e,a),e._zod.optin="optional",e._zod.optout="optional",ct(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),ct(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${$h(i.source)})?$`):void 0}),e._zod.parse=(i,o)=>{if(a.innerType._zod.optin==="optional"){const s=i.value,u=a.innerType._zod.run(i,o);return u instanceof Promise?u.then(c=>Dv(c,s)):Dv(u,s)}return i.value===void 0?i:a.innerType._zod.run(i,o)}}),_2=te("$ZodExactOptional",(e,a)=>{Lb.init(e,a),ct(e._zod,"values",()=>a.innerType._zod.values),ct(e._zod,"pattern",()=>a.innerType._zod.pattern),e._zod.parse=(i,o)=>a.innerType._zod.run(i,o)}),T2=te("$ZodNullable",(e,a)=>{Nt.init(e,a),ct(e._zod,"optin",()=>a.innerType._zod.optin),ct(e._zod,"optout",()=>a.innerType._zod.optout),ct(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${$h(i.source)}|null)$`):void 0}),ct(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),e._zod.parse=(i,o)=>i.value===null?i:a.innerType._zod.run(i,o)}),R2=te("$ZodDefault",(e,a)=>{Nt.init(e,a),e._zod.optin="optional",ct(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,o)=>{if(o.direction==="backward")return a.innerType._zod.run(i,o);if(i.value===void 0)return i.value=a.defaultValue,i;const s=a.innerType._zod.run(i,o);return s instanceof Promise?s.then(u=>Lv(u,a)):Lv(s,a)}});function Lv(e,a){return e.value===void 0&&(e.value=a.defaultValue),e}const A2=te("$ZodPrefault",(e,a)=>{Nt.init(e,a),e._zod.optin="optional",ct(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,o)=>(o.direction==="backward"||i.value===void 0&&(i.value=a.defaultValue),a.innerType._zod.run(i,o))}),N2=te("$ZodNonOptional",(e,a)=>{Nt.init(e,a),ct(e._zod,"values",()=>{const i=a.innerType._zod.values;return i?new Set([...i].filter(o=>o!==void 0)):void 0}),e._zod.parse=(i,o)=>{const s=a.innerType._zod.run(i,o);return s instanceof Promise?s.then(u=>Bv(u,e)):Bv(s,e)}});function Bv(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 j2=te("$ZodCatch",(e,a)=>{Nt.init(e,a),e._zod.optin="optional",ct(e._zod,"optout",()=>a.innerType._zod.optout),ct(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,o)=>{if(o.direction==="backward")return a.innerType._zod.run(i,o);const s=a.innerType._zod.run(i,o);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=>fi(c,o,ci()))},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=>fi(u,o,ci()))},input:i.value}),i.issues=[],i.fallback=!0),i)}}),z2=te("$ZodPipe",(e,a)=>{Nt.init(e,a),ct(e._zod,"values",()=>a.in._zod.values),ct(e._zod,"optin",()=>a.in._zod.optin),ct(e._zod,"optout",()=>a.out._zod.optout),ct(e._zod,"propValues",()=>a.in._zod.propValues),e._zod.parse=(i,o)=>{if(o.direction==="backward"){const u=a.out._zod.run(i,o);return u instanceof Promise?u.then(c=>gu(c,a.in,o)):gu(u,a.in,o)}const s=a.in._zod.run(i,o);return s instanceof Promise?s.then(u=>gu(u,a.out,o)):gu(s,a.out,o)}});function gu(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 C2=te("$ZodReadonly",(e,a)=>{Nt.init(e,a),ct(e._zod,"propValues",()=>a.innerType._zod.propValues),ct(e._zod,"values",()=>a.innerType._zod.values),ct(e._zod,"optin",()=>a.innerType?._zod?.optin),ct(e._zod,"optout",()=>a.innerType?._zod?.optout),e._zod.parse=(i,o)=>{if(o.direction==="backward")return a.innerType._zod.run(i,o);const s=a.innerType._zod.run(i,o);return s instanceof Promise?s.then(Uv):Uv(s)}});function Uv(e){return e.value=Object.freeze(e.value),e}const M2=te("$ZodCustom",(e,a)=>{Sn.init(e,a),Nt.init(e,a),e._zod.parse=(i,o)=>i,e._zod.check=i=>{const o=i.value,s=a.fn(o);if(s instanceof Promise)return s.then(u=>Hv(u,i,o,e));Hv(s,i,o,e)}});function Hv(e,a,i,o){if(!e){const s={code:"custom",input:i,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(s.params=o._zod.def.params),a.issues.push(kl(s))}}var $v;class O2{constructor(){this._map=new WeakMap,this._idmap=new Map}add(a,...i){const o=i[0];return this._map.set(a,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.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 o={...this.get(i)??{}};delete o.id;const s={...o,...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 k2(){return new O2}($v=globalThis).__zod_globalRegistry??($v.__zod_globalRegistry=k2());const xl=globalThis.__zod_globalRegistry;function D2(e,a){return new e({type:"string",...Re(a)})}function L2(e,a){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Re(a)})}function Zv(e,a){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Re(a)})}function B2(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Re(a)})}function U2(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Re(a)})}function H2(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Re(a)})}function $2(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Re(a)})}function Z2(e,a){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Re(a)})}function q2(e,a){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Re(a)})}function P2(e,a){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Re(a)})}function F2(e,a){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Re(a)})}function Q2(e,a){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Re(a)})}function Y2(e,a){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Re(a)})}function G2(e,a){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Re(a)})}function V2(e,a){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Re(a)})}function K2(e,a){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Re(a)})}function I2(e,a){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Re(a)})}function X2(e,a){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Re(a)})}function J2(e,a){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Re(a)})}function W2(e,a){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Re(a)})}function eT(e,a){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Re(a)})}function tT(e,a){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Re(a)})}function nT(e,a){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Re(a)})}function aT(e,a){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Re(a)})}function rT(e,a){return new e({type:"string",format:"date",check:"string_format",...Re(a)})}function iT(e,a){return new e({type:"string",format:"time",check:"string_format",precision:null,...Re(a)})}function oT(e,a){return new e({type:"string",format:"duration",check:"string_format",...Re(a)})}function lT(e,a){return new e({type:"number",checks:[],...Re(a)})}function sT(e,a){return new e({type:"number",check:"number_format",abort:!1,form)DELIM" -R"DELIM(at:"safeint",...Re(a)})}function uT(e,a){return new e({type:"boolean",...Re(a)})}function cT(e){return new e({type:"unknown"})}function fT(e,a){return new e({type:"never",...Re(a)})}function qv(e,a){return new jb({check:"less_than",...Re(a),value:e,inclusive:!1})}function zd(e,a){return new jb({check:"less_than",...Re(a),value:e,inclusive:!0})}function Pv(e,a){return new zb({check:"greater_than",...Re(a),value:e,inclusive:!1})}function Cd(e,a){return new zb({check:"greater_than",...Re(a),value:e,inclusive:!0})}function Fv(e,a){return new A_({check:"multiple_of",...Re(a),value:e})}function Bb(e,a){return new j_({check:"max_length",...Re(a),maximum:e})}function Fu(e,a){return new z_({check:"min_length",...Re(a),minimum:e})}function Ub(e,a){return new C_({check:"length_equals",...Re(a),length:e})}function dT(e,a){return new M_({check:"string_format",format:"regex",...Re(a),pattern:e})}function hT(e){return new O_({check:"string_format",format:"lowercase",...Re(e)})}function mT(e){return new k_({check:"string_format",format:"uppercase",...Re(e)})}function pT(e,a){return new D_({check:"string_format",format:"includes",...Re(a),includes:e})}function yT(e,a){return new L_({check:"string_format",format:"starts_with",...Re(a),prefix:e})}function gT(e,a){return new B_({check:"string_format",format:"ends_with",...Re(a),suffix:e})}function bo(e){return new U_({check:"overwrite",tx:e})}function vT(e){return bo(a=>a.normalize(e))}function bT(){return bo(e=>e.trim())}function xT(){return bo(e=>e.toLowerCase())}function ST(){return bo(e=>e.toUpperCase())}function wT(){return bo(e=>jE(e))}function ET(e,a,i){return new e({type:"array",element:a,...Re(i)})}function _T(e,a,i){return new e({type:"custom",check:"custom",fn:a,...Re(i)})}function TT(e,a){const i=RT(o=>(o.addIssue=s=>{if(typeof s=="string")o.issues.push(kl(s,o.value,i._zod.def));else{const u=s;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=o.value),u.inst??(u.inst=i),u.continue??(u.continue=!i._zod.def.abort),o.issues.push(kl(u))}},e(o.value,o)),a);return i}function RT(e,a){const i=new Sn({check:"custom",...Re(a)});return i._zod.check=e,i}function Hb(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??xl,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 It(e,a,i={path:[],schemaPath:[]}){var o;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),It(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"&&cn(e)&&(delete c.schema.examples,delete c.schema.default),a.io==="input"&&"_prefault"in c.schema&&((o=c.schema).default??(o.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 o=new Map;for(const c of e.seen.entries()){const d=e.metadataRegistry.get(c[0])?.id;if(d){const m=o.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.`);o.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??(T=>T);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 G=w.compile();return(J,oe)=>G(x,J,oe)};let c;const u=Ll,d=!Ph.jitless,p=d&&DE.value,b=a.catchall;let g;e._zod.parse=(x,w)=>{g??(g=o.value);const T=x.value;return u(T)?d&&p&&w?.async===!1&&w.jitless!==!0?(c||(c=s(a.shape)),x=c(x,w),b?Ub([],T,x,w,g,e):x):i(x,w):(x.issues.push({expected:"object",code:"invalid_type",input:T,inst:e}),x)}});function Lv(e,a,i,o){for(const c of e)if(c.issues.length===0)return a.value=c.value,a;const s=e.filter(c=>!so(c));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(c=>c.issues.map(u=>Ja(u,o,Xa())))}),a)}const $b=te("$ZodUnion",(e,a)=>{Tt.init(e,a),ut(e._zod,"optin",()=>a.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ut(e._zod,"optout",()=>a.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ut(e._zod,"values",()=>{if(a.options.every(o=>o._zod.values))return new Set(a.options.flatMap(o=>Array.from(o._zod.values)))}),ut(e._zod,"pattern",()=>{if(a.options.every(o=>o._zod.pattern)){const o=a.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Fh(s.source)).join("|")})$`)}});const i=a.options.length===1?a.options[0]._zod.run:null;e._zod.parse=(o,s)=>{if(i)return i(o,s);let c=!1;const u=[];for(const d of a.options){const m=d._zod.run({value:o.value,issues:[]},s);if(m instanceof Promise)u.push(m),c=!0;else{if(m.issues.length===0)return m;u.push(m)}}return c?Promise.all(u).then(d=>Lv(d,o,e,s)):Lv(u,o,e,s)}}),E2=te("$ZodDiscriminatedUnion",(e,a)=>{a.inclusive=!1,$b.init(e,a);const i=e._zod.parse;ut(e._zod,"propValues",()=>{const s={};for(const c of a.options){const u=c._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${a.options.indexOf(c)}"`);for(const[d,m]of Object.entries(u)){s[d]||(s[d]=new Set);for(const p of m)s[d].add(p)}}return s});const o=ru(()=>{const s=a.options,c=new Map;for(const u of s){const d=u._zod.propValues?.[a.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${a.options.indexOf(u)}"`);for(const m of d){if(c.has(m))throw new Error(`Duplicate discriminator value "${String(m)}"`);c.set(m,u)}}return c});e._zod.parse=(s,c)=>{const u=s.value;if(!Ll(u))return s.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),s;const d=o.value.get(u?.[a.discriminator]);return d?d._zod.run(s,c):a.unionFallback||c.direction==="backward"?i(s,c):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:a.discriminator,options:Array.from(o.value.keys()),input:u,path:[a.discriminator],inst:e}),s)}}),_2=te("$ZodIntersection",(e,a)=>{Tt.init(e,a),e._zod.parse=(i,o)=>{const s=i.value,c=a.left._zod.run({value:s,issues:[]},o),u=a.right._zod.run({value:s,issues:[]},o);return c instanceof Promise||u instanceof Promise?Promise.all([c,u]).then(([m,p])=>Bv(i,m,p)):Bv(i,c,u)}});function gh(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(go(e)&&go(a)){const i=Object.keys(a),o=Object.keys(e).filter(c=>i.indexOf(c)!==-1),s={...e,...a};for(const c of o){const u=gh(e[c],a[c]);if(!u.valid)return{valid:!1,mergeErrorPath:[c,...u.mergeErrorPath]};s[c]=u.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 o=0;od.l&&d.r).map(([d])=>d);if(c.length&&s&&e.issues.push({...s,keys:c}),so(e))return e;const u=gh(a.value,i.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const T2=te("$ZodRecord",(e,a)=>{Tt.init(e,a),e._zod.parse=(i,o)=>{const s=i.value;if(!go(s))return i.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),i;const c=[],u=a.keyType._zod.values;if(u){i.value={};const d=new Set;for(const p of u)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){d.add(typeof p=="number"?p.toString():p);const b=a.keyType._zod.run({value:p,issues:[]},o);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(b.issues.length){i.issues.push({code:"invalid_key",origin:"record",issues:b.issues.map(w=>Ja(w,o,Xa())),input:p,path:[p],inst:e});continue}const g=b.value,x=a.valueType._zod.run({value:s[p],issues:[]},o);x instanceof Promise?c.push(x.then(w=>{w.issues.length&&i.issues.push(...co(p,w.issues)),i.value[g]=w.value})):(x.issues.length&&i.issues.push(...co(p,x.issues)),i.value[g]=x.value)}let m;for(const p in s)d.has(p)||(m=m??[],m.push(p));m&&m.length>0&&i.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:m})}else{i.value={};for(const d of Reflect.)DELIM" +R"DELIM(ownKeys(s)){if(d==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,d))continue;let m=a.keyType._zod.run({value:d,issues:[]},o);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&zb.test(d)&&m.issues.length){const g=a.keyType._zod.run({value:Number(d),issues:[]},o);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(m=g)}if(m.issues.length){a.mode==="loose"?i.value[d]=s[d]:i.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(g=>Ja(g,o,Xa())),input:d,path:[d],inst:e});continue}const b=a.valueType._zod.run({value:s[d],issues:[]},o);b instanceof Promise?c.push(b.then(g=>{g.issues.length&&i.issues.push(...co(d,g.issues)),i.value[m.value]=g.value})):(b.issues.length&&i.issues.push(...co(d,b.issues)),i.value[m.value]=b.value)}}return c.length?Promise.all(c).then(()=>i):i}}),R2=te("$ZodEnum",(e,a)=>{Tt.init(e,a);const i=wb(a.entries),o=new Set(i);e._zod.values=o,e._zod.pattern=new RegExp(`^(${i.filter(s=>LE.has(typeof s)).map(s=>typeof s=="string"?vo(s):s.toString()).join("|")})$`),e._zod.parse=(s,c)=>{const u=s.value;return o.has(u)||s.issues.push({code:"invalid_value",values:i,input:u,inst:e}),s}}),j2=te("$ZodLiteral",(e,a)=>{if(Tt.init(e,a),a.values.length===0)throw new Error("Cannot create literal schema with no valid values");const i=new Set(a.values);e._zod.values=i,e._zod.pattern=new RegExp(`^(${a.values.map(o=>typeof o=="string"?vo(o):o?vo(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,s)=>{const c=o.value;return i.has(c)||o.issues.push({code:"invalid_value",values:a.values,input:c,inst:e}),o}}),N2=te("$ZodTransform",(e,a)=>{Tt.init(e,a),e._zod.optin="optional",e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new Sb(e.constructor.name);const s=a.transform(i.value,i);if(o.async)return(s instanceof Promise?s:Promise.resolve(s)).then(u=>(i.value=u,i.fallback=!0,i));if(s instanceof Promise)throw new ho;return i.value=s,i.fallback=!0,i}});function Uv(e,a){return a===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Hb=te("$ZodOptional",(e,a)=>{Tt.init(e,a),e._zod.optin="optional",e._zod.optout="optional",ut(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),ut(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${Fh(i.source)})?$`):void 0}),e._zod.parse=(i,o)=>{if(a.innerType._zod.optin==="optional"){const s=i.value,c=a.innerType._zod.run(i,o);return c instanceof Promise?c.then(u=>Uv(u,s)):Uv(c,s)}return i.value===void 0?i:a.innerType._zod.run(i,o)}}),k2=te("$ZodExactOptional",(e,a)=>{Hb.init(e,a),ut(e._zod,"values",()=>a.innerType._zod.values),ut(e._zod,"pattern",()=>a.innerType._zod.pattern),e._zod.parse=(i,o)=>a.innerType._zod.run(i,o)}),A2=te("$ZodNullable",(e,a)=>{Tt.init(e,a),ut(e._zod,"optin",()=>a.innerType._zod.optin),ut(e._zod,"optout",()=>a.innerType._zod.optout),ut(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${Fh(i.source)}|null)$`):void 0}),ut(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),e._zod.parse=(i,o)=>i.value===null?i:a.innerType._zod.run(i,o)}),z2=te("$ZodDefault",(e,a)=>{Tt.init(e,a),e._zod.optin="optional",ut(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,o)=>{if(o.direction==="backward")return a.innerType._zod.run(i,o);if(i.value===void 0)return i.value=a.defaultValue,i;const s=a.innerType._zod.run(i,o);return s instanceof Promise?s.then(c=>$v(c,a)):$v(s,a)}});function $v(e,a){return e.value===void 0&&(e.value=a.defaultValue),e}const C2=te("$ZodPrefault",(e,a)=>{Tt.init(e,a),e._zod.optin="optional",ut(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,o)=>(o.direction==="backward"||i.value===void 0&&(i.value=a.defaultValue),a.innerType._zod.run(i,o))}),M2=te("$ZodNonOptional",(e,a)=>{Tt.init(e,a),ut(e._zod,"values",()=>{const i=a.innerType._zod.values;return i?new Set([...i].filter(o=>o!==void 0)):void 0}),e._zod.parse=(i,o)=>{const s=a.innerType._zod.run(i,o);return s instanceof Promise?s.then(c=>Hv(c,e)):Hv(s,e)}});function Hv(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 O2=te("$ZodCatch",(e,a)=>{Tt.init(e,a),e._zod.optin="optional",ut(e._zod,"optout",()=>a.innerType._zod.optout),ut(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,o)=>{if(o.direction==="backward")return a.innerType._zod.run(i,o);const s=a.innerType._zod.run(i,o);return s instanceof Promise?s.then(c=>(i.value=c.value,c.issues.length&&(i.value=a.catchValue({...i,error:{issues:c.issues.map(u=>Ja(u,o,Xa()))},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(c=>Ja(c,o,Xa()))},input:i.value}),i.issues=[],i.fallback=!0),i)}}),D2=te("$ZodPipe",(e,a)=>{Tt.init(e,a),ut(e._zod,"values",()=>a.in._zod.values),ut(e._zod,"optin",()=>a.in._zod.optin),ut(e._zod,"optout",()=>a.out._zod.optout),ut(e._zod,"propValues",()=>a.in._zod.propValues),e._zod.parse=(i,o)=>{if(o.direction==="backward"){const c=a.out._zod.run(i,o);return c instanceof Promise?c.then(u=>bc(u,a.in,o)):bc(c,a.in,o)}const s=a.in._zod.run(i,o);return s instanceof Promise?s.then(c=>bc(c,a.out,o)):bc(s,a.out,o)}});function bc(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=te("$ZodReadonly",(e,a)=>{Tt.init(e,a),ut(e._zod,"propValues",()=>a.innerType._zod.propValues),ut(e._zod,"values",()=>a.innerType._zod.values),ut(e._zod,"optin",()=>a.innerType?._zod?.optin),ut(e._zod,"optout",()=>a.innerType?._zod?.optout),e._zod.parse=(i,o)=>{if(o.direction==="backward")return a.innerType._zod.run(i,o);const s=a.innerType._zod.run(i,o);return s instanceof Promise?s.then(Zv):Zv(s)}});function Zv(e){return e.value=Object.freeze(e.value),e}const B2=te("$ZodCustom",(e,a)=>{En.init(e,a),Tt.init(e,a),e._zod.parse=(i,o)=>i,e._zod.check=i=>{const o=i.value,s=a.fn(o);if(s instanceof Promise)return s.then(c=>Pv(c,i,o,e));Pv(s,i,o,e)}});function Pv(e,a,i,o){if(!e){const s={code:"custom",input:i,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(s.params=o._zod.def.params),a.issues.push(Bl(s))}}var qv;class U2{constructor(){this._map=new WeakMap,this._idmap=new Map}add(a,...i){const o=i[0];return this._map.set(a,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.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 o={...this.get(i)??{}};delete o.id;const s={...o,...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 $2(){return new U2}(qv=globalThis).__zod_globalRegistry??(qv.__zod_globalRegistry=$2());const _l=globalThis.__zod_globalRegistry;function H2(e,a){return new e({type:"string",...Re(a)})}function Z2(e,a){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Re(a)})}function Fv(e,a){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Re(a)})}function P2(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Re(a)})}function q2(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Re(a)})}function F2(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Re(a)})}function Q2(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Re(a)})}function Y2(e,a){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Re(a)})}function G2(e,a){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Re(a))DELIM" +R"DELIM(})}function V2(e,a){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Re(a)})}function K2(e,a){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Re(a)})}function I2(e,a){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Re(a)})}function X2(e,a){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Re(a)})}function J2(e,a){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Re(a)})}function W2(e,a){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Re(a)})}function eT(e,a){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Re(a)})}function tT(e,a){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Re(a)})}function nT(e,a){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Re(a)})}function aT(e,a){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Re(a)})}function rT(e,a){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Re(a)})}function iT(e,a){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Re(a)})}function oT(e,a){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Re(a)})}function lT(e,a){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Re(a)})}function sT(e,a){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Re(a)})}function cT(e,a){return new e({type:"string",format:"date",check:"string_format",...Re(a)})}function uT(e,a){return new e({type:"string",format:"time",check:"string_format",precision:null,...Re(a)})}function fT(e,a){return new e({type:"string",format:"duration",check:"string_format",...Re(a)})}function dT(e,a){return new e({type:"number",checks:[],...Re(a)})}function hT(e,a){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Re(a)})}function mT(e,a){return new e({type:"boolean",...Re(a)})}function pT(e){return new e({type:"unknown"})}function yT(e,a){return new e({type:"never",...Re(a)})}function Qv(e,a){return new Mb({check:"less_than",...Re(a),value:e,inclusive:!1})}function Cd(e,a){return new Mb({check:"less_than",...Re(a),value:e,inclusive:!0})}function Yv(e,a){return new Ob({check:"greater_than",...Re(a),value:e,inclusive:!1})}function Md(e,a){return new Ob({check:"greater_than",...Re(a),value:e,inclusive:!0})}function Gv(e,a){return new z_({check:"multiple_of",...Re(a),value:e})}function Zb(e,a){return new M_({check:"max_length",...Re(a),maximum:e})}function Yc(e,a){return new O_({check:"min_length",...Re(a),minimum:e})}function Pb(e,a){return new D_({check:"length_equals",...Re(a),length:e})}function gT(e,a){return new L_({check:"string_format",format:"regex",...Re(a),pattern:e})}function vT(e){return new B_({check:"string_format",format:"lowercase",...Re(e)})}function bT(e){return new U_({check:"string_format",format:"uppercase",...Re(e)})}function xT(e,a){return new $_({check:"string_format",format:"includes",...Re(a),includes:e})}function ST(e,a){return new H_({check:"string_format",format:"starts_with",...Re(a),prefix:e})}function wT(e,a){return new Z_({check:"string_format",format:"ends_with",...Re(a),suffix:e})}function wo(e){return new P_({check:"overwrite",tx:e})}function ET(e){return wo(a=>a.normalize(e))}function _T(){return wo(e=>e.trim())}function TT(){return wo(e=>e.toLowerCase())}function RT(){return wo(e=>e.toUpperCase())}function jT(){return wo(e=>OE(e))}function NT(e,a,i){return new e({type:"array",element:a,...Re(i)})}function kT(e,a,i){return new e({type:"custom",check:"custom",fn:a,...Re(i)})}function AT(e,a){const i=zT(o=>(o.addIssue=s=>{if(typeof s=="string")o.issues.push(Bl(s,o.value,i._zod.def));else{const c=s;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=o.value),c.inst??(c.inst=i),c.continue??(c.continue=!i._zod.def.abort),o.issues.push(Bl(c))}},e(o.value,o)),a);return i}function zT(e,a){const i=new En({check:"custom",...Re(a)});return i._zod.check=e,i}function qb(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??_l,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 Ht(e,a,i={path:[],schemaPath:[]}){var o;const s=e._zod.def,c=a.seen.get(e);if(c)return c.count++,i.schemaPath.includes(e)&&(c.cycle=i.path),c.schema;const u={schema:{},count:1,cycle:void 0,path:i.path};a.seen.set(e,u);const d=e._zod.toJSONSchema?.();if(d)u.schema=d;else{const b={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(a,u.schema,b);else{const x=u.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&&(u.ref||(u.ref=g),Ht(g,a,b),a.seen.get(g).isParent=!0)}const m=a.metadataRegistry.get(e);return m&&Object.assign(u.schema,m),a.io==="input"&&fn(e)&&(delete u.schema.examples,delete u.schema.default),a.io==="input"&&"_prefault"in u.schema&&((o=u.schema).default??(o.default=u.schema._prefault)),delete u.schema._prefault,a.seen.get(e).schema}function Fb(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const u of e.seen.entries()){const d=e.metadataRegistry.get(u[0])?.id;if(d){const m=o.get(d);if(m&&m!==u[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(d,u[0])}}const s=u=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=e.external.registry.get(u[0])?.id,x=e.external.uri??(T=>T);if(g)return{ref:x(g)};const w=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=w,{defId:w,ref:`${x("__shared")}#/${d}/${w}`}}if(u[1]===i)return{ref:"#"};const p=`#/${d}/`,b=u[1].schema.id??`__schema${e.counter++}`;return{defId:b,ref:p+b}},c=u=>{if(u[1].schema.$ref)return;const d=u[1],{ref:m,defId:p}=s(u);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 u of e.seen.entries()){const d=u[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 Zb(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=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){o(g);const w=e.seen.get(g),T=w.schema;if(T.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(T)):Object.assign(p,T),Object.assign(p,b),d._zod.parent===g)for(const R in p)R==="$ref"||R==="allOf"||R in b||delete p[R];if(T.$ref&&w.def)for(const R in p)R==="$ref"||R==="allOf"||R in w.def&&JSON.stringify(p[R])===JSON.stringify(w.def[R])&&delete p[R]}const x=d._zod.parent;if(x&&x!==g){o(x);const w=e.seen.get(x);if(w?.schema.$ref&&(p.$ref=w.schema.$ref,w.def))for(const T in p)T==="$ref"||T==="allOf"||T in w.def&&JSON.stringify(p[T])===JSON.stringify(w.def[T])&&delete p[T]}e.override({zodSchema:d,jsonSchema:p,path:m.path??[]})};for(const d of[...e.seen.entries()].reverse())o(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 cn(e,a){const i=a??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return cn(o.element,i);if(o.type==="set")return cn(o.valueType,i);if(o.type==="lazy")return cn(o.getter(),i);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return cn(o.innerType,i);if(o.type==="intersection")return cn(o.left,i)||cn(o.right,i);if(o.type==="record"||o.type==="map")return cn(o.keyType,i)||cn(o.valueType,i);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:cn(o.in,i)||cn(o.out,i);if(o.type==="object"){for(const s in o.shape)if(cn(o.shape[s],i))return!0;return!1}if(o.type==="union"){for(const s of o.options)if(cn(s,i))return!0;return!1}if(o.type==="tuple"){for(const s of o.items)if(cn(s,i))return!0;return!!(o.rest&&cn(o.rest,i))}return!1}const AT=(e,a={})=>i=>{const o=Hb({...i,processors:a});return It(e,o),$b(o,e),Zb(o,e)},Qu=(e,a,i={})=>o=>{const{libraryOptions:s,target:u}=o??{},c=Hb({...s??{},ta)DELIM" -R"DELIM(rget:u,io:a,processors:i});return It(e,c),$b(c,e),Zb(c,e)},NT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},jT=(e,a,i,o)=>{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=NT[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}))])}},zT=(e,a,i,o)=>{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 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)},CT=(e,a,i,o)=>{i.type="boolean"},MT=(e,a,i,o)=>{i.not={}},OT=(e,a,i,o)=>{},kT=(e,a,i,o)=>{const s=e._zod.def,u=vb(s.entries);u.every(c=>typeof c=="number")&&(i.type="number"),u.every(c=>typeof c=="string")&&(i.type="string"),i.enum=u},DT=(e,a,i,o)=>{const s=e._zod.def,u=[];for(const c of s.values)if(c===void 0){if(a.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof c=="bigint"){if(a.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");u.push(Number(c))}else u.push(c);if(u.length!==0)if(u.length===1){const c=u[0];i.type=c===null?"null":typeof c,a.target==="draft-04"||a.target==="openapi-3.0"?i.enum=[c]:i.const=c}else u.every(c=>typeof c=="number")&&(i.type="number"),u.every(c=>typeof c=="string")&&(i.type="string"),u.every(c=>typeof c=="boolean")&&(i.type="boolean"),u.every(c=>c===null)&&(i.type="null"),i.enum=u},LT=(e,a,i,o)=>{if(a.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},BT=(e,a,i,o)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},UT=(e,a,i,o)=>{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=It(u.element,a,{...o,path:[...o.path,"items"]})},HT=(e,a,i,o)=>{const s=i,u=e._zod.def;s.type="object",s.properties={};const c=u.shape;for(const p in c)s.properties[p]=It(c[p],a,{...o,path:[...o.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=It(u.catchall,a,{...o,path:[...o.path,"additionalProperties"]})):a.io==="output"&&(s.additionalProperties=!1)},$T=(e,a,i,o)=>{const s=e._zod.def,u=s.inclusive===!1,c=s.options.map((d,m)=>It(d,a,{...o,path:[...o.path,u?"oneOf":"anyOf",m]}));u?i.oneOf=c:i.anyOf=c},ZT=(e,a,i,o)=>{const s=e._zod.def,u=It(s.left,a,{...o,path:[...o.path,"allOf",0]}),c=It(s.right,a,{...o,path:[...o.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},qT=(e,a,i,o)=>{const s=e._zod.def,u=It(s.innerType,a,o),c=a.seen.get(e);a.target==="openapi-3.0"?(c.ref=s.innerType,i.nullable=!0):i.anyOf=[u,{type:"null"}]},PT=(e,a,i,o)=>{const s=e._zod.def;It(s.innerType,a,o);const u=a.seen.get(e);u.ref=s.innerType},FT=(e,a,i,o)=>{const s=e._zod.def;It(s.innerType,a,o);const u=a.seen.get(e);u.ref=s.innerType,i.default=JSON.parse(JSON.stringify(s.defaultValue))},QT=(e,a,i,o)=>{const s=e._zod.def;It(s.innerType,a,o);const u=a.seen.get(e);u.ref=s.innerType,a.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},YT=(e,a,i,o)=>{const s=e._zod.def;It(s.innerType,a,o);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},GT=(e,a,i,o)=>{const s=e._zod.def,u=s.in._zod.traits.has("$ZodTransform"),c=a.io==="input"?u?s.out:s.in:s.out;It(c,a,o);const d=a.seen.get(e);d.ref=c},VT=(e,a,i,o)=>{const s=e._zod.def;It(s.innerType,a,o);const u=a.seen.get(e);u.ref=s.innerType,i.readOnly=!0},qb=(e,a,i,o)=>{const s=e._zod.def;It(s.innerType,a,o);const u=a.seen.get(e);u.ref=s.innerType},KT=te("ZodISODateTime",(e,a)=>{J_.init(e,a),_t.init(e,a)});function IT(e){return aT(KT,e)}const XT=te("ZodISODate",(e,a)=>{W_.init(e,a),_t.init(e,a)});function JT(e){return rT(XT,e)}const WT=te("ZodISOTime",(e,a)=>{e2.init(e,a),_t.init(e,a)});function e4(e){return iT(WT,e)}const t4=te("ZodISODuration",(e,a)=>{t2.init(e,a),_t.init(e,a)});function n4(e){return oT(t4,e)}const a4=(e,a)=>{Eb.init(e,a),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>PE(e,i)},flatten:{value:i=>qE(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,dh,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,dh,2)}},isEmpty:{get(){return e.issues.length===0}}})},Jn=te("ZodError",a4,{Parent:Error}),r4=qh(Jn),i4=Ph(Jn),o4=ac(Jn),l4=rc(Jn),s4=YE(Jn),u4=GE(Jn),c4=VE(Jn),f4=KE(Jn),d4=IE(Jn),h4=XE(Jn),m4=JE(Jn),p4=WE(Jn),Qv=new WeakMap;function Pl(e,a,i){const o=Object.getPrototypeOf(e);let s=Qv.get(o);if(s||(s=new Set,Qv.set(o,s)),!s.has(a)){s.add(a);for(const u in i){const c=i[u];Object.defineProperty(o,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 jt=te("ZodType",(e,a)=>(Nt.init(e,a),Object.assign(e["~standard"],{jsonSchema:{input:Qu(e,"input"),output:Qu(e,"output")}}),e.toJSONSchema=AT(e,{}),e.def=a,e.type=a.type,Object.defineProperty(e,"_def",{value:a}),e.parse=(i,o)=>r4(e,i,o,{callee:e.parse}),e.safeParse=(i,o)=>o4(e,i,o),e.parseAsync=async(i,o)=>i4(e,i,o,{callee:e.parseAsync}),e.safeParseAsync=async(i,o)=>l4(e,i,o),e.spa=e.safeParseAsync,e.encode=(i,o)=>s4(e,i,o),e.decode=(i,o)=>u4(e,i,o),e.encodeAsync=async(i,o)=>c4(e,i,o),e.decodeAsync=async(i,o)=>f4(e,i,o),e.safeEncode=(i,o)=>d4(e,i,o),e.safeDecode=(i,o)=>h4(e,i,o),e.safeEncodeAsync=async(i,o)=>m4(e,i,o),e.safeDecodeAsync=async(i,o)=>p4(e,i,o),Pl(e,"ZodType",{check(...i){const o=this.def;return this.clone(Br(o,{checks:[...o.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,o){return Ur(this,i,o)},brand(){return this},register(i,o){return i.add(this,o),this},refine(i,o){return this.check(cR(i,o))},superRefine(i,o){return this.check(fR(i,o))},overwrite(i){return this.check(bo(i))},optional(){return Kv(this)},exactOptional(){return X4(this)},nullable(){return Iv(this)},nullish(){return Kv(Iv(this))},nonoptional(i){return aR(this,i)},array(){return Lr(this)},or(i){return Z4([this,i])},and(i){return Q4(this,i)},transform(i){return Xv(this,K4(i))},default(i){return eR(this,i)},prefault(i){return nR(this,i)},catch(i){return iR(this,i)},pipe(i){return Xv(this,i)},readonly(){return sR(this)},describe(i){const o=this.clone();return xl.add(o,{description:i}),o},meta(...i){if(i.length===0)return xl.get(this);const o=this.clone();return xl.add(o,i[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(i){return i(this)}}),Object.defineProperty(e,"description",{get(){return xl.get(e)?.description},configurable:!0}),e)),Pb=te("_ZodString",(e,a)=>{Fh.init(e,a),jt.init(e,a),e._zod.proc)DELIM" -R"DELIM(essJSONSchema=(o,s,u)=>jT(e,o,s);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,Pl(e,"_ZodString",{regex(...o){return this.check(dT(...o))},includes(...o){return this.check(pT(...o))},startsWith(...o){return this.check(yT(...o))},endsWith(...o){return this.check(gT(...o))},min(...o){return this.check(Fu(...o))},max(...o){return this.check(Bb(...o))},length(...o){return this.check(Ub(...o))},nonempty(...o){return this.check(Fu(1,...o))},lowercase(o){return this.check(hT(o))},uppercase(o){return this.check(mT(o))},trim(){return this.check(bT())},normalize(...o){return this.check(vT(...o))},toLowerCase(){return this.check(xT())},toUpperCase(){return this.check(ST())},slugify(){return this.check(wT())}})}),y4=te("ZodString",(e,a)=>{Fh.init(e,a),Pb.init(e,a),e.email=i=>e.check(L2(g4,i)),e.url=i=>e.check(Z2(v4,i)),e.jwt=i=>e.check(nT(O4,i)),e.emoji=i=>e.check(q2(b4,i)),e.guid=i=>e.check(Zv(Yv,i)),e.uuid=i=>e.check(B2(vu,i)),e.uuidv4=i=>e.check(U2(vu,i)),e.uuidv6=i=>e.check(H2(vu,i)),e.uuidv7=i=>e.check($2(vu,i)),e.nanoid=i=>e.check(P2(x4,i)),e.guid=i=>e.check(Zv(Yv,i)),e.cuid=i=>e.check(F2(S4,i)),e.cuid2=i=>e.check(Q2(w4,i)),e.ulid=i=>e.check(Y2(E4,i)),e.base64=i=>e.check(W2(z4,i)),e.base64url=i=>e.check(eT(C4,i)),e.xid=i=>e.check(G2(_4,i)),e.ksuid=i=>e.check(V2(T4,i)),e.ipv4=i=>e.check(K2(R4,i)),e.ipv6=i=>e.check(I2(A4,i)),e.cidrv4=i=>e.check(X2(N4,i)),e.cidrv6=i=>e.check(J2(j4,i)),e.e164=i=>e.check(tT(M4,i)),e.datetime=i=>e.check(IT(i)),e.date=i=>e.check(JT(i)),e.time=i=>e.check(e4(i)),e.duration=i=>e.check(n4(i))});function At(e){return D2(y4,e)}const _t=te("ZodStringFormat",(e,a)=>{wt.init(e,a),Pb.init(e,a)}),g4=te("ZodEmail",(e,a)=>{P_.init(e,a),_t.init(e,a)}),Yv=te("ZodGUID",(e,a)=>{Z_.init(e,a),_t.init(e,a)}),vu=te("ZodUUID",(e,a)=>{q_.init(e,a),_t.init(e,a)}),v4=te("ZodURL",(e,a)=>{F_.init(e,a),_t.init(e,a)}),b4=te("ZodEmoji",(e,a)=>{Q_.init(e,a),_t.init(e,a)}),x4=te("ZodNanoID",(e,a)=>{Y_.init(e,a),_t.init(e,a)}),S4=te("ZodCUID",(e,a)=>{G_.init(e,a),_t.init(e,a)}),w4=te("ZodCUID2",(e,a)=>{V_.init(e,a),_t.init(e,a)}),E4=te("ZodULID",(e,a)=>{K_.init(e,a),_t.init(e,a)}),_4=te("ZodXID",(e,a)=>{I_.init(e,a),_t.init(e,a)}),T4=te("ZodKSUID",(e,a)=>{X_.init(e,a),_t.init(e,a)}),R4=te("ZodIPv4",(e,a)=>{n2.init(e,a),_t.init(e,a)}),A4=te("ZodIPv6",(e,a)=>{a2.init(e,a),_t.init(e,a)}),N4=te("ZodCIDRv4",(e,a)=>{r2.init(e,a),_t.init(e,a)}),j4=te("ZodCIDRv6",(e,a)=>{i2.init(e,a),_t.init(e,a)}),z4=te("ZodBase64",(e,a)=>{o2.init(e,a),_t.init(e,a)}),C4=te("ZodBase64URL",(e,a)=>{s2.init(e,a),_t.init(e,a)}),M4=te("ZodE164",(e,a)=>{u2.init(e,a),_t.init(e,a)}),O4=te("ZodJWT",(e,a)=>{f2.init(e,a),_t.init(e,a)}),Fb=te("ZodNumber",(e,a)=>{Mb.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(o,s,u)=>zT(e,o,s),Pl(e,"ZodNumber",{gt(o,s){return this.check(Pv(o,s))},gte(o,s){return this.check(Cd(o,s))},min(o,s){return this.check(Cd(o,s))},lt(o,s){return this.check(qv(o,s))},lte(o,s){return this.check(zd(o,s))},max(o,s){return this.check(zd(o,s))},int(o){return this.check(Gv(o))},safe(o){return this.check(Gv(o))},positive(o){return this.check(Pv(0,o))},nonnegative(o){return this.check(Cd(0,o))},negative(o){return this.check(qv(0,o))},nonpositive(o){return this.check(zd(0,o))},multipleOf(o,s){return this.check(Fv(o,s))},step(o,s){return this.check(Fv(o,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 lT(Fb,e)}const k4=te("ZodNumberFormat",(e,a)=>{d2.init(e,a),Fb.init(e,a)});function Gv(e){return sT(k4,e)}const D4=te("ZodBoolean",(e,a)=>{h2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>CT(e,i,o)});function Qh(e){return uT(D4,e)}const L4=te("ZodUnknown",(e,a)=>{m2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>OT()});function mh(){return cT(L4)}const B4=te("ZodNever",(e,a)=>{p2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>MT(e,i,o)});function U4(e){return fT(B4,e)}const H4=te("ZodArray",(e,a)=>{y2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>UT(e,i,o,s),e.element=a.element,Pl(e,"ZodArray",{min(i,o){return this.check(Fu(i,o))},nonempty(i){return this.check(Fu(1,i))},max(i,o){return this.check(Bb(i,o))},length(i,o){return this.check(Ub(i,o))},unwrap(){return this.element}})});function Lr(e,a){return ET(H4,e,a)}const $4=te("ZodObject",(e,a)=>{v2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>HT(e,i,o,s),ct(e,"shape",()=>a.shape),Pl(e,"ZodObject",{keyof(){return Y4(Object.keys(this._zod.def.shape))},catchall(i){return this.clone({...this._zod.def,catchall:i})},passthrough(){return this.clone({...this._zod.def,catchall:mh()})},loose(){return this.clone({...this._zod.def,catchall:mh()})},strict(){return this.clone({...this._zod.def,catchall:U4()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(i){return LE(this,i)},safeExtend(i){return BE(this,i)},merge(i){return UE(this,i)},pick(i){return kE(this,i)},omit(i){return DE(this,i)},partial(...i){return HE(Yb,this,i[0])},required(...i){return $E(Gb,this,i[0])}})});function Dn(e,a){const i={type:"object",shape:e??{},...Re(a)};return new $4(i)}const Qb=te("ZodUnion",(e,a)=>{Db.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>$T(e,i,o,s),e.options=a.options});function Z4(e,a){return new Qb({type:"union",options:e,...Re(a)})}const q4=te("ZodDiscriminatedUnion",(e,a)=>{Qb.init(e,a),b2.init(e,a)});function P4(e,a,i){return new q4({type:"union",options:a,discriminator:e,...Re(i)})}const F4=te("ZodIntersection",(e,a)=>{x2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>ZT(e,i,o,s)});function Q4(e,a){return new F4({type:"intersection",left:e,right:a})}const ph=te("ZodEnum",(e,a)=>{S2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(o,s,u)=>kT(e,o,s),e.enum=a.entries,e.options=Object.values(a.entries);const i=new Set(Object.keys(a.entries));e.extract=(o,s)=>{const u={};for(const c of o)if(i.has(c))u[c]=a.entries[c];else throw new Error(`Key ${c} not found in enum`);return new ph({...a,checks:[],...Re(s),entries:u})},e.exclude=(o,s)=>{const u={...a.entries};for(const c of o)if(i.has(c))delete u[c];else throw new Error(`Key ${c} not found in enum`);return new ph({...a,checks:[],...Re(s),entries:u})}});function Y4(e,a){const i=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new ph({type:"enum",entries:i,...Re(a)})}const G4=te("ZodLiteral",(e,a)=>{w2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>DT(e,i,o),e.values=new Set(a.values),Object.defineProperty(e,"value",{get(){if(a.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return a.values[0]}})});function Vv(e,a){return new G4({type:"literal",values:Array.isArray(e)?e:[e],...Re(a)})}const V4=te("ZodTransform",(e,a)=>{E2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>BT(e,i),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new gb(e.constructor.name);i.addIssue=u=>{if(typeof u=="string")i.issues.push(kl(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(kl(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 K4(e){return new V4({type:"transform",transform:e})}const Yb=te("ZodOptional",(e,a)=>{Lb.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>qb(e,i,o,s),e.unwrap=()=>e._zod.def.innerType});function Kv(e){return new Yb({type:"optional",innerType:e})}const I4=te("ZodExactOptional",(e,a)=>{_2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>qb(e,i,o,s),e.unwrap=()=>e._zod.def.innerType});function X4(e){return new I4({type:")DELIM" -R"DELIM(optional",innerType:e})}const J4=te("ZodNullable",(e,a)=>{T2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>qT(e,i,o,s),e.unwrap=()=>e._zod.def.innerType});function Iv(e){return new J4({type:"nullable",innerType:e})}const W4=te("ZodDefault",(e,a)=>{R2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>FT(e,i,o,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function eR(e,a){return new W4({type:"default",innerType:e,get defaultValue(){return typeof a=="function"?a():xb(a)}})}const tR=te("ZodPrefault",(e,a)=>{A2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>QT(e,i,o,s),e.unwrap=()=>e._zod.def.innerType});function nR(e,a){return new tR({type:"prefault",innerType:e,get defaultValue(){return typeof a=="function"?a():xb(a)}})}const Gb=te("ZodNonOptional",(e,a)=>{N2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>PT(e,i,o,s),e.unwrap=()=>e._zod.def.innerType});function aR(e,a){return new Gb({type:"nonoptional",innerType:e,...Re(a)})}const rR=te("ZodCatch",(e,a)=>{j2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>YT(e,i,o,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function iR(e,a){return new rR({type:"catch",innerType:e,catchValue:typeof a=="function"?a:()=>a})}const oR=te("ZodPipe",(e,a)=>{z2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>GT(e,i,o,s),e.in=a.in,e.out=a.out});function Xv(e,a){return new oR({type:"pipe",in:e,out:a})}const lR=te("ZodReadonly",(e,a)=>{C2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>VT(e,i,o,s),e.unwrap=()=>e._zod.def.innerType});function sR(e){return new lR({type:"readonly",innerType:e})}const uR=te("ZodCustom",(e,a)=>{M2.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>LT(e,i)});function cR(e,a={}){return _T(uR,e,a)}function fR(e,a){return TT(e,a)}function di(e){if(!e)return;const a=e.trim();if(!a)return;const i=a.toLowerCase(),o=i.indexOf("1");if(o>0){const c=i.slice(0,o);if(["bc","tb","bcrt","ltc","sb"].includes(c)){const d=i.slice(o+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 Yh extends Error{constructor(a,i){super(a),this.status=i}status}const yh=Dn({id:At(),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:At().optional(),previousblockhash:At().nullable().optional(),nonce:Ve().optional(),version:Ve().optional()}).loose(),Vb=Dn({confirmed:Qh(),block_height:Ve().optional(),block_hash:At().optional(),block_time:Ve().optional()}),dR=Dn({txid:At().optional().nullable(),vout:Ve().optional().nullable(),sequence:Ve().optional(),scriptsig:At().optional().nullable(),scriptsig_asm:At().optional().nullable(),witness:Lr(At()).optional(),is_coinbase:Qh().optional(),prevout:Dn({scriptpubkey_type:At().optional(),scriptpubkey_address:At().optional(),scriptpubkey:At().optional(),scriptpubkey_asm:At().optional(),value:Ve().optional()}).partial().nullable().optional()}).loose(),hR=Dn({scriptpubkey_type:At().optional(),scriptpubkey_address:At().optional(),scriptpubkey:At().optional(),scriptpubkey_asm:At().optional(),value:Ve(),n:Ve().optional()}).loose(),zu=Dn({txid:At(),hash:At().optional(),fee:Ve().optional(),version:Ve(),locktime:Ve(),vin:Lr(dR),vout:Lr(hR),size:Ve(),weight:Ve(),status:Vb}).loose(),Gh=Lr(yh),Yu=Lr(zu),Jv=Dn({in_best_chain:Qh(),next_best:At().optional(),height:Ve().optional()}),Wv=Dn({address:At(),chain_stats:Dn({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:Dn({funded_txo_count:Ve().optional(),funded_txo_sum:Ve().optional(),spent_txo_count:Ve().optional(),spent_txo_sum:Ve().optional(),tx_count:Ve().optional()})}),mR=Dn({txid:At(),vout:Ve().int().nonnegative(),value:Ve().nonnegative(),status:Vb}).loose(),pR=Lr(mR),yR=P4("spent",[Dn({spent:Vv(!1)}),Dn({spent:Vv(!0),txid:At().regex(/^[0-9a-f]{64}$/iu),vin:Ve().int().nonnegative().max(4294967295)})]);async function qt(e,a,i){const o=a.startsWith("/")?a:`/${a}`,s=await fetch(`${e}${o}`);if(!s.ok)throw new Yh(`Request to ${a} failed with status ${String(s.status)}`,s.status);const u=await s.json();return i.parse(u)}async function e0(e,a,i){if(i<=0)return[];const o=[];let s=a;for(;s&&o.lengthu.scriptpubkey_address===e?s+u.value:s,0),o=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-o}async function Md(e,a){if(a==="latest"||a==="tip"){const i=await qt(e,"/blocks",Gh);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 Yh("Unable to resolve block height",i.status);return(await i.text()).trim()}return a}async function n0(e,a,i){if(i.lastKnownHeight==null||a>=i.lastKnownHeight)return null;const o=a+1;try{const s=await fetch(`${e}/block-height/${String(o)}`);return s.ok&&(await s.text()).trim()||null}catch(s){return console.warn(`Failed to resolve hash for height ${String(o)}`,s),null}}function hl(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 Od(e,a){const i=e.status.confirmed?"confirmed":"unconfirmed",o=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:o,outputs:s}}function vR(e,a){const i=e.chain_stats,o=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:di(e.address),balance:s,totalReceived:(i.funded_txo_sum??0)+(o.funded_txo_sum??0),totalSent:(i.spent_txo_sum??0)+(o.spent_txo_sum??0),txCount:(i.tx_count??0)+(o.tx_count??0),utxoCount:(i.funded_txo_count??0)-(i.spent_txo_count??0),transacti)DELIM" -R"DELIM(ons:u}}function bR(e){const a=e.chain_stats,i=e.mempool_stats,o=(a.funded_txo_sum??0)-(a.spent_txo_sum??0);return{address:e.address,addressType:di(e.address),balance:o,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:gR(e,i),blockHeight:i.status.block_height}))}async function a0(e,a,i=0){const o=i>0?`/block/${a}/txs/${String(i)}`:`/block/${a}/txs`;return qt(e,o,Yu)}async function xR(e,a,i){return i?qt(e,`/address/${a}/txs/chain/${i}`,Yu):qt(e,`/address/${a}/txs`,Yu)}function Ib({baseUrl:e}){const a=new Set;let i=null;const o={lastBlockHash:null,lastKnownHeight:null};async function s(d){const m=await qt(e,`/tx/${d}`,zu);return await(m.status.block_height?eo(e,o,m.status.block_height):eo(e,o)),Od(m,o)}function u(){i||a.size===0||(i=setInterval(async()=>{try{const d=await qt(e,"/blocks",Gh);if(d.length===0)return;const m=d[0];if(m.id!==o.lastBlockHash){o.lastBlockHash=m.id,o.lastKnownHeight=Math.max(m.height,o.lastKnownHeight??0);const p=hl(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 e0(e,"/blocks",d);return m.length>0&&(o.lastBlockHash=m[0].id,o.lastKnownHeight=Math.max(m[0].height,o.lastKnownHeight??0)),m.map(p=>hl(p))},async getBlocksBefore(d,m=10){const p=Math.max(d,0),b=await e0(e,`/blocks/${String(p)}`,m);return b.length>0&&(o.lastKnownHeight=Math.max(b[0].height,o.lastKnownHeight??0)),b.map(g=>hl(g))},async getBlockHeader(d){const m=await Md(e,d);await eo(e,o);const[p,b]=await Promise.all([qt(e,`/block/${m}`,yh),qt(e,`/block/${m}/status`,Jv).catch(()=>null)]),g=hl(p);o.lastBlockHash=g.hash,o.lastKnownHeight=Math.max(g.height,o.lastKnownHeight??g.height);let x=b?.next_best??null;return x||(x=await n0(e,g.height,o)),{...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 Md(e,d);await eo(e,o);const p=await qt(e,`/block/${m}`,yh),[b,g]=await Promise.allSettled([a0(e,m),qt(e,`/block/${m}/status`,Jv)]);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=hl(p);o.lastBlockHash=x.hash,o.lastKnownHeight=Math.max(x.height,o.lastKnownHeight??x.height);const w=b.status==="fulfilled"?b.value:[];let C=(g.status==="fulfilled"?g.value:null)?.next_best??null;return C||(C=await n0(e,x.height,o)),{...x,merkleRoot:p.merkle_root,nonce:p.nonce,bits:p.bits,version:p.version,nextBlockHash:C,transactions:w.map(q=>Od(q,o))}},async getBlockTransactions(d,m=0){const p=await Md(e,d),b=await a0(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"?eo(e,o,g):eo(e,o)),b.map(x=>Od(x,o))},async getTransactionHeader(d){return s(d)},async getTransaction(d){return s(d)},async getTransactionInputScriptHex(d,m){const p=await qt(e,`/tx/${d}`,zu);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 qt(e,`/tx/${d}`,zu);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 getTransactionOutputSpends(d,m){if(m.length===0)return[];const p=await qt(e,`/tx/${d}/outspends`,Lr(mh()));return m.map(b=>{const g=yR.safeParse(p[b]);return g.success?g.data.spent?{outputIndex:b,status:"spent",txid:g.data.txid.toLowerCase(),inputIndex:g.data.vin}:{outputIndex:b,status:"unspent"}:{outputIndex:b,status:"unknown"}})},async getAddressSummary(d){const m=await qt(e,`/address/${d}`,Wv);return bR(m)},async getAddressUtxos(d){return(await qt(e,`/address/${d}/utxo`,pR)).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 qt(e,`/address/${d}`,Wv),p=await qt(e,`/address/${d}/txs`,Yu);return vR(m,p)},async getAddressTransactions(d,m){const p=await xR(e,d,m);return Kb(d,p)},subscribeToEvents(d){return a.add(d),u(),()=>{a.delete(d),a.size===0&&c()}}}}function SR({baseUrl:e}){const a=Ib({baseUrl:e});return{...a,metadata:{...a.metadata,id:"mempool",label:"mempool.space",endpoint:e,description:"Adapter backed by mempool.space REST API."}}}function Dl(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function Xb(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 Vh(e){if(typeof e!="function")throw new TypeError("function expected");return!0}function Ll(e,a){if(typeof a!="string")throw new TypeError(`${e}: string expected`);return!0}function Fl(e){if(typeof e!="number")throw new TypeError(`number expected, got ${typeof e}`);if(!Number.isSafeInteger(e))throw new RangeError(`invalid integer: ${e}`)}function Gu(e){if(!Array.isArray(e))throw new TypeError("array expected")}function Jb(e,a){if(!Xb(!0,a))throw new TypeError(`${e}: array of strings expected`)}function Kh(e,a){if(!Xb(!1,a))throw new TypeError(`${e}: array of numbers expected`)}function Ih(...e){const a=u=>u,i=(u,c)=>d=>u(c(d)),o=e.map(u=>u.encode).reduceRight(i,a),s=e.map(u=>u.decode).reduce(i,a);return{encode:o,decode:s}}function Wb(e){const a=typeof e=="string"?e.split(""):e,i=a.length;Jb("alphabet",a);const o=new Map(a.map((s,u)=>[s,u]));return{encode:s=>(Gu(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=>(Gu(s),s.map(u=>{Ll("alphabet.decode",u);const c=o.get(u);if(c===void 0)throw new Error(`Unknown letter: "${u}". Allowed: ${e}`);return c}))}}function ex(e=""){return Ll("join",e),{encode:a=>(Jb("join.decode",a),a.join(e)),decode:a=>(Ll("join.decode",a),a.split(e))}}function r0(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(Gu(e),!e.length)return[];let o=0;const s=[],u=Array.from(e,d=>{if(Fl(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=o;pa===0?e:tx(a,e%a),Vu=(e,a)=>e+(a-tx(e,a)),Cu=(()=>{let e=[];for(let a=0;a<40;a++)e.push(2**a);return e})();function gh(e,a,i,o){if(Gu(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(Vu(a,i)>32)throw new Error(`convertRadix2: carry overflow from=${a} to=${i} carryBits=${Vu(a,i)}`);let s=0,u=0;const c=Cu[a],d=Cu[)DELIM" -R"DELIM(i]-1,m=[];for(const p of e){if(Fl(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=Cu[u];if(b===void 0)throw new Error("invalid carry");s&=b-1}if(s=s<=a)throw new Error("Excess padding");if(!o&&s>0)throw new Error(`Non-zero padding: ${s}`);return o&&u>0&&m.push(s>>>0),m}function wR(e){Fl(e);const a=2**8;return{encode:i=>{if(!Dl(i))throw new TypeError("radix.encode input should be Uint8Array");return r0(Array.from(i),a,e)},decode:i=>(Kh("radix.decode",i),Uint8Array.from(r0(i,e,a)))}}function ER(e,a=!1){if(Fl(e),e<=0||e>32)throw new RangeError("radix2: bits should be in (0..32]");if(Vu(8,e)>32||Vu(e,8)>32)throw new RangeError("radix2: carry overflow");return{encode:i=>{if(!Dl(i))throw new TypeError("radix2.encode input should be Uint8Array");return gh(Array.from(i),8,e,!a)},decode:i=>(Kh("radix2.decode",i),Uint8Array.from(gh(i,e,8,a)))}}function i0(e){return Vh(e),function(...a){try{return e.apply(null,a)}catch{}}}function _R(e,a){if(Fl(e),e<=0)throw new RangeError(`checksum length must be positive: ${e}`);Vh(a);const i=a;return{encode(o){if(!Dl(o))throw new TypeError("checksum.encode: input should be Uint8Array");const s=i(o).slice(0,e),u=new Uint8Array(o.length+e);return u.set(o),u.set(s,o.length),u},decode(o){if(!Dl(o))throw new TypeError("checksum.decode: input should be Uint8Array");const s=o.slice(0,-e),u=o.slice(-e),c=i(s).slice(0,e);for(let d=0;dIh(wR(58),Wb(e),ex("")),RR=Object.freeze(TR("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),AR=e=>{Vh(e);const a=e;return Ih(_R(4,i=>a(a(i))),RR)},vh=Ih(Wb("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),ex("")),o0=[996825010,642813549,513874426,1027748829,705979059];function ml(e){const a=e>>25;let i=(e&33554431)<<5;for(let o=0;o>o&1)===1&&(i^=o0[o]);return i}function l0(e,a,i=1){const o=e.length;let s=1;for(let u=0;u126)throw new Error(`Invalid prefix (${e})`);s=ml(s)^c>>5}s=ml(s);for(let u=0;uw)throw new TypeError(`Length ${C} exceeds limit ${w}`);const R=g.toLowerCase(),q=l0(R,x,a);return`${R}1${vh.encode(x)}${q}`}function d(g,x=90){Ll("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 T=g.toLowerCase();if(g!==T&&g!==g.toUpperCase())throw new Error("String must be lowercase or uppercase");const C=T.lastIndexOf("1");if(C===0||C===-1)throw new Error('Letter "1" must be present between prefix and data only');const R=T.slice(0,C),q=T.slice(C+1);if(q.length<6)throw new Error("Data must be at least 6 characters long");const G=vh.decode(q).slice(0,-6),X=l0(R,G,a);if(!q.endsWith(X))throw new Error(`Invalid checksum in ${g}: expected "${X}"`);return{prefix:R,words:G}}const m=i0(d);function p(g){const{prefix:x,words:w}=d(g,!1);return{prefix:x,words:w,bytes:o(w)}}function b(g,x){return c(g,s(x))}return{encode:c,decode:d,encodeFromBytes:b,decodeToBytes:p,decodeUnsafe:m,fromWords:o,fromWordsUnsafe:u,toWords:s}}const Ku=Object.freeze(nx("bech32")),bh=Object.freeze(nx("bech32m"));function NR(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function Xh(e,a,i=""){const o=NR(e),s=e?.length;if(!o||a!==void 0){const c=i&&`"${i}" `,d="",m=o?`length=${s}`:`type=${typeof e}`,p=c+"expected Uint8Array"+d+", got "+m;throw o?new RangeError(p):new TypeError(p)}return e}function s0(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 jR(e,a){Xh(e,void 0,"digestInto() output");const i=a.outputLen;if(e.length='+i)}function xh(...e){for(let a=0;a>>a}const zR=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",CR=Array.from({length:256},(e,a)=>a.toString(16).padStart(2,"0"));function Mu(e){if(Xh(e),zR)return e.toHex();let a="";for(let i=0;ie(u).update(s).digest(),o=e(void 0);return i.outputLen=o.outputLen,i.blockLen=o.blockLen,i.canXOF=o.canXOF,i.create=s=>e(s),Object.assign(i,a),Object.freeze(i)}const OR=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function kR(e,a,i){return e&a^~e&i}function DR(e,a,i){return e&a^e&i^a&i}class LR{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(a,i,o,s){this.blockLen=a,this.outputLen=i,this.padOffset=o,this.isLE=s,this.buffer=new Uint8Array(a),this.view=kd(this.buffer)}update(a){s0(this),Xh(a);const{view:i,buffer:o,blockLen:s}=this,u=a.length;for(let c=0;cs-c&&(this.process(o,0),c=0);for(let g=c;gb.length)throw new Error("_sha2: outputLen bigger than state");for(let g=0;g>>3,C=ya(w,17)^ya(w,19)^w>>>10;Rr[g]=C+Rr[g-7]+T+Rr[g-16]|0}let{A:o,B:s,C:u,D:c,E:d,F:m,G:p,H:b}=this;for(let g=0;g<64;g++){const x=ya(d,6)^ya(d,11)^ya(d,25),)DELIM" -R"DELIM(w=b+x+kR(d,m,p)+BR[g]+Rr[g]|0,C=(ya(o,2)^ya(o,13)^ya(o,22))+DR(o,s,u)|0;b=p,p=m,m=d,d=c+w|0,c=u,u=s,s=o,o=w+C|0}o=o+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(o,s,u,c,d,m,p,b)}roundClean(){xh(Rr)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),xh(this.buffer)}}class HR extends UR{A=Tr[0]|0;B=Tr[1]|0;C=Tr[2]|0;D=Tr[3]|0;E=Tr[4]|0;F=Tr[5]|0;G=Tr[6]|0;H=Tr[7]|0;constructor(){super(32)}}const ax=MR(()=>new HR,OR(1)),rx=AR(ax),$R=0x00000000ffff0000000000000000000000000000000000000000000000000000n;function Jh(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 o=BigInt(i)*(1n<i[1]).filter(Boolean);return a.length>0?a:[e]}function Wh(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 o=a.match(/zero \[([0-9a-f]+)\]/)?.[1]??"";return o.length===40?"p2wpkh":o.length===64?"p2wsh":"segwit"}if(a.startsWith("1 ["))return"p2tr"}function Ql(){return"mainnet"}function Yl(e){return e==="testnet"||e==="regtest"?{p2pkh:111,p2sh:196,hrp:e==="regtest"?"bcrt":"tb"}:{p2pkh:0,p2sh:5,hrp:"bc"}}function u0(e,a){const i=new Uint8Array(a.length/2+1);return i[0]=e,i.set(Jh(a),1),rx.encode(i)}function Dd(e,a,i){const o=Jh(i),s=Ku.toWords(o);return s.unshift(a),(a===0?Ku:bh).encode(e,s)}function ix(e,a){const i=e.toLowerCase(),o=i.match(/dup hash160 \[([0-9a-f]{40})\] equalverify checksig/);if(o)return{address:u0(a.p2pkh,o[1]),type:"p2pkh"};const s=i.match(/^hash160 \[([0-9a-f]{40})\] equal$/);if(s)return{address:u0(a.p2sh,s[1]),type:"p2sh"};const u=i.match(/^zero \[([0-9a-f]{40})\]/);if(u)return{address:Dd(a.hrp,0,u[1]),type:"p2wpkh"};const c=i.match(/^zero \[([0-9a-f]{64})\]/);if(c)return{address:Dd(a.hrp,0,c[1]),type:"p2wsh"};const d=i.match(/^1 \[([0-9a-f]{64})\]/);return d?{address:Dd(a.hrp,1,d[1]),type:"p2tr"}:{type:Wh(e)}}function PR(e,a){try{const s=rx.decode(e),u=s[0],c=Mu(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(Ku);if(c&&c.prefix===a.hrp){const m=c.words[0],p=Ku.fromWords(c.words.slice(1)),b=Mu(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(bh);if(d&&d.prefix===a.hrp){const m=d.words[0],p=bh.fromWords(d.words.slice(1)),b=Mu(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 Ka(e,a){const i=e.toLowerCase();if(/^[0-9a-f]{64}$/.test(i))return{hash:i,type:"script-hash"};const o=PR(e,a);if(!o)return null;const s=ax(Jh(o.scriptHex)),u=Uint8Array.from(s).reverse();return{hash:Mu(u),type:o.type}}function Ou(e,a){return{hash:e.hash,height:e.height,timestamp:e.timestamp,txCount:a,size:void 0,weight:void 0,difficulty:ZR(e.bits),previousBlockHash:e.previous}}function FR(e){const a=qR(e);return a&&a.length>0?a:void 0}function QR(e,a,i,o){const s=/^0{64}$/u.test(e.point.hash),u=a?ix(a.script,i):{address:void 0,type:void 0},c=a?a.value:void 0,d=a?a.script:void 0;return{index:o,prevTxId:s?void 0:e.point.hash,prevOutputIndex:s?void 0:e.point.index,address:u.address,valueSats:c,scriptType:u.type??Wh(d??e.script),isCoinbase:s,script:e.script?{mnemonic:e.script}:void 0,witness:FR(e.witness),sequence:e.sequence}}function YR(e,a,i){const o=ix(e.script,i);return{index:a,address:o.address,valueSats:e.value,scriptType:o.type??Wh(e.script),spent:void 0,script:e.script?{mnemonic:e.script}:void 0}}function GR(e,a){return typeof e!="number"||typeof a!="number"?0:Math.max(0,e-a+1)}function bu(e,a,i,o,s){const u=e.outputs.map((b,g)=>YR(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=GR(o.tipHeight,o.blockHeight),p=typeof o.blockHeight=="number"?"confirmed":"unconfirmed";return{txid:e.hash,hash:e.hash,status:p,confirmations:m,blockHeight:o.blockHeight,blockHash:o.blockHash,receivedTime:o.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)=>QR(b,a[g],i,g)),outputs:u}}const xu=25,Tl=8,VR="/v1/top/subscribe?format=json",KR="/v1/top/subscribe?format=json&stop=true",IR=5e3,XR=2500,Ld=5e3,JR=3e5,c0=5e3,pl=new Map,Bd=new Map;class oc extends Error{constructor(a,i){super(a),this.status=i,this.name="LibbitcoinApiError"}status}const Iu={address:!0,filter:!1,turbo:!0,witness:!0,retarget:!1,difficult:!1};function WR(e){if(!e||typeof e!="object"||Array.isArray(e))return Iu;const a=e,i=o=>typeof a[o]=="boolean"?a[o]:Iu[o];return{address:i("address"),filter:i("filter"),turbo:i("turbo"),witness:i("witness"),retarget:i("retarget"),difficult:i("difficult")}}function Sl(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 o=i,s=typeof o.count=="number"?o.count:void 0,u=typeof o.size=="number"?o.size:void 0,c=typeof o.weight=="number"?o.weight:void 0;return s===void 0&&u===void 0&&c===void 0?null:{count:s,size:u,weight:c}}function ku(e){return e?.weight??e?.size}function e3(e,a){return!Number.isFinite(e)||!Number.isFinite(a)||a<=0?null:e/a*4}function Su(e,a){if(!a)return e;const i=typeof a.fee=="number"?a.fee:void 0,o=typeof a.weight=="number"?a.weight:void 0,s=typeof i=="number"&&typeof o=="number"?e3(i,o):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 nn(e,a,i){const o=a.startsWith("/")?a:`/${a}`;let s=o.includes("?")?`${e}${o}`:`${e}${o}?format=json`;i&&(s+=s.includes("?")?"&turbo=true":"?turbo=true");const u=Bd.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 oc(`Request failed ${String(d.status)}: ${p||d.statusText}`,d.status)}const m=await d.text();try{return JSON.parse(m)}catch{return m}})();Bd.set(s,c);try{return await c}finally{Bd.delete(s)}}async function Vt(e,a,i){try{return await nn(e,a,i)}catch{return null}}async function ox(e,a,i){try{return await nn(e,a,i)}catch(o){if(o instanceof oc&&o.status===404)return null;throw o}}async function lx(e,a){const i=await nn(e,"/v1/top?format=json",a),o=typeof i=="number"?i:Number(i);if(!Number.isFinite(o))throw new Error("Invalid top height");return o}function sx(e){return/^[0-9a-f]{64}$/iu.test(e)}function t3(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0?e:typeof e=="string"&&/^\d+$/u.test(e.trim())?Number(e.trim()):null}function Sh(e){const a=t3(e);if(a!==null)return a;if(typeof e=="string"){const s=e.trim();return sx(s)?s:null}if(!e||typeof e!="object"||Array.isArray(e))return null;const i=e,o=[i.payload,i.top,i.block,i.header,i.hash,i.height];for(const s of o){if(s===e)continue;const u=Sh(s);if(u!==null)return u}return null}function n3(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)}func)DELIM" -R"DELIM(tion a3(e){const a=e.trim();if(!a)return null;try{return Sh(JSON.parse(a))}catch{return Sh(a)}}function r3(e){const a=e.trim();if(!a)return null;const o=/^[a-z][a-z\d+\-.]*:\/\//iu.test(a)?a:`http://${a}`,s=globalThis.window;try{const u=new URL(o,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 ri(e,a){const i=Date.now(),o=`${e}|0`,s=pl.get(o);if(s&&s.expiresAt>i)return s.promise;const u=lx(e,a).then(c=>(pl.set(o,{promise:u,value:c,expiresAt:Date.now()+c0}),c),c=>{throw pl.get(o)?.promise===u&&pl.delete(o),c});return pl.set(o,{promise:u,value:s?.value??null,expiresAt:i+c0}),u}async function wu(e,a,i){if(a==="latest"||a==="tip"){const o=await ri(e,i);return{path:`/v1/block/height/${String(o)}`,height:o}}return/^\d+$/u.test(a)?{path:`/v1/block/height/${a}`}:{path:`/v1/block/hash/${a}`}}function i3(e,a){const i=new Map;return(o,s)=>{const u=`${o}:${String(s)}`,c=i.get(u);if(c)return c;const d=nn(e,`/v1/output/${o}/${String(s)}?format=json`,a).catch(()=>null);return i.set(u,d),d}}async function o3(e,a,i,o){return nn(e,`${a}/tx/${String(i)}?format=json`,o)}async function f0(e,a,i,o){const s=await si(i,Tl,async c=>{try{return await o3(e,a,c)}catch(d){if(o&&d instanceof oc&&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 d0(e,a){return si(a,Tl,async i=>{const[o,s]=await Promise.all([nn(e,`/v1/block/height/${String(i)}/header?format=json`),Vt(e,`/v1/block/height/${String(i)}/header/context?format=json`)]),u=Sl(s);return{...Ou(o,u?.count),size:ku(u)}})}function ux(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function cx(e){return ux(e)?typeof e.hash=="string"&&e.hash.length>0&&typeof e.index=="number"&&Number.isInteger(e.index)&&e.index>=0:!1}function fx(e,a){if(!Array.isArray(e)||!e.every(i=>ux(i)&&cx(i.point)&&typeof i.value=="number"&&Number.isFinite(i.value)&&i.value>=0))throw new TypeError(`Invalid response from ${a}`);return e}async function l3(e,a,i){const o=`/v1/address/${a}/confirmed?format=json`,s=await ox(e,o,i);return s===null?[]:fx(s,o)}async function s3(e,a,i){const o=`/v1/address/${a}?format=json`,s=await ox(e,o,i);return s===null?[]:fx(s,o)}const h0=25,dx=8,m0=3e4;function u3(e){if(e===void 0)return 0;const a=Number(e);return Number.isInteger(a)&&a>0?a:0}async function hx(e,a,i){const o=`/v1/output/${a}/${String(i)}/spender?format=json`;let s;try{s=await nn(e,o)}catch(u){if(u instanceof oc&&u.status===404)return null;throw u}if(!cx(s))throw new TypeError(`Invalid response from ${o}`);return s}async function si(e,a,i){const o=Array.from({length:e.length});let s=0;async function u(){for(;su())),o}async function c3(e,a,i){const o=await si(a,dx,u=>hx(e,u.point.hash,u.point.index)),s=[];for(const[u,c]of a.entries()){const{hash:d,index:m}=c.point,p=o[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 p0(e,a){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const o=Number(e);if(Number.isFinite(o))return o}let i=0;for(const o of a)i+=o.value;return i}function Ud({baseUrl:e,pollIntervalMs:a=15e3,turbo:i=!1}){const o=new Set,s=new Set;let u=null,c=null,d=null,m=null,p=null,b=Ld,g=!1,x=!1,w="idle",T=null,C=null;const R=Yl(Ql());let q=null,G=null;const X=r3(e),le=!!(X&&globalThis.WebSocket),ne=new Map,ge=new Map;async function z(H,ce){const he=Date.now(),xe=ne.get(H);if(xe&&xe.expiresAt>he)return xe.outputs;const me=await s3(e,H,ce);return ne.set(H,{outputs:me,expiresAt:he+m0}),me}async function E(H,ce){const he=Date.now(),xe=ge.get(H);if(xe&&xe.expiresAt>he)return xe.request;const me=l3(e,H,ce);ge.set(H,{request:me,expiresAt:he+m0});try{return await me}catch(Ne){throw ge.get(H)?.request===me&&ge.delete(H),Ne}}async function k(H,ce,he){const xe=await z(H,ce),me=u3(he),Ne=xe.slice(me,me+h0),Je=me+h0,ke=Je{const ce=WR(H);return q=ce,ce}).catch(H=>(console.warn("Libbitcoin configuration fetch failed",H),q=Iu,Iu)),G)}function Q(H){return H.address}function F(H){return Q(H)&&H.turbo}function re(){return{transport:w,websocketAvailable:le&&!g}}function fe(H){if(w===H)return;w=H;const ce=re();for(const he of s)he(ce)}async function be(H){const ce=typeof H=="number"?`/v1/block/height/${String(H)}`:`/v1/block/hash/${H}`,[he,xe]=await Promise.all([nn(e,`${ce}/header?format=json`),Vt(e,`${ce}/header/context?format=json`)]);if(C===he.hash||T!==null&&he.heightT&&await be(H)}catch(H){console.warn("Libbitcoin poller failed",H)}}function O(){o.size!==0&&(u||(u=setInterval(()=>{L()},a)),fe("polling"))}function ie(){u&&(clearInterval(u),u=null)}function de(){d&&(clearTimeout(d),d=null)}function we(){m&&(clearTimeout(m),m=null)}function j(){p&&(clearTimeout(p),p=null)}function K(){if(p||!le||o.size===0)return;const H=b;b=Math.min(b*2,JR),p=setTimeout(()=>{p=null,!(c||o.size===0)&&(g=!1,W())},H)}function I(){g=!0,se(!1),O(),K()}function se(H){if(de(),!!c){x=!0;try{H&&c.readyState===1&&c.send(KR),c.close()}catch{}finally{c=null}}}function W(){if(we(),c)return!0;if(!le||!X||g||o.size===0)return!1;try{x=!1,c=new WebSocket(X),fe("connecting")}catch(ce){return console.warn("Libbitcoin websocket unavailable, falling back to polling",ce),I(),!1}const H=c;return d=setTimeout(()=>{c===H&&(console.warn("Libbitcoin websocket connect timed out, falling back to polling"),I())},IR),H.addEventListener("open",()=>{if(c===H){de();try{H.send(VR),ie(),g=!1,b=Ld,fe("websocket")}catch(ce){console.warn("Libbitcoin websocket subscribe failed, falling back to polling",ce),I()}}}),H.addEventListener("message",ce=>{(async()=>{try{const he=await n3(ce.data);if(he===null)return;const xe=a3(he);if(xe===null)return;await be(xe)}catch(he){console.warn("Libbitcoin websocket event handling failed",he)}})()}),H.addEventListener("error",ce=>{x||c!==H||(console.warn("Libbitcoin websocket failed, falling back to polling",ce),I())}),H.addEventListener("close",()=>{if(!(c!==null&&c!==H)){if(de(),c===H&&(c=null),x){x=!1;return}o.size!==0&&I()}}),!0}function pe(){W()||(O(),K())}function Ce(){we(),j(),b=Ld,g=!1,ie(),se(!0),fe("idle")}function Et(){o.size>0||m||(m=setTimeout(()=>{m=null,o.size===0&&Ce()},XR))}return{metadata:{id:"libbitcoin",label:"Server",type:"local",connectionState:"connected",supportsWebsocket:le,endpoint:e,description:"Adapter for the libbitcoin embedded REST API."},getConfiguration(){return B()},async getLatestBlocks(H=10){const ce=await ri(e);T=ce;const he=Array.from({length:H},(me,Ne)=>ce-Ne).filter(me=>me>=0),xe=await d0(e,he);return xe.length>0&&(C=xe[0].hash),xe},async getBlocksBefore(H,ce=10){const he=Array.from({length:ce},(xe,me)=>H-me).filter(xe=>xe>=0);return d0(e,he)},async getBlockHeader(H){const{path:ce,height:he}=await wu(e,H),xe=he===void 0?ri(e):Promise.resolve(he),[me,Ne,Je]=await Promise.all([nn(e,`${ce}/header?format=json`),xe,Vt(e,`${ce}/header/context?format=json`)]);T=Math.max(T??0,Ne);let ke=null;me.height_a),Ja=await f0(e,ce,En,typeof Ie!="number"),Pt=await si(Ja,Tl,dn=>Vt(e,`/v1/tx/${dn.hash}/details?format=json`)),ea=Ja.map((dn,_a)=>{const Un=Pt[_a],_n=bu(dn,[],R,{blockHeight:me.height,blockHash:me.hash,tipHeight:Ne,timestamp:me.timestamp},typeof Un?.fee=="number"?Un.fee:void 0);return Su(_n,Un)});return{...yt,size:ke?.maximal??ku(Qe),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:ea}},async getBlockTransactions(H,ce=0){const{path:he}=await wu(e,H),[xe,me,Ne]=await Promise.all([nn(e,`${he}/header?format=json`),ri(e),Vt(e,`${he}/header/context?format=json`)]);T=Math.max(T??0,me);const Je=Sl(Ne)?.count;if(typeof Je=="number"&&ce>=Je)return[];const ke=typeof Je=="number"?Math.min(ce+xu,Je):ce+xu,qe=Array.from({length:Math.max(0,ke-ce)},(yt,Jt)=>ce+Jt),Qe=await f0(e,he,qe,typeof Je!="number");if(Qe.length===0)return[];const Ie=await si(Qe,Tl,yt=>Vt(e,`/v1/tx/${yt.hash}/details?format=json`));return Qe.map((yt,Jt)=>{const En=Ie[Jt],Ja=bu(yt,[],R,{blockHeight:xe.height,blockHash:xe.hash,tipHeight:me,timestamp:xe.timestamp},typeof En?.fee=="number"?En.fee:void 0);return Su(Ja,En)})},async getTransaction(H){const ce=await nn(e,`/v1/tx/${H}?format=json`),he=i3(e),xe=si(ce.inputs,Tl,Qe=>/^0{64}$/u.test(Qe.point.hash)?Promise.resolve(null):he(Qe.point.hash,Qe.point.index)),[me,Ne,Je,ke]=await Promise.all([Vt(e,`/v1/tx/${H}/header?format=json`),ri(e).catch(()=>null),Vt(e,`/v1/tx/${H}/details?format=json`),xe]);typeof Ne=="number"&&(T=Math.max(T??0,Ne));const qe=bu(ce,ke,R,{blockHeight:me?.height,blockHash:me?.hash,tipHeight:typeof Ne=="number"?Ne:void 0,timestamp:me?.timestamp},typeof Je?.fee=="number"?Je.fee:void 0);return Su(qe,Je)},async getTransactionHeader(H){const ce=await nn(e,`/v1/tx/${H}?format=json`),[he,xe,me]=await Promise.all([Vt(e,`/v1/tx/${H}/header?format=json`),ri(e).catch(()=>null),Vt(e,`/v1/tx/${H}/details?format=json`)]);typeof xe=="number"&&(T=Math.max(T??0,xe));const Ne=bu(ce,[],R,{blockHeight:he?.height,blockHash:he?.hash,tipHeight:typeof xe=="number"?xe:void 0,timestamp:he?.timestamp},typeof me?.fee=="number"?me.fee:void 0);return Su(Ne,me)},async getTransactionInputScriptHex(H,ce){return(await nn(e,`/v1/input/${H}/${String(ce)}/script?format=text`)).trim()},async getTransactionOutputScriptHex(H,ce){return(await nn(e,`/v1/output/${H}/${String(ce)}/script?format=text`)).trim()},getTransactionOutputSpends(H,ce){return si(ce,dx,async he=>{try{const xe=await hx(e,H,he);return xe===null?{outputIndex:he,status:"unspent"}:!sx(xe.hash)||xe.index>4294967295?{outputIndex:he,status:"unknown"}:{outputIndex:he,status:"spent",txid:xe.hash.toLowerCase(),inputIndex:xe.index}}catch{return{outputIndex:he,status:"unknown"}}})},async getAddress(H){const ce=Ka(H,R);if(!ce)throw new Error("Unsupported address format for libbitcoin adapter");const he=q??await B();if(!Q(he))throw new Error("Address endpoints are disabled by server configuration");const xe=i&&F(he),[me,Ne]=await Promise.all([Vt(e,`/v1/address/${ce.hash}/balance?format=json`,xe),E(ce.hash,xe)]),Je=p0(me,Ne),ke=await k(ce.hash,xe);return{address:H,addressType:ce.type,balance:Je,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:Ne.length,transactions:ke}},async getAddressSummary(H){const ce=Ka(H,R);if(!ce)throw new Error("Unsupported address format for libbitcoin adapter");const he=q??await B();if(!Q(he))throw new Error("Address endpoints are disabled by server configuration");const xe=i&&F(he),[me,Ne]=await Promise.all([Vt(e,`/v1/address/${ce.hash}/balance?format=json`,xe),E(ce.hash,xe)]),Je=p0(me,Ne);return{address:H,addressType:ce.type,balance:Je,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:Ne.length}},async getAddressUtxos(H){const ce=Ka(H,R);if(!ce)throw new Error("Unsupported address format for libbitcoin adapter");const he=q??await B();if(!Q(he))throw new Error("Address endpoints are disabled by server configuration");const xe=i&&F(he);return(await E(ce.hash,xe)).map(Ne=>({txid:Ne.point.hash,outputIndex:Ne.point.index,valueSats:Ne.value,status:"confirmed"}))},async getAddressTransactions(H,ce){const he=Ka(H,R);if(!he)return[];const xe=q??await B();if(!Q(xe))return[];const me=i&&F(xe);return k(he.hash,me,ce)},subscribeToEvents(H){return we(),o.add(H),pe(),()=>{o.delete(H),Et()}},getEventStatus:re,subscribeToEventStatus(H){return s.add(H),H(re()),()=>{s.delete(H)}}}}const mx=_.createContext(null),px=_.createContext(null),yx=_.createContext(null);function f3({children:e,client:a}){return y.jsx(mx.Provider,{value:a,children:e})}function d3({children:e,provider:a,setProvider:i,availableProviders:o,selectorVisible:s,setSelectorVisible:u}){return y.jsx(px.Provider,{value:{provider:a,setProvider:i,availableProviders:o,selectorVisible:s,setSelectorVisible:u},children:e})}function h3({children:e,turbo:a,setTurbo:i}){return y.jsx(yx.Provider,{value:{turbo:a,setTurbo:i},children:e})}function Xa(){const e=_.useContext(mx);if(!e)throw new Error("BlockchainClientProvider missing in component tree");return e}function Gl(){return Xa().metadata}function gx(){const e=_.useContext(px);if(!e)throw new Error("ProviderSwitcherProvider missing in component tree");return e}function vx(){const e=_.useContext(yx);if(!e)throw new Error("TurboProvider missing in component tree");return e}function Hd(){const e=globalThis.window;return e?.location.origin?e.location.origin:"http://localhost:8080"}function m3(e,a){if(e==="blockstream")return Ib({baseUrl:"https://blockstream.info/api"});if(e==="mempool")return SR({baseUrl:"https://mempool.space/api"});if(e==="libbitcoin"){const o=Hd();return Ud({baseUrl:o,turbo:a?.turboEnabled})}if(e==="external"){console.warn("No external API URL provided, falling back to libbitcoin provider");const o=Hd();return Ud({baseUrl:o,turbo:a?.turboEnabled})}console.warn(`Unknown provider "${e}", falling back to libbitcoin provider`);const i=Hd();return Ud({baseUrl:i,turbo:a?.turboEnabled})}function p3(){return[...new Set(["libbitcoin","blockstream","mempool"])]}const $d=10,y3=20;function bx(e){return e.metadata.endpoint?{providerId:e.metadata.id,endpoint:e.metadata.endpoint}:{providerId:e.metadata.id}}function xx(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 y0(e){return JSON.stringify([e.providerId,e.endpoint??null])}function g3(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 v3(e,a,i){const o=e.getQueryCache().findAll({predicate:s=>{const u=s.queryKey;return u.length>=4&&xx(u[0],a)&&u[1]==="blocks"&&u[2]==="latest"}});for(const s of o){const u=g3(s.queryKey[3],$d);e.setQueryData(s.queryKey,c=>[i,...(c??[]).filter(p=>p.hash!==i.hash)].slice(0,u))}e.setQueryData([a,"blocks","latest",{limit:$d}],s=>[i,...(s??[]).filter(d=>d.hash!==i.hash)].slice(0,$d))}function b3(e,a,i){e.setQueryData([a,"transactions","recent"],o=>[i,...(o??[]).filter(c=>c.txid!==i.txid)].slice(0,y3))}function x3(e,a))DELIM" -R"DELIM({if(!xx(e.queryKey[0],a))return!1;const i=e.meta;if(i?.blockRefresh==="always")return!0;if(i?.blockRefresh!=="while-unconfirmed")return!1;const o=e.state.data;return!o||typeof o!="object"||Array.isArray(o)?!0:o.status!=="confirmed"}function S3(e,a){return e.invalidateQueries({predicate:i=>x3(i,a),refetchType:"active"})}function w3(e,a,i){i.type==="block.new"&&v3(e,a,i.payload),i.type==="tx.new"&&b3(e,a,i.payload)}function wn({queryKey:e,queryFn:a,enabled:i,retry:o,staleTime:s,initialData:u,blockRefresh:c}){const d=Xa();return AE({queryKey:[bx(d),...e],queryFn:()=>a(d),enabled:i,...o===void 0?{}:{retry:o},staleTime:s,initialData:u,meta:c?{blockRefresh:c}:void 0})}function Sx(e=10){return wn({queryKey:["blocks","latest",{limit:e}],queryFn:a=>a.getLatestBlocks(e)})}function wx(){return wn({queryKey:["configuration"],queryFn:e=>e.getConfiguration(),staleTime:6e4})}function em(e,a){return wn({queryKey:["block",e,"header"],queryFn:i=>i.getBlockHeader(e),enabled:(a?.enabled??!0)&&!!e.trim(),retry:a?.retry})}function Ex(e,a){return wn({queryKey:["block",e,"stats"],queryFn:i=>i.getBlockStats(e),enabled:(a?.enabled??!0)&&!!e.trim(),staleTime:1/0})}function E3(e,a=0){return wn({queryKey:["block",e,"transactions",{startIndex:a}],queryFn:i=>i.getBlockTransactions(e,a)})}function _x(e,a){return wn({queryKey:["transaction",e,"header"],queryFn:i=>i.getTransactionHeader(e),enabled:(a?.enabled??!0)&&!!e.trim(),retry:a?.retry,blockRefresh:"while-unconfirmed"})}function _3(e,a){return wn({queryKey:["transaction",e],queryFn:i=>i.getTransaction(e),enabled:a?.enabled??!!e.trim(),blockRefresh:"while-unconfirmed"})}function T3(e,a,i){return wn({queryKey:["transaction",e,"input",a,"scriptHex"],queryFn:o=>o.getTransactionInputScriptHex(e,a),enabled:(i?.enabled??!0)&&!!e.trim()})}function R3(e,a,i){return wn({queryKey:["transaction",e,"output",a,"scriptHex"],queryFn:o=>o.getTransactionOutputScriptHex(e,a),enabled:(i?.enabled??!0)&&!!e.trim()})}function A3(e){return wn({queryKey:["address",e,"summary"],queryFn:a=>a.getAddressSummary(e),enabled:!!e.trim(),blockRefresh:"always"})}function N3(e,a){return wn({queryKey:["transaction",e,"outputSpends",a],queryFn:i=>i.getTransactionOutputSpends(e,a),enabled:!!e.trim()&&a.length>0,blockRefresh:"always"})}function j3(e){return wn({queryKey:["address",e,"utxos"],queryFn:a=>a.getAddressUtxos(e),enabled:!!e.trim(),blockRefresh:"always"})}function z3(e,a){return wn({queryKey:["address",e,"transactions",{lastSeenTxid:null}],queryFn:i=>i.getAddressTransactions(e,a),enabled:!!e.trim(),blockRefresh:"always"})}function C3(e){const a=Xa(),i=_.useRef(e);_.useEffect(()=>{i.current=e},[e]),_.useEffect(()=>{const o=a.subscribeToEvents(s=>{i.current(s)});return()=>{o()}},[a])}function M3(){const e=Xa(),a=_.useMemo(()=>({transport:e.metadata.supportsWebsocket?"websocket":"polling",websocketAvailable:e.metadata.supportsWebsocket}),[e.metadata.supportsWebsocket]),[i,o]=_.useState(()=>e.getEventStatus?e.getEventStatus():a);return _.useEffect(()=>{const s=e.getEventStatus?e.getEventStatus():a;return o(s),e.subscribeToEventStatus?.(o)},[e,a]),i}function O3(){const e=Xa(),a=_.useMemo(()=>bx(e),[e]),i=tc(),o=_.useRef(new Map),s=_.useRef(new Map),u=_.useCallback(d=>{const m=y0(d);let p=s.current.get(m);if(p||(p={dirty:!1,running:null},s.current.set(m,p)),p.dirty=!0,p.running)return;const b=async()=>{for(;p.dirty;)p.dirty=!1,await S3(i,d)};p.running=b().finally(()=>{p.running=null,p.dirty||s.current.delete(m)})},[i]),c=_.useCallback(d=>{if(w3(i,a,d),d.type!=="block.new")return;const m=y0(a);o.current.get(m)!==d.payload.hash&&(o.current.set(m,d.payload.hash),u(a))},[i,a,u]);return C3(c),null}function k3(e=10){const{data:a,isLoading:i,isError:o,error:s}=Sx(e),{data:u=[]}=wn({queryKey:["transactions","recent"],queryFn:()=>Promise.resolve([]),enabled:!1,initialData:[]});return{data:a,recentTransactions:u,isLoading:i,isError:o,error:s}}function Zd(e){return globalThis.window?.localStorage.getItem(e)??null}function qd(e,a){globalThis.window?.localStorage.setItem(e,a)}function D3({children:e}){const a="libbitcoin",i=p3(),[o,s]=_.useState(()=>Zd("turboEnabled")==="true"),[u,c]=_.useState(()=>{const g=Zd("blockchainProvider");return g&&i.includes(g)?g:a}),[d,m]=_.useState(()=>Zd("providerSelectorVisible")==="true"),[p]=_.useState(()=>new mE({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}})),b=_.useMemo(()=>m3(u,{turboEnabled:o}),[u,o]);return _.useEffect(()=>{qd("turboEnabled",o?"true":"false")},[o]),_.useEffect(()=>{qd("blockchainProvider",u)},[u]),_.useEffect(()=>{qd("providerSelectorVisible",d?"true":"false")},[d]),y.jsx(d3,{provider:u,setProvider:c,availableProviders:i,selectorVisible:d,setSelectorVisible:m,children:y.jsx(h3,{turbo:o,setTurbo:s,children:y.jsx(f3,{client:b,children:y.jsxs(pE,{client:p,children:[y.jsx(O3,{}),e,null]})})})})}var Tx=e=>{throw TypeError(e)},Rx=(e,a,i)=>a.has(e)||Tx("Cannot "+i),Kn=(e,a,i)=>(Rx(e,a,"read from private field"),i?i.call(e):a.get(e)),wl=(e,a,i)=>a.has(e)?Tx("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(e):a.set(e,i),ga=(e,a,i,o)=>(Rx(e,a,"write to private field"),a.set(e,i),i),lc=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,tm=/^[\\/]{2}/;function Ax(e,a){return a+e.replace(/\\/g,"/")}var Nx=(e=>(e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE",e))(Nx||{}),g0="popstate";function v0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function L3(e={}){function a(o,s){let u=s.state?.masked,{pathname:c,search:d,hash:m}=u||o.location;return Bl("",{pathname:c,search:d,hash:m},s.state&&s.state.usr||null,s.state&&s.state.key||"default",u?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function i(o,s){return typeof s=="string"?s:xa(s)}return U3(a,i,null,e)}function Be(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function St(e,a){if(!e){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function B3(){return Math.random().toString(36).substring(2,10)}function b0(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 Bl(e,a,i=null,o,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof a=="string"?wa(a):a,state:i,key:a&&a.key||o||B3(),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 wa(e){let a={};if(e){let i=e.indexOf("#");i>=0&&(a.hash=e.substring(i),e=e.substring(0,i));let o=e.indexOf("?");o>=0&&(a.search=e.substring(o),e=e.substring(0,o)),e&&(a.pathname=e)}return a}function U3(e,a,i,o={}){let{window:s=document.defaultView,v5Compat:u=!1}=o,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 R=b(),q=R==null?null:R-p;p=R,m&&m({action:d,location:C.location,delta:q})}function x(R,q){d="PUSH";let G=v0(R)?R:Bl(C.location,R,q);p=b()+1;let X=b0(G,p),le=C.createHref(G.mask||G);try{c.pushState(X,"",le)}catch(ne){if(ne instanceof DOMException&&ne.name==="DataCloneError")throw ne;s.location.assign(le)}u&&m&&m({action:d,location:C.location,delta:1})}function w(R,q){d="REPLACE";let G=v0(R)?R:Bl(C.location,R,q);p=b();let X=b0(G,p),le=C.createHref(G.mask||G);c.replaceState(X,"",le),u&&m&&m({action:d,location:C.location,delta:0})}function T(R){return jx(s,R)}let C={get action(){return d},get location(){return e(s,c)},listen(R){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(g0,g),m=R,()=>{s.removeEventListener(g0,g),m=null}},createHref(R){return a(s,R)},createURL:T,encodeLocation(R){let q=T(R);return{pathname:q.pathname,search:q.search,hash:q.hash}},push:x,replace:w,go(R){return c.go(R)}};return C}function jx(e,a,i=!1){let o="http://localhost";e&&(o=e.location.origin!=="null"?e.location.origin:e.location.href),Be(o,"No window.location.(o)DELIM" -R"DELIM(rigin|href) available to create URL");let s=typeof a=="string"?a:xa(a);return s=s.replace(/ $/,"%20"),!i&&tm.test(s)&&(s=o+s),new URL(s,o)}var El,x0=class{constructor(e){if(wl(this,El,new Map),e)for(let[a,i]of e)this.set(a,i)}get(e){if(Kn(this,El).has(e))return Kn(this,El).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,a){Kn(this,El).set(e,a)}};El=new WeakMap;var H3=new Set(["lazy","caseSensitive","path","id","index","children"]);function $3(e){return H3.has(e)}var Z3=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function q3(e){return Z3.has(e)}function P3(e){return e.index===!0}function Ul(e,a,i=[],o={},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||!o[m],`Found a route id collision on id "${m}". Route id's must be globally unique within Data Router usages`),P3(u)){let p={...u,id:m};return o[m]=S0(p,a(p)),p}else{let p={...u,id:m,children:void 0};return o[m]=S0(p,a(p)),u.children&&(p.children=Ul(u.children,a,d,o,s)),p}})}function S0(e,a){return Object.assign(e,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...e.lazy,...a.lazy}}:{}})}function zx(e,a,i="/"){return ua(e,a,i,!1)}function ua(e,a,i,o,s){let u=typeof a=="string"?wa(a):a,c=Bn(u.pathname||"/",i);if(c==null)return null;let d=s??Du(e),m=null,p=eA(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(o)&&m)return;Be(b.relativePath.startsWith(o),`Absolute route path "${b.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(o.length)}let g=Xn([o,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 "${g}".`),Mx(c.children,a,x,g,m)),!(c.path==null&&!c.index)&&a.push({path:g,score:X3(g,c.index),routesMeta:x.map((w,T)=>{let[C,R]=Dx(w.relativePath,w.caseSensitive,T===x.length-1);return{...w,matcher:C,compiledParams:R}})})};return e.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))u(c,d);else for(let m of Ox(c.path))u(c,d,!0,m)}),a}function Ox(e){let a=e.split("/");if(a.length===0)return[];let[i,...o]=a,s=i.endsWith("?"),u=i.replace(/\?$/,"");if(o.length===0)return s?[u,""]:[u];let c=Ox(o.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 F3(e){e.sort((a,i)=>a.score!==i.score?i.score-a.score:J3(a.routesMeta.map(o=>o.childrenIndex),i.routesMeta.map(o=>o.childrenIndex)))}var Q3=/^:[\w-]+$/,Y3=3,G3=2,V3=1,K3=10,I3=-2,w0=e=>e==="*";function X3(e,a){let i=e.split("/"),o=i.length;return i.some(w0)&&(o+=I3),a&&(o+=G3),i.filter(s=>!w0(s)).reduce((s,u)=>s+(Q3.test(u)?Y3:u===""?V3:K3),o)}function J3(e,a){return e.length===a.length&&e.slice(0,-1).every((o,s)=>o===a[s])?e[e.length-1]-a[a.length-1]:0}function W3(e,a,i=!1){let{routesMeta:o}=e,s={},u="/",c=[];for(let d=0;d{if(b==="*"){let T=d[x]||"";c=u.slice(0,u.length-T.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 Dx(e,a=!1,i=!0){St(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 o=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,m,p,b)=>{if(o.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("*")?(o.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,a?void 0:"i"),o]}function eA(e){try{return e.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return St(!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 Bn(e,a){if(a==="/")return e;if(!e.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,o=e.charAt(i);return o&&o!=="/"?null:e.slice(i)||"/"}function tA({basename:e,pathname:a}){return a==="/"?e:Xn([e,a])}var nm=e=>lc.test(e);function nA(e,a="/"){let{pathname:i,search:o="",hash:s=""}=typeof e=="string"?wa(e):e,u;return i?(i=am(i),i.startsWith("/")?u=E0(i.substring(1),"/"):u=E0(i,a)):u=a,{pathname:u,search:rA(o),hash:iA(s)}}function E0(e,a){let i=Ju(a).split("/");return e.split("/").forEach(s=>{s===".."?i.length>1&&i.pop():s!=="."&&i.push(s)}),i.length>1?i.join("/"):"/"}function Pd(e,a,i,o){return`Cannot include a '${e}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. 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 Lx(e){return e.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function sc(e){let a=Lx(e);return a.map((i,o)=>o===a.length-1?i.pathname:i.pathnameBase)}function Vl(e,a,i,o=!1){let s;typeof e=="string"?s=wa(e):(s={...e},Be(!s.pathname||!s.pathname.includes("?"),Pd("?","pathname","search",s)),Be(!s.pathname||!s.pathname.includes("#"),Pd("#","pathname","hash",s)),Be(!s.search||!s.search.includes("#"),Pd("#","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(!o&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),g-=1;s.pathname=x.join("/")}d=g>=0?a[g]:"/"}let m=nA(s,d),p=c&&c!=="/"&&c.endsWith("/"),b=(u||c===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(p||b)&&(m.pathname+="/"),m}var am=e=>e.replace(/[\\/]{2,}/g,"/"),Xn=e=>am(e.join("/")),Ju=e=>e.replace(/\/+$/,""),aA=e=>Ju(e).replace(/^\/*/,"/"),rA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,iA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,oA=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Kl=class{constructor(e,a,i,o=!1){this.status=e,this.statusText=a||"",this.internal=o,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Hl(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Il(e){let a=e.map(i=>i.route.path).filter(Boolean);return Xn(a)||"/"}var B)DELIM" -R"DELIM(x=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ux(e,a){let i=e;if(typeof i!="string"||!lc.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let o=i,s=!1;if(Bx)try{let u=new URL(window.location.href),c=tm.test(i)?new URL(Ax(i,u.protocol)):new URL(i),d=Bn(c.pathname,a);c.origin===u.origin&&d!=null?i=d+c.search+c.hash:s=!0}catch{St(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:s,to:i}}var Or=Symbol("Uninstrumented");function lA(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 o={};if(typeof a.lazy=="function"&&i.lazy.length>0){let s=so(i.lazy,a.lazy,()=>{});s&&(o.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=so(d,c,()=>{});m&&(o.lazy=Object.assign(o.lazy||{},{[u]:m}))}})}return["loader","action"].forEach(s=>{let u=a[s];if(typeof u=="function"&&i[s].length>0){let c=u[Or]??u,d=so(i[s],c,(...m)=>_0(m[0]));d&&(s==="loader"&&c.hydrate===!0&&(d.hydrate=!0),d[Or]=c,o[s]=d)}}),a.middleware&&a.middleware.length>0&&i.middleware.length>0&&(o.middleware=a.middleware.map(s=>{let u=s[Or]??s,c=so(i.middleware,u,(...d)=>_0(d[0]));return c?(c[Or]=u,c):s})),o}function sA(e,a){let i={navigate:[],fetch:[]};if(a.forEach(o=>o({instrument(s){let u=Object.keys(s);for(let c of u)s[c]&&i[c].push(s[c])}})),i.navigate.length>0){let o=e.navigate[Or]??e.navigate,s=so(i.navigate,o,(...u)=>{let[c,d]=u;return{to:typeof c=="number"||typeof c=="string"?c:c?xa(c):".",...T0(e,d??{})}});s&&(s[Or]=o,e.navigate=s)}if(i.fetch.length>0){let o=e.fetch[Or]??e.fetch,s=so(i.fetch,o,(...u)=>{let[c,,d,m]=u;return{href:d??".",fetcherKey:c,...T0(e,m??{})}});s&&(s[Or]=o,e.fetch=s)}return e}function so(e,a,i){return e.length===0?null:async(...o)=>{let s=await Hx(e,i(...o),()=>a(...o),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function Hx(e,a,i,o){let s=e[o],u;if(s){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=Hx(e,a,i,o-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 _0(e){let{request:a,context:i,params:o,pattern:s}=e;return{request:uA(a),params:{...o},pattern:s,context:cA(i)}}function T0(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 uA(e){return{method:e.method,url:e.url,headers:{get:(...a)=>e.headers.get(...a)}}}function cA(e){if(dA(e)){let a={...e};return Object.freeze(a),a}else return{get:a=>e.get(a)}}var fA=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function dA(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")===fA}var $x=["POST","PUT","PATCH","DELETE"],hA=new Set($x),mA=["GET",...$x],pA=new Set(mA),Zx=new Set([301,302,303,307,308]),yA=new Set([307,308]),Fd={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},gA={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},yl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},vA=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),qx="remix-router-transitions",Px=Symbol("ResetLoaderData"),ii,ro,zr,io,bA=class{constructor(e){wl(this,ii),wl(this,ro),wl(this,zr),wl(this,io),ga(this,ii,e),ga(this,ro,Du(e))}get stableRoutes(){return Kn(this,ii)}get activeRoutes(){return Kn(this,zr)??Kn(this,ii)}get branches(){return Kn(this,io)??Kn(this,ro)}get hasHMRRoutes(){return Kn(this,zr)!=null}setRoutes(e){ga(this,ii,e),ga(this,ro,Du(e))}setHmrRoutes(e){ga(this,zr,e),ga(this,io,Du(e))}commitHmrRoutes(){Kn(this,zr)&&(ga(this,ii,Kn(this,zr)),ga(this,ro,Kn(this,io)),ga(this,zr,void 0),ga(this,io,void 0))}};ii=new WeakMap;ro=new WeakMap;zr=new WeakMap;io=new WeakMap;function xA(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 o=e.hydrationRouteProperties||[],s=e.mapRouteProperties||vA,u=s;if(e.instrumentations){let N=e.instrumentations;u=D=>({...s(D),...lA(N.map(P=>P.route).filter(Boolean),D)})}let c={},d=new bA(Ul(e.routes,u,void 0,c)),m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let p=e.dataStrategy||TA,b={...e.future},g=null,x=new Set,w=null,T=null,C=null,R=null,q=e.hydrationData!=null,G=ua(d.activeRoutes,e.history.location,m,!1,d.branches),X=!1,le=null,ne,ge;if(G==null&&!e.patchRoutesOnNavigation){let N=In(404,{pathname:e.history.location.pathname}),{matches:D,route:P}=Eu(d.activeRoutes);ne=!0,ge=!ne,G=D,le={[P.id]:N}}else if(G&&!e.hydrationData&&er(G,d.activeRoutes,e.history.location.pathname).active&&(G=null),G)if(G.some(N=>N.route.lazy))ne=!1,ge=!ne;else if(!G.some(N=>rm(N.route)))ne=!0,ge=!ne;else{let N=e.hydrationData?e.hydrationData.loaderData:null,D=e.hydrationData?e.hydrationData.errors:null,P=G;if(D){let oe=G.findIndex(ue=>D[ue.route.id]!==void 0);P=P.slice(0,oe+1)}ge=!1,ne=!0,P.forEach(oe=>{let ue=Fx(oe.route,N,D);ge=ge||ue.renderFallback,ne=ne&&!ue.shouldLoad})}else{ne=!1,ge=!ne,G=[];let N=er(null,d.activeRoutes,e.history.location.pathname);N.active&&N.matches&&(X=!0,G=N.matches)}let z,E={historyAction:e.history.action,location:e.history.location,matches:G,initialized:ne,renderFallback:ge,navigation:Fd,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||le,fetchers:new Map,blockers:new Map},k="POP",B=null,Q=!1,F,re=!1,fe=new Map,be=null,L=!1,O=!1,ie=new Set,de=new Map,we=0,j=-1,K=new Map,I=new Set,se=new Map,W=new Map,pe=new Set,Ce=new Map,Et,H=null;function ce(){if(g=e.history.listen(({action:N,location:D,delta:P})=>{if(Et){Et(),Et=void 0;return}St(Ce.size===0||P!=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 oe=Zr({currentLocation:E.location,nextLocation:D,historyAction:N});if(oe&&P!=null){let ue=new Promise(Ee=>{Et=Ee});e.history.go(P*-1),Ra(oe,{state:"blocked",location:D,proceed(){Ra(oe,{state:"proceeding",proceed:void 0,reset:void 0,location:D}),ue.then(()=>e.history.go(P))},reset(){let Ee=new Map(E.blockers);Ee.set(oe,yl),me({blockers:Ee})}}),B?.resolve(),B=null;return}return qe(N,D)}),i){FA(a,fe);let N=()=>QA(a,fe);a.addEventListener("pagehide",N),be=()=>a.removeEventListener("pagehide",N)}return E.initialized||qe("POP",E.location,{initialHydration:!0}),z}function he(){g&&g(),be&&be(),x.clear(),F&&F.abort(),E.fetchers.forEach((N,D)=>Ta(E.fetchers,D)),E.blockers.forEach((N,D)=>$r(D))}function xe(N){if(x.add(N),w){let{)DELIM" -R"DELIM(newErrors:D}=w;w=null,N(E,{deletedFetchers:[],newErrors:D,viewTransitionOpts:void 0,flushSync:!1})}return()=>x.delete(N)}function me(N,D={}){N.matches&&(N.matches=N.matches.map(ue=>{let Ee=c[ue.route.id],ye=ue.route;return ye.element!==Ee.element||ye.errorElement!==Ee.errorElement||ye.hydrateFallbackElement!==Ee.hydrateFallbackElement?{...ue,route:Ee}:ue})),E={...E,...N};let P=[],oe=[];E.fetchers.forEach((ue,Ee)=>{ue.state==="idle"&&(pe.has(Ee)?P.push(Ee):oe.push(Ee))}),pe.forEach(ue=>{!E.fetchers.has(ue)&&!de.has(ue)&&P.push(ue)}),x.size===0&&(w={newErrors:N.errors??null}),[...x].forEach(ue=>ue(E,{deletedFetchers:P,newErrors:N.errors??null,viewTransitionOpts:D.viewTransitionOpts,flushSync:D.flushSync===!0})),P.forEach(ue=>Ta(E.fetchers,ue)),oe.forEach(ue=>E.fetchers.delete(ue))}function Ne(N,D,{flushSync:P}={}){let oe=E.actionData!=null&&E.navigation.formMethod!=null&&an(E.navigation.formMethod)&&E.navigation.state==="loading"&&N.state?._isRedirect!==!0,ue;D.actionData?Object.keys(D.actionData).length>0?ue=D.actionData:ue=null:oe?ue=E.actionData:ue=null;let Ee=D.loaderData?D0(E.loaderData,D.loaderData,D.matches||[],D.errors):E.loaderData,ye=E.blockers;ye.size>0&&(ye=new Map(ye),ye.forEach((ze,Ue)=>ye.set(Ue,yl)));let Se=L?!1:wo(N,D.matches||E.matches),ve=Q===!0||E.navigation.formMethod!=null&&an(E.navigation.formMethod)&&N.state?._isRedirect!==!0;d.commitHmrRoutes(),L||k==="POP"||(k==="PUSH"?e.history.push(N,N.state):k==="REPLACE"&&e.history.replace(N,N.state));let je;if(k==="POP"){let ze=fe.get(E.location.pathname);ze&&ze.has(N.pathname)?je={currentLocation:E.location,nextLocation:N}:fe.has(N.pathname)&&(je={currentLocation:N,nextLocation:E.location})}else if(re){let ze=fe.get(E.location.pathname);ze?ze.add(N.pathname):(ze=new Set([N.pathname]),fe.set(E.location.pathname,ze)),je={currentLocation:E.location,nextLocation:N}}me({...D,actionData:ue,loaderData:Ee,historyAction:k,location:N,initialized:!0,renderFallback:!1,navigation:Fd,revalidation:"idle",restoreScrollPosition:Se,preventScrollReset:ve,blockers:ye},{viewTransitionOpts:je,flushSync:P===!0}),k="POP",Q=!1,re=!1,L=!1,O=!1,B?.resolve(),B=null,H?.resolve(),H=null}async function Je(N,D){if(B?.resolve(),B=null,typeof N=="number"){B||(B=H0());let tt=B.promise;return e.history.go(N),tt}let P=wh(E.location,E.matches,m,N,D?.fromRouteId,D?.relative),{path:oe,submission:ue,error:Ee}=R0(!1,P,D),ye;D?.mask&&(ye={pathname:"",search:"",hash:"",...typeof D.mask=="string"?wa(D.mask):{...E.location.mask,...D.mask}});let Se=E.location,ve=Bl(Se,oe,D&&D.state,void 0,ye);ve={...ve,...e.history.encodeLocation(ve)};let je=D&&D.replace!=null?D.replace:void 0,ze="PUSH";je===!0?ze="REPLACE":je===!1||ue!=null&&an(ue.formMethod)&&ue.formAction===E.location.pathname+E.location.search&&(ze="REPLACE");let Ue=D&&"preventScrollReset"in D?D.preventScrollReset===!0:void 0,Oe=(D&&D.flushSync)===!0,Ze=Zr({currentLocation:Se,nextLocation:ve,historyAction:ze});if(Ze){Ra(Ze,{state:"blocked",location:ve,proceed(){Ra(Ze,{state:"proceeding",proceed:void 0,reset:void 0,location:ve}),Je(N,D)},reset(){let tt=new Map(E.blockers);tt.set(Ze,yl),me({blockers:tt})}});return}await qe(ze,ve,{submission:ue,pendingError:Ee,preventScrollReset:Ue,replace:D&&D.replace,enableViewTransition:D&&D.viewTransition,flushSync:Oe,callSiteDefaultShouldRevalidate:D&&D.defaultShouldRevalidate})}function ke(){H||(H=H0()),Un(),me({revalidation:"loading"});let N=H.promise;return E.navigation.state==="submitting"?N:E.navigation.state==="idle"?(qe(E.historyAction,E.location,{startUninterruptedRevalidation:!0}),N):(qe(k||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation,enableViewTransition:re===!0}),N)}async function qe(N,D,P){F&&F.abort(),F=null,k=N,L=(P&&P.startUninterruptedRevalidation)===!0,gc(E.location,E.matches),Q=(P&&P.preventScrollReset)===!0,re=(P&&P.enableViewTransition)===!0;let oe=d.activeRoutes,ue=P?.initialHydration&&E.matches&&E.matches.length>0&&!X?E.matches:ua(oe,D,m,!1,d.branches),Ee=(P&&P.flushSync)===!0;if(ue&&E.initialized&&!O&&kA(E.location,D)&&!(P&&P.submission&&an(P.submission.formMethod))){Ne(D,{matches:ue},{flushSync:Ee});return}let ye=er(ue,oe,D.pathname);if(ye.active&&ye.matches&&(ue=ye.matches),!ue){let{error:ot,notFoundMatches:We,route:zt}=ta(D.pathname);Ne(D,{matches:We,loaderData:{},errors:{[zt.id]:ot}},{flushSync:Ee});return}let Se=P&&P.overrideNavigation?{...P.overrideNavigation,matches:ue,historyAction:N}:void 0;F=new AbortController;let ve=oo(e.history,D,F.signal,P&&P.submission),je=e.getContext?await e.getContext():new x0,ze;if(P&&P.pendingError)ze=[Mr(ue).route.id,{type:"error",error:P.pendingError}];else if(P&&P.submission&&an(P.submission.formMethod)){let ot=await Qe(ve,D,P.submission,ue,N,je,ye.active,P&&P.initialHydration===!0,{replace:P.replace,flushSync:Ee});if(ot.shortCircuited)return;if(ot.pendingActionResult){let[We,zt]=ot.pendingActionResult;if(kn(zt)&&Hl(zt.error)&&zt.error.status===404){F=null,Ne(D,{matches:ot.matches,loaderData:{},errors:{[We]:zt.error}});return}}ue=ot.matches||ue,ze=ot.pendingActionResult,Se=Qd(D,ue,N,P.submission),Ee=!1,ye.active=!1,ve=oo(e.history,ve.url,ve.signal)}let{shortCircuited:Ue,matches:Oe,loaderData:Ze,errors:tt,workingFetchers:gt}=await Ie(ve,D,ue,N,je,ye.active,Se,P&&P.submission,P&&P.fetcherSubmission,P&&P.replace,P&&P.initialHydration===!0,Ee,ze,P&&P.callSiteDefaultShouldRevalidate);Ue||(F=null,Ne(D,{matches:Oe||ue,...L0(ze),loaderData:Ze,errors:tt,...gt?{fetchers:gt}:{}}))}async function Qe(N,D,P,oe,ue,Ee,ye,Se,ve={}){Un();let je=qA(D,oe,ue,P);if(me({navigation:je},{flushSync:ve.flushSync===!0}),ye){let Oe=await fa(oe,D.pathname,N.signal);if(Oe.type==="aborted")return{shortCircuited:!0};if(Oe.type==="error"){if(Oe.partialMatches.length===0){let{matches:tt,route:gt}=Eu(d.activeRoutes);return{matches:tt,pendingActionResult:[gt.id,{type:"error",error:Oe.error}]}}let Ze=Mr(Oe.partialMatches).route.id;return{matches:Oe.partialMatches,pendingActionResult:[Ze,{type:"error",error:Oe.error}]}}else if(Oe.matches)oe=Oe.matches;else{let{notFoundMatches:Ze,error:tt,route:gt}=ta(D.pathname);return{matches:Ze,pendingActionResult:[gt.id,{type:"error",error:tt}]}}}let ze,Ue=Lu(oe,D);if(!Ue.route.action&&!Ue.route.lazy)ze={type:"error",error:In(405,{method:N.method,pathname:D.pathname,routeId:Ue.route.id})};else{let Oe=fo(u,c,N,D,oe,Ue,Se?[]:o,Ee),Ze=await dn(N,D,Oe,Ee,null);if(ze=Ze[Ue.route.id],!ze){for(let tt of oe)if(Ze[tt.route.id]){ze=Ze[tt.route.id];break}}if(N.signal.aborted)return{shortCircuited:!0}}if(ui(ze)){let Oe;return ve&&ve.replace!=null?Oe=ve.replace:Oe=M0(ze.response.headers.get("Location"),new URL(N.url),m,e.history)===E.location.pathname+E.location.search,await ea(N,ze,!0,{submission:P,replace:Oe}),{shortCircuited:!0}}if(kn(ze)){let Oe=Mr(oe,Ue.route.id);return(ve&&ve.replace)!==!0&&(k="PUSH"),{matches:oe,pendingActionResult:[Oe.route.id,ze,Ue.route.id]}}return{matches:oe,pendingActionResult:[Ue.route.id,ze]}}async function Ie(N,D,P,oe,ue,Ee,ye,Se,ve,je,ze,Ue,Oe,Ze){let tt=ye||Qd(D,P,oe,Se),gt=Se||ve||U0(tt),ot=!L&&!ze;if(Ee){if(ot){let mt=yt(Oe);me({navigation:tt,...mt!==void 0?{actionData:mt}:{}},{flushSync:Ue})}let De=await fa(P,D.pathname,N.signal);if(De.type==="aborted")return{shortCircuited:!0};if(De.type==="error"){if(De.partialMatches.length===0){let{matches:Tn,route:ra}=Eu(d.activeRoutes);return{matches:Tn,loaderData:{},errors:{[ra.id]:De.error}}}let mt=Mr(De.partialMatches).route.id;return{matches:De.partialMatches,loaderData:{},errors:{[mt]:De.error}}}else if(De.matches)P=De.matches;else{let{error:mt,notFoundMatches:Tn,route:ra}=ta(D.pathname);return{matches:Tn,loaderData:{},errors:{[ra.id]:mt}}}}let We=d.activeRoutes,{dsMatches:zt,revalidatingFetchers:et}=A0(N,ue,u,c,e.history,E,P,gt,D,ze?[]:o,ze===!0,O,ie,pe,se,I,We,m,e.patchRoutesOnNavigation!=null,d.branches,Oe,Ze);if(j=++we,!e.dataStrategy&&!zt.some(De=>De.shouldLoad)&&!zt.some(De=>De.route.middleware&&De.route.middleware.length>0)&&et.length===0){let De=new Map(E.fetchers),mt=ts(De);return)DELIM" -R"DELIM( Ne(D,{matches:P,loaderData:{},errors:Oe&&kn(Oe[1])?{[Oe[0]]:Oe[1].error}:null,...L0(Oe),...mt?{fetchers:De}:{}},{flushSync:Ue}),{shortCircuited:!0}}if(ot){let De={};if(!Ee){De.navigation=tt;let mt=yt(Oe);mt!==void 0&&(De.actionData=mt)}et.length>0&&(De.fetchers=Jt(et)),me(De,{flushSync:Ue})}et.forEach(De=>{$t(De.key),De.controller&&de.set(De.key,De.controller)});let tr=()=>et.forEach(De=>$t(De.key));F&&F.signal.addEventListener("abort",tr);let{loaderResults:na,fetcherResults:hn}=await _a(zt,et,N,D,ue);if(N.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener("abort",tr),et.forEach(De=>de.delete(De.key));let ln=_u(na);if(ln)return await ea(N,ln.result,!0,{replace:je}),{shortCircuited:!0};if(ln=_u(hn),ln)return I.add(ln.key),await ea(N,ln.result,!0,{replace:je}),{shortCircuited:!0};let $n=new Map(E.fetchers),{loaderData:gi,errors:aa}=k0(E,P,na,Oe,et,hn,$n);ze&&E.errors&&(aa={...E.errors,...aa});let vi=ts($n),Aa=ns(j,$n),Na=vi||Aa||et.length>0;return{matches:P,loaderData:gi,errors:aa,...Na?{workingFetchers:$n}:{}}}function yt(N){if(N&&!kn(N[1]))return{[N[0]]:N[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function Jt(N){let D=new Map(E.fetchers);return N.forEach(P=>{let oe=D.get(P.key),ue=gl(void 0,oe?oe.data:void 0);D.set(P.key,ue)}),D}async function En(N,D,P,oe){$t(N);let ue=(oe&&oe.flushSync)===!0,Ee=d.activeRoutes,ye=wh(E.location,E.matches,m,P,D,oe?.relative),Se=ua(Ee,ye,m,!1,d.branches),ve=er(Se,Ee,ye);if(ve.active&&ve.matches&&(Se=ve.matches),!Se){Hn(N,D,In(404,{pathname:ye}),{flushSync:ue});return}let{path:je,submission:ze,error:Ue}=R0(!0,ye,oe);if(Ue){Hn(N,D,Ue,{flushSync:ue});return}let Oe=e.getContext?await e.getContext():new x0,Ze=(oe&&oe.preventScrollReset)===!0;if(ze&&an(ze.formMethod)){await Ja(N,D,je,Se,Oe,ve.active,ue,Ze,ze,oe&&oe.defaultShouldRevalidate);return}se.set(N,{routeId:D,path:je}),await Pt(N,D,je,Se,Oe,ve.active,ue,Ze,ze)}async function Ja(N,D,P,oe,ue,Ee,ye,Se,ve,je){Un(),se.delete(N);let ze=E.fetchers.get(N);_n(N,PA(ve,ze),{flushSync:ye});let Ue=new AbortController,Oe=oo(e.history,P,Ue.signal,ve);if(Ee){let lt=await fa(oe,new URL(Oe.url).pathname,Oe.signal,N);if(lt.type==="aborted")return;if(lt.type==="error"){Hn(N,D,lt.error,{flushSync:ye});return}else if(lt.matches)oe=lt.matches;else{Hn(N,D,In(404,{pathname:P}),{flushSync:ye});return}}let Ze=Lu(oe,P);if(!Ze.route.action&&!Ze.route.lazy){let lt=In(405,{method:ve.formMethod,pathname:P,routeId:D});Hn(N,D,lt,{flushSync:ye});return}de.set(N,Ue);let tt=we,gt=fo(u,c,Oe,P,oe,Ze,o,ue),ot=await dn(Oe,P,gt,ue,N),We=ot[Ze.route.id];if(!We){for(let lt of gt)if(ot[lt.route.id]){We=ot[lt.route.id];break}}if(Oe.signal.aborted){de.get(N)===Ue&&de.delete(N);return}if(pe.has(N)){if(ui(We)||kn(We)){_n(N,ba(void 0));return}}else{if(ui(We))if(de.delete(N),j>tt){_n(N,ba(void 0));return}else return I.add(N),_n(N,gl(ve)),ea(Oe,We,!1,{fetcherSubmission:ve,preventScrollReset:Se});if(kn(We)){Hn(N,D,We.error);return}}let zt=E.navigation.location||E.location,et=oo(e.history,zt,Ue.signal),tr=d.activeRoutes,na=E.navigation.state!=="idle"?ua(tr,E.navigation.location,m,!1,d.branches):E.matches;Be(na,"Didn't find any matches after fetcher action");let hn=++we;K.set(N,hn);let{dsMatches:ln,revalidatingFetchers:$n}=A0(et,ue,u,c,e.history,E,na,ve,zt,o,!1,O,ie,pe,se,I,tr,m,e.patchRoutesOnNavigation!=null,d.branches,[Ze.route.id,We],je),gi=gl(ve,We.data),aa=new Map(E.fetchers);aa.set(N,gi),$n.filter(lt=>lt.key!==N).forEach(lt=>{let ja=lt.key,sn=aa.get(ja),Eo=gl(void 0,sn?sn.data:void 0);aa.set(ja,Eo),$t(ja),lt.controller&&de.set(ja,lt.controller)}),me({fetchers:aa});let vi=()=>$n.forEach(lt=>$t(lt.key));Ue.signal.addEventListener("abort",vi);let{loaderResults:Aa,fetcherResults:Na}=await _a(ln,$n,et,zt,ue);if(Ue.signal.aborted)return;Ue.signal.removeEventListener("abort",vi),K.delete(N),de.delete(N),$n.forEach(lt=>de.delete(lt.key));let De=E.fetchers.has(N),mt=lt=>{if(!De)return lt;let ja=new Map(lt.fetchers);return ja.set(N,ba(We.data)),{...lt,fetchers:ja}},Tn=_u(Aa);if(Tn)return E=mt(E),ea(et,Tn.result,!1,{preventScrollReset:Se});if(Tn=_u(Na),Tn)return I.add(Tn.key),E=mt(E),ea(et,Tn.result,!1,{preventScrollReset:Se});let ra=new Map(E.fetchers);De&&ra.set(N,ba(We.data));let{loaderData:bi,errors:xi}=k0(E,na,Aa,void 0,$n,Na,ra);ns(hn,ra),E.navigation.state==="loading"&&hn>j?(Be(k,"Expected pending action"),F&&F.abort(),Ne(E.navigation.location,{matches:na,loaderData:bi,errors:xi,fetchers:ra})):(me({errors:xi,loaderData:D0(E.loaderData,bi,na,xi),fetchers:ra}),O=!1)}async function Pt(N,D,P,oe,ue,Ee,ye,Se,ve){let je=E.fetchers.get(N);_n(N,gl(ve,je?je.data:void 0),{flushSync:ye});let ze=new AbortController,Ue=oo(e.history,P,ze.signal);if(Ee){let We=await fa(oe,new URL(Ue.url).pathname,Ue.signal,N);if(We.type==="aborted")return;if(We.type==="error"){Hn(N,D,We.error,{flushSync:ye});return}else if(We.matches)oe=We.matches;else{Hn(N,D,In(404,{pathname:P}),{flushSync:ye});return}}let Oe=Lu(oe,P);de.set(N,ze);let Ze=we,tt=fo(u,c,Ue,P,oe,Oe,o,ue),gt=await dn(Ue,P,tt,ue,N),ot=gt[Oe.route.id];if(!ot){for(let We of oe)if(gt[We.route.id]){ot=gt[We.route.id];break}}if(de.get(N)===ze&&de.delete(N),!Ue.signal.aborted){if(pe.has(N)){_n(N,ba(void 0));return}if(ui(ot))if(j>Ze){_n(N,ba(void 0));return}else{I.add(N),await ea(Ue,ot,!1,{preventScrollReset:Se});return}if(kn(ot)){Hn(N,D,ot.error);return}_n(N,ba(ot.data))}}async function ea(N,D,P,{submission:oe,fetcherSubmission:ue,preventScrollReset:Ee,replace:ye}={}){P||(B?.resolve(),B=null),D.response.headers.has("X-Remix-Revalidate")&&(O=!0);let Se=D.response.headers.get("Location");Be(Se,"Expected a Location header on the redirect Response"),Se=M0(Se,new URL(N.url),m,e.history);let ve=Bl(E.location,Se,{_isRedirect:!0});if(i){let tt=!1;if(D.response.headers.has("X-Remix-Reload-Document"))tt=!0;else if(nm(Se)){const gt=jx(a,Se,!0);tt=gt.origin!==a.location.origin||Bn(gt.pathname,m)==null}if(tt){ye?a.location.replace(Se):a.location.assign(Se);return}}F=null;let je=ye===!0||D.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:ze,formAction:Ue,formEncType:Oe}=E.navigation;!oe&&!ue&&ze&&Ue&&Oe&&(oe=U0(E.navigation));let Ze=oe||ue;if(yA.has(D.response.status)&&Ze&&an(Ze.formMethod))await qe(je,ve,{submission:{...Ze,formAction:Se},preventScrollReset:Ee||Q,enableViewTransition:P?re:void 0});else{let tt=Qd(ve,[],je,oe);await qe(je,ve,{overrideNavigation:tt,fetcherSubmission:ue,preventScrollReset:Ee||Q,enableViewTransition:P?re:void 0})}}async function dn(N,D,P,oe,ue){let Ee,ye={};try{Ee=await AA(p,N,D,P,ue,oe,!1)}catch(Se){return P.filter(ve=>ve.shouldLoad).forEach(ve=>{ye[ve.route.id]={type:"error",error:Se}}),ye}if(N.signal.aborted)return ye;if(!an(N.method))for(let Se of P){if(Ee[Se.route.id]?.type==="error")break;!Ee.hasOwnProperty(Se.route.id)&&!E.loaderData.hasOwnProperty(Se.route.id)&&(!E.errors||!E.errors.hasOwnProperty(Se.route.id))&&Se.shouldCallHandler()&&(Ee[Se.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Se.route.id}`)})}for(let[Se,ve]of Object.entries(Ee))if(UA(ve)){let je=ve.result;ye[Se]={type:"redirect",response:CA(je,N,Se,P,m)}}else ye[Se]=await zA(ve);return ye}async function _a(N,D,P,oe,ue){let Ee=dn(P,oe,N,ue,null),ye=Promise.all(D.map(async je=>{if(je.matches&&je.match&&je.request&&je.controller){let Ue=(await dn(je.request,je.path,je.matches,ue,je.key))[je.match.route.id];return{[je.key]:Ue}}else return Promise.resolve({[je.key]:{type:"error",error:In(404,{pathname:je.path})}})})),Se=await Ee,ve=(await ye).reduce((je,ze)=>Object.assign(je,ze),{});return{loaderResults:Se,fetcherResults:ve}}function Un(){O=!0,se.forEach((N,D)=>{de.has(D)&&ie.add(D),$t(D)})}function _n(N,D,P={}){let oe=new Map(E.fetchers);oe.set(N,D),me({fetchers:oe},{flushSync:(P&&P.flushSync)===!0})}function Hn(N,D,P,oe={}){let ue=Mr(E.matches,D),Ee=new Map(E.fetchers);Ta(Ee,N),me({errors:{[ue.route.id]:P},fetchers:Ee},{flushSync:(oe&&oe.flushSync)===!0})}function mc(N){return W.set()DELIM" -R"DELIM(N,(W.get(N)||0)+1),pe.has(N)&&pe.delete(N),E.fetchers.get(N)||gA}function pc(N,D){$t(N,D?.reason),_n(N,ba(null))}function Ta(N,D){let P=E.fetchers.get(D);de.has(D)&&!(P&&P.state==="loading"&&K.has(D))&&$t(D),se.delete(D),K.delete(D),I.delete(D),pe.delete(D),ie.delete(D),N.delete(D)}function on(N){let D=(W.get(N)||0)-1;D<=0?(W.delete(N),pe.add(N)):W.set(N,D),me({fetchers:new Map(E.fetchers)})}function $t(N,D){let P=de.get(N);P&&(P.abort(D),de.delete(N))}function Wt(N,D){for(let P of N){let oe=D.get(P);Be(oe,`Expected fetcher: ${P}`);let ue=ba(oe.data);D.set(P,ue)}}function ts(N){let D=[],P=!1;for(let oe of I){let ue=N.get(oe);Be(ue,`Expected fetcher: ${oe}`),ue.state==="loading"&&(I.delete(oe),D.push(oe),P=!0)}return Wt(D,N),P}function ns(N,D){let P=[];for(let[oe,ue]of K)if(ue0}function yc(N,D){let P=E.blockers.get(N)||yl;return Ce.get(N)!==D&&Ce.set(N,D),P}function $r(N){E.blockers.delete(N),Ce.delete(N)}function Ra(N,D){let P=E.blockers.get(N)||yl;Be(P.state==="unblocked"&&D.state==="blocked"||P.state==="blocked"&&D.state==="blocked"||P.state==="blocked"&&D.state==="proceeding"||P.state==="blocked"&&D.state==="unblocked"||P.state==="proceeding"&&D.state==="unblocked",`Invalid blocker state transition: ${P.state} -> ${D.state}`);let oe=new Map(E.blockers);oe.set(N,D),me({blockers:oe})}function Zr({currentLocation:N,nextLocation:D,historyAction:P}){if(Ce.size===0)return;Ce.size>1&&St(!1,"A router only supports one blocker at a time");let oe=Array.from(Ce.entries()),[ue,Ee]=oe[oe.length-1],ye=E.blockers.get(ue);if(!(ye&&ye.state==="proceeding")&&Ee({currentLocation:N,nextLocation:D,historyAction:P}))return ue}function ta(N){let D=In(404,{pathname:N}),P=d.activeRoutes,{matches:oe,route:ue}=Eu(P);return{notFoundMatches:oe,route:ue,error:D}}function yi(N,D,P){if(T=N,R=D,C=P||null,!q&&E.navigation===Fd){q=!0;let oe=wo(E.location,E.matches);oe!=null&&me({restoreScrollPosition:oe})}return()=>{T=null,R=null,C=null}}function Wa(N,D){return C&&C(N,D.map(oe=>Cx(oe,E.loaderData)))||N.key}function gc(N,D){if(T&&R){let P=Wa(N,D);T[P]=R()}}function wo(N,D){if(T){let P=Wa(N,D),oe=T[P];if(typeof oe=="number")return oe}return null}function er(N,D,P){if(e.patchRoutesOnNavigation){let oe=d.branches;if(N){if(Object.keys(N[0].params).length>0)return{active:!0,matches:ua(D,P,m,!0,oe)}}else return{active:!0,matches:ua(D,P,m,!0,oe)||[]}}return{active:!1,matches:null}}async function fa(N,D,P,oe){if(!e.patchRoutesOnNavigation)return{type:"success",matches:N};let ue=N;for(;;){let Ee=c;try{await e.patchRoutesOnNavigation({signal:P,path:D,matches:ue,fetcherKey:oe,patch:(je,ze)=>{P.aborted||N0(je,ze,d,Ee,u,!1)}})}catch(je){return{type:"error",error:je,partialMatches:ue}}if(P.aborted)return{type:"aborted"};let ye=d.branches,Se=ua(d.activeRoutes,D,m,!1,ye),ve=null;if(Se){if(Object.keys(Se[0].params).length===0)return{type:"success",matches:Se};if(ve=ua(d.activeRoutes,D,m,!0,ye),!(ve&&ue.lengthP.route.id===D[oe].route.id)}function rs(N){c={},d.setHmrRoutes(Ul(N,u,void 0,c))}function is(N,D,P=!1){N0(N,D,d,c,u,P),d.hasHMRRoutes||me({})}return z={get basename(){return m},get future(){return b},get state(){return E},get routes(){return d.stableRoutes},get branches(){return d.branches},get manifest(){return c},get window(){return a},initialize:ce,subscribe:xe,enableScrollRestoration:yi,navigate:Je,fetch:En,revalidate:ke,createHref:N=>e.history.createHref(N),encodeLocation:N=>e.history.encodeLocation(N),getFetcher:mc,resetFetcher:pc,deleteFetcher:on,dispose:he,getBlocker:yc,deleteBlocker:$r,patchRoutes:is,_internalFetchControllers:de,_internalSetRoutes:rs,_internalSetStateDoNotUseOrYouWillBreakYourApp(N){me(N)}},e.instrumentations&&(z=sA(z,e.instrumentations.map(N=>N.router).filter(Boolean))),z}function SA(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function wh(e,a,i,o,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=Vl(o||".",sc(c),Bn(e.pathname,i)||e.pathname,u==="path");if(o==null&&(m.search=e.search,m.hash=e.hash),(o==null||o===""||o===".")&&d){let p=om(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=tA({basename:i,pathname:m.pathname})),xa(m)}function R0(e,a,i){if(!i||!SA(i))return{path:a};if(i.formMethod&&!ZA(i.formMethod))return{path:a,error:In(405,{method:i.formMethod})};let o=()=>({path:a,error:In(400,{type:"invalid-body"})}),u=(i.formMethod||"get").toUpperCase(),c=Xx(a);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!an(u))return o();let g=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((x,[w,T])=>`${x}${w}=${T} -`,""):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(!an(u))return o();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 o()}}}Be(typeof FormData=="function","FormData is not available in this environment");let d,m;if(i.formData)d=Th(i.formData),m=i.formData;else if(i.body instanceof FormData)d=Th(i.body),m=i.body;else if(i.body instanceof URLSearchParams)d=i.body,m=O0(d);else if(i.body==null)d=new URLSearchParams,m=new FormData;else try{d=new URLSearchParams(i.body),m=O0(d)}catch{return o()}let p={formMethod:u,formAction:c,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:m,json:void 0,text:void 0};if(an(p.formMethod))return{path:a,submission:p};let b=wa(a);return e&&b.search&&om(b.search)&&d.append("index",""),b.search=`?${d}`,{path:xa(b),submission:p}}function A0(e,a,i,o,s,u,c,d,m,p,b,g,x,w,T,C,R,q,G,X,le,ne){let ge=le?kn(le[1])?le[1].error:le[1].data:void 0,z=s.createURL(u.location),E=s.createURL(m),k;if(b&&u.errors){let L=Object.keys(u.errors)[0];k=c.findIndex(O=>O.route.id===L)}else if(le&&kn(le[1])){let L=le[0];k=c.findIndex(O=>O.route.id===L)-1}let B=le?le[1].statusCode:void 0,Q=B&&B>=400,F={currentUrl:z,currentParams:u.matches[0]?.params||{},nextUrl:E,nextParams:c[0].params,...d,actionResult:ge,actionStatus:B},re=Il(c),fe=c.map((L,O)=>{let{route:ie}=L,de=null;if(k!=null&&O>k)de=!1;else if(ie.lazy)de=!0;else if(!rm(ie))de=!1;else if(b){let{shouldLoad:I}=Fx(ie,u.loaderData,u.errors);de=I}else wA(u.loaderData,u.matches[O],L)&&(de=!0);if(de!==null)return Eh(i,o,e,m,re,L,p,a,de);let we=!1;typeof ne=="boolean"?we=ne:Q?we=!1:(g||z.pathname+z.search===E.pathname+E.search||z.search!==E.search||EA(u.matches[O],L))&&(we=!0);let j={...F,defaultShouldRevalidate:we},K=Rl(L,j);return Eh(i,o,e,m,re,L,p,a,K,j,ne)}),be=[];return T.forEach((L,O)=>{if(b||!c.some(W=>W.route.id===L.routeId)||w.has(O))return;let ie=u.fetchers.get(O),de=ie&&ie.state!=="idle"&&ie.data===void 0,we=ua(R,L.path,q??"/",!1,X);if(!we){if(G&&de)return;be.push({key:O,routeId:L.routeId,path:L.path,matches:null,match:null,request:null,controller:null});return}if(C.has(O))return;let j=Lu(we,L.path),K=new AbortController,I=oo(s,L.path,K.signal),se=null;if(x.has(O))x.delete(O),se=fo(i,o,I,L.path,we,j,p,a);else if(de)g&&(se=fo(i,o,I,L.path,we,j,p,a));else{let W;typeof ne=="boolean"?W=ne:Q?W=!1:W=g;let pe={...F,defaultShouldRevalidate:W};Rl(j,pe)&&(se=fo(i,o,I,L.path,we,j,p,a,pe))}se&&be.push({key:O,routeId:L.routeId,path:L.p)DELIM" -R"DELIM(ath,matches:se,match:j,request:I,controller:K})}),{dsMatches:fe,revalidatingFetchers:be}}function rm(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Fx(e,a,i){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!rm(e))return{shouldLoad:!1,renderFallback:!1};let o=a!=null&&e.id in a,s=i!=null&&i[e.id]!==void 0;if(!o&&s)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!o};let u=!o&&!s;return{shouldLoad:u,renderFallback:u}}function wA(e,a,i){let o=!a||i.route.id!==a.route.id,s=!e.hasOwnProperty(i.route.id);return o||s}function EA(e,a){let i=e.route.path;return e.pathname!==a.pathname||i!=null&&i.endsWith("*")&&e.params["*"]!==a.params["*"]}function Rl(e,a){if(e.route.shouldRevalidate){let i=e.route.shouldRevalidate(a);if(typeof i=="boolean")return i}return a.defaultShouldRevalidate}function N0(e,a,i,o,s,u){let c;if(e){let p=o[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(g=>Qx(p,g));b?m.push({existingRoute:b,newRoute:p}):d.push(p)}),d.length>0){let p=Ul(d,s,[e||"_","patch",String(c?.length||"0")],o);c.push(...p)}if(u&&m.length>0)for(let p=0;pa.children?.some(s=>Qx(i,s)))??!1:!1}var j0=new WeakMap,Yx=({key:e,route:a,manifest:i,mapRouteProperties:o})=>{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=j0.get(s);c||(c={},j0.set(s,c));let d=c[e];if(d)return d;let m=(async()=>{let p=$3(e),g=s[e]!==void 0&&e!=="hasErrorBoundary";if(p)St(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)St(!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,o(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},z0=new WeakMap;function _A(e,a,i,o,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=z0.get(u);if(b)return{lazyRoutePromise:b,lazyHandlerPromise:b};let g=(async()=>{Be(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),w={};for(let T in x){let C=x[T];if(C===void 0)continue;let R=q3(T),G=u[T]!==void 0&&T!=="hasErrorBoundary";R?St(!R,"Route property "+T+" is not a supported property to be returned from a lazy route function. This property will be ignored."):G?St(!G,`Route "${u.id}" has a static property "${T}" defined but its lazy function is also returning a value for this property. The lazy route property "${T}" will be ignored.`):w[T]=C}Object.assign(u,w),Object.assign(u,{...o(u),lazy:void 0})})();return z0.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=Yx({key:b,route:e,manifest:i,mapRouteProperties:o});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 C0(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 TA(e){return e.matches.some(a=>a.route.middleware)?Gx(e,()=>C0(e)):C0(e)}function Gx(e,a){return RA(e,a,o=>{if($A(o))throw o;return o},LA,i);function i(o,s,u){if(u)return Promise.resolve(Object.assign(u.value,{[s]:{type:"error",result:o}}));{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=Mr(c,c[d].route.id).route.id;return Promise.resolve({[m]:{type:"error",result:o}})}}}async function RA(e,a,i,o,s){let{matches:u,...c}=e,d=u.flatMap(p=>p.route.middleware?p.route.middleware.map(b=>[p.route.id,b]):[]);return await Vx(c,d,a,i,o,s)}async function Vx(e,a,i,o,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 Vx(e,a,i,o,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),T=w!=null?o(w):void 0;return s(T)?T:g?T??g.value:(g={value:await x()},g.value)}catch(w){return await u(w,p,g)}}function Kx(e,a,i,o,s){let u=Yx({key:"middleware",route:o.route,manifest:a,mapRouteProperties:e}),c=_A(o.route,an(i.method)?"action":"loader",a,e,s);return{middleware:u,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function Eh(e,a,i,o,s,u,c,d,m,p=null,b){let g=!1,x=Kx(e,a,i,u,c);return{...u,_lazyPromises:x,shouldLoad:m,shouldRevalidateArgs:p,shouldCallHandler(w){return g=!0,p?typeof b=="boolean"?Rl(u,{...p,defaultShouldRevalidate:b}):typeof w=="boolean"?Rl(u,{...p,defaultShouldRevalidate:w}):Rl(u,p):m},resolve(w){let{lazy:T,loader:C,middleware:R}=u.route,q=g||m||w&&!an(i.method)&&(T||C),G=R&&R.length>0&&!C&&!T;return q&&(an(i.method)||!G)?NA({request:i,path:o,pattern:s,match:u,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:w,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function fo(e,a,i,o,s,u,c,d,m=null){return s.map(p=>p.route.id!==u.route.id?{...p,shouldLoad:!1,shouldRevalidateArgs:m,shouldCallHandler:()=>!1,_lazyPromises:Kx(e,a,i,p,c),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Eh(e,a,i,o,Il(s),p,c,d,!0,m))}async function AA(e,a,i,o,s,u,c){o.some(b=>b._lazyPromises?.middleware)&&await Promise.all(o.map(b=>b._lazyPromises?.middleware));let d={request:a,url:Ix(a,i),pattern:Il(o),params:o[0].params,context:u,matches:o},p=await e({...d,fetcherKey:s,runClientMiddleware:b=>{let g=d;return Gx(g,()=>b({...g,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(o.flatMap(b=>[b._lazyPromises?.handler,b._lazyPromises?.route]))}catch{}return p}async function NA({request:e,path:a,pattern:i,match:o,lazyHandlerPromise:s,lazyRoutePromise:u,handlerOverride:c,scopedContext:d}){let m,p,b=an(e.method),g=b?"action":"loader",x=w=>{let T,C=new Promise((G,X)=>T=X);p=()=>T(),e.signal.addEventListener("abort",p);let R=G=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${o.route.id}]`)):w({request:e,url:Ix(e,a),pattern:i,params:o.params,context:d},...G!==void 0?[G]:[]),q=(async()=>{try{return{type:"data",result:await(c?c(X=>R(X)):R())}}catch(G){return{type:"error",result:G}}})();return Promise.race([q,C])};try{let w=b?o.route.action:o.route.loader;if(s||u)if(w){let T,[C]=await Promise.all([x(w).catch(R=>{T=R}),s,u]);if(T!==void 0)throw T;m=C}else{await s;let T=b?o.route.action:o.route.loader;if(T)[m]=await Promise.all([x(T),u]);else if(g==="action"){let C=new URL(e.url),R=C.pathname+C.search;throw In(405,{method:e.method,pathname:R,routeId:o.route.id})}else return{type:"data",result:void 0}}else if(w)m=await x(w);else{let T=new URL(e.url),C=T.pathname+T.search;throw In(404,{pathname:C})}}catch(w){return{type:"error",result:w}}finally)DELIM" -R"DELIM({p&&e.signal.removeEventListener("abort",p)}return m}async function jA(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 zA(e){let{result:a,type:i}=e;if(im(a)){let o;try{o=await jA(a)}catch(s){return{type:"error",error:s}}return i==="error"?{type:"error",error:new Kl(a.status,a.statusText,o),statusCode:a.status,headers:a.headers}:{type:"data",data:o,statusCode:a.status,headers:a.headers}}return i==="error"?B0(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:DA(a),statusCode:Hl(a)?a.status:void 0,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:Hl(a)?a.status:void 0}:B0(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 CA(e,a,i,o,s){let u=e.headers.get("Location");if(Be(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!nm(u)){let c=o.slice(0,o.findIndex(d=>d.route.id===i)+1);u=wh(new URL(a.url),c,s,u),e.headers.set("Location",u)}return e}var MA=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function _h(e){try{return MA.includes(new URL(e).protocol)}catch{return!1}}function M0(e,a,i,o){if(nm(e)){let s=e,u=tm.test(s)?new URL(Ax(s,a.protocol)):new URL(s);if(_h(u.toString()))throw new Error("Invalid redirect location");let c=Bn(u.pathname,i)!=null;if(u.origin===a.origin&&c)return am(u.pathname)+u.search+u.hash}try{let s=o.createURL(e);if(_h(s.toString()))throw new Error("Invalid redirect location")}catch{}return e}function oo(e,a,i,o){let s=e.createURL(Xx(a)).toString(),u={signal:i};if(o&&an(o.formMethod)){let{formMethod:c,formEncType:d}=o;u.method=c.toUpperCase(),d==="application/json"?(u.headers=new Headers({"Content-Type":d}),u.body=JSON.stringify(o.json)):d==="text/plain"?u.body=o.text:d==="application/x-www-form-urlencoded"&&o.formData?u.body=Th(o.formData):u.body=o.formData}return new Request(s,u)}function Ix(e,a){let i=new URL(e.url),o=typeof a=="string"?wa(a):a;if(i.pathname=o.pathname||"/",o.search){let s=new URLSearchParams(o.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=o.hash||"",i}function Th(e){let a=new URLSearchParams;for(let[i,o]of e.entries())a.append(i,typeof o=="string"?o:o.name);return a}function O0(e){let a=new FormData;for(let[i,o]of e.entries())a.append(i,o);return a}function OA(e,a,i,o=!1,s=!1){let u={},c=null,d,m=!1,p={},b=i&&kn(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(Be(!ui(w),"Cannot handle redirect results in processLoaderData"),kn(w)){let T=w.error;if(b!==void 0&&(T=b,b=void 0),c=c||{},s)c[x]=T;else{let C=Mr(e,x);c[C.route.id]==null&&(c[C.route.id]=T)}o||(u[x]=Px),m||(m=!0,d=Hl(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 k0(e,a,i,o,s,u,c){let{loaderData:d,errors:m}=OA(a,i,o);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(Be(w,"Did not find corresponding fetcher result"),kn(w)){let T=Mr(e.matches,g?.route.id);m&&m[T.route.id]||(m={...m,[T.route.id]:w.error}),c.delete(b)}else if(ui(w))Be(!1,"Unhandled fetcher revalidation redirect");else{let T=ba(w.data);c.set(b,T)}}),{loaderData:d,errors:m}}function D0(e,a,i,o){let s=Object.entries(a).filter(([,u])=>u!==Px).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]),o&&o.hasOwnProperty(c))break}return s}function L0(e){return e?kn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Mr(e,a){return(a?e.slice(0,e.findIndex(o=>o.route.id===a)+1):[...e]).reverse().find(o=>o.route.hasErrorBoundary===!0)||e[0]}function Eu(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 In(e,{pathname:a,routeId:i,method:o,type:s,message:u}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",o&&a&&i?d=`You made a ${o} 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",o&&a&&i?d=`You made a ${o.toUpperCase()} request to "${a}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:o&&(d=`Invalid request method "${o.toUpperCase()}"`)),new Kl(e||500,c,new Error(d),!0)}function _u(e){let a=Object.entries(e);for(let i=a.length-1;i>=0;i--){let[o,s]=a[i];if(ui(s))return{key:o,result:s}}}function Xx(e){let a=typeof e=="string"?wa(e):e;return xa({...a,hash:""})}function kA(e,a){return e.pathname!==a.pathname||e.search!==a.search?!1:e.hash===""?a.hash!=="":e.hash===a.hash?!0:a.hash!==""}function DA(e){return new Kl(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function LA(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([a,i])=>typeof a=="string"&&BA(i))}function BA(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function UA(e){return im(e.result)&&Zx.has(e.result.status)}function kn(e){return e.type==="error"}function ui(e){return(e&&e.type)==="redirect"}function B0(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function im(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function HA(e){return Zx.has(e)}function $A(e){return im(e)&&HA(e.status)&&e.headers.has("Location")}function ZA(e){return pA.has(e.toUpperCase())}function an(e){return hA.has(e.toUpperCase())}function om(e){return new URLSearchParams(e).getAll("index").some(a=>a==="")}function Lu(e,a){let i=typeof a=="string"?wa(a).search:a.search;if(e[e.length-1].route.index&&om(i||""))return e[e.length-1];let o=Lx(e);return o[o.length-1]}function U0(e){let{formMethod:a,formAction:i,formEncType:o,text:s,formData:u,json:c}=e;if(!(!a||!i||!o)){if(s!=null)return{formMethod:a,formAction:i,formEncType:o,formData:void 0,json:void 0,text:s};if(u!=null)return{formMethod:a,formAction:i,formEncType:o,formData:u,json:void 0,text:void 0};if(c!==void 0)return{formMethod:a,formAction:i,formEncType:o,formData:void 0,json:c,text:void 0}}}function Qd(e,a,i,o){return o?{state:"loading",location:e,matches:a,historyAction:i,formMethod:o.formMethod,formAction:o.formAction,formEncType:o.formEncType,formData:o.formData,json:o.json,text:o.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 qA(e,a,i,o){return{state:"submitting",location:e,matches:a,historyAction:i,formMethod:o.formMethod,formAction:o.formAction,formEncType:o.formEncType,formData:o.formData,json:o.json,text:o.text}}function gl(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 PA(e,a){return{state:"submitting",formMethod:e.formMethod,)DELIM" -R"DELIM(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 FA(e,a){try{let i=e.sessionStorage.getItem(qx);if(i){let o=JSON.parse(i);for(let[s,u]of Object.entries(o||{}))u&&Array.isArray(u)&&a.set(s,new Set(u||[]))}}catch{}}function QA(e,a){if(a.size>0){let i={};for(let[o,s]of a)i[o]=[...s];try{e.sessionStorage.setItem(qx,JSON.stringify(i))}catch(o){St(!1,`Failed to save applied view transitions in sessionStorage (${o}).`)}}}function H0(){let e,a,i=new Promise((o,s)=>{e=async u=>{o(u);try{await i}catch{}},a=async u=>{s(u);try{await i}catch{}}});return{promise:i,resolve:e,reject:a}}var mi=_.createContext(null);mi.displayName="DataRouter";var xo=_.createContext(null);xo.displayName="DataRouterState";var Jx=_.createContext(!1);function Wx(){return _.useContext(Jx)}var lm=_.createContext({isTransitioning:!1});lm.displayName="ViewTransition";var e1=_.createContext(new Map);e1.displayName="Fetchers";var YA=_.createContext(null);YA.displayName="Await";var fn=_.createContext(null);fn.displayName="Navigation";var Xl=_.createContext(null);Xl.displayName="Location";var Wn=_.createContext({outlet:null,matches:[],isDataRoute:!1});Wn.displayName="Route";var sm=_.createContext(null);sm.displayName="RouteError";var t1="REACT_ROUTER_ERROR",GA="REDIRECT",VA="ROUTE_ERROR_RESPONSE";function KA(e){if(e.startsWith(`${t1}:${GA}:{`))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 IA(e){if(e.startsWith(`${t1}:${VA}:{`))try{let a=JSON.parse(e.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new Kl(a.status,a.statusText,a.data)}catch{}}function XA(e,{relative:a}={}){Be(So(),"useHref() may be used only in the context of a component.");let{basename:i,navigator:o}=_.useContext(fn),{hash:s,pathname:u,search:c}=Jl(e,{relative:a}),d=u;return i!=="/"&&(d=u==="/"?i:Xn([i,u])),o.createHref({pathname:d,search:c,hash:s})}function So(){return _.useContext(Xl)!=null}function Xt(){return Be(So(),"useLocation() may be used only in the context of a component."),_.useContext(Xl).location}function JA(){return _.useContext(Xl).navigationType}var n1="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function a1(e){_.useContext(fn).static||_.useLayoutEffect(e)}function Ea(){let{isDataRoute:e}=_.useContext(Wn);return e?dN():WA()}function WA(){Be(So(),"useNavigate() may be used only in the context of a component.");let e=_.useContext(mi),{basename:a,navigator:i}=_.useContext(fn),{matches:o}=_.useContext(Wn),{pathname:s}=Xt(),u=JSON.stringify(sc(o)),c=_.useRef(!1);return a1(()=>{c.current=!0}),_.useCallback((m,p={})=>{if(St(c.current,n1),!c.current)return;if(typeof m=="number"){i.go(m);return}let b=Vl(m,JSON.parse(u),s,p.relative==="path");e==null&&a!=="/"&&(b.pathname=b.pathname==="/"?a:Xn([a,b.pathname])),(p.replace?i.replace:i.push)(b,p.state,p)},[a,i,u,s,e])}var eN=_.createContext(null);function tN(e){let a=_.useContext(Wn).outlet;return _.useMemo(()=>a&&_.createElement(eN.Provider,{value:e},a),[a,e])}function um(){let{matches:e}=_.useContext(Wn);return e[e.length-1]?.params??{}}function Jl(e,{relative:a}={}){let{matches:i}=_.useContext(Wn),{pathname:o}=Xt(),s=JSON.stringify(sc(i));return _.useMemo(()=>Vl(e,JSON.parse(s),o,a==="path"),[e,s,o,a])}function nN(e,a,i){Be(So(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=_.useContext(fn),{matches:s}=_.useContext(Wn),u=s[s.length-1],c=u?u.params:{},d=u?u.pathname:"/",m=u?u.pathnameBase:"/",p=u&&u.route;{let R=p&&p.path||"";l1(d,!p||R.endsWith("*")||R.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 u of e.seen.entries()){const d=u[1];if(a===u[0]){c(u);continue}if(e.external){const p=e.external.registry.get(u[0])?.id;if(a!==u[0]&&p){c(u);continue}}if(e.metadataRegistry.get(u[0])?.id){c(u);continue}if(d.cycle){c(u);continue}if(d.count>1&&e.reused==="ref"){c(u);continue}}}function Qb(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=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){o(g);const w=e.seen.get(g),T=w.schema;if(T.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(T)):Object.assign(p,T),Object.assign(p,b),d._zod.parent===g)for(const R in p)R==="$ref"||R==="allOf"||R in b||delete p[R];if(T.$ref&&w.def)for(const R in p)R==="$ref"||R==="allOf"||R in w.def&&JSON.stringify(p[R])===JSON.stringify(w.def[R])&&delete p[R]}const x=d._zod.parent;if(x&&x!==g){o(x);const w=e.seen.get(x);if(w?.schema.$ref&&(p.$ref=w.schema.$ref,w.def))for(const T in p)T==="$ref"||T==="allOf"||T in w.def&&JSON.stringify(p[T])===JSON.stringify(w.def[T])&&delete p[T]}e.override({zodSchema:d,jsonSchema:p,path:m.path??[]})};for(const d of[...e.seen.entries()].reverse())o(d[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target=)DELIM" +R"DELIM(=="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 c=e.metadataRegistry.get(a)?.id;c!==void 0&&s.id===c&&delete s.id;const u=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,u[m.defId]=m.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?s.$defs=u:s.definitions=u);try{const d=JSON.parse(JSON.stringify(s));return Object.defineProperty(d,"~standard",{value:{...a["~standard"],jsonSchema:{input:Gc(a,"input",e.processors),output:Gc(a,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function fn(e,a){const i=a??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return fn(o.element,i);if(o.type==="set")return fn(o.valueType,i);if(o.type==="lazy")return fn(o.getter(),i);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return fn(o.innerType,i);if(o.type==="intersection")return fn(o.left,i)||fn(o.right,i);if(o.type==="record"||o.type==="map")return fn(o.keyType,i)||fn(o.valueType,i);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:fn(o.in,i)||fn(o.out,i);if(o.type==="object"){for(const s in o.shape)if(fn(o.shape[s],i))return!0;return!1}if(o.type==="union"){for(const s of o.options)if(fn(s,i))return!0;return!1}if(o.type==="tuple"){for(const s of o.items)if(fn(s,i))return!0;return!!(o.rest&&fn(o.rest,i))}return!1}const CT=(e,a={})=>i=>{const o=qb({...i,processors:a});return Ht(e,o),Fb(o,e),Qb(o,e)},Gc=(e,a,i={})=>o=>{const{libraryOptions:s,target:c}=o??{},u=qb({...s??{},target:c,io:a,processors:i});return Ht(e,u),Fb(u,e),Qb(u,e)},MT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},OT=(e,a,i,o)=>{const s=i;s.type="string";const{minimum:c,maximum:u,format:d,patterns:m,contentEncoding:p}=e._zod.bag;if(typeof c=="number"&&(s.minLength=c),typeof u=="number"&&(s.maxLength=u),d&&(s.format=MT[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}))])}},DT=(e,a,i,o)=>{const s=i,{minimum:c,maximum:u,format:d,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>=(c??Number.NEGATIVE_INFINITY),x=typeof p=="number"&&p<=(u??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 c=="number"&&(s.minimum=c),x?w?(s.maximum=p,s.exclusiveMaximum=!0):s.exclusiveMaximum=p:typeof u=="number"&&(s.maximum=u),typeof m=="number"&&(s.multipleOf=m)},LT=(e,a,i,o)=>{i.type="boolean"},BT=(e,a,i,o)=>{i.not={}},UT=(e,a,i,o)=>{},$T=(e,a,i,o)=>{const s=e._zod.def,c=wb(s.entries);c.every(u=>typeof u=="number")&&(i.type="number"),c.every(u=>typeof u=="string")&&(i.type="string"),i.enum=c},HT=(e,a,i,o)=>{const s=e._zod.def,c=[];for(const u of s.values)if(u===void 0){if(a.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof u=="bigint"){if(a.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(u))}else c.push(u);if(c.length!==0)if(c.length===1){const u=c[0];i.type=u===null?"null":typeof u,a.target==="draft-04"||a.target==="openapi-3.0"?i.enum=[u]:i.const=u}else c.every(u=>typeof u=="number")&&(i.type="number"),c.every(u=>typeof u=="string")&&(i.type="string"),c.every(u=>typeof u=="boolean")&&(i.type="boolean"),c.every(u=>u===null)&&(i.type="null"),i.enum=c},ZT=(e,a,i,o)=>{if(a.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},PT=(e,a,i,o)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},qT=(e,a,i,o)=>{const s=i,c=e._zod.def,{minimum:u,maximum:d}=e._zod.bag;typeof u=="number"&&(s.minItems=u),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=Ht(c.element,a,{...o,path:[...o.path,"items"]})},FT=(e,a,i,o)=>{const s=i,c=e._zod.def;s.type="object",s.properties={};const u=c.shape;for(const p in u)s.properties[p]=Ht(u[p],a,{...o,path:[...o.path,"properties",p]});const d=new Set(Object.keys(u)),m=new Set([...d].filter(p=>{const b=c.shape[p]._zod;return a.io==="input"?b.optin===void 0:b.optout===void 0}));m.size>0&&(s.required=Array.from(m)),c.catchall?._zod.def.type==="never"?s.additionalProperties=!1:c.catchall?c.catchall&&(s.additionalProperties=Ht(c.catchall,a,{...o,path:[...o.path,"additionalProperties"]})):a.io==="output"&&(s.additionalProperties=!1)},QT=(e,a,i,o)=>{const s=e._zod.def,c=s.inclusive===!1,u=s.options.map((d,m)=>Ht(d,a,{...o,path:[...o.path,c?"oneOf":"anyOf",m]}));c?i.oneOf=u:i.anyOf=u},YT=(e,a,i,o)=>{const s=e._zod.def,c=Ht(s.left,a,{...o,path:[...o.path,"allOf",0]}),u=Ht(s.right,a,{...o,path:[...o.path,"allOf",1]}),d=p=>"allOf"in p&&Object.keys(p).length===1,m=[...d(c)?c.allOf:[c],...d(u)?u.allOf:[u]];i.allOf=m},GT=(e,a,i,o)=>{const s=i,c=e._zod.def;s.type="object";const u=c.keyType,m=u._zod.bag?.patterns;if(c.mode==="loose"&&m&&m.size>0){const b=Ht(c.valueType,a,{...o,path:[...o.path,"patternProperties","*"]});s.patternProperties={};for(const g of m)s.patternProperties[g.source]=b}else(a.target==="draft-07"||a.target==="draft-2020-12")&&(s.propertyNames=Ht(c.keyType,a,{...o,path:[...o.path,"propertyNames"]})),s.additionalProperties=Ht(c.valueType,a,{...o,path:[...o.path,"additionalProperties"]});const p=u._zod.values;if(p){const b=[...p].filter(g=>typeof g=="string"||typeof g=="number");b.length>0&&(s.required=b)}},VT=(e,a,i,o)=>{const s=e._zod.def,c=Ht(s.innerType,a,o),u=a.seen.get(e);a.target==="openapi-3.0"?(u.ref=s.innerType,i.nullable=!0):i.anyOf=[c,{type:"null"}]},KT=(e,a,i,o)=>{const s=e._zod.def;Ht(s.innerType,a,o);const c=a.seen.get(e);c.ref=s.innerType},IT=(e,a,i,o)=>{const s=e._zod.def;Ht(s.innerType,a,o);const c=a.seen.get(e);c.ref=s.innerType,i.default=JSON.parse(JSON.stringify(s.defaultValue))},XT=(e,a,i,o)=>{const s=e._zod.def;Ht(s.innerType,a,o);const c=a.seen.get(e);c.ref=s.innerType,a.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},JT=(e,a,i,o)=>{const s=e._zod.def;Ht(s.innerType,a,o);const c=a.seen.get(e);c.ref=s.innerType;let u;try{u=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=u},WT=(e,a,i,o)=>{const s=e._zod.def,c=s.in._zod.traits.has("$ZodTransform"),u=a.io==="input"?c?s.out:s.in:s.out;Ht(u,a,o);const d=a.seen.get(e);d.ref=u},e4=(e,a,i,o)=>{const s=e._zod.def;Ht(s.innerType,a,o);const c=a.seen.get(e);c.ref=s.innerType,i.readOnly=!0},Yb=(e,a,i,o)=>{const s=e._zod.def;Ht(s.innerType,a,o);const c=a.seen.get(e);c.ref=s.innerType},t4=te("ZodISODateTime",(e,a)=>{n2.init(e,a),jt.init(e,a)});function n4(e){return sT(t4,e)}const a4=te("ZodISODate",(e,a)=>{a2.init(e,a),jt.init(e,a)});function r4(e){return cT(a4,e)}const i4=te("ZodISOTime",(e,a)=>{r2.init(e,a),jt.init(e,a)});function o4(e){return uT(i4,e)}const l4=te("ZodISODuration",(e,a)=>{i2.init(e,a),jt.init(e,a)});function s4(e){return fT(l4,e)}const c4=(e,a)=>{Rb.init(e,a),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>VE(e,i)},flatten:{value:i=>GE(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,yh,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,yh,2)}},isEmpty)DELIM" +R"DELIM(:{get(){return e.issues.length===0}}})},Jn=te("ZodError",c4,{Parent:Error}),u4=Yh(Jn),f4=Gh(Jn),d4=iu(Jn),h4=ou(Jn),m4=XE(Jn),p4=JE(Jn),y4=WE(Jn),g4=e_(Jn),v4=t_(Jn),b4=n_(Jn),x4=a_(Jn),S4=r_(Jn),Vv=new WeakMap;function Yl(e,a,i){const o=Object.getPrototypeOf(e);let s=Vv.get(o);if(s||(s=new Set,Vv.set(o,s)),!s.has(a)){s.add(a);for(const c in i){const u=i[c];Object.defineProperty(o,c,{configurable:!0,enumerable:!1,get(){const d=u.bind(this);return Object.defineProperty(this,c,{configurable:!0,writable:!0,enumerable:!0,value:d}),d},set(d){Object.defineProperty(this,c,{configurable:!0,writable:!0,enumerable:!0,value:d})}})}}}const Rt=te("ZodType",(e,a)=>(Tt.init(e,a),Object.assign(e["~standard"],{jsonSchema:{input:Gc(e,"input"),output:Gc(e,"output")}}),e.toJSONSchema=CT(e,{}),e.def=a,e.type=a.type,Object.defineProperty(e,"_def",{value:a}),e.parse=(i,o)=>u4(e,i,o,{callee:e.parse}),e.safeParse=(i,o)=>d4(e,i,o),e.parseAsync=async(i,o)=>f4(e,i,o,{callee:e.parseAsync}),e.safeParseAsync=async(i,o)=>h4(e,i,o),e.spa=e.safeParseAsync,e.encode=(i,o)=>m4(e,i,o),e.decode=(i,o)=>p4(e,i,o),e.encodeAsync=async(i,o)=>y4(e,i,o),e.decodeAsync=async(i,o)=>g4(e,i,o),e.safeEncode=(i,o)=>v4(e,i,o),e.safeDecode=(i,o)=>b4(e,i,o),e.safeEncodeAsync=async(i,o)=>x4(e,i,o),e.safeDecodeAsync=async(i,o)=>S4(e,i,o),Yl(e,"ZodType",{check(...i){const o=this.def;return this.clone(Hr(o,{checks:[...o.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,o){return Zr(this,i,o)},brand(){return this},register(i,o){return i.add(this,o),this},refine(i,o){return this.check(gR(i,o))},superRefine(i,o){return this.check(vR(i,o))},overwrite(i){return this.check(wo(i))},optional(){return Wv(this)},exactOptional(){return rR(this)},nullable(){return e0(this)},nullish(){return Wv(e0(this))},nonoptional(i){return uR(this,i)},array(){return $r(this)},or(i){return G4([this,i])},and(i){return X4(this,i)},transform(i){return t0(this,nR(i))},default(i){return lR(this,i)},prefault(i){return cR(this,i)},catch(i){return dR(this,i)},pipe(i){return t0(this,i)},readonly(){return pR(this)},describe(i){const o=this.clone();return _l.add(o,{description:i}),o},meta(...i){if(i.length===0)return _l.get(this);const o=this.clone();return _l.add(o,i[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(i){return i(this)}}),Object.defineProperty(e,"description",{get(){return _l.get(e)?.description},configurable:!0}),e)),Gb=te("_ZodString",(e,a)=>{Vh.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(o,s,c)=>OT(e,o,s);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,Yl(e,"_ZodString",{regex(...o){return this.check(gT(...o))},includes(...o){return this.check(xT(...o))},startsWith(...o){return this.check(ST(...o))},endsWith(...o){return this.check(wT(...o))},min(...o){return this.check(Yc(...o))},max(...o){return this.check(Zb(...o))},length(...o){return this.check(Pb(...o))},nonempty(...o){return this.check(Yc(1,...o))},lowercase(o){return this.check(vT(o))},uppercase(o){return this.check(bT(o))},trim(){return this.check(_T())},normalize(...o){return this.check(ET(...o))},toLowerCase(){return this.check(TT())},toUpperCase(){return this.check(RT())},slugify(){return this.check(jT())}})}),w4=te("ZodString",(e,a)=>{Vh.init(e,a),Gb.init(e,a),e.email=i=>e.check(Z2(E4,i)),e.url=i=>e.check(Y2(_4,i)),e.jwt=i=>e.check(lT($4,i)),e.emoji=i=>e.check(G2(T4,i)),e.guid=i=>e.check(Fv(Kv,i)),e.uuid=i=>e.check(P2(xc,i)),e.uuidv4=i=>e.check(q2(xc,i)),e.uuidv6=i=>e.check(F2(xc,i)),e.uuidv7=i=>e.check(Q2(xc,i)),e.nanoid=i=>e.check(V2(R4,i)),e.guid=i=>e.check(Fv(Kv,i)),e.cuid=i=>e.check(K2(j4,i)),e.cuid2=i=>e.check(I2(N4,i)),e.ulid=i=>e.check(X2(k4,i)),e.base64=i=>e.check(rT(L4,i)),e.base64url=i=>e.check(iT(B4,i)),e.xid=i=>e.check(J2(A4,i)),e.ksuid=i=>e.check(W2(z4,i)),e.ipv4=i=>e.check(eT(C4,i)),e.ipv6=i=>e.check(tT(M4,i)),e.cidrv4=i=>e.check(nT(O4,i)),e.cidrv6=i=>e.check(aT(D4,i)),e.e164=i=>e.check(oT(U4,i)),e.datetime=i=>e.check(n4(i)),e.date=i=>e.check(r4(i)),e.time=i=>e.check(o4(i)),e.duration=i=>e.check(s4(i))});function gt(e){return H2(w4,e)}const jt=te("ZodStringFormat",(e,a)=>{Et.init(e,a),Gb.init(e,a)}),E4=te("ZodEmail",(e,a)=>{G_.init(e,a),jt.init(e,a)}),Kv=te("ZodGUID",(e,a)=>{Q_.init(e,a),jt.init(e,a)}),xc=te("ZodUUID",(e,a)=>{Y_.init(e,a),jt.init(e,a)}),_4=te("ZodURL",(e,a)=>{V_.init(e,a),jt.init(e,a)}),T4=te("ZodEmoji",(e,a)=>{K_.init(e,a),jt.init(e,a)}),R4=te("ZodNanoID",(e,a)=>{I_.init(e,a),jt.init(e,a)}),j4=te("ZodCUID",(e,a)=>{X_.init(e,a),jt.init(e,a)}),N4=te("ZodCUID2",(e,a)=>{J_.init(e,a),jt.init(e,a)}),k4=te("ZodULID",(e,a)=>{W_.init(e,a),jt.init(e,a)}),A4=te("ZodXID",(e,a)=>{e2.init(e,a),jt.init(e,a)}),z4=te("ZodKSUID",(e,a)=>{t2.init(e,a),jt.init(e,a)}),C4=te("ZodIPv4",(e,a)=>{o2.init(e,a),jt.init(e,a)}),M4=te("ZodIPv6",(e,a)=>{l2.init(e,a),jt.init(e,a)}),O4=te("ZodCIDRv4",(e,a)=>{s2.init(e,a),jt.init(e,a)}),D4=te("ZodCIDRv6",(e,a)=>{c2.init(e,a),jt.init(e,a)}),L4=te("ZodBase64",(e,a)=>{u2.init(e,a),jt.init(e,a)}),B4=te("ZodBase64URL",(e,a)=>{d2.init(e,a),jt.init(e,a)}),U4=te("ZodE164",(e,a)=>{h2.init(e,a),jt.init(e,a)}),$4=te("ZodJWT",(e,a)=>{p2.init(e,a),jt.init(e,a)}),Vb=te("ZodNumber",(e,a)=>{Lb.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(o,s,c)=>DT(e,o,s),Yl(e,"ZodNumber",{gt(o,s){return this.check(Yv(o,s))},gte(o,s){return this.check(Md(o,s))},min(o,s){return this.check(Md(o,s))},lt(o,s){return this.check(Qv(o,s))},lte(o,s){return this.check(Cd(o,s))},max(o,s){return this.check(Cd(o,s))},int(o){return this.check(Iv(o))},safe(o){return this.check(Iv(o))},positive(o){return this.check(Yv(0,o))},nonnegative(o){return this.check(Md(0,o))},negative(o){return this.check(Qv(0,o))},nonpositive(o){return this.check(Cd(0,o))},multipleOf(o,s){return this.check(Gv(o,s))},step(o,s){return this.check(Gv(o,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 Pe(e){return dT(Vb,e)}const H4=te("ZodNumberFormat",(e,a)=>{y2.init(e,a),Vb.init(e,a)});function Iv(e){return hT(H4,e)}const Z4=te("ZodBoolean",(e,a)=>{g2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>LT(e,i,o)});function Or(e){return mT(Z4,e)}const P4=te("ZodUnknown",(e,a)=>{v2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>UT()});function vh(){return pT(P4)}const q4=te("ZodNever",(e,a)=>{b2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>BT(e,i,o)});function F4(e){return yT(q4,e)}const Q4=te("ZodArray",(e,a)=>{x2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>qT(e,i,o,s),e.element=a.element,Yl(e,"ZodArray",{min(i,o){return this.check(Yc(i,o))},nonempty(i){return this.check(Yc(1,i))},max(i,o){return this.check(Zb(i,o))},length(i,o){return this.check(Pb(i,o))},unwrap(){return this.element}})});function $r(e,a){return NT(Q4,e,a)}const Y4=te("ZodObject",(e,a)=>{w2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>FT(e,i,o,s),ut(e,"shape",()=>a.shape),Yl(e,"ZodObject",{keyof(){return W4(Object.keys(this._zod.def.shape))},catchall(i){return this.clone({...this._zod.def,catchall:i})},passthrough(){return this.clone({...this._zod.def,catchall:vh()})},loose(){return this.clone({...this._zod.def,catchall:vh()})},strict(){return this.clone({...this._zod.def,catchall:F4()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(i){return ZE(this,i)},safeExtend(i){return PE(this,i)},merge(i){return qE(this,i)},pick(i){return $E(this,i)},omit(i){return HE(this,i)},partial(...i){return FE(Ib,this,i[0])},required(...i){return QE(Xb,this,i[0])}})});function on(e,a){const i={type:"obj)DELIM" +R"DELIM(ect",shape:e??{},...Re(a)};return new Y4(i)}const Kb=te("ZodUnion",(e,a)=>{$b.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>QT(e,i,o,s),e.options=a.options});function G4(e,a){return new Kb({type:"union",options:e,...Re(a)})}const V4=te("ZodDiscriminatedUnion",(e,a)=>{Kb.init(e,a),E2.init(e,a)});function K4(e,a,i){return new V4({type:"union",options:a,discriminator:e,...Re(i)})}const I4=te("ZodIntersection",(e,a)=>{_2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>YT(e,i,o,s)});function X4(e,a){return new I4({type:"intersection",left:e,right:a})}const Xv=te("ZodRecord",(e,a)=>{T2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>GT(e,i,o,s),e.keyType=a.keyType,e.valueType=a.valueType});function J4(e,a,i){return!a||!a._zod?new Xv({type:"record",keyType:gt(),valueType:e,...Re(a)}):new Xv({type:"record",keyType:e,valueType:a,...Re(i)})}const bh=te("ZodEnum",(e,a)=>{R2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(o,s,c)=>$T(e,o,s),e.enum=a.entries,e.options=Object.values(a.entries);const i=new Set(Object.keys(a.entries));e.extract=(o,s)=>{const c={};for(const u of o)if(i.has(u))c[u]=a.entries[u];else throw new Error(`Key ${u} not found in enum`);return new bh({...a,checks:[],...Re(s),entries:c})},e.exclude=(o,s)=>{const c={...a.entries};for(const u of o)if(i.has(u))delete c[u];else throw new Error(`Key ${u} not found in enum`);return new bh({...a,checks:[],...Re(s),entries:c})}});function W4(e,a){const i=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new bh({type:"enum",entries:i,...Re(a)})}const eR=te("ZodLiteral",(e,a)=>{j2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>HT(e,i,o),e.values=new Set(a.values),Object.defineProperty(e,"value",{get(){if(a.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return a.values[0]}})});function Jv(e,a){return new eR({type:"literal",values:Array.isArray(e)?e:[e],...Re(a)})}const tR=te("ZodTransform",(e,a)=>{N2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>PT(e,i),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new Sb(e.constructor.name);i.addIssue=c=>{if(typeof c=="string")i.issues.push(Bl(c,i.value,a));else{const u=c;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=i.value),u.inst??(u.inst=e),i.issues.push(Bl(u))}};const s=a.transform(i.value,i);return s instanceof Promise?s.then(c=>(i.value=c,i.fallback=!0,i)):(i.value=s,i.fallback=!0,i)}});function nR(e){return new tR({type:"transform",transform:e})}const Ib=te("ZodOptional",(e,a)=>{Hb.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>Yb(e,i,o,s),e.unwrap=()=>e._zod.def.innerType});function Wv(e){return new Ib({type:"optional",innerType:e})}const aR=te("ZodExactOptional",(e,a)=>{k2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>Yb(e,i,o,s),e.unwrap=()=>e._zod.def.innerType});function rR(e){return new aR({type:"optional",innerType:e})}const iR=te("ZodNullable",(e,a)=>{A2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>VT(e,i,o,s),e.unwrap=()=>e._zod.def.innerType});function e0(e){return new iR({type:"nullable",innerType:e})}const oR=te("ZodDefault",(e,a)=>{z2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>IT(e,i,o,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function lR(e,a){return new oR({type:"default",innerType:e,get defaultValue(){return typeof a=="function"?a():_b(a)}})}const sR=te("ZodPrefault",(e,a)=>{C2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>XT(e,i,o,s),e.unwrap=()=>e._zod.def.innerType});function cR(e,a){return new sR({type:"prefault",innerType:e,get defaultValue(){return typeof a=="function"?a():_b(a)}})}const Xb=te("ZodNonOptional",(e,a)=>{M2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>KT(e,i,o,s),e.unwrap=()=>e._zod.def.innerType});function uR(e,a){return new Xb({type:"nonoptional",innerType:e,...Re(a)})}const fR=te("ZodCatch",(e,a)=>{O2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>JT(e,i,o,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function dR(e,a){return new fR({type:"catch",innerType:e,catchValue:typeof a=="function"?a:()=>a})}const hR=te("ZodPipe",(e,a)=>{D2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>WT(e,i,o,s),e.in=a.in,e.out=a.out});function t0(e,a){return new hR({type:"pipe",in:e,out:a})}const mR=te("ZodReadonly",(e,a)=>{L2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>e4(e,i,o,s),e.unwrap=()=>e._zod.def.innerType});function pR(e){return new mR({type:"readonly",innerType:e})}const yR=te("ZodCustom",(e,a)=>{B2.init(e,a),Rt.init(e,a),e._zod.processJSONSchema=(i,o,s)=>ZT(e,i)});function gR(e,a={}){return kT(yR,e,a)}function vR(e,a){return AT(e,a)}function hi(e){if(!e)return;const a=e.trim();if(!a)return;const i=a.toLowerCase(),o=i.indexOf("1");if(o>0){const u=i.slice(0,o);if(["bc","tb","bcrt","ltc","sb"].includes(u)){const d=i.slice(o+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 Kh extends Error{constructor(a,i){super(a),this.status=i}status}const xh=on({id:gt(),height:Pe(),timestamp:Pe().optional(),mediantime:Pe().optional(),tx_count:Pe().optional(),size:Pe().optional(),weight:Pe().optional(),difficulty:Pe().optional(),bits:Pe().optional(),merkle_root:gt().optional(),previousblockhash:gt().nullable().optional(),nonce:Pe().optional(),version:Pe().optional()}).loose(),Jb=on({confirmed:Or(),block_height:Pe().optional(),block_hash:gt().optional(),block_time:Pe().optional()}),bR=on({txid:gt().optional().nullable(),vout:Pe().optional().nullable(),sequence:Pe().optional(),scriptsig:gt().optional().nullable(),scriptsig_asm:gt().optional().nullable(),witness:$r(gt()).optional(),is_coinbase:Or().optional(),prevout:on({scriptpubkey_type:gt().optional(),scriptpubkey_address:gt().optional(),scriptpubkey:gt().optional(),scriptpubkey_asm:gt().optional(),value:Pe().optional()}).partial().nullable().optional()}).loose(),xR=on({scriptpubkey_type:gt().optional(),scriptpubkey_address:gt().optional(),scriptpubkey:gt().optional(),scriptpubkey_asm:gt().optional(),value:Pe(),n:Pe().optional()}).loose(),Cc=on({txid:gt(),hash:gt().optional(),fee:Pe().optional(),version:Pe(),locktime:Pe(),vin:$r(bR),vout:$r(xR),size:Pe(),weight:Pe(),status:Jb}).loose(),Ih=$r(xh),Vc=$r(Cc),Od=on({in_best_chain:Or(),next_best:gt().optional(),height:Pe().optional()}),SR=on({id:gt().regex(/^[0-9a-f]{64}$/iu),mediantime:Pe().int().nonnegative().max(4294967295).optional()}),n0=on({address:gt(),chain_stats:on({funded_txo_count:Pe().optional(),funded_txo_sum:Pe().optional(),spent_txo_count:Pe().optional(),spent_txo_sum:Pe().optional(),tx_count:Pe().optional()}),mempool_stats:on({funded_txo_count:Pe().optional(),funded_txo_sum:Pe().optional(),spent_txo_count:Pe().optional(),spent_txo_sum:Pe().optional(),tx_count:Pe().optional()})}),wR=on({txid:gt(),vout:Pe().int().nonnegative(),value:Pe().nonnegative(),status:Jb}).loose(),ER=$r(wR),_R=K4("spent",[on({spent:Jv(!1)}),on({spent:Jv(!0),txid:gt().regex(/^[0-9a-f]{64}$/iu),vin:Pe().int().nonnegative().max(4294967295)})]);async function $t(e,a,i){const o=a.startsWith("/")?a:`/${a}`,s=await fetch(`${e}${o}`);if(!s.ok)throw new Kh(`Request to ${a} failed with status ${String(s.status)}`,s.status);const c=await s.json();return i.parse(c)}async function a0(e,a,i){if(i<=0)return[];const o=[];let s=a;for(;s&&o.lengthc.scriptpubkey_address===e?s+c.value:s,0),o=a.vin.reduce((s,c)=>{const u=c.prevout;return u?.scriptpubkey_address===e&&typeof u.value=="number"?s+u.value:s},0);return i-o}async function Dd(e,a){if(a==="latest"||a==="tip"){const i=await $t(e,"/blocks",Ih);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 Kh("Unable to resolve block height",i.status);return(await i.text()).trim()}return a}async function i0(e,a,i){if(i.lastKnownHeight==null||a>=i.lastKnownHeight)return null;const o=a+1;try{const s=await fetch(`${e}/block-height/${String(o)}`);return s.ok&&(await s.text()).trim()||null}catch(s){return console.warn(`Failed to resolve hash for height ${String(o)}`,s),null}}function gl(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 Ld(e,a){const i=e.status.confirmed?"confirmed":"unconfirmed",o=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})),c=s.reduce((m,p)=>m+p.valueSats,0),u=a.lastKnownHeight;let d=0;return e.status.block_height&&i==="confirmed"&&(d=u&&u>=e.status.block_height?u-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:c,inputs:o,outputs:s}}function RR(e,a){const i=e.chain_stats,o=e.mempool_stats,s=(i.funded_txo_sum??0)-(i.spent_txo_sum??0),c=Wb(e.address,a.slice(0,25));return{address:e.address,addressType:hi(e.address),balance:s,totalReceived:(i.funded_txo_sum??0)+(o.funded_txo_sum??0),totalSent:(i.spent_txo_sum??0)+(o.spent_txo_sum??0),txCount:(i.tx_count??0)+(o.tx_count??0),utxoCount:(i.funded_txo_count??0)-(i.spent_txo_count??0),transactions:c}}function jR(e){const a=e.chain_stats,i=e.mempool_stats,o=(a.funded_txo_sum??0)-(a.spent_txo_sum??0);return{address:e.address,addressType:hi(e.address),balance:o,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 Wb(e,a){return a.map(i=>({txid:i.txid,timestamp:i.status.block_time,valueChange:TR(e,i),blockHeight:i.status.block_height}))}async function o0(e,a,i=0){const o=i>0?`/block/${a}/txs/${String(i)}`:`/block/${a}/txs`;return $t(e,o,Vc)}async function NR(e,a,i){return i?$t(e,`/address/${a}/txs/chain/${i}`,Vc):$t(e,`/address/${a}/txs`,Vc)}function ex({baseUrl:e}){const a=new Set;let i=null;const o={lastBlockHash:null,lastKnownHeight:null};async function s(d){const m=await $t(e,`/tx/${d}`,Cc);return await(m.status.block_height?to(e,o,m.status.block_height):to(e,o)),Ld(m,o)}function c(){i||a.size===0||(i=setInterval(async()=>{try{const d=await $t(e,"/blocks",Ih);if(d.length===0)return;const m=d[0];if(m.id!==o.lastBlockHash){o.lastBlockHash=m.id,o.lastKnownHeight=Math.max(m.height,o.lastKnownHeight??0);const p=gl(m);for(const b of a)b({type:"block.new",payload:p})}}catch(d){console.warn("Block polling failed",d)}},15e3))}function u(){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 a0(e,"/blocks",d);return m.length>0&&(o.lastBlockHash=m[0].id,o.lastKnownHeight=Math.max(m[0].height,o.lastKnownHeight??0)),m.map(p=>gl(p))},async getBlocksBefore(d,m=10){const p=Math.max(d,0),b=await a0(e,`/blocks/${String(p)}`,m);return b.length>0&&(o.lastKnownHeight=Math.max(b[0].height,o.lastKnownHeight??0)),b.map(g=>gl(g))},async getBlockHeader(d){const m=await Dd(e,d);await to(e,o);const[p,b]=await Promise.all([$t(e,`/block/${m}`,xh),$t(e,`/block/${m}/status`,Od).catch(()=>null)]),g=gl(p);o.lastBlockHash=g.hash,o.lastKnownHeight=Math.max(g.height,o.lastKnownHeight??g.height);let x=b?.next_best??null;return x||(x=await i0(e,g.height,o)),{...g,merkleRoot:p.merkle_root,nonce:p.nonce,bits:p.bits,version:p.version,nextBlockHash:x}},async getBlockValidation(d){const[m,p]=await Promise.all([$t(e,`/block/${d}`,SR),$t(e,`/block/${d}/status`,Od)]);if(m.id.toLowerCase()!==d.toLowerCase())throw new Error("Block validation response does not match the requested block");return{medianTimePast:m.mediantime,inBestChain:p.in_best_chain}},getBlockStats(d){return Promise.resolve({})},async getBlock(d){const m=await Dd(e,d);await to(e,o);const p=await $t(e,`/block/${m}`,xh),[b,g]=await Promise.allSettled([o0(e,m),$t(e,`/block/${m}/status`,Od)]);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=gl(p);o.lastBlockHash=x.hash,o.lastKnownHeight=Math.max(x.height,o.lastKnownHeight??x.height);const w=b.status==="fulfilled"?b.value:[];let z=(g.status==="fulfilled"?g.value:null)?.next_best??null;return z||(z=await i0(e,x.height,o)),{...x,merkleRoot:p.merkle_root,nonce:p.nonce,bits:p.bits,version:p.version,nextBlockHash:z,transactions:w.map(q=>Ld(q,o))}},async getBlockTransactions(d,m=0){const p=await Dd(e,d),b=await o0(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"?to(e,o,g):to(e,o)),b.map(x=>Ld(x,o))},async getTransactionHeader(d){return s(d)},async getTransaction(d){return s(d)},async getTransactionInputScriptHex(d,m){const p=await $t(e,`/tx/${d}`,Cc);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 $t(e,`/tx/${d}`,Cc);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 getTransactionOutputSpends(d,m){if(m.length===0)return[];const p=await $t(e,`/tx/${d}/outspends`,$r(vh()));return m.map(b=>{const g=_R.safeParse(p[b]);return g.success?g.data.spent?{outputIndex:b,status:"spent",txid:g.data.txid.toLowerCase(),inputIndex:g.data.vin}:{outputIndex:b,status:"unspent"}:{outputIndex:b,status:"unknown"}})},async getAddressSummary(d){const m=await $t(e,`/address/${d}`,n0);return jR(m)},async getAddressUtxos(d){return(await $t(e,`/address/${d}/utxo`,ER)).map(p=>({txid:p.txid,outputIndex:p.vout,valueSats:p.value,status:p.status.confirmed?"confirmed":"unconfirmed",blockH)DELIM" +R"DELIM(eight:p.status.block_height,blockHash:p.status.block_hash,timestamp:p.status.block_time}))},async getAddress(d){const m=await $t(e,`/address/${d}`,n0),p=await $t(e,`/address/${d}/txs`,Vc);return RR(m,p)},async getAddressTransactions(d,m){const p=await NR(e,d,m);return Wb(d,p)},subscribeToEvents(d){return a.add(d),c(),()=>{a.delete(d),a.size===0&&u()}}}}function kR({baseUrl:e}){const a=ex({baseUrl:e});return{...a,metadata:{...a.metadata,id:"mempool",label:"mempool.space",endpoint:e,description:"Adapter backed by mempool.space REST API."}}}function Ul(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function tx(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 Xh(e){if(typeof e!="function")throw new TypeError("function expected");return!0}function $l(e,a){if(typeof a!="string")throw new TypeError(`${e}: string expected`);return!0}function Gl(e){if(typeof e!="number")throw new TypeError(`number expected, got ${typeof e}`);if(!Number.isSafeInteger(e))throw new RangeError(`invalid integer: ${e}`)}function Kc(e){if(!Array.isArray(e))throw new TypeError("array expected")}function nx(e,a){if(!tx(!0,a))throw new TypeError(`${e}: array of strings expected`)}function Jh(e,a){if(!tx(!1,a))throw new TypeError(`${e}: array of numbers expected`)}function Wh(...e){const a=c=>c,i=(c,u)=>d=>c(u(d)),o=e.map(c=>c.encode).reduceRight(i,a),s=e.map(c=>c.decode).reduce(i,a);return{encode:o,decode:s}}function ax(e){const a=typeof e=="string"?e.split(""):e,i=a.length;nx("alphabet",a);const o=new Map(a.map((s,c)=>[s,c]));return{encode:s=>(Kc(s),s.map(c=>{if(!Number.isSafeInteger(c)||c<0||c>=i)throw new Error(`alphabet.encode: digit index outside alphabet "${c}". Allowed: ${e}`);return a[c]})),decode:s=>(Kc(s),s.map(c=>{$l("alphabet.decode",c);const u=o.get(c);if(u===void 0)throw new Error(`Unknown letter: "${c}". Allowed: ${e}`);return u}))}}function rx(e=""){return $l("join",e),{encode:a=>(nx("join.decode",a),a.join(e)),decode:a=>($l("join.decode",a),a.split(e))}}function l0(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(Kc(e),!e.length)return[];let o=0;const s=[],c=Array.from(e,d=>{if(Gl(d),d<0||d>=a)throw new Error(`invalid integer: ${d}`);return d}),u=c.length;for(;;){let d=0,m=!0;for(let p=o;pa===0?e:ix(a,e%a),Ic=(e,a)=>e+(a-ix(e,a)),Mc=(()=>{let e=[];for(let a=0;a<40;a++)e.push(2**a);return e})();function Sh(e,a,i,o){if(Kc(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(Ic(a,i)>32)throw new Error(`convertRadix2: carry overflow from=${a} to=${i} carryBits=${Ic(a,i)}`);let s=0,c=0;const u=Mc[a],d=Mc[i]-1,m=[];for(const p of e){if(Gl(p),p>=u)throw new Error(`convertRadix2: invalid data word=${p} from=${a}`);if(s=s<32)throw new Error(`convertRadix2: carry overflow pos=${c} from=${a}`);for(c+=a;c>=i;c-=i)m.push((s>>c-i&d)>>>0);const b=Mc[c];if(b===void 0)throw new Error("invalid carry");s&=b-1}if(s=s<=a)throw new Error("Excess padding");if(!o&&s>0)throw new Error(`Non-zero padding: ${s}`);return o&&c>0&&m.push(s>>>0),m}function AR(e){Gl(e);const a=2**8;return{encode:i=>{if(!Ul(i))throw new TypeError("radix.encode input should be Uint8Array");return l0(Array.from(i),a,e)},decode:i=>(Jh("radix.decode",i),Uint8Array.from(l0(i,e,a)))}}function zR(e,a=!1){if(Gl(e),e<=0||e>32)throw new RangeError("radix2: bits should be in (0..32]");if(Ic(8,e)>32||Ic(e,8)>32)throw new RangeError("radix2: carry overflow");return{encode:i=>{if(!Ul(i))throw new TypeError("radix2.encode input should be Uint8Array");return Sh(Array.from(i),8,e,!a)},decode:i=>(Jh("radix2.decode",i),Uint8Array.from(Sh(i,e,8,a)))}}function s0(e){return Xh(e),function(...a){try{return e.apply(null,a)}catch{}}}function CR(e,a){if(Gl(e),e<=0)throw new RangeError(`checksum length must be positive: ${e}`);Xh(a);const i=a;return{encode(o){if(!Ul(o))throw new TypeError("checksum.encode: input should be Uint8Array");const s=i(o).slice(0,e),c=new Uint8Array(o.length+e);return c.set(o),c.set(s,o.length),c},decode(o){if(!Ul(o))throw new TypeError("checksum.decode: input should be Uint8Array");const s=o.slice(0,-e),c=o.slice(-e),u=i(s).slice(0,e);for(let d=0;dWh(AR(58),ax(e),rx("")),OR=Object.freeze(MR("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),DR=e=>{Xh(e);const a=e;return Wh(CR(4,i=>a(a(i))),OR)},wh=Wh(ax("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),rx("")),c0=[996825010,642813549,513874426,1027748829,705979059];function vl(e){const a=e>>25;let i=(e&33554431)<<5;for(let o=0;o>o&1)===1&&(i^=c0[o]);return i}function u0(e,a,i=1){const o=e.length;let s=1;for(let c=0;c126)throw new Error(`Invalid prefix (${e})`);s=vl(s)^u>>5}s=vl(s);for(let c=0;cw)throw new TypeError(`Length ${z} exceeds limit ${w}`);const R=g.toLowerCase(),q=u0(R,x,a);return`${R}1${wh.encode(x)}${q}`}function d(g,x=90){$l("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 T=g.toLowerCase();if(g!==T&&g!==g.toUpperCase())throw new Error("String must be lowercase or uppercase");const z=T.lastIndexOf("1");if(z===0||z===-1)throw new Error('Letter "1" must be present between prefix and data only');const R=T.slice(0,z),q=T.slice(z+1);if(q.length<6)throw new Error("Data must be at least 6 characters long");const G=wh.decode(q).slice(0,-6),J=u0(R,G,a);if(!q.endsWith(J))throw new Error(`Invalid checksum in ${g}: expected "${J}"`);return{prefix:R,words:G}}const m=s0(d);function p(g){const{prefix:x,words:w}=d(g,!1);return{prefix:x,words:w,bytes:o(w)}}function b(g,x){return u(g,s(x))}return{encode:u,decode:d,encodeFromBytes:b,decodeToBytes:p,decodeUnsafe:m,fromWords:o,fromWordsUnsafe:c,toWords:s}}const Xc=Object.freeze(ox("bech32")),Eh=Object.freeze(ox("bech32m"));function LR(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function em(e,a,i=""){const o=LR(e),s=e?.length;if(!o||a!==void 0){const u=i&&`"${i}" `,d="",m=o?`length=${s}`:`type=${typeof e}`,p=u+"expected Uint8Array"+d+", got "+m;throw o?new RangeError(p):new TypeError(p)}return e}function f0(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 BR(e,a){em(e,void 0,"digestInto() output");const i=a.outputLen;if(e.length='+i)}function _h(...e){for(let a=0;a>>a}const UR=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",$R=Array.fr)DELIM" +R"DELIM(om({length:256},(e,a)=>a.toString(16).padStart(2,"0"));function Oc(e){if(em(e),UR)return e.toHex();let a="";for(let i=0;ie(c).update(s).digest(),o=e(void 0);return i.outputLen=o.outputLen,i.blockLen=o.blockLen,i.canXOF=o.canXOF,i.create=s=>e(s),Object.assign(i,a),Object.freeze(i)}const ZR=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function PR(e,a,i){return e&a^~e&i}function qR(e,a,i){return e&a^e&i^a&i}class FR{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(a,i,o,s){this.blockLen=a,this.outputLen=i,this.padOffset=o,this.isLE=s,this.buffer=new Uint8Array(a),this.view=Bd(this.buffer)}update(a){f0(this),em(a);const{view:i,buffer:o,blockLen:s}=this,c=a.length;for(let u=0;us-u&&(this.process(o,0),u=0);for(let g=u;gb.length)throw new Error("_sha2: outputLen bigger than state");for(let g=0;g>>3,z=ya(w,17)^ya(w,19)^w>>>10;Nr[g]=z+Nr[g-7]+T+Nr[g-16]|0}let{A:o,B:s,C:c,D:u,E:d,F:m,G:p,H:b}=this;for(let g=0;g<64;g++){const x=ya(d,6)^ya(d,11)^ya(d,25),w=b+x+PR(d,m,p)+QR[g]+Nr[g]|0,z=(ya(o,2)^ya(o,13)^ya(o,22))+qR(o,s,c)|0;b=p,p=m,m=d,d=u+w|0,u=c,c=s,s=o,o=w+z|0}o=o+this.A|0,s=s+this.B|0,c=c+this.C|0,u=u+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(o,s,c,u,d,m,p,b)}roundClean(){_h(Nr)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),_h(this.buffer)}}class GR extends YR{A=jr[0]|0;B=jr[1]|0;C=jr[2]|0;D=jr[3]|0;E=jr[4]|0;F=jr[5]|0;G=jr[6]|0;H=jr[7]|0;constructor(){super(32)}}const lx=HR(()=>new GR,ZR(1)),sx=DR(lx),VR=0x00000000ffff0000000000000000000000000000000000000000000000000000n;function tm(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 o=BigInt(i)*(1n<i[1]).filter(Boolean);return a.length>0?a:[e]}function nm(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 o=a.match(/zero \[([0-9a-f]+)\]/)?.[1]??"";return o.length===40?"p2wpkh":o.length===64?"p2wsh":"segwit"}if(a.startsWith("1 ["))return"p2tr"}function Vl(){return"mainnet"}function Kl(e){return e==="testnet"||e==="regtest"?{p2pkh:111,p2sh:196,hrp:e==="regtest"?"bcrt":"tb"}:{p2pkh:0,p2sh:5,hrp:"bc"}}function d0(e,a){const i=new Uint8Array(a.length/2+1);return i[0]=e,i.set(tm(a),1),sx.encode(i)}function Ud(e,a,i){const o=tm(i),s=Xc.toWords(o);return s.unshift(a),(a===0?Xc:Eh).encode(e,s)}function cx(e,a){const i=e.toLowerCase(),o=i.match(/dup hash160 \[([0-9a-f]{40})\] equalverify checksig/);if(o)return{address:d0(a.p2pkh,o[1]),type:"p2pkh"};const s=i.match(/^hash160 \[([0-9a-f]{40})\] equal$/);if(s)return{address:d0(a.p2sh,s[1]),type:"p2sh"};const c=i.match(/^zero \[([0-9a-f]{40})\]/);if(c)return{address:Ud(a.hrp,0,c[1]),type:"p2wpkh"};const u=i.match(/^zero \[([0-9a-f]{64})\]/);if(u)return{address:Ud(a.hrp,0,u[1]),type:"p2wsh"};const d=i.match(/^1 \[([0-9a-f]{64})\]/);return d?{address:Ud(a.hrp,1,d[1]),type:"p2tr"}:{type:nm(e)}}function XR(e,a){try{const s=sx.decode(e),c=s[0],u=Oc(s.slice(1));if(u.length===40&&c===a.p2pkh)return{scriptHex:`76a914${u}88ac`,type:"p2pkh"};if(u.length===40&&c===a.p2sh)return{scriptHex:`a914${u}87`,type:"p2sh"}}catch{}const i=e.toLowerCase();if(i.indexOf("1")>0&&i.startsWith(`${a.hrp}1`)){const s=i,c=m=>{try{return m.decode(s,90)}catch{return null}},u=c(Xc);if(u&&u.prefix===a.hrp){const m=u.words[0],p=Xc.fromWords(u.words.slice(1)),b=Oc(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=c(Eh);if(d&&d.prefix===a.hrp){const m=d.words[0],p=Eh.fromWords(d.words.slice(1)),b=Oc(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 Ka(e,a){const i=e.toLowerCase();if(/^[0-9a-f]{64}$/.test(i))return{hash:i,type:"script-hash"};const o=XR(e,a);if(!o)return null;const s=lx(tm(o.scriptHex)),c=Uint8Array.from(s).reverse();return{hash:Oc(c),type:o.type}}function Dc(e,a){return{hash:e.hash,height:e.height,timestamp:e.timestamp,txCount:a,size:void 0,weight:void 0,difficulty:KR(e.bits),previousBlockHash:e.previous}}function JR(e){const a=IR(e);return a&&a.length>0?a:void 0}function WR(e,a,i,o){const s=/^0{64}$/u.test(e.point.hash),c=a?cx(a.script,i):{address:void 0,type:void 0},u=a?a.value:void 0,d=a?a.script:void 0;return{index:o,prevTxId:s?void 0:e.point.hash,prevOutputIndex:s?void 0:e.point.index,address:c.address,valueSats:u,scriptType:c.type??nm(d??e.script),isCoinbase:s,script:e.script?{mnemonic:e.script}:void 0,witness:JR(e.witness),sequence:e.sequence}}function ej(e,a,i){const o=cx(e.script,i);return{index:a,address:o.address,valueSats:e.value,scriptType:o.type??nm(e.script),spent:void 0,script:e.script?{mnemonic:e.script}:void 0}}function tj(e,a){return typeof e!="number"||typeof a!="number"?0:Math.max(0,e-a+1)}function Sc(e,a,i,o,s){const c=e.outputs.map((b,g)=>ej(b,g,i)),u=c.reduce((b,g)=>b+g.valueSats,0),d=a.reduce((b,g)=>g?(b??0)+g.value:b,null),m=tj(o.tipHeight,o.blockHeight),p=typeof o.blockHeight=="number"?"confirmed":"unconfirmed";return{txid:e.hash,hash:e.hash,status:p,confirmations:m,blockHeight:o.blockHeight,blockHash:o.blockHash,receivedTime:o.timestamp,feeSats:Number.isFinite(s)?s:void 0,feeRate:null,size:void)DELIM" +R"DELIM( 0,weight:void 0,version:e.version,locktime:e.locktime,totalInput:d,totalOutput:u,inputs:e.inputs.map((b,g)=>WR(b,a[g],i,g)),outputs:c}}const wc=25,kl=8,nj="/v1/top/subscribe?format=json",aj="/v1/top/subscribe?format=json&stop=true",rj=5e3,ij=2500,$d=5e3,oj=3e5,lj=on({hash:gt().regex(/^[0-9a-f]{64}$/iu),mtp:Pe().int().nonnegative().max(4294967295).optional(),state:on({validated:Or().optional(),confirmed:Or().optional(),confirmable:Or().optional(),unconfirmable:Or().optional()}).optional(),forks:J4(gt(),Or()).optional()}),h0=5e3,bl=new Map,Hd=new Map;class su extends Error{constructor(a,i){super(a),this.status=i,this.name="LibbitcoinApiError"}status}const Jc={address:!0,filter:!1,turbo:!0,witness:!0,retarget:!1,difficult:!1};function sj(e){if(!e||typeof e!="object"||Array.isArray(e))return Jc;const a=e,i=o=>typeof a[o]=="boolean"?a[o]:Jc[o];return{address:i("address"),filter:i("filter"),turbo:i("turbo"),witness:i("witness"),retarget:i("retarget"),difficult:i("difficult")}}function Tl(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 o=i,s=typeof o.count=="number"?o.count:void 0,c=typeof o.size=="number"?o.size:void 0,u=typeof o.weight=="number"?o.weight:void 0;return s===void 0&&c===void 0&&u===void 0?null:{count:s,size:c,weight:u}}function Lc(e){return e?.weight??e?.size}function cj(e,a){return!Number.isFinite(e)||!Number.isFinite(a)||a<=0?null:e/a*4}function Ec(e,a){if(!a)return e;const i=typeof a.fee=="number"?a.fee:void 0,o=typeof a.weight=="number"?a.weight:void 0,s=typeof i=="number"&&typeof o=="number"?cj(i,o):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 Xt(e,a,i){const o=a.startsWith("/")?a:`/${a}`;let s=o.includes("?")?`${e}${o}`:`${e}${o}?format=json`;i&&(s+=s.includes("?")?"&turbo=true":"?turbo=true");const c=Hd.get(s);if(c)return c;const u=(async()=>{const d=await fetch(s,{headers:{Accept:"application/json"}});if(!d.ok){const p=await d.text().catch(()=>"");throw new su(`Request failed ${String(d.status)}: ${p||d.statusText}`,d.status)}const m=await d.text();try{return JSON.parse(m)}catch{return m}})();Hd.set(s,u);try{return await u}finally{Hd.delete(s)}}async function It(e,a,i){try{return await Xt(e,a,i)}catch{return null}}async function ux(e,a,i){try{return await Xt(e,a,i)}catch(o){if(o instanceof su&&o.status===404)return null;throw o}}async function fx(e,a){const i=await Xt(e,"/v1/top?format=json",a),o=typeof i=="number"?i:Number(i);if(!Number.isFinite(o))throw new Error("Invalid top height");return o}function dx(e){return/^[0-9a-f]{64}$/iu.test(e)}function uj(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0?e:typeof e=="string"&&/^\d+$/u.test(e.trim())?Number(e.trim()):null}function Th(e){const a=uj(e);if(a!==null)return a;if(typeof e=="string"){const s=e.trim();return dx(s)?s:null}if(!e||typeof e!="object"||Array.isArray(e))return null;const i=e,o=[i.payload,i.top,i.block,i.header,i.hash,i.height];for(const s of o){if(s===e)continue;const c=Th(s);if(c!==null)return c}return null}function fj(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 dj(e){const a=e.trim();if(!a)return null;try{return Th(JSON.parse(a))}catch{return Th(a)}}function hj(e){const a=e.trim();if(!a)return null;const o=/^[a-z][a-z\d+\-.]*:\/\//iu.test(a)?a:`http://${a}`,s=globalThis.window;try{const c=new URL(o,s?.location.href??"http://localhost");if(c.protocol==="http:")c.protocol="ws:";else if(c.protocol==="https:")c.protocol="wss:";else if(c.protocol!=="ws:"&&c.protocol!=="wss:")return null;return c.hash="",c.search="",c.toString()}catch{return null}}async function li(e,a){const i=Date.now(),o=`${e}|0`,s=bl.get(o);if(s&&s.expiresAt>i)return s.promise;const c=fx(e,a).then(u=>(bl.set(o,{promise:c,value:u,expiresAt:Date.now()+h0}),u),u=>{throw bl.get(o)?.promise===c&&bl.delete(o),u});return bl.set(o,{promise:c,value:s?.value??null,expiresAt:i+h0}),c}async function _c(e,a,i){if(a==="latest"||a==="tip"){const o=await li(e,i);return{path:`/v1/block/height/${String(o)}`,height:o}}return/^\d+$/u.test(a)?{path:`/v1/block/height/${a}`}:{path:`/v1/block/hash/${a}`}}function mj(e,a){const i=new Map;return(o,s)=>{const c=`${o}:${String(s)}`,u=i.get(c);if(u)return u;const d=Xt(e,`/v1/output/${o}/${String(s)}?format=json`,a).catch(()=>null);return i.set(c,d),d}}async function pj(e,a,i,o){return Xt(e,`${a}/tx/${String(i)}?format=json`,o)}async function m0(e,a,i,o){const s=await fi(i,kl,async u=>{try{return await pj(e,a,u)}catch(d){if(o&&d instanceof su&&d.status===404)return null;throw d}}),c=s.indexOf(null);if(c===-1)return s.filter(u=>u!==null);if(s.slice(c+1).some(u=>u!==null))throw new Error("Libbitcoin returned a non-contiguous block transaction page");return s.slice(0,c).filter(u=>u!==null)}async function p0(e,a){return fi(a,kl,async i=>{const[o,s]=await Promise.all([Xt(e,`/v1/block/height/${String(i)}/header?format=json`),It(e,`/v1/block/height/${String(i)}/header/context?format=json`)]),c=Tl(s);return{...Dc(o,c?.count),size:Lc(c)}})}function hx(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function mx(e){return hx(e)?typeof e.hash=="string"&&e.hash.length>0&&typeof e.index=="number"&&Number.isInteger(e.index)&&e.index>=0:!1}function px(e,a){if(!Array.isArray(e)||!e.every(i=>hx(i)&&mx(i.point)&&typeof i.value=="number"&&Number.isFinite(i.value)&&i.value>=0))throw new TypeError(`Invalid response from ${a}`);return e}async function yj(e,a,i){const o=`/v1/address/${a}/confirmed?format=json`,s=await ux(e,o,i);return s===null?[]:px(s,o)}async function gj(e,a,i){const o=`/v1/address/${a}?format=json`,s=await ux(e,o,i);return s===null?[]:px(s,o)}const y0=25,yx=8,g0=3e4;function vj(e){if(e===void 0)return 0;const a=Number(e);return Number.isInteger(a)&&a>0?a:0}async function gx(e,a,i){const o=`/v1/output/${a}/${String(i)}/spender?format=json`;let s;try{s=await Xt(e,o)}catch(c){if(c instanceof su&&c.status===404)return null;throw c}if(!mx(s))throw new TypeError(`Invalid response from ${o}`);return s}async function fi(e,a,i){const o=Array.from({length:e.length});let s=0;async function c(){for(;sc())),o}async function bj(e,a,i){const o=await fi(a,yx,c=>gx(e,c.point.hash,c.point.index)),s=[];for(const[c,u]of a.entries()){const{hash:d,index:m}=u.point,p=o[c];s.push({id:`in:${d}:${String(m)}`,txid:d,outputIndex:m,valueChange:u.value,direction:"received",spent:p!==null,...i===null?{}:{cursor:i}}),p&&s.push({id:`out:${d}:${String(m)}`,txid:p.hash,valueChange:-u.value,direction:"sent",...i===null?{}:{cursor:i}})}return s}function v0(e,a){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const o=Number(e);if(Number.isFinite(o))return o}let i=0;for(const o of a)i+=o.value;return i}function Zd({baseUrl:e,pollIntervalMs:a=15e3,turbo:i=!1}){const o=new Set,s=new Set;let c=null,u=null,d=null,m=null,p=null,b=$d,g=!1,x=!1,w="idle",T=null,z=null;const R=Kl(Vl());let q=null,G=null;const J=hj(e),oe=!!(J&&globalThis.WebSocket),ee=new Map,be=new Map;async function A($,ce){const de=Date.now(),ge=ee.get($);if(ge&&ge.expiresAt>de)return ge.outputs;const me=await gj(e,$,ce);return ee.set($,{outputs:me,expiresAt:de+g0}),me}async function E($,ce){const de=Date.now(),ge=be.get($);if(ge&&ge.expiresAt>de)return ge.request;const me=yj(e,$,ce);be.set($,{request:me,expiresAt:de+g0});try{return await me}catch(Ne){throw be.get($)?.request===me&&be.delete($),Ne}}async function D($)DELIM" +R"DELIM(,ce,de){const ge=await A($,ce),me=vj(de),Ne=ge.slice(me,me+y0),Je=me+y0,Oe=Je{const ce=sj($);return q=ce,ce}).catch($=>(console.warn("Libbitcoin configuration fetch failed",$),q=Jc,Jc)),G)}function Q($){return $.address}function F($){return Q($)&&$.turbo}function ue(){return{transport:w,websocketAvailable:oe&&!g}}function he($){if(w===$)return;w=$;const ce=ue();for(const de of s)de(ce)}async function pe($){const ce=typeof $=="number"?`/v1/block/height/${String($)}`:`/v1/block/hash/${$}`,[de,ge]=await Promise.all([Xt(e,`${ce}/header?format=json`),It(e,`${ce}/header/context?format=json`)]);if(z===de.hash||T!==null&&de.heightT&&await pe($)}catch($){console.warn("Libbitcoin poller failed",$)}}function M(){o.size!==0&&(c||(c=setInterval(()=>{O()},a)),he("polling"))}function re(){c&&(clearInterval(c),c=null)}function fe(){d&&(clearTimeout(d),d=null)}function we(){m&&(clearTimeout(m),m=null)}function k(){p&&(clearTimeout(p),p=null)}function K(){if(p||!oe||o.size===0)return;const $=b;b=Math.min(b*2,oj),p=setTimeout(()=>{p=null,!(u||o.size===0)&&(g=!1,W())},$)}function I(){g=!0,le(!1),M(),K()}function le($){if(fe(),!!u){x=!0;try{$&&u.readyState===1&&u.send(aj),u.close()}catch{}finally{u=null}}}function W(){if(we(),u)return!0;if(!oe||!J||g||o.size===0)return!1;try{x=!1,u=new WebSocket(J),he("connecting")}catch(ce){return console.warn("Libbitcoin websocket unavailable, falling back to polling",ce),I(),!1}const $=u;return d=setTimeout(()=>{u===$&&(console.warn("Libbitcoin websocket connect timed out, falling back to polling"),I())},rj),$.addEventListener("open",()=>{if(u===$){fe();try{$.send(nj),re(),g=!1,b=$d,he("websocket")}catch(ce){console.warn("Libbitcoin websocket subscribe failed, falling back to polling",ce),I()}}}),$.addEventListener("message",ce=>{(async()=>{try{const de=await fj(ce.data);if(de===null)return;const ge=dj(de);if(ge===null)return;await pe(ge)}catch(de){console.warn("Libbitcoin websocket event handling failed",de)}})()}),$.addEventListener("error",ce=>{x||u!==$||(console.warn("Libbitcoin websocket failed, falling back to polling",ce),I())}),$.addEventListener("close",()=>{if(!(u!==null&&u!==$)){if(fe(),u===$&&(u=null),x){x=!1;return}o.size!==0&&I()}}),!0}function ye(){W()||(M(),K())}function ze(){we(),k(),b=$d,g=!1,re(),le(!0),he("idle")}function _t(){o.size>0||m||(m=setTimeout(()=>{m=null,o.size===0&&ze()},ij))}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($=10){const ce=await li(e);T=ce;const de=Array.from({length:$},(me,Ne)=>ce-Ne).filter(me=>me>=0),ge=await p0(e,de);return ge.length>0&&(z=ge[0].hash),ge},async getBlocksBefore($,ce=10){const de=Array.from({length:ce},(ge,me)=>$-me).filter(ge=>ge>=0);return p0(e,de)},async getBlockHeader($){const{path:ce,height:de}=await _c(e,$),ge=de===void 0?li(e):Promise.resolve(de),[me,Ne,Je]=await Promise.all([Xt(e,`${ce}/header?format=json`),ge,It(e,`${ce}/header/context?format=json`)]);T=Math.max(T??0,Ne);let Oe=null;me.height_a),er=await m0(e,ce,_n,typeof Ie!="number"),Qt=await fi(er,kl,mn=>It(e,`/v1/tx/${mn.hash}/details?format=json`)),ea=er.map((mn,_a)=>{const Un=Qt[_a],Tn=Sc(mn,[],R,{blockHeight:me.height,blockHash:me.hash,tipHeight:Ne,timestamp:me.timestamp},typeof Un?.fee=="number"?Un.fee:void 0);return Ec(Tn,Un)});return{...yt,size:Oe?.maximal??Lc(Ye),weight:Oe?.weight,merkleRoot:me.merkle_root,nonce:me.nonce,bits:me.bits,version:me.version,nextBlockHash:qe,feesSats:Oe?.fees,subsidySats:Oe?.subsidy,sigops:Oe?.sigops,transactions:ea}},async getBlockTransactions($,ce=0){const{path:de}=await _c(e,$),[ge,me,Ne]=await Promise.all([Xt(e,`${de}/header?format=json`),li(e),It(e,`${de}/header/context?format=json`)]);T=Math.max(T??0,me);const Je=Tl(Ne)?.count;if(typeof Je=="number"&&ce>=Je)return[];const Oe=typeof Je=="number"?Math.min(ce+wc,Je):ce+wc,qe=Array.from({length:Math.max(0,Oe-ce)},(yt,en)=>ce+en),Ye=await m0(e,de,qe,typeof Je!="number");if(Ye.length===0)return[];const Ie=await fi(Ye,kl,yt=>It(e,`/v1/tx/${yt.hash}/details?format=json`));return Ye.map((yt,en)=>{const _n=Ie[en],er=Sc(yt,[],R,{blockHeight:ge.height,blockHash:ge.hash,tipHeight:me,timestamp:ge.timestamp},typeof _n?.fee=="number"?_n.fee:void 0);return Ec(er,_n)})},async getTransaction($){const ce=await Xt(e,`/v1/tx/${$}?format=json`),de=mj(e),ge=fi(ce.inputs,kl,Ye=>/^0{64}$/u.test(Ye.point.hash)?Promise.resolve(null):de(Ye.point.hash,Ye.point.index)),[me,Ne,Je,Oe]=await Promise.all([It(e,`/v1/tx/${$}/header?format=json`),li(e).catch(()=>null),It(e,`/v1/tx/${$}/details?format=json`),ge]);typeof Ne=="number"&&(T=Math.max(T??0,Ne));const qe=Sc(ce,Oe,R,{blockHeight:me?.height,blockHash:me?.hash,tipHeight:typeof Ne=="number"?Ne:void 0,timestamp:me?.timestamp},typeof Je?.fee=="number"?Je.fee:void 0);return Ec(qe,Je)},async getTransactionHeader($){const ce=await Xt(e,`/v1/tx/${$}?format=json`),[de,ge,me]=await Promise.all([It(e,`/v1/tx/${$}/header?format=json`),li(e).catch(()=>null),It(e,`/v1/tx/${$}/details?format=json`)]);typeof ge=="number"&&(T=Math.max(T??0,ge));const Ne=Sc(ce,[],R,{blockHeight:de?.height,blockHash:de?.hash,tipHeight:typeof ge=="number"?ge:void 0,timestamp:de?.timestamp},typeof me?.fee=="number"?me.fee:void 0);return Ec(Ne,me)},async getTransactionInputScriptHex($,ce){return(await Xt(e,`/v1/input/${$}/${String(ce)}/script?format=text`)).trim()},async getTransactionOutputScriptHex($,ce){return(await Xt(e,`/v1/output/${$}/${String(ce)}/script?format=text`)).trim()},getTransactionOutputSpends($,ce){return fi(ce,yx,async de=>{try{const ge=await gx(e,$,de);return ge===null?{outputIndex:de,status:"unspent"}:!dx(ge.hash)||ge.index>4294967295?{outputIndex:de,status:"unknown"}:{outputIndex:de,status:"spent",txid:ge.hash.toLowerCase(),inputIndex:ge.index}}catch{return{outputIndex:de,status:"unknown"}}})},async getAddress($){const ce=Ka($,R);if(!ce)throw new Error("Unsupported address format for libbitcoin adapter");const de=q??await B();if(!Q(de))throw new Error("Address endpoints are disabled by server configuration");const ge=i&&F(de),[me,Ne]=await Promise.all([It(e,`/v1/address/${ce.hash}/balance?format=json`,ge)DELIM" +R"DELIM(),E(ce.hash,ge)]),Je=v0(me,Ne),Oe=await D(ce.hash,ge);return{address:$,addressType:ce.type,balance:Je,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:Ne.length,transactions:Oe}},async getAddressSummary($){const ce=Ka($,R);if(!ce)throw new Error("Unsupported address format for libbitcoin adapter");const de=q??await B();if(!Q(de))throw new Error("Address endpoints are disabled by server configuration");const ge=i&&F(de),[me,Ne]=await Promise.all([It(e,`/v1/address/${ce.hash}/balance?format=json`,ge),E(ce.hash,ge)]),Je=v0(me,Ne);return{address:$,addressType:ce.type,balance:Je,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:Ne.length}},async getAddressUtxos($){const ce=Ka($,R);if(!ce)throw new Error("Unsupported address format for libbitcoin adapter");const de=q??await B();if(!Q(de))throw new Error("Address endpoints are disabled by server configuration");const ge=i&&F(de);return(await E(ce.hash,ge)).map(Ne=>({txid:Ne.point.hash,outputIndex:Ne.point.index,valueSats:Ne.value,status:"confirmed"}))},async getAddressTransactions($,ce){const de=Ka($,R);if(!de)return[];const ge=q??await B();if(!Q(ge))return[];const me=i&&F(ge);return D(de.hash,me,ce)},subscribeToEvents($){return we(),o.add($),ye(),()=>{o.delete($),_t()}},getEventStatus:ue,subscribeToEventStatus($){return s.add($),$(ue()),()=>{s.delete($)}}}}const vx=_.createContext(null),bx=_.createContext(null),xx=_.createContext(null);function xj({children:e,client:a}){return y.jsx(vx.Provider,{value:a,children:e})}function Sj({children:e,provider:a,setProvider:i,availableProviders:o,selectorVisible:s,setSelectorVisible:c}){return y.jsx(bx.Provider,{value:{provider:a,setProvider:i,availableProviders:o,selectorVisible:s,setSelectorVisible:c},children:e})}function wj({children:e,turbo:a,setTurbo:i}){return y.jsx(xx.Provider,{value:{turbo:a,setTurbo:i},children:e})}function Wa(){const e=_.useContext(vx);if(!e)throw new Error("BlockchainClientProvider missing in component tree");return e}function Eo(){return Wa().metadata}function Sx(){const e=_.useContext(bx);if(!e)throw new Error("ProviderSwitcherProvider missing in component tree");return e}function wx(){const e=_.useContext(xx);if(!e)throw new Error("TurboProvider missing in component tree");return e}function Pd(){const e=globalThis.window;return e?.location.origin?e.location.origin:"http://localhost:8080"}function Ej(e,a){if(e==="blockstream")return ex({baseUrl:"https://blockstream.info/api"});if(e==="mempool")return kR({baseUrl:"https://mempool.space/api"});if(e==="libbitcoin"){const o=Pd();return Zd({baseUrl:o,turbo:a?.turboEnabled})}if(e==="external"){console.warn("No external API URL provided, falling back to libbitcoin provider");const o=Pd();return Zd({baseUrl:o,turbo:a?.turboEnabled})}console.warn(`Unknown provider "${e}", falling back to libbitcoin provider`);const i=Pd();return Zd({baseUrl:i,turbo:a?.turboEnabled})}function _j(){return[...new Set(["libbitcoin","blockstream","mempool"])]}const qd=10,Tj=20;function Ex(e){return e.metadata.endpoint?{providerId:e.metadata.id,endpoint:e.metadata.endpoint}:{providerId:e.metadata.id}}function _x(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 b0(e){return JSON.stringify([e.providerId,e.endpoint??null])}function Rj(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 jj(e,a,i){const o=e.getQueryCache().findAll({predicate:s=>{const c=s.queryKey;return c.length>=4&&_x(c[0],a)&&c[1]==="blocks"&&c[2]==="latest"}});for(const s of o){const c=Rj(s.queryKey[3],qd);e.setQueryData(s.queryKey,u=>[i,...(u??[]).filter(p=>p.hash!==i.hash)].slice(0,c))}e.setQueryData([a,"blocks","latest",{limit:qd}],s=>[i,...(s??[]).filter(d=>d.hash!==i.hash)].slice(0,qd))}function Nj(e,a,i){e.setQueryData([a,"transactions","recent"],o=>[i,...(o??[]).filter(u=>u.txid!==i.txid)].slice(0,Tj))}function kj(e,a){if(!_x(e.queryKey[0],a))return!1;const i=e.meta;if(i?.blockRefresh==="always")return!0;if(i?.blockRefresh!=="while-unconfirmed")return!1;const o=e.state.data;return!o||typeof o!="object"||Array.isArray(o)?!0:o.status!=="confirmed"}function Aj(e,a){return e.invalidateQueries({predicate:i=>kj(i,a),refetchType:"active"})}function zj(e,a,i){i.type==="block.new"&&jj(e,a,i.payload),i.type==="tx.new"&&Nj(e,a,i.payload)}function dn({queryKey:e,queryFn:a,enabled:i,retry:o,staleTime:s,initialData:c,blockRefresh:u}){const d=Wa();return CE({queryKey:[Ex(d),...e],queryFn:()=>a(d),enabled:i,...o===void 0?{}:{retry:o},staleTime:s,initialData:c,meta:u?{blockRefresh:u}:void 0})}function Tx(e=10){return dn({queryKey:["blocks","latest",{limit:e}],queryFn:a=>a.getLatestBlocks(e)})}function Rx(){return dn({queryKey:["configuration"],queryFn:e=>e.getConfiguration(),staleTime:6e4})}function am(e,a){return dn({queryKey:["block",e,"header"],queryFn:i=>i.getBlockHeader(e),enabled:(a?.enabled??!0)&&!!e.trim(),retry:a?.retry})}function jx(e,a){return dn({queryKey:["block",e,"stats"],queryFn:i=>i.getBlockStats(e),enabled:(a?.enabled??!0)&&!!e.trim(),staleTime:1/0})}function Cj(e,a){return dn({queryKey:["block",e,"validation"],queryFn:i=>i.getBlockValidation(e),enabled:(a?.enabled??!0)&&!!e.trim(),blockRefresh:"always"})}function Mj(e,a=0){return dn({queryKey:["block",e,"transactions",{startIndex:a}],queryFn:i=>i.getBlockTransactions(e,a)})}function Nx(e,a){return dn({queryKey:["transaction",e,"header"],queryFn:i=>i.getTransactionHeader(e),enabled:(a?.enabled??!0)&&!!e.trim(),retry:a?.retry,blockRefresh:"while-unconfirmed"})}function Oj(e,a){return dn({queryKey:["transaction",e],queryFn:i=>i.getTransaction(e),enabled:a?.enabled??!!e.trim(),blockRefresh:"while-unconfirmed"})}function Dj(e,a,i){return dn({queryKey:["transaction",e,"input",a,"scriptHex"],queryFn:o=>o.getTransactionInputScriptHex(e,a),enabled:(i?.enabled??!0)&&!!e.trim()})}function Lj(e,a,i){return dn({queryKey:["transaction",e,"output",a,"scriptHex"],queryFn:o=>o.getTransactionOutputScriptHex(e,a),enabled:(i?.enabled??!0)&&!!e.trim()})}function Bj(e){return dn({queryKey:["address",e,"summary"],queryFn:a=>a.getAddressSummary(e),enabled:!!e.trim(),blockRefresh:"always"})}function Uj(e,a){return dn({queryKey:["transaction",e,"outputSpends",a],queryFn:i=>i.getTransactionOutputSpends(e,a),enabled:!!e.trim()&&a.length>0,blockRefresh:"always"})}function $j(e){return dn({queryKey:["address",e,"utxos"],queryFn:a=>a.getAddressUtxos(e),enabled:!!e.trim(),blockRefresh:"always"})}function Hj(e,a){return dn({queryKey:["address",e,"transactions",{lastSeenTxid:null}],queryFn:i=>i.getAddressTransactions(e,a),enabled:!!e.trim(),blockRefresh:"always"})}function Zj(e){const a=Wa(),i=_.useRef(e);_.useEffect(()=>{i.current=e},[e]),_.useEffect(()=>{const o=a.subscribeToEvents(s=>{i.current(s)});return()=>{o()}},[a])}function Pj(){const e=Wa(),a=_.useMemo(()=>({transport:e.metadata.supportsWebsocket?"websocket":"polling",websocketAvailable:e.metadata.supportsWebsocket}),[e.metadata.supportsWebsocket]),[i,o]=_.useState(()=>e.getEventStatus?e.getEventStatus():a);return _.useEffect(()=>{const s=e.getEventStatus?e.getEventStatus():a;return o(s),e.subscribeToEventStatus?.(o)},[e,a]),i}function qj(){const e=Wa(),a=_.useMemo(()=>Ex(e),[e]),i=au(),o=_.useRef(new Map),s=_.useRef(new Map),c=_.useCallback(d=>{const m=b0(d);let p=s.current.get(m);if(p||(p={dirty:!1,running:null},s.current.set(m,p)),p.dirty=!0,p.running)return;const b=async()=>{for(;p.dirty;)p.dirty=!1,await Aj(i,d)};p.running=b().finally(()=>{p.running=null,p.dirty||s.current.delete(m)})},[i]),u=_.useCallback(d=>{if(zj(i,a,d),d.type!=="block.new")return;const m=b0(a);o.current.get(m)!==d.payload.hash&&(o.current.set(m,d.payload.hash),c(a))},[i,a,c]);return Zj(u),null}function Fj(e=10){const{data:a,isLoading:i,isError:o,error:s}=Tx(e),{data:c=[]}=dn({queryKey:["transactions","recent"],queryFn:()=>Promise.resolve([]),enabled:!1,initialData:[]});return{data:a,recentTran)DELIM" +R"DELIM(sactions:c,isLoading:i,isError:o,error:s}}function Fd(e){return globalThis.window?.localStorage.getItem(e)??null}function Qd(e,a){globalThis.window?.localStorage.setItem(e,a)}function Qj({children:e}){const a="libbitcoin",i=_j(),[o,s]=_.useState(()=>Fd("turboEnabled")==="true"),[c,u]=_.useState(()=>{const g=Fd("blockchainProvider");return g&&i.includes(g)?g:a}),[d,m]=_.useState(()=>Fd("providerSelectorVisible")==="true"),[p]=_.useState(()=>new bE({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}})),b=_.useMemo(()=>Ej(c,{turboEnabled:o}),[c,o]);return _.useEffect(()=>{Qd("turboEnabled",o?"true":"false")},[o]),_.useEffect(()=>{Qd("blockchainProvider",c)},[c]),_.useEffect(()=>{Qd("providerSelectorVisible",d?"true":"false")},[d]),y.jsx(Sj,{provider:c,setProvider:u,availableProviders:i,selectorVisible:d,setSelectorVisible:m,children:y.jsx(wj,{turbo:o,setTurbo:s,children:y.jsx(xj,{client:b,children:y.jsxs(xE,{client:p,children:[y.jsx(qj,{}),e,null]})})})})}var kx=e=>{throw TypeError(e)},Ax=(e,a,i)=>a.has(e)||kx("Cannot "+i),Kn=(e,a,i)=>(Ax(e,a,"read from private field"),i?i.call(e):a.get(e)),Rl=(e,a,i)=>a.has(e)?kx("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(e):a.set(e,i),ga=(e,a,i,o)=>(Ax(e,a,"write to private field"),a.set(e,i),i),cu=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,rm=/^[\\/]{2}/;function zx(e,a){return a+e.replace(/\\/g,"/")}var Cx=(e=>(e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE",e))(Cx||{}),x0="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 Yj(e={}){function a(o,s){let c=s.state?.masked,{pathname:u,search:d,hash:m}=c||o.location;return Hl("",{pathname:u,search:d,hash:m},s.state&&s.state.usr||null,s.state&&s.state.key||"default",c?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function i(o,s){return typeof s=="string"?s:xa(s)}return Vj(a,i,null,e)}function Be(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function wt(e,a){if(!e){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function Gj(){return Math.random().toString(36).substring(2,10)}function w0(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 Hl(e,a,i=null,o,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof a=="string"?wa(a):a,state:i,key:a&&a.key||o||Gj(),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 wa(e){let a={};if(e){let i=e.indexOf("#");i>=0&&(a.hash=e.substring(i),e=e.substring(0,i));let o=e.indexOf("?");o>=0&&(a.search=e.substring(o),e=e.substring(0,o)),e&&(a.pathname=e)}return a}function Vj(e,a,i,o={}){let{window:s=document.defaultView,v5Compat:c=!1}=o,u=s.history,d="POP",m=null,p=b();p==null&&(p=0,u.replaceState({...u.state,idx:p},""));function b(){return(u.state||{idx:null}).idx}function g(){d="POP";let R=b(),q=R==null?null:R-p;p=R,m&&m({action:d,location:z.location,delta:q})}function x(R,q){d="PUSH";let G=S0(R)?R:Hl(z.location,R,q);p=b()+1;let J=w0(G,p),oe=z.createHref(G.mask||G);try{u.pushState(J,"",oe)}catch(ee){if(ee instanceof DOMException&&ee.name==="DataCloneError")throw ee;s.location.assign(oe)}c&&m&&m({action:d,location:z.location,delta:1})}function w(R,q){d="REPLACE";let G=S0(R)?R:Hl(z.location,R,q);p=b();let J=w0(G,p),oe=z.createHref(G.mask||G);u.replaceState(J,"",oe),c&&m&&m({action:d,location:z.location,delta:0})}function T(R){return Mx(s,R)}let z={get action(){return d},get location(){return e(s,u)},listen(R){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(x0,g),m=R,()=>{s.removeEventListener(x0,g),m=null}},createHref(R){return a(s,R)},createURL:T,encodeLocation(R){let q=T(R);return{pathname:q.pathname,search:q.search,hash:q.hash}},push:x,replace:w,go(R){return u.go(R)}};return z}function Mx(e,a,i=!1){let o="http://localhost";e&&(o=e.location.origin!=="null"?e.location.origin:e.location.href),Be(o,"No window.location.(origin|href) available to create URL");let s=typeof a=="string"?a:xa(a);return s=s.replace(/ $/,"%20"),!i&&rm.test(s)&&(s=o+s),new URL(s,o)}var jl,E0=class{constructor(e){if(Rl(this,jl,new Map),e)for(let[a,i]of e)this.set(a,i)}get(e){if(Kn(this,jl).has(e))return Kn(this,jl).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,a){Kn(this,jl).set(e,a)}};jl=new WeakMap;var Kj=new Set(["lazy","caseSensitive","path","id","index","children"]);function Ij(e){return Kj.has(e)}var Xj=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Jj(e){return Xj.has(e)}function Wj(e){return e.index===!0}function Zl(e,a,i=[],o={},s=!1){return e.map((c,u)=>{let d=[...i,String(u)],m=typeof c.id=="string"?c.id:d.join("-");if(Be(c.index!==!0||!c.children,"Cannot specify children on an index route"),Be(s||!o[m],`Found a route id collision on id "${m}". Route id's must be globally unique within Data Router usages`),Wj(c)){let p={...c,id:m};return o[m]=_0(p,a(p)),p}else{let p={...c,id:m,children:void 0};return o[m]=_0(p,a(p)),c.children&&(p.children=Zl(c.children,a,d,o,s)),p}})}function _0(e,a){return Object.assign(e,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...e.lazy,...a.lazy}}:{}})}function Ox(e,a,i="/"){return ca(e,a,i,!1)}function ca(e,a,i,o,s){let c=typeof a=="string"?wa(a):a,u=Bn(c.pathname||"/",i);if(u==null)return null;let d=s??Bc(e),m=null,p=uN(u);for(let b=0;m==null&&b{let b={relativePath:p===void 0?u.path||"":p,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(o)&&m)return;Be(b.relativePath.startsWith(o),`Absolute route path "${b.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(o.length)}let g=Xn([o,b.relativePath]),x=i.concat(b);u.children&&u.children.length>0&&(Be(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),Lx(u.children,a,x,g,m)),!(u.path==null&&!u.index)&&a.push({path:g,score:lN(g,u.index),routesMeta:x.map((w,T)=>{let[z,R]=$x(w.relativePath,w.caseSensitive,T===x.length-1);return{...w,matcher:z,compiledParams:R}})})};return e.forEach((u,d)=>{if(u.path===""||!u.path?.includes("?"))c(u,d);else for(let m of Bx(u.path))c(u,d,!0,m)}),a}function Bx(e){let a=e.split("/");if(a.length===0)return[];let[i,...o]=a,s=i.endsWith("?"),c=i.replace(/\?$/,"");if(o.length===0)return s?[c,""]:[c];let u=Bx(o.join("/")),d=[];return d.push(...u.map(m=>m===""?c:[c,m].join("/"))),s&&d.push(...u),d.map(m=>e.startsWith("/")&&m===""?"/":m)}function eN(e){e.sort((a,i)=>a.score!==i.score?i.score-a.score:sN(a.routesMeta.map(o=>o.childrenIndex),i.routesMeta.map(o=>o.childrenIndex)))}var tN=/^:[\w-]+$/,nN=3,aN=2,rN=1,iN=10,oN=-2,T0=e=>e==="*";function lN(e,a){let i=e.split("/"),o=i.length;return i.some(T0)&&(o+=oN),a&&(o+=aN),i.filter(s=>!T0(s)).reduce((s,c)=>s+(tN.test(c)?nN:c===""?rN:iN),o)}function sN(e,a){return e.length===a.length&&e.slice(0,-1).every((o,s)=>o===a[s])?e[e.length-1]-a[a.length-1]:0}function cN(e,a,i=!1){let{routesMeta:o}=e,s={},c="/",u=[];for(let d=0;d{if(b==="*"){let T=d[x]||"";u=c.slice(0,c.length-T.length).replace(/(.)\/+$/,"$1")}const w=d[x];return g&&!w?p[b]=void 0:p[b]=(w||"").replace(/%2F/g,"/"),p},{}),pathname:c,pathnameBase:u,pattern:e}}function $x(e,a=!1,i=!0){wt(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 o=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,d,m,p,b)=>{if(o.push({paramName:d,isOptional:m!=null}),m){let g=b.charAt(p+u.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(o.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,a?void 0:"i"),o]}function uN(e){try{return e.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return wt(!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 Bn(e,a){if(a==="/")return e;if(!e.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,o=e.charAt(i);return o&&o!=="/"?null:e.slice(i)||"/"}function fN({basename:e,pathname:a}){return a==="/"?e:Xn([e,a])}var im=e=>cu.test(e);function dN(e,a="/"){let{pathname:i,search:o="",hash:s=""}=typeof e=="string"?wa(e):e,c;return i?(i=om(i),i.startsWith("/")?c=R0(i.substring(1),"/"):c=R0(i,a)):c=a,{pathname:c,search:mN(o),hash:pN(s)}}function R0(e,a){let i=eu(a).split("/");return e.split("/").forEach(s=>{s===".."?i.length>1&&i.pop():s!=="."&&i.push(s)}),i.length>1?i.join("/"):"/"}function Yd(e,a,i,o){return`Cannot include a '${e}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. 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 Hx(e){return e.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function uu(e){let a=Hx(e);return a.map((i,o)=>o===a.length-1?i.pathname:i.pathnameBase)}function Il(e,a,i,o=!1){let s;typeof e=="string"?s=wa(e):(s={...e},Be(!s.pathname||!s.pathname.includes("?"),Yd("?","pathname","search",s)),Be(!s.pathname||!s.pathname.includes("#"),Yd("#","pathname","hash",s)),Be(!s.search||!s.search.includes("#"),Yd("#","search","hash",s)));let c=e===""||s.pathname==="",u=c?"/":s.pathname,d;if(u==null)d=i;else{let g=a.length-1;if(!o&&u.startsWith("..")){let x=u.split("/");for(;x[0]==="..";)x.shift(),g-=1;s.pathname=x.join("/")}d=g>=0?a[g]:"/"}let m=dN(s,d),p=u&&u!=="/"&&u.endsWith("/"),b=(c||u===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(p||b)&&(m.pathname+="/"),m}var om=e=>e.replace(/[\\/]{2,}/g,"/"),Xn=e=>om(e.join("/")),eu=e=>e.replace(/\/+$/,""),hN=e=>eu(e).replace(/^\/*/,"/"),mN=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,pN=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,yN=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Xl=class{constructor(e,a,i,o=!1){this.status=e,this.statusText=a||"",this.internal=o,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Pl(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Jl(e){let a=e.map(i=>i.route.path).filter(Boolean);return Xn(a)||"/"}var Zx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Px(e,a){let i=e;if(typeof i!="string"||!cu.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let o=i,s=!1;if(Zx)try{let c=new URL(window.location.href),u=rm.test(i)?new URL(zx(i,c.protocol)):new URL(i),d=Bn(u.pathname,a);u.origin===c.origin&&d!=null?i=d+u.search+u.hash:s=!0}catch{wt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:s,to:i}}var Lr=Symbol("Uninstrumented");function gN(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(c){let u=Object.keys(i);for(let d of u)c[d]&&i[d].push(c[d])}}));let o={};if(typeof a.lazy=="function"&&i.lazy.length>0){let s=uo(i.lazy,a.lazy,()=>{});s&&(o.lazy=s)}if(typeof a.lazy=="object"){let s=a.lazy;["middleware","loader","action"].forEach(c=>{let u=s[c],d=i[`lazy.${c}`];if(typeof u=="function"&&d.length>0){let m=uo(d,u,()=>{});m&&(o.lazy=Object.assign(o.lazy||{},{[c]:m}))}})}return["loader","action"].forEach(s=>{let c=a[s];if(typeof c=="function"&&i[s].length>0){let u=c[Lr]??c,d=uo(i[s],u,(...m)=>j0(m[0]));d&&(s==="loader"&&u.hydrate===!0&&(d.hydrate=!0),d[Lr]=u,o[s]=d)}}),a.middleware&&a.middleware.length>0&&i.middleware.length>0&&(o.middleware=a.middleware.map(s=>{let c=s[Lr]??s,u=uo(i.middleware,c,(...d)=>j0(d[0]));return u?(u[Lr]=c,u):s})),o}function vN(e,a){let i={navigate:[],fetch:[]};if(a.forEach(o=>o({instrument(s){let c=Object.keys(s);for(let u of c)s[u]&&i[u].push(s[u])}})),i.navigate.length>0){let o=e.navigate[Lr]??e.navigate,s=uo(i.navigate,o,(...c)=>{let[u,d]=c;return{to:typeof u=="number"||typeof u=="string"?u:u?xa(u):".",...N0(e,d??{})}});s&&(s[Lr]=o,e.navigate=s)}if(i.fetch.length>0){let o=e.fetch[Lr]??e.fetch,s=uo(i.fetch,o,(...c)=>{let[u,,d,m]=c;return{href:d??".",fetcherKey:u,...N0(e,m??{})}});s&&(s[Lr]=o,e.fetch=s)}return e}function uo(e,a,i){return e.length===0?null:async(...o)=>{let s=await qx(e,i(...o),()=>a(...o),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function qx(e,a,i,o){let s=e[o],c;if(s){let u,d=async()=>(u?console.error("You cannot call instrumented handlers more than once"):u=qx(e,a,i,o-1),c=await u,Be(c,"Expected a result"),c.type==="error"&&c.value instanceof Error?{status:"error",error:c.value}:{status:"success",error:void 0});try{await s(d,a)}catch(m){console.error("An instrumentation function threw an error:",m)}u||await d(),await u}else try{c={type:"success",value:await i()}}catch(u){c={type:"error",value:u}}return c||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function j0(e){let{request:a,context:i,params:o,pattern:s}=e;return{request:bN(a),params:{...o},pattern:s,context:xN(i)}}function N0(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 bN(e){return{method:e.method,url:e.url,headers:{get:(...a)=>e.headers.get(...a)}}}function xN(e){if(wN(e)){let a={...e};return Object.freeze(a),a}else return{get:a=>e.get(a)}}var SN=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function wN(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")===SN}var Fx=["POST","PUT","PATCH","DELETE"],EN=new Set(Fx),_N=["GET",...Fx],TN=new Set(_N),Qx=new Set([301,302,303,307,308]),RN=new Set([307,308]),Gd={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,)DELIM" +R"DELIM(text:void 0},jN={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},xl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},NN=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Yx="remix-router-transitions",Gx=Symbol("ResetLoaderData"),si,io,Cr,oo,kN=class{constructor(e){Rl(this,si),Rl(this,io),Rl(this,Cr),Rl(this,oo),ga(this,si,e),ga(this,io,Bc(e))}get stableRoutes(){return Kn(this,si)}get activeRoutes(){return Kn(this,Cr)??Kn(this,si)}get branches(){return Kn(this,oo)??Kn(this,io)}get hasHMRRoutes(){return Kn(this,Cr)!=null}setRoutes(e){ga(this,si,e),ga(this,io,Bc(e))}setHmrRoutes(e){ga(this,Cr,e),ga(this,oo,Bc(e))}commitHmrRoutes(){Kn(this,Cr)&&(ga(this,si,Kn(this,Cr)),ga(this,io,Kn(this,oo)),ga(this,Cr,void 0),ga(this,oo,void 0))}};si=new WeakMap;io=new WeakMap;Cr=new WeakMap;oo=new WeakMap;function AN(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 o=e.hydrationRouteProperties||[],s=e.mapRouteProperties||NN,c=s;if(e.instrumentations){let N=e.instrumentations;c=L=>({...s(L),...gN(N.map(P=>P.route).filter(Boolean),L)})}let u={},d=new kN(Zl(e.routes,c,void 0,u)),m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let p=e.dataStrategy||DN,b={...e.future},g=null,x=new Set,w=null,T=null,z=null,R=null,q=e.hydrationData!=null,G=ca(d.activeRoutes,e.history.location,m,!1,d.branches),J=!1,oe=null,ee,be;if(G==null&&!e.patchRoutesOnNavigation){let N=In(404,{pathname:e.history.location.pathname}),{matches:L,route:P}=Tc(d.activeRoutes);ee=!0,be=!ee,G=L,oe={[P.id]:N}}else if(G&&!e.hydrationData&&nr(G,d.activeRoutes,e.history.location.pathname).active&&(G=null),G)if(G.some(N=>N.route.lazy))ee=!1,be=!ee;else if(!G.some(N=>lm(N.route)))ee=!0,be=!ee;else{let N=e.hydrationData?e.hydrationData.loaderData:null,L=e.hydrationData?e.hydrationData.errors:null,P=G;if(L){let ie=G.findIndex(se=>L[se.route.id]!==void 0);P=P.slice(0,ie+1)}be=!1,ee=!0,P.forEach(ie=>{let se=Vx(ie.route,N,L);be=be||se.renderFallback,ee=ee&&!se.shouldLoad})}else{ee=!1,be=!ee,G=[];let N=nr(null,d.activeRoutes,e.history.location.pathname);N.active&&N.matches&&(J=!0,G=N.matches)}let A,E={historyAction:e.history.action,location:e.history.location,matches:G,initialized:ee,renderFallback:be,navigation:Gd,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,F,ue=!1,he=new Map,pe=null,O=!1,M=!1,re=new Set,fe=new Map,we=0,k=-1,K=new Map,I=new Set,le=new Map,W=new Map,ye=new Set,ze=new Map,_t,$=null;function ce(){if(g=e.history.listen(({action:N,location:L,delta:P})=>{if(_t){_t(),_t=void 0;return}wt(ze.size===0||P!=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=Fr({currentLocation:E.location,nextLocation:L,historyAction:N});if(ie&&P!=null){let se=new Promise(Ee=>{_t=Ee});e.history.go(P*-1),Ra(ie,{state:"blocked",location:L,proceed(){Ra(ie,{state:"proceeding",proceed:void 0,reset:void 0,location:L}),se.then(()=>e.history.go(P))},reset(){let Ee=new Map(E.blockers);Ee.set(ie,xl),me({blockers:Ee})}}),B?.resolve(),B=null;return}return qe(N,L)}),i){e3(a,he);let N=()=>t3(a,he);a.addEventListener("pagehide",N),pe=()=>a.removeEventListener("pagehide",N)}return E.initialized||qe("POP",E.location,{initialHydration:!0}),A}function de(){g&&g(),pe&&pe(),x.clear(),F&&F.abort(),E.fetchers.forEach((N,L)=>Ta(E.fetchers,L)),E.blockers.forEach((N,L)=>qr(L))}function ge(N){if(x.add(N),w){let{newErrors:L}=w;w=null,N(E,{deletedFetchers:[],newErrors:L,viewTransitionOpts:void 0,flushSync:!1})}return()=>x.delete(N)}function me(N,L={}){N.matches&&(N.matches=N.matches.map(se=>{let Ee=u[se.route.id],ve=se.route;return ve.element!==Ee.element||ve.errorElement!==Ee.errorElement||ve.hydrateFallbackElement!==Ee.hydrateFallbackElement?{...se,route:Ee}:se})),E={...E,...N};let P=[],ie=[];E.fetchers.forEach((se,Ee)=>{se.state==="idle"&&(ye.has(Ee)?P.push(Ee):ie.push(Ee))}),ye.forEach(se=>{!E.fetchers.has(se)&&!fe.has(se)&&P.push(se)}),x.size===0&&(w={newErrors:N.errors??null}),[...x].forEach(se=>se(E,{deletedFetchers:P,newErrors:N.errors??null,viewTransitionOpts:L.viewTransitionOpts,flushSync:L.flushSync===!0})),P.forEach(se=>Ta(E.fetchers,se)),ie.forEach(se=>E.fetchers.delete(se))}function Ne(N,L,{flushSync:P}={}){let ie=E.actionData!=null&&E.navigation.formMethod!=null&&rn(E.navigation.formMethod)&&E.navigation.state==="loading"&&N.state?._isRedirect!==!0,se;L.actionData?Object.keys(L.actionData).length>0?se=L.actionData:se=null:ie?se=E.actionData:se=null;let Ee=L.loaderData?U0(E.loaderData,L.loaderData,L.matches||[],L.errors):E.loaderData,ve=E.blockers;ve.size>0&&(ve=new Map(ve),ve.forEach((Ae,Ue)=>ve.set(Ue,xl)));let Se=O?!1:Ro(N,L.matches||E.matches),xe=Q===!0||E.navigation.formMethod!=null&&rn(E.navigation.formMethod)&&N.state?._isRedirect!==!0;d.commitHmrRoutes(),O||D==="POP"||(D==="PUSH"?e.history.push(N,N.state):D==="REPLACE"&&e.history.replace(N,N.state));let ke;if(D==="POP"){let Ae=he.get(E.location.pathname);Ae&&Ae.has(N.pathname)?ke={currentLocation:E.location,nextLocation:N}:he.has(N.pathname)&&(ke={currentLocation:N,nextLocation:E.location})}else if(ue){let Ae=he.get(E.location.pathname);Ae?Ae.add(N.pathname):(Ae=new Set([N.pathname]),he.set(E.location.pathname,Ae)),ke={currentLocation:E.location,nextLocation:N}}me({...L,actionData:se,loaderData:Ee,historyAction:D,location:N,initialized:!0,renderFallback:!1,navigation:Gd,revalidation:"idle",restoreScrollPosition:Se,preventScrollReset:xe,blockers:ve},{viewTransitionOpts:ke,flushSync:P===!0}),D="POP",Q=!1,ue=!1,O=!1,M=!1,B?.resolve(),B=null,$?.resolve(),$=null}async function Je(N,L){if(B?.resolve(),B=null,typeof N=="number"){B||(B=P0());let tt=B.promise;return e.history.go(N),tt}let P=Rh(E.location,E.matches,m,N,L?.fromRouteId,L?.relative),{path:ie,submission:se,error:Ee}=k0(!1,P,L),ve;L?.mask&&(ve={pathname:"",search:"",hash:"",...typeof L.mask=="string"?wa(L.mask):{...E.location.mask,...L.mask}});let Se=E.location,xe=Hl(Se,ie,L&&L.state,void 0,ve);xe={...xe,...e.history.encodeLocation(xe)};let ke=L&&L.replace!=null?L.replace:void 0,Ae="PUSH";ke===!0?Ae="REPLACE":ke===!1||se!=null&&rn(se.formMethod)&&se.formAction===E.location.pathname+E.location.search&&(Ae="REPLACE");let Ue=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,Me=(L&&L.flushSync)===!0,Ze=Fr({currentLocation:Se,nextLocation:xe,historyAction:Ae});if(Ze){Ra(Ze,{state:"blocked",location:xe,proceed(){Ra(Ze,{state:"proceeding",proceed:void 0,reset:void 0,location:xe}),Je(N,L)},reset(){let tt=new Map(E.blockers);tt.set(Ze,xl),me({blockers:tt})}});return}await qe(Ae,xe,{submission:se,pendingError:Ee,preventScrollReset:Ue,replace:L&&L.replace,enableViewTransition:L&&L.viewTransition,flushSync:Me,callSiteDefaultShouldRevalidate:L&&L.defaultShouldRevalidate})}function Oe(){$||($=P0()),Un(),me({revalidation:"loading"});let N=$.promise;return E.navigation.state==="submitting"?N:E.navigation.state==="idle"?(qe(E.historyAction,E.location,{startUninterruptedRevalidation:!0}),N):(qe(D||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation,enableViewTransition:ue===!0}),N)}async function qe(N,L,P){F&&F.abort(),F=null,D=N,O=(P&&P.startUninterruptedRevalidation)===!0,bu(E.location,E.matches),Q=(P&&P.preventScrollReset)===!0,ue=(P&&P.enableViewTr)DELIM" +R"DELIM(ansition)===!0;let ie=d.activeRoutes,se=P?.initialHydration&&E.matches&&E.matches.length>0&&!J?E.matches:ca(ie,L,m,!1,d.branches),Ee=(P&&P.flushSync)===!0;if(se&&E.initialized&&!M&&FN(E.location,L)&&!(P&&P.submission&&rn(P.submission.formMethod))){Ne(L,{matches:se},{flushSync:Ee});return}let ve=nr(se,ie,L.pathname);if(ve.active&&ve.matches&&(se=ve.matches),!se){let{error:ot,notFoundMatches:We,route:At}=ta(L.pathname);Ne(L,{matches:We,loaderData:{},errors:{[At.id]:ot}},{flushSync:Ee});return}let Se=P&&P.overrideNavigation?{...P.overrideNavigation,matches:se,historyAction:N}:void 0;F=new AbortController;let xe=lo(e.history,L,F.signal,P&&P.submission),ke=e.getContext?await e.getContext():new E0,Ae;if(P&&P.pendingError)Ae=[Dr(se).route.id,{type:"error",error:P.pendingError}];else if(P&&P.submission&&rn(P.submission.formMethod)){let ot=await Ye(xe,L,P.submission,se,N,ke,ve.active,P&&P.initialHydration===!0,{replace:P.replace,flushSync:Ee});if(ot.shortCircuited)return;if(ot.pendingActionResult){let[We,At]=ot.pendingActionResult;if(Dn(At)&&Pl(At.error)&&At.error.status===404){F=null,Ne(L,{matches:ot.matches,loaderData:{},errors:{[We]:At.error}});return}}se=ot.matches||se,Ae=ot.pendingActionResult,Se=Vd(L,se,N,P.submission),Ee=!1,ve.active=!1,xe=lo(e.history,xe.url,xe.signal)}let{shortCircuited:Ue,matches:Me,loaderData:Ze,errors:tt,workingFetchers:vt}=await Ie(xe,L,se,N,ke,ve.active,Se,P&&P.submission,P&&P.fetcherSubmission,P&&P.replace,P&&P.initialHydration===!0,Ee,Ae,P&&P.callSiteDefaultShouldRevalidate);Ue||(F=null,Ne(L,{matches:Me||se,...$0(Ae),loaderData:Ze,errors:tt,...vt?{fetchers:vt}:{}}))}async function Ye(N,L,P,ie,se,Ee,ve,Se,xe={}){Un();let ke=JN(L,ie,se,P);if(me({navigation:ke},{flushSync:xe.flushSync===!0}),ve){let Me=await fa(ie,L.pathname,N.signal);if(Me.type==="aborted")return{shortCircuited:!0};if(Me.type==="error"){if(Me.partialMatches.length===0){let{matches:tt,route:vt}=Tc(d.activeRoutes);return{matches:tt,pendingActionResult:[vt.id,{type:"error",error:Me.error}]}}let Ze=Dr(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:tt,route:vt}=ta(L.pathname);return{matches:Ze,pendingActionResult:[vt.id,{type:"error",error:tt}]}}}let Ae,Ue=Uc(ie,L);if(!Ue.route.action&&!Ue.route.lazy)Ae={type:"error",error:In(405,{method:N.method,pathname:L.pathname,routeId:Ue.route.id})};else{let Me=mo(c,u,N,L,ie,Ue,Se?[]:o,Ee),Ze=await mn(N,L,Me,Ee,null);if(Ae=Ze[Ue.route.id],!Ae){for(let tt of ie)if(Ze[tt.route.id]){Ae=Ze[tt.route.id];break}}if(N.signal.aborted)return{shortCircuited:!0}}if(di(Ae)){let Me;return xe&&xe.replace!=null?Me=xe.replace:Me=D0(Ae.response.headers.get("Location"),new URL(N.url),m,e.history)===E.location.pathname+E.location.search,await ea(N,Ae,!0,{submission:P,replace:Me}),{shortCircuited:!0}}if(Dn(Ae)){let Me=Dr(ie,Ue.route.id);return(xe&&xe.replace)!==!0&&(D="PUSH"),{matches:ie,pendingActionResult:[Me.route.id,Ae,Ue.route.id]}}return{matches:ie,pendingActionResult:[Ue.route.id,Ae]}}async function Ie(N,L,P,ie,se,Ee,ve,Se,xe,ke,Ae,Ue,Me,Ze){let tt=ve||Vd(L,P,ie,Se),vt=Se||xe||Z0(tt),ot=!O&&!Ae;if(Ee){if(ot){let mt=yt(Me);me({navigation:tt,...mt!==void 0?{actionData:mt}:{}},{flushSync:Ue})}let De=await fa(P,L.pathname,N.signal);if(De.type==="aborted")return{shortCircuited:!0};if(De.type==="error"){if(De.partialMatches.length===0){let{matches:Rn,route:ra}=Tc(d.activeRoutes);return{matches:Rn,loaderData:{},errors:{[ra.id]:De.error}}}let mt=Dr(De.partialMatches).route.id;return{matches:De.partialMatches,loaderData:{},errors:{[mt]:De.error}}}else if(De.matches)P=De.matches;else{let{error:mt,notFoundMatches:Rn,route:ra}=ta(L.pathname);return{matches:Rn,loaderData:{},errors:{[ra.id]:mt}}}}let We=d.activeRoutes,{dsMatches:At,revalidatingFetchers:et}=A0(N,se,c,u,e.history,E,P,vt,L,Ae?[]:o,Ae===!0,M,re,ye,le,I,We,m,e.patchRoutesOnNavigation!=null,d.branches,Me,Ze);if(k=++we,!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(E.fetchers),mt=as(De);return Ne(L,{matches:P,loaderData:{},errors:Me&&Dn(Me[1])?{[Me[0]]:Me[1].error}:null,...$0(Me),...mt?{fetchers:De}:{}},{flushSync:Ue}),{shortCircuited:!0}}if(ot){let De={};if(!Ee){De.navigation=tt;let mt=yt(Me);mt!==void 0&&(De.actionData=mt)}et.length>0&&(De.fetchers=en(et)),me(De,{flushSync:Ue})}et.forEach(De=>{Pt(De.key),De.controller&&fe.set(De.key,De.controller)});let ar=()=>et.forEach(De=>Pt(De.key));F&&F.signal.addEventListener("abort",ar);let{loaderResults:na,fetcherResults:pn}=await _a(At,et,N,L,se);if(N.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener("abort",ar),et.forEach(De=>fe.delete(De.key));let sn=Rc(na);if(sn)return await ea(N,sn.result,!0,{replace:ke}),{shortCircuited:!0};if(sn=Rc(pn),sn)return I.add(sn.key),await ea(N,sn.result,!0,{replace:ke}),{shortCircuited:!0};let Hn=new Map(E.fetchers),{loaderData:vi,errors:aa}=B0(E,P,na,Me,et,pn,Hn);Ae&&E.errors&&(aa={...E.errors,...aa});let bi=as(Hn),ja=rs(k,Hn),Na=bi||ja||et.length>0;return{matches:P,loaderData:vi,errors:aa,...Na?{workingFetchers:Hn}:{}}}function yt(N){if(N&&!Dn(N[1]))return{[N[0]]:N[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function en(N){let L=new Map(E.fetchers);return N.forEach(P=>{let ie=L.get(P.key),se=Sl(void 0,ie?ie.data:void 0);L.set(P.key,se)}),L}async function _n(N,L,P,ie){Pt(N);let se=(ie&&ie.flushSync)===!0,Ee=d.activeRoutes,ve=Rh(E.location,E.matches,m,P,L,ie?.relative),Se=ca(Ee,ve,m,!1,d.branches),xe=nr(Se,Ee,ve);if(xe.active&&xe.matches&&(Se=xe.matches),!Se){$n(N,L,In(404,{pathname:ve}),{flushSync:se});return}let{path:ke,submission:Ae,error:Ue}=k0(!0,ve,ie);if(Ue){$n(N,L,Ue,{flushSync:se});return}let Me=e.getContext?await e.getContext():new E0,Ze=(ie&&ie.preventScrollReset)===!0;if(Ae&&rn(Ae.formMethod)){await er(N,L,ke,Se,Me,xe.active,se,Ze,Ae,ie&&ie.defaultShouldRevalidate);return}le.set(N,{routeId:L,path:ke}),await Qt(N,L,ke,Se,Me,xe.active,se,Ze,Ae)}async function er(N,L,P,ie,se,Ee,ve,Se,xe,ke){Un(),le.delete(N);let Ae=E.fetchers.get(N);Tn(N,WN(xe,Ae),{flushSync:ve});let Ue=new AbortController,Me=lo(e.history,P,Ue.signal,xe);if(Ee){let lt=await fa(ie,new URL(Me.url).pathname,Me.signal,N);if(lt.type==="aborted")return;if(lt.type==="error"){$n(N,L,lt.error,{flushSync:ve});return}else if(lt.matches)ie=lt.matches;else{$n(N,L,In(404,{pathname:P}),{flushSync:ve});return}}let Ze=Uc(ie,P);if(!Ze.route.action&&!Ze.route.lazy){let lt=In(405,{method:xe.formMethod,pathname:P,routeId:L});$n(N,L,lt,{flushSync:ve});return}fe.set(N,Ue);let tt=we,vt=mo(c,u,Me,P,ie,Ze,o,se),ot=await mn(Me,P,vt,se,N),We=ot[Ze.route.id];if(!We){for(let lt of vt)if(ot[lt.route.id]){We=ot[lt.route.id];break}}if(Me.signal.aborted){fe.get(N)===Ue&&fe.delete(N);return}if(ye.has(N)){if(di(We)||Dn(We)){Tn(N,ba(void 0));return}}else{if(di(We))if(fe.delete(N),k>tt){Tn(N,ba(void 0));return}else return I.add(N),Tn(N,Sl(xe)),ea(Me,We,!1,{fetcherSubmission:xe,preventScrollReset:Se});if(Dn(We)){$n(N,L,We.error);return}}let At=E.navigation.location||E.location,et=lo(e.history,At,Ue.signal),ar=d.activeRoutes,na=E.navigation.state!=="idle"?ca(ar,E.navigation.location,m,!1,d.branches):E.matches;Be(na,"Didn't find any matches after fetcher action");let pn=++we;K.set(N,pn);let{dsMatches:sn,revalidatingFetchers:Hn}=A0(et,se,c,u,e.history,E,na,xe,At,o,!1,M,re,ye,le,I,ar,m,e.patchRoutesOnNavigation!=null,d.branches,[Ze.route.id,We],ke),vi=Sl(xe,We.data),aa=new Map(E.fetchers);aa.set(N,vi),Hn.filter(lt=>lt.key!==N).forEach(lt=>{let ka=lt.key,cn=aa.get(ka),jo=Sl(void 0,cn?cn.data:void 0);aa.set(ka,jo),Pt(ka),lt.controller&&fe.set(ka,lt.controller)}),me({fetchers:aa});let bi=()=>Hn.forEach(lt=>Pt(lt.key));Ue.signal.addEventListener("abort",bi);let{loaderResults:ja,fetcherResults:Na}=await _a(sn,Hn,et,At,se);if(Ue.signal.aborted)return;Ue.signal.removeEventListener("abort",bi),K.dele)DELIM" +R"DELIM(te(N),fe.delete(N),Hn.forEach(lt=>fe.delete(lt.key));let De=E.fetchers.has(N),mt=lt=>{if(!De)return lt;let ka=new Map(lt.fetchers);return ka.set(N,ba(We.data)),{...lt,fetchers:ka}},Rn=Rc(ja);if(Rn)return E=mt(E),ea(et,Rn.result,!1,{preventScrollReset:Se});if(Rn=Rc(Na),Rn)return I.add(Rn.key),E=mt(E),ea(et,Rn.result,!1,{preventScrollReset:Se});let ra=new Map(E.fetchers);De&&ra.set(N,ba(We.data));let{loaderData:xi,errors:Si}=B0(E,na,ja,void 0,Hn,Na,ra);rs(pn,ra),E.navigation.state==="loading"&&pn>k?(Be(D,"Expected pending action"),F&&F.abort(),Ne(E.navigation.location,{matches:na,loaderData:xi,errors:Si,fetchers:ra})):(me({errors:Si,loaderData:U0(E.loaderData,xi,na,Si),fetchers:ra}),M=!1)}async function Qt(N,L,P,ie,se,Ee,ve,Se,xe){let ke=E.fetchers.get(N);Tn(N,Sl(xe,ke?ke.data:void 0),{flushSync:ve});let Ae=new AbortController,Ue=lo(e.history,P,Ae.signal);if(Ee){let We=await fa(ie,new URL(Ue.url).pathname,Ue.signal,N);if(We.type==="aborted")return;if(We.type==="error"){$n(N,L,We.error,{flushSync:ve});return}else if(We.matches)ie=We.matches;else{$n(N,L,In(404,{pathname:P}),{flushSync:ve});return}}let Me=Uc(ie,P);fe.set(N,Ae);let Ze=we,tt=mo(c,u,Ue,P,ie,Me,o,se),vt=await mn(Ue,P,tt,se,N),ot=vt[Me.route.id];if(!ot){for(let We of ie)if(vt[We.route.id]){ot=vt[We.route.id];break}}if(fe.get(N)===Ae&&fe.delete(N),!Ue.signal.aborted){if(ye.has(N)){Tn(N,ba(void 0));return}if(di(ot))if(k>Ze){Tn(N,ba(void 0));return}else{I.add(N),await ea(Ue,ot,!1,{preventScrollReset:Se});return}if(Dn(ot)){$n(N,L,ot.error);return}Tn(N,ba(ot.data))}}async function ea(N,L,P,{submission:ie,fetcherSubmission:se,preventScrollReset:Ee,replace:ve}={}){P||(B?.resolve(),B=null),L.response.headers.has("X-Remix-Revalidate")&&(M=!0);let Se=L.response.headers.get("Location");Be(Se,"Expected a Location header on the redirect Response"),Se=D0(Se,new URL(N.url),m,e.history);let xe=Hl(E.location,Se,{_isRedirect:!0});if(i){let tt=!1;if(L.response.headers.has("X-Remix-Reload-Document"))tt=!0;else if(im(Se)){const vt=Mx(a,Se,!0);tt=vt.origin!==a.location.origin||Bn(vt.pathname,m)==null}if(tt){ve?a.location.replace(Se):a.location.assign(Se);return}}F=null;let ke=ve===!0||L.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ae,formAction:Ue,formEncType:Me}=E.navigation;!ie&&!se&&Ae&&Ue&&Me&&(ie=Z0(E.navigation));let Ze=ie||se;if(RN.has(L.response.status)&&Ze&&rn(Ze.formMethod))await qe(ke,xe,{submission:{...Ze,formAction:Se},preventScrollReset:Ee||Q,enableViewTransition:P?ue:void 0});else{let tt=Vd(xe,[],ke,ie);await qe(ke,xe,{overrideNavigation:tt,fetcherSubmission:se,preventScrollReset:Ee||Q,enableViewTransition:P?ue:void 0})}}async function mn(N,L,P,ie,se){let Ee,ve={};try{Ee=await BN(p,N,L,P,se,ie,!1)}catch(Se){return P.filter(xe=>xe.shouldLoad).forEach(xe=>{ve[xe.route.id]={type:"error",error:Se}}),ve}if(N.signal.aborted)return ve;if(!rn(N.method))for(let Se of P){if(Ee[Se.route.id]?.type==="error")break;!Ee.hasOwnProperty(Se.route.id)&&!E.loaderData.hasOwnProperty(Se.route.id)&&(!E.errors||!E.errors.hasOwnProperty(Se.route.id))&&Se.shouldCallHandler()&&(Ee[Se.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Se.route.id}`)})}for(let[Se,xe]of Object.entries(Ee))if(VN(xe)){let ke=xe.result;ve[Se]={type:"redirect",response:ZN(ke,N,Se,P,m)}}else ve[Se]=await HN(xe);return ve}async function _a(N,L,P,ie,se){let Ee=mn(P,ie,N,se,null),ve=Promise.all(L.map(async ke=>{if(ke.matches&&ke.match&&ke.request&&ke.controller){let Ue=(await mn(ke.request,ke.path,ke.matches,se,ke.key))[ke.match.route.id];return{[ke.key]:Ue}}else return Promise.resolve({[ke.key]:{type:"error",error:In(404,{pathname:ke.path})}})})),Se=await Ee,xe=(await ve).reduce((ke,Ae)=>Object.assign(ke,Ae),{});return{loaderResults:Se,fetcherResults:xe}}function Un(){M=!0,le.forEach((N,L)=>{fe.has(L)&&re.add(L),Pt(L)})}function Tn(N,L,P={}){let ie=new Map(E.fetchers);ie.set(N,L),me({fetchers:ie},{flushSync:(P&&P.flushSync)===!0})}function $n(N,L,P,ie={}){let se=Dr(E.matches,L),Ee=new Map(E.fetchers);Ta(Ee,N),me({errors:{[se.route.id]:P},fetchers:Ee},{flushSync:(ie&&ie.flushSync)===!0})}function yu(N){return W.set(N,(W.get(N)||0)+1),ye.has(N)&&ye.delete(N),E.fetchers.get(N)||jN}function gu(N,L){Pt(N,L?.reason),Tn(N,ba(null))}function Ta(N,L){let P=E.fetchers.get(L);fe.has(L)&&!(P&&P.state==="loading"&&K.has(L))&&Pt(L),le.delete(L),K.delete(L),I.delete(L),ye.delete(L),re.delete(L),N.delete(L)}function ln(N){let L=(W.get(N)||0)-1;L<=0?(W.delete(N),ye.add(N)):W.set(N,L),me({fetchers:new Map(E.fetchers)})}function Pt(N,L){let P=fe.get(N);P&&(P.abort(L),fe.delete(N))}function tn(N,L){for(let P of N){let ie=L.get(P);Be(ie,`Expected fetcher: ${P}`);let se=ba(ie.data);L.set(P,se)}}function as(N){let L=[],P=!1;for(let ie of I){let se=N.get(ie);Be(se,`Expected fetcher: ${ie}`),se.state==="loading"&&(I.delete(ie),L.push(ie),P=!0)}return tn(L,N),P}function rs(N,L){let P=[];for(let[ie,se]of K)if(se0}function vu(N,L){let P=E.blockers.get(N)||xl;return ze.get(N)!==L&&ze.set(N,L),P}function qr(N){E.blockers.delete(N),ze.delete(N)}function Ra(N,L){let P=E.blockers.get(N)||xl;Be(P.state==="unblocked"&&L.state==="blocked"||P.state==="blocked"&&L.state==="blocked"||P.state==="blocked"&&L.state==="proceeding"||P.state==="blocked"&&L.state==="unblocked"||P.state==="proceeding"&&L.state==="unblocked",`Invalid blocker state transition: ${P.state} -> ${L.state}`);let ie=new Map(E.blockers);ie.set(N,L),me({blockers:ie})}function Fr({currentLocation:N,nextLocation:L,historyAction:P}){if(ze.size===0)return;ze.size>1&&wt(!1,"A router only supports one blocker at a time");let ie=Array.from(ze.entries()),[se,Ee]=ie[ie.length-1],ve=E.blockers.get(se);if(!(ve&&ve.state==="proceeding")&&Ee({currentLocation:N,nextLocation:L,historyAction:P}))return se}function ta(N){let L=In(404,{pathname:N}),P=d.activeRoutes,{matches:ie,route:se}=Tc(P);return{notFoundMatches:ie,route:se,error:L}}function gi(N,L,P){if(T=N,R=L,z=P||null,!q&&E.navigation===Gd){q=!0;let ie=Ro(E.location,E.matches);ie!=null&&me({restoreScrollPosition:ie})}return()=>{T=null,R=null,z=null}}function tr(N,L){return z&&z(N,L.map(ie=>Dx(ie,E.loaderData)))||N.key}function bu(N,L){if(T&&R){let P=tr(N,L);T[P]=R()}}function Ro(N,L){if(T){let P=tr(N,L),ie=T[P];if(typeof ie=="number")return ie}return null}function nr(N,L,P){if(e.patchRoutesOnNavigation){let ie=d.branches;if(N){if(Object.keys(N[0].params).length>0)return{active:!0,matches:ca(L,P,m,!0,ie)}}else return{active:!0,matches:ca(L,P,m,!0,ie)||[]}}return{active:!1,matches:null}}async function fa(N,L,P,ie){if(!e.patchRoutesOnNavigation)return{type:"success",matches:N};let se=N;for(;;){let Ee=u;try{await e.patchRoutesOnNavigation({signal:P,path:L,matches:se,fetcherKey:ie,patch:(ke,Ae)=>{P.aborted||z0(ke,Ae,d,Ee,c,!1)}})}catch(ke){return{type:"error",error:ke,partialMatches:se}}if(P.aborted)return{type:"aborted"};let ve=d.branches,Se=ca(d.activeRoutes,L,m,!1,ve),xe=null;if(Se){if(Object.keys(Se[0].params).length===0)return{type:"success",matches:Se};if(xe=ca(d.activeRoutes,L,m,!0,ve),!(xe&&se.lengthP.route.id===L[ie].route.id)}function os(N){u={},d.setHmrRoutes(Zl(N,c,void 0,u))}function ls(N,L,P=!1){z0(N,L,d,u,c,P),d.hasHMRRoutes||me({})}return A={get basename(){return m},get future(){return b},get state(){return E},get routes(){return d.stableRoutes},get branches(){return d.branches},get manifest(){return u},get window(){return a},initialize:ce,subscribe:ge,enableScrollRestoration:gi,navigate:Je,fetch:_n,revalidate:Oe,createHref:N=>e.history.createHref(N),encodeLocation:N=>e.history.encodeLocation(N),getFetcher:yu,resetFetcher:gu,deleteFetcher:ln,dispose)DELIM" +R"DELIM(:de,getBlocker:vu,deleteBlocker:qr,patchRoutes:ls,_internalFetchControllers:fe,_internalSetRoutes:os,_internalSetStateDoNotUseOrYouWillBreakYourApp(N){me(N)}},e.instrumentations&&(A=vN(A,e.instrumentations.map(N=>N.router).filter(Boolean))),A}function zN(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Rh(e,a,i,o,s,c){let u,d;if(s){u=[];for(let p of a)if(u.push(p),p.route.id===s){d=p;break}}else u=a,d=a[a.length-1];let m=Il(o||".",uu(u),Bn(e.pathname,i)||e.pathname,c==="path");if(o==null&&(m.search=e.search,m.hash=e.hash),(o==null||o===""||o===".")&&d){let p=cm(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=fN({basename:i,pathname:m.pathname})),xa(m)}function k0(e,a,i){if(!i||!zN(i))return{path:a};if(i.formMethod&&!XN(i.formMethod))return{path:a,error:In(405,{method:i.formMethod})};let o=()=>({path:a,error:In(400,{type:"invalid-body"})}),c=(i.formMethod||"get").toUpperCase(),u=t1(a);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!rn(c))return o();let g=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((x,[w,T])=>`${x}${w}=${T} +`,""):String(i.body);return{path:a,submission:{formMethod:c,formAction:u,formEncType:i.formEncType,formData:void 0,json:void 0,text:g}}}else if(i.formEncType==="application/json"){if(!rn(c))return o();try{let g=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:a,submission:{formMethod:c,formAction:u,formEncType:i.formEncType,formData:void 0,json:g,text:void 0}}}catch{return o()}}}Be(typeof FormData=="function","FormData is not available in this environment");let d,m;if(i.formData)d=kh(i.formData),m=i.formData;else if(i.body instanceof FormData)d=kh(i.body),m=i.body;else if(i.body instanceof URLSearchParams)d=i.body,m=L0(d);else if(i.body==null)d=new URLSearchParams,m=new FormData;else try{d=new URLSearchParams(i.body),m=L0(d)}catch{return o()}let p={formMethod:c,formAction:u,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:m,json:void 0,text:void 0};if(rn(p.formMethod))return{path:a,submission:p};let b=wa(a);return e&&b.search&&cm(b.search)&&d.append("index",""),b.search=`?${d}`,{path:xa(b),submission:p}}function A0(e,a,i,o,s,c,u,d,m,p,b,g,x,w,T,z,R,q,G,J,oe,ee){let be=oe?Dn(oe[1])?oe[1].error:oe[1].data:void 0,A=s.createURL(c.location),E=s.createURL(m),D;if(b&&c.errors){let O=Object.keys(c.errors)[0];D=u.findIndex(M=>M.route.id===O)}else if(oe&&Dn(oe[1])){let O=oe[0];D=u.findIndex(M=>M.route.id===O)-1}let B=oe?oe[1].statusCode:void 0,Q=B&&B>=400,F={currentUrl:A,currentParams:c.matches[0]?.params||{},nextUrl:E,nextParams:u[0].params,...d,actionResult:be,actionStatus:B},ue=Jl(u),he=u.map((O,M)=>{let{route:re}=O,fe=null;if(D!=null&&M>D)fe=!1;else if(re.lazy)fe=!0;else if(!lm(re))fe=!1;else if(b){let{shouldLoad:I}=Vx(re,c.loaderData,c.errors);fe=I}else CN(c.loaderData,c.matches[M],O)&&(fe=!0);if(fe!==null)return jh(i,o,e,m,ue,O,p,a,fe);let we=!1;typeof ee=="boolean"?we=ee:Q?we=!1:(g||A.pathname+A.search===E.pathname+E.search||A.search!==E.search||MN(c.matches[M],O))&&(we=!0);let k={...F,defaultShouldRevalidate:we},K=Al(O,k);return jh(i,o,e,m,ue,O,p,a,K,k,ee)}),pe=[];return T.forEach((O,M)=>{if(b||!u.some(W=>W.route.id===O.routeId)||w.has(M))return;let re=c.fetchers.get(M),fe=re&&re.state!=="idle"&&re.data===void 0,we=ca(R,O.path,q??"/",!1,J);if(!we){if(G&&fe)return;pe.push({key:M,routeId:O.routeId,path:O.path,matches:null,match:null,request:null,controller:null});return}if(z.has(M))return;let k=Uc(we,O.path),K=new AbortController,I=lo(s,O.path,K.signal),le=null;if(x.has(M))x.delete(M),le=mo(i,o,I,O.path,we,k,p,a);else if(fe)g&&(le=mo(i,o,I,O.path,we,k,p,a));else{let W;typeof ee=="boolean"?W=ee:Q?W=!1:W=g;let ye={...F,defaultShouldRevalidate:W};Al(k,ye)&&(le=mo(i,o,I,O.path,we,k,p,a,ye))}le&&pe.push({key:M,routeId:O.routeId,path:O.path,matches:le,match:k,request:I,controller:K})}),{dsMatches:he,revalidatingFetchers:pe}}function lm(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Vx(e,a,i){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!lm(e))return{shouldLoad:!1,renderFallback:!1};let o=a!=null&&e.id in a,s=i!=null&&i[e.id]!==void 0;if(!o&&s)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!o};let c=!o&&!s;return{shouldLoad:c,renderFallback:c}}function CN(e,a,i){let o=!a||i.route.id!==a.route.id,s=!e.hasOwnProperty(i.route.id);return o||s}function MN(e,a){let i=e.route.path;return e.pathname!==a.pathname||i!=null&&i.endsWith("*")&&e.params["*"]!==a.params["*"]}function Al(e,a){if(e.route.shouldRevalidate){let i=e.route.shouldRevalidate(a);if(typeof i=="boolean")return i}return a.defaultShouldRevalidate}function z0(e,a,i,o,s,c){let u;if(e){let p=o[e];Be(p,`No route found to patch children into: routeId = ${e}`),p.children||(p.children=[]),u=p.children}else u=i.activeRoutes;let d=[],m=[];if(a.forEach(p=>{let b=u.find(g=>Kx(p,g));b?m.push({existingRoute:b,newRoute:p}):d.push(p)}),d.length>0){let p=Zl(d,s,[e||"_","patch",String(u?.length||"0")],o);u.push(...p)}if(c&&m.length>0)for(let p=0;pa.children?.some(s=>Kx(i,s)))??!1:!1}var C0=new WeakMap,Ix=({key:e,route:a,manifest:i,mapRouteProperties:o})=>{let s=i[a.id];if(Be(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let c=s.lazy[e];if(!c)return;let u=C0.get(s);u||(u={},C0.set(s,u));let d=u[e];if(d)return d;let m=(async()=>{let p=Ij(e),g=s[e]!==void 0&&e!=="hasErrorBoundary";if(p)wt(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),u[e]=Promise.resolve();else if(g)wt(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await c();x!=null&&(Object.assign(s,{[e]:x}),Object.assign(s,o(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(x=>x===void 0)&&(s.lazy=void 0))})();return u[e]=m,m},M0=new WeakMap;function ON(e,a,i,o,s){let c=i[e.id];if(Be(c,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let b=M0.get(c);if(b)return{lazyRoutePromise:b,lazyHandlerPromise:b};let g=(async()=>{Be(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),w={};for(let T in x){let z=x[T];if(z===void 0)continue;let R=Jj(T),G=c[T]!==void 0&&T!=="hasErrorBoundary";R?wt(!R,"Route property "+T+" is not a supported property to be returned from a lazy route function. This property will be ignored."):G?wt(!G,`Route "${c.id}" has a static property "${T}" defined but its lazy function is also returning a value for this property. The lazy route property "${T}" will be ignored.`):w[T]=z}Object.assign(c,w),Object.assign(c,{...o(c),lazy:void 0})})();return M0.set(c,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let u=Object.keys(e.lazy),d=[],m;for(let b of u){if(s&&s.includes(b))continue;let g=Ix({key:b,route:e,manifest:i,mapRouteProperties:o});g&&(d.push(g),b===a&&(m=g))}let p=d.length>0?Promise.all(d).then(()=>{}):void 0;return p?.catch(()=>{}),m?.catch(()=>{}),{la)DELIM" +R"DELIM(zyRoutePromise:p,lazyHandlerPromise:m}}async function O0(e){let a=e.matches.filter(s=>s.shouldLoad),i={};return(await Promise.all(a.map(s=>s.resolve()))).forEach((s,c)=>{i[a[c].route.id]=s}),i}async function DN(e){return e.matches.some(a=>a.route.middleware)?Xx(e,()=>O0(e)):O0(e)}function Xx(e,a){return LN(e,a,o=>{if(IN(o))throw o;return o},YN,i);function i(o,s,c){if(c)return Promise.resolve(Object.assign(c.value,{[s]:{type:"error",result:o}}));{let{matches:u}=e,d=Math.min(Math.max(u.findIndex(p=>p.route.id===s),0),Math.max(u.findIndex(p=>p.shouldCallHandler()),0)),m=Dr(u,u[d].route.id).route.id;return Promise.resolve({[m]:{type:"error",result:o}})}}}async function LN(e,a,i,o,s){let{matches:c,...u}=e,d=c.flatMap(p=>p.route.middleware?p.route.middleware.map(b=>[p.route.id,b]):[]);return await Jx(u,d,a,i,o,s)}async function Jx(e,a,i,o,s,c,u=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let m=a[u];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 Jx(e,a,i,o,s,c,u+1)},g.value}catch(w){return g={value:await c(w,p,g)},g.value}};try{let w=await b(e,x),T=w!=null?o(w):void 0;return s(T)?T:g?T??g.value:(g={value:await x()},g.value)}catch(w){return await c(w,p,g)}}function Wx(e,a,i,o,s){let c=Ix({key:"middleware",route:o.route,manifest:a,mapRouteProperties:e}),u=ON(o.route,rn(i.method)?"action":"loader",a,e,s);return{middleware:c,route:u.lazyRoutePromise,handler:u.lazyHandlerPromise}}function jh(e,a,i,o,s,c,u,d,m,p=null,b){let g=!1,x=Wx(e,a,i,c,u);return{...c,_lazyPromises:x,shouldLoad:m,shouldRevalidateArgs:p,shouldCallHandler(w){return g=!0,p?typeof b=="boolean"?Al(c,{...p,defaultShouldRevalidate:b}):typeof w=="boolean"?Al(c,{...p,defaultShouldRevalidate:w}):Al(c,p):m},resolve(w){let{lazy:T,loader:z,middleware:R}=c.route,q=g||m||w&&!rn(i.method)&&(T||z),G=R&&R.length>0&&!z&&!T;return q&&(rn(i.method)||!G)?UN({request:i,path:o,pattern:s,match:c,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:w,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function mo(e,a,i,o,s,c,u,d,m=null){return s.map(p=>p.route.id!==c.route.id?{...p,shouldLoad:!1,shouldRevalidateArgs:m,shouldCallHandler:()=>!1,_lazyPromises:Wx(e,a,i,p,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:jh(e,a,i,o,Jl(s),p,u,d,!0,m))}async function BN(e,a,i,o,s,c,u){o.some(b=>b._lazyPromises?.middleware)&&await Promise.all(o.map(b=>b._lazyPromises?.middleware));let d={request:a,url:e1(a,i),pattern:Jl(o),params:o[0].params,context:c,matches:o},p=await e({...d,fetcherKey:s,runClientMiddleware:b=>{let g=d;return Xx(g,()=>b({...g,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(o.flatMap(b=>[b._lazyPromises?.handler,b._lazyPromises?.route]))}catch{}return p}async function UN({request:e,path:a,pattern:i,match:o,lazyHandlerPromise:s,lazyRoutePromise:c,handlerOverride:u,scopedContext:d}){let m,p,b=rn(e.method),g=b?"action":"loader",x=w=>{let T,z=new Promise((G,J)=>T=J);p=()=>T(),e.signal.addEventListener("abort",p);let R=G=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${o.route.id}]`)):w({request:e,url:e1(e,a),pattern:i,params:o.params,context:d},...G!==void 0?[G]:[]),q=(async()=>{try{return{type:"data",result:await(u?u(J=>R(J)):R())}}catch(G){return{type:"error",result:G}}})();return Promise.race([q,z])};try{let w=b?o.route.action:o.route.loader;if(s||c)if(w){let T,[z]=await Promise.all([x(w).catch(R=>{T=R}),s,c]);if(T!==void 0)throw T;m=z}else{await s;let T=b?o.route.action:o.route.loader;if(T)[m]=await Promise.all([x(T),c]);else if(g==="action"){let z=new URL(e.url),R=z.pathname+z.search;throw In(405,{method:e.method,pathname:R,routeId:o.route.id})}else return{type:"data",result:void 0}}else if(w)m=await x(w);else{let T=new URL(e.url),z=T.pathname+T.search;throw In(404,{pathname:z})}}catch(w){return{type:"error",result:w}}finally{p&&e.signal.removeEventListener("abort",p)}return m}async function $N(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 HN(e){let{result:a,type:i}=e;if(sm(a)){let o;try{o=await $N(a)}catch(s){return{type:"error",error:s}}return i==="error"?{type:"error",error:new Xl(a.status,a.statusText,o),statusCode:a.status,headers:a.headers}:{type:"data",data:o,statusCode:a.status,headers:a.headers}}return i==="error"?H0(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:QN(a),statusCode:Pl(a)?a.status:void 0,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:Pl(a)?a.status:void 0}:H0(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 ZN(e,a,i,o,s){let c=e.headers.get("Location");if(Be(c,"Redirects returned/thrown from loaders/actions must have a Location header"),!im(c)){let u=o.slice(0,o.findIndex(d=>d.route.id===i)+1);c=Rh(new URL(a.url),u,s,c),e.headers.set("Location",c)}return e}var PN=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Nh(e){try{return PN.includes(new URL(e).protocol)}catch{return!1}}function D0(e,a,i,o){if(im(e)){let s=e,c=rm.test(s)?new URL(zx(s,a.protocol)):new URL(s);if(Nh(c.toString()))throw new Error("Invalid redirect location");let u=Bn(c.pathname,i)!=null;if(c.origin===a.origin&&u)return om(c.pathname)+c.search+c.hash}try{let s=o.createURL(e);if(Nh(s.toString()))throw new Error("Invalid redirect location")}catch{}return e}function lo(e,a,i,o){let s=e.createURL(t1(a)).toString(),c={signal:i};if(o&&rn(o.formMethod)){let{formMethod:u,formEncType:d}=o;c.method=u.toUpperCase(),d==="application/json"?(c.headers=new Headers({"Content-Type":d}),c.body=JSON.stringify(o.json)):d==="text/plain"?c.body=o.text:d==="application/x-www-form-urlencoded"&&o.formData?c.body=kh(o.formData):c.body=o.formData}return new Request(s,c)}function e1(e,a){let i=new URL(e.url),o=typeof a=="string"?wa(a):a;if(i.pathname=o.pathname||"/",o.search){let s=new URLSearchParams(o.search),c=s.getAll("index");s.delete("index");for(let u of c.filter(Boolean))s.append("index",u);i.search=s.size?`?${s.toString()}`:""}else i.search="";return i.hash=o.hash||"",i}function kh(e){let a=new URLSearchParams;for(let[i,o]of e.entries())a.append(i,typeof o=="string"?o:o.name);return a}function L0(e){let a=new FormData;for(let[i,o]of e.entries())a.append(i,o);return a}function qN(e,a,i,o=!1,s=!1){let c={},u=null,d,m=!1,p={},b=i&&Dn(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(Be(!di(w),"Cannot handle redirect results in processLoaderData"),Dn(w)){let T=w.error;if(b!==void 0&&(T=b,b=void 0),u=u||{},s)u[x]=T;else{let z=Dr(e,x);u[z.route.id]==null&&(u[z.route.id]=T)}o||(c[x]=Gx),m||(m=!0,d=Pl(w.error)?w.error.status:500),w.headers&&(p[x]=w.headers)}else c[x]=w.data,w.statusCode&&w.statusCode!==200&&!m&&(d=w.statusCode),w.headers&&(p[x]=w.headers)}),b!==void 0&&i&&(u={[i[0]]:b},i[2]&&(c[i[2]]=void 0)),{loaderData:c,errors:u,statusCode:d||200,loaderHeaders:p}}function B0(e,a,i,o,s,c,u){let{loaderData:d,errors:m}=qN(a,i,o);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=c[b];if(Be(w,"Did not find corresponding fetcher result"),Dn(w)){let T=Dr(e.matches,g?.route.id);m&&m[T.route.id]||(m={...m,[T.route.id]:w.error}),u.delete(b)}else if(di(w))Be(!1,"Unhandled fetcher revalidation redirect");else{let T=ba(w.data);u.set(b,T)}}),{loaderData:d,errors:m}}function U0(e,a,i,o){let s=Ob)DELIM" +R"DELIM(ject.entries(a).filter(([,c])=>c!==Gx).reduce((c,[u,d])=>(c[u]=d,c),{});for(let c of i){let u=c.route.id;if(!a.hasOwnProperty(u)&&e.hasOwnProperty(u)&&c.route.loader&&(s[u]=e[u]),o&&o.hasOwnProperty(u))break}return s}function $0(e){return e?Dn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Dr(e,a){return(a?e.slice(0,e.findIndex(o=>o.route.id===a)+1):[...e]).reverse().find(o=>o.route.hasErrorBoundary===!0)||e[0]}function Tc(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 In(e,{pathname:a,routeId:i,method:o,type:s,message:c}={}){let u="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(u="Bad Request",o&&a&&i?d=`You made a ${o} 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?(u="Forbidden",d=`Route "${i}" does not match URL "${a}"`):e===404?(u="Not Found",d=`No route matches URL "${a}"`):e===405&&(u="Method Not Allowed",o&&a&&i?d=`You made a ${o.toUpperCase()} request to "${a}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:o&&(d=`Invalid request method "${o.toUpperCase()}"`)),new Xl(e||500,u,new Error(d),!0)}function Rc(e){let a=Object.entries(e);for(let i=a.length-1;i>=0;i--){let[o,s]=a[i];if(di(s))return{key:o,result:s}}}function t1(e){let a=typeof e=="string"?wa(e):e;return xa({...a,hash:""})}function FN(e,a){return e.pathname!==a.pathname||e.search!==a.search?!1:e.hash===""?a.hash!=="":e.hash===a.hash?!0:a.hash!==""}function QN(e){return new Xl(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function YN(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([a,i])=>typeof a=="string"&&GN(i))}function GN(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function VN(e){return sm(e.result)&&Qx.has(e.result.status)}function Dn(e){return e.type==="error"}function di(e){return(e&&e.type)==="redirect"}function H0(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function sm(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function KN(e){return Qx.has(e)}function IN(e){return sm(e)&&KN(e.status)&&e.headers.has("Location")}function XN(e){return TN.has(e.toUpperCase())}function rn(e){return EN.has(e.toUpperCase())}function cm(e){return new URLSearchParams(e).getAll("index").some(a=>a==="")}function Uc(e,a){let i=typeof a=="string"?wa(a).search:a.search;if(e[e.length-1].route.index&&cm(i||""))return e[e.length-1];let o=Hx(e);return o[o.length-1]}function Z0(e){let{formMethod:a,formAction:i,formEncType:o,text:s,formData:c,json:u}=e;if(!(!a||!i||!o)){if(s!=null)return{formMethod:a,formAction:i,formEncType:o,formData:void 0,json:void 0,text:s};if(c!=null)return{formMethod:a,formAction:i,formEncType:o,formData:c,json:void 0,text:void 0};if(u!==void 0)return{formMethod:a,formAction:i,formEncType:o,formData:void 0,json:u,text:void 0}}}function Vd(e,a,i,o){return o?{state:"loading",location:e,matches:a,historyAction:i,formMethod:o.formMethod,formAction:o.formAction,formEncType:o.formEncType,formData:o.formData,json:o.json,text:o.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 JN(e,a,i,o){return{state:"submitting",location:e,matches:a,historyAction:i,formMethod:o.formMethod,formAction:o.formAction,formEncType:o.formEncType,formData:o.formData,json:o.json,text:o.text}}function Sl(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 WN(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 e3(e,a){try{let i=e.sessionStorage.getItem(Yx);if(i){let o=JSON.parse(i);for(let[s,c]of Object.entries(o||{}))c&&Array.isArray(c)&&a.set(s,new Set(c||[]))}}catch{}}function t3(e,a){if(a.size>0){let i={};for(let[o,s]of a)i[o]=[...s];try{e.sessionStorage.setItem(Yx,JSON.stringify(i))}catch(o){wt(!1,`Failed to save applied view transitions in sessionStorage (${o}).`)}}}function P0(){let e,a,i=new Promise((o,s)=>{e=async c=>{o(c);try{await i}catch{}},a=async c=>{s(c);try{await i}catch{}}});return{promise:i,resolve:e,reject:a}}var pi=_.createContext(null);pi.displayName="DataRouter";var _o=_.createContext(null);_o.displayName="DataRouterState";var n1=_.createContext(!1);function a1(){return _.useContext(n1)}var um=_.createContext({isTransitioning:!1});um.displayName="ViewTransition";var r1=_.createContext(new Map);r1.displayName="Fetchers";var n3=_.createContext(null);n3.displayName="Await";var hn=_.createContext(null);hn.displayName="Navigation";var Wl=_.createContext(null);Wl.displayName="Location";var Wn=_.createContext({outlet:null,matches:[],isDataRoute:!1});Wn.displayName="Route";var fm=_.createContext(null);fm.displayName="RouteError";var i1="REACT_ROUTER_ERROR",a3="REDIRECT",r3="ROUTE_ERROR_RESPONSE";function i3(e){if(e.startsWith(`${i1}:${a3}:{`))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 o3(e){if(e.startsWith(`${i1}:${r3}:{`))try{let a=JSON.parse(e.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new Xl(a.status,a.statusText,a.data)}catch{}}function l3(e,{relative:a}={}){Be(To(),"useHref() may be used only in the context of a component.");let{basename:i,navigator:o}=_.useContext(hn),{hash:s,pathname:c,search:u}=es(e,{relative:a}),d=c;return i!=="/"&&(d=c==="/"?i:Xn([i,c])),o.createHref({pathname:d,search:u,hash:s})}function To(){return _.useContext(Wl)!=null}function Ft(){return Be(To(),"useLocation() may be used only in the context of a component."),_.useContext(Wl).location}function s3(){return _.useContext(Wl).navigationType}var o1="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function l1(e){_.useContext(hn).static||_.useLayoutEffect(e)}function Ea(){let{isDataRoute:e}=_.useContext(Wn);return e?w3():c3()}function c3(){Be(To(),"useNavigate() may be used only in the context of a component.");let e=_.useContext(pi),{basename:a,navigator:i}=_.useContext(hn),{matches:o}=_.useContext(Wn),{pathname:s}=Ft(),c=JSON.stringify(uu(o)),u=_.useRef(!1);return l1(()=>{u.current=!0}),_.useCallback((m,p={})=>{if(wt(u.current,o1),!u.current)return;if(typeof m=="number"){i.go(m);return}let b=Il(m,JSON.parse(c),s,p.relative==="path");e==null&&a!=="/"&&(b.pathname=b.pathname==="/"?a:Xn([a,b.pathname])),(p.replace?i.replace:i.push)(b,p.state,p)},[a,i,c,s,e])}var u3=_.createContext(null);function f3(e){let a=_.useContext(Wn).outlet;return _.useMemo(()=>a&&_.createElement(u3.Provider,{value:e},a),[a,e])}function dm(){let{matches:e}=_.useContext(Wn);return e[e.length-1]?.params??{}}function es(e,{relative:a}={}){let{matches:i}=_.useContext(Wn),{pathname:o}=Ft(),s=JSON.stringify(uu(i));return _.useMemo(()=>Il(e,JSON.parse(s),o,a==="path"),[e,s,o,a])}function d3(e,a,i){Be(To(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=_.useContext(hn),{matches:s}=_.useContext(Wn),c=s[s.length-1)DELIM" +R"DELIM(],u=c?c.params:{},d=c?c.pathname:"/",m=c?c.pathnameBase:"/",p=c&&c.route;{let R=p&&p.path||"";f1(d,!p||R.endsWith("*")||R.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=Xt(),g;g=b;let x=g.pathname||"/",w=x;if(m!=="/"){let R=m.replace(/^\//,"").split("/");w="/"+x.replace(/^\//,"").split("/").slice(R.length).join("/")}let T=i&&i.state.matches.length?i.state.matches.map(R=>Object.assign(R,{route:i.manifest[R.route.id]||R.route})):zx(e,{pathname:w});return St(p||T!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),St(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.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.`),lN(T&&T.map(R=>Object.assign({},R,{params:Object.assign({},c,R.params),pathname:Xn([m,o.encodeLocation?o.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?m:Xn([m,o.encodeLocation?o.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),s,i)}function aN(){let e=o1(),a=Hl(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),i=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:o},u={padding:"2px 4px",backgroundColor:o},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=_.createElement(_.Fragment,null,_.createElement("p",null,"💿 Hey developer 👋"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:u},"ErrorBoundary")," or"," ",_.createElement("code",{style:u},"errorElement")," prop on your route.")),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},a),i?_.createElement("pre",{style:s},i):null,c)}var rN=_.createElement(aN,null),r1=class extends _.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=IA(e.digest);i&&(e=i)}let a=e!==void 0?_.createElement(Wn.Provider,{value:this.props.routeContext},_.createElement(sm.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?_.createElement(iN,{error:e},a):a}};r1.contextType=Jx;var Yd=new WeakMap;function iN({children:e,error:a}){let{basename:i}=_.useContext(fn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=KA(a.digest);if(o){let s=Yd.get(a);if(s)throw s;let u=Ux(o.location,i),c=u.absoluteURL||u.to;if(_h(c))throw new Error("Invalid redirect location");if(Bx&&!Yd.get(a))if(u.isExternal||o.reloadDocument)window.location.href=c;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:o.replace}));throw Yd.set(a,d),d}return _.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c}`})}}return e}function oN({routeContext:e,match:a,children:i}){let o=_.useContext(mi);r)DELIM" -R"DELIM(eturn o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),_.createElement(Wn.Provider,{value:e},i)}function lN(e,a=[],i){let o=i?.state;if(e==null){if(!o)return null;if(o.errors)e=o.matches;else if(a.length===0&&!o.initialized&&o.matches.length>0)e=o.matches;else return null}let s=e,u=o?.errors;if(u!=null){let b=s.findIndex(g=>g.route.id&&u?.[g.route.id]!==void 0);Be(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&&o){c=o.renderFallback;for(let b=0;b=0?s=s.slice(0,d+1):s=[s[0]];break}}}}let m=i?.onError,p=o&&m?(b,g)=>{m(b,{location:o.location,params:o.matches?.[0]?.params??{},pattern:Il(o.matches),errorInfo:g})}:void 0;return s.reduceRight((b,g,x)=>{let w,T=!1,C=null,R=null;o&&(w=u&&g.route.id?u[g.route.id]:void 0,C=g.route.errorElement||rN,c&&(d<0&&x===0?(l1("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,R=null):d===x&&(T=!0,R=g.route.hydrateFallbackElement||null)));let q=a.concat(s.slice(0,x+1)),G=()=>{let X;return w?X=C:T?X=R:g.route.Component?X=_.createElement(g.route.Component,null):g.route.element?X=g.route.element:X=b,_.createElement(oN,{match:g,routeContext:{outlet:b,matches:q,isDataRoute:o!=null},children:X})};return o&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?_.createElement(r1,{location:o.location,revalidation:o.revalidation,component:C,error:w,children:G(),routeContext:{outlet:null,matches:q,isDataRoute:!0},onError:p}):G()},null)}function cm(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function sN(e){let a=_.useContext(mi);return Be(a,cm(e)),a}function fm(e){let a=_.useContext(xo);return Be(a,cm(e)),a}function uN(e){let a=_.useContext(Wn);return Be(a,cm(e)),a}function dm(e){let a=uN(e),i=a.matches[a.matches.length-1];return Be(i.route.id,`${e} can only be used on routes that contain a unique "id"`),i.route.id}function cN(){return dm("useRouteId")}function fN(){let e=fm("useNavigation");return _.useMemo(()=>{let{matches:a,historyAction:i,...o}=e.navigation;return o},[e.navigation])}function i1(){let{matches:e,loaderData:a}=fm("useMatches");return _.useMemo(()=>e.map(i=>Cx(i,a)),[e,a])}function o1(){let e=_.useContext(sm),a=fm("useRouteError"),i=dm("useRouteError");return e!==void 0?e:a.errors?.[i]}function dN(){let{router:e}=sN("useNavigate"),a=dm("useNavigate"),i=_.useRef(!1);return a1(()=>{i.current=!0}),_.useCallback(async(s,u={})=>{St(i.current,n1),i.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:a,...u}))},[e,a])}var $0={};function l1(e,a,i){!a&&!$0[e]&&($0[e]=!0,St(!1,i))}var Z0={};function q0(e,a){!e&&!Z0[a]&&(Z0[a]=!0,console.warn(a))}var hN="useOptimistic",P0=Dw[hN],mN=()=>{};function pN(e){return P0?P0(e):[e,mN]}function yN(e){let a={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&St(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(a,{element:_.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&St(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(a,{hydrateFallbackElement:_.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&St(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(a,{errorElement:_.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),a}var gN=["HydrateFallback","hydrateFallbackElement"],vN=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 bN({router:e,flushSync:a,onError:i,useTransitions:o}){o=Wx()||o;let[u,c]=_.useState(e.state),[d,m]=pN(u),[p,b]=_.useState(),[g,x]=_.useState({isTransitioning:!1}),[w,T]=_.useState(),[C,R]=_.useState(),[q,G]=_.useState(),X=_.useRef(new Map),le=_.useCallback((E,{deletedFetchers:k,newErrors:B,flushSync:Q,viewTransitionOpts:F})=>{B&&i&&Object.values(B).forEach(fe=>i(fe,{location:E.location,params:E.matches[0]?.params??{},pattern:Il(E.matches)})),E.fetchers.forEach((fe,be)=>{fe.data!==void 0&&X.current.set(be,fe.data)}),k.forEach(fe=>X.current.delete(fe)),q0(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 re=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(q0(F==null||re,"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."),!F||!re){a&&Q?a(()=>c(E)):o===!1?c(E):_.startTransition(()=>{o===!0&&m(fe=>F0(fe,E)),c(E)});return}if(a&&Q){a(()=>{C&&(w?.resolve(),C.skipTransition()),x({isTransitioning:!0,flushSync:!0,currentLocation:F.currentLocation,nextLocation:F.nextLocation})});let fe=e.window.document.startViewTransition(()=>{a(()=>c(E))});fe.finished.finally(()=>{a(()=>{T(void 0),R(void 0),b(void 0),x({isTransitioning:!1})})}),a(()=>R(fe));return}C?(w?.resolve(),C.skipTransition(),G({state:E,currentLocation:F.currentLocation,nextLocation:F.nextLocation})):(b(E),x({isTransitioning:!0,flushSync:!1,currentLocation:F.currentLocation,nextLocation:F.nextLocation}))},[e.window,a,C,w,o,m,i]);_.useLayoutEffect(()=>e.subscribe(le),[e,le]),_.useEffect(()=>{g.isTransitioning&&!g.flushSync&&T(new vN)},[g]),_.useEffect(()=>{if(w&&p&&e.window){let E=p,k=w.promise,B=e.window.document.startViewTransition(async()=>{o===!1?c(E):_.startTransition(()=>{o===!0&&m(Q=>F0(Q,E)),c(E)}),await k});B.finished.finally(()=>{T(void 0),R(void 0),b(void 0),x({isTransitioning:!1})}),R(B)}},[p,w,e.window,o,m]),_.useEffect(()=>{w&&p&&d.location.key===p.location.key&&w.resolve()},[w,C,d.location,p]),_.useEffect(()=>{!g.isTransitioning&&q&&(b(q.state),x({isTransitioning:!0,flushSync:!1,currentLocation:q.currentLocation,nextLocation:q.nextLocation}),G(void 0))},[g.isTransitioning,q]);let ne=_.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:E=>e.navigate(E),push:(E,k,B)=>e.navigate(E,{state:k,preventScrollReset:B?.preventScrollReset}),replace:(E,k,B)=>e.navigate(E,{replace:!0,state:k,preventScrollReset:B?.preventScrollReset})}),[e]),ge=e.basename||"/",z=_.useMemo(()=>({router:e,navigator:ne,static:!1,basename:ge,onError:i}),[e,ne,ge,i]);return _.createElement(_.Fragment,null,_.createElement(mi.Provider,{value:z},_.createElement(xo.Provider,{value:d},_.createElement(e1.Provider,{value:X.current},_.createElement(lm.Provider,{value:g},_.createElement(_N,{basename:ge,location:d.location,navigationType:d.historyAction,navigator:ne,useTransitions:o},_.createElement(xN,{routes:e.routes,manifest:e.manifest,future:e.future,state:d,isStatic:!1,onError:i})))))),null)}function F0(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 xN=_.memo(SN);function SN({routes:e,manifest:a,future:i,state:o,isStatic:s)DELIM" -R"DELIM(,onError:u}){return nN(e,void 0,{manifest:a,state:o,isStatic:s,onError:u})}function wN({to:e,replace:a,state:i,relative:o}){Be(So()," may be used only in the context of a component.");let{static:s}=_.useContext(fn);St(!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}=_.useContext(Wn),{pathname:c}=Xt(),d=Ea(),m=Vl(e,sc(u),c,o==="path"),p=JSON.stringify(m);return _.useEffect(()=>{d(JSON.parse(p),{replace:a,state:i,relative:o})},[d,p,o,a,i]),null}function EN(e){return tN(e.context)}function Ut(e){Be(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function _N({basename:e="/",children:a=null,location:i,navigationType:o="POP",navigator:s,static:u=!1,useTransitions:c}){Be(!So(),"You cannot render a inside another . You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),m=_.useMemo(()=>({basename:d,navigator:s,static:u,useTransitions:c,future:{}}),[d,s,u,c]);typeof i=="string"&&(i=wa(i));let{pathname:p="/",search:b="",hash:g="",state:x=null,key:w="default",mask:T}=i,C=_.useMemo(()=>{let R=Bn(p,d);return R==null?null:{location:{pathname:R,search:b,hash:g,state:x,key:w,mask:T},navigationType:o}},[d,p,b,g,x,w,o,T]);return St(C!=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.`),C==null?null:_.createElement(fn.Provider,{value:m},_.createElement(Xl.Provider,{children:a,value:C}))}function Rh(e,a=[]){let i=[];return _.Children.forEach(e,(o,s)=>{if(!_.isValidElement(o))return;let u=[...a,s];if(o.type===_.Fragment){i.push.apply(i,Rh(o.props.children,u));return}Be(o.type===Ut,`[${typeof o.type=="string"?o.type:o.type.name}] is not a component. All component children of must be a or `),Be(!o.props.index||!o.props.children,"An index route cannot have child routes.");let c={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(c.children=Rh(o.props.children,u)),i.push(c)}),i}var TN=Rh,Bu="get",Uu="application/x-www-form-urlencoded";function uc(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function RN(e){return uc(e)&&e.tagName.toLowerCase()==="button"}function AN(e){return uc(e)&&e.tagName.toLowerCase()==="form"}function NN(e){return uc(e)&&e.tagName.toLowerCase()==="input"}function jN(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zN(e,a){return e.button===0&&(!a||a==="_self")&&!jN(e)}function Ah(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((a,i)=>{let o=e[i];return a.concat(Array.isArray(o)?o.map(s=>[i,s]):[[i,o]])},[]))}function CN(e,a){let i=Ah(e);return a&&a.forEach((o,s)=>{i.has(s)||a.getAll(s).forEach(u=>{i.append(s,u)})}),i}var Tu=null;function MN(){if(Tu===null)try{new FormData(document.createElement("form"),0),Tu=!1}catch{Tu=!0}return Tu}var ON=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Gd(e){return e!=null&&!ON.has(e)?(St(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Uu}"`),null):e}function kN(e,a){let i,o,s,u,c;if(AN(e)){let d=e.getAttribute("action");o=d?Bn(d,a):null,i=e.getAttribute("method")||Bu,s=Gd(e.getAttribute("enctype"))||Uu,u=new FormData(e)}else if(RN(e)||NN(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a