diff --git a/console/embedded/native_css.cpp b/console/embedded/native_css.cpp index e502b08b..14c1f810 100644 --- a/console/embedded/native_css.cpp +++ b/console/embedded/native_css.cpp @@ -24,11 +24,11 @@ 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)DELIM" R"DELIM(;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(--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:1re)DELIM" - R"DELIM(m;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}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.end{inset-inline-end:var(--spacing)}.left-0{left:calc(var(--spacing) * 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:calc(var(--spacing) * 1)}.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}.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:calc(var(--spacing) * 0)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[12rem\]{min-width:12rem}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0{gap:calc(var(--spacing) * 0)}.gap-1{gap:calc(var(--spacing) * 1)}.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:)DELIM" - R"DELIM(0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-accentSecondary\/30>:not(:last-child)){border-color:#c856374d}.place-self-start{place-self:start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-accent{border-color:#ffa022}.border-accent\/20{border-color:#ffa02233}.border-accent\/30{border-color:#ffa0224d}.border-accent\/40{border-color:#ffa02266}.border-accent\/50{border-color:#ffa02280}.border-accentSecondary\/20{border-color:#c8563733}.border-accentSecondary\/30{border-color:#c856374d}.border-accentSecondary\/40{border-color:#c8563766}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500) 50%,transparent)}}.border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/50{border-color:color-mix(in oklab,var(--color-emerald-500) 50%,transparent)}}.border-rose-500\/50{border-color:#ff235780}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/50{border-color:color-mix(in oklab,var(--color-rose-500) 50%,transparent)}}.border-slate-500\/50{border-color:#62748e80}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/50{border-color:color-mix(in oklab,var(--color-slate-500) 50%,transparent)}}.border-textMuted\/30{border-color:#cfcfcf4d}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-accent{background-color:#ffa022}.bg-accent\/5{background-color:#ffa0220d}.bg-accentSecondary{background-color:#c85637}.bg-accentSecondary\/10{background-color:#c856371a}.bg-accentSecondary\/20{background-color:#c8563733}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.bg-background{background-color:#272822}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-current{background-color:currentColor}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var)DELIM" - R"DELIM((--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:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-accent{color:#ffa022}.text-accentSecondary{color:#c85637}.text-amber-300{color:var(--color-amber-300)}.text-emerald-300{color:var(--color-emerald-300)}.text-rose-300{color:var(--color-rose-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:#cfcfcf}.text-textPrimary{color:#ededed}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--t)DELIM" - R"DELIM(w-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-focus-within\:max-w-\[18rem\]:is(:where(.group):focus-within *){max-width:18rem}.group-focus-within\:translate-x-0:is(:where(.group):focus-within *){--tw-translate-x:calc(var(--spacing) * 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:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-textMuted::placeholder{color:#cfcfcf}.first\:text-left:first-child{text-align:left}.last\:text-right:last-child{text-align:right}.focus-within\:justify-start:focus-within{justify-content:flex-start}.focus-within\:gap-2:focus-within{gap:calc(var(--spacing) * 2)}.focus-within\:px-3:focus-within{padding-inline:calc(var(--spacing) * 3)}@media(hover:hover){.hover\:justify-start:hover{justify-content:flex-start}.hover\:gap-2:hover{gap:calc(var(--spacing) * 2)}.hover\:border-accent:hover{border-color:#ffa022}.hover\:border-accentSecondary:hover{border-color:#c85637}.hover\:bg-accentSecondary\/10:hover{background-color:#c856371a}.hover\:px-3:hover{padding-inline:calc(var(--spacing) * 3)}.hover\:text-accent:hover{color:#ffa022}.hover\:text-accentSecondary:hover{color:#c85637}}.focus\:border-accent:focus{border-color:#ffa022}.focus\:ring-accent:focus{--tw-ring-color:#ffa022}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-60:disabled{opacity:.6}@media(prefers-reduced-motion:no-preference){.motion-safe\:-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.motion-safe\:transition-\[max-width\,opacity\,transform\]{transition-property:max-width,opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:transition-\[padding\,gap\]{transition-property:padding,gap;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:duration-200{--tw-duration:.2s;transition-duration:.2s}.motion-safe\:ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}}@media(min-width:40rem){.sm\:block{display:block}.sm\:inline{display:inline}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}@media(min-width:48rem){.md\:order-2{order:2}.md\:order-3{order:3}.md\:order-4{order:4}.md\:ml-auto{margin-left:auto}.md\:hidden{display:none}.md\:inline{display:inline}.md\:w-72{width:calc(var(--spacing) * 72)}.md\:w-auto{width:auto})DELIM" - R"DELIM(.md\:flex-none{flex:none}.md\:flex-nowrap{flex-wrap:nowrap}}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}}@media(min-width:80rem){.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-\[minmax\(0\,1\.5fr\)_minmax\(20rem\,1fr\)\]{grid-template-columns:minmax(0,1.5fr) minmax(20rem,1fr)}}}:root{color-scheme:dark}body{font-family:var(--font-sans);color:#ededed;background-color:#272822}::selection{color:#272822;background-color:#ffa022}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@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(m;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}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.end{inset-inline-end:var(--spacing)}.left-0{left:calc(var(--spacing) * 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:calc(var(--spacing) * 1)}.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:calc(var(--spacing) * 0)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[12rem\]{min-width:12rem}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0{gap:calc(var(--spacing) * 0)}.gap-1{gap:calc(var(--spacing) * 1)}.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)){)DELIM" + R"DELIM(--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-accentSecondary\/30>:not(:last-child)){border-color:#c856374d}.place-self-start{place-self:start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-accent{border-color:#ffa022}.border-accent\/20{border-color:#ffa02233}.border-accent\/30{border-color:#ffa0224d}.border-accent\/40{border-color:#ffa02266}.border-accent\/50{border-color:#ffa02280}.border-accentSecondary\/20{border-color:#c8563733}.border-accentSecondary\/30{border-color:#c856374d}.border-accentSecondary\/40{border-color:#c8563766}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500) 50%,transparent)}}.border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/50{border-color:color-mix(in oklab,var(--color-emerald-500) 50%,transparent)}}.border-rose-500\/50{border-color:#ff235780}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/50{border-color:color-mix(in oklab,var(--color-rose-500) 50%,transparent)}}.border-slate-500\/50{border-color:#62748e80}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/50{border-color:color-mix(in oklab,var(--color-slate-500) 50%,transparent)}}.border-textMuted\/30{border-color:#cfcfcf4d}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-accent{background-color:#ffa022}.bg-accent\/5{background-color:#ffa0220d}.bg-accentSecondary{background-color:#c85637}.bg-accentSecondary\/10{background-color:#c856371a}.bg-accentSecondary\/20{background-color:#c8563733}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.bg-background{background-color:#272822}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-current{background-color:currentColor}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:c)DELIM" + R"DELIM(olor-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:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-accent{color:#ffa022}.text-accentSecondary{color:#c85637}.text-amber-300{color:var(--color-amber-300)}.text-emerald-300{color:var(--color-emerald-300)}.text-rose-300{color:var(--color-rose-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:#cfcfcf}.text-textPrimary{color:#ededed}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--)DELIM" + R"DELIM(tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-focus-within\:max-w-\[18rem\]:is(:where(.group):focus-within *){max-width:18rem}.group-focus-within\:translate-x-0:is(:where(.group):focus-within *){--tw-translate-x:calc(var(--spacing) * 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:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-textMuted::placeholder{color:#cfcfcf}.first\:text-left:first-child{text-align:left}.last\:text-right:last-child{text-align:right}.focus-within\:justify-start:focus-within{justify-content:flex-start}.focus-within\:gap-2:focus-within{gap:calc(var(--spacing) * 2)}.focus-within\:px-3:focus-within{padding-inline:calc(var(--spacing) * 3)}@media(hover:hover){.hover\:justify-start:hover{justify-content:flex-start}.hover\:gap-2:hover{gap:calc(var(--spacing) * 2)}.hover\:border-accent:hover{border-color:#ffa022}.hover\:border-accentSecondary:hover{border-color:#c85637}.hover\:bg-accentSecondary\/10:hover{background-color:#c856371a}.hover\:px-3:hover{padding-inline:calc(var(--spacing) * 3)}.hover\:text-accent:hover{color:#ffa022}.hover\:text-accentSecondary:hover{color:#c85637}}.focus\:border-accent:focus{border-color:#ffa022}.focus\:ring-accent:focus{--tw-ring-color:#ffa022}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-60:disabled{opacity:.6}@media(prefers-reduced-motion:no-preference){.motion-safe\:-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.motion-safe\:transition-\[max-width\,opacity\,transform\]{transition-property:max-width,opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:transition-\[padding\,gap\]{transition-property:padding,gap;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:duration-200{--tw-duration:.2s;transition-duration:.2s}.motion-safe\:ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}}@media(min-width:40rem){.sm\:block{display:block}.sm\:inline{display:inline}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}@media(min-width:48rem){.md\:order-2{order:2}.md\:order-3{order:3}.md\:order-4{order:4}.md\:ml-auto{margin-left:auto}.md\:hidden{display:none}.md\:inline{display:inline}.md\:w-72{width:calc(var(--spacing) * 72)}.m)DELIM" + R"DELIM(d\:w-auto{width:auto}.md\:flex-none{flex:none}.md\:flex-nowrap{flex-wrap:nowrap}}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}}@media(min-width:80rem){.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-\[minmax\(0\,1\.5fr\)_minmax\(20rem\,1fr\)\]{grid-template-columns:minmax(0,1.5fr) minmax(20rem,1fr)}}}:root{color-scheme:dark}body{font-family:var(--font-sans);color:#ededed;background-color:#272822}::selection{color:#272822;background-color:#ffa022}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@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 f547a5d4..bdedbf9a 100644 --- a/console/embedded/native_ecma.cpp +++ b/console/embedded/native_ecma.cpp @@ -22,68 +22,68 @@ namespace libbitcoin { namespace server { DEFINE_EMBEDDED_PAGE(native_pages, char, ecma, - R"DELIM(function DS(e,a){for(var i=0;il[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function i(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(s){if(s.ep)return;s.ep=!0;const u=i(s);fetch(s.href,u)}})();function th(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Kf={exports:{}},$l={};var _v;function kS(){if(_v)return $l;_v=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(l,s,u){var f=null;if(u!==void 0&&(f=""+u),s.key!==void 0&&(f=""+s.key),"key"in s){u={};for(var h in s)h!=="key"&&(u[h]=s[h])}else u=s;return s=u.ref,{$$typeof:e,type:l,key:f,ref:s!==void 0?s:null,props:u}}return $l.Fragment=a,$l.jsx=i,$l.jsxs=i,$l}var Ev;function LS(){return Ev||(Ev=1,Kf.exports=kS()),Kf.exports}var b=LS(),Vf={exports:{}},ze={};var Tv;function BS(){if(Tv)return ze;Tv=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function w(C){return C===null||typeof C!="object"?null:(C=x&&C[x]||C["@@iterator"],typeof C=="function"?C:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,z={};function M(C,P,ne){this.props=C,this.context=P,this.refs=z,this.updater=ne||_}M.prototype.isReactComponent={},M.prototype.setState=function(C,P){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,P,"setState")},M.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function L(){}L.prototype=M.prototype;function B(C,P,ne){this.props=C,this.context=P,this.refs=z,this.updater=ne||_}var Y=B.prototype=new L;Y.constructor=B,E(Y,M.prototype),Y.isPureReactComponent=!0;var K=Array.isArray;function ie(){}var I={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function se(C,P,ne){var le=ne.ref;return{$$typeof:e,type:C,key:P,ref:le!==void 0?le:null,props:ne}}function ue(C,P){return se(C.type,P,C.props)}function de(C){return typeof C=="object"&&C!==null&&C.$$typeof===e}function te(C){var P={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(ne){return P[ne]})}var ge=/\/+/g;function Ne(C,P){return typeof C=="object"&&C!==null&&C.key!=null?te(""+C.key):P.toString(36)}function V(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(ie,ie):(C.status="pending",C.then(function(P){C.status==="pending"&&(C.status="fulfilled",C.value=P)},function(P){C.status==="pending"&&(C.status="rejected",C.reason=P)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function O(C,P,ne,le,we){var Re=typeof C;(Re==="undefined"||Re==="boolean")&&(C=null);var oe=!1;if(C===null)oe=!0;else switch(Re){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(C.$$typeof){case e:case a:oe=!0;break;case g:return oe=C._init,O(oe(C._payload),P,ne,le,we)}}if(oe)return we=we(C),oe=le===""?"."+Ne(C,0):le,K(we)?(ne="",oe!=null&&(ne=oe.replace(ge,"$&/")+"/"),O(we,P,ne,"",function(Gt){return Gt})):we!=null&&(de(we)&&(we=ue(we,ne+(we.key==null||C&&C.key===we.key?"":(""+we.key).replace(ge,"$&/")+"/")+oe)),P.push(we)),1;oe=0;var Me=le===""?".":le+":";if(K(C))for(var Ae=0;Ae>>1,xe=O[re];if(0>>1;res(ne,W))les(we,ne)?(O[re]=we,O[le]=W,re=le):(O[re]=ne,O[P]=W,re=P);else if(les(we,W))O[re]=we,O[le]=W,re=le;else break e}}return Q}function s(O,Q){var W=O.sortIndex-Q.sortIndex;return W!==0?W:O.id-Q.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 f=Date,h=f.now();e.unstable_now=function(){return f.now()-h}}var p=[],m=[],g=1,v=null,x=3,w=!1,_=!1,E=!1,z=!1,M=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function Y(O){for(var Q=i(m);Q!==null;){if(Q.callback===null)l(m);else if(Q.startTime<=O)l(m),Q.sortIndex=Q.expirationTime,a(p,Q);else break;Q=i(m)}}function K(O){if(E=!1,Y(O),!_)if(i(p)!==null)_=!0,ie||(ie=!0,te());else{var Q=i(m);Q!==null&&V(K,Q.startTime-O)}}var ie=!1,I=-1,N=5,se=-1;function ue(){return z?!0:!(e.unstable_now()-seO&&ue());){var re=v.callback;if(typeof re=="function"){v.callback=null,x=v.priorityLevel;var xe=re(v.expirationTime<=O);if(O=e.unstable_now(),typeof xe=="function"){v.callback=xe,Y(O),Q=!0;break t}v===i(p)&&l(p),Y(O)}else l(p);v=i(p)}if(v!==null)Q=!0;else{var C=i(m);C!==null&&V(K,C.startTime-O),Q=!1}}break e}finally{v=null,x=W,w=!1}Q=void 0}}finally{Q?te():ie=!1}}}var te;if(typeof B=="function")te=function(){B(de)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,Ne=ge.port2;ge.port1.onmessage=de,te=function(){Ne.postMessage(null)}}else te=function(){M(de,0)};function V(O,Q){I=M(function(){O(e.unstable_now())},Q)}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||125re?(O.sortIndex=W,a(m,O),i(p)===null&&O===i(m)&&(E?(L(I),I=-1):E=!0,V(K,W-re))):(O.sortIndex=xe,a(p,O),_||w||(_=!0,ie||(ie=!0,te()))),O},e.unstable_shouldYield=ue,e.unstable_wrapCallback=function(O){var Q=x;return function(){var W=x;x=Q;try{return O.apply(this,arguments)}finally{x=W}}}})(If)),If}var Av;function $S(){return Av||(Av=1,Jf.exports=US()),Jf.exports}var Wf={exports:{}},Vt={};var Cv;function ZS(){if(Cv)return Vt;Cv=1;var e=ho();function a(p){var m="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),Wf.exports=ZS(),Wf.exports}var jv;function qS(){if(jv)return Zl;jv=1;var e=$S(),a=ho(),i=w0();function l(t){var n="https://react.dev/errors/"+t;if(1xe||(t.current=re[xe],re[xe]=null,xe--)}function ne(t,n){xe++,re[xe]=t.current,t.current=n}var le=C(null),we=C(null),Re=C(null),oe=C(null);function Me(t,n){switch(ne(Re,n),ne(we,t),ne(le,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Yy(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Yy(n),t=Fy(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}P(le),ne(le,t)}function Ae(){P(le),P(we),P(Re)}function Gt(t){t.memoizedState!==null&&ne(oe,t);var n=le.current,r=Fy(n,t.type);n!==r&&(ne(we,t),ne(le,r))}function Yt(t){we.current===t&&(P(le),P(we)),oe.current===t&&(P(oe),Ll._currentValue=W)}var wn,ht;function Ze(t){if(wn===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);wn=n&&n[1]||"",ht=-1l[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function i(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(s){if(s.ep)return;s.ep=!0;const u=i(s);fetch(s.href,u)}})();function ah(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xf={exports:{}},$l={};var Tv;function BS(){if(Tv)return $l;Tv=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(l,s,u){var f=null;if(u!==void 0&&(f=""+u),s.key!==void 0&&(f=""+s.key),"key"in s){u={};for(var h in s)h!=="key"&&(u[h]=s[h])}else u=s;return s=u.ref,{$$typeof:e,type:l,key:f,ref:s!==void 0?s:null,props:u}}return $l.Fragment=a,$l.jsx=i,$l.jsxs=i,$l}var Rv;function HS(){return Rv||(Rv=1,Xf.exports=BS()),Xf.exports}var g=HS(),Jf={exports:{}},ze={};var zv;function US(){if(zv)return ze;zv=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function w(C){return C===null||typeof C!="object"?null:(C=x&&C[x]||C["@@iterator"],typeof C=="function"?C:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,R={};function M(C,P,ne){this.props=C,this.context=P,this.refs=R,this.updater=ne||_}M.prototype.isReactComponent={},M.prototype.setState=function(C,P){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,P,"setState")},M.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function L(){}L.prototype=M.prototype;function B(C,P,ne){this.props=C,this.context=P,this.refs=R,this.updater=ne||_}var Y=B.prototype=new L;Y.constructor=B,E(Y,M.prototype),Y.isPureReactComponent=!0;var K=Array.isArray;function ie(){}var I={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function se(C,P,ne){var le=ne.ref;return{$$typeof:e,type:C,key:P,ref:le!==void 0?le:null,props:ne}}function ue(C,P){return se(C.type,P,C.props)}function de(C){return typeof C=="object"&&C!==null&&C.$$typeof===e}function te(C){var P={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(ne){return P[ne]})}var ge=/\/+/g;function Oe(C,P){return typeof C=="object"&&C!==null&&C.key!=null?te(""+C.key):P.toString(36)}function V(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(ie,ie):(C.status="pending",C.then(function(P){C.status==="pending"&&(C.status="fulfilled",C.value=P)},function(P){C.status==="pending"&&(C.status="rejected",C.reason=P)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function j(C,P,ne,le,we){var Re=typeof C;(Re==="undefined"||Re==="boolean")&&(C=null);var oe=!1;if(C===null)oe=!0;else switch(Re){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(C.$$typeof){case e:case a:oe=!0;break;case b:return oe=C._init,j(oe(C._payload),P,ne,le,we)}}if(oe)return we=we(C),oe=le===""?"."+Oe(C,0):le,K(we)?(ne="",oe!=null&&(ne=oe.replace(ge,"$&/")+"/"),j(we,P,ne,"",function(Gt){return Gt})):we!=null&&(de(we)&&(we=ue(we,ne+(we.key==null||C&&C.key===we.key?"":(""+we.key).replace(ge,"$&/")+"/")+oe)),P.push(we)),1;oe=0;var Me=le===""?".":le+":";if(K(C))for(var Ae=0;Ae>>1,xe=j[re];if(0>>1;res(ne,W))les(we,ne)?(j[re]=we,j[le]=W,re=le):(j[re]=ne,j[P]=W,re=P);else if(les(we,W))j[re]=we,j[le]=W,re=le;else break e}}return Q}function s(j,Q){var W=j.sortIndex-Q.sortIndex;return W!==0?W:j.id-Q.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 f=Date,h=f.now();e.unstable_now=function(){return f.now()-h}}var p=[],m=[],b=1,v=null,x=3,w=!1,_=!1,E=!1,R=!1,M=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function Y(j){for(var Q=i(m);Q!==null;){if(Q.callback===null)l(m);else if(Q.startTime<=j)l(m),Q.sortIndex=Q.expirationTime,a(p,Q);else break;Q=i(m)}}function K(j){if(E=!1,Y(j),!_)if(i(p)!==null)_=!0,ie||(ie=!0,te());else{var Q=i(m);Q!==null&&V(K,Q.startTime-j)}}var ie=!1,I=-1,O=5,se=-1;function ue(){return R?!0:!(e.unstable_now()-sej&&ue());){var re=v.callback;if(typeof re=="function"){v.callback=null,x=v.priorityLevel;var xe=re(v.expirationTime<=j);if(j=e.unstable_now(),typeof xe=="function"){v.callback=xe,Y(j),Q=!0;break t}v===i(p)&&l(p),Y(j)}else l(p);v=i(p)}if(v!==null)Q=!0;else{var C=i(m);C!==null&&V(K,C.startTime-j),Q=!1}}break e}finally{v=null,x=W,w=!1}Q=void 0}}finally{Q?te():ie=!1}}}var te;if(typeof B=="function")te=function(){B(de)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,Oe=ge.port2;ge.port1.onmessage=de,te=function(){Oe.postMessage(null)}}else te=function(){M(de,0)};function V(j,Q){I=M(function(){j(e.unstable_now())},Q)}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(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125re?(j.sortIndex=W,a(m,j),i(p)===null&&j===i(m)&&(E?(L(I),I=-1):E=!0,V(K,W-re))):(j.sortIndex=xe,a(p,j),_||w||(_=!0,ie||(ie=!0,te()))),j},e.unstable_shouldYield=ue,e.unstable_wrapCallback=function(j){var Q=x;return function(){var W=x;x=Q;try{return j.apply(this,arguments)}finally{x=W}}}})(ed)),ed}var jv;function qS(){return jv||(jv=1,Wf.exports=ZS()),Wf.exports}var td={exports:{}},Vt={};var Nv;function QS(){if(Nv)return Vt;Nv=1;var e=po();function a(p){var m="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),td.exports=QS(),td.exports}var Mv;function PS(){if(Mv)return Zl;Mv=1;var e=qS(),a=po(),i=E0();function l(t){var n="https://react.dev/errors/"+t;if(1xe||(t.current=re[xe],re[xe]=null,xe--)}function ne(t,n){xe++,re[xe]=t.current,t.current=n}var le=C(null),we=C(null),Re=C(null),oe=C(null);function Me(t,n){switch(ne(Re,n),ne(we,t),ne(le,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Ky(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Ky(n),t=Vy(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}P(le),ne(le,t)}function Ae(){P(le),P(we),P(Re)}function Gt(t){t.memoizedState!==null&&ne(oe,t);var n=le.current,r=Vy(n,t.type);n!==r&&(ne(we,t),ne(le,r))}function Yt(t){we.current===t&&(P(le),P(we)),oe.current===t&&(P(oe),Ll._currentValue=W)}var wn,ht;function Ze(t){if(wn===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);wn=n&&n[1]||"",ht=-1)":-1c||R[o]!==U[c]){var G=` -`+R[o].replace(" at new "," at ");return t.displayName&&G.includes("")&&(G=G.replace("",t.displayName)),G}while(1<=o&&0<=c);break}}}finally{lt=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?Ze(r):""}function Xe(t,n){switch(t.tag){case 26:case 27:case 5:return Ze(t.type);case 16:return Ze("Lazy");case 13:return t.child!==n&&n!==null?Ze("Suspense Fallback"):Ze("Suspense");case 19:return Ze("SuspenseList");case 0:case 15:return Pe(t.type,!1);case 11:return Pe(t.type.render,!1);case 1:return Pe(t.type,!0);case 31:return Ze("Activity");default:return""}}function Kn(t){try{var n="",r=null;do n+=Xe(t,r),r=t,t=t.return;while(t);return n}catch(o){return` +`);for(c=o=0;oc||z[o]!==U[c]){var G=` +`+z[o].replace(" at new "," at ");return t.displayName&&G.includes("")&&(G=G.replace("",t.displayName)),G}while(1<=o&&0<=c);break}}}finally{lt=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?Ze(r):""}function Xe(t,n){switch(t.tag){case 26:case 27:case 5:return Ze(t.type);case 16:return Ze("Lazy");case 13:return t.child!==n&&n!==null?Ze("Suspense Fallback"):Ze("Suspense");case 19:return Ze("SuspenseList");case 0:case 15:return Pe(t.type,!1);case 11:return Pe(t.type.render,!1);case 1:return Pe(t.type,!0);case 31:return Ze("Activity");default:return""}}function Kn(t){try{var n="",r=null;do n+=Xe(t,r),r=t,t=t.return;while(t);return n}catch(o){return` Error generating stack: `+o.message+` -`+o.stack}}var br=Object.prototype.hasOwnProperty,Na=e.unstable_scheduleCallback,Xi=e.unstable_cancelCallback,Lu=e.unstable_shouldYield,Bu=e.unstable_requestPaint,Jt=e.unstable_now,oa=e.unstable_getCurrentPriorityLevel,Ma=e.unstable_ImmediatePriority,Ji=e.unstable_UserBlockingPriority,Da=e.unstable_NormalPriority,$n=e.unstable_LowPriority,_n=e.unstable_IdlePriority,Eo=e.log,Hu=e.unstable_setDisableYieldValue,sa=null,It=null;function kt(t){if(typeof Eo=="function"&&Hu(t),It&&typeof It.setStrictMode=="function")try{It.setStrictMode(sa,t)}catch{}}var Ft=Math.clz32?Math.clz32:Uu,To=Math.log,Ro=Math.LN2;function Uu(t){return t>>>=0,t===0?32:31-(To(t)/Ro|0)|0}var xr=256,ua=262144,Sr=4194304;function Zn(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 Kr(t,n,r){var o=t.pendingLanes;if(o===0)return 0;var c=0,d=t.suspendedLanes,y=t.pingedLanes;t=t.warmLanes;var S=o&134217727;return S!==0?(o=S&~d,o!==0?c=Zn(o):(y&=S,y!==0?c=Zn(y):r||(r=S&~t,r!==0&&(c=Zn(r))))):(S=o&~d,S!==0?c=Zn(S):y!==0?c=Zn(y):r||(r=o&~t,r!==0&&(c=Zn(r)))),c===0?0:)DELIM" -R"DELIM(n!==0&&n!==c&&(n&d)===0&&(d=c&-c,r=n&-n,d>=r||d===32&&(r&4194048)!==0)?n:c}function ka(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function $u(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 Ii(){var t=Sr;return Sr<<=1,(Sr&62914560)===0&&(Sr=4194304),t}function La(t){for(var n=[],r=0;31>r;r++)n.push(t);return n}function Vn(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function zo(t,n,r,o,c,d){var y=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var S=t.entanglements,R=t.expirationTimes,U=t.hiddenUpdates;for(r=y&~r;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Ax=/[\n"\\]/g;function En(t){return t.replace(Ax,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Zu(t,n,r,o,c,d,y,S){t.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.type=y:t.removeAttribute("type"),n!=null?y==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Tt(n)):t.value!==""+Tt(n)&&(t.value=""+Tt(n)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),n!=null?qu(t,y,Tt(n)):r!=null?qu(t,y,Tt(r)):o!=null&&t.removeAttribute("value"),c==null&&d!=null&&(t.defaultChecked=!!d),c!=null&&(t.checked=c&&typeof c!="function"&&typeof c!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.name=""+Tt(S):t.removeAttribute("name")}function $h(t,n,r,o,c,d,y,S){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(t.type=d),n!=null||r!=null){if(!(d!=="submit"&&d!=="reset"||n!=null)){Jr(t);return}r=r!=null?""+Tt(r):"",n=n!=null?""+Tt(n):r,S||n===t.value||(t.value=n),t.defaultValue=n}o=o??c,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=S?t.checked:!!o,t.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),Jr(t)}function qu(t,n,r){n==="number"&&jo(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function Ir(t,n,r,o){if(t=t.options,n){n={};for(var c=0;c"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fu=!1;if(fa)try{var el={};Object.defineProperty(el,"passive",{get:function(){Fu=!0}}),window.addEventListener("test",el,el),window.removeEventListener("test",el,el)}catch{Fu=!1}var Ha=null,Ku=null,Mo=null;function Fh(){if(Mo)return Mo;var t,n=Ku,r=n.length,o,c="value"in Ha?Ha.value:Ha.textContent,d=c.length;for(t=0;t=al),Wh=" ",em=!1;function tm(t,n){switch(t){case"keyup":return n1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ni=!1;function r1(t,n){switch(t){case"compositionend":return nm(n);case"keypress":return n.which!==32?null:(em=!0,Wh);case"textInput":return t=n.data,t===Wh&&em?null:t;default:return null}}function i1(t,n){if(ni)return t==="compositionend"||!Wu&&tm(t,n)?(t=Fh(),Mo=Ku=Ha=null,ni=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:r,offset:n-t};t=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=cm(r)}}function dm(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?dm(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function hm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=jo(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=jo(t.document)}return n}function nc(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 h1=fa&&"documentMode"in document&&11>=document.documentMode,ai=null,ac=null,ol=null,rc=!1;function mm(t,n,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;rc||ai==null||ai!==jo(o)||(o=ai,"selectionStart"in o&&nc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ol&&ll(ol,o)||(ol=o,o=Rs(ac,"onSelect"),0>=y,c-=y,In=1<<32-Ft(n)+c|r<je?(Ue=ve,ve=null):Ue=ve.sibling;var Fe=Z(k,ve,H[je],F);if(Fe===null){ve===null&&(ve=Ue);break}t&&ve&&Fe.alternate===null&&n(k,ve),j=d(Fe,j,je),Ye===null?Se=Fe:Ye.sibling=Fe,Ye=Fe,ve=Ue}if(je===H.length)return r(k,ve),$e&&ha(k,je),Se;if(ve===null){for(;jeje?(Ue=ve,ve=null):Ue=ve.sibling;var lr=Z(k,ve,Fe.value,F);if(lr===null){ve===null&&(ve=U)DELIM" -R"DELIM(e);break}t&&ve&&lr.alternate===null&&n(k,ve),j=d(lr,j,je),Ye===null?Se=lr:Ye.sibling=lr,Ye=lr,ve=Ue}if(Fe.done)return r(k,ve),$e&&ha(k,je),Se;if(ve===null){for(;!Fe.done;je++,Fe=H.next())Fe=X(k,Fe.value,F),Fe!==null&&(j=d(Fe,j,je),Ye===null?Se=Fe:Ye.sibling=Fe,Ye=Fe);return $e&&ha(k,je),Se}for(ve=o(ve);!Fe.done;je++,Fe=H.next())Fe=q(ve,k,je,Fe.value,F),Fe!==null&&(t&&Fe.alternate!==null&&ve.delete(Fe.key===null?je:Fe.key),j=d(Fe,j,je),Ye===null?Se=Fe:Ye.sibling=Fe,Ye=Fe);return t&&ve.forEach(function(MS){return n(k,MS)}),$e&&ha(k,je),Se}function nt(k,j,H,F){if(typeof H=="object"&&H!==null&&H.type===E&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case w:e:{for(var Se=H.key;j!==null;){if(j.key===Se){if(Se=H.type,Se===E){if(j.tag===7){r(k,j.sibling),F=c(j,H.props.children),F.return=k,k=F;break e}}else if(j.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===N&&Mr(Se)===j.type){r(k,j.sibling),F=c(j,H.props),hl(F,H),F.return=k,k=F;break e}r(k,j);break}else n(k,j);j=j.sibling}H.type===E?(F=Ar(H.props.children,k.mode,F,H.key),F.return=k,k=F):(F=Qo(H.type,H.key,H.props,null,k.mode,F),hl(F,H),F.return=k,k=F)}return y(k);case _:e:{for(Se=H.key;j!==null;){if(j.key===Se)if(j.tag===4&&j.stateNode.containerInfo===H.containerInfo&&j.stateNode.implementation===H.implementation){r(k,j.sibling),F=c(j,H.children||[]),F.return=k,k=F;break e}else{r(k,j);break}else n(k,j);j=j.sibling}F=fc(H,k.mode,F),F.return=k,k=F}return y(k);case N:return H=Mr(H),nt(k,j,H,F)}if(V(H))return me(k,j,H,F);if(te(H)){if(Se=te(H),typeof Se!="function")throw Error(l(150));return H=Se.call(H),Te(k,j,H,F)}if(typeof H.then=="function")return nt(k,j,Xo(H),F);if(H.$$typeof===B)return nt(k,j,Yo(k,H),F);Jo(k,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,j!==null&&j.tag===6?(r(k,j.sibling),F=c(j,H),F.return=k,k=F):(r(k,j),F=cc(H,k.mode,F),F.return=k,k=F),y(k)):r(k,j)}return function(k,j,H,F){try{dl=0;var Se=nt(k,j,H,F);return mi=null,Se}catch(ve){if(ve===hi||ve===Ko)throw ve;var Ye=hn(29,ve,null,k.mode);return Ye.lanes=F,Ye.return=k,Ye}}}var kr=Bm(!0),Hm=Bm(!1),Qa=!1;function _c(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ec(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 Pa(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ga(t,n,r){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(Ve&2)!==0){var c=o.pending;return c===null?n.next=n:(n.next=c.next,c.next=n),o.pending=n,n=qo(t),Sm(t,null,r),n}return Zo(t,o,n,r),qo(t)}function ml(t,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,Co(t,r)}}function Tc(t,n){var r=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var c=null,d=null;if(r=r.firstBaseUpdate,r!==null){do{var y={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};d===null?c=d=y:d=d.next=y,r=r.next}while(r!==null);d===null?c=d=n:d=d.next=n}else c=d=n;r={baseState:o.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:o.shared,callbacks:o.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=n:t.next=n,r.lastBaseUpdate=n}var Rc=!1;function pl(){if(Rc){var t=di;if(t!==null)throw t}}function yl(t,n,r,o){Rc=!1;var c=t.updateQueue;Qa=!1;var d=c.firstBaseUpdate,y=c.lastBaseUpdate,S=c.shared.pending;if(S!==null){c.shared.pending=null;var R=S,U=R.next;R.next=null,y===null?d=U:y.next=U,y=R;var G=t.alternate;G!==null&&(G=G.updateQueue,S=G.lastBaseUpdate,S!==y&&(S===null?G.firstBaseUpdate=U:S.next=U,G.lastBaseUpdate=R))}if(d!==null){var X=c.baseState;y=0,G=U=R=null,S=d;do{var Z=S.lane&-536870913,q=Z!==S.lane;if(q?(He&Z)===Z:(o&Z)===Z){Z!==0&&Z===fi&&(Rc=!0),G!==null&&(G=G.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var me=t,Te=S;Z=n;var nt=r;switch(Te.tag){case 1:if(me=Te.payload,typeof me=="function"){X=me.call(nt,X,Z);break e}X=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=Te.payload,Z=typeof me=="function"?me.call(nt,X,Z):me,Z==null)break e;X=v({},X,Z);break e;case 2:Qa=!0}}Z=S.callback,Z!==null&&(t.flags|=64,q&&(t.flags|=8192),q=c.callbacks,q===null?c.callbacks=[Z]:q.push(Z))}else q={lane:Z,tag:S.tag,payload:S.payload,callback:S.callback,next:null},G===null?(U=G=q,R=X):G=G.next=q,y|=Z;if(S=S.next,S===null){if(S=c.shared.pending,S===null)break;q=S,S=q.next,q.next=null,c.lastBaseUpdate=q,c.shared.pending=null}}while(!0);G===null&&(R=X),c.baseState=R,c.firstBaseUpdate=U,c.lastBaseUpdate=G,d===null&&(c.shared.lanes=0),Xa|=y,t.lanes=y,t.memoizedState=X}}function Um(t,n){if(typeof t!="function")throw Error(l(191,t));t.call(n)}function $m(t,n){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;td?d:8;var y=O.T,S={};O.T=S,Gc(t,!1,n,r);try{var R=c(),U=O.S;if(U!==null&&U(S,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var G=w1(R,o);bl(t,n,G,gn(t))}else bl(t,n,o,gn(t))}catch(X){bl(t,n,{then:function(){},status:"rejected",reason:X},gn())}finally{Q.p=d,y!==null&&S.types!==null&&(y.types=S.types),O.T=y}}function A1(){}function Qc(t,n,r,o){if(t.tag!==5)throw Error(l(476));var c=gp(t).queue;vp(t,c,n,W,r===null?A1:function(){return bp(t),r(o)})}function gp(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:W},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:r},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function bp(t){var n=gp(t);n.next===null&&(n=t.alternate.memoizedState),bl(t,n.next.queue,{},gn())}function Pc(){return Ut(Ll)}function xp(){return St().memoizedState}function Sp(){return St().memoizedState}function C1(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var r=gn();t=Pa(r);var o=Ga(n,t,r);o!==null&&(sn(o,n,r),ml(o,n,r)),n={cache:bc()},t.payload=n;return}n=n.return}}function O1(t,n,r){var o=gn();r={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},os(t)?_p(n,r):(r=sc(t,n,r,o),r!==null&&(sn(r,t,o),Ep(r,n,o)))}function wp(t,n,r){var o=gn();bl(t,n,r,o)}function bl(t,n,r,o){var c={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(os(t))_p(n,c);else{var d=t.alternate;if(t.lanes===0&&(d===null||d.lanes===0)&&(d=n.lastRenderedReducer,d!==null))try{var y=n.lastRenderedState,S=d(y,r);if(c.hasEagerState=!0,c.eagerState=S,dn(S,y))return Zo(t,n,c,0),rt===null&&$o(),!1}catch{}if(r=sc(t,n,c,o),r!==null)return sn(r,t,o),Ep(r,n,o),!0}return!1}function Gc(t,n,r,o){if(o={lane:2,revertLane:Ef(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},os(t)){if(n)throw Error(l(479))}else n=sc(t,r,o,2),n!==null&&sn(n,t,2)}function os(t){var n=t.alternate;return t===Ce||n!==null&&n===Ce}function _p(t,n){yi=es=!0;var r=t.pending;r===null?n.next=n:(n.next=r.next,r.next=n),t.pending=n}function Ep(t,n,r){if((r&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,Co(t,r)}}var xl={readContext:Ut,use:as,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt};xl.useEffectEvent=yt;var Tp={readContext:Ut,use:as,useCallback:function(t,n){return Wt().memoizedState=[t,n===void 0?null:n],t},useContext:Ut,useEffect:sp,useImperativeHandle:function(t,n,r){r=r!=null?r.concat([t]):null,is(4194308,4,dp.bind(null,n,t),r)},useLayoutEffect:function(t,n){return is(4194308,4,t,n)},useInsertionEffect:function(t,n){is(4,2,t,n)},useMemo:function(t,n){var r=Wt();n=n===void 0?null:n;var o=t();if(Lr){kt(!0);try{t()}finally{kt(!1)}}return r.memoizedState=[o,n],o},useReducer:function(t,n,r){var o=Wt();if(r!==void 0){var c=r(n);if(Lr){kt(!0);try{r(n)}finally{kt(!1)}}}else c=n;return o.memoizedState=o.baseState=c,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:c},o.queue=t,t=t.dispatch=O1.bind(null,Ce,t),[o.memoizedState,t]},useRef:function(t){var n=Wt();return t={current:t},n.memoizedState=t},useState:function(t){t=Hc(t);var n=t.queue,r=wp.bind(null,Ce,n);return n.dispatch=r,[t.memoizedState,r]},useDebugValue:Zc,useDeferredValue:function(t,n){var r=Wt();return qc(r,t,n)},useTransition:function(){var t=Hc(!1);return t=vp.bind(null,Ce,t.queue,!0,!1),Wt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,r){var o=Ce,c=Wt();if($e){if(r===void 0)throw Error(l(407));r=r()}else{if(r=n(),rt===null)throw Error(l(349));(He&127)!==0||Ym(o,n,r)}c.memoizedState=r;var d={value:r,getSnapshot:n};return c.queue=d,sp(Km.bind(null)DELIM" -R"DELIM(,o,d,t),[t]),o.flags|=2048,gi(9,{destroy:void 0},Fm.bind(null,o,d,r,n),null),r},useId:function(){var t=Wt(),n=rt.identifierPrefix;if($e){var r=Wn,o=In;r=(o&~(1<<32-Ft(o)-1)).toString(32)+r,n="_"+n+"R_"+r,r=ts++,0<\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof o.is=="string"?y.createElement("select",{is:o.is}):y.createElement("select"),o.multiple?d.multiple=!0:o.size&&(d.size=o.size);break;default:d=typeof o.is=="string"?y.createElement(c,{is:o.is}):y.createElement(c)}}d[ce]=n,d[fe]=o;e:for(y=n.child;y!==null;){if(y.tag===5||y.tag===6)d.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===n)break e;for(;y.sibling===null;){if(y.return===null||y.return===n)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}n.stateNode=d;e:switch(Zt(d,c,o),c){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ba(n)}}return ct(n),lf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,r),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&ba(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(l(166));if(t=Re.current,ui(n)){if(t=n.stateNode,r=n.memoizedProps,o=null,c=Ht,c!==null)switch(c.tag){case 27:case 5:o=c.memoizedProps}t[ce]=n,t=!!(t.nodeValue===r||o!==null&&o.suppressHydrationWarning===!0||Py(t.nodeValue,r)),t||Za(n,!0)}else t=zs(t).createTextNode(o),t[ce]=n,n.stateNode=t}return ct(n),null;case 31:if(r=n.memoizedState,t===null||t.memoizedState!==null){if(o=ui(n),r!==null){if(t===null){if(!o)throw Error(l(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[ce]=n}else Cr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ct(n),t=!1}else r=pc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return n.flags&256?(pn(n),n):(pn(n),null);if((n.flags&128)!==0)throw Error(l(558))}return ct(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(c=ui(n),o!==null&&o.dehydrated!==null){if(t===null){if(!c)throw Error(l(318));if(c=n.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(l(317));c[ce]=n}else Cr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ct(n),c=!1}else c=pc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=c),c=!0;if(!c)return n.flags&256?(pn(n),n):(pn(n),null)}return pn(n),(n.flags&128)!==0?(n.lanes=r,n):(r=o!==null,t=t!==null&&t.memoizedState!==null,r&&(o=n.child,c=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(c=o.alternate.memoizedState.cachePool.pool),d=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),d!==c&&(o.flags|=2048)),r!==t&&r&&(n.child.flags|=8192),ds(n,n.updateQueue),ct(n),null);case 4:return Ae(),t===null&&Af(n.stateNode.containerInfo),ct(n),null;case 10:return pa(n.type),ct(n),null;case 19:if(P(xt),o=n.memoizedState,o===null)return ct(n),null;if(c=(n.flags&128)!==0,d=o.rendering,d===null)if(c)wl(o,!1);else{if(vt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(d=Wo(t),d!==null){for(n.flags|=128,wl(o,!1),t=d.updateQueue,n.updateQueue=t,ds(n,t),n.subtreeFlags=0,t=r,r=n.child;r!==null;)wm(r,t),r=r.sibling;return ne(xt,xt.current&1|2),$e&&ha(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Jt()>vs&&(n.flags|=128,c=!0,wl(o,!1),n.lanes=4194304)}else{if(!c)if(t=Wo(d),t!==null){if(n.flags|=128,c=!0,t=t.updateQueue,n.updateQueue=t,ds(n,t),wl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!d.alternate&&!$e)return ct(n),null}else 2*Jt()-o.renderingStartTime>vs&&r!==536870912&&(n.flags|=128,c=!0,wl(o,!1),n.lanes=4194304);o.isBackwards?(d.sibling=n.child,n.child=d):(t=o.last,t!==null?t.sibling=d:n.child=d,o.last=d)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Jt(),t.sibling=null,r=xt.current,ne(xt,c?r&1|2:r&1),$e&&ha(n,o.treeForkCount),t):(ct(n),null);case 22:case 23:return pn(n),Ac(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(r&536870912)!==0&&(n.flags&128)===0&&(ct(n),n.subtreeFlags&6&&(n.flags|=8192)):ct(n),r=n.updateQueue,r!==null&&ds(n,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048),t!==null&&P(Nr),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),pa(Rt),ct(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function k1(t,n){switch(hc(n),n.tag){case 1:return t=n.flags,t&65536)DELIM" -R"DELIM(?(n.flags=t&-65537|128,n):null;case 3:return pa(Rt),Ae(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Yt(n),null;case 31:if(n.memoizedState!==null){if(pn(n),n.alternate===null)throw Error(l(340));Cr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(pn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(l(340));Cr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return P(xt),null;case 4:return Ae(),null;case 10:return pa(n.type),null;case 22:case 23:return pn(n),Ac(),t!==null&&P(Nr),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return pa(Rt),null;case 25:return null;default:return null}}function Vp(t,n){switch(hc(n),n.tag){case 3:pa(Rt),Ae();break;case 26:case 27:case 5:Yt(n);break;case 4:Ae();break;case 31:n.memoizedState!==null&&pn(n);break;case 13:pn(n);break;case 19:P(xt);break;case 10:pa(n.type);break;case 22:case 23:pn(n),Ac(),t!==null&&P(Nr);break;case 24:pa(Rt)}}function _l(t,n){try{var r=n.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var c=o.next;r=c;do{if((r.tag&t)===t){o=void 0;var d=r.create,y=r.inst;o=d(),y.destroy=o}r=r.next}while(r!==c)}}catch(S){Ie(n,n.return,S)}}function Ka(t,n,r){try{var o=n.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var d=c.next;o=d;do{if((o.tag&t)===t){var y=o.inst,S=y.destroy;if(S!==void 0){y.destroy=void 0,c=n;var R=r,U=S;try{U()}catch(G){Ie(c,R,G)}}}o=o.next}while(o!==d)}}catch(G){Ie(n,n.return,G)}}function Xp(t){var n=t.updateQueue;if(n!==null){var r=t.stateNode;try{$m(n,r)}catch(o){Ie(t,t.return,o)}}}function Jp(t,n,r){r.props=Br(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(o){Ie(t,n,o)}}function El(t,n){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof r=="function"?t.refCleanup=r(o):r.current=o}}catch(c){Ie(t,n,c)}}function ea(t,n){var r=t.ref,o=t.refCleanup;if(r!==null)if(typeof o=="function")try{o()}catch(c){Ie(t,n,c)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(c){Ie(t,n,c)}else r.current=null}function Ip(t){var n=t.type,r=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&o.focus();break e;case"img":r.src?o.src=r.src:r.srcSet&&(o.srcset=r.srcSet)}}catch(c){Ie(t,t.return,c)}}function of(t,n,r){try{var o=t.stateNode;aS(o,t.type,r,n),o[fe]=n}catch(c){Ie(t,t.return,c)}}function Wp(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&tr(t.type)||t.tag===4}function sf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Wp(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&&tr(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 uf(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(t),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=ca));else if(o!==4&&(o===27&&tr(t.type)&&(r=t.stateNode,n=null),t=t.child,t!==null))for(uf(t,n,r),t=t.sibling;t!==null;)uf(t,n,r),t=t.sibling}function hs(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?r.insertBefore(t,n):r.appendChild(t);else if(o!==4&&(o===27&&tr(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(hs(t,n,r),t=t.sibling;t!==null;)hs(t,n,r),t=t.sibling}function ey(t){var n=t.stateNode,r=t.memoizedProps;try{for(var o=t.type,c=n.attributes;c.length;)n.removeAttributeNode(c[0]);Zt(n,o,r),n[ce]=t,n[fe]=r}catch(d){Ie(t,t.return,d)}}var xa=!1,Ct=!1,cf=!1,ty=typeof WeakSet=="function"?WeakSet:Set,Bt=null;function L1(t,n){if(t=t.containerInfo,jf=Ds,t=hm(t),nc(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var c=o.anchorOffset,d=o.focusNode;o=o.focusOffset;try{r.nodeType,d.nodeType}catch{r=null;break e}var y=0,S=-1,R=-1,U=0,G=0,X=t,Z=null;t:for(;;){for(var q;X!==r||c!==0&&X.nodeType!==3||(S=y+c),X!==d||o!==0&&X.nodeType!==3||(R=y+o),X.nodeType===3&&(y+=X.nodeValue.length),(q=X.firstChild)!==null;)Z=X,X=q;for(;;){if(X===t)break t;if(Z===r&&++U===c&&(S=y),Z===d&&++G===o&&(R=y),(q=X.nextSibling)!==null)break;X=Z,Z=X.parentNode}X=q}r=S===-1||R===-1?null:{start:S,end:R}}else r=null}r=r||{start:0,end:0}}else r=null;for(Nf={focusedElem:t,selectionRange:r},Ds=!1,Bt=n;Bt!==null;)if(n=Bt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Bt=t;else for(;Bt!==null;){switch(n=Bt,d=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(r=0;r title"))),Zt(d,o,r),d[ce]=t,it(d),o=d;break e;case"link":var y=ov("link","href",c).get(o+(r.href||""));if(y){for(var S=0;Snt&&(y=nt,nt=Te,Te=y);var k=fm(S,Te),j=fm(S,nt);if(k&&j&&(q.rangeCount!==1||q.anchorNode!==k.node||q.anchorOffset!==k.offset||q.focusNode!==j.node||q.focusOffset!==j.offset)){var H=X.createRange();H.setStart(k.node,k.offset),q.removeAllRanges(),Te>nt?(q.addRange(H),q.extend(j.node,j.offset)):(H.setEnd(j.node,j.offset),q.addRange(H))}}}}for(X=[],q=S;q=q.parentNode;)q.nodeType===1&&X.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;Sr?32:r,O.T=null,r=vf,vf=null;var d=Ia,y=Ta;if(Mt=0,_i=Ia=null,Ta=0,(Ve&6)!==0)throw Error(l(331));var S=Ve;if(Ve|=4,dy(d.current),uy(d,d.current,y,r),Ve=S,Ol(0,!1),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(sa,d)}catch{}return!0}finally{Q.p=c,O.T=o,Oy(t,n)}}function Ny(t,n,r){n=Rn(r,n),n=Vc(t.stateNode,n,2),t=Ga(t,n,2),t!==null&&(Vn(t,2),ta(t))}function Ie(t,n,r){if(t.tag===3)Ny(t,t,r);else for(;n!==null;){if(n.tag===3){Ny(n,t,r);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.com)DELIM" -R"DELIM(ponentDidCatch=="function"&&(Ja===null||!Ja.has(o))){t=Rn(r,t),r=Mp(2),o=Ga(n,r,2),o!==null&&(Dp(r,o,n,t),Vn(o,2),ta(o));break}}n=n.return}}function Sf(t,n,r){var o=t.pingCache;if(o===null){o=t.pingCache=new U1;var c=new Set;o.set(n,c)}else c=o.get(n),c===void 0&&(c=new Set,o.set(n,c));c.has(r)||(hf=!0,c.add(r),t=P1.bind(null,t,n,r),n.then(t,t))}function P1(t,n,r){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,rt===t&&(He&r)===r&&(vt===4||vt===3&&(He&62914560)===He&&300>Jt()-ys?(Ve&2)===0&&Ei(t,0):mf|=r,wi===He&&(wi=0)),ta(t)}function My(t,n){n===0&&(n=Ii()),t=zr(t,n),t!==null&&(Vn(t,n),ta(t))}function G1(t){var n=t.memoizedState,r=0;n!==null&&(r=n.retryLane),My(t,r)}function Y1(t,n){var r=0;switch(t.tag){case 31:case 13:var o=t.stateNode,c=t.memoizedState;c!==null&&(r=c.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(n),My(t,r)}function F1(t,n){return Na(t,n)}var _s=null,Ri=null,wf=!1,Es=!1,_f=!1,er=0;function ta(t){t!==Ri&&t.next===null&&(Ri===null?_s=Ri=t:Ri=Ri.next=t),Es=!0,wf||(wf=!0,V1())}function Ol(t,n){if(!_f&&Es){_f=!0;do for(var r=!1,o=_s;o!==null;){if(t!==0){var c=o.pendingLanes;if(c===0)var d=0;else{var y=o.suspendedLanes,S=o.pingedLanes;d=(1<<31-Ft(42|t)+1)-1,d&=c&~(y&~S),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(r=!0,By(o,d))}else d=He,d=Kr(o,o===rt?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(d&3)===0||ka(o,d)||(r=!0,By(o,d));o=o.next}while(r);_f=!1}}function K1(){Dy()}function Dy(){Es=wf=!1;var t=0;er!==0&&iS()&&(t=er);for(var n=Jt(),r=null,o=_s;o!==null;){var c=o.next,d=ky(o,n);d===0?(o.next=null,r===null?_s=c:r.next=c,c===null&&(Ri=r)):(r=o,(t!==0||(d&3)!==0)&&(Es=!0)),o=c}Mt!==0&&Mt!==5||Ol(t),er!==0&&(er=0)}function ky(t,n){for(var r=t.suspendedLanes,o=t.pingedLanes,c=t.expirationTimes,d=t.pendingLanes&-62914561;0S)break;var G=R.transferSize,X=R.initiatorType;G&&Gy(X)&&(R=R.responseEnd,y+=G*(R"u"?null:document;function av(t,n,r){var o=zi;if(o&&typeof n=="string"&&n){var c=En(n);c='link[rel="'+t+'"][href="'+c+'"]',typeof r=="string"&&(c+='[crossorigin="'+r+'"]'),nv.has(c)||(nv.add(c),t={rel:t,crossOrigin:r,href:n},o.querySelector(c)===null&&(n=o.createElement("link"),Zt(n,"link",t),it(n),o.head.appendChild(n)))}}function mS(t){Ra.D(t),av("dns-prefetch",t,null)}function pS(t,n){Ra.C(t,n),av("preconnect",t,n)}function yS(t,n,r){Ra.L(t,n,r);var o=zi;if(o&&t&&n){var c='link[rel="preload"][as="'+En(n)+'"]';n==="image"&&r&&r.imageSrcSet?(c+='[imagesrcset="'+En(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(c+='[imagesizes="'+En(r.imageSizes)+'"]')):c+='[href="'+En(t)+'"]';var d=c;switch(n){case"style":d=Ai(t);break;case"script":d=Ci(t)}Nn.has(d)||(t=v({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:t,as:n},r),Nn.set(d,t),o.querySelector(c)!==null||n==="style"&&o.querySelector(Dl(d))||n==="script"&&o.querySelector(kl(d))||(n=o.createElement("link"),Zt(n,"link",t),it(n),o.head.appendChild(n)))}}function vS(t,n){Ra.m(t,n);var r=zi;if(r&&t){var o=n&&typeof n.as=="string"?n.as:"script",c='link[rel="modulepreload"][as="'+En(o)+'"][href="'+En(t)+'"]',d=c;switch(o){case"audioworklet":case"paintworklet":case"serv)DELIM" -R"DELIM(iceworker":case"sharedworker":case"worker":case"script":d=Ci(t)}if(!Nn.has(d)&&(t=v({rel:"modulepreload",href:t},n),Nn.set(d,t),r.querySelector(c)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(kl(d)))return}o=r.createElement("link"),Zt(o,"link",t),it(o),r.head.appendChild(o)}}}function gS(t,n,r){Ra.S(t,n,r);var o=zi;if(o&&t){var c=Et(o).hoistableStyles,d=Ai(t);n=n||"default";var y=c.get(d);if(!y){var S={loading:0,preload:null};if(y=o.querySelector(Dl(d)))S.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":n},r),(r=Nn.get(d))&&Uf(t,r);var R=y=o.createElement("link");it(R),Zt(R,"link",t),R._p=new Promise(function(U,G){R.onload=U,R.onerror=G}),R.addEventListener("load",function(){S.loading|=1}),R.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Cs(y,n,o)}y={type:"stylesheet",instance:y,count:1,state:S},c.set(d,y)}}}function bS(t,n){Ra.X(t,n);var r=zi;if(r&&t){var o=Et(r).hoistableScripts,c=Ci(t),d=o.get(c);d||(d=r.querySelector(kl(c)),d||(t=v({src:t,async:!0},n),(n=Nn.get(c))&&$f(t,n),d=r.createElement("script"),it(d),Zt(d,"link",t),r.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(c,d))}}function xS(t,n){Ra.M(t,n);var r=zi;if(r&&t){var o=Et(r).hoistableScripts,c=Ci(t),d=o.get(c);d||(d=r.querySelector(kl(c)),d||(t=v({src:t,async:!0,type:"module"},n),(n=Nn.get(c))&&$f(t,n),d=r.createElement("script"),it(d),Zt(d,"link",t),r.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(c,d))}}function rv(t,n,r,o){var c=(c=Re.current)?As(c):null;if(!c)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=Ai(r.href),r=Et(c).hoistableStyles,o=r.get(n),o||(o={type:"style",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Ai(r.href);var d=Et(c).hoistableStyles,y=d.get(t);if(y||(c=c.ownerDocument||c,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(t,y),(d=c.querySelector(Dl(t)))&&!d._p&&(y.instance=d,y.state.loading=5),Nn.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},Nn.set(t,r),d||SS(c,t,r,y.state))),n&&o===null)throw Error(l(528,""));return y}if(n&&o!==null)throw Error(l(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ci(r),r=Et(c).hoistableScripts,o=r.get(n),o||(o={type:"script",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function Ai(t){return'href="'+En(t)+'"'}function Dl(t){return'link[rel="stylesheet"]['+t+"]"}function iv(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function SS(t,n,r,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),Zt(n,"link",r),it(n),t.head.appendChild(n))}function Ci(t){return'[src="'+En(t)+'"]'}function kl(t){return"script[async]"+t}function lv(t,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+En(r.href)+'"]');if(o)return n.instance=o,it(o),o;var c=v({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),it(o),Zt(o,"style",c),Cs(o,r.precedence,t),n.instance=o;case"stylesheet":c=Ai(r.href);var d=t.querySelector(Dl(c));if(d)return n.state.loading|=4,n.instance=d,it(d),d;o=iv(r),(c=Nn.get(c))&&Uf(o,c),d=(t.ownerDocument||t).createElement("link"),it(d);var y=d;return y._p=new Promise(function(S,R){y.onload=S,y.onerror=R}),Zt(d,"link",o),n.state.loading|=4,Cs(d,r.precedence,t),n.instance=d;case"script":return d=Ci(r.src),(c=t.querySelector(kl(d)))?(n.instance=c,it(c),c):(o=r,(c=Nn.get(d))&&(o=v({},r),$f(o,c)),t=t.ownerDocument||t,c=t.createElement("script"),it(c),Zt(c,"link",o),t.head.appendChild(c),n.instance=c);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Cs(o,r.precedence,t));return n.instance}function Cs(t,n,r){for(var o=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=o.length?o[o.length-1]:null,d=c,y=0;y title"):null)}function wS(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 uv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function _S(t,n,r,o){if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var c=Ai(o.href),d=n.querySelector(Dl(c));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=js.bind(t),n.then(t,t)),r.state.loading|=4,r.instance=d,it(d);return}d=n.ownerDocument||n,o=iv(o),(c=Nn.get(c))&&Uf(o,c),d=d.createElement("link"),it(d);var y=d;y._p=new Promise(function(S,R){y.onload=S,y.onerror=R}),Zt(d,"link",o),r.instance=d}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(t.count++,r=js.bind(t),n.addEventListener("load",r),n.addEventListener("error",r))}}var Zf=0;function ES(t,n){return t.stylesheets&&t.count===0&&Ms(t,t.stylesheets),0Zf?50:800)+n);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(c)}}:null}function js(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ms(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ns=null;function Ms(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ns=new Map,n.forEach(TS,t),Ns=null,js.call(t))}function TS(t,n){if(!(n.state.loading&4)){var r=Ns.get(t);if(r)var o=r.get(null);else{r=new Map,Ns.set(t,r);for(var c=t.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),Xf.exports=qS(),Xf.exports}var PS=QS();const GS=th(PS);var mo=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(){}},YS=class extends mo{#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.onFocu)DELIM" -R"DELIM(s()})}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"}},nh=new YS,FS={setTimeout:(e,a)=>setTimeout(e,a),clearTimeout:e=>clearTimeout(e),setInterval:(e,a)=>setInterval(e,a),clearInterval:e=>clearInterval(e)},KS=class{#e=FS;#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)}},Zr=new KS;function VS(e){setTimeout(e,0)}var XS=typeof window>"u"||"Deno"in globalThis;function un(){}function JS(e,a){return typeof e=="function"?e(a):e}function kd(e){return typeof e=="number"&&e>=0&&e!==1/0}function _0(e,a){return Math.max(e+(a||0)-Date.now(),0)}function mr(e,a){return typeof e=="function"?e(a):e}function Dn(e,a){return typeof e=="function"?e(a):e}function Mv(e,a){const{type:i="all",exact:l,fetchStatus:s,predicate:u,queryKey:f,stale:h}=e;if(f){if(l){if(a.queryHash!==ah(f,a.options))return!1}else if(!no(a.queryKey,f))return!1}if(i!=="all"){const p=a.isActive();if(i==="active"&&!p||i==="inactive"&&p)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||s&&s!==a.state.fetchStatus||u&&!u(a))}function Dv(e,a){const{exact:i,status:l,predicate:s,mutationKey:u}=e;if(u){if(!a.options.mutationKey)return!1;if(i){if(to(a.options.mutationKey)!==to(u))return!1}else if(!no(a.options.mutationKey,u))return!1}return!(l&&a.state.status!==l||s&&!s(a))}function ah(e,a){return(a?.queryKeyHashFn||to)(e)}function to(e){return JSON.stringify(e,(a,i)=>Bd(i)?Object.keys(i).sort().reduce((l,s)=>(l[s]=i[s],l),{}):i)}function no(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(i=>no(e[i],a[i])):!1}var IS=Object.prototype.hasOwnProperty;function E0(e,a,i=0){if(e===a)return e;if(i>500)return a;const l=kv(e)&&kv(a);if(!l&&!(Bd(e)&&Bd(a)))return a;const u=(l?e:Object.keys(e)).length,f=l?a:Object.keys(a),h=f.length,p=l?new Array(h):{};let m=0;for(let g=0;g{Zr.setTimeout(a,e)})}function Hd(e,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,a):i.structuralSharing!==!1?E0(e,a):a}function ew(e,a,i=0){const l=[...e,a];return i&&l.length>i?l.slice(1):l}function tw(e,a,i=0){const l=[a,...e];return i&&l.length>i?l.slice(0,-1):l}var rh=Symbol();function T0(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===rh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function R0(e,a){return typeof e=="function"?e(...a):!!e}function nw(e,a,i){let l=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=a(),l||(l=!0,s.aborted?i():s.addEventListener("abort",i,{once:!0})),s)}),e}var ao=(()=>{let e=()=>XS;return{isServer(){return e()},setIsServer(a){e=a}}})();function Ud(){let e,a;const i=new Promise((s,u)=>{e=s,a=u});i.status="pending",i.catch(()=>{});function l(s){Object.assign(i,s),delete i.resolve,delete i.reject}return i.resolve=s=>{l({status:"fulfilled",value:s}),e(s)},i.reject=s=>{l({status:"rejected",reason:s}),a(s)},i}var aw=VS;function rw(){let e=[],a=0,i=h=>{h()},l=h=>{h()},s=aw;const u=h=>{a?e.push(h):s(()=>{i(h)})},f=()=>{const h=e;e=[],h.length&&s(()=>{l(()=>{h.forEach(p=>{i(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||f()}return p},batchCalls:h=>(...p)=>{u(()=>{h(...p)})},schedule:u,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{l=h},setScheduler:h=>{s=h}}}var Qt=rw(),iw=class extends mo{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const a=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#e}},du=new iw;function lw(e){return Math.min()DELIM" -R"DELIM(1e3*2**e,3e4)}function z0(e){return(e??"online")==="online"?du.isOnline():!0}var $d=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function A0(e){let a=!1,i=0,l;const s=Ud(),u=()=>s.status!=="pending",f=E=>{if(!u()){const z=new $d(E);x(z),e.onCancel?.(z)}},h=()=>{a=!0},p=()=>{a=!1},m=()=>nh.isFocused()&&(e.networkMode==="always"||du.isOnline())&&e.canRun(),g=()=>z0(e.networkMode)&&e.canRun(),v=E=>{u()||(l?.(),s.resolve(E))},x=E=>{u()||(l?.(),s.reject(E))},w=()=>new Promise(E=>{l=z=>{(u()||m())&&E(z)},e.onPause?.()}).then(()=>{l=void 0,u()||e.onContinue?.()}),_=()=>{if(u())return;let E;const z=i===0?e.initialPromise:void 0;try{E=z??e.fn()}catch(M){E=Promise.reject(M)}Promise.resolve(E).then(v).catch(M=>{if(u())return;const L=e.retry??(ao.isServer()?0:3),B=e.retryDelay??lw,Y=typeof B=="function"?B(i,M):B,K=L===!0||typeof L=="number"&&im()?void 0:w()).then(()=>{a?x(M):_()})})};return{promise:s,status:()=>s.status,cancel:f,continue:()=>(l?.(),s),cancelRetry:h,continueRetry:p,canStart:g,start:()=>(g()?_():w().then(_),s)}}var C0=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),kd(this.gcTime)&&(this.#e=Zr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ao.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Zr.clearTimeout(this.#e),this.#e=void 0)}},ow=class extends C0{#e;#t;#n;#r;#a;#l;#i;constructor(e){super(),this.#i=!1,this.#l=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Hv(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#l,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=Hv(this.options);a.data!==void 0&&(this.setState(Bv(a.data,a.dataUpdatedAt)),this.#e=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,a){const i=Hd(this.state.data,e,this.options);return this.#s({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}setState(e,a){this.#s({type:"setState",state:e,setStateOptions:a})}cancel(e){const a=this.#a?.promise;return this.#a?.cancel(e),a?a.then(un).catch(un):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Dn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rh||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>mr(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:!_0(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.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.#a&&(this.#i||this.#o()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#o(){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.#a?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,l=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#i=!0,i.signal)})},s=()=>{const h=T0(this.options,a),m=(()=>{const g={client:this.#r,queryKey:this.queryKey,meta:this.meta};return l(g),g})();return this.#i=!1,this.options.persister?this.options.persister(h,m,this):h(m)},f=(()=>{const h={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:s};return l(h),h})();this.options.behavior?.onFetch(f,thi)DELIM" -R"DELIM(s),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#s({type:"fetch",meta:f.fetchOptions?.meta}),this.#a=A0({initialPromise:a?.initialPromise,fn:f.fetchFn,onCancel:h=>{h instanceof $d&&h.revert&&this.setState({...this.#t,fetchStatus:"idle"}),i.abort()},onFail:(h,p)=>{this.#s({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const h=await this.#a.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof $d){if(h.silent)return this.#a.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#s({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}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,...O0(i.data,this.options),fetchMeta:e.meta??null};case"success":const l={...i,...Bv(e.data,e.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?l:void 0,l;case"error":const s=e.error;return{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=a(this.state),Qt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function O0(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:z0(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Bv(e,a){return{data:e,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Hv(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,i=a!==void 0,l=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var sw=class extends mo{constructor(e,a){super(),this.options=a,this.#e=e,this.#o=null,this.#i=Ud(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#r=void 0;#a;#l;#i;#o;#s;#h;#m;#c;#f;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Uv(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Zd(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Zd(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 Dn(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&&!Ld(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const l=this.hasListeners();l&&$v(this.#t,i,this.options,a)&&this.#d(),this.updateResult(),l&&(this.#t!==i||Dn(this.options.enabled,this.#t)!==Dn(a.enabled,this.#t)||mr(this.options.staleTime,this.#t)!==mr(a.staleTime,this.#t))&&this.#y();const s=this.#v();l&&(this.#t!==i||Dn(this.options.enabled,this.#t)!==Dn(a.enabled,this.#t)||s!==this.#u)&&this.#g(s)}getOptimisticResult(e){const a=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(a,e);return cw(this,i)&&(this.#r=i,this.#l=this.options,this.#a=this.#t.state),i}getCurrentResult(){return this.#r}trackResult(e,a){return new Proxy(e,{get:(i,l)=>(this.trackProp(l),a?.(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,l))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=this.#e.defaultQueryOptions(e),i=this.#e.getQueryCache().build(this)DELIM" -R"DELIM(.#e,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(e){this.#w();let a=this.#t.fetch(this.options,e);return e?.throwOnError||(a=a.catch(un)),a}#y(){this.#x();const e=mr(this.options.staleTime,this.#t);if(ao.isServer()||this.#r.isStale||!kd(e))return;const i=_0(this.#r.dataUpdatedAt,e)+1;this.#c=Zr.setTimeout(()=>{this.#r.isStale||this.updateResult()},i)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#g(e){this.#S(),this.#u=e,!(ao.isServer()||Dn(this.options.enabled,this.#t)===!1||!kd(this.#u)||this.#u===0)&&(this.#f=Zr.setInterval(()=>{(this.options.refetchIntervalInBackground||nh.isFocused())&&this.#d()},this.#u))}#b(){this.#y(),this.#g(this.#v())}#x(){this.#c!==void 0&&(Zr.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#f!==void 0&&(Zr.clearInterval(this.#f),this.#f=void 0)}createResult(e,a){const i=this.#t,l=this.options,s=this.#r,u=this.#a,f=this.#l,p=e!==i?e.state:this.#n,{state:m}=e;let g={...m},v=!1,x;if(a._optimisticResults){const N=this.hasListeners(),se=!N&&Uv(e,a),ue=N&&$v(e,i,a,l);(se||ue)&&(g={...g,...O0(m.data,e.options)}),a._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:w,errorUpdatedAt:_,status:E}=g;x=g.data;let z=!1;if(a.placeholderData!==void 0&&x===void 0&&E==="pending"){let N;s?.isPlaceholderData&&a.placeholderData===f?.placeholderData?(N=s.data,z=!0):N=typeof a.placeholderData=="function"?a.placeholderData(this.#m?.state.data,this.#m):a.placeholderData,N!==void 0&&(E="success",x=Hd(s?.data,N,a),v=!0)}if(a.select&&x!==void 0&&!z)if(s&&x===u?.data&&a.select===this.#s)x=this.#h;else try{this.#s=a.select,x=a.select(x),x=Hd(s?.data,x,a),this.#h=x,this.#o=null}catch(N){this.#o=N}this.#o&&(w=this.#o,x=this.#h,_=Date.now(),E="error");const M=g.fetchStatus==="fetching",L=E==="pending",B=E==="error",Y=L&&M,K=x!==void 0,I={status:E,fetchStatus:g.fetchStatus,isPending:L,isSuccess:E==="success",isError:B,isInitialLoading:Y,isLoading:Y,data:x,dataUpdatedAt:g.dataUpdatedAt,error:w,errorUpdatedAt:_,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:g.dataUpdateCount>p.dataUpdateCount||g.errorUpdateCount>p.errorUpdateCount,isFetching:M,isRefetching:M&&!L,isLoadingError:B&&!K,isPaused:g.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:B&&K,isStale:ih(e,a),refetch:this.refetch,promise:this.#i,isEnabled:Dn(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const N=I.data!==void 0,se=I.status==="error"&&!N,ue=ge=>{se?ge.reject(I.error):N&&ge.resolve(I.data)},de=()=>{const ge=this.#i=I.promise=Ud();ue(ge)},te=this.#i;switch(te.status){case"pending":e.queryHash===i.queryHash&&ue(te);break;case"fulfilled":(se||I.data!==te.value)&&de();break;case"rejected":(!se||I.error!==te.reason)&&de();break}}return I}updateResult(){const e=this.#r,a=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#l=this.options,this.#a.data!==void 0&&(this.#m=this.#t),Ld(a,e))return;this.#r=a;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:l}=this.options,s=typeof l=="function"?l():l;if(s==="all"||!s&&!this.#p.size)return!0;const u=new Set(s??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#r).some(f=>{const h=f;return this.#r[h]!==e[h]&&u.has(h)})};this.#_({listeners:i()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const a=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(a?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){Qt.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function uw(e,a){return Dn(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&a.retryOnMount===!1)}function Uv(e,a){return uw(e,a)||e.state.data!==void 0&&Zd(e,a,a.refetchOnMount)}function Zd(e,a,i){if(Dn(a.enabled,e)!==!1&&mr(a.staleTime,e)!=="static"){const l=typeof i=="function"?i(e):i;return l==="always"||l!==!1&&ih(e,a)}return!1}function $v(e,a,i,l){return(e!==a||Dn(l.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&ih(e,i)}function ih(e,a){return Dn(a.enabled,e)!==!1&&e.isStaleByTime(mr(a.staleTime,e))}function cw(e,a){return!Ld(e.getCurrentResult(),a)}function Zv(e){return{onFetch:(a,i)=>{const l=a.options,s=a.fetchOptions?.meta?.fetchMore?.direction,u=a.state.data?.pages||[],f=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let g=!1;const v=_=>{nw(_,()=>a.signal,()=>g=!0)},x=T0(a.options,a.fetchOptions),w=async(_,E,z)=>{if(g)return Promise.reject();if(E==null&&_.pages.length)return Promise.resolve(_);const L=(()=>{const ie={client:a.client,queryKey:a.queryKey,pageParam:E,direction:z?"backward":"forwa)DELIM" -R"DELIM(rd",meta:a.options.meta};return v(ie),ie})(),B=await x(L),{maxPages:Y}=a.options,K=z?tw:ew;return{pages:K(_.pages,B,Y),pageParams:K(_.pageParams,E,Y)}};if(s&&u.length){const _=s==="backward",E=_?fw:qv,z={pages:u,pageParams:f},M=E(l,z);h=await w(z,M,_)}else{const _=e??u.length;do{const E=p===0?f[0]??l.initialPageParam:qv(l,h);if(p>0&&E==null)break;h=await w(h,E),p++}while(p<_)}return h};a.options.persister?a.fetchFn=()=>a.options.persister?.(m,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=m}}}function qv(e,{pages:a,pageParams:i}){const l=a.length-1;return a.length>0?e.getNextPageParam(a[l],a,i[l],i):void 0}function fw(e,{pages:a,pageParams:i}){return a.length>0?e.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var dw=class extends C0{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||hw(),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.#r?.continue()??this.execute(this.state.variables)}async execute(e){const a=()=>{this.#a({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=A0({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(u,f)=>{this.#a({type:"failed",failureCount:u,error:f})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const l=this.state.status==="pending",s=!this.#r.canStart();try{if(l)a();else{this.#a({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,i);const f=await this.options.onMutate?.(e,i);f!==this.state.context&&this.#a({type:"pending",context:f,variables:e,isPaused:s})}const u=await this.#r.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.#a({type:"success",data:u}),u}catch(u){try{await this.#n.config.onError?.(u,e,this.state.context,this,i)}catch(f){Promise.reject(f)}try{await this.options.onError?.(u,e,this.state.context,i)}catch(f){Promise.reject(f)}try{await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,i)}catch(f){Promise.reject(f)}try{await this.options.onSettled?.(void 0,u,e,this.state.context,i)}catch(f){Promise.reject(f)}throw this.#a({type:"error",error:u}),u}finally{this.#n.runNext(this)}}#a(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),Qt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function hw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mw=class extends mo{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,a,i){const l=new dw({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:i});return this.add(l),l}add(e){this.#e.add(e);const a=Zs(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=Zs(e);if(typeof a=="string"){const i=this.#t.get(a);if(i)if(i.length>1){const l=i.indexOf(e);l!==-1&&i.splice(l,1)}else i[0]===e&&this.#t.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=Zs(e);if(typeof a=="string"){const l=this.#t.get(a)?.find(s=>s.state.status==="pending");return!l||l===e}else return!0}runNext(e){const a=Zs(e);return typeof a=="string"?this.#t.get(a)?.find(l=>l!==e&&l.state.isPaused)?.continue()??Promise.resolve():Promise.resolv)DELIM" -R"DELIM(e()}clear(){Qt.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=>Dv(a,i))}findAll(e={}){return this.getAll().filter(a=>Dv(e,a))}notify(e){Qt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return Qt.batch(()=>Promise.all(e.map(a=>a.continue().catch(un))))}};function Zs(e){return e.options.scope?.id}var pw=class extends mo{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,a,i){const l=a.queryKey,s=a.queryHash??ah(l,a);let u=this.get(s);return u||(u=new ow({client:e,queryKey:l,queryHash:s,options:e.defaultQueryOptions(a),state:i,defaultOptions:e.getQueryDefaults(l)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=this.#e.get(e.queryHash);a&&(e.destroy(),a===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Qt.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=>Mv(a,i))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(i=>Mv(e,i)):a}notify(e){Qt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){Qt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Qt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},yw=class{#e;#t;#n;#r;#a;#l;#i;#o;constructor(e={}){this.#e=e.queryCache||new pw,this.#t=e.mutationCache||new mw,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#i=nh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=du.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#l--,this.#l===0&&(this.#i?.(),this.#i=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),l=i.state.data;return l===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(mr(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(l))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:a,state:i})=>{const l=i.data;return[a,l]})}setQueryData(e,a,i){const l=this.defaultQueryOptions({queryKey:e}),u=this.#e.get(l.queryHash)?.state.data,f=JS(a,u);if(f!==void 0)return this.#e.build(this,l).setData(f,{...i,manual:!0})}setQueriesData(e,a,i){return Qt.batch(()=>this.#e.findAll(e).map(({queryKey:l})=>[l,this.setQueryData(l,a,i)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state}removeQueries(e){const a=this.#e;Qt.batch(()=>{a.findAll(e).forEach(i=>{a.remove(i)})})}resetQueries(e,a){const i=this.#e;return Qt.batch(()=>(i.findAll(e).forEach(l=>{l.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const i={revert:!0,...a},l=Qt.batch(()=>this.#e.findAll(e).map(s=>s.cancel(i)));return Promise.all(l).then(un).catch(un)}invalidateQueries(e,a={}){return Qt.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},a)))}refetchQueries(e,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},l=Qt.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let u=s.fetch(void 0,i);return i.throwOnError||(u=u.catch(un)),s.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(l).then(un)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const i=this.#e.build(this,a);return i.isStaleByTime(mr(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(un).catch(un)}fetchInfiniteQuery(e){return e.behavior=Zv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(un).catch(un)}ensureInfiniteQueryData(e){return e.behavior=Zv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return du.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.#r.set(to(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#r.values()],i={};return a.forEach(l=>{no(e,l.queryKey)&&Object.assign(i,l.defaultOptions)}),i}setMutationDefaults(e,a){this.#a.set(to(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#a.values()],i={};return a.forEach(l=>{no(e,l.mutationKey)&&O)DELIM" -R"DELIM(bject.assign(i,l.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const a={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=ah(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===rh&&(a.enabled=!1),a}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},j0=T.createContext(void 0),zu=e=>{const a=T.useContext(j0);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},vw=({client:e,children:a})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),b.jsx(j0.Provider,{value:e,children:a})),N0=T.createContext(!1),gw=()=>T.useContext(N0);N0.Provider;function bw(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var xw=T.createContext(bw()),Sw=()=>T.useContext(xw),ww=(e,a,i)=>{const l=i?.state.error&&typeof e.throwOnError=="function"?R0(e.throwOnError,[i.state.error,i]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||l)&&(a.isReset()||(e.retryOnMount=!1))},_w=e=>{T.useEffect(()=>{e.clearReset()},[e])},Ew=({result:e,errorResetBoundary:a,throwOnError:i,query:l,suspense:s})=>e.isError&&!a.isReset()&&!e.isFetching&&l&&(s&&e.data===void 0||R0(i,[e.error,l])),Tw=e=>{if(e.suspense){const i=s=>s==="static"?s:Math.max(s??1e3,1e3),l=e.staleTime;e.staleTime=typeof l=="function"?(...s)=>i(l(...s)):i(l),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Rw=(e,a)=>e.isLoading&&e.isFetching&&!a,zw=(e,a)=>e?.suspense&&a.isPending,Qv=(e,a,i)=>a.fetchOptimistic(e).catch(()=>{i.clearReset()});function Aw(e,a,i){const l=gw(),s=Sw(),u=zu(),f=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(f);const h=u.getQueryCache().get(f.queryHash);f._optimisticResults=l?"isRestoring":"optimistic",Tw(f),ww(f,s,h),_w(s);const p=!u.getQueryCache().get(f.queryHash),[m]=T.useState(()=>new a(u,f)),g=m.getOptimisticResult(f),v=!l&&e.subscribed!==!1;if(T.useSyncExternalStore(T.useCallback(x=>{const w=v?m.subscribe(Qt.batchCalls(x)):un;return m.updateResult(),w},[m,v]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),T.useEffect(()=>{m.setOptions(f)},[f,m]),zw(f,g))throw Qv(f,m,s);if(Ew({result:g,errorResetBoundary:s,throwOnError:f.throwOnError,query:h,suspense:f.suspense}))throw g.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(f,g),f.experimental_prefetchInRender&&!ao.isServer()&&Rw(g,l)&&(p?Qv(f,m,s):h?.promise)?.catch(un).finally(()=>{m.updateResult()}),f.notifyOnChangeProps?g:m.trackResult(g)}function Cw(e,a){return Aw(e,sw)}function J(e,a,i){function l(h,p){if(h._zod||Object.defineProperty(h,"_zod",{value:{def:p,constr:f,traits:new Set},enumerable:!1}),h._zod.traits.has(e))return;h._zod.traits.add(e),a(h,p);const m=f.prototype,g=Object.keys(m);for(let v=0;vi?.Parent&&h instanceof i.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}class $i extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class M0 extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}const D0={};function Qr(e){return D0}function k0(e){const a=Object.values(e).filter(l=>typeof l=="number");return Object.entries(e).filter(([l,s])=>a.indexOf(+l)===-1).map(([l,s])=>s)}function qd(e,a){return typeof a=="bigint"?a.toString():a}function lh(e){return{get value(){{const a=e();return Object.defineProperty(this,"value",{value:a}),a}}}}function oh(e){return e==null}function sh(e){const a=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(a,i)}function Ow(e,a){const i=(e.toString().split(".")[1]||"").length,l=a.toString();let s=(l.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(l)){const p=l.match(/\d?e-(\d?)/);p?.[1]&&(s=Number.parseInt(p[1]))}const u=i>s?i:s,f=Number.parseInt(e.toFixed(u).replace(".","")),h=Number.parseInt(a.toFixed(u).replace(".",""));return f%h/10**u}const Pv=Symbol("evaluating");function We(e,a,i){let l;Object.defineProperty(e,a,{get(){if(l!==Pv)return l===void 0&&(l=Pv,l=i()),l},set(s){Object.defineProperty(e,a,{value:s})},configurable:!0})}function Yr(e,a,i){Object.defineProperty(e,a,{value:i,writable:!0,enumerable:!0,configurable:!0})}function yr(...e){const a={};for(const i of e){const l=Object.g)DELIM" -R"DELIM(etOwnPropertyDescriptors(i);Object.assign(a,l)}return Object.defineProperties({},a)}function Gv(e){return JSON.stringify(e)}function jw(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const L0="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function hu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Nw=lh(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ro(e){if(hu(e)===!1)return!1;const a=e.constructor;if(a===void 0||typeof a!="function")return!0;const i=a.prototype;return!(hu(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function B0(e){return ro(e)?{...e}:Array.isArray(e)?[...e]:e}const Mw=new Set(["string","number","symbol"]);function Au(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vr(e,a,i){const l=new e._zod.constr(a??e._zod.def);return(!a||i?.parent)&&(l._zod.parent=e),l}function Ee(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 Dw(e){return Object.keys(e).filter(a=>e[a]._zod.optin==="optional"&&e[a]._zod.optout==="optional")}const kw={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 Lw(e,a){const i=e._zod.def,l=i.checks;if(l&&l.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=yr(e._zod.def,{get shape(){const f={};for(const h in a){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);a[h]&&(f[h]=i.shape[h])}return Yr(this,"shape",f),f},checks:[]});return vr(e,u)}function Bw(e,a){const i=e._zod.def,l=i.checks;if(l&&l.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=yr(e._zod.def,{get shape(){const f={...e._zod.def.shape};for(const h in a){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);a[h]&&delete f[h]}return Yr(this,"shape",f),f},checks:[]});return vr(e,u)}function Hw(e,a){if(!ro(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 f in a)if(Object.getOwnPropertyDescriptor(u,f)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=yr(e._zod.def,{get shape(){const u={...e._zod.def.shape,...a};return Yr(this,"shape",u),u}});return vr(e,s)}function Uw(e,a){if(!ro(a))throw new Error("Invalid input to safeExtend: expected a plain object");const i=yr(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a};return Yr(this,"shape",l),l}});return vr(e,i)}function $w(e,a){const i=yr(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a._zod.def.shape};return Yr(this,"shape",l),l},get catchall(){return a._zod.def.catchall},checks:[]});return vr(e,i)}function Zw(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 f=yr(a._zod.def,{get shape(){const h=a._zod.def.shape,p={...h};if(i)for(const m in i){if(!(m in h))throw new Error(`Unrecognized key: "${m}"`);i[m]&&(p[m]=e?new e({type:"optional",innerType:h[m]}):h[m])}else for(const m in h)p[m]=e?new e({type:"optional",innerType:h[m]}):h[m];return Yr(this,"shape",p),p},checks:[]});return vr(a,f)}function qw(e,a,i){const l=yr(a._zod.def,{get shape(){const s=a._zod.def.shape,u={...s};if(i)for(const f in i){if(!(f in u))throw new Error(`Unrecognized key: "${f}"`);i[f]&&(u[f]=new e({type:"nonoptional",innerType:s[f]}))}else for(const f in s)u[f]=new e({type:"nonoptional",innerType:s[f]});return Yr(this,"shape",u),u}});return vr(a,l)}function Hi(e,a=0){if(e.aborted===!0)return!0;for(let i=a;i{var l;return(l=i).path??(l.path=[]),i.path.unshift(e),i})}function qs(e){return typeof e=="string"?e:e?.message}function Pr(e,a,i){const l={...e,path:e.path??[]};if(!e.message){const s=qs(e.inst?._zod.def?.error?.(e))??qs(a?.error?.(e))??qs(i.customError?.(e))??qs(i.localeError?.(e))??"Invalid input";l.message=s}return delete l.inst,delete l.continue,a?.reportInput||delete l.input,l}function uh(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function io(...e){const[a,i,l]=e;return typeof a=="string"?{message:a,code:"custom",input:i,inst:l}:{...a}}const U0=(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,qd,2),Object.definePro)DELIM" -R"DELIM(perty(e,"toString",{value:()=>e.message,enumerable:!1})},$0=J("$ZodError",U0),Z0=J("$ZodError",U0,{Parent:Error});function Qw(e,a=i=>i.message){const i={},l=[];for(const s of e.issues)s.path.length>0?(i[s.path[0]]=i[s.path[0]]||[],i[s.path[0]].push(a(s))):l.push(a(s));return{formErrors:l,fieldErrors:i}}function Pw(e,a=i=>i.message){const i={_errors:[]},l=s=>{for(const u of s.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(f=>l({issues:f}));else if(u.code==="invalid_key")l({issues:u.issues});else if(u.code==="invalid_element")l({issues:u.issues});else if(u.path.length===0)i._errors.push(a(u));else{let f=i,h=0;for(;h(a,i,l,s)=>{const u=l?Object.assign(l,{async:!1}):{async:!1},f=a._zod.run({value:i,issues:[]},u);if(f instanceof Promise)throw new $i;if(f.issues.length){const h=new(s?.Err??e)(f.issues.map(p=>Pr(p,u,Qr())));throw L0(h,s?.callee),h}return f.value},fh=e=>async(a,i,l,s)=>{const u=l?Object.assign(l,{async:!0}):{async:!0};let f=a._zod.run({value:i,issues:[]},u);if(f instanceof Promise&&(f=await f),f.issues.length){const h=new(s?.Err??e)(f.issues.map(p=>Pr(p,u,Qr())));throw L0(h,s?.callee),h}return f.value},Cu=e=>(a,i,l)=>{const s=l?{...l,async:!1}:{async:!1},u=a._zod.run({value:i,issues:[]},s);if(u instanceof Promise)throw new $i;return u.issues.length?{success:!1,error:new(e??$0)(u.issues.map(f=>Pr(f,s,Qr())))}:{success:!0,data:u.value}},Gw=Cu(Z0),Ou=e=>async(a,i,l)=>{const s=l?Object.assign(l,{async:!0}):{async:!0};let u=a._zod.run({value:i,issues:[]},s);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(f=>Pr(f,s,Qr())))}:{success:!0,data:u.value}},Yw=Ou(Z0),Fw=e=>(a,i,l)=>{const s=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return ch(e)(a,i,s)},Kw=e=>(a,i,l)=>ch(e)(a,i,l),Vw=e=>async(a,i,l)=>{const s=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return fh(e)(a,i,s)},Xw=e=>async(a,i,l)=>fh(e)(a,i,l),Jw=e=>(a,i,l)=>{const s=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return Cu(e)(a,i,s)},Iw=e=>(a,i,l)=>Cu(e)(a,i,l),Ww=e=>async(a,i,l)=>{const s=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return Ou(e)(a,i,s)},e2=e=>async(a,i,l)=>Ou(e)(a,i,l),t2=/^[cC][^\s-]{8,}$/,n2=/^[0-9a-z]+$/,a2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,r2=/^[0-9a-vA-V]{20}$/,i2=/^[A-Za-z0-9]{27}$/,l2=/^[a-zA-Z0-9_-]{21}$/,o2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,s2=/^([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})$/,Yv=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)$/,u2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,c2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function f2(){return new RegExp(c2,"u")}const d2=/^(?:(?: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])$/,h2=/^(([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}|:))$/,m2=/^((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])$/,p2=/^(([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])$/,y2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,q0=/^[A-Za-z0-9_-]*$/,v2=/^\+[1-9]\d{6,14}$/,Q0="(?:(?:\\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])))",g2=new RegExp(`^${Q0}$`);function P0(e){const a="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${a}`:e.precision===0?`${a}:[0-5]\\d`:`${a}:[0-5]\\d\\.\\d{${e.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function b2(e){return new RegExp(`^${P0(e)}$`)}function x2(e){const a=P0({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const l=`${a}(?:${i.join("|")})`;return new RegExp(`^${Q0}T(?:${l})$`)}const S2=e=>{const a=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},w2=/^-?\d+$/,_2=/^-?\d+(?:\.\d+)?$/,E2=/^(?:true|fal)DELIM" -R"DELIM(se)$/i,T2=/^[^A-Z]*$/,R2=/^[^a-z]*$/,fn=J("$ZodCheck",(e,a)=>{var i;e._zod??(e._zod={}),e._zod.def=a,(i=e._zod).onattach??(i.onattach=[])}),G0={number:"number",bigint:"bigint",object:"date"},Y0=J("$ZodCheckLessThan",(e,a)=>{fn.init(e,a);const i=G0[typeof a.value];e._zod.onattach.push(l=>{const s=l._zod.bag,u=(a.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value{(a.inclusive?l.value<=a.value:l.value{fn.init(e,a);const i=G0[typeof a.value];e._zod.onattach.push(l=>{const s=l._zod.bag,u=(a.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;a.value>u&&(a.inclusive?s.minimum=a.value:s.exclusiveMinimum=a.value)}),e._zod.check=l=>{(a.inclusive?l.value>=a.value:l.value>a.value)||l.issues.push({origin:i,code:"too_small",minimum:typeof a.value=="object"?a.value.getTime():a.value,input:l.value,inclusive:a.inclusive,inst:e,continue:!a.abort})}}),z2=J("$ZodCheckMultipleOf",(e,a)=>{fn.init(e,a),e._zod.onattach.push(i=>{var l;(l=i._zod.bag).multipleOf??(l.multipleOf=a.value)}),e._zod.check=i=>{if(typeof i.value!=typeof a.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%a.value===BigInt(0):Ow(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})}}),A2=J("$ZodCheckNumberFormat",(e,a)=>{fn.init(e,a),a.format=a.format||"float64";const i=a.format?.includes("int"),l=i?"int":"number",[s,u]=kw[a.format];e._zod.onattach.push(f=>{const h=f._zod.bag;h.format=a.format,h.minimum=s,h.maximum=u,i&&(h.pattern=w2)}),e._zod.check=f=>{const h=f.value;if(i){if(!Number.isInteger(h)){f.issues.push({expected:l,format:a.format,code:"invalid_type",continue:!1,input:h,inst:e});return}if(!Number.isSafeInteger(h)){h>0?f.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!a.abort}):f.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!a.abort});return}}hu&&f.issues.push({origin:"number",input:h,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!a.abort})}}),C2=J("$ZodCheckMaxLength",(e,a)=>{var i;fn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!oh(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum{const s=l.value;if(s.length<=a.maximum)return;const f=uh(s);l.issues.push({origin:f,code:"too_big",maximum:a.maximum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),O2=J("$ZodCheckMinLength",(e,a)=>{var i;fn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!oh(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>s&&(l._zod.bag.minimum=a.minimum)}),e._zod.check=l=>{const s=l.value;if(s.length>=a.minimum)return;const f=uh(s);l.issues.push({origin:f,code:"too_small",minimum:a.minimum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),j2=J("$ZodCheckLengthEquals",(e,a)=>{var i;fn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!oh(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag;s.minimum=a.length,s.maximum=a.length,s.length=a.length}),e._zod.check=l=>{const s=l.value,u=s.length;if(u===a.length)return;const f=uh(s),h=u>a.length;l.issues.push({origin:f,...h?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:l.value,inst:e,continue:!a.abort})}}),ju=J("$ZodCheckStringFormat",(e,a)=>{var i,l;fn.init(e,a),e._zod.onattach.push(s=>{const u=s._zod.bag;u.format=a.format,a.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(a.pattern))}),a.pattern?(i=e._zod).check??(i.check=s=>{a.pattern.lastIndex=0,!a.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:a.format,input:s.value,...a.pattern?{pattern:a.pattern.toString()}:{},inst:e,continue:!a.abort})}):(l=e._zod).check??(l.check=()=>{})}),N2=J("$ZodCheckRegex",(e,a)=>{ju.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})}}),M2=J("$ZodCheckLowerCase",(e,a)=>{a.pattern??(a.pattern=T2),ju.init(e,a)}),D2=J("$ZodCheckUpperCase",(e,a)=>{a.pattern??(a.pattern=R2),ju.init(e,a)}),k2=J("$ZodCheckIncludes",(e,a)=>{fn.init(e,a);const i=Au(a.includes),l=)DELIM" -R"DELIM(new RegExp(typeof a.position=="number"?`^.{${a.position}}${i}`:i);a.pattern=l,e._zod.onattach.push(s=>{const u=s._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(l)}),e._zod.check=s=>{s.value.includes(a.includes,a.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:a.includes,input:s.value,inst:e,continue:!a.abort})}}),L2=J("$ZodCheckStartsWith",(e,a)=>{fn.init(e,a);const i=new RegExp(`^${Au(a.prefix)}.*`);a.pattern??(a.pattern=i),e._zod.onattach.push(l=>{const s=l._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=l=>{l.value.startsWith(a.prefix)||l.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:l.value,inst:e,continue:!a.abort})}}),B2=J("$ZodCheckEndsWith",(e,a)=>{fn.init(e,a);const i=new RegExp(`.*${Au(a.suffix)}$`);a.pattern??(a.pattern=i),e._zod.onattach.push(l=>{const s=l._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=l=>{l.value.endsWith(a.suffix)||l.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:l.value,inst:e,continue:!a.abort})}}),H2=J("$ZodCheckOverwrite",(e,a)=>{fn.init(e,a),e._zod.check=i=>{i.value=a.tx(i.value)}});class U2{constructor(a=[]){this.content=[],this.indent=0,this&&(this.args=a)}indented(a){this.indent+=1,a(this),this.indent-=1}write(a){if(typeof a=="function"){a(this,{execution:"sync"}),a(this,{execution:"async"});return}const l=a.split(` +`+o.stack}}var br=Object.prototype.hasOwnProperty,Oa=e.unstable_scheduleCallback,Xi=e.unstable_cancelCallback,Hu=e.unstable_shouldYield,Uu=e.unstable_requestPaint,Jt=e.unstable_now,sa=e.unstable_getCurrentPriorityLevel,Ma=e.unstable_ImmediatePriority,Ji=e.unstable_UserBlockingPriority,Da=e.unstable_NormalPriority,$n=e.unstable_LowPriority,_n=e.unstable_IdlePriority,Ro=e.log,$u=e.unstable_setDisableYieldValue,ua=null,It=null;function kt(t){if(typeof Ro=="function"&&$u(t),It&&typeof It.setStrictMode=="function")try{It.setStrictMode(ua,t)}catch{}}var Ft=Math.clz32?Math.clz32:Zu,zo=Math.log,Ao=Math.LN2;function Zu(t){return t>>>=0,t===0?32:31-(zo(t)/Ao|0)|0}var xr=256,ca=262144,Sr=4194304;function Zn(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 Kr(t,n,r){var o=t.pendingLanes;if(o===0)return 0;var c=0,d=t.suspendedLanes,y=t.pingedLanes;t=t.warmLanes;var S=o&134217727;return S!==0?(o=S&~d,o!==0?c=Zn(o):(y&=S,y!==0?c=Zn(y):r||(r=S&~t,r!==0&&(c=Zn(r))))):(S=o&~d,S!==0?c=Zn(S):y!==0?c=Zn(y):r||(r=o&~t,r!==0&&(c=Zn(r)))),c===0?0:)DELIM" +R"DELIM(n!==0&&n!==c&&(n&d)===0&&(d=c&-c,r=n&-n,d>=r||d===32&&(r&4194048)!==0)?n:c}function ka(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function qu(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 Ii(){var t=Sr;return Sr<<=1,(Sr&62914560)===0&&(Sr=4194304),t}function La(t){for(var n=[],r=0;31>r;r++)n.push(t);return n}function Vn(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Co(t,n,r,o,c,d){var y=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var S=t.entanglements,z=t.expirationTimes,U=t.hiddenUpdates;for(r=y&~r;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var jx=/[\n"\\]/g;function En(t){return t.replace(jx,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Qu(t,n,r,o,c,d,y,S){t.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.type=y:t.removeAttribute("type"),n!=null?y==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Rt(n)):t.value!==""+Rt(n)&&(t.value=""+Rt(n)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),n!=null?Pu(t,y,Rt(n)):r!=null?Pu(t,y,Rt(r)):o!=null&&t.removeAttribute("value"),c==null&&d!=null&&(t.defaultChecked=!!d),c!=null&&(t.checked=c&&typeof c!="function"&&typeof c!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.name=""+Rt(S):t.removeAttribute("name")}function qh(t,n,r,o,c,d,y,S){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(t.type=d),n!=null||r!=null){if(!(d!=="submit"&&d!=="reset"||n!=null)){Jr(t);return}r=r!=null?""+Rt(r):"",n=n!=null?""+Rt(n):r,S||n===t.value||(t.value=n),t.defaultValue=n}o=o??c,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=S?t.checked:!!o,t.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),Jr(t)}function Pu(t,n,r){n==="number"&&Mo(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function Ir(t,n,r,o){if(t=t.options,n){n={};for(var c=0;c"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vu=!1;if(da)try{var el={};Object.defineProperty(el,"passive",{get:function(){Vu=!0}}),window.addEventListener("test",el,el),window.removeEventListener("test",el,el)}catch{Vu=!1}var Ha=null,Xu=null,ko=null;function Vh(){if(ko)return ko;var t,n=Xu,r=n.length,o,c="value"in Ha?Ha.value:Ha.textContent,d=c.length;for(t=0;t=al),tm=" ",nm=!1;function am(t,n){switch(t){case"keyup":return r1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ni=!1;function l1(t,n){switch(t){case"compositionend":return rm(n);case"keypress":return n.which!==32?null:(nm=!0,tm);case"textInput":return t=n.data,t===tm&&nm?null:t;default:return null}}function o1(t,n){if(ni)return t==="compositionend"||!tc&&am(t,n)?(t=Vh(),ko=Xu=Ha=null,ni=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:r,offset:n-t};t=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=dm(r)}}function mm(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?mm(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function pm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Mo(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=Mo(t.document)}return n}function rc(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 p1=da&&"documentMode"in document&&11>=document.documentMode,ai=null,ic=null,ol=null,lc=!1;function ym(t,n,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;lc||ai==null||ai!==Mo(o)||(o=ai,"selectionStart"in o&&rc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ol&&ll(ol,o)||(ol=o,o=As(ic,"onSelect"),0>=y,c-=y,In=1<<32-Ft(n)+c|r<Ne?(Ue=ve,ve=null):Ue=ve.sibling;var Fe=Z(k,ve,H[Ne],F);if(Fe===null){ve===null&&(ve=Ue);break}t&&ve&&Fe.alternate===null&&n(k,ve),N=d(Fe,N,Ne),Ye===null?Se=Fe:Ye.sibling=Fe,Ye=Fe,ve=Ue}if(Ne===H.length)return r(k,ve),$e&&ma(k,Ne),Se;if(ve===null){for(;NeNe?(Ue=ve,ve=null):Ue=ve.sibling;var lr=Z(k,ve,Fe.value,F);if(lr===null){ve===null&&(ve=U)DELIM" +R"DELIM(e);break}t&&ve&&lr.alternate===null&&n(k,ve),N=d(lr,N,Ne),Ye===null?Se=lr:Ye.sibling=lr,Ye=lr,ve=Ue}if(Fe.done)return r(k,ve),$e&&ma(k,Ne),Se;if(ve===null){for(;!Fe.done;Ne++,Fe=H.next())Fe=X(k,Fe.value,F),Fe!==null&&(N=d(Fe,N,Ne),Ye===null?Se=Fe:Ye.sibling=Fe,Ye=Fe);return $e&&ma(k,Ne),Se}for(ve=o(ve);!Fe.done;Ne++,Fe=H.next())Fe=q(ve,k,Ne,Fe.value,F),Fe!==null&&(t&&Fe.alternate!==null&&ve.delete(Fe.key===null?Ne:Fe.key),N=d(Fe,N,Ne),Ye===null?Se=Fe:Ye.sibling=Fe,Ye=Fe);return t&&ve.forEach(function(kS){return n(k,kS)}),$e&&ma(k,Ne),Se}function nt(k,N,H,F){if(typeof H=="object"&&H!==null&&H.type===E&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case w:e:{for(var Se=H.key;N!==null;){if(N.key===Se){if(Se=H.type,Se===E){if(N.tag===7){r(k,N.sibling),F=c(N,H.props.children),F.return=k,k=F;break e}}else if(N.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===O&&Mr(Se)===N.type){r(k,N.sibling),F=c(N,H.props),hl(F,H),F.return=k,k=F;break e}r(k,N);break}else n(k,N);N=N.sibling}H.type===E?(F=Ar(H.props.children,k.mode,F,H.key),F.return=k,k=F):(F=Go(H.type,H.key,H.props,null,k.mode,F),hl(F,H),F.return=k,k=F)}return y(k);case _:e:{for(Se=H.key;N!==null;){if(N.key===Se)if(N.tag===4&&N.stateNode.containerInfo===H.containerInfo&&N.stateNode.implementation===H.implementation){r(k,N.sibling),F=c(N,H.children||[]),F.return=k,k=F;break e}else{r(k,N);break}else n(k,N);N=N.sibling}F=hc(H,k.mode,F),F.return=k,k=F}return y(k);case O:return H=Mr(H),nt(k,N,H,F)}if(V(H))return me(k,N,H,F);if(te(H)){if(Se=te(H),typeof Se!="function")throw Error(l(150));return H=Se.call(H),Te(k,N,H,F)}if(typeof H.then=="function")return nt(k,N,Io(H),F);if(H.$$typeof===B)return nt(k,N,Ko(k,H),F);Wo(k,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,N!==null&&N.tag===6?(r(k,N.sibling),F=c(N,H),F.return=k,k=F):(r(k,N),F=dc(H,k.mode,F),F.return=k,k=F),y(k)):r(k,N)}return function(k,N,H,F){try{dl=0;var Se=nt(k,N,H,F);return mi=null,Se}catch(ve){if(ve===hi||ve===Xo)throw ve;var Ye=hn(29,ve,null,k.mode);return Ye.lanes=F,Ye.return=k,Ye}}}var kr=Um(!0),$m=Um(!1),Qa=!1;function Tc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rc(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 Pa(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ga(t,n,r){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(Ve&2)!==0){var c=o.pending;return c===null?n.next=n:(n.next=c.next,c.next=n),o.pending=n,n=Po(t),_m(t,null,r),n}return Qo(t,o,n,r),Po(t)}function ml(t,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,No(t,r)}}function zc(t,n){var r=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var c=null,d=null;if(r=r.firstBaseUpdate,r!==null){do{var y={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};d===null?c=d=y:d=d.next=y,r=r.next}while(r!==null);d===null?c=d=n:d=d.next=n}else c=d=n;r={baseState:o.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:o.shared,callbacks:o.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=n:t.next=n,r.lastBaseUpdate=n}var Ac=!1;function pl(){if(Ac){var t=di;if(t!==null)throw t}}function yl(t,n,r,o){Ac=!1;var c=t.updateQueue;Qa=!1;var d=c.firstBaseUpdate,y=c.lastBaseUpdate,S=c.shared.pending;if(S!==null){c.shared.pending=null;var z=S,U=z.next;z.next=null,y===null?d=U:y.next=U,y=z;var G=t.alternate;G!==null&&(G=G.updateQueue,S=G.lastBaseUpdate,S!==y&&(S===null?G.firstBaseUpdate=U:S.next=U,G.lastBaseUpdate=z))}if(d!==null){var X=c.baseState;y=0,G=U=z=null,S=d;do{var Z=S.lane&-536870913,q=Z!==S.lane;if(q?(He&Z)===Z:(o&Z)===Z){Z!==0&&Z===fi&&(Ac=!0),G!==null&&(G=G.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var me=t,Te=S;Z=n;var nt=r;switch(Te.tag){case 1:if(me=Te.payload,typeof me=="function"){X=me.call(nt,X,Z);break e}X=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=Te.payload,Z=typeof me=="function"?me.call(nt,X,Z):me,Z==null)break e;X=v({},X,Z);break e;case 2:Qa=!0}}Z=S.callback,Z!==null&&(t.flags|=64,q&&(t.flags|=8192),q=c.callbacks,q===null?c.callbacks=[Z]:q.push(Z))}else q={lane:Z,tag:S.tag,payload:S.payload,callback:S.callback,next:null},G===null?(U=G=q,z=X):G=G.next=q,y|=Z;if(S=S.next,S===null){if(S=c.shared.pending,S===null)break;q=S,S=q.next,q.next=null,c.lastBaseUpdate=q,c.shared.pending=null}}while(!0);G===null&&(z=X),c.baseState=z,c.firstBaseUpdate=U,c.lastBaseUpdate=G,d===null&&(c.shared.lanes=0),Xa|=y,t.lanes=y,t.memoizedState=X}}function Zm(t,n){if(typeof t!="function")throw Error(l(191,t));t.call(n)}function qm(t,n){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;td?d:8;var y=j.T,S={};j.T=S,Fc(t,!1,n,r);try{var z=c(),U=j.S;if(U!==null&&U(S,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var G=E1(z,o);bl(t,n,G,gn(t))}else bl(t,n,o,gn(t))}catch(X){bl(t,n,{then:function(){},status:"rejected",reason:X},gn())}finally{Q.p=d,y!==null&&S.types!==null&&(y.types=S.types),j.T=y}}function j1(){}function Gc(t,n,r,o){if(t.tag!==5)throw Error(l(476));var c=xp(t).queue;bp(t,c,n,W,r===null?j1:function(){return Sp(t),r(o)})}function xp(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:W},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:r},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function Sp(t){var n=xp(t);n.next===null&&(n=t.alternate.memoizedState),bl(t,n.next.queue,{},gn())}function Yc(){return Ut(Ll)}function wp(){return wt().memoizedState}function _p(){return wt().memoizedState}function N1(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var r=gn();t=Pa(r);var o=Ga(n,t,r);o!==null&&(un(o,n,r),ml(o,n,r)),n={cache:Sc()},t.payload=n;return}n=n.return}}function O1(t,n,r){var o=gn();r={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},us(t)?Tp(n,r):(r=cc(t,n,r,o),r!==null&&(un(r,t,o),Rp(r,n,o)))}function Ep(t,n,r){var o=gn();bl(t,n,r,o)}function bl(t,n,r,o){var c={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(us(t))Tp(n,c);else{var d=t.alternate;if(t.lanes===0&&(d===null||d.lanes===0)&&(d=n.lastRenderedReducer,d!==null))try{var y=n.lastRenderedState,S=d(y,r);if(c.hasEagerState=!0,c.eagerState=S,dn(S,y))return Qo(t,n,c,0),rt===null&&qo(),!1}catch{}if(r=cc(t,n,c,o),r!==null)return un(r,t,o),Rp(r,n,o),!0}return!1}function Fc(t,n,r,o){if(o={lane:2,revertLane:Rf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},us(t)){if(n)throw Error(l(479))}else n=cc(t,r,o,2),n!==null&&un(n,t,2)}function us(t){var n=t.alternate;return t===Ce||n!==null&&n===Ce}function Tp(t,n){yi=ns=!0;var r=t.pending;r===null?n.next=n:(n.next=r.next,r.next=n),t.pending=n}function Rp(t,n,r){if((r&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,No(t,r)}}var xl={readContext:Ut,use:is,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useLayoutEffect:vt,useInsertionEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useSyncExternalStore:vt,useId:vt,useHostTransitionStatus:vt,useFormState:vt,useActionState:vt,useOptimistic:vt,useMemoCache:vt,useCacheRefresh:vt};xl.useEffectEvent=vt;var zp={readContext:Ut,use:is,useCallback:function(t,n){return Wt().memoizedState=[t,n===void 0?null:n],t},useContext:Ut,useEffect:cp,useImperativeHandle:function(t,n,r){r=r!=null?r.concat([t]):null,os(4194308,4,mp.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=Wt();n=n===void 0?null:n;var o=t();if(Lr){kt(!0);try{t()}finally{kt(!1)}}return r.memoizedState=[o,n],o},useReducer:function(t,n,r){var o=Wt();if(r!==void 0){var c=r(n);if(Lr){kt(!0);try{r(n)}finally{kt(!1)}}}else c=n;return o.memoizedState=o.baseState=c,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:c},o.queue=t,t=t.dispatch=O1.bind(null,Ce,t),[o.memoizedState,t]},useRef:function(t){var n=Wt();return t={current:t},n.memoizedState=t},useState:function(t){t=$c(t);var n=t.queue,r=Ep.bind(null,Ce,n);return n.dispatch=r,[t.memoizedState,r]},useDebugValue:Qc,useDeferredValue:function(t,n){var r=Wt();return Pc(r,t,n)},useTransition:function(){var t=$c(!1);return t=bp.bind(null,Ce,t.queue,!0,!1),Wt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,r){var o=Ce,c=Wt();if($e){if(r===void 0)throw Error(l(407));r=r()}else{if(r=n(),rt===null)throw Error(l(349));(He&127)!==0||Km(o,n,r)}c.memoizedState=r;var d={value:r,getSnapshot:n};return c.queue=d,cp(Xm.bind(null)DELIM" +R"DELIM(,o,d,t),[t]),o.flags|=2048,gi(9,{destroy:void 0},Vm.bind(null,o,d,r,n),null),r},useId:function(){var t=Wt(),n=rt.identifierPrefix;if($e){var r=Wn,o=In;r=(o&~(1<<32-Ft(o)-1)).toString(32)+r,n="_"+n+"R_"+r,r=as++,0<\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof o.is=="string"?y.createElement("select",{is:o.is}):y.createElement("select"),o.multiple?d.multiple=!0:o.size&&(d.size=o.size);break;default:d=typeof o.is=="string"?y.createElement(c,{is:o.is}):y.createElement(c)}}d[ce]=n,d[fe]=o;e:for(y=n.child;y!==null;){if(y.tag===5||y.tag===6)d.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===n)break e;for(;y.sibling===null;){if(y.return===null||y.return===n)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}n.stateNode=d;e:switch(Zt(d,c,o),c){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&xa(n)}}return ct(n),sf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,r),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&xa(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(l(166));if(t=Re.current,ui(n)){if(t=n.stateNode,r=n.memoizedProps,o=null,c=Ht,c!==null)switch(c.tag){case 27:case 5:o=c.memoizedProps}t[ce]=n,t=!!(t.nodeValue===r||o!==null&&o.suppressHydrationWarning===!0||Yy(t.nodeValue,r)),t||Za(n,!0)}else t=Cs(t).createTextNode(o),t[ce]=n,n.stateNode=t}return ct(n),null;case 31:if(r=n.memoizedState,t===null||t.memoizedState!==null){if(o=ui(n),r!==null){if(t===null){if(!o)throw Error(l(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[ce]=n}else Cr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ct(n),t=!1}else r=vc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return n.flags&256?(pn(n),n):(pn(n),null);if((n.flags&128)!==0)throw Error(l(558))}return ct(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(c=ui(n),o!==null&&o.dehydrated!==null){if(t===null){if(!c)throw Error(l(318));if(c=n.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(l(317));c[ce]=n}else Cr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ct(n),c=!1}else c=vc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=c),c=!0;if(!c)return n.flags&256?(pn(n),n):(pn(n),null)}return pn(n),(n.flags&128)!==0?(n.lanes=r,n):(r=o!==null,t=t!==null&&t.memoizedState!==null,r&&(o=n.child,c=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(c=o.alternate.memoizedState.cachePool.pool),d=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),d!==c&&(o.flags|=2048)),r!==t&&r&&(n.child.flags|=8192),ms(n,n.updateQueue),ct(n),null);case 4:return Ae(),t===null&&jf(n.stateNode.containerInfo),ct(n),null;case 10:return ya(n.type),ct(n),null;case 19:if(P(St),o=n.memoizedState,o===null)return ct(n),null;if(c=(n.flags&128)!==0,d=o.rendering,d===null)if(c)wl(o,!1);else{if(gt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(d=ts(t),d!==null){for(n.flags|=128,wl(o,!1),t=d.updateQueue,n.updateQueue=t,ms(n,t),n.subtreeFlags=0,t=r,r=n.child;r!==null;)Em(r,t),r=r.sibling;return ne(St,St.current&1|2),$e&&ma(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Jt()>bs&&(n.flags|=128,c=!0,wl(o,!1),n.lanes=4194304)}else{if(!c)if(t=ts(d),t!==null){if(n.flags|=128,c=!0,t=t.updateQueue,n.updateQueue=t,ms(n,t),wl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!d.alternate&&!$e)return ct(n),null}else 2*Jt()-o.renderingStartTime>bs&&r!==536870912&&(n.flags|=128,c=!0,wl(o,!1),n.lanes=4194304);o.isBackwards?(d.sibling=n.child,n.child=d):(t=o.last,t!==null?t.sibling=d:n.child=d,o.last=d)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Jt(),t.sibling=null,r=St.current,ne(St,c?r&1|2:r&1),$e&&ma(n,o.treeForkCount),t):(ct(n),null);case 22:case 23:return pn(n),jc(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(r&536870912)!==0&&(n.flags&128)===0&&(ct(n),n.subtreeFlags&6&&(n.flags|=8192)):ct(n),r=n.updateQueue,r!==null&&ms(n,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048),t!==null&&P(Or),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),ya(zt),ct(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function B1(t,n){switch(pc(n),n.tag){case 1:return t=n.flags,t&65536)DELIM" +R"DELIM(?(n.flags=t&-65537|128,n):null;case 3:return ya(zt),Ae(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Yt(n),null;case 31:if(n.memoizedState!==null){if(pn(n),n.alternate===null)throw Error(l(340));Cr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(pn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(l(340));Cr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return P(St),null;case 4:return Ae(),null;case 10:return ya(n.type),null;case 22:case 23:return pn(n),jc(),t!==null&&P(Or),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return ya(zt),null;case 25:return null;default:return null}}function Jp(t,n){switch(pc(n),n.tag){case 3:ya(zt),Ae();break;case 26:case 27:case 5:Yt(n);break;case 4:Ae();break;case 31:n.memoizedState!==null&&pn(n);break;case 13:pn(n);break;case 19:P(St);break;case 10:ya(n.type);break;case 22:case 23:pn(n),jc(),t!==null&&P(Or);break;case 24:ya(zt)}}function _l(t,n){try{var r=n.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var c=o.next;r=c;do{if((r.tag&t)===t){o=void 0;var d=r.create,y=r.inst;o=d(),y.destroy=o}r=r.next}while(r!==c)}}catch(S){Ie(n,n.return,S)}}function Ka(t,n,r){try{var o=n.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var d=c.next;o=d;do{if((o.tag&t)===t){var y=o.inst,S=y.destroy;if(S!==void 0){y.destroy=void 0,c=n;var z=r,U=S;try{U()}catch(G){Ie(c,z,G)}}}o=o.next}while(o!==d)}}catch(G){Ie(n,n.return,G)}}function Ip(t){var n=t.updateQueue;if(n!==null){var r=t.stateNode;try{qm(n,r)}catch(o){Ie(t,t.return,o)}}}function Wp(t,n,r){r.props=Br(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(o){Ie(t,n,o)}}function El(t,n){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof r=="function"?t.refCleanup=r(o):r.current=o}}catch(c){Ie(t,n,c)}}function ea(t,n){var r=t.ref,o=t.refCleanup;if(r!==null)if(typeof o=="function")try{o()}catch(c){Ie(t,n,c)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(c){Ie(t,n,c)}else r.current=null}function ey(t){var n=t.type,r=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&o.focus();break e;case"img":r.src?o.src=r.src:r.srcSet&&(o.srcset=r.srcSet)}}catch(c){Ie(t,t.return,c)}}function uf(t,n,r){try{var o=t.stateNode;iS(o,t.type,r,n),o[fe]=n}catch(c){Ie(t,t.return,c)}}function ty(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&tr(t.type)||t.tag===4}function cf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||ty(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&&tr(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 ff(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(t),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=fa));else if(o!==4&&(o===27&&tr(t.type)&&(r=t.stateNode,n=null),t=t.child,t!==null))for(ff(t,n,r),t=t.sibling;t!==null;)ff(t,n,r),t=t.sibling}function ps(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?r.insertBefore(t,n):r.appendChild(t);else if(o!==4&&(o===27&&tr(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(ps(t,n,r),t=t.sibling;t!==null;)ps(t,n,r),t=t.sibling}function ny(t){var n=t.stateNode,r=t.memoizedProps;try{for(var o=t.type,c=n.attributes;c.length;)n.removeAttributeNode(c[0]);Zt(n,o,r),n[ce]=t,n[fe]=r}catch(d){Ie(t,t.return,d)}}var Sa=!1,jt=!1,df=!1,ay=typeof WeakSet=="function"?WeakSet:Set,Bt=null;function H1(t,n){if(t=t.containerInfo,Mf=Ls,t=pm(t),rc(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var c=o.anchorOffset,d=o.focusNode;o=o.focusOffset;try{r.nodeType,d.nodeType}catch{r=null;break e}var y=0,S=-1,z=-1,U=0,G=0,X=t,Z=null;t:for(;;){for(var q;X!==r||c!==0&&X.nodeType!==3||(S=y+c),X!==d||o!==0&&X.nodeType!==3||(z=y+o),X.nodeType===3&&(y+=X.nodeValue.length),(q=X.firstChild)!==null;)Z=X,X=q;for(;;){if(X===t)break t;if(Z===r&&++U===c&&(S=y),Z===d&&++G===o&&(z=y),(q=X.nextSibling)!==null)break;X=Z,Z=X.parentNode}X=q}r=S===-1||z===-1?null:{start:S,end:z}}else r=null}r=r||{start:0,end:0}}else r=null;for(Df={focusedElem:t,selectionRange:r},Ls=!1,Bt=n;Bt!==null;)if(n=Bt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Bt=t;else for(;Bt!==null;){switch(n=Bt,d=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(r=0;r title"))),Zt(d,o,r),d[ce]=t,it(d),o=d;break e;case"link":var y=uv("link","href",c).get(o+(r.href||""));if(y){for(var S=0;Snt&&(y=nt,nt=Te,Te=y);var k=hm(S,Te),N=hm(S,nt);if(k&&N&&(q.rangeCount!==1||q.anchorNode!==k.node||q.anchorOffset!==k.offset||q.focusNode!==N.node||q.focusOffset!==N.offset)){var H=X.createRange();H.setStart(k.node,k.offset),q.removeAllRanges(),Te>nt?(q.addRange(H),q.extend(N.node,N.offset)):(H.setEnd(N.node,N.offset),q.addRange(H))}}}}for(X=[],q=S;q=q.parentNode;)q.nodeType===1&&X.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;Sr?32:r,j.T=null,r=bf,bf=null;var d=Ia,y=Ra;if(Dt=0,_i=Ia=null,Ra=0,(Ve&6)!==0)throw Error(l(331));var S=Ve;if(Ve|=4,my(d.current),fy(d,d.current,y,r),Ve=S,jl(0,!1),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(ua,d)}catch{}return!0}finally{Q.p=c,j.T=o,Oy(t,n)}}function Dy(t,n,r){n=Rn(r,n),n=Jc(t.stateNode,n,2),t=Ga(t,n,2),t!==null&&(Vn(t,2),ta(t))}function Ie(t,n,r){if(t.tag===3)Dy(t,t,r);else for(;n!==null;){if(n.tag===3){Dy(n,t,r);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.com)DELIM" +R"DELIM(ponentDidCatch=="function"&&(Ja===null||!Ja.has(o))){t=Rn(r,t),r=kp(2),o=Ga(n,r,2),o!==null&&(Lp(r,o,n,t),Vn(o,2),ta(o));break}}n=n.return}}function _f(t,n,r){var o=t.pingCache;if(o===null){o=t.pingCache=new Z1;var c=new Set;o.set(n,c)}else c=o.get(n),c===void 0&&(c=new Set,o.set(n,c));c.has(r)||(pf=!0,c.add(r),t=Y1.bind(null,t,n,r),n.then(t,t))}function Y1(t,n,r){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,rt===t&&(He&r)===r&&(gt===4||gt===3&&(He&62914560)===He&&300>Jt()-gs?(Ve&2)===0&&Ei(t,0):yf|=r,wi===He&&(wi=0)),ta(t)}function ky(t,n){n===0&&(n=Ii()),t=zr(t,n),t!==null&&(Vn(t,n),ta(t))}function F1(t){var n=t.memoizedState,r=0;n!==null&&(r=n.retryLane),ky(t,r)}function K1(t,n){var r=0;switch(t.tag){case 31:case 13:var o=t.stateNode,c=t.memoizedState;c!==null&&(r=c.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(n),ky(t,r)}function V1(t,n){return Oa(t,n)}var Ts=null,Ri=null,Ef=!1,Rs=!1,Tf=!1,er=0;function ta(t){t!==Ri&&t.next===null&&(Ri===null?Ts=Ri=t:Ri=Ri.next=t),Rs=!0,Ef||(Ef=!0,J1())}function jl(t,n){if(!Tf&&Rs){Tf=!0;do for(var r=!1,o=Ts;o!==null;){if(t!==0){var c=o.pendingLanes;if(c===0)var d=0;else{var y=o.suspendedLanes,S=o.pingedLanes;d=(1<<31-Ft(42|t)+1)-1,d&=c&~(y&~S),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(r=!0,Uy(o,d))}else d=He,d=Kr(o,o===rt?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(d&3)===0||ka(o,d)||(r=!0,Uy(o,d));o=o.next}while(r);Tf=!1}}function X1(){Ly()}function Ly(){Rs=Ef=!1;var t=0;er!==0&&oS()&&(t=er);for(var n=Jt(),r=null,o=Ts;o!==null;){var c=o.next,d=By(o,n);d===0?(o.next=null,r===null?Ts=c:r.next=c,c===null&&(Ri=r)):(r=o,(t!==0||(d&3)!==0)&&(Rs=!0)),o=c}Dt!==0&&Dt!==5||jl(t),er!==0&&(er=0)}function By(t,n){for(var r=t.suspendedLanes,o=t.pingedLanes,c=t.expirationTimes,d=t.pendingLanes&-62914561;0S)break;var G=z.transferSize,X=z.initiatorType;G&&Fy(X)&&(z=z.responseEnd,y+=G*(z"u"?null:document;function iv(t,n,r){var o=zi;if(o&&typeof n=="string"&&n){var c=En(n);c='link[rel="'+t+'"][href="'+c+'"]',typeof r=="string"&&(c+='[crossorigin="'+r+'"]'),rv.has(c)||(rv.add(c),t={rel:t,crossOrigin:r,href:n},o.querySelector(c)===null&&(n=o.createElement("link"),Zt(n,"link",t),it(n),o.head.appendChild(n)))}}function yS(t){za.D(t),iv("dns-prefetch",t,null)}function vS(t,n){za.C(t,n),iv("preconnect",t,n)}function gS(t,n,r){za.L(t,n,r);var o=zi;if(o&&t&&n){var c='link[rel="preload"][as="'+En(n)+'"]';n==="image"&&r&&r.imageSrcSet?(c+='[imagesrcset="'+En(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(c+='[imagesizes="'+En(r.imageSizes)+'"]')):c+='[href="'+En(t)+'"]';var d=c;switch(n){case"style":d=Ai(t);break;case"script":d=Ci(t)}On.has(d)||(t=v({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:t,as:n},r),On.set(d,t),o.querySelector(c)!==null||n==="style"&&o.querySelector(Dl(d))||n==="script"&&o.querySelector(kl(d))||(n=o.createElement("link"),Zt(n,"link",t),it(n),o.head.appendChild(n)))}}function bS(t,n){za.m(t,n);var r=zi;if(r&&t){var o=n&&typeof n.as=="string"?n.as:"script",c='link[rel="modulepreload"][as="'+En(o)+'"][href="'+En(t)+'"]',d=c;switch(o){case"audioworklet":case"paintworklet":case"serv)DELIM" +R"DELIM(iceworker":case"sharedworker":case"worker":case"script":d=Ci(t)}if(!On.has(d)&&(t=v({rel:"modulepreload",href:t},n),On.set(d,t),r.querySelector(c)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(kl(d)))return}o=r.createElement("link"),Zt(o,"link",t),it(o),r.head.appendChild(o)}}}function xS(t,n,r){za.S(t,n,r);var o=zi;if(o&&t){var c=Tt(o).hoistableStyles,d=Ai(t);n=n||"default";var y=c.get(d);if(!y){var S={loading:0,preload:null};if(y=o.querySelector(Dl(d)))S.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":n},r),(r=On.get(d))&&Zf(t,r);var z=y=o.createElement("link");it(z),Zt(z,"link",t),z._p=new Promise(function(U,G){z.onload=U,z.onerror=G}),z.addEventListener("load",function(){S.loading|=1}),z.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Ns(y,n,o)}y={type:"stylesheet",instance:y,count:1,state:S},c.set(d,y)}}}function SS(t,n){za.X(t,n);var r=zi;if(r&&t){var o=Tt(r).hoistableScripts,c=Ci(t),d=o.get(c);d||(d=r.querySelector(kl(c)),d||(t=v({src:t,async:!0},n),(n=On.get(c))&&qf(t,n),d=r.createElement("script"),it(d),Zt(d,"link",t),r.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(c,d))}}function wS(t,n){za.M(t,n);var r=zi;if(r&&t){var o=Tt(r).hoistableScripts,c=Ci(t),d=o.get(c);d||(d=r.querySelector(kl(c)),d||(t=v({src:t,async:!0,type:"module"},n),(n=On.get(c))&&qf(t,n),d=r.createElement("script"),it(d),Zt(d,"link",t),r.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(c,d))}}function lv(t,n,r,o){var c=(c=Re.current)?js(c):null;if(!c)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=Ai(r.href),r=Tt(c).hoistableStyles,o=r.get(n),o||(o={type:"style",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Ai(r.href);var d=Tt(c).hoistableStyles,y=d.get(t);if(y||(c=c.ownerDocument||c,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(t,y),(d=c.querySelector(Dl(t)))&&!d._p&&(y.instance=d,y.state.loading=5),On.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},On.set(t,r),d||_S(c,t,r,y.state))),n&&o===null)throw Error(l(528,""));return y}if(n&&o!==null)throw Error(l(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ci(r),r=Tt(c).hoistableScripts,o=r.get(n),o||(o={type:"script",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function Ai(t){return'href="'+En(t)+'"'}function Dl(t){return'link[rel="stylesheet"]['+t+"]"}function ov(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function _S(t,n,r,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),Zt(n,"link",r),it(n),t.head.appendChild(n))}function Ci(t){return'[src="'+En(t)+'"]'}function kl(t){return"script[async]"+t}function sv(t,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+En(r.href)+'"]');if(o)return n.instance=o,it(o),o;var c=v({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),it(o),Zt(o,"style",c),Ns(o,r.precedence,t),n.instance=o;case"stylesheet":c=Ai(r.href);var d=t.querySelector(Dl(c));if(d)return n.state.loading|=4,n.instance=d,it(d),d;o=ov(r),(c=On.get(c))&&Zf(o,c),d=(t.ownerDocument||t).createElement("link"),it(d);var y=d;return y._p=new Promise(function(S,z){y.onload=S,y.onerror=z}),Zt(d,"link",o),n.state.loading|=4,Ns(d,r.precedence,t),n.instance=d;case"script":return d=Ci(r.src),(c=t.querySelector(kl(d)))?(n.instance=c,it(c),c):(o=r,(c=On.get(d))&&(o=v({},r),qf(o,c)),t=t.ownerDocument||t,c=t.createElement("script"),it(c),Zt(c,"link",o),t.head.appendChild(c),n.instance=c);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Ns(o,r.precedence,t));return n.instance}function Ns(t,n,r){for(var o=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=o.length?o[o.length-1]:null,d=c,y=0;y title"):null)}function ES(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 fv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function TS(t,n,r,o){if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var c=Ai(o.href),d=n.querySelector(Dl(c));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Ms.bind(t),n.then(t,t)),r.state.loading|=4,r.instance=d,it(d);return}d=n.ownerDocument||n,o=ov(o),(c=On.get(c))&&Zf(o,c),d=d.createElement("link"),it(d);var y=d;y._p=new Promise(function(S,z){y.onload=S,y.onerror=z}),Zt(d,"link",o),r.instance=d}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(t.count++,r=Ms.bind(t),n.addEventListener("load",r),n.addEventListener("error",r))}}var Qf=0;function RS(t,n){return t.stylesheets&&t.count===0&&ks(t,t.stylesheets),0Qf?50:800)+n);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(c)}}:null}function Ms(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ks(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ds=null;function ks(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ds=new Map,n.forEach(zS,t),Ds=null,Ms.call(t))}function zS(t,n){if(!(n.state.loading&4)){var r=Ds.get(t);if(r)var o=r.get(null);else{r=new Map,Ds.set(t,r);for(var c=t.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),If.exports=PS(),If.exports}var YS=GS();const FS=ah(YS);var yo=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(){}},KS=class extends yo{#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.onFocu)DELIM" +R"DELIM(s()})}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"}},rh=new KS,VS={setTimeout:(e,a)=>setTimeout(e,a),clearTimeout:e=>clearTimeout(e),setInterval:(e,a)=>setInterval(e,a),clearInterval:e=>clearInterval(e)},XS=class{#e=VS;#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)}},Zr=new XS;function JS(e){setTimeout(e,0)}var IS=typeof window>"u"||"Deno"in globalThis;function cn(){}function WS(e,a){return typeof e=="function"?e(a):e}function Bd(e){return typeof e=="number"&&e>=0&&e!==1/0}function T0(e,a){return Math.max(e+(a||0)-Date.now(),0)}function mr(e,a){return typeof e=="function"?e(a):e}function Dn(e,a){return typeof e=="function"?e(a):e}function kv(e,a){const{type:i="all",exact:l,fetchStatus:s,predicate:u,queryKey:f,stale:h}=e;if(f){if(l){if(a.queryHash!==ih(f,a.options))return!1}else if(!ao(a.queryKey,f))return!1}if(i!=="all"){const p=a.isActive();if(i==="active"&&!p||i==="inactive"&&p)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||s&&s!==a.state.fetchStatus||u&&!u(a))}function Lv(e,a){const{exact:i,status:l,predicate:s,mutationKey:u}=e;if(u){if(!a.options.mutationKey)return!1;if(i){if(no(a.options.mutationKey)!==no(u))return!1}else if(!ao(a.options.mutationKey,u))return!1}return!(l&&a.state.status!==l||s&&!s(a))}function ih(e,a){return(a?.queryKeyHashFn||no)(e)}function no(e){return JSON.stringify(e,(a,i)=>Ud(i)?Object.keys(i).sort().reduce((l,s)=>(l[s]=i[s],l),{}):i)}function ao(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(i=>ao(e[i],a[i])):!1}var ew=Object.prototype.hasOwnProperty;function R0(e,a,i=0){if(e===a)return e;if(i>500)return a;const l=Bv(e)&&Bv(a);if(!l&&!(Ud(e)&&Ud(a)))return a;const u=(l?e:Object.keys(e)).length,f=l?a:Object.keys(a),h=f.length,p=l?new Array(h):{};let m=0;for(let b=0;b{Zr.setTimeout(a,e)})}function $d(e,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,a):i.structuralSharing!==!1?R0(e,a):a}function nw(e,a,i=0){const l=[...e,a];return i&&l.length>i?l.slice(1):l}function aw(e,a,i=0){const l=[a,...e];return i&&l.length>i?l.slice(0,-1):l}var lh=Symbol();function z0(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 A0(e,a){return typeof e=="function"?e(...a):!!e}function rw(e,a,i){let l=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=a(),l||(l=!0,s.aborted?i():s.addEventListener("abort",i,{once:!0})),s)}),e}var ro=(()=>{let e=()=>IS;return{isServer(){return e()},setIsServer(a){e=a}}})();function Zd(){let e,a;const i=new Promise((s,u)=>{e=s,a=u});i.status="pending",i.catch(()=>{});function l(s){Object.assign(i,s),delete i.resolve,delete i.reject}return i.resolve=s=>{l({status:"fulfilled",value:s}),e(s)},i.reject=s=>{l({status:"rejected",reason:s}),a(s)},i}var iw=JS;function lw(){let e=[],a=0,i=h=>{h()},l=h=>{h()},s=iw;const u=h=>{a?e.push(h):s(()=>{i(h)})},f=()=>{const h=e;e=[],h.length&&s(()=>{l(()=>{h.forEach(p=>{i(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||f()}return p},batchCalls:h=>(...p)=>{u(()=>{h(...p)})},schedule:u,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{l=h},setScheduler:h=>{s=h}}}var Qt=lw(),ow=class extends yo{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const a=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#e}},mu=new ow;function sw(e){return Math.min()DELIM" +R"DELIM(1e3*2**e,3e4)}function C0(e){return(e??"online")==="online"?mu.isOnline():!0}var qd=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function j0(e){let a=!1,i=0,l;const s=Zd(),u=()=>s.status!=="pending",f=E=>{if(!u()){const R=new qd(E);x(R),e.onCancel?.(R)}},h=()=>{a=!0},p=()=>{a=!1},m=()=>rh.isFocused()&&(e.networkMode==="always"||mu.isOnline())&&e.canRun(),b=()=>C0(e.networkMode)&&e.canRun(),v=E=>{u()||(l?.(),s.resolve(E))},x=E=>{u()||(l?.(),s.reject(E))},w=()=>new Promise(E=>{l=R=>{(u()||m())&&E(R)},e.onPause?.()}).then(()=>{l=void 0,u()||e.onContinue?.()}),_=()=>{if(u())return;let E;const R=i===0?e.initialPromise:void 0;try{E=R??e.fn()}catch(M){E=Promise.reject(M)}Promise.resolve(E).then(v).catch(M=>{if(u())return;const L=e.retry??(ro.isServer()?0:3),B=e.retryDelay??sw,Y=typeof B=="function"?B(i,M):B,K=L===!0||typeof L=="number"&&im()?void 0:w()).then(()=>{a?x(M):_()})})};return{promise:s,status:()=>s.status,cancel:f,continue:()=>(l?.(),s),cancelRetry:h,continueRetry:p,canStart:b,start:()=>(b()?_():w().then(_),s)}}var N0=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Bd(this.gcTime)&&(this.#e=Zr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ro.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Zr.clearTimeout(this.#e),this.#e=void 0)}},uw=class extends N0{#e;#t;#n;#r;#a;#l;#i;constructor(e){super(),this.#i=!1,this.#l=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=$v(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#l,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=$v(this.options);a.data!==void 0&&(this.setState(Uv(a.data,a.dataUpdatedAt)),this.#e=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,a){const i=$d(this.state.data,e,this.options);return this.#s({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}setState(e,a){this.#s({type:"setState",state:e,setStateOptions:a})}cancel(e){const a=this.#a?.promise;return this.#a?.cancel(e),a?a.then(cn).catch(cn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Dn(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=>mr(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:!T0(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.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.#a&&(this.#i||this.#o()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#o(){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.#a?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,l=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#i=!0,i.signal)})},s=()=>{const h=z0(this.options,a),m=(()=>{const b={client:this.#r,queryKey:this.queryKey,meta:this.meta};return l(b),b})();return this.#i=!1,this.options.persister?this.options.persister(h,m,this):h(m)},f=(()=>{const h={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:s};return l(h),h})();this.options.behavior?.onFetch(f,thi)DELIM" +R"DELIM(s),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#s({type:"fetch",meta:f.fetchOptions?.meta}),this.#a=j0({initialPromise:a?.initialPromise,fn:f.fetchFn,onCancel:h=>{h instanceof qd&&h.revert&&this.setState({...this.#t,fetchStatus:"idle"}),i.abort()},onFail:(h,p)=>{this.#s({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const h=await this.#a.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof qd){if(h.silent)return this.#a.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#s({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}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,...O0(i.data,this.options),fetchMeta:e.meta??null};case"success":const l={...i,...Uv(e.data,e.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?l:void 0,l;case"error":const s=e.error;return{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=a(this.state),Qt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function O0(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:C0(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Uv(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,l=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var cw=class extends yo{constructor(e,a){super(),this.options=a,this.#e=e,this.#o=null,this.#i=Zd(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#r=void 0;#a;#l;#i;#o;#s;#h;#m;#c;#f;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Zv(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Qd(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Qd(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 Dn(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&&!Hd(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const l=this.hasListeners();l&&qv(this.#t,i,this.options,a)&&this.#d(),this.updateResult(),l&&(this.#t!==i||Dn(this.options.enabled,this.#t)!==Dn(a.enabled,this.#t)||mr(this.options.staleTime,this.#t)!==mr(a.staleTime,this.#t))&&this.#y();const s=this.#v();l&&(this.#t!==i||Dn(this.options.enabled,this.#t)!==Dn(a.enabled,this.#t)||s!==this.#u)&&this.#g(s)}getOptimisticResult(e){const a=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(a,e);return dw(this,i)&&(this.#r=i,this.#l=this.options,this.#a=this.#t.state),i}getCurrentResult(){return this.#r}trackResult(e,a){return new Proxy(e,{get:(i,l)=>(this.trackProp(l),a?.(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,l))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=this.#e.defaultQueryOptions(e),i=this.#e.getQueryCache().build(this)DELIM" +R"DELIM(.#e,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(e){this.#w();let a=this.#t.fetch(this.options,e);return e?.throwOnError||(a=a.catch(cn)),a}#y(){this.#x();const e=mr(this.options.staleTime,this.#t);if(ro.isServer()||this.#r.isStale||!Bd(e))return;const i=T0(this.#r.dataUpdatedAt,e)+1;this.#c=Zr.setTimeout(()=>{this.#r.isStale||this.updateResult()},i)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#g(e){this.#S(),this.#u=e,!(ro.isServer()||Dn(this.options.enabled,this.#t)===!1||!Bd(this.#u)||this.#u===0)&&(this.#f=Zr.setInterval(()=>{(this.options.refetchIntervalInBackground||rh.isFocused())&&this.#d()},this.#u))}#b(){this.#y(),this.#g(this.#v())}#x(){this.#c!==void 0&&(Zr.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#f!==void 0&&(Zr.clearInterval(this.#f),this.#f=void 0)}createResult(e,a){const i=this.#t,l=this.options,s=this.#r,u=this.#a,f=this.#l,p=e!==i?e.state:this.#n,{state:m}=e;let b={...m},v=!1,x;if(a._optimisticResults){const O=this.hasListeners(),se=!O&&Zv(e,a),ue=O&&qv(e,i,a,l);(se||ue)&&(b={...b,...O0(m.data,e.options)}),a._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:w,errorUpdatedAt:_,status:E}=b;x=b.data;let R=!1;if(a.placeholderData!==void 0&&x===void 0&&E==="pending"){let O;s?.isPlaceholderData&&a.placeholderData===f?.placeholderData?(O=s.data,R=!0):O=typeof a.placeholderData=="function"?a.placeholderData(this.#m?.state.data,this.#m):a.placeholderData,O!==void 0&&(E="success",x=$d(s?.data,O,a),v=!0)}if(a.select&&x!==void 0&&!R)if(s&&x===u?.data&&a.select===this.#s)x=this.#h;else try{this.#s=a.select,x=a.select(x),x=$d(s?.data,x,a),this.#h=x,this.#o=null}catch(O){this.#o=O}this.#o&&(w=this.#o,x=this.#h,_=Date.now(),E="error");const M=b.fetchStatus==="fetching",L=E==="pending",B=E==="error",Y=L&&M,K=x!==void 0,I={status:E,fetchStatus:b.fetchStatus,isPending:L,isSuccess:E==="success",isError:B,isInitialLoading:Y,isLoading:Y,data:x,dataUpdatedAt:b.dataUpdatedAt,error:w,errorUpdatedAt:_,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:b.dataUpdateCount>p.dataUpdateCount||b.errorUpdateCount>p.errorUpdateCount,isFetching:M,isRefetching:M&&!L,isLoadingError:B&&!K,isPaused:b.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:B&&K,isStale:oh(e,a),refetch:this.refetch,promise:this.#i,isEnabled:Dn(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const O=I.data!==void 0,se=I.status==="error"&&!O,ue=ge=>{se?ge.reject(I.error):O&&ge.resolve(I.data)},de=()=>{const ge=this.#i=I.promise=Zd();ue(ge)},te=this.#i;switch(te.status){case"pending":e.queryHash===i.queryHash&&ue(te);break;case"fulfilled":(se||I.data!==te.value)&&de();break;case"rejected":(!se||I.error!==te.reason)&&de();break}}return I}updateResult(){const e=this.#r,a=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#l=this.options,this.#a.data!==void 0&&(this.#m=this.#t),Hd(a,e))return;this.#r=a;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:l}=this.options,s=typeof l=="function"?l():l;if(s==="all"||!s&&!this.#p.size)return!0;const u=new Set(s??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#r).some(f=>{const h=f;return this.#r[h]!==e[h]&&u.has(h)})};this.#_({listeners:i()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const a=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(a?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){Qt.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function fw(e,a){return Dn(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&a.retryOnMount===!1)}function Zv(e,a){return fw(e,a)||e.state.data!==void 0&&Qd(e,a,a.refetchOnMount)}function Qd(e,a,i){if(Dn(a.enabled,e)!==!1&&mr(a.staleTime,e)!=="static"){const l=typeof i=="function"?i(e):i;return l==="always"||l!==!1&&oh(e,a)}return!1}function qv(e,a,i,l){return(e!==a||Dn(l.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&oh(e,i)}function oh(e,a){return Dn(a.enabled,e)!==!1&&e.isStaleByTime(mr(a.staleTime,e))}function dw(e,a){return!Hd(e.getCurrentResult(),a)}function Qv(e){return{onFetch:(a,i)=>{const l=a.options,s=a.fetchOptions?.meta?.fetchMore?.direction,u=a.state.data?.pages||[],f=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let b=!1;const v=_=>{rw(_,()=>a.signal,()=>b=!0)},x=z0(a.options,a.fetchOptions),w=async(_,E,R)=>{if(b)return Promise.reject();if(E==null&&_.pages.length)return Promise.resolve(_);const L=(()=>{const ie={client:a.client,queryKey:a.queryKey,pageParam:E,direction:R?"backward":"forwa)DELIM" +R"DELIM(rd",meta:a.options.meta};return v(ie),ie})(),B=await x(L),{maxPages:Y}=a.options,K=R?aw:nw;return{pages:K(_.pages,B,Y),pageParams:K(_.pageParams,E,Y)}};if(s&&u.length){const _=s==="backward",E=_?hw:Pv,R={pages:u,pageParams:f},M=E(l,R);h=await w(R,M,_)}else{const _=e??u.length;do{const E=p===0?f[0]??l.initialPageParam:Pv(l,h);if(p>0&&E==null)break;h=await w(h,E),p++}while(p<_)}return h};a.options.persister?a.fetchFn=()=>a.options.persister?.(m,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=m}}}function Pv(e,{pages:a,pageParams:i}){const l=a.length-1;return a.length>0?e.getNextPageParam(a[l],a,i[l],i):void 0}function hw(e,{pages:a,pageParams:i}){return a.length>0?e.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var mw=class extends N0{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||pw(),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.#r?.continue()??this.execute(this.state.variables)}async execute(e){const a=()=>{this.#a({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=j0({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(u,f)=>{this.#a({type:"failed",failureCount:u,error:f})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const l=this.state.status==="pending",s=!this.#r.canStart();try{if(l)a();else{this.#a({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,i);const f=await this.options.onMutate?.(e,i);f!==this.state.context&&this.#a({type:"pending",context:f,variables:e,isPaused:s})}const u=await this.#r.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.#a({type:"success",data:u}),u}catch(u){try{await this.#n.config.onError?.(u,e,this.state.context,this,i)}catch(f){Promise.reject(f)}try{await this.options.onError?.(u,e,this.state.context,i)}catch(f){Promise.reject(f)}try{await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,i)}catch(f){Promise.reject(f)}try{await this.options.onSettled?.(void 0,u,e,this.state.context,i)}catch(f){Promise.reject(f)}throw this.#a({type:"error",error:u}),u}finally{this.#n.runNext(this)}}#a(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),Qt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function pw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var yw=class extends yo{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,a,i){const l=new mw({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:i});return this.add(l),l}add(e){this.#e.add(e);const a=Qs(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=Qs(e);if(typeof a=="string"){const i=this.#t.get(a);if(i)if(i.length>1){const l=i.indexOf(e);l!==-1&&i.splice(l,1)}else i[0]===e&&this.#t.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=Qs(e);if(typeof a=="string"){const l=this.#t.get(a)?.find(s=>s.state.status==="pending");return!l||l===e}else return!0}runNext(e){const a=Qs(e);return typeof a=="string"?this.#t.get(a)?.find(l=>l!==e&&l.state.isPaused)?.continue()??Promise.resolve():Promise.resolv)DELIM" +R"DELIM(e()}clear(){Qt.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=>Lv(a,i))}findAll(e={}){return this.getAll().filter(a=>Lv(e,a))}notify(e){Qt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return Qt.batch(()=>Promise.all(e.map(a=>a.continue().catch(cn))))}};function Qs(e){return e.options.scope?.id}var vw=class extends yo{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,a,i){const l=a.queryKey,s=a.queryHash??ih(l,a);let u=this.get(s);return u||(u=new uw({client:e,queryKey:l,queryHash:s,options:e.defaultQueryOptions(a),state:i,defaultOptions:e.getQueryDefaults(l)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=this.#e.get(e.queryHash);a&&(e.destroy(),a===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Qt.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=>kv(a,i))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(i=>kv(e,i)):a}notify(e){Qt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){Qt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Qt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},gw=class{#e;#t;#n;#r;#a;#l;#i;#o;constructor(e={}){this.#e=e.queryCache||new vw,this.#t=e.mutationCache||new yw,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#i=rh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=mu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#l--,this.#l===0&&(this.#i?.(),this.#i=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),l=i.state.data;return l===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(mr(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(l))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:a,state:i})=>{const l=i.data;return[a,l]})}setQueryData(e,a,i){const l=this.defaultQueryOptions({queryKey:e}),u=this.#e.get(l.queryHash)?.state.data,f=WS(a,u);if(f!==void 0)return this.#e.build(this,l).setData(f,{...i,manual:!0})}setQueriesData(e,a,i){return Qt.batch(()=>this.#e.findAll(e).map(({queryKey:l})=>[l,this.setQueryData(l,a,i)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state}removeQueries(e){const a=this.#e;Qt.batch(()=>{a.findAll(e).forEach(i=>{a.remove(i)})})}resetQueries(e,a){const i=this.#e;return Qt.batch(()=>(i.findAll(e).forEach(l=>{l.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const i={revert:!0,...a},l=Qt.batch(()=>this.#e.findAll(e).map(s=>s.cancel(i)));return Promise.all(l).then(cn).catch(cn)}invalidateQueries(e,a={}){return Qt.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},a)))}refetchQueries(e,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},l=Qt.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let u=s.fetch(void 0,i);return i.throwOnError||(u=u.catch(cn)),s.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(l).then(cn)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const i=this.#e.build(this,a);return i.isStaleByTime(mr(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(cn).catch(cn)}fetchInfiniteQuery(e){return e.behavior=Qv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cn).catch(cn)}ensureInfiniteQueryData(e){return e.behavior=Qv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return mu.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.#r.set(no(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#r.values()],i={};return a.forEach(l=>{ao(e,l.queryKey)&&Object.assign(i,l.defaultOptions)}),i}setMutationDefaults(e,a){this.#a.set(no(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#a.values()],i={};return a.forEach(l=>{ao(e,l.mutationKey)&&O)DELIM" +R"DELIM(bject.assign(i,l.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const a={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=ih(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()}},M0=T.createContext(void 0),Au=e=>{const a=T.useContext(M0);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},bw=({client:e,children:a})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(M0.Provider,{value:e,children:a})),D0=T.createContext(!1),xw=()=>T.useContext(D0);D0.Provider;function Sw(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ww=T.createContext(Sw()),_w=()=>T.useContext(ww),Ew=(e,a,i)=>{const l=i?.state.error&&typeof e.throwOnError=="function"?A0(e.throwOnError,[i.state.error,i]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||l)&&(a.isReset()||(e.retryOnMount=!1))},Tw=e=>{T.useEffect(()=>{e.clearReset()},[e])},Rw=({result:e,errorResetBoundary:a,throwOnError:i,query:l,suspense:s})=>e.isError&&!a.isReset()&&!e.isFetching&&l&&(s&&e.data===void 0||A0(i,[e.error,l])),zw=e=>{if(e.suspense){const i=s=>s==="static"?s:Math.max(s??1e3,1e3),l=e.staleTime;e.staleTime=typeof l=="function"?(...s)=>i(l(...s)):i(l),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Aw=(e,a)=>e.isLoading&&e.isFetching&&!a,Cw=(e,a)=>e?.suspense&&a.isPending,Gv=(e,a,i)=>a.fetchOptimistic(e).catch(()=>{i.clearReset()});function jw(e,a,i){const l=xw(),s=_w(),u=Au(),f=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(f);const h=u.getQueryCache().get(f.queryHash);f._optimisticResults=l?"isRestoring":"optimistic",zw(f),Ew(f,s,h),Tw(s);const p=!u.getQueryCache().get(f.queryHash),[m]=T.useState(()=>new a(u,f)),b=m.getOptimisticResult(f),v=!l&&e.subscribed!==!1;if(T.useSyncExternalStore(T.useCallback(x=>{const w=v?m.subscribe(Qt.batchCalls(x)):cn;return m.updateResult(),w},[m,v]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),T.useEffect(()=>{m.setOptions(f)},[f,m]),Cw(f,b))throw Gv(f,m,s);if(Rw({result:b,errorResetBoundary:s,throwOnError:f.throwOnError,query:h,suspense:f.suspense}))throw b.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(f,b),f.experimental_prefetchInRender&&!ro.isServer()&&Aw(b,l)&&(p?Gv(f,m,s):h?.promise)?.catch(cn).finally(()=>{m.updateResult()}),f.notifyOnChangeProps?b:m.trackResult(b)}function Nw(e,a){return jw(e,cw)}function J(e,a,i){function l(h,p){if(h._zod||Object.defineProperty(h,"_zod",{value:{def:p,constr:f,traits:new Set},enumerable:!1}),h._zod.traits.has(e))return;h._zod.traits.add(e),a(h,p);const m=f.prototype,b=Object.keys(m);for(let v=0;vi?.Parent&&h instanceof i.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}class $i extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class k0 extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}const L0={};function Qr(e){return L0}function B0(e){const a=Object.values(e).filter(l=>typeof l=="number");return Object.entries(e).filter(([l,s])=>a.indexOf(+l)===-1).map(([l,s])=>s)}function Pd(e,a){return typeof a=="bigint"?a.toString():a}function sh(e){return{get value(){{const a=e();return Object.defineProperty(this,"value",{value:a}),a}}}}function uh(e){return e==null}function ch(e){const a=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(a,i)}function Ow(e,a){const i=(e.toString().split(".")[1]||"").length,l=a.toString();let s=(l.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(l)){const p=l.match(/\d?e-(\d?)/);p?.[1]&&(s=Number.parseInt(p[1]))}const u=i>s?i:s,f=Number.parseInt(e.toFixed(u).replace(".","")),h=Number.parseInt(a.toFixed(u).replace(".",""));return f%h/10**u}const Yv=Symbol("evaluating");function We(e,a,i){let l;Object.defineProperty(e,a,{get(){if(l!==Yv)return l===void 0&&(l=Yv,l=i()),l},set(s){Object.defineProperty(e,a,{value:s})},configurable:!0})}function Yr(e,a,i){Object.defineProperty(e,a,{value:i,writable:!0,enumerable:!0,configurable:!0})}function yr(...e){const a={};for(const i of e){const l=Object.g)DELIM" +R"DELIM(etOwnPropertyDescriptors(i);Object.assign(a,l)}return Object.defineProperties({},a)}function Fv(e){return JSON.stringify(e)}function Mw(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const H0="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function pu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Dw=sh(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function io(e){if(pu(e)===!1)return!1;const a=e.constructor;if(a===void 0||typeof a!="function")return!0;const i=a.prototype;return!(pu(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function U0(e){return io(e)?{...e}:Array.isArray(e)?[...e]:e}const kw=new Set(["string","number","symbol"]);function Cu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vr(e,a,i){const l=new e._zod.constr(a??e._zod.def);return(!a||i?.parent)&&(l._zod.parent=e),l}function Ee(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 Lw(e){return Object.keys(e).filter(a=>e[a]._zod.optin==="optional"&&e[a]._zod.optout==="optional")}const Bw={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 Hw(e,a){const i=e._zod.def,l=i.checks;if(l&&l.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=yr(e._zod.def,{get shape(){const f={};for(const h in a){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);a[h]&&(f[h]=i.shape[h])}return Yr(this,"shape",f),f},checks:[]});return vr(e,u)}function Uw(e,a){const i=e._zod.def,l=i.checks;if(l&&l.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=yr(e._zod.def,{get shape(){const f={...e._zod.def.shape};for(const h in a){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);a[h]&&delete f[h]}return Yr(this,"shape",f),f},checks:[]});return vr(e,u)}function $w(e,a){if(!io(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 f in a)if(Object.getOwnPropertyDescriptor(u,f)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=yr(e._zod.def,{get shape(){const u={...e._zod.def.shape,...a};return Yr(this,"shape",u),u}});return vr(e,s)}function Zw(e,a){if(!io(a))throw new Error("Invalid input to safeExtend: expected a plain object");const i=yr(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a};return Yr(this,"shape",l),l}});return vr(e,i)}function qw(e,a){const i=yr(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a._zod.def.shape};return Yr(this,"shape",l),l},get catchall(){return a._zod.def.catchall},checks:[]});return vr(e,i)}function Qw(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 f=yr(a._zod.def,{get shape(){const h=a._zod.def.shape,p={...h};if(i)for(const m in i){if(!(m in h))throw new Error(`Unrecognized key: "${m}"`);i[m]&&(p[m]=e?new e({type:"optional",innerType:h[m]}):h[m])}else for(const m in h)p[m]=e?new e({type:"optional",innerType:h[m]}):h[m];return Yr(this,"shape",p),p},checks:[]});return vr(a,f)}function Pw(e,a,i){const l=yr(a._zod.def,{get shape(){const s=a._zod.def.shape,u={...s};if(i)for(const f in i){if(!(f in u))throw new Error(`Unrecognized key: "${f}"`);i[f]&&(u[f]=new e({type:"nonoptional",innerType:s[f]}))}else for(const f in s)u[f]=new e({type:"nonoptional",innerType:s[f]});return Yr(this,"shape",u),u}});return vr(a,l)}function Hi(e,a=0){if(e.aborted===!0)return!0;for(let i=a;i{var l;return(l=i).path??(l.path=[]),i.path.unshift(e),i})}function Ps(e){return typeof e=="string"?e:e?.message}function Pr(e,a,i){const l={...e,path:e.path??[]};if(!e.message){const s=Ps(e.inst?._zod.def?.error?.(e))??Ps(a?.error?.(e))??Ps(i.customError?.(e))??Ps(i.localeError?.(e))??"Invalid input";l.message=s}return delete l.inst,delete l.continue,a?.reportInput||delete l.input,l}function fh(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function lo(...e){const[a,i,l]=e;return typeof a=="string"?{message:a,code:"custom",input:i,inst:l}:{...a}}const Z0=(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,Pd,2),Object.definePro)DELIM" +R"DELIM(perty(e,"toString",{value:()=>e.message,enumerable:!1})},q0=J("$ZodError",Z0),Q0=J("$ZodError",Z0,{Parent:Error});function Gw(e,a=i=>i.message){const i={},l=[];for(const s of e.issues)s.path.length>0?(i[s.path[0]]=i[s.path[0]]||[],i[s.path[0]].push(a(s))):l.push(a(s));return{formErrors:l,fieldErrors:i}}function Yw(e,a=i=>i.message){const i={_errors:[]},l=s=>{for(const u of s.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(f=>l({issues:f}));else if(u.code==="invalid_key")l({issues:u.issues});else if(u.code==="invalid_element")l({issues:u.issues});else if(u.path.length===0)i._errors.push(a(u));else{let f=i,h=0;for(;h(a,i,l,s)=>{const u=l?Object.assign(l,{async:!1}):{async:!1},f=a._zod.run({value:i,issues:[]},u);if(f instanceof Promise)throw new $i;if(f.issues.length){const h=new(s?.Err??e)(f.issues.map(p=>Pr(p,u,Qr())));throw H0(h,s?.callee),h}return f.value},hh=e=>async(a,i,l,s)=>{const u=l?Object.assign(l,{async:!0}):{async:!0};let f=a._zod.run({value:i,issues:[]},u);if(f instanceof Promise&&(f=await f),f.issues.length){const h=new(s?.Err??e)(f.issues.map(p=>Pr(p,u,Qr())));throw H0(h,s?.callee),h}return f.value},ju=e=>(a,i,l)=>{const s=l?{...l,async:!1}:{async:!1},u=a._zod.run({value:i,issues:[]},s);if(u instanceof Promise)throw new $i;return u.issues.length?{success:!1,error:new(e??q0)(u.issues.map(f=>Pr(f,s,Qr())))}:{success:!0,data:u.value}},Fw=ju(Q0),Nu=e=>async(a,i,l)=>{const s=l?Object.assign(l,{async:!0}):{async:!0};let u=a._zod.run({value:i,issues:[]},s);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(f=>Pr(f,s,Qr())))}:{success:!0,data:u.value}},Kw=Nu(Q0),Vw=e=>(a,i,l)=>{const s=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return dh(e)(a,i,s)},Xw=e=>(a,i,l)=>dh(e)(a,i,l),Jw=e=>async(a,i,l)=>{const s=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return hh(e)(a,i,s)},Iw=e=>async(a,i,l)=>hh(e)(a,i,l),Ww=e=>(a,i,l)=>{const s=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return ju(e)(a,i,s)},e2=e=>(a,i,l)=>ju(e)(a,i,l),t2=e=>async(a,i,l)=>{const s=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return Nu(e)(a,i,s)},n2=e=>async(a,i,l)=>Nu(e)(a,i,l),a2=/^[cC][^\s-]{8,}$/,r2=/^[0-9a-z]+$/,i2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,l2=/^[0-9a-vA-V]{20}$/,o2=/^[A-Za-z0-9]{27}$/,s2=/^[a-zA-Z0-9_-]{21}$/,u2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,c2=/^([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})$/,Kv=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)$/,f2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,d2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function h2(){return new RegExp(d2,"u")}const m2=/^(?:(?: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])$/,p2=/^(([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}|:))$/,y2=/^((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])$/,v2=/^(([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])$/,g2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,P0=/^[A-Za-z0-9_-]*$/,b2=/^\+[1-9]\d{6,14}$/,G0="(?:(?:\\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])))",x2=new RegExp(`^${G0}$`);function Y0(e){const a="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${a}`:e.precision===0?`${a}:[0-5]\\d`:`${a}:[0-5]\\d\\.\\d{${e.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function S2(e){return new RegExp(`^${Y0(e)}$`)}function w2(e){const a=Y0({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const l=`${a}(?:${i.join("|")})`;return new RegExp(`^${G0}T(?:${l})$`)}const _2=e=>{const a=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},E2=/^-?\d+$/,T2=/^-?\d+(?:\.\d+)?$/,R2=/^(?:true|fal)DELIM" +R"DELIM(se)$/i,z2=/^[^A-Z]*$/,A2=/^[^a-z]*$/,fn=J("$ZodCheck",(e,a)=>{var i;e._zod??(e._zod={}),e._zod.def=a,(i=e._zod).onattach??(i.onattach=[])}),F0={number:"number",bigint:"bigint",object:"date"},K0=J("$ZodCheckLessThan",(e,a)=>{fn.init(e,a);const i=F0[typeof a.value];e._zod.onattach.push(l=>{const s=l._zod.bag,u=(a.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value{(a.inclusive?l.value<=a.value:l.value{fn.init(e,a);const i=F0[typeof a.value];e._zod.onattach.push(l=>{const s=l._zod.bag,u=(a.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;a.value>u&&(a.inclusive?s.minimum=a.value:s.exclusiveMinimum=a.value)}),e._zod.check=l=>{(a.inclusive?l.value>=a.value:l.value>a.value)||l.issues.push({origin:i,code:"too_small",minimum:typeof a.value=="object"?a.value.getTime():a.value,input:l.value,inclusive:a.inclusive,inst:e,continue:!a.abort})}}),C2=J("$ZodCheckMultipleOf",(e,a)=>{fn.init(e,a),e._zod.onattach.push(i=>{var l;(l=i._zod.bag).multipleOf??(l.multipleOf=a.value)}),e._zod.check=i=>{if(typeof i.value!=typeof a.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%a.value===BigInt(0):Ow(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})}}),j2=J("$ZodCheckNumberFormat",(e,a)=>{fn.init(e,a),a.format=a.format||"float64";const i=a.format?.includes("int"),l=i?"int":"number",[s,u]=Bw[a.format];e._zod.onattach.push(f=>{const h=f._zod.bag;h.format=a.format,h.minimum=s,h.maximum=u,i&&(h.pattern=E2)}),e._zod.check=f=>{const h=f.value;if(i){if(!Number.isInteger(h)){f.issues.push({expected:l,format:a.format,code:"invalid_type",continue:!1,input:h,inst:e});return}if(!Number.isSafeInteger(h)){h>0?f.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!a.abort}):f.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!a.abort});return}}hu&&f.issues.push({origin:"number",input:h,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!a.abort})}}),N2=J("$ZodCheckMaxLength",(e,a)=>{var i;fn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!uh(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum{const s=l.value;if(s.length<=a.maximum)return;const f=fh(s);l.issues.push({origin:f,code:"too_big",maximum:a.maximum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),O2=J("$ZodCheckMinLength",(e,a)=>{var i;fn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!uh(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>s&&(l._zod.bag.minimum=a.minimum)}),e._zod.check=l=>{const s=l.value;if(s.length>=a.minimum)return;const f=fh(s);l.issues.push({origin:f,code:"too_small",minimum:a.minimum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),M2=J("$ZodCheckLengthEquals",(e,a)=>{var i;fn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!uh(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag;s.minimum=a.length,s.maximum=a.length,s.length=a.length}),e._zod.check=l=>{const s=l.value,u=s.length;if(u===a.length)return;const f=fh(s),h=u>a.length;l.issues.push({origin:f,...h?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:l.value,inst:e,continue:!a.abort})}}),Ou=J("$ZodCheckStringFormat",(e,a)=>{var i,l;fn.init(e,a),e._zod.onattach.push(s=>{const u=s._zod.bag;u.format=a.format,a.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(a.pattern))}),a.pattern?(i=e._zod).check??(i.check=s=>{a.pattern.lastIndex=0,!a.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:a.format,input:s.value,...a.pattern?{pattern:a.pattern.toString()}:{},inst:e,continue:!a.abort})}):(l=e._zod).check??(l.check=()=>{})}),D2=J("$ZodCheckRegex",(e,a)=>{Ou.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})}}),k2=J("$ZodCheckLowerCase",(e,a)=>{a.pattern??(a.pattern=z2),Ou.init(e,a)}),L2=J("$ZodCheckUpperCase",(e,a)=>{a.pattern??(a.pattern=A2),Ou.init(e,a)}),B2=J("$ZodCheckIncludes",(e,a)=>{fn.init(e,a);const i=Cu(a.includes),l=)DELIM" +R"DELIM(new RegExp(typeof a.position=="number"?`^.{${a.position}}${i}`:i);a.pattern=l,e._zod.onattach.push(s=>{const u=s._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(l)}),e._zod.check=s=>{s.value.includes(a.includes,a.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:a.includes,input:s.value,inst:e,continue:!a.abort})}}),H2=J("$ZodCheckStartsWith",(e,a)=>{fn.init(e,a);const i=new RegExp(`^${Cu(a.prefix)}.*`);a.pattern??(a.pattern=i),e._zod.onattach.push(l=>{const s=l._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=l=>{l.value.startsWith(a.prefix)||l.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:l.value,inst:e,continue:!a.abort})}}),U2=J("$ZodCheckEndsWith",(e,a)=>{fn.init(e,a);const i=new RegExp(`.*${Cu(a.suffix)}$`);a.pattern??(a.pattern=i),e._zod.onattach.push(l=>{const s=l._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=l=>{l.value.endsWith(a.suffix)||l.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:l.value,inst:e,continue:!a.abort})}}),$2=J("$ZodCheckOverwrite",(e,a)=>{fn.init(e,a),e._zod.check=i=>{i.value=a.tx(i.value)}});class Z2{constructor(a=[]){this.content=[],this.indent=0,this&&(this.args=a)}indented(a){this.indent+=1,a(this),this.indent-=1}write(a){if(typeof a=="function"){a(this,{execution:"sync"}),a(this,{execution:"async"});return}const l=a.split(` `).filter(f=>f),s=Math.min(...l.map(f=>f.length-f.trimStart().length)),u=l.map(f=>f.slice(s)).map(f=>" ".repeat(this.indent*2)+f);for(const f of u)this.content.push(f)}compile(){const a=Function,i=this?.args,s=[...(this?.content??[""]).map(u=>` ${u}`)];return new a(...i,s.join(` -`))}}const $2={major:4,minor:3,patch:6},wt=J("$ZodType",(e,a)=>{var i;e??(e={}),e._zod.def=a,e._zod.bag=e._zod.bag||{},e._zod.version=$2;const l=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&l.unshift(e);for(const s of l)for(const u of s._zod.onattach)u(e);if(l.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(f,h,p)=>{let m=Hi(f),g;for(const v of h){if(v._zod.def.when){if(!v._zod.def.when(f))continue}else if(m)continue;const x=f.issues.length,w=v._zod.check(f);if(w instanceof Promise&&p?.async===!1)throw new $i;if(g||w instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await w,f.issues.length!==x&&(m||(m=Hi(f,x)))});else{if(f.issues.length===x)continue;m||(m=Hi(f,x))}}return g?g.then(()=>f):f},u=(f,h,p)=>{if(Hi(f))return f.aborted=!0,f;const m=s(h,l,p);if(m instanceof Promise){if(p.async===!1)throw new $i;return m.then(g=>e._zod.parse(g,p))}return e._zod.parse(m,p)};e._zod.run=(f,h)=>{if(h.skipChecks)return e._zod.parse(f,h);if(h.direction==="backward"){const m=e._zod.parse({value:f.value,issues:[]},{...h,skipChecks:!0});return m instanceof Promise?m.then(g=>u(g,f,h)):u(m,f,h)}const p=e._zod.parse(f,h);if(p instanceof Promise){if(h.async===!1)throw new $i;return p.then(m=>s(m,l,h))}return s(p,l,h)}}We(e,"~standard",()=>({validate:s=>{try{const u=Gw(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return Yw(e,s).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},vendor:"zod",version:1}))}),dh=J("$ZodString",(e,a)=>{wt.init(e,a),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??S2(e._zod.bag),e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),dt=J("$ZodStringFormat",(e,a)=>{ju.init(e,a),dh.init(e,a)}),Z2=J("$ZodGUID",(e,a)=>{a.pattern??(a.pattern=s2),dt.init(e,a)}),q2=J("$ZodUUID",(e,a)=>{if(a.version){const l={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(l===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=Yv(l))}else a.pattern??(a.pattern=Yv());dt.init(e,a)}),Q2=J("$ZodEmail",(e,a)=>{a.pattern??(a.pattern=u2),dt.init(e,a)}),P2=J("$ZodURL",(e,a)=>{dt.init(e,a),e._zod.check=i=>{try{const l=i.value.trim(),s=new URL(l);a.hostname&&(a.hostname.lastIndex=0,a.hostname.test(s.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:a.hostname.source,input:i.value,inst:e,continue:!a.abort})),a.protocol&&(a.protocol.lastIndex=0,a.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:a.protocol.source,input:i.value,inst:e,continue:!a.abort})),a.normalize?i.value=s.href:i.value=l;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!a.abort})}}}),G2=J("$ZodEmoji",(e,a)=>{a.pattern??(a.pattern=f2()),dt.init(e,a)}),Y2=J("$ZodNanoID",(e,a)=>{a.pattern??(a.pattern=l2),dt.init(e,a)}),F2=J("$ZodCUID",(e,a)=>{a.pattern??(a.pattern=t2),dt.init(e,a)}),K2=J("$ZodCUID2",(e,a)=>{a.pattern??(a.pattern=n2),dt.init(e,a)}),V2=J("$ZodULID",(e,a)=>)DELIM" -R"DELIM({a.pattern??(a.pattern=a2),dt.init(e,a)}),X2=J("$ZodXID",(e,a)=>{a.pattern??(a.pattern=r2),dt.init(e,a)}),J2=J("$ZodKSUID",(e,a)=>{a.pattern??(a.pattern=i2),dt.init(e,a)}),I2=J("$ZodISODateTime",(e,a)=>{a.pattern??(a.pattern=x2(a)),dt.init(e,a)}),W2=J("$ZodISODate",(e,a)=>{a.pattern??(a.pattern=g2),dt.init(e,a)}),e_=J("$ZodISOTime",(e,a)=>{a.pattern??(a.pattern=b2(a)),dt.init(e,a)}),t_=J("$ZodISODuration",(e,a)=>{a.pattern??(a.pattern=o2),dt.init(e,a)}),n_=J("$ZodIPv4",(e,a)=>{a.pattern??(a.pattern=d2),dt.init(e,a),e._zod.bag.format="ipv4"}),a_=J("$ZodIPv6",(e,a)=>{a.pattern??(a.pattern=h2),dt.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})}}}),r_=J("$ZodCIDRv4",(e,a)=>{a.pattern??(a.pattern=m2),dt.init(e,a)}),i_=J("$ZodCIDRv6",(e,a)=>{a.pattern??(a.pattern=p2),dt.init(e,a),e._zod.check=i=>{const l=i.value.split("/");try{if(l.length!==2)throw new Error;const[s,u]=l;if(!u)throw new Error;const f=Number(u);if(`${f}`!==u)throw new Error;if(f<0||f>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 K0(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const l_=J("$ZodBase64",(e,a)=>{a.pattern??(a.pattern=y2),dt.init(e,a),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{K0(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!a.abort})}});function o_(e){if(!q0.test(e))return!1;const a=e.replace(/[-_]/g,l=>l==="-"?"+":"/"),i=a.padEnd(Math.ceil(a.length/4)*4,"=");return K0(i)}const s_=J("$ZodBase64URL",(e,a)=>{a.pattern??(a.pattern=q0),dt.init(e,a),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{o_(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!a.abort})}}),u_=J("$ZodE164",(e,a)=>{a.pattern??(a.pattern=v2),dt.init(e,a)});function c_(e,a=null){try{const i=e.split(".");if(i.length!==3)return!1;const[l]=i;if(!l)return!1;const s=JSON.parse(atob(l));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||a&&(!("alg"in s)||s.alg!==a))}catch{return!1}}const f_=J("$ZodJWT",(e,a)=>{dt.init(e,a),e._zod.check=i=>{c_(i.value,a.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!a.abort})}}),V0=J("$ZodNumber",(e,a)=>{wt.init(e,a),e._zod.pattern=e._zod.bag.pattern??_2,e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=Number(i.value)}catch{}const s=i.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return i;const u=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...u?{received:u}:{}}),i}}),d_=J("$ZodNumberFormat",(e,a)=>{A2.init(e,a),V0.init(e,a)}),h_=J("$ZodBoolean",(e,a)=>{wt.init(e,a),e._zod.pattern=E2,e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=!!i.value}catch{}const s=i.value;return typeof s=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),i}}),m_=J("$ZodUnknown",(e,a)=>{wt.init(e,a),e._zod.parse=i=>i}),p_=J("$ZodNever",(e,a)=>{wt.init(e,a),e._zod.parse=(i,l)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function Fv(e,a,i){e.issues.length&&a.issues.push(...H0(i,e.issues)),a.value[i]=e.value}const y_=J("$ZodArray",(e,a)=>{wt.init(e,a),e._zod.parse=(i,l)=>{const s=i.value;if(!Array.isArray(s))return i.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),i;i.value=Array(s.length);const u=[];for(let f=0;fFv(m,i,f))):Fv(p,i,f)}return u.length?Promise.all(u).then(()=>i):i}});function mu(e,a,i,l,s){if(e.issues.length){if(s&&!(i in l))return;a.issues.push(...H0(i,e.issues))}e.value===void 0?i in l&&(a.value[i]=void 0):a.value[i]=e.value}function X0(e){const a=Object.keys(e.shape);for(const l of a)if(!e.shape?.[l]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const i=Dw(e.shape);return{...e,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(i)}}function J0(e,a,i,l,s,u){const f=[],h=s.keySet,p=s.catchall._zod,m=p.def.type,g=p.optout==="optional";for(const v in a){if(h.has(v))continue;if(m==="never"){f.push(v);continue}const x=p.run({value:a[v],issues:[]},l);x instanceof Promise?e.push(x.then(w=>mu(w,i,v,a,g))):mu(x,i,v,a,g)}return f.length&&i.issues.push({code:"unrecognized_keys",keys:f,input:a,inst:u}),e.length?Promise.all(e).then(()=>i):i}const v_=J("$ZodObject",(e,a)=>{if(wt.init(e,a),!Object.getOwnPropertyDescriptor(a,"shape")?.get){const h=a.shape;Object.defineProperty(a,"shape",{get:()=>{const p={...h};return Object.defineProperty(a,"shape",{value:p}),p}})}const l=lh(()=>X0(a));We(e._zod,"propValues",()=>{const h=a.shape,p={};for(const m in h){const g=)DELIM" -R"DELIM(h[m]._zod;if(g.values){p[m]??(p[m]=new Set);for(const v of g.values)p[m].add(v)}}return p});const s=hu,u=a.catchall;let f;e._zod.parse=(h,p)=>{f??(f=l.value);const m=h.value;if(!s(m))return h.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),h;h.value={};const g=[],v=f.shape;for(const x of f.keys){const w=v[x],_=w._zod.optout==="optional",E=w._zod.run({value:m[x],issues:[]},p);E instanceof Promise?g.push(E.then(z=>mu(z,h,x,m,_))):mu(E,h,x,m,_)}return u?J0(g,m,h,p,l.value,e):g.length?Promise.all(g).then(()=>h):h}}),g_=J("$ZodObjectJIT",(e,a)=>{v_.init(e,a);const i=e._zod.parse,l=lh(()=>X0(a)),s=x=>{const w=new U2(["shape","payload","ctx"]),_=l.value,E=B=>{const Y=Gv(B);return`shape[${Y}]._zod.run({ value: input[${Y}], issues: [] }, ctx)`};w.write("const input = payload.value;");const z=Object.create(null);let M=0;for(const B of _.keys)z[B]=`key_${M++}`;w.write("const newResult = {};");for(const B of _.keys){const Y=z[B],K=Gv(B),I=x[B]?._zod?.optout==="optional";w.write(`const ${Y} = ${E(B)};`),I?w.write(` +`))}}const q2={major:4,minor:3,patch:6},_t=J("$ZodType",(e,a)=>{var i;e??(e={}),e._zod.def=a,e._zod.bag=e._zod.bag||{},e._zod.version=q2;const l=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&l.unshift(e);for(const s of l)for(const u of s._zod.onattach)u(e);if(l.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(f,h,p)=>{let m=Hi(f),b;for(const v of h){if(v._zod.def.when){if(!v._zod.def.when(f))continue}else if(m)continue;const x=f.issues.length,w=v._zod.check(f);if(w instanceof Promise&&p?.async===!1)throw new $i;if(b||w instanceof Promise)b=(b??Promise.resolve()).then(async()=>{await w,f.issues.length!==x&&(m||(m=Hi(f,x)))});else{if(f.issues.length===x)continue;m||(m=Hi(f,x))}}return b?b.then(()=>f):f},u=(f,h,p)=>{if(Hi(f))return f.aborted=!0,f;const m=s(h,l,p);if(m instanceof Promise){if(p.async===!1)throw new $i;return m.then(b=>e._zod.parse(b,p))}return e._zod.parse(m,p)};e._zod.run=(f,h)=>{if(h.skipChecks)return e._zod.parse(f,h);if(h.direction==="backward"){const m=e._zod.parse({value:f.value,issues:[]},{...h,skipChecks:!0});return m instanceof Promise?m.then(b=>u(b,f,h)):u(m,f,h)}const p=e._zod.parse(f,h);if(p instanceof Promise){if(h.async===!1)throw new $i;return p.then(m=>s(m,l,h))}return s(p,l,h)}}We(e,"~standard",()=>({validate:s=>{try{const u=Fw(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return Kw(e,s).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},vendor:"zod",version:1}))}),mh=J("$ZodString",(e,a)=>{_t.init(e,a),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??_2(e._zod.bag),e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),dt=J("$ZodStringFormat",(e,a)=>{Ou.init(e,a),mh.init(e,a)}),Q2=J("$ZodGUID",(e,a)=>{a.pattern??(a.pattern=c2),dt.init(e,a)}),P2=J("$ZodUUID",(e,a)=>{if(a.version){const l={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(l===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=Kv(l))}else a.pattern??(a.pattern=Kv());dt.init(e,a)}),G2=J("$ZodEmail",(e,a)=>{a.pattern??(a.pattern=f2),dt.init(e,a)}),Y2=J("$ZodURL",(e,a)=>{dt.init(e,a),e._zod.check=i=>{try{const l=i.value.trim(),s=new URL(l);a.hostname&&(a.hostname.lastIndex=0,a.hostname.test(s.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:a.hostname.source,input:i.value,inst:e,continue:!a.abort})),a.protocol&&(a.protocol.lastIndex=0,a.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:a.protocol.source,input:i.value,inst:e,continue:!a.abort})),a.normalize?i.value=s.href:i.value=l;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!a.abort})}}}),F2=J("$ZodEmoji",(e,a)=>{a.pattern??(a.pattern=h2()),dt.init(e,a)}),K2=J("$ZodNanoID",(e,a)=>{a.pattern??(a.pattern=s2),dt.init(e,a)}),V2=J("$ZodCUID",(e,a)=>{a.pattern??(a.pattern=a2),dt.init(e,a)}),X2=J("$ZodCUID2",(e,a)=>{a.pattern??(a.pattern=r2),dt.init(e,a)}),J2=J("$ZodULID",(e,a)=>)DELIM" +R"DELIM({a.pattern??(a.pattern=i2),dt.init(e,a)}),I2=J("$ZodXID",(e,a)=>{a.pattern??(a.pattern=l2),dt.init(e,a)}),W2=J("$ZodKSUID",(e,a)=>{a.pattern??(a.pattern=o2),dt.init(e,a)}),e_=J("$ZodISODateTime",(e,a)=>{a.pattern??(a.pattern=w2(a)),dt.init(e,a)}),t_=J("$ZodISODate",(e,a)=>{a.pattern??(a.pattern=x2),dt.init(e,a)}),n_=J("$ZodISOTime",(e,a)=>{a.pattern??(a.pattern=S2(a)),dt.init(e,a)}),a_=J("$ZodISODuration",(e,a)=>{a.pattern??(a.pattern=u2),dt.init(e,a)}),r_=J("$ZodIPv4",(e,a)=>{a.pattern??(a.pattern=m2),dt.init(e,a),e._zod.bag.format="ipv4"}),i_=J("$ZodIPv6",(e,a)=>{a.pattern??(a.pattern=p2),dt.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})}}}),l_=J("$ZodCIDRv4",(e,a)=>{a.pattern??(a.pattern=y2),dt.init(e,a)}),o_=J("$ZodCIDRv6",(e,a)=>{a.pattern??(a.pattern=v2),dt.init(e,a),e._zod.check=i=>{const l=i.value.split("/");try{if(l.length!==2)throw new Error;const[s,u]=l;if(!u)throw new Error;const f=Number(u);if(`${f}`!==u)throw new Error;if(f<0||f>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 X0(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const s_=J("$ZodBase64",(e,a)=>{a.pattern??(a.pattern=g2),dt.init(e,a),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{X0(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!a.abort})}});function u_(e){if(!P0.test(e))return!1;const a=e.replace(/[-_]/g,l=>l==="-"?"+":"/"),i=a.padEnd(Math.ceil(a.length/4)*4,"=");return X0(i)}const c_=J("$ZodBase64URL",(e,a)=>{a.pattern??(a.pattern=P0),dt.init(e,a),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{u_(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!a.abort})}}),f_=J("$ZodE164",(e,a)=>{a.pattern??(a.pattern=b2),dt.init(e,a)});function d_(e,a=null){try{const i=e.split(".");if(i.length!==3)return!1;const[l]=i;if(!l)return!1;const s=JSON.parse(atob(l));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||a&&(!("alg"in s)||s.alg!==a))}catch{return!1}}const h_=J("$ZodJWT",(e,a)=>{dt.init(e,a),e._zod.check=i=>{d_(i.value,a.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!a.abort})}}),J0=J("$ZodNumber",(e,a)=>{_t.init(e,a),e._zod.pattern=e._zod.bag.pattern??T2,e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=Number(i.value)}catch{}const s=i.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return i;const u=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...u?{received:u}:{}}),i}}),m_=J("$ZodNumberFormat",(e,a)=>{j2.init(e,a),J0.init(e,a)}),p_=J("$ZodBoolean",(e,a)=>{_t.init(e,a),e._zod.pattern=R2,e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=!!i.value}catch{}const s=i.value;return typeof s=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),i}}),y_=J("$ZodUnknown",(e,a)=>{_t.init(e,a),e._zod.parse=i=>i}),v_=J("$ZodNever",(e,a)=>{_t.init(e,a),e._zod.parse=(i,l)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function Vv(e,a,i){e.issues.length&&a.issues.push(...$0(i,e.issues)),a.value[i]=e.value}const g_=J("$ZodArray",(e,a)=>{_t.init(e,a),e._zod.parse=(i,l)=>{const s=i.value;if(!Array.isArray(s))return i.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),i;i.value=Array(s.length);const u=[];for(let f=0;fVv(m,i,f))):Vv(p,i,f)}return u.length?Promise.all(u).then(()=>i):i}});function yu(e,a,i,l,s){if(e.issues.length){if(s&&!(i in l))return;a.issues.push(...$0(i,e.issues))}e.value===void 0?i in l&&(a.value[i]=void 0):a.value[i]=e.value}function I0(e){const a=Object.keys(e.shape);for(const l of a)if(!e.shape?.[l]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const i=Lw(e.shape);return{...e,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(i)}}function W0(e,a,i,l,s,u){const f=[],h=s.keySet,p=s.catchall._zod,m=p.def.type,b=p.optout==="optional";for(const v in a){if(h.has(v))continue;if(m==="never"){f.push(v);continue}const x=p.run({value:a[v],issues:[]},l);x instanceof Promise?e.push(x.then(w=>yu(w,i,v,a,b))):yu(x,i,v,a,b)}return f.length&&i.issues.push({code:"unrecognized_keys",keys:f,input:a,inst:u}),e.length?Promise.all(e).then(()=>i):i}const b_=J("$ZodObject",(e,a)=>{if(_t.init(e,a),!Object.getOwnPropertyDescriptor(a,"shape")?.get){const h=a.shape;Object.defineProperty(a,"shape",{get:()=>{const p={...h};return Object.defineProperty(a,"shape",{value:p}),p}})}const l=sh(()=>I0(a));We(e._zod,"propValues",()=>{const h=a.shape,p={};for(const m in h){const b=)DELIM" +R"DELIM(h[m]._zod;if(b.values){p[m]??(p[m]=new Set);for(const v of b.values)p[m].add(v)}}return p});const s=pu,u=a.catchall;let f;e._zod.parse=(h,p)=>{f??(f=l.value);const m=h.value;if(!s(m))return h.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),h;h.value={};const b=[],v=f.shape;for(const x of f.keys){const w=v[x],_=w._zod.optout==="optional",E=w._zod.run({value:m[x],issues:[]},p);E instanceof Promise?b.push(E.then(R=>yu(R,h,x,m,_))):yu(E,h,x,m,_)}return u?W0(b,m,h,p,l.value,e):b.length?Promise.all(b).then(()=>h):h}}),x_=J("$ZodObjectJIT",(e,a)=>{b_.init(e,a);const i=e._zod.parse,l=sh(()=>I0(a)),s=x=>{const w=new Z2(["shape","payload","ctx"]),_=l.value,E=B=>{const Y=Fv(B);return`shape[${Y}]._zod.run({ value: input[${Y}], issues: [] }, ctx)`};w.write("const input = payload.value;");const R=Object.create(null);let M=0;for(const B of _.keys)R[B]=`key_${M++}`;w.write("const newResult = {};");for(const B of _.keys){const Y=R[B],K=Fv(B),I=x[B]?._zod?.optout==="optional";w.write(`const ${Y} = ${E(B)};`),I?w.write(` if (${Y}.issues.length) { if (${K} in input) { payload.issues = payload.issues.concat(${Y}.issues.map(iss => ({ @@ -117,62 +117,62 @@ R"DELIM(h[m]._zod;if(g.values){p[m]??(p[m]=new Set);for(const v of g.values)p[m] newResult[${K}] = ${Y}.value; } - `)}w.write("payload.value = newResult;"),w.write("return payload;");const L=w.compile();return(B,Y)=>L(x,B,Y)};let u;const f=hu,h=!D0.jitless,m=h&&Nw.value,g=a.catchall;let v;e._zod.parse=(x,w)=>{v??(v=l.value);const _=x.value;return f(_)?h&&m&&w?.async===!1&&w.jitless!==!0?(u||(u=s(a.shape)),x=u(x,w),g?J0([],_,x,w,v,e):x):i(x,w):(x.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),x)}});function Kv(e,a,i,l){for(const u of e)if(u.issues.length===0)return a.value=u.value,a;const s=e.filter(u=>!Hi(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(f=>Pr(f,l,Qr())))}),a)}const b_=J("$ZodUnion",(e,a)=>{wt.init(e,a),We(e._zod,"optin",()=>a.options.some(s=>s._zod.optin==="optional")?"optional":void 0),We(e._zod,"optout",()=>a.options.some(s=>s._zod.optout==="optional")?"optional":void 0),We(e._zod,"values",()=>{if(a.options.every(s=>s._zod.values))return new Set(a.options.flatMap(s=>Array.from(s._zod.values)))}),We(e._zod,"pattern",()=>{if(a.options.every(s=>s._zod.pattern)){const s=a.options.map(u=>u._zod.pattern);return new RegExp(`^(${s.map(u=>sh(u.source)).join("|")})$`)}});const i=a.options.length===1,l=a.options[0]._zod.run;e._zod.parse=(s,u)=>{if(i)return l(s,u);let f=!1;const h=[];for(const p of a.options){const m=p._zod.run({value:s.value,issues:[]},u);if(m instanceof Promise)h.push(m),f=!0;else{if(m.issues.length===0)return m;h.push(m)}}return f?Promise.all(h).then(p=>Kv(p,s,e,u)):Kv(h,s,e,u)}}),x_=J("$ZodIntersection",(e,a)=>{wt.init(e,a),e._zod.parse=(i,l)=>{const s=i.value,u=a.left._zod.run({value:s,issues:[]},l),f=a.right._zod.run({value:s,issues:[]},l);return u instanceof Promise||f instanceof Promise?Promise.all([u,f]).then(([p,m])=>Vv(i,p,m)):Vv(i,u,f)}});function Qd(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(ro(e)&&ro(a)){const i=Object.keys(a),l=Object.keys(e).filter(u=>i.indexOf(u)!==-1),s={...e,...a};for(const u of l){const f=Qd(e[u],a[u]);if(!f.valid)return{valid:!1,mergeErrorPath:[u,...f.mergeErrorPath]};s[u]=f.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(a)){if(e.length!==a.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let l=0;lh.l&&h.r).map(([h])=>h);if(u.length&&s&&e.issues.push({...s,keys:u}),Hi(e))return e;const f=Qd(a.value,i.value);if(!f.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(f.mergeErrorPath)}`);)DELIM" - R"DELIM(return e.value=f.data,e}const S_=J("$ZodEnum",(e,a)=>{wt.init(e,a);const i=k0(a.entries),l=new Set(i);e._zod.values=l,e._zod.pattern=new RegExp(`^(${i.filter(s=>Mw.has(typeof s)).map(s=>typeof s=="string"?Au(s):s.toString()).join("|")})$`),e._zod.parse=(s,u)=>{const f=s.value;return l.has(f)||s.issues.push({code:"invalid_value",values:i,input:f,inst:e}),s}}),w_=J("$ZodTransform",(e,a)=>{wt.init(e,a),e._zod.parse=(i,l)=>{if(l.direction==="backward")throw new M0(e.constructor.name);const s=a.transform(i.value,i);if(l.async)return(s instanceof Promise?s:Promise.resolve(s)).then(f=>(i.value=f,i));if(s instanceof Promise)throw new $i;return i.value=s,i}});function Xv(e,a){return e.issues.length&&a===void 0?{issues:[],value:void 0}:e}const I0=J("$ZodOptional",(e,a)=>{wt.init(e,a),e._zod.optin="optional",e._zod.optout="optional",We(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),We(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${sh(i.source)})?$`):void 0}),e._zod.parse=(i,l)=>{if(a.innerType._zod.optin==="optional"){const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Xv(u,i.value)):Xv(s,i.value)}return i.value===void 0?i:a.innerType._zod.run(i,l)}}),__=J("$ZodExactOptional",(e,a)=>{I0.init(e,a),We(e._zod,"values",()=>a.innerType._zod.values),We(e._zod,"pattern",()=>a.innerType._zod.pattern),e._zod.parse=(i,l)=>a.innerType._zod.run(i,l)}),E_=J("$ZodNullable",(e,a)=>{wt.init(e,a),We(e._zod,"optin",()=>a.innerType._zod.optin),We(e._zod,"optout",()=>a.innerType._zod.optout),We(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${sh(i.source)}|null)$`):void 0}),We(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),e._zod.parse=(i,l)=>i.value===null?i:a.innerType._zod.run(i,l)}),T_=J("$ZodDefault",(e,a)=>{wt.init(e,a),e._zod.optin="optional",We(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);if(i.value===void 0)return i.value=a.defaultValue,i;const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Jv(u,a)):Jv(s,a)}});function Jv(e,a){return e.value===void 0&&(e.value=a.defaultValue),e}const R_=J("$ZodPrefault",(e,a)=>{wt.init(e,a),e._zod.optin="optional",We(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>(l.direction==="backward"||i.value===void 0&&(i.value=a.defaultValue),a.innerType._zod.run(i,l))}),z_=J("$ZodNonOptional",(e,a)=>{wt.init(e,a),We(e._zod,"values",()=>{const i=a.innerType._zod.values;return i?new Set([...i].filter(l=>l!==void 0)):void 0}),e._zod.parse=(i,l)=>{const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Iv(u,e)):Iv(s,e)}});function Iv(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 A_=J("$ZodCatch",(e,a)=>{wt.init(e,a),We(e._zod,"optin",()=>a.innerType._zod.optin),We(e._zod,"optout",()=>a.innerType._zod.optout),We(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>(i.value=u.value,u.issues.length&&(i.value=a.catchValue({...i,error:{issues:u.issues.map(f=>Pr(f,l,Qr()))},input:i.value}),i.issues=[]),i)):(i.value=s.value,s.issues.length&&(i.value=a.catchValue({...i,error:{issues:s.issues.map(u=>Pr(u,l,Qr()))},input:i.value}),i.issues=[]),i)}}),C_=J("$ZodPipe",(e,a)=>{wt.init(e,a),We(e._zod,"values",()=>a.in._zod.values),We(e._zod,"optin",()=>a.in._zod.optin),We(e._zod,"optout",()=>a.out._zod.optout),We(e._zod,"propValues",()=>a.in._zod.propValues),e._zod.parse=(i,l)=>{if(l.direction==="backward"){const u=a.out._zod.run(i,l);return u instanceof Promise?u.then(f=>Qs(f,a.in,l)):Qs(u,a.in,l)}const s=a.in._zod.run(i,l);return s instanceof Promise?s.then(u=>Qs(u,a.out,l)):Qs(s,a.out,l)}});function Qs(e,a,i){return e.issues.length?(e.aborted=!0,e):a._zod.run({value:e.value,issues:e.issues},i)}const O_=J("$ZodReadonly",(e,a)=>{wt.init(e,a),We(e._zod,"propValues",()=>a.innerType._zod.propValues),We(e._zod,"values",()=>a.innerType._zod.values),We(e._zod,"optin",()=>a.innerType?._zod?.optin),We(e._zod,"optout",()=>a.innerType?._zod?.optout),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(Wv):Wv(s)}});function Wv(e){return e.value=Object.freeze(e.value),e}const j_=J("$ZodCustom",(e,a)=>{fn.init(e,a),wt.init(e,a),e._zod.parse=(i,l)=>i,e._zod.check=i=>{const l=i.value,s=a.fn(l);if(s instanceof Promise)return s.then(u=>eg(u,i,l,e));eg(s,i,l,e)}});function eg(e,a,i,l){if(!e){const s={code:"custom",input:i,inst:l,path:[...l._zod.def.path??[]],continue:!l._zod.def.abort};l._zod.def.params&&(s.params=l._zod.def.params),a.issues.push(io(s))}}var tg;class N_{constructor(){this._map=new Weak)DELIM" - R"DELIM(Map,this._idmap=new Map}add(a,...i){const l=i[0];return this._map.set(a,l),l&&typeof l=="object"&&"id"in l&&this._idmap.set(l.id,a),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(a){const i=this._map.get(a);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(a),this}get(a){const i=a._zod.parent;if(i){const l={...this.get(i)??{}};delete l.id;const s={...l,...this._map.get(a)};return Object.keys(s).length?s:void 0}return this._map.get(a)}has(a){return this._map.has(a)}}function M_(){return new N_}(tg=globalThis).__zod_globalRegistry??(tg.__zod_globalRegistry=M_());const Vl=globalThis.__zod_globalRegistry;function D_(e,a){return new e({type:"string",...Ee(a)})}function k_(e,a){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ee(a)})}function ng(e,a){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ee(a)})}function L_(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ee(a)})}function B_(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ee(a)})}function H_(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ee(a)})}function U_(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ee(a)})}function $_(e,a){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ee(a)})}function Z_(e,a){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ee(a)})}function q_(e,a){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ee(a)})}function Q_(e,a){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ee(a)})}function P_(e,a){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ee(a)})}function G_(e,a){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ee(a)})}function Y_(e,a){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ee(a)})}function F_(e,a){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ee(a)})}function K_(e,a){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ee(a)})}function V_(e,a){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ee(a)})}function X_(e,a){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ee(a)})}function J_(e,a){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ee(a)})}function I_(e,a){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ee(a)})}function W_(e,a){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ee(a)})}function eE(e,a){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ee(a)})}function tE(e,a){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ee(a)})}function nE(e,a){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ee(a)})}function aE(e,a){return new e({type:"string",format:"date",check:"string_format",...Ee(a)})}function rE(e,a){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ee(a)})}function iE(e,a){return new e({type:"string",format:"duration",check:"string_format",...Ee(a)})}function lE(e,a){return new e({type:"number",checks:[],...Ee(a)})}function oE(e,a){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ee(a)})}function sE(e,a){return new e({type:"boolean",...Ee(a)})}function uE(e){return new e({type:"unknown"})}function cE(e,a){return new e({type:"never",...Ee(a)})}function ag(e,a){return new Y0({check:"less_than",...Ee(a),value:e,inclusive:!1})}function ed(e,a){return new Y0({check:"less_than",...Ee(a),value:e,inclusive:!0})}function rg(e,a){return new F0({check:"greater_than",...Ee(a),value:e,inclusive:!1})}function td(e,a){return new F0({check:"greater_than",...Ee(a),value:e,inclusive:!0})}function ig(e,a){return new z2({check:"multiple_of",...Ee(a),value:e})}function W0(e,a){return new C2({check:"max_length",...Ee(a),maximum:e})}function pu(e,a){return new O2({check:"min_length",...Ee(a),minimum:e})}function eb(e,a){return new j2({check:"length_equals",...Ee(a),length:e})}function fE(e,a){return new N2({check:"string_format",format:"regex",...Ee(a),pattern:e})}function dE(e){return new M2({check:"string_format",format:"lowercase",...Ee(e)})}function hE(e){return new D2({check:"string_format",format:"uppercase",...Ee(e)})}function mE(e,a){return new k2({check:"string_format",format:"includes",...Ee(a),includes:e})}function pE(e,a){return new L2({check:"string_format",format:"starts_with",...Ee(a),prefix:e})}function yE(e,a){return new B2({check:"string_format",format:"ends_with",...Ee(a),suffix:e})}function Fi(e){return new H2({check:"overwrite",tx:e})}function vE(e){return Fi(a=>a.norma)DELIM" - R"DELIM(lize(e))}function gE(){return Fi(e=>e.trim())}function bE(){return Fi(e=>e.toLowerCase())}function xE(){return Fi(e=>e.toUpperCase())}function SE(){return Fi(e=>jw(e))}function wE(e,a,i){return new e({type:"array",element:a,...Ee(i)})}function _E(e,a,i){return new e({type:"custom",check:"custom",fn:a,...Ee(i)})}function EE(e){const a=TE(i=>(i.addIssue=l=>{if(typeof l=="string")i.issues.push(io(l,i.value,a._zod.def));else{const s=l;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=a),s.continue??(s.continue=!a._zod.def.abort),i.issues.push(io(s))}},e(i.value,i)));return a}function TE(e,a){const i=new fn({check:"custom",...Ee(a)});return i._zod.check=e,i}function tb(e){let a=e?.target??"draft-2020-12";return a==="draft-4"&&(a="draft-04"),a==="draft-7"&&(a="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Vl,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 Pt(e,a,i={path:[],schemaPath:[]}){var l;const s=e._zod.def,u=a.seen.get(e);if(u)return u.count++,i.schemaPath.includes(e)&&(u.cycle=i.path),u.schema;const f={schema:{},count:1,cycle:void 0,path:i.path};a.seen.set(e,f);const h=e._zod.toJSONSchema?.();if(h)f.schema=h;else{const g={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(a,f.schema,g);else{const x=f.schema,w=a.processors[s.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);w(e,a,x,g)}const v=e._zod.parent;v&&(f.ref||(f.ref=v),Pt(v,a,g),a.seen.get(v).isParent=!0)}const p=a.metadataRegistry.get(e);return p&&Object.assign(f.schema,p),a.io==="input"&&en(e)&&(delete f.schema.examples,delete f.schema.default),a.io==="input"&&f.schema._prefault&&((l=f.schema).default??(l.default=f.schema._prefault)),delete f.schema._prefault,a.seen.get(e).schema}function nb(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=new Map;for(const f of e.seen.entries()){const h=e.metadataRegistry.get(f[0])?.id;if(h){const p=l.get(h);if(p&&p!==f[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);l.set(h,f[0])}}const s=f=>{const h=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=e.external.registry.get(f[0])?.id,x=e.external.uri??(_=>_);if(v)return{ref:x(v)};const w=f[1].defId??f[1].schema.id??`schema${e.counter++}`;return f[1].defId=w,{defId:w,ref:`${x("__shared")}#/${h}/${w}`}}if(f[1]===i)return{ref:"#"};const m=`#/${h}/`,g=f[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:m+g}},u=f=>{if(f[1].schema.$ref)return;const h=f[1],{ref:p,defId:m}=s(f);h.def={...h.schema},m&&(h.defId=m);const g=h.schema;for(const v in g)delete g[v];g.$ref=p};if(e.cycles==="throw")for(const f of e.seen.entries()){const h=f[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/ + `)}w.write("payload.value = newResult;"),w.write("return payload;");const L=w.compile();return(B,Y)=>L(x,B,Y)};let u;const f=pu,h=!L0.jitless,m=h&&Dw.value,b=a.catchall;let v;e._zod.parse=(x,w)=>{v??(v=l.value);const _=x.value;return f(_)?h&&m&&w?.async===!1&&w.jitless!==!0?(u||(u=s(a.shape)),x=u(x,w),b?W0([],_,x,w,v,e):x):i(x,w):(x.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),x)}});function Xv(e,a,i,l){for(const u of e)if(u.issues.length===0)return a.value=u.value,a;const s=e.filter(u=>!Hi(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(f=>Pr(f,l,Qr())))}),a)}const S_=J("$ZodUnion",(e,a)=>{_t.init(e,a),We(e._zod,"optin",()=>a.options.some(s=>s._zod.optin==="optional")?"optional":void 0),We(e._zod,"optout",()=>a.options.some(s=>s._zod.optout==="optional")?"optional":void 0),We(e._zod,"values",()=>{if(a.options.every(s=>s._zod.values))return new Set(a.options.flatMap(s=>Array.from(s._zod.values)))}),We(e._zod,"pattern",()=>{if(a.options.every(s=>s._zod.pattern)){const s=a.options.map(u=>u._zod.pattern);return new RegExp(`^(${s.map(u=>ch(u.source)).join("|")})$`)}});const i=a.options.length===1,l=a.options[0]._zod.run;e._zod.parse=(s,u)=>{if(i)return l(s,u);let f=!1;const h=[];for(const p of a.options){const m=p._zod.run({value:s.value,issues:[]},u);if(m instanceof Promise)h.push(m),f=!0;else{if(m.issues.length===0)return m;h.push(m)}}return f?Promise.all(h).then(p=>Xv(p,s,e,u)):Xv(h,s,e,u)}}),w_=J("$ZodIntersection",(e,a)=>{_t.init(e,a),e._zod.parse=(i,l)=>{const s=i.value,u=a.left._zod.run({value:s,issues:[]},l),f=a.right._zod.run({value:s,issues:[]},l);return u instanceof Promise||f instanceof Promise?Promise.all([u,f]).then(([p,m])=>Jv(i,p,m)):Jv(i,u,f)}});function Gd(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(io(e)&&io(a)){const i=Object.keys(a),l=Object.keys(e).filter(u=>i.indexOf(u)!==-1),s={...e,...a};for(const u of l){const f=Gd(e[u],a[u]);if(!f.valid)return{valid:!1,mergeErrorPath:[u,...f.mergeErrorPath]};s[u]=f.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(a)){if(e.length!==a.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let l=0;lh.l&&h.r).map(([h])=>h);if(u.length&&s&&e.issues.push({...s,keys:u}),Hi(e))return e;const f=Gd(a.value,i.value);if(!f.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(f.mergeErrorPath)}`);)DELIM" + R"DELIM(return e.value=f.data,e}const __=J("$ZodEnum",(e,a)=>{_t.init(e,a);const i=B0(a.entries),l=new Set(i);e._zod.values=l,e._zod.pattern=new RegExp(`^(${i.filter(s=>kw.has(typeof s)).map(s=>typeof s=="string"?Cu(s):s.toString()).join("|")})$`),e._zod.parse=(s,u)=>{const f=s.value;return l.has(f)||s.issues.push({code:"invalid_value",values:i,input:f,inst:e}),s}}),E_=J("$ZodTransform",(e,a)=>{_t.init(e,a),e._zod.parse=(i,l)=>{if(l.direction==="backward")throw new k0(e.constructor.name);const s=a.transform(i.value,i);if(l.async)return(s instanceof Promise?s:Promise.resolve(s)).then(f=>(i.value=f,i));if(s instanceof Promise)throw new $i;return i.value=s,i}});function Iv(e,a){return e.issues.length&&a===void 0?{issues:[],value:void 0}:e}const eb=J("$ZodOptional",(e,a)=>{_t.init(e,a),e._zod.optin="optional",e._zod.optout="optional",We(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),We(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${ch(i.source)})?$`):void 0}),e._zod.parse=(i,l)=>{if(a.innerType._zod.optin==="optional"){const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Iv(u,i.value)):Iv(s,i.value)}return i.value===void 0?i:a.innerType._zod.run(i,l)}}),T_=J("$ZodExactOptional",(e,a)=>{eb.init(e,a),We(e._zod,"values",()=>a.innerType._zod.values),We(e._zod,"pattern",()=>a.innerType._zod.pattern),e._zod.parse=(i,l)=>a.innerType._zod.run(i,l)}),R_=J("$ZodNullable",(e,a)=>{_t.init(e,a),We(e._zod,"optin",()=>a.innerType._zod.optin),We(e._zod,"optout",()=>a.innerType._zod.optout),We(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${ch(i.source)}|null)$`):void 0}),We(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),e._zod.parse=(i,l)=>i.value===null?i:a.innerType._zod.run(i,l)}),z_=J("$ZodDefault",(e,a)=>{_t.init(e,a),e._zod.optin="optional",We(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);if(i.value===void 0)return i.value=a.defaultValue,i;const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Wv(u,a)):Wv(s,a)}});function Wv(e,a){return e.value===void 0&&(e.value=a.defaultValue),e}const A_=J("$ZodPrefault",(e,a)=>{_t.init(e,a),e._zod.optin="optional",We(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>(l.direction==="backward"||i.value===void 0&&(i.value=a.defaultValue),a.innerType._zod.run(i,l))}),C_=J("$ZodNonOptional",(e,a)=>{_t.init(e,a),We(e._zod,"values",()=>{const i=a.innerType._zod.values;return i?new Set([...i].filter(l=>l!==void 0)):void 0}),e._zod.parse=(i,l)=>{const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>eg(u,e)):eg(s,e)}});function eg(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 j_=J("$ZodCatch",(e,a)=>{_t.init(e,a),We(e._zod,"optin",()=>a.innerType._zod.optin),We(e._zod,"optout",()=>a.innerType._zod.optout),We(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>(i.value=u.value,u.issues.length&&(i.value=a.catchValue({...i,error:{issues:u.issues.map(f=>Pr(f,l,Qr()))},input:i.value}),i.issues=[]),i)):(i.value=s.value,s.issues.length&&(i.value=a.catchValue({...i,error:{issues:s.issues.map(u=>Pr(u,l,Qr()))},input:i.value}),i.issues=[]),i)}}),N_=J("$ZodPipe",(e,a)=>{_t.init(e,a),We(e._zod,"values",()=>a.in._zod.values),We(e._zod,"optin",()=>a.in._zod.optin),We(e._zod,"optout",()=>a.out._zod.optout),We(e._zod,"propValues",()=>a.in._zod.propValues),e._zod.parse=(i,l)=>{if(l.direction==="backward"){const u=a.out._zod.run(i,l);return u instanceof Promise?u.then(f=>Gs(f,a.in,l)):Gs(u,a.in,l)}const s=a.in._zod.run(i,l);return s instanceof Promise?s.then(u=>Gs(u,a.out,l)):Gs(s,a.out,l)}});function Gs(e,a,i){return e.issues.length?(e.aborted=!0,e):a._zod.run({value:e.value,issues:e.issues},i)}const O_=J("$ZodReadonly",(e,a)=>{_t.init(e,a),We(e._zod,"propValues",()=>a.innerType._zod.propValues),We(e._zod,"values",()=>a.innerType._zod.values),We(e._zod,"optin",()=>a.innerType?._zod?.optin),We(e._zod,"optout",()=>a.innerType?._zod?.optout),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(tg):tg(s)}});function tg(e){return e.value=Object.freeze(e.value),e}const M_=J("$ZodCustom",(e,a)=>{fn.init(e,a),_t.init(e,a),e._zod.parse=(i,l)=>i,e._zod.check=i=>{const l=i.value,s=a.fn(l);if(s instanceof Promise)return s.then(u=>ng(u,i,l,e));ng(s,i,l,e)}});function ng(e,a,i,l){if(!e){const s={code:"custom",input:i,inst:l,path:[...l._zod.def.path??[]],continue:!l._zod.def.abort};l._zod.def.params&&(s.params=l._zod.def.params),a.issues.push(lo(s))}}var ag;class D_{constructor(){this._map=new Weak)DELIM" + R"DELIM(Map,this._idmap=new Map}add(a,...i){const l=i[0];return this._map.set(a,l),l&&typeof l=="object"&&"id"in l&&this._idmap.set(l.id,a),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(a){const i=this._map.get(a);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(a),this}get(a){const i=a._zod.parent;if(i){const l={...this.get(i)??{}};delete l.id;const s={...l,...this._map.get(a)};return Object.keys(s).length?s:void 0}return this._map.get(a)}has(a){return this._map.has(a)}}function k_(){return new D_}(ag=globalThis).__zod_globalRegistry??(ag.__zod_globalRegistry=k_());const Xl=globalThis.__zod_globalRegistry;function L_(e,a){return new e({type:"string",...Ee(a)})}function B_(e,a){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ee(a)})}function rg(e,a){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ee(a)})}function H_(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ee(a)})}function U_(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ee(a)})}function $_(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ee(a)})}function Z_(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ee(a)})}function q_(e,a){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ee(a)})}function Q_(e,a){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ee(a)})}function P_(e,a){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ee(a)})}function G_(e,a){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ee(a)})}function Y_(e,a){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ee(a)})}function F_(e,a){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ee(a)})}function K_(e,a){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ee(a)})}function V_(e,a){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ee(a)})}function X_(e,a){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ee(a)})}function J_(e,a){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ee(a)})}function I_(e,a){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ee(a)})}function W_(e,a){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ee(a)})}function eE(e,a){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ee(a)})}function tE(e,a){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ee(a)})}function nE(e,a){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ee(a)})}function aE(e,a){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ee(a)})}function rE(e,a){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ee(a)})}function iE(e,a){return new e({type:"string",format:"date",check:"string_format",...Ee(a)})}function lE(e,a){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ee(a)})}function oE(e,a){return new e({type:"string",format:"duration",check:"string_format",...Ee(a)})}function sE(e,a){return new e({type:"number",checks:[],...Ee(a)})}function uE(e,a){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ee(a)})}function cE(e,a){return new e({type:"boolean",...Ee(a)})}function fE(e){return new e({type:"unknown"})}function dE(e,a){return new e({type:"never",...Ee(a)})}function ig(e,a){return new K0({check:"less_than",...Ee(a),value:e,inclusive:!1})}function nd(e,a){return new K0({check:"less_than",...Ee(a),value:e,inclusive:!0})}function lg(e,a){return new V0({check:"greater_than",...Ee(a),value:e,inclusive:!1})}function ad(e,a){return new V0({check:"greater_than",...Ee(a),value:e,inclusive:!0})}function og(e,a){return new C2({check:"multiple_of",...Ee(a),value:e})}function tb(e,a){return new N2({check:"max_length",...Ee(a),maximum:e})}function vu(e,a){return new O2({check:"min_length",...Ee(a),minimum:e})}function nb(e,a){return new M2({check:"length_equals",...Ee(a),length:e})}function hE(e,a){return new D2({check:"string_format",format:"regex",...Ee(a),pattern:e})}function mE(e){return new k2({check:"string_format",format:"lowercase",...Ee(e)})}function pE(e){return new L2({check:"string_format",format:"uppercase",...Ee(e)})}function yE(e,a){return new B2({check:"string_format",format:"includes",...Ee(a),includes:e})}function vE(e,a){return new H2({check:"string_format",format:"starts_with",...Ee(a),prefix:e})}function gE(e,a){return new U2({check:"string_format",format:"ends_with",...Ee(a),suffix:e})}function Fi(e){return new $2({check:"overwrite",tx:e})}function bE(e){return Fi(a=>a.norma)DELIM" + R"DELIM(lize(e))}function xE(){return Fi(e=>e.trim())}function SE(){return Fi(e=>e.toLowerCase())}function wE(){return Fi(e=>e.toUpperCase())}function _E(){return Fi(e=>Mw(e))}function EE(e,a,i){return new e({type:"array",element:a,...Ee(i)})}function TE(e,a,i){return new e({type:"custom",check:"custom",fn:a,...Ee(i)})}function RE(e){const a=zE(i=>(i.addIssue=l=>{if(typeof l=="string")i.issues.push(lo(l,i.value,a._zod.def));else{const s=l;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=a),s.continue??(s.continue=!a._zod.def.abort),i.issues.push(lo(s))}},e(i.value,i)));return a}function zE(e,a){const i=new fn({check:"custom",...Ee(a)});return i._zod.check=e,i}function ab(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 Pt(e,a,i={path:[],schemaPath:[]}){var l;const s=e._zod.def,u=a.seen.get(e);if(u)return u.count++,i.schemaPath.includes(e)&&(u.cycle=i.path),u.schema;const f={schema:{},count:1,cycle:void 0,path:i.path};a.seen.set(e,f);const h=e._zod.toJSONSchema?.();if(h)f.schema=h;else{const b={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(a,f.schema,b);else{const x=f.schema,w=a.processors[s.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);w(e,a,x,b)}const v=e._zod.parent;v&&(f.ref||(f.ref=v),Pt(v,a,b),a.seen.get(v).isParent=!0)}const p=a.metadataRegistry.get(e);return p&&Object.assign(f.schema,p),a.io==="input"&&en(e)&&(delete f.schema.examples,delete f.schema.default),a.io==="input"&&f.schema._prefault&&((l=f.schema).default??(l.default=f.schema._prefault)),delete f.schema._prefault,a.seen.get(e).schema}function rb(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=new Map;for(const f of e.seen.entries()){const h=e.metadataRegistry.get(f[0])?.id;if(h){const p=l.get(h);if(p&&p!==f[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);l.set(h,f[0])}}const s=f=>{const h=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=e.external.registry.get(f[0])?.id,x=e.external.uri??(_=>_);if(v)return{ref:x(v)};const w=f[1].defId??f[1].schema.id??`schema${e.counter++}`;return f[1].defId=w,{defId:w,ref:`${x("__shared")}#/${h}/${w}`}}if(f[1]===i)return{ref:"#"};const m=`#/${h}/`,b=f[1].schema.id??`__schema${e.counter++}`;return{defId:b,ref:m+b}},u=f=>{if(f[1].schema.$ref)return;const h=f[1],{ref:p,defId:m}=s(f);h.def={...h.schema},m&&(h.defId=m);const b=h.schema;for(const v in b)delete b[v];b.$ref=p};if(e.cycles==="throw")for(const f of e.seen.entries()){const h=f[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of e.seen.entries()){const h=f[1];if(a===f[0]){u(f);continue}if(e.external){const m=e.external.registry.get(f[0])?.id;if(a!==f[0]&&m){u(f);continue}}if(e.metadataRegistry.get(f[0])?.id){u(f);continue}if(h.cycle){u(f);continue}if(h.count>1&&e.reused==="ref"){u(f);continue}}}function ab(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=f=>{const h=e.seen.get(f);if(h.ref===null)return;const p=h.def??h.schema,m={...p},g=h.ref;if(h.ref=null,g){l(g);const x=e.seen.get(g),w=x.schema;if(w.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(w)):Object.assign(p,w),Object.assign(p,m),f._zod.parent===g)for(const E in p)E==="$ref"||E==="allOf"||E in m||delete p[E];if(w.$ref&&x.def)for(const E in p)E==="$ref"||E==="allOf"||E in x.def&&JSON.stringify(p[E])===JSON.stringify(x.def[E])&&delete p[E]}const v=f._zod.parent;if(v&&v!==g){l(v);const x=e.seen.get(v);if(x?.schema.$ref&&(p.$ref=x.schema.$ref,x.def))for(const w in p)w==="$ref"||w==="allOf"||w in x.def&&JSON.stringify(p[w])===JSON.stringify(x.def[w])&&delete p[w]}e.override({zodSchema:f,jsonSchema:p,path:h.path??[]})};for(const f of[...e.seen.entries()].reverse())l(f[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 f=e.external.registry.get(a)?.id;if(!f)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(f)}Object.assign(s,i.def??i.schema);const u=e.external?.defs??{};for(const f of e.seen.entries()){const h=f[1];h.def&&h.defId&&(u[h.defId]=h.def)}e.externa)DELIM" -R"DELIM(l||Object.keys(u).length>0&&(e.target==="draft-2020-12"?s.$defs=u:s.definitions=u);try{const f=JSON.parse(JSON.stringify(s));return Object.defineProperty(f,"~standard",{value:{...a["~standard"],jsonSchema:{input:yu(a,"input",e.processors),output:yu(a,"output",e.processors)}},enumerable:!1,writable:!1}),f}catch{throw new Error("Error converting schema to JSON.")}}function en(e,a){const i=a??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const l=e._zod.def;if(l.type==="transform")return!0;if(l.type==="array")return en(l.element,i);if(l.type==="set")return en(l.valueType,i);if(l.type==="lazy")return en(l.getter(),i);if(l.type==="promise"||l.type==="optional"||l.type==="nonoptional"||l.type==="nullable"||l.type==="readonly"||l.type==="default"||l.type==="prefault")return en(l.innerType,i);if(l.type==="intersection")return en(l.left,i)||en(l.right,i);if(l.type==="record"||l.type==="map")return en(l.keyType,i)||en(l.valueType,i);if(l.type==="pipe")return en(l.in,i)||en(l.out,i);if(l.type==="object"){for(const s in l.shape)if(en(l.shape[s],i))return!0;return!1}if(l.type==="union"){for(const s of l.options)if(en(s,i))return!0;return!1}if(l.type==="tuple"){for(const s of l.items)if(en(s,i))return!0;return!!(l.rest&&en(l.rest,i))}return!1}const RE=(e,a={})=>i=>{const l=tb({...i,processors:a});return Pt(e,l),nb(l,e),ab(l,e)},yu=(e,a,i={})=>l=>{const{libraryOptions:s,target:u}=l??{},f=tb({...s??{},target:u,io:a,processors:i});return Pt(e,f),nb(f,e),ab(f,e)},zE={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},AE=(e,a,i,l)=>{const s=i;s.type="string";const{minimum:u,maximum:f,format:h,patterns:p,contentEncoding:m}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof f=="number"&&(s.maxLength=f),h&&(s.format=zE[h]??h,s.format===""&&delete s.format,h==="time"&&delete s.format),m&&(s.contentEncoding=m),p&&p.size>0){const g=[...p];g.length===1?s.pattern=g[0].source:g.length>1&&(s.allOf=[...g.map(v=>({...a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},CE=(e,a,i,l)=>{const s=i,{minimum:u,maximum:f,format:h,multipleOf:p,exclusiveMaximum:m,exclusiveMinimum:g}=e._zod.bag;typeof h=="string"&&h.includes("int")?s.type="integer":s.type="number",typeof g=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(s.minimum=g,s.exclusiveMinimum=!0):s.exclusiveMinimum=g),typeof u=="number"&&(s.minimum=u,typeof g=="number"&&a.target!=="draft-04"&&(g>=u?delete s.minimum:delete s.exclusiveMinimum)),typeof m=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(s.maximum=m,s.exclusiveMaximum=!0):s.exclusiveMaximum=m),typeof f=="number"&&(s.maximum=f,typeof m=="number"&&a.target!=="draft-04"&&(m<=f?delete s.maximum:delete s.exclusiveMaximum)),typeof p=="number"&&(s.multipleOf=p)},OE=(e,a,i,l)=>{i.type="boolean"},jE=(e,a,i,l)=>{i.not={}},NE=(e,a,i,l)=>{},ME=(e,a,i,l)=>{const s=e._zod.def,u=k0(s.entries);u.every(f=>typeof f=="number")&&(i.type="number"),u.every(f=>typeof f=="string")&&(i.type="string"),i.enum=u},DE=(e,a,i,l)=>{if(a.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},kE=(e,a,i,l)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},LE=(e,a,i,l)=>{const s=i,u=e._zod.def,{minimum:f,maximum:h}=e._zod.bag;typeof f=="number"&&(s.minItems=f),typeof h=="number"&&(s.maxItems=h),s.type="array",s.items=Pt(u.element,a,{...l,path:[...l.path,"items"]})},BE=(e,a,i,l)=>{const s=i,u=e._zod.def;s.type="object",s.properties={};const f=u.shape;for(const m in f)s.properties[m]=Pt(f[m],a,{...l,path:[...l.path,"properties",m]});const h=new Set(Object.keys(f)),p=new Set([...h].filter(m=>{const g=u.shape[m]._zod;return a.io==="input"?g.optin===void 0:g.optout===void 0}));p.size>0&&(s.required=Array.from(p)),u.catchall?._zod.def.type==="never"?s.additionalProperties=!1:u.catchall?u.catchall&&(s.additionalProperties=Pt(u.catchall,a,{...l,path:[...l.path,"additionalProperties"]})):a.io==="output"&&(s.additionalProperties=!1)},HE=(e,a,i,l)=>{const s=e._zod.def,u=s.inclusive===!1,f=s.options.map((h,p)=>Pt(h,a,{...l,path:[...l.path,u?"oneOf":"anyOf",p]}));u?i.oneOf=f:i.anyOf=f},UE=(e,a,i,l)=>{const s=e._zod.def,u=Pt(s.left,a,{...l,path:[...l.path,"allOf",0]}),f=Pt(s.right,a,{...l,path:[...l.path,"allOf",1]}),h=m=>"allOf"in m&&Object.keys(m).length===1,p=[...h(u)?u.allOf:[u],...h(f)?f.allOf:[f]];i.allOf=p},$E=(e,a,i,l)=>{const s=e._zod.def,u=Pt(s.innerType,a,l),f=a.seen.get(e);a.target==="openapi-3.0"?(f.ref=s.innerType,i.nullable=!0):i.anyOf=[u,{type:"null"}]},ZE=(e,a,i,l)=>{const s=e._zod.def;Pt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType},qE=(e,a,i,l)=>{const s=e._zod.def;Pt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,i.default=JSON.parse(JSON.stringify(s.defaultValue))},QE=(e,a,i,l)=>{const s=e._zod.def;Pt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,a.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(s.defau)DELIM" -R"DELIM(ltValue)))},PE=(e,a,i,l)=>{const s=e._zod.def;Pt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType;let f;try{f=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=f},GE=(e,a,i,l)=>{const s=e._zod.def,u=a.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Pt(u,a,l);const f=a.seen.get(e);f.ref=u},YE=(e,a,i,l)=>{const s=e._zod.def;Pt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,i.readOnly=!0},rb=(e,a,i,l)=>{const s=e._zod.def;Pt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType},FE=J("ZodISODateTime",(e,a)=>{I2.init(e,a),mt.init(e,a)});function KE(e){return nE(FE,e)}const VE=J("ZodISODate",(e,a)=>{W2.init(e,a),mt.init(e,a)});function XE(e){return aE(VE,e)}const JE=J("ZodISOTime",(e,a)=>{e_.init(e,a),mt.init(e,a)});function IE(e){return rE(JE,e)}const WE=J("ZodISODuration",(e,a)=>{t_.init(e,a),mt.init(e,a)});function e4(e){return iE(WE,e)}const t4=(e,a)=>{$0.init(e,a),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>Pw(e,i)},flatten:{value:i=>Qw(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,qd,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,qd,2)}},isEmpty:{get(){return e.issues.length===0}}})},Bn=J("ZodError",t4,{Parent:Error}),n4=ch(Bn),a4=fh(Bn),r4=Cu(Bn),i4=Ou(Bn),l4=Fw(Bn),o4=Kw(Bn),s4=Vw(Bn),u4=Xw(Bn),c4=Jw(Bn),f4=Iw(Bn),d4=Ww(Bn),h4=e2(Bn),_t=J("ZodType",(e,a)=>(wt.init(e,a),Object.assign(e["~standard"],{jsonSchema:{input:yu(e,"input"),output:yu(e,"output")}}),e.toJSONSchema=RE(e,{}),e.def=a,e.type=a.type,Object.defineProperty(e,"_def",{value:a}),e.check=(...i)=>e.clone(yr(a,{checks:[...a.checks??[],...i.map(l=>typeof l=="function"?{_zod:{check:l,def:{check:"custom"},onattach:[]}}:l)]}),{parent:!0}),e.with=e.check,e.clone=(i,l)=>vr(e,i,l),e.brand=()=>e,e.register=((i,l)=>(i.add(e,l),e)),e.parse=(i,l)=>n4(e,i,l,{callee:e.parse}),e.safeParse=(i,l)=>r4(e,i,l),e.parseAsync=async(i,l)=>a4(e,i,l,{callee:e.parseAsync}),e.safeParseAsync=async(i,l)=>i4(e,i,l),e.spa=e.safeParseAsync,e.encode=(i,l)=>l4(e,i,l),e.decode=(i,l)=>o4(e,i,l),e.encodeAsync=async(i,l)=>s4(e,i,l),e.decodeAsync=async(i,l)=>u4(e,i,l),e.safeEncode=(i,l)=>c4(e,i,l),e.safeDecode=(i,l)=>f4(e,i,l),e.safeEncodeAsync=async(i,l)=>d4(e,i,l),e.safeDecodeAsync=async(i,l)=>h4(e,i,l),e.refine=(i,l)=>e.check(lT(i,l)),e.superRefine=i=>e.check(oT(i)),e.overwrite=i=>e.check(Fi(i)),e.optional=()=>ug(e),e.exactOptional=()=>F4(e),e.nullable=()=>cg(e),e.nullish=()=>ug(cg(e)),e.nonoptional=i=>W4(e,i),e.array=()=>Gi(e),e.or=i=>$4([e,i]),e.and=i=>q4(e,i),e.transform=i=>fg(e,G4(i)),e.default=i=>X4(e,i),e.prefault=i=>I4(e,i),e.catch=i=>tT(e,i),e.pipe=i=>fg(e,i),e.readonly=()=>rT(e),e.describe=i=>{const l=e.clone();return Vl.add(l,{description:i}),l},Object.defineProperty(e,"description",{get(){return Vl.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return Vl.get(e);const l=e.clone();return Vl.add(l,i[0]),l},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),ib=J("_ZodString",(e,a)=>{dh.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(l,s,u)=>AE(e,l,s);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...l)=>e.check(fE(...l)),e.includes=(...l)=>e.check(mE(...l)),e.startsWith=(...l)=>e.check(pE(...l)),e.endsWith=(...l)=>e.check(yE(...l)),e.min=(...l)=>e.check(pu(...l)),e.max=(...l)=>e.check(W0(...l)),e.length=(...l)=>e.check(eb(...l)),e.nonempty=(...l)=>e.check(pu(1,...l)),e.lowercase=l=>e.check(dE(l)),e.uppercase=l=>e.check(hE(l)),e.trim=()=>e.check(gE()),e.normalize=(...l)=>e.check(vE(...l)),e.toLowerCase=()=>e.check(bE()),e.toUpperCase=()=>e.check(xE()),e.slugify=()=>e.check(SE())}),m4=J("ZodString",(e,a)=>{dh.init(e,a),ib.init(e,a),e.email=i=>e.check(k_(p4,i)),e.url=i=>e.check($_(y4,i)),e.jwt=i=>e.check(tE(j4,i)),e.emoji=i=>e.check(Z_(v4,i)),e.guid=i=>e.check(ng(lg,i)),e.uuid=i=>e.check(L_(Ps,i)),e.uuidv4=i=>e.check(B_(Ps,i)),e.uuidv6=i=>e.check(H_(Ps,i)),e.uuidv7=i=>e.check(U_(Ps,i)),e.nanoid=i=>e.check(q_(g4,i)),e.guid=i=>e.check(ng(lg,i)),e.cuid=i=>e.check(Q_(b4,i)),e.cuid2=i=>e.check(P_(x4,i)),e.ulid=i=>e.check(G_(S4,i)),e.base64=i=>e.check(I_(A4,i)),e.base64url=i=>e.check(W_(C4,i)),e.xid=i=>e.check(Y_(w4,i)),e.ksuid=i=>e.check(F_(_4,i)),e.ipv4=i=>e.check(K_(E4,i)),e.ipv6=i=>e.check(V_(T4,i)),e.cidrv4=i=>e.check(X_(R4,i)),e.cidrv6=i=>e.check(J_(z4,i)),e.e164=i=>e.check(eE(O4,i)),e.datetime=i=>e.check(KE(i)),e.date=i=>e.check(XE(i)),e.time=i=>e.check(IE(i)),e.duration=i=>e.check(e4(i))});function jt(e){return D_(m4,e)}const mt=J("ZodStringFormat",(e,a)=>{dt.init(e,a),ib.init(e,a)}),p4=J("ZodEmail",(e,a)=>{Q2.init(e,a),mt.init(e,a)}),lg=J("ZodGUID",(e,a)=>{Z2.init(e,a),mt.init(e,a)}),Ps=J("ZodUUID",(e,a)=>{q2.init(e,a),mt.init(e,a)}),y4=J("ZodURL",(e,a)=>{P2.init(e,a),mt.init(e,a)}),v4=J("ZodEmoji",(e,a)=>{G2.init(e,a),mt.init(e,a)}),g4=J("ZodNanoID",(e,a)=>{)DELIM" -R"DELIM(Y2.init(e,a),mt.init(e,a)}),b4=J("ZodCUID",(e,a)=>{F2.init(e,a),mt.init(e,a)}),x4=J("ZodCUID2",(e,a)=>{K2.init(e,a),mt.init(e,a)}),S4=J("ZodULID",(e,a)=>{V2.init(e,a),mt.init(e,a)}),w4=J("ZodXID",(e,a)=>{X2.init(e,a),mt.init(e,a)}),_4=J("ZodKSUID",(e,a)=>{J2.init(e,a),mt.init(e,a)}),E4=J("ZodIPv4",(e,a)=>{n_.init(e,a),mt.init(e,a)}),T4=J("ZodIPv6",(e,a)=>{a_.init(e,a),mt.init(e,a)}),R4=J("ZodCIDRv4",(e,a)=>{r_.init(e,a),mt.init(e,a)}),z4=J("ZodCIDRv6",(e,a)=>{i_.init(e,a),mt.init(e,a)}),A4=J("ZodBase64",(e,a)=>{l_.init(e,a),mt.init(e,a)}),C4=J("ZodBase64URL",(e,a)=>{s_.init(e,a),mt.init(e,a)}),O4=J("ZodE164",(e,a)=>{u_.init(e,a),mt.init(e,a)}),j4=J("ZodJWT",(e,a)=>{f_.init(e,a),mt.init(e,a)}),lb=J("ZodNumber",(e,a)=>{V0.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(l,s,u)=>CE(e,l,s),e.gt=(l,s)=>e.check(rg(l,s)),e.gte=(l,s)=>e.check(td(l,s)),e.min=(l,s)=>e.check(td(l,s)),e.lt=(l,s)=>e.check(ag(l,s)),e.lte=(l,s)=>e.check(ed(l,s)),e.max=(l,s)=>e.check(ed(l,s)),e.int=l=>e.check(og(l)),e.safe=l=>e.check(og(l)),e.positive=l=>e.check(rg(0,l)),e.nonnegative=l=>e.check(td(0,l)),e.negative=l=>e.check(ag(0,l)),e.nonpositive=l=>e.check(ed(0,l)),e.multipleOf=(l,s)=>e.check(ig(l,s)),e.step=(l,s)=>e.check(ig(l,s)),e.finite=()=>e;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 Qe(e){return lE(lb,e)}const N4=J("ZodNumberFormat",(e,a)=>{d_.init(e,a),lb.init(e,a)});function og(e){return oE(N4,e)}const M4=J("ZodBoolean",(e,a)=>{h_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>OE(e,i,l)});function hh(e){return sE(M4,e)}const D4=J("ZodUnknown",(e,a)=>{m_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>NE()});function sg(){return uE(D4)}const k4=J("ZodNever",(e,a)=>{p_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>jE(e,i,l)});function L4(e){return cE(k4,e)}const B4=J("ZodArray",(e,a)=>{y_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>LE(e,i,l,s),e.element=a.element,e.min=(i,l)=>e.check(pu(i,l)),e.nonempty=i=>e.check(pu(1,i)),e.max=(i,l)=>e.check(W0(i,l)),e.length=(i,l)=>e.check(eb(i,l)),e.unwrap=()=>e.element});function Gi(e,a){return wE(B4,e,a)}const H4=J("ZodObject",(e,a)=>{g_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>BE(e,i,l,s),We(e,"shape",()=>a.shape),e.keyof=()=>Q4(Object.keys(e._zod.def.shape)),e.catchall=i=>e.clone({...e._zod.def,catchall:i}),e.passthrough=()=>e.clone({...e._zod.def,catchall:sg()}),e.loose=()=>e.clone({...e._zod.def,catchall:sg()}),e.strict=()=>e.clone({...e._zod.def,catchall:L4()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>Hw(e,i),e.safeExtend=i=>Uw(e,i),e.merge=i=>$w(e,i),e.pick=i=>Lw(e,i),e.omit=i=>Bw(e,i),e.partial=(...i)=>Zw(ob,e,i[0]),e.required=(...i)=>qw(sb,e,i[0])});function ra(e,a){const i={type:"object",shape:e??{},...Ee(a)};return new H4(i)}const U4=J("ZodUnion",(e,a)=>{b_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>HE(e,i,l,s),e.options=a.options});function $4(e,a){return new U4({type:"union",options:e,...Ee(a)})}const Z4=J("ZodIntersection",(e,a)=>{x_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>UE(e,i,l,s)});function q4(e,a){return new Z4({type:"intersection",left:e,right:a})}const Pd=J("ZodEnum",(e,a)=>{S_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(l,s,u)=>ME(e,l,s),e.enum=a.entries,e.options=Object.values(a.entries);const i=new Set(Object.keys(a.entries));e.extract=(l,s)=>{const u={};for(const f of l)if(i.has(f))u[f]=a.entries[f];else throw new Error(`Key ${f} not found in enum`);return new Pd({...a,checks:[],...Ee(s),entries:u})},e.exclude=(l,s)=>{const u={...a.entries};for(const f of l)if(i.has(f))delete u[f];else throw new Error(`Key ${f} not found in enum`);return new Pd({...a,checks:[],...Ee(s),entries:u})}});function Q4(e,a){const i=Array.isArray(e)?Object.fromEntries(e.map(l=>[l,l])):e;return new Pd({type:"enum",entries:i,...Ee(a)})}const P4=J("ZodTransform",(e,a)=>{w_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>kE(e,i),e._zod.parse=(i,l)=>{if(l.direction==="backward")throw new M0(e.constructor.name);i.addIssue=u=>{if(typeof u=="string")i.issues.push(io(u,i.value,a));else{const f=u;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=i.value),f.inst??(f.inst=e),i.issues.push(io(f))}};const s=a.transform(i.value,i);return s instanceof Promise?s.then(u=>(i.value=u,i)):(i.value=s,i)}});function G4(e){return new P4({type:"transform",transform:e})}const ob=J("ZodOptional",(e,a)=>{I0.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>rb(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function ug(e){return new ob({type:"optional",innerType:e})}const Y4=J("ZodExactOptional",(e,a)=>{__.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l)DELIM" -R"DELIM(,s)=>rb(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function F4(e){return new Y4({type:"optional",innerType:e})}const K4=J("ZodNullable",(e,a)=>{E_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>$E(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function cg(e){return new K4({type:"nullable",innerType:e})}const V4=J("ZodDefault",(e,a)=>{T_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>qE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function X4(e,a){return new V4({type:"default",innerType:e,get defaultValue(){return typeof a=="function"?a():B0(a)}})}const J4=J("ZodPrefault",(e,a)=>{R_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>QE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function I4(e,a){return new J4({type:"prefault",innerType:e,get defaultValue(){return typeof a=="function"?a():B0(a)}})}const sb=J("ZodNonOptional",(e,a)=>{z_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>ZE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function W4(e,a){return new sb({type:"nonoptional",innerType:e,...Ee(a)})}const eT=J("ZodCatch",(e,a)=>{A_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>PE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function tT(e,a){return new eT({type:"catch",innerType:e,catchValue:typeof a=="function"?a:()=>a})}const nT=J("ZodPipe",(e,a)=>{C_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>GE(e,i,l,s),e.in=a.in,e.out=a.out});function fg(e,a){return new nT({type:"pipe",in:e,out:a})}const aT=J("ZodReadonly",(e,a)=>{O_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>YE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function rT(e){return new aT({type:"readonly",innerType:e})}const iT=J("ZodCustom",(e,a)=>{j_.init(e,a),_t.init(e,a),e._zod.processJSONSchema=(i,l,s)=>DE(e,i)});function lT(e,a={}){return _E(iT,e,a)}function oT(e){return EE(e)}function Gr(e){if(!e)return;const a=e.trim();if(!a)return;const i=a.toLowerCase(),l=i.indexOf("1");if(l>0){const f=i.slice(0,l);if(["bc","tb","bcrt","ltc","sb"].includes(f)){const h=i.slice(l+1);if(!h)return;const p=h.charAt(0);return p==="p"?"p2tr":p==="q"?h.length===39||h.length===40||e.length===42?"p2wpkh":h.length===59||h.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 mh extends Error{constructor(a,i){super(a),this.status=i}status}const Gd=ra({id:jt(),height:Qe(),timestamp:Qe().optional(),mediantime:Qe().optional(),tx_count:Qe().optional(),size:Qe().optional(),weight:Qe().optional(),difficulty:Qe().optional(),bits:Qe().optional(),merkle_root:jt().optional(),previousblockhash:jt().nullable().optional(),nonce:Qe().optional(),version:Qe().optional()}).loose(),sT=ra({confirmed:hh(),block_height:Qe().optional(),block_hash:jt().optional(),block_time:Qe().optional()}),uT=ra({txid:jt().optional().nullable(),vout:Qe().optional().nullable(),sequence:Qe().optional(),scriptsig:jt().optional().nullable(),scriptsig_asm:jt().optional().nullable(),witness:Gi(jt()).optional(),is_coinbase:hh().optional(),prevout:ra({scriptpubkey_type:jt().optional(),scriptpubkey_address:jt().optional(),scriptpubkey:jt().optional(),scriptpubkey_asm:jt().optional(),value:Qe().optional()}).partial().nullable().optional()}).loose(),cT=ra({scriptpubkey_type:jt().optional(),scriptpubkey_address:jt().optional(),scriptpubkey:jt().optional(),scriptpubkey_asm:jt().optional(),value:Qe(),n:Qe().optional()}).loose(),nu=ra({txid:jt(),hash:jt().optional(),fee:Qe().optional(),version:Qe(),locktime:Qe(),vin:Gi(uT),vout:Gi(cT),size:Qe(),weight:Qe(),status:sT}).loose(),au=Gi(Gd),vu=Gi(nu),dg=ra({in_best_chain:hh(),next_best:jt().optional(),height:Qe().optional()}),hg=ra({address:jt(),chain_stats:ra({funded_txo_count:Qe().optional(),funded_txo_sum:Qe().optional(),spent_txo_count:Qe().optional(),spent_txo_sum:Qe().optional(),tx_count:Qe().optional()}),mempool_stats:ra({funded_txo_count:Qe().optional(),funded_txo_sum:Qe().optional(),spent_txo_count:Qe().optional(),spent_txo_sum:Qe().optional(),tx_count:Qe().optional()})});async function qt(e,a,i){const l=a.startsWith("/")?a:`/${a}`,s=await fetch(`${e}${l}`);if(!s.ok)throw new mh(`Request to ${a} failed with status ${String(s.status)}`,s.status);const u=await s.json();return i.parse(u)}async function mg(e,a){const i=await fetch(`${e}/blocks/tip/height`);if(!i.ok)throw new mh("Unable to fetch tip height",i.status);const l=await i.text(),s=Number(l.trim());if(!Number.isFinite(s))throw new TypeError("Invalid tip height response");return a.lastKnownHeight=s,s}async function ji(e,a,i){if(a.lastKnownHeight===null){await mg(e,a);return}typeof i=="number"&&a.lastKnownHeightu.scriptpubkey_address===e?s+u.value:s,0),l=a.vin.reduce((s,u)=>{const f=u.prevout;return f?.scrip)DELIM" -R"DELIM(tpubkey_address===e&&typeof f.value=="number"?s+f.value:s},0);return i-l}async function nd(e,a){if(a==="latest"||a==="tip"){const i=await qt(e,"/blocks",au);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 mh("Unable to resolve block height",i.status);return(await i.text()).trim()}return a}async function pg(e,a,i){if(i.lastKnownHeight==null||a>=i.lastKnownHeight)return null;const l=a+1;try{const s=await fetch(`${e}/block-height/${String(l)}`);return s.ok&&(await s.text()).trim()||null}catch(s){return console.warn(`Failed to resolve hash for height ${String(l)}`,s),null}}function ql(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 ad(e,a){const i=e.status.confirmed?"confirmed":"unconfirmed",l=e.vin.map((p,m)=>{const g=p.is_coinbase||p.txid==null?void 0:typeof p.vout=="number"&&p.vout!==4294967295?p.vout:void 0;return{index:m,prevTxId:p.txid??void 0,prevOutputIndex:g,address:p.prevout?.scriptpubkey_address??void 0,valueSats:p.prevout?.value,scriptType:p.prevout?.scriptpubkey_type,isCoinbase:p.is_coinbase??!1,script:p.scriptsig||p.scriptsig_asm?{hex:p.scriptsig??void 0,mnemonic:p.scriptsig_asm??void 0}:void 0,witness:p.witness??void 0,sequence:p.sequence}}),s=e.vout.map((p,m)=>({index:m,address:p.scriptpubkey_address??void 0,valueSats:p.value,scriptType:p.scriptpubkey_type,spent:void 0,script:p.scriptpubkey||p.scriptpubkey_asm?{hex:p.scriptpubkey??void 0,mnemonic:p.scriptpubkey_asm??void 0}:void 0})),u=s.reduce((p,m)=>p+m.valueSats,0),f=a.lastKnownHeight;let h=0;return e.status.block_height&&i==="confirmed"&&(h=f&&f>=e.status.block_height?f-e.status.block_height+1:1),{txid:e.txid,hash:e.hash??e.txid,status:i,confirmations:h,blockHeight:e.status.block_height,blockHash:e.status.block_hash,receivedTime:e.status.block_time,feeSats:e.fee??null,feeRate:e.fee?e.fee/e.weight*4:null,size:e.size,weight:e.weight,version:e.version,locktime:e.locktime,totalInput:null,totalOutput:u,inputs:l,outputs:s}}function dT(e,a){const i=e.chain_stats,l=e.mempool_stats,s=(i.funded_txo_sum??0)-(i.spent_txo_sum??0),u=ub(e.address,a.slice(0,25));return{address:e.address,addressType:Gr(e.address),balance:s,totalReceived:(i.funded_txo_sum??0)+(l.funded_txo_sum??0),totalSent:(i.spent_txo_sum??0)+(l.spent_txo_sum??0),txCount:(i.tx_count??0)+(l.tx_count??0),utxoCount:(i.funded_txo_count??0)-(i.spent_txo_count??0),transactions:u}}function hT(e){const a=e.chain_stats,i=e.mempool_stats,l=(a.funded_txo_sum??0)-(a.spent_txo_sum??0);return{address:e.address,addressType:Gr(e.address),balance:l,totalReceived:(a.funded_txo_sum??0)+(i.funded_txo_sum??0),totalSent:(a.spent_txo_sum??0)+(i.spent_txo_sum??0),txCount:(a.tx_count??0)+(i.tx_count??0),utxoCount:(a.funded_txo_count??0)-(a.spent_txo_count??0)}}function ub(e,a){return a.map(i=>({txid:i.txid,timestamp:i.status.block_time,valueChange:fT(e,i),blockHeight:i.status.block_height}))}async function yg(e,a,i=0){const l=i>0?`/block/${a}/txs/${String(i)}`:`/block/${a}/txs`;return qt(e,l,vu)}async function mT(e,a,i){return i?qt(e,`/address/${a}/txs/chain/${i}`,vu):qt(e,`/address/${a}/txs`,vu)}function cb({baseUrl:e}){const a=new Set;let i=null;const l={lastBlockHash:null,lastKnownHeight:null};async function s(h){const p=await qt(e,`/tx/${h}`,nu);return await(p.status.block_height?ji(e,l,p.status.block_height):ji(e,l)),ad(p,l)}function u(){i||a.size===0||(i=setInterval(async()=>{try{const h=await qt(e,"/blocks",au);if(h.length===0)return;const p=h[0];if(p.id!==l.lastBlockHash){l.lastBlockHash=p.id,l.lastKnownHeight=Math.max(p.height,l.lastKnownHeight??0);const m=ql(p);for(const g of a)g({type:"block.new",payload:m})}}catch(h){console.warn("Block polling failed",h)}},15e3))}function f(){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(h=10){const p=await qt(e,"/blocks",au);return p.length>0&&(l.lastBlockHash=p[0].id,l.lastKnownHeight=Math.max(p[0].height,l.lastKnownHeight??0)),p.slice(0,h).map(m=>ql(m))},async getBlocksBefore(h,p=10){const m=Math.max(h,0),g=await qt(e,`/blocks/${String(m)}`,au);return g.length>0&&(l.lastKnownHeight=Math.max(g[0].height,l.lastKnownHeight??0)),g.slice(0,p).map(v=>ql(v))},async getBlockHeader(h){const p=await nd(e,h);await ji(e,l);const[m,g]=await Promise.all([qt(e,`/block/${p}`,Gd),qt(e,`/block/${p}/status`,dg).catch(()=>null)]),v=ql(m);l.lastBlockHash=v.hash,l.lastKnownHeight=Math.max(v.height,l.lastKnownHeight??v.height);let x=g?.next_best??null;return x||(x=await pg(e,v.height,l)),{...v,merkleRoot)DELIM" -R"DELIM(:m.merkle_root,nonce:m.nonce,bits:m.bits,version:m.version,nextBlockHash:x}},getBlockStats(h){return Promise.resolve({})},async getBlock(h){const p=await nd(e,h);await ji(e,l);const m=await qt(e,`/block/${p}`,Gd),[g,v]=await Promise.allSettled([yg(e,p),qt(e,`/block/${p}/status`,dg)]);g.status==="rejected"&&console.warn("Failed to load block transactions, defaulting to empty set",g.reason),v.status==="rejected"&&console.warn("Failed to load block status, defaulting to unknown",v.reason);const x=ql(m);l.lastBlockHash=x.hash,l.lastKnownHeight=Math.max(x.height,l.lastKnownHeight??x.height);const w=g.status==="fulfilled"?g.value:[];let E=(v.status==="fulfilled"?v.value:null)?.next_best??null;return E||(E=await pg(e,x.height,l)),{...x,merkleRoot:m.merkle_root,nonce:m.nonce,bits:m.bits,version:m.version,nextBlockHash:E,transactions:w.map(M=>ad(M,l))}},async getBlockTransactions(h,p=0){const m=await nd(e,h),g=await yg(e,m,p),v=g.reduce((x,w)=>w.status.block_height?x===null?w.status.block_height:Math.max(x,w.status.block_height):x,null);return await(typeof v=="number"?ji(e,l,v):ji(e,l)),g.map(x=>ad(x,l))},async getTransactionHeader(h){return s(h)},async getTransaction(h){return s(h)},async getTransactionInputScriptHex(h,p){const m=await qt(e,`/tx/${h}`,nu);if(p<0||p>=m.vin.length)throw new RangeError(`Input index ${String(p)} not found`);const v=m.vin[p].scriptsig;return typeof v=="string"?v:""},async getTransactionOutputScriptHex(h,p){const m=await qt(e,`/tx/${h}`,nu);if(p<0||p>=m.vout.length)throw new RangeError(`Output index ${String(p)} not found`);const v=m.vout[p].scriptpubkey;if(typeof v!="string")throw new TypeError("Output script missing in provider response");return v},async getAddressSummary(h){const p=await qt(e,`/address/${h}`,hg);return hT(p)},async getAddress(h){const p=await qt(e,`/address/${h}`,hg),m=await qt(e,`/address/${h}/txs`,vu);return dT(p,m)},async getAddressTransactions(h,p){const m=await mT(e,h,p);return ub(h,m)},subscribeToEvents(h){return a.add(h),u(),()=>{a.delete(h),a.size===0&&f()}}}}function pT({baseUrl:e}){const a=cb({baseUrl:e});return{...a,metadata:{...a.metadata,id:"mempool",label:"mempool.space",endpoint:e,description:"Adapter backed by mempool.space REST API."}}}function lo(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function fb(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 db(e){if(typeof e!="function")throw new Error("function expected");return!0}function oo(e,a){if(typeof a!="string")throw new Error(`${e}: string expected`);return!0}function po(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function gu(e){if(!Array.isArray(e))throw new Error("array expected")}function hb(e,a){if(!fb(!0,a))throw new Error(`${e}: array of strings expected`)}function ph(e,a){if(!fb(!1,a))throw new Error(`${e}: array of numbers expected`)}function yh(...e){const a=u=>u,i=(u,f)=>h=>u(f(h)),l=e.map(u=>u.encode).reduceRight(i,a),s=e.map(u=>u.decode).reduce(i,a);return{encode:l,decode:s}}function mb(e){const a=typeof e=="string"?e.split(""):e,i=a.length;hb("alphabet",a);const l=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=>{oo("alphabet.decode",u);const f=l.get(u);if(f===void 0)throw new Error(`Unknown letter: "${u}". Allowed: ${e}`);return f}))}}function pb(e=""){return oo("join",e),{encode:a=>(hb("join.decode",a),a.join(e)),decode:a=>(oo("join.decode",a),a.split(e))}}function vg(e,a,i){if(a<2)throw new Error(`convertRadix: invalid from=${a}, base cannot be less than 2`);if(i<2)throw new Error(`convertRadix: invalid to=${i}, base cannot be less than 2`);if(gu(e),!e.length)return[];let l=0;const s=[],u=Array.from(e,h=>{if(po(h),h<0||h>=a)throw new Error(`invalid integer: ${h}`);return h}),f=u.length;for(;;){let h=0,p=!0;for(let m=l;ma===0?e:yb(a,e%a),bu=(e,a)=>e+(a-yb(e,a)),ru=(()=>{let e=[];for(let a=0;a<40;a++)e.push(2**a);return e})();function Yd(e,a,i,l){if(gu(e),a<=0||a>32)throw new Error(`convertRadix2: wrong from=${a}`);if(i<=0||i>32)throw new Error(`convertRadix2: wrong to=${i}`);if(bu(a,i)>32)throw new Error(`convertRadix2: carry overflow from=${a} to=${i} carryBits=${bu(a,i)}`);let s=0,u=0;const f=ru[a],h=ru[i]-1,p=[];for(const m of e){if(po(m),m>=f)throw new Error(`convertRadix2: invalid data word=${m} from=${a}`);if(s=s<32)throw new Error(`convertRadix2: carry)DELIM" -R"DELIM( overflow pos=${u} from=${a}`);for(u+=a;u>=i;u-=i)p.push((s>>u-i&h)>>>0);const g=ru[u];if(g===void 0)throw new Error("invalid carry");s&=g-1}if(s=s<=a)throw new Error("Excess padding");if(!l&&s>0)throw new Error(`Non-zero padding: ${s}`);return l&&u>0&&p.push(s>>>0),p}function yT(e){po(e);const a=2**8;return{encode:i=>{if(!lo(i))throw new Error("radix.encode input should be Uint8Array");return vg(Array.from(i),a,e)},decode:i=>(ph("radix.decode",i),Uint8Array.from(vg(i,e,a)))}}function vT(e,a=!1){if(po(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(bu(8,e)>32||bu(e,8)>32)throw new Error("radix2: carry overflow");return{encode:i=>{if(!lo(i))throw new Error("radix2.encode input should be Uint8Array");return Yd(Array.from(i),8,e,!a)},decode:i=>(ph("radix2.decode",i),Uint8Array.from(Yd(i,e,8,a)))}}function gg(e){return db(e),function(...a){try{return e.apply(null,a)}catch{}}}function gT(e,a){return po(e),db(a),{encode(i){if(!lo(i))throw new Error("checksum.encode: input should be Uint8Array");const l=a(i).slice(0,e),s=new Uint8Array(i.length+e);return s.set(i),s.set(l,i.length),s},decode(i){if(!lo(i))throw new Error("checksum.decode: input should be Uint8Array");const l=i.slice(0,-e),s=i.slice(-e),u=a(l).slice(0,e);for(let f=0;fyh(yT(58),mb(e),pb("")),xT=bT("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),ST=e=>yh(gT(4,a=>e(e(a))),xT),Fd=yh(mb("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),pb("")),bg=[996825010,642813549,513874426,1027748829,705979059];function Ql(e){const a=e>>25;let i=(e&33554431)<<5;for(let l=0;l>l&1)===1&&(i^=bg[l]);return i}function xg(e,a,i=1){const l=e.length;let s=1;for(let u=0;u126)throw new Error(`Invalid prefix (${e})`);s=Ql(s)^f>>5}s=Ql(s);for(let u=0;uw)throw new TypeError(`Length ${E} exceeds limit ${w}`);const z=v.toLowerCase(),M=xg(z,x,a);return`${z}1${Fd.encode(x)}${M}`}function h(v,x=90){oo("bech32.decode input",v);const w=v.length;if(w<8||x!==!1&&w>x)throw new TypeError(`invalid string length: ${w} (${v}). Expected (8..${x})`);const _=v.toLowerCase();if(v!==_&&v!==v.toUpperCase())throw new Error("String must be lowercase or uppercase");const E=_.lastIndexOf("1");if(E===0||E===-1)throw new Error('Letter "1" must be present between prefix and data only');const z=_.slice(0,E),M=_.slice(E+1);if(M.length<6)throw new Error("Data must be at least 6 characters long");const L=Fd.decode(M).slice(0,-6),B=xg(z,L,a);if(!M.endsWith(B))throw new Error(`Invalid checksum in ${v}: expected "${B}"`);return{prefix:z,words:L}}const p=gg(h);function m(v){const{prefix:x,words:w}=h(v,!1);return{prefix:x,words:w,bytes:l(w)}}function g(v,x){return f(v,s(x))}return{encode:f,decode:h,encodeFromBytes:g,decodeToBytes:m,decodeUnsafe:p,fromWords:l,fromWordsUnsafe:u,toWords:s}}const xu=vb("bech32"),Kd=vb("bech32m");function wT(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function vh(e,a,i=""){const l=wT(e),s=e?.length;if(!l||a!==void 0){const f=i&&`"${i}" `,h="",p=l?`length=${s}`:`type=${typeof e}`,m=f+"expected Uint8Array"+h+", got "+p;throw l?new RangeError(m):new TypeError(m)}return e}function Sg(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 _T(e,a){vh(e,void 0,"digestInto() output");const i=a.outputLen;if(e.length='+i)}function Vd(...e){for(let a=0;a>>a}const ET=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",TT=Array.from({length:256},(e,a)=>a.toString(16).padStart(2,"0"));function iu(e){if(vh(e),ET)return e.toHex();let a="";for(let i=0;ie(u).update(s).digest(),l=e(void 0);return i.outputLen=l.outputLen,i.blockLen=l.blockLen,i.canXOF=l.canXOF,i.create=s=>e(s),Object.assign(i,a),Object.freeze(i)}const zT=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function AT(e,a,i){return e&a^~e&i}function CT(e,a,i){return e&a^e&i^a&i}class OT{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(a,i,l,s){this.blockLen=a,this.outputLen=i,this.padOffs)DELIM" -R"DELIM(et=l,this.isLE=s,this.buffer=new Uint8Array(a),this.view=rd(this.buffer)}update(a){Sg(this),vh(a);const{view:i,buffer:l,blockLen:s}=this,u=a.length;for(let f=0;fs-f&&(this.process(l,0),f=0);for(let v=f;vg.length)throw new Error("_sha2: outputLen bigger than state");for(let v=0;v>>3,E=na(w,17)^na(w,19)^w>>>10;sr[v]=E+sr[v-7]+_+sr[v-16]|0}let{A:l,B:s,C:u,D:f,E:h,F:p,G:m,H:g}=this;for(let v=0;v<64;v++){const x=na(h,6)^na(h,11)^na(h,25),w=g+x+AT(h,p,m)+jT[v]+sr[v]|0,E=(na(l,2)^na(l,13)^na(l,22))+CT(l,s,u)|0;g=m,m=p,p=h,h=f+w|0,f=u,u=s,s=l,l=w+E|0}l=l+this.A|0,s=s+this.B|0,u=u+this.C|0,f=f+this.D|0,h=h+this.E|0,p=p+this.F|0,m=m+this.G|0,g=g+this.H|0,this.set(l,s,u,f,h,p,m,g)}roundClean(){Vd(sr)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Vd(this.buffer)}}class MT extends NT{A=or[0]|0;B=or[1]|0;C=or[2]|0;D=or[3]|0;E=or[4]|0;F=or[5]|0;G=or[6]|0;H=or[7]|0;constructor(){super(32)}}const gb=RT(()=>new MT,zT(1)),bb=ST(gb),DT=0x00000000ffff0000000000000000000000000000000000000000000000000000n;function gh(e){if(e.length%2!==0)throw new Error("Invalid hex string");const a=new Uint8Array(e.length/2);for(let i=0;i>>24,i=e&8388607;if(i===0||a<3)return;const l=BigInt(i)*(1n<i[1]).filter(Boolean);return a.length>0?a:[e]}function bh(e){const a=e.toLowerCase();if(a.includes("dup hash160")&&a.includes("equalverify checksig"))return"p2pkh";if(a.startsWith("hash160")&&a.includes("equal"))return"p2sh";if(a.startsWith("zero [")){const l=a.match(/zero \[([0-9a-f]+)\]/)?.[1]??"";return l.length===40?"p2wpkh":l.length===64?"p2wsh":"segwit"}if(a.startsWith("1 ["))return"p2tr"}function yo(){return"mainnet"}function vo(e){return e==="testnet"||e==="regtest"?{p2pkh:111,p2sh:196,hrp:e==="regtest"?"bcrt":"tb"}:{p2pkh:0,p2sh:5,hrp:"bc"}}function wg(e,a){const i=new Uint8Array(a.length/2+1);return i[0]=e,i.set(gh(a),1),bb.encode(i)}function id(e,a,i){const l=gh(i),s=xu.toWords(l);return s.unshift(a),(a===0?xu:Kd).encode(e,s)}function xb(e,a){const i=e.toLowerCase(),l=i.match(/dup hash160 \[([0-9a-f]{40})\] equalverify checksig/);if(l)return{address:wg(a.p2pkh,l[1]),type:"p2pkh"};const s=i.match(/^hash160 \[([0-9a-f]{40})\] equal$/);if(s)return{address:wg(a.p2sh,s[1]),type:"p2sh"};const u=i.match(/^zero \[([0-9a-f]{40})\]/);if(u)return{address:id(a.hrp,0,u[1]),type:"p2wpkh"};const f=i.match(/^zero \[([0-9a-f]{64})\]/);if(f)return{address:id(a.hrp,0,f[1]),type:"p2wsh"};const h=i.match(/^1 \[([0-9a-f]{64})\]/);return h?{address:id(a.hrp,1,h[1]),type:"p2tr"}:{type:bh(e)}}func)DELIM" -R"DELIM(tion BT(e,a){try{const s=bb.decode(e),u=s[0],f=iu(s.slice(1));if(f.length===40&&u===a.p2pkh)return{scriptHex:`76a914${f}88ac`,type:"p2pkh"};if(f.length===40&&u===a.p2sh)return{scriptHex:`a914${f}87`,type:"p2sh"}}catch{}const i=e.toLowerCase();if(i.indexOf("1")>0&&i.startsWith(`${a.hrp}1`)){const s=i,u=p=>{try{return p.decode(s,90)}catch{return null}},f=u(xu);if(f&&f.prefix===a.hrp){const p=f.words[0],m=xu.fromWords(f.words.slice(1)),g=iu(m),v=m.length.toString(16).padStart(2,"0");if(p===0&&(m.length===20||m.length===32))return{scriptHex:`00${v}${g}`,type:m.length===20?"p2wpkh":"p2wsh"}}const h=u(Kd);if(h&&h.prefix===a.hrp){const p=h.words[0],m=Kd.fromWords(h.words.slice(1)),g=iu(m),v=m.length.toString(16).padStart(2,"0");if(p===1&&m.length===32)return{scriptHex:`51${v}${g}`,type:"p2tr"}}}return null}function pr(e,a){const i=e.toLowerCase();if(/^[0-9a-f]{64}$/.test(i))return{hash:i,type:"script-hash"};const l=BT(e,a);if(!l)return null;const s=gb(gh(l.scriptHex)),u=Uint8Array.from(s).reverse();return{hash:iu(u),type:l.type}}function Pl(e,a){return{hash:e.hash,height:e.height,timestamp:e.timestamp,txCount:a,size:void 0,weight:void 0,difficulty:kT(e.bits),previousBlockHash:e.previous}}function HT(e){const a=LT(e);return a&&a.length>0?a:void 0}function UT(e,a,i,l){const s=/^0{64}$/u.test(e.point.hash),u=a?xb(a.script,i):{address:void 0,type:void 0},f=a?a.value:void 0,h=a?a.script:void 0;return{index:l,prevTxId:s?void 0:e.point.hash,prevOutputIndex:s?void 0:e.point.index,address:u.address,valueSats:f,scriptType:u.type??bh(h??e.script),isCoinbase:s,script:e.script?{mnemonic:e.script}:void 0,witness:HT(e.witness),sequence:e.sequence}}function $T(e,a,i){const l=xb(e.script,i);return{index:a,address:l.address,valueSats:e.value,scriptType:l.type??bh(e.script),spent:void 0,script:e.script?{mnemonic:e.script}:void 0}}function ZT(e,a){return typeof e!="number"||typeof a!="number"?0:Math.max(0,e-a+1)}function Gs(e,a,i,l,s){const u=e.outputs.map((g,v)=>$T(g,v,i)),f=u.reduce((g,v)=>g+v.valueSats,0),h=a.reduce((g,v)=>v?(g??0)+v.value:g,null),p=ZT(l.tipHeight,l.blockHeight),m=typeof l.blockHeight=="number"?"confirmed":"unconfirmed";return{txid:e.hash,hash:e.hash,status:m,confirmations:p,blockHeight:l.blockHeight,blockHash:l.blockHash,receivedTime:l.timestamp,feeSats:Number.isFinite(s)?s:void 0,feeRate:null,size:void 0,weight:void 0,version:e.version,locktime:e.locktime,totalInput:h,totalOutput:f,inputs:e.inputs.map((g,v)=>UT(g,a[v],i,v)),outputs:u}}const Ys=25,_g=5e3,ld=new Map,od=new Map,Su={address:!0,filter:!1,turbo:!0,witness:!0,retarget:!1,difficult:!1};function qT(e){if(!e||typeof e!="object"||Array.isArray(e))return Su;const a=e,i=l=>typeof a[l]=="boolean"?a[l]:Su[l];return{address:i("address"),filter:i("filter"),turbo:i("turbo"),witness:i("witness"),retarget:i("retarget"),difficult:i("difficult")}}function Ni(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const i=e.state;if(!i||typeof i!="object"||Array.isArray(i))return null;const l=i,s=typeof l.count=="number"?l.count:void 0,u=typeof l.size=="number"?l.size:void 0,f=typeof l.weight=="number"?l.weight:void 0;return s===void 0&&u===void 0&&f===void 0?null:{count:s,size:u,weight:f}}function QT(e,a){return!Number.isFinite(e)||!Number.isFinite(a)||a<=0?null:e/a*4}function Fs(e,a){if(!a)return e;const i=typeof a.fee=="number"?a.fee:void 0,l=typeof a.weight=="number"?a.weight:void 0,s=typeof i=="number"&&typeof l=="number"?QT(i,l):e.feeRate;return{...e,wtxid:a.wtxid||e.wtxid,feeSats:typeof a.fee=="number"?a.fee:e.feeSats,feeRate:s,size:typeof a.maximal=="number"?a.maximal:e.size,weight:typeof a.weight=="number"?a.weight:e.weight,sigops:typeof a.confirmed?.sigops=="number"?a.confirmed.sigops:e.sigops,totalInput:typeof a.value=="number"?a.value:e.totalInput,totalOutput:typeof a.spend=="number"?a.spend:e.totalOutput}}async function tn(e,a,i){const l=a.startsWith("/")?a:`/${a}`;let s=l.includes("?")?`${e}${l}`:`${e}${l}?format=json`;i&&(s+=s.includes("?")?"&turbo=true":"?turbo=true");const u=od.get(s);if(u)return u;const f=(async()=>{const h=await fetch(s,{headers:{Accept:"application/json"}});if(!h.ok){const m=await h.text().catch(()=>"");throw new Error(`Request failed ${String(h.status)}: ${m||h.statusText}`)}const p=await h.text();try{return JSON.parse(p)}catch{return p}})();od.set(s,f);try{return await f}finally{od.delete(s)}}async function Ot(e,a,i){try{return await tn(e,a,i)}catch{return null}}async function Sb(e,a){const i=await tn(e,"/v1/top?format=json",a),l=typeof i=="number"?i:Number(i);if(!Number.isFinite(l))throw new Error("Invalid top height");return l}async function $r(e,a){const i=Date.now(),l=`${e}|0`,s=ld.get(l);if(s&&s.expiresAt>i)return s.promise;const u=Sb(e,a).then(f=>(ld.set(l,{promise:u,value:f,expiresAt:Date.now()+_g}),f));return ld.set(l,{promise:u,value:s?.value??null,expiresAt:i+_g}),u}async function Ks(e,a,i){if(a==="latest"||a==="tip"){const l=await $r(e,i);return{path:`/v1/block/height/${String(l)}`,height:l}}return/^\d+$/u.test(a)?{)DELIM" -R"DELIM(path:`/v1/block/height/${a}`}:{path:`/v1/block/hash/${a}`}}function PT(e,a){const i=new Map;return(l,s)=>{const u=`${l}:${String(s)}`,f=i.get(u);if(f)return f;const h=tn(e,`/v1/output/${l}/${String(s)}?format=json`,a).catch(()=>null);return i.set(u,h),h}}async function Eg(e,a,i,l){return tn(e,`${a}/tx/${String(i)}?format=json`,l)}async function sd(e,a,i){const l=await Ot(e,`/v1/address/${a}/confirmed?format=json`,i);return l||(await Ot(e,`/v1/address/${a}?format=json`,i)??[])}function Tg(e,a){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const l=Number(e);if(Number.isFinite(l))return l}let i=0;for(const l of a)i+=l.value;return i}function ud({baseUrl:e,pollIntervalMs:a=15e3,turbo:i=!1}){const l=new Set;let s=null,u=null;const f=vo(yo());let h=null,p=null;function m(){return p||(p=tn(e,"/v1/configuration?format=json").then(_=>{const E=qT(_);return h=E,E}).catch(_=>(console.warn("Libbitcoin configuration fetch failed",_),h=Su,Su)),p)}function g(_){return _.address}function v(_){return g(_)&&_.turbo}function x(){s||(s=setInterval(async()=>{try{const _=await Sb(e);if(u===null){u=_;return}if(_>u){const[E,z]=await Promise.all([tn(e,`/v1/block/height/${String(_)}/header?format=json`),Ot(e,`/v1/block/height/${String(_)}/header/context?format=json`)]),M=Ni(z),B={...Pl(E,M?.count),size:M?.size};for(const Y of l)Y({type:"block.new",payload:B});u=_}}catch(_){console.warn("Libbitcoin poller failed",_)}},a))}function w(){s&&(clearInterval(s),s=null)}return{metadata:{id:"libbitcoin",label:"Server",type:"local",connectionState:"connected",supportsWebsocket:!1,endpoint:e,description:"Adapter for the libbitcoin embedded REST API."},getConfiguration(){return m()},async getLatestBlocks(_=10){const E=await $r(e);u=E;const z=Array.from({length:_},(B,Y)=>E-Y).filter(B=>B>=0),[M,L]=await Promise.all([Promise.all(z.map(B=>tn(e,`/v1/block/height/${String(B)}/header?format=json`))),Promise.all(z.map(B=>Ot(e,`/v1/block/height/${String(B)}/header/context?format=json`)))]);return M.map((B,Y)=>{const K=Ni(L[Y]);return{...Pl(B,K?.count),size:K?.size}})},async getBlocksBefore(_,E=10){const z=Array.from({length:E},(B,Y)=>_-Y).filter(B=>B>=0),[M,L]=await Promise.all([Promise.all(z.map(B=>tn(e,`/v1/block/height/${String(B)}/header?format=json`))),Promise.all(z.map(B=>Ot(e,`/v1/block/height/${String(B)}/header/context?format=json`)))]);return M.map((B,Y)=>{const K=Ni(L[Y]);return{...Pl(B,K?.count),size:K?.size}})},async getBlockHeader(_){const{path:E,height:z}=await Ks(e,_),M=z===void 0?$r(e):Promise.resolve(z),[L,B,Y]=await Promise.all([tn(e,`${E}/header?format=json`),M,Ot(e,`${E}/header/context?format=json`)]);u=Math.max(u??0,B);let K=null;L.heightQ),ge=(await Promise.all(de.map(O=>Eg(e,E,O).catch(()=>null)))).filter(O=>O!==null),Ne=await Promise.all(ge.map(O=>Ot(e,`/v1/tx/${O.hash}/details?format=json`))),V=ge.map((O,Q)=>{const W=Ne[Q],re=Gs(O,[],f,{blockHeight:L.height,blockHash:L.hash,tipHeight:B,timestamp:L.timestamp},typeof W?.fee=="number"?W.fee:void 0);return Fs(re,W)});return{...se,size:K?.maximal??I?.size,weight:K?.weight,merkleRoot:L.merkle_root,nonce:L.nonce,bits:L.bits,version:L.version,nextBlockHash:ie,feesSats:K?.fees,subsidySats:K?.subsidy,sigops:K?.sigops,transactions:V}},async getBlockTransactions(_,E=0){const{path:z}=await Ks(e,_),[M,L,B]=await Promise.all([tn(e,`${z}/header?format=json`),$r(e),Ot(e,`${z}/header/context?format=json`)]);u=Math.max(u??0,L);const Y=Ni(B)?.count;if(typeof Y=="number"&&E>=Y)return[];const K=typeof Y=="number"?Math.min(E+Ys,Y):E+Ys,ie=Array.from({length:Math.max(0,K-E)},(ue,de)=>E+de),N=(await Promise.all(ie.map(ue=>Eg(e,z,ue).catch(()=>null)))).filter(ue=>ue!==null);if(N.length===0)return[];const se=await Promise.all(N.map(ue=>Ot(e,`/v1/tx/${ue.hash}/details?format=json`)));return N.map((ue,de)=>{const te=se[de],ge=Gs(ue,[],f,{blockHeight:M.height,blockHash:M.hash,tipHeight:L,timestamp:M.timestamp},typeof te?.fee=="number"?te.fee:void 0);return Fs(ge,te)})},async getTransaction(_){const E=await tn(e,`/v1/tx/${_}?format=json`),z=PT(e),M=Promise.al)DELIM" -R"DELIM(l(E.inputs.map(I=>/^0{64}$/u.test(I.point.hash)?Promise.resolve(null):z(I.point.hash,I.point.index))),[L,B,Y,K]=await Promise.all([Ot(e,`/v1/tx/${_}/header?format=json`),$r(e).catch(()=>null),Ot(e,`/v1/tx/${_}/details?format=json`),M]);typeof B=="number"&&(u=Math.max(u??0,B));const ie=Gs(E,K,f,{blockHeight:L?.height,blockHash:L?.hash,tipHeight:typeof B=="number"?B:void 0,timestamp:L?.timestamp},typeof Y?.fee=="number"?Y.fee:void 0);return Fs(ie,Y)},async getTransactionHeader(_){const E=await tn(e,`/v1/tx/${_}?format=json`),[z,M,L]=await Promise.all([Ot(e,`/v1/tx/${_}/header?format=json`),$r(e).catch(()=>null),Ot(e,`/v1/tx/${_}/details?format=json`)]);typeof M=="number"&&(u=Math.max(u??0,M));const B=Gs(E,[],f,{blockHeight:z?.height,blockHash:z?.hash,tipHeight:typeof M=="number"?M:void 0,timestamp:z?.timestamp},typeof L?.fee=="number"?L.fee:void 0);return Fs(B,L)},async getTransactionInputScriptHex(_,E){return(await tn(e,`/v1/input/${_}/${String(E)}/script?format=text`)).trim()},async getTransactionOutputScriptHex(_,E){return(await tn(e,`/v1/output/${_}/${String(E)}/script?format=text`)).trim()},async getAddress(_){const E=pr(_,f);if(!E)throw new Error("Unsupported address format for libbitcoin adapter");const z=h??await m();if(!g(z))throw new Error("Address endpoints are disabled by server configuration");const M=i&&v(z),[L,B]=await Promise.all([Ot(e,`/v1/address/${E.hash}/balance?format=json`,M),sd(e,E.hash,M)]),Y=Tg(L,B),K=B.map(ie=>({txid:ie.point.hash,blockHeight:void 0,timestamp:void 0,valueChange:ie.value}));return{address:_,addressType:E.type,balance:Y,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:B.length,transactions:K}},async getAddressSummary(_){const E=pr(_,f);if(!E)throw new Error("Unsupported address format for libbitcoin adapter");const z=h??await m();if(!g(z))throw new Error("Address endpoints are disabled by server configuration");const M=i&&v(z),[L,B]=await Promise.all([Ot(e,`/v1/address/${E.hash}/balance?format=json`,M),sd(e,E.hash,M)]),Y=Tg(L,B);return{address:_,addressType:E.type,balance:Y,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:B.length}},async getAddressTransactions(_){const E=pr(_,f);if(!E)return[];const z=h??await m();if(!g(z))return[];const M=i&&v(z);return(await sd(e,E.hash,M)).map(B=>({txid:B.point.hash,blockHeight:void 0,timestamp:void 0,valueChange:B.value}))},subscribeToEvents(_){return l.add(_),x(),()=>{l.delete(_),l.size===0&&w()}}}}const wb=T.createContext(null),_b=T.createContext(null),Eb=T.createContext(null);function GT({children:e,client:a}){return b.jsx(wb.Provider,{value:a,children:e})}function YT({children:e,provider:a,setProvider:i,availableProviders:l}){return b.jsx(_b.Provider,{value:{provider:a,setProvider:i,availableProviders:l},children:e})}function FT({children:e,turbo:a,setTurbo:i}){return b.jsx(Eb.Provider,{value:{turbo:a,setTurbo:i},children:e})}function gr(){const e=T.useContext(wb);if(!e)throw new Error("BlockchainClientProvider missing in component tree");return e}function go(){return gr().metadata}function Tb(){const e=T.useContext(_b);if(!e)throw new Error("ProviderSwitcherProvider missing in component tree");return e}function Rb(){const e=T.useContext(Eb);if(!e)throw new Error("TurboProvider missing in component tree");return e}function cd(){const e=globalThis.window;return e?.location.origin?e.location.origin:"http://localhost:8080"}function KT(e,a){if(e==="blockstream")return cb({baseUrl:"https://blockstream.info/api"});if(e==="mempool")return pT({baseUrl:"https://mempool.space/api"});if(e==="libbitcoin"){const l=cd();return ud({baseUrl:l,turbo:a?.turboEnabled})}if(e==="external"){console.warn("No external API URL provided, falling back to libbitcoin provider");const l=cd();return ud({baseUrl:l,turbo:a?.turboEnabled})}console.warn(`Unknown provider "${e}", falling back to libbitcoin provider`);const i=cd();return ud({baseUrl:i,turbo:a?.turboEnabled})}function VT(){return[...new Set(["libbitcoin","blockstream","mempool"])]}function XT({children:e}){const a="libbitcoin",i=VT(),l=(()=>{const v=globalThis.window;return v?v.localStorage.getItem("turboEnabled")==="true":!1})(),s=(()=>{const v=globalThis.window;if(!v)return a;const x=v.localStorage.getItem("blockchainProvider");return x&&i.includes(x)?x:a})(),[u,f]=T.useState(l),[h,p]=T.useState(s),[m]=T.useState(()=>new yw({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}})),g=T.useMemo(()=>KT(h,{turboEnabled:u}),[h,u]);return T.useEffect(()=>{const v=globalThis.window;v&&v.localStorage.setItem("turboEnabled",u?"true":"false")},[u]),T.useEffect(()=>{const v=globalThis.window;v&&v.localStorage.setItem("blockchainProvider",h)},[h]),b.jsx(YT,{provider:h,setProvider:p,availableProviders:i,children:b.jsx(FT,{turbo:u,setTurbo:f,children:b.jsx(GT,{client:g,children:b.jsxs(vw,{client:m,children:[e,null]})})})})}var zb=e=>{throw TypeError(e)},JT=(e,a,i)=>a.has(e)||zb("Cannot "+i),fd=(e,a,i)=>(JT(e,a,"read from private field"),i?i.call(e):a.get(e)),IT=()DELIM" -R"DELIM(e,a,i)=>a.has(e)?zb("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(e):a.set(e,i),Rg="popstate";function zg(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function WT(e={}){function a(l,s){let u=s.state?.masked,{pathname:f,search:h,hash:p}=u||l.location;return so("",{pathname:f,search:h,hash:p},s.state&&s.state.usr||null,s.state&&s.state.key||"default",u?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,s){return typeof s=="string"?s:ia(s)}return tR(a,i,null,e)}function Oe(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function gt(e,a){if(!e){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function eR(){return Math.random().toString(36).substring(2,10)}function Ag(e,a){return{usr:e.state,key:e.key,idx:a,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function so(e,a,i=null,l,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof a=="string"?la(a):a,state:i,key:a&&a.key||l||eR(),unstable_mask:s}}function ia({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 la(e){let a={};if(e){let i=e.indexOf("#");i>=0&&(a.hash=e.substring(i),e=e.substring(0,i));let l=e.indexOf("?");l>=0&&(a.search=e.substring(l),e=e.substring(0,l)),e&&(a.pathname=e)}return a}function tR(e,a,i,l={}){let{window:s=document.defaultView,v5Compat:u=!1}=l,f=s.history,h="POP",p=null,m=g();m==null&&(m=0,f.replaceState({...f.state,idx:m},""));function g(){return(f.state||{idx:null}).idx}function v(){h="POP";let z=g(),M=z==null?null:z-m;m=z,p&&p({action:h,location:E.location,delta:M})}function x(z,M){h="PUSH";let L=zg(z)?z:so(E.location,z,M);m=g()+1;let B=Ag(L,m),Y=E.createHref(L.unstable_mask||L);try{f.pushState(B,"",Y)}catch(K){if(K instanceof DOMException&&K.name==="DataCloneError")throw K;s.location.assign(Y)}u&&p&&p({action:h,location:E.location,delta:1})}function w(z,M){h="REPLACE";let L=zg(z)?z:so(E.location,z,M);m=g();let B=Ag(L,m),Y=E.createHref(L.unstable_mask||L);f.replaceState(B,"",Y),u&&p&&p({action:h,location:E.location,delta:0})}function _(z){return Ab(z)}let E={get action(){return h},get location(){return e(s,f)},listen(z){if(p)throw new Error("A history only accepts one active listener");return s.addEventListener(Rg,v),p=z,()=>{s.removeEventListener(Rg,v),p=null}},createHref(z){return a(s,z)},createURL:_,encodeLocation(z){let M=_(z);return{pathname:M.pathname,search:M.search,hash:M.hash}},push:x,replace:w,go(z){return f.go(z)}};return E}function Ab(e,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),Oe(i,"No window.location.(origin|href) available to create URL");let l=typeof e=="string"?e:ia(e);return l=l.replace(/ $/,"%20"),!a&&l.startsWith("//")&&(l=i+l),new URL(l,i)}var Xl,Cg=class{constructor(e){if(IT(this,Xl,new Map),e)for(let[a,i]of e)this.set(a,i)}get(e){if(fd(this,Xl).has(e))return fd(this,Xl).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,a){fd(this,Xl).set(e,a)}};Xl=new WeakMap;var nR=new Set(["lazy","caseSensitive","path","id","index","children"]);function aR(e){return nR.has(e)}var rR=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function iR(e){return rR.has(e)}function lR(e){return e.index===!0}function uo(e,a,i=[],l={},s=!1){return e.map((u,f)=>{let h=[...i,String(f)],p=typeof u.id=="string"?u.id:h.join("-");if(Oe(u.index!==!0||!u.children,"Cannot specify children on an index route"),Oe(s||!l[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),lR(u)){let m={...u,id:p};return l[p]=Og(m,a(m)),m}else{let m={...u,id:p,children:void 0};return l[p]=Og(m,a(m)),u.children&&(m.children=uo(u.children,a,h,l,s)),m}})}function Og(e,a){return Object.assign(e,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...e.lazy,...a.lazy}}:{}})}function fr(e,a,i="/"){return Jl(e,a,i,!1)}function Jl(e,a,i,l){let s=typeof a=="string"?la(a):a,u=Ln(s.pathname||"/",i);if(u==null)return null;let f=Cb(e);sR(f);let h=null;for(let p=0;h==null&&p{let g={relativePath:m===void 0?f.path||"":m,caseSensitive:f.caseSensitive===!0,childrenIndex:h,route:f};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(l)&&p)return;Oe(g.relativePath.startsWith(l),`Absolute route path "${g.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(l.length)}let v=)DELIM" -R"DELIM(kn([l,g.relativePath]),x=i.concat(g);f.children&&f.children.length>0&&(Oe(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),Cb(f.children,a,x,v,p)),!(f.path==null&&!f.index)&&a.push({path:v,score:pR(v,f.index),routesMeta:x})};return e.forEach((f,h)=>{if(f.path===""||!f.path?.includes("?"))u(f,h);else for(let p of Ob(f.path))u(f,h,!0,p)}),a}function Ob(e){let a=e.split("/");if(a.length===0)return[];let[i,...l]=a,s=i.endsWith("?"),u=i.replace(/\?$/,"");if(l.length===0)return s?[u,""]:[u];let f=Ob(l.join("/")),h=[];return h.push(...f.map(p=>p===""?u:[u,p].join("/"))),s&&h.push(...f),h.map(p=>e.startsWith("/")&&p===""?"/":p)}function sR(e){e.sort((a,i)=>a.score!==i.score?i.score-a.score:yR(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var uR=/^:[\w-]+$/,cR=3,fR=2,dR=1,hR=10,mR=-2,jg=e=>e==="*";function pR(e,a){let i=e.split("/"),l=i.length;return i.some(jg)&&(l+=mR),a&&(l+=fR),i.filter(s=>!jg(s)).reduce((s,u)=>s+(uR.test(u)?cR:u===""?dR:hR),l)}function yR(e,a){return e.length===a.length&&e.slice(0,-1).every((l,s)=>l===a[s])?e[e.length-1]-a[a.length-1]:0}function vR(e,a,i=!1){let{routesMeta:l}=e,s={},u="/",f=[];for(let h=0;h{if(g==="*"){let _=h[x]||"";f=u.slice(0,u.length-_.length).replace(/(.)\/+$/,"$1")}const w=h[x];return v&&!w?m[g]=void 0:m[g]=(w||"").replace(/%2F/g,"/"),m},{}),pathname:u,pathnameBase:f,pattern:e}}function gR(e,a=!1,i=!0){gt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let l=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,h,p,m,g)=>{if(l.push({paramName:h,isOptional:p!=null}),p){let v=g.charAt(m+f.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(l.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,a?void 0:"i"),l]}function bR(e){try{return e.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return gt(!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 Ln(e,a){if(a==="/")return e;if(!e.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,l=e.charAt(i);return l&&l!=="/"?null:e.slice(i)||"/"}function xR({basename:e,pathname:a}){return a==="/"?e:kn([e,a])}var jb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xh=e=>jb.test(e);function SR(e,a="/"){let{pathname:i,search:l="",hash:s=""}=typeof e=="string"?la(e):e,u;return i?(i=Sh(i),i.startsWith("/")?u=Ng(i.substring(1),"/"):u=Ng(i,a)):u=a,{pathname:u,search:_R(l),hash:ER(s)}}function Ng(e,a){let i=_u(a).split("/");return e.split("/").forEach(s=>{s===".."?i.length>1&&i.pop():s!=="."&&i.push(s)}),i.length>1?i.join("/"):"/"}function dd(e,a,i,l){return`Cannot include a '${e}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Nb(e){return e.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function Nu(e){let a=Nb(e);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function bo(e,a,i,l=!1){let s;typeof e=="string"?s=la(e):(s={...e},Oe(!s.pathname||!s.pathname.includes("?"),dd("?","pathname","search",s)),Oe(!s.pathname||!s.pathname.includes("#"),dd("#","pathname","hash",s)),Oe(!s.search||!s.search.includes("#"),dd("#","search","hash",s)));let u=e===""||s.pathname==="",f=u?"/":s.pathname,h;if(f==null)h=i;else{let v=a.length-1;if(!l&&f.startsWith("..")){let x=f.split("/");for(;x[0]==="..";)x.shift(),v-=1;s.pathname=x.join("/")}h=v>=0?a[v]:"/"}let p=SR(s,h),m=f&&f!=="/"&&f.endsWith("/"),g=(u||f===".")&&i.endsWith("/");return!p.pathname.endsWith("/")&&(m||g)&&(p.pathname+="/"),p}var Sh=e=>e.replace(/\/\/+/g,"/"),kn=e)DELIM" -R"DELIM(=>Sh(e.join("/")),_u=e=>e.replace(/\/+$/,""),wR=e=>_u(e).replace(/^\/*/,"/"),_R=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ER=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,xo=class{constructor(e,a,i,l=!1){this.status=e,this.statusText=a||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function co(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function So(e){let a=e.map(i=>i.route.path).filter(Boolean);return kn(a)||"/"}var Mb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Db(e,a){let i=e;if(typeof i!="string"||!jb.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,s=!1;if(Mb)try{let u=new URL(window.location.href),f=i.startsWith("//")?new URL(u.protocol+i):new URL(i),h=Ln(f.pathname,a);f.origin===u.origin&&h!=null?i=h+f.search+f.hash:s=!0}catch{gt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:s,to:i}}var hr=Symbol("Uninstrumented");function TR(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 f=Object.keys(i);for(let h of f)u[h]&&i[h].push(u[h])}}));let l={};if(typeof a.lazy=="function"&&i.lazy.length>0){let s=Ui(i.lazy,a.lazy,()=>{});s&&(l.lazy=s)}if(typeof a.lazy=="object"){let s=a.lazy;["middleware","loader","action"].forEach(u=>{let f=s[u],h=i[`lazy.${u}`];if(typeof f=="function"&&h.length>0){let p=Ui(h,f,()=>{});p&&(l.lazy=Object.assign(l.lazy||{},{[u]:p}))}})}return["loader","action"].forEach(s=>{let u=a[s];if(typeof u=="function"&&i[s].length>0){let f=u[hr]??u,h=Ui(i[s],f,(...p)=>Mg(p[0]));h&&(s==="loader"&&f.hydrate===!0&&(h.hydrate=!0),h[hr]=f,l[s]=h)}}),a.middleware&&a.middleware.length>0&&i.middleware.length>0&&(l.middleware=a.middleware.map(s=>{let u=s[hr]??s,f=Ui(i.middleware,u,(...h)=>Mg(h[0]));return f?(f[hr]=u,f):s})),l}function RR(e,a){let i={navigate:[],fetch:[]};if(a.forEach(l=>l({instrument(s){let u=Object.keys(s);for(let f of u)s[f]&&i[f].push(s[f])}})),i.navigate.length>0){let l=e.navigate[hr]??e.navigate,s=Ui(i.navigate,l,(...u)=>{let[f,h]=u;return{to:typeof f=="number"||typeof f=="string"?f:f?ia(f):".",...Dg(e,h??{})}});s&&(s[hr]=l,e.navigate=s)}if(i.fetch.length>0){let l=e.fetch[hr]??e.fetch,s=Ui(i.fetch,l,(...u)=>{let[f,,h,p]=u;return{href:h??".",fetcherKey:f,...Dg(e,p??{})}});s&&(s[hr]=l,e.fetch=s)}return e}function Ui(e,a,i){return e.length===0?null:async(...l)=>{let s=await kb(e,i(...l),()=>a(...l),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function kb(e,a,i,l){let s=e[l],u;if(s){let f,h=async()=>(f?console.error("You cannot call instrumented handlers more than once"):f=kb(e,a,i,l-1),u=await f,Oe(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await s(h,a)}catch(p){console.error("An instrumentation function threw an error:",p)}f||await h(),await f}else try{u={type:"success",value:await i()}}catch(f){u={type:"error",value:f}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Mg(e){let{request:a,context:i,params:l,unstable_pattern:s}=e;return{request:zR(a),params:{...l},unstable_pattern:s,context:AR(i)}}function Dg(e,a){return{currentUrl:ia(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 zR(e){return{method:e.method,url:e.url,headers:{get:(...a)=>e.headers.get(...a)}}}function AR(e){if(OR(e)){let a={...e};return Object.freeze(a),a}else return{get:a=>e.get(a)}}var CR=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function OR(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")===CR}var Lb=["POST","PUT","PATCH","DELETE"],jR=new Set(Lb),NR=["GET",...Lb],MR=new Set(NR),Bb=new Set([301,302,303,307,308]),DR=new Set([307,308]),hd={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},kR={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Gl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},LR=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Hb="remix-router-transitions",Ub=Symbol("ResetLoaderData");function BR(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";Oe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let l=e.hydrationRouteProperties||[],s=e.mapRouteProperties||LR,u=s;if(e.unstable_i)DELIM" -R"DELIM(nstrumentations){let A=e.unstable_instrumentations;u=D=>({...s(D),...TR(A.map($=>$.route).filter(Boolean),D)})}let f={},h=uo(e.routes,u,void 0,f),p,m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let g=e.dataStrategy||qR,v={unstable_passThroughRequests:!1,...e.future},x=null,w=new Set,_=null,E=null,z=null,M=e.hydrationData!=null,L=fr(h,e.history.location,m),B=!1,Y=null,K,ie;if(L==null&&!e.patchRoutesOnNavigation){let A=Mn(404,{pathname:e.history.location.pathname}),{matches:D,route:$}=Vs(h);K=!0,ie=!K,L=D,Y={[$.id]:A}}else if(L&&!e.hydrationData&&La(L,h,e.history.location.pathname).active&&(L=null),L)if(L.some(A=>A.route.lazy))K=!1,ie=!K;else if(!L.some(A=>wh(A.route)))K=!0,ie=!K;else{let A=e.hydrationData?e.hydrationData.loaderData:null,D=e.hydrationData?e.hydrationData.errors:null,$=L;if(D){let ee=L.findIndex(ae=>D[ae.route.id]!==void 0);$=$.slice(0,ee+1)}ie=!1,K=!0,$.forEach(ee=>{let ae=$b(ee.route,A,D);ie=ie||ae.renderFallback,K=K&&!ae.shouldLoad})}else{K=!1,ie=!K,L=[];let A=La(null,h,e.history.location.pathname);A.active&&A.matches&&(B=!0,L=A.matches)}let I,N={historyAction:e.history.action,location:e.history.location,matches:L,initialized:K,renderFallback:ie,navigation:hd,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||Y,fetchers:new Map,blockers:new Map},se="POP",ue=null,de=!1,te,ge=!1,Ne=new Map,V=null,O=!1,Q=!1,W=new Set,re=new Map,xe=0,C=-1,P=new Map,ne=new Set,le=new Map,we=new Map,Re=new Set,oe=new Map,Me,Ae=null;function Gt(){if(x=e.history.listen(({action:A,location:D,delta:$})=>{if(Me){Me(),Me=void 0;return}gt(oe.size===0||$!=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 ee=Sr({currentLocation:N.location,nextLocation:D,historyAction:A});if(ee&&$!=null){let ae=new Promise(pe=>{Me=pe});e.history.go($*-1),ua(ee,{state:"blocked",location:D,proceed(){ua(ee,{state:"proceeding",proceed:void 0,reset:void 0,location:D}),ae.then(()=>e.history.go($))},reset(){let pe=new Map(N.blockers);pe.set(ee,Gl),ht({blockers:pe})}}),ue?.resolve(),ue=null;return}return Xe(A,D)}),i){lz(a,Ne);let A=()=>oz(a,Ne);a.addEventListener("pagehide",A),V=()=>a.removeEventListener("pagehide",A)}return N.initialized||Xe("POP",N.location,{initialHydration:!0}),I}function Yt(){x&&x(),V&&V(),w.clear(),te&&te.abort(),N.fetchers.forEach((A,D)=>sa(D)),N.blockers.forEach((A,D)=>xr(D))}function wn(A){return w.add(A),()=>w.delete(A)}function ht(A,D={}){A.matches&&(A.matches=A.matches.map(ae=>{let pe=f[ae.route.id],ce=ae.route;return ce.element!==pe.element||ce.errorElement!==pe.errorElement||ce.hydrateFallbackElement!==pe.hydrateFallbackElement?{...ae,route:pe}:ae})),N={...N,...A};let $=[],ee=[];N.fetchers.forEach((ae,pe)=>{ae.state==="idle"&&(Re.has(pe)?$.push(pe):ee.push(pe))}),Re.forEach(ae=>{!N.fetchers.has(ae)&&!re.has(ae)&&$.push(ae)}),[...w].forEach(ae=>ae(N,{deletedFetchers:$,newErrors:A.errors??null,viewTransitionOpts:D.viewTransitionOpts,flushSync:D.flushSync===!0})),$.forEach(ae=>sa(ae)),ee.forEach(ae=>N.fetchers.delete(ae))}function Ze(A,D,{flushSync:$}={}){let ee=N.actionData!=null&&N.navigation.formMethod!=null&&Xt(N.navigation.formMethod)&&N.navigation.state==="loading"&&A.state?._isRedirect!==!0,ae;D.actionData?Object.keys(D.actionData).length>0?ae=D.actionData:ae=null:ee?ae=N.actionData:ae=null;let pe=D.loaderData?Gg(N.loaderData,D.loaderData,D.matches||[],D.errors):N.loaderData,ce=N.blockers;ce.size>0&&(ce=new Map(ce),ce.forEach((_e,be)=>ce.set(be,Gl)));let fe=O?!1:Ii(A,D.matches||N.matches),ye=de===!0||N.navigation.formMethod!=null&&Xt(N.navigation.formMethod)&&A.state?._isRedirect!==!0;p&&(h=p,p=void 0),O||se==="POP"||(se==="PUSH"?e.history.push(A,A.state):se==="REPLACE"&&e.history.replace(A,A.state));let he;if(se==="POP"){let _e=Ne.get(N.location.pathname);_e&&_e.has(A.pathname)?he={currentLocation:N.location,nextLocation:A}:Ne.has(A.pathname)&&(he={currentLocation:A,nextLocation:N.location})}else if(ge){let _e=Ne.get(N.location.pathname);_e?_e.add(A.pathname):(_e=new Set([A.pathname]),Ne.set(N.location.pathname,_e)),he={currentLocation:N.location,nextLocation:A}}ht({...D,actionData:ae,loaderData:pe,historyAction:se,location:A,initialized:!0,renderFallback:!1,navigation:hd,revalidation:"idle",restoreScrollPosition:fe,preventScrollReset:ye,blockers:ce},{viewTransitionOpts:he,flushSync:$===!0}),se="POP",de=!1,ge=!1,O=!1,Q=!1,ue?.resolve(),ue=null,Ae?.resolve(),Ae=null}async function lt(A,D){if(ue?.resolve(),ue=null,typeof A=="number"){ue||(ue=Vg());let at)DELIM" -R"DELIM(=ue.promise;return e.history.go(A),at}let $=Xd(N.location,N.matches,m,A,D?.fromRouteId,D?.relative),{path:ee,submission:ae,error:pe}=kg(!1,$,D),ce;D?.unstable_mask&&(ce={pathname:"",search:"",hash:"",...typeof D.unstable_mask=="string"?la(D.unstable_mask):{...N.location.unstable_mask,...D.unstable_mask}});let fe=N.location,ye=so(fe,ee,D&&D.state,void 0,ce);ye={...ye,...e.history.encodeLocation(ye)};let he=D&&D.replace!=null?D.replace:void 0,_e="PUSH";he===!0?_e="REPLACE":he===!1||ae!=null&&Xt(ae.formMethod)&&ae.formAction===N.location.pathname+N.location.search&&(_e="REPLACE");let be=D&&"preventScrollReset"in D?D.preventScrollReset===!0:void 0,Ge=(D&&D.flushSync)===!0,De=Sr({currentLocation:fe,nextLocation:ye,historyAction:_e});if(De){ua(De,{state:"blocked",location:ye,proceed(){ua(De,{state:"proceeding",proceed:void 0,reset:void 0,location:ye}),lt(A,D)},reset(){let at=new Map(N.blockers);at.set(De,Gl),ht({blockers:at})}});return}await Xe(_e,ye,{submission:ae,pendingError:pe,preventScrollReset:be,replace:D&&D.replace,enableViewTransition:D&&D.viewTransition,flushSync:Ge,callSiteDefaultShouldRevalidate:D&&D.unstable_defaultShouldRevalidate})}function Pe(){Ae||(Ae=Vg()),Da(),ht({revalidation:"loading"});let A=Ae.promise;return N.navigation.state==="submitting"?A:N.navigation.state==="idle"?(Xe(N.historyAction,N.location,{startUninterruptedRevalidation:!0}),A):(Xe(se||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,enableViewTransition:ge===!0}),A)}async function Xe(A,D,$){te&&te.abort(),te=null,se=A,O=($&&$.startUninterruptedRevalidation)===!0,$u(N.location,N.matches),de=($&&$.preventScrollReset)===!0,ge=($&&$.enableViewTransition)===!0;let ee=p||h,ae=$&&$.overrideNavigation,pe=$?.initialHydration&&N.matches&&N.matches.length>0&&!B?N.matches:fr(ee,D,m),ce=($&&$.flushSync)===!0;if(pe&&N.initialized&&!Q&&XR(N.location,D)&&!($&&$.submission&&Xt($.submission.formMethod))){Ze(D,{matches:pe},{flushSync:ce});return}let fe=La(pe,ee,D.pathname);if(fe.active&&fe.matches&&(pe=fe.matches),!pe){let{error:ot,notFoundMatches:pt,route:qe}=Zn(D.pathname);Ze(D,{matches:pt,loaderData:{},errors:{[qe.id]:ot}},{flushSync:ce});return}te=new AbortController;let ye=Bi(e.history,D,te.signal,$&&$.submission),he=e.getContext?await e.getContext():new Cg,_e;if($&&$.pendingError)_e=[dr(pe).route.id,{type:"error",error:$.pendingError}];else if($&&$.submission&&Xt($.submission.formMethod)){let ot=await Kn(ye,D,$.submission,pe,he,fe.active,$&&$.initialHydration===!0,{replace:$.replace,flushSync:ce});if(ot.shortCircuited)return;if(ot.pendingActionResult){let[pt,qe]=ot.pendingActionResult;if(bn(qe)&&co(qe.error)&&qe.error.status===404){te=null,Ze(D,{matches:ot.matches,loaderData:{},errors:{[pt]:qe.error}});return}}pe=ot.matches||pe,_e=ot.pendingActionResult,ae=md(D,$.submission),ce=!1,fe.active=!1,ye=Bi(e.history,ye.url,ye.signal)}let{shortCircuited:be,matches:Ge,loaderData:De,errors:at}=await br(ye,D,pe,he,fe.active,ae,$&&$.submission,$&&$.fetcherSubmission,$&&$.replace,$&&$.initialHydration===!0,ce,_e,$&&$.callSiteDefaultShouldRevalidate);be||(te=null,Ze(D,{matches:Ge||pe,...Yg(_e),loaderData:De,errors:at}))}async function Kn(A,D,$,ee,ae,pe,ce,fe={}){Da();let ye=rz(D,$);if(ht({navigation:ye},{flushSync:fe.flushSync===!0}),pe){let be=await Vn(ee,D.pathname,A.signal);if(be.type==="aborted")return{shortCircuited:!0};if(be.type==="error"){if(be.partialMatches.length===0){let{matches:De,route:at}=Vs(h);return{matches:De,pendingActionResult:[at.id,{type:"error",error:be.error}]}}let Ge=dr(be.partialMatches).route.id;return{matches:be.partialMatches,pendingActionResult:[Ge,{type:"error",error:be.error}]}}else if(be.matches)ee=be.matches;else{let{notFoundMatches:Ge,error:De,route:at}=Zn(D.pathname);return{matches:Ge,pendingActionResult:[at.id,{type:"error",error:De}]}}}let he,_e=lu(ee,D);if(!_e.route.action&&!_e.route.lazy)he={type:"error",error:Mn(405,{method:A.method,pathname:D.pathname,routeId:_e.route.id})};else{let be=Zi(u,f,A,D,ee,_e,ce?[]:l,ae),Ge=await Ma(A,D,be,ae,null);if(he=Ge[_e.route.id],!he){for(let De of ee)if(Ge[De.route.id]){he=Ge[De.route.id];break}}if(A.signal.aborted)return{shortCircuited:!0}}if(qr(he)){let be;return fe&&fe.replace!=null?be=fe.replace:be=qg(he.response.headers.get("Location"),new URL(A.url),m,e.history)===N.location.pathname+N.location.search,await oa(A,he,!0,{submission:$,replace:be}),{shortCircuited:!0}}if(bn(he)){let be=dr(ee,_e.route.id);return(fe&&fe.replace)!==!0&&(se="PUSH"),{matches:ee,pendingActionResult:[be.route.id,he,_e.route.id]}}return{matches:ee,pendingActionResult:[_e.route.id,he]}}async function br(A,D,$,ee,ae,pe,ce,fe,ye,he,_e,be,Ge){let De=pe||md(D,ce),at=ce||fe||Kg(De),ot=!O&&!he;if(ae){if(ot){let bt=Na(be);ht({navigation:De,...bt!==void 0?{actionData:bt}:{}},{flushSync:_e})}let ke=await Vn($,D.pathname,A.signal);if(ke.type==="aborted")return{shortCircuited:!0};if(ke.type==="error"){if(ke.partialMatches.length===0){let{matches:Kt,route:Tt}=Vs(h);return{matches:Kt,loaderDa)DELIM" -R"DELIM(ta:{},errors:{[Tt.id]:ke.error}}}let bt=dr(ke.partialMatches).route.id;return{matches:ke.partialMatches,loaderData:{},errors:{[bt]:ke.error}}}else if(ke.matches)$=ke.matches;else{let{error:bt,notFoundMatches:Kt,route:Tt}=Zn(D.pathname);return{matches:Kt,loaderData:{},errors:{[Tt.id]:bt}}}}let pt=p||h,{dsMatches:qe,revalidatingFetchers:Et}=Lg(A,ee,u,f,e.history,N,$,at,D,he?[]:l,he===!0,Q,W,Re,le,ne,pt,m,e.patchRoutesOnNavigation!=null,be,Ge);if(C=++xe,!e.dataStrategy&&!qe.some(ke=>ke.shouldLoad)&&!qe.some(ke=>ke.route.middleware&&ke.route.middleware.length>0)&&Et.length===0){let ke=To();return Ze(D,{matches:$,loaderData:{},errors:be&&bn(be[1])?{[be[0]]:be[1].error}:null,...Yg(be),...ke?{fetchers:new Map(N.fetchers)}:{}},{flushSync:_e}),{shortCircuited:!0}}if(ot){let ke={};if(!ae){ke.navigation=De;let bt=Na(be);bt!==void 0&&(ke.actionData=bt)}Et.length>0&&(ke.fetchers=Xi(Et)),ht(ke,{flushSync:_e})}Et.forEach(ke=>{kt(ke.key),ke.controller&&re.set(ke.key,ke.controller)});let it=()=>Et.forEach(ke=>kt(ke.key));te&&te.signal.addEventListener("abort",it);let{loaderResults:Ba,fetcherResults:qn}=await Ji(qe,Et,A,D,ee);if(A.signal.aborted)return{shortCircuited:!0};te&&te.signal.removeEventListener("abort",it),Et.forEach(ke=>re.delete(ke.key));let Lt=Xs(Ba);if(Lt)return await oa(A,Lt.result,!0,{replace:ye}),{shortCircuited:!0};if(Lt=Xs(qn),Lt)return ne.add(Lt.key),await oa(A,Lt.result,!0,{replace:ye}),{shortCircuited:!0};let{loaderData:Xn,errors:wr}=Pg(N,$,Ba,be,Et,qn);he&&N.errors&&(wr={...N.errors,...wr});let Jn=To(),_r=Ro(C),Vr=Jn||_r||Et.length>0;return{matches:$,loaderData:Xn,errors:wr,...Vr?{fetchers:new Map(N.fetchers)}:{}}}function Na(A){if(A&&!bn(A[1]))return{[A[0]]:A[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function Xi(A){return A.forEach(D=>{let $=N.fetchers.get(D.key),ee=Yl(void 0,$?$.data:void 0);N.fetchers.set(D.key,ee)}),new Map(N.fetchers)}async function Lu(A,D,$,ee){kt(A);let ae=(ee&&ee.flushSync)===!0,pe=p||h,ce=Xd(N.location,N.matches,m,$,D,ee?.relative),fe=fr(pe,ce,m),ye=La(fe,pe,ce);if(ye.active&&ye.matches&&(fe=ye.matches),!fe){_n(A,D,Mn(404,{pathname:ce}),{flushSync:ae});return}let{path:he,submission:_e,error:be}=kg(!0,ce,ee);if(be){_n(A,D,be,{flushSync:ae});return}let Ge=e.getContext?await e.getContext():new Cg,De=(ee&&ee.preventScrollReset)===!0;if(_e&&Xt(_e.formMethod)){await Bu(A,D,he,fe,Ge,ye.active,ae,De,_e,ee&&ee.unstable_defaultShouldRevalidate);return}le.set(A,{routeId:D,path:he}),await Jt(A,D,he,fe,Ge,ye.active,ae,De,_e)}async function Bu(A,D,$,ee,ae,pe,ce,fe,ye,he){Da(),le.delete(A);let _e=N.fetchers.get(A);$n(A,iz(ye,_e),{flushSync:ce});let be=new AbortController,Ge=Bi(e.history,$,be.signal,ye);if(pe){let st=await Vn(ee,new URL(Ge.url).pathname,Ge.signal,A);if(st.type==="aborted")return;if(st.type==="error"){_n(A,D,st.error,{flushSync:ce});return}else if(st.matches)ee=st.matches;else{_n(A,D,Mn(404,{pathname:$}),{flushSync:ce});return}}let De=lu(ee,$);if(!De.route.action&&!De.route.lazy){let st=Mn(405,{method:ye.formMethod,pathname:$,routeId:D});_n(A,D,st,{flushSync:ce});return}re.set(A,be);let at=xe,ot=Zi(u,f,Ge,$,ee,De,l,ae),pt=await Ma(Ge,$,ot,ae,A),qe=pt[De.route.id];if(!qe){for(let st of ot)if(pt[st.route.id]){qe=pt[st.route.id];break}}if(Ge.signal.aborted){re.get(A)===be&&re.delete(A);return}if(Re.has(A)){if(qr(qe)||bn(qe)){$n(A,Aa(void 0));return}}else{if(qr(qe))if(re.delete(A),C>at){$n(A,Aa(void 0));return}else return ne.add(A),$n(A,Yl(ye)),oa(Ge,qe,!1,{fetcherSubmission:ye,preventScrollReset:fe});if(bn(qe)){_n(A,D,qe.error);return}}let Et=N.navigation.location||N.location,it=Bi(e.history,Et,be.signal),Ba=p||h,qn=N.navigation.state!=="idle"?fr(Ba,N.navigation.location,m):N.matches;Oe(qn,"Didn't find any matches after fetcher action");let Lt=++xe;P.set(A,Lt);let Xn=Yl(ye,qe.data);N.fetchers.set(A,Xn);let{dsMatches:wr,revalidatingFetchers:Jn}=Lg(it,ae,u,f,e.history,N,qn,ye,Et,l,!1,Q,W,Re,le,ne,Ba,m,e.patchRoutesOnNavigation!=null,[De.route.id,qe],he);Jn.filter(st=>st.key!==A).forEach(st=>{let Xr=st.key,Jr=N.fetchers.get(Xr),Oo=Yl(void 0,Jr?Jr.data:void 0);N.fetchers.set(Xr,Oo),kt(Xr),st.controller&&re.set(Xr,st.controller)}),ht({fetchers:new Map(N.fetchers)});let _r=()=>Jn.forEach(st=>kt(st.key));be.signal.addEventListener("abort",_r);let{loaderResults:Vr,fetcherResults:ke}=await Ji(wr,Jn,it,Et,ae);if(be.signal.aborted)return;if(be.signal.removeEventListener("abort",_r),P.delete(A),re.delete(A),Jn.forEach(st=>re.delete(st.key)),N.fetchers.has(A)){let st=Aa(qe.data);N.fetchers.set(A,st)}let bt=Xs(Vr);if(bt)return oa(it,bt.result,!1,{preventScrollReset:fe});if(bt=Xs(ke),bt)return ne.add(bt.key),oa(it,bt.result,!1,{preventScrollReset:fe});let{loaderData:Kt,errors:Tt}=Pg(N,qn,Vr,void 0,Jn,ke);Ro(Lt),N.navigation.state==="loading"&&Lt>C?(Oe(se,"Expected pending action"),te&&te.abort(),Ze(N.navigation.location,{matches:qn,loaderData:Kt,errors:Tt,fetchers:new Map(N.fetchers)})):(ht({errors:Tt,loaderData:Gg(N.loaderData,Kt,qn,Tt),fetchers:new)DELIM" -R"DELIM( Map(N.fetchers)}),Q=!1)}async function Jt(A,D,$,ee,ae,pe,ce,fe,ye){let he=N.fetchers.get(A);$n(A,Yl(ye,he?he.data:void 0),{flushSync:ce});let _e=new AbortController,be=Bi(e.history,$,_e.signal);if(pe){let qe=await Vn(ee,new URL(be.url).pathname,be.signal,A);if(qe.type==="aborted")return;if(qe.type==="error"){_n(A,D,qe.error,{flushSync:ce});return}else if(qe.matches)ee=qe.matches;else{_n(A,D,Mn(404,{pathname:$}),{flushSync:ce});return}}let Ge=lu(ee,$);re.set(A,_e);let De=xe,at=Zi(u,f,be,$,ee,Ge,l,ae),pt=(await Ma(be,$,at,ae,A))[Ge.route.id];if(re.get(A)===_e&&re.delete(A),!be.signal.aborted){if(Re.has(A)){$n(A,Aa(void 0));return}if(qr(pt))if(C>De){$n(A,Aa(void 0));return}else{ne.add(A),await oa(be,pt,!1,{preventScrollReset:fe});return}if(bn(pt)){_n(A,D,pt.error);return}$n(A,Aa(pt.data))}}async function oa(A,D,$,{submission:ee,fetcherSubmission:ae,preventScrollReset:pe,replace:ce}={}){$||(ue?.resolve(),ue=null),D.response.headers.has("X-Remix-Revalidate")&&(Q=!0);let fe=D.response.headers.get("Location");Oe(fe,"Expected a Location header on the redirect Response"),fe=qg(fe,new URL(A.url),m,e.history);let ye=so(N.location,fe,{_isRedirect:!0});if(i){let at=!1;if(D.response.headers.has("X-Remix-Reload-Document"))at=!0;else if(xh(fe)){const ot=Ab(fe,!0);at=ot.origin!==a.location.origin||Ln(ot.pathname,m)==null}if(at){ce?a.location.replace(fe):a.location.assign(fe);return}}te=null;let he=ce===!0||D.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:_e,formAction:be,formEncType:Ge}=N.navigation;!ee&&!ae&&_e&&be&&Ge&&(ee=Kg(N.navigation));let De=ee||ae;if(DR.has(D.response.status)&&De&&Xt(De.formMethod))await Xe(he,ye,{submission:{...De,formAction:fe},preventScrollReset:pe||de,enableViewTransition:$?ge:void 0});else{let at=md(ye,ee);await Xe(he,ye,{overrideNavigation:at,fetcherSubmission:ae,preventScrollReset:pe||de,enableViewTransition:$?ge:void 0})}}async function Ma(A,D,$,ee,ae){let pe,ce={};try{pe=await PR(g,A,D,$,ae,ee,!1)}catch(fe){return $.filter(ye=>ye.shouldLoad).forEach(ye=>{ce[ye.route.id]={type:"error",error:fe}}),ce}if(A.signal.aborted)return ce;if(!Xt(A.method))for(let fe of $){if(pe[fe.route.id]?.type==="error")break;!pe.hasOwnProperty(fe.route.id)&&!N.loaderData.hasOwnProperty(fe.route.id)&&(!N.errors||!N.errors.hasOwnProperty(fe.route.id))&&fe.shouldCallHandler()&&(pe[fe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${fe.route.id}`)})}for(let[fe,ye]of Object.entries(pe))if(ez(ye)){let he=ye.result;ce[fe]={type:"redirect",response:KR(he,A,fe,$,m)}}else ce[fe]=await FR(ye);return ce}async function Ji(A,D,$,ee,ae){let pe=Ma($,ee,A,ae,null),ce=Promise.all(D.map(async he=>{if(he.matches&&he.match&&he.request&&he.controller){let be=(await Ma(he.request,he.path,he.matches,ae,he.key))[he.match.route.id];return{[he.key]:be}}else return Promise.resolve({[he.key]:{type:"error",error:Mn(404,{pathname:he.path})}})})),fe=await pe,ye=(await ce).reduce((he,_e)=>Object.assign(he,_e),{});return{loaderResults:fe,fetcherResults:ye}}function Da(){Q=!0,le.forEach((A,D)=>{re.has(D)&&W.add(D),kt(D)})}function $n(A,D,$={}){N.fetchers.set(A,D),ht({fetchers:new Map(N.fetchers)},{flushSync:($&&$.flushSync)===!0})}function _n(A,D,$,ee={}){let ae=dr(N.matches,D);sa(A),ht({errors:{[ae.route.id]:$},fetchers:new Map(N.fetchers)},{flushSync:(ee&&ee.flushSync)===!0})}function Eo(A){return we.set(A,(we.get(A)||0)+1),Re.has(A)&&Re.delete(A),N.fetchers.get(A)||kR}function Hu(A,D){kt(A,D?.reason),$n(A,Aa(null))}function sa(A){let D=N.fetchers.get(A);re.has(A)&&!(D&&D.state==="loading"&&P.has(A))&&kt(A),le.delete(A),P.delete(A),ne.delete(A),Re.delete(A),W.delete(A),N.fetchers.delete(A)}function It(A){let D=(we.get(A)||0)-1;D<=0?(we.delete(A),Re.add(A)):we.set(A,D),ht({fetchers:new Map(N.fetchers)})}function kt(A,D){let $=re.get(A);$&&($.abort(D),re.delete(A))}function Ft(A){for(let D of A){let $=Eo(D),ee=Aa($.data);N.fetchers.set(D,ee)}}function To(){let A=[],D=!1;for(let $ of ne){let ee=N.fetchers.get($);Oe(ee,`Expected fetcher: ${$}`),ee.state==="loading"&&(ne.delete($),A.push($),D=!0)}return Ft(A),D}function Ro(A){let D=[];for(let[$,ee]of P)if(ee0}function Uu(A,D){let $=N.blockers.get(A)||Gl;return oe.get(A)!==D&&oe.set(A,D),$}function xr(A){N.blockers.delete(A),oe.delete(A)}function ua(A,D){let $=N.blockers.get(A)||Gl;Oe($.state==="unblocked"&&D.state==="blocked"||$.state==="blocked"&&D.state==="blocked"||$.state==="blocked"&&D.state==="proceeding"||$.state==="blocked"&&D.state==="unblocked"||$.state==="proceeding"&&D.state==="unblocked",`Invalid blocker state transition: ${$.state} -> ${D.state}`);let ee=new Map(N.blockers);ee.set(A,D),ht({blockers:ee})}function Sr({currentLocation:A,nextLocation:D,historyAction:$}){if(oe.size===0)return;oe.size>1&>(!1,"A router only supports one blocker at a time");let ee=Array.from(oe.entries()),[ae,pe])DELIM" -R"DELIM(=ee[ee.length-1],ce=N.blockers.get(ae);if(!(ce&&ce.state==="proceeding")&&pe({currentLocation:A,nextLocation:D,historyAction:$}))return ae}function Zn(A){let D=Mn(404,{pathname:A}),$=p||h,{matches:ee,route:ae}=Vs($);return{notFoundMatches:ee,route:ae,error:D}}function Kr(A,D,$){if(_=A,z=D,E=$||null,!M&&N.navigation===hd){M=!0;let ee=Ii(N.location,N.matches);ee!=null&&ht({restoreScrollPosition:ee})}return()=>{_=null,z=null,E=null}}function ka(A,D){return E&&E(A,D.map(ee=>oR(ee,N.loaderData)))||A.key}function $u(A,D){if(_&&z){let $=ka(A,D);_[$]=z()}}function Ii(A,D){if(_){let $=ka(A,D),ee=_[$];if(typeof ee=="number")return ee}return null}function La(A,D,$){if(e.patchRoutesOnNavigation)if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:Jl(D,$,m,!0)}}else return{active:!0,matches:Jl(D,$,m,!0)||[]};return{active:!1,matches:null}}async function Vn(A,D,$,ee){if(!e.patchRoutesOnNavigation)return{type:"success",matches:A};let ae=A;for(;;){let pe=p==null,ce=p||h,fe=f;try{await e.patchRoutesOnNavigation({signal:$,path:D,matches:ae,fetcherKey:ee,patch:(_e,be)=>{$.aborted||Bg(_e,be,ce,fe,u,!1)}})}catch(_e){return{type:"error",error:_e,partialMatches:ae}}finally{pe&&!$.aborted&&(h=[...h])}if($.aborted)return{type:"aborted"};let ye=fr(ce,D,m),he=null;if(ye){if(Object.keys(ye[0].params).length===0)return{type:"success",matches:ye};if(he=Jl(ce,D,m,!0),!(he&&ae.length$.route.id===D[ee].route.id)}function Ao(A){f={},p=uo(A,u,void 0,f)}function Co(A,D,$=!1){let ee=p==null;Bg(A,D,p||h,f,u,$),ee&&(h=[...h],ht({}))}return I={get basename(){return m},get future(){return v},get state(){return N},get routes(){return h},get window(){return a},initialize:Gt,subscribe:wn,enableScrollRestoration:Kr,navigate:lt,fetch:Lu,revalidate:Pe,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Eo,resetFetcher:Hu,deleteFetcher:It,dispose:Yt,getBlocker:Uu,deleteBlocker:xr,patchRoutes:Co,_internalFetchControllers:re,_internalSetRoutes:Ao,_internalSetStateDoNotUseOrYouWillBreakYourApp(A){ht(A)}},e.unstable_instrumentations&&(I=RR(I,e.unstable_instrumentations.map(A=>A.router).filter(Boolean))),I}function HR(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Xd(e,a,i,l,s,u){let f,h;if(s){f=[];for(let m of a)if(f.push(m),m.route.id===s){h=m;break}}else f=a,h=a[a.length-1];let p=bo(l||".",Nu(f),Ln(e.pathname,i)||e.pathname,u==="path");if(l==null&&(p.search=e.search,p.hash=e.hash),(l==null||l===""||l===".")&&h){let m=Eh(p.search);if(h.route.index&&!m)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!h.route.index&&m){let g=new URLSearchParams(p.search),v=g.getAll("index");g.delete("index"),v.filter(w=>w).forEach(w=>g.append("index",w));let x=g.toString();p.search=x?`?${x}`:""}}return i!=="/"&&(p.pathname=xR({basename:i,pathname:p.pathname})),ia(p)}function kg(e,a,i){if(!i||!HR(i))return{path:a};if(i.formMethod&&!az(i.formMethod))return{path:a,error:Mn(405,{method:i.formMethod})};let l=()=>({path:a,error:Mn(400,{type:"invalid-body"})}),u=(i.formMethod||"get").toUpperCase(),f=Fb(a);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!Xt(u))return l();let v=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((x,[w,_])=>`${x}${w}=${_} -`,""):String(i.body);return{path:a,submission:{formMethod:u,formAction:f,formEncType:i.formEncType,formData:void 0,json:void 0,text:v}}}else if(i.formEncType==="application/json"){if(!Xt(u))return l();try{let v=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:a,submission:{formMethod:u,formAction:f,formEncType:i.formEncType,formData:void 0,json:v,text:void 0}}}catch{return l()}}}Oe(typeof FormData=="function","FormData is not available in this environment");let h,p;if(i.formData)h=Id(i.formData),p=i.formData;else if(i.body instanceof FormData)h=Id(i.body),p=i.body;else if(i.body instanceof URLSearchParams)h=i.body,p=Qg(h);else if(i.body==null)h=new URLSearchParams,p=new FormData;else try{h=new URLSearchParams(i.body),p=Qg(h)}catch{return l()}let m={formMethod:u,formAction:f,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(Xt(m.formMethod))return{path:a,submission:m};let g=la(a);return e&&g.search&&Eh(g.search)&&h.append("index",""),g.search=`?${h}`,{path:ia(g),submission:m}}function Lg(e,a,i,l,s,u,f,h,p,m,g,v,x,w,_,E,z,M,L,B,Y){let K=B?bn(B[1])?B[1].error:B[1].data:void 0,ie=s.createURL(u.location),I=s.createURL(p),N;if(g&&u.errors){let V=Object.keys(u.errors)[0];N=f.findIndex(O=>O.route.id===V)}else if(B&&bn(B[1])){let V=B[0];N=f.findIndex(O=>O.route.id===V)-1}let se=B?B[1].statusCode:void 0,ue=se&&se>=400,de={currentUrl:ie,currentParams:u.matc)DELIM" -R"DELIM(hes[0]?.params||{},nextUrl:I,nextParams:f[0].params,...h,actionResult:K,actionStatus:se},te=So(f),ge=f.map((V,O)=>{let{route:Q}=V,W=null;if(N!=null&&O>N)W=!1;else if(Q.lazy)W=!0;else if(!wh(Q))W=!1;else if(g){let{shouldLoad:P}=$b(Q,u.loaderData,u.errors);W=P}else UR(u.loaderData,u.matches[O],V)&&(W=!0);if(W!==null)return Jd(i,l,e,p,te,V,m,a,W);let re=!1;typeof Y=="boolean"?re=Y:ue?re=!1:(v||ie.pathname+ie.search===I.pathname+I.search||ie.search!==I.search||$R(u.matches[O],V))&&(re=!0);let xe={...de,defaultShouldRevalidate:re},C=Il(V,xe);return Jd(i,l,e,p,te,V,m,a,C,xe,Y)}),Ne=[];return _.forEach((V,O)=>{if(g||!f.some(le=>le.route.id===V.routeId)||w.has(O))return;let Q=u.fetchers.get(O),W=Q&&Q.state!=="idle"&&Q.data===void 0,re=fr(z,V.path,M);if(!re){if(L&&W)return;Ne.push({key:O,routeId:V.routeId,path:V.path,matches:null,match:null,request:null,controller:null});return}if(E.has(O))return;let xe=lu(re,V.path),C=new AbortController,P=Bi(s,V.path,C.signal),ne=null;if(x.has(O))x.delete(O),ne=Zi(i,l,P,V.path,re,xe,m,a);else if(W)v&&(ne=Zi(i,l,P,V.path,re,xe,m,a));else{let le;typeof Y=="boolean"?le=Y:ue?le=!1:le=v;let we={...de,defaultShouldRevalidate:le};Il(xe,we)&&(ne=Zi(i,l,P,V.path,re,xe,m,a,we))}ne&&Ne.push({key:O,routeId:V.routeId,path:V.path,matches:ne,match:xe,request:P,controller:C})}),{dsMatches:ge,revalidatingFetchers:Ne}}function wh(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function $b(e,a,i){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!wh(e))return{shouldLoad:!1,renderFallback:!1};let l=a!=null&&e.id in a,s=i!=null&&i[e.id]!==void 0;if(!l&&s)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!l};let u=!l&&!s;return{shouldLoad:u,renderFallback:u}}function UR(e,a,i){let l=!a||i.route.id!==a.route.id,s=!e.hasOwnProperty(i.route.id);return l||s}function $R(e,a){let i=e.route.path;return e.pathname!==a.pathname||i!=null&&i.endsWith("*")&&e.params["*"]!==a.params["*"]}function Il(e,a){if(e.route.shouldRevalidate){let i=e.route.shouldRevalidate(a);if(typeof i=="boolean")return i}return a.defaultShouldRevalidate}function Bg(e,a,i,l,s,u){let f;if(e){let m=l[e];Oe(m,`No route found to patch children into: routeId = ${e}`),m.children||(m.children=[]),f=m.children}else f=i;let h=[],p=[];if(a.forEach(m=>{let g=f.find(v=>Zb(m,v));g?p.push({existingRoute:g,newRoute:m}):h.push(m)}),h.length>0){let m=uo(h,s,[e||"_","patch",String(f?.length||"0")],l);f.push(...m)}if(u&&p.length>0)for(let m=0;ma.children?.some(s=>Zb(i,s)))??!1:!1}var Hg=new WeakMap,qb=({key:e,route:a,manifest:i,mapRouteProperties:l})=>{let s=i[a.id];if(Oe(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let u=s.lazy[e];if(!u)return;let f=Hg.get(s);f||(f={},Hg.set(s,f));let h=f[e];if(h)return h;let p=(async()=>{let m=aR(e),v=s[e]!==void 0&&e!=="hasErrorBoundary";if(m)gt(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),f[e]=Promise.resolve();else if(v)gt(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await u();x!=null&&(Object.assign(s,{[e]:x}),Object.assign(s,l(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(x=>x===void 0)&&(s.lazy=void 0))})();return f[e]=p,p},Ug=new WeakMap;function ZR(e,a,i,l,s){let u=i[e.id];if(Oe(u,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let g=Ug.get(u);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let v=(async()=>{Oe(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),w={};for(let _ in x){let E=x[_];if(E===void 0)continue;let z=iR(_),L=u[_]!==void 0&&_!=="hasErrorBoundary";z?gt(!z,"Route property "+_+" is not a supported property to be returned from a lazy route function. This property will be ignored."):L?gt(!L,`Route "${u.id}" has a static property "${_}" defined but its lazy function is also returning a value for this property. The lazy route property "${_}" will be ignored.`):w[_]=E}Object.assign(u,w),Object.assign(u,{...l(u),lazy:void 0})})();return Ug.set(u,v),v.catch(()=>{}),{lazyRoutePromise:v,lazyHandlerPromise:v}}let f=Object.keys(e.lazy),h=[],p;for(let g of f){if(s&&s.includes(g))continue;let v=qb({key:g,route:e,manifest:i,mapRouteProperties:l});v&&(h.push(v),g===a&&(p=v))}let m=h.length>0?Promise.all(h).then(()=>{}):voi)DELIM" -R"DELIM(d 0;return m?.catch(()=>{}),p?.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:p}}async function $g(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 qR(e){return e.matches.some(a=>a.route.middleware)?Qb(e,()=>$g(e)):$g(e)}function Qb(e,a){return QR(e,a,l=>{if(nz(l))throw l;return l},IR,i);function i(l,s,u){if(u)return Promise.resolve(Object.assign(u.value,{[s]:{type:"error",result:l}}));{let{matches:f}=e,h=Math.min(Math.max(f.findIndex(m=>m.route.id===s),0),Math.max(f.findIndex(m=>m.shouldCallHandler()),0)),p=dr(f,f[h].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:l}})}}}async function QR(e,a,i,l,s){let{matches:u,...f}=e,h=u.flatMap(m=>m.route.middleware?m.route.middleware.map(g=>[m.route.id,g]):[]);return await Pb(f,h,a,i,l,s)}async function Pb(e,a,i,l,s,u,f=0){let{request:h}=e;if(h.signal.aborted)throw h.signal.reason??new Error(`Request aborted: ${h.method} ${h.url}`);let p=a[f];if(!p)return await i();let[m,g]=p,v,x=async()=>{if(v)throw new Error("You may only call `next()` once per middleware");try{return v={value:await Pb(e,a,i,l,s,u,f+1)},v.value}catch(w){return v={value:await u(w,m,v)},v.value}};try{let w=await g(e,x),_=w!=null?l(w):void 0;return s(_)?_:v?_??v.value:(v={value:await x()},v.value)}catch(w){return await u(w,m,v)}}function Gb(e,a,i,l,s){let u=qb({key:"middleware",route:l.route,manifest:a,mapRouteProperties:e}),f=ZR(l.route,Xt(i.method)?"action":"loader",a,e,s);return{middleware:u,route:f.lazyRoutePromise,handler:f.lazyHandlerPromise}}function Jd(e,a,i,l,s,u,f,h,p,m=null,g){let v=!1,x=Gb(e,a,i,u,f);return{...u,_lazyPromises:x,shouldLoad:p,shouldRevalidateArgs:m,shouldCallHandler(w){return v=!0,m?typeof g=="boolean"?Il(u,{...m,defaultShouldRevalidate:g}):typeof w=="boolean"?Il(u,{...m,defaultShouldRevalidate:w}):Il(u,m):p},resolve(w){let{lazy:_,loader:E,middleware:z}=u.route,M=v||p||w&&!Xt(i.method)&&(_||E),L=z&&z.length>0&&!E&&!_;return M&&(Xt(i.method)||!L)?GR({request:i,path:l,unstable_pattern:s,match:u,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:w,scopedContext:h}):Promise.resolve({type:"data",result:void 0})}}}function Zi(e,a,i,l,s,u,f,h,p=null){return s.map(m=>m.route.id!==u.route.id?{...m,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:Gb(e,a,i,m,f),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Jd(e,a,i,l,So(s),m,f,h,!0,p))}async function PR(e,a,i,l,s,u,f){l.some(g=>g._lazyPromises?.middleware)&&await Promise.all(l.map(g=>g._lazyPromises?.middleware));let h={request:a,unstable_url:Yb(a,i),unstable_pattern:So(l),params:l[0].params,context:u,matches:l},m=await e({...h,fetcherKey:s,runClientMiddleware:g=>{let v=h;return Qb(v,()=>g({...v,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(l.flatMap(g=>[g._lazyPromises?.handler,g._lazyPromises?.route]))}catch{}return m}async function GR({request:e,path:a,unstable_pattern:i,match:l,lazyHandlerPromise:s,lazyRoutePromise:u,handlerOverride:f,scopedContext:h}){let p,m,g=Xt(e.method),v=g?"action":"loader",x=w=>{let _,E=new Promise((L,B)=>_=B);m=()=>_(),e.signal.addEventListener("abort",m);let z=L=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${v}" [routeId: ${l.route.id}]`)):w({request:e,unstable_url:Yb(e,a),unstable_pattern:i,params:l.params,context:h},...L!==void 0?[L]:[]),M=(async()=>{try{return{type:"data",result:await(f?f(B=>z(B)):z())}}catch(L){return{type:"error",result:L}}})();return Promise.race([M,E])};try{let w=g?l.route.action:l.route.loader;if(s||u)if(w){let _,[E]=await Promise.all([x(w).catch(z=>{_=z}),s,u]);if(_!==void 0)throw _;p=E}else{await s;let _=g?l.route.action:l.route.loader;if(_)[p]=await Promise.all([x(_),u]);else if(v==="action"){let E=new URL(e.url),z=E.pathname+E.search;throw Mn(405,{method:e.method,pathname:z,routeId:l.route.id})}else return{type:"data",result:void 0}}else if(w)p=await x(w);else{let _=new URL(e.url),E=_.pathname+_.search;throw Mn(404,{pathname:E})}}catch(w){return{type:"error",result:w}}finally{m&&e.signal.removeEventListener("abort",m)}return p}async function YR(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 FR(e){let{result:a,type:i}=e;if(_h(a)){let l;try{l=await YR(a)}catch(s){return{type:"error",error:s}}return i==="error"?{type:"error",error:new xo(a.status,a.statusText,l),statusCode:a.status,headers:a.headers}:{type:"data",data:l,statusCode:a.status,headers:a.headers}}return i==="error"?Fg(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:JR(a),statusCode:co(a)?a.status:void 0,headers:a.init?.headers?new Headers(a.init.headers):v)DELIM" -R"DELIM(oid 0}:{type:"error",error:a,statusCode:co(a)?a.status:void 0}:Fg(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 KR(e,a,i,l,s){let u=e.headers.get("Location");if(Oe(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!xh(u)){let f=l.slice(0,l.findIndex(h=>h.route.id===i)+1);u=Xd(new URL(a.url),f,s,u),e.headers.set("Location",u)}return e}var Zg=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function qg(e,a,i,l){if(xh(e)){let s=e,u=s.startsWith("//")?new URL(a.protocol+s):new URL(s);if(Zg.includes(u.protocol))throw new Error("Invalid redirect location");let f=Ln(u.pathname,i)!=null;if(u.origin===a.origin&&f)return Sh(u.pathname)+u.search+u.hash}try{let s=l.createURL(e);if(Zg.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Bi(e,a,i,l){let s=e.createURL(Fb(a)).toString(),u={signal:i};if(l&&Xt(l.formMethod)){let{formMethod:f,formEncType:h}=l;u.method=f.toUpperCase(),h==="application/json"?(u.headers=new Headers({"Content-Type":h}),u.body=JSON.stringify(l.json)):h==="text/plain"?u.body=l.text:h==="application/x-www-form-urlencoded"&&l.formData?u.body=Id(l.formData):u.body=l.formData}return new Request(s,u)}function Yb(e,a){let i=new URL(e.url),l=typeof a=="string"?la(a):a;if(i.pathname=l.pathname||"/",l.search){let s=new URLSearchParams(l.search),u=s.getAll("index");s.delete("index");for(let f of u.filter(Boolean))s.append("index",f);i.search=s.size?`?${s.toString()}`:""}else i.search="";return i.hash=l.hash||"",i}function Id(e){let a=new URLSearchParams;for(let[i,l]of e.entries())a.append(i,typeof l=="string"?l:l.name);return a}function Qg(e){let a=new FormData;for(let[i,l]of e.entries())a.append(i,l);return a}function VR(e,a,i,l=!1,s=!1){let u={},f=null,h,p=!1,m={},g=i&&bn(i[1])?i[1].error:void 0;return e.forEach(v=>{if(!(v.route.id in a))return;let x=v.route.id,w=a[x];if(Oe(!qr(w),"Cannot handle redirect results in processLoaderData"),bn(w)){let _=w.error;if(g!==void 0&&(_=g,g=void 0),f=f||{},s)f[x]=_;else{let E=dr(e,x);f[E.route.id]==null&&(f[E.route.id]=_)}l||(u[x]=Ub),p||(p=!0,h=co(w.error)?w.error.status:500),w.headers&&(m[x]=w.headers)}else u[x]=w.data,w.statusCode&&w.statusCode!==200&&!p&&(h=w.statusCode),w.headers&&(m[x]=w.headers)}),g!==void 0&&i&&(f={[i[0]]:g},i[2]&&(u[i[2]]=void 0)),{loaderData:u,errors:f,statusCode:h||200,loaderHeaders:m}}function Pg(e,a,i,l,s,u){let{loaderData:f,errors:h}=VR(a,i,l);return s.filter(p=>!p.matches||p.matches.some(m=>m.shouldLoad)).forEach(p=>{let{key:m,match:g,controller:v}=p;if(v&&v.signal.aborted)return;let x=u[m];if(Oe(x,"Did not find corresponding fetcher result"),bn(x)){let w=dr(e.matches,g?.route.id);h&&h[w.route.id]||(h={...h,[w.route.id]:x.error}),e.fetchers.delete(m)}else if(qr(x))Oe(!1,"Unhandled fetcher revalidation redirect");else{let w=Aa(x.data);e.fetchers.set(m,w)}}),{loaderData:f,errors:h}}function Gg(e,a,i,l){let s=Object.entries(a).filter(([,u])=>u!==Ub).reduce((u,[f,h])=>(u[f]=h,u),{});for(let u of i){let f=u.route.id;if(!a.hasOwnProperty(f)&&e.hasOwnProperty(f)&&u.route.loader&&(s[f]=e[f]),l&&l.hasOwnProperty(f))break}return s}function Yg(e){return e?bn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function dr(e,a){return(a?e.slice(0,e.findIndex(l=>l.route.id===a)+1):[...e]).reverse().find(l=>l.route.hasErrorBoundary===!0)||e[0]}function Vs(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 Mn(e,{pathname:a,routeId:i,method:l,type:s,message:u}={}){let f="Unknown Server Error",h="Unknown @remix-run/router error";return e===400?(f="Bad Request",l&&a&&i?h=`You made a ${l} request to "${a}" but did not provide a \`loader\` for route "${i}", so there is no way to handle the request.`:s==="invalid-body"&&(h="Unable to encode submission body")):e===403?(f="Forbidden",h=`Route "${i}" does not match URL "${a}"`):e===404?(f="Not Found",h=`No route matches URL "${a}"`):e===405&&(f="Method Not Allowed",l&&a&&i?h=`You made a ${l.toUpperCase()} request to "${a}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:l&&(h=`Invalid request method "${l.toUpperCase()}"`)),new xo(e||500,f,new Error(h),!0)}function Xs(e){let a=Object.entries(e);for(let i=a.length-1;i>=0;i--){let[l,s]=a[i];if(qr(s))return{key:l,result:s}}}function Fb(e){let a=typeof e=="string"?la(e):e;return ia({...a,hash:""})}function XR(e,a){return e.pathname!==a.pathname||e.search!==a.search?!1:e.hash===""?a.hash!=="":e.hash===a.hash?!0:a.hash!==""}function JR(e){return new xo(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function IR(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([a,i])=>typeof a=="string"&&WR(i))}function WR(e){return e!=null&&)DELIM" -R"DELIM(typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function ez(e){return _h(e.result)&&Bb.has(e.result.status)}function bn(e){return e.type==="error"}function qr(e){return(e&&e.type)==="redirect"}function Fg(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function _h(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function tz(e){return Bb.has(e)}function nz(e){return _h(e)&&tz(e.status)&&e.headers.has("Location")}function az(e){return MR.has(e.toUpperCase())}function Xt(e){return jR.has(e.toUpperCase())}function Eh(e){return new URLSearchParams(e).getAll("index").some(a=>a==="")}function lu(e,a){let i=typeof a=="string"?la(a).search:a.search;if(e[e.length-1].route.index&&Eh(i||""))return e[e.length-1];let l=Nb(e);return l[l.length-1]}function Kg(e){let{formMethod:a,formAction:i,formEncType:l,text:s,formData:u,json:f}=e;if(!(!a||!i||!l)){if(s!=null)return{formMethod:a,formAction:i,formEncType:l,formData:void 0,json:void 0,text:s};if(u!=null)return{formMethod:a,formAction:i,formEncType:l,formData:u,json:void 0,text:void 0};if(f!==void 0)return{formMethod:a,formAction:i,formEncType:l,formData:void 0,json:f,text:void 0}}}function md(e,a){return a?{state:"loading",location:e,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function rz(e,a){return{state:"submitting",location:e,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}}function Yl(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 iz(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 Aa(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 lz(e,a){try{let i=e.sessionStorage.getItem(Hb);if(i){let l=JSON.parse(i);for(let[s,u]of Object.entries(l||{}))u&&Array.isArray(u)&&a.set(s,new Set(u||[]))}}catch{}}function oz(e,a){if(a.size>0){let i={};for(let[l,s]of a)i[l]=[...s];try{e.sessionStorage.setItem(Hb,JSON.stringify(i))}catch(l){gt(!1,`Failed to save applied view transitions in sessionStorage (${l}).`)}}}function Vg(){let e,a,i=new Promise((l,s)=>{e=async u=>{l(u);try{await i}catch{}},a=async u=>{s(u);try{await i}catch{}}});return{promise:i,resolve:e,reject:a}}var Fr=T.createContext(null);Fr.displayName="DataRouter";var wo=T.createContext(null);wo.displayName="DataRouterState";var Kb=T.createContext(!1);function Vb(){return T.useContext(Kb)}var Th=T.createContext({isTransitioning:!1});Th.displayName="ViewTransition";var Xb=T.createContext(new Map);Xb.displayName="Fetchers";var sz=T.createContext(null);sz.displayName="Await";var xn=T.createContext(null);xn.displayName="Navigation";var Mu=T.createContext(null);Mu.displayName="Location";var Hn=T.createContext({outlet:null,matches:[],isDataRoute:!1});Hn.displayName="Route";var Rh=T.createContext(null);Rh.displayName="RouteError";var Jb="REACT_ROUTER_ERROR",uz="REDIRECT",cz="ROUTE_ERROR_RESPONSE";function fz(e){if(e.startsWith(`${Jb}:${uz}:{`))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 dz(e){if(e.startsWith(`${Jb}:${cz}:{`))try{let a=JSON.parse(e.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new xo(a.status,a.statusText,a.data)}catch{}}function hz(e,{relative:a}={}){Oe(Ki(),"useHref() may be used only in the context of a component.");let{basename:i,navigator:l}=T.useContext(xn),{hash:s,pathname:u,search:f}=_o(e,{relative:a}),h=u;return i!=="/"&&(h=u==="/"?i:kn([i,u])),l.createHref({pathname:h,search:f,hash:s})}function Ki(){return T.useContext(Mu)!=null}function Sn(){return Oe(Ki(),"useLocation() may be used only in the context of a component."),T.useContext(Mu).location}var Ib="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Wb(e){T.useContext(xn).static||T.useLayoutEffect(e)}function ja(){let{isDataRoute:e}=T.useContext(Hn);return e?zz():mz()}function mz(){Oe(Ki(),"useNavigate() may be used only in the context of a component.");let e=T.useContext(Fr),{basename:a,navigator:i}=T.useContext(xn),{matches:l}=T.useContext(Hn),{pathname:)DELIM" -R"DELIM(s}=Sn(),u=JSON.stringify(Nu(l)),f=T.useRef(!1);return Wb(()=>{f.current=!0}),T.useCallback((p,m={})=>{if(gt(f.current,Ib),!f.current)return;if(typeof p=="number"){i.go(p);return}let g=bo(p,JSON.parse(u),s,m.relative==="path");e==null&&a!=="/"&&(g.pathname=g.pathname==="/"?a:kn([a,g.pathname])),(m.replace?i.replace:i.push)(g,m.state,m)},[a,i,u,s,e])}var pz=T.createContext(null);function yz(e){let a=T.useContext(Hn).outlet;return T.useMemo(()=>a&&T.createElement(pz.Provider,{value:e},a),[a,e])}function zh(){let{matches:e}=T.useContext(Hn),a=e[e.length-1];return a?a.params:{}}function _o(e,{relative:a}={}){let{matches:i}=T.useContext(Hn),{pathname:l}=Sn(),s=JSON.stringify(Nu(i));return T.useMemo(()=>bo(e,JSON.parse(s),l,a==="path"),[e,s,l,a])}function vz(e,a,i){Oe(Ki(),"useRoutes() may be used only in the context of a component.");let{navigator:l}=T.useContext(xn),{matches:s}=T.useContext(Hn),u=s[s.length-1],f=u?u.params:{},h=u?u.pathname:"/",p=u?u.pathnameBase:"/",m=u&&u.route;{let z=m&&m.path||"";nx(h,!m||z.endsWith("*")||z.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${h}" (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 f of e.seen.entries()){const h=f[1];if(a===f[0]){u(f);continue}if(e.external){const m=e.external.registry.get(f[0])?.id;if(a!==f[0]&&m){u(f);continue}}if(e.metadataRegistry.get(f[0])?.id){u(f);continue}if(h.cycle){u(f);continue}if(h.count>1&&e.reused==="ref"){u(f);continue}}}function ib(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=f=>{const h=e.seen.get(f);if(h.ref===null)return;const p=h.def??h.schema,m={...p},b=h.ref;if(h.ref=null,b){l(b);const x=e.seen.get(b),w=x.schema;if(w.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(w)):Object.assign(p,w),Object.assign(p,m),f._zod.parent===b)for(const E in p)E==="$ref"||E==="allOf"||E in m||delete p[E];if(w.$ref&&x.def)for(const E in p)E==="$ref"||E==="allOf"||E in x.def&&JSON.stringify(p[E])===JSON.stringify(x.def[E])&&delete p[E]}const v=f._zod.parent;if(v&&v!==b){l(v);const x=e.seen.get(v);if(x?.schema.$ref&&(p.$ref=x.schema.$ref,x.def))for(const w in p)w==="$ref"||w==="allOf"||w in x.def&&JSON.stringify(p[w])===JSON.stringify(x.def[w])&&delete p[w]}e.override({zodSchema:f,jsonSchema:p,path:h.path??[]})};for(const f of[...e.seen.entries()].reverse())l(f[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 f=e.external.registry.get(a)?.id;if(!f)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(f)}Object.assign(s,i.def??i.schema);const u=e.external?.defs??{};for(const f of e.seen.entries()){const h=f[1];h.def&&h.defId&&(u[h.defId]=h.def)}e.externa)DELIM" +R"DELIM(l||Object.keys(u).length>0&&(e.target==="draft-2020-12"?s.$defs=u:s.definitions=u);try{const f=JSON.parse(JSON.stringify(s));return Object.defineProperty(f,"~standard",{value:{...a["~standard"],jsonSchema:{input:gu(a,"input",e.processors),output:gu(a,"output",e.processors)}},enumerable:!1,writable:!1}),f}catch{throw new Error("Error converting schema to JSON.")}}function en(e,a){const i=a??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const l=e._zod.def;if(l.type==="transform")return!0;if(l.type==="array")return en(l.element,i);if(l.type==="set")return en(l.valueType,i);if(l.type==="lazy")return en(l.getter(),i);if(l.type==="promise"||l.type==="optional"||l.type==="nonoptional"||l.type==="nullable"||l.type==="readonly"||l.type==="default"||l.type==="prefault")return en(l.innerType,i);if(l.type==="intersection")return en(l.left,i)||en(l.right,i);if(l.type==="record"||l.type==="map")return en(l.keyType,i)||en(l.valueType,i);if(l.type==="pipe")return en(l.in,i)||en(l.out,i);if(l.type==="object"){for(const s in l.shape)if(en(l.shape[s],i))return!0;return!1}if(l.type==="union"){for(const s of l.options)if(en(s,i))return!0;return!1}if(l.type==="tuple"){for(const s of l.items)if(en(s,i))return!0;return!!(l.rest&&en(l.rest,i))}return!1}const AE=(e,a={})=>i=>{const l=ab({...i,processors:a});return Pt(e,l),rb(l,e),ib(l,e)},gu=(e,a,i={})=>l=>{const{libraryOptions:s,target:u}=l??{},f=ab({...s??{},target:u,io:a,processors:i});return Pt(e,f),rb(f,e),ib(f,e)},CE={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},jE=(e,a,i,l)=>{const s=i;s.type="string";const{minimum:u,maximum:f,format:h,patterns:p,contentEncoding:m}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof f=="number"&&(s.maxLength=f),h&&(s.format=CE[h]??h,s.format===""&&delete s.format,h==="time"&&delete s.format),m&&(s.contentEncoding=m),p&&p.size>0){const b=[...p];b.length===1?s.pattern=b[0].source:b.length>1&&(s.allOf=[...b.map(v=>({...a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},NE=(e,a,i,l)=>{const s=i,{minimum:u,maximum:f,format:h,multipleOf:p,exclusiveMaximum:m,exclusiveMinimum:b}=e._zod.bag;typeof h=="string"&&h.includes("int")?s.type="integer":s.type="number",typeof b=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(s.minimum=b,s.exclusiveMinimum=!0):s.exclusiveMinimum=b),typeof u=="number"&&(s.minimum=u,typeof b=="number"&&a.target!=="draft-04"&&(b>=u?delete s.minimum:delete s.exclusiveMinimum)),typeof m=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(s.maximum=m,s.exclusiveMaximum=!0):s.exclusiveMaximum=m),typeof f=="number"&&(s.maximum=f,typeof m=="number"&&a.target!=="draft-04"&&(m<=f?delete s.maximum:delete s.exclusiveMaximum)),typeof p=="number"&&(s.multipleOf=p)},OE=(e,a,i,l)=>{i.type="boolean"},ME=(e,a,i,l)=>{i.not={}},DE=(e,a,i,l)=>{},kE=(e,a,i,l)=>{const s=e._zod.def,u=B0(s.entries);u.every(f=>typeof f=="number")&&(i.type="number"),u.every(f=>typeof f=="string")&&(i.type="string"),i.enum=u},LE=(e,a,i,l)=>{if(a.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},BE=(e,a,i,l)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},HE=(e,a,i,l)=>{const s=i,u=e._zod.def,{minimum:f,maximum:h}=e._zod.bag;typeof f=="number"&&(s.minItems=f),typeof h=="number"&&(s.maxItems=h),s.type="array",s.items=Pt(u.element,a,{...l,path:[...l.path,"items"]})},UE=(e,a,i,l)=>{const s=i,u=e._zod.def;s.type="object",s.properties={};const f=u.shape;for(const m in f)s.properties[m]=Pt(f[m],a,{...l,path:[...l.path,"properties",m]});const h=new Set(Object.keys(f)),p=new Set([...h].filter(m=>{const b=u.shape[m]._zod;return a.io==="input"?b.optin===void 0:b.optout===void 0}));p.size>0&&(s.required=Array.from(p)),u.catchall?._zod.def.type==="never"?s.additionalProperties=!1:u.catchall?u.catchall&&(s.additionalProperties=Pt(u.catchall,a,{...l,path:[...l.path,"additionalProperties"]})):a.io==="output"&&(s.additionalProperties=!1)},$E=(e,a,i,l)=>{const s=e._zod.def,u=s.inclusive===!1,f=s.options.map((h,p)=>Pt(h,a,{...l,path:[...l.path,u?"oneOf":"anyOf",p]}));u?i.oneOf=f:i.anyOf=f},ZE=(e,a,i,l)=>{const s=e._zod.def,u=Pt(s.left,a,{...l,path:[...l.path,"allOf",0]}),f=Pt(s.right,a,{...l,path:[...l.path,"allOf",1]}),h=m=>"allOf"in m&&Object.keys(m).length===1,p=[...h(u)?u.allOf:[u],...h(f)?f.allOf:[f]];i.allOf=p},qE=(e,a,i,l)=>{const s=e._zod.def,u=Pt(s.innerType,a,l),f=a.seen.get(e);a.target==="openapi-3.0"?(f.ref=s.innerType,i.nullable=!0):i.anyOf=[u,{type:"null"}]},QE=(e,a,i,l)=>{const s=e._zod.def;Pt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType},PE=(e,a,i,l)=>{const s=e._zod.def;Pt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,i.default=JSON.parse(JSON.stringify(s.defaultValue))},GE=(e,a,i,l)=>{const s=e._zod.def;Pt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,a.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(s.defau)DELIM" +R"DELIM(ltValue)))},YE=(e,a,i,l)=>{const s=e._zod.def;Pt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType;let f;try{f=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=f},FE=(e,a,i,l)=>{const s=e._zod.def,u=a.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Pt(u,a,l);const f=a.seen.get(e);f.ref=u},KE=(e,a,i,l)=>{const s=e._zod.def;Pt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,i.readOnly=!0},lb=(e,a,i,l)=>{const s=e._zod.def;Pt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType},VE=J("ZodISODateTime",(e,a)=>{e_.init(e,a),pt.init(e,a)});function XE(e){return rE(VE,e)}const JE=J("ZodISODate",(e,a)=>{t_.init(e,a),pt.init(e,a)});function IE(e){return iE(JE,e)}const WE=J("ZodISOTime",(e,a)=>{n_.init(e,a),pt.init(e,a)});function e4(e){return lE(WE,e)}const t4=J("ZodISODuration",(e,a)=>{a_.init(e,a),pt.init(e,a)});function n4(e){return oE(t4,e)}const a4=(e,a)=>{q0.init(e,a),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>Yw(e,i)},flatten:{value:i=>Gw(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,Pd,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,Pd,2)}},isEmpty:{get(){return e.issues.length===0}}})},Bn=J("ZodError",a4,{Parent:Error}),r4=dh(Bn),i4=hh(Bn),l4=ju(Bn),o4=Nu(Bn),s4=Vw(Bn),u4=Xw(Bn),c4=Jw(Bn),f4=Iw(Bn),d4=Ww(Bn),h4=e2(Bn),m4=t2(Bn),p4=n2(Bn),Et=J("ZodType",(e,a)=>(_t.init(e,a),Object.assign(e["~standard"],{jsonSchema:{input:gu(e,"input"),output:gu(e,"output")}}),e.toJSONSchema=AE(e,{}),e.def=a,e.type=a.type,Object.defineProperty(e,"_def",{value:a}),e.check=(...i)=>e.clone(yr(a,{checks:[...a.checks??[],...i.map(l=>typeof l=="function"?{_zod:{check:l,def:{check:"custom"},onattach:[]}}:l)]}),{parent:!0}),e.with=e.check,e.clone=(i,l)=>vr(e,i,l),e.brand=()=>e,e.register=((i,l)=>(i.add(e,l),e)),e.parse=(i,l)=>r4(e,i,l,{callee:e.parse}),e.safeParse=(i,l)=>l4(e,i,l),e.parseAsync=async(i,l)=>i4(e,i,l,{callee:e.parseAsync}),e.safeParseAsync=async(i,l)=>o4(e,i,l),e.spa=e.safeParseAsync,e.encode=(i,l)=>s4(e,i,l),e.decode=(i,l)=>u4(e,i,l),e.encodeAsync=async(i,l)=>c4(e,i,l),e.decodeAsync=async(i,l)=>f4(e,i,l),e.safeEncode=(i,l)=>d4(e,i,l),e.safeDecode=(i,l)=>h4(e,i,l),e.safeEncodeAsync=async(i,l)=>m4(e,i,l),e.safeDecodeAsync=async(i,l)=>p4(e,i,l),e.refine=(i,l)=>e.check(sT(i,l)),e.superRefine=i=>e.check(uT(i)),e.overwrite=i=>e.check(Fi(i)),e.optional=()=>fg(e),e.exactOptional=()=>V4(e),e.nullable=()=>dg(e),e.nullish=()=>fg(dg(e)),e.nonoptional=i=>tT(e,i),e.array=()=>Gi(e),e.or=i=>q4([e,i]),e.and=i=>P4(e,i),e.transform=i=>hg(e,F4(i)),e.default=i=>I4(e,i),e.prefault=i=>eT(e,i),e.catch=i=>aT(e,i),e.pipe=i=>hg(e,i),e.readonly=()=>lT(e),e.describe=i=>{const l=e.clone();return Xl.add(l,{description:i}),l},Object.defineProperty(e,"description",{get(){return Xl.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return Xl.get(e);const l=e.clone();return Xl.add(l,i[0]),l},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),ob=J("_ZodString",(e,a)=>{mh.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(l,s,u)=>jE(e,l,s);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...l)=>e.check(hE(...l)),e.includes=(...l)=>e.check(yE(...l)),e.startsWith=(...l)=>e.check(vE(...l)),e.endsWith=(...l)=>e.check(gE(...l)),e.min=(...l)=>e.check(vu(...l)),e.max=(...l)=>e.check(tb(...l)),e.length=(...l)=>e.check(nb(...l)),e.nonempty=(...l)=>e.check(vu(1,...l)),e.lowercase=l=>e.check(mE(l)),e.uppercase=l=>e.check(pE(l)),e.trim=()=>e.check(xE()),e.normalize=(...l)=>e.check(bE(...l)),e.toLowerCase=()=>e.check(SE()),e.toUpperCase=()=>e.check(wE()),e.slugify=()=>e.check(_E())}),y4=J("ZodString",(e,a)=>{mh.init(e,a),ob.init(e,a),e.email=i=>e.check(B_(v4,i)),e.url=i=>e.check(q_(g4,i)),e.jwt=i=>e.check(aE(M4,i)),e.emoji=i=>e.check(Q_(b4,i)),e.guid=i=>e.check(rg(sg,i)),e.uuid=i=>e.check(H_(Ys,i)),e.uuidv4=i=>e.check(U_(Ys,i)),e.uuidv6=i=>e.check($_(Ys,i)),e.uuidv7=i=>e.check(Z_(Ys,i)),e.nanoid=i=>e.check(P_(x4,i)),e.guid=i=>e.check(rg(sg,i)),e.cuid=i=>e.check(G_(S4,i)),e.cuid2=i=>e.check(Y_(w4,i)),e.ulid=i=>e.check(F_(_4,i)),e.base64=i=>e.check(eE(j4,i)),e.base64url=i=>e.check(tE(N4,i)),e.xid=i=>e.check(K_(E4,i)),e.ksuid=i=>e.check(V_(T4,i)),e.ipv4=i=>e.check(X_(R4,i)),e.ipv6=i=>e.check(J_(z4,i)),e.cidrv4=i=>e.check(I_(A4,i)),e.cidrv6=i=>e.check(W_(C4,i)),e.e164=i=>e.check(nE(O4,i)),e.datetime=i=>e.check(XE(i)),e.date=i=>e.check(IE(i)),e.time=i=>e.check(e4(i)),e.duration=i=>e.check(n4(i))});function Mt(e){return L_(y4,e)}const pt=J("ZodStringFormat",(e,a)=>{dt.init(e,a),ob.init(e,a)}),v4=J("ZodEmail",(e,a)=>{G2.init(e,a),pt.init(e,a)}),sg=J("ZodGUID",(e,a)=>{Q2.init(e,a),pt.init(e,a)}),Ys=J("ZodUUID",(e,a)=>{P2.init(e,a),pt.init(e,a)}),g4=J("ZodURL",(e,a)=>{Y2.init(e,a),pt.init(e,a)}),b4=J("ZodEmoji",(e,a)=>{F2.init(e,a),pt.init(e,a)}),x4=J("ZodNanoID",(e,a)=>{)DELIM" +R"DELIM(K2.init(e,a),pt.init(e,a)}),S4=J("ZodCUID",(e,a)=>{V2.init(e,a),pt.init(e,a)}),w4=J("ZodCUID2",(e,a)=>{X2.init(e,a),pt.init(e,a)}),_4=J("ZodULID",(e,a)=>{J2.init(e,a),pt.init(e,a)}),E4=J("ZodXID",(e,a)=>{I2.init(e,a),pt.init(e,a)}),T4=J("ZodKSUID",(e,a)=>{W2.init(e,a),pt.init(e,a)}),R4=J("ZodIPv4",(e,a)=>{r_.init(e,a),pt.init(e,a)}),z4=J("ZodIPv6",(e,a)=>{i_.init(e,a),pt.init(e,a)}),A4=J("ZodCIDRv4",(e,a)=>{l_.init(e,a),pt.init(e,a)}),C4=J("ZodCIDRv6",(e,a)=>{o_.init(e,a),pt.init(e,a)}),j4=J("ZodBase64",(e,a)=>{s_.init(e,a),pt.init(e,a)}),N4=J("ZodBase64URL",(e,a)=>{c_.init(e,a),pt.init(e,a)}),O4=J("ZodE164",(e,a)=>{f_.init(e,a),pt.init(e,a)}),M4=J("ZodJWT",(e,a)=>{h_.init(e,a),pt.init(e,a)}),sb=J("ZodNumber",(e,a)=>{J0.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(l,s,u)=>NE(e,l,s),e.gt=(l,s)=>e.check(lg(l,s)),e.gte=(l,s)=>e.check(ad(l,s)),e.min=(l,s)=>e.check(ad(l,s)),e.lt=(l,s)=>e.check(ig(l,s)),e.lte=(l,s)=>e.check(nd(l,s)),e.max=(l,s)=>e.check(nd(l,s)),e.int=l=>e.check(ug(l)),e.safe=l=>e.check(ug(l)),e.positive=l=>e.check(lg(0,l)),e.nonnegative=l=>e.check(ad(0,l)),e.negative=l=>e.check(ig(0,l)),e.nonpositive=l=>e.check(nd(0,l)),e.multipleOf=(l,s)=>e.check(og(l,s)),e.step=(l,s)=>e.check(og(l,s)),e.finite=()=>e;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 Qe(e){return sE(sb,e)}const D4=J("ZodNumberFormat",(e,a)=>{m_.init(e,a),sb.init(e,a)});function ug(e){return uE(D4,e)}const k4=J("ZodBoolean",(e,a)=>{p_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>OE(e,i,l)});function ph(e){return cE(k4,e)}const L4=J("ZodUnknown",(e,a)=>{y_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>DE()});function cg(){return fE(L4)}const B4=J("ZodNever",(e,a)=>{v_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>ME(e,i,l)});function H4(e){return dE(B4,e)}const U4=J("ZodArray",(e,a)=>{g_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>HE(e,i,l,s),e.element=a.element,e.min=(i,l)=>e.check(vu(i,l)),e.nonempty=i=>e.check(vu(1,i)),e.max=(i,l)=>e.check(tb(i,l)),e.length=(i,l)=>e.check(nb(i,l)),e.unwrap=()=>e.element});function Gi(e,a){return EE(U4,e,a)}const $4=J("ZodObject",(e,a)=>{x_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>UE(e,i,l,s),We(e,"shape",()=>a.shape),e.keyof=()=>G4(Object.keys(e._zod.def.shape)),e.catchall=i=>e.clone({...e._zod.def,catchall:i}),e.passthrough=()=>e.clone({...e._zod.def,catchall:cg()}),e.loose=()=>e.clone({...e._zod.def,catchall:cg()}),e.strict=()=>e.clone({...e._zod.def,catchall:H4()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>$w(e,i),e.safeExtend=i=>Zw(e,i),e.merge=i=>qw(e,i),e.pick=i=>Hw(e,i),e.omit=i=>Uw(e,i),e.partial=(...i)=>Qw(ub,e,i[0]),e.required=(...i)=>Pw(cb,e,i[0])});function ra(e,a){const i={type:"object",shape:e??{},...Ee(a)};return new $4(i)}const Z4=J("ZodUnion",(e,a)=>{S_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>$E(e,i,l,s),e.options=a.options});function q4(e,a){return new Z4({type:"union",options:e,...Ee(a)})}const Q4=J("ZodIntersection",(e,a)=>{w_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>ZE(e,i,l,s)});function P4(e,a){return new Q4({type:"intersection",left:e,right:a})}const Yd=J("ZodEnum",(e,a)=>{__.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(l,s,u)=>kE(e,l,s),e.enum=a.entries,e.options=Object.values(a.entries);const i=new Set(Object.keys(a.entries));e.extract=(l,s)=>{const u={};for(const f of l)if(i.has(f))u[f]=a.entries[f];else throw new Error(`Key ${f} not found in enum`);return new Yd({...a,checks:[],...Ee(s),entries:u})},e.exclude=(l,s)=>{const u={...a.entries};for(const f of l)if(i.has(f))delete u[f];else throw new Error(`Key ${f} not found in enum`);return new Yd({...a,checks:[],...Ee(s),entries:u})}});function G4(e,a){const i=Array.isArray(e)?Object.fromEntries(e.map(l=>[l,l])):e;return new Yd({type:"enum",entries:i,...Ee(a)})}const Y4=J("ZodTransform",(e,a)=>{E_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>BE(e,i),e._zod.parse=(i,l)=>{if(l.direction==="backward")throw new k0(e.constructor.name);i.addIssue=u=>{if(typeof u=="string")i.issues.push(lo(u,i.value,a));else{const f=u;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=i.value),f.inst??(f.inst=e),i.issues.push(lo(f))}};const s=a.transform(i.value,i);return s instanceof Promise?s.then(u=>(i.value=u,i)):(i.value=s,i)}});function F4(e){return new Y4({type:"transform",transform:e})}const ub=J("ZodOptional",(e,a)=>{eb.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>lb(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function fg(e){return new ub({type:"optional",innerType:e})}const K4=J("ZodExactOptional",(e,a)=>{T_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l)DELIM" +R"DELIM(,s)=>lb(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function V4(e){return new K4({type:"optional",innerType:e})}const X4=J("ZodNullable",(e,a)=>{R_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>qE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function dg(e){return new X4({type:"nullable",innerType:e})}const J4=J("ZodDefault",(e,a)=>{z_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>PE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function I4(e,a){return new J4({type:"default",innerType:e,get defaultValue(){return typeof a=="function"?a():U0(a)}})}const W4=J("ZodPrefault",(e,a)=>{A_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>GE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function eT(e,a){return new W4({type:"prefault",innerType:e,get defaultValue(){return typeof a=="function"?a():U0(a)}})}const cb=J("ZodNonOptional",(e,a)=>{C_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>QE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function tT(e,a){return new cb({type:"nonoptional",innerType:e,...Ee(a)})}const nT=J("ZodCatch",(e,a)=>{j_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>YE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function aT(e,a){return new nT({type:"catch",innerType:e,catchValue:typeof a=="function"?a:()=>a})}const rT=J("ZodPipe",(e,a)=>{N_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>FE(e,i,l,s),e.in=a.in,e.out=a.out});function hg(e,a){return new rT({type:"pipe",in:e,out:a})}const iT=J("ZodReadonly",(e,a)=>{O_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>KE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function lT(e){return new iT({type:"readonly",innerType:e})}const oT=J("ZodCustom",(e,a)=>{M_.init(e,a),Et.init(e,a),e._zod.processJSONSchema=(i,l,s)=>LE(e,i)});function sT(e,a={}){return TE(oT,e,a)}function uT(e){return RE(e)}function Gr(e){if(!e)return;const a=e.trim();if(!a)return;const i=a.toLowerCase(),l=i.indexOf("1");if(l>0){const f=i.slice(0,l);if(["bc","tb","bcrt","ltc","sb"].includes(f)){const h=i.slice(l+1);if(!h)return;const p=h.charAt(0);return p==="p"?"p2tr":p==="q"?h.length===39||h.length===40||e.length===42?"p2wpkh":h.length===59||h.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 Fd=ra({id:Mt(),height:Qe(),timestamp:Qe().optional(),mediantime:Qe().optional(),tx_count:Qe().optional(),size:Qe().optional(),weight:Qe().optional(),difficulty:Qe().optional(),bits:Qe().optional(),merkle_root:Mt().optional(),previousblockhash:Mt().nullable().optional(),nonce:Qe().optional(),version:Qe().optional()}).loose(),cT=ra({confirmed:ph(),block_height:Qe().optional(),block_hash:Mt().optional(),block_time:Qe().optional()}),fT=ra({txid:Mt().optional().nullable(),vout:Qe().optional().nullable(),sequence:Qe().optional(),scriptsig:Mt().optional().nullable(),scriptsig_asm:Mt().optional().nullable(),witness:Gi(Mt()).optional(),is_coinbase:ph().optional(),prevout:ra({scriptpubkey_type:Mt().optional(),scriptpubkey_address:Mt().optional(),scriptpubkey:Mt().optional(),scriptpubkey_asm:Mt().optional(),value:Qe().optional()}).partial().nullable().optional()}).loose(),dT=ra({scriptpubkey_type:Mt().optional(),scriptpubkey_address:Mt().optional(),scriptpubkey:Mt().optional(),scriptpubkey_asm:Mt().optional(),value:Qe(),n:Qe().optional()}).loose(),ru=ra({txid:Mt(),hash:Mt().optional(),fee:Qe().optional(),version:Qe(),locktime:Qe(),vin:Gi(fT),vout:Gi(dT),size:Qe(),weight:Qe(),status:cT}).loose(),iu=Gi(Fd),bu=Gi(ru),mg=ra({in_best_chain:ph(),next_best:Mt().optional(),height:Qe().optional()}),pg=ra({address:Mt(),chain_stats:ra({funded_txo_count:Qe().optional(),funded_txo_sum:Qe().optional(),spent_txo_count:Qe().optional(),spent_txo_sum:Qe().optional(),tx_count:Qe().optional()}),mempool_stats:ra({funded_txo_count:Qe().optional(),funded_txo_sum:Qe().optional(),spent_txo_count:Qe().optional(),spent_txo_sum:Qe().optional(),tx_count:Qe().optional()})});async function qt(e,a,i){const l=a.startsWith("/")?a:`/${a}`,s=await fetch(`${e}${l}`);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 yg(e,a){const i=await fetch(`${e}/blocks/tip/height`);if(!i.ok)throw new yh("Unable to fetch tip height",i.status);const l=await i.text(),s=Number(l.trim());if(!Number.isFinite(s))throw new TypeError("Invalid tip height response");return a.lastKnownHeight=s,s}async function Ni(e,a,i){if(a.lastKnownHeight===null){await yg(e,a);return}typeof i=="number"&&a.lastKnownHeightu.scriptpubkey_address===e?s+u.value:s,0),l=a.vin.reduce((s,u)=>{const f=u.prevout;return f?.scrip)DELIM" +R"DELIM(tpubkey_address===e&&typeof f.value=="number"?s+f.value:s},0);return i-l}async function rd(e,a){if(a==="latest"||a==="tip"){const i=await qt(e,"/blocks",iu);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 vg(e,a,i){if(i.lastKnownHeight==null||a>=i.lastKnownHeight)return null;const l=a+1;try{const s=await fetch(`${e}/block-height/${String(l)}`);return s.ok&&(await s.text()).trim()||null}catch(s){return console.warn(`Failed to resolve hash for height ${String(l)}`,s),null}}function ql(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 id(e,a){const i=e.status.confirmed?"confirmed":"unconfirmed",l=e.vin.map((p,m)=>{const b=p.is_coinbase||p.txid==null?void 0:typeof p.vout=="number"&&p.vout!==4294967295?p.vout:void 0;return{index:m,prevTxId:p.txid??void 0,prevOutputIndex:b,address:p.prevout?.scriptpubkey_address??void 0,valueSats:p.prevout?.value,scriptType:p.prevout?.scriptpubkey_type,isCoinbase:p.is_coinbase??!1,script:p.scriptsig||p.scriptsig_asm?{hex:p.scriptsig??void 0,mnemonic:p.scriptsig_asm??void 0}:void 0,witness:p.witness??void 0,sequence:p.sequence}}),s=e.vout.map((p,m)=>({index:m,address:p.scriptpubkey_address??void 0,valueSats:p.value,scriptType:p.scriptpubkey_type,spent:void 0,script:p.scriptpubkey||p.scriptpubkey_asm?{hex:p.scriptpubkey??void 0,mnemonic:p.scriptpubkey_asm??void 0}:void 0})),u=s.reduce((p,m)=>p+m.valueSats,0),f=a.lastKnownHeight;let h=0;return e.status.block_height&&i==="confirmed"&&(h=f&&f>=e.status.block_height?f-e.status.block_height+1:1),{txid:e.txid,hash:e.hash??e.txid,status:i,confirmations:h,blockHeight:e.status.block_height,blockHash:e.status.block_hash,receivedTime:e.status.block_time,feeSats:e.fee??null,feeRate:e.fee?e.fee/e.weight*4:null,size:e.size,weight:e.weight,version:e.version,locktime:e.locktime,totalInput:null,totalOutput:u,inputs:l,outputs:s}}function mT(e,a){const i=e.chain_stats,l=e.mempool_stats,s=(i.funded_txo_sum??0)-(i.spent_txo_sum??0),u=fb(e.address,a.slice(0,25));return{address:e.address,addressType:Gr(e.address),balance:s,totalReceived:(i.funded_txo_sum??0)+(l.funded_txo_sum??0),totalSent:(i.spent_txo_sum??0)+(l.spent_txo_sum??0),txCount:(i.tx_count??0)+(l.tx_count??0),utxoCount:(i.funded_txo_count??0)-(i.spent_txo_count??0),transactions:u}}function pT(e){const a=e.chain_stats,i=e.mempool_stats,l=(a.funded_txo_sum??0)-(a.spent_txo_sum??0);return{address:e.address,addressType:Gr(e.address),balance:l,totalReceived:(a.funded_txo_sum??0)+(i.funded_txo_sum??0),totalSent:(a.spent_txo_sum??0)+(i.spent_txo_sum??0),txCount:(a.tx_count??0)+(i.tx_count??0),utxoCount:(a.funded_txo_count??0)-(a.spent_txo_count??0)}}function fb(e,a){return a.map(i=>({txid:i.txid,timestamp:i.status.block_time,valueChange:hT(e,i),blockHeight:i.status.block_height}))}async function gg(e,a,i=0){const l=i>0?`/block/${a}/txs/${String(i)}`:`/block/${a}/txs`;return qt(e,l,bu)}async function yT(e,a,i){return i?qt(e,`/address/${a}/txs/chain/${i}`,bu):qt(e,`/address/${a}/txs`,bu)}function db({baseUrl:e}){const a=new Set;let i=null;const l={lastBlockHash:null,lastKnownHeight:null};async function s(h){const p=await qt(e,`/tx/${h}`,ru);return await(p.status.block_height?Ni(e,l,p.status.block_height):Ni(e,l)),id(p,l)}function u(){i||a.size===0||(i=setInterval(async()=>{try{const h=await qt(e,"/blocks",iu);if(h.length===0)return;const p=h[0];if(p.id!==l.lastBlockHash){l.lastBlockHash=p.id,l.lastKnownHeight=Math.max(p.height,l.lastKnownHeight??0);const m=ql(p);for(const b of a)b({type:"block.new",payload:m})}}catch(h){console.warn("Block polling failed",h)}},15e3))}function f(){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(h=10){const p=await qt(e,"/blocks",iu);return p.length>0&&(l.lastBlockHash=p[0].id,l.lastKnownHeight=Math.max(p[0].height,l.lastKnownHeight??0)),p.slice(0,h).map(m=>ql(m))},async getBlocksBefore(h,p=10){const m=Math.max(h,0),b=await qt(e,`/blocks/${String(m)}`,iu);return b.length>0&&(l.lastKnownHeight=Math.max(b[0].height,l.lastKnownHeight??0)),b.slice(0,p).map(v=>ql(v))},async getBlockHeader(h){const p=await rd(e,h);await Ni(e,l);const[m,b]=await Promise.all([qt(e,`/block/${p}`,Fd),qt(e,`/block/${p}/status`,mg).catch(()=>null)]),v=ql(m);l.lastBlockHash=v.hash,l.lastKnownHeight=Math.max(v.height,l.lastKnownHeight??v.height);let x=b?.next_best??null;return x||(x=await vg(e,v.height,l)),{...v,merkleRoot)DELIM" +R"DELIM(:m.merkle_root,nonce:m.nonce,bits:m.bits,version:m.version,nextBlockHash:x}},getBlockStats(h){return Promise.resolve({})},async getBlock(h){const p=await rd(e,h);await Ni(e,l);const m=await qt(e,`/block/${p}`,Fd),[b,v]=await Promise.allSettled([gg(e,p),qt(e,`/block/${p}/status`,mg)]);b.status==="rejected"&&console.warn("Failed to load block transactions, defaulting to empty set",b.reason),v.status==="rejected"&&console.warn("Failed to load block status, defaulting to unknown",v.reason);const x=ql(m);l.lastBlockHash=x.hash,l.lastKnownHeight=Math.max(x.height,l.lastKnownHeight??x.height);const w=b.status==="fulfilled"?b.value:[];let E=(v.status==="fulfilled"?v.value:null)?.next_best??null;return E||(E=await vg(e,x.height,l)),{...x,merkleRoot:m.merkle_root,nonce:m.nonce,bits:m.bits,version:m.version,nextBlockHash:E,transactions:w.map(M=>id(M,l))}},async getBlockTransactions(h,p=0){const m=await rd(e,h),b=await gg(e,m,p),v=b.reduce((x,w)=>w.status.block_height?x===null?w.status.block_height:Math.max(x,w.status.block_height):x,null);return await(typeof v=="number"?Ni(e,l,v):Ni(e,l)),b.map(x=>id(x,l))},async getTransactionHeader(h){return s(h)},async getTransaction(h){return s(h)},async getTransactionInputScriptHex(h,p){const m=await qt(e,`/tx/${h}`,ru);if(p<0||p>=m.vin.length)throw new RangeError(`Input index ${String(p)} not found`);const v=m.vin[p].scriptsig;return typeof v=="string"?v:""},async getTransactionOutputScriptHex(h,p){const m=await qt(e,`/tx/${h}`,ru);if(p<0||p>=m.vout.length)throw new RangeError(`Output index ${String(p)} not found`);const v=m.vout[p].scriptpubkey;if(typeof v!="string")throw new TypeError("Output script missing in provider response");return v},async getAddressSummary(h){const p=await qt(e,`/address/${h}`,pg);return pT(p)},async getAddress(h){const p=await qt(e,`/address/${h}`,pg),m=await qt(e,`/address/${h}/txs`,bu);return mT(p,m)},async getAddressTransactions(h,p){const m=await yT(e,h,p);return fb(h,m)},subscribeToEvents(h){return a.add(h),u(),()=>{a.delete(h),a.size===0&&f()}}}}function vT({baseUrl:e}){const a=db({baseUrl:e});return{...a,metadata:{...a.metadata,id:"mempool",label:"mempool.space",endpoint:e,description:"Adapter backed by mempool.space REST API."}}}function oo(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function hb(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 mb(e){if(typeof e!="function")throw new Error("function expected");return!0}function so(e,a){if(typeof a!="string")throw new Error(`${e}: string expected`);return!0}function vo(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function xu(e){if(!Array.isArray(e))throw new Error("array expected")}function pb(e,a){if(!hb(!0,a))throw new Error(`${e}: array of strings expected`)}function vh(e,a){if(!hb(!1,a))throw new Error(`${e}: array of numbers expected`)}function gh(...e){const a=u=>u,i=(u,f)=>h=>u(f(h)),l=e.map(u=>u.encode).reduceRight(i,a),s=e.map(u=>u.decode).reduce(i,a);return{encode:l,decode:s}}function yb(e){const a=typeof e=="string"?e.split(""):e,i=a.length;pb("alphabet",a);const l=new Map(a.map((s,u)=>[s,u]));return{encode:s=>(xu(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=>(xu(s),s.map(u=>{so("alphabet.decode",u);const f=l.get(u);if(f===void 0)throw new Error(`Unknown letter: "${u}". Allowed: ${e}`);return f}))}}function vb(e=""){return so("join",e),{encode:a=>(pb("join.decode",a),a.join(e)),decode:a=>(so("join.decode",a),a.split(e))}}function bg(e,a,i){if(a<2)throw new Error(`convertRadix: invalid from=${a}, base cannot be less than 2`);if(i<2)throw new Error(`convertRadix: invalid to=${i}, base cannot be less than 2`);if(xu(e),!e.length)return[];let l=0;const s=[],u=Array.from(e,h=>{if(vo(h),h<0||h>=a)throw new Error(`invalid integer: ${h}`);return h}),f=u.length;for(;;){let h=0,p=!0;for(let m=l;ma===0?e:gb(a,e%a),Su=(e,a)=>e+(a-gb(e,a)),lu=(()=>{let e=[];for(let a=0;a<40;a++)e.push(2**a);return e})();function Kd(e,a,i,l){if(xu(e),a<=0||a>32)throw new Error(`convertRadix2: wrong from=${a}`);if(i<=0||i>32)throw new Error(`convertRadix2: wrong to=${i}`);if(Su(a,i)>32)throw new Error(`convertRadix2: carry overflow from=${a} to=${i} carryBits=${Su(a,i)}`);let s=0,u=0;const f=lu[a],h=lu[i]-1,p=[];for(const m of e){if(vo(m),m>=f)throw new Error(`convertRadix2: invalid data word=${m} from=${a}`);if(s=s<32)throw new Error(`convertRadix2: carry)DELIM" +R"DELIM( overflow pos=${u} from=${a}`);for(u+=a;u>=i;u-=i)p.push((s>>u-i&h)>>>0);const b=lu[u];if(b===void 0)throw new Error("invalid carry");s&=b-1}if(s=s<=a)throw new Error("Excess padding");if(!l&&s>0)throw new Error(`Non-zero padding: ${s}`);return l&&u>0&&p.push(s>>>0),p}function gT(e){vo(e);const a=2**8;return{encode:i=>{if(!oo(i))throw new Error("radix.encode input should be Uint8Array");return bg(Array.from(i),a,e)},decode:i=>(vh("radix.decode",i),Uint8Array.from(bg(i,e,a)))}}function bT(e,a=!1){if(vo(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(Su(8,e)>32||Su(e,8)>32)throw new Error("radix2: carry overflow");return{encode:i=>{if(!oo(i))throw new Error("radix2.encode input should be Uint8Array");return Kd(Array.from(i),8,e,!a)},decode:i=>(vh("radix2.decode",i),Uint8Array.from(Kd(i,e,8,a)))}}function xg(e){return mb(e),function(...a){try{return e.apply(null,a)}catch{}}}function xT(e,a){return vo(e),mb(a),{encode(i){if(!oo(i))throw new Error("checksum.encode: input should be Uint8Array");const l=a(i).slice(0,e),s=new Uint8Array(i.length+e);return s.set(i),s.set(l,i.length),s},decode(i){if(!oo(i))throw new Error("checksum.decode: input should be Uint8Array");const l=i.slice(0,-e),s=i.slice(-e),u=a(l).slice(0,e);for(let f=0;fgh(gT(58),yb(e),vb("")),wT=ST("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),_T=e=>gh(xT(4,a=>e(e(a))),wT),Vd=gh(yb("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),vb("")),Sg=[996825010,642813549,513874426,1027748829,705979059];function Ql(e){const a=e>>25;let i=(e&33554431)<<5;for(let l=0;l>l&1)===1&&(i^=Sg[l]);return i}function wg(e,a,i=1){const l=e.length;let s=1;for(let u=0;u126)throw new Error(`Invalid prefix (${e})`);s=Ql(s)^f>>5}s=Ql(s);for(let u=0;uw)throw new TypeError(`Length ${E} exceeds limit ${w}`);const R=v.toLowerCase(),M=wg(R,x,a);return`${R}1${Vd.encode(x)}${M}`}function h(v,x=90){so("bech32.decode input",v);const w=v.length;if(w<8||x!==!1&&w>x)throw new TypeError(`invalid string length: ${w} (${v}). Expected (8..${x})`);const _=v.toLowerCase();if(v!==_&&v!==v.toUpperCase())throw new Error("String must be lowercase or uppercase");const E=_.lastIndexOf("1");if(E===0||E===-1)throw new Error('Letter "1" must be present between prefix and data only');const R=_.slice(0,E),M=_.slice(E+1);if(M.length<6)throw new Error("Data must be at least 6 characters long");const L=Vd.decode(M).slice(0,-6),B=wg(R,L,a);if(!M.endsWith(B))throw new Error(`Invalid checksum in ${v}: expected "${B}"`);return{prefix:R,words:L}}const p=xg(h);function m(v){const{prefix:x,words:w}=h(v,!1);return{prefix:x,words:w,bytes:l(w)}}function b(v,x){return f(v,s(x))}return{encode:f,decode:h,encodeFromBytes:b,decodeToBytes:m,decodeUnsafe:p,fromWords:l,fromWordsUnsafe:u,toWords:s}}const wu=bb("bech32"),Xd=bb("bech32m");function ET(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function bh(e,a,i=""){const l=ET(e),s=e?.length;if(!l||a!==void 0){const f=i&&`"${i}" `,h="",p=l?`length=${s}`:`type=${typeof e}`,m=f+"expected Uint8Array"+h+", got "+p;throw l?new RangeError(m):new TypeError(m)}return e}function _g(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 TT(e,a){bh(e,void 0,"digestInto() output");const i=a.outputLen;if(e.length='+i)}function Jd(...e){for(let a=0;a>>a}const RT=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",zT=Array.from({length:256},(e,a)=>a.toString(16).padStart(2,"0"));function ou(e){if(bh(e),RT)return e.toHex();let a="";for(let i=0;ie(u).update(s).digest(),l=e(void 0);return i.outputLen=l.outputLen,i.blockLen=l.blockLen,i.canXOF=l.canXOF,i.create=s=>e(s),Object.assign(i,a),Object.freeze(i)}const CT=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function jT(e,a,i){return e&a^~e&i}function NT(e,a,i){return e&a^e&i^a&i}class OT{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(a,i,l,s){this.blockLen=a,this.outputLen=i,this.padOffs)DELIM" +R"DELIM(et=l,this.isLE=s,this.buffer=new Uint8Array(a),this.view=ld(this.buffer)}update(a){_g(this),bh(a);const{view:i,buffer:l,blockLen:s}=this,u=a.length;for(let f=0;fs-f&&(this.process(l,0),f=0);for(let v=f;vb.length)throw new Error("_sha2: outputLen bigger than state");for(let v=0;v>>3,E=na(w,17)^na(w,19)^w>>>10;sr[v]=E+sr[v-7]+_+sr[v-16]|0}let{A:l,B:s,C:u,D:f,E:h,F:p,G:m,H:b}=this;for(let v=0;v<64;v++){const x=na(h,6)^na(h,11)^na(h,25),w=b+x+jT(h,p,m)+MT[v]+sr[v]|0,E=(na(l,2)^na(l,13)^na(l,22))+NT(l,s,u)|0;b=m,m=p,p=h,h=f+w|0,f=u,u=s,s=l,l=w+E|0}l=l+this.A|0,s=s+this.B|0,u=u+this.C|0,f=f+this.D|0,h=h+this.E|0,p=p+this.F|0,m=m+this.G|0,b=b+this.H|0,this.set(l,s,u,f,h,p,m,b)}roundClean(){Jd(sr)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Jd(this.buffer)}}class kT extends DT{A=or[0]|0;B=or[1]|0;C=or[2]|0;D=or[3]|0;E=or[4]|0;F=or[5]|0;G=or[6]|0;H=or[7]|0;constructor(){super(32)}}const xb=AT(()=>new kT,CT(1)),Sb=_T(xb),LT=0x00000000ffff0000000000000000000000000000000000000000000000000000n;function xh(e){if(e.length%2!==0)throw new Error("Invalid hex string");const a=new Uint8Array(e.length/2);for(let i=0;i>>24,i=e&8388607;if(i===0||a<3)return;const l=BigInt(i)*(1n<i[1]).filter(Boolean);return a.length>0?a:[e]}function Sh(e){const a=e.toLowerCase();if(a.includes("dup hash160")&&a.includes("equalverify checksig"))return"p2pkh";if(a.startsWith("hash160")&&a.includes("equal"))return"p2sh";if(a.startsWith("zero [")){const l=a.match(/zero \[([0-9a-f]+)\]/)?.[1]??"";return l.length===40?"p2wpkh":l.length===64?"p2wsh":"segwit"}if(a.startsWith("1 ["))return"p2tr"}function go(){return"mainnet"}function bo(e){return e==="testnet"||e==="regtest"?{p2pkh:111,p2sh:196,hrp:e==="regtest"?"bcrt":"tb"}:{p2pkh:0,p2sh:5,hrp:"bc"}}function Eg(e,a){const i=new Uint8Array(a.length/2+1);return i[0]=e,i.set(xh(a),1),Sb.encode(i)}function od(e,a,i){const l=xh(i),s=wu.toWords(l);return s.unshift(a),(a===0?wu:Xd).encode(e,s)}function wb(e,a){const i=e.toLowerCase(),l=i.match(/dup hash160 \[([0-9a-f]{40})\] equalverify checksig/);if(l)return{address:Eg(a.p2pkh,l[1]),type:"p2pkh"};const s=i.match(/^hash160 \[([0-9a-f]{40})\] equal$/);if(s)return{address:Eg(a.p2sh,s[1]),type:"p2sh"};const u=i.match(/^zero \[([0-9a-f]{40})\]/);if(u)return{address:od(a.hrp,0,u[1]),type:"p2wpkh"};const f=i.match(/^zero \[([0-9a-f]{64})\]/);if(f)return{address:od(a.hrp,0,f[1]),type:"p2wsh"};const h=i.match(/^1 \[([0-9a-f]{64})\]/);return h?{address:od(a.hrp,1,h[1]),type:"p2tr"}:{type:Sh(e)}}func)DELIM" +R"DELIM(tion UT(e,a){try{const s=Sb.decode(e),u=s[0],f=ou(s.slice(1));if(f.length===40&&u===a.p2pkh)return{scriptHex:`76a914${f}88ac`,type:"p2pkh"};if(f.length===40&&u===a.p2sh)return{scriptHex:`a914${f}87`,type:"p2sh"}}catch{}const i=e.toLowerCase();if(i.indexOf("1")>0&&i.startsWith(`${a.hrp}1`)){const s=i,u=p=>{try{return p.decode(s,90)}catch{return null}},f=u(wu);if(f&&f.prefix===a.hrp){const p=f.words[0],m=wu.fromWords(f.words.slice(1)),b=ou(m),v=m.length.toString(16).padStart(2,"0");if(p===0&&(m.length===20||m.length===32))return{scriptHex:`00${v}${b}`,type:m.length===20?"p2wpkh":"p2wsh"}}const h=u(Xd);if(h&&h.prefix===a.hrp){const p=h.words[0],m=Xd.fromWords(h.words.slice(1)),b=ou(m),v=m.length.toString(16).padStart(2,"0");if(p===1&&m.length===32)return{scriptHex:`51${v}${b}`,type:"p2tr"}}}return null}function pr(e,a){const i=e.toLowerCase();if(/^[0-9a-f]{64}$/.test(i))return{hash:i,type:"script-hash"};const l=UT(e,a);if(!l)return null;const s=xb(xh(l.scriptHex)),u=Uint8Array.from(s).reverse();return{hash:ou(u),type:l.type}}function Pl(e,a){return{hash:e.hash,height:e.height,timestamp:e.timestamp,txCount:a,size:void 0,weight:void 0,difficulty:BT(e.bits),previousBlockHash:e.previous}}function $T(e){const a=HT(e);return a&&a.length>0?a:void 0}function ZT(e,a,i,l){const s=/^0{64}$/u.test(e.point.hash),u=a?wb(a.script,i):{address:void 0,type:void 0},f=a?a.value:void 0,h=a?a.script:void 0;return{index:l,prevTxId:s?void 0:e.point.hash,prevOutputIndex:s?void 0:e.point.index,address:u.address,valueSats:f,scriptType:u.type??Sh(h??e.script),isCoinbase:s,script:e.script?{mnemonic:e.script}:void 0,witness:$T(e.witness),sequence:e.sequence}}function qT(e,a,i){const l=wb(e.script,i);return{index:a,address:l.address,valueSats:e.value,scriptType:l.type??Sh(e.script),spent:void 0,script:e.script?{mnemonic:e.script}:void 0}}function QT(e,a){return typeof e!="number"||typeof a!="number"?0:Math.max(0,e-a+1)}function Fs(e,a,i,l,s){const u=e.outputs.map((b,v)=>qT(b,v,i)),f=u.reduce((b,v)=>b+v.valueSats,0),h=a.reduce((b,v)=>v?(b??0)+v.value:b,null),p=QT(l.tipHeight,l.blockHeight),m=typeof l.blockHeight=="number"?"confirmed":"unconfirmed";return{txid:e.hash,hash:e.hash,status:m,confirmations:p,blockHeight:l.blockHeight,blockHash:l.blockHash,receivedTime:l.timestamp,feeSats:Number.isFinite(s)?s:void 0,feeRate:null,size:void 0,weight:void 0,version:e.version,locktime:e.locktime,totalInput:h,totalOutput:f,inputs:e.inputs.map((b,v)=>ZT(b,a[v],i,v)),outputs:u}}const Ks=25,Tg=5e3,sd=new Map,ud=new Map,_u={address:!0,filter:!1,turbo:!0,witness:!0,retarget:!1,difficult:!1};function PT(e){if(!e||typeof e!="object"||Array.isArray(e))return _u;const a=e,i=l=>typeof a[l]=="boolean"?a[l]:_u[l];return{address:i("address"),filter:i("filter"),turbo:i("turbo"),witness:i("witness"),retarget:i("retarget"),difficult:i("difficult")}}function Oi(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const i=e.state;if(!i||typeof i!="object"||Array.isArray(i))return null;const l=i,s=typeof l.count=="number"?l.count:void 0,u=typeof l.size=="number"?l.size:void 0,f=typeof l.weight=="number"?l.weight:void 0;return s===void 0&&u===void 0&&f===void 0?null:{count:s,size:u,weight:f}}function Gl(e){return e?.weight??e?.size}function GT(e,a){return!Number.isFinite(e)||!Number.isFinite(a)||a<=0?null:e/a*4}function Vs(e,a){if(!a)return e;const i=typeof a.fee=="number"?a.fee:void 0,l=typeof a.weight=="number"?a.weight:void 0,s=typeof i=="number"&&typeof l=="number"?GT(i,l):e.feeRate;return{...e,wtxid:a.wtxid||e.wtxid,feeSats:typeof a.fee=="number"?a.fee:e.feeSats,feeRate:s,size:typeof a.maximal=="number"?a.maximal:e.size,weight:typeof a.weight=="number"?a.weight:e.weight,sigops:typeof a.confirmed?.sigops=="number"?a.confirmed.sigops:e.sigops,totalInput:typeof a.value=="number"?a.value:e.totalInput,totalOutput:typeof a.spend=="number"?a.spend:e.totalOutput}}async function tn(e,a,i){const l=a.startsWith("/")?a:`/${a}`;let s=l.includes("?")?`${e}${l}`:`${e}${l}?format=json`;i&&(s+=s.includes("?")?"&turbo=true":"?turbo=true");const u=ud.get(s);if(u)return u;const f=(async()=>{const h=await fetch(s,{headers:{Accept:"application/json"}});if(!h.ok){const m=await h.text().catch(()=>"");throw new Error(`Request failed ${String(h.status)}: ${m||h.statusText}`)}const p=await h.text();try{return JSON.parse(p)}catch{return p}})();ud.set(s,f);try{return await f}finally{ud.delete(s)}}async function Ot(e,a,i){try{return await tn(e,a,i)}catch{return null}}async function _b(e,a){const i=await tn(e,"/v1/top?format=json",a),l=typeof i=="number"?i:Number(i);if(!Number.isFinite(l))throw new Error("Invalid top height");return l}async function $r(e,a){const i=Date.now(),l=`${e}|0`,s=sd.get(l);if(s&&s.expiresAt>i)return s.promise;const u=_b(e,a).then(f=>(sd.set(l,{promise:u,value:f,expiresAt:Date.now()+Tg}),f));return sd.set(l,{promise:u,value:s?.value??null,expiresAt:i+Tg}),u}async function Xs(e,a,i){if(a==="latest"||a==="tip"){const l=await $r(e,i);return{path:`/v1/block/height/${Strin)DELIM" +R"DELIM(g(l)}`,height:l}}return/^\d+$/u.test(a)?{path:`/v1/block/height/${a}`}:{path:`/v1/block/hash/${a}`}}function YT(e,a){const i=new Map;return(l,s)=>{const u=`${l}:${String(s)}`,f=i.get(u);if(f)return f;const h=tn(e,`/v1/output/${l}/${String(s)}?format=json`,a).catch(()=>null);return i.set(u,h),h}}async function Rg(e,a,i,l){return tn(e,`${a}/tx/${String(i)}?format=json`,l)}async function cd(e,a,i){const l=await Ot(e,`/v1/address/${a}/confirmed?format=json`,i);return l||(await Ot(e,`/v1/address/${a}?format=json`,i)??[])}function zg(e,a){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const l=Number(e);if(Number.isFinite(l))return l}let i=0;for(const l of a)i+=l.value;return i}function fd({baseUrl:e,pollIntervalMs:a=15e3,turbo:i=!1}){const l=new Set;let s=null,u=null;const f=bo(go());let h=null,p=null;function m(){return p||(p=tn(e,"/v1/configuration?format=json").then(_=>{const E=PT(_);return h=E,E}).catch(_=>(console.warn("Libbitcoin configuration fetch failed",_),h=_u,_u)),p)}function b(_){return _.address}function v(_){return b(_)&&_.turbo}function x(){s||(s=setInterval(async()=>{try{const _=await _b(e);if(u===null){u=_;return}if(_>u){const[E,R]=await Promise.all([tn(e,`/v1/block/height/${String(_)}/header?format=json`),Ot(e,`/v1/block/height/${String(_)}/header/context?format=json`)]),M=Oi(R),B={...Pl(E,M?.count),size:Gl(M)};for(const Y of l)Y({type:"block.new",payload:B});u=_}}catch(_){console.warn("Libbitcoin poller failed",_)}},a))}function w(){s&&(clearInterval(s),s=null)}return{metadata:{id:"libbitcoin",label:"Server",type:"local",connectionState:"connected",supportsWebsocket:!1,endpoint:e,description:"Adapter for the libbitcoin embedded REST API."},getConfiguration(){return m()},async getLatestBlocks(_=10){const E=await $r(e);u=E;const R=Array.from({length:_},(B,Y)=>E-Y).filter(B=>B>=0),[M,L]=await Promise.all([Promise.all(R.map(B=>tn(e,`/v1/block/height/${String(B)}/header?format=json`))),Promise.all(R.map(B=>Ot(e,`/v1/block/height/${String(B)}/header/context?format=json`)))]);return M.map((B,Y)=>{const K=Oi(L[Y]);return{...Pl(B,K?.count),size:Gl(K)}})},async getBlocksBefore(_,E=10){const R=Array.from({length:E},(B,Y)=>_-Y).filter(B=>B>=0),[M,L]=await Promise.all([Promise.all(R.map(B=>tn(e,`/v1/block/height/${String(B)}/header?format=json`))),Promise.all(R.map(B=>Ot(e,`/v1/block/height/${String(B)}/header/context?format=json`)))]);return M.map((B,Y)=>{const K=Oi(L[Y]);return{...Pl(B,K?.count),size:Gl(K)}})},async getBlockHeader(_){const{path:E,height:R}=await Xs(e,_),M=R===void 0?$r(e):Promise.resolve(R),[L,B,Y]=await Promise.all([tn(e,`${E}/header?format=json`),M,Ot(e,`${E}/header/context?format=json`)]);u=Math.max(u??0,B);let K=null;L.heightQ),ge=(await Promise.all(de.map(j=>Rg(e,E,j).catch(()=>null)))).filter(j=>j!==null),Oe=await Promise.all(ge.map(j=>Ot(e,`/v1/tx/${j.hash}/details?format=json`))),V=ge.map((j,Q)=>{const W=Oe[Q],re=Fs(j,[],f,{blockHeight:L.height,blockHash:L.hash,tipHeight:B,timestamp:L.timestamp},typeof W?.fee=="number"?W.fee:void 0);return Vs(re,W)});return{...se,size:K?.maximal??Gl(I),weight:K?.weight,merkleRoot:L.merkle_root,nonce:L.nonce,bits:L.bits,version:L.version,nextBlockHash:ie,feesSats:K?.fees,subsidySats:K?.subsidy,sigops:K?.sigops,transactions:V}},async getBlockTransactions(_,E=0){const{path:R}=await Xs(e,_),[M,L,B]=await Promise.all([tn(e,`${R}/header?format=json`),$r(e),Ot(e,`${R}/header/context?format=json`)]);u=Math.max(u??0,L);const Y=Oi(B)?.count;if(typeof Y=="number"&&E>=Y)return[];const K=typeof Y=="number"?Math.min(E+Ks,Y):E+Ks,ie=Array.from({length:Math.max(0,K-E)},(ue,de)=>E+de),O=(await Promise.all(ie.map(ue=>Rg(e,R,ue).catch(()=>null)))).filter(ue=>ue!==null);if(O.length===0)return[];const se=await Promise.all(O.map(ue=>Ot(e,`/v1/tx/${ue.hash}/details?format=json`)));return O.map((ue,de)=>{const te=se[de],ge=Fs(ue,[],f,{blockHeight:M.height,blockHash:M.hash,tipHeight:L,timestamp:M.timestamp},typeof te?.fee=="number"?te.fee:void 0);return Vs(ge,te)})},async getTransaction(_){const E=await tn(e,`/v1/tx/${_}?for)DELIM" +R"DELIM(mat=json`),R=YT(e),M=Promise.all(E.inputs.map(I=>/^0{64}$/u.test(I.point.hash)?Promise.resolve(null):R(I.point.hash,I.point.index))),[L,B,Y,K]=await Promise.all([Ot(e,`/v1/tx/${_}/header?format=json`),$r(e).catch(()=>null),Ot(e,`/v1/tx/${_}/details?format=json`),M]);typeof B=="number"&&(u=Math.max(u??0,B));const ie=Fs(E,K,f,{blockHeight:L?.height,blockHash:L?.hash,tipHeight:typeof B=="number"?B:void 0,timestamp:L?.timestamp},typeof Y?.fee=="number"?Y.fee:void 0);return Vs(ie,Y)},async getTransactionHeader(_){const E=await tn(e,`/v1/tx/${_}?format=json`),[R,M,L]=await Promise.all([Ot(e,`/v1/tx/${_}/header?format=json`),$r(e).catch(()=>null),Ot(e,`/v1/tx/${_}/details?format=json`)]);typeof M=="number"&&(u=Math.max(u??0,M));const B=Fs(E,[],f,{blockHeight:R?.height,blockHash:R?.hash,tipHeight:typeof M=="number"?M:void 0,timestamp:R?.timestamp},typeof L?.fee=="number"?L.fee:void 0);return Vs(B,L)},async getTransactionInputScriptHex(_,E){return(await tn(e,`/v1/input/${_}/${String(E)}/script?format=text`)).trim()},async getTransactionOutputScriptHex(_,E){return(await tn(e,`/v1/output/${_}/${String(E)}/script?format=text`)).trim()},async getAddress(_){const E=pr(_,f);if(!E)throw new Error("Unsupported address format for libbitcoin adapter");const R=h??await m();if(!b(R))throw new Error("Address endpoints are disabled by server configuration");const M=i&&v(R),[L,B]=await Promise.all([Ot(e,`/v1/address/${E.hash}/balance?format=json`,M),cd(e,E.hash,M)]),Y=zg(L,B),K=B.map(ie=>({txid:ie.point.hash,blockHeight:void 0,timestamp:void 0,valueChange:ie.value}));return{address:_,addressType:E.type,balance:Y,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:B.length,transactions:K}},async getAddressSummary(_){const E=pr(_,f);if(!E)throw new Error("Unsupported address format for libbitcoin adapter");const R=h??await m();if(!b(R))throw new Error("Address endpoints are disabled by server configuration");const M=i&&v(R),[L,B]=await Promise.all([Ot(e,`/v1/address/${E.hash}/balance?format=json`,M),cd(e,E.hash,M)]),Y=zg(L,B);return{address:_,addressType:E.type,balance:Y,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:B.length}},async getAddressTransactions(_){const E=pr(_,f);if(!E)return[];const R=h??await m();if(!b(R))return[];const M=i&&v(R);return(await cd(e,E.hash,M)).map(B=>({txid:B.point.hash,blockHeight:void 0,timestamp:void 0,valueChange:B.value}))},subscribeToEvents(_){return l.add(_),x(),()=>{l.delete(_),l.size===0&&w()}}}}const Eb=T.createContext(null),Tb=T.createContext(null),Rb=T.createContext(null);function FT({children:e,client:a}){return g.jsx(Eb.Provider,{value:a,children:e})}function KT({children:e,provider:a,setProvider:i,availableProviders:l}){return g.jsx(Tb.Provider,{value:{provider:a,setProvider:i,availableProviders:l},children:e})}function VT({children:e,turbo:a,setTurbo:i}){return g.jsx(Rb.Provider,{value:{turbo:a,setTurbo:i},children:e})}function gr(){const e=T.useContext(Eb);if(!e)throw new Error("BlockchainClientProvider missing in component tree");return e}function xo(){return gr().metadata}function zb(){const e=T.useContext(Tb);if(!e)throw new Error("ProviderSwitcherProvider missing in component tree");return e}function Ab(){const e=T.useContext(Rb);if(!e)throw new Error("TurboProvider missing in component tree");return e}function dd(){const e=globalThis.window;return e?.location.origin?e.location.origin:"http://localhost:8080"}function XT(e,a){if(e==="blockstream")return db({baseUrl:"https://blockstream.info/api"});if(e==="mempool")return vT({baseUrl:"https://mempool.space/api"});if(e==="libbitcoin"){const l=dd();return fd({baseUrl:l,turbo:a?.turboEnabled})}if(e==="external"){console.warn("No external API URL provided, falling back to libbitcoin provider");const l=dd();return fd({baseUrl:l,turbo:a?.turboEnabled})}console.warn(`Unknown provider "${e}", falling back to libbitcoin provider`);const i=dd();return fd({baseUrl:i,turbo:a?.turboEnabled})}function JT(){return[...new Set(["libbitcoin","blockstream","mempool"])]}function IT({children:e}){const a="libbitcoin",i=JT(),l=(()=>{const v=globalThis.window;return v?v.localStorage.getItem("turboEnabled")==="true":!1})(),s=(()=>{const v=globalThis.window;if(!v)return a;const x=v.localStorage.getItem("blockchainProvider");return x&&i.includes(x)?x:a})(),[u,f]=T.useState(l),[h,p]=T.useState(s),[m]=T.useState(()=>new gw({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}})),b=T.useMemo(()=>XT(h,{turboEnabled:u}),[h,u]);return T.useEffect(()=>{const v=globalThis.window;v&&v.localStorage.setItem("turboEnabled",u?"true":"false")},[u]),T.useEffect(()=>{const v=globalThis.window;v&&v.localStorage.setItem("blockchainProvider",h)},[h]),g.jsx(KT,{provider:h,setProvider:p,availableProviders:i,children:g.jsx(VT,{turbo:u,setTurbo:f,children:g.jsx(FT,{client:b,children:g.jsxs(bw,{client:m,children:[e,null]})})})})}var Cb=e=>{throw TypeError(e)},WT=(e,a,i)=>a.has(e)||Cb("Cannot "+i),hd=(e,a,i)=>(WT(e,a,"read from private fie)DELIM" +R"DELIM(ld"),i?i.call(e):a.get(e)),eR=(e,a,i)=>a.has(e)?Cb("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(e):a.set(e,i),Ag="popstate";function Cg(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function tR(e={}){function a(l,s){let u=s.state?.masked,{pathname:f,search:h,hash:p}=u||l.location;return uo("",{pathname:f,search:h,hash:p},s.state&&s.state.usr||null,s.state&&s.state.key||"default",u?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,s){return typeof s=="string"?s:ia(s)}return aR(a,i,null,e)}function je(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function bt(e,a){if(!e){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function nR(){return Math.random().toString(36).substring(2,10)}function jg(e,a){return{usr:e.state,key:e.key,idx:a,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function uo(e,a,i=null,l,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof a=="string"?la(a):a,state:i,key:a&&a.key||l||nR(),unstable_mask:s}}function ia({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 la(e){let a={};if(e){let i=e.indexOf("#");i>=0&&(a.hash=e.substring(i),e=e.substring(0,i));let l=e.indexOf("?");l>=0&&(a.search=e.substring(l),e=e.substring(0,l)),e&&(a.pathname=e)}return a}function aR(e,a,i,l={}){let{window:s=document.defaultView,v5Compat:u=!1}=l,f=s.history,h="POP",p=null,m=b();m==null&&(m=0,f.replaceState({...f.state,idx:m},""));function b(){return(f.state||{idx:null}).idx}function v(){h="POP";let R=b(),M=R==null?null:R-m;m=R,p&&p({action:h,location:E.location,delta:M})}function x(R,M){h="PUSH";let L=Cg(R)?R:uo(E.location,R,M);m=b()+1;let B=jg(L,m),Y=E.createHref(L.unstable_mask||L);try{f.pushState(B,"",Y)}catch(K){if(K instanceof DOMException&&K.name==="DataCloneError")throw K;s.location.assign(Y)}u&&p&&p({action:h,location:E.location,delta:1})}function w(R,M){h="REPLACE";let L=Cg(R)?R:uo(E.location,R,M);m=b();let B=jg(L,m),Y=E.createHref(L.unstable_mask||L);f.replaceState(B,"",Y),u&&p&&p({action:h,location:E.location,delta:0})}function _(R){return jb(R)}let E={get action(){return h},get location(){return e(s,f)},listen(R){if(p)throw new Error("A history only accepts one active listener");return s.addEventListener(Ag,v),p=R,()=>{s.removeEventListener(Ag,v),p=null}},createHref(R){return a(s,R)},createURL:_,encodeLocation(R){let M=_(R);return{pathname:M.pathname,search:M.search,hash:M.hash}},push:x,replace:w,go(R){return f.go(R)}};return E}function jb(e,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),je(i,"No window.location.(origin|href) available to create URL");let l=typeof e=="string"?e:ia(e);return l=l.replace(/ $/,"%20"),!a&&l.startsWith("//")&&(l=i+l),new URL(l,i)}var Jl,Ng=class{constructor(e){if(eR(this,Jl,new Map),e)for(let[a,i]of e)this.set(a,i)}get(e){if(hd(this,Jl).has(e))return hd(this,Jl).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,a){hd(this,Jl).set(e,a)}};Jl=new WeakMap;var rR=new Set(["lazy","caseSensitive","path","id","index","children"]);function iR(e){return rR.has(e)}var lR=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function oR(e){return lR.has(e)}function sR(e){return e.index===!0}function co(e,a,i=[],l={},s=!1){return e.map((u,f)=>{let h=[...i,String(f)],p=typeof u.id=="string"?u.id:h.join("-");if(je(u.index!==!0||!u.children,"Cannot specify children on an index route"),je(s||!l[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),sR(u)){let m={...u,id:p};return l[p]=Og(m,a(m)),m}else{let m={...u,id:p,children:void 0};return l[p]=Og(m,a(m)),u.children&&(m.children=co(u.children,a,h,l,s)),m}})}function Og(e,a){return Object.assign(e,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...e.lazy,...a.lazy}}:{}})}function fr(e,a,i="/"){return Il(e,a,i,!1)}function Il(e,a,i,l){let s=typeof a=="string"?la(a):a,u=Ln(s.pathname||"/",i);if(u==null)return null;let f=Nb(e);cR(f);let h=null;for(let p=0;h==null&&p{let b={relativePath:m===void 0?f.path||"":m,caseSensitive:f.caseSensitive===!0,childrenIndex:h,route:f};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(l)&&p)return;je(b.relativePath.startsWith(l),`Absolute route path "${b.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.rela)DELIM" +R"DELIM(tivePath.slice(l.length)}let v=kn([l,b.relativePath]),x=i.concat(b);f.children&&f.children.length>0&&(je(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),Nb(f.children,a,x,v,p)),!(f.path==null&&!f.index)&&a.push({path:v,score:vR(v,f.index),routesMeta:x})};return e.forEach((f,h)=>{if(f.path===""||!f.path?.includes("?"))u(f,h);else for(let p of Ob(f.path))u(f,h,!0,p)}),a}function Ob(e){let a=e.split("/");if(a.length===0)return[];let[i,...l]=a,s=i.endsWith("?"),u=i.replace(/\?$/,"");if(l.length===0)return s?[u,""]:[u];let f=Ob(l.join("/")),h=[];return h.push(...f.map(p=>p===""?u:[u,p].join("/"))),s&&h.push(...f),h.map(p=>e.startsWith("/")&&p===""?"/":p)}function cR(e){e.sort((a,i)=>a.score!==i.score?i.score-a.score:gR(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var fR=/^:[\w-]+$/,dR=3,hR=2,mR=1,pR=10,yR=-2,Mg=e=>e==="*";function vR(e,a){let i=e.split("/"),l=i.length;return i.some(Mg)&&(l+=yR),a&&(l+=hR),i.filter(s=>!Mg(s)).reduce((s,u)=>s+(fR.test(u)?dR:u===""?mR:pR),l)}function gR(e,a){return e.length===a.length&&e.slice(0,-1).every((l,s)=>l===a[s])?e[e.length-1]-a[a.length-1]:0}function bR(e,a,i=!1){let{routesMeta:l}=e,s={},u="/",f=[];for(let h=0;h{if(b==="*"){let _=h[x]||"";f=u.slice(0,u.length-_.length).replace(/(.)\/+$/,"$1")}const w=h[x];return v&&!w?m[b]=void 0:m[b]=(w||"").replace(/%2F/g,"/"),m},{}),pathname:u,pathnameBase:f,pattern:e}}function xR(e,a=!1,i=!0){bt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let l=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,h,p,m,b)=>{if(l.push({paramName:h,isOptional:p!=null}),p){let v=b.charAt(m+f.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(l.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,a?void 0:"i"),l]}function SR(e){try{return e.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return bt(!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 Ln(e,a){if(a==="/")return e;if(!e.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,l=e.charAt(i);return l&&l!=="/"?null:e.slice(i)||"/"}function wR({basename:e,pathname:a}){return a==="/"?e:kn([e,a])}var Mb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wh=e=>Mb.test(e);function _R(e,a="/"){let{pathname:i,search:l="",hash:s=""}=typeof e=="string"?la(e):e,u;return i?(i=_h(i),i.startsWith("/")?u=Dg(i.substring(1),"/"):u=Dg(i,a)):u=a,{pathname:u,search:TR(l),hash:RR(s)}}function Dg(e,a){let i=Tu(a).split("/");return e.split("/").forEach(s=>{s===".."?i.length>1&&i.pop():s!=="."&&i.push(s)}),i.length>1?i.join("/"):"/"}function md(e,a,i,l){return`Cannot include a '${e}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Db(e){return e.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function Mu(e){let a=Db(e);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function So(e,a,i,l=!1){let s;typeof e=="string"?s=la(e):(s={...e},je(!s.pathname||!s.pathname.includes("?"),md("?","pathname","search",s)),je(!s.pathname||!s.pathname.includes("#"),md("#","pathname","hash",s)),je(!s.search||!s.search.includes("#"),md("#","search","hash",s)));let u=e===""||s.pathname==="",f=u?"/":s.pathname,h;if(f==null)h=i;else{let v=a.length-1;if(!l&&f.startsWith("..")){let x=f.split("/");for(;x[0]==="..";)x.shift(),v-=1;s.pathname=x.join("/")}h=v>=0?a[v]:"/"}let p=_R(s,h),m=f&&f!=="/"&&f.endsWith("/"),b=(u||f===".")&&i.endsWith("/");return!p.pathname.endsWith("/")&&(m||b)&&(p.pathname+="/"),p}var _h=)DELIM" +R"DELIM(e=>e.replace(/\/\/+/g,"/"),kn=e=>_h(e.join("/")),Tu=e=>e.replace(/\/+$/,""),ER=e=>Tu(e).replace(/^\/*/,"/"),TR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,RR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,wo=class{constructor(e,a,i,l=!1){this.status=e,this.statusText=a||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function fo(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function _o(e){let a=e.map(i=>i.route.path).filter(Boolean);return kn(a)||"/"}var kb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Lb(e,a){let i=e;if(typeof i!="string"||!Mb.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,s=!1;if(kb)try{let u=new URL(window.location.href),f=i.startsWith("//")?new URL(u.protocol+i):new URL(i),h=Ln(f.pathname,a);f.origin===u.origin&&h!=null?i=h+f.search+f.hash:s=!0}catch{bt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:s,to:i}}var hr=Symbol("Uninstrumented");function zR(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 f=Object.keys(i);for(let h of f)u[h]&&i[h].push(u[h])}}));let l={};if(typeof a.lazy=="function"&&i.lazy.length>0){let s=Ui(i.lazy,a.lazy,()=>{});s&&(l.lazy=s)}if(typeof a.lazy=="object"){let s=a.lazy;["middleware","loader","action"].forEach(u=>{let f=s[u],h=i[`lazy.${u}`];if(typeof f=="function"&&h.length>0){let p=Ui(h,f,()=>{});p&&(l.lazy=Object.assign(l.lazy||{},{[u]:p}))}})}return["loader","action"].forEach(s=>{let u=a[s];if(typeof u=="function"&&i[s].length>0){let f=u[hr]??u,h=Ui(i[s],f,(...p)=>kg(p[0]));h&&(s==="loader"&&f.hydrate===!0&&(h.hydrate=!0),h[hr]=f,l[s]=h)}}),a.middleware&&a.middleware.length>0&&i.middleware.length>0&&(l.middleware=a.middleware.map(s=>{let u=s[hr]??s,f=Ui(i.middleware,u,(...h)=>kg(h[0]));return f?(f[hr]=u,f):s})),l}function AR(e,a){let i={navigate:[],fetch:[]};if(a.forEach(l=>l({instrument(s){let u=Object.keys(s);for(let f of u)s[f]&&i[f].push(s[f])}})),i.navigate.length>0){let l=e.navigate[hr]??e.navigate,s=Ui(i.navigate,l,(...u)=>{let[f,h]=u;return{to:typeof f=="number"||typeof f=="string"?f:f?ia(f):".",...Lg(e,h??{})}});s&&(s[hr]=l,e.navigate=s)}if(i.fetch.length>0){let l=e.fetch[hr]??e.fetch,s=Ui(i.fetch,l,(...u)=>{let[f,,h,p]=u;return{href:h??".",fetcherKey:f,...Lg(e,p??{})}});s&&(s[hr]=l,e.fetch=s)}return e}function Ui(e,a,i){return e.length===0?null:async(...l)=>{let s=await Bb(e,i(...l),()=>a(...l),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function Bb(e,a,i,l){let s=e[l],u;if(s){let f,h=async()=>(f?console.error("You cannot call instrumented handlers more than once"):f=Bb(e,a,i,l-1),u=await f,je(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await s(h,a)}catch(p){console.error("An instrumentation function threw an error:",p)}f||await h(),await f}else try{u={type:"success",value:await i()}}catch(f){u={type:"error",value:f}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function kg(e){let{request:a,context:i,params:l,unstable_pattern:s}=e;return{request:CR(a),params:{...l},unstable_pattern:s,context:jR(i)}}function Lg(e,a){return{currentUrl:ia(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 CR(e){return{method:e.method,url:e.url,headers:{get:(...a)=>e.headers.get(...a)}}}function jR(e){if(OR(e)){let a={...e};return Object.freeze(a),a}else return{get:a=>e.get(a)}}var NR=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function OR(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")===NR}var Hb=["POST","PUT","PATCH","DELETE"],MR=new Set(Hb),DR=["GET",...Hb],kR=new Set(DR),Ub=new Set([301,302,303,307,308]),LR=new Set([307,308]),pd={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},BR={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},HR=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),$b="remix-router-transitions",Zb=Symbol("ResetLoaderData");function UR(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";je(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let l=e.hydrationRouteProperties||[],s=e.mapRoutePro)DELIM" +R"DELIM(perties||HR,u=s;if(e.unstable_instrumentations){let A=e.unstable_instrumentations;u=D=>({...s(D),...zR(A.map($=>$.route).filter(Boolean),D)})}let f={},h=co(e.routes,u,void 0,f),p,m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let b=e.dataStrategy||PR,v={unstable_passThroughRequests:!1,...e.future},x=null,w=new Set,_=null,E=null,R=null,M=e.hydrationData!=null,L=fr(h,e.history.location,m),B=!1,Y=null,K,ie;if(L==null&&!e.patchRoutesOnNavigation){let A=Mn(404,{pathname:e.history.location.pathname}),{matches:D,route:$}=Js(h);K=!0,ie=!K,L=D,Y={[$.id]:A}}else if(L&&!e.hydrationData&&La(L,h,e.history.location.pathname).active&&(L=null),L)if(L.some(A=>A.route.lazy))K=!1,ie=!K;else if(!L.some(A=>Eh(A.route)))K=!0,ie=!K;else{let A=e.hydrationData?e.hydrationData.loaderData:null,D=e.hydrationData?e.hydrationData.errors:null,$=L;if(D){let ee=L.findIndex(ae=>D[ae.route.id]!==void 0);$=$.slice(0,ee+1)}ie=!1,K=!0,$.forEach(ee=>{let ae=qb(ee.route,A,D);ie=ie||ae.renderFallback,K=K&&!ae.shouldLoad})}else{K=!1,ie=!K,L=[];let A=La(null,h,e.history.location.pathname);A.active&&A.matches&&(B=!0,L=A.matches)}let I,O={historyAction:e.history.action,location:e.history.location,matches:L,initialized:K,renderFallback:ie,navigation:pd,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||Y,fetchers:new Map,blockers:new Map},se="POP",ue=null,de=!1,te,ge=!1,Oe=new Map,V=null,j=!1,Q=!1,W=new Set,re=new Map,xe=0,C=-1,P=new Map,ne=new Set,le=new Map,we=new Map,Re=new Set,oe=new Map,Me,Ae=null;function Gt(){if(x=e.history.listen(({action:A,location:D,delta:$})=>{if(Me){Me(),Me=void 0;return}bt(oe.size===0||$!=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 ee=Sr({currentLocation:O.location,nextLocation:D,historyAction:A});if(ee&&$!=null){let ae=new Promise(pe=>{Me=pe});e.history.go($*-1),ca(ee,{state:"blocked",location:D,proceed(){ca(ee,{state:"proceeding",proceed:void 0,reset:void 0,location:D}),ae.then(()=>e.history.go($))},reset(){let pe=new Map(O.blockers);pe.set(ee,Yl),ht({blockers:pe})}}),ue?.resolve(),ue=null;return}return Xe(A,D)}),i){sz(a,Oe);let A=()=>uz(a,Oe);a.addEventListener("pagehide",A),V=()=>a.removeEventListener("pagehide",A)}return O.initialized||Xe("POP",O.location,{initialHydration:!0}),I}function Yt(){x&&x(),V&&V(),w.clear(),te&&te.abort(),O.fetchers.forEach((A,D)=>ua(D)),O.blockers.forEach((A,D)=>xr(D))}function wn(A){return w.add(A),()=>w.delete(A)}function ht(A,D={}){A.matches&&(A.matches=A.matches.map(ae=>{let pe=f[ae.route.id],ce=ae.route;return ce.element!==pe.element||ce.errorElement!==pe.errorElement||ce.hydrateFallbackElement!==pe.hydrateFallbackElement?{...ae,route:pe}:ae})),O={...O,...A};let $=[],ee=[];O.fetchers.forEach((ae,pe)=>{ae.state==="idle"&&(Re.has(pe)?$.push(pe):ee.push(pe))}),Re.forEach(ae=>{!O.fetchers.has(ae)&&!re.has(ae)&&$.push(ae)}),[...w].forEach(ae=>ae(O,{deletedFetchers:$,newErrors:A.errors??null,viewTransitionOpts:D.viewTransitionOpts,flushSync:D.flushSync===!0})),$.forEach(ae=>ua(ae)),ee.forEach(ae=>O.fetchers.delete(ae))}function Ze(A,D,{flushSync:$}={}){let ee=O.actionData!=null&&O.navigation.formMethod!=null&&Xt(O.navigation.formMethod)&&O.navigation.state==="loading"&&A.state?._isRedirect!==!0,ae;D.actionData?Object.keys(D.actionData).length>0?ae=D.actionData:ae=null:ee?ae=O.actionData:ae=null;let pe=D.loaderData?Fg(O.loaderData,D.loaderData,D.matches||[],D.errors):O.loaderData,ce=O.blockers;ce.size>0&&(ce=new Map(ce),ce.forEach((_e,be)=>ce.set(be,Yl)));let fe=j?!1:Ii(A,D.matches||O.matches),ye=de===!0||O.navigation.formMethod!=null&&Xt(O.navigation.formMethod)&&A.state?._isRedirect!==!0;p&&(h=p,p=void 0),j||se==="POP"||(se==="PUSH"?e.history.push(A,A.state):se==="REPLACE"&&e.history.replace(A,A.state));let he;if(se==="POP"){let _e=Oe.get(O.location.pathname);_e&&_e.has(A.pathname)?he={currentLocation:O.location,nextLocation:A}:Oe.has(A.pathname)&&(he={currentLocation:A,nextLocation:O.location})}else if(ge){let _e=Oe.get(O.location.pathname);_e?_e.add(A.pathname):(_e=new Set([A.pathname]),Oe.set(O.location.pathname,_e)),he={currentLocation:O.location,nextLocation:A}}ht({...D,actionData:ae,loaderData:pe,historyAction:se,location:A,initialized:!0,renderFallback:!1,navigation:pd,revalidation:"idle",restoreScrollPosition:fe,preventScrollReset:ye,blockers:ce},{viewTransitionOpts:he,flushSync:$===!0}),se="POP",de=!1,ge=!1,j=!1,Q=!1,ue?.resolve(),ue=null,Ae?.resolve(),Ae=null}async function lt(A,D){if(ue?.resolve(),ue=null,typeof A=)DELIM" +R"DELIM(="number"){ue||(ue=Jg());let at=ue.promise;return e.history.go(A),at}let $=Id(O.location,O.matches,m,A,D?.fromRouteId,D?.relative),{path:ee,submission:ae,error:pe}=Bg(!1,$,D),ce;D?.unstable_mask&&(ce={pathname:"",search:"",hash:"",...typeof D.unstable_mask=="string"?la(D.unstable_mask):{...O.location.unstable_mask,...D.unstable_mask}});let fe=O.location,ye=uo(fe,ee,D&&D.state,void 0,ce);ye={...ye,...e.history.encodeLocation(ye)};let he=D&&D.replace!=null?D.replace:void 0,_e="PUSH";he===!0?_e="REPLACE":he===!1||ae!=null&&Xt(ae.formMethod)&&ae.formAction===O.location.pathname+O.location.search&&(_e="REPLACE");let be=D&&"preventScrollReset"in D?D.preventScrollReset===!0:void 0,Ge=(D&&D.flushSync)===!0,De=Sr({currentLocation:fe,nextLocation:ye,historyAction:_e});if(De){ca(De,{state:"blocked",location:ye,proceed(){ca(De,{state:"proceeding",proceed:void 0,reset:void 0,location:ye}),lt(A,D)},reset(){let at=new Map(O.blockers);at.set(De,Yl),ht({blockers:at})}});return}await Xe(_e,ye,{submission:ae,pendingError:pe,preventScrollReset:be,replace:D&&D.replace,enableViewTransition:D&&D.viewTransition,flushSync:Ge,callSiteDefaultShouldRevalidate:D&&D.unstable_defaultShouldRevalidate})}function Pe(){Ae||(Ae=Jg()),Da(),ht({revalidation:"loading"});let A=Ae.promise;return O.navigation.state==="submitting"?A:O.navigation.state==="idle"?(Xe(O.historyAction,O.location,{startUninterruptedRevalidation:!0}),A):(Xe(se||O.historyAction,O.navigation.location,{overrideNavigation:O.navigation,enableViewTransition:ge===!0}),A)}async function Xe(A,D,$){te&&te.abort(),te=null,se=A,j=($&&$.startUninterruptedRevalidation)===!0,qu(O.location,O.matches),de=($&&$.preventScrollReset)===!0,ge=($&&$.enableViewTransition)===!0;let ee=p||h,ae=$&&$.overrideNavigation,pe=$?.initialHydration&&O.matches&&O.matches.length>0&&!B?O.matches:fr(ee,D,m),ce=($&&$.flushSync)===!0;if(pe&&O.initialized&&!Q&&IR(O.location,D)&&!($&&$.submission&&Xt($.submission.formMethod))){Ze(D,{matches:pe},{flushSync:ce});return}let fe=La(pe,ee,D.pathname);if(fe.active&&fe.matches&&(pe=fe.matches),!pe){let{error:ot,notFoundMatches:yt,route:qe}=Zn(D.pathname);Ze(D,{matches:yt,loaderData:{},errors:{[qe.id]:ot}},{flushSync:ce});return}te=new AbortController;let ye=Bi(e.history,D,te.signal,$&&$.submission),he=e.getContext?await e.getContext():new Ng,_e;if($&&$.pendingError)_e=[dr(pe).route.id,{type:"error",error:$.pendingError}];else if($&&$.submission&&Xt($.submission.formMethod)){let ot=await Kn(ye,D,$.submission,pe,he,fe.active,$&&$.initialHydration===!0,{replace:$.replace,flushSync:ce});if(ot.shortCircuited)return;if(ot.pendingActionResult){let[yt,qe]=ot.pendingActionResult;if(bn(qe)&&fo(qe.error)&&qe.error.status===404){te=null,Ze(D,{matches:ot.matches,loaderData:{},errors:{[yt]:qe.error}});return}}pe=ot.matches||pe,_e=ot.pendingActionResult,ae=yd(D,$.submission),ce=!1,fe.active=!1,ye=Bi(e.history,ye.url,ye.signal)}let{shortCircuited:be,matches:Ge,loaderData:De,errors:at}=await br(ye,D,pe,he,fe.active,ae,$&&$.submission,$&&$.fetcherSubmission,$&&$.replace,$&&$.initialHydration===!0,ce,_e,$&&$.callSiteDefaultShouldRevalidate);be||(te=null,Ze(D,{matches:Ge||pe,...Kg(_e),loaderData:De,errors:at}))}async function Kn(A,D,$,ee,ae,pe,ce,fe={}){Da();let ye=lz(D,$);if(ht({navigation:ye},{flushSync:fe.flushSync===!0}),pe){let be=await Vn(ee,D.pathname,A.signal);if(be.type==="aborted")return{shortCircuited:!0};if(be.type==="error"){if(be.partialMatches.length===0){let{matches:De,route:at}=Js(h);return{matches:De,pendingActionResult:[at.id,{type:"error",error:be.error}]}}let Ge=dr(be.partialMatches).route.id;return{matches:be.partialMatches,pendingActionResult:[Ge,{type:"error",error:be.error}]}}else if(be.matches)ee=be.matches;else{let{notFoundMatches:Ge,error:De,route:at}=Zn(D.pathname);return{matches:Ge,pendingActionResult:[at.id,{type:"error",error:De}]}}}let he,_e=su(ee,D);if(!_e.route.action&&!_e.route.lazy)he={type:"error",error:Mn(405,{method:A.method,pathname:D.pathname,routeId:_e.route.id})};else{let be=Zi(u,f,A,D,ee,_e,ce?[]:l,ae),Ge=await Ma(A,D,be,ae,null);if(he=Ge[_e.route.id],!he){for(let De of ee)if(Ge[De.route.id]){he=Ge[De.route.id];break}}if(A.signal.aborted)return{shortCircuited:!0}}if(qr(he)){let be;return fe&&fe.replace!=null?be=fe.replace:be=Pg(he.response.headers.get("Location"),new URL(A.url),m,e.history)===O.location.pathname+O.location.search,await sa(A,he,!0,{submission:$,replace:be}),{shortCircuited:!0}}if(bn(he)){let be=dr(ee,_e.route.id);return(fe&&fe.replace)!==!0&&(se="PUSH"),{matches:ee,pendingActionResult:[be.route.id,he,_e.route.id]}}return{matches:ee,pendingActionResult:[_e.route.id,he]}}async function br(A,D,$,ee,ae,pe,ce,fe,ye,he,_e,be,Ge){let De=pe||yd(D,ce),at=ce||fe||Xg(De),ot=!j&&!he;if(ae){if(ot){let xt=Oa(be);ht({navigation:De,...xt!==void 0?{actionData:xt}:{}},{flushSync:_e})}let ke=await Vn($,D.pathname,A.signal);if(ke.type==="aborted")return{shortCircuited:!0};if(ke.type==="error"){if(ke.partialMatches.length===0){let{matches:Kt,route:Rt}=J)DELIM" +R"DELIM(s(h);return{matches:Kt,loaderData:{},errors:{[Rt.id]:ke.error}}}let xt=dr(ke.partialMatches).route.id;return{matches:ke.partialMatches,loaderData:{},errors:{[xt]:ke.error}}}else if(ke.matches)$=ke.matches;else{let{error:xt,notFoundMatches:Kt,route:Rt}=Zn(D.pathname);return{matches:Kt,loaderData:{},errors:{[Rt.id]:xt}}}}let yt=p||h,{dsMatches:qe,revalidatingFetchers:Tt}=Hg(A,ee,u,f,e.history,O,$,at,D,he?[]:l,he===!0,Q,W,Re,le,ne,yt,m,e.patchRoutesOnNavigation!=null,be,Ge);if(C=++xe,!e.dataStrategy&&!qe.some(ke=>ke.shouldLoad)&&!qe.some(ke=>ke.route.middleware&&ke.route.middleware.length>0)&&Tt.length===0){let ke=zo();return Ze(D,{matches:$,loaderData:{},errors:be&&bn(be[1])?{[be[0]]:be[1].error}:null,...Kg(be),...ke?{fetchers:new Map(O.fetchers)}:{}},{flushSync:_e}),{shortCircuited:!0}}if(ot){let ke={};if(!ae){ke.navigation=De;let xt=Oa(be);xt!==void 0&&(ke.actionData=xt)}Tt.length>0&&(ke.fetchers=Xi(Tt)),ht(ke,{flushSync:_e})}Tt.forEach(ke=>{kt(ke.key),ke.controller&&re.set(ke.key,ke.controller)});let it=()=>Tt.forEach(ke=>kt(ke.key));te&&te.signal.addEventListener("abort",it);let{loaderResults:Ba,fetcherResults:qn}=await Ji(qe,Tt,A,D,ee);if(A.signal.aborted)return{shortCircuited:!0};te&&te.signal.removeEventListener("abort",it),Tt.forEach(ke=>re.delete(ke.key));let Lt=Is(Ba);if(Lt)return await sa(A,Lt.result,!0,{replace:ye}),{shortCircuited:!0};if(Lt=Is(qn),Lt)return ne.add(Lt.key),await sa(A,Lt.result,!0,{replace:ye}),{shortCircuited:!0};let{loaderData:Xn,errors:wr}=Yg(O,$,Ba,be,Tt,qn);he&&O.errors&&(wr={...O.errors,...wr});let Jn=zo(),_r=Ao(C),Vr=Jn||_r||Tt.length>0;return{matches:$,loaderData:Xn,errors:wr,...Vr?{fetchers:new Map(O.fetchers)}:{}}}function Oa(A){if(A&&!bn(A[1]))return{[A[0]]:A[1].data};if(O.actionData)return Object.keys(O.actionData).length===0?null:O.actionData}function Xi(A){return A.forEach(D=>{let $=O.fetchers.get(D.key),ee=Fl(void 0,$?$.data:void 0);O.fetchers.set(D.key,ee)}),new Map(O.fetchers)}async function Hu(A,D,$,ee){kt(A);let ae=(ee&&ee.flushSync)===!0,pe=p||h,ce=Id(O.location,O.matches,m,$,D,ee?.relative),fe=fr(pe,ce,m),ye=La(fe,pe,ce);if(ye.active&&ye.matches&&(fe=ye.matches),!fe){_n(A,D,Mn(404,{pathname:ce}),{flushSync:ae});return}let{path:he,submission:_e,error:be}=Bg(!0,ce,ee);if(be){_n(A,D,be,{flushSync:ae});return}let Ge=e.getContext?await e.getContext():new Ng,De=(ee&&ee.preventScrollReset)===!0;if(_e&&Xt(_e.formMethod)){await Uu(A,D,he,fe,Ge,ye.active,ae,De,_e,ee&&ee.unstable_defaultShouldRevalidate);return}le.set(A,{routeId:D,path:he}),await Jt(A,D,he,fe,Ge,ye.active,ae,De,_e)}async function Uu(A,D,$,ee,ae,pe,ce,fe,ye,he){Da(),le.delete(A);let _e=O.fetchers.get(A);$n(A,oz(ye,_e),{flushSync:ce});let be=new AbortController,Ge=Bi(e.history,$,be.signal,ye);if(pe){let st=await Vn(ee,new URL(Ge.url).pathname,Ge.signal,A);if(st.type==="aborted")return;if(st.type==="error"){_n(A,D,st.error,{flushSync:ce});return}else if(st.matches)ee=st.matches;else{_n(A,D,Mn(404,{pathname:$}),{flushSync:ce});return}}let De=su(ee,$);if(!De.route.action&&!De.route.lazy){let st=Mn(405,{method:ye.formMethod,pathname:$,routeId:D});_n(A,D,st,{flushSync:ce});return}re.set(A,be);let at=xe,ot=Zi(u,f,Ge,$,ee,De,l,ae),yt=await Ma(Ge,$,ot,ae,A),qe=yt[De.route.id];if(!qe){for(let st of ot)if(yt[st.route.id]){qe=yt[st.route.id];break}}if(Ge.signal.aborted){re.get(A)===be&&re.delete(A);return}if(Re.has(A)){if(qr(qe)||bn(qe)){$n(A,Ca(void 0));return}}else{if(qr(qe))if(re.delete(A),C>at){$n(A,Ca(void 0));return}else return ne.add(A),$n(A,Fl(ye)),sa(Ge,qe,!1,{fetcherSubmission:ye,preventScrollReset:fe});if(bn(qe)){_n(A,D,qe.error);return}}let Tt=O.navigation.location||O.location,it=Bi(e.history,Tt,be.signal),Ba=p||h,qn=O.navigation.state!=="idle"?fr(Ba,O.navigation.location,m):O.matches;je(qn,"Didn't find any matches after fetcher action");let Lt=++xe;P.set(A,Lt);let Xn=Fl(ye,qe.data);O.fetchers.set(A,Xn);let{dsMatches:wr,revalidatingFetchers:Jn}=Hg(it,ae,u,f,e.history,O,qn,ye,Tt,l,!1,Q,W,Re,le,ne,Ba,m,e.patchRoutesOnNavigation!=null,[De.route.id,qe],he);Jn.filter(st=>st.key!==A).forEach(st=>{let Xr=st.key,Jr=O.fetchers.get(Xr),Oo=Fl(void 0,Jr?Jr.data:void 0);O.fetchers.set(Xr,Oo),kt(Xr),st.controller&&re.set(Xr,st.controller)}),ht({fetchers:new Map(O.fetchers)});let _r=()=>Jn.forEach(st=>kt(st.key));be.signal.addEventListener("abort",_r);let{loaderResults:Vr,fetcherResults:ke}=await Ji(wr,Jn,it,Tt,ae);if(be.signal.aborted)return;if(be.signal.removeEventListener("abort",_r),P.delete(A),re.delete(A),Jn.forEach(st=>re.delete(st.key)),O.fetchers.has(A)){let st=Ca(qe.data);O.fetchers.set(A,st)}let xt=Is(Vr);if(xt)return sa(it,xt.result,!1,{preventScrollReset:fe});if(xt=Is(ke),xt)return ne.add(xt.key),sa(it,xt.result,!1,{preventScrollReset:fe});let{loaderData:Kt,errors:Rt}=Yg(O,qn,Vr,void 0,Jn,ke);Ao(Lt),O.navigation.state==="loading"&&Lt>C?(je(se,"Expected pending action"),te&&te.abort(),Ze(O.navigation.location,{matches:qn,loaderData:Kt,errors:Rt,fetchers:new Map(O.fetchers)})):(ht({errors:Rt,loaderData:Fg(O.lo)DELIM" +R"DELIM(aderData,Kt,qn,Rt),fetchers:new Map(O.fetchers)}),Q=!1)}async function Jt(A,D,$,ee,ae,pe,ce,fe,ye){let he=O.fetchers.get(A);$n(A,Fl(ye,he?he.data:void 0),{flushSync:ce});let _e=new AbortController,be=Bi(e.history,$,_e.signal);if(pe){let qe=await Vn(ee,new URL(be.url).pathname,be.signal,A);if(qe.type==="aborted")return;if(qe.type==="error"){_n(A,D,qe.error,{flushSync:ce});return}else if(qe.matches)ee=qe.matches;else{_n(A,D,Mn(404,{pathname:$}),{flushSync:ce});return}}let Ge=su(ee,$);re.set(A,_e);let De=xe,at=Zi(u,f,be,$,ee,Ge,l,ae),yt=(await Ma(be,$,at,ae,A))[Ge.route.id];if(re.get(A)===_e&&re.delete(A),!be.signal.aborted){if(Re.has(A)){$n(A,Ca(void 0));return}if(qr(yt))if(C>De){$n(A,Ca(void 0));return}else{ne.add(A),await sa(be,yt,!1,{preventScrollReset:fe});return}if(bn(yt)){_n(A,D,yt.error);return}$n(A,Ca(yt.data))}}async function sa(A,D,$,{submission:ee,fetcherSubmission:ae,preventScrollReset:pe,replace:ce}={}){$||(ue?.resolve(),ue=null),D.response.headers.has("X-Remix-Revalidate")&&(Q=!0);let fe=D.response.headers.get("Location");je(fe,"Expected a Location header on the redirect Response"),fe=Pg(fe,new URL(A.url),m,e.history);let ye=uo(O.location,fe,{_isRedirect:!0});if(i){let at=!1;if(D.response.headers.has("X-Remix-Reload-Document"))at=!0;else if(wh(fe)){const ot=jb(fe,!0);at=ot.origin!==a.location.origin||Ln(ot.pathname,m)==null}if(at){ce?a.location.replace(fe):a.location.assign(fe);return}}te=null;let he=ce===!0||D.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:_e,formAction:be,formEncType:Ge}=O.navigation;!ee&&!ae&&_e&&be&&Ge&&(ee=Xg(O.navigation));let De=ee||ae;if(LR.has(D.response.status)&&De&&Xt(De.formMethod))await Xe(he,ye,{submission:{...De,formAction:fe},preventScrollReset:pe||de,enableViewTransition:$?ge:void 0});else{let at=yd(ye,ee);await Xe(he,ye,{overrideNavigation:at,fetcherSubmission:ae,preventScrollReset:pe||de,enableViewTransition:$?ge:void 0})}}async function Ma(A,D,$,ee,ae){let pe,ce={};try{pe=await YR(b,A,D,$,ae,ee,!1)}catch(fe){return $.filter(ye=>ye.shouldLoad).forEach(ye=>{ce[ye.route.id]={type:"error",error:fe}}),ce}if(A.signal.aborted)return ce;if(!Xt(A.method))for(let fe of $){if(pe[fe.route.id]?.type==="error")break;!pe.hasOwnProperty(fe.route.id)&&!O.loaderData.hasOwnProperty(fe.route.id)&&(!O.errors||!O.errors.hasOwnProperty(fe.route.id))&&fe.shouldCallHandler()&&(pe[fe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${fe.route.id}`)})}for(let[fe,ye]of Object.entries(pe))if(nz(ye)){let he=ye.result;ce[fe]={type:"redirect",response:XR(he,A,fe,$,m)}}else ce[fe]=await VR(ye);return ce}async function Ji(A,D,$,ee,ae){let pe=Ma($,ee,A,ae,null),ce=Promise.all(D.map(async he=>{if(he.matches&&he.match&&he.request&&he.controller){let be=(await Ma(he.request,he.path,he.matches,ae,he.key))[he.match.route.id];return{[he.key]:be}}else return Promise.resolve({[he.key]:{type:"error",error:Mn(404,{pathname:he.path})}})})),fe=await pe,ye=(await ce).reduce((he,_e)=>Object.assign(he,_e),{});return{loaderResults:fe,fetcherResults:ye}}function Da(){Q=!0,le.forEach((A,D)=>{re.has(D)&&W.add(D),kt(D)})}function $n(A,D,$={}){O.fetchers.set(A,D),ht({fetchers:new Map(O.fetchers)},{flushSync:($&&$.flushSync)===!0})}function _n(A,D,$,ee={}){let ae=dr(O.matches,D);ua(A),ht({errors:{[ae.route.id]:$},fetchers:new Map(O.fetchers)},{flushSync:(ee&&ee.flushSync)===!0})}function Ro(A){return we.set(A,(we.get(A)||0)+1),Re.has(A)&&Re.delete(A),O.fetchers.get(A)||BR}function $u(A,D){kt(A,D?.reason),$n(A,Ca(null))}function ua(A){let D=O.fetchers.get(A);re.has(A)&&!(D&&D.state==="loading"&&P.has(A))&&kt(A),le.delete(A),P.delete(A),ne.delete(A),Re.delete(A),W.delete(A),O.fetchers.delete(A)}function It(A){let D=(we.get(A)||0)-1;D<=0?(we.delete(A),Re.add(A)):we.set(A,D),ht({fetchers:new Map(O.fetchers)})}function kt(A,D){let $=re.get(A);$&&($.abort(D),re.delete(A))}function Ft(A){for(let D of A){let $=Ro(D),ee=Ca($.data);O.fetchers.set(D,ee)}}function zo(){let A=[],D=!1;for(let $ of ne){let ee=O.fetchers.get($);je(ee,`Expected fetcher: ${$}`),ee.state==="loading"&&(ne.delete($),A.push($),D=!0)}return Ft(A),D}function Ao(A){let D=[];for(let[$,ee]of P)if(ee0}function Zu(A,D){let $=O.blockers.get(A)||Yl;return oe.get(A)!==D&&oe.set(A,D),$}function xr(A){O.blockers.delete(A),oe.delete(A)}function ca(A,D){let $=O.blockers.get(A)||Yl;je($.state==="unblocked"&&D.state==="blocked"||$.state==="blocked"&&D.state==="blocked"||$.state==="blocked"&&D.state==="proceeding"||$.state==="blocked"&&D.state==="unblocked"||$.state==="proceeding"&&D.state==="unblocked",`Invalid blocker state transition: ${$.state} -> ${D.state}`);let ee=new Map(O.blockers);ee.set(A,D),ht({blockers:ee})}function Sr({currentLocation:A,nextLocation:D,historyAction:$}){if(oe.size===0)return;oe.size>1&&bt(!1,"A router only supports one blocker at a time");let ee=A)DELIM" +R"DELIM(rray.from(oe.entries()),[ae,pe]=ee[ee.length-1],ce=O.blockers.get(ae);if(!(ce&&ce.state==="proceeding")&&pe({currentLocation:A,nextLocation:D,historyAction:$}))return ae}function Zn(A){let D=Mn(404,{pathname:A}),$=p||h,{matches:ee,route:ae}=Js($);return{notFoundMatches:ee,route:ae,error:D}}function Kr(A,D,$){if(_=A,R=D,E=$||null,!M&&O.navigation===pd){M=!0;let ee=Ii(O.location,O.matches);ee!=null&&ht({restoreScrollPosition:ee})}return()=>{_=null,R=null,E=null}}function ka(A,D){return E&&E(A,D.map(ee=>uR(ee,O.loaderData)))||A.key}function qu(A,D){if(_&&R){let $=ka(A,D);_[$]=R()}}function Ii(A,D){if(_){let $=ka(A,D),ee=_[$];if(typeof ee=="number")return ee}return null}function La(A,D,$){if(e.patchRoutesOnNavigation)if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:Il(D,$,m,!0)}}else return{active:!0,matches:Il(D,$,m,!0)||[]};return{active:!1,matches:null}}async function Vn(A,D,$,ee){if(!e.patchRoutesOnNavigation)return{type:"success",matches:A};let ae=A;for(;;){let pe=p==null,ce=p||h,fe=f;try{await e.patchRoutesOnNavigation({signal:$,path:D,matches:ae,fetcherKey:ee,patch:(_e,be)=>{$.aborted||Ug(_e,be,ce,fe,u,!1)}})}catch(_e){return{type:"error",error:_e,partialMatches:ae}}finally{pe&&!$.aborted&&(h=[...h])}if($.aborted)return{type:"aborted"};let ye=fr(ce,D,m),he=null;if(ye){if(Object.keys(ye[0].params).length===0)return{type:"success",matches:ye};if(he=Il(ce,D,m,!0),!(he&&ae.length$.route.id===D[ee].route.id)}function jo(A){f={},p=co(A,u,void 0,f)}function No(A,D,$=!1){let ee=p==null;Ug(A,D,p||h,f,u,$),ee&&(h=[...h],ht({}))}return I={get basename(){return m},get future(){return v},get state(){return O},get routes(){return h},get window(){return a},initialize:Gt,subscribe:wn,enableScrollRestoration:Kr,navigate:lt,fetch:Hu,revalidate:Pe,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Ro,resetFetcher:$u,deleteFetcher:It,dispose:Yt,getBlocker:Zu,deleteBlocker:xr,patchRoutes:No,_internalFetchControllers:re,_internalSetRoutes:jo,_internalSetStateDoNotUseOrYouWillBreakYourApp(A){ht(A)}},e.unstable_instrumentations&&(I=AR(I,e.unstable_instrumentations.map(A=>A.router).filter(Boolean))),I}function $R(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Id(e,a,i,l,s,u){let f,h;if(s){f=[];for(let m of a)if(f.push(m),m.route.id===s){h=m;break}}else f=a,h=a[a.length-1];let p=So(l||".",Mu(f),Ln(e.pathname,i)||e.pathname,u==="path");if(l==null&&(p.search=e.search,p.hash=e.hash),(l==null||l===""||l===".")&&h){let m=Rh(p.search);if(h.route.index&&!m)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!h.route.index&&m){let b=new URLSearchParams(p.search),v=b.getAll("index");b.delete("index"),v.filter(w=>w).forEach(w=>b.append("index",w));let x=b.toString();p.search=x?`?${x}`:""}}return i!=="/"&&(p.pathname=wR({basename:i,pathname:p.pathname})),ia(p)}function Bg(e,a,i){if(!i||!$R(i))return{path:a};if(i.formMethod&&!iz(i.formMethod))return{path:a,error:Mn(405,{method:i.formMethod})};let l=()=>({path:a,error:Mn(400,{type:"invalid-body"})}),u=(i.formMethod||"get").toUpperCase(),f=Vb(a);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!Xt(u))return l();let v=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((x,[w,_])=>`${x}${w}=${_} +`,""):String(i.body);return{path:a,submission:{formMethod:u,formAction:f,formEncType:i.formEncType,formData:void 0,json:void 0,text:v}}}else if(i.formEncType==="application/json"){if(!Xt(u))return l();try{let v=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:a,submission:{formMethod:u,formAction:f,formEncType:i.formEncType,formData:void 0,json:v,text:void 0}}}catch{return l()}}}je(typeof FormData=="function","FormData is not available in this environment");let h,p;if(i.formData)h=eh(i.formData),p=i.formData;else if(i.body instanceof FormData)h=eh(i.body),p=i.body;else if(i.body instanceof URLSearchParams)h=i.body,p=Gg(h);else if(i.body==null)h=new URLSearchParams,p=new FormData;else try{h=new URLSearchParams(i.body),p=Gg(h)}catch{return l()}let m={formMethod:u,formAction:f,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(Xt(m.formMethod))return{path:a,submission:m};let b=la(a);return e&&b.search&&Rh(b.search)&&h.append("index",""),b.search=`?${h}`,{path:ia(b),submission:m}}function Hg(e,a,i,l,s,u,f,h,p,m,b,v,x,w,_,E,R,M,L,B,Y){let K=B?bn(B[1])?B[1].error:B[1].data:void 0,ie=s.createURL(u.location),I=s.createURL(p),O;if(b&&u.errors){let V=Object.keys(u.errors)[0];O=f.findIndex(j=>j.route.id===V)}else if(B&&bn(B[1])){let V=B[0];O=f.findIndex(j=>j.route.id===V)-1}let se=B?B[1].statusCode:void 0,ue=se&&se>=400,de={cur)DELIM" +R"DELIM(rentUrl:ie,currentParams:u.matches[0]?.params||{},nextUrl:I,nextParams:f[0].params,...h,actionResult:K,actionStatus:se},te=_o(f),ge=f.map((V,j)=>{let{route:Q}=V,W=null;if(O!=null&&j>O)W=!1;else if(Q.lazy)W=!0;else if(!Eh(Q))W=!1;else if(b){let{shouldLoad:P}=qb(Q,u.loaderData,u.errors);W=P}else ZR(u.loaderData,u.matches[j],V)&&(W=!0);if(W!==null)return Wd(i,l,e,p,te,V,m,a,W);let re=!1;typeof Y=="boolean"?re=Y:ue?re=!1:(v||ie.pathname+ie.search===I.pathname+I.search||ie.search!==I.search||qR(u.matches[j],V))&&(re=!0);let xe={...de,defaultShouldRevalidate:re},C=Wl(V,xe);return Wd(i,l,e,p,te,V,m,a,C,xe,Y)}),Oe=[];return _.forEach((V,j)=>{if(b||!f.some(le=>le.route.id===V.routeId)||w.has(j))return;let Q=u.fetchers.get(j),W=Q&&Q.state!=="idle"&&Q.data===void 0,re=fr(R,V.path,M);if(!re){if(L&&W)return;Oe.push({key:j,routeId:V.routeId,path:V.path,matches:null,match:null,request:null,controller:null});return}if(E.has(j))return;let xe=su(re,V.path),C=new AbortController,P=Bi(s,V.path,C.signal),ne=null;if(x.has(j))x.delete(j),ne=Zi(i,l,P,V.path,re,xe,m,a);else if(W)v&&(ne=Zi(i,l,P,V.path,re,xe,m,a));else{let le;typeof Y=="boolean"?le=Y:ue?le=!1:le=v;let we={...de,defaultShouldRevalidate:le};Wl(xe,we)&&(ne=Zi(i,l,P,V.path,re,xe,m,a,we))}ne&&Oe.push({key:j,routeId:V.routeId,path:V.path,matches:ne,match:xe,request:P,controller:C})}),{dsMatches:ge,revalidatingFetchers:Oe}}function Eh(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function qb(e,a,i){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Eh(e))return{shouldLoad:!1,renderFallback:!1};let l=a!=null&&e.id in a,s=i!=null&&i[e.id]!==void 0;if(!l&&s)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!l};let u=!l&&!s;return{shouldLoad:u,renderFallback:u}}function ZR(e,a,i){let l=!a||i.route.id!==a.route.id,s=!e.hasOwnProperty(i.route.id);return l||s}function qR(e,a){let i=e.route.path;return e.pathname!==a.pathname||i!=null&&i.endsWith("*")&&e.params["*"]!==a.params["*"]}function Wl(e,a){if(e.route.shouldRevalidate){let i=e.route.shouldRevalidate(a);if(typeof i=="boolean")return i}return a.defaultShouldRevalidate}function Ug(e,a,i,l,s,u){let f;if(e){let m=l[e];je(m,`No route found to patch children into: routeId = ${e}`),m.children||(m.children=[]),f=m.children}else f=i;let h=[],p=[];if(a.forEach(m=>{let b=f.find(v=>Qb(m,v));b?p.push({existingRoute:b,newRoute:m}):h.push(m)}),h.length>0){let m=co(h,s,[e||"_","patch",String(f?.length||"0")],l);f.push(...m)}if(u&&p.length>0)for(let m=0;ma.children?.some(s=>Qb(i,s)))??!1:!1}var $g=new WeakMap,Pb=({key:e,route:a,manifest:i,mapRouteProperties:l})=>{let s=i[a.id];if(je(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let u=s.lazy[e];if(!u)return;let f=$g.get(s);f||(f={},$g.set(s,f));let h=f[e];if(h)return h;let p=(async()=>{let m=iR(e),v=s[e]!==void 0&&e!=="hasErrorBoundary";if(m)bt(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),f[e]=Promise.resolve();else if(v)bt(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await u();x!=null&&(Object.assign(s,{[e]:x}),Object.assign(s,l(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(x=>x===void 0)&&(s.lazy=void 0))})();return f[e]=p,p},Zg=new WeakMap;function QR(e,a,i,l,s){let u=i[e.id];if(je(u,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let b=Zg.get(u);if(b)return{lazyRoutePromise:b,lazyHandlerPromise:b};let v=(async()=>{je(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),w={};for(let _ in x){let E=x[_];if(E===void 0)continue;let R=oR(_),L=u[_]!==void 0&&_!=="hasErrorBoundary";R?bt(!R,"Route property "+_+" is not a supported property to be returned from a lazy route function. This property will be ignored."):L?bt(!L,`Route "${u.id}" has a static property "${_}" defined but its lazy function is also returning a value for this property. The lazy route property "${_}" will be ignored.`):w[_]=E}Object.assign(u,w),Object.assign(u,{...l(u),lazy:void 0})})();return Zg.set(u,v),v.catch(()=>{}),{lazyRoutePromise:v,lazyHandlerPromise:v}}let f=Object.keys(e.lazy),h=[],p;for(let b of f){if(s&&s.includes(b))continue;let v=Pb({key:b,route:e,manifest:i,mapRouteProperties:l});v&&(h.push(v),b===a&&(p=v))}let m=h.length>0?)DELIM" +R"DELIM(Promise.all(h).then(()=>{}):void 0;return m?.catch(()=>{}),p?.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:p}}async function qg(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 PR(e){return e.matches.some(a=>a.route.middleware)?Gb(e,()=>qg(e)):qg(e)}function Gb(e,a){return GR(e,a,l=>{if(rz(l))throw l;return l},ez,i);function i(l,s,u){if(u)return Promise.resolve(Object.assign(u.value,{[s]:{type:"error",result:l}}));{let{matches:f}=e,h=Math.min(Math.max(f.findIndex(m=>m.route.id===s),0),Math.max(f.findIndex(m=>m.shouldCallHandler()),0)),p=dr(f,f[h].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:l}})}}}async function GR(e,a,i,l,s){let{matches:u,...f}=e,h=u.flatMap(m=>m.route.middleware?m.route.middleware.map(b=>[m.route.id,b]):[]);return await Yb(f,h,a,i,l,s)}async function Yb(e,a,i,l,s,u,f=0){let{request:h}=e;if(h.signal.aborted)throw h.signal.reason??new Error(`Request aborted: ${h.method} ${h.url}`);let p=a[f];if(!p)return await i();let[m,b]=p,v,x=async()=>{if(v)throw new Error("You may only call `next()` once per middleware");try{return v={value:await Yb(e,a,i,l,s,u,f+1)},v.value}catch(w){return v={value:await u(w,m,v)},v.value}};try{let w=await b(e,x),_=w!=null?l(w):void 0;return s(_)?_:v?_??v.value:(v={value:await x()},v.value)}catch(w){return await u(w,m,v)}}function Fb(e,a,i,l,s){let u=Pb({key:"middleware",route:l.route,manifest:a,mapRouteProperties:e}),f=QR(l.route,Xt(i.method)?"action":"loader",a,e,s);return{middleware:u,route:f.lazyRoutePromise,handler:f.lazyHandlerPromise}}function Wd(e,a,i,l,s,u,f,h,p,m=null,b){let v=!1,x=Fb(e,a,i,u,f);return{...u,_lazyPromises:x,shouldLoad:p,shouldRevalidateArgs:m,shouldCallHandler(w){return v=!0,m?typeof b=="boolean"?Wl(u,{...m,defaultShouldRevalidate:b}):typeof w=="boolean"?Wl(u,{...m,defaultShouldRevalidate:w}):Wl(u,m):p},resolve(w){let{lazy:_,loader:E,middleware:R}=u.route,M=v||p||w&&!Xt(i.method)&&(_||E),L=R&&R.length>0&&!E&&!_;return M&&(Xt(i.method)||!L)?FR({request:i,path:l,unstable_pattern:s,match:u,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:w,scopedContext:h}):Promise.resolve({type:"data",result:void 0})}}}function Zi(e,a,i,l,s,u,f,h,p=null){return s.map(m=>m.route.id!==u.route.id?{...m,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:Fb(e,a,i,m,f),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Wd(e,a,i,l,_o(s),m,f,h,!0,p))}async function YR(e,a,i,l,s,u,f){l.some(b=>b._lazyPromises?.middleware)&&await Promise.all(l.map(b=>b._lazyPromises?.middleware));let h={request:a,unstable_url:Kb(a,i),unstable_pattern:_o(l),params:l[0].params,context:u,matches:l},m=await e({...h,fetcherKey:s,runClientMiddleware:b=>{let v=h;return Gb(v,()=>b({...v,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(l.flatMap(b=>[b._lazyPromises?.handler,b._lazyPromises?.route]))}catch{}return m}async function FR({request:e,path:a,unstable_pattern:i,match:l,lazyHandlerPromise:s,lazyRoutePromise:u,handlerOverride:f,scopedContext:h}){let p,m,b=Xt(e.method),v=b?"action":"loader",x=w=>{let _,E=new Promise((L,B)=>_=B);m=()=>_(),e.signal.addEventListener("abort",m);let R=L=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${v}" [routeId: ${l.route.id}]`)):w({request:e,unstable_url:Kb(e,a),unstable_pattern:i,params:l.params,context:h},...L!==void 0?[L]:[]),M=(async()=>{try{return{type:"data",result:await(f?f(B=>R(B)):R())}}catch(L){return{type:"error",result:L}}})();return Promise.race([M,E])};try{let w=b?l.route.action:l.route.loader;if(s||u)if(w){let _,[E]=await Promise.all([x(w).catch(R=>{_=R}),s,u]);if(_!==void 0)throw _;p=E}else{await s;let _=b?l.route.action:l.route.loader;if(_)[p]=await Promise.all([x(_),u]);else if(v==="action"){let E=new URL(e.url),R=E.pathname+E.search;throw Mn(405,{method:e.method,pathname:R,routeId:l.route.id})}else return{type:"data",result:void 0}}else if(w)p=await x(w);else{let _=new URL(e.url),E=_.pathname+_.search;throw Mn(404,{pathname:E})}}catch(w){return{type:"error",result:w}}finally{m&&e.signal.removeEventListener("abort",m)}return p}async function KR(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 VR(e){let{result:a,type:i}=e;if(Th(a)){let l;try{l=await KR(a)}catch(s){return{type:"error",error:s}}return i==="error"?{type:"error",error:new wo(a.status,a.statusText,l),statusCode:a.status,headers:a.headers}:{type:"data",data:l,statusCode:a.status,headers:a.headers}}return i==="error"?Vg(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:WR(a),statusCode:fo(a)?a.status:void 0,headers:a.init?.header)DELIM" +R"DELIM(s?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:fo(a)?a.status:void 0}:Vg(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 XR(e,a,i,l,s){let u=e.headers.get("Location");if(je(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!wh(u)){let f=l.slice(0,l.findIndex(h=>h.route.id===i)+1);u=Id(new URL(a.url),f,s,u),e.headers.set("Location",u)}return e}var Qg=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Pg(e,a,i,l){if(wh(e)){let s=e,u=s.startsWith("//")?new URL(a.protocol+s):new URL(s);if(Qg.includes(u.protocol))throw new Error("Invalid redirect location");let f=Ln(u.pathname,i)!=null;if(u.origin===a.origin&&f)return _h(u.pathname)+u.search+u.hash}try{let s=l.createURL(e);if(Qg.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Bi(e,a,i,l){let s=e.createURL(Vb(a)).toString(),u={signal:i};if(l&&Xt(l.formMethod)){let{formMethod:f,formEncType:h}=l;u.method=f.toUpperCase(),h==="application/json"?(u.headers=new Headers({"Content-Type":h}),u.body=JSON.stringify(l.json)):h==="text/plain"?u.body=l.text:h==="application/x-www-form-urlencoded"&&l.formData?u.body=eh(l.formData):u.body=l.formData}return new Request(s,u)}function Kb(e,a){let i=new URL(e.url),l=typeof a=="string"?la(a):a;if(i.pathname=l.pathname||"/",l.search){let s=new URLSearchParams(l.search),u=s.getAll("index");s.delete("index");for(let f of u.filter(Boolean))s.append("index",f);i.search=s.size?`?${s.toString()}`:""}else i.search="";return i.hash=l.hash||"",i}function eh(e){let a=new URLSearchParams;for(let[i,l]of e.entries())a.append(i,typeof l=="string"?l:l.name);return a}function Gg(e){let a=new FormData;for(let[i,l]of e.entries())a.append(i,l);return a}function JR(e,a,i,l=!1,s=!1){let u={},f=null,h,p=!1,m={},b=i&&bn(i[1])?i[1].error:void 0;return e.forEach(v=>{if(!(v.route.id in a))return;let x=v.route.id,w=a[x];if(je(!qr(w),"Cannot handle redirect results in processLoaderData"),bn(w)){let _=w.error;if(b!==void 0&&(_=b,b=void 0),f=f||{},s)f[x]=_;else{let E=dr(e,x);f[E.route.id]==null&&(f[E.route.id]=_)}l||(u[x]=Zb),p||(p=!0,h=fo(w.error)?w.error.status:500),w.headers&&(m[x]=w.headers)}else u[x]=w.data,w.statusCode&&w.statusCode!==200&&!p&&(h=w.statusCode),w.headers&&(m[x]=w.headers)}),b!==void 0&&i&&(f={[i[0]]:b},i[2]&&(u[i[2]]=void 0)),{loaderData:u,errors:f,statusCode:h||200,loaderHeaders:m}}function Yg(e,a,i,l,s,u){let{loaderData:f,errors:h}=JR(a,i,l);return s.filter(p=>!p.matches||p.matches.some(m=>m.shouldLoad)).forEach(p=>{let{key:m,match:b,controller:v}=p;if(v&&v.signal.aborted)return;let x=u[m];if(je(x,"Did not find corresponding fetcher result"),bn(x)){let w=dr(e.matches,b?.route.id);h&&h[w.route.id]||(h={...h,[w.route.id]:x.error}),e.fetchers.delete(m)}else if(qr(x))je(!1,"Unhandled fetcher revalidation redirect");else{let w=Ca(x.data);e.fetchers.set(m,w)}}),{loaderData:f,errors:h}}function Fg(e,a,i,l){let s=Object.entries(a).filter(([,u])=>u!==Zb).reduce((u,[f,h])=>(u[f]=h,u),{});for(let u of i){let f=u.route.id;if(!a.hasOwnProperty(f)&&e.hasOwnProperty(f)&&u.route.loader&&(s[f]=e[f]),l&&l.hasOwnProperty(f))break}return s}function Kg(e){return e?bn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function dr(e,a){return(a?e.slice(0,e.findIndex(l=>l.route.id===a)+1):[...e]).reverse().find(l=>l.route.hasErrorBoundary===!0)||e[0]}function Js(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 Mn(e,{pathname:a,routeId:i,method:l,type:s,message:u}={}){let f="Unknown Server Error",h="Unknown @remix-run/router error";return e===400?(f="Bad Request",l&&a&&i?h=`You made a ${l} request to "${a}" but did not provide a \`loader\` for route "${i}", so there is no way to handle the request.`:s==="invalid-body"&&(h="Unable to encode submission body")):e===403?(f="Forbidden",h=`Route "${i}" does not match URL "${a}"`):e===404?(f="Not Found",h=`No route matches URL "${a}"`):e===405&&(f="Method Not Allowed",l&&a&&i?h=`You made a ${l.toUpperCase()} request to "${a}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:l&&(h=`Invalid request method "${l.toUpperCase()}"`)),new wo(e||500,f,new Error(h),!0)}function Is(e){let a=Object.entries(e);for(let i=a.length-1;i>=0;i--){let[l,s]=a[i];if(qr(s))return{key:l,result:s}}}function Vb(e){let a=typeof e=="string"?la(e):e;return ia({...a,hash:""})}function IR(e,a){return e.pathname!==a.pathname||e.search!==a.search?!1:e.hash===""?a.hash!=="":e.hash===a.hash?!0:a.hash!==""}function WR(e){return new wo(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function ez(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([a,i])=>typeof a=="string"&&tz(i))})DELIM" +R"DELIM(function tz(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function nz(e){return Th(e.result)&&Ub.has(e.result.status)}function bn(e){return e.type==="error"}function qr(e){return(e&&e.type)==="redirect"}function Vg(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Th(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function az(e){return Ub.has(e)}function rz(e){return Th(e)&&az(e.status)&&e.headers.has("Location")}function iz(e){return kR.has(e.toUpperCase())}function Xt(e){return MR.has(e.toUpperCase())}function Rh(e){return new URLSearchParams(e).getAll("index").some(a=>a==="")}function su(e,a){let i=typeof a=="string"?la(a).search:a.search;if(e[e.length-1].route.index&&Rh(i||""))return e[e.length-1];let l=Db(e);return l[l.length-1]}function Xg(e){let{formMethod:a,formAction:i,formEncType:l,text:s,formData:u,json:f}=e;if(!(!a||!i||!l)){if(s!=null)return{formMethod:a,formAction:i,formEncType:l,formData:void 0,json:void 0,text:s};if(u!=null)return{formMethod:a,formAction:i,formEncType:l,formData:u,json:void 0,text:void 0};if(f!==void 0)return{formMethod:a,formAction:i,formEncType:l,formData:void 0,json:f,text:void 0}}}function yd(e,a){return a?{state:"loading",location:e,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function lz(e,a){return{state:"submitting",location:e,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}}function Fl(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 oz(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 Ca(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 sz(e,a){try{let i=e.sessionStorage.getItem($b);if(i){let l=JSON.parse(i);for(let[s,u]of Object.entries(l||{}))u&&Array.isArray(u)&&a.set(s,new Set(u||[]))}}catch{}}function uz(e,a){if(a.size>0){let i={};for(let[l,s]of a)i[l]=[...s];try{e.sessionStorage.setItem($b,JSON.stringify(i))}catch(l){bt(!1,`Failed to save applied view transitions in sessionStorage (${l}).`)}}}function Jg(){let e,a,i=new Promise((l,s)=>{e=async u=>{l(u);try{await i}catch{}},a=async u=>{s(u);try{await i}catch{}}});return{promise:i,resolve:e,reject:a}}var Fr=T.createContext(null);Fr.displayName="DataRouter";var Eo=T.createContext(null);Eo.displayName="DataRouterState";var Xb=T.createContext(!1);function Jb(){return T.useContext(Xb)}var zh=T.createContext({isTransitioning:!1});zh.displayName="ViewTransition";var Ib=T.createContext(new Map);Ib.displayName="Fetchers";var cz=T.createContext(null);cz.displayName="Await";var xn=T.createContext(null);xn.displayName="Navigation";var Du=T.createContext(null);Du.displayName="Location";var Hn=T.createContext({outlet:null,matches:[],isDataRoute:!1});Hn.displayName="Route";var Ah=T.createContext(null);Ah.displayName="RouteError";var Wb="REACT_ROUTER_ERROR",fz="REDIRECT",dz="ROUTE_ERROR_RESPONSE";function hz(e){if(e.startsWith(`${Wb}:${fz}:{`))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 mz(e){if(e.startsWith(`${Wb}:${dz}:{`))try{let a=JSON.parse(e.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new wo(a.status,a.statusText,a.data)}catch{}}function pz(e,{relative:a}={}){je(Ki(),"useHref() may be used only in the context of a component.");let{basename:i,navigator:l}=T.useContext(xn),{hash:s,pathname:u,search:f}=To(e,{relative:a}),h=u;return i!=="/"&&(h=u==="/"?i:kn([i,u])),l.createHref({pathname:h,search:f,hash:s})}function Ki(){return T.useContext(Du)!=null}function Sn(){return je(Ki(),"useLocation() may be used only in the context of a component."),T.useContext(Du).location}var ex="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function tx(e){T.useContext(xn).static||T.useLayoutEffect(e)}function oa(){let{isDataRoute:e}=T.useContext(Hn);return e?Cz():yz()}function yz(){je(Ki(),"useNavigate() may be used only in the context of a component.");let e=T.useContext(Fr),{basename:a,navigator:i}=T.useContext(xn),{matches)DELIM" +R"DELIM(:l}=T.useContext(Hn),{pathname:s}=Sn(),u=JSON.stringify(Mu(l)),f=T.useRef(!1);return tx(()=>{f.current=!0}),T.useCallback((p,m={})=>{if(bt(f.current,ex),!f.current)return;if(typeof p=="number"){i.go(p);return}let b=So(p,JSON.parse(u),s,m.relative==="path");e==null&&a!=="/"&&(b.pathname=b.pathname==="/"?a:kn([a,b.pathname])),(m.replace?i.replace:i.push)(b,m.state,m)},[a,i,u,s,e])}var vz=T.createContext(null);function gz(e){let a=T.useContext(Hn).outlet;return T.useMemo(()=>a&&T.createElement(vz.Provider,{value:e},a),[a,e])}function Ch(){let{matches:e}=T.useContext(Hn),a=e[e.length-1];return a?a.params:{}}function To(e,{relative:a}={}){let{matches:i}=T.useContext(Hn),{pathname:l}=Sn(),s=JSON.stringify(Mu(i));return T.useMemo(()=>So(e,JSON.parse(s),l,a==="path"),[e,s,l,a])}function bz(e,a,i){je(Ki(),"useRoutes() may be used only in the context of a component.");let{navigator:l}=T.useContext(xn),{matches:s}=T.useContext(Hn),u=s[s.length-1],f=u?u.params:{},h=u?u.pathname:"/",p=u?u.pathnameBase:"/",m=u&&u.route;{let R=m&&m.path||"";rx(h,!m||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${h}" (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 g=Sn(),v;v=g;let x=v.pathname||"/",w=x;if(p!=="/"){let z=p.replace(/^\//,"").split("/");w="/"+x.replace(/^\//,"").split("/").slice(z.length).join("/")}let _=fr(e,{pathname:w});return gt(m||_!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),gt(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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.`),wz(_&&_.map(z=>Object.assign({},z,{params:Object.assign({},f,z.params),pathname:kn([p,l.encodeLocation?l.encodeLocation(z.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:z.pathname]),pathnameBase:z.pathnameBase==="/"?p:kn([p,l.encodeLocation?l.encodeLocation(z.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:z.pathnameBase])})),s,i)}function gz(){let e=tx(),a=co(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),i=e instanceof Error?e.stack:null,l="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:l},u={padding:"2px 4px",backgroundColor:l},f=null;return console.error("Error handled by React Router default ErrorBoundary:",e),f=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:u},"ErrorBoundary")," or"," ",T.createElement("code",{style:u},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},a),i?T.createElement("pre",{style:s},i):null,f)}var bz=T.createElement(gz,null),ex=class extends T.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,a){return a.location!==e.location||a.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:a.error,location:a.location,revalidation:e.revalidation||a.revalidation}}componentDidCatch(e,a){this.props.onError?this.props.onError(e,a):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const i=dz(e.digest);i&&(e=i)}let a=e!==void 0?T.createElement(Hn.Provider,{value:this.props.routeContext},T.createElement(Rh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?T.createElement(xz,{error:e},a):a}};ex.contextType=Kb;var pd=new WeakMap;function xz({children:e,error:a}){let{basename:i}=T.useContext(xn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=fz(a.digest);if(l){let s=pd.get(a);if(s)throw s;let u=Db(l.location,i);if(Mb&&!pd.get(a))if(u.isExternal||l.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:l.replace}));throw pd.set(a,f),f}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return e}function Sz({routeContext:e,match:a,children:i}){let l=T.useContext(Fr);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoun)DELIM" -R"DELIM(dary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),T.createElement(Hn.Provider,{value:e},i)}function wz(e,a=[],i){let l=i?.state;if(e==null){if(!l)return null;if(l.errors)e=l.matches;else if(a.length===0&&!l.initialized&&l.matches.length>0)e=l.matches;else return null}let s=e,u=l?.errors;if(u!=null){let g=s.findIndex(v=>v.route.id&&u?.[v.route.id]!==void 0);Oe(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),s=s.slice(0,Math.min(s.length,g+1))}let f=!1,h=-1;if(i&&l){f=l.renderFallback;for(let g=0;g=0?s=s.slice(0,h+1):s=[s[0]];break}}}}let p=i?.onError,m=l&&p?(g,v)=>{p(g,{location:l.location,params:l.matches?.[0]?.params??{},unstable_pattern:So(l.matches),errorInfo:v})}:void 0;return s.reduceRight((g,v,x)=>{let w,_=!1,E=null,z=null;l&&(w=u&&v.route.id?u[v.route.id]:void 0,E=v.route.errorElement||bz,f&&(h<0&&x===0?(nx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,z=null):h===x&&(_=!0,z=v.route.hydrateFallbackElement||null)));let M=a.concat(s.slice(0,x+1)),L=()=>{let B;return w?B=E:_?B=z:v.route.Component?B=T.createElement(v.route.Component,null):v.route.element?B=v.route.element:B=g,T.createElement(Sz,{match:v,routeContext:{outlet:g,matches:M,isDataRoute:l!=null},children:B})};return l&&(v.route.ErrorBoundary||v.route.errorElement||x===0)?T.createElement(ex,{location:l.location,revalidation:l.revalidation,component:E,error:w,children:L(),routeContext:{outlet:null,matches:M,isDataRoute:!0},onError:m}):L()},null)}function Ah(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _z(e){let a=T.useContext(Fr);return Oe(a,Ah(e)),a}function Ez(e){let a=T.useContext(wo);return Oe(a,Ah(e)),a}function Tz(e){let a=T.useContext(Hn);return Oe(a,Ah(e)),a}function Ch(e){let a=Tz(e),i=a.matches[a.matches.length-1];return Oe(i.route.id,`${e} can only be used on routes that contain a unique "id"`),i.route.id}function Rz(){return Ch("useRouteId")}function tx(){let e=T.useContext(Rh),a=Ez("useRouteError"),i=Ch("useRouteError");return e!==void 0?e:a.errors?.[i]}function zz(){let{router:e}=_z("useNavigate"),a=Ch("useNavigate"),i=T.useRef(!1);return Wb(()=>{i.current=!0}),T.useCallback(async(s,u={})=>{gt(i.current,Ib),i.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:a,...u}))},[e,a])}var Xg={};function nx(e,a,i){!a&&!Xg[e]&&(Xg[e]=!0,gt(!1,i))}var Jg={};function Ig(e,a){!e&&!Jg[a]&&(Jg[a]=!0,console.warn(a))}var Az="useOptimistic",Wg=HS[Az],Cz=()=>{};function Oz(e){return Wg?Wg(e):[e,Cz]}function jz(e){let a={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&>(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(a,{element:T.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&>(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(a,{hydrateFallbackElement:T.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&>(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(a,{errorElement:T.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),a}var Nz=["HydrateFallback","hydrateFallbackElement"],Mz=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 Dz({router:e,flushSync:a,onError:i,unstable_useTransitions:l}){l=Vb()||l;let[u,f]=T.useState(e.state),[h,p]=Oz(u),[m,g]=T.useState(),[v,x]=T.useState({isTransitioning:!1}),[w,_]=T.useState(),[E,z]=T.useState(),[M,L]=T.useState(),B=T.useRef(new Map),Y=T.useCallback((se,{deletedFetchers:ue,newErrors:de,flushSync:te,viewTransitionOpts:ge})=>{de&&i&&Object.values(de).forEach(V=>i(V,{location:se.location,params:se.matches[0]?.params??{},unstable_pattern:So(se.matches)})),se.fetchers.forEach((V,O)=>{V.data!==void 0&&B.current.set(O,V.data)}),ue.forEach(V=>B.current.delete(V)),Ig(te===!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 Ne=e.window!=null&&e.window.document!=null&&typeof e.window.docu)DELIM" -R"DELIM(ment.startViewTransition=="function";if(Ig(ge==null||Ne,"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."),!ge||!Ne){a&&te?a(()=>f(se)):l===!1?f(se):T.startTransition(()=>{l===!0&&p(V=>e0(V,se)),f(se)});return}if(a&&te){a(()=>{E&&(w?.resolve(),E.skipTransition()),x({isTransitioning:!0,flushSync:!0,currentLocation:ge.currentLocation,nextLocation:ge.nextLocation})});let V=e.window.document.startViewTransition(()=>{a(()=>f(se))});V.finished.finally(()=>{a(()=>{_(void 0),z(void 0),g(void 0),x({isTransitioning:!1})})}),a(()=>z(V));return}E?(w?.resolve(),E.skipTransition(),L({state:se,currentLocation:ge.currentLocation,nextLocation:ge.nextLocation})):(g(se),x({isTransitioning:!0,flushSync:!1,currentLocation:ge.currentLocation,nextLocation:ge.nextLocation}))},[e.window,a,E,w,l,p,i]);T.useLayoutEffect(()=>e.subscribe(Y),[e,Y]);let K=h.initialized;T.useLayoutEffect(()=>{!K&&e.state.initialized&&Y(e.state,{deletedFetchers:[],flushSync:!1,newErrors:null})},[K,Y,e.state]),T.useEffect(()=>{v.isTransitioning&&!v.flushSync&&_(new Mz)},[v]),T.useEffect(()=>{if(w&&m&&e.window){let se=m,ue=w.promise,de=e.window.document.startViewTransition(async()=>{l===!1?f(se):T.startTransition(()=>{l===!0&&p(te=>e0(te,se)),f(se)}),await ue});de.finished.finally(()=>{_(void 0),z(void 0),g(void 0),x({isTransitioning:!1})}),z(de)}},[m,w,e.window,l,p]),T.useEffect(()=>{w&&m&&h.location.key===m.location.key&&w.resolve()},[w,E,h.location,m]),T.useEffect(()=>{!v.isTransitioning&&M&&(g(M.state),x({isTransitioning:!0,flushSync:!1,currentLocation:M.currentLocation,nextLocation:M.nextLocation}),L(void 0))},[v.isTransitioning,M]);let ie=T.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:se=>e.navigate(se),push:(se,ue,de)=>e.navigate(se,{state:ue,preventScrollReset:de?.preventScrollReset}),replace:(se,ue,de)=>e.navigate(se,{replace:!0,state:ue,preventScrollReset:de?.preventScrollReset})}),[e]),I=e.basename||"/",N=T.useMemo(()=>({router:e,navigator:ie,static:!1,basename:I,onError:i}),[e,ie,I,i]);return T.createElement(T.Fragment,null,T.createElement(Fr.Provider,{value:N},T.createElement(wo.Provider,{value:h},T.createElement(Xb.Provider,{value:B.current},T.createElement(Th.Provider,{value:v},T.createElement(Uz,{basename:I,location:h.location,navigationType:h.historyAction,navigator:ie,unstable_useTransitions:l},T.createElement(kz,{routes:e.routes,future:e.future,state:h,isStatic:!1,onError:i})))))),null)}function e0(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 kz=T.memo(Lz);function Lz({routes:e,future:a,state:i,isStatic:l,onError:s}){return vz(e,void 0,{state:i,isStatic:l,onError:s})}function Bz({to:e,replace:a,state:i,relative:l}){Oe(Ki()," may be used only in the context of a component.");let{static:s}=T.useContext(xn);gt(!s," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:u}=T.useContext(Hn),{pathname:f}=Sn(),h=ja(),p=bo(e,Nu(u),f,l==="path"),m=JSON.stringify(p);return T.useEffect(()=>{h(JSON.parse(m),{replace:a,state:i,relative:l})},[h,m,l,a,i]),null}function Hz(e){return yz(e.context)}function Dt(e){Oe(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function Uz({basename:e="/",children:a=null,location:i,navigationType:l="POP",navigator:s,static:u=!1,unstable_useTransitions:f}){Oe(!Ki(),"You cannot render a inside another . You should never have more than one in your app.");let h=e.replace(/^\/*/,"/"),p=T.useMemo(()=>({basename:h,navigator:s,static:u,unstable_useTransitions:f,future:{}}),[h,s,u,f]);typeof i=="string"&&(i=la(i));let{pathname:m="/",search:g="",hash:v="",state:x=null,key:w="default",unstable_mask:_}=i,E=T.useMemo(()=>{let z=Ln(m,h);return z==null?null:{location:{pathname:z,search:g,hash:v,state:x,key:w,unstable_mask:_},navigationType:l}},[h,m,g,v,x,w,l,_]);return gt(E!=null,` is not able to match the URL "${m}${g}${v}" because it does not start with the basename, so the won't render anything.`),E==null?null:T.createElement(xn.Provider,{value:p},T.createElement(Mu.Provider,{children:a,value:E}))}function Wd(e,a=[]){let i=[];return T.Children.forEach(e,(l,s)=>{if(!T.isValidElement(l))return;let u=[...a,s];if(l.type===T.Fragment){i.push.apply(i,Wd(l.props.children,u));return}Oe(l.type===Dt,`[${typeof l.type=="string"?l.type:l.type.name}] is not a component. All component children of must be a or `),Oe(!l.props.index||!l.props.)DELIM" -R"DELIM(children,"An index route cannot have child routes.");let f={id:l.props.id||u.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(f.children=Wd(l.props.children,u)),i.push(f)}),i}var $z=Wd,ou="get",su="application/x-www-form-urlencoded";function Du(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Zz(e){return Du(e)&&e.tagName.toLowerCase()==="button"}function qz(e){return Du(e)&&e.tagName.toLowerCase()==="form"}function Qz(e){return Du(e)&&e.tagName.toLowerCase()==="input"}function Pz(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Gz(e,a){return e.button===0&&(!a||a==="_self")&&!Pz(e)}function eh(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((a,i)=>{let l=e[i];return a.concat(Array.isArray(l)?l.map(s=>[i,s]):[[i,l]])},[]))}function Yz(e,a){let i=eh(e);return a&&a.forEach((l,s)=>{i.has(s)||a.getAll(s).forEach(u=>{i.append(s,u)})}),i}var Js=null;function Fz(){if(Js===null)try{new FormData(document.createElement("form"),0),Js=!1}catch{Js=!0}return Js}var Kz=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function yd(e){return e!=null&&!Kz.has(e)?(gt(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${su}"`),null):e}function Vz(e,a){let i,l,s,u,f;if(qz(e)){let h=e.getAttribute("action");l=h?Ln(h,a):null,i=e.getAttribute("method")||ou,s=yd(e.getAttribute("enctype"))||su,u=new FormData(e)}else if(Zz(e)||Qz(e)&&(e.type==="submit"||e.type==="image")){let h=e.form;if(h==null)throw new Error('Cannot submit a