From fe3b2ac6da6247394304ca332de0e0ead136aca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A2=A8=E6=A2=93=E6=9F=92?= <1787882683@qq.com> Date: Wed, 19 Nov 2025 15:09:58 +0800 Subject: [PATCH] upload WebUI 0.11.3 DashBoard after Build Files --- webui/dist/assets/index-BjjI9czp.css | 1 - webui/dist/assets/index-Cr3EQ_qm.js | 157 +++++++++++++++++++++++++++ webui/dist/assets/index-DCgZlSpL.css | 1 + webui/dist/assets/index-DYT0dd6E.js | 151 -------------------------- webui/dist/index.html | 4 +- 5 files changed, 160 insertions(+), 154 deletions(-) delete mode 100644 webui/dist/assets/index-BjjI9czp.css create mode 100644 webui/dist/assets/index-Cr3EQ_qm.js create mode 100644 webui/dist/assets/index-DCgZlSpL.css delete mode 100644 webui/dist/assets/index-DYT0dd6E.js diff --git a/webui/dist/assets/index-BjjI9czp.css b/webui/dist/assets/index-BjjI9czp.css deleted file mode 100644 index f7652efa..00000000 --- a/webui/dist/assets/index-BjjI9czp.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 221.2 83.2% 53.3%;--primary-foreground: 210 40% 98%;--primary-gradient: none;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 221.2 83.2% 53.3%;--radius: .5rem;--chart-1: 221.2 83.2% 53.3%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 217.2 91.2% 59.8%;--primary-foreground: 222.2 47.4% 11.2%;--primary-gradient: none;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 224.3 76.3% 48%;--chart-1: 217.2 91.2% 59.8%;--chart-2: 160 60% 50%;--chart-3: 30 80% 60%;--chart-4: 280 65% 65%;--chart-5: 340 75% 60%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-4{bottom:1rem}.left-0{left:0}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-2\.5{top:.625rem}.top-3{top:.75rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.col-span-2{grid-column:span 2 / span 2}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.-mt-2{margin-top:-.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-4{width:1rem;height:1rem}.size-\[--cell-size\]{width:var(--cell-size);height:var(--cell-size)}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[--cell-size\]{height:var(--cell-size)}.h-\[1\.25rem\]{height:1.25rem}.h-\[250px\]{height:250px}.h-\[300px\]{height:300px}.h-\[400px\]{height:400px}.h-\[calc\(100vh-200px\)\]{height:calc(100vh - 200px)}.h-\[calc\(100vh-260px\)\]{height:calc(100vh - 260px)}.h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.h-\[calc\(100vh-500px\)\]{height:calc(100vh - 500px)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\[--radix-context-menu-content-available-height\]{max-height:var(--radix-context-menu-content-available-height)}.max-h-\[--radix-select-content-available-height\]{max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(90vh-120px\)\]{max-height:calc(90vh - 120px)}.max-h-screen{max-height:100vh}.min-h-10{min-height:2.5rem}.min-h-\[100px\]{min-height:100px}.min-h-\[60px\]{min-height:60px}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-1{width:.25rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[--cell-size\]{width:var(--cell-size)}.w-\[120px\]{width:120px}.w-\[140px\]{width:140px}.w-\[70px\]{width:70px}.w-\[95vw\]{width:95vw}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[--cell-size\]{min-width:var(--cell-size)}.min-w-\[80px\]{min-width:80px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-\[200px\]{max-width:200px}.max-w-\[95vw\]{max-width:95vw}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\[--radix-context-menu-content-transform-origin\]{transform-origin:var(--radix-context-menu-content-transform-origin)}.origin-\[--radix-popover-content-transform-origin\]{transform-origin:var(--radix-popover-content-transform-origin)}.origin-\[--radix-select-content-transform-origin\]{transform-origin:var(--radix-select-content-transform-origin)}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-\[1\.5px\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[--color-border\]{border-color:var(--color-border)}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-current{border-color:currentColor}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-orange-600{--tw-border-opacity: 1;border-color:rgb(234 88 12 / var(--tw-border-opacity, 1))}.border-primary{border-color:hsl(var(--primary))}.border-primary\/20{border-color:hsl(var(--primary) / .2)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-background\/50{background-color:hsl(var(--background) / .5)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-card\/80{background-color:hsl(var(--card) / .8)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-600\/20{background-color:#dc262633}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/50{background-color:hsl(var(--secondary) / .5)}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-300{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.bg-slate-400{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-500{--tw-gradient-from: #6366f1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(99 102 241 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-500{--tw-gradient-from: #f97316 var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-200{--tw-gradient-from: #e2e8f0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(226 232 240 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-300{--tw-gradient-from: #cbd5e1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(203 213 225 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-400{--tw-gradient-from: #94a3b8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(148 163 184 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-cyan-500{--tw-gradient-to: #06b6d4 var(--tw-gradient-to-position)}.to-emerald-500{--tw-gradient-to: #10b981 var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position)}.to-purple-500{--tw-gradient-to: #a855f7 var(--tw-gradient-to-position)}.to-slate-700{--tw-gradient-to: #334155 var(--tw-gradient-to-position)}.to-slate-800{--tw-gradient-to: #1e293b var(--tw-gradient-to-position)}.to-slate-900{--tw-gradient-to: #0f172a var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-yellow-400{fill:#facc15}.p-0{padding:0}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[--cell-size\]{padding-left:var(--cell-size);padding-right:var(--cell-size)}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pl-10{padding-left:2.5rem}.pl-11{padding-left:2.75rem}.pl-2{padding-left:.5rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-10{padding-right:2.5rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-6{padding-right:1.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.text-\[150px\]{font-size:150px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/60{color:hsl(var(--muted-foreground) / .6)}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-orange-900{--tw-text-opacity: 1;color:rgb(124 45 18 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/10{color:hsl(var(--primary) / .1)}.text-primary\/30{color:hsl(var(--primary) / .3)}.text-primary\/60{color:hsl(var(--primary) / .6)}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--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(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-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-xl{--tw-backdrop-blur: blur(24px);-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,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.text-primary-gradient{color:hsl(var(--primary))}.has-gradient .text-primary-gradient{background:var(--primary-gradient);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}.\[--cell-size\:2rem\]{--cell-size: 2rem}.no-animations *,.no-animations *:before,.no-animations *:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.no-animations *:hover{transition-duration:.01ms!important}::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}::view-transition-old(root){z-index:1}::view-transition-new(root){z-index:999}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:border-primary\/50:hover{border-color:hsl(var(--primary) / .5)}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-accent\/50:hover{background-color:hsl(var(--accent) / .5)}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-white\/5:hover{background-color:#ffffff0d}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-green-700:hover{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.hover\:text-orange-700:hover{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-gray-100:focus{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--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, 0 0 #0000)}.focus\:ring-2:focus{--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, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--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(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-1:focus-visible{--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, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--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, 0 0 #0000)}.focus-visible\:ring-red-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[range-end\=true\]\:rounded-md[data-range-end=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-middle\=true\]\:rounded-none[data-range-middle=true]{border-radius:0}.data-\[range-start\=true\]\:rounded-md[data-range-start=true]{border-radius:calc(var(--radius) - 2px)}.data-\[selected\=true\]\:rounded-none[data-selected=true]{border-radius:0}.data-\[range-end\=true\]\:bg-primary[data-range-end=true]{background-color:hsl(var(--primary))}.data-\[range-middle\=true\]\:bg-accent[data-range-middle=true]{background-color:hsl(var(--accent))}.data-\[range-start\=true\]\:bg-primary[data-range-start=true],.data-\[selected-single\=true\]\:bg-primary[data-selected-single=true]{background-color:hsl(var(--primary))}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:hsl(var(--muted-foreground))}.data-\[range-end\=true\]\:text-primary-foreground[data-range-end=true]{color:hsl(var(--primary-foreground))}.data-\[range-middle\=true\]\:text-accent-foreground[data-range-middle=true]{color:hsl(var(--accent-foreground))}.data-\[range-start\=true\]\:text-primary-foreground[data-range-start=true],.data-\[selected-single\=true\]\:text-primary-foreground[data-selected-single=true]{color:hsl(var(--primary-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=active\]\:duration-300[data-state=active]{transition-duration:.3s}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:relative{position:relative}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:z-10{z-index:10}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:border-ring{border-color:hsl(var(--ring))}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-\[3px\]{--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(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-ring\/50{--tw-ring-color: hsl(var(--ring) / .5)}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:border-gray-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity, 1))}.dark\:border-yellow-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(113 63 18 / var(--tw-border-opacity, 1))}.dark\:bg-blue-500\/20:is(.dark *){background-color:#3b82f633}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950\/20:is(.dark *){background-color:#17255433}.dark\:bg-blue-950\/30:is(.dark *){background-color:#1725544d}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-orange-950\/20:is(.dark *){background-color:#43140733}.dark\:bg-red-500\/20:is(.dark *){background-color:#ef444433}.dark\:bg-red-600\/30:is(.dark *){background-color:#dc26264d}.dark\:bg-red-950\/50:is(.dark *){background-color:#450a0a80}.dark\:bg-yellow-500\/20:is(.dark *){background-color:#eab30833}.dark\:bg-yellow-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity, 1))}.dark\:bg-yellow-950\/30:is(.dark *){background-color:#4220064d}.dark\:text-blue-100:is(.dark *){--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-cyan-500:is(.dark *){--tw-text-opacity: 1;color:rgb(6 182 212 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-orange-100:is(.dark *){--tw-text-opacity: 1;color:rgb(255 237 213 / var(--tw-text-opacity, 1))}.dark\:text-orange-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 215 170 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-yellow-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-500:is(.dark *){--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:focus\:bg-gray-800:focus:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}@media(min-width:640px){.sm\:bottom-0{bottom:0}.sm\:right-0{right:0}.sm\:top-auto{top:auto}.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mr-2{margin-right:.5rem}.sm\:mt-0{margin-top:0}.sm\:mt-2{margin-top:.5rem}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:h-24{height:6rem}.sm\:h-3{height:.75rem}.sm\:h-\[300px\]{height:300px}.sm\:h-\[400px\]{height:400px}.sm\:h-\[500px\]{height:500px}.sm\:h-\[calc\(100vh-320px\)\]{height:calc(100vh - 320px)}.sm\:w-24{width:6rem}.sm\:w-3{width:.75rem}.sm\:w-\[140px\]{width:140px}.sm\:w-\[160px\]{width:160px}.sm\:w-\[200px\]{width:200px}.sm\:w-\[500px\]{width:500px}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:max-w-2xl{max-width:42rem}.sm\:max-w-\[900px\]{max-width:900px}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:flex-1{flex:1 1 0%}.sm\:flex-none{flex:none}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-col{flex-direction:column}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-0{gap:0px}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-6{gap:1.5rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-3{padding:.75rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:text-left{text-align:left}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\:text-\[200px\]{font-size:200px}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media(min-width:768px){.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:max-w-\[420px\]{max-width:420px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:text-sm{font-size:.875rem;line-height:1.25rem}}@media(min-width:1024px){.lg\:invisible{visibility:hidden}.lg\:relative{position:relative}.lg\:z-0{z-index:0}.lg\:mb-1{margin-bottom:.25rem}.lg\:block{display:block}.lg\:hidden{display:none}.lg\:h-\[calc\(100vh-400px\)\]{height:calc(100vh - 400px)}.lg\:w-16{width:4rem}.lg\:w-64{width:16rem}.lg\:w-8{width:2rem}.lg\:w-\[150px\]{width:150px}.lg\:w-\[180px\]{width:180px}.lg\:w-\[200px\]{width:200px}.lg\:w-\[240px\]{width:240px}.lg\:w-\[80px\]{width:80px}.lg\:w-auto{width:auto}.lg\:max-w-0{max-width:0px}.lg\:flex-1{flex:1 1 0%}.lg\:flex-none{flex:none}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.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-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:justify-center{justify-content:center}.lg\:gap-0{gap:0px}.lg\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.lg\:overflow-hidden{overflow:hidden}.lg\:p-4{padding:1rem}.lg\:p-6{padding:1.5rem}.lg\:px-0{padding-left:0;padding-right:0}.lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}.lg\:text-sm{font-size:.875rem;line-height:1.25rem}.lg\:opacity-0{opacity:0}}.\[\&\+div\]\:text-xs+div{font-size:.75rem;line-height:1rem}.\[\&\:first-child\[data-selected\=true\]_button\]\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\:last-child\[data-selected\=true\]_button\]\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>span\]\:text-xs>span{font-size:.75rem;line-height:1rem}.\[\&\>span\]\:opacity-70>span{opacity:.7}.\[\&\>svg\]\:size-3\.5>svg{width:.875rem;height:.875rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:invisible svg{visibility:hidden}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-slot=card-content] .\[\[data-slot\=card-content\]_\&\]\:bg-transparent,[data-slot=popover-content] .\[\[data-slot\=popover-content\]_\&\]\:bg-transparent{background-color:transparent} diff --git a/webui/dist/assets/index-Cr3EQ_qm.js b/webui/dist/assets/index-Cr3EQ_qm.js new file mode 100644 index 00000000..13762ce7 --- /dev/null +++ b/webui/dist/assets/index-Cr3EQ_qm.js @@ -0,0 +1,157 @@ +function LV(e,t){for(var n=0;nr[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var gp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function St(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var y0={exports:{}},qd={};var $k;function BV(){if($k)return qd;$k=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var u in a)u!=="key"&&(i[u]=a[u])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:i}}return qd.Fragment=t,qd.jsx=n,qd.jsxs=n,qd}var Ik;function zV(){return Ik||(Ik=1,y0.exports=BV()),y0.exports}var o=zV(),x0={exports:{}},Ve={};var Lk;function qV(){if(Lk)return Ve;Lk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function x(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function N(I,B,Y){this.props=I,this.context=B,this.refs=w,this.updater=Y||j}N.prototype.isReactComponent={},N.prototype.setState=function(I,B){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,B,"setState")},N.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function O(){}O.prototype=N.prototype;function C(I,B,Y){this.props=I,this.context=B,this.refs=w,this.updater=Y||j}var A=C.prototype=new O;A.constructor=C,b(A,N.prototype),A.isPureReactComponent=!0;var E=Array.isArray;function k(){}var T={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function $(I,B,Y){var ne=Y.ref;return{$$typeof:e,type:I,key:B,ref:ne!==void 0?ne:null,props:Y}}function z(I,B){return $(I.type,B,I.props)}function D(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function U(I){var B={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(Y){return B[Y]})}var V=/\/+/g;function H(I,B){return typeof I=="object"&&I!==null&&I.key!=null?U(""+I.key):B.toString(36)}function G(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(k,k):(I.status="pending",I.then(function(B){I.status==="pending"&&(I.status="fulfilled",I.value=B)},function(B){I.status==="pending"&&(I.status="rejected",I.reason=B)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function L(I,B,Y,ne,oe){var xe=typeof I;(xe==="undefined"||xe==="boolean")&&(I=null);var ee=!1;if(I===null)ee=!0;else switch(xe){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(I.$$typeof){case e:case t:ee=!0;break;case m:return ee=I._init,L(ee(I._payload),B,Y,ne,oe)}}if(ee)return oe=oe(I),ee=ne===""?"."+H(I,0):ne,E(oe)?(Y="",ee!=null&&(Y=ee.replace(V,"$&/")+"/"),L(oe,B,Y,"",function(pe){return pe})):oe!=null&&(D(oe)&&(oe=z(oe,Y+(oe.key==null||I&&I.key===oe.key?"":(""+oe.key).replace(V,"$&/")+"/")+ee)),B.push(oe)),1;ee=0;var ae=ne===""?".":ne+":";if(E(I))for(var Z=0;Z>>1,te=L[K];if(0>>1;Ka(Y,F))nea(oe,Y)?(L[K]=oe,L[ne]=F,K=ne):(L[K]=Y,L[B]=F,K=B);else if(nea(oe,F))L[K]=oe,L[ne]=F,K=ne;else break e}}return R}function a(L,R){var F=L.sortIndex-R.sortIndex;return F!==0?F:L.id-R.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],f=[],m=1,p=null,g=3,x=!1,j=!1,b=!1,w=!1,N=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function A(L){for(var R=n(f);R!==null;){if(R.callback===null)r(f);else if(R.startTime<=L)r(f),R.sortIndex=R.expirationTime,t(d,R);else break;R=n(f)}}function E(L){if(b=!1,A(L),!j)if(n(d)!==null)j=!0,k||(k=!0,U());else{var R=n(f);R!==null&&G(E,R.startTime-L)}}var k=!1,T=-1,P=5,$=-1;function z(){return w?!0:!(e.unstable_now()-$L&&z());){var K=p.callback;if(typeof K=="function"){p.callback=null,g=p.priorityLevel;var te=K(p.expirationTime<=L);if(L=e.unstable_now(),typeof te=="function"){p.callback=te,A(L),R=!0;break t}p===n(d)&&r(d),A(L)}else r(d);p=n(d)}if(p!==null)R=!0;else{var I=n(f);I!==null&&G(E,I.startTime-L),R=!1}}break e}finally{p=null,g=F,x=!1}R=void 0}}finally{R?U():k=!1}}}var U;if(typeof C=="function")U=function(){C(D)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,H=V.port2;V.port1.onmessage=D,U=function(){H.postMessage(null)}}else U=function(){N(D,0)};function G(L,R){T=N(function(){L(e.unstable_now())},R)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125K?(L.sortIndex=F,t(f,L),n(d)===null&&L===n(f)&&(b?(O(T),T=-1):b=!0,G(E,F-K))):(L.sortIndex=te,t(d,L),j||x||(j=!0,k||(k=!0,U()))),L},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(L){var R=g;return function(){var F=g;g=R;try{return L.apply(this,arguments)}finally{g=F}}}})(j0)),j0}var qk;function UV(){return qk||(qk=1,w0.exports=FV()),w0.exports}var S0={exports:{}},ar={};var Fk;function HV(){if(Fk)return ar;Fk=1;var e=xh();function t(d){var f="https://react.dev/errors/"+d;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),S0.exports=HV(),S0.exports}var Hk;function WV(){if(Hk)return Fd;Hk=1;var e=UV(),t=xh(),n=IL();function r(s){var c="https://react.dev/errors/"+s;if(1te||(s.current=K[te],K[te]=null,te--)}function Y(s,c){te++,K[te]=s.current,s.current=c}var ne=I(null),oe=I(null),xe=I(null),ee=I(null);function ae(s,c){switch(Y(xe,c),Y(oe,s),Y(ne,null),c.nodeType){case 9:case 11:s=(s=c.documentElement)&&(s=s.namespaceURI)?ik(s):0;break;default:if(s=c.tagName,c=c.namespaceURI)c=ik(c),s=ok(c,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}B(ne),Y(ne,s)}function Z(){B(ne),B(oe),B(xe)}function pe(s){s.memoizedState!==null&&Y(ee,s);var c=ne.current,h=ok(c,s.type);c!==h&&(Y(oe,s),Y(ne,h))}function je(s){oe.current===s&&(B(ne),B(oe)),ee.current===s&&(B(ee),Id._currentValue=F)}var le,Re;function _e(s){if(le===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);le=c&&c[1]||"",Re=-1)":-1S||X[v]!==se[S]){var ge=` +`+X[v].replace(" at new "," at ");return s.displayName&&ge.includes("")&&(ge=ge.replace("",s.displayName)),ge}while(1<=v&&0<=S);break}}}finally{me=!1,Error.prepareStackTrace=h}return(h=s?s.displayName||s.name:"")?_e(h):""}function Le(s,c){switch(s.tag){case 26:case 27:case 5:return _e(s.type);case 16:return _e("Lazy");case 13:return s.child!==c&&c!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return ve(s.type,!1);case 11:return ve(s.type.render,!1);case 1:return ve(s.type,!0);case 31:return _e("Activity");default:return""}}function Dt(s){try{var c="",h=null;do c+=Le(s,h),h=s,s=s.return;while(s);return c}catch(v){return` +Error generating stack: `+v.message+` +`+v.stack}}var Nn=Object.prototype.hasOwnProperty,pr=e.unstable_scheduleCallback,nr=e.unstable_cancelCallback,vr=e.unstable_shouldYield,lt=e.unstable_requestPaint,rt=e.unstable_now,Dn=e.unstable_getCurrentPriorityLevel,hs=e.unstable_ImmediatePriority,rm=e.unstable_UserBlockingPriority,kl=e.unstable_NormalPriority,nx=e.unstable_LowPriority,am=e.unstable_IdlePriority,rx=e.log,ax=e.unstable_setDisableYieldValue,ms=null,gr=null;function Ga(s){if(typeof rx=="function"&&ax(s),gr&&typeof gr.setStrictMode=="function")try{gr.setStrictMode(ms,s)}catch{}}var rr=Math.clz32?Math.clz32:Lt,ix=Math.log,et=Math.LN2;function Lt(s){return s>>>=0,s===0?32:31-(ix(s)/et|0)|0}var He=256,gt=262144,$n=4194304;function tt(s){var c=s&42;if(c!==0)return c;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Pl(s,c,h){var v=s.pendingLanes;if(v===0)return 0;var S=0,_=s.suspendedLanes,M=s.pingedLanes;s=s.warmLanes;var q=v&134217727;return q!==0?(v=q&~_,v!==0?S=tt(v):(M&=q,M!==0?S=tt(M):h||(h=q&~s,h!==0&&(S=tt(h))))):(q=v&~_,q!==0?S=tt(q):M!==0?S=tt(M):h||(h=v&~s,h!==0&&(S=tt(h)))),S===0?0:c!==0&&c!==S&&(c&_)===0&&(_=S&-S,h=c&-c,_>=h||_===32&&(h&4194048)!==0)?c:S}function ps(s,c){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&c)===0}function ox(s,c){switch(s){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 Ml(){var s=$n;return $n<<=1,($n&62914560)===0&&($n=4194304),s}function vs(s){for(var c=[],h=0;31>h;h++)c.push(s);return c}function Zu(s,c){s.pendingLanes|=c,c!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function OW(s,c,h,v,S,_){var M=s.pendingLanes;s.pendingLanes=h,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=h,s.entangledLanes&=h,s.errorRecoveryDisabledLanes&=h,s.shellSuspendCounter=0;var q=s.entanglements,X=s.expirationTimes,se=s.hiddenUpdates;for(h=M&~h;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var PW=/[\n"\\]/g;function sa(s){return s.replace(PW,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function fx(s,c,h,v,S,_,M,q){s.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?s.type=M:s.removeAttribute("type"),c!=null?M==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+oa(c)):s.value!==""+oa(c)&&(s.value=""+oa(c)):M!=="submit"&&M!=="reset"||s.removeAttribute("value"),c!=null?hx(s,M,oa(c)):h!=null?hx(s,M,oa(h)):v!=null&&s.removeAttribute("value"),S==null&&_!=null&&(s.defaultChecked=!!_),S!=null&&(s.checked=S&&typeof S!="function"&&typeof S!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?s.name=""+oa(q):s.removeAttribute("name")}function JE(s,c,h,v,S,_,M,q){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(s.type=_),c!=null||h!=null){if(!(_!=="submit"&&_!=="reset"||c!=null)){dx(s);return}h=h!=null?""+oa(h):"",c=c!=null?""+oa(c):h,q||c===s.value||(s.value=c),s.defaultValue=c}v=v??S,v=typeof v!="function"&&typeof v!="symbol"&&!!v,s.checked=q?s.checked:!!v,s.defaultChecked=!!v,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(s.name=M),dx(s)}function hx(s,c,h){c==="number"&&sm(s.ownerDocument)===s||s.defaultValue===""+h||(s.defaultValue=""+h)}function Bl(s,c,h,v){if(s=s.options,c){c={};for(var S=0;S"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yx=!1;if(_i)try{var td={};Object.defineProperty(td,"passive",{get:function(){yx=!0}}),window.addEventListener("test",td,td),window.removeEventListener("test",td,td)}catch{yx=!1}var mo=null,xx=null,cm=null;function oA(){if(cm)return cm;var s,c=xx,h=c.length,v,S="value"in mo?mo.value:mo.textContent,_=S.length;for(s=0;s=ad),fA=" ",hA=!1;function mA(s,c){switch(s){case"keyup":return o7.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pA(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Ul=!1;function l7(s,c){switch(s){case"compositionend":return pA(c);case"keypress":return c.which!==32?null:(hA=!0,fA);case"textInput":return s=c.data,s===fA&&hA?null:s;default:return null}}function c7(s,c){if(Ul)return s==="compositionend"||!_x&&mA(s,c)?(s=oA(),cm=xx=mo=null,Ul=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:h,offset:c-s};s=v}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=SA(h)}}function NA(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?NA(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function OA(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var c=sm(s.document);c instanceof s.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)s=c.contentWindow;else break;c=sm(s.document)}return c}function Cx(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}var g7=_i&&"documentMode"in document&&11>=document.documentMode,Hl=null,Ex=null,ld=null,Ax=!1;function CA(s,c,h){var v=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Ax||Hl==null||Hl!==sm(v)||(v=Hl,"selectionStart"in v&&Cx(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),ld&&sd(ld,v)||(ld=v,v=np(Ex,"onSelect"),0>=M,S-=M,Ya=1<<32-rr(c)+S|h<Qe?(ut=De,De=null):ut=De.sibling;var mt=ce(re,De,ie[Qe],be);if(mt===null){De===null&&(De=ut);break}s&&De&&mt.alternate===null&&c(re,De),Q=_(mt,Q,Qe),ht===null?Ie=mt:ht.sibling=mt,ht=mt,De=ut}if(Qe===ie.length)return h(re,De),ft&&Oi(re,Qe),Ie;if(De===null){for(;QeQe?(ut=De,De=null):ut=De.sibling;var $o=ce(re,De,mt.value,be);if($o===null){De===null&&(De=ut);break}s&&De&&$o.alternate===null&&c(re,De),Q=_($o,Q,Qe),ht===null?Ie=$o:ht.sibling=$o,ht=$o,De=ut}if(mt.done)return h(re,De),ft&&Oi(re,Qe),Ie;if(De===null){for(;!mt.done;Qe++,mt=ie.next())mt=we(re,mt.value,be),mt!==null&&(Q=_(mt,Q,Qe),ht===null?Ie=mt:ht.sibling=mt,ht=mt);return ft&&Oi(re,Qe),Ie}for(De=v(De);!mt.done;Qe++,mt=ie.next())mt=he(De,re,Qe,mt.value,be),mt!==null&&(s&&mt.alternate!==null&&De.delete(mt.key===null?Qe:mt.key),Q=_(mt,Q,Qe),ht===null?Ie=mt:ht.sibling=mt,ht=mt);return s&&De.forEach(function(IV){return c(re,IV)}),ft&&Oi(re,Qe),Ie}function Pt(re,Q,ie,be){if(typeof ie=="object"&&ie!==null&&ie.type===b&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:e:{for(var Ie=ie.key;Q!==null;){if(Q.key===Ie){if(Ie=ie.type,Ie===b){if(Q.tag===7){h(re,Q.sibling),be=S(Q,ie.props.children),be.return=re,re=be;break e}}else if(Q.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===P&&Cs(Ie)===Q.type){h(re,Q.sibling),be=S(Q,ie.props),md(be,ie),be.return=re,re=be;break e}h(re,Q);break}else c(re,Q);Q=Q.sibling}ie.type===b?(be=js(ie.props.children,re.mode,be,ie.key),be.return=re,re=be):(be=xm(ie.type,ie.key,ie.props,null,re.mode,be),md(be,ie),be.return=re,re=be)}return M(re);case j:e:{for(Ie=ie.key;Q!==null;){if(Q.key===Ie)if(Q.tag===4&&Q.stateNode.containerInfo===ie.containerInfo&&Q.stateNode.implementation===ie.implementation){h(re,Q.sibling),be=S(Q,ie.children||[]),be.return=re,re=be;break e}else{h(re,Q);break}else c(re,Q);Q=Q.sibling}be=$x(ie,re.mode,be),be.return=re,re=be}return M(re);case P:return ie=Cs(ie),Pt(re,Q,ie,be)}if(G(ie))return Ae(re,Q,ie,be);if(U(ie)){if(Ie=U(ie),typeof Ie!="function")throw Error(r(150));return ie=Ie.call(ie),ze(re,Q,ie,be)}if(typeof ie.then=="function")return Pt(re,Q,Om(ie),be);if(ie.$$typeof===C)return Pt(re,Q,jm(re,ie),be);Cm(re,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,Q!==null&&Q.tag===6?(h(re,Q.sibling),be=S(Q,ie),be.return=re,re=be):(h(re,Q),be=Dx(ie,re.mode,be),be.return=re,re=be),M(re)):h(re,Q)}return function(re,Q,ie,be){try{hd=0;var Ie=Pt(re,Q,ie,be);return tc=null,Ie}catch(De){if(De===ec||De===_m)throw De;var ht=zr(29,De,null,re.mode);return ht.lanes=be,ht.return=re,ht}finally{}}}var As=XA(!0),ZA=XA(!1),xo=!1;function Yx(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kx(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function bo(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function wo(s,c,h){var v=s.updateQueue;if(v===null)return null;if(v=v.shared,(yt&2)!==0){var S=v.pending;return S===null?c.next=c:(c.next=S.next,S.next=c),v.pending=c,c=ym(s),RA(s,null,h),c}return gm(s,v,c,h),ym(s)}function pd(s,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194048)!==0)){var v=c.lanes;v&=s.pendingLanes,h|=v,c.lanes=h,FE(s,h)}}function Xx(s,c){var h=s.updateQueue,v=s.alternate;if(v!==null&&(v=v.updateQueue,h===v)){var S=null,_=null;if(h=h.firstBaseUpdate,h!==null){do{var M={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};_===null?S=_=M:_=_.next=M,h=h.next}while(h!==null);_===null?S=_=c:_=_.next=c}else S=_=c;h={baseState:v.baseState,firstBaseUpdate:S,lastBaseUpdate:_,shared:v.shared,callbacks:v.callbacks},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=c:s.next=c,h.lastBaseUpdate=c}var Zx=!1;function vd(){if(Zx){var s=Jl;if(s!==null)throw s}}function gd(s,c,h,v){Zx=!1;var S=s.updateQueue;xo=!1;var _=S.firstBaseUpdate,M=S.lastBaseUpdate,q=S.shared.pending;if(q!==null){S.shared.pending=null;var X=q,se=X.next;X.next=null,M===null?_=se:M.next=se,M=X;var ge=s.alternate;ge!==null&&(ge=ge.updateQueue,q=ge.lastBaseUpdate,q!==M&&(q===null?ge.firstBaseUpdate=se:q.next=se,ge.lastBaseUpdate=X))}if(_!==null){var we=S.baseState;M=0,ge=se=X=null,q=_;do{var ce=q.lane&-536870913,he=ce!==q.lane;if(he?(ct&ce)===ce:(v&ce)===ce){ce!==0&&ce===Ql&&(Zx=!0),ge!==null&&(ge=ge.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var Ae=s,ze=q;ce=c;var Pt=h;switch(ze.tag){case 1:if(Ae=ze.payload,typeof Ae=="function"){we=Ae.call(Pt,we,ce);break e}we=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=ze.payload,ce=typeof Ae=="function"?Ae.call(Pt,we,ce):Ae,ce==null)break e;we=p({},we,ce);break e;case 2:xo=!0}}ce=q.callback,ce!==null&&(s.flags|=64,he&&(s.flags|=8192),he=S.callbacks,he===null?S.callbacks=[ce]:he.push(ce))}else he={lane:ce,tag:q.tag,payload:q.payload,callback:q.callback,next:null},ge===null?(se=ge=he,X=we):ge=ge.next=he,M|=ce;if(q=q.next,q===null){if(q=S.shared.pending,q===null)break;he=q,q=he.next,he.next=null,S.lastBaseUpdate=he,S.shared.pending=null}}while(!0);ge===null&&(X=we),S.baseState=X,S.firstBaseUpdate=se,S.lastBaseUpdate=ge,_===null&&(S.shared.lanes=0),Oo|=M,s.lanes=M,s.memoizedState=we}}function QA(s,c){if(typeof s!="function")throw Error(r(191,s));s.call(c)}function JA(s,c){var h=s.callbacks;if(h!==null)for(s.callbacks=null,s=0;s_?_:8;var M=L.T,q={};L.T=q,vb(s,!1,c,h);try{var X=S(),se=L.S;if(se!==null&&se(q,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var ge=O7(X,v);bd(s,c,ge,Wr(s))}else bd(s,c,v,Wr(s))}catch(we){bd(s,c,{then:function(){},status:"rejected",reason:we},Wr())}finally{R.p=_,M!==null&&q.types!==null&&(M.types=q.types),L.T=M}}function P7(){}function mb(s,c,h,v){if(s.tag!==5)throw Error(r(476));var S=kT(s).queue;TT(s,S,c,F,h===null?P7:function(){return PT(s),h(v)})}function kT(s){var c=s.memoizedState;if(c!==null)return c;c={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ti,lastRenderedState:F},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ti,lastRenderedState:h},next:null},s.memoizedState=c,s=s.alternate,s!==null&&(s.memoizedState=c),c}function PT(s){var c=kT(s);c.next===null&&(c=s.alternate.memoizedState),bd(s,c.next.queue,{},Wr())}function pb(){return Kn(Id)}function MT(){return sn().memoizedState}function RT(){return sn().memoizedState}function M7(s){for(var c=s.return;c!==null;){switch(c.tag){case 24:case 3:var h=Wr();s=bo(h);var v=wo(c,s,h);v!==null&&(Ar(v,c,h),pd(v,c,h)),c={cache:Hx()},s.payload=c;return}c=c.return}}function R7(s,c,h){var v=Wr();h={lane:v,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Im(s)?$T(c,h):(h=Mx(s,c,h,v),h!==null&&(Ar(h,s,v),IT(h,c,v)))}function DT(s,c,h){var v=Wr();bd(s,c,h,v)}function bd(s,c,h,v){var S={lane:v,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Im(s))$T(c,S);else{var _=s.alternate;if(s.lanes===0&&(_===null||_.lanes===0)&&(_=c.lastRenderedReducer,_!==null))try{var M=c.lastRenderedState,q=_(M,h);if(S.hasEagerState=!0,S.eagerState=q,Br(q,M))return gm(s,c,S,0),$t===null&&vm(),!1}catch{}finally{}if(h=Mx(s,c,S,v),h!==null)return Ar(h,s,v),IT(h,c,v),!0}return!1}function vb(s,c,h,v){if(v={lane:2,revertLane:Yb(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},Im(s)){if(c)throw Error(r(479))}else c=Mx(s,h,v,2),c!==null&&Ar(c,s,2)}function Im(s){var c=s.alternate;return s===Ke||c!==null&&c===Ke}function $T(s,c){rc=Tm=!0;var h=s.pending;h===null?c.next=c:(c.next=h.next,h.next=c),s.pending=c}function IT(s,c,h){if((h&4194048)!==0){var v=c.lanes;v&=s.pendingLanes,h|=v,c.lanes=h,FE(s,h)}}var wd={readContext:Kn,use:Mm,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useLayoutEffect:nn,useInsertionEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useSyncExternalStore:nn,useId:nn,useHostTransitionStatus:nn,useFormState:nn,useActionState:nn,useOptimistic:nn,useMemoCache:nn,useCacheRefresh:nn};wd.useEffectEvent=nn;var LT={readContext:Kn,use:Mm,useCallback:function(s,c){return yr().memoizedState=[s,c===void 0?null:c],s},useContext:Kn,useEffect:wT,useImperativeHandle:function(s,c,h){h=h!=null?h.concat([s]):null,Dm(4194308,4,NT.bind(null,c,s),h)},useLayoutEffect:function(s,c){return Dm(4194308,4,s,c)},useInsertionEffect:function(s,c){Dm(4,2,s,c)},useMemo:function(s,c){var h=yr();c=c===void 0?null:c;var v=s();if(Ts){Ga(!0);try{s()}finally{Ga(!1)}}return h.memoizedState=[v,c],v},useReducer:function(s,c,h){var v=yr();if(h!==void 0){var S=h(c);if(Ts){Ga(!0);try{h(c)}finally{Ga(!1)}}}else S=c;return v.memoizedState=v.baseState=S,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:S},v.queue=s,s=s.dispatch=R7.bind(null,Ke,s),[v.memoizedState,s]},useRef:function(s){var c=yr();return s={current:s},c.memoizedState=s},useState:function(s){s=cb(s);var c=s.queue,h=DT.bind(null,Ke,c);return c.dispatch=h,[s.memoizedState,h]},useDebugValue:fb,useDeferredValue:function(s,c){var h=yr();return hb(h,s,c)},useTransition:function(){var s=cb(!1);return s=TT.bind(null,Ke,s.queue,!0,!1),yr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,c,h){var v=Ke,S=yr();if(ft){if(h===void 0)throw Error(r(407));h=h()}else{if(h=c(),$t===null)throw Error(r(349));(ct&127)!==0||iT(v,c,h)}S.memoizedState=h;var _={value:h,getSnapshot:c};return S.queue=_,wT(sT.bind(null,v,_,s),[s]),v.flags|=2048,ic(9,{destroy:void 0},oT.bind(null,v,_,h,c),null),h},useId:function(){var s=yr(),c=$t.identifierPrefix;if(ft){var h=Ka,v=Ya;h=(v&~(1<<32-rr(v)-1)).toString(32)+h,c="_"+c+"R_"+h,h=km++,0<\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof v.is=="string"?M.createElement("select",{is:v.is}):M.createElement("select"),v.multiple?_.multiple=!0:v.size&&(_.size=v.size);break;default:_=typeof v.is=="string"?M.createElement(S,{is:v.is}):M.createElement(S)}}_[Gn]=c,_[Sr]=v;e:for(M=c.child;M!==null;){if(M.tag===5||M.tag===6)_.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===c)break e;for(;M.sibling===null;){if(M.return===null||M.return===c)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}c.stateNode=_;e:switch(Zn(_,S,v),S){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&Pi(c)}}return Wt(c),Tb(c,c.type,s===null?null:s.memoizedProps,c.pendingProps,h),null;case 6:if(s&&c.stateNode!=null)s.memoizedProps!==v&&Pi(c);else{if(typeof v!="string"&&c.stateNode===null)throw Error(r(166));if(s=xe.current,Xl(c)){if(s=c.stateNode,h=c.memoizedProps,v=null,S=Yn,S!==null)switch(S.tag){case 27:case 5:v=S.memoizedProps}s[Gn]=c,s=!!(s.nodeValue===h||v!==null&&v.suppressHydrationWarning===!0||rk(s.nodeValue,h)),s||go(c,!0)}else s=rp(s).createTextNode(v),s[Gn]=c,c.stateNode=s}return Wt(c),null;case 31:if(h=c.memoizedState,s===null||s.memoizedState!==null){if(v=Xl(c),h!==null){if(s===null){if(!v)throw Error(r(318));if(s=c.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Gn]=c}else Ss(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Wt(c),s=!1}else h=zx(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),s=!0;if(!s)return c.flags&256?(Fr(c),c):(Fr(c),null);if((c.flags&128)!==0)throw Error(r(558))}return Wt(c),null;case 13:if(v=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(S=Xl(c),v!==null&&v.dehydrated!==null){if(s===null){if(!S)throw Error(r(318));if(S=c.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(r(317));S[Gn]=c}else Ss(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Wt(c),S=!1}else S=zx(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=S),S=!0;if(!S)return c.flags&256?(Fr(c),c):(Fr(c),null)}return Fr(c),(c.flags&128)!==0?(c.lanes=h,c):(h=v!==null,s=s!==null&&s.memoizedState!==null,h&&(v=c.child,S=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(S=v.alternate.memoizedState.cachePool.pool),_=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(_=v.memoizedState.cachePool.pool),_!==S&&(v.flags|=2048)),h!==s&&h&&(c.child.flags|=8192),Fm(c,c.updateQueue),Wt(c),null);case 4:return Z(),s===null&&Qb(c.stateNode.containerInfo),Wt(c),null;case 10:return Ei(c.type),Wt(c),null;case 19:if(B(on),v=c.memoizedState,v===null)return Wt(c),null;if(S=(c.flags&128)!==0,_=v.rendering,_===null)if(S)Sd(v,!1);else{if(rn!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(_=Am(s),_!==null){for(c.flags|=128,Sd(v,!1),s=_.updateQueue,c.updateQueue=s,Fm(c,s),c.subtreeFlags=0,s=h,h=c.child;h!==null;)DA(h,s),h=h.sibling;return Y(on,on.current&1|2),ft&&Oi(c,v.treeForkCount),c.child}s=s.sibling}v.tail!==null&&rt()>Gm&&(c.flags|=128,S=!0,Sd(v,!1),c.lanes=4194304)}else{if(!S)if(s=Am(_),s!==null){if(c.flags|=128,S=!0,s=s.updateQueue,c.updateQueue=s,Fm(c,s),Sd(v,!0),v.tail===null&&v.tailMode==="hidden"&&!_.alternate&&!ft)return Wt(c),null}else 2*rt()-v.renderingStartTime>Gm&&h!==536870912&&(c.flags|=128,S=!0,Sd(v,!1),c.lanes=4194304);v.isBackwards?(_.sibling=c.child,c.child=_):(s=v.last,s!==null?s.sibling=_:c.child=_,v.last=_)}return v.tail!==null?(s=v.tail,v.rendering=s,v.tail=s.sibling,v.renderingStartTime=rt(),s.sibling=null,h=on.current,Y(on,S?h&1|2:h&1),ft&&Oi(c,v.treeForkCount),s):(Wt(c),null);case 22:case 23:return Fr(c),Jx(),v=c.memoizedState!==null,s!==null?s.memoizedState!==null!==v&&(c.flags|=8192):v&&(c.flags|=8192),v?(h&536870912)!==0&&(c.flags&128)===0&&(Wt(c),c.subtreeFlags&6&&(c.flags|=8192)):Wt(c),h=c.updateQueue,h!==null&&Fm(c,h.retryQueue),h=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==h&&(c.flags|=2048),s!==null&&B(Os),null;case 24:return h=null,s!==null&&(h=s.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),Ei(un),Wt(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function B7(s,c){switch(Lx(c),c.tag){case 1:return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Ei(un),Z(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 26:case 27:case 5:return je(c),null;case 31:if(c.memoizedState!==null){if(Fr(c),c.alternate===null)throw Error(r(340));Ss()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 13:if(Fr(c),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Ss()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return B(on),null;case 4:return Z(),null;case 10:return Ei(c.type),null;case 22:case 23:return Fr(c),Jx(),s!==null&&B(Os),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 24:return Ei(un),null;case 25:return null;default:return null}}function l2(s,c){switch(Lx(c),c.tag){case 3:Ei(un),Z();break;case 26:case 27:case 5:je(c);break;case 4:Z();break;case 31:c.memoizedState!==null&&Fr(c);break;case 13:Fr(c);break;case 19:B(on);break;case 10:Ei(c.type);break;case 22:case 23:Fr(c),Jx(),s!==null&&B(Os);break;case 24:Ei(un)}}function _d(s,c){try{var h=c.updateQueue,v=h!==null?h.lastEffect:null;if(v!==null){var S=v.next;h=S;do{if((h.tag&s)===s){v=void 0;var _=h.create,M=h.inst;v=_(),M.destroy=v}h=h.next}while(h!==S)}}catch(q){Nt(c,c.return,q)}}function _o(s,c,h){try{var v=c.updateQueue,S=v!==null?v.lastEffect:null;if(S!==null){var _=S.next;v=_;do{if((v.tag&s)===s){var M=v.inst,q=M.destroy;if(q!==void 0){M.destroy=void 0,S=c;var X=h,se=q;try{se()}catch(ge){Nt(S,X,ge)}}}v=v.next}while(v!==_)}}catch(ge){Nt(c,c.return,ge)}}function c2(s){var c=s.updateQueue;if(c!==null){var h=s.stateNode;try{JA(c,h)}catch(v){Nt(s,s.return,v)}}}function u2(s,c,h){h.props=ks(s.type,s.memoizedProps),h.state=s.memoizedState;try{h.componentWillUnmount()}catch(v){Nt(s,c,v)}}function Nd(s,c){try{var h=s.ref;if(h!==null){switch(s.tag){case 26:case 27:case 5:var v=s.stateNode;break;case 30:v=s.stateNode;break;default:v=s.stateNode}typeof h=="function"?s.refCleanup=h(v):h.current=v}}catch(S){Nt(s,c,S)}}function Xa(s,c){var h=s.ref,v=s.refCleanup;if(h!==null)if(typeof v=="function")try{v()}catch(S){Nt(s,c,S)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(S){Nt(s,c,S)}else h.current=null}function d2(s){var c=s.type,h=s.memoizedProps,v=s.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":h.autoFocus&&v.focus();break e;case"img":h.src?v.src=h.src:h.srcSet&&(v.srcset=h.srcSet)}}catch(S){Nt(s,s.return,S)}}function kb(s,c,h){try{var v=s.stateNode;sV(v,s.type,h,c),v[Sr]=c}catch(S){Nt(s,s.return,S)}}function f2(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ko(s.type)||s.tag===4}function Pb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||f2(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&ko(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Mb(s,c,h){var v=s.tag;if(v===5||v===6)s=s.stateNode,c?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(s,c):(c=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,c.appendChild(s),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=Si));else if(v!==4&&(v===27&&ko(s.type)&&(h=s.stateNode,c=null),s=s.child,s!==null))for(Mb(s,c,h),s=s.sibling;s!==null;)Mb(s,c,h),s=s.sibling}function Um(s,c,h){var v=s.tag;if(v===5||v===6)s=s.stateNode,c?h.insertBefore(s,c):h.appendChild(s);else if(v!==4&&(v===27&&ko(s.type)&&(h=s.stateNode),s=s.child,s!==null))for(Um(s,c,h),s=s.sibling;s!==null;)Um(s,c,h),s=s.sibling}function h2(s){var c=s.stateNode,h=s.memoizedProps;try{for(var v=s.type,S=c.attributes;S.length;)c.removeAttributeNode(S[0]);Zn(c,v,h),c[Gn]=s,c[Sr]=h}catch(_){Nt(s,s.return,_)}}var Mi=!1,hn=!1,Rb=!1,m2=typeof WeakSet=="function"?WeakSet:Set,Ln=null;function z7(s,c){if(s=s.containerInfo,t0=up,s=OA(s),Cx(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var v=h.getSelection&&h.getSelection();if(v&&v.rangeCount!==0){h=v.anchorNode;var S=v.anchorOffset,_=v.focusNode;v=v.focusOffset;try{h.nodeType,_.nodeType}catch{h=null;break e}var M=0,q=-1,X=-1,se=0,ge=0,we=s,ce=null;t:for(;;){for(var he;we!==h||S!==0&&we.nodeType!==3||(q=M+S),we!==_||v!==0&&we.nodeType!==3||(X=M+v),we.nodeType===3&&(M+=we.nodeValue.length),(he=we.firstChild)!==null;)ce=we,we=he;for(;;){if(we===s)break t;if(ce===h&&++se===S&&(q=M),ce===_&&++ge===v&&(X=M),(he=we.nextSibling)!==null)break;we=ce,ce=we.parentNode}we=he}h=q===-1||X===-1?null:{start:q,end:X}}else h=null}h=h||{start:0,end:0}}else h=null;for(n0={focusedElem:s,selectionRange:h},up=!1,Ln=c;Ln!==null;)if(c=Ln,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,Ln=s;else for(;Ln!==null;){switch(c=Ln,_=c.alternate,s=c.flags,c.tag){case 0:if((s&4)!==0&&(s=c.updateQueue,s=s!==null?s.events:null,s!==null))for(h=0;h title"))),Zn(_,v,h),_[Gn]=s,In(_),v=_;break e;case"link":var M=bk("link","href",S).get(v+(h.href||""));if(M){for(var q=0;qPt&&(M=Pt,Pt=ze,ze=M);var re=_A(q,ze),Q=_A(q,Pt);if(re&&Q&&(he.rangeCount!==1||he.anchorNode!==re.node||he.anchorOffset!==re.offset||he.focusNode!==Q.node||he.focusOffset!==Q.offset)){var ie=we.createRange();ie.setStart(re.node,re.offset),he.removeAllRanges(),ze>Pt?(he.addRange(ie),he.extend(Q.node,Q.offset)):(ie.setEnd(Q.node,Q.offset),he.addRange(ie))}}}}for(we=[],he=q;he=he.parentNode;)he.nodeType===1&&we.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;qh?32:h,L.T=null,h=qb,qb=null;var _=Eo,M=Li;if(On=0,uc=Eo=null,Li=0,(yt&6)!==0)throw Error(r(331));var q=yt;if(yt|=4,N2(_.current),j2(_,_.current,M,h),yt=q,kd(0,!1),gr&&typeof gr.onPostCommitFiberRoot=="function")try{gr.onPostCommitFiberRoot(ms,_)}catch{}return!0}finally{R.p=S,L.T=v,U2(s,c)}}function W2(s,c,h){c=ca(h,c),c=bb(s.stateNode,c,2),s=wo(s,c,2),s!==null&&(Zu(s,2),Za(s))}function Nt(s,c,h){if(s.tag===3)W2(s,s,h);else for(;c!==null;){if(c.tag===3){W2(c,s,h);break}else if(c.tag===1){var v=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(Co===null||!Co.has(v))){s=ca(h,s),h=VT(2),v=wo(c,h,2),v!==null&&(GT(h,v,c,s),Zu(v,2),Za(v));break}}c=c.return}}function Wb(s,c,h){var v=s.pingCache;if(v===null){v=s.pingCache=new U7;var S=new Set;v.set(c,S)}else S=v.get(c),S===void 0&&(S=new Set,v.set(c,S));S.has(h)||(Ib=!0,S.add(h),s=Y7.bind(null,s,c,h),c.then(s,s))}function Y7(s,c,h){var v=s.pingCache;v!==null&&v.delete(c),s.pingedLanes|=s.suspendedLanes&h,s.warmLanes&=~h,$t===s&&(ct&h)===h&&(rn===4||rn===3&&(ct&62914560)===ct&&300>rt()-Vm?(yt&2)===0&&dc(s,0):Lb|=h,cc===ct&&(cc=0)),Za(s)}function V2(s,c){c===0&&(c=Ml()),s=ws(s,c),s!==null&&(Zu(s,c),Za(s))}function K7(s){var c=s.memoizedState,h=0;c!==null&&(h=c.retryLane),V2(s,h)}function X7(s,c){var h=0;switch(s.tag){case 31:case 13:var v=s.stateNode,S=s.memoizedState;S!==null&&(h=S.retryLane);break;case 19:v=s.stateNode;break;case 22:v=s.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(c),V2(s,h)}function Z7(s,c){return pr(s,c)}var Jm=null,hc=null,Vb=!1,ep=!1,Gb=!1,To=0;function Za(s){s!==hc&&s.next===null&&(hc===null?Jm=hc=s:hc=hc.next=s),ep=!0,Vb||(Vb=!0,J7())}function kd(s,c){if(!Gb&&ep){Gb=!0;do for(var h=!1,v=Jm;v!==null;){if(s!==0){var S=v.pendingLanes;if(S===0)var _=0;else{var M=v.suspendedLanes,q=v.pingedLanes;_=(1<<31-rr(42|s)+1)-1,_&=S&~(M&~q),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(h=!0,X2(v,_))}else _=ct,_=Pl(v,v===$t?_:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(_&3)===0||ps(v,_)||(h=!0,X2(v,_));v=v.next}while(h);Gb=!1}}function Q7(){G2()}function G2(){ep=Vb=!1;var s=0;To!==0&&cV()&&(s=To);for(var c=rt(),h=null,v=Jm;v!==null;){var S=v.next,_=Y2(v,c);_===0?(v.next=null,h===null?Jm=S:h.next=S,S===null&&(hc=h)):(h=v,(s!==0||(_&3)!==0)&&(ep=!0)),v=S}On!==0&&On!==5||kd(s),To!==0&&(To=0)}function Y2(s,c){for(var h=s.suspendedLanes,v=s.pingedLanes,S=s.expirationTimes,_=s.pendingLanes&-62914561;0<_;){var M=31-rr(_),q=1<q)break;var ge=X.transferSize,we=X.initiatorType;ge&&ak(we)&&(X=X.responseEnd,M+=ge*(X"u"?null:document;function vk(s,c,h){var v=mc;if(v&&typeof c=="string"&&c){var S=sa(c);S='link[rel="'+s+'"][href="'+S+'"]',typeof h=="string"&&(S+='[crossorigin="'+h+'"]'),pk.has(S)||(pk.add(S),s={rel:s,crossOrigin:h,href:c},v.querySelector(S)===null&&(c=v.createElement("link"),Zn(c,"link",s),In(c),v.head.appendChild(c)))}}function yV(s){Bi.D(s),vk("dns-prefetch",s,null)}function xV(s,c){Bi.C(s,c),vk("preconnect",s,c)}function bV(s,c,h){Bi.L(s,c,h);var v=mc;if(v&&s&&c){var S='link[rel="preload"][as="'+sa(c)+'"]';c==="image"&&h&&h.imageSrcSet?(S+='[imagesrcset="'+sa(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(S+='[imagesizes="'+sa(h.imageSizes)+'"]')):S+='[href="'+sa(s)+'"]';var _=S;switch(c){case"style":_=pc(s);break;case"script":_=vc(s)}pa.has(_)||(s=p({rel:"preload",href:c==="image"&&h&&h.imageSrcSet?void 0:s,as:c},h),pa.set(_,s),v.querySelector(S)!==null||c==="style"&&v.querySelector(Dd(_))||c==="script"&&v.querySelector($d(_))||(c=v.createElement("link"),Zn(c,"link",s),In(c),v.head.appendChild(c)))}}function wV(s,c){Bi.m(s,c);var h=mc;if(h&&s){var v=c&&typeof c.as=="string"?c.as:"script",S='link[rel="modulepreload"][as="'+sa(v)+'"][href="'+sa(s)+'"]',_=S;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=vc(s)}if(!pa.has(_)&&(s=p({rel:"modulepreload",href:s},c),pa.set(_,s),h.querySelector(S)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector($d(_)))return}v=h.createElement("link"),Zn(v,"link",s),In(v),h.head.appendChild(v)}}}function jV(s,c,h){Bi.S(s,c,h);var v=mc;if(v&&s){var S=Il(v).hoistableStyles,_=pc(s);c=c||"default";var M=S.get(_);if(!M){var q={loading:0,preload:null};if(M=v.querySelector(Dd(_)))q.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":c},h),(h=pa.get(_))&&c0(s,h);var X=M=v.createElement("link");In(X),Zn(X,"link",s),X._p=new Promise(function(se,ge){X.onload=se,X.onerror=ge}),X.addEventListener("load",function(){q.loading|=1}),X.addEventListener("error",function(){q.loading|=2}),q.loading|=4,ip(M,c,v)}M={type:"stylesheet",instance:M,count:1,state:q},S.set(_,M)}}}function SV(s,c){Bi.X(s,c);var h=mc;if(h&&s){var v=Il(h).hoistableScripts,S=vc(s),_=v.get(S);_||(_=h.querySelector($d(S)),_||(s=p({src:s,async:!0},c),(c=pa.get(S))&&u0(s,c),_=h.createElement("script"),In(_),Zn(_,"link",s),h.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},v.set(S,_))}}function _V(s,c){Bi.M(s,c);var h=mc;if(h&&s){var v=Il(h).hoistableScripts,S=vc(s),_=v.get(S);_||(_=h.querySelector($d(S)),_||(s=p({src:s,async:!0,type:"module"},c),(c=pa.get(S))&&u0(s,c),_=h.createElement("script"),In(_),Zn(_,"link",s),h.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},v.set(S,_))}}function gk(s,c,h,v){var S=(S=xe.current)?ap(S):null;if(!S)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(c=pc(h.href),h=Il(S).hoistableStyles,v=h.get(c),v||(v={type:"style",instance:null,count:0,state:null},h.set(c,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){s=pc(h.href);var _=Il(S).hoistableStyles,M=_.get(s);if(M||(S=S.ownerDocument||S,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(s,M),(_=S.querySelector(Dd(s)))&&!_._p&&(M.instance=_,M.state.loading=5),pa.has(s)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},pa.set(s,h),_||NV(S,s,h,M.state))),c&&v===null)throw Error(r(528,""));return M}if(c&&v!==null)throw Error(r(529,""));return null;case"script":return c=h.async,h=h.src,typeof h=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=vc(h),h=Il(S).hoistableScripts,v=h.get(c),v||(v={type:"script",instance:null,count:0,state:null},h.set(c,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function pc(s){return'href="'+sa(s)+'"'}function Dd(s){return'link[rel="stylesheet"]['+s+"]"}function yk(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function NV(s,c,h,v){s.querySelector('link[rel="preload"][as="style"]['+c+"]")?v.loading=1:(c=s.createElement("link"),v.preload=c,c.addEventListener("load",function(){return v.loading|=1}),c.addEventListener("error",function(){return v.loading|=2}),Zn(c,"link",h),In(c),s.head.appendChild(c))}function vc(s){return'[src="'+sa(s)+'"]'}function $d(s){return"script[async]"+s}function xk(s,c,h){if(c.count++,c.instance===null)switch(c.type){case"style":var v=s.querySelector('style[data-href~="'+sa(h.href)+'"]');if(v)return c.instance=v,In(v),v;var S=p({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return v=(s.ownerDocument||s).createElement("style"),In(v),Zn(v,"style",S),ip(v,h.precedence,s),c.instance=v;case"stylesheet":S=pc(h.href);var _=s.querySelector(Dd(S));if(_)return c.state.loading|=4,c.instance=_,In(_),_;v=yk(h),(S=pa.get(S))&&c0(v,S),_=(s.ownerDocument||s).createElement("link"),In(_);var M=_;return M._p=new Promise(function(q,X){M.onload=q,M.onerror=X}),Zn(_,"link",v),c.state.loading|=4,ip(_,h.precedence,s),c.instance=_;case"script":return _=vc(h.src),(S=s.querySelector($d(_)))?(c.instance=S,In(S),S):(v=h,(S=pa.get(_))&&(v=p({},h),u0(v,S)),s=s.ownerDocument||s,S=s.createElement("script"),In(S),Zn(S,"link",v),s.head.appendChild(S),c.instance=S);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(v=c.instance,c.state.loading|=4,ip(v,h.precedence,s));return c.instance}function ip(s,c,h){for(var v=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=v.length?v[v.length-1]:null,_=S,M=0;M title"):null)}function OV(s,c,h){if(h===1||c.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return s=c.disabled,typeof c.precedence=="string"&&s==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function jk(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function CV(s,c,h,v){if(h.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var S=pc(v.href),_=c.querySelector(Dd(S));if(_){c=_._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=sp.bind(s),c.then(s,s)),h.state.loading|=4,h.instance=_,In(_);return}_=c.ownerDocument||c,v=yk(v),(S=pa.get(S))&&c0(v,S),_=_.createElement("link"),In(_);var M=_;M._p=new Promise(function(q,X){M.onload=q,M.onerror=X}),Zn(_,"link",v),h.instance=_}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(h,c),(c=h.state.preload)&&(h.state.loading&3)===0&&(s.count++,h=sp.bind(s),c.addEventListener("load",h),c.addEventListener("error",h))}}var d0=0;function EV(s,c){return s.stylesheets&&s.count===0&&cp(s,s.stylesheets),0d0?50:800)+c);return s.unsuspend=h,function(){s.unsuspend=null,clearTimeout(v),clearTimeout(S)}}:null}function sp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cp(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var lp=null;function cp(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,lp=new Map,c.forEach(AV,s),lp=null,sp.call(s))}function AV(s,c){if(!(c.state.loading&4)){var h=lp.get(s);if(h)var v=h.get(null);else{h=new Map,lp.set(s,h);for(var S=s.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),b0.exports=WV(),b0.exports}var GV=VV();const s_=new WeakMap,YV=new WeakMap,cv={current:[]};let _0=!1,pf=0;const of=new Set,yp=new Map;function LL(e){for(const t of e){if(cv.current.includes(t))continue;cv.current.push(t),t.recompute();const n=YV.get(t);if(n)for(const r of n){const a=s_.get(r);a?.length&&LL(a)}}}function KV(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function XV(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function BL(e){if(pf>0&&!yp.has(e)&&yp.set(e,e.prevState),of.add(e),!(pf>0)&&!_0)try{for(_0=!0;of.size>0;){const t=Array.from(of);of.clear();for(const n of t){const r=yp.get(n)??n.prevState;n.prevState=r,KV(n)}for(const n of t){const r=s_.get(n);r&&(cv.current.push(n),LL(r))}for(const n of t){const r=s_.get(n);if(r)for(const a of r)XV(a)}}}finally{_0=!1,cv.current=[],yp.clear()}}function vf(e){pf++;try{e()}finally{if(pf--,pf===0){const t=of.values().next().value;t&&BL(t)}}}function ZV(e){return typeof e=="function"}class QV{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var a,i;this.listeners.add(r);const l=(i=(a=this.options)==null?void 0:a.onSubscribe)==null?void 0:i.call(a,r,this);return()=>{this.listeners.delete(r),l?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,a;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):ZV(t)?this.state=t(this.prevState):this.state=t,(a=(r=this.options)==null?void 0:r.onUpdate)==null||a.call(r),BL(this)}}const Wo="__TSR_index",Vk="popstate",Gk="beforeunload";function JV(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:l}))},a=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},i=async({task:l,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){l();return}const m=e.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&m.length&&p)for(const g of m){const x=uv(d.path,d.state);if(await g.blockerFn({currentLocation:t,nextLocation:x,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,u,d)=>{const f=t.state[Wo];u=Yk(f+1,u),i({task:()=>{e.pushState(l,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:u})},replace:(l,u,d)=>{const f=t.state[Wo];u=Yk(f,u),i({task:()=>{e.replaceState(l,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:u})},go:(l,u)=>{i({task:()=>{e.go(l),a({type:"GO",index:l})},navigateOpts:u,type:"GO"})},back:l=>{i({task:()=>{e.back(l?.ignoreBlocker??!1),a({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{i({task:()=>{e.forward(l?.ignoreBlocker??!1),a({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Wo]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Yk(e,t){t||(t={});const n=yO();return{...t,key:n,__TSR_key:n,[Wo]:e}}function eG(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let a=[];const i=()=>a,l=P=>a=P,u=(P=>P),d=(()=>uv(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const P=yO();t.history.replaceState({[Wo]:0,key:P,__TSR_key:P},"")}let f=d(),m,p=!1,g=!1,x=!1,j=!1;const b=()=>f;let w,N;const O=()=>{w&&(T._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),T._ignoreSubscribers=!1,w=void 0,N=void 0,m=void 0)},C=(P,$,z)=>{const D=u($);N||(m=f),f=uv($,z),w={href:D,state:z,isPush:w?.isPush||P==="push"},N||(N=Promise.resolve().then(()=>O()))},A=P=>{f=d(),T.notify({type:P})},E=async()=>{if(g){g=!1;return}const P=d(),$=P.state[Wo]-f.state[Wo],z=$===1,D=$===-1,U=!z&&!D||p;p=!1;const V=U?"GO":D?"BACK":"FORWARD",H=U?{type:"GO",index:$}:{type:D?"BACK":"FORWARD"};if(x)x=!1;else{const G=i();if(typeof document<"u"&&G.length){for(const L of G)if(await L.blockerFn({currentLocation:f,nextLocation:P,action:V})){g=!0,t.history.go(1),T.notify(H);return}}}f=d(),T.notify(H)},k=P=>{if(j){j=!1;return}let $=!1;const z=i();if(typeof document<"u"&&z.length)for(const D of z){const U=D.enableBeforeUnload??!0;if(U===!0){$=!0;break}if(typeof U=="function"&&U()===!0){$=!0;break}}if($)return P.preventDefault(),P.returnValue=""},T=JV({getLocation:b,getLength:()=>t.history.length,pushState:(P,$)=>C("push",P,$),replaceState:(P,$)=>C("replace",P,$),back:P=>(P&&(x=!0),j=!0,t.history.back()),forward:P=>{P&&(x=!0),j=!0,t.history.forward()},go:P=>{p=!0,t.history.go(P)},createHref:P=>u(P),flush:O,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Gk,k,{capture:!0}),t.removeEventListener(Vk,E)},onBlocked:()=>{m&&f!==m&&(f=m)},getBlockers:i,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(Gk,k,{capture:!0}),t.addEventListener(Vk,E),t.history.pushState=function(...P){const $=n.apply(t.history,P);return T._ignoreSubscribers||A("PUSH"),$},t.history.replaceState=function(...P){const $=r.apply(t.history,P);return T._ignoreSubscribers||A("REPLACE"),$},T}function uv(e,t){const n=e.indexOf("#"),r=e.indexOf("?"),a=yO();return{href:e,pathname:e.substring(0,n>0?r>0?Math.min(n,r):n:r>0?r:e.length),hash:n>-1?e.substring(n):"",search:r>-1?e.slice(r,n===-1?void 0:n):"",state:t||{[Wo]:0,key:a,__TSR_key:a}}}function yO(){return(Math.random()+1).toString(36).substring(7)}function l_(e){return e[e.length-1]}function tG(e){return typeof e=="function"}function Ys(e,t){return tG(e)?e(t):e}const nG=Object.prototype.hasOwnProperty;function ba(e,t){if(e===t)return e;const n=t,r=Zk(e)&&Zk(n);if(!r&&!(dv(e)&&dv(n)))return n;const a=r?e:Kk(e);if(!a)return n;const i=r?n:Kk(n);if(!i)return n;const l=a.length,u=i.length,d=r?new Array(u):{};let f=0;for(let m=0;m"u")return!0;const n=t.prototype;return!(!Xk(n)||!n.hasOwnProperty("isPrototypeOf"))}function Xk(e){return Object.prototype.toString.call(e)==="[object Object]"}function Zk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ks(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,a=e.length;ra||!Ks(e[l],t[l],n)))return!1;return a===i}return!1}function Kc(e){let t,n;const r=new Promise((a,i)=>{t=a,n=i});return r.status="pending",r.resolve=a=>{r.status="resolved",r.value=a,t(a),e?.(a)},r.reject=a=>{r.status="rejected",n(a)},r}function Vo(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const rG=Array.from(new Map([["%","%25"],["\\","%5C"]]).values());function Qk(e,t=rG){function n(a,i,l=0){for(let u=l;u{try{return decodeURI(u)}catch{return u}})}}if(e===""||!/%[0-9A-Fa-f]{2}/g.test(e))return e;const r=e.replaceAll(/%[0-9a-f]{2}/g,a=>a.toUpperCase());return n(r,t)}var aG="Invariant failed";function cr(e,t){if(!e)throw new Error(aG)}const ci=0,al=1,Xc=2,Zc=3;function Xi(e){return xO(e.filter(t=>t!==void 0).join("/"))}function xO(e){return e.replace(/\/{2,}/g,"/")}function bO(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Go(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Xp(e){return Go(bO(e))}function fv(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function iG(e,t,n){return fv(e,n)===fv(t,n)}function oG(e){const{type:t,value:n}=e;if(t===ci)return n;const{prefixSegment:r,suffixSegment:a}=e;if(t===al){const i=n.substring(1);if(r&&a)return`${r}{$${i}}${a}`;if(r)return`${r}{$${i}}`;if(a)return`{$${i}}${a}`}if(t===Zc){const i=n.substring(1);return r&&a?`${r}{-$${i}}${a}`:r?`${r}{-$${i}}`:a?`{-$${i}}${a}`:`{-$${i}}`}if(t===Xc){if(r&&a)return`${r}{$}${a}`;if(r)return`${r}{$}`;if(a)return`{$}${a}`}return n}function sG({base:e,to:t,trailingSlash:n="never",parseCache:r}){let a=Qc(e,r).slice();const i=Qc(t,r);a.length>1&&l_(a)?.value==="/"&&a.pop();for(let d=0,f=i.length;d1&&(l_(a).value==="/"?n==="never"&&a.pop():n==="always"&&a.push({type:ci,value:"/"}));const l=a.map(oG);return Xi(l)}const Qc=(e,t)=>{if(!e)return[];const n=t?.get(e);if(n)return n;const r=hG(e);return t?.set(e,r),r},lG=/^\$.{1,}$/,cG=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,uG=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,dG=/^\$$/,fG=/^(.*?)\{\$\}(.*)$/;function hG(e){e=xO(e);const t=[];if(e.slice(0,1)==="/"&&(e=e.substring(1),t.push({type:ci,value:"/"})),!e)return t;const n=e.split("/").filter(Boolean);return t.push(...n.map(r=>{const a=r.match(fG);if(a){const u=a[1],d=a[2];return{type:Xc,value:"$",prefixSegment:u||void 0,suffixSegment:d||void 0}}const i=r.match(uG);if(i){const u=i[1],d=i[2],f=i[3];return{type:Zc,value:d,prefixSegment:u||void 0,suffixSegment:f||void 0}}const l=r.match(cG);if(l){const u=l[1],d=l[2],f=l[3];return{type:al,value:""+d,prefixSegment:u||void 0,suffixSegment:f||void 0}}if(lG.test(r)){const u=r.substring(1);return{type:al,value:"$"+u,prefixSegment:void 0,suffixSegment:void 0}}return dG.test(r)?{type:Xc,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:ci,value:r}})),e.slice(-1)==="/"&&(e=e.substring(1),t.push({type:ci,value:"/"})),t}function N0({path:e,params:t,decodeCharMap:n,parseCache:r}){const a=Qc(e,r);function i(f){const m=t[f],p=typeof m=="string";return f==="*"||f==="_splat"?p?encodeURI(m):m:p?mG(m,n):m}let l=!1;const u={},d=Xi(a.map(f=>{if(f.type===ci)return f.value;if(f.type===Xc){u._splat=t._splat,u["*"]=t._splat;const m=f.prefixSegment||"",p=f.suffixSegment||"";if(!t._splat)return l=!0,m||p?`${m}${p}`:void 0;const g=i("_splat");return`${m}${g}${p}`}if(f.type===al){const m=f.value.substring(1);!l&&!(m in t)&&(l=!0),u[m]=t[m];const p=f.prefixSegment||"",g=f.suffixSegment||"";return`${p}${i(m)??"undefined"}${g}`}if(f.type===Zc){const m=f.value.substring(1),p=f.prefixSegment||"",g=f.suffixSegment||"";return!(m in t)||t[m]==null?p||g?`${p}${g}`:void 0:(u[m]=t[m],`${p}${i(m)??""}${g}`)}return f.value}));return{usedParams:u,interpolatedPath:d,isMissingParams:l}}function mG(e,t){let n=encodeURIComponent(e);if(t)for(const[r,a]of t)n=n.replaceAll(r,a);return n}function c_(e,t,n){const r=pG(e,t,n);if(!(t.to&&!r))return r??{}}function pG(e,{to:t,fuzzy:n,caseSensitive:r},a){const i=t,l=Qc(e.startsWith("/")?e:`/${e}`,a),u=Qc(i.startsWith("/")?i:`/${i}`,a),d={};return vG(l,u,d,n,r)?d:void 0}function vG(e,t,n,r,a){let i=0,l=0;for(;ib.value)));p&&j.startsWith(p)&&(j=j.slice(p.length)),g&&j.endsWith(g)&&(j=j.slice(0,j.length-g.length)),m=j}else m=decodeURI(Xi(f.map(p=>p.value)));return n["*"]=m,n._splat=m,!0}if(d.type===ci){if(d.value==="/"&&!u?.value){l++;continue}if(u){if(a){if(d.value!==u.value)return!1}else if(d.value.toLowerCase()!==u.value.toLowerCase())return!1;i++,l++;continue}else return!1}if(d.type===al){if(!u||u.value==="/")return!1;let f="",m=!1;if(d.prefixSegment||d.suffixSegment){const p=d.prefixSegment||"",g=d.suffixSegment||"",x=u.value;if(p&&!x.startsWith(p)||g&&!x.endsWith(g))return!1;let j=x;p&&j.startsWith(p)&&(j=j.slice(p.length)),g&&j.endsWith(g)&&(j=j.slice(0,j.length-g.length)),f=decodeURIComponent(j),m=!0}else f=decodeURIComponent(u.value),m=!0;m&&(n[d.value.substring(1)]=f,i++),l++;continue}if(d.type===Zc){if(!u){l++;continue}if(u.value==="/"){l++;continue}let f="",m=!1;if(d.prefixSegment||d.suffixSegment){const p=d.prefixSegment||"",g=d.suffixSegment||"",x=u.value;if((!p||x.startsWith(p))&&(!g||x.endsWith(g))){let j=x;p&&j.startsWith(p)&&(j=j.slice(p.length)),g&&j.endsWith(g)&&(j=j.slice(0,j.length-g.length)),f=decodeURIComponent(j),m=!0}}else{let p=!0;for(let g=l+1;g=t.length)return n["**"]=Xi(e.slice(i).map(f=>f.value)),!!r&&t[t.length-1]?.value!=="/";if(l=e.length){for(let f=l;f{if(r.isRoot||!r.path)return;const i=bO(r.fullPath);let l=Qc(i),u=0;for(;l.length>u+1&&l[u]?.value==="/";)u++;u>0&&(l=l.slice(u));let d=0,f=!1;const m=l.map((p,g)=>{if(p.value==="/")return gG;if(p.type===ci)return yG;let x;p.type===al?x=xG:p.type===Zc?(x=bG,d++):x=wG;for(let j=g+1;j{const i=Math.min(r.scores.length,a.scores.length);for(let l=0;la.parsed[l].value?1:-1;return r.index-a.index}).map((r,a)=>(r.child.rank=a,r.child))}function CG({routeTree:e,initRoute:t}){const n={},r={},a=l=>{l.forEach((u,d)=>{t?.(u,d);const f=n[u.id];if(cr(!f,`Duplicate routes found with id: ${String(u.id)}`),n[u.id]=u,!u.isRoot&&u.path){const p=Go(u.fullPath);(!r[p]||u.fullPath.endsWith("/"))&&(r[p]=u)}const m=u.children;m?.length&&a(m)})};a([e]);const i=OG(Object.values(n));return{routesById:n,routesByPath:r,flatRoutes:i}}function qa(e){return!!e?.isNotFound}function EG(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const hv="tsr-scroll-restoration-v1_3",AG=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function TG(){const e=EG();if(!e)return null;const t=e.getItem(hv);let n=t?JSON.parse(t):{};return{state:n,set:r=>(n=Ys(r,n)||n,e.setItem(hv,JSON.stringify(n)))}}const xp=TG(),u_=e=>e.state.__TSR_key||e.href;function kG(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let mv=!1;function zL({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:a,location:i}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const u=t||window.history.state?.__TSR_key,d=l[u];mv=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const p in d){const g=d[p];if(p==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(p){const x=document.querySelector(p);x&&(x.scrollLeft=g.scrollX,x.scrollTop=g.scrollY)}}break e}const f=(i??window.location).hash.split("#",2)[1];if(f){const p=window.history.state?.__hashScrollIntoViewOptions??!0;if(p){const g=document.getElementById(f);g&&g.scrollIntoView(p)}break e}const m={top:0,left:0,behavior:n};if(window.scrollTo(m),a)for(const p of a){if(p==="window")continue;const g=typeof p=="function"?p():document.querySelector(p);g&&g.scrollTo(m)}}mv=!1}function PG(e,t){if(!xp&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!xp))return;e.isScrollRestorationSetup=!0,mv=!1;const r=e.options.getScrollRestorationKey||u_;window.history.scrollRestoration="manual";const a=i=>{if(mv||!e.isScrollRestoring)return;let l="";if(i.target===document||i.target===window)l="window";else{const d=i.target.getAttribute("data-scroll-restoration-id");d?l=`[data-scroll-restoration-id="${d}"]`:l=kG(i.target)}const u=r(e.state.location);xp.set(d=>{const f=d[u]||={},m=f[l]||={};if(l==="window")m.scrollX=window.scrollX||0,m.scrollY=window.scrollY||0;else if(l){const p=document.querySelector(l);p&&(m.scrollX=p.scrollLeft||0,m.scrollY=p.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",AG(a,100),!0),e.subscribe("onRendered",i=>{const l=r(i.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(zL({storageKey:hv,key:l,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&xp.set(u=>(u[l]||={},u)))})}function MG(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function RG(e,t=String){const n=new URLSearchParams;for(const r in e){const a=e[r];a!==void 0&&n.set(r,t(a))}return n.toString()}function O0(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function DG(e){const t=new URLSearchParams(e),n={};for(const[r,a]of t.entries()){const i=n[r];i==null?n[r]=O0(a):Array.isArray(i)?i.push(O0(a)):n[r]=[i,O0(a)]}return n}const $G=LG(JSON.parse),IG=BG(JSON.stringify,JSON.parse);function LG(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=DG(t);for(const r in n){const a=n[r];if(typeof a=="string")try{n[r]=e(a)}catch{}}return n}}function BG(e,t){const n=typeof t=="function";function r(a){if(typeof a=="object"&&a!==null)try{return e(a)}catch{}else if(n&&typeof a=="string")try{return t(a),e(a)}catch{}return a}return a=>{const i=RG(a,r);return i?`?${i}`:""}}const Xr="__root__";function qL(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function ai(e){return e instanceof Response&&!!e.options}function zG(e){const t=new Map;let n,r;const a=i=>{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,n=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const l=t.get(i);if(l)return a(l),l.value},set(i,l){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const u=t.get(i);if(u)u.value=l,a(u);else{const d={key:i,value:l,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(i,d)}}}}const Zp=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Mg=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),FL=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),cr(n.options.notFoundComponent);const r=e.matches.find(a=>a.routeId===n.id);cr(r,"Could not find match for route: "+n.id),e.updateMatch(r.id,a=>({...a,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,FL(e,t))},Fo=(e,t,n)=>{if(!(!ai(n)&&!qa(n))){if(ai(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const r=ai(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,a=>({...a,status:r,isFetching:!1,error:n})),qa(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw ai(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(FL(e,n),n)}},UL=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},Ud=(e,t,n,r)=>{const{id:a,routeId:i}=e.matches[t],l=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Fo(e,e.router.getMatch(a),n);try{l.options.onError?.(n)}catch(u){n=u,Fo(e,e.router.getMatch(a),n)}e.updateMatch(a,u=>(u._nonReactive.beforeLoadPromise?.resolve(),u._nonReactive.beforeLoadPromise=void 0,u._nonReactive.loadPromise?.resolve(),{...u,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},qG=(e,t,n,r)=>{const a=e.router.getMatch(t),i=e.matches[n-1]?.id,l=i?e.router.getMatch(i):void 0;if(e.router.isShell()){a.ssr=r.id===Xr;return}if(l?.ssr===!1){a.ssr=!1;return}const u=x=>x===!0&&l?.ssr==="data-only"?"data-only":x,d=e.router.options.defaultSsr??!0;if(r.options.ssr===void 0){a.ssr=u(d);return}if(typeof r.options.ssr!="function"){a.ssr=u(r.options.ssr);return}const{search:f,params:m}=a,p={search:bp(f,a.searchError),params:bp(m,a.paramsError),location:e.location,matches:e.matches.map(x=>({index:x.index,pathname:x.pathname,fullPath:x.fullPath,staticData:x.staticData,id:x.id,routeId:x.routeId,search:bp(x.search,x.searchError),params:bp(x.params,x.paramsError),ssr:x.ssr}))},g=r.options.ssr(p);if(Vo(g))return g.then(x=>{a.ssr=u(x??d)});a.ssr=u(g??d)},HL=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const a=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!e.router.isServer&&!Mg(e,t)&&(n.options.loader||n.options.beforeLoad||GL(n))&&typeof a=="number"&&a!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const l=setTimeout(()=>{Zp(e)},a);r._nonReactive.pendingTimeout=l}},FG=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;HL(e,t,n,r);const a=()=>{const i=e.router.getMatch(t);i.preload&&(i.status==="redirected"||i.status==="notFound")&&Fo(e,i,i.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(a):a()},UG=(e,t,n,r)=>{const a=e.router.getMatch(t),i=a._nonReactive.loadPromise;a._nonReactive.loadPromise=Kc(()=>{i?.resolve()});const{paramsError:l,searchError:u}=a;l&&Ud(e,n,l,"PARSE_PARAMS"),u&&Ud(e,n,u,"VALIDATE_SEARCH"),HL(e,t,r,a);const d=new AbortController,f=e.matches[n-1]?.id,g={...(f?e.router.getMatch(f):void 0)?.context??e.router.options.context??void 0,...a.__routeContext};let x=!1;const j=()=>{x||(x=!0,e.updateMatch(t,T=>({...T,isFetching:"beforeLoad",fetchCount:T.fetchCount+1,abortController:d,context:g})))},b=()=>{a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,T=>({...T,isFetching:!1}))};if(!r.options.beforeLoad){vf(()=>{j(),b()});return}a._nonReactive.beforeLoadPromise=Kc();const{search:w,params:N,cause:O}=a,C=Mg(e,t),A={search:w,abortController:d,params:N,preload:C,context:g,location:e.location,navigate:T=>e.router.navigate({...T,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:C?"preload":O,matches:e.matches,...e.router.options.additionalContext},E=T=>{if(T===void 0){vf(()=>{j(),b()});return}(ai(T)||qa(T))&&(j(),Ud(e,n,T,"BEFORE_LOAD")),vf(()=>{j(),e.updateMatch(t,P=>({...P,__beforeLoadContext:T,context:{...P.context,...T}})),b()})};let k;try{if(k=r.options.beforeLoad(A),Vo(k))return j(),k.catch(T=>{Ud(e,n,T,"BEFORE_LOAD")}).then(E)}catch(T){j(),Ud(e,n,T,"BEFORE_LOAD")}E(k)},HG=(e,t)=>{const{id:n,routeId:r}=e.matches[t],a=e.router.looseRoutesById[r],i=()=>{if(e.router.isServer){const d=qG(e,n,t,a);if(Vo(d))return d.then(u)}return u()},l=()=>UG(e,n,t,a),u=()=>{if(UL(e,n))return;const d=FG(e,n,a);return Vo(d)?d.then(l):l()};return i()},gf=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const a={matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(a),n.options.scripts?.(a),n.options.headers?.(a)]).then(([i,l,u])=>{const d=i?.meta,f=i?.links,m=i?.scripts,p=i?.styles;return{meta:d,links:f,headScripts:m,headers:u,scripts:l,styles:p}})},WL=(e,t,n,r)=>{const a=e.matchPromises[n-1],{params:i,loaderDeps:l,abortController:u,cause:d}=e.router.getMatch(t);let f=e.router.options.context??{};for(let p=0;p<=n;p++){const g=e.matches[p];if(!g)continue;const x=e.router.getMatch(g.id);x&&(f={...f,...x.__routeContext??{},...x.__beforeLoadContext??{}})}const m=Mg(e,t);return{params:i,deps:l,preload:!!m,parentMatchPromise:a,abortController:u,context:f,location:e.location,navigate:p=>e.router.navigate({...p,_fromLocation:e.location}),cause:m?"preload":d,route:r,...e.router.options.additionalContext}},nP=async(e,t,n,r)=>{try{const a=e.router.getMatch(t);try{(!e.router.isServer||a.ssr===!0)&&VL(r);const i=r.options.loader?.(WL(e,t,n,r)),l=r.options.loader&&Vo(i);if(!!(l||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(t,p=>({...p,isFetching:"loader"})),r.options.loader){const p=l?await i:i;Fo(e,e.router.getMatch(t),p),p!==void 0&&e.updateMatch(t,g=>({...g,loaderData:p}))}r._lazyPromise&&await r._lazyPromise;const d=gf(e,t,r),f=d?await d:void 0,m=a._nonReactive.minPendingPromise;m&&await m,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,p=>({...p,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...f}))}catch(i){let l=i;const u=a._nonReactive.minPendingPromise;u&&await u,qa(i)&&await r.options.notFoundComponent?.preload?.(),Fo(e,e.router.getMatch(t),i);try{r.options.onError?.(i)}catch(m){l=m,Fo(e,e.router.getMatch(t),m)}const d=gf(e,t,r),f=d?await d:void 0;e.updateMatch(t,m=>({...m,error:l,status:"error",isFetching:!1,...f}))}}catch(a){const i=e.router.getMatch(t);if(i){const l=gf(e,t,r);if(l){const u=await l;e.updateMatch(t,d=>({...d,...u}))}i._nonReactive.loaderPromise=void 0}Fo(e,i,a)}},WG=async(e,t)=>{const{id:n,routeId:r}=e.matches[t];let a=!1,i=!1;const l=e.router.looseRoutesById[r];if(UL(e,n)){if(e.router.isServer){const f=gf(e,n,l);if(f){const m=await f;e.updateMatch(n,p=>({...p,...m}))}return e.router.getMatch(n)}}else{const f=e.router.getMatch(n);if(f._nonReactive.loaderPromise){if(f.status==="success"&&!e.sync&&!f.preload)return f;await f._nonReactive.loaderPromise;const m=e.router.getMatch(n),p=m._nonReactive.error||m.error;p&&Fo(e,m,p)}else{const m=Date.now()-f.updatedAt,p=Mg(e,n),g=p?l.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:l.options.staleTime??e.router.options.defaultStaleTime??0,x=l.options.shouldReload,j=typeof x=="function"?x(WL(e,n,t,l)):x,b=!!p&&!e.router.state.matches.some(C=>C.id===n),w=e.router.getMatch(n);w._nonReactive.loaderPromise=Kc(),b!==w.preload&&e.updateMatch(n,C=>({...C,preload:b}));const{status:N,invalid:O}=w;if(a=N==="success"&&(O||(j??m>g)),!(p&&l.options.preload===!1))if(a&&!e.sync)i=!0,(async()=>{try{await nP(e,n,t,l);const C=e.router.getMatch(n);C._nonReactive.loaderPromise?.resolve(),C._nonReactive.loadPromise?.resolve(),C._nonReactive.loaderPromise=void 0}catch(C){ai(C)&&await e.router.navigate(C.options)}})();else if(N!=="success"||a&&e.sync)await nP(e,n,t,l);else{const C=gf(e,n,l);if(C){const A=await C;e.updateMatch(n,E=>({...E,...A}))}}}}const u=e.router.getMatch(n);i||(u._nonReactive.loaderPromise?.resolve(),u._nonReactive.loadPromise?.resolve()),clearTimeout(u._nonReactive.pendingTimeout),u._nonReactive.pendingTimeout=void 0,i||(u._nonReactive.loaderPromise=void 0),u._nonReactive.dehydrated=void 0;const d=i?u.isFetching:!1;return d!==u.isFetching||u.invalid!==!1?(e.updateMatch(n,f=>({...f,isFetching:d,invalid:!1})),e.router.getMatch(n)):u};async function rP(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&Zp(t);try{for(let a=0;a{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of YL){const a=e.options[r]?.preload;a&&n.push(a())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function bp(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function GL(e){for(const t of YL)if(e.options[t]?.preload)return!0;return!1}const YL=["component","errorComponent","pendingComponent","notFoundComponent"];function VG(e){return{input:({url:t})=>{for(const n of e)t=KL(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=XL(e[n],t);return t}}}function GG(e){const t=Xp(e.basepath),n=`/${t}`,r=`${n}/`,a=e.caseSensitive?n:n.toLowerCase(),i=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const u=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return u===a?l.pathname="/":u.startsWith(i)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=Xi(["/",t,l.pathname]),l)}}function KL(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function XL(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Xs(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,a=t?.href!==n.href,i=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:a,hashChanged:i}}class YG{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,a=this.basepath??r?.basepath??"/",i=this.basepath===void 0,l=r?.rewrite;this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(g=>[encodeURIComponent(g),g])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=eG())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new QV(XG(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),PG(this));let u=!1;const d=this.options.basepath??"/",f=this.options.rewrite;if(i||a!==d||l!==f){this.basepath=d;const g=[];Xp(d)!==""&&g.push(GG({basepath:d})),f&&g.push(f),this.rewrite=g.length===0?void 0:g.length===1?g[0]:VG(g),this.history&&this.updateLatestLocation(),u=!0}u&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:n,routesByPath:r,flatRoutes:a}=CG({routeTree:this.routeTree,initRoute:(l,u)=>{l.init({originalIndex:u})}});this.routesById=n,this.routesByPath=r,this.flatRoutes=a;const i=this.options.notFoundRoute;i&&(i.init({originalIndex:99999999999}),this.routesById[i.id]=i)},this.subscribe=(n,r)=>{const a={eventType:n,fn:r};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const a=({href:d,state:f})=>{const m=new URL(d,this.origin),p=KL(this.rewrite,m),g=this.options.parseSearch(p.search),x=this.options.stringifySearch(g);p.search=x;const j=p.href.replace(p.origin,""),{pathname:b,hash:w}=p;return{href:j,publicHref:d,url:p.href,pathname:Qk(b),searchStr:x,search:ba(r?.search,g),hash:w.split("#").reverse()[0]??"",state:ba(r?.state,f)}},i=a(n),{__tempLocation:l,__tempKey:u}=i.state;if(l&&(!u||u===this.tempLocationKey)){const d=a(l);return d.state.key=i.state.key,d.state.__TSR_key=i.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:i}}return i},this.resolvePathWithBase=(n,r)=>sG({base:n,to:xO(r),trailingSlash:this.options.trailingSlash,parseCache:this.parsePathnameCache}),this.matchRoutes=(n,r,a)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},a):this.matchRoutesInternal(n,r),this.parsePathnameCache=zG(1e3),this.getMatchedRoutes=(n,r)=>ZG({pathname:n,routePathname:r,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes,parseCache:this.parsePathnameCache}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(i=>i.status==="pending"),r=this.state.matches.filter(i=>i.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(i=>{this.cancelMatch(i.id)})},this.buildLocation=n=>{const r=(i={})=>{const l=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutes(l,{_buildLocation:!0}),d=l_(u);i.from;const f=i.unsafeRelative==="path"?l.pathname:i.from??d.fullPath,m=this.resolvePathWithBase(f,"."),p=d.search,g={...d.params},x=i.to?this.resolvePathWithBase(m,`${i.to}`):this.resolvePathWithBase(m,"."),j=i.params===!1||i.params===null?{}:(i.params??!0)===!0?g:Object.assign(g,Ys(i.params,g)),b=N0({path:x,params:j,parseCache:this.parsePathnameCache}).interpolatedPath,w=this.matchRoutes(b,void 0,{_buildLocation:!0}).map(z=>this.looseRoutesById[z.routeId]);if(Object.keys(j).length>0)for(const z of w){const D=z.options.params?.stringify??z.options.stringifyParams;D&&Object.assign(j,D(j))}const N=n.leaveParams?x:Qk(N0({path:x,params:j,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath);let O=p;if(n._includeValidateSearch&&this.options.search?.strict){const z={};w.forEach(D=>{if(D.options.validateSearch)try{Object.assign(z,d_(D.options.validateSearch,{...z,...O}))}catch{}}),O=z}O=QG({search:O,dest:i,destRoutes:w,_includeValidateSearch:n._includeValidateSearch}),O=ba(p,O);const C=this.options.stringifySearch(O),A=i.hash===!0?l.hash:i.hash?Ys(i.hash,l.hash):void 0,E=A?`#${A}`:"";let k=i.state===!0?l.state:i.state?Ys(i.state,l.state):{};k=ba(l.state,k);const T=`${N}${C}${E}`,P=new URL(T,this.origin),$=XL(this.rewrite,P);return{publicHref:$.pathname+$.search+$.hash,href:T,url:$.href,pathname:N,search:O,searchStr:C,state:k,hash:A??"",unmaskOnReload:i.unmaskOnReload}},a=(i={},l)=>{const u=r(i);let d=l?r(l):void 0;if(!d){let f={};const m=this.options.routeMasks?.find(p=>{const g=c_(u.pathname,{to:p.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return g?(f=g,!0):!1});if(m){const{from:p,...g}=m;l={from:n.from,...g,params:f},d=r(l)}}return d&&(u.maskedLocation=d),u};return n.mask?a(n,{from:n.from,...n.mask}):a(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:r,...a})=>{const i=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(m=>{a.state[m]=this.latestLocation.state[m]});const f=Ks(a.state,this.latestLocation.state);return d.forEach(m=>{delete a.state[m]}),f},l=Go(this.latestLocation.href)===Go(a.href),u=this.commitLocationPromise;if(this.commitLocationPromise=Kc(()=>{u?.resolve()}),l&&i())this.load();else{let{maskedLocation:d,hashScrollIntoView:f,...m}=a;d&&(m={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[a.replace?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:r})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:a,viewTransition:i,ignoreBlocker:l,href:u,...d}={})=>{if(u){const p=this.history.location.state.__TSR_index,g=uv(u,{__TSR_index:n?p:p+1});d.to=g.pathname,d.search=this.options.parseSearch(g.search),d.hash=g.hash.slice(1)}const f=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const m=this.commitLocation({...f,viewTransition:i,replace:n,resetScroll:r,hashScrollIntoView:a,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=({to:n,reloadDocument:r,href:a,...i})=>{if(!r&&a)try{new URL(`${a}`),r=!0}catch{}return r?(a||(a=this.buildLocation({to:n,...i}).url),i.replace?window.location.replace(a):window.location.href=a,Promise.resolve()):this.buildAndCommitLocation({...i,href:a,to:n,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const r=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),a=i=>{try{return encodeURI(decodeURI(i))}catch{return i}};if(Xp(a(this.latestLocation.href))!==Xp(a(r.href))){let i=r.url;throw this.origin&&i.startsWith(this.origin)&&(i=i.replace(this.origin,"")||"/"),qL({href:i})}}const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(a=>!n.some(i=>i.id===a.id))}))},this.load=async n=>{let r,a,i;for(i=new Promise(u=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Xs({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...Xs({resolvedLocation:f,location:d})}),await rP({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let m=[],p=[],g=[];vf(()=>{this.__store.setState(x=>{const j=x.matches,b=x.pendingMatches||x.matches;return m=j.filter(w=>!b.some(N=>N.id===w.id)),p=b.filter(w=>!j.some(N=>N.id===w.id)),g=b.filter(w=>j.some(N=>N.id===w.id)),{...x,isLoading:!1,loadedAt:Date.now(),matches:b,pendingMatches:void 0,cachedMatches:[...x.cachedMatches,...m.filter(w=>w.status!=="error")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[p,"onEnter"],[g,"onStay"]].forEach(([x,j])=>{x.forEach(b=>{this.looseRoutesById[b.routeId].options[j]?.(b)})})})})}})}catch(d){ai(d)?(r=d,this.isServer||this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):qa(d)&&(a=d),this.__store.setState(f=>({...f,statusCode:r?r.status:a?404:f.matches.some(m=>m.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),u()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(u=>u.status==="error")&&(l=500),l!==void 0&&this.__store.setState(u=>({...u,statusCode:l}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,l=this.state.resolvedLocation,u=typeof r.types=="function"?r.types(Xs({resolvedLocation:l,location:i})):r.types;if(u===!1){n();return}a={update:n,types:u}}else a=n;document.startViewTransition(a)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const a=this.state.pendingMatches?.some(i=>i.id===n)?"pendingMatches":this.state.matches.some(i=>i.id===n)?"matches":this.state.cachedMatches.some(i=>i.id===n)?"cachedMatches":"";a&&this.__store.setState(i=>({...i,[a]:i[a]?.map(l=>l.id===n?r(l):l)}))})},this.getMatch=n=>{const r=a=>a.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=a=>n?.filter?.(a)??!0?{...a,invalid:!0,...n?.forcePending||a.status==="error"?{status:"pending",error:void 0}:void 0}:a;return this.__store.setState(a=>({...a,matches:a.matches.map(r),cachedMatches:a.cachedMatches.map(r),pendingMatches:a.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.resolveRedirect=n=>{if(!n.options.href){const r=this.buildLocation(n.options);let a=r.url;this.origin&&a.startsWith(this.origin)&&(a=a.replace(this.origin,"")||"/"),n.options.href=r.href,n.headers.set("Location",a)}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(a=>({...a,cachedMatches:a.cachedMatches.filter(i=>!r(i))})):this.__store.setState(a=>({...a,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const a=this.looseRoutesById[r.routeId];if(!a.options.loader)return!0;const i=(r.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=i};this.clearCache({filter:n})},this.loadRouteChunk=VL,this.preloadRoute=async n=>{const r=this.buildLocation(n);let a=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(u=>u.id)),l=new Set([...i,...this.state.cachedMatches.map(u=>u.id)]);vf(()=>{a.forEach(u=>{l.has(u.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,u]}))})});try{return a=await rP({router:this,matches:a,location:r,preload:!0,updateMatch:(u,d)=>{i.has(u)?a=a.map(f=>f.id===u?d(f):f):this.updateMatch(u,d)}}),a}catch(u){if(ai(u))return u.options.reloadDocument?void 0:await this.preloadRoute({...u.options,_fromLocation:r});qa(u)||console.error(u);return}},this.matchRoute=(n,r)=>{const a={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},i=this.buildLocation(a);if(r?.pending&&this.state.status!=="pending")return!1;const u=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=c_(u.pathname,{...r,to:i.pathname},this.parsePathnameCache);return!d||n.params&&!Ks(d,n.params,{partial:!0})?!1:d&&(r?.includeSearch??!0)?Ks(u.search,i.search,{partial:!0})?d:!1:d},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??IG,parseSearch:t.parseSearch??$G}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const{foundRoute:r,matchedRoutes:a,routeParams:i}=this.getMatchedRoutes(t.pathname,n?.dest?.to);let l=!1;(r?r.path!=="/"&&i["**"]:Go(t.pathname))&&(this.options.notFoundRoute?a.push(this.options.notFoundRoute):l=!0);const u=(()=>{if(l){if(this.options.notFoundMode!=="root")for(let m=a.length-1;m>=0;m--){const p=a[m];if(p.children)return p.id}return Xr}})(),d=[],f=m=>m?.id?m.context??this.options.context??void 0:this.options.context??void 0;return a.forEach((m,p)=>{const g=d[p-1],[x,j,b]=(()=>{const U=g?.search??t.search,V=g?._strictSearch??void 0;try{const H=d_(m.options.validateSearch,{...U})??void 0;return[{...U,...H},{...V,...H},void 0]}catch(H){let G=H;if(H instanceof pv||(G=new pv(H.message,{cause:H})),n?.throwOnError)throw G;return[U,{},G]}})(),w=m.options.loaderDeps?.({search:x})??"",N=w?JSON.stringify(w):"",{interpolatedPath:O,usedParams:C}=N0({path:m.fullPath,params:i,decodeCharMap:this.pathParamsDecodeCharMap}),A=m.id+O+N,E=this.getMatch(A),k=this.state.matches.find(U=>U.routeId===m.id),T=E?._strictParams??C;let P;if(!E){const U=m.options.params?.parse??m.options.parseParams;if(U)try{Object.assign(T,U(T))}catch(V){if(P=new KG(V.message,{cause:V}),n?.throwOnError)throw P}}Object.assign(i,T);const $=k?"stay":"enter";let z;if(E)z={...E,cause:$,params:k?ba(k.params,i):i,_strictParams:T,search:ba(k?k.search:E.search,x),_strictSearch:j};else{const U=m.options.loader||m.options.beforeLoad||m.lazyFn||GL(m)?"pending":"success";z={id:A,index:p,routeId:m.id,params:k?ba(k.params,i):i,_strictParams:T,pathname:O,updatedAt:Date.now(),search:k?ba(k.search,x):x,_strictSearch:j,searchError:void 0,status:U,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:Kc()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:$,loaderDeps:k?ba(k.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}n?.preload||(z.globalNotFound=u===m.id),z.searchError=b;const D=f(g);z.context={...D,...z.__routeContext,...z.__beforeLoadContext},d.push(z)}),d.forEach((m,p)=>{const g=this.looseRoutesById[m.routeId];if(!this.getMatch(m.id)&&n?._buildLocation!==!0){const j=d[p-1],b=f(j);if(g.options.context){const w={deps:m.loaderDeps,params:m.params,context:b??{},location:t,navigate:N=>this.navigate({...N,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d};m.__routeContext=g.options.context(w)??void 0}m.context={...b,...m.__routeContext,...m.__beforeLoadContext}}}),d}}class pv extends Error{}class KG extends Error{}function XG(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function d_(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new pv("Async validation not supported");if(n.issues)throw new pv(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function ZG({pathname:e,routePathname:t,caseSensitive:n,routesByPath:r,routesById:a,flatRoutes:i,parseCache:l}){let u={};const d=Go(e),f=x=>c_(d,{to:x.fullPath,caseSensitive:x.options?.caseSensitive??n,fuzzy:!0},l);let m=t!==void 0?r[t]:void 0;if(m)u=f(m);else{let x;for(const j of i){const b=f(j);if(b)if(j.path!=="/"&&b["**"])x||(x={foundRoute:j,routeParams:b});else{m=j,u=b;break}}!m&&x&&(m=x.foundRoute,u=x.routeParams)}let p=m||a[Xr];const g=[p];for(;p.parentRoute;)p=p.parentRoute,g.push(p);return g.reverse(),{matchedRoutes:g,routeParams:u,foundRoute:m}}function QG({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){const a=n.reduce((u,d)=>{const f=[];if("search"in d.options)d.options.search?.middlewares&&f.push(...d.options.search.middlewares);else if(d.options.preSearchFilters||d.options.postSearchFilters){const m=({search:p,next:g})=>{let x=p;"preSearchFilters"in d.options&&d.options.preSearchFilters&&(x=d.options.preSearchFilters.reduce((b,w)=>w(b),p));const j=g(x);return"postSearchFilters"in d.options&&d.options.postSearchFilters?d.options.postSearchFilters.reduce((b,w)=>w(b),j):j};f.push(m)}if(r&&d.options.validateSearch){const m=({search:p,next:g})=>{const x=g(p);try{return{...x,...d_(d.options.validateSearch,x)??void 0}}catch{return x}};f.push(m)}return u.concat(f)},[])??[],i=({search:u})=>t.search?t.search===!0?u:Ys(t.search,u):{};a.push(i);const l=(u,d)=>{if(u>=a.length)return d;const f=a[u];return f({search:d,next:p=>l(u+1,p)})};return l(0,e)}const JG="Error preloading route! ☝️";class ZL{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,a=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=Xr:this.parentRoute||cr(!1);let i=a?Xr:r?.path;i&&i!=="/"&&(i=bO(i));const l=r?.id||i;let u=a?Xr:Xi([this.parentRoute.id===Xr?"":this.parentRoute.id,l]);i===Xr&&(i="/"),u!==Xr&&(u=Xi(["/",u]));const d=u===Xr?"/":Xi([this.parentRoute.fullPath,i]);this._path=i,this._id=u,this._fullPath=d,this._to=d},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class eY extends ZL{constructor(t){super(t)}}function wO(e){const t=e.errorComponent??Rg;return o.jsx(tY,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?y.createElement(t,{error:n,reset:r}):e.children})}class tY extends y.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Rg({error:e}){const[t,n]=y.useState(!1);return o.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[o.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),o.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),o.jsx("div",{style:{height:".25rem"}}),t?o.jsx("div",{children:o.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?o.jsx("code",{children:e.message}):null})}):null]})}function nY({children:e,fallback:t=null}){return rY()?o.jsx(W.Fragment,{children:e}):o.jsx(W.Fragment,{children:t})}function rY(){return W.useSyncExternalStore(aY,()=>!0,()=>!1)}function aY(){return()=>{}}var C0={exports:{}},E0={},A0={exports:{}},T0={};var aP;function iY(){if(aP)return T0;aP=1;var e=xh();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function u(p,g){var x=g(),j=r({inst:{value:x,getSnapshot:g}}),b=j[0].inst,w=j[1];return i(function(){b.value=x,b.getSnapshot=g,d(b)&&w({inst:b})},[p,x,g]),a(function(){return d(b)&&w({inst:b}),p(function(){d(b)&&w({inst:b})})},[p]),l(x),x}function d(p){var g=p.getSnapshot;p=p.value;try{var x=g();return!n(p,x)}catch{return!0}}function f(p,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return T0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,T0}var iP;function oY(){return iP||(iP=1,A0.exports=iY()),A0.exports}var oP;function sY(){if(oP)return E0;oP=1;var e=xh(),t=oY();function n(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return E0.useSyncExternalStoreWithSelector=function(f,m,p,g,x){var j=i(null);if(j.current===null){var b={hasValue:!1,value:null};j.current=b}else b=j.current;j=u(function(){function N(k){if(!O){if(O=!0,C=k,k=g(k),x!==void 0&&b.hasValue){var T=b.value;if(x(T,k))return A=T}return A=k}if(T=A,r(C,k))return T;var P=g(k);return x!==void 0&&x(T,P)?(C=k,T):(C=k,A=P)}var O=!1,C,A,E=p===void 0?null:p;return[function(){return N(m())},E===null?void 0:function(){return N(E())}]},[m,p,g,x]);var w=a(f,j[0],j[1]);return l(function(){b.hasValue=!0,b.value=w},[w]),d(w),w},E0}var sP;function lY(){return sP||(sP=1,C0.exports=sY()),C0.exports}var cY=lY();function uY(e,t=r=>r,n={}){const r=n.equal??dY;return cY.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function dY(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!t.has(r)||!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=lP(e);if(n.length!==lP(t).length)return!1;for(let r=0;r"u"?k0:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=k0,k0)}function $r(e){const t=y.useContext(QL());return e?.warn,t}function jr(e){const t=$r({warn:e?.router===void 0}),n=e?.router||t,r=y.useRef(void 0);return uY(n.__store,a=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const i=ba(r.current,e.select(a));return r.current=i,i}return e.select(a)}return a})}const Dg=y.createContext(void 0),fY=y.createContext(void 0);function hi(e){const t=y.useContext(e.from?fY:Dg);return jr({select:r=>{const a=r.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(cr(!((e.shouldThrow??!0)&&!a),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),a!==void 0)return e.select?e.select(a):a},structuralSharing:e.structuralSharing})}function jO(e){return hi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function SO(e){const{select:t,...n}=e;return hi({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function _O(e){return hi({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function NO(e){return hi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ia(e){const t=$r();return y.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var gl=IL();const hY=St(gl),wp=typeof window<"u"?y.useLayoutEffect:y.useEffect;function P0(e){const t=y.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function mY(e,t,n={},r={}){y.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const a=new IntersectionObserver(([i])=>{t(i)},n);return a.observe(e.current),()=>{a.disconnect()}},[t,n,r.disabled,e])}function pY(e){const t=y.useRef(null);return y.useImperativeHandle(e,()=>t.current,[]),t}function vY(e,t){const n=$r(),[r,a]=y.useState(!1),i=y.useRef(!1),l=pY(t),{activeProps:u,inactiveProps:d,activeOptions:f,to:m,preload:p,preloadDelay:g,hashScrollIntoView:x,replace:j,startTransition:b,resetScroll:w,viewTransition:N,children:O,target:C,disabled:A,style:E,className:k,onClick:T,onFocus:P,onMouseEnter:$,onMouseLeave:z,onTouchStart:D,ignoreBlocker:U,params:V,search:H,hash:G,state:L,mask:R,reloadDocument:F,unsafeRelative:K,from:te,_fromLocation:I,...B}=e,Y=jr({select:lt=>lt.location.search,structuralSharing:!0}),ne=e.from,oe=y.useMemo(()=>({...e,from:ne}),[n,Y,ne,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),xe=y.useMemo(()=>n.buildLocation({...oe}),[n,oe]),ee=y.useMemo(()=>{if(A)return;let lt=xe.maskedLocation?xe.maskedLocation.url:xe.url,rt=!1;return n.origin&&(lt.startsWith(n.origin)?lt=n.history.createHref(lt.replace(n.origin,""))||"/":rt=!0),{href:lt,external:rt}},[A,xe.maskedLocation,xe.url,n.origin,n.history]),ae=y.useMemo(()=>{if(ee?.external)return ee.href;try{return new URL(m),m}catch{}},[m,ee]),Z=e.reloadDocument||ae?!1:p??n.options.defaultPreload,pe=g??n.options.defaultPreloadDelay??0,je=jr({select:lt=>{if(ae)return!1;if(f?.exact){if(!iG(lt.location.pathname,xe.pathname,n.basepath))return!1}else{const rt=fv(lt.location.pathname,n.basepath),Dn=fv(xe.pathname,n.basepath);if(!(rt.startsWith(Dn)&&(rt.length===Dn.length||rt[Dn.length]==="/")))return!1}return(f?.includeSearch??!0)&&!Ks(lt.location.search,xe.search,{partial:!f?.exact,ignoreUndefined:!f?.explicitUndefined})?!1:f?.includeHash?lt.location.hash===xe.hash:!0}}),le=y.useCallback(()=>{n.preloadRoute({...oe}).catch(lt=>{console.warn(lt),console.warn(JG)})},[n,oe]),Re=y.useCallback(lt=>{lt?.isIntersecting&&le()},[le]);mY(l,Re,wY,{disabled:!!A||Z!=="viewport"}),y.useEffect(()=>{i.current||!A&&Z==="render"&&(le(),i.current=!0)},[A,le,Z]);const _e=lt=>{const rt=lt.currentTarget.getAttribute("target"),Dn=C!==void 0?C:rt;if(!A&&!jY(lt)&&!lt.defaultPrevented&&(!Dn||Dn==="_self")&<.button===0){lt.preventDefault(),gl.flushSync(()=>{a(!0)});const hs=n.subscribe("onResolved",()=>{hs(),a(!1)});n.navigate({...oe,replace:j,resetScroll:w,hashScrollIntoView:x,startTransition:b,viewTransition:N,ignoreBlocker:U})}};if(ae)return{...B,ref:l,href:ae,...O&&{children:O},...C&&{target:C},...A&&{disabled:A},...E&&{style:E},...k&&{className:k},...T&&{onClick:T},...P&&{onFocus:P},...$&&{onMouseEnter:$},...z&&{onMouseLeave:z},...D&&{onTouchStart:D}};const me=lt=>{A||Z&&le()},ve=me,Le=lt=>{if(!(A||!Z))if(!pe)le();else{const rt=lt.target;if(Hd.has(rt))return;const Dn=setTimeout(()=>{Hd.delete(rt),le()},pe);Hd.set(rt,Dn)}},Dt=lt=>{if(A||!Z||!pe)return;const rt=lt.target,Dn=Hd.get(rt);Dn&&(clearTimeout(Dn),Hd.delete(rt))},Nn=je?Ys(u,{})??gY:M0,pr=je?M0:Ys(d,{})??M0,nr=[k,Nn.className,pr.className].filter(Boolean).join(" "),vr=(E||Nn.style||pr.style)&&{...E,...Nn.style,...pr.style};return{...B,...Nn,...pr,href:ee?.href,ref:l,onClick:Wd([T,_e]),onFocus:Wd([P,me]),onMouseEnter:Wd([$,Le]),onMouseLeave:Wd([z,Dt]),onTouchStart:Wd([D,ve]),disabled:!!A,target:C,...vr&&{style:vr},...nr&&{className:nr},...A&&yY,...je&&xY,...r&&bY}}const M0={},gY={className:"active"},yY={role:"link","aria-disabled":!0},xY={"data-status":"active","aria-current":"page"},bY={"data-transitioning":"transitioning"},Hd=new WeakMap,wY={rootMargin:"100px"},Wd=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},OO=y.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:a,ref:i,...l}=vY(r,t),u=typeof r.children=="function"?r.children({isActive:l["data-status"]==="active"}):r.children;return n===void 0&&delete l.disabled,y.createElement(n||"a",{...l,ref:i},u)});function jY(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class SY extends ZL{constructor(t){super(t),this.useMatch=n=>hi({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>hi({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>NO({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>_O({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>SO({...n,from:this.id}),this.useLoaderData=n=>jO({...n,from:this.id}),this.useNavigate=()=>ia({from:this.fullPath}),this.Link=W.forwardRef((n,r)=>o.jsx(OO,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function dr(e){return new SY(e)}class _Y extends eY{constructor(t){super(t),this.useMatch=n=>hi({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>hi({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>NO({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>_O({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>SO({...n,from:this.id}),this.useLoaderData=n=>jO({...n,from:this.id}),this.useNavigate=()=>ia({from:this.fullPath}),this.Link=W.forwardRef((n,r)=>o.jsx(OO,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function NY(e){return new _Y(e)}function cP(e){return typeof e=="object"?new uP(e,{silent:!0}).createRoute(e):new uP(e,{silent:!0}).createRoute}class uP{constructor(t,n){this.path=t,this.createRoute=r=>{this.silent;const a=dr(r);return a.isRoot=!1,a},this.silent=n?.silent}}class dP{constructor(t){this.useMatch=n=>hi({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>hi({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>NO({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>_O({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>SO({...n,from:this.options.id}),this.useLoaderData=n=>jO({...n,from:this.options.id}),this.useNavigate=()=>{const n=$r();return ia({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function fP(e){return typeof e=="object"?new dP(e):t=>new dP({id:e,...t})}function OY(){const e=$r(),t=y.useRef({router:e,mounted:!1}),[n,r]=y.useState(!1),{hasPendingMatches:a,isLoading:i}=jr({select:p=>({isLoading:p.isLoading,hasPendingMatches:p.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),l=P0(i),u=i||n||a,d=P0(u),f=i||a,m=P0(f);return e.startTransition=p=>{r(!0),y.startTransition(()=>{p(),r(!1)})},y.useEffect(()=>{const p=e.history.subscribe(e.load),g=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Go(e.latestLocation.href)!==Go(g.href)&&e.commitLocation({...g,replace:!0}),()=>{p()}},[e,e.history]),wp(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(g){console.error(g)}})()},[e]),wp(()=>{l&&!i&&e.emit({type:"onLoad",...Xs(e.state)})},[l,e,i]),wp(()=>{m&&!f&&e.emit({type:"onBeforeRouteMount",...Xs(e.state)})},[f,m,e]),wp(()=>{d&&!u&&(e.emit({type:"onResolved",...Xs(e.state)}),e.__store.setState(p=>({...p,status:"idle",resolvedLocation:p.location})),MG(e))},[u,d,e]),null}function CY(e){const t=jr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return o.jsx(wO,{getResetKey:()=>t,onCatch:(n,r)=>{if(qa(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(qa(n))return e.fallback?.(n);throw n},children:e.children})}function EY(){return o.jsx("p",{children:"Not Found"})}function Ec(e){return o.jsx(o.Fragment,{children:e.children})}function JL(e,t,n){return t.options.notFoundComponent?o.jsx(t.options.notFoundComponent,{data:n}):e.options.defaultNotFoundComponent?o.jsx(e.options.defaultNotFoundComponent,{data:n}):o.jsx(EY,{})}function AY({children:e}){const t=$r();return t.isServer?o.jsx("script",{nonce:t.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[e].filter(Boolean).join(` +`)+";$_TSR.c()"}}):null}function TY(){const e=$r();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||u_)(e.latestLocation),r=n!==u_(e.latestLocation)?n:void 0,a={storageKey:hv,shouldScrollRestoration:!0};return r&&(a.key=r),o.jsx(AY,{children:`(${zL.toString()})(${JSON.stringify(a)})`})}const e5=y.memo(function({matchId:t}){const n=$r(),r=jr({select:N=>{const O=N.matches.find(C=>C.id===t);return cr(O),{routeId:O.routeId,ssr:O.ssr,_displayPending:O._displayPending}},structuralSharing:!0}),a=n.routesById[r.routeId],i=a.options.pendingComponent??n.options.defaultPendingComponent,l=i?o.jsx(i,{}):null,u=a.options.errorComponent??n.options.defaultErrorComponent,d=a.options.onCatch??n.options.defaultOnCatch,f=a.isRoot?a.options.notFoundComponent??n.options.notFoundRoute?.options.component:a.options.notFoundComponent,m=r.ssr===!1||r.ssr==="data-only",p=(!a.isRoot||a.options.wrapInSuspense||m)&&(a.options.wrapInSuspense??i??(a.options.errorComponent?.preload||m))?y.Suspense:Ec,g=u?wO:Ec,x=f?CY:Ec,j=jr({select:N=>N.loadedAt}),b=jr({select:N=>{const O=N.matches.findIndex(C=>C.id===t);return N.matches[O-1]?.routeId}}),w=a.isRoot?a.options.shellComponent??Ec:Ec;return o.jsxs(w,{children:[o.jsx(Dg.Provider,{value:t,children:o.jsx(p,{fallback:l,children:o.jsx(g,{getResetKey:()=>j,errorComponent:u||Rg,onCatch:(N,O)=>{if(qa(N))throw N;d?.(N,O)},children:o.jsx(x,{fallback:N=>{if(!f||N.routeId&&N.routeId!==r.routeId||!N.routeId&&!a.isRoot)throw N;return y.createElement(f,N)},children:m||r._displayPending?o.jsx(nY,{fallback:l,children:o.jsx(hP,{matchId:t})}):o.jsx(hP,{matchId:t})})})})}),b===Xr&&n.options.scrollRestoration?o.jsxs(o.Fragment,{children:[o.jsx(kY,{}),o.jsx(TY,{})]}):null]})});function kY(){const e=$r(),t=y.useRef(void 0);return o.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Xs(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const hP=y.memo(function({matchId:t}){const n=$r(),{match:r,key:a,routeId:i}=jr({select:d=>{const f=d.matches.find(j=>j.id===t),m=f.routeId,g=(n.routesById[m].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:m,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:m,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),l=n.routesById[i],u=y.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?o.jsx(d,{},a):o.jsx(CO,{})},[a,l.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const d=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const f=n.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise&&!n.isServer){const m=Kc();f._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),f._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return cr(qa(r.error)),JL(n,l,r.error);if(r.status==="redirected")throw cr(ai(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error"){if(n.isServer){const d=(l.options.errorComponent??n.options.defaultErrorComponent)||Rg;return o.jsx(d,{error:r.error,reset:void 0,info:{componentStack:""}})}throw r.error}return u}),CO=y.memo(function(){const t=$r(),n=y.useContext(Dg),r=jr({select:f=>f.matches.find(m=>m.id===n)?.routeId}),a=t.routesById[r],i=jr({select:f=>{const p=f.matches.find(g=>g.id===n);return cr(p),p.globalNotFound}}),l=jr({select:f=>{const m=f.matches,p=m.findIndex(g=>g.id===n);return m[p+1]?.id}}),u=t.options.defaultPendingComponent?o.jsx(t.options.defaultPendingComponent,{}):null;if(i)return JL(t,a,void 0);if(!l)return null;const d=o.jsx(e5,{matchId:l});return r===Xr?o.jsx(y.Suspense,{fallback:u,children:d}):d});function PY(){const e=$r(),n=e.routesById[Xr].options.pendingComponent??e.options.defaultPendingComponent,r=n?o.jsx(n,{}):null,a=e.isServer||typeof document<"u"&&e.ssr?Ec:y.Suspense,i=o.jsxs(a,{fallback:r,children:[!e.isServer&&o.jsx(OY,{}),o.jsx(MY,{})]});return e.options.InnerWrap?o.jsx(e.options.InnerWrap,{children:i}):i}function MY(){const e=$r(),t=jr({select:a=>a.matches[0]?.id}),n=jr({select:a=>a.loadedAt}),r=t?o.jsx(e5,{matchId:t}):null;return o.jsx(Dg.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:o.jsx(wO,{getResetKey:()=>n,errorComponent:Rg,onCatch:a=>{a.message||a.toString()},children:r})})}function RY(){const e=$r();return jr({select:t=>[t.location.href,t.resolvedLocation?.href,t.status],structuralSharing:!0}),y.useCallback(t=>{const{pending:n,caseSensitive:r,fuzzy:a,includeSearch:i,...l}=t;return e.matchRoute(l,{pending:n,caseSensitive:r,fuzzy:a,includeSearch:i})},[e])}const DY=e=>new $Y(e);class $Y extends YG{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=cP,globalThis.createLazyFileRoute=fP):typeof window<"u"&&(window.createFileRoute=cP,window.createLazyFileRoute=fP);function IY({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=QL(),a=o.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?o.jsx(e.options.Wrap,{children:a}):a}function LY({router:e,...t}){return o.jsx(IY,{router:e,...t,children:o.jsx(PY,{})})}function t5(e,t){return function(){return e.apply(t,arguments)}}const{toString:BY}=Object.prototype,{getPrototypeOf:EO}=Object,{iterator:$g,toStringTag:n5}=Symbol,Ig=(e=>t=>{const n=BY.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ha=e=>(e=e.toLowerCase(),t=>Ig(t)===e),Lg=e=>t=>typeof t===e,{isArray:Pu}=Array,Jc=Lg("undefined");function bh(e){return e!==null&&!Jc(e)&&e.constructor!==null&&!Jc(e.constructor)&&kr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const r5=Ha("ArrayBuffer");function zY(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&r5(e.buffer),t}const qY=Lg("string"),kr=Lg("function"),a5=Lg("number"),wh=e=>e!==null&&typeof e=="object",FY=e=>e===!0||e===!1,Qp=e=>{if(Ig(e)!=="object")return!1;const t=EO(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(n5 in e)&&!($g in e)},UY=e=>{if(!wh(e)||bh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},HY=Ha("Date"),WY=Ha("File"),VY=Ha("Blob"),GY=Ha("FileList"),YY=e=>wh(e)&&kr(e.pipe),KY=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||kr(e.append)&&((t=Ig(e))==="formdata"||t==="object"&&kr(e.toString)&&e.toString()==="[object FormData]"))},XY=Ha("URLSearchParams"),[ZY,QY,JY,eK]=["ReadableStream","Request","Response","Headers"].map(Ha),tK=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function jh(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),Pu(e))for(r=0,a=e.length;r0;)if(a=n[r],t===a.toLowerCase())return a;return null}const Fs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,o5=e=>!Jc(e)&&e!==Fs;function f_(){const{caseless:e,skipUndefined:t}=o5(this)&&this||{},n={},r=(a,i)=>{const l=e&&i5(n,i)||i;Qp(n[l])&&Qp(a)?n[l]=f_(n[l],a):Qp(a)?n[l]=f_({},a):Pu(a)?n[l]=a.slice():(!t||!Jc(a))&&(n[l]=a)};for(let a=0,i=arguments.length;a(jh(t,(a,i)=>{n&&kr(a)?e[i]=t5(a,n):e[i]=a},{allOwnKeys:r}),e),rK=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),aK=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},iK=(e,t,n,r)=>{let a,i,l;const u={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)l=a[i],(!r||r(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&EO(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},oK=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},sK=e=>{if(!e)return null;if(Pu(e))return e;let t=e.length;if(!a5(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},lK=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&EO(Uint8Array)),cK=(e,t)=>{const r=(e&&e[$g]).call(e);let a;for(;(a=r.next())&&!a.done;){const i=a.value;t.call(e,i[0],i[1])}},uK=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},dK=Ha("HTMLFormElement"),fK=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),mP=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),hK=Ha("RegExp"),s5=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};jh(n,(a,i)=>{let l;(l=t(a,i,e))!==!1&&(r[i]=l||a)}),Object.defineProperties(e,r)},mK=e=>{s5(e,(t,n)=>{if(kr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(kr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},pK=(e,t)=>{const n={},r=a=>{a.forEach(i=>{n[i]=!0})};return Pu(e)?r(e):r(String(e).split(t)),n},vK=()=>{},gK=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function yK(e){return!!(e&&kr(e.append)&&e[n5]==="FormData"&&e[$g])}const xK=e=>{const t=new Array(10),n=(r,a)=>{if(wh(r)){if(t.indexOf(r)>=0)return;if(bh(r))return r;if(!("toJSON"in r)){t[a]=r;const i=Pu(r)?[]:{};return jh(r,(l,u)=>{const d=n(l,a+1);!Jc(d)&&(i[u]=d)}),t[a]=void 0,i}}return r};return n(e,0)},bK=Ha("AsyncFunction"),wK=e=>e&&(wh(e)||kr(e))&&kr(e.then)&&kr(e.catch),l5=((e,t)=>e?setImmediate:t?((n,r)=>(Fs.addEventListener("message",({source:a,data:i})=>{a===Fs&&i===n&&r.length&&r.shift()()},!1),a=>{r.push(a),Fs.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",kr(Fs.postMessage)),jK=typeof queueMicrotask<"u"?queueMicrotask.bind(Fs):typeof process<"u"&&process.nextTick||l5,SK=e=>e!=null&&kr(e[$g]),de={isArray:Pu,isArrayBuffer:r5,isBuffer:bh,isFormData:KY,isArrayBufferView:zY,isString:qY,isNumber:a5,isBoolean:FY,isObject:wh,isPlainObject:Qp,isEmptyObject:UY,isReadableStream:ZY,isRequest:QY,isResponse:JY,isHeaders:eK,isUndefined:Jc,isDate:HY,isFile:WY,isBlob:VY,isRegExp:hK,isFunction:kr,isStream:YY,isURLSearchParams:XY,isTypedArray:lK,isFileList:GY,forEach:jh,merge:f_,extend:nK,trim:tK,stripBOM:rK,inherits:aK,toFlatObject:iK,kindOf:Ig,kindOfTest:Ha,endsWith:oK,toArray:sK,forEachEntry:cK,matchAll:uK,isHTMLForm:dK,hasOwnProperty:mP,hasOwnProp:mP,reduceDescriptors:s5,freezeMethods:mK,toObjectSet:pK,toCamelCase:fK,noop:vK,toFiniteNumber:gK,findKey:i5,global:Fs,isContextDefined:o5,isSpecCompliantForm:yK,toJSONObject:xK,isAsyncFn:bK,isThenable:wK,setImmediate:l5,asap:jK,isIterable:SK};function Xe(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}de.inherits(Xe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:de.toJSONObject(this.config),code:this.code,status:this.status}}});const c5=Xe.prototype,u5={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{u5[e]={value:e}});Object.defineProperties(Xe,u5);Object.defineProperty(c5,"isAxiosError",{value:!0});Xe.from=(e,t,n,r,a,i)=>{const l=Object.create(c5);de.toFlatObject(e,l,function(m){return m!==Error.prototype},f=>f!=="isAxiosError");const u=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return Xe.call(l,u,d,n,r,a),e&&l.cause==null&&Object.defineProperty(l,"cause",{value:e,configurable:!0}),l.name=e&&e.name||"Error",i&&Object.assign(l,i),l};const _K=null;function h_(e){return de.isPlainObject(e)||de.isArray(e)}function d5(e){return de.endsWith(e,"[]")?e.slice(0,-2):e}function pP(e,t,n){return e?e.concat(t).map(function(a,i){return a=d5(a),!n&&i?"["+a+"]":a}).join(n?".":""):t}function NK(e){return de.isArray(e)&&!e.some(h_)}const OK=de.toFlatObject(de,{},null,function(t){return/^is[A-Z]/.test(t)});function Bg(e,t,n){if(!de.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=de.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,w){return!de.isUndefined(w[b])});const r=n.metaTokens,a=n.visitor||m,i=n.dots,l=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&de.isSpecCompliantForm(t);if(!de.isFunction(a))throw new TypeError("visitor must be a function");function f(j){if(j===null)return"";if(de.isDate(j))return j.toISOString();if(de.isBoolean(j))return j.toString();if(!d&&de.isBlob(j))throw new Xe("Blob is not supported. Use a Buffer instead.");return de.isArrayBuffer(j)||de.isTypedArray(j)?d&&typeof Blob=="function"?new Blob([j]):Buffer.from(j):j}function m(j,b,w){let N=j;if(j&&!w&&typeof j=="object"){if(de.endsWith(b,"{}"))b=r?b:b.slice(0,-2),j=JSON.stringify(j);else if(de.isArray(j)&&NK(j)||(de.isFileList(j)||de.endsWith(b,"[]"))&&(N=de.toArray(j)))return b=d5(b),N.forEach(function(C,A){!(de.isUndefined(C)||C===null)&&t.append(l===!0?pP([b],A,i):l===null?b:b+"[]",f(C))}),!1}return h_(j)?!0:(t.append(pP(w,b,i),f(j)),!1)}const p=[],g=Object.assign(OK,{defaultVisitor:m,convertValue:f,isVisitable:h_});function x(j,b){if(!de.isUndefined(j)){if(p.indexOf(j)!==-1)throw Error("Circular reference detected in "+b.join("."));p.push(j),de.forEach(j,function(N,O){(!(de.isUndefined(N)||N===null)&&a.call(t,N,de.isString(O)?O.trim():O,b,g))===!0&&x(N,b?b.concat(O):[O])}),p.pop()}}if(!de.isObject(e))throw new TypeError("data must be an object");return x(e),t}function vP(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function AO(e,t){this._pairs=[],e&&Bg(e,this,t)}const f5=AO.prototype;f5.append=function(t,n){this._pairs.push([t,n])};f5.toString=function(t){const n=t?function(r){return t.call(this,r,vP)}:vP;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function CK(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function h5(e,t,n){if(!t)return e;const r=n&&n.encode||CK;de.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let i;if(a?i=a(t,n):i=de.isURLSearchParams(t)?t.toString():new AO(t,n).toString(r),i){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class gP{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){de.forEach(this.handlers,function(r){r!==null&&t(r)})}}const m5={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},EK=typeof URLSearchParams<"u"?URLSearchParams:AO,AK=typeof FormData<"u"?FormData:null,TK=typeof Blob<"u"?Blob:null,kK={isBrowser:!0,classes:{URLSearchParams:EK,FormData:AK,Blob:TK},protocols:["http","https","file","blob","url","data"]},TO=typeof window<"u"&&typeof document<"u",m_=typeof navigator=="object"&&navigator||void 0,PK=TO&&(!m_||["ReactNative","NativeScript","NS"].indexOf(m_.product)<0),MK=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",RK=TO&&window.location.href||"http://localhost",DK=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:TO,hasStandardBrowserEnv:PK,hasStandardBrowserWebWorkerEnv:MK,navigator:m_,origin:RK},Symbol.toStringTag,{value:"Module"})),lr={...DK,...kK};function $K(e,t){return Bg(e,new lr.classes.URLSearchParams,{visitor:function(n,r,a,i){return lr.isNode&&de.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function IK(e){return de.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function LK(e){const t={},n=Object.keys(e);let r;const a=n.length;let i;for(r=0;r=n.length;return l=!l&&de.isArray(a)?a.length:l,d?(de.hasOwnProp(a,l)?a[l]=[a[l],r]:a[l]=r,!u):((!a[l]||!de.isObject(a[l]))&&(a[l]=[]),t(n,r,a[l],i)&&de.isArray(a[l])&&(a[l]=LK(a[l])),!u)}if(de.isFormData(e)&&de.isFunction(e.entries)){const n={};return de.forEachEntry(e,(r,a)=>{t(IK(r),a,n,0)}),n}return null}function BK(e,t,n){if(de.isString(e))try{return(t||JSON.parse)(e),de.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Sh={transitional:m5,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,i=de.isObject(t);if(i&&de.isHTMLForm(t)&&(t=new FormData(t)),de.isFormData(t))return a?JSON.stringify(p5(t)):t;if(de.isArrayBuffer(t)||de.isBuffer(t)||de.isStream(t)||de.isFile(t)||de.isBlob(t)||de.isReadableStream(t))return t;if(de.isArrayBufferView(t))return t.buffer;if(de.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return $K(t,this.formSerializer).toString();if((u=de.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Bg(u?{"files[]":t}:t,d&&new d,this.formSerializer)}}return i||a?(n.setContentType("application/json",!1),BK(t)):t}],transformResponse:[function(t){const n=this.transitional||Sh.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(de.isResponse(t)||de.isReadableStream(t))return t;if(t&&de.isString(t)&&(r&&!this.responseType||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t,this.parseReviver)}catch(u){if(l)throw u.name==="SyntaxError"?Xe.from(u,Xe.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:lr.classes.FormData,Blob:lr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};de.forEach(["delete","get","head","post","put","patch"],e=>{Sh.headers[e]={}});const zK=de.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),qK=e=>{const t={};let n,r,a;return e&&e.split(` +`).forEach(function(l){a=l.indexOf(":"),n=l.substring(0,a).trim().toLowerCase(),r=l.substring(a+1).trim(),!(!n||t[n]&&zK[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},yP=Symbol("internals");function Vd(e){return e&&String(e).trim().toLowerCase()}function Jp(e){return e===!1||e==null?e:de.isArray(e)?e.map(Jp):String(e)}function FK(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const UK=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function R0(e,t,n,r,a){if(de.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!de.isString(t)){if(de.isString(r))return t.indexOf(r)!==-1;if(de.isRegExp(r))return r.test(t)}}function HK(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function WK(e,t){const n=de.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,i,l){return this[r].call(this,t,a,i,l)},configurable:!0})})}let Pr=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function i(u,d,f){const m=Vd(d);if(!m)throw new Error("header name must be a non-empty string");const p=de.findKey(a,m);(!p||a[p]===void 0||f===!0||f===void 0&&a[p]!==!1)&&(a[p||d]=Jp(u))}const l=(u,d)=>de.forEach(u,(f,m)=>i(f,m,d));if(de.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(de.isString(t)&&(t=t.trim())&&!UK(t))l(qK(t),n);else if(de.isObject(t)&&de.isIterable(t)){let u={},d,f;for(const m of t){if(!de.isArray(m))throw TypeError("Object iterator must return a key-value pair");u[f=m[0]]=(d=u[f])?de.isArray(d)?[...d,m[1]]:[d,m[1]]:m[1]}l(u,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=Vd(t),t){const r=de.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return FK(a);if(de.isFunction(n))return n.call(this,a,r);if(de.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Vd(t),t){const r=de.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||R0(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function i(l){if(l=Vd(l),l){const u=de.findKey(r,l);u&&(!n||R0(r,r[u],u,n))&&(delete r[u],a=!0)}}return de.isArray(t)?t.forEach(i):i(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const i=n[r];(!t||R0(this,this[i],i,t,!0))&&(delete this[i],a=!0)}return a}normalize(t){const n=this,r={};return de.forEach(this,(a,i)=>{const l=de.findKey(r,i);if(l){n[l]=Jp(a),delete n[i];return}const u=t?HK(i):String(i).trim();u!==i&&delete n[i],n[u]=Jp(a),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return de.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&de.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[yP]=this[yP]={accessors:{}}).accessors,a=this.prototype;function i(l){const u=Vd(l);r[u]||(WK(a,l),r[u]=!0)}return de.isArray(t)?t.forEach(i):i(t),this}};Pr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);de.reduceDescriptors(Pr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});de.freezeMethods(Pr);function D0(e,t){const n=this||Sh,r=t||n,a=Pr.from(r.headers);let i=r.data;return de.forEach(e,function(u){i=u.call(n,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function v5(e){return!!(e&&e.__CANCEL__)}function Mu(e,t,n){Xe.call(this,e??"canceled",Xe.ERR_CANCELED,t,n),this.name="CanceledError"}de.inherits(Mu,Xe,{__CANCEL__:!0});function g5(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Xe("Request failed with status code "+n.status,[Xe.ERR_BAD_REQUEST,Xe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function VK(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function GK(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,i=0,l;return t=t!==void 0?t:1e3,function(d){const f=Date.now(),m=r[i];l||(l=f),n[a]=d,r[a]=f;let p=i,g=0;for(;p!==a;)g+=n[p++],p=p%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),f-l{n=m,a=null,i&&(clearTimeout(i),i=null),e(...f)};return[(...f)=>{const m=Date.now(),p=m-n;p>=r?l(f,m):(a=f,i||(i=setTimeout(()=>{i=null,l(a)},r-p)))},()=>a&&l(a)]}const vv=(e,t,n=3)=>{let r=0;const a=GK(50,250);return YK(i=>{const l=i.loaded,u=i.lengthComputable?i.total:void 0,d=l-r,f=a(d),m=l<=u;r=l;const p={loaded:l,total:u,progress:u?l/u:void 0,bytes:d,rate:f||void 0,estimated:f&&u&&m?(u-l)/f:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(p)},n)},xP=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},bP=e=>(...t)=>de.asap(()=>e(...t)),KK=lr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,lr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(lr.origin),lr.navigator&&/(msie|trident)/i.test(lr.navigator.userAgent)):()=>!0,XK=lr.hasStandardBrowserEnv?{write(e,t,n,r,a,i,l){if(typeof document>"u")return;const u=[`${e}=${encodeURIComponent(t)}`];de.isNumber(n)&&u.push(`expires=${new Date(n).toUTCString()}`),de.isString(r)&&u.push(`path=${r}`),de.isString(a)&&u.push(`domain=${a}`),i===!0&&u.push("secure"),de.isString(l)&&u.push(`SameSite=${l}`),document.cookie=u.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ZK(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function QK(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function y5(e,t,n){let r=!ZK(t);return e&&(r||n==!1)?QK(e,t):t}const wP=e=>e instanceof Pr?{...e}:e;function il(e,t){t=t||{};const n={};function r(f,m,p,g){return de.isPlainObject(f)&&de.isPlainObject(m)?de.merge.call({caseless:g},f,m):de.isPlainObject(m)?de.merge({},m):de.isArray(m)?m.slice():m}function a(f,m,p,g){if(de.isUndefined(m)){if(!de.isUndefined(f))return r(void 0,f,p,g)}else return r(f,m,p,g)}function i(f,m){if(!de.isUndefined(m))return r(void 0,m)}function l(f,m){if(de.isUndefined(m)){if(!de.isUndefined(f))return r(void 0,f)}else return r(void 0,m)}function u(f,m,p){if(p in t)return r(f,m);if(p in e)return r(void 0,f)}const d={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(f,m,p)=>a(wP(f),wP(m),p,!0)};return de.forEach(Object.keys({...e,...t}),function(m){const p=d[m]||a,g=p(e[m],t[m],m);de.isUndefined(g)&&p!==u||(n[m]=g)}),n}const x5=e=>{const t=il({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:i,headers:l,auth:u}=t;if(t.headers=l=Pr.from(l),t.url=h5(y5(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),de.isFormData(n)){if(lr.hasStandardBrowserEnv||lr.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(de.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([m,p])=>{f.includes(m.toLowerCase())&&l.set(m,p)})}}if(lr.hasStandardBrowserEnv&&(r&&de.isFunction(r)&&(r=r(t)),r||r!==!1&&KK(t.url))){const d=a&&i&&XK.read(i);d&&l.set(a,d)}return t},JK=typeof XMLHttpRequest<"u",eX=JK&&function(e){return new Promise(function(n,r){const a=x5(e);let i=a.data;const l=Pr.from(a.headers).normalize();let{responseType:u,onUploadProgress:d,onDownloadProgress:f}=a,m,p,g,x,j;function b(){x&&x(),j&&j(),a.cancelToken&&a.cancelToken.unsubscribe(m),a.signal&&a.signal.removeEventListener("abort",m)}let w=new XMLHttpRequest;w.open(a.method.toUpperCase(),a.url,!0),w.timeout=a.timeout;function N(){if(!w)return;const C=Pr.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),E={data:!u||u==="text"||u==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:C,config:e,request:w};g5(function(T){n(T),b()},function(T){r(T),b()},E),w=null}"onloadend"in w?w.onloadend=N:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(N)},w.onabort=function(){w&&(r(new Xe("Request aborted",Xe.ECONNABORTED,e,w)),w=null)},w.onerror=function(A){const E=A&&A.message?A.message:"Network Error",k=new Xe(E,Xe.ERR_NETWORK,e,w);k.event=A||null,r(k),w=null},w.ontimeout=function(){let A=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const E=a.transitional||m5;a.timeoutErrorMessage&&(A=a.timeoutErrorMessage),r(new Xe(A,E.clarifyTimeoutError?Xe.ETIMEDOUT:Xe.ECONNABORTED,e,w)),w=null},i===void 0&&l.setContentType(null),"setRequestHeader"in w&&de.forEach(l.toJSON(),function(A,E){w.setRequestHeader(E,A)}),de.isUndefined(a.withCredentials)||(w.withCredentials=!!a.withCredentials),u&&u!=="json"&&(w.responseType=a.responseType),f&&([g,j]=vv(f,!0),w.addEventListener("progress",g)),d&&w.upload&&([p,x]=vv(d),w.upload.addEventListener("progress",p),w.upload.addEventListener("loadend",x)),(a.cancelToken||a.signal)&&(m=C=>{w&&(r(!C||C.type?new Mu(null,e,w):C),w.abort(),w=null)},a.cancelToken&&a.cancelToken.subscribe(m),a.signal&&(a.signal.aborted?m():a.signal.addEventListener("abort",m)));const O=VK(a.url);if(O&&lr.protocols.indexOf(O)===-1){r(new Xe("Unsupported protocol "+O+":",Xe.ERR_BAD_REQUEST,e));return}w.send(i||null)})},tX=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const i=function(f){if(!a){a=!0,u();const m=f instanceof Error?f:this.reason;r.abort(m instanceof Xe?m:new Mu(m instanceof Error?m.message:m))}};let l=t&&setTimeout(()=>{l=null,i(new Xe(`timeout ${t} of ms exceeded`,Xe.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),e=null)};e.forEach(f=>f.addEventListener("abort",i));const{signal:d}=r;return d.unsubscribe=()=>de.asap(u),d}},nX=function*(e,t){let n=e.byteLength;if(n{const a=rX(e,t);let i=0,l,u=d=>{l||(l=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:f,value:m}=await a.next();if(f){u(),d.close();return}let p=m.byteLength;if(n){let g=i+=p;n(g)}d.enqueue(new Uint8Array(m))}catch(f){throw u(f),f}},cancel(d){return u(d),a.return()}},{highWaterMark:2})},SP=64*1024,{isFunction:jp}=de,iX=(({Request:e,Response:t})=>({Request:e,Response:t}))(de.global),{ReadableStream:_P,TextEncoder:NP}=de.global,OP=(e,...t)=>{try{return!!e(...t)}catch{return!1}},oX=e=>{e=de.merge.call({skipUndefined:!0},iX,e);const{fetch:t,Request:n,Response:r}=e,a=t?jp(t):typeof fetch=="function",i=jp(n),l=jp(r);if(!a)return!1;const u=a&&jp(_P),d=a&&(typeof NP=="function"?(j=>b=>j.encode(b))(new NP):async j=>new Uint8Array(await new n(j).arrayBuffer())),f=i&&u&&OP(()=>{let j=!1;const b=new n(lr.origin,{body:new _P,method:"POST",get duplex(){return j=!0,"half"}}).headers.has("Content-Type");return j&&!b}),m=l&&u&&OP(()=>de.isReadableStream(new r("").body)),p={stream:m&&(j=>j.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(j=>{!p[j]&&(p[j]=(b,w)=>{let N=b&&b[j];if(N)return N.call(b);throw new Xe(`Response type '${j}' is not supported`,Xe.ERR_NOT_SUPPORT,w)})});const g=async j=>{if(j==null)return 0;if(de.isBlob(j))return j.size;if(de.isSpecCompliantForm(j))return(await new n(lr.origin,{method:"POST",body:j}).arrayBuffer()).byteLength;if(de.isArrayBufferView(j)||de.isArrayBuffer(j))return j.byteLength;if(de.isURLSearchParams(j)&&(j=j+""),de.isString(j))return(await d(j)).byteLength},x=async(j,b)=>{const w=de.toFiniteNumber(j.getContentLength());return w??g(b)};return async j=>{let{url:b,method:w,data:N,signal:O,cancelToken:C,timeout:A,onDownloadProgress:E,onUploadProgress:k,responseType:T,headers:P,withCredentials:$="same-origin",fetchOptions:z}=x5(j),D=t||fetch;T=T?(T+"").toLowerCase():"text";let U=tX([O,C&&C.toAbortSignal()],A),V=null;const H=U&&U.unsubscribe&&(()=>{U.unsubscribe()});let G;try{if(k&&f&&w!=="get"&&w!=="head"&&(G=await x(P,N))!==0){let I=new n(b,{method:"POST",body:N,duplex:"half"}),B;if(de.isFormData(N)&&(B=I.headers.get("content-type"))&&P.setContentType(B),I.body){const[Y,ne]=xP(G,vv(bP(k)));N=jP(I.body,SP,Y,ne)}}de.isString($)||($=$?"include":"omit");const L=i&&"credentials"in n.prototype,R={...z,signal:U,method:w.toUpperCase(),headers:P.normalize().toJSON(),body:N,duplex:"half",credentials:L?$:void 0};V=i&&new n(b,R);let F=await(i?D(V,z):D(b,R));const K=m&&(T==="stream"||T==="response");if(m&&(E||K&&H)){const I={};["status","statusText","headers"].forEach(oe=>{I[oe]=F[oe]});const B=de.toFiniteNumber(F.headers.get("content-length")),[Y,ne]=E&&xP(B,vv(bP(E),!0))||[];F=new r(jP(F.body,SP,Y,()=>{ne&&ne(),H&&H()}),I)}T=T||"text";let te=await p[de.findKey(p,T)||"text"](F,j);return!K&&H&&H(),await new Promise((I,B)=>{g5(I,B,{data:te,headers:Pr.from(F.headers),status:F.status,statusText:F.statusText,config:j,request:V})})}catch(L){throw H&&H(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new Xe("Network Error",Xe.ERR_NETWORK,j,V),{cause:L.cause||L}):Xe.from(L,L&&L.code,j,V)}}},sX=new Map,b5=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,i=[r,a,n];let l=i.length,u=l,d,f,m=sX;for(;u--;)d=i[u],f=m.get(d),f===void 0&&m.set(d,f=u?new Map:oX(t)),m=f;return f};b5();const kO={http:_K,xhr:eX,fetch:{get:b5}};de.forEach(kO,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const CP=e=>`- ${e}`,lX=e=>de.isFunction(e)||e===null||e===!1;function cX(e,t){e=de.isArray(e)?e:[e];const{length:n}=e;let r,a;const i={};for(let l=0;l`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let u=n?l.length>1?`since : +`+l.map(CP).join(` +`):" "+CP(l[0]):"as no adapter specified";throw new Xe("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return a}const w5={getAdapter:cX,adapters:kO};function $0(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Mu(null,e)}function EP(e){return $0(e),e.headers=Pr.from(e.headers),e.data=D0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),w5.getAdapter(e.adapter||Sh.adapter,e)(e).then(function(r){return $0(e),r.data=D0.call(e,e.transformResponse,r),r.headers=Pr.from(r.headers),r},function(r){return v5(r)||($0(e),r&&r.response&&(r.response.data=D0.call(e,e.transformResponse,r.response),r.response.headers=Pr.from(r.response.headers))),Promise.reject(r)})}const j5="1.13.2",zg={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{zg[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const AP={};zg.transitional=function(t,n,r){function a(i,l){return"[Axios v"+j5+"] Transitional option '"+i+"'"+l+(r?". "+r:"")}return(i,l,u)=>{if(t===!1)throw new Xe(a(l," has been removed"+(n?" in "+n:"")),Xe.ERR_DEPRECATED);return n&&!AP[l]&&(AP[l]=!0,console.warn(a(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,l,u):!0}};zg.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function uX(e,t,n){if(typeof e!="object")throw new Xe("options must be an object",Xe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const i=r[a],l=t[i];if(l){const u=e[i],d=u===void 0||l(u,i,e);if(d!==!0)throw new Xe("option "+i+" must be "+d,Xe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Xe("Unknown option "+i,Xe.ERR_BAD_OPTION)}}const ev={assertOptions:uX,validators:zg},Qa=ev.validators;let Zs=class{constructor(t){this.defaults=t||{},this.interceptors={request:new gP,response:new gP}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=il(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:i}=n;r!==void 0&&ev.assertOptions(r,{silentJSONParsing:Qa.transitional(Qa.boolean),forcedJSONParsing:Qa.transitional(Qa.boolean),clarifyTimeoutError:Qa.transitional(Qa.boolean)},!1),a!=null&&(de.isFunction(a)?n.paramsSerializer={serialize:a}:ev.assertOptions(a,{encode:Qa.function,serialize:Qa.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ev.assertOptions(n,{baseUrl:Qa.spelling("baseURL"),withXsrfToken:Qa.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=i&&de.merge(i.common,i[n.method]);i&&de.forEach(["delete","get","head","post","put","patch","common"],j=>{delete i[j]}),n.headers=Pr.concat(l,i);const u=[];let d=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(d=d&&b.synchronous,u.unshift(b.fulfilled,b.rejected))});const f=[];this.interceptors.response.forEach(function(b){f.push(b.fulfilled,b.rejected)});let m,p=0,g;if(!d){const j=[EP.bind(this),void 0];for(j.unshift(...u),j.push(...f),g=j.length,m=Promise.resolve(n);p{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](a);r._listeners=null}),this.promise.then=a=>{let i;const l=new Promise(u=>{r.subscribe(u),i=u}).then(a);return l.cancel=function(){r.unsubscribe(i)},l},t(function(i,l,u){r.reason||(r.reason=new Mu(i,l,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new S5(function(a){t=a}),cancel:t}}};function fX(e){return function(n){return e.apply(null,n)}}function hX(e){return de.isObject(e)&&e.isAxiosError===!0}const p_={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(p_).forEach(([e,t])=>{p_[t]=e});function _5(e){const t=new Zs(e),n=t5(Zs.prototype.request,t);return de.extend(n,Zs.prototype,t,{allOwnKeys:!0}),de.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return _5(il(e,a))},n}const cn=_5(Sh);cn.Axios=Zs;cn.CanceledError=Mu;cn.CancelToken=dX;cn.isCancel=v5;cn.VERSION=j5;cn.toFormData=Bg;cn.AxiosError=Xe;cn.Cancel=cn.CanceledError;cn.all=function(t){return Promise.all(t)};cn.spread=fX;cn.isAxiosError=hX;cn.mergeConfig=il;cn.AxiosHeaders=Pr;cn.formToJSON=e=>p5(de.isHTMLForm(e)?new FormData(e):e);cn.getAdapter=w5.getAdapter;cn.HttpStatusCode=p_;cn.default=cn;const{Axios:uAe,AxiosError:dAe,CanceledError:fAe,isCancel:hAe,CancelToken:mAe,VERSION:pAe,all:vAe,Cancel:gAe,isAxiosError:yAe,spread:xAe,toFormData:bAe,AxiosHeaders:wAe,HttpStatusCode:jAe,formToJSON:SAe,getAdapter:_Ae,mergeConfig:NAe}=cn;function N5(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const n=new Array(e.length+t.length);for(let r=0;r({classGroupId:e,validator:t}),O5=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),gv="-",TP=[],vX="arbitrary..",gX=e=>{const t=xX(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return yX(l);const u=l.split(gv),d=u[0]===""&&u.length>1?1:0;return C5(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],f=n[l];return d?f?mX(f,d):d:f||TP}return n[l]||TP}}},C5=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],i=n.nextPart.get(a);if(i){const f=C5(e,t+1,i);if(f)return f}const l=n.validators;if(l===null)return;const u=t===0?e.join(gv):e.slice(t).join(gv),d=l.length;for(let f=0;fe.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?vX+r:void 0})(),xX=e=>{const{theme:t,classGroups:n}=e;return bX(n,t)},bX=(e,t)=>{const n=O5();for(const r in e){const a=e[r];PO(a,n,r,t)}return n},PO=(e,t,n,r)=>{const a=e.length;for(let i=0;i{if(typeof e=="string"){jX(e,t,n);return}if(typeof e=="function"){SX(e,t,n,r);return}_X(e,t,n,r)},jX=(e,t,n)=>{const r=e===""?t:E5(t,e);r.classGroupId=n},SX=(e,t,n,r)=>{if(NX(e)){PO(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(pX(n,e))},_X=(e,t,n,r)=>{const a=Object.entries(e),i=a.length;for(let l=0;l{let n=e;const r=t.split(gv),a=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,OX=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(i,l)=>{n[i]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let l=n[i];if(l!==void 0)return l;if((l=r[i])!==void 0)return a(i,l),l},set(i,l){i in n?n[i]=l:a(i,l)}}},v_="!",kP=":",CX=[],PP=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),EX=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const i=[];let l=0,u=0,d=0,f;const m=a.length;for(let b=0;bd?f-d:void 0;return PP(i,x,g,j)};if(t){const a=t+kP,i=r;r=l=>l.startsWith(a)?i(l.slice(a.length)):PP(CX,!1,l,void 0,!0)}if(n){const a=r;r=i=>n({className:i,parseClassName:a})}return r},AX=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let i=0;i0&&(a.sort(),r.push(...a),a=[]),r.push(l)):a.push(l)}return a.length>0&&(a.sort(),r.push(...a)),r}},TX=e=>({cache:OX(e.cacheSize),parseClassName:EX(e),sortModifiers:AX(e),...gX(e)}),kX=/\s+/,PX=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:i}=t,l=[],u=e.trim().split(kX);let d="";for(let f=u.length-1;f>=0;f-=1){const m=u[f],{isExternal:p,modifiers:g,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:b}=n(m);if(p){d=m+(d.length>0?" "+d:d);continue}let w=!!b,N=r(w?j.substring(0,b):j);if(!N){if(!w){d=m+(d.length>0?" "+d:d);continue}if(N=r(j),!N){d=m+(d.length>0?" "+d:d);continue}w=!1}const O=g.length===0?"":g.length===1?g[0]:i(g).join(":"),C=x?O+v_:O,A=C+N;if(l.indexOf(A)>-1)continue;l.push(A);const E=a(N,w);for(let k=0;k0?" "+d:d)}return d},MX=(...e)=>{let t=0,n,r,a="";for(;t{if(typeof e=="string")return e;let t,n="";for(let r=0;r{let n,r,a,i;const l=d=>{const f=t.reduce((m,p)=>p(m),e());return n=TX(f),r=n.cache.get,a=n.cache.set,i=u,u(d)},u=d=>{const f=r(d);if(f)return f;const m=PX(d,n);return a(d,m),m};return i=l,(...d)=>i(MX(...d))},DX=[],Cn=e=>{const t=n=>n[e]||DX;return t.isThemeGetter=!0,t},T5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,k5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$X=/^\d+\/\d+$/,IX=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,LX=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,BX=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zX=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qX=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yc=e=>$X.test(e),nt=e=>!!e&&!Number.isNaN(Number(e)),Io=e=>!!e&&Number.isInteger(Number(e)),I0=e=>e.endsWith("%")&&nt(e.slice(0,-1)),zi=e=>IX.test(e),FX=()=>!0,UX=e=>LX.test(e)&&!BX.test(e),P5=()=>!1,HX=e=>zX.test(e),WX=e=>qX.test(e),VX=e=>!Te(e)&&!ke(e),GX=e=>Ru(e,D5,P5),Te=e=>T5.test(e),Rs=e=>Ru(e,$5,UX),L0=e=>Ru(e,QX,nt),MP=e=>Ru(e,M5,P5),YX=e=>Ru(e,R5,WX),Sp=e=>Ru(e,I5,HX),ke=e=>k5.test(e),Gd=e=>Du(e,$5),KX=e=>Du(e,JX),RP=e=>Du(e,M5),XX=e=>Du(e,D5),ZX=e=>Du(e,R5),_p=e=>Du(e,I5,!0),Ru=(e,t,n)=>{const r=T5.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Du=(e,t,n=!1)=>{const r=k5.exec(e);return r?r[1]?t(r[1]):n:!1},M5=e=>e==="position"||e==="percentage",R5=e=>e==="image"||e==="url",D5=e=>e==="length"||e==="size"||e==="bg-size",$5=e=>e==="length",QX=e=>e==="number",JX=e=>e==="family-name",I5=e=>e==="shadow",eZ=()=>{const e=Cn("color"),t=Cn("font"),n=Cn("text"),r=Cn("font-weight"),a=Cn("tracking"),i=Cn("leading"),l=Cn("breakpoint"),u=Cn("container"),d=Cn("spacing"),f=Cn("radius"),m=Cn("shadow"),p=Cn("inset-shadow"),g=Cn("text-shadow"),x=Cn("drop-shadow"),j=Cn("blur"),b=Cn("perspective"),w=Cn("aspect"),N=Cn("ease"),O=Cn("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...A(),ke,Te],k=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],P=()=>[ke,Te,d],$=()=>[yc,"full","auto",...P()],z=()=>[Io,"none","subgrid",ke,Te],D=()=>["auto",{span:["full",Io,ke,Te]},Io,ke,Te],U=()=>[Io,"auto",ke,Te],V=()=>["auto","min","max","fr",ke,Te],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...P()],R=()=>[yc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],F=()=>[e,ke,Te],K=()=>[...A(),RP,MP,{position:[ke,Te]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",XX,GX,{size:[ke,Te]}],B=()=>[I0,Gd,Rs],Y=()=>["","none","full",f,ke,Te],ne=()=>["",nt,Gd,Rs],oe=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[nt,I0,RP,MP],ae=()=>["","none",j,ke,Te],Z=()=>["none",nt,ke,Te],pe=()=>["none",nt,ke,Te],je=()=>[nt,ke,Te],le=()=>[yc,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[zi],breakpoint:[zi],color:[FX],container:[zi],"drop-shadow":[zi],ease:["in","out","in-out"],font:[VX],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[zi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[zi],shadow:[zi],spacing:["px",nt],text:[zi],"text-shadow":[zi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yc,Te,ke,w]}],container:["container"],columns:[{columns:[nt,Te,ke,u]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{start:$()}],end:[{end:$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[Io,"auto",ke,Te]}],basis:[{basis:[yc,"full","auto",u,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[nt,yc,"auto","initial","none",Te]}],grow:[{grow:["",nt,ke,Te]}],shrink:[{shrink:["",nt,ke,Te]}],order:[{order:[Io,"first","last","none",ke,Te]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:R()}],w:[{w:[u,"screen",...R()]}],"min-w":[{"min-w":[u,"screen","none",...R()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...R()]}],h:[{h:["screen","lh",...R()]}],"min-h":[{"min-h":["screen","lh","none",...R()]}],"max-h":[{"max-h":["screen","lh",...R()]}],"font-size":[{text:["base",n,Gd,Rs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ke,L0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",I0,Te]}],"font-family":[{font:[KX,Te,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ke,Te]}],"line-clamp":[{"line-clamp":[nt,"none",ke,L0]}],leading:[{leading:[i,...P()]}],"list-image":[{"list-image":["none",ke,Te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,Te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[nt,"from-font","auto",ke,Rs]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[nt,"auto",ke,Te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,Te]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke,Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:K()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Io,ke,Te],radial:["",ke,Te],conic:[Io,ke,Te]},ZX,YX]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[nt,ke,Te]}],"outline-w":[{outline:["",nt,Gd,Rs]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",m,_p,Sp]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",p,_p,Sp]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[nt,Rs]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",g,_p,Sp]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[nt,ke,Te]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[nt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[ke,Te]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[nt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,Te]}],filter:[{filter:["","none",ke,Te]}],blur:[{blur:ae()}],brightness:[{brightness:[nt,ke,Te]}],contrast:[{contrast:[nt,ke,Te]}],"drop-shadow":[{"drop-shadow":["","none",x,_p,Sp]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",nt,ke,Te]}],"hue-rotate":[{"hue-rotate":[nt,ke,Te]}],invert:[{invert:["",nt,ke,Te]}],saturate:[{saturate:[nt,ke,Te]}],sepia:[{sepia:["",nt,ke,Te]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,Te]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[nt,ke,Te]}],"backdrop-contrast":[{"backdrop-contrast":[nt,ke,Te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",nt,ke,Te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[nt,ke,Te]}],"backdrop-invert":[{"backdrop-invert":["",nt,ke,Te]}],"backdrop-opacity":[{"backdrop-opacity":[nt,ke,Te]}],"backdrop-saturate":[{"backdrop-saturate":[nt,ke,Te]}],"backdrop-sepia":[{"backdrop-sepia":["",nt,ke,Te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,Te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[nt,"initial",ke,Te]}],ease:[{ease:["linear","initial",N,ke,Te]}],delay:[{delay:[nt,ke,Te]}],animate:[{animate:["none",O,ke,Te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ke,Te]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Z()}],"rotate-x":[{"rotate-x":Z()}],"rotate-y":[{"rotate-y":Z()}],"rotate-z":[{"rotate-z":Z()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:je()}],"skew-x":[{"skew-x":je()}],"skew-y":[{"skew-y":je()}],transform:[{transform:[ke,Te,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke,Te]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke,Te]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[nt,Gd,Rs,L0]}],stroke:[{stroke:["none",...F()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},tZ=RX(eZ);function ue(...e){return tZ(Ye(e))}const dt=y.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ue("rounded-xl border bg-card text-card-foreground shadow",e),...t}));dt.displayName="Card";const Vt=y.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ue("flex flex-col space-y-1.5 p-6",e),...t}));Vt.displayName="CardHeader";const Gt=y.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ue("font-semibold leading-none tracking-tight",e),...t}));Gt.displayName="CardTitle";const Jn=y.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));Jn.displayName="CardDescription";const ln=y.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ue("p-6 pt-0",e),...t}));ln.displayName="CardContent";const L5=y.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ue("flex items-center p-6 pt-0",e),...t}));L5.displayName="CardFooter";function Se(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function nZ(e,t){const n=y.createContext(t),r=i=>{const{children:l,...u}=i,d=y.useMemo(()=>u,Object.values(u));return o.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function a(i){const l=y.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function fr(e,t=[]){let n=[];function r(i,l){const u=y.createContext(l),d=n.length;n=[...n,l];const f=p=>{const{scope:g,children:x,...j}=p,b=g?.[e]?.[d]||u,w=y.useMemo(()=>j,Object.values(j));return o.jsx(b.Provider,{value:w,children:x})};f.displayName=i+"Provider";function m(p,g){const x=g?.[e]?.[d]||u,j=y.useContext(x);if(j)return j;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,m]}const a=()=>{const i=n.map(l=>y.createContext(l));return function(u){const d=u?.[e]||i;return y.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return a.scopeName=e,[r,rZ(a,...t)]}function rZ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...u,...p}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function DP(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Mr(...e){return t=>{let n=!1;const r=e.map(a=>{const i=DP(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a{const{children:i,...l}=r,u=y.Children.toArray(i),d=u.find(oZ);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return o.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return o.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function aZ(e){const t=y.forwardRef((n,r)=>{const{children:a,...i}=n;if(y.isValidElement(a)){const l=lZ(a),u=sZ(i,a.props);return a.type!==y.Fragment&&(u.ref=r?Mr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var iZ=Symbol("radix.slottable");function oZ(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===iZ}function sZ(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function lZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function _h(e){const t=e+"CollectionProvider",[n,r]=fr(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=b=>{const{scope:w,children:N}=b,O=W.useRef(null),C=W.useRef(new Map).current;return o.jsx(a,{scope:w,itemMap:C,collectionRef:O,children:N})};l.displayName=t;const u=e+"CollectionSlot",d=$P(u),f=W.forwardRef((b,w)=>{const{scope:N,children:O}=b,C=i(u,N),A=qe(w,C.collectionRef);return o.jsx(d,{ref:A,children:O})});f.displayName=u;const m=e+"CollectionItemSlot",p="data-radix-collection-item",g=$P(m),x=W.forwardRef((b,w)=>{const{scope:N,children:O,...C}=b,A=W.useRef(null),E=qe(w,A),k=i(m,N);return W.useEffect(()=>(k.itemMap.set(A,{ref:A,...C}),()=>void k.itemMap.delete(A))),o.jsx(g,{[p]:"",ref:E,children:O})});x.displayName=m;function j(b){const w=i(e+"CollectionConsumer",b);return W.useCallback(()=>{const O=w.collectionRef.current;if(!O)return[];const C=Array.from(O.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((k,T)=>C.indexOf(k.ref.current)-C.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:l,Slot:f,ItemSlot:x},j,r]}var Fn=globalThis?.document?y.useLayoutEffect:()=>{},cZ=gO[" useId ".trim().toString()]||(()=>{}),uZ=0;function qn(e){const[t,n]=y.useState(cZ());return Fn(()=>{n(r=>r??String(uZ++))},[e]),t?`radix-${t}`:""}function dZ(e){const t=fZ(e),n=y.forwardRef((r,a)=>{const{children:i,...l}=r,u=y.Children.toArray(i),d=u.find(mZ);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return o.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return o.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function fZ(e){const t=y.forwardRef((n,r)=>{const{children:a,...i}=n;if(y.isValidElement(a)){const l=vZ(a),u=pZ(i,a.props);return a.type!==y.Fragment&&(u.ref=r?Mr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hZ=Symbol("radix.slottable");function mZ(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hZ}function pZ(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function vZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gZ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Me=gZ.reduce((e,t)=>{const n=dZ(`Primitive.${t}`),r=y.forwardRef((a,i)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(d,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function MO(e,t){e&&gl.flushSync(()=>e.dispatchEvent(t))}function tn(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>t.current?.(...n),[])}var yZ=gO[" useInsertionEffect ".trim().toString()]||Fn;function _a({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,l]=xZ({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:a;{const m=y.useRef(e!==void 0);y.useEffect(()=>{const p=m.current;p!==u&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=u},[u,r])}const f=y.useCallback(m=>{if(u){const p=bZ(m)?m(e):m;p!==e&&l.current?.(p)}else i(m)},[u,e,i,l]);return[d,f]}function xZ({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),a=y.useRef(n),i=y.useRef(t);return yZ(()=>{i.current=t},[t]),y.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}function bZ(e){return typeof e=="function"}var wZ=y.createContext(void 0);function $u(e){const t=y.useContext(wZ);return e||t||"ltr"}var B0="rovingFocusGroup.onEntryFocus",jZ={bubbles:!1,cancelable:!0},Nh="RovingFocusGroup",[g_,B5,SZ]=_h(Nh),[_Z,qg]=fr(Nh,[SZ]),[NZ,OZ]=_Z(Nh),z5=y.forwardRef((e,t)=>o.jsx(g_.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(g_.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(CZ,{...e,ref:t})})}));z5.displayName=Nh;var CZ=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...p}=e,g=y.useRef(null),x=qe(t,g),j=$u(i),[b,w]=_a({prop:l,defaultProp:u??null,onChange:d,caller:Nh}),[N,O]=y.useState(!1),C=tn(f),A=B5(n),E=y.useRef(!1),[k,T]=y.useState(0);return y.useEffect(()=>{const P=g.current;if(P)return P.addEventListener(B0,C),()=>P.removeEventListener(B0,C)},[C]),o.jsx(NZ,{scope:n,orientation:r,dir:j,loop:a,currentTabStopId:b,onItemFocus:y.useCallback(P=>w(P),[w]),onItemShiftTab:y.useCallback(()=>O(!0),[]),onFocusableItemAdd:y.useCallback(()=>T(P=>P+1),[]),onFocusableItemRemove:y.useCallback(()=>T(P=>P-1),[]),children:o.jsx(Me.div,{tabIndex:N||k===0?-1:0,"data-orientation":r,...p,ref:x,style:{outline:"none",...e.style},onMouseDown:Se(e.onMouseDown,()=>{E.current=!0}),onFocus:Se(e.onFocus,P=>{const $=!E.current;if(P.target===P.currentTarget&&$&&!N){const z=new CustomEvent(B0,jZ);if(P.currentTarget.dispatchEvent(z),!z.defaultPrevented){const D=A().filter(L=>L.focusable),U=D.find(L=>L.active),V=D.find(L=>L.id===b),G=[U,V,...D].filter(Boolean).map(L=>L.ref.current);U5(G,m)}}E.current=!1}),onBlur:Se(e.onBlur,()=>O(!1))})})}),q5="RovingFocusGroupItem",F5=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:l,...u}=e,d=qn(),f=i||d,m=OZ(q5,n),p=m.currentTabStopId===f,g=B5(n),{onFocusableItemAdd:x,onFocusableItemRemove:j,currentTabStopId:b}=m;return y.useEffect(()=>{if(r)return x(),()=>j()},[r,x,j]),o.jsx(g_.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:o.jsx(Me.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...u,ref:t,onMouseDown:Se(e.onMouseDown,w=>{r?m.onItemFocus(f):w.preventDefault()}),onFocus:Se(e.onFocus,()=>m.onItemFocus(f)),onKeyDown:Se(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){m.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const N=TZ(w,m.orientation,m.dir);if(N!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let C=g().filter(A=>A.focusable).map(A=>A.ref.current);if(N==="last")C.reverse();else if(N==="prev"||N==="next"){N==="prev"&&C.reverse();const A=C.indexOf(w.currentTarget);C=m.loop?kZ(C,A+1):C.slice(A+1)}setTimeout(()=>U5(C))}}),children:typeof l=="function"?l({isCurrentTabStop:p,hasTabStop:b!=null}):l})})});F5.displayName=q5;var EZ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function AZ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function TZ(e,t,n){const r=AZ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return EZ[r]}function U5(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function kZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var H5=z5,W5=F5;function PZ(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Mn=e=>{const{present:t,children:n}=e,r=MZ(t),a=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),i=qe(r.ref,RZ(a));return typeof n=="function"||r.isPresent?y.cloneElement(a,{ref:i}):null};Mn.displayName="Presence";function MZ(e){const[t,n]=y.useState(),r=y.useRef(null),a=y.useRef(e),i=y.useRef("none"),l=e?"mounted":"unmounted",[u,d]=PZ(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const f=Np(r.current);i.current=u==="mounted"?f:"none"},[u]),Fn(()=>{const f=r.current,m=a.current;if(m!==e){const g=i.current,x=Np(f);e?d("MOUNT"):x==="none"||f?.display==="none"?d("UNMOUNT"):d(m&&g!==x?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),Fn(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,p=x=>{const b=Np(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&b&&(d("ANIMATION_END"),!a.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},g=x=>{x.target===t&&(i.current=Np(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:y.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Np(e){return e?.animationName||"none"}function RZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Fg="Tabs",[DZ]=fr(Fg,[qg]),V5=qg(),[$Z,RO]=DZ(Fg),G5=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:l="horizontal",dir:u,activationMode:d="automatic",...f}=e,m=$u(u),[p,g]=_a({prop:r,onChange:a,defaultProp:i??"",caller:Fg});return o.jsx($Z,{scope:n,baseId:qn(),value:p,onValueChange:g,orientation:l,dir:m,activationMode:d,children:o.jsx(Me.div,{dir:m,"data-orientation":l,...f,ref:t})})});G5.displayName=Fg;var Y5="TabsList",K5=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=RO(Y5,n),l=V5(n);return o.jsx(H5,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:o.jsx(Me.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});K5.displayName=Y5;var X5="TabsTrigger",Z5=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,l=RO(X5,n),u=V5(n),d=eB(l.baseId,r),f=tB(l.baseId,r),m=r===l.value;return o.jsx(W5,{asChild:!0,...u,focusable:!a,active:m,children:o.jsx(Me.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:d,...i,ref:t,onMouseDown:Se(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?l.onValueChange(r):p.preventDefault()}),onKeyDown:Se(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&l.onValueChange(r)}),onFocus:Se(e.onFocus,()=>{const p=l.activationMode!=="manual";!m&&!a&&p&&l.onValueChange(r)})})})});Z5.displayName=X5;var Q5="TabsContent",J5=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...l}=e,u=RO(Q5,n),d=eB(u.baseId,r),f=tB(u.baseId,r),m=r===u.value,p=y.useRef(m);return y.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),o.jsx(Mn,{present:a||m,children:({present:g})=>o.jsx(Me.div,{"data-state":m?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&i})})});J5.displayName=Q5;function eB(e,t){return`${e}-trigger-${t}`}function tB(e,t){return`${e}-content-${t}`}var IZ=G5,nB=K5,rB=Z5,aB=J5;const ol=IZ,Xo=y.forwardRef(({className:e,...t},n)=>o.jsx(nB,{ref:n,className:ue("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Xo.displayName=nB.displayName;const Ct=y.forwardRef(({className:e,...t},n)=>o.jsx(rB,{ref:n,className:ue("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Ct.displayName=rB.displayName;const Qt=y.forwardRef(({className:e,...t},n)=>o.jsx(aB,{ref:n,className:ue("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:animate-in data-[state=active]:fade-in data-[state=active]:duration-300",e),...t}));Qt.displayName=aB.displayName;function Of(e,[t,n]){return Math.min(n,Math.max(t,e))}function LZ(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var DO="ScrollArea",[iB]=fr(DO),[BZ,Oa]=iB(DO),oB=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:i=600,...l}=e,[u,d]=y.useState(null),[f,m]=y.useState(null),[p,g]=y.useState(null),[x,j]=y.useState(null),[b,w]=y.useState(null),[N,O]=y.useState(0),[C,A]=y.useState(0),[E,k]=y.useState(!1),[T,P]=y.useState(!1),$=qe(t,D=>d(D)),z=$u(a);return o.jsx(BZ,{scope:n,type:r,dir:z,scrollHideDelay:i,scrollArea:u,viewport:f,onViewportChange:m,content:p,onContentChange:g,scrollbarX:x,onScrollbarXChange:j,scrollbarXEnabled:E,onScrollbarXEnabledChange:k,scrollbarY:b,onScrollbarYChange:w,scrollbarYEnabled:T,onScrollbarYEnabledChange:P,onCornerWidthChange:O,onCornerHeightChange:A,children:o.jsx(Me.div,{dir:z,...l,ref:$,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})})});oB.displayName=DO;var sB="ScrollAreaViewport",lB=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,l=Oa(sB,n),u=y.useRef(null),d=qe(t,u,l.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),o.jsx(Me.div,{"data-radix-scroll-area-viewport":"",...i,ref:d,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:o.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});lB.displayName=sB;var gi="ScrollAreaScrollbar",$O=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Oa(gi,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=a,u=e.orientation==="horizontal";return y.useEffect(()=>(u?i(!0):l(!0),()=>{u?i(!1):l(!1)}),[u,i,l]),a.type==="hover"?o.jsx(zZ,{...r,ref:t,forceMount:n}):a.type==="scroll"?o.jsx(qZ,{...r,ref:t,forceMount:n}):a.type==="auto"?o.jsx(cB,{...r,ref:t,forceMount:n}):a.type==="always"?o.jsx(IO,{...r,ref:t}):null});$O.displayName=gi;var zZ=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Oa(gi,e.__scopeScrollArea),[i,l]=y.useState(!1);return y.useEffect(()=>{const u=a.scrollArea;let d=0;if(u){const f=()=>{window.clearTimeout(d),l(!0)},m=()=>{d=window.setTimeout(()=>l(!1),a.scrollHideDelay)};return u.addEventListener("pointerenter",f),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",f),u.removeEventListener("pointerleave",m)}}},[a.scrollArea,a.scrollHideDelay]),o.jsx(Mn,{present:n||i,children:o.jsx(cB,{"data-state":i?"visible":"hidden",...r,ref:t})})}),qZ=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Oa(gi,e.__scopeScrollArea),i=e.orientation==="horizontal",l=Hg(()=>d("SCROLL_END"),100),[u,d]=LZ("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(u==="idle"){const f=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(f)}},[u,a.scrollHideDelay,d]),y.useEffect(()=>{const f=a.viewport,m=i?"scrollLeft":"scrollTop";if(f){let p=f[m];const g=()=>{const x=f[m];p!==x&&(d("SCROLL"),l()),p=x};return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[a.viewport,i,d,l]),o.jsx(Mn,{present:n||u!=="hidden",children:o.jsx(IO,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Se(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Se(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),cB=y.forwardRef((e,t)=>{const n=Oa(gi,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,l]=y.useState(!1),u=e.orientation==="horizontal",d=Hg(()=>{if(n.viewport){const f=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,a=Oa(gi,e.__scopeScrollArea),i=y.useRef(null),l=y.useRef(0),[u,d]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=mB(u.viewport,u.content),m={...r,sizes:u,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:g=>l.current=g};function p(g,x){return GZ(g,l.current,u,x)}return n==="horizontal"?o.jsx(FZ,{...m,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const g=a.viewport.scrollLeft,x=IP(g,u,a.dir);i.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollLeft=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollLeft=p(g,a.dir))}}):n==="vertical"?o.jsx(UZ,{...m,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const g=a.viewport.scrollTop,x=IP(g,u);i.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollTop=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollTop=p(g))}}):null}),FZ=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Oa(gi,e.__scopeScrollArea),[l,u]=y.useState(),d=y.useRef(null),f=qe(t,d,i.onScrollbarXChange);return y.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),o.jsx(dB,{"data-orientation":"horizontal",...a,ref:f,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Ug(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,p)=>{if(i.viewport){const g=i.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),vB(g,p)&&m.preventDefault()}},onResize:()=>{d.current&&i.viewport&&l&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:xv(l.paddingLeft),paddingEnd:xv(l.paddingRight)}})}})}),UZ=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Oa(gi,e.__scopeScrollArea),[l,u]=y.useState(),d=y.useRef(null),f=qe(t,d,i.onScrollbarYChange);return y.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),o.jsx(dB,{"data-orientation":"vertical",...a,ref:f,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Ug(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,p)=>{if(i.viewport){const g=i.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),vB(g,p)&&m.preventDefault()}},onResize:()=>{d.current&&i.viewport&&l&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:xv(l.paddingTop),paddingEnd:xv(l.paddingBottom)}})}})}),[HZ,uB]=iB(gi),dB=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:u,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:m,onResize:p,...g}=e,x=Oa(gi,n),[j,b]=y.useState(null),w=qe(t,$=>b($)),N=y.useRef(null),O=y.useRef(""),C=x.viewport,A=r.content-r.viewport,E=tn(m),k=tn(d),T=Hg(p,10);function P($){if(N.current){const z=$.clientX-N.current.left,D=$.clientY-N.current.top;f({x:z,y:D})}}return y.useEffect(()=>{const $=z=>{const D=z.target;j?.contains(D)&&E(z,A)};return document.addEventListener("wheel",$,{passive:!1}),()=>document.removeEventListener("wheel",$,{passive:!1})},[C,j,A,E]),y.useEffect(k,[r,k]),eu(j,T),eu(x.content,T),o.jsx(HZ,{scope:n,scrollbar:j,hasThumb:a,onThumbChange:tn(i),onThumbPointerUp:tn(l),onThumbPositionChange:k,onThumbPointerDown:tn(u),children:o.jsx(Me.div,{...g,ref:w,style:{position:"absolute",...g.style},onPointerDown:Se(e.onPointerDown,$=>{$.button===0&&($.target.setPointerCapture($.pointerId),N.current=j.getBoundingClientRect(),O.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),P($))}),onPointerMove:Se(e.onPointerMove,P),onPointerUp:Se(e.onPointerUp,$=>{const z=$.target;z.hasPointerCapture($.pointerId)&&z.releasePointerCapture($.pointerId),document.body.style.webkitUserSelect=O.current,x.viewport&&(x.viewport.style.scrollBehavior=""),N.current=null})})})}),yv="ScrollAreaThumb",fB=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=uB(yv,e.__scopeScrollArea);return o.jsx(Mn,{present:n||a.hasThumb,children:o.jsx(WZ,{ref:t,...r})})}),WZ=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=Oa(yv,n),l=uB(yv,n),{onThumbPositionChange:u}=l,d=qe(t,p=>l.onThumbChange(p)),f=y.useRef(void 0),m=Hg(()=>{f.current&&(f.current(),f.current=void 0)},100);return y.useEffect(()=>{const p=i.viewport;if(p){const g=()=>{if(m(),!f.current){const x=YZ(p,u);f.current=x,u()}};return u(),p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[i.viewport,m,u]),o.jsx(Me.div,{"data-state":l.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Se(e.onPointerDownCapture,p=>{const x=p.target.getBoundingClientRect(),j=p.clientX-x.left,b=p.clientY-x.top;l.onThumbPointerDown({x:j,y:b})}),onPointerUp:Se(e.onPointerUp,l.onThumbPointerUp)})});fB.displayName=yv;var LO="ScrollAreaCorner",hB=y.forwardRef((e,t)=>{const n=Oa(LO,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?o.jsx(VZ,{...e,ref:t}):null});hB.displayName=LO;var VZ=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Oa(LO,n),[i,l]=y.useState(0),[u,d]=y.useState(0),f=!!(i&&u);return eu(a.scrollbarX,()=>{const m=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(m),d(m)}),eu(a.scrollbarY,()=>{const m=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(m),l(m)}),f?o.jsx(Me.div,{...r,ref:t,style:{width:i,height:u,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function xv(e){return e?parseInt(e,10):0}function mB(e,t){const n=e/t;return isNaN(n)?0:n}function Ug(e){const t=mB(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function GZ(e,t,n,r="ltr"){const a=Ug(n),i=a/2,l=t||i,u=a-l,d=n.scrollbar.paddingStart+l,f=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,p=r==="ltr"?[0,m]:[m*-1,0];return pB([d,f],p)(e)}function IP(e,t,n="ltr"){const r=Ug(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,l=t.content-t.viewport,u=i-r,d=n==="ltr"?[0,l]:[l*-1,0],f=Of(e,d);return pB([0,l],[0,u])(f)}function pB(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function vB(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function a(){const i={left:e.scrollLeft,top:e.scrollTop},l=n.left!==i.left,u=n.top!==i.top;(l||u)&&t(),n=i,r=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(r)};function Hg(e,t){const n=tn(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function eu(e,t){const n=tn(t);Fn(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var gB=oB,KZ=lB,XZ=hB;const Xt=y.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(gB,{ref:r,className:ue("relative overflow-hidden",e),...n,children:[o.jsx(KZ,{className:"h-full w-full rounded-[inherit]",children:t}),o.jsx(yB,{}),o.jsx(XZ,{})]}));Xt.displayName=gB.displayName;const yB=y.forwardRef(({className:e,orientation:t="vertical",...n},r)=>o.jsx($O,{ref:r,orientation:t,className:ue("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:o.jsx(fB,{className:"relative flex-1 rounded-full bg-border"})}));yB.displayName=$O.displayName;var z0,LP;function Ir(){if(LP)return z0;LP=1;var e=Array.isArray;return z0=e,z0}var q0,BP;function xB(){if(BP)return q0;BP=1;var e=typeof gp=="object"&&gp&&gp.Object===Object&&gp;return q0=e,q0}var F0,zP;function yi(){if(zP)return F0;zP=1;var e=xB(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return F0=n,F0}var U0,qP;function Oh(){if(qP)return U0;qP=1;var e=yi(),t=e.Symbol;return U0=t,U0}var H0,FP;function ZZ(){if(FP)return H0;FP=1;var e=Oh(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function i(l){var u=n.call(l,a),d=l[a];try{l[a]=void 0;var f=!0}catch{}var m=r.call(l);return f&&(u?l[a]=d:delete l[a]),m}return H0=i,H0}var W0,UP;function QZ(){if(UP)return W0;UP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return W0=n,W0}var V0,HP;function so(){if(HP)return V0;HP=1;var e=Oh(),t=ZZ(),n=QZ(),r="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function l(u){return u==null?u===void 0?a:r:i&&i in Object(u)?t(u):n(u)}return V0=l,V0}var G0,WP;function lo(){if(WP)return G0;WP=1;function e(t){return t!=null&&typeof t=="object"}return G0=e,G0}var Y0,VP;function Iu(){if(VP)return Y0;VP=1;var e=so(),t=lo(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return Y0=r,Y0}var K0,GP;function BO(){if(GP)return K0;GP=1;var e=Ir(),t=Iu(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(i,l){if(e(i))return!1;var u=typeof i;return u=="number"||u=="symbol"||u=="boolean"||i==null||t(i)?!0:r.test(i)||!n.test(i)||l!=null&&i in Object(l)}return K0=a,K0}var X0,YP;function rs(){if(YP)return X0;YP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return X0=e,X0}var Z0,KP;function zO(){if(KP)return Z0;KP=1;var e=so(),t=rs(),n="[object AsyncFunction]",r="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function l(u){if(!t(u))return!1;var d=e(u);return d==r||d==a||d==n||d==i}return Z0=l,Z0}var Q0,XP;function JZ(){if(XP)return Q0;XP=1;var e=yi(),t=e["__core-js_shared__"];return Q0=t,Q0}var J0,ZP;function eQ(){if(ZP)return J0;ZP=1;var e=JZ(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return J0=n,J0}var ew,QP;function bB(){if(QP)return ew;QP=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return ew=n,ew}var tw,JP;function tQ(){if(JP)return tw;JP=1;var e=zO(),t=eQ(),n=rs(),r=bB(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,d=l.toString,f=u.hasOwnProperty,m=RegExp("^"+d.call(f).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(g){if(!n(g)||t(g))return!1;var x=e(g)?m:i;return x.test(r(g))}return tw=p,tw}var nw,eM;function nQ(){if(eM)return nw;eM=1;function e(t,n){return t?.[n]}return nw=e,nw}var rw,tM;function yl(){if(tM)return rw;tM=1;var e=tQ(),t=nQ();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return rw=n,rw}var aw,nM;function Wg(){if(nM)return aw;nM=1;var e=yl(),t=e(Object,"create");return aw=t,aw}var iw,rM;function rQ(){if(rM)return iw;rM=1;var e=Wg();function t(){this.__data__=e?e(null):{},this.size=0}return iw=t,iw}var ow,aM;function aQ(){if(aM)return ow;aM=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return ow=e,ow}var sw,iM;function iQ(){if(iM)return sw;iM=1;var e=Wg(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function a(i){var l=this.__data__;if(e){var u=l[i];return u===t?void 0:u}return r.call(l,i)?l[i]:void 0}return sw=a,sw}var lw,oM;function oQ(){if(oM)return lw;oM=1;var e=Wg(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return lw=r,lw}var cw,sM;function sQ(){if(sM)return cw;sM=1;var e=Wg(),t="__lodash_hash_undefined__";function n(r,a){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=e&&a===void 0?t:a,this}return cw=n,cw}var uw,lM;function lQ(){if(lM)return uw;lM=1;var e=rQ(),t=aQ(),n=iQ(),r=oQ(),a=sQ();function i(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u-1}return vw=t,vw}var gw,pM;function hQ(){if(pM)return gw;pM=1;var e=Vg();function t(n,r){var a=this.__data__,i=e(a,n);return i<0?(++this.size,a.push([n,r])):a[i][1]=r,this}return gw=t,gw}var yw,vM;function Gg(){if(vM)return yw;vM=1;var e=cQ(),t=uQ(),n=dQ(),r=fQ(),a=hQ();function i(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u0?1:-1},Us=function(t){return sl(t)&&t.indexOf("%")===t.length-1},Oe=function(t){return $Q(t)&&!Ch(t)},IQ=function(t){return Ge(t)},kn=function(t){return Oe(t)||sl(t)},LQ=0,Bu=function(t){var n=++LQ;return"".concat(t||"").concat(n)},br=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Oe(t)&&!sl(t))return r;var i;if(Us(t)){var l=t.indexOf("%");i=n*parseFloat(t.slice(0,l))/100}else i=+t;return Ch(i)&&(i=r),a&&i>n&&(i=n),i},qo=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},BQ=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function x_(e){"@babel/helpers - typeof";return x_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x_(e)}var HM={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Zi=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},WM=null,Hw=null,GO=function e(t){if(t===WM&&Array.isArray(Hw))return Hw;var n=[];return y.Children.forEach(t,function(r){Ge(r)||(PQ.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Hw=n,WM=t,n};function ta(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return Zi(a)}):r=[Zi(t)],GO(e).forEach(function(a){var i=ea(a,"type.displayName")||ea(a,"type.name");r.indexOf(i)!==-1&&n.push(a)}),n}function Yr(e,t){var n=ta(e,t);return n&&n[0]}var VM=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!Oe(r)||r<=0||!Oe(a)||a<=0)},GQ=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],YQ=function(t){return t&&t.type&&sl(t.type)&&GQ.indexOf(t.type)>=0},KQ=function(t){return t&&x_(t)==="object"&&"clipDot"in t},XQ=function(t,n,r,a){var i,l=(i=Uw?.[a])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!We(t)&&(a&&l.includes(n)||FQ.includes(n))||r&&VO.includes(n)},Be=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(y.isValidElement(t)&&(a=t.props),!Lu(a))return null;var i={};return Object.keys(a).forEach(function(l){var u;XQ((u=a)===null||u===void 0?void 0:u[l],l,n,r)&&(i[l]=a[l])}),i},b_=function e(t,n){if(t===n)return!0;var r=y.Children.count(t);if(r!==y.Children.count(n))return!1;if(r===0)return!0;if(r===1)return GM(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function j_(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,i=e.className,l=e.style,u=e.title,d=e.desc,f=eJ(e,JQ),m=a||{width:n,height:r,x:0,y:0},p=Ye("recharts-surface",i);return W.createElement("svg",w_({},Be(f,!0,"svg"),{className:p,width:n,height:r,style:l,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height)}),W.createElement("title",null,u),W.createElement("desc",null,d),t)}var nJ=["children","className"];function S_(){return S_=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function aJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var pt=W.forwardRef(function(e,t){var n=e.children,r=e.className,a=rJ(e,nJ),i=Ye("recharts-layer",r);return W.createElement("g",S_({className:i},Be(a,!0),{ref:t}),n)}),za=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),i=2;ii?0:i+n),r=r>i?i:r,r<0&&(r+=i),i=n>r?0:r-n>>>0,n>>>=0;for(var l=Array(i);++a=i?n:e(n,r,a)}return Vw=t,Vw}var Gw,ZM;function OB(){if(ZM)return Gw;ZM=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,i="\\ufe0e\\ufe0f",l="\\u200d",u=RegExp("["+l+e+a+i+"]");function d(f){return u.test(f)}return Gw=d,Gw}var Yw,QM;function sJ(){if(QM)return Yw;QM=1;function e(t){return t.split("")}return Yw=e,Yw}var Kw,JM;function lJ(){if(JM)return Kw;JM=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,i="\\ufe0e\\ufe0f",l="["+e+"]",u="["+a+"]",d="\\ud83c[\\udffb-\\udfff]",f="(?:"+u+"|"+d+")",m="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",j=f+"?",b="["+i+"]?",w="(?:"+x+"(?:"+[m,p,g].join("|")+")"+b+j+")*",N=b+j+w,O="(?:"+[m+u+"?",u,p,g,l].join("|")+")",C=RegExp(d+"(?="+d+")|"+O+N,"g");function A(E){return E.match(C)||[]}return Kw=A,Kw}var Xw,eR;function cJ(){if(eR)return Xw;eR=1;var e=sJ(),t=OB(),n=lJ();function r(a){return t(a)?n(a):e(a)}return Xw=r,Xw}var Zw,tR;function uJ(){if(tR)return Zw;tR=1;var e=oJ(),t=OB(),n=cJ(),r=jB();function a(i){return function(l){l=r(l);var u=t(l)?n(l):void 0,d=u?u[0]:l.charAt(0),f=u?e(u,1).join(""):l.slice(1);return d[i]()+f}}return Zw=a,Zw}var Qw,nR;function dJ(){if(nR)return Qw;nR=1;var e=uJ(),t=e("toUpperCase");return Qw=t,Qw}var fJ=dJ();const Xg=St(fJ);function zt(e){return function(){return e}}const CB=Math.cos,jv=Math.sin,Wa=Math.sqrt,Sv=Math.PI,Zg=2*Sv,__=Math.PI,N_=2*__,Ls=1e-6,hJ=N_-Ls;function EB(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return EB;const n=10**t;return function(r){this._+=r[0];for(let a=1,i=r.length;aLs)if(!(Math.abs(p*d-f*m)>Ls)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let x=r-l,j=a-u,b=d*d+f*f,w=x*x+j*j,N=Math.sqrt(b),O=Math.sqrt(g),C=i*Math.tan((__-Math.acos((b+g-w)/(2*N*O)))/2),A=C/O,E=C/N;Math.abs(A-1)>Ls&&this._append`L${t+A*m},${n+A*p}`,this._append`A${i},${i},0,0,${+(p*x>m*j)},${this._x1=t+E*d},${this._y1=n+E*f}`}}arc(t,n,r,a,i,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let u=r*Math.cos(a),d=r*Math.sin(a),f=t+u,m=n+d,p=1^l,g=l?a-i:i-a;this._x1===null?this._append`M${f},${m}`:(Math.abs(this._x1-f)>Ls||Math.abs(this._y1-m)>Ls)&&this._append`L${f},${m}`,r&&(g<0&&(g=g%N_+N_),g>hJ?this._append`A${r},${r},0,1,${p},${t-u},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=m}`:g>Ls&&this._append`A${r},${r},0,${+(g>=__)},${p},${this._x1=t+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function YO(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new pJ(t)}function KO(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function AB(e){this._context=e}AB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Qg(e){return new AB(e)}function TB(e){return e[0]}function kB(e){return e[1]}function PB(e,t){var n=zt(!0),r=null,a=Qg,i=null,l=YO(u);e=typeof e=="function"?e:e===void 0?TB:zt(e),t=typeof t=="function"?t:t===void 0?kB:zt(t);function u(d){var f,m=(d=KO(d)).length,p,g=!1,x;for(r==null&&(i=a(x=l())),f=0;f<=m;++f)!(f=x;--j)u.point(C[j],A[j]);u.lineEnd(),u.areaEnd()}N&&(C[g]=+e(w,g,p),A[g]=+t(w,g,p),u.point(r?+r(w,g,p):C[g],n?+n(w,g,p):A[g]))}if(O)return u=null,O+""||null}function m(){return PB().defined(a).curve(l).context(i)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:zt(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:zt(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:zt(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:zt(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:zt(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:zt(+p),f):n},f.lineX0=f.lineY0=function(){return m().x(e).y(t)},f.lineY1=function(){return m().x(e).y(n)},f.lineX1=function(){return m().x(r).y(t)},f.defined=function(p){return arguments.length?(a=typeof p=="function"?p:zt(!!p),f):a},f.curve=function(p){return arguments.length?(l=p,i!=null&&(u=l(i)),f):l},f.context=function(p){return arguments.length?(p==null?i=u=null:u=l(i=p),f):i},f}class MB{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function vJ(e){return new MB(e,!0)}function gJ(e){return new MB(e,!1)}const XO={draw(e,t){const n=Wa(t/Sv);e.moveTo(n,0),e.arc(0,0,n,0,Zg)}},yJ={draw(e,t){const n=Wa(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},RB=Wa(1/3),xJ=RB*2,bJ={draw(e,t){const n=Wa(t/xJ),r=n*RB;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},wJ={draw(e,t){const n=Wa(t),r=-n/2;e.rect(r,r,n,n)}},jJ=.8908130915292852,DB=jv(Sv/10)/jv(7*Sv/10),SJ=jv(Zg/10)*DB,_J=-CB(Zg/10)*DB,NJ={draw(e,t){const n=Wa(t*jJ),r=SJ*n,a=_J*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const l=Zg*i/5,u=CB(l),d=jv(l);e.lineTo(d*n,-u*n),e.lineTo(u*r-d*a,d*r+u*a)}e.closePath()}},Jw=Wa(3),OJ={draw(e,t){const n=-Wa(t/(Jw*3));e.moveTo(0,n*2),e.lineTo(-Jw*n,-n),e.lineTo(Jw*n,-n),e.closePath()}},va=-.5,ga=Wa(3)/2,O_=1/Wa(12),CJ=(O_/2+1)*3,EJ={draw(e,t){const n=Wa(t/CJ),r=n/2,a=n*O_,i=r,l=n*O_+n,u=-i,d=l;e.moveTo(r,a),e.lineTo(i,l),e.lineTo(u,d),e.lineTo(va*r-ga*a,ga*r+va*a),e.lineTo(va*i-ga*l,ga*i+va*l),e.lineTo(va*u-ga*d,ga*u+va*d),e.lineTo(va*r+ga*a,va*a-ga*r),e.lineTo(va*i+ga*l,va*l-ga*i),e.lineTo(va*u+ga*d,va*d-ga*u),e.closePath()}};function AJ(e,t){let n=null,r=YO(a);e=typeof e=="function"?e:zt(e||XO),t=typeof t=="function"?t:zt(t===void 0?64:+t);function a(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:zt(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:zt(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function _v(){}function Nv(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function $B(e){this._context=e}$B.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Nv(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Nv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function TJ(e){return new $B(e)}function IB(e){this._context=e}IB.prototype={areaStart:_v,areaEnd:_v,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Nv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function kJ(e){return new IB(e)}function LB(e){this._context=e}LB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Nv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function PJ(e){return new LB(e)}function BB(e){this._context=e}BB.prototype={areaStart:_v,areaEnd:_v,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function MJ(e){return new BB(e)}function rR(e){return e<0?-1:1}function aR(e,t,n){var r=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(r||a<0&&-0),l=(n-e._y1)/(a||r<0&&-0),u=(i*a+l*r)/(r+a);return(rR(i)+rR(l))*Math.min(Math.abs(i),Math.abs(l),.5*Math.abs(u))||0}function iR(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ej(e,t,n){var r=e._x0,a=e._y0,i=e._x1,l=e._y1,u=(i-r)/3;e._context.bezierCurveTo(r+u,a+u*t,i-u,l-u*n,i,l)}function Ov(e){this._context=e}Ov.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ej(this,this._t0,iR(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ej(this,iR(this,n=aR(this,e,t)),n);break;default:ej(this,this._t0,n=aR(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function zB(e){this._context=new qB(e)}(zB.prototype=Object.create(Ov.prototype)).point=function(e,t){Ov.prototype.point.call(this,t,e)};function qB(e){this._context=e}qB.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,a,i){this._context.bezierCurveTo(t,e,r,n,i,a)}};function RJ(e){return new Ov(e)}function DJ(e){return new zB(e)}function FB(e){this._context=e}FB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=oR(e),a=oR(t),i=0,l=1;l=0;--t)a[t]=(l[t]-a[t+1])/i[t];for(i[n-1]=(e[n]+a[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function IJ(e){return new Jg(e,.5)}function LJ(e){return new Jg(e,0)}function BJ(e){return new Jg(e,1)}function tu(e,t){if((l=e.length)>1)for(var n=1,r,a,i=e[t[0]],l,u=i.length;n=0;)n[t]=t;return n}function zJ(e,t){return e[t]}function qJ(e){const t=[];return t.key=e,t}function FJ(){var e=zt([]),t=C_,n=tu,r=zJ;function a(i){var l=Array.from(e.apply(this,arguments),qJ),u,d=l.length,f=-1,m;for(const p of i)for(u=0,++f;u0){for(var n,r,a=0,i=e[0].length,l;a0){for(var n=0,r=e[t[0]],a,i=r.length;n0)||!((i=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,i,l;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ZJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var UB={symbolCircle:XO,symbolCross:yJ,symbolDiamond:bJ,symbolSquare:wJ,symbolStar:NJ,symbolTriangle:OJ,symbolWye:EJ},QJ=Math.PI/180,JJ=function(t){var n="symbol".concat(Xg(t));return UB[n]||XO},eee=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*QJ;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},tee=function(t,n){UB["symbol".concat(Xg(t))]=n},ZO=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,i=a===void 0?64:a,l=t.sizeType,u=l===void 0?"area":l,d=XJ(t,VJ),f=lR(lR({},d),{},{type:r,size:i,sizeType:u}),m=function(){var w=JJ(r),N=AJ().type(w).size(eee(i,u,r));return N()},p=f.className,g=f.cx,x=f.cy,j=Be(f,!0);return g===+g&&x===+x&&i===+i?W.createElement("path",E_({},j,{className:Ye("recharts-symbols",p),transform:"translate(".concat(g,", ").concat(x,")"),d:m()})):null};ZO.registerSymbol=tee;function nu(e){"@babel/helpers - typeof";return nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nu(e)}function A_(){return A_=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var O=x.inactive?f:x.color;return W.createElement("li",A_({className:w,style:p,key:"legend-item-".concat(j)},ll(r.props,x,j)),W.createElement(j_,{width:l,height:l,viewBox:m,style:g},r.renderIcon(x)),W.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},b?b(N,x,j):N))})}},{key:"render",value:function(){var r=this.props,a=r.payload,i=r.layout,l=r.align;if(!a||!a.length)return null;var u={padding:0,margin:0,textAlign:i==="horizontal"?l:"left"};return W.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(y.PureComponent);Ef(QO,"displayName","Legend");Ef(QO,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var tj,uR;function dee(){if(uR)return tj;uR=1;var e=Gg();function t(){this.__data__=new e,this.size=0}return tj=t,tj}var nj,dR;function fee(){if(dR)return nj;dR=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return nj=e,nj}var rj,fR;function hee(){if(fR)return rj;fR=1;function e(t){return this.__data__.get(t)}return rj=e,rj}var aj,hR;function mee(){if(hR)return aj;hR=1;function e(t){return this.__data__.has(t)}return aj=e,aj}var ij,mR;function pee(){if(mR)return ij;mR=1;var e=Gg(),t=FO(),n=UO(),r=200;function a(i,l){var u=this.__data__;if(u instanceof e){var d=u.__data__;if(!t||d.lengthx))return!1;var b=p.get(l),w=p.get(u);if(b&&w)return b==u&&w==l;var N=-1,O=!0,C=d&a?new e:void 0;for(p.set(l,u),p.set(u,l);++N-1&&r%1==0&&r-1&&n%1==0&&n<=e}return Cj=t,Cj}var Ej,LR;function Eee(){if(LR)return Ej;LR=1;var e=so(),t=nC(),n=lo(),r="[object Arguments]",a="[object Array]",i="[object Boolean]",l="[object Date]",u="[object Error]",d="[object Function]",f="[object Map]",m="[object Number]",p="[object Object]",g="[object RegExp]",x="[object Set]",j="[object String]",b="[object WeakMap]",w="[object ArrayBuffer]",N="[object DataView]",O="[object Float32Array]",C="[object Float64Array]",A="[object Int8Array]",E="[object Int16Array]",k="[object Int32Array]",T="[object Uint8Array]",P="[object Uint8ClampedArray]",$="[object Uint16Array]",z="[object Uint32Array]",D={};D[O]=D[C]=D[A]=D[E]=D[k]=D[T]=D[P]=D[$]=D[z]=!0,D[r]=D[a]=D[w]=D[i]=D[N]=D[l]=D[u]=D[d]=D[f]=D[m]=D[p]=D[g]=D[x]=D[j]=D[b]=!1;function U(V){return n(V)&&t(V.length)&&!!D[e(V)]}return Ej=U,Ej}var Aj,BR;function JB(){if(BR)return Aj;BR=1;function e(t){return function(n){return t(n)}}return Aj=e,Aj}var lf={exports:{}};lf.exports;var zR;function Aee(){return zR||(zR=1,(function(e,t){var n=xB(),r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,l=i&&n.process,u=(function(){try{var d=a&&a.require&&a.require("util").types;return d||l&&l.binding&&l.binding("util")}catch{}})();e.exports=u})(lf,lf.exports)),lf.exports}var Tj,qR;function ez(){if(qR)return Tj;qR=1;var e=Eee(),t=JB(),n=Aee(),r=n&&n.isTypedArray,a=r?t(r):e;return Tj=a,Tj}var kj,FR;function Tee(){if(FR)return kj;FR=1;var e=Nee(),t=eC(),n=Ir(),r=QB(),a=tC(),i=ez(),l=Object.prototype,u=l.hasOwnProperty;function d(f,m){var p=n(f),g=!p&&t(f),x=!p&&!g&&r(f),j=!p&&!g&&!x&&i(f),b=p||g||x||j,w=b?e(f.length,String):[],N=w.length;for(var O in f)(m||u.call(f,O))&&!(b&&(O=="length"||x&&(O=="offset"||O=="parent")||j&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||a(O,N)))&&w.push(O);return w}return kj=d,kj}var Pj,UR;function kee(){if(UR)return Pj;UR=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return Pj=t,Pj}var Mj,HR;function tz(){if(HR)return Mj;HR=1;function e(t,n){return function(r){return t(n(r))}}return Mj=e,Mj}var Rj,WR;function Pee(){if(WR)return Rj;WR=1;var e=tz(),t=e(Object.keys,Object);return Rj=t,Rj}var Dj,VR;function Mee(){if(VR)return Dj;VR=1;var e=kee(),t=Pee(),n=Object.prototype,r=n.hasOwnProperty;function a(i){if(!e(i))return t(i);var l=[];for(var u in Object(i))r.call(i,u)&&u!="constructor"&&l.push(u);return l}return Dj=a,Dj}var $j,GR;function Eh(){if(GR)return $j;GR=1;var e=zO(),t=nC();function n(r){return r!=null&&t(r.length)&&!e(r)}return $j=n,$j}var Ij,YR;function ey(){if(YR)return Ij;YR=1;var e=Tee(),t=Mee(),n=Eh();function r(a){return n(a)?e(a):t(a)}return Ij=r,Ij}var Lj,KR;function Ree(){if(KR)return Lj;KR=1;var e=wee(),t=_ee(),n=ey();function r(a){return e(a,n,t)}return Lj=r,Lj}var Bj,XR;function Dee(){if(XR)return Bj;XR=1;var e=Ree(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(i,l,u,d,f,m){var p=u&t,g=e(i),x=g.length,j=e(l),b=j.length;if(x!=b&&!p)return!1;for(var w=x;w--;){var N=g[w];if(!(p?N in l:r.call(l,N)))return!1}var O=m.get(i),C=m.get(l);if(O&&C)return O==l&&C==i;var A=!0;m.set(i,l),m.set(l,i);for(var E=p;++w-1}return d1=t,d1}var f1,SD;function tte(){if(SD)return f1;SD=1;function e(t,n,r){for(var a=-1,i=t==null?0:t.length;++a=l){var N=f?null:a(d);if(N)return i(N);j=!1,g=r,w=new e}else w=f?[]:b;e:for(;++p=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vte(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function gte(e){return e.value}function yte(e,t){if(W.isValidElement(e))return W.cloneElement(e,t);if(typeof e=="function")return W.createElement(e,t);t.ref;var n=pte(t,ste);return W.createElement(QO,n)}var kD=1,Qs=(function(e){function t(){var n;lte(this,t);for(var r=arguments.length,a=new Array(r),i=0;ikD||Math.abs(a.height-this.lastBoundingBox.height)>kD)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,r&&r(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?qi({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,i=a.layout,l=a.align,u=a.verticalAlign,d=a.margin,f=a.chartWidth,m=a.chartHeight,p,g;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(l==="center"&&i==="vertical"){var x=this.getBBoxSnapshot();p={left:((f||0)-x.width)/2}}else p=l==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(u==="middle"){var j=this.getBBoxSnapshot();g={top:((m||0)-j.height)/2}}else g=u==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return qi(qi({},p),g)}},{key:"render",value:function(){var r=this,a=this.props,i=a.content,l=a.width,u=a.height,d=a.wrapperStyle,f=a.payloadUniqBy,m=a.payload,p=qi(qi({position:"absolute",width:l||"auto",height:u||"auto"},this.getDefaultPosition(d)),d);return W.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(x){r.wrapperNode=x}},yte(i,qi(qi({},this.props),{},{payload:oz(m,f,gte)})))}}],[{key:"getWithHeight",value:function(r,a){var i=qi(qi({},this.defaultProps),r.props),l=i.layout;return l==="vertical"&&Oe(r.props.height)?{height:r.props.height}:l==="horizontal"?{width:r.props.width||a}:null}}])})(y.PureComponent);ty(Qs,"displayName","Legend");ty(Qs,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var g1,PD;function xte(){if(PD)return g1;PD=1;var e=Oh(),t=eC(),n=Ir(),r=e?e.isConcatSpreadable:void 0;function a(i){return n(i)||t(i)||!!(r&&i&&i[r])}return g1=a,g1}var y1,MD;function cz(){if(MD)return y1;MD=1;var e=ZB(),t=xte();function n(r,a,i,l,u){var d=-1,f=r.length;for(i||(i=t),u||(u=[]);++d0&&i(m)?a>1?n(m,a-1,i,l,u):e(u,m):l||(u[u.length]=m)}return u}return y1=n,y1}var x1,RD;function bte(){if(RD)return x1;RD=1;function e(t){return function(n,r,a){for(var i=-1,l=Object(n),u=a(n),d=u.length;d--;){var f=u[t?d:++i];if(r(l[f],f,l)===!1)break}return n}}return x1=e,x1}var b1,DD;function wte(){if(DD)return b1;DD=1;var e=bte(),t=e();return b1=t,b1}var w1,$D;function uz(){if($D)return w1;$D=1;var e=wte(),t=ey();function n(r,a){return r&&e(r,a,t)}return w1=n,w1}var j1,ID;function jte(){if(ID)return j1;ID=1;var e=Eh();function t(n,r){return function(a,i){if(a==null)return a;if(!e(a))return n(a,i);for(var l=a.length,u=r?l:-1,d=Object(a);(r?u--:++ur||u&&d&&m&&!f&&!p||i&&d&&m||!a&&m||!l)return 1;if(!i&&!u&&!p&&n=f)return m;var p=a[i];return m*(p=="desc"?-1:1)}}return n.index-r.index}return C1=t,C1}var E1,UD;function Ote(){if(UD)return E1;UD=1;var e=HO(),t=WO(),n=xi(),r=dz(),a=Ste(),i=JB(),l=Nte(),u=zu(),d=Ir();function f(m,p,g){p.length?p=e(p,function(b){return d(b)?function(w){return t(w,b.length===1?b[0]:b)}:b}):p=[u];var x=-1;p=e(p,i(n));var j=r(m,function(b,w,N){var O=e(p,function(C){return C(b)});return{criteria:O,index:++x,value:b}});return a(j,function(b,w){return l(b,w,g)})}return E1=f,E1}var A1,HD;function Cte(){if(HD)return A1;HD=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return A1=e,A1}var T1,WD;function Ete(){if(WD)return T1;WD=1;var e=Cte(),t=Math.max;function n(r,a,i){return a=t(a===void 0?r.length-1:a,0),function(){for(var l=arguments,u=-1,d=t(l.length-a,0),f=Array(d);++u0){if(++i>=e)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return R1=r,R1}var D1,XD;function Pte(){if(XD)return D1;XD=1;var e=Tte(),t=kte(),n=t(e);return D1=n,D1}var $1,ZD;function Mte(){if(ZD)return $1;ZD=1;var e=zu(),t=Ete(),n=Pte();function r(a,i){return n(t(a,i,e),a+"")}return $1=r,$1}var I1,QD;function ny(){if(QD)return I1;QD=1;var e=qO(),t=Eh(),n=tC(),r=rs();function a(i,l,u){if(!r(u))return!1;var d=typeof l;return(d=="number"?t(u)&&n(l,u.length):d=="string"&&l in u)?e(u[l],i):!1}return I1=a,I1}var L1,JD;function Rte(){if(JD)return L1;JD=1;var e=cz(),t=Ote(),n=Mte(),r=ny(),a=n(function(i,l){if(i==null)return[];var u=l.length;return u>1&&r(i,l[0],l[1])?l=[]:u>2&&r(l[0],l[1],l[2])&&(l=[l[0]]),t(i,e(l,1),[])});return L1=a,L1}var Dte=Rte();const iC=St(Dte);function Af(e){"@babel/helpers - typeof";return Af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Af(e)}function P_(){return P_=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.x),"".concat(Yd,"-left"),Oe(n)&&t&&Oe(t.x)&&n=t.y),"".concat(Yd,"-top"),Oe(r)&&t&&Oe(t.y)&&rb?Math.max(m,d[r]):Math.max(p,d[r])}function Xte(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function Zte(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,i=e.reverseDirection,l=e.tooltipBox,u=e.useTranslate3d,d=e.viewBox,f,m,p;return l.height>0&&l.width>0&&n?(m=n4({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),p=n4({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),f=Xte({translateX:m,translateY:p,useTranslate3d:u})):f=Yte,{cssProperties:f,cssClasses:Kte({translateX:m,translateY:p,coordinate:n})}}function au(e){"@babel/helpers - typeof";return au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},au(e)}function r4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function a4(e){for(var t=1;ti4||Math.abs(r.height-this.state.lastBoundingBox.height)>i4)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,a=this.props,i=a.active,l=a.allowEscapeViewBox,u=a.animationDuration,d=a.animationEasing,f=a.children,m=a.coordinate,p=a.hasPayload,g=a.isAnimationActive,x=a.offset,j=a.position,b=a.reverseDirection,w=a.useTranslate3d,N=a.viewBox,O=a.wrapperStyle,C=Zte({allowEscapeViewBox:l,coordinate:m,offsetTopLeft:x,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:w,viewBox:N}),A=C.cssClasses,E=C.cssProperties,k=a4(a4({transition:g&&i?"transform ".concat(u,"ms ").concat(d):void 0},E),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&p?"visible":"hidden",position:"absolute",top:0,left:0},O);return W.createElement("div",{tabIndex:-1,className:A,style:k,ref:function(P){r.wrapperNode=P}},f)}}])})(y.PureComponent),sne=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},xl={isSsr:sne()};function iu(e){"@babel/helpers - typeof";return iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iu(e)}function o4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function s4(e){for(var t=1;t0;return W.createElement(one,{allowEscapeViewBox:l,animationDuration:u,animationEasing:d,isAnimationActive:g,active:i,coordinate:m,hasPayload:k,offset:x,position:w,reverseDirection:N,useTranslate3d:O,viewBox:C,wrapperStyle:A},gne(f,s4(s4({},this.props),{},{payload:E})))}}])})(y.PureComponent);oC(ei,"displayName","Tooltip");oC(ei,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!xl.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var z1,l4;function yne(){if(l4)return z1;l4=1;var e=yi(),t=function(){return e.Date.now()};return z1=t,z1}var q1,c4;function xne(){if(c4)return q1;c4=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return q1=t,q1}var F1,u4;function bne(){if(u4)return F1;u4=1;var e=xne(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return F1=n,F1}var U1,d4;function gz(){if(d4)return U1;d4=1;var e=bne(),t=rs(),n=Iu(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;function d(f){if(typeof f=="number")return f;if(n(f))return r;if(t(f)){var m=typeof f.valueOf=="function"?f.valueOf():f;f=t(m)?m+"":m}if(typeof f!="string")return f===0?f:+f;f=e(f);var p=i.test(f);return p||l.test(f)?u(f.slice(2),p?2:8):a.test(f)?r:+f}return U1=d,U1}var H1,f4;function wne(){if(f4)return H1;f4=1;var e=rs(),t=yne(),n=gz(),r="Expected a function",a=Math.max,i=Math.min;function l(u,d,f){var m,p,g,x,j,b,w=0,N=!1,O=!1,C=!0;if(typeof u!="function")throw new TypeError(r);d=n(d)||0,e(f)&&(N=!!f.leading,O="maxWait"in f,g=O?a(n(f.maxWait)||0,d):g,C="trailing"in f?!!f.trailing:C);function A(V){var H=m,G=p;return m=p=void 0,w=V,x=u.apply(G,H),x}function E(V){return w=V,j=setTimeout(P,d),N?A(V):x}function k(V){var H=V-b,G=V-w,L=d-H;return O?i(L,g-G):L}function T(V){var H=V-b,G=V-w;return b===void 0||H>=d||H<0||O&&G>=g}function P(){var V=t();if(T(V))return $(V);j=setTimeout(P,k(V))}function $(V){return j=void 0,C&&m?A(V):(m=p=void 0,x)}function z(){j!==void 0&&clearTimeout(j),w=0,m=b=p=j=void 0}function D(){return j===void 0?x:$(t())}function U(){var V=t(),H=T(V);if(m=arguments,p=this,b=V,H){if(j===void 0)return E(b);if(O)return clearTimeout(j),j=setTimeout(P,d),A(b)}return j===void 0&&(j=setTimeout(P,d)),x}return U.cancel=z,U.flush=D,U}return H1=l,H1}var W1,h4;function jne(){if(h4)return W1;h4=1;var e=wne(),t=rs(),n="Expected a function";function r(a,i,l){var u=!0,d=!0;if(typeof a!="function")throw new TypeError(n);return t(l)&&(u="leading"in l?!!l.leading:u,d="trailing"in l?!!l.trailing:d),e(a,i,{leading:u,maxWait:i,trailing:d})}return W1=r,W1}var Sne=jne();const yz=St(Sne);function kf(e){"@babel/helpers - typeof";return kf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kf(e)}function m4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ep(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(V=yz(V,b,{trailing:!0,leading:!1}));var H=new ResizeObserver(V),G=E.current.getBoundingClientRect(),L=G.width,R=G.height;return D(L,R),H.observe(E.current),function(){H.disconnect()}},[D,b]);var U=y.useMemo(function(){var V=$.containerWidth,H=$.containerHeight;if(V<0||H<0)return null;za(Us(l)||Us(d),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,l,d),za(!n||n>0,"The aspect(%s) must be greater than zero.",n);var G=Us(l)?V:l,L=Us(d)?H:d;n&&n>0&&(G?L=G/n:L&&(G=L*n),g&&L>g&&(L=g)),za(G>0||L>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,G,L,l,d,m,p,n);var R=!Array.isArray(x)&&Zi(x.type).endsWith("Chart");return W.Children.map(x,function(F){return W.isValidElement(F)?y.cloneElement(F,Ep({width:G,height:L},R?{style:Ep({height:"100%",width:"100%",maxHeight:L,maxWidth:G},F.props.style)}:{})):F})},[n,x,d,g,p,m,$,l]);return W.createElement("div",{id:w?"".concat(w):void 0,className:Ye("recharts-responsive-container",N),style:Ep(Ep({},A),{},{width:l,height:d,minWidth:m,minHeight:p,maxHeight:g}),ref:E},U)}),ry=function(t){return null};ry.displayName="Cell";function Pf(e){"@babel/helpers - typeof";return Pf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pf(e)}function v4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $_(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||xl.isSsr)return{width:0,height:0};var r=Lne(n),a=JSON.stringify({text:t,copyStyle:r});if(xc.widthCache[a])return xc.widthCache[a];try{var i=document.getElementById(g4);i||(i=document.createElement("span"),i.setAttribute("id",g4),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var l=$_($_({},Ine),r);Object.assign(i.style,l),i.textContent="".concat(t);var u=i.getBoundingClientRect(),d={width:u.width,height:u.height};return xc.widthCache[a]=d,++xc.cacheCount>$ne&&(xc.cacheCount=0,xc.widthCache={}),d}catch{return{width:0,height:0}}},Bne=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Mf(e){"@babel/helpers - typeof";return Mf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mf(e)}function kv(e,t){return Une(e)||Fne(e,t)||qne(e,t)||zne()}function zne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qne(e,t){if(e){if(typeof e=="string")return y4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y4(e,t)}}function y4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function rre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function _4(e,t){return sre(e)||ore(e,t)||ire(e,t)||are()}function are(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ire(e,t){if(e){if(typeof e=="string")return N4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N4(e,t)}}function N4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return G.reduce(function(L,R){var F=R.word,K=R.width,te=L[L.length-1];if(te&&(a==null||i||te.width+K+rR.width?L:R})};if(!m)return x;for(var b="…",w=function(G){var L=p.slice(0,G),R=jz({breakAll:f,style:d,children:L+b}).wordsWithComputedWidth,F=g(R),K=F.length>l||j(F).width>Number(a);return[K,F]},N=0,O=p.length-1,C=0,A;N<=O&&C<=p.length-1;){var E=Math.floor((N+O)/2),k=E-1,T=w(k),P=_4(T,2),$=P[0],z=P[1],D=w(E),U=_4(D,1),V=U[0];if(!$&&!V&&(N=E+1),$&&V&&(O=E-1),!$&&V){A=z;break}C++}return A||x},O4=function(t){var n=Ge(t)?[]:t.toString().split(wz);return[{words:n}]},cre=function(t){var n=t.width,r=t.scaleToFit,a=t.children,i=t.style,l=t.breakAll,u=t.maxLines;if((n||r)&&!xl.isSsr){var d,f,m=jz({breakAll:l,children:a,style:i});if(m){var p=m.wordsWithComputedWidth,g=m.spaceWidth;d=p,f=g}else return O4(a);return lre({breakAll:l,children:a,maxLines:u,style:i},d,f,n,r)}return O4(a)},C4="#808080",cl=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,l=t.lineHeight,u=l===void 0?"1em":l,d=t.capHeight,f=d===void 0?"0.71em":d,m=t.scaleToFit,p=m===void 0?!1:m,g=t.textAnchor,x=g===void 0?"start":g,j=t.verticalAnchor,b=j===void 0?"end":j,w=t.fill,N=w===void 0?C4:w,O=S4(t,tre),C=y.useMemo(function(){return cre({breakAll:O.breakAll,children:O.children,maxLines:O.maxLines,scaleToFit:p,style:O.style,width:O.width})},[O.breakAll,O.children,O.maxLines,p,O.style,O.width]),A=O.dx,E=O.dy,k=O.angle,T=O.className,P=O.breakAll,$=S4(O,nre);if(!kn(r)||!kn(i))return null;var z=r+(Oe(A)?A:0),D=i+(Oe(E)?E:0),U;switch(b){case"start":U=V1("calc(".concat(f,")"));break;case"middle":U=V1("calc(".concat((C.length-1)/2," * -").concat(u," + (").concat(f," / 2))"));break;default:U=V1("calc(".concat(C.length-1," * -").concat(u,")"));break}var V=[];if(p){var H=C[0].width,G=O.width;V.push("scale(".concat((Oe(G)?G/H:1)/H,")"))}return k&&V.push("rotate(".concat(k,", ").concat(z,", ").concat(D,")")),V.length&&($.transform=V.join(" ")),W.createElement("text",I_({},Be($,!0),{x:z,y:D,className:Ye("recharts-text",T),textAnchor:x,fill:N.includes("url")?C4:N}),C.map(function(L,R){var F=L.words.join(P?"":" ");return W.createElement("tspan",{x:z,dy:R===0?U:u,key:"".concat(F,"-").concat(R)},F)}))};function Yo(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function ure(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function sC(e){let t,n,r;e.length!==2?(t=Yo,n=(u,d)=>Yo(e(u),d),r=(u,d)=>e(u)-d):(t=e===Yo||e===ure?e:dre,n=e,r=e);function a(u,d,f=0,m=u.length){if(f>>1;n(u[p],d)<0?f=p+1:m=p}while(f>>1;n(u[p],d)<=0?f=p+1:m=p}while(ff&&r(u[p-1],d)>-r(u[p],d)?p-1:p}return{left:a,center:l,right:i}}function dre(){return 0}function Sz(e){return e===null?NaN:+e}function*fre(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const hre=sC(Yo),Ah=hre.right;sC(Sz).center;class E4 extends Map{constructor(t,n=vre){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(A4(this,t))}has(t){return super.has(A4(this,t))}set(t,n){return super.set(mre(this,t),n)}delete(t){return super.delete(pre(this,t))}}function A4({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function mre({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function pre({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function vre(e){return e!==null&&typeof e=="object"?e.valueOf():e}function gre(e=Yo){if(e===Yo)return _z;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function _z(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const yre=Math.sqrt(50),xre=Math.sqrt(10),bre=Math.sqrt(2);function Pv(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),i=r/Math.pow(10,a),l=i>=yre?10:i>=xre?5:i>=bre?2:1;let u,d,f;return a<0?(f=Math.pow(10,-a)/l,u=Math.round(e*f),d=Math.round(t*f),u/ft&&--d,f=-f):(f=Math.pow(10,a)*l,u=Math.round(e/f),d=Math.round(t/f),u*ft&&--d),d0))return[];if(e===t)return[e];const r=t=a))return[];const u=i-a+1,d=new Array(u);if(r)if(l<0)for(let f=0;f=r)&&(n=r);return n}function k4(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function Nz(e,t,n=0,r=1/0,a){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(a=a===void 0?_z:gre(a);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,m=Math.log(d),p=.5*Math.exp(2*m/3),g=.5*Math.sqrt(m*p*(d-p)/d)*(f-d/2<0?-1:1),x=Math.max(n,Math.floor(t-f*p/d+g)),j=Math.min(r,Math.floor(t+(d-f)*p/d+g));Nz(e,t,x,j,a)}const i=e[t];let l=n,u=r;for(Kd(e,n,t),a(e[r],i)>0&&Kd(e,n,r);l0;)--u}a(e[n],i)===0?Kd(e,n,u):(++u,Kd(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function Kd(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function wre(e,t,n){if(e=Float64Array.from(fre(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return k4(e);if(t>=1)return T4(e);var r,a=(r-1)*t,i=Math.floor(a),l=T4(Nz(e,i).subarray(0,i+1)),u=k4(e.subarray(i+1));return l+(u-l)*(a-i)}}function jre(e,t,n=Sz){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,a=(r-1)*t,i=Math.floor(a),l=+n(e[i],i,e),u=+n(e[i+1],i+1,e);return l+(u-l)*(a-i)}}function Sre(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(a);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Tp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Tp(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Nre.exec(e))?new Tr(t[1],t[2],t[3],1):(t=Ore.exec(e))?new Tr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Cre.exec(e))?Tp(t[1],t[2],t[3],t[4]):(t=Ere.exec(e))?Tp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Are.exec(e))?L4(t[1],t[2]/100,t[3]/100,1):(t=Tre.exec(e))?L4(t[1],t[2]/100,t[3]/100,t[4]):P4.hasOwnProperty(e)?D4(P4[e]):e==="transparent"?new Tr(NaN,NaN,NaN,0):null}function D4(e){return new Tr(e>>16&255,e>>8&255,e&255,1)}function Tp(e,t,n,r){return r<=0&&(e=t=n=NaN),new Tr(e,t,n,r)}function Mre(e){return e instanceof Th||(e=If(e)),e?(e=e.rgb(),new Tr(e.r,e.g,e.b,e.opacity)):new Tr}function F_(e,t,n,r){return arguments.length===1?Mre(e):new Tr(e,t,n,r??1)}function Tr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}cC(Tr,F_,Cz(Th,{brighter(e){return e=e==null?Mv:Math.pow(Mv,e),new Tr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Df:Math.pow(Df,e),new Tr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Tr(Js(this.r),Js(this.g),Js(this.b),Rv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$4,formatHex:$4,formatHex8:Rre,formatRgb:I4,toString:I4}));function $4(){return`#${Hs(this.r)}${Hs(this.g)}${Hs(this.b)}`}function Rre(){return`#${Hs(this.r)}${Hs(this.g)}${Hs(this.b)}${Hs((isNaN(this.opacity)?1:this.opacity)*255)}`}function I4(){const e=Rv(this.opacity);return`${e===1?"rgb(":"rgba("}${Js(this.r)}, ${Js(this.g)}, ${Js(this.b)}${e===1?")":`, ${e})`}`}function Rv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Js(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Hs(e){return e=Js(e),(e<16?"0":"")+e.toString(16)}function L4(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new La(e,t,n,r)}function Ez(e){if(e instanceof La)return new La(e.h,e.s,e.l,e.opacity);if(e instanceof Th||(e=If(e)),!e)return new La;if(e instanceof La)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),i=Math.max(t,n,r),l=NaN,u=i-a,d=(i+a)/2;return u?(t===i?l=(n-r)/u+(n0&&d<1?0:l,new La(l,u,d,e.opacity)}function Dre(e,t,n,r){return arguments.length===1?Ez(e):new La(e,t,n,r??1)}function La(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}cC(La,Dre,Cz(Th,{brighter(e){return e=e==null?Mv:Math.pow(Mv,e),new La(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Df:Math.pow(Df,e),new La(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new Tr(G1(e>=240?e-240:e+120,a,r),G1(e,a,r),G1(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new La(B4(this.h),kp(this.s),kp(this.l),Rv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Rv(this.opacity);return`${e===1?"hsl(":"hsla("}${B4(this.h)}, ${kp(this.s)*100}%, ${kp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function B4(e){return e=(e||0)%360,e<0?e+360:e}function kp(e){return Math.max(0,Math.min(1,e||0))}function G1(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const uC=e=>()=>e;function $re(e,t){return function(n){return e+n*t}}function Ire(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Lre(e){return(e=+e)==1?Az:function(t,n){return n-t?Ire(t,n,e):uC(isNaN(t)?n:t)}}function Az(e,t){var n=t-e;return n?$re(e,n):uC(isNaN(e)?t:e)}const z4=(function e(t){var n=Lre(t);function r(a,i){var l=n((a=F_(a)).r,(i=F_(i)).r),u=n(a.g,i.g),d=n(a.b,i.b),f=Az(a.opacity,i.opacity);return function(m){return a.r=l(m),a.g=u(m),a.b=d(m),a.opacity=f(m),a+""}}return r.gamma=e,r})(1);function Bre(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(i){for(a=0;an&&(i=t.slice(n,i),u[l]?u[l]+=i:u[++l]=i),(r=r[0])===(a=a[0])?u[l]?u[l]+=a:u[++l]=a:(u[++l]=null,d.push({i:l,x:Dv(r,a)})),n=Y1.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Xre(e,t,n){var r=e[0],a=e[1],i=t[0],l=t[1];return a2?Zre:Xre,d=f=null,p}function p(g){return g==null||isNaN(g=+g)?i:(d||(d=u(e.map(r),t,n)))(r(l(g)))}return p.invert=function(g){return l(a((f||(f=u(t,e.map(r),Dv)))(g)))},p.domain=function(g){return arguments.length?(e=Array.from(g,$v),m()):e.slice()},p.range=function(g){return arguments.length?(t=Array.from(g),m()):t.slice()},p.rangeRound=function(g){return t=Array.from(g),n=dC,m()},p.clamp=function(g){return arguments.length?(l=g?!0:wr,m()):l!==wr},p.interpolate=function(g){return arguments.length?(n=g,m()):n},p.unknown=function(g){return arguments.length?(i=g,p):i},function(g,x){return r=g,a=x,m()}}function fC(){return ay()(wr,wr)}function Qre(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Iv(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function ou(e){return e=Iv(Math.abs(e)),e?e[1]:NaN}function Jre(e,t){return function(n,r){for(var a=n.length,i=[],l=0,u=e[0],d=0;a>0&&u>0&&(d+u+1>r&&(u=Math.max(1,r-d)),i.push(n.substring(a-=u,a+u)),!((d+=u+1)>r));)u=e[l=(l+1)%e.length];return i.reverse().join(t)}}function eae(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var tae=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Lf(e){if(!(t=tae.exec(e)))throw new Error("invalid format: "+e);var t;return new hC({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Lf.prototype=hC.prototype;function hC(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}hC.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function nae(e){e:for(var t=e.length,n=1,r=-1,a;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var Tz;function rae(e,t){var n=Iv(e,t);if(!n)return e+"";var r=n[0],a=n[1],i=a-(Tz=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,l=r.length;return i===l?r:i>l?r+new Array(i-l+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Iv(e,Math.max(0,t+i-1))[0]}function F4(e,t){var n=Iv(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const U4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Qre,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>F4(e*100,t),r:F4,s:rae,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function H4(e){return e}var W4=Array.prototype.map,V4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function aae(e){var t=e.grouping===void 0||e.thousands===void 0?H4:Jre(W4.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?H4:eae(W4.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(p){p=Lf(p);var g=p.fill,x=p.align,j=p.sign,b=p.symbol,w=p.zero,N=p.width,O=p.comma,C=p.precision,A=p.trim,E=p.type;E==="n"?(O=!0,E="g"):U4[E]||(C===void 0&&(C=12),A=!0,E="g"),(w||g==="0"&&x==="=")&&(w=!0,g="0",x="=");var k=b==="$"?n:b==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():"",T=b==="$"?r:/[%p]/.test(E)?l:"",P=U4[E],$=/[defgprs%]/.test(E);C=C===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function z(D){var U=k,V=T,H,G,L;if(E==="c")V=P(D)+V,D="";else{D=+D;var R=D<0||1/D<0;if(D=isNaN(D)?d:P(Math.abs(D),C),A&&(D=nae(D)),R&&+D==0&&j!=="+"&&(R=!1),U=(R?j==="("?j:u:j==="-"||j==="("?"":j)+U,V=(E==="s"?V4[8+Tz/3]:"")+V+(R&&j==="("?")":""),$){for(H=-1,G=D.length;++HL||L>57){V=(L===46?a+D.slice(H+1):D.slice(H))+V,D=D.slice(0,H);break}}}O&&!w&&(D=t(D,1/0));var F=U.length+D.length+V.length,K=F>1)+U+D+V+K.slice(F);break;default:D=K+U+D+V;break}return i(D)}return z.toString=function(){return p+""},z}function m(p,g){var x=f((p=Lf(p),p.type="f",p)),j=Math.max(-8,Math.min(8,Math.floor(ou(g)/3)))*3,b=Math.pow(10,-j),w=V4[8+j/3];return function(N){return x(b*N)+w}}return{format:f,formatPrefix:m}}var Pp,mC,kz;iae({thousands:",",grouping:[3],currency:["$",""]});function iae(e){return Pp=aae(e),mC=Pp.format,kz=Pp.formatPrefix,Pp}function oae(e){return Math.max(0,-ou(Math.abs(e)))}function sae(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ou(t)/3)))*3-ou(Math.abs(e)))}function lae(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ou(t)-ou(e))+1}function Pz(e,t,n,r){var a=z_(e,t,n),i;switch(r=Lf(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=sae(a,l))&&(r.precision=i),kz(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=lae(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=oae(a))&&(r.precision=i-(r.type==="%")*2);break}}return mC(r)}function as(e){var t=e.domain;return e.ticks=function(n){var r=t();return L_(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return Pz(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,i=r.length-1,l=r[a],u=r[i],d,f,m=10;for(u0;){if(f=B_(l,u,n),f===d)return r[a]=l,r[i]=u,t(r);if(f>0)l=Math.floor(l/f)*f,u=Math.ceil(u/f)*f;else if(f<0)l=Math.ceil(l*f)/f,u=Math.floor(u*f)/f;else break;d=f}return e},e}function Lv(){var e=fC();return e.copy=function(){return kh(e,Lv())},Ca.apply(e,arguments),as(e)}function Mz(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,$v),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Mz(e).unknown(t)},e=arguments.length?Array.from(e,$v):[0,1],as(n)}function Rz(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],i=e[r],l;return iMath.pow(e,t)}function hae(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function K4(e){return(t,n)=>-e(-t,n)}function pC(e){const t=e(G4,Y4),n=t.domain;let r=10,a,i;function l(){return a=hae(r),i=fae(r),n()[0]<0?(a=K4(a),i=K4(i),e(cae,uae)):e(G4,Y4),t}return t.base=function(u){return arguments.length?(r=+u,l()):r},t.domain=function(u){return arguments.length?(n(u),l()):n()},t.ticks=u=>{const d=n();let f=d[0],m=d[d.length-1];const p=m0){for(;g<=x;++g)for(j=1;jm)break;N.push(b)}}else for(;g<=x;++g)for(j=r-1;j>=1;--j)if(b=g>0?j/i(-g):j*i(g),!(bm)break;N.push(b)}N.length*2{if(u==null&&(u=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=Lf(d)).precision==null&&(d.trim=!0),d=mC(d)),u===1/0)return d;const f=Math.max(1,r*u/t.ticks().length);return m=>{let p=m/i(Math.round(a(m)));return p*rn(Rz(n(),{floor:u=>i(Math.floor(a(u))),ceil:u=>i(Math.ceil(a(u)))})),t}function Dz(){const e=pC(ay()).domain([1,10]);return e.copy=()=>kh(e,Dz()).base(e.base()),Ca.apply(e,arguments),e}function X4(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Z4(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function vC(e){var t=1,n=e(X4(t),Z4(t));return n.constant=function(r){return arguments.length?e(X4(t=+r),Z4(t)):t},as(n)}function $z(){var e=vC(ay());return e.copy=function(){return kh(e,$z()).constant(e.constant())},Ca.apply(e,arguments)}function Q4(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function mae(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function pae(e){return e<0?-e*e:e*e}function gC(e){var t=e(wr,wr),n=1;function r(){return n===1?e(wr,wr):n===.5?e(mae,pae):e(Q4(n),Q4(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},as(t)}function yC(){var e=gC(ay());return e.copy=function(){return kh(e,yC()).exponent(e.exponent())},Ca.apply(e,arguments),e}function vae(){return yC.apply(null,arguments).exponent(.5)}function J4(e){return Math.sign(e)*e*e}function gae(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Iz(){var e=fC(),t=[0,1],n=!1,r;function a(i){var l=gae(e(i));return isNaN(l)?r:n?Math.round(l):l}return a.invert=function(i){return e.invert(J4(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,$v)).map(J4)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(n=!!i,a):n},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return Iz(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ca.apply(a,arguments),as(a)}function Lz(){var e=[],t=[],n=[],r;function a(){var l=0,u=Math.max(1,t.length);for(n=new Array(u-1);++l0?n[u-1]:e[0],u=n?[r[n-1],t]:[r[f-1],r[f]]},l.unknown=function(d){return arguments.length&&(i=d),l},l.thresholds=function(){return r.slice()},l.copy=function(){return Bz().domain([e,t]).range(a).unknown(i)},Ca.apply(as(l),arguments)}function zz(){var e=[.5],t=[0,1],n,r=1;function a(i){return i!=null&&i<=i?t[Ah(e,i,0,r)]:n}return a.domain=function(i){return arguments.length?(e=Array.from(i),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var l=t.indexOf(i);return[e[l-1],e[l]]},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return zz().domain(e).range(t).unknown(n)},Ca.apply(a,arguments)}const K1=new Date,X1=new Date;function Rn(e,t,n,r){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const l=a(i),u=a.ceil(i);return i-l(t(i=new Date(+i),l==null?1:Math.floor(l)),i),a.range=(i,l,u)=>{const d=[];if(i=a.ceil(i),u=u==null?1:Math.floor(u),!(i0))return d;let f;do d.push(f=new Date(+i)),t(i,u),e(i);while(fRn(l=>{if(l>=l)for(;e(l),!i(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!i(l););else for(;--u>=0;)for(;t(l,1),!i(l););}),n&&(a.count=(i,l)=>(K1.setTime(+i),X1.setTime(+l),e(K1),e(X1),Math.floor(n(K1,X1))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(r?l=>r(l)%i===0:l=>a.count(0,l)%i===0):a)),a}const Bv=Rn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Bv.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Rn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Bv);Bv.range;const Wi=1e3,ja=Wi*60,Vi=ja*60,eo=Vi*24,xC=eo*7,e$=eo*30,Z1=eo*365,Ws=Rn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Wi)},(e,t)=>(t-e)/Wi,e=>e.getUTCSeconds());Ws.range;const bC=Rn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Wi)},(e,t)=>{e.setTime(+e+t*ja)},(e,t)=>(t-e)/ja,e=>e.getMinutes());bC.range;const wC=Rn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ja)},(e,t)=>(t-e)/ja,e=>e.getUTCMinutes());wC.range;const jC=Rn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Wi-e.getMinutes()*ja)},(e,t)=>{e.setTime(+e+t*Vi)},(e,t)=>(t-e)/Vi,e=>e.getHours());jC.range;const SC=Rn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Vi)},(e,t)=>(t-e)/Vi,e=>e.getUTCHours());SC.range;const Ph=Rn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ja)/eo,e=>e.getDate()-1);Ph.range;const iy=Rn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/eo,e=>e.getUTCDate()-1);iy.range;const qz=Rn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/eo,e=>Math.floor(e/eo));qz.range;function bl(e){return Rn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ja)/xC)}const oy=bl(0),zv=bl(1),yae=bl(2),xae=bl(3),su=bl(4),bae=bl(5),wae=bl(6);oy.range;zv.range;yae.range;xae.range;su.range;bae.range;wae.range;function wl(e){return Rn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/xC)}const sy=wl(0),qv=wl(1),jae=wl(2),Sae=wl(3),lu=wl(4),_ae=wl(5),Nae=wl(6);sy.range;qv.range;jae.range;Sae.range;lu.range;_ae.range;Nae.range;const _C=Rn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());_C.range;const NC=Rn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());NC.range;const to=Rn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());to.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});to.range;const no=Rn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());no.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});no.range;function Fz(e,t,n,r,a,i){const l=[[Ws,1,Wi],[Ws,5,5*Wi],[Ws,15,15*Wi],[Ws,30,30*Wi],[i,1,ja],[i,5,5*ja],[i,15,15*ja],[i,30,30*ja],[a,1,Vi],[a,3,3*Vi],[a,6,6*Vi],[a,12,12*Vi],[r,1,eo],[r,2,2*eo],[n,1,xC],[t,1,e$],[t,3,3*e$],[e,1,Z1]];function u(f,m,p){const g=mw).right(l,g);if(x===l.length)return e.every(z_(f/Z1,m/Z1,p));if(x===0)return Bv.every(Math.max(z_(f,m,p),1));const[j,b]=l[g/l[x-1][2]53)return null;"w"in le||(le.w=1),"Z"in le?(_e=J1(Xd(le.y,0,1)),me=_e.getUTCDay(),_e=me>4||me===0?qv.ceil(_e):qv(_e),_e=iy.offset(_e,(le.V-1)*7),le.y=_e.getUTCFullYear(),le.m=_e.getUTCMonth(),le.d=_e.getUTCDate()+(le.w+6)%7):(_e=Q1(Xd(le.y,0,1)),me=_e.getDay(),_e=me>4||me===0?zv.ceil(_e):zv(_e),_e=Ph.offset(_e,(le.V-1)*7),le.y=_e.getFullYear(),le.m=_e.getMonth(),le.d=_e.getDate()+(le.w+6)%7)}else("W"in le||"U"in le)&&("w"in le||(le.w="u"in le?le.u%7:"W"in le?1:0),me="Z"in le?J1(Xd(le.y,0,1)).getUTCDay():Q1(Xd(le.y,0,1)).getDay(),le.m=0,le.d="W"in le?(le.w+6)%7+le.W*7-(me+5)%7:le.w+le.U*7-(me+6)%7);return"Z"in le?(le.H+=le.Z/100|0,le.M+=le.Z%100,J1(le)):Q1(le)}}function P(Z,pe,je,le){for(var Re=0,_e=pe.length,me=je.length,ve,Le;Re<_e;){if(le>=me)return-1;if(ve=pe.charCodeAt(Re++),ve===37){if(ve=pe.charAt(Re++),Le=E[ve in t$?pe.charAt(Re++):ve],!Le||(le=Le(Z,je,le))<0)return-1}else if(ve!=je.charCodeAt(le++))return-1}return le}function $(Z,pe,je){var le=f.exec(pe.slice(je));return le?(Z.p=m.get(le[0].toLowerCase()),je+le[0].length):-1}function z(Z,pe,je){var le=x.exec(pe.slice(je));return le?(Z.w=j.get(le[0].toLowerCase()),je+le[0].length):-1}function D(Z,pe,je){var le=p.exec(pe.slice(je));return le?(Z.w=g.get(le[0].toLowerCase()),je+le[0].length):-1}function U(Z,pe,je){var le=N.exec(pe.slice(je));return le?(Z.m=O.get(le[0].toLowerCase()),je+le[0].length):-1}function V(Z,pe,je){var le=b.exec(pe.slice(je));return le?(Z.m=w.get(le[0].toLowerCase()),je+le[0].length):-1}function H(Z,pe,je){return P(Z,t,pe,je)}function G(Z,pe,je){return P(Z,n,pe,je)}function L(Z,pe,je){return P(Z,r,pe,je)}function R(Z){return l[Z.getDay()]}function F(Z){return i[Z.getDay()]}function K(Z){return d[Z.getMonth()]}function te(Z){return u[Z.getMonth()]}function I(Z){return a[+(Z.getHours()>=12)]}function B(Z){return 1+~~(Z.getMonth()/3)}function Y(Z){return l[Z.getUTCDay()]}function ne(Z){return i[Z.getUTCDay()]}function oe(Z){return d[Z.getUTCMonth()]}function xe(Z){return u[Z.getUTCMonth()]}function ee(Z){return a[+(Z.getUTCHours()>=12)]}function ae(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var pe=k(Z+="",C);return pe.toString=function(){return Z},pe},parse:function(Z){var pe=T(Z+="",!1);return pe.toString=function(){return Z},pe},utcFormat:function(Z){var pe=k(Z+="",A);return pe.toString=function(){return Z},pe},utcParse:function(Z){var pe=T(Z+="",!0);return pe.toString=function(){return Z},pe}}}var t$={"-":"",_:" ",0:"0"},Vn=/^\s*\d+/,kae=/^%/,Pae=/[\\^$*+?|[\]().{}]/g;function vt(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",i=a.length;return r+(i[t.toLowerCase(),n]))}function Rae(e,t,n){var r=Vn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Dae(e,t,n){var r=Vn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function $ae(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Iae(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Lae(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function n$(e,t,n){var r=Vn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function r$(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Bae(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function zae(e,t,n){var r=Vn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function qae(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function a$(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Fae(e,t,n){var r=Vn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function i$(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Uae(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Hae(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Wae(e,t,n){var r=Vn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Vae(e,t,n){var r=Vn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Gae(e,t,n){var r=kae.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Yae(e,t,n){var r=Vn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Kae(e,t,n){var r=Vn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function o$(e,t){return vt(e.getDate(),t,2)}function Xae(e,t){return vt(e.getHours(),t,2)}function Zae(e,t){return vt(e.getHours()%12||12,t,2)}function Qae(e,t){return vt(1+Ph.count(to(e),e),t,3)}function Uz(e,t){return vt(e.getMilliseconds(),t,3)}function Jae(e,t){return Uz(e,t)+"000"}function eie(e,t){return vt(e.getMonth()+1,t,2)}function tie(e,t){return vt(e.getMinutes(),t,2)}function nie(e,t){return vt(e.getSeconds(),t,2)}function rie(e){var t=e.getDay();return t===0?7:t}function aie(e,t){return vt(oy.count(to(e)-1,e),t,2)}function Hz(e){var t=e.getDay();return t>=4||t===0?su(e):su.ceil(e)}function iie(e,t){return e=Hz(e),vt(su.count(to(e),e)+(to(e).getDay()===4),t,2)}function oie(e){return e.getDay()}function sie(e,t){return vt(zv.count(to(e)-1,e),t,2)}function lie(e,t){return vt(e.getFullYear()%100,t,2)}function cie(e,t){return e=Hz(e),vt(e.getFullYear()%100,t,2)}function uie(e,t){return vt(e.getFullYear()%1e4,t,4)}function die(e,t){var n=e.getDay();return e=n>=4||n===0?su(e):su.ceil(e),vt(e.getFullYear()%1e4,t,4)}function fie(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+vt(t/60|0,"0",2)+vt(t%60,"0",2)}function s$(e,t){return vt(e.getUTCDate(),t,2)}function hie(e,t){return vt(e.getUTCHours(),t,2)}function mie(e,t){return vt(e.getUTCHours()%12||12,t,2)}function pie(e,t){return vt(1+iy.count(no(e),e),t,3)}function Wz(e,t){return vt(e.getUTCMilliseconds(),t,3)}function vie(e,t){return Wz(e,t)+"000"}function gie(e,t){return vt(e.getUTCMonth()+1,t,2)}function yie(e,t){return vt(e.getUTCMinutes(),t,2)}function xie(e,t){return vt(e.getUTCSeconds(),t,2)}function bie(e){var t=e.getUTCDay();return t===0?7:t}function wie(e,t){return vt(sy.count(no(e)-1,e),t,2)}function Vz(e){var t=e.getUTCDay();return t>=4||t===0?lu(e):lu.ceil(e)}function jie(e,t){return e=Vz(e),vt(lu.count(no(e),e)+(no(e).getUTCDay()===4),t,2)}function Sie(e){return e.getUTCDay()}function _ie(e,t){return vt(qv.count(no(e)-1,e),t,2)}function Nie(e,t){return vt(e.getUTCFullYear()%100,t,2)}function Oie(e,t){return e=Vz(e),vt(e.getUTCFullYear()%100,t,2)}function Cie(e,t){return vt(e.getUTCFullYear()%1e4,t,4)}function Eie(e,t){var n=e.getUTCDay();return e=n>=4||n===0?lu(e):lu.ceil(e),vt(e.getUTCFullYear()%1e4,t,4)}function Aie(){return"+0000"}function l$(){return"%"}function c$(e){return+e}function u$(e){return Math.floor(+e/1e3)}var bc,Gz,Yz;Tie({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Tie(e){return bc=Tae(e),Gz=bc.format,bc.parse,Yz=bc.utcFormat,bc.utcParse,bc}function kie(e){return new Date(e)}function Pie(e){return e instanceof Date?+e:+new Date(+e)}function OC(e,t,n,r,a,i,l,u,d,f){var m=fC(),p=m.invert,g=m.domain,x=f(".%L"),j=f(":%S"),b=f("%I:%M"),w=f("%I %p"),N=f("%a %d"),O=f("%b %d"),C=f("%B"),A=f("%Y");function E(k){return(d(k)t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,i)=>wre(e,i/r))},n.copy=function(){return Qz(t).domain(e)},co.apply(n,arguments)}function cy(){var e=0,t=.5,n=1,r=1,a,i,l,u,d,f=wr,m,p=!1,g;function x(b){return isNaN(b=+b)?g:(b=.5+((b=+m(b))-i)*(r*bn}return tS=e,tS}var nS,m$;function Iie(){if(m$)return nS;m$=1;var e=uy(),t=n6(),n=zu();function r(a){return a&&a.length?e(a,n,t):void 0}return nS=r,nS}var Lie=Iie();const dy=St(Lie);var rS,p$;function r6(){if(p$)return rS;p$=1;function e(t,n){return te.e^i.s<0?1:-1;for(r=i.d.length,a=e.d.length,t=0,n=re.d[t]^i.s<0?1:-1;return r===a?0:r>a^i.s<0?1:-1};Ee.decimalPlaces=Ee.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Yt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ee.dividedBy=Ee.div=function(e){return Qi(this,new this.constructor(e))};Ee.dividedToIntegerBy=Ee.idiv=function(e){var t=this,n=t.constructor;return It(Qi(t,new n(e),0,1),n.precision)};Ee.equals=Ee.eq=function(e){return!this.cmp(e)};Ee.exponent=function(){return vn(this)};Ee.greaterThan=Ee.gt=function(e){return this.cmp(e)>0};Ee.greaterThanOrEqualTo=Ee.gte=function(e){return this.cmp(e)>=0};Ee.isInteger=Ee.isint=function(){return this.e>this.d.length-2};Ee.isNegative=Ee.isneg=function(){return this.s<0};Ee.isPositive=Ee.ispos=function(){return this.s>0};Ee.isZero=function(){return this.s===0};Ee.lessThan=Ee.lt=function(e){return this.cmp(e)<0};Ee.lessThanOrEqualTo=Ee.lte=function(e){return this.cmp(e)<1};Ee.logarithm=Ee.log=function(e){var t,n=this,r=n.constructor,a=r.precision,i=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Jr))throw Error(Na+"NaN");if(n.s<1)throw Error(Na+(n.s?"NaN":"-Infinity"));return n.eq(Jr)?new r(0):(Zt=!1,t=Qi(Bf(n,i),Bf(e,i),i),Zt=!0,It(t,a))};Ee.minus=Ee.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?s6(t,e):i6(t,(e.s=-e.s,e))};Ee.modulo=Ee.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(Na+"NaN");return n.s?(Zt=!1,t=Qi(n,e,0,1).times(e),Zt=!0,n.minus(t)):It(new r(n),a)};Ee.naturalExponential=Ee.exp=function(){return o6(this)};Ee.naturalLogarithm=Ee.ln=function(){return Bf(this)};Ee.negated=Ee.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ee.plus=Ee.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?i6(t,e):s6(t,(e.s=-e.s,e))};Ee.precision=Ee.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(el+e);if(t=vn(a)+1,r=a.d.length-1,n=r*Yt+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Ee.squareRoot=Ee.sqrt=function(){var e,t,n,r,a,i,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(Na+"NaN")}for(e=vn(u),Zt=!1,a=Math.sqrt(+u),a==0||a==1/0?(t=ii(u.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Uu((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(a.toString()),n=d.precision,a=l=n+3;;)if(i=r,r=i.plus(Qi(u,i,l+2)).times(.5),ii(i.d).slice(0,l)===(t=ii(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),a==l&&t=="4999"){if(It(i,n+1,0),i.times(i).eq(u)){r=i;break}}else if(t!="9999")break;l+=4}return Zt=!0,It(r,n)};Ee.times=Ee.mul=function(e){var t,n,r,a,i,l,u,d,f,m=this,p=m.constructor,g=m.d,x=(e=new p(e)).d;if(!m.s||!e.s)return new p(0);for(e.s*=m.s,n=m.e+e.e,d=g.length,f=x.length,d=0;){for(t=0,a=d+r;a>r;)u=i[a]+x[r]*g[a-r-1]+t,i[a--]=u%Bn|0,t=u/Bn|0;i[a]=(i[a]+t)%Bn|0}for(;!i[--l];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,Zt?It(e,p.precision):e};Ee.toDecimalPlaces=Ee.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(mi(e,0,Fu),t===void 0?t=r.rounding:mi(t,0,8),It(n,e+vn(n)+1,t))};Ee.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=ul(r,!0):(mi(e,0,Fu),t===void 0?t=a.rounding:mi(t,0,8),r=It(new a(r),e+1,t),n=ul(r,!0,e+1)),n};Ee.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?ul(a):(mi(e,0,Fu),t===void 0?t=i.rounding:mi(t,0,8),r=It(new i(a),e+vn(a)+1,t),n=ul(r.abs(),!1,e+vn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Ee.toInteger=Ee.toint=function(){var e=this,t=e.constructor;return It(new t(e),vn(e)+1,t.rounding)};Ee.toNumber=function(){return+this};Ee.toPower=Ee.pow=function(e){var t,n,r,a,i,l,u=this,d=u.constructor,f=12,m=+(e=new d(e));if(!e.s)return new d(Jr);if(u=new d(u),!u.s){if(e.s<1)throw Error(Na+"Infinity");return u}if(u.eq(Jr))return u;if(r=d.precision,e.eq(Jr))return It(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,i=u.s,l){if((n=m<0?-m:m)<=a6){for(a=new d(Jr),t=Math.ceil(r/Yt+4),Zt=!1;n%2&&(a=a.times(u),w$(a.d,t)),n=Uu(n/2),n!==0;)u=u.times(u),w$(u.d,t);return Zt=!0,e.s<0?new d(Jr).div(a):It(a,r)}}else if(i<0)throw Error(Na+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,Zt=!1,a=e.times(Bf(u,r+f)),Zt=!0,a=o6(a),a.s=i,a};Ee.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=vn(a),r=ul(a,n<=i.toExpNeg||n>=i.toExpPos)):(mi(e,1,Fu),t===void 0?t=i.rounding:mi(t,0,8),a=It(new i(a),e,t),n=vn(a),r=ul(a,e<=n||n<=i.toExpNeg,e)),r};Ee.toSignificantDigits=Ee.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(mi(e,1,Fu),t===void 0?t=r.rounding:mi(t,0,8)),It(new r(n),e,t)};Ee.toString=Ee.valueOf=Ee.val=Ee.toJSON=Ee[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=vn(e),n=e.constructor;return ul(e,t<=n.toExpNeg||t>=n.toExpPos)};function i6(e,t){var n,r,a,i,l,u,d,f,m=e.constructor,p=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),Zt?It(t,p):t;if(d=e.d,f=t.d,l=e.e,a=t.e,d=d.slice(),i=l-a,i){for(i<0?(r=d,i=-i,u=f.length):(r=f,a=l,u=d.length),l=Math.ceil(p/Yt),u=l>u?l+1:u+1,i>u&&(i=u,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(u=d.length,i=f.length,u-i<0&&(i=u,r=f,f=d,d=r),n=0;i;)n=(d[--i]=d[i]+f[i]+n)/Bn|0,d[i]%=Bn;for(n&&(d.unshift(n),++a),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=a,Zt?It(t,p):t}function mi(e,t,n){if(e!==~~e||en)throw Error(el+e)}function ii(e){var t,n,r,a=e.length-1,i="",l=e[0];if(a>0){for(i+=l,t=1;tl?1:-1;else for(u=d=0;ua[u]?1:-1;break}return d}function n(r,a,i){for(var l=0;i--;)r[i]-=l,l=r[i]1;)r.shift()}return function(r,a,i,l){var u,d,f,m,p,g,x,j,b,w,N,O,C,A,E,k,T,P,$=r.constructor,z=r.s==a.s?1:-1,D=r.d,U=a.d;if(!r.s)return new $(r);if(!a.s)throw Error(Na+"Division by zero");for(d=r.e-a.e,T=U.length,E=D.length,x=new $(z),j=x.d=[],f=0;U[f]==(D[f]||0);)++f;if(U[f]>(D[f]||0)&&--d,i==null?O=i=$.precision:l?O=i+(vn(r)-vn(a))+1:O=i,O<0)return new $(0);if(O=O/Yt+2|0,f=0,T==1)for(m=0,U=U[0],O++;(f1&&(U=e(U,m),D=e(D,m),T=U.length,E=D.length),A=T,b=D.slice(0,T),w=b.length;w=Bn/2&&++k;do m=0,u=t(U,b,T,w),u<0?(N=b[0],T!=w&&(N=N*Bn+(b[1]||0)),m=N/k|0,m>1?(m>=Bn&&(m=Bn-1),p=e(U,m),g=p.length,w=b.length,u=t(p,b,g,w),u==1&&(m--,n(p,T16)throw Error(AC+vn(e));if(!e.s)return new m(Jr);for(Zt=!1,u=p,l=new m(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(r=Math.log(Bs(2,f))/Math.LN10*2+5|0,u+=r,n=a=i=new m(Jr),m.precision=u;;){if(a=It(a.times(e),u),n=n.times(++d),l=i.plus(Qi(a,n,u)),ii(l.d).slice(0,u)===ii(i.d).slice(0,u)){for(;f--;)i=It(i.times(i),u);return m.precision=p,t==null?(Zt=!0,It(i,p)):i}i=l}}function vn(e){for(var t=e.e*Yt,n=e.d[0];n>=10;n/=10)t++;return t}function lS(e,t,n){if(t>e.LN10.sd())throw Zt=!0,n&&(e.precision=n),Error(Na+"LN10 precision limit exceeded");return It(new e(e.LN10),t)}function zo(e){for(var t="";e--;)t+="0";return t}function Bf(e,t){var n,r,a,i,l,u,d,f,m,p=1,g=10,x=e,j=x.d,b=x.constructor,w=b.precision;if(x.s<1)throw Error(Na+(x.s?"NaN":"-Infinity"));if(x.eq(Jr))return new b(0);if(t==null?(Zt=!1,f=w):f=t,x.eq(10))return t==null&&(Zt=!0),lS(b,f);if(f+=g,b.precision=f,n=ii(j),r=n.charAt(0),i=vn(x),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)x=x.times(e),n=ii(x.d),r=n.charAt(0),p++;i=vn(x),r>1?(x=new b("0."+n),i++):x=new b(r+"."+n.slice(1))}else return d=lS(b,f+2,w).times(i+""),x=Bf(new b(r+"."+n.slice(1)),f-g).plus(d),b.precision=w,t==null?(Zt=!0,It(x,w)):x;for(u=l=x=Qi(x.minus(Jr),x.plus(Jr),f),m=It(x.times(x),f),a=3;;){if(l=It(l.times(m),f),d=u.plus(Qi(l,new b(a),f)),ii(d.d).slice(0,f)===ii(u.d).slice(0,f))return u=u.times(2),i!==0&&(u=u.plus(lS(b,f+2,w).times(i+""))),u=Qi(u,new b(p),f),b.precision=w,t==null?(Zt=!0,It(u,w)):u;u=d,a+=2}}function b$(e,t){var n,r,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=Uu(n/Yt),e.d=[],r=(n+1)%Yt,n<0&&(r+=Yt),rFv||e.e<-Fv))throw Error(AC+n)}else e.s=0,e.e=0,e.d=[0];return e}function It(e,t,n){var r,a,i,l,u,d,f,m,p=e.d;for(l=1,i=p[0];i>=10;i/=10)l++;if(r=t-l,r<0)r+=Yt,a=t,f=p[m=0];else{if(m=Math.ceil((r+1)/Yt),i=p.length,m>=i)return e;for(f=i=p[m],l=1;i>=10;i/=10)l++;r%=Yt,a=r-Yt+l}if(n!==void 0&&(i=Bs(10,l-a-1),u=f/i%10|0,d=t<0||p[m+1]!==void 0||f%i,d=n<4?(u||d)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||d||n==6&&(r>0?a>0?f/Bs(10,l-a):0:p[m-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(i=vn(e),p.length=1,t=t-i-1,p[0]=Bs(10,(Yt-t%Yt)%Yt),e.e=Uu(-t/Yt)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=m,i=1,m--):(p.length=m+1,i=Bs(10,Yt-r),p[m]=a>0?(f/Bs(10,l-a)%Bs(10,a)|0)*i:0),d)for(;;)if(m==0){(p[0]+=i)==Bn&&(p[0]=1,++e.e);break}else{if(p[m]+=i,p[m]!=Bn)break;p[m--]=0,i=1}for(r=p.length;p[--r]===0;)p.pop();if(Zt&&(e.e>Fv||e.e<-Fv))throw Error(AC+vn(e));return e}function s6(e,t){var n,r,a,i,l,u,d,f,m,p,g=e.constructor,x=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),Zt?It(t,x):t;if(d=e.d,p=t.d,r=t.e,f=e.e,d=d.slice(),l=f-r,l){for(m=l<0,m?(n=d,l=-l,u=p.length):(n=p,r=f,u=d.length),a=Math.max(Math.ceil(x/Yt),u)+2,l>a&&(l=a,n.length=1),n.reverse(),a=l;a--;)n.push(0);n.reverse()}else{for(a=d.length,u=p.length,m=a0;--a)d[u++]=0;for(a=p.length;a>l;){if(d[--a]0?i=i.charAt(0)+"."+i.slice(1)+zo(r):l>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+zo(-a-1)+i,n&&(r=n-l)>0&&(i+=zo(r))):a>=l?(i+=zo(a+1-l),n&&(r=n-a-1)>0&&(i=i+"."+zo(r))):((r=a+1)0&&(a+1===l&&(i+="."),i+=zo(r))),e.s<0?"-"+i:i}function w$(e,t){if(e.length>t)return e.length=t,!0}function l6(e){var t,n,r;function a(i){var l=this;if(!(l instanceof a))return new a(i);if(l.constructor=a,i instanceof a){l.s=i.s,l.e=i.e,l.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(el+i);if(i>0)l.s=1;else if(i<0)i=-i,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(i===~~i&&i<1e7){l.e=0,l.d=[i];return}return b$(l,i.toString())}else if(typeof i!="string")throw Error(el+i);if(i.charCodeAt(0)===45?(i=i.slice(1),l.s=-1):l.s=1,Yie.test(i))b$(l,i);else throw Error(el+i)}if(a.prototype=Ee,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=l6,a.config=a.set=Kie,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(el+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(el+n+": "+r);return this}var TC=l6(Gie);Jr=new TC(1);const Mt=TC;function Xie(e){return eoe(e)||Jie(e)||Qie(e)||Zie()}function Zie(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qie(e,t){if(e){if(typeof e=="string")return W_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W_(e,t)}}function Jie(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function eoe(e){if(Array.isArray(e))return W_(e)}function W_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,a):e(t-l,j$(function(){for(var u=arguments.length,d=new Array(u),f=0;fe.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,i=void 0;try{for(var l=e[Symbol.iterator](),u;!(r=(u=l.next()).done)&&(n.push(u.value),!(t&&n.length===t));r=!0);}catch(d){a=!0,i=d}finally{try{!r&&l.return!=null&&l.return()}finally{if(a)throw i}}return n}}function poe(e){if(Array.isArray(e))return e}function h6(e){var t=zf(e,2),n=t[0],r=t[1],a=n,i=r;return n>r&&(a=r,i=n),[a,i]}function m6(e,t,n){if(e.lte(0))return new Mt(0);var r=my.getDigitCount(e.toNumber()),a=new Mt(10).pow(r),i=e.div(a),l=r!==1?.05:.1,u=new Mt(Math.ceil(i.div(l).toNumber())).add(n).mul(l),d=u.mul(a);return t?d:new Mt(Math.ceil(d))}function voe(e,t,n){var r=1,a=new Mt(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new Mt(10).pow(my.getDigitCount(e)-1),a=new Mt(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new Mt(Math.floor(e)))}else e===0?a=new Mt(Math.floor((t-1)/2)):n||(a=new Mt(Math.floor(e)));var l=Math.floor((t-1)/2),u=aoe(roe(function(d){return a.add(new Mt(d-l).mul(r)).toNumber()}),V_);return u(0,t)}function p6(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Mt(0),tickMin:new Mt(0),tickMax:new Mt(0)};var i=m6(new Mt(t).sub(e).div(n-1),r,a),l;e<=0&&t>=0?l=new Mt(0):(l=new Mt(e).add(t).div(2),l=l.sub(new Mt(l).mod(i)));var u=Math.ceil(l.sub(e).div(i).toNumber()),d=Math.ceil(new Mt(t).sub(l).div(i).toNumber()),f=u+d+1;return f>n?p6(e,t,n,r,a+1):(f0?d+(n-f):d,u=t>0?u:u+(n-f)),{step:i,tickMin:l.sub(new Mt(u).mul(i)),tickMax:l.add(new Mt(d).mul(i))})}function goe(e){var t=zf(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=Math.max(a,2),u=h6([n,r]),d=zf(u,2),f=d[0],m=d[1];if(f===-1/0||m===1/0){var p=m===1/0?[f].concat(Y_(V_(0,a-1).map(function(){return 1/0}))):[].concat(Y_(V_(0,a-1).map(function(){return-1/0})),[m]);return n>r?G_(p):p}if(f===m)return voe(f,a,i);var g=p6(f,m,l,i),x=g.step,j=g.tickMin,b=g.tickMax,w=my.rangeStep(j,b.add(new Mt(.1).mul(x)),x);return n>r?G_(w):w}function yoe(e,t){var n=zf(e,2),r=n[0],a=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=h6([r,a]),u=zf(l,2),d=u[0],f=u[1];if(d===-1/0||f===1/0)return[r,a];if(d===f)return[d];var m=Math.max(t,2),p=m6(new Mt(f).sub(d).div(m-1),i,0),g=[].concat(Y_(my.rangeStep(new Mt(d),new Mt(f).sub(new Mt(.99).mul(p)),p)),[f]);return r>a?G_(g):g}var xoe=d6(goe),boe=d6(yoe),woe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function cu(e){"@babel/helpers - typeof";return cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cu(e)}function Uv(){return Uv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Eoe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Aoe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Toe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,l=-1,u=(n=r?.length)!==null&&n!==void 0?n:0;if(u<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var d=i.range,f=0;f0?a[f-1].coordinate:a[u-1].coordinate,p=a[f].coordinate,g=f>=u-1?a[0].coordinate:a[f+1].coordinate,x=void 0;if(xr(p-m)!==xr(g-p)){var j=[];if(xr(g-p)===xr(d[1]-d[0])){x=g;var b=p+d[1]-d[0];j[0]=Math.min(b,(b+m)/2),j[1]=Math.max(b,(b+m)/2)}else{x=m;var w=g+d[1]-d[0];j[0]=Math.min(p,(w+p)/2),j[1]=Math.max(p,(w+p)/2)}var N=[Math.min(p,(x+p)/2),Math.max(p,(x+p)/2)];if(t>N[0]&&t<=N[1]||t>=j[0]&&t<=j[1]){l=a[f].index;break}}else{var O=Math.min(m,g),C=Math.max(m,g);if(t>(O+p)/2&&t<=(C+p)/2){l=a[f].index;break}}}else for(var A=0;A0&&A(r[A].coordinate+r[A-1].coordinate)/2&&t<=(r[A].coordinate+r[A+1].coordinate)/2||A===u-1&&t>(r[A].coordinate+r[A-1].coordinate)/2){l=r[A].index;break}return l},kC=function(t){var n,r=t,a=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?an(an({},t.type.defaultProps),t.props):t.props,l=i.stroke,u=i.fill,d;switch(a){case"Line":d=l;break;case"Area":case"Radar":d=l&&l!=="none"?l:u;break;default:d=u;break}return d},Goe=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var l={},u=Object.keys(i),d=0,f=u.length;d=0});if(N&&N.length){var O=N[0].type.defaultProps,C=O!==void 0?an(an({},O),N[0].props):N[0].props,A=C.barSize,E=C[w];l[E]||(l[E]=[]);var k=Ge(A)?n:A;l[E].push({item:N[0],stackList:N.slice(1),barSize:Ge(k)?void 0:br(k,r,0)})}}return l},Yoe=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,i=t.sizeList,l=i===void 0?[]:i,u=t.maxBarSize,d=l.length;if(d<1)return null;var f=br(n,a,0,!0),m,p=[];if(l[0].barSize===+l[0].barSize){var g=!1,x=a/d,j=l.reduce(function(A,E){return A+E.barSize||0},0);j+=(d-1)*f,j>=a&&(j-=(d-1)*f,f=0),j>=a&&x>0&&(g=!0,x*=.9,j=d*x);var b=(a-j)/2>>0,w={offset:b-f,size:0};m=l.reduce(function(A,E){var k={item:E.item,position:{offset:w.offset+w.size+f,size:g?x:E.barSize}},T=[].concat(N$(A),[k]);return w=T[T.length-1].position,E.stackList&&E.stackList.length&&E.stackList.forEach(function(P){T.push({item:P,position:w})}),T},p)}else{var N=br(r,a,0,!0);a-2*N-(d-1)*f<=0&&(f=0);var O=(a-2*N-(d-1)*f)/d;O>1&&(O>>=0);var C=u===+u?Math.min(O,u):O;m=l.reduce(function(A,E,k){var T=[].concat(N$(A),[{item:E.item,position:{offset:N+(O+f)*k+(O-C)/2,size:C}}]);return E.stackList&&E.stackList.length&&E.stackList.forEach(function(P){T.push({item:P,position:T[T.length-1].position})}),T},p)}return m},Koe=function(t,n,r,a){var i=r.children,l=r.width,u=r.margin,d=l-(u.left||0)-(u.right||0),f=x6({children:i,legendWidth:d});if(f){var m=a||{},p=m.width,g=m.height,x=f.align,j=f.verticalAlign,b=f.layout;if((b==="vertical"||b==="horizontal"&&j==="middle")&&x!=="center"&&Oe(t[x]))return an(an({},t),{},Fc({},x,t[x]+(p||0)));if((b==="horizontal"||b==="vertical"&&x==="center")&&j!=="middle"&&Oe(t[j]))return an(an({},t),{},Fc({},j,t[j]+(g||0)))}return t},Xoe=function(t,n,r){return Ge(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},b6=function(t,n,r,a,i){var l=n.props.children,u=ta(l,Rh).filter(function(f){return Xoe(a,i,f.props.direction)});if(u&&u.length){var d=u.map(function(f){return f.props.dataKey});return t.reduce(function(f,m){var p=Tn(m,r);if(Ge(p))return f;var g=Array.isArray(p)?[fy(p),dy(p)]:[p,p],x=d.reduce(function(j,b){var w=Tn(m,b,0),N=g[0]-Math.abs(Array.isArray(w)?w[0]:w),O=g[1]+Math.abs(Array.isArray(w)?w[1]:w);return[Math.min(N,j[0]),Math.max(O,j[1])]},[1/0,-1/0]);return[Math.min(x[0],f[0]),Math.max(x[1],f[1])]},[1/0,-1/0])}return null},Zoe=function(t,n,r,a,i){var l=n.map(function(u){return b6(t,u,r,i,a)}).filter(function(u){return!Ge(u)});return l&&l.length?l.reduce(function(u,d){return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]):null},w6=function(t,n,r,a,i){var l=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&b6(t,d,f,a)||bf(t,f,r,i)});if(r==="number")return l.reduce(function(d,f){return[Math.min(d[0],f[0]),Math.max(d[1],f[1])]},[1/0,-1/0]);var u={};return l.reduce(function(d,f){for(var m=0,p=f.length;m=2?xr(u[0]-u[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var m=(t.ticks||t.niceTicks).map(function(p){var g=i?i.indexOf(p):p;return{coordinate:a(g)+f,value:p,offset:f}});return m.filter(function(p){return!Ch(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,g){return{coordinate:a(p)+f,value:p,index:g,offset:f}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(p){return{coordinate:a(p)+f,value:p,offset:f}}):a.domain().map(function(p,g){return{coordinate:a(p)+f,value:i?i[p]:p,index:g,offset:f}})},cS=new WeakMap,Mp=function(t,n){if(typeof n!="function")return t;cS.has(t)||cS.set(t,new WeakMap);var r=cS.get(t);if(r.has(n))return r.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,a),a},_6=function(t,n,r){var a=t.scale,i=t.type,l=t.layout,u=t.axisType;if(a==="auto")return l==="radial"&&u==="radiusAxis"?{scale:Rf(),realScaleType:"band"}:l==="radial"&&u==="angleAxis"?{scale:Lv(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:xf(),realScaleType:"point"}:i==="category"?{scale:Rf(),realScaleType:"band"}:{scale:Lv(),realScaleType:"linear"};if(sl(a)){var d="scale".concat(Xg(a));return{scale:(d$[d]||xf)(),realScaleType:d$[d]?d:"point"}}return We(a)?{scale:a}:{scale:xf(),realScaleType:"point"}},C$=1e-4,N6=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,a=t.range(),i=Math.min(a[0],a[1])-C$,l=Math.max(a[0],a[1])+C$,u=t(n[0]),d=t(n[r-1]);(ul||dl)&&t.domain([n[0],n[r-1]])}},Qoe=function(t,n){if(!t)return null;for(var r=0,a=t.length;ra)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]=0?(t[u][r][0]=i,t[u][r][1]=i+d,i=t[u][r][1]):(t[u][r][0]=l,t[u][r][1]=l+d,l=t[u][r][1])}},tse=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r=0?(t[l][r][0]=i,t[l][r][1]=i+u,i=t[l][r][1]):(t[l][r][0]=0,t[l][r][1]=0)}},nse={sign:ese,expand:UJ,none:tu,silhouette:HJ,wiggle:WJ,positive:tse},rse=function(t,n,r){var a=n.map(function(u){return u.props.dataKey}),i=nse[r],l=FJ().keys(a).value(function(u,d){return+Tn(u,d,0)}).order(C_).offset(i);return l(t)},ase=function(t,n,r,a,i,l){if(!t)return null;var u=l?n.reverse():n,d={},f=u.reduce(function(p,g){var x,j=(x=g.type)!==null&&x!==void 0&&x.defaultProps?an(an({},g.type.defaultProps),g.props):g.props,b=j.stackId,w=j.hide;if(w)return p;var N=j[r],O=p[N]||{hasStack:!1,stackGroups:{}};if(kn(b)){var C=O.stackGroups[b]||{numericAxisId:r,cateAxisId:a,items:[]};C.items.push(g),O.hasStack=!0,O.stackGroups[b]=C}else O.stackGroups[Bu("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[g]};return an(an({},p),{},Fc({},N,O))},d),m={};return Object.keys(f).reduce(function(p,g){var x=f[g];if(x.hasStack){var j={};x.stackGroups=Object.keys(x.stackGroups).reduce(function(b,w){var N=x.stackGroups[w];return an(an({},b),{},Fc({},w,{numericAxisId:r,cateAxisId:a,items:N.items,stackedData:rse(t,N.items,i)}))},j)}return an(an({},p),{},Fc({},g,x))},m)},O6=function(t,n){var r=n.realScaleType,a=n.type,i=n.tickCount,l=n.originalDomain,u=n.allowDecimals,d=r||n.scale;if(d!=="auto"&&d!=="linear")return null;if(i&&a==="number"&&l&&(l[0]==="auto"||l[1]==="auto")){var f=t.domain();if(!f.length)return null;var m=xoe(f,i,u);return t.domain([fy(m),dy(m)]),{niceTicks:m}}if(i&&a==="number"){var p=t.domain(),g=boe(p,i,u);return{niceTicks:g}}return null};function E$(e){var t=e.axis,n=e.ticks,r=e.bandSize,a=e.entry,i=e.index,l=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ge(a[t.dataKey])){var u=bv(n,"value",a[t.dataKey]);if(u)return u.coordinate+r/2}return n[i]?n[i].coordinate+r/2:null}var d=Tn(a,Ge(l)?t.dataKey:l);return Ge(d)?null:t.scale(d)}var A$=function(t){var n=t.axis,r=t.ticks,a=t.offset,i=t.bandSize,l=t.entry,u=t.index;if(n.type==="category")return r[u]?r[u].coordinate+a:null;var d=Tn(l,n.dataKey,n.domain[u]);return Ge(d)?null:n.scale(d)-i/2+a},ise=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return a<=0&&i>=0?0:i<0?i:a}return r[0]},ose=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?an(an({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(kn(i)){var l=n[i];if(l){var u=l.items.indexOf(t);return u>=0?l.stackedData[u]:null}}return null},sse=function(t){return t.reduce(function(n,r){return[fy(r.concat([n[0]]).filter(Oe)),dy(r.concat([n[1]]).filter(Oe))]},[1/0,-1/0])},C6=function(t,n,r){return Object.keys(t).reduce(function(a,i){var l=t[i],u=l.stackedData,d=u.reduce(function(f,m){var p=sse(m.slice(n,r+1));return[Math.min(f[0],p[0]),Math.max(f[1],p[1])]},[1/0,-1/0]);return[Math.min(d[0],a[0]),Math.max(d[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},T$=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,k$=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Q_=function(t,n,r){if(We(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(Oe(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(T$.test(t[0])){var i=+T$.exec(t[0])[1];a[0]=n[0]-i}else We(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(Oe(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(k$.test(t[1])){var l=+k$.exec(t[1])[1];a[1]=n[1]+l}else We(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},Wv=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!r||a>0)return a}if(t&&n&&n.length>=2){for(var i=iC(n,function(p){return p.coordinate}),l=1/0,u=1,d=i.length;ue.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},vse=function(t,n,r,a,i){var l=t.width,u=t.height,d=t.startAngle,f=t.endAngle,m=br(t.cx,l,l/2),p=br(t.cy,u,u/2),g=T6(l,u,r),x=br(t.innerRadius,g,0),j=br(t.outerRadius,g,g*.8),b=Object.keys(n);return b.reduce(function(w,N){var O=n[N],C=O.domain,A=O.reversed,E;if(Ge(O.range))a==="angleAxis"?E=[d,f]:a==="radiusAxis"&&(E=[x,j]),A&&(E=[E[1],E[0]]);else{E=O.range;var k=E,T=use(k,2);d=T[0],f=T[1]}var P=_6(O,i),$=P.realScaleType,z=P.scale;z.domain(C).range(E),N6(z);var D=O6(z,Ui(Ui({},O),{},{realScaleType:$})),U=Ui(Ui(Ui({},O),D),{},{range:E,radius:j,realScaleType:$,scale:z,cx:m,cy:p,innerRadius:x,outerRadius:j,startAngle:d,endAngle:f});return Ui(Ui({},w),{},A6({},N,U))},{})},gse=function(t,n){var r=t.x,a=t.y,i=n.x,l=n.y;return Math.sqrt(Math.pow(r-i,2)+Math.pow(a-l,2))},yse=function(t,n){var r=t.x,a=t.y,i=n.cx,l=n.cy,u=gse({x:r,y:a},{x:i,y:l});if(u<=0)return{radius:u};var d=(r-i)/u,f=Math.acos(d);return a>l&&(f=2*Math.PI-f),{radius:u,angle:pse(f),angleInRadian:f}},xse=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),i=Math.floor(r/360),l=Math.min(a,i);return{startAngle:n-l*360,endAngle:r-l*360}},bse=function(t,n){var r=n.startAngle,a=n.endAngle,i=Math.floor(r/360),l=Math.floor(a/360),u=Math.min(i,l);return t+u*360},D$=function(t,n){var r=t.x,a=t.y,i=yse({x:r,y:a},n),l=i.radius,u=i.angle,d=n.innerRadius,f=n.outerRadius;if(lf)return!1;if(l===0)return!0;var m=xse(n),p=m.startAngle,g=m.endAngle,x=u,j;if(p<=g){for(;x>g;)x-=360;for(;x=p&&x<=g}else{for(;x>p;)x-=360;for(;x=g&&x<=p}return j?Ui(Ui({},n),{},{radius:l,angle:bse(x,n)}):null},k6=function(t){return!y.isValidElement(t)&&!We(t)&&typeof t!="boolean"?t.className:""};function Hf(e){"@babel/helpers - typeof";return Hf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hf(e)}var wse=["offset"];function jse(e){return Ose(e)||Nse(e)||_se(e)||Sse()}function Sse(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _se(e,t){if(e){if(typeof e=="string")return J_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J_(e,t)}}function Nse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ose(e){if(Array.isArray(e))return J_(e)}function J_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ese(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function $$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function An(e){for(var t=1;t=0?1:-1,C,A;a==="insideStart"?(C=x+O*l,A=b):a==="insideEnd"?(C=j-O*l,A=!b):a==="end"&&(C=j+O*l,A=b),A=N<=0?A:!A;var E=Ft(f,m,w,C),k=Ft(f,m,w,C+(A?1:-1)*359),T="M".concat(E.x,",").concat(E.y,` + A`).concat(w,",").concat(w,",0,1,").concat(A?0:1,`, + `).concat(k.x,",").concat(k.y),P=Ge(t.id)?Bu("recharts-radial-line-"):t.id;return W.createElement("text",Wf({},r,{dominantBaseline:"central",className:Ye("recharts-radial-bar-label",u)}),W.createElement("defs",null,W.createElement("path",{id:P,d:T})),W.createElement("textPath",{xlinkHref:"#".concat(P)},n))},Dse=function(t){var n=t.viewBox,r=t.offset,a=t.position,i=n,l=i.cx,u=i.cy,d=i.innerRadius,f=i.outerRadius,m=i.startAngle,p=i.endAngle,g=(m+p)/2;if(a==="outside"){var x=Ft(l,u,f+r,g),j=x.x,b=x.y;return{x:j,y:b,textAnchor:j>=l?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"end"};var w=(d+f)/2,N=Ft(l,u,w,g),O=N.x,C=N.y;return{x:O,y:C,textAnchor:"middle",verticalAnchor:"middle"}},$se=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,i=t.position,l=n,u=l.x,d=l.y,f=l.width,m=l.height,p=m>=0?1:-1,g=p*a,x=p>0?"end":"start",j=p>0?"start":"end",b=f>=0?1:-1,w=b*a,N=b>0?"end":"start",O=b>0?"start":"end";if(i==="top"){var C={x:u+f/2,y:d-p*a,textAnchor:"middle",verticalAnchor:x};return An(An({},C),r?{height:Math.max(d-r.y,0),width:f}:{})}if(i==="bottom"){var A={x:u+f/2,y:d+m+g,textAnchor:"middle",verticalAnchor:j};return An(An({},A),r?{height:Math.max(r.y+r.height-(d+m),0),width:f}:{})}if(i==="left"){var E={x:u-w,y:d+m/2,textAnchor:N,verticalAnchor:"middle"};return An(An({},E),r?{width:Math.max(E.x-r.x,0),height:m}:{})}if(i==="right"){var k={x:u+f+w,y:d+m/2,textAnchor:O,verticalAnchor:"middle"};return An(An({},k),r?{width:Math.max(r.x+r.width-k.x,0),height:m}:{})}var T=r?{width:f,height:m}:{};return i==="insideLeft"?An({x:u+w,y:d+m/2,textAnchor:O,verticalAnchor:"middle"},T):i==="insideRight"?An({x:u+f-w,y:d+m/2,textAnchor:N,verticalAnchor:"middle"},T):i==="insideTop"?An({x:u+f/2,y:d+g,textAnchor:"middle",verticalAnchor:j},T):i==="insideBottom"?An({x:u+f/2,y:d+m-g,textAnchor:"middle",verticalAnchor:x},T):i==="insideTopLeft"?An({x:u+w,y:d+g,textAnchor:O,verticalAnchor:j},T):i==="insideTopRight"?An({x:u+f-w,y:d+g,textAnchor:N,verticalAnchor:j},T):i==="insideBottomLeft"?An({x:u+w,y:d+m-g,textAnchor:O,verticalAnchor:x},T):i==="insideBottomRight"?An({x:u+f-w,y:d+m-g,textAnchor:N,verticalAnchor:x},T):Lu(i)&&(Oe(i.x)||Us(i.x))&&(Oe(i.y)||Us(i.y))?An({x:u+br(i.x,f),y:d+br(i.y,m),textAnchor:"end",verticalAnchor:"end"},T):An({x:u+f/2,y:d+m/2,textAnchor:"middle",verticalAnchor:"middle"},T)},Ise=function(t){return"cx"in t&&Oe(t.cx)};function zn(e){var t=e.offset,n=t===void 0?5:t,r=Cse(e,wse),a=An({offset:n},r),i=a.viewBox,l=a.position,u=a.value,d=a.children,f=a.content,m=a.className,p=m===void 0?"":m,g=a.textBreakAll;if(!i||Ge(u)&&Ge(d)&&!y.isValidElement(f)&&!We(f))return null;if(y.isValidElement(f))return y.cloneElement(f,a);var x;if(We(f)){if(x=y.createElement(f,a),y.isValidElement(x))return x}else x=Pse(a);var j=Ise(i),b=Be(a,!0);if(j&&(l==="insideStart"||l==="insideEnd"||l==="end"))return Rse(a,x,b);var w=j?Dse(a):$se(a);return W.createElement(cl,Wf({className:Ye("recharts-label",p)},b,w,{breakAll:g}),x)}zn.displayName="Label";var P6=function(t){var n=t.cx,r=t.cy,a=t.angle,i=t.startAngle,l=t.endAngle,u=t.r,d=t.radius,f=t.innerRadius,m=t.outerRadius,p=t.x,g=t.y,x=t.top,j=t.left,b=t.width,w=t.height,N=t.clockWise,O=t.labelViewBox;if(O)return O;if(Oe(b)&&Oe(w)){if(Oe(p)&&Oe(g))return{x:p,y:g,width:b,height:w};if(Oe(x)&&Oe(j))return{x,y:j,width:b,height:w}}return Oe(p)&&Oe(g)?{x:p,y:g,width:0,height:0}:Oe(n)&&Oe(r)?{cx:n,cy:r,startAngle:i||a||0,endAngle:l||a||0,innerRadius:f||0,outerRadius:m||d||u||0,clockWise:N}:t.viewBox?t.viewBox:{}},Lse=function(t,n){return t?t===!0?W.createElement(zn,{key:"label-implicit",viewBox:n}):kn(t)?W.createElement(zn,{key:"label-implicit",viewBox:n,value:t}):y.isValidElement(t)?t.type===zn?y.cloneElement(t,{key:"label-implicit",viewBox:n}):W.createElement(zn,{key:"label-implicit",content:t,viewBox:n}):We(t)?W.createElement(zn,{key:"label-implicit",content:t,viewBox:n}):Lu(t)?W.createElement(zn,Wf({viewBox:n},t,{key:"label-implicit"})):null:null},Bse=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var a=t.children,i=P6(t),l=ta(a,zn).map(function(d,f){return y.cloneElement(d,{viewBox:n||i,key:"label-".concat(f)})});if(!r)return l;var u=Lse(t.label,n||i);return[u].concat(jse(l))};zn.parseViewBox=P6;zn.renderCallByParent=Bse;var uS,I$;function zse(){if(I$)return uS;I$=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return uS=e,uS}var qse=zse();const Fse=St(qse);function Vf(e){"@babel/helpers - typeof";return Vf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vf(e)}var Use=["valueAccessor"],Hse=["data","dataKey","clockWise","id","textBreakAll"];function Wse(e){return Kse(e)||Yse(e)||Gse(e)||Vse()}function Vse(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gse(e,t){if(e){if(typeof e=="string")return eN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eN(e,t)}}function Yse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Kse(e){if(Array.isArray(e))return eN(e)}function eN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Jse(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var ele=function(t){return Array.isArray(t.value)?Fse(t.value):t.value};function Ji(e){var t=e.valueAccessor,n=t===void 0?ele:t,r=z$(e,Use),a=r.data,i=r.dataKey,l=r.clockWise,u=r.id,d=r.textBreakAll,f=z$(r,Hse);return!a||!a.length?null:W.createElement(pt,{className:"recharts-label-list"},a.map(function(m,p){var g=Ge(i)?n(m,p):Tn(m&&m.payload,i),x=Ge(u)?{}:{id:"".concat(u,"-").concat(p)};return W.createElement(zn,Gv({},Be(m,!0),f,x,{parentViewBox:m.parentViewBox,value:g,textBreakAll:d,viewBox:zn.parseViewBox(Ge(l)?m:B$(B$({},m),{},{clockWise:l})),key:"label-".concat(p),index:p}))}))}Ji.displayName="LabelList";function tle(e,t){return e?e===!0?W.createElement(Ji,{key:"labelList-implicit",data:t}):W.isValidElement(e)||We(e)?W.createElement(Ji,{key:"labelList-implicit",data:t,content:e}):Lu(e)?W.createElement(Ji,Gv({data:t},e,{key:"labelList-implicit"})):null:null}function nle(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,a=ta(r,Ji).map(function(l,u){return y.cloneElement(l,{data:t,key:"labelList-".concat(u)})});if(!n)return a;var i=tle(e.label,t);return[i].concat(Wse(a))}Ji.renderCallByParent=nle;function Gf(e){"@babel/helpers - typeof";return Gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gf(e)}function tN(){return tN=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(l>f),`, + `).concat(p.x,",").concat(p.y,` + `);if(a>0){var x=Ft(n,r,a,l),j=Ft(n,r,a,f);g+="L ".concat(j.x,",").concat(j.y,` + A `).concat(a,",").concat(a,`,0, + `).concat(+(Math.abs(d)>180),",").concat(+(l<=f),`, + `).concat(x.x,",").concat(x.y," Z")}else g+="L ".concat(n,",").concat(r," Z");return g},sle=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,l=t.cornerRadius,u=t.forceCornerRadius,d=t.cornerIsExternal,f=t.startAngle,m=t.endAngle,p=xr(m-f),g=Rp({cx:n,cy:r,radius:i,angle:f,sign:p,cornerRadius:l,cornerIsExternal:d}),x=g.circleTangency,j=g.lineTangency,b=g.theta,w=Rp({cx:n,cy:r,radius:i,angle:m,sign:-p,cornerRadius:l,cornerIsExternal:d}),N=w.circleTangency,O=w.lineTangency,C=w.theta,A=d?Math.abs(f-m):Math.abs(f-m)-b-C;if(A<0)return u?"M ".concat(j.x,",").concat(j.y,` + a`).concat(l,",").concat(l,",0,0,1,").concat(l*2,`,0 + a`).concat(l,",").concat(l,",0,0,1,").concat(-l*2,`,0 + `):M6({cx:n,cy:r,innerRadius:a,outerRadius:i,startAngle:f,endAngle:m});var E="M ".concat(j.x,",").concat(j.y,` + A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(x.x,",").concat(x.y,` + A`).concat(i,",").concat(i,",0,").concat(+(A>180),",").concat(+(p<0),",").concat(N.x,",").concat(N.y,` + A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(O.x,",").concat(O.y,` + `);if(a>0){var k=Rp({cx:n,cy:r,radius:a,angle:f,sign:p,isExternal:!0,cornerRadius:l,cornerIsExternal:d}),T=k.circleTangency,P=k.lineTangency,$=k.theta,z=Rp({cx:n,cy:r,radius:a,angle:m,sign:-p,isExternal:!0,cornerRadius:l,cornerIsExternal:d}),D=z.circleTangency,U=z.lineTangency,V=z.theta,H=d?Math.abs(f-m):Math.abs(f-m)-$-V;if(H<0&&l===0)return"".concat(E,"L").concat(n,",").concat(r,"Z");E+="L".concat(U.x,",").concat(U.y,` + A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(D.x,",").concat(D.y,` + A`).concat(a,",").concat(a,",0,").concat(+(H>180),",").concat(+(p>0),",").concat(T.x,",").concat(T.y,` + A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(P.x,",").concat(P.y,"Z")}else E+="L".concat(n,",").concat(r,"Z");return E},lle={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},R6=function(t){var n=F$(F$({},lle),t),r=n.cx,a=n.cy,i=n.innerRadius,l=n.outerRadius,u=n.cornerRadius,d=n.forceCornerRadius,f=n.cornerIsExternal,m=n.startAngle,p=n.endAngle,g=n.className;if(l0&&Math.abs(m-p)<360?w=sle({cx:r,cy:a,innerRadius:i,outerRadius:l,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:m,endAngle:p}):w=M6({cx:r,cy:a,innerRadius:i,outerRadius:l,startAngle:m,endAngle:p}),W.createElement("path",tN({},Be(n,!0),{className:x,d:w,role:"img"}))};function Yf(e){"@babel/helpers - typeof";return Yf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yf(e)}function nN(){return nN=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Cle(e,t){return jl(e.getTime(),t.getTime())}function Ele(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Ale(e,t){return e===t}function J$(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var a=new Array(r),i=e.entries(),l,u,d=0;(l=i.next())&&!l.done;){for(var f=t.entries(),m=!1,p=0;(u=f.next())&&!u.done;){if(a[p]){p++;continue}var g=l.value,x=u.value;if(n.equals(g[0],x[0],d,p,e,t,n)&&n.equals(g[1],x[1],g[0],x[0],e,t,n)){m=a[p]=!0;break}p++}if(!m)return!1;d++}return!0}var Tle=jl;function kle(e,t,n){var r=Q$(e),a=r.length;if(Q$(t).length!==a)return!1;for(;a-- >0;)if(!D6(e,t,n,r[a]))return!1;return!0}function tf(e,t,n){var r=X$(e),a=r.length;if(X$(t).length!==a)return!1;for(var i,l,u;a-- >0;)if(i=r[a],!D6(e,t,n,i)||(l=Z$(e,i),u=Z$(t,i),(l||u)&&(!l||!u||l.configurable!==u.configurable||l.enumerable!==u.enumerable||l.writable!==u.writable)))return!1;return!0}function Ple(e,t){return jl(e.valueOf(),t.valueOf())}function Mle(e,t){return e.source===t.source&&e.flags===t.flags}function eI(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var a=new Array(r),i=e.values(),l,u;(l=i.next())&&!l.done;){for(var d=t.values(),f=!1,m=0;(u=d.next())&&!u.done;){if(!a[m]&&n.equals(l.value,u.value,l.value,u.value,e,t,n)){f=a[m]=!0;break}m++}if(!f)return!1}return!0}function Rle(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Dle(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function D6(e,t,n,r){return(r===Nle||r===_le||r===Sle)&&(e.$$typeof||t.$$typeof)?!0:jle(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var $le="[object Arguments]",Ile="[object Boolean]",Lle="[object Date]",Ble="[object Error]",zle="[object Map]",qle="[object Number]",Fle="[object Object]",Ule="[object RegExp]",Hle="[object Set]",Wle="[object String]",Vle="[object URL]",Gle=Array.isArray,tI=typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView:null,nI=Object.assign,Yle=Object.prototype.toString.call.bind(Object.prototype.toString);function Kle(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,a=e.areFunctionsEqual,i=e.areMapsEqual,l=e.areNumbersEqual,u=e.areObjectsEqual,d=e.arePrimitiveWrappersEqual,f=e.areRegExpsEqual,m=e.areSetsEqual,p=e.areTypedArraysEqual,g=e.areUrlsEqual,x=e.unknownTagComparators;return function(b,w,N){if(b===w)return!0;if(b==null||w==null)return!1;var O=typeof b;if(O!==typeof w)return!1;if(O!=="object")return O==="number"?l(b,w,N):O==="function"?a(b,w,N):!1;var C=b.constructor;if(C!==w.constructor)return!1;if(C===Object)return u(b,w,N);if(Gle(b))return t(b,w,N);if(tI!=null&&tI(b))return p(b,w,N);if(C===Date)return n(b,w,N);if(C===RegExp)return f(b,w,N);if(C===Map)return i(b,w,N);if(C===Set)return m(b,w,N);var A=Yle(b);if(A===Lle)return n(b,w,N);if(A===Ule)return f(b,w,N);if(A===zle)return i(b,w,N);if(A===Hle)return m(b,w,N);if(A===Fle)return typeof b.then!="function"&&typeof w.then!="function"&&u(b,w,N);if(A===Vle)return g(b,w,N);if(A===Ble)return r(b,w,N);if(A===$le)return u(b,w,N);if(A===Ile||A===qle||A===Wle)return d(b,w,N);if(x){var E=x[A];if(!E){var k=wle(b);k&&(E=x[k])}if(E)return E(b,w,N)}return!1}}function Xle(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,a={areArraysEqual:r?tf:Ole,areDatesEqual:Cle,areErrorsEqual:Ele,areFunctionsEqual:Ale,areMapsEqual:r?K$(J$,tf):J$,areNumbersEqual:Tle,areObjectsEqual:r?tf:kle,arePrimitiveWrappersEqual:Ple,areRegExpsEqual:Mle,areSetsEqual:r?K$(eI,tf):eI,areTypedArraysEqual:r?tf:Rle,areUrlsEqual:Dle,unknownTagComparators:void 0};if(n&&(a=nI({},a,n(a))),t){var i=$p(a.areArraysEqual),l=$p(a.areMapsEqual),u=$p(a.areObjectsEqual),d=$p(a.areSetsEqual);a=nI({},a,{areArraysEqual:i,areMapsEqual:l,areObjectsEqual:u,areSetsEqual:d})}return a}function Zle(e){return function(t,n,r,a,i,l,u){return e(t,n,u)}}function Qle(e){var t=e.circular,n=e.comparator,r=e.createState,a=e.equals,i=e.strict;if(r)return function(d,f){var m=r(),p=m.cache,g=p===void 0?t?new WeakMap:void 0:p,x=m.meta;return n(d,f,{cache:g,equals:a,meta:x,strict:i})};if(t)return function(d,f){return n(d,f,{cache:new WeakMap,equals:a,meta:void 0,strict:i})};var l={cache:void 0,equals:a,meta:void 0,strict:i};return function(d,f){return n(d,f,l)}}var Jle=os();os({strict:!0});os({circular:!0});os({circular:!0,strict:!0});os({createInternalComparator:function(){return jl}});os({strict:!0,createInternalComparator:function(){return jl}});os({circular:!0,createInternalComparator:function(){return jl}});os({circular:!0,createInternalComparator:function(){return jl},strict:!0});function os(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,a=e.createState,i=e.strict,l=i===void 0?!1:i,u=Xle(e),d=Kle(u),f=r?r(d):Zle(d);return Qle({circular:n,comparator:d,createState:a,equals:f,strict:l})}function ece(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function rI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(i){n<0&&(n=i),i-n>t?(e(i),n=-1):ece(a)};requestAnimationFrame(r)}function rN(e){"@babel/helpers - typeof";return rN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rN(e)}function tce(e){return ice(e)||ace(e)||rce(e)||nce()}function nce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rce(e,t){if(e){if(typeof e=="string")return aI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aI(e,t)}}function aI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?1:N<0?0:N},b=function(N){for(var O=N>1?1:N,C=O,A=0;A<8;++A){var E=p(C)-O,k=x(C);if(Math.abs(E-O)0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,i=a===void 0?8:a,l=t.dt,u=l===void 0?17:l,d=function(m,p,g){var x=-(m-p)*r,j=g*i,b=g+(x-j)*u/1e3,w=g*u/1e3+m;return Math.abs(w-p)e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $ce(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i=0)&&(n[a]=e[a]);return n}function mS(e){return zce(e)||Bce(e)||Lce(e)||Ice()}function Ice(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lce(e,t){if(e){if(typeof e=="string")return lN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lN(e,t)}}function Bce(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zce(e){if(Array.isArray(e))return lN(e)}function lN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Zv(e){return Zv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Zv(e)}var pi=(function(e){Wce(n,e);var t=Vce(n);function n(r,a){var i;qce(this,n),i=t.call(this,r,a);var l=i.props,u=l.isActive,d=l.attributeName,f=l.from,m=l.to,p=l.steps,g=l.children,x=l.duration;if(i.handleStyleChange=i.handleStyleChange.bind(dN(i)),i.changeStyle=i.changeStyle.bind(dN(i)),!u||x<=0)return i.state={style:{}},typeof g=="function"&&(i.state={style:m}),uN(i);if(p&&p.length)i.state={style:p[0].style};else if(f){if(typeof g=="function")return i.state={style:f},uN(i);i.state={style:d?cf({},d,f):f}}else i.state={style:{}};return i}return Uce(n,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,l=a.canBegin;this.mounted=!0,!(!i||!l)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,l=i.isActive,u=i.canBegin,d=i.attributeName,f=i.shouldReAnimate,m=i.to,p=i.from,g=this.state.style;if(u){if(!l){var x={style:d?cf({},d,m):m};this.state&&g&&(d&&g[d]!==m||!d&&g!==m)&&this.setState(x);return}if(!(Jle(a.to,m)&&a.canBegin&&a.isActive)){var j=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var b=j||f?p:a.to;if(this.state&&g){var w={style:d?cf({},d,b):b};(d&&g[d]!==b||!d&&g!==b)&&this.setState(w)}this.runAnimation(Pa(Pa({},this.props),{},{from:b,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,l=a.from,u=a.to,d=a.duration,f=a.easing,m=a.begin,p=a.onAnimationEnd,g=a.onAnimationStart,x=Mce(l,u,jce(f),d,this.changeStyle),j=function(){i.stopJSAnimation=x()};this.manager.start([g,m,j,d,p])}},{key:"runStepAnimation",value:function(a){var i=this,l=a.steps,u=a.begin,d=a.onAnimationStart,f=l[0],m=f.style,p=f.duration,g=p===void 0?0:p,x=function(b,w,N){if(N===0)return b;var O=w.duration,C=w.easing,A=C===void 0?"ease":C,E=w.style,k=w.properties,T=w.onAnimationEnd,P=N>0?l[N-1]:w,$=k||Object.keys(E);if(typeof A=="function"||A==="spring")return[].concat(mS(b),[i.runJSAnimation.bind(i,{from:P.style,to:E,duration:O,easing:A}),O]);var z=sI($,O,A),D=Pa(Pa(Pa({},P.style),E),{},{transition:z});return[].concat(mS(b),[D,O,T]).filter(uce)};return this.manager.start([d].concat(mS(l.reduce(x,[m,Math.max(g,u)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=oce());var i=a.begin,l=a.duration,u=a.attributeName,d=a.to,f=a.easing,m=a.onAnimationStart,p=a.onAnimationEnd,g=a.steps,x=a.children,j=this.manager;if(this.unSubscribe=j.subscribe(this.handleStyleChange),typeof f=="function"||typeof x=="function"||f==="spring"){this.runJSAnimation(a);return}if(g.length>1){this.runStepAnimation(a);return}var b=u?cf({},u,d):d,w=sI(Object.keys(b),l,f);j.start([m,i,Pa(Pa({},b),{},{transition:w}),l,p])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var l=a.duration;a.attributeName,a.easing;var u=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var d=Dce(a,Rce),f=y.Children.count(i),m=this.state.style;if(typeof i=="function")return i(m);if(!u||f===0||l<=0)return i;var p=function(x){var j=x.props,b=j.style,w=b===void 0?{}:b,N=j.className,O=y.cloneElement(x,Pa(Pa({},d),{},{style:Pa(Pa({},w),m),className:N}));return O};return f===1?p(y.Children.only(i)):W.createElement("div",null,y.Children.map(i,function(g){return p(g)}))}}]),n})(y.PureComponent);pi.displayName="Animate";pi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};pi.propTypes={from:bt.oneOfType([bt.object,bt.string]),to:bt.oneOfType([bt.object,bt.string]),attributeName:bt.string,duration:bt.number,begin:bt.number,easing:bt.oneOfType([bt.string,bt.func]),steps:bt.arrayOf(bt.shape({duration:bt.number.isRequired,style:bt.object.isRequired,easing:bt.oneOfType([bt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),bt.func]),properties:bt.arrayOf("string"),onAnimationEnd:bt.func})),children:bt.oneOfType([bt.node,bt.func]),isActive:bt.bool,canBegin:bt.bool,onAnimationEnd:bt.func,shouldReAnimate:bt.bool,onAnimationStart:bt.func,onAnimationReStart:bt.func};function Zf(e){"@babel/helpers - typeof";return Zf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zf(e)}function Qv(){return Qv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?1:-1,d=r>=0?1:-1,f=a>=0&&r>=0||a<0&&r<0?1:0,m;if(l>0&&i instanceof Array){for(var p=[0,0,0,0],g=0,x=4;gl?l:i[g];m="M".concat(t,",").concat(n+u*p[0]),p[0]>0&&(m+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(f,",").concat(t+d*p[0],",").concat(n)),m+="L ".concat(t+r-d*p[1],",").concat(n),p[1]>0&&(m+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(f,`, + `).concat(t+r,",").concat(n+u*p[1])),m+="L ".concat(t+r,",").concat(n+a-u*p[2]),p[2]>0&&(m+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(f,`, + `).concat(t+r-d*p[2],",").concat(n+a)),m+="L ".concat(t+d*p[3],",").concat(n+a),p[3]>0&&(m+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(f,`, + `).concat(t,",").concat(n+a-u*p[3])),m+="Z"}else if(l>0&&i===+i&&i>0){var j=Math.min(l,i);m="M ".concat(t,",").concat(n+u*j,` + A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+d*j,",").concat(n,` + L `).concat(t+r-d*j,",").concat(n,` + A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r,",").concat(n+u*j,` + L `).concat(t+r,",").concat(n+a-u*j,` + A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r-d*j,",").concat(n+a,` + L `).concat(t+d*j,",").concat(n+a,` + A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t,",").concat(n+a-u*j," Z")}else m="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return m},nue=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,i=n.x,l=n.y,u=n.width,d=n.height;if(Math.abs(u)>0&&Math.abs(d)>0){var f=Math.min(i,i+u),m=Math.max(i,i+u),p=Math.min(l,l+d),g=Math.max(l,l+d);return r>=f&&r<=m&&a>=p&&a<=g}return!1},rue={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},PC=function(t){var n=pI(pI({},rue),t),r=y.useRef(),a=y.useState(-1),i=Yce(a,2),l=i[0],u=i[1];y.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var A=r.current.getTotalLength();A&&u(A)}catch{}},[]);var d=n.x,f=n.y,m=n.width,p=n.height,g=n.radius,x=n.className,j=n.animationEasing,b=n.animationDuration,w=n.animationBegin,N=n.isAnimationActive,O=n.isUpdateAnimationActive;if(d!==+d||f!==+f||m!==+m||p!==+p||m===0||p===0)return null;var C=Ye("recharts-rectangle",x);return O?W.createElement(pi,{canBegin:l>0,from:{width:m,height:p,x:d,y:f},to:{width:m,height:p,x:d,y:f},duration:b,animationEasing:j,isActive:O},function(A){var E=A.width,k=A.height,T=A.x,P=A.y;return W.createElement(pi,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:b,isActive:N,easing:j},W.createElement("path",Qv({},Be(n,!0),{className:C,d:vI(T,P,E,k,g),ref:r})))}):W.createElement("path",Qv({},Be(n,!0),{className:C,d:vI(d,f,m,p,g)}))},aue=["points","className","baseLinePoints","connectNulls"];function $c(){return $c=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function oue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function gI(e){return uue(e)||cue(e)||lue(e)||sue()}function sue(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lue(e,t){if(e){if(typeof e=="string")return fN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fN(e,t)}}function cue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uue(e){if(Array.isArray(e))return fN(e)}function fN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){yI(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),yI(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},jf=function(t,n){var r=due(t);n&&(r=[r.reduce(function(i,l){return[].concat(gI(i),gI(l))},[])]);var a=r.map(function(i){return i.reduce(function(l,u,d){return"".concat(l).concat(d===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},fue=function(t,n,r){var a=jf(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(jf(n.reverse(),r).slice(1))},hue=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,l=iue(t,aue);if(!n||!n.length)return null;var u=Ye("recharts-polygon",r);if(a&&a.length){var d=l.stroke&&l.stroke!=="none",f=fue(n,a,i);return W.createElement("g",{className:u},W.createElement("path",$c({},Be(l,!0),{fill:f.slice(-1)==="Z"?l.fill:"none",stroke:"none",d:f})),d?W.createElement("path",$c({},Be(l,!0),{fill:"none",d:jf(n,i)})):null,d?W.createElement("path",$c({},Be(l,!0),{fill:"none",d:jf(a,i)})):null)}var m=jf(n,i);return W.createElement("path",$c({},Be(l,!0),{fill:m.slice(-1)==="Z"?l.fill:"none",className:u,d:m}))};function hN(){return hN=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var wue=function(t,n,r,a,i,l){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(l,",").concat(n,"h").concat(r)},jue=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,l=t.top,u=l===void 0?0:l,d=t.left,f=d===void 0?0:d,m=t.width,p=m===void 0?0:m,g=t.height,x=g===void 0?0:g,j=t.className,b=xue(t,mue),w=pue({x:r,y:i,top:u,left:f,width:p,height:x},b);return!Oe(r)||!Oe(i)||!Oe(p)||!Oe(x)||!Oe(u)||!Oe(f)?null:W.createElement("path",mN({},Be(w,!0),{className:Ye("recharts-cross",j),d:wue(r,i,p,x,u,f)}))},pS,bI;function Sue(){if(bI)return pS;bI=1;var e=uy(),t=n6(),n=xi();function r(a,i){return a&&a.length?e(a,n(i,2),t):void 0}return pS=r,pS}var _ue=Sue();const Nue=St(_ue);var vS,wI;function Oue(){if(wI)return vS;wI=1;var e=uy(),t=xi(),n=r6();function r(a,i){return a&&a.length?e(a,t(i,2),n):void 0}return vS=r,vS}var Cue=Oue();const Eue=St(Cue);var Aue=["cx","cy","angle","ticks","axisLine"],Tue=["ticks","tick","angle","tickFormatter","stroke"];function du(e){"@babel/helpers - typeof";return du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},du(e)}function Sf(){return Sf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function kue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Pue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _I(e,t){for(var n=0;nCI?l=a==="outer"?"start":"end":i<-CI?l=a==="outer"?"end":"start":l="middle",l}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,l=r.radius,u=r.axisLine,d=r.axisLineType,f=Is(Is({},Be(this.props,!1)),{},{fill:"none"},Be(u,!1));if(d==="circle")return W.createElement(py,qs({className:"recharts-polar-angle-axis-line"},f,{cx:a,cy:i,r:l}));var m=this.props.ticks,p=m.map(function(g){return Ft(a,i,l,g.coordinate)});return W.createElement(hue,qs({className:"recharts-polar-angle-axis-line"},f,{points:p}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,l=a.tick,u=a.tickLine,d=a.tickFormatter,f=a.stroke,m=Be(this.props,!1),p=Be(l,!1),g=Is(Is({},m),{},{fill:"none"},Be(u,!1)),x=i.map(function(j,b){var w=r.getTickLineCoord(j),N=r.getTickTextAnchor(j),O=Is(Is(Is({textAnchor:N},m),{},{stroke:"none",fill:f},p),{},{index:b,payload:j,x:w.x2,y:w.y2});return W.createElement(pt,qs({className:Ye("recharts-polar-angle-axis-tick",k6(l)),key:"tick-".concat(j.coordinate)},ll(r.props,j,b)),u&&W.createElement("line",qs({className:"recharts-polar-angle-axis-tick-line"},g,w)),l&&t.renderTickItem(l,O,d?d(j.value,b):j.value))});return W.createElement(pt,{className:"recharts-polar-angle-axis-ticks"},x)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.radius,l=r.axisLine;return i<=0||!a||!a.length?null:W.createElement(pt,{className:Ye("recharts-polar-angle-axis",this.props.className)},l&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var l;return W.isValidElement(r)?l=W.cloneElement(r,a):We(r)?l=r(a):l=W.createElement(cl,qs({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),l}}])})(y.PureComponent);yy(xy,"displayName","PolarAngleAxis");yy(xy,"axisType","angleAxis");yy(xy,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var gS,EI;function Gue(){if(EI)return gS;EI=1;var e=tz(),t=e(Object.getPrototypeOf,Object);return gS=t,gS}var yS,AI;function Yue(){if(AI)return yS;AI=1;var e=so(),t=Gue(),n=lo(),r="[object Object]",a=Function.prototype,i=Object.prototype,l=a.toString,u=i.hasOwnProperty,d=l.call(Object);function f(m){if(!n(m)||e(m)!=r)return!1;var p=t(m);if(p===null)return!0;var g=u.call(p,"constructor")&&p.constructor;return typeof g=="function"&&g instanceof g&&l.call(g)==d}return yS=f,yS}var Kue=Yue();const Xue=St(Kue);var xS,TI;function Zue(){if(TI)return xS;TI=1;var e=so(),t=lo(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return xS=r,xS}var Que=Zue();const Jue=St(Que);function Jf(e){"@babel/helpers - typeof";return Jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jf(e)}function tg(){return tg=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:g,x:d,y:f},to:{upperWidth:m,lowerWidth:p,height:g,x:d,y:f},duration:b,animationEasing:j,isActive:N},function(C){var A=C.upperWidth,E=C.lowerWidth,k=C.height,T=C.x,P=C.y;return W.createElement(pi,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:b,easing:j},W.createElement("path",tg({},Be(n,!0),{className:O,d:RI(T,P,A,E,k),ref:r})))}):W.createElement("g",null,W.createElement("path",tg({},Be(n,!0),{className:O,d:RI(d,f,m,p,g)})))},ude=["option","shapeType","propTransformer","activeClassName","isActive"];function eh(e){"@babel/helpers - typeof";return eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eh(e)}function dde(e,t){if(e==null)return{};var n=fde(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fde(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function DI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ng(e){for(var t=1;t0?ea(C,"paddingAngle",0):0;if(E){var T=Zr(E.endAngle-E.startAngle,C.endAngle-C.startAngle),P=Bt(Bt({},C),{},{startAngle:O+k,endAngle:O+T(b)+k});w.push(P),O=P.endAngle}else{var $=C.endAngle,z=C.startAngle,D=Zr(0,$-z),U=D(b),V=Bt(Bt({},C),{},{startAngle:O+k,endAngle:O+U+k});w.push(V),O=V.endAngle}}),W.createElement(pt,null,r.renderSectorsStatically(w))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var l=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[l].focus(),a.setState({sectorToFocus:l});break}case"ArrowRight":{var u=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[u].focus(),a.setState({sectorToFocus:u});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,i=r.isAnimationActive,l=this.state.prevSectors;return i&&a&&a.length&&(!l||!Mh(l,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,a=this.props,i=a.hide,l=a.sectors,u=a.className,d=a.label,f=a.cx,m=a.cy,p=a.innerRadius,g=a.outerRadius,x=a.isAnimationActive,j=this.state.isAnimationFinished;if(i||!l||!l.length||!Oe(f)||!Oe(m)||!Oe(p)||!Oe(g))return null;var b=Ye("recharts-pie",u);return W.createElement(pt,{tabIndex:this.props.rootTabIndex,className:b,ref:function(N){r.pieRef=N}},this.renderSectors(),d&&this.renderLabels(l),zn.renderCallByParent(this.props,null,!1),(!x||j)&&Ji.renderCallByParent(this.props,l,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return a.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:r.sectors!==a.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,a){return r>a?"start":r=360?O:O-1)*d,A=w-O*x-C,E=a.reduce(function(P,$){var z=Tn($,N,0);return P+(Oe(z)?z:0)},0),k;if(E>0){var T;k=a.map(function(P,$){var z=Tn(P,N,0),D=Tn(P,m,$),U=(Oe(z)?z:0)/E,V;$?V=T.endAngle+xr(b)*d*(z!==0?1:0):V=l;var H=V+xr(b)*((z!==0?x:0)+U*A),G=(V+H)/2,L=(j.innerRadius+j.outerRadius)/2,R=[{name:D,value:z,payload:P,dataKey:N,type:g}],F=Ft(j.cx,j.cy,L,G);return T=Bt(Bt(Bt({percent:U,cornerRadius:i,name:D,tooltipPayload:R,midAngle:G,middleRadius:L,tooltipPosition:F},P),j),{},{value:Tn(P,N),startAngle:V,endAngle:H,payload:P,paddingAngle:xr(b)*d}),T})}return Bt(Bt({},j),{},{sectors:k,data:a})});var bS,BI;function Mde(){if(BI)return bS;BI=1;var e=Math.ceil,t=Math.max;function n(r,a,i,l){for(var u=-1,d=t(e((a-r)/(i||1)),0),f=Array(d);d--;)f[l?d:++u]=r,r+=i;return f}return bS=n,bS}var wS,zI;function K6(){if(zI)return wS;zI=1;var e=gz(),t=1/0,n=17976931348623157e292;function r(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var i=a<0?-1:1;return i*n}return a===a?a:0}return wS=r,wS}var jS,qI;function Rde(){if(qI)return jS;qI=1;var e=Mde(),t=ny(),n=K6();function r(a){return function(i,l,u){return u&&typeof u!="number"&&t(i,l,u)&&(l=u=void 0),i=n(i),l===void 0?(l=i,i=0):l=n(l),u=u===void 0?i0&&r.handleDrag(a.changedTouches[0])}),Gr(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,i=a.endIndex,l=a.onDragEnd,u=a.startIndex;l?.({endIndex:i,startIndex:u})}),r.detachDragEndListener()}),Gr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Gr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Gr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Gr(r,"handleSlideDragStart",function(a){var i=GI(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return Vde(t,e),Fde(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,i=r.endX,l=this.state.scaleValues,u=this.props,d=u.gap,f=u.data,m=f.length-1,p=Math.min(a,i),g=Math.max(a,i),x=t.getIndexInRange(l,p),j=t.getIndexInRange(l,g);return{startIndex:x-x%d,endIndex:j===m?m:j-j%d}}},{key:"getTextOfTick",value:function(r){var a=this.props,i=a.data,l=a.tickFormatter,u=a.dataKey,d=Tn(i[r],u,r);return We(l)?l(d,r):d}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,i=a.slideMoveStartX,l=a.startX,u=a.endX,d=this.props,f=d.x,m=d.width,p=d.travellerWidth,g=d.startIndex,x=d.endIndex,j=d.onChange,b=r.pageX-i;b>0?b=Math.min(b,f+m-p-u,f+m-p-l):b<0&&(b=Math.max(b,f-l,f-u));var w=this.getIndex({startX:l+b,endX:u+b});(w.startIndex!==g||w.endIndex!==x)&&j&&j(w),this.setState({startX:l+b,endX:u+b,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var i=GI(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,i=a.brushMoveStartX,l=a.movingTravellerId,u=a.endX,d=a.startX,f=this.state[l],m=this.props,p=m.x,g=m.width,x=m.travellerWidth,j=m.onChange,b=m.gap,w=m.data,N={startX:this.state.startX,endX:this.state.endX},O=r.pageX-i;O>0?O=Math.min(O,p+g-x-f):O<0&&(O=Math.max(O,p-f)),N[l]=f+O;var C=this.getIndex(N),A=C.startIndex,E=C.endIndex,k=function(){var P=w.length-1;return l==="startX"&&(u>d?A%b===0:E%b===0)||ud?E%b===0:A%b===0)||u>d&&E===P};this.setState(Gr(Gr({},l,f+O),"brushMoveStartX",r.pageX),function(){j&&k()&&j(C)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var i=this,l=this.state,u=l.scaleValues,d=l.startX,f=l.endX,m=this.state[a],p=u.indexOf(m);if(p!==-1){var g=p+r;if(!(g===-1||g>=u.length)){var x=u[g];a==="startX"&&x>=f||a==="endX"&&x<=d||this.setState(Gr({},a,x),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,i=r.y,l=r.width,u=r.height,d=r.fill,f=r.stroke;return W.createElement("rect",{stroke:f,fill:d,x:a,y:i,width:l,height:u})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,i=r.y,l=r.width,u=r.height,d=r.data,f=r.children,m=r.padding,p=y.Children.only(f);return p?W.cloneElement(p,{x:a,y:i,width:l,height:u,margin:m,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(r,a){var i,l,u=this,d=this.props,f=d.y,m=d.travellerWidth,p=d.height,g=d.traveller,x=d.ariaLabel,j=d.data,b=d.startIndex,w=d.endIndex,N=Math.max(r,this.props.x),O=_S(_S({},Be(this.props,!1)),{},{x:N,y:f,width:m,height:p}),C=x||"Min value: ".concat((i=j[b])===null||i===void 0?void 0:i.name,", Max value: ").concat((l=j[w])===null||l===void 0?void 0:l.name);return W.createElement(pt,{tabIndex:0,role:"slider","aria-label":C,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(E){["ArrowLeft","ArrowRight"].includes(E.key)&&(E.preventDefault(),E.stopPropagation(),u.handleTravellerMoveKeyboard(E.key==="ArrowRight"?1:-1,a))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(g,O))}},{key:"renderSlide",value:function(r,a){var i=this.props,l=i.y,u=i.height,d=i.stroke,f=i.travellerWidth,m=Math.min(r,a)+f,p=Math.max(Math.abs(a-r)-f,0);return W.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:d,fillOpacity:.2,x:m,y:l,width:p,height:u})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,i=r.endIndex,l=r.y,u=r.height,d=r.travellerWidth,f=r.stroke,m=this.state,p=m.startX,g=m.endX,x=5,j={pointerEvents:"none",fill:f};return W.createElement(pt,{className:"recharts-brush-texts"},W.createElement(cl,ig({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,g)-x,y:l+u/2},j),this.getTextOfTick(a)),W.createElement(cl,ig({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,g)+d+x,y:l+u/2},j),this.getTextOfTick(i)))}},{key:"render",value:function(){var r=this.props,a=r.data,i=r.className,l=r.children,u=r.x,d=r.y,f=r.width,m=r.height,p=r.alwaysShowText,g=this.state,x=g.startX,j=g.endX,b=g.isTextActive,w=g.isSlideMoving,N=g.isTravellerMoving,O=g.isTravellerFocused;if(!a||!a.length||!Oe(u)||!Oe(d)||!Oe(f)||!Oe(m)||f<=0||m<=0)return null;var C=Ye("recharts-brush",i),A=W.Children.count(l)===1,E=zde("userSelect","none");return W.createElement(pt,{className:C,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:E},this.renderBackground(),A&&this.renderPanorama(),this.renderSlide(x,j),this.renderTravellerLayer(x,"startX"),this.renderTravellerLayer(j,"endX"),(b||w||N||O||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,i=r.y,l=r.width,u=r.height,d=r.stroke,f=Math.floor(i+u/2)-1;return W.createElement(W.Fragment,null,W.createElement("rect",{x:a,y:i,width:l,height:u,fill:d,stroke:"none"}),W.createElement("line",{x1:a+1,y1:f,x2:a+l-1,y2:f,fill:"none",stroke:"#fff"}),W.createElement("line",{x1:a+1,y1:f+2,x2:a+l-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var i;return W.isValidElement(r)?i=W.cloneElement(r,a):We(r)?i=r(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(r,a){var i=r.data,l=r.width,u=r.x,d=r.travellerWidth,f=r.updateId,m=r.startIndex,p=r.endIndex;if(i!==a.prevData||f!==a.prevUpdateId)return _S({prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:u,prevWidth:l},i&&i.length?Yde({data:i,width:l,x:u,travellerWidth:d,startIndex:m,endIndex:p}):{scale:null,scaleValues:null});if(a.scale&&(l!==a.prevWidth||u!==a.prevX||d!==a.prevTravellerWidth)){a.scale.range([u,u+l-d]);var g=a.scale.domain().map(function(x){return a.scale(x)});return{prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:u,prevWidth:l,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:g}}return null}},{key:"getIndexInRange",value:function(r,a){for(var i=r.length,l=0,u=i-1;u-l>1;){var d=Math.floor((l+u)/2);r[d]>a?u=d:l=d}return a>=r[u]?u:l}}])})(y.PureComponent);Gr(pu,"displayName","Brush");Gr(pu,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var NS,YI;function Kde(){if(YI)return NS;YI=1;var e=aC();function t(n,r){var a;return e(n,function(i,l,u){return a=r(i,l,u),!a}),!!a}return NS=t,NS}var OS,KI;function Xde(){if(KI)return OS;KI=1;var e=YB(),t=xi(),n=Kde(),r=Ir(),a=ny();function i(l,u,d){var f=r(l)?e:n;return d&&a(l,u,d)&&(u=void 0),f(l,t(u,3))}return OS=i,OS}var Zde=Xde();const Qde=St(Zde);var di=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},CS,XI;function Jde(){if(XI)return CS;XI=1;var e=fz();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return CS=t,CS}var ES,ZI;function efe(){if(ZI)return ES;ZI=1;var e=Jde(),t=uz(),n=xi();function r(a,i){var l={};return i=n(i,3),t(a,function(u,d,f){e(l,d,i(u,d,f))}),l}return ES=r,ES}var tfe=efe();const nfe=St(tfe);var AS,QI;function rfe(){if(QI)return AS;QI=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ffe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function hfe(e,t){var n=e.x,r=e.y,a=dfe(e,sfe),i="".concat(n),l=parseInt(i,10),u="".concat(r),d=parseInt(u,10),f="".concat(t.height||a.height),m=parseInt(f,10),p="".concat(t.width||a.width),g=parseInt(p,10);return nf(nf(nf(nf(nf({},t),a),l?{x:l}:{}),d?{y:d}:{}),{},{height:m,width:g,name:t.name,radius:t.radius})}function n3(e){return W.createElement(V6,xN({shapeType:"rectangle",propTransformer:hfe,activeClassName:"recharts-active-bar"},e))}var mfe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var i=Oe(r)||IQ(r);return i?t(r,a):(i||cr(!1),n)}},pfe=["value","background"],eq;function vu(e){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vu(e)}function vfe(e,t){if(e==null)return{};var n=gfe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gfe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function sg(){return sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(G)0&&Math.abs(H)0&&(V=Math.min((ne||0)-(H[oe-1]||0),V))}),Number.isFinite(V)){var G=V/U,L=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(T=G*L/2),b.padding==="no-gap"){var R=br(t.barCategoryGap,G*L),F=G*L/2;T=F-R-(F-R)/L*R}}}a==="xAxis"?P=[r.left+(C.left||0)+(T||0),r.left+r.width-(C.right||0)-(T||0)]:a==="yAxis"?P=d==="horizontal"?[r.top+r.height-(C.bottom||0),r.top+(C.top||0)]:[r.top+(C.top||0)+(T||0),r.top+r.height-(C.bottom||0)-(T||0)]:P=b.range,E&&(P=[P[1],P[0]]);var K=_6(b,i,g),te=K.scale,I=K.realScaleType;te.domain(N).range(P),N6(te);var B=O6(te,$a($a({},b),{},{realScaleType:I}));a==="xAxis"?(D=w==="top"&&!A||w==="bottom"&&A,$=r.left,z=p[k]-D*b.height):a==="yAxis"&&(D=w==="left"&&!A||w==="right"&&A,$=p[k]-D*b.width,z=r.top);var Y=$a($a($a({},b),B),{},{realScaleType:I,x:$,y:z,scale:te,width:a==="xAxis"?r.width:b.width,height:a==="yAxis"?r.height:b.height});return Y.bandSize=Wv(Y,B),!b.hide&&a==="xAxis"?p[k]+=(D?-1:1)*Y.height:b.hide||(p[k]+=(D?-1:1)*Y.width),$a($a({},x),{},jy({},j,Y))},{})},iq=function(t,n){var r=t.x,a=t.y,i=n.x,l=n.y;return{x:Math.min(r,i),y:Math.min(a,l),width:Math.abs(i-r),height:Math.abs(l-a)}},Efe=function(t){var n=t.x1,r=t.y1,a=t.x2,i=t.y2;return iq({x:n,y:r},{x:a,y:i})},oq=(function(){function e(t){Nfe(this,e),this.scale=t}return Ofe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,i=r.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(n)+u}default:return this.scale(n)}if(a){var d=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+d}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],i=r[r.length-1];return a<=i?n>=a&&n<=i:n>=i&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])})();jy(oq,"EPS",1e-4);var MC=function(t){var n=Object.keys(t).reduce(function(r,a){return $a($a({},r),{},jy({},a,oq.create(t[a])))},{});return $a($a({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=i.bandAware,u=i.position;return nfe(a,function(d,f){return n[f].apply(d,{bandAware:l,position:u})})},isInRange:function(a){return J6(a,function(i,l){return n[l].isInRange(i)})}})};function Afe(e){return(e%180+180)%180}var Tfe=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Afe(a),l=i*Math.PI/180,u=Math.atan(r/n),d=l>u&&l-1?d[f?i[m]:m]:void 0}}return PS=r,PS}var MS,l3;function Pfe(){if(l3)return MS;l3=1;var e=K6();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return MS=t,MS}var RS,c3;function Mfe(){if(c3)return RS;c3=1;var e=iz(),t=xi(),n=Pfe(),r=Math.max;function a(i,l,u){var d=i==null?0:i.length;if(!d)return-1;var f=u==null?0:n(u);return f<0&&(f=r(d+f,0)),e(i,t(l,3),f)}return RS=a,RS}var DS,u3;function Rfe(){if(u3)return DS;u3=1;var e=kfe(),t=Mfe(),n=e(t);return DS=n,DS}var Dfe=Rfe();const $fe=St(Dfe);var Ife=wB();const Lfe=St(Ife);var Bfe=Lfe(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),RC=y.createContext(void 0),DC=y.createContext(void 0),sq=y.createContext(void 0),lq=y.createContext({}),cq=y.createContext(void 0),uq=y.createContext(0),dq=y.createContext(0),d3=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,i=n.offset,l=t.clipPathId,u=t.children,d=t.width,f=t.height,m=Bfe(i);return W.createElement(RC.Provider,{value:r},W.createElement(DC.Provider,{value:a},W.createElement(lq.Provider,{value:i},W.createElement(sq.Provider,{value:m},W.createElement(cq.Provider,{value:l},W.createElement(uq.Provider,{value:f},W.createElement(dq.Provider,{value:d},u)))))))},zfe=function(){return y.useContext(cq)},fq=function(t){var n=y.useContext(RC);n==null&&cr(!1);var r=n[t];return r==null&&cr(!1),r},qfe=function(){var t=y.useContext(RC);return qo(t)},Ffe=function(){var t=y.useContext(DC),n=$fe(t,function(r){return J6(r.domain,Number.isFinite)});return n||qo(t)},hq=function(t){var n=y.useContext(DC);n==null&&cr(!1);var r=n[t];return r==null&&cr(!1),r},Ufe=function(){var t=y.useContext(sq);return t},Hfe=function(){return y.useContext(lq)},$C=function(){return y.useContext(dq)},IC=function(){return y.useContext(uq)};function gu(e){"@babel/helpers - typeof";return gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gu(e)}function Wfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vfe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*a)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-a)<=0}function Che(e,t){return bq(e,t+1)}function Ehe(e,t,n,r,a){for(var i=(r||[]).slice(),l=t.start,u=t.end,d=0,f=1,m=l,p=function(){var j=r?.[d];if(j===void 0)return{v:bq(r,f)};var b=d,w,N=function(){return w===void 0&&(w=n(j,b)),w},O=j.coordinate,C=d===0||fg(e,O,N,m,u);C||(d=0,m=l,f+=1),C&&(m=O+e*(N()/2+a),d+=f)},g;f<=i.length;)if(g=p(),g)return g.v;return[]}function ih(e){"@babel/helpers - typeof";return ih=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ih(e)}function x3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ir(e){for(var t=1;t0?x.coordinate-w*e:x.coordinate})}else i[g]=x=ir(ir({},x),{},{tickCoord:x.coordinate});var N=fg(e,x.tickCoord,b,u,d);N&&(d=x.tickCoord-e*(b()/2+a),i[g]=ir(ir({},x),{},{isShow:!0}))},m=l-1;m>=0;m--)f(m);return i}function Mhe(e,t,n,r,a,i){var l=(r||[]).slice(),u=l.length,d=t.start,f=t.end;if(i){var m=r[u-1],p=n(m,u-1),g=e*(m.coordinate+e*p/2-f);l[u-1]=m=ir(ir({},m),{},{tickCoord:g>0?m.coordinate-g*e:m.coordinate});var x=fg(e,m.tickCoord,function(){return p},d,f);x&&(f=m.tickCoord-e*(p/2+a),l[u-1]=ir(ir({},m),{},{isShow:!0}))}for(var j=i?u-1:u,b=function(O){var C=l[O],A,E=function(){return A===void 0&&(A=n(C,O)),A};if(O===0){var k=e*(C.coordinate-e*E()/2-d);l[O]=C=ir(ir({},C),{},{tickCoord:k<0?C.coordinate-k*e:C.coordinate})}else l[O]=C=ir(ir({},C),{},{tickCoord:C.coordinate});var T=fg(e,C.tickCoord,E,d,f);T&&(d=C.tickCoord+e*(E()/2+a),l[O]=ir(ir({},C),{},{isShow:!0}))},w=0;w=2?xr(a[1].coordinate-a[0].coordinate):1,N=Ohe(i,w,x);return d==="equidistantPreserveStart"?Ehe(w,N,b,a,l):(d==="preserveStart"||d==="preserveStartEnd"?g=Mhe(w,N,b,a,l,d==="preserveStartEnd"):g=Phe(w,N,b,a,l),g.filter(function(O){return O.isShow}))}var Rhe=["viewBox"],Dhe=["viewBox"],$he=["ticks"];function bu(e){"@babel/helpers - typeof";return bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bu(e)}function Lc(){return Lc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ihe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Lhe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w3(e,t){for(var n=0;n0?d(this.props):d(x)),l<=0||u<=0||!j||!j.length?null:W.createElement(pt,{className:Ye("recharts-cartesian-axis",f),ref:function(w){r.layerReference=w}},i&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),zn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,i){var l,u=Ye(a.className,"recharts-cartesian-axis-tick-value");return W.isValidElement(r)?l=W.cloneElement(r,En(En({},a),{},{className:u})):We(r)?l=r(En(En({},a),{},{className:u})):l=W.createElement(cl,Lc({},a,{className:"recharts-cartesian-axis-tick-value"}),i),l}}])})(y.Component);qC(Hu,"displayName","CartesianAxis");qC(Hu,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Whe=["x1","y1","x2","y2","key"],Vhe=["offset"];function dl(e){"@babel/helpers - typeof";return dl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dl(e)}function j3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function sr(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Xhe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Zhe=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,a=t.x,i=t.y,l=t.width,u=t.height,d=t.ry;return W.createElement("rect",{x:a,y:i,ry:d,width:l,height:u,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Sq(e,t){var n;if(W.isValidElement(e))n=W.cloneElement(e,t);else if(We(e))n=e(t);else{var r=t.x1,a=t.y1,i=t.x2,l=t.y2,u=t.key,d=S3(t,Whe),f=Be(d,!1);f.offset;var m=S3(f,Vhe);n=W.createElement("line",Vs({},m,{x1:r,y1:a,x2:i,y2:l,fill:"none",key:u}))}return n}function Qhe(e){var t=e.x,n=e.width,r=e.horizontal,a=r===void 0?!0:r,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var l=i.map(function(u,d){var f=sr(sr({},e),{},{x1:t,y1:u,x2:t+n,y2:u,key:"line-".concat(d),index:d});return Sq(a,f)});return W.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function Jhe(e){var t=e.y,n=e.height,r=e.vertical,a=r===void 0?!0:r,i=e.verticalPoints;if(!a||!i||!i.length)return null;var l=i.map(function(u,d){var f=sr(sr({},e),{},{x1:u,y1:t,x2:u,y2:t+n,key:"line-".concat(d),index:d});return Sq(a,f)});return W.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function eme(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,a=e.y,i=e.width,l=e.height,u=e.horizontalPoints,d=e.horizontal,f=d===void 0?!0:d;if(!f||!t||!t.length)return null;var m=u.map(function(g){return Math.round(g+a-a)}).sort(function(g,x){return g-x});a!==m[0]&&m.unshift(0);var p=m.map(function(g,x){var j=!m[x+1],b=j?a+l-g:m[x+1]-g;if(b<=0)return null;var w=x%t.length;return W.createElement("rect",{key:"react-".concat(x),y:g,x:r,height:b,width:i,stroke:"none",fill:t[w],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return W.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function tme(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,a=e.fillOpacity,i=e.x,l=e.y,u=e.width,d=e.height,f=e.verticalPoints;if(!n||!r||!r.length)return null;var m=f.map(function(g){return Math.round(g+i-i)}).sort(function(g,x){return g-x});i!==m[0]&&m.unshift(0);var p=m.map(function(g,x){var j=!m[x+1],b=j?i+u-g:m[x+1]-g;if(b<=0)return null;var w=x%r.length;return W.createElement("rect",{key:"react-".concat(x),x:g,y:l,width:b,height:d,stroke:"none",fill:r[w],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return W.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var nme=function(t,n){var r=t.xAxis,a=t.width,i=t.height,l=t.offset;return S6(zC(sr(sr(sr({},Hu.defaultProps),r),{},{ticks:Gi(r,!0),viewBox:{x:0,y:0,width:a,height:i}})),l.left,l.left+l.width,n)},rme=function(t,n){var r=t.yAxis,a=t.width,i=t.height,l=t.offset;return S6(zC(sr(sr(sr({},Hu.defaultProps),r),{},{ticks:Gi(r,!0),viewBox:{x:0,y:0,width:a,height:i}})),l.top,l.top+l.height,n)},wc={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function uf(e){var t,n,r,a,i,l,u=$C(),d=IC(),f=Hfe(),m=sr(sr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:wc.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:wc.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:wc.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:wc.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:wc.vertical,verticalFill:(l=e.verticalFill)!==null&&l!==void 0?l:wc.verticalFill,x:Oe(e.x)?e.x:f.left,y:Oe(e.y)?e.y:f.top,width:Oe(e.width)?e.width:f.width,height:Oe(e.height)?e.height:f.height}),p=m.x,g=m.y,x=m.width,j=m.height,b=m.syncWithTicks,w=m.horizontalValues,N=m.verticalValues,O=qfe(),C=Ffe();if(!Oe(x)||x<=0||!Oe(j)||j<=0||!Oe(p)||p!==+p||!Oe(g)||g!==+g)return null;var A=m.verticalCoordinatesGenerator||nme,E=m.horizontalCoordinatesGenerator||rme,k=m.horizontalPoints,T=m.verticalPoints;if((!k||!k.length)&&We(E)){var P=w&&w.length,$=E({yAxis:C?sr(sr({},C),{},{ticks:P?w:C.ticks}):void 0,width:u,height:d,offset:f},P?!0:b);za(Array.isArray($),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(dl($),"]")),Array.isArray($)&&(k=$)}if((!T||!T.length)&&We(A)){var z=N&&N.length,D=A({xAxis:O?sr(sr({},O),{},{ticks:z?N:O.ticks}):void 0,width:u,height:d,offset:f},z?!0:b);za(Array.isArray(D),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(dl(D),"]")),Array.isArray(D)&&(T=D)}return W.createElement("g",{className:"recharts-cartesian-grid"},W.createElement(Zhe,{fill:m.fill,fillOpacity:m.fillOpacity,x:m.x,y:m.y,width:m.width,height:m.height,ry:m.ry}),W.createElement(Qhe,Vs({},m,{offset:f,horizontalPoints:k,xAxis:O,yAxis:C})),W.createElement(Jhe,Vs({},m,{offset:f,verticalPoints:T,xAxis:O,yAxis:C})),W.createElement(eme,Vs({},m,{horizontalPoints:k})),W.createElement(tme,Vs({},m,{verticalPoints:T})))}uf.displayName="CartesianGrid";var ame=["type","layout","connectNulls","ref"],ime=["key"];function wu(e){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wu(e)}function _3(e,t){if(e==null)return{};var n=ome(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ome(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function _f(){return _f=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);np){x=[].concat(jc(d.slice(0,j)),[p-b]);break}var w=x.length%2===0?[0,g]:[g];return[].concat(jc(t.repeat(d,m)),jc(x),w).map(function(N){return"".concat(N,"px")}).join(", ")}),Ia(n,"id",Bu("recharts-line-")),Ia(n,"pathRef",function(l){n.mainCurve=l}),Ia(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Ia(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return vme(t,e),fme(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,l=i.points,u=i.xAxis,d=i.yAxis,f=i.layout,m=i.children,p=ta(m,Rh);if(!p)return null;var g=function(b,w){return{x:b.x,y:b.y,value:b.value,errorVal:Tn(b.payload,w)}},x={clipPath:r?"url(#clipPath-".concat(a,")"):null};return W.createElement(pt,x,p.map(function(j){return W.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:l,xAxis:u,yAxis:d,layout:f,dataPointFormatter:g})}))}},{key:"renderDots",value:function(r,a,i){var l=this.props.isAnimationActive;if(l&&!this.state.isAnimationFinished)return null;var u=this.props,d=u.dot,f=u.points,m=u.dataKey,p=Be(this.props,!1),g=Be(d,!0),x=f.map(function(b,w){var N=Vr(Vr(Vr({key:"dot-".concat(w),r:3},p),g),{},{index:w,cx:b.x,cy:b.y,value:b.value,dataKey:m,payload:b.payload,points:f});return t.renderDotItem(d,N)}),j={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return W.createElement(pt,_f({className:"recharts-line-dots",key:"dots"},j),x)}},{key:"renderCurveStatically",value:function(r,a,i,l){var u=this.props,d=u.type,f=u.layout,m=u.connectNulls;u.ref;var p=_3(u,ame),g=Vr(Vr(Vr({},Be(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:r},l),{},{type:d,layout:f,connectNulls:m});return W.createElement(Yv,_f({},g,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,a){var i=this,l=this.props,u=l.points,d=l.strokeDasharray,f=l.isAnimationActive,m=l.animationBegin,p=l.animationDuration,g=l.animationEasing,x=l.animationId,j=l.animateNewValues,b=l.width,w=l.height,N=this.state,O=N.prevPoints,C=N.totalLength;return W.createElement(pi,{begin:m,duration:p,isActive:f,easing:g,from:{t:0},to:{t:1},key:"line-".concat(x),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(A){var E=A.t;if(O){var k=O.length/u.length,T=u.map(function(U,V){var H=Math.floor(V*k);if(O[H]){var G=O[H],L=Zr(G.x,U.x),R=Zr(G.y,U.y);return Vr(Vr({},U),{},{x:L(E),y:R(E)})}if(j){var F=Zr(b*2,U.x),K=Zr(w/2,U.y);return Vr(Vr({},U),{},{x:F(E),y:K(E)})}return Vr(Vr({},U),{},{x:U.x,y:U.y})});return i.renderCurveStatically(T,r,a)}var P=Zr(0,C),$=P(E),z;if(d){var D="".concat(d).split(/[,\s]+/gim).map(function(U){return parseFloat(U)});z=i.getStrokeDasharray($,C,D)}else z=i.generateSimpleStrokeDasharray(C,$);return i.renderCurveStatically(u,r,a,{strokeDasharray:z})})}},{key:"renderCurve",value:function(r,a){var i=this.props,l=i.points,u=i.isAnimationActive,d=this.state,f=d.prevPoints,m=d.totalLength;return u&&l&&l.length&&(!f&&m>0||!Mh(f,l))?this.renderCurveWithAnimation(r,a):this.renderCurveStatically(l,r,a)}},{key:"render",value:function(){var r,a=this.props,i=a.hide,l=a.dot,u=a.points,d=a.className,f=a.xAxis,m=a.yAxis,p=a.top,g=a.left,x=a.width,j=a.height,b=a.isAnimationActive,w=a.id;if(i||!u||!u.length)return null;var N=this.state.isAnimationFinished,O=u.length===1,C=Ye("recharts-line",d),A=f&&f.allowDataOverflow,E=m&&m.allowDataOverflow,k=A||E,T=Ge(w)?this.id:w,P=(r=Be(l,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},$=P.r,z=$===void 0?3:$,D=P.strokeWidth,U=D===void 0?2:D,V=KQ(l)?l:{},H=V.clipDot,G=H===void 0?!0:H,L=z*2+U;return W.createElement(pt,{className:C},A||E?W.createElement("defs",null,W.createElement("clipPath",{id:"clipPath-".concat(T)},W.createElement("rect",{x:A?g:g-x/2,y:E?p:p-j/2,width:A?x:x*2,height:E?j:j*2})),!G&&W.createElement("clipPath",{id:"clipPath-dots-".concat(T)},W.createElement("rect",{x:g-L/2,y:p-L/2,width:x+L,height:j+L}))):null,!O&&this.renderCurve(k,T),this.renderErrorBar(k,T),(O||l)&&this.renderDots(k,G,T),(!b||N)&&Ji.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:a.curPoints}:r.points!==a.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,a){for(var i=r.length%2!==0?[].concat(jc(r),[0]):r,l=[],u=0;ue.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ope(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function spe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lpe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?l:t&&t.length&&Oe(a)&&Oe(i)?t.slice(a,i+1):[]};function Lq(e){return e==="number"?[0,"auto"]:void 0}var LN=function(t,n,r,a){var i=t.graphicalItems,l=t.tooltipAxis,u=Cy(n,t);return r<0||!i||!i.length||r>=u.length?null:i.reduce(function(d,f){var m,p=(m=f.props.data)!==null&&m!==void 0?m:n;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var g;if(l.dataKey&&!l.allowDuplicatedCategory){var x=p===void 0?u:p;g=bv(x,l.dataKey,a)}else g=p&&p[r]||u[r];return g?[].concat(Nu(d),[E6(f,g)]):d},[])},M3=function(t,n,r,a){var i=a||{x:t.chartX,y:t.chartY},l=bpe(i,r),u=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,m=Voe(l,u,f,d);if(m>=0&&f){var p=f[m]&&f[m].value,g=LN(t,n,m,p),x=wpe(r,u,m,i);return{activeTooltipIndex:m,activeLabel:p,activePayload:g,activeCoordinate:x}}return null},jpe=function(t,n){var r=n.axes,a=n.graphicalItems,i=n.axisType,l=n.axisIdKey,u=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,m=t.layout,p=t.children,g=t.stackOffset,x=j6(m,i);return r.reduce(function(j,b){var w,N=b.type.defaultProps!==void 0?ye(ye({},b.type.defaultProps),b.props):b.props,O=N.type,C=N.dataKey,A=N.allowDataOverflow,E=N.allowDuplicatedCategory,k=N.scale,T=N.ticks,P=N.includeHidden,$=N[l];if(j[$])return j;var z=Cy(t.data,{graphicalItems:a.filter(function(B){var Y,ne=l in B.props?B.props[l]:(Y=B.type.defaultProps)===null||Y===void 0?void 0:Y[l];return ne===$}),dataStartIndex:d,dataEndIndex:f}),D=z.length,U,V,H;Yme(N.domain,A,O)&&(U=Q_(N.domain,null,A),x&&(O==="number"||k!=="auto")&&(H=bf(z,C,"category")));var G=Lq(O);if(!U||U.length===0){var L,R=(L=N.domain)!==null&&L!==void 0?L:G;if(C){if(U=bf(z,C,O),O==="category"&&x){var F=BQ(U);E&&F?(V=U,U=ag(0,D)):E||(U=P$(R,U,b).reduce(function(B,Y){return B.indexOf(Y)>=0?B:[].concat(Nu(B),[Y])},[]))}else if(O==="category")E?U=U.filter(function(B){return B!==""&&!Ge(B)}):U=P$(R,U,b).reduce(function(B,Y){return B.indexOf(Y)>=0||Y===""||Ge(Y)?B:[].concat(Nu(B),[Y])},[]);else if(O==="number"){var K=Zoe(z,a.filter(function(B){var Y,ne,oe=l in B.props?B.props[l]:(Y=B.type.defaultProps)===null||Y===void 0?void 0:Y[l],xe="hide"in B.props?B.props.hide:(ne=B.type.defaultProps)===null||ne===void 0?void 0:ne.hide;return oe===$&&(P||!xe)}),C,i,m);K&&(U=K)}x&&(O==="number"||k!=="auto")&&(H=bf(z,C,"category"))}else x?U=ag(0,D):u&&u[$]&&u[$].hasStack&&O==="number"?U=g==="expand"?[0,1]:C6(u[$].stackGroups,d,f):U=w6(z,a.filter(function(B){var Y=l in B.props?B.props[l]:B.type.defaultProps[l],ne="hide"in B.props?B.props.hide:B.type.defaultProps.hide;return Y===$&&(P||!ne)}),O,m,!0);if(O==="number")U=DN(p,U,$,i,T),R&&(U=Q_(R,U,A));else if(O==="category"&&R){var te=R,I=U.every(function(B){return te.indexOf(B)>=0});I&&(U=te)}}return ye(ye({},j),{},Fe({},$,ye(ye({},N),{},{axisType:i,domain:U,categoricalDomain:H,duplicateDomain:V,originalDomain:(w=N.domain)!==null&&w!==void 0?w:G,isCategorical:x,layout:m})))},{})},Spe=function(t,n){var r=n.graphicalItems,a=n.Axis,i=n.axisType,l=n.axisIdKey,u=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,m=t.layout,p=t.children,g=Cy(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),x=g.length,j=j6(m,i),b=-1;return r.reduce(function(w,N){var O=N.type.defaultProps!==void 0?ye(ye({},N.type.defaultProps),N.props):N.props,C=O[l],A=Lq("number");if(!w[C]){b++;var E;return j?E=ag(0,x):u&&u[C]&&u[C].hasStack?(E=C6(u[C].stackGroups,d,f),E=DN(p,E,C,i)):(E=Q_(A,w6(g,r.filter(function(k){var T,P,$=l in k.props?k.props[l]:(T=k.type.defaultProps)===null||T===void 0?void 0:T[l],z="hide"in k.props?k.props.hide:(P=k.type.defaultProps)===null||P===void 0?void 0:P.hide;return $===C&&!z}),"number",m),a.defaultProps.allowDataOverflow),E=DN(p,E,C,i)),ye(ye({},w),{},Fe({},C,ye(ye({axisType:i},a.defaultProps),{},{hide:!0,orientation:ea(ype,"".concat(i,".").concat(b%2),null),domain:E,originalDomain:A,isCategorical:j,layout:m})))}return w},{})},_pe=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,i=n.AxisComp,l=n.graphicalItems,u=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,m=t.children,p="".concat(a,"Id"),g=ta(m,i),x={};return g&&g.length?x=jpe(t,{axes:g,graphicalItems:l,axisType:a,axisIdKey:p,stackGroups:u,dataStartIndex:d,dataEndIndex:f}):l&&l.length&&(x=Spe(t,{Axis:i,graphicalItems:l,axisType:a,axisIdKey:p,stackGroups:u,dataStartIndex:d,dataEndIndex:f})),x},Npe=function(t){var n=qo(t),r=Gi(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:iC(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Wv(n,r)}},R3=function(t){var n=t.children,r=t.defaultShowTooltip,a=Yr(n,pu),i=0,l=0;return t.data&&t.data.length!==0&&(l=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(l=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:l,activeTooltipIndex:-1,isTooltipActive:!!r}},Ope=function(t){return!t||!t.length?!1:t.some(function(n){var r=Zi(n&&n.type);return r&&r.indexOf("Bar")>=0})},D3=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Cpe=function(t,n){var r=t.props,a=t.graphicalItems,i=t.xAxisMap,l=i===void 0?{}:i,u=t.yAxisMap,d=u===void 0?{}:u,f=r.width,m=r.height,p=r.children,g=r.margin||{},x=Yr(p,pu),j=Yr(p,Qs),b=Object.keys(d).reduce(function(E,k){var T=d[k],P=T.orientation;return!T.mirror&&!T.hide?ye(ye({},E),{},Fe({},P,E[P]+T.width)):E},{left:g.left||0,right:g.right||0}),w=Object.keys(l).reduce(function(E,k){var T=l[k],P=T.orientation;return!T.mirror&&!T.hide?ye(ye({},E),{},Fe({},P,ea(E,"".concat(P))+T.height)):E},{top:g.top||0,bottom:g.bottom||0}),N=ye(ye({},w),b),O=N.bottom;x&&(N.bottom+=x.props.height||pu.defaultProps.height),j&&n&&(N=Koe(N,a,r,n));var C=f-N.left-N.right,A=m-N.top-N.bottom;return ye(ye({brushBottom:O},N),{},{width:Math.max(C,0),height:Math.max(A,0)})},Epe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},FC=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,l=t.validateTooltipEventTypes,u=l===void 0?["axis"]:l,d=t.axisComponents,f=t.legendContent,m=t.formatAxisMap,p=t.defaultProps,g=function(N,O){var C=O.graphicalItems,A=O.stackGroups,E=O.offset,k=O.updateId,T=O.dataStartIndex,P=O.dataEndIndex,$=N.barSize,z=N.layout,D=N.barGap,U=N.barCategoryGap,V=N.maxBarSize,H=D3(z),G=H.numericAxisName,L=H.cateAxisName,R=Ope(C),F=[];return C.forEach(function(K,te){var I=Cy(N.data,{graphicalItems:[K],dataStartIndex:T,dataEndIndex:P}),B=K.type.defaultProps!==void 0?ye(ye({},K.type.defaultProps),K.props):K.props,Y=B.dataKey,ne=B.maxBarSize,oe=B["".concat(G,"Id")],xe=B["".concat(L,"Id")],ee={},ae=d.reduce(function(nr,vr){var lt=O["".concat(vr.axisType,"Map")],rt=B["".concat(vr.axisType,"Id")];lt&<[rt]||vr.axisType==="zAxis"||cr(!1);var Dn=lt[rt];return ye(ye({},nr),{},Fe(Fe({},vr.axisType,Dn),"".concat(vr.axisType,"Ticks"),Gi(Dn)))},ee),Z=ae[L],pe=ae["".concat(L,"Ticks")],je=A&&A[oe]&&A[oe].hasStack&&ose(K,A[oe].stackGroups),le=Zi(K.type).indexOf("Bar")>=0,Re=Wv(Z,pe),_e=[],me=R&&Goe({barSize:$,stackGroups:A,totalSize:Epe(ae,L)});if(le){var ve,Le,Dt=Ge(ne)?V:ne,Nn=(ve=(Le=Wv(Z,pe,!0))!==null&&Le!==void 0?Le:Dt)!==null&&ve!==void 0?ve:0;_e=Yoe({barGap:D,barCategoryGap:U,bandSize:Nn!==Re?Nn:Re,sizeList:me[xe],maxBarSize:Dt}),Nn!==Re&&(_e=_e.map(function(nr){return ye(ye({},nr),{},{position:ye(ye({},nr.position),{},{offset:nr.position.offset-Nn/2})})}))}var pr=K&&K.type&&K.type.getComposedData;pr&&F.push({props:ye(ye({},pr(ye(ye({},ae),{},{displayedData:I,props:N,dataKey:Y,item:K,bandSize:Re,barPosition:_e,offset:E,stackedData:je,layout:z,dataStartIndex:T,dataEndIndex:P}))),{},Fe(Fe(Fe({key:K.key||"item-".concat(te)},G,ae[G]),L,ae[L]),"animationId",k)),childIndex:QQ(K,N.children),item:K})}),F},x=function(N,O){var C=N.props,A=N.dataStartIndex,E=N.dataEndIndex,k=N.updateId;if(!VM({props:C}))return null;var T=C.children,P=C.layout,$=C.stackOffset,z=C.data,D=C.reverseStackOrder,U=D3(P),V=U.numericAxisName,H=U.cateAxisName,G=ta(T,r),L=ase(z,G,"".concat(V,"Id"),"".concat(H,"Id"),$,D),R=d.reduce(function(B,Y){var ne="".concat(Y.axisType,"Map");return ye(ye({},B),{},Fe({},ne,_pe(C,ye(ye({},Y),{},{graphicalItems:G,stackGroups:Y.axisType===V&&L,dataStartIndex:A,dataEndIndex:E}))))},{}),F=Cpe(ye(ye({},R),{},{props:C,graphicalItems:G}),O?.legendBBox);Object.keys(R).forEach(function(B){R[B]=m(C,R[B],F,B.replace("Map",""),n)});var K=R["".concat(H,"Map")],te=Npe(K),I=g(C,ye(ye({},R),{},{dataStartIndex:A,dataEndIndex:E,updateId:k,graphicalItems:G,stackGroups:L,offset:F}));return ye(ye({formattedGraphicalItems:I,graphicalItems:G,offset:F,stackGroups:L},te),R)},j=(function(w){function N(O){var C,A,E;return spe(this,N),E=upe(this,N,[O]),Fe(E,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Fe(E,"accessibilityManager",new Gme),Fe(E,"handleLegendBBoxUpdate",function(k){if(k){var T=E.state,P=T.dataStartIndex,$=T.dataEndIndex,z=T.updateId;E.setState(ye({legendBBox:k},x({props:E.props,dataStartIndex:P,dataEndIndex:$,updateId:z},ye(ye({},E.state),{},{legendBBox:k}))))}}),Fe(E,"handleReceiveSyncEvent",function(k,T,P){if(E.props.syncId===k){if(P===E.eventEmitterSymbol&&typeof E.props.syncMethod!="function")return;E.applySyncEvent(T)}}),Fe(E,"handleBrushChange",function(k){var T=k.startIndex,P=k.endIndex;if(T!==E.state.dataStartIndex||P!==E.state.dataEndIndex){var $=E.state.updateId;E.setState(function(){return ye({dataStartIndex:T,dataEndIndex:P},x({props:E.props,dataStartIndex:T,dataEndIndex:P,updateId:$},E.state))}),E.triggerSyncEvent({dataStartIndex:T,dataEndIndex:P})}}),Fe(E,"handleMouseEnter",function(k){var T=E.getMouseInfo(k);if(T){var P=ye(ye({},T),{},{isTooltipActive:!0});E.setState(P),E.triggerSyncEvent(P);var $=E.props.onMouseEnter;We($)&&$(P,k)}}),Fe(E,"triggeredAfterMouseMove",function(k){var T=E.getMouseInfo(k),P=T?ye(ye({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};E.setState(P),E.triggerSyncEvent(P);var $=E.props.onMouseMove;We($)&&$(P,k)}),Fe(E,"handleItemMouseEnter",function(k){E.setState(function(){return{isTooltipActive:!0,activeItem:k,activePayload:k.tooltipPayload,activeCoordinate:k.tooltipPosition||{x:k.cx,y:k.cy}}})}),Fe(E,"handleItemMouseLeave",function(){E.setState(function(){return{isTooltipActive:!1}})}),Fe(E,"handleMouseMove",function(k){k.persist(),E.throttleTriggeredAfterMouseMove(k)}),Fe(E,"handleMouseLeave",function(k){E.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};E.setState(T),E.triggerSyncEvent(T);var P=E.props.onMouseLeave;We(P)&&P(T,k)}),Fe(E,"handleOuterEvent",function(k){var T=ZQ(k),P=ea(E.props,"".concat(T));if(T&&We(P)){var $,z;/.*touch.*/i.test(T)?z=E.getMouseInfo(k.changedTouches[0]):z=E.getMouseInfo(k),P(($=z)!==null&&$!==void 0?$:{},k)}}),Fe(E,"handleClick",function(k){var T=E.getMouseInfo(k);if(T){var P=ye(ye({},T),{},{isTooltipActive:!0});E.setState(P),E.triggerSyncEvent(P);var $=E.props.onClick;We($)&&$(P,k)}}),Fe(E,"handleMouseDown",function(k){var T=E.props.onMouseDown;if(We(T)){var P=E.getMouseInfo(k);T(P,k)}}),Fe(E,"handleMouseUp",function(k){var T=E.props.onMouseUp;if(We(T)){var P=E.getMouseInfo(k);T(P,k)}}),Fe(E,"handleTouchMove",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&E.throttleTriggeredAfterMouseMove(k.changedTouches[0])}),Fe(E,"handleTouchStart",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&E.handleMouseDown(k.changedTouches[0])}),Fe(E,"handleTouchEnd",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&E.handleMouseUp(k.changedTouches[0])}),Fe(E,"handleDoubleClick",function(k){var T=E.props.onDoubleClick;if(We(T)){var P=E.getMouseInfo(k);T(P,k)}}),Fe(E,"handleContextMenu",function(k){var T=E.props.onContextMenu;if(We(T)){var P=E.getMouseInfo(k);T(P,k)}}),Fe(E,"triggerSyncEvent",function(k){E.props.syncId!==void 0&&LS.emit(BS,E.props.syncId,k,E.eventEmitterSymbol)}),Fe(E,"applySyncEvent",function(k){var T=E.props,P=T.layout,$=T.syncMethod,z=E.state.updateId,D=k.dataStartIndex,U=k.dataEndIndex;if(k.dataStartIndex!==void 0||k.dataEndIndex!==void 0)E.setState(ye({dataStartIndex:D,dataEndIndex:U},x({props:E.props,dataStartIndex:D,dataEndIndex:U,updateId:z},E.state)));else if(k.activeTooltipIndex!==void 0){var V=k.chartX,H=k.chartY,G=k.activeTooltipIndex,L=E.state,R=L.offset,F=L.tooltipTicks;if(!R)return;if(typeof $=="function")G=$(F,k);else if($==="value"){G=-1;for(var K=0;K=0){var je,le;if(V.dataKey&&!V.allowDuplicatedCategory){var Re=typeof V.dataKey=="function"?pe:"payload.".concat(V.dataKey.toString());je=bv(K,Re,G),le=te&&I&&bv(I,Re,G)}else je=K?.[H],le=te&&I&&I[H];if(xe||oe){var _e=k.props.activeIndex!==void 0?k.props.activeIndex:H;return[y.cloneElement(k,ye(ye(ye({},$.props),ae),{},{activeIndex:_e})),null,null]}if(!Ge(je))return[Z].concat(Nu(E.renderActivePoints({item:$,activePoint:je,basePoint:le,childIndex:H,isRange:te})))}else{var me,ve=(me=E.getItemByXY(E.state.activeCoordinate))!==null&&me!==void 0?me:{graphicalItem:Z},Le=ve.graphicalItem,Dt=Le.item,Nn=Dt===void 0?k:Dt,pr=Le.childIndex,nr=ye(ye(ye({},$.props),ae),{},{activeIndex:pr});return[y.cloneElement(Nn,nr),null,null]}return te?[Z,null,null]:[Z,null]}),Fe(E,"renderCustomized",function(k,T,P){return y.cloneElement(k,ye(ye({key:"recharts-customized-".concat(P)},E.props),E.state))}),Fe(E,"renderMap",{CartesianGrid:{handler:Lp,once:!0},ReferenceArea:{handler:E.renderReferenceElement},ReferenceLine:{handler:Lp},ReferenceDot:{handler:E.renderReferenceElement},XAxis:{handler:Lp},YAxis:{handler:Lp},Brush:{handler:E.renderBrush,once:!0},Bar:{handler:E.renderGraphicChild},Line:{handler:E.renderGraphicChild},Area:{handler:E.renderGraphicChild},Radar:{handler:E.renderGraphicChild},RadialBar:{handler:E.renderGraphicChild},Scatter:{handler:E.renderGraphicChild},Pie:{handler:E.renderGraphicChild},Funnel:{handler:E.renderGraphicChild},Tooltip:{handler:E.renderCursor,once:!0},PolarGrid:{handler:E.renderPolarGrid,once:!0},PolarAngleAxis:{handler:E.renderPolarAxis},PolarRadiusAxis:{handler:E.renderPolarAxis},Customized:{handler:E.renderCustomized}}),E.clipPathId="".concat((C=O.id)!==null&&C!==void 0?C:Bu("recharts"),"-clip"),E.throttleTriggeredAfterMouseMove=yz(E.triggeredAfterMouseMove,(A=O.throttleDelay)!==null&&A!==void 0?A:1e3/60),E.state={},E}return hpe(N,w),cpe(N,[{key:"componentDidMount",value:function(){var C,A;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C:0,top:(A=this.props.margin.top)!==null&&A!==void 0?A:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var C=this.props,A=C.children,E=C.data,k=C.height,T=C.layout,P=Yr(A,ei);if(P){var $=P.props.defaultIndex;if(!(typeof $!="number"||$<0||$>this.state.tooltipTicks.length-1)){var z=this.state.tooltipTicks[$]&&this.state.tooltipTicks[$].value,D=LN(this.state,E,$,z),U=this.state.tooltipTicks[$].coordinate,V=(this.state.offset.top+k)/2,H=T==="horizontal",G=H?{x:U,y:V}:{y:U,x:V},L=this.state.formattedGraphicalItems.find(function(F){var K=F.item;return K.type.name==="Scatter"});L&&(G=ye(ye({},G),L.props.points[$].tooltipPosition),D=L.props.points[$].tooltipPayload);var R={activeTooltipIndex:$,isTooltipActive:!0,activeLabel:z,activePayload:D,activeCoordinate:G};this.setState(R),this.renderCursor(P),this.accessibilityManager.setIndex($)}}}},{key:"getSnapshotBeforeUpdate",value:function(C,A){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==A.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==C.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==C.margin){var E,k;this.accessibilityManager.setDetails({offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0}})}return null}},{key:"componentDidUpdate",value:function(C){b_([Yr(C.children,ei)],[Yr(this.props.children,ei)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var C=Yr(this.props.children,ei);if(C&&typeof C.props.shared=="boolean"){var A=C.props.shared?"axis":"item";return u.indexOf(A)>=0?A:i}return i}},{key:"getMouseInfo",value:function(C){if(!this.container)return null;var A=this.container,E=A.getBoundingClientRect(),k=Bne(E),T={chartX:Math.round(C.pageX-k.left),chartY:Math.round(C.pageY-k.top)},P=E.width/A.offsetWidth||1,$=this.inRange(T.chartX,T.chartY,P);if(!$)return null;var z=this.state,D=z.xAxisMap,U=z.yAxisMap,V=this.getTooltipEventType(),H=M3(this.state,this.props.data,this.props.layout,$);if(V!=="axis"&&D&&U){var G=qo(D).scale,L=qo(U).scale,R=G&&G.invert?G.invert(T.chartX):null,F=L&&L.invert?L.invert(T.chartY):null;return ye(ye({},T),{},{xValue:R,yValue:F},H)}return H?ye(ye({},T),H):null}},{key:"inRange",value:function(C,A){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=this.props.layout,T=C/E,P=A/E;if(k==="horizontal"||k==="vertical"){var $=this.state.offset,z=T>=$.left&&T<=$.left+$.width&&P>=$.top&&P<=$.top+$.height;return z?{x:T,y:P}:null}var D=this.state,U=D.angleAxisMap,V=D.radiusAxisMap;if(U&&V){var H=qo(U);return D$({x:T,y:P},H)}return null}},{key:"parseEventsOfWrapper",value:function(){var C=this.props.children,A=this.getTooltipEventType(),E=Yr(C,ei),k={};E&&A==="axis"&&(E.props.trigger==="click"?k={onClick:this.handleClick}:k={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=wv(this.props,this.handleOuterEvent);return ye(ye({},T),k)}},{key:"addListener",value:function(){LS.on(BS,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){LS.removeListener(BS,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(C,A,E){for(var k=this.state.formattedGraphicalItems,T=0,P=k.length;T");return e}const Ac=y.forwardRef(({id:e,className:t,children:n,config:r,...a},i)=>{const l=y.useId(),u=`chart-${e||l.replace(/:/g,"")}`;return o.jsx(Bq.Provider,{value:{config:r},children:o.jsxs("div",{"data-chart":u,ref:i,className:ue("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",t),...a,children:[o.jsx(Ppe,{id:u,config:r}),o.jsx(Pne,{children:n})]})})});Ac.displayName="Chart";const Ppe=({id:e,config:t})=>{const n=Object.entries(t).filter(([,r])=>r.theme||r.color);return n.length?o.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(kpe).map(([r,a])=>` +${a} [data-chart=${e}] { +${n.map(([i,l])=>{const u=l.theme?.[r]||l.color;return u?` --color-${i}: ${u};`:null}).join(` +`)} +} +`).join(` +`)}}):null},rf=ei,Tc=y.forwardRef(({active:e,payload:t,className:n,indicator:r="dot",hideLabel:a=!1,hideIndicator:i=!1,label:l,labelFormatter:u,labelClassName:d,formatter:f,color:m,nameKey:p,labelKey:g},x)=>{const{config:j}=zq(),b=y.useMemo(()=>{if(a||!t?.length)return null;const[N]=t,O=`${g||N?.dataKey||N?.name||"value"}`,C=BN(j,N,O),A=!g&&typeof l=="string"?j[l]?.label||l:C?.label;return u?o.jsx("div",{className:ue("font-medium",d),children:u(A,t)}):A?o.jsx("div",{className:ue("font-medium",d),children:A}):null},[l,u,t,a,d,j,g]);if(!e||!t?.length)return null;const w=t.length===1&&r!=="dot";return o.jsxs("div",{ref:x,className:ue("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",n),children:[w?null:b,o.jsx("div",{className:"grid gap-1.5",children:t.filter(N=>N.type!=="none").map((N,O)=>{const C=`${p||N.name||N.dataKey||"value"}`,A=BN(j,N,C),E=m||N.payload.fill||N.color;return o.jsx("div",{className:ue("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",r==="dot"&&"items-center"),children:f&&N?.value!==void 0&&N.name?f(N.value,N.name,N,O,N.payload):o.jsxs(o.Fragment,{children:[A?.icon?o.jsx(A.icon,{}):!i&&o.jsx("div",{className:ue("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":r==="dot","w-1":r==="line","w-0 border-[1.5px] border-dashed bg-transparent":r==="dashed","my-0.5":w&&r==="dashed"}),style:{"--color-bg":E,"--color-border":E}}),o.jsxs("div",{className:ue("flex flex-1 justify-between leading-none",w?"items-end":"items-center"),children:[o.jsxs("div",{className:"grid gap-1.5",children:[w?b:null,o.jsx("span",{className:"text-muted-foreground",children:A?.label||N.name})]}),N.value&&o.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:N.value.toLocaleString()})]})]})},N.dataKey)})})]})});Tc.displayName="ChartTooltip";const Mpe=Qs,qq=y.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:r="bottom",nameKey:a},i)=>{const{config:l}=zq();return n?.length?o.jsx("div",{ref:i,className:ue("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",e),children:n.filter(u=>u.type!=="none").map(u=>{const d=`${a||u.dataKey||"value"}`,f=BN(l,u,d);return o.jsxs("div",{className:ue("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[f?.icon&&!t?o.jsx(f.icon,{}):o.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:u.color}}),f?.label]},u.value)})}):null});qq.displayName="ChartLegend";function BN(e,t,n){if(typeof t!="object"||t===null)return;const r="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let a=n;return n in t&&typeof t[n]=="string"?a=t[n]:r&&n in r&&typeof r[n]=="string"&&(a=r[n]),a in e?e[a]:e[n]}const Rpe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Dpe=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),$3=e=>{const t=Dpe(e);return t.charAt(0).toUpperCase()+t.slice(1)},Fq=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),$pe=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Ipe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Lpe=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:l,...u},d)=>y.createElement("svg",{ref:d,...Ipe,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Fq("lucide",a),...!i&&!$pe(u)&&{"aria-hidden":"true"},...u},[...l.map(([f,m])=>y.createElement(f,m)),...Array.isArray(i)?i:[i]]));const Ce=(e,t)=>{const n=y.forwardRef(({className:r,...a},i)=>y.createElement(Lpe,{ref:i,iconNode:t,className:Fq(`lucide-${Rpe($3(e))}`,`lucide-${e}`,r),...a}));return n.displayName=$3(e),n};const Bpe=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],zpe=Ce("activity",Bpe);const qpe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Uq=Ce("arrow-left",qpe);const Fpe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Upe=Ce("arrow-right",Fpe);const Hpe=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Wpe=Ce("ban",Hpe);const Vpe=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Gpe=Ce("book-open",Vpe);const Ype=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Kpe=Ce("bot",Ype);const Xpe=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],Hq=Ce("boxes",Xpe);const Zpe=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],I3=Ce("calendar",Zpe);const Qpe=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Jpe=Ce("chart-column",Qpe);const eve=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],tl=Ce("check",eve);const tve=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],lh=Ce("chevron-down",tve);const nve=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],UC=Ce("chevron-left",nve);const rve=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],HC=Ce("chevron-right",rve);const ave=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],zN=Ce("chevron-up",ave);const ive=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],ove=Ce("chevrons-up-down",ive);const sve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],yg=Ce("circle-alert",sve);const lve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ou=Ce("circle-check",lve);const cve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],uve=Ce("circle-question-mark",cve);const dve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],Wq=Ce("circle-user",dve);const fve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Vq=Ce("circle-x",fve);const hve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],mve=Ce("circle",hve);const pve=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],nl=Ce("clock",pve);const vve=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],qN=Ce("copy",vve);const gve=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],yve=Ce("database",gve);const xve=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],bve=Ce("dollar-sign",xve);const wve=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],FN=Ce("download",wve);const jve=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],nv=Ce("external-link",jve);const Sve=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],UN=Ce("eye-off",Sve);const _ve=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ro=Ce("eye",_ve);const Nve=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],xg=Ce("file-search",Nve);const Ove=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],WC=Ce("file-text",Ove);const Cve=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],HN=Ce("funnel",Cve);const Eve=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],bg=Ce("hash",Eve);const Ave=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],wg=Ce("house",Ave);const Tve=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],kve=Ce("image",Tve);const Pve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Gq=Ce("info",Pve);const Mve=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Rve=Ce("key",Mve);const Dve=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],WN=Ce("loader-circle",Dve);const $ve=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],L3=Ce("lock",$ve);const Ive=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],B3=Ce("log-out",Ive);const Lve=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Bve=Ce("menu",Lve);const zve=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],$h=Ce("message-square",zve);const qve=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],VN=Ce("moon",qve);const Fve=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Yq=Ce("package",Fve);const Uve=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Kq=Ce("palette",Uve);const Hve=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],Wve=Ce("pause",Hve);const Vve=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Cu=Ce("pencil",Vve);const Gve=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Yve=Ce("play",Gve);const Kve=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],er=Ce("plus",Kve);const Xve=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],rl=Ce("refresh-cw",Xve);const Zve=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Qve=Ce("rotate-ccw",Zve);const Jve=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],ege=Ce("rotate-cw",Jve);const tge=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],VC=Ce("save",tge);const nge=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Rr=Ce("search",nge);const rge=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Xq=Ce("server",rge);const age=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],ige=Ce("settings-2",age);const oge=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Uc=Ce("settings",oge);const sge=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],lge=Ce("shield",sge);const cge=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],uge=Ce("skip-forward",cge);const dge=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],GC=Ce("smile",dge);const fge=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],hge=Ce("sparkles",fge);const mge=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],YC=Ce("square-pen",mge);const pge=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],z3=Ce("star",pge);const vge=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],GN=Ce("sun",vge);const gge=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],yge=Ce("terminal",gge);const xge=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ut=Ce("trash-2",xge);const bge=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],wge=Ce("trending-up",bge);const jge=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Hc=Ce("triangle-alert",jge);const Sge=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Zq=Ce("user",Sge);const _ge=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Nge=Ce("users",_ge);const Oge=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ih=Ce("x",Oge);const Cge=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ch=Ce("zap",Cge);var Ege=Symbol.for("react.lazy"),jg=gO[" use ".trim().toString()];function Age(e){return typeof e=="object"&&e!==null&&"then"in e}function Qq(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Ege&&"_payload"in e&&Age(e._payload)}function Lh(e){const t=kge(e),n=y.forwardRef((r,a)=>{let{children:i,...l}=r;Qq(i)&&typeof jg=="function"&&(i=jg(i._payload));const u=y.Children.toArray(i),d=u.find(Mge);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return o.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return o.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var Tge=Lh("Slot");function kge(e){const t=y.forwardRef((n,r)=>{let{children:a,...i}=n;if(Qq(a)&&typeof jg=="function"&&(a=jg(a._payload)),y.isValidElement(a)){const l=Dge(a),u=Rge(i,a.props);return a.type!==y.Fragment&&(u.ref=r?Mr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Pge=Symbol("radix.slottable");function Mge(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Pge}function Rge(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function Dge(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const q3=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,F3=Ye,Bh=(e,t)=>n=>{var r;if(t?.variants==null)return F3(e,n?.class,n?.className);const{variants:a,defaultVariants:i}=t,l=Object.keys(a).map(f=>{const m=n?.[f],p=i?.[f];if(m===null)return null;const g=q3(m)||q3(p);return a[f][g]}),u=n&&Object.entries(n).reduce((f,m)=>{let[p,g]=m;return g===void 0||(f[p]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,m)=>{let{class:p,className:g,...x}=m;return Object.entries(x).every(j=>{let[b,w]=j;return Array.isArray(w)?w.includes({...i,...u}[b]):{...i,...u}[b]===w})?[...f,p,g]:f},[]);return F3(e,l,d,n?.class,n?.className)},uh=Bh("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),fe=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const l=r?Tge:"button";return o.jsx(l,{className:ue(uh({variant:t,size:n,className:e})),ref:i,...a})});fe.displayName="Button";function $ge(){const[e,t]=y.useState(null),[n,r]=y.useState(!0),[a,i]=y.useState(24),[l,u]=y.useState(!0),d=y.useCallback(async()=>{try{const O=localStorage.getItem("token"),C=await cn.get(`/api/webui/statistics/dashboard?hours=${a}`,{headers:{Authorization:`Bearer ${O}`}});t(C.data),r(!1)}catch(O){console.error("Failed to fetch dashboard data:",O),r(!1)}},[a]);if(y.useEffect(()=>{d()},[d]),y.useEffect(()=>{if(!l)return;const O=setInterval(()=>{d()},3e4);return()=>clearInterval(O)},[l,d]),n||!e)return o.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:o.jsxs("div",{className:"text-center space-y-4",children:[o.jsx(rl,{className:"h-12 w-12 animate-spin mx-auto text-muted-foreground"}),o.jsx("p",{className:"text-muted-foreground",children:"加载统计数据中..."})]})});const{summary:f,model_stats:m,hourly_data:p,daily_data:g,recent_activity:x}=e,j=O=>{const C=Math.floor(O/3600),A=Math.floor(O%3600/60);return`${C}小时${A}分钟`},b=O=>new Date(O).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),w=m.slice(0,6).map(O=>({name:O.model_name,value:O.request_count,fill:`hsl(var(--chart-${m.indexOf(O)%5+1}))`})),N={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return o.jsx(Xt,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(ol,{value:a.toString(),onValueChange:O=>i(Number(O)),children:o.jsxs(Xo,{className:"grid grid-cols-3 w-full sm:w-auto",children:[o.jsx(Ct,{value:"24",children:"24小时"}),o.jsx(Ct,{value:"168",children:"7天"}),o.jsx(Ct,{value:"720",children:"30天"})]})}),o.jsxs(fe,{variant:l?"default":"outline",size:"sm",onClick:()=>u(!l),className:"gap-2",children:[o.jsx(rl,{className:`h-4 w-4 ${l?"animate-spin":""}`}),o.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),o.jsx(fe,{variant:"outline",size:"sm",onClick:d,children:o.jsx(rl,{className:"h-4 w-4"})})]})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[o.jsxs(dt,{children:[o.jsxs(Vt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(Gt,{className:"text-sm font-medium",children:"总请求数"}),o.jsx(zpe,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(ln,{children:[o.jsx("div",{className:"text-2xl font-bold",children:f.total_requests.toLocaleString()}),o.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",a<48?a+"小时":Math.floor(a/24)+"天"]})]})]}),o.jsxs(dt,{children:[o.jsxs(Vt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(Gt,{className:"text-sm font-medium",children:"总花费"}),o.jsx(bve,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(ln,{children:[o.jsxs("div",{className:"text-2xl font-bold",children:["¥",f.total_cost.toFixed(2)]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:f.cost_per_hour>0?`¥${f.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),o.jsxs(dt,{children:[o.jsxs(Vt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(Gt,{className:"text-sm font-medium",children:"Token消耗"}),o.jsx(yve,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(ln,{children:[o.jsxs("div",{className:"text-2xl font-bold",children:[(f.total_tokens/1e3).toFixed(1),"K"]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:f.tokens_per_hour>0?`${(f.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),o.jsxs(dt,{children:[o.jsxs(Vt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(Gt,{className:"text-sm font-medium",children:"平均响应"}),o.jsx(ch,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(ln,{children:[o.jsxs("div",{className:"text-2xl font-bold",children:[f.avg_response_time.toFixed(2),"s"]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[o.jsxs(dt,{children:[o.jsxs(Vt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(Gt,{className:"text-sm font-medium",children:"在线时长"}),o.jsx(nl,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(ln,{children:o.jsx("div",{className:"text-xl font-bold",children:j(f.online_time)})})]}),o.jsxs(dt,{children:[o.jsxs(Vt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(Gt,{className:"text-sm font-medium",children:"消息处理"}),o.jsx($h,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(ln,{children:[o.jsx("div",{className:"text-xl font-bold",children:f.total_messages.toLocaleString()}),o.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",f.total_replies.toLocaleString()," 条"]})]})]}),o.jsxs(dt,{children:[o.jsxs(Vt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(Gt,{className:"text-sm font-medium",children:"成本效率"}),o.jsx(wge,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(ln,{children:[o.jsx("div",{className:"text-xl font-bold",children:f.total_messages>0?`¥${(f.total_cost/f.total_messages*100).toFixed(2)}`:"¥0.00"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),o.jsxs(ol,{defaultValue:"trends",className:"space-y-4",children:[o.jsxs(Xo,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[o.jsx(Ct,{value:"trends",children:"趋势"}),o.jsx(Ct,{value:"models",children:"模型"}),o.jsx(Ct,{value:"activity",children:"活动"}),o.jsx(Ct,{value:"daily",children:"日统计"})]}),o.jsxs(Qt,{value:"trends",className:"space-y-4",children:[o.jsxs(dt,{children:[o.jsxs(Vt,{children:[o.jsx(Gt,{children:"请求趋势"}),o.jsxs(Jn,{children:["最近",a,"小时的请求量变化"]})]}),o.jsx(ln,{children:o.jsx(Ac,{config:N,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:o.jsxs(Ape,{data:p,children:[o.jsx(uf,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Ho,{dataKey:"timestamp",tickFormatter:O=>b(O),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Hi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(rf,{content:o.jsx(Tc,{labelFormatter:O=>b(O)})}),o.jsx(Dh,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[o.jsxs(dt,{children:[o.jsxs(Vt,{children:[o.jsx(Gt,{children:"花费趋势"}),o.jsx(Jn,{children:"API调用成本变化"})]}),o.jsx(ln,{children:o.jsx(Ac,{config:N,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:o.jsxs(qS,{data:p,children:[o.jsx(uf,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Ho,{dataKey:"timestamp",tickFormatter:O=>b(O),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Hi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(rf,{content:o.jsx(Tc,{labelFormatter:O=>b(O)})}),o.jsx(oi,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),o.jsxs(dt,{children:[o.jsxs(Vt,{children:[o.jsx(Gt,{children:"Token消耗"}),o.jsx(Jn,{children:"Token使用量变化"})]}),o.jsx(ln,{children:o.jsx(Ac,{config:N,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:o.jsxs(qS,{data:p,children:[o.jsx(uf,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Ho,{dataKey:"timestamp",tickFormatter:O=>b(O),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Hi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(rf,{content:o.jsx(Tc,{labelFormatter:O=>b(O)})}),o.jsx(oi,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),o.jsx(Qt,{value:"models",className:"space-y-4",children:o.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[o.jsxs(dt,{children:[o.jsxs(Vt,{children:[o.jsx(Gt,{children:"模型请求分布"}),o.jsx(Jn,{children:"各模型使用占比"})]}),o.jsx(ln,{children:o.jsx(Ac,{config:Object.fromEntries(m.slice(0,6).map((O,C)=>[O.model_name,{label:O.model_name,color:`hsl(var(--chart-${C%5+1}))`}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:o.jsxs(Tpe,{children:[o.jsx(rf,{content:o.jsx(Tc,{})}),o.jsx(uo,{data:w,cx:"50%",cy:"50%",labelLine:!1,label:({name:O,percent:C})=>`${O} ${C?(C*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:w.map((O,C)=>o.jsx(ry,{fill:O.fill},`cell-${C}`))})]})})})]}),o.jsxs(dt,{children:[o.jsxs(Vt,{children:[o.jsx(Gt,{children:"模型详细统计"}),o.jsx(Jn,{children:"请求数、花费和性能"})]}),o.jsx(ln,{children:o.jsx(Xt,{className:"h-[300px] sm:h-[400px]",children:o.jsx("div",{className:"space-y-3",children:m.map((O,C)=>o.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:O.model_name}),o.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${C%5+1}))`}})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),o.jsx("span",{className:"ml-1 font-medium",children:O.request_count.toLocaleString()})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"花费:"}),o.jsxs("span",{className:"ml-1 font-medium",children:["¥",O.total_cost.toFixed(2)]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),o.jsxs("span",{className:"ml-1 font-medium",children:[(O.total_tokens/1e3).toFixed(1),"K"]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),o.jsxs("span",{className:"ml-1 font-medium",children:[O.avg_response_time.toFixed(2),"s"]})]})]})]},C))})})})]})]})}),o.jsx(Qt,{value:"activity",children:o.jsxs(dt,{children:[o.jsxs(Vt,{children:[o.jsx(Gt,{children:"最近活动"}),o.jsx(Jn,{children:"最新的API调用记录"})]}),o.jsx(ln,{children:o.jsx(Xt,{className:"h-[400px] sm:h-[500px]",children:o.jsx("div",{className:"space-y-2",children:x.map((O,C)=>o.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"font-medium text-sm truncate",children:O.model}),o.jsx("div",{className:"text-xs text-muted-foreground",children:O.request_type})]}),o.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:b(O.timestamp)})]}),o.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),o.jsx("span",{className:"ml-1",children:O.tokens})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"花费:"}),o.jsxs("span",{className:"ml-1",children:["¥",O.cost.toFixed(4)]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),o.jsxs("span",{className:"ml-1",children:[O.time_cost.toFixed(2),"s"]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"状态:"}),o.jsx("span",{className:`ml-1 ${O.status==="success"?"text-green-600":"text-red-600"}`,children:O.status})]})]})]},C))})})})]})}),o.jsx(Qt,{value:"daily",children:o.jsxs(dt,{children:[o.jsxs(Vt,{children:[o.jsx(Gt,{children:"每日统计"}),o.jsx(Jn,{children:"最近7天的数据汇总"})]}),o.jsx(ln,{children:o.jsx(Ac,{config:{requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"}},className:"h-[400px] sm:h-[500px] w-full aspect-auto",children:o.jsxs(qS,{data:g,children:[o.jsx(uf,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Ho,{dataKey:"timestamp",tickFormatter:O=>{const C=new Date(O);return`${C.getMonth()+1}/${C.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Hi,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Hi,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(rf,{content:o.jsx(Tc,{labelFormatter:O=>new Date(O).toLocaleDateString("zh-CN")})}),o.jsx(Mpe,{content:o.jsx(qq,{})}),o.jsx(oi,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),o.jsx(oi,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]})]})})}const Ige={theme:"system",setTheme:()=>null},Jq=y.createContext(Ige),KC=()=>{const e=y.useContext(Jq);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},Lge=(e,t,n)=>{const r=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||r){t(e);return}const a=n.clientX,i=n.clientY,l=Math.hypot(Math.max(a,innerWidth-a),Math.max(i,innerHeight-i));document.startViewTransition(()=>{t(e)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${a}px ${i}px)`,`circle(${l}px at ${a}px ${i}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},eF=y.createContext(void 0),tF=()=>{const e=y.useContext(eF);if(e===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return e};function Ey(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Ay(e){const[t,n]=y.useState(void 0);return Fn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,u;if("borderBoxSize"in i){const d=i.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,u=f.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ty="Switch",[Bge]=fr(Ty),[zge,qge]=Bge(Ty),nF=y.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:i,required:l,disabled:u,value:d="on",onCheckedChange:f,form:m,...p}=e,[g,x]=y.useState(null),j=qe(t,C=>x(C)),b=y.useRef(!1),w=g?m||!!g.closest("form"):!0,[N,O]=_a({prop:a,defaultProp:i??!1,onChange:f,caller:Ty});return o.jsxs(zge,{scope:n,checked:N,disabled:u,children:[o.jsx(Me.button,{type:"button",role:"switch","aria-checked":N,"aria-required":l,"data-state":oF(N),"data-disabled":u?"":void 0,disabled:u,value:d,...p,ref:j,onClick:Se(e.onClick,C=>{O(A=>!A),w&&(b.current=C.isPropagationStopped(),b.current||C.stopPropagation())})}),w&&o.jsx(iF,{control:g,bubbles:!b.current,name:r,value:d,checked:N,required:l,disabled:u,form:m,style:{transform:"translateX(-100%)"}})]})});nF.displayName=Ty;var rF="SwitchThumb",aF=y.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=qge(rF,n);return o.jsx(Me.span,{"data-state":oF(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});aF.displayName=rF;var Fge="SwitchBubbleInput",iF=y.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const l=y.useRef(null),u=qe(l,i),d=Ey(n),f=Ay(t);return y.useEffect(()=>{const m=l.current;if(!m)return;const p=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&x){const j=new Event("click",{bubbles:r});x.call(m,n),m.dispatchEvent(j)}},[d,n,r]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:u,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});iF.displayName=Fge;function oF(e){return e?"checked":"unchecked"}var sF=nF,Uge=aF;const at=y.forwardRef(({className:e,...t},n)=>o.jsx(sF,{className:ue("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:o.jsx(Uge,{className:ue("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));at.displayName=sF.displayName;var Hge=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wge=Hge.reduce((e,t)=>{const n=Lh(`Primitive.${t}`),r=y.forwardRef((a,i)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(d,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Vge="Label",lF=y.forwardRef((e,t)=>o.jsx(Wge.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));lF.displayName=Vge;var cF=lF;const Gge=Bh("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),J=y.forwardRef(({className:e,...t},n)=>o.jsx(cF,{ref:n,className:ue(Gge(),e),...t}));J.displayName=cF.displayName;const Ne=y.forwardRef(({className:e,type:t,...n},r)=>o.jsx("input",{type:t,className:ue("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Ne.displayName="Input";const Yge=1,Kge=1e6;let FS=0;function Xge(){return FS=(FS+1)%Number.MAX_SAFE_INTEGER,FS.toString()}const US=new Map,U3=e=>{if(US.has(e))return;const t=setTimeout(()=>{US.delete(e),Nf({type:"REMOVE_TOAST",toastId:e})},Kge);US.set(e,t)},Zge=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Yge)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?U3(n):e.toasts.forEach(r=>{U3(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},rv=[];let av={toasts:[]};function Nf(e){av=Zge(av,e),rv.forEach(t=>{t(av)})}function Qge({...e}){const t=Xge(),n=a=>Nf({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Nf({type:"DISMISS_TOAST",toastId:t});return Nf({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function hr(){const[e,t]=y.useState(av);return y.useEffect(()=>(rv.push(t),()=>{const n=rv.indexOf(t);n>-1&&rv.splice(n,1)}),[e]),{...e,toast:Qge,dismiss:n=>Nf({type:"DISMISS_TOAST",toastId:n})}}const Jge=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:e=>e.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:e=>/[A-Z]/.test(e)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:e=>/[a-z]/.test(e)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:e=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(e)}];function eye(e){const t=Jge.map(r=>({id:r.id,label:r.label,description:r.description,passed:r.validate(e)}));return{isValid:t.every(r=>r.passed),rules:t}}const XC="0.11.3",ZC="MaiBot Dashboard",tye=`${ZC} v${XC}`,nye=(e="v")=>`${e}${XC}`;function rye(e,t=globalThis?.document){const n=tn(e);y.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var aye="DismissableLayer",YN="dismissableLayer.update",iye="dismissableLayer.pointerDownOutside",oye="dismissableLayer.focusOutside",H3,uF=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Sl=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:u,...d}=e,f=y.useContext(uF),[m,p]=y.useState(null),g=m?.ownerDocument??globalThis?.document,[,x]=y.useState({}),j=qe(t,T=>p(T)),b=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=b.indexOf(w),O=m?b.indexOf(m):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,A=O>=N,E=lye(T=>{const P=T.target,$=[...f.branches].some(z=>z.contains(P));!A||$||(a?.(T),l?.(T),T.defaultPrevented||u?.())},g),k=cye(T=>{const P=T.target;[...f.branches].some(z=>z.contains(P))||(i?.(T),l?.(T),T.defaultPrevented||u?.())},g);return rye(T=>{O===f.layers.size-1&&(r?.(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},g),y.useEffect(()=>{if(m)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(H3=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),W3(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=H3)}},[m,g,n,f]),y.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),W3())},[m,f]),y.useEffect(()=>{const T=()=>x({});return document.addEventListener(YN,T),()=>document.removeEventListener(YN,T)},[]),o.jsx(Me.div,{...d,ref:j,style:{pointerEvents:C?A?"auto":"none":void 0,...e.style},onFocusCapture:Se(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Se(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Se(e.onPointerDownCapture,E.onPointerDownCapture)})});Sl.displayName=aye;var sye="DismissableLayerBranch",dF=y.forwardRef((e,t)=>{const n=y.useContext(uF),r=y.useRef(null),a=qe(t,r);return y.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),o.jsx(Me.div,{...e,ref:a})});dF.displayName=sye;function lye(e,t=globalThis?.document){const n=tn(e),r=y.useRef(!1),a=y.useRef(()=>{});return y.useEffect(()=>{const i=u=>{if(u.target&&!r.current){let d=function(){fF(iye,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function cye(e,t=globalThis?.document){const n=tn(e),r=y.useRef(!1);return y.useEffect(()=>{const a=i=>{i.target&&!r.current&&fF(oye,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function W3(){const e=new CustomEvent(YN);document.dispatchEvent(e)}function fF(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?MO(a,i):a.dispatchEvent(i)}var uye=Sl,dye=dF,HS="focusScope.autoFocusOnMount",WS="focusScope.autoFocusOnUnmount",V3={bubbles:!1,cancelable:!0},fye="FocusScope",zh=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[u,d]=y.useState(null),f=tn(a),m=tn(i),p=y.useRef(null),g=qe(t,b=>d(b)),x=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let b=function(C){if(x.paused||!u)return;const A=C.target;u.contains(A)?p.current=A:Bo(p.current,{select:!0})},w=function(C){if(x.paused||!u)return;const A=C.relatedTarget;A!==null&&(u.contains(A)||Bo(p.current,{select:!0}))},N=function(C){if(document.activeElement===document.body)for(const E of C)E.removedNodes.length>0&&Bo(u)};document.addEventListener("focusin",b),document.addEventListener("focusout",w);const O=new MutationObserver(N);return u&&O.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",w),O.disconnect()}}},[r,u,x.paused]),y.useEffect(()=>{if(u){Y3.add(x);const b=document.activeElement;if(!u.contains(b)){const N=new CustomEvent(HS,V3);u.addEventListener(HS,f),u.dispatchEvent(N),N.defaultPrevented||(hye(yye(hF(u)),{select:!0}),document.activeElement===b&&Bo(u))}return()=>{u.removeEventListener(HS,f),setTimeout(()=>{const N=new CustomEvent(WS,V3);u.addEventListener(WS,m),u.dispatchEvent(N),N.defaultPrevented||Bo(b??document.body,{select:!0}),u.removeEventListener(WS,m),Y3.remove(x)},0)}}},[u,f,m,x]);const j=y.useCallback(b=>{if(!n&&!r||x.paused)return;const w=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,N=document.activeElement;if(w&&N){const O=b.currentTarget,[C,A]=mye(O);C&&A?!b.shiftKey&&N===A?(b.preventDefault(),n&&Bo(C,{select:!0})):b.shiftKey&&N===C&&(b.preventDefault(),n&&Bo(A,{select:!0})):N===O&&b.preventDefault()}},[n,r,x.paused]);return o.jsx(Me.div,{tabIndex:-1,...l,ref:g,onKeyDown:j})});zh.displayName=fye;function hye(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Bo(r,{select:t}),document.activeElement!==n)return}function mye(e){const t=hF(e),n=G3(t,e),r=G3(t.reverse(),e);return[n,r]}function hF(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function G3(e,t){for(const n of e)if(!pye(n,{upTo:t}))return n}function pye(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function vye(e){return e instanceof HTMLInputElement&&"select"in e}function Bo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&vye(e)&&t&&e.select()}}var Y3=gye();function gye(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=K3(e,t),e.unshift(t)},remove(t){e=K3(e,t),e[0]?.resume()}}}function K3(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function yye(e){return e.filter(t=>t.tagName!=="A")}var xye="Portal",_l=y.forwardRef((e,t)=>{const{container:n,...r}=e,[a,i]=y.useState(!1);Fn(()=>i(!0),[]);const l=n||a&&globalThis?.document?.body;return l?hY.createPortal(o.jsx(Me.div,{...r,ref:t}),l):null});_l.displayName=xye;var VS=0;function ky(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??X3()),document.body.insertAdjacentElement("beforeend",e[1]??X3()),VS++,()=>{VS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),VS--}},[])}function X3(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ti=function(){return ti=Object.assign||function(t){for(var n,r=1,a=arguments.length;r"u")return $ye;var t=Iye(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Bye=gF(),Wc="data-scroll-locked",zye=function(e,t,n,r){var a=e.left,i=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),` + .`.concat(wye,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(u,"px ").concat(r,`; + } + body[`).concat(Wc,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(a,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(l,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(u,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(iv,` { + right: `).concat(u,"px ").concat(r,`; + } + + .`).concat(ov,` { + margin-right: `).concat(u,"px ").concat(r,`; + } + + .`).concat(iv," .").concat(iv,` { + right: 0 `).concat(r,`; + } + + .`).concat(ov," .").concat(ov,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(Wc,`] { + `).concat(jye,": ").concat(u,`px; + } +`)},Q3=function(){var e=parseInt(document.body.getAttribute(Wc)||"0",10);return isFinite(e)?e:0},qye=function(){y.useEffect(function(){return document.body.setAttribute(Wc,(Q3()+1).toString()),function(){var e=Q3()-1;e<=0?document.body.removeAttribute(Wc):document.body.setAttribute(Wc,e.toString())}},[])},Fye=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;qye();var i=y.useMemo(function(){return Lye(a)},[a]);return y.createElement(Bye,{styles:zye(i,!t,a,n?"":"!important")})},KN=!1;if(typeof window<"u")try{var Bp=Object.defineProperty({},"passive",{get:function(){return KN=!0,!0}});window.addEventListener("test",Bp,Bp),window.removeEventListener("test",Bp,Bp)}catch{KN=!1}var Sc=KN?{passive:!1}:!1,Uye=function(e){return e.tagName==="TEXTAREA"},yF=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Uye(e)&&n[t]==="visible")},Hye=function(e){return yF(e,"overflowY")},Wye=function(e){return yF(e,"overflowX")},J3=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=xF(e,r);if(a){var i=bF(e,r),l=i[1],u=i[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Vye=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Gye=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},xF=function(e,t){return e==="v"?Hye(t):Wye(t)},bF=function(e,t){return e==="v"?Vye(t):Gye(t)},Yye=function(e,t){return e==="h"&&t==="rtl"?-1:1},Kye=function(e,t,n,r,a){var i=Yye(e,window.getComputedStyle(t).direction),l=i*r,u=n.target,d=t.contains(u),f=!1,m=l>0,p=0,g=0;do{if(!u)break;var x=bF(e,u),j=x[0],b=x[1],w=x[2],N=b-w-i*j;(j||N)&&xF(e,u)&&(p+=N,g+=j);var O=u.parentNode;u=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(m&&Math.abs(p)<1||!m&&Math.abs(g)<1)&&(f=!0),f},zp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eL=function(e){return[e.deltaX,e.deltaY]},tL=function(e){return e&&"current"in e?e.current:e},Xye=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Zye=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},Qye=0,_c=[];function Jye(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),a=y.useState(Qye++)[0],i=y.useState(gF)[0],l=y.useRef(e);y.useEffect(function(){l.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var b=bye([e.lockRef.current],(e.shards||[]).map(tL),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=y.useCallback(function(b,w){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var N=zp(b),O=n.current,C="deltaX"in b?b.deltaX:O[0]-N[0],A="deltaY"in b?b.deltaY:O[1]-N[1],E,k=b.target,T=Math.abs(C)>Math.abs(A)?"h":"v";if("touches"in b&&T==="h"&&k.type==="range")return!1;var P=J3(T,k);if(!P)return!0;if(P?E=T:(E=T==="v"?"h":"v",P=J3(T,k)),!P)return!1;if(!r.current&&"changedTouches"in b&&(C||A)&&(r.current=E),!E)return!0;var $=r.current||E;return Kye($,w,b,$==="h"?C:A)},[]),d=y.useCallback(function(b){var w=b;if(!(!_c.length||_c[_c.length-1]!==i)){var N="deltaY"in w?eL(w):zp(w),O=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&Xye(E.delta,N)})[0];if(O&&O.should){w.cancelable&&w.preventDefault();return}if(!O){var C=(l.current.shards||[]).map(tL).filter(Boolean).filter(function(E){return E.contains(w.target)}),A=C.length>0?u(w,C[0]):!l.current.noIsolation;A&&w.cancelable&&w.preventDefault()}}},[]),f=y.useCallback(function(b,w,N,O){var C={name:b,delta:w,target:N,should:O,shadowParent:exe(N)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(A){return A!==C})},1)},[]),m=y.useCallback(function(b){n.current=zp(b),r.current=void 0},[]),p=y.useCallback(function(b){f(b.type,eL(b),b.target,u(b,e.lockRef.current))},[]),g=y.useCallback(function(b){f(b.type,zp(b),b.target,u(b,e.lockRef.current))},[]);y.useEffect(function(){return _c.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",d,Sc),document.addEventListener("touchmove",d,Sc),document.addEventListener("touchstart",m,Sc),function(){_c=_c.filter(function(b){return b!==i}),document.removeEventListener("wheel",d,Sc),document.removeEventListener("touchmove",d,Sc),document.removeEventListener("touchstart",m,Sc)}},[]);var x=e.removeScrollBar,j=e.inert;return y.createElement(y.Fragment,null,j?y.createElement(i,{styles:Zye(a)}):null,x?y.createElement(Fye,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function exe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const txe=Aye(vF,Jye);var qh=y.forwardRef(function(e,t){return y.createElement(Py,ti({},e,{ref:t,sideCar:txe}))});qh.classNames=Py.classNames;var nxe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Nc=new WeakMap,qp=new WeakMap,Fp={},XS=0,wF=function(e){return e&&(e.host||wF(e.parentNode))},rxe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=wF(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},axe=function(e,t,n,r){var a=rxe(t,Array.isArray(e)?e:[e]);Fp[n]||(Fp[n]=new WeakMap);var i=Fp[n],l=[],u=new Set,d=new Set(a),f=function(p){!p||u.has(p)||(u.add(p),f(p.parentNode))};a.forEach(f);var m=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(g){if(u.has(g))m(g);else try{var x=g.getAttribute(r),j=x!==null&&x!=="false",b=(Nc.get(g)||0)+1,w=(i.get(g)||0)+1;Nc.set(g,b),i.set(g,w),l.push(g),b===1&&j&&qp.set(g,!0),w===1&&g.setAttribute(n,"true"),j||g.setAttribute(r,"true")}catch(N){console.error("aria-hidden: cannot operate on ",g,N)}})};return m(t),u.clear(),XS++,function(){l.forEach(function(p){var g=Nc.get(p)-1,x=i.get(p)-1;Nc.set(p,g),i.set(p,x),g||(qp.has(p)||p.removeAttribute(r),qp.delete(p)),x||p.removeAttribute(n)}),XS--,XS||(Nc=new WeakMap,Nc=new WeakMap,qp=new WeakMap,Fp={})}},My=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=nxe(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),axe(r,a,n,"aria-hidden")):function(){return null}};function ixe(e){const t=oxe(e),n=y.forwardRef((r,a)=>{const{children:i,...l}=r,u=y.Children.toArray(i),d=u.find(lxe);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return o.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return o.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function oxe(e){const t=y.forwardRef((n,r)=>{const{children:a,...i}=n;if(y.isValidElement(a)){const l=uxe(a),u=cxe(i,a.props);return a.type!==y.Fragment&&(u.ref=r?Mr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sxe=Symbol("radix.slottable");function lxe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sxe}function cxe(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function uxe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ry="Dialog",[jF,SF]=fr(Ry),[dxe,Va]=jF(Ry),_F=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,u=y.useRef(null),d=y.useRef(null),[f,m]=_a({prop:r,defaultProp:a??!1,onChange:i,caller:Ry});return o.jsx(dxe,{scope:t,triggerRef:u,contentRef:d,contentId:qn(),titleId:qn(),descriptionId:qn(),open:f,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(p=>!p),[m]),modal:l,children:n})};_F.displayName=Ry;var NF="DialogTrigger",OF=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Va(NF,n),i=qe(t,a.triggerRef);return o.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":eE(a.open),...r,ref:i,onClick:Se(e.onClick,a.onOpenToggle)})});OF.displayName=NF;var QC="DialogPortal",[fxe,CF]=jF(QC,{forceMount:void 0}),EF=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Va(QC,t);return o.jsx(fxe,{scope:t,forceMount:n,children:y.Children.map(r,l=>o.jsx(Mn,{present:n||i.open,children:o.jsx(_l,{asChild:!0,container:a,children:l})}))})};EF.displayName=QC;var Sg="DialogOverlay",AF=y.forwardRef((e,t)=>{const n=CF(Sg,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Va(Sg,e.__scopeDialog);return i.modal?o.jsx(Mn,{present:r||i.open,children:o.jsx(mxe,{...a,ref:t})}):null});AF.displayName=Sg;var hxe=ixe("DialogOverlay.RemoveScroll"),mxe=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Va(Sg,n);return o.jsx(qh,{as:hxe,allowPinchZoom:!0,shards:[a.contentRef],children:o.jsx(Me.div,{"data-state":eE(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),fl="DialogContent",TF=y.forwardRef((e,t)=>{const n=CF(fl,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Va(fl,e.__scopeDialog);return o.jsx(Mn,{present:r||i.open,children:i.modal?o.jsx(pxe,{...a,ref:t}):o.jsx(vxe,{...a,ref:t})})});TF.displayName=fl;var pxe=y.forwardRef((e,t)=>{const n=Va(fl,e.__scopeDialog),r=y.useRef(null),a=qe(t,n.contentRef,r);return y.useEffect(()=>{const i=r.current;if(i)return My(i)},[]),o.jsx(kF,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Se(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Se(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&i.preventDefault()}),onFocusOutside:Se(e.onFocusOutside,i=>i.preventDefault())})}),vxe=y.forwardRef((e,t)=>{const n=Va(fl,e.__scopeDialog),r=y.useRef(!1),a=y.useRef(!1);return o.jsx(kF,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;n.triggerRef.current?.contains(l)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),kF=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=e,u=Va(fl,n),d=y.useRef(null),f=qe(t,d);return ky(),o.jsxs(o.Fragment,{children:[o.jsx(zh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:o.jsx(Sl,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":eE(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(yxe,{titleId:u.titleId}),o.jsx(bxe,{contentRef:d,descriptionId:u.descriptionId})]})]})}),JC="DialogTitle",PF=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Va(JC,n);return o.jsx(Me.h2,{id:a.titleId,...r,ref:t})});PF.displayName=JC;var MF="DialogDescription",RF=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Va(MF,n);return o.jsx(Me.p,{id:a.descriptionId,...r,ref:t})});RF.displayName=MF;var DF="DialogClose",$F=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Va(DF,n);return o.jsx(Me.button,{type:"button",...r,ref:t,onClick:Se(e.onClick,()=>a.onOpenChange(!1))})});$F.displayName=DF;function eE(e){return e?"open":"closed"}var IF="DialogTitleWarning",[gxe,LF]=nZ(IF,{contentName:fl,titleName:JC,docsSlug:"dialog"}),yxe=({titleId:e})=>{const t=LF(IF),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},xxe="DialogDescriptionWarning",bxe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${LF(xxe).contentName}}.`;return y.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},tE=_F,BF=OF,nE=EF,Dy=AF,$y=TF,rE=PF,aE=RF,iE=$F;const tr=tE,zF=BF,wxe=nE,qF=y.forwardRef(({className:e,...t},n)=>o.jsx(Dy,{ref:n,className:ue("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));qF.displayName=Dy.displayName;const Un=y.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(wxe,{children:[o.jsx(qF,{}),o.jsxs($y,{ref:r,className:ue("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,o.jsxs(iE,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[o.jsx(Ih,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Un.displayName=$y.displayName;const Hn=({className:e,...t})=>o.jsx("div",{className:ue("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Hn.displayName="DialogHeader";const Dr=({className:e,...t})=>o.jsx("div",{className:ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Dr.displayName="DialogFooter";const Wn=y.forwardRef(({className:e,...t},n)=>o.jsx(rE,{ref:n,className:ue("text-lg font-semibold leading-none tracking-tight",e),...t}));Wn.displayName=rE.displayName;const ur=y.forwardRef(({className:e,...t},n)=>o.jsx(aE,{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));ur.displayName=aE.displayName;var jxe=Symbol("radix.slottable");function Sxe(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=jxe,t}var FF="AlertDialog",[_xe]=fr(FF,[SF]),fo=SF(),UF=e=>{const{__scopeAlertDialog:t,...n}=e,r=fo(t);return o.jsx(tE,{...r,...n,modal:!0})};UF.displayName=FF;var Nxe="AlertDialogTrigger",HF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=fo(n);return o.jsx(BF,{...a,...r,ref:t})});HF.displayName=Nxe;var Oxe="AlertDialogPortal",WF=e=>{const{__scopeAlertDialog:t,...n}=e,r=fo(t);return o.jsx(nE,{...r,...n})};WF.displayName=Oxe;var Cxe="AlertDialogOverlay",VF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=fo(n);return o.jsx(Dy,{...a,...r,ref:t})});VF.displayName=Cxe;var Vc="AlertDialogContent",[Exe,Axe]=_xe(Vc),Txe=Sxe("AlertDialogContent"),GF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=fo(n),l=y.useRef(null),u=qe(t,l),d=y.useRef(null);return o.jsx(gxe,{contentName:Vc,titleName:YF,docsSlug:"alert-dialog",children:o.jsx(Exe,{scope:n,cancelRef:d,children:o.jsxs($y,{role:"alertdialog",...i,...a,ref:u,onOpenAutoFocus:Se(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[o.jsx(Txe,{children:r}),o.jsx(Pxe,{contentRef:l})]})})})});GF.displayName=Vc;var YF="AlertDialogTitle",KF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=fo(n);return o.jsx(rE,{...a,...r,ref:t})});KF.displayName=YF;var XF="AlertDialogDescription",ZF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=fo(n);return o.jsx(aE,{...a,...r,ref:t})});ZF.displayName=XF;var kxe="AlertDialogAction",QF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=fo(n);return o.jsx(iE,{...a,...r,ref:t})});QF.displayName=kxe;var JF="AlertDialogCancel",e8=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=Axe(JF,n),i=fo(n),l=qe(t,a);return o.jsx(iE,{...i,...r,ref:l})});e8.displayName=JF;var Pxe=({contentRef:e})=>{const t=`\`${Vc}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${Vc}\` by passing a \`${XF}\` component as a child, which also benefits sighted users by adding visible context to the dialog. + +Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Vc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. + +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return y.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Mxe=UF,Rxe=HF,Dxe=WF,t8=VF,n8=GF,r8=QF,a8=e8,i8=KF,o8=ZF;const Pn=Mxe,na=Rxe,$xe=Dxe,s8=y.forwardRef(({className:e,...t},n)=>o.jsx(t8,{className:ue("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));s8.displayName=t8.displayName;const gn=y.forwardRef(({className:e,...t},n)=>o.jsxs($xe,{children:[o.jsx(s8,{}),o.jsx(n8,{ref:n,className:ue("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));gn.displayName=n8.displayName;const yn=({className:e,...t})=>o.jsx("div",{className:ue("flex flex-col space-y-2 text-center sm:text-left",e),...t});yn.displayName="AlertDialogHeader";const xn=({className:e,...t})=>o.jsx("div",{className:ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});xn.displayName="AlertDialogFooter";const bn=y.forwardRef(({className:e,...t},n)=>o.jsx(i8,{ref:n,className:ue("text-lg font-semibold",e),...t}));bn.displayName=i8.displayName;const wn=y.forwardRef(({className:e,...t},n)=>o.jsx(o8,{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));wn.displayName=o8.displayName;const jn=y.forwardRef(({className:e,...t},n)=>o.jsx(r8,{ref:n,className:ue(uh(),e),...t}));jn.displayName=r8.displayName;const Sn=y.forwardRef(({className:e,...t},n)=>o.jsx(a8,{ref:n,className:ue(uh({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Sn.displayName=a8.displayName;function Ixe(){return o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),o.jsxs(ol,{defaultValue:"appearance",className:"w-full",children:[o.jsxs(Xo,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[o.jsxs(Ct,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(Kq,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"外观"})]}),o.jsxs(Ct,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(lge,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"安全"})]}),o.jsxs(Ct,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(Uc,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"其他"})]}),o.jsxs(Ct,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(Gq,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"关于"})]})]}),o.jsxs(Xt,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[o.jsx(Qt,{value:"appearance",className:"mt-0",children:o.jsx(Lxe,{})}),o.jsx(Qt,{value:"security",className:"mt-0",children:o.jsx(Bxe,{})}),o.jsx(Qt,{value:"other",className:"mt-0",children:o.jsx(zxe,{})}),o.jsx(Qt,{value:"about",className:"mt-0",children:o.jsx(qxe,{})})]})]})]})}function nL(e){const t=document.documentElement,r={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[e];if(r)t.style.setProperty("--primary",r.hsl),r.gradient?(t.style.setProperty("--primary-gradient",r.gradient),t.classList.add("has-gradient")):(t.style.removeProperty("--primary-gradient"),t.classList.remove("has-gradient"));else if(e.startsWith("#")){const a=i=>{i=i.replace("#","");const l=parseInt(i.substring(0,2),16)/255,u=parseInt(i.substring(2,4),16)/255,d=parseInt(i.substring(4,6),16)/255,f=Math.max(l,u,d),m=Math.min(l,u,d);let p=0,g=0;const x=(f+m)/2;if(f!==m){const j=f-m;switch(g=x>.5?j/(2-f-m):j/(f+m),f){case l:p=((u-d)/j+(ulocalStorage.getItem("accent-color")||"blue");y.useEffect(()=>{const f=localStorage.getItem("accent-color")||"blue";nL(f)},[]);const d=f=>{u(f),localStorage.setItem("accent-color",f),nL(f)};return o.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[o.jsx(ZS,{value:"light",current:e,onChange:t,label:"浅色",description:"始终使用浅色主题"}),o.jsx(ZS,{value:"dark",current:e,onChange:t,label:"深色",description:"始终使用深色主题"}),o.jsx(ZS,{value:"system",current:e,onChange:t,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),o.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[o.jsx(xa,{value:"blue",current:l,onChange:d,label:"蓝色",colorClass:"bg-blue-500"}),o.jsx(xa,{value:"purple",current:l,onChange:d,label:"紫色",colorClass:"bg-purple-500"}),o.jsx(xa,{value:"green",current:l,onChange:d,label:"绿色",colorClass:"bg-green-500"}),o.jsx(xa,{value:"orange",current:l,onChange:d,label:"橙色",colorClass:"bg-orange-500"}),o.jsx(xa,{value:"pink",current:l,onChange:d,label:"粉色",colorClass:"bg-pink-500"}),o.jsx(xa,{value:"red",current:l,onChange:d,label:"红色",colorClass:"bg-red-500"})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),o.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[o.jsx(xa,{value:"gradient-sunset",current:l,onChange:d,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),o.jsx(xa,{value:"gradient-ocean",current:l,onChange:d,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),o.jsx(xa,{value:"gradient-forest",current:l,onChange:d,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),o.jsx(xa,{value:"gradient-aurora",current:l,onChange:d,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),o.jsx(xa,{value:"gradient-fire",current:l,onChange:d,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),o.jsx(xa,{value:"gradient-twilight",current:l,onChange:d,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[o.jsx("div",{className:"flex-1",children:o.jsx("input",{type:"color",value:l.startsWith("#")?l:"#3b82f6",onChange:f=>d(f.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),o.jsx("div",{className:"flex-1",children:o.jsx(Ne,{type:"text",value:l,onChange:f=>d(f.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),o.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),o.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[o.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5 flex-1",children:[o.jsx(J,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),o.jsx(at,{id:"animations",checked:n,onCheckedChange:r})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5 flex-1",children:[o.jsx(J,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),o.jsx(at,{id:"waves-background",checked:a,onCheckedChange:i})]})})]})]})]})}function Bxe(){const e=ia(),[t,n]=y.useState(""),[r,a]=y.useState(""),[i,l]=y.useState(!1),[u,d]=y.useState(!1),[f,m]=y.useState(!1),[p,g]=y.useState(!1),[x,j]=y.useState(!1),[b,w]=y.useState(!1),[N,O]=y.useState(""),[C,A]=y.useState(!1),{toast:E}=hr(),k=y.useMemo(()=>eye(r),[r]),T=()=>localStorage.getItem("access-token")||"",P=async H=>{try{await navigator.clipboard.writeText(H),j(!0),E({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>j(!1),2e3)}catch{E({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},$=async()=>{if(!r.trim()){E({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!k.isValid){const H=k.rules.filter(G=>!G.passed).map(G=>G.label).join(", ");E({title:"格式错误",description:`Token 不符合要求: ${H}`,variant:"destructive"});return}m(!0);try{const H=T(),G=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${H}`},body:JSON.stringify({new_token:r.trim()})}),L=await G.json();G.ok&&L.success?(localStorage.setItem("access-token",r.trim()),a(""),t&&n(r.trim()),E({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{localStorage.removeItem("access-token"),e({to:"/auth"})},1500)):E({title:"更新失败",description:L.message||"无法更新 Token",variant:"destructive"})}catch(H){console.error("更新 Token 错误:",H),E({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{m(!1)}},z=async()=>{g(!0);try{const H=T(),G=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${H}`}}),L=await G.json();G.ok&&L.success?(localStorage.setItem("access-token",L.token),n(L.token),O(L.token),w(!0),A(!1),E({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):E({title:"生成失败",description:L.message||"无法生成新 Token",variant:"destructive"})}catch(H){console.error("生成 Token 错误:",H),E({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{g(!1)}},D=async()=>{try{await navigator.clipboard.writeText(N),A(!0),E({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{E({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},U=()=>{w(!1),setTimeout(()=>{O(""),A(!1)},300),setTimeout(()=>{localStorage.removeItem("access-token"),e({to:"/auth"})},500)},V=H=>{H||U()};return o.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[o.jsx(tr,{open:b,onOpenChange:V,children:o.jsxs(Un,{className:"sm:max-w-md",children:[o.jsxs(Hn,{children:[o.jsxs(Wn,{className:"flex items-center gap-2",children:[o.jsx(Hc,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),o.jsx(ur,{children:"这是您的新 Token,请立即保存。关闭此窗口后将跳转到登录页面。"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[o.jsx(J,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),o.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:N})]}),o.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Hc,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),o.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[o.jsx("p",{className:"font-semibold",children:"重要提示"}),o.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[o.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),o.jsx("li",{children:"请立即复制并保存到安全的位置"}),o.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),o.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),o.jsxs(Dr,{className:"gap-2 sm:gap-0",children:[o.jsx(fe,{variant:"outline",onClick:D,className:"gap-2",children:C?o.jsxs(o.Fragment,{children:[o.jsx(tl,{className:"h-4 w-4 text-green-500"}),"已复制"]}):o.jsxs(o.Fragment,{children:[o.jsx(qN,{className:"h-4 w-4"}),"复制 Token"]})}),o.jsx(fe,{onClick:U,children:"我已保存,关闭"})]})]})}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),o.jsx("div",{className:"space-y-3 sm:space-y-4",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx(Ne,{id:"current-token",type:i?"text":"password",value:t||T(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),o.jsx("button",{onClick:()=>{t||n(T()),l(!i)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:i?"隐藏":"显示",children:i?o.jsx(UN,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(ro,{className:"h-4 w-4 text-muted-foreground"})})]}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[o.jsx(fe,{variant:"outline",size:"icon",onClick:()=>P(T()),title:"复制到剪贴板",className:"flex-shrink-0",children:x?o.jsx(tl,{className:"h-4 w-4 text-green-500"}):o.jsx(qN,{className:"h-4 w-4"})}),o.jsxs(Pn,{children:[o.jsx(na,{asChild:!0,children:o.jsxs(fe,{variant:"outline",disabled:p,className:"gap-2 flex-1 sm:flex-none",children:[o.jsx(rl,{className:ue("h-4 w-4",p&&"animate-spin")}),o.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),o.jsx("span",{className:"sm:hidden",children:"生成"})]})}),o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认重新生成 Token"}),o.jsx(wn,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:z,children:"确认生成"})]})]})]})]})]}),o.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),o.jsxs("div",{className:"relative",children:[o.jsx(Ne,{id:"new-token",type:u?"text":"password",value:r,onChange:H=>a(H.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),o.jsx("button",{onClick:()=>d(!u),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:u?"隐藏":"显示",children:u?o.jsx(UN,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(ro,{className:"h-4 w-4 text-muted-foreground"})})]}),r&&o.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),o.jsx("div",{className:"space-y-1.5",children:k.rules.map(H=>o.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[H.passed?o.jsx(Ou,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):o.jsx(Vq,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),o.jsx("span",{className:ue(H.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:H.label})]},H.id))}),k.isValid&&o.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:o.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[o.jsx(tl,{className:"h-4 w-4"}),o.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),o.jsx(fe,{onClick:$,disabled:f||!k.isValid||!r,className:"w-full sm:w-auto",children:f?"更新中...":"更新自定义 Token"})]})]}),o.jsxs("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3 sm:p-4",children:[o.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),o.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[o.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),o.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),o.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),o.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),o.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),o.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function zxe(){const e=ia(),{toast:t}=hr(),[n,r]=y.useState(!1),a=async()=>{r(!0);try{const i=localStorage.getItem("access-token"),l=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${i}`}}),u=await l.json();l.ok&&u.success?(t({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{e({to:"/setup"})},1e3)):t({title:"重置失败",description:u.message||"无法重置配置状态",variant:"destructive"})}catch(i){console.error("重置配置状态错误:",i),t({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{r(!1)}};return o.jsx("div",{className:"space-y-4 sm:space-y-6",children:o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsx("div",{className:"space-y-2",children:o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),o.jsxs(Pn,{children:[o.jsx(na,{asChild:!0,children:o.jsxs(fe,{variant:"outline",disabled:n,className:"gap-2",children:[o.jsx(Qve,{className:ue("h-4 w-4",n&&"animate-spin")}),"重新进行初次配置"]})}),o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认重新配置"}),o.jsx(wn,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:a,children:"确认重置"})]})]})]})]})]})})}function qxe(){return o.jsx("div",{className:"space-y-4 sm:space-y-6",children:o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",ZC]}),o.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[o.jsxs("p",{children:["版本: ",XC]}),o.jsx("p",{children:"基于 React 19 + Vite + TanStack Router"})]})]})})}function ZS({value:e,current:t,onChange:n,label:r,description:a}){const i=t===e;return o.jsxs("button",{onClick:()=>n(e),className:ue("relative rounded-lg border-2 p-3 sm:p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",i?"border-primary bg-accent":"border-border"),children:[i&&o.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"text-sm sm:text-base font-medium",children:r}),o.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:a})]}),o.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[e==="light"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),e==="dark"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),e==="system"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function xa({value:e,current:t,onChange:n,label:r,colorClass:a}){const i=t===e;return o.jsxs("button",{onClick:()=>n(e),className:ue("relative rounded-lg border-2 p-2 sm:p-3 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",i?"border-primary bg-accent":"border-border"),children:[i&&o.jsx("div",{className:"absolute top-1.5 right-1.5 sm:top-2 sm:right-2 h-1.5 w-1.5 sm:h-2 sm:w-2 rounded-full bg-primary"}),o.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[o.jsx("div",{className:ue("h-8 w-8 sm:h-10 sm:w-10 rounded-full",a)}),o.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:r})]})]})}class Fxe{grad3;p;perm;constructor(t=0){this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.p=[];for(let n=0;n<256;n++)this.p[n]=Math.floor(Math.random()*256);this.perm=[];for(let n=0;n<512;n++)this.perm[n]=this.p[n&255]}dot(t,n,r){return t[0]*n+t[1]*r}mix(t,n,r){return(1-r)*t+r*n}fade(t){return t*t*t*(t*(t*6-15)+10)}perlin2(t,n){const r=Math.floor(t)&255,a=Math.floor(n)&255;t-=Math.floor(t),n-=Math.floor(n);const i=this.fade(t),l=this.fade(n),u=this.perm[r]+a,d=this.perm[u],f=this.perm[u+1],m=this.perm[r+1]+a,p=this.perm[m],g=this.perm[m+1];return this.mix(this.mix(this.dot(this.grad3[d%12],t,n),this.dot(this.grad3[p%12],t-1,n),i),this.mix(this.dot(this.grad3[f%12],t,n-1),this.dot(this.grad3[g%12],t-1,n-1),i),l)}}function Uxe(){const e=y.useRef(null),t=y.useRef(null),n=y.useRef(void 0),r=y.useRef({mouse:{x:-10,y:0,lx:0,ly:0,sx:0,sy:0,v:0,vs:0,a:0,set:!1},lines:[],paths:[],noise:new Fxe(Math.random()),bounding:null});return y.useEffect(()=>{const a=t.current,i=e.current;if(!a||!i)return;const l=r.current,u=()=>{const b=a.getBoundingClientRect();l.bounding=b,i.style.width=`${b.width}px`,i.style.height=`${b.height}px`},d=()=>{if(!l.bounding)return;const{width:b,height:w}=l.bounding;l.lines=[],l.paths.forEach($=>$.remove()),l.paths=[];const N=10,O=32,C=b+200,A=w+30,E=Math.ceil(C/N),k=Math.ceil(A/O),T=(b-N*E)/2,P=(w-O*k)/2;for(let $=0;$<=E;$++){const z=[];for(let U=0;U<=k;U++){const V={x:T+N*$,y:P+O*U,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};z.push(V)}const D=document.createElementNS("http://www.w3.org/2000/svg","path");i.appendChild(D),l.paths.push(D),l.lines.push(z)}},f=b=>{const{lines:w,mouse:N,noise:O}=l;w.forEach(C=>{C.forEach(A=>{const E=O.perlin2((A.x+b*.0125)*.002,(A.y+b*.005)*.0015)*12;A.wave.x=Math.cos(E)*32,A.wave.y=Math.sin(E)*16;const k=A.x-N.sx,T=A.y-N.sy,P=Math.hypot(k,T),$=Math.max(175,N.vs);if(P<$){const z=1-P/$,D=Math.cos(P*.001)*z;A.cursor.vx+=Math.cos(N.a)*D*$*N.vs*65e-5,A.cursor.vy+=Math.sin(N.a)*D*$*N.vs*65e-5}A.cursor.vx+=(0-A.cursor.x)*.005,A.cursor.vy+=(0-A.cursor.y)*.005,A.cursor.vx*=.925,A.cursor.vy*=.925,A.cursor.x+=A.cursor.vx*2,A.cursor.y+=A.cursor.vy*2,A.cursor.x=Math.min(100,Math.max(-100,A.cursor.x)),A.cursor.y=Math.min(100,Math.max(-100,A.cursor.y))})})},m=(b,w=!0)=>{const N={x:b.x+b.wave.x+(w?b.cursor.x:0),y:b.y+b.wave.y+(w?b.cursor.y:0)};return N.x=Math.round(N.x*10)/10,N.y=Math.round(N.y*10)/10,N},p=()=>{const{lines:b,paths:w}=l;b.forEach((N,O)=>{let C=m(N[0],!1),A=`M ${C.x} ${C.y}`;N.forEach((E,k)=>{const T=k===N.length-1;C=m(E,!T),A+=`L ${C.x} ${C.y}`}),w[O].setAttribute("d",A)})},g=b=>{const{mouse:w}=l;w.sx+=(w.x-w.sx)*.1,w.sy+=(w.y-w.sy)*.1;const N=w.x-w.lx,O=w.y-w.ly,C=Math.hypot(N,O);w.v=C,w.vs+=(C-w.vs)*.1,w.vs=Math.min(100,w.vs),w.lx=w.x,w.ly=w.y,w.a=Math.atan2(O,N),a&&(a.style.setProperty("--x",`${w.sx}px`),a.style.setProperty("--y",`${w.sy}px`)),f(b),p(),n.current=requestAnimationFrame(g)},x=b=>{if(!l.bounding)return;const{mouse:w}=l;w.x=b.pageX-l.bounding.left,w.y=b.pageY-l.bounding.top+window.scrollY,w.set||(w.sx=w.x,w.sy=w.y,w.lx=w.x,w.ly=w.y,w.set=!0)},j=()=>{u(),d()};return u(),d(),window.addEventListener("resize",j),window.addEventListener("mousemove",x),n.current=requestAnimationFrame(g),()=>{window.removeEventListener("resize",j),window.removeEventListener("mousemove",x),n.current&&cancelAnimationFrame(n.current)}},[]),o.jsxs("div",{ref:t,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[o.jsx("div",{className:"waves-cursor",style:{position:"absolute",top:0,left:0,width:"0.5rem",height:"0.5rem",background:"hsl(var(--primary) / 0.3)",borderRadius:"50%",transform:"translate3d(calc(var(--x, -0.5rem) - 50%), calc(var(--y, 50%) - 50%), 0)",willChange:"transform",pointerEvents:"none"}}),o.jsx("svg",{ref:e,style:{display:"block",width:"100%",height:"100%"},children:o.jsx("style",{children:` + path { + fill: none; + stroke: hsl(var(--primary) / 0.20); + stroke-width: 1px; + } + `})})]})}function Hxe(){const e=ia();y.useEffect(()=>{localStorage.getItem("access-token")||e({to:"/auth"})},[e])}function l8(){return!!localStorage.getItem("access-token")}function Wxe(){const[e,t]=y.useState(""),[n,r]=y.useState(!1),[a,i]=y.useState(""),l=ia(),{enableWavesBackground:u,setEnableWavesBackground:d}=tF(),{theme:f,setTheme:m}=KC();y.useEffect(()=>{l8()&&l({to:"/"})},[l]);const g=f==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":f,x=()=>{m(g==="dark"?"light":"dark")},j=async b=>{if(b.preventDefault(),i(""),!e.trim()){i("请输入 Access Token");return}r(!0);try{const w=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e.trim()})}),N=await w.json();if(w.ok&&N.valid){localStorage.setItem("access-token",e.trim());const O=await fetch("/api/webui/setup/status",{method:"GET",headers:{Authorization:`Bearer ${e.trim()}`}}),C=await O.json();O.ok&&C.is_first_setup?l({to:"/setup"}):l({to:"/"})}else i(N.message||"Token 验证失败,请检查后重试")}catch(w){console.error("Token 验证错误:",w),i("连接服务器失败,请检查网络连接")}finally{r(!1)}};return o.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[u&&o.jsx(Uxe,{}),o.jsxs(dt,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[o.jsx("button",{onClick:x,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:g==="dark"?"切换到浅色模式":"切换到深色模式",children:g==="dark"?o.jsx(GN,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):o.jsx(VN,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),o.jsxs(Vt,{className:"space-y-4 text-center",children:[o.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:o.jsx(L3,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Gt,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),o.jsx(Jn,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),o.jsx(ln,{children:o.jsxs("form",{onSubmit:j,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),o.jsxs("div",{className:"relative",children:[o.jsx(Rve,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),o.jsx(Ne,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:e,onChange:b=>t(b.target.value),className:ue("pl-10",a&&"border-red-500 focus-visible:ring-red-500"),disabled:n,autoFocus:!0,autoComplete:"off"})]})]}),a&&o.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-red-50 p-3 text-sm text-red-600 dark:bg-red-950/50 dark:text-red-400",children:[o.jsx(yg,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),o.jsx("span",{children:a})]}),o.jsx(fe,{type:"submit",className:"w-full",disabled:n,children:n?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),o.jsxs(tr,{children:[o.jsx(zF,{asChild:!0,children:o.jsxs("button",{className:"w-full text-center text-sm text-primary hover:text-primary/80 transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[o.jsx(uve,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),o.jsxs(Un,{className:"sm:max-w-md",children:[o.jsxs(Hn,{children:[o.jsxs(Wn,{className:"flex items-center gap-2",children:[o.jsx(L3,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),o.jsx(ur,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(yge,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),o.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[o.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),o.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),o.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(WC,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),o.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:o.jsx("code",{className:"text-primary",children:"data/webui.json"})}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",o.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),o.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(yg,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),o.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[o.jsx("p",{className:"font-semibold",children:"安全提示"}),o.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[o.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),o.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]}),o.jsxs(Pn,{children:[o.jsx(na,{asChild:!0,children:o.jsxs("button",{className:"w-full text-center text-sm text-muted-foreground hover:text-foreground transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[o.jsx(ch,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsxs(bn,{className:"flex items-center gap-2",children:[o.jsx(ch,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),o.jsx(wn,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),o.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:()=>d(!1),children:"关闭动画"})]})]})]})]})})]}),o.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:o.jsx("p",{children:tye})})]})}function Vxe(e,t=[]){let n=[];function r(i,l){const u=y.createContext(l);u.displayName=i+"Context";const d=n.length;n=[...n,l];const f=p=>{const{scope:g,children:x,...j}=p,b=g?.[e]?.[d]||u,w=y.useMemo(()=>j,Object.values(j));return o.jsx(b.Provider,{value:w,children:x})};f.displayName=i+"Provider";function m(p,g){const x=g?.[e]?.[d]||u,j=y.useContext(x);if(j)return j;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,m]}const a=()=>{const i=n.map(l=>y.createContext(l));return function(u){const d=u?.[e]||i;return y.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return a.scopeName=e,[r,Gxe(a,...t)]}function Gxe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...u,...p}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Yxe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],c8=Yxe.reduce((e,t)=>{const n=Lh(`Primitive.${t}`),r=y.forwardRef((a,i)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(d,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),oE="Progress",sE=100,[Kxe]=Vxe(oE),[Xxe,Zxe]=Kxe(oE),u8=y.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=Qxe,...l}=e;(a||a===0)&&!rL(a)&&console.error(Jxe(`${a}`,"Progress"));const u=rL(a)?a:sE;r!==null&&!aL(r,u)&&console.error(ebe(`${r}`,"Progress"));const d=aL(r,u)?r:null,f=_g(d)?i(d,u):void 0;return o.jsx(Xxe,{scope:n,value:d,max:u,children:o.jsx(c8.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":_g(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":h8(d,u),"data-value":d??void 0,"data-max":u,...l,ref:t})})});u8.displayName=oE;var d8="ProgressIndicator",f8=y.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=Zxe(d8,n);return o.jsx(c8.div,{"data-state":h8(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});f8.displayName=d8;function Qxe(e,t){return`${Math.round(e/t*100)}%`}function h8(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function _g(e){return typeof e=="number"}function rL(e){return _g(e)&&!isNaN(e)&&e>0}function aL(e,t){return _g(e)&&!isNaN(e)&&e<=t&&e>=0}function Jxe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${sE}\`.`}function ebe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: + - a positive number + - less than the value passed to \`max\` (or ${sE} if no \`max\` prop is set) + - \`null\` or \`undefined\` if the progress is indeterminate. + +Defaulting to \`null\`.`}var m8=u8,tbe=f8;const lE=y.forwardRef(({className:e,value:t,...n},r)=>o.jsx(m8,{ref:r,className:ue("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:o.jsx(tbe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));lE.displayName=m8.displayName;const qt=y.forwardRef(({className:e,...t},n)=>o.jsx("textarea",{className:ue("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));qt.displayName="Textarea";var nbe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rbe=nbe.reduce((e,t)=>{const n=Lh(`Primitive.${t}`),r=y.forwardRef((a,i)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(d,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),abe="Separator",iL="horizontal",ibe=["horizontal","vertical"],p8=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=iL,...a}=e,i=obe(r)?r:iL,u=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return o.jsx(rbe.div,{"data-orientation":i,...u,...a,ref:t})});p8.displayName=abe;function obe(e){return ibe.includes(e)}var v8=p8;const dh=y.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>o.jsx(v8,{ref:a,decorative:n,orientation:t,className:ue("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));dh.displayName=v8.displayName;const sbe=Bh("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function en({className:e,variant:t,...n}){return o.jsx("div",{className:ue(sbe({variant:t}),e),...n})}function lbe({config:e,onChange:t}){const n=a=>{a.trim()&&!e.alias_names.includes(a.trim())&&t({...e,alias_names:[...e.alias_names,a.trim()]})},r=a=>{t({...e,alias_names:e.alias_names.filter((i,l)=>l!==a)})};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx(J,{htmlFor:"qq_account",children:"QQ账号 *"}),o.jsx(Ne,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:e.qq_account||"",onChange:a=>t({...e,qq_account:Number(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(J,{htmlFor:"nickname",children:"昵称 *"}),o.jsx(Ne,{id:"nickname",placeholder:"请输入机器人的昵称",value:e.nickname,onChange:a=>t({...e,nickname:a.target.value})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(J,{children:"别名"}),o.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:e.alias_names.map((a,i)=>o.jsxs(en,{variant:"secondary",className:"gap-1",children:[a,o.jsx("button",{type:"button",onClick:()=>r(i),className:"ml-1 hover:text-destructive",children:o.jsx(Ih,{className:"h-3 w-3"})})]},i))}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Ne,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:a=>{a.key==="Enter"&&(n(a.target.value),a.target.value="")}}),o.jsx(fe,{type:"button",variant:"outline",onClick:()=>{const a=document.getElementById("alias_input");a&&(n(a.value),a.value="")},children:"添加"})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function cbe({config:e,onChange:t}){return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx(J,{htmlFor:"personality",children:"人格特征 *"}),o.jsx(qt,{id:"personality",placeholder:"描述机器人的人格特质和身份特征(建议120字以内)",value:e.personality,onChange:n=>t({...e,personality:n.target.value}),rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(J,{htmlFor:"reply_style",children:"表达风格 *"}),o.jsx(qt,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:e.reply_style,onChange:n=>t({...e,reply_style:n.target.value}),rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(J,{htmlFor:"interest",children:"兴趣 *"}),o.jsx(qt,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:e.interest,onChange:n=>t({...e,interest:n.target.value}),rows:2}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),o.jsx(dh,{}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(J,{htmlFor:"plan_style",children:"群聊说话规则 *"}),o.jsx(qt,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:e.plan_style,onChange:n=>t({...e,plan_style:n.target.value}),rows:4}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(J,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),o.jsx(qt,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:e.private_plan_style,onChange:n=>t({...e,private_plan_style:n.target.value}),rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function ube({config:e,onChange:t}){return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(J,{htmlFor:"emoji_chance",children:"表情包激活概率"}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:[(e.emoji_chance*100).toFixed(0),"%"]})]}),o.jsx(Ne,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:e.emoji_chance,onChange:n=>t({...e,emoji_chance:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(J,{htmlFor:"max_reg_num",children:"最大表情包数量"}),o.jsx(Ne,{id:"max_reg_num",type:"number",min:"1",max:"200",value:e.max_reg_num,onChange:n=>t({...e,max_reg_num:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(J,{htmlFor:"do_replace",children:"达到最大数量时替换"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),o.jsx(at,{id:"do_replace",checked:e.do_replace,onCheckedChange:n=>t({...e,do_replace:n})})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(J,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),o.jsx(Ne,{id:"check_interval",type:"number",min:"1",max:"120",value:e.check_interval,onChange:n=>t({...e,check_interval:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),o.jsx(dh,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(J,{htmlFor:"steal_emoji",children:"偷取表情包"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),o.jsx(at,{id:"steal_emoji",checked:e.steal_emoji,onCheckedChange:n=>t({...e,steal_emoji:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(J,{htmlFor:"content_filtration",children:"启用表情包过滤"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),o.jsx(at,{id:"content_filtration",checked:e.content_filtration,onCheckedChange:n=>t({...e,content_filtration:n})})]}),e.content_filtration&&o.jsxs("div",{className:"space-y-3",children:[o.jsx(J,{htmlFor:"filtration_prompt",children:"过滤要求"}),o.jsx(Ne,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:e.filtration_prompt,onChange:n=>t({...e,filtration_prompt:n.target.value})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function dbe({config:e,onChange:t}){return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(J,{htmlFor:"enable_tool",children:"启用工具系统"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),o.jsx(at,{id:"enable_tool",checked:e.enable_tool,onCheckedChange:n=>t({...e,enable_tool:n})})]}),o.jsx(dh,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(J,{htmlFor:"enable_mood",children:"启用情绪系统"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),o.jsx(at,{id:"enable_mood",checked:e.enable_mood,onCheckedChange:n=>t({...e,enable_mood:n})})]}),e.enable_mood&&o.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx(J,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),o.jsx(Ne,{id:"mood_update_threshold",type:"number",min:"0.1",max:"10",step:"0.1",value:e.mood_update_threshold||1,onChange:n=>t({...e,mood_update_threshold:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(J,{htmlFor:"emotion_style",children:"情感特征"}),o.jsx(qt,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:e.emotion_style||"",onChange:n=>t({...e,emotion_style:n.target.value}),rows:2}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),o.jsx(dh,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(J,{htmlFor:"all_global",children:"启用全局黑话模式"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),o.jsx(at,{id:"all_global",checked:e.all_global,onCheckedChange:n=>t({...e,all_global:n})})]})]})}async function Ze(e,t){const n=await fetch(e,t);if(n.status===401)throw localStorage.removeItem("access-token"),window.location.href="/auth",new Error("认证失败,请重新登录");return n}function st(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function fbe(){const e=await Ze("/api/webui/config/bot",{method:"GET",headers:st()});if(!e.ok)throw new Error("读取Bot配置失败");const n=(await e.json()).config.bot||{};return{qq_account:n.qq_account||0,nickname:n.nickname||"",alias_names:n.alias_names||[]}}async function hbe(){const e=await Ze("/api/webui/config/bot",{method:"GET",headers:st()});if(!e.ok)throw new Error("读取人格配置失败");const n=(await e.json()).config.personality||{};return{personality:n.personality||"",reply_style:n.reply_style||"",interest:n.interest||"",plan_style:n.plan_style||"",private_plan_style:n.private_plan_style||""}}async function mbe(){const e=await Ze("/api/webui/config/bot",{method:"GET",headers:st()});if(!e.ok)throw new Error("读取表情包配置失败");const n=(await e.json()).config.emoji||{};return{emoji_chance:n.emoji_chance??.4,max_reg_num:n.max_reg_num??40,do_replace:n.do_replace??!0,check_interval:n.check_interval??10,steal_emoji:n.steal_emoji??!0,content_filtration:n.content_filtration??!1,filtration_prompt:n.filtration_prompt||""}}async function pbe(){const e=await Ze("/api/webui/config/bot",{method:"GET",headers:st()});if(!e.ok)throw new Error("读取其他配置失败");const n=(await e.json()).config,r=n.tool||{},a=n.mood||{},i=n.jargon||{};return{enable_tool:r.enable_tool??!0,enable_mood:a.enable_mood??!1,mood_update_threshold:a.mood_update_threshold,emotion_style:a.emotion_style,all_global:i.all_global??!0}}async function vbe(e){const t=await Ze("/api/webui/config/bot/section/bot",{method:"POST",headers:st(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存Bot基础配置失败")}return await t.json()}async function gbe(e){const t=await Ze("/api/webui/config/bot/section/personality",{method:"POST",headers:st(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存人格配置失败")}return await t.json()}async function ybe(e){const t=await Ze("/api/webui/config/bot/section/emoji",{method:"POST",headers:st(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存表情包配置失败")}return await t.json()}async function xbe(e){const t=[];t.push(Ze("/api/webui/config/bot/section/tool",{method:"POST",headers:st(),body:JSON.stringify({enable_tool:e.enable_tool})})),t.push(Ze("/api/webui/config/bot/section/jargon",{method:"POST",headers:st(),body:JSON.stringify({all_global:e.all_global})}));const n={enable_mood:e.enable_mood};e.enable_mood&&(n.mood_update_threshold=e.mood_update_threshold||1,n.emotion_style=e.emotion_style||""),t.push(Ze("/api/webui/config/bot/section/mood",{method:"POST",headers:st(),body:JSON.stringify(n)}));const r=await Promise.all(t);for(const a of r)if(!a.ok){const i=await a.json();throw new Error(i.detail||"保存其他配置失败")}return{success:!0}}async function oL(){const e=localStorage.getItem("access-token"),t=await Ze("/api/webui/setup/complete",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!t.ok){const n=await t.json();throw new Error(n.message||"标记配置完成失败")}return await t.json()}function bbe(){const e=ia(),{toast:t}=hr(),[n,r]=y.useState(0),[a,i]=y.useState(!1),[l,u]=y.useState(!1),[d,f]=y.useState(!0),[m,p]=y.useState({qq_account:0,nickname:"",alias_names:[]}),[g,x]=y.useState({personality:"是一个女大学生,现在在读大二,会刷贴吧。",reply_style:"请回复的平淡一些,简短一些,说中文,不要刻意突出自身学科背景。可以参考贴吧,知乎和微博的回复风格。",interest:"对技术相关话题,游戏和动漫相关话题感兴趣,也对日常话题感兴趣,不喜欢太过沉重严肃的话题",plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 +2.如果相同的内容已经被执行,请不要重复执行 +3.请控制你的发言频率,不要太过频繁的发言 +4.如果有人对你感到厌烦,请减少回复 +5.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对`,private_plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 +2.如果相同的内容已经被执行,请不要重复执行 +3.某句话如果已经被回复过,不要重复回复`}),[j,b]=y.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"符合公序良俗"}),[w,N]=y.useState({enable_tool:!0,enable_mood:!1,mood_update_threshold:1,emotion_style:"情绪较为稳定,但遭遇特定事件的时候起伏较大",all_global:!0}),O=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:Kpe},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:Zq},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:GC},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:Uc},{id:"complete",title:"完成设置",description:"后续配置提示",icon:ch}],C=(n+1)/O.length*100;y.useEffect(()=>{(async()=>{try{f(!0);const[D,U,V,H]=await Promise.all([fbe(),hbe(),mbe(),pbe()]);p(D),x(U),b(V),N(H)}catch(D){t({title:"加载配置失败",description:D instanceof Error?D.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{f(!1)}})()},[t]);const A=async()=>{u(!0);try{switch(n){case 0:await vbe(m);break;case 1:await gbe(g);break;case 2:await ybe(j);break;case 3:await xbe(w);break}return t({title:"保存成功",description:`${O[n].title}配置已保存`}),!0}catch(z){return t({title:"保存失败",description:z instanceof Error?z.message:"未知错误",variant:"destructive"}),!1}finally{u(!1)}},E=async()=>{await A()&&n{n>0&&r(n-1)},T=async()=>{i(!0);try{if(!await A()){i(!1);return}await oL(),t({title:"配置完成",description:"所有配置已保存,正在跳转..."}),setTimeout(()=>{e({to:"/"})},500)}catch(z){t({title:"完成失败",description:z instanceof Error?z.message:"未知错误",variant:"destructive"})}finally{i(!1)}},P=async()=>{try{await oL(),e({to:"/"})}catch(z){t({title:"跳过失败",description:z instanceof Error?z.message:"未知错误",variant:"destructive"})}},$=()=>{switch(n){case 0:return o.jsx(lbe,{config:m,onChange:p});case 1:return o.jsx(cbe,{config:g,onChange:x});case 2:return o.jsx(ube,{config:j,onChange:b});case 3:return o.jsx(dbe,{config:w,onChange:N});case 4:return o.jsxs("div",{className:"space-y-6 text-center py-8",children:[o.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:o.jsx(ch,{className:"h-8 w-8 text-primary",strokeWidth:2})}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("h3",{className:"text-xl font-semibold",children:"模型配置"}),o.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"为了让机器人正常工作,您需要配置 AI 模型提供商和模型。"})]}),o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-6 max-w-md mx-auto text-left space-y-4",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"mt-0.5",children:o.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"1"})}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium",children:"配置 API 提供商"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → API 提供商"中添加您的 API 提供商信息'})]})]}),o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"mt-0.5",children:o.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"2"})}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium",children:"添加模型"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型列表"中添加需要使用的模型'})]})]}),o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"mt-0.5",children:o.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"3"})}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium",children:"配置模型任务"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型任务配置"中为不同任务分配模型'})]})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"💡 提示:完成向导后,您可以在系统设置中进行详细的模型配置"})]});default:return null}};return o.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-gradient-to-br from-primary/5 via-background to-secondary/5 p-4 md:p-6",children:[o.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[o.jsx("div",{className:"absolute left-1/4 top-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-primary/5 blur-3xl"}),o.jsx("div",{className:"absolute right-1/4 bottom-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-secondary/5 blur-3xl"})]}),d?o.jsxs("div",{className:"relative z-10 text-center",children:[o.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:o.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),o.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),o.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[o.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[o.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 md:h-16 md:w-16 items-center justify-center rounded-2xl bg-primary/10",children:o.jsx(hge,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),o.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),o.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",ZC," 的初始配置"]})]}),o.jsxs("div",{className:"mb-6 md:mb-8",children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[o.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",n+1," / ",O.length]}),o.jsxs("span",{className:"font-medium text-primary",children:[Math.round(C),"%"]})]}),o.jsx(lE,{value:C,className:"h-2"})]}),o.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:O.map((z,D)=>{const U=z.icon;return o.jsxs("div",{className:ue("flex flex-1 flex-col items-center gap-1 md:gap-2",De({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[o.jsx(wg,{className:"h-4 w-4"}),"返回首页"]}),o.jsxs(fe,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[o.jsx(Uq,{className:"h-4 w-4"}),"返回上一页"]})]}),o.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}var y8=["PageUp","PageDown"],x8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],b8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Wu="Slider",[XN,wbe,jbe]=_h(Wu),[w8]=fr(Wu,[jbe]),[Sbe,Iy]=w8(Wu),j8=y.forwardRef((e,t)=>{const{name:n,min:r=0,max:a=100,step:i=1,orientation:l="horizontal",disabled:u=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[r],value:m,onValueChange:p=()=>{},onValueCommit:g=()=>{},inverted:x=!1,form:j,...b}=e,w=y.useRef(new Set),N=y.useRef(0),C=l==="horizontal"?_be:Nbe,[A=[],E]=_a({prop:m,defaultProp:f,onChange:D=>{[...w.current][N.current]?.focus(),p(D)}}),k=y.useRef(A);function T(D){const U=Tbe(A,D);z(D,U)}function P(D){z(D,N.current)}function $(){const D=k.current[N.current];A[N.current]!==D&&g(A)}function z(D,U,{commit:V}={commit:!1}){const H=Rbe(i),G=Dbe(Math.round((D-r)/i)*i+r,H),L=Of(G,[r,a]);E((R=[])=>{const F=Ebe(R,L,U);if(Mbe(F,d*i)){N.current=F.indexOf(L);const K=String(F)!==String(R);return K&&V&&g(F),K?F:R}else return R})}return o.jsx(Sbe,{scope:e.__scopeSlider,name:n,disabled:u,min:r,max:a,valueIndexToChangeRef:N,thumbs:w.current,values:A,orientation:l,form:j,children:o.jsx(XN.Provider,{scope:e.__scopeSlider,children:o.jsx(XN.Slot,{scope:e.__scopeSlider,children:o.jsx(C,{"aria-disabled":u,"data-disabled":u?"":void 0,...b,ref:t,onPointerDown:Se(b.onPointerDown,()=>{u||(k.current=A)}),min:r,max:a,inverted:x,onSlideStart:u?void 0:T,onSlideMove:u?void 0:P,onSlideEnd:u?void 0:$,onHomeKeyDown:()=>!u&&z(r,0,{commit:!0}),onEndKeyDown:()=>!u&&z(a,A.length-1,{commit:!0}),onStepKeyDown:({event:D,direction:U})=>{if(!u){const G=y8.includes(D.key)||D.shiftKey&&x8.includes(D.key)?10:1,L=N.current,R=A[L],F=i*G*U;z(R+F,L,{commit:!0})}}})})})})});j8.displayName=Wu;var[S8,_8]=w8(Wu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),_be=y.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:i,onSlideStart:l,onSlideMove:u,onSlideEnd:d,onStepKeyDown:f,...m}=e,[p,g]=y.useState(null),x=qe(t,C=>g(C)),j=y.useRef(void 0),b=$u(a),w=b==="ltr",N=w&&!i||!w&&i;function O(C){const A=j.current||p.getBoundingClientRect(),E=[0,A.width],T=cE(E,N?[n,r]:[r,n]);return j.current=A,T(C-A.left)}return o.jsx(S8,{scope:e.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:o.jsx(N8,{dir:b,"data-orientation":"horizontal",...m,ref:x,style:{...m.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const A=O(C.clientX);l?.(A)},onSlideMove:C=>{const A=O(C.clientX);u?.(A)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:C=>{const E=b8[N?"from-left":"from-right"].includes(C.key);f?.({event:C,direction:E?-1:1})}})})}),Nbe=y.forwardRef((e,t)=>{const{min:n,max:r,inverted:a,onSlideStart:i,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,m=y.useRef(null),p=qe(t,m),g=y.useRef(void 0),x=!a;function j(b){const w=g.current||m.current.getBoundingClientRect(),N=[0,w.height],C=cE(N,x?[r,n]:[n,r]);return g.current=w,C(b-w.top)}return o.jsx(S8,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:o.jsx(N8,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const w=j(b.clientY);i?.(w)},onSlideMove:b=>{const w=j(b.clientY);l?.(w)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:b=>{const N=b8[x?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:N?-1:1})}})})}),N8=y.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:l,onEndKeyDown:u,onStepKeyDown:d,...f}=e,m=Iy(Wu,n);return o.jsx(Me.span,{...f,ref:t,onKeyDown:Se(e.onKeyDown,p=>{p.key==="Home"?(l(p),p.preventDefault()):p.key==="End"?(u(p),p.preventDefault()):y8.concat(x8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Se(e.onPointerDown,p=>{const g=p.target;g.setPointerCapture(p.pointerId),p.preventDefault(),m.thumbs.has(g)?g.focus():r(p)}),onPointerMove:Se(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:Se(e.onPointerUp,p=>{const g=p.target;g.hasPointerCapture(p.pointerId)&&(g.releasePointerCapture(p.pointerId),i(p))})})}),O8="SliderTrack",C8=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=Iy(O8,n);return o.jsx(Me.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});C8.displayName=O8;var ZN="SliderRange",E8=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=Iy(ZN,n),i=_8(ZN,n),l=y.useRef(null),u=qe(t,l),d=a.values.length,f=a.values.map(g=>k8(g,a.min,a.max)),m=d>1?Math.min(...f):0,p=100-Math.max(...f);return o.jsx(Me.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:u,style:{...e.style,[i.startEdge]:m+"%",[i.endEdge]:p+"%"}})});E8.displayName=ZN;var QN="SliderThumb",A8=y.forwardRef((e,t)=>{const n=wbe(e.__scopeSlider),[r,a]=y.useState(null),i=qe(t,u=>a(u)),l=y.useMemo(()=>r?n().findIndex(u=>u.ref.current===r):-1,[n,r]);return o.jsx(Obe,{...e,ref:i,index:l})}),Obe=y.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...i}=e,l=Iy(QN,n),u=_8(QN,n),[d,f]=y.useState(null),m=qe(t,O=>f(O)),p=d?l.form||!!d.closest("form"):!0,g=Ay(d),x=l.values[r],j=x===void 0?0:k8(x,l.min,l.max),b=Abe(r,l.values.length),w=g?.[u.size],N=w?kbe(w,j,u.direction):0;return y.useEffect(()=>{if(d)return l.thumbs.add(d),()=>{l.thumbs.delete(d)}},[d,l.thumbs]),o.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${j}% + ${N}px)`},children:[o.jsx(XN.ItemSlot,{scope:e.__scopeSlider,children:o.jsx(Me.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":l.min,"aria-valuenow":x,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...i,ref:m,style:x===void 0?{display:"none"}:e.style,onFocus:Se(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),p&&o.jsx(T8,{name:a??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:x},r)]})});A8.displayName=QN;var Cbe="RadioBubbleInput",T8=y.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=y.useRef(null),i=qe(a,r),l=Ey(t);return y.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&m){const p=new Event("input",{bubbles:!0});m.call(u,t),u.dispatchEvent(p)}},[l,t]),o.jsx(Me.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});T8.displayName=Cbe;function Ebe(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,i)=>a-i)}function k8(e,t,n){const i=100/(n-t)*(e-t);return Of(i,[0,100])}function Abe(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Tbe(e,t){if(e.length===1)return 0;const n=e.map(a=>Math.abs(a-t)),r=Math.min(...n);return n.indexOf(r)}function kbe(e,t,n){const r=e/2,i=cE([0,50],[0,r]);return(r-i(t)*n)*n}function Pbe(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Mbe(e,t){if(t>0){const n=Pbe(e);return Math.min(...n)>=t}return!0}function cE(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Rbe(e){return(String(e).split(".")[1]||"").length}function Dbe(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var P8=j8,$be=C8,Ibe=E8,Lbe=A8;const uE=y.forwardRef(({className:e,...t},n)=>o.jsxs(P8,{ref:n,className:ue("relative flex w-full touch-none select-none items-center",e),...t,children:[o.jsx($be,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:o.jsx(Ibe,{className:"absolute h-full bg-primary"})}),o.jsx(Lbe,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));uE.displayName=P8.displayName;const Bbe=["top","right","bottom","left"],Zo=Math.min,Qr=Math.max,Ng=Math.round,Up=Math.floor,fi=e=>({x:e,y:e}),zbe={left:"right",right:"left",bottom:"top",top:"bottom"},qbe={start:"end",end:"start"};function JN(e,t,n){return Qr(e,Zo(t,n))}function ao(e,t){return typeof e=="function"?e(t):e}function io(e){return e.split("-")[0]}function Vu(e){return e.split("-")[1]}function dE(e){return e==="x"?"y":"x"}function fE(e){return e==="y"?"height":"width"}const Fbe=new Set(["top","bottom"]);function si(e){return Fbe.has(io(e))?"y":"x"}function hE(e){return dE(si(e))}function Ube(e,t,n){n===void 0&&(n=!1);const r=Vu(e),a=hE(e),i=fE(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Og(l)),[l,Og(l)]}function Hbe(e){const t=Og(e);return[eO(e),t,eO(t)]}function eO(e){return e.replace(/start|end/g,t=>qbe[t])}const sL=["left","right"],lL=["right","left"],Wbe=["top","bottom"],Vbe=["bottom","top"];function Gbe(e,t,n){switch(e){case"top":case"bottom":return n?t?lL:sL:t?sL:lL;case"left":case"right":return t?Wbe:Vbe;default:return[]}}function Ybe(e,t,n,r){const a=Vu(e);let i=Gbe(io(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(eO)))),i}function Og(e){return e.replace(/left|right|bottom|top/g,t=>zbe[t])}function Kbe(e){return{top:0,right:0,bottom:0,left:0,...e}}function M8(e){return typeof e!="number"?Kbe(e):{top:e,right:e,bottom:e,left:e}}function Cg(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function cL(e,t,n){let{reference:r,floating:a}=e;const i=si(t),l=hE(t),u=fE(l),d=io(t),f=i==="y",m=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,g=r[u]/2-a[u]/2;let x;switch(d){case"top":x={x:m,y:r.y-a.height};break;case"bottom":x={x:m,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-a.width,y:p};break;default:x={x:r.x,y:r.y}}switch(Vu(t)){case"start":x[l]-=g*(n&&f?-1:1);break;case"end":x[l]+=g*(n&&f?-1:1);break}return x}const Xbe=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:m,y:p}=cL(f,r,d),g=r,x={},j=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:l,elements:u,middlewareData:d}=t,{element:f,padding:m=0}=ao(e,t)||{};if(f==null)return{};const p=M8(m),g={x:n,y:r},x=hE(a),j=fE(x),b=await l.getDimensions(f),w=x==="y",N=w?"top":"left",O=w?"bottom":"right",C=w?"clientHeight":"clientWidth",A=i.reference[j]+i.reference[x]-g[x]-i.floating[j],E=g[x]-i.reference[x],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let T=k?k[C]:0;(!T||!await(l.isElement==null?void 0:l.isElement(k)))&&(T=u.floating[C]||i.floating[j]);const P=A/2-E/2,$=T/2-b[j]/2-1,z=Zo(p[N],$),D=Zo(p[O],$),U=z,V=T-b[j]-D,H=T/2-b[j]/2+P,G=JN(U,H,V),L=!d.arrow&&Vu(a)!=null&&H!==G&&i.reference[j]/2-(HH<=0)){var D,U;const H=(((D=i.flip)==null?void 0:D.index)||0)+1,G=T[H];if(G&&(!(p==="alignment"?O!==si(G):!1)||z.every(F=>si(F.placement)===O?F.overflows[0]>0:!0)))return{data:{index:H,overflows:z},reset:{placement:G}};let L=(U=z.filter(R=>R.overflows[0]<=0).sort((R,F)=>R.overflows[1]-F.overflows[1])[0])==null?void 0:U.placement;if(!L)switch(x){case"bestFit":{var V;const R=(V=z.filter(F=>{if(k){const K=si(F.placement);return K===O||K==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(K=>K>0).reduce((K,te)=>K+te,0)]).sort((F,K)=>F[1]-K[1])[0])==null?void 0:V[0];R&&(L=R);break}case"initialPlacement":L=u;break}if(a!==L)return{reset:{placement:L}}}return{}}}};function uL(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function dL(e){return Bbe.some(t=>e[t]>=0)}const Jbe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=ao(e,t);switch(r){case"referenceHidden":{const i=await fh(t,{...a,elementContext:"reference"}),l=uL(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:dL(l)}}}case"escaped":{const i=await fh(t,{...a,altBoundary:!0}),l=uL(i,n.floating);return{data:{escapedOffsets:l,escaped:dL(l)}}}default:return{}}}}},R8=new Set(["left","top"]);async function e0e(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=io(n),u=Vu(n),d=si(n)==="y",f=R8.has(l)?-1:1,m=i&&d?-1:1,p=ao(t,e);let{mainAxis:g,crossAxis:x,alignmentAxis:j}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof j=="number"&&(x=u==="end"?j*-1:j),d?{x:x*m,y:g*f}:{x:g*f,y:x*m}}const t0e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:u}=t,d=await e0e(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+d.x,y:i+d.y,data:{...d,placement:l}}}}},n0e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:w=>{let{x:N,y:O}=w;return{x:N,y:O}}},...d}=ao(e,t),f={x:n,y:r},m=await fh(t,d),p=si(io(a)),g=dE(p);let x=f[g],j=f[p];if(i){const w=g==="y"?"top":"left",N=g==="y"?"bottom":"right",O=x+m[w],C=x-m[N];x=JN(O,x,C)}if(l){const w=p==="y"?"top":"left",N=p==="y"?"bottom":"right",O=j+m[w],C=j-m[N];j=JN(O,j,C)}const b=u.fn({...t,[g]:x,[p]:j});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[g]:i,[p]:l}}}}}},r0e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=ao(e,t),m={x:n,y:r},p=si(a),g=dE(p);let x=m[g],j=m[p];const b=ao(u,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const C=g==="y"?"height":"width",A=i.reference[g]-i.floating[C]+w.mainAxis,E=i.reference[g]+i.reference[C]-w.mainAxis;xE&&(x=E)}if(f){var N,O;const C=g==="y"?"width":"height",A=R8.has(io(a)),E=i.reference[p]-i.floating[C]+(A&&((N=l.offset)==null?void 0:N[p])||0)+(A?0:w.crossAxis),k=i.reference[p]+i.reference[C]+(A?0:((O=l.offset)==null?void 0:O[p])||0)-(A?w.crossAxis:0);jk&&(j=k)}return{[g]:x,[p]:j}}}},a0e=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:l,elements:u}=t,{apply:d=()=>{},...f}=ao(e,t),m=await fh(t,f),p=io(a),g=Vu(a),x=si(a)==="y",{width:j,height:b}=i.floating;let w,N;p==="top"||p==="bottom"?(w=p,N=g===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(N=p,w=g==="end"?"top":"bottom");const O=b-m.top-m.bottom,C=j-m.left-m.right,A=Zo(b-m[w],O),E=Zo(j-m[N],C),k=!t.middlewareData.shift;let T=A,P=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=O),k&&!g){const z=Qr(m.left,0),D=Qr(m.right,0),U=Qr(m.top,0),V=Qr(m.bottom,0);x?P=j-2*(z!==0||D!==0?z+D:Qr(m.left,m.right)):T=b-2*(U!==0||V!==0?U+V:Qr(m.top,m.bottom))}await d({...t,availableWidth:P,availableHeight:T});const $=await l.getDimensions(u.floating);return j!==$.width||b!==$.height?{reset:{rects:!0}}:{}}}};function Ly(){return typeof window<"u"}function Gu(e){return D8(e)?(e.nodeName||"").toLowerCase():"#document"}function ra(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bi(e){var t;return(t=(D8(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function D8(e){return Ly()?e instanceof Node||e instanceof ra(e).Node:!1}function Fa(e){return Ly()?e instanceof Element||e instanceof ra(e).Element:!1}function vi(e){return Ly()?e instanceof HTMLElement||e instanceof ra(e).HTMLElement:!1}function fL(e){return!Ly()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ra(e).ShadowRoot}const i0e=new Set(["inline","contents"]);function Fh(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ua(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!i0e.has(a)}const o0e=new Set(["table","td","th"]);function s0e(e){return o0e.has(Gu(e))}const l0e=[":popover-open",":modal"];function By(e){return l0e.some(t=>{try{return e.matches(t)}catch{return!1}})}const c0e=["transform","translate","scale","rotate","perspective"],u0e=["transform","translate","scale","rotate","perspective","filter"],d0e=["paint","layout","strict","content"];function mE(e){const t=pE(),n=Fa(e)?Ua(e):e;return c0e.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||u0e.some(r=>(n.willChange||"").includes(r))||d0e.some(r=>(n.contain||"").includes(r))}function f0e(e){let t=Qo(e);for(;vi(t)&&!Eu(t);){if(mE(t))return t;if(By(t))return null;t=Qo(t)}return null}function pE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const h0e=new Set(["html","body","#document"]);function Eu(e){return h0e.has(Gu(e))}function Ua(e){return ra(e).getComputedStyle(e)}function zy(e){return Fa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qo(e){if(Gu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fL(e)&&e.host||bi(e);return fL(t)?t.host:t}function $8(e){const t=Qo(e);return Eu(t)?e.ownerDocument?e.ownerDocument.body:e.body:vi(t)&&Fh(t)?t:$8(t)}function hh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=$8(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=ra(a);if(i){const u=tO(l);return t.concat(l,l.visualViewport||[],Fh(a)?a:[],u&&n?hh(u):[])}return t.concat(a,hh(a,[],n))}function tO(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function I8(e){const t=Ua(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=vi(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=Ng(n)!==i||Ng(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function vE(e){return Fa(e)?e:e.contextElement}function Gc(e){const t=vE(e);if(!vi(t))return fi(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=I8(t);let l=(i?Ng(n.width):n.width)/r,u=(i?Ng(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const m0e=fi(0);function L8(e){const t=ra(e);return!pE()||!t.visualViewport?m0e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function p0e(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ra(e)?!1:t}function hl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=vE(e);let l=fi(1);t&&(r?Fa(r)&&(l=Gc(r)):l=Gc(e));const u=p0e(i,n,r)?L8(i):fi(0);let d=(a.left+u.x)/l.x,f=(a.top+u.y)/l.y,m=a.width/l.x,p=a.height/l.y;if(i){const g=ra(i),x=r&&Fa(r)?ra(r):r;let j=g,b=tO(j);for(;b&&r&&x!==j;){const w=Gc(b),N=b.getBoundingClientRect(),O=Ua(b),C=N.left+(b.clientLeft+parseFloat(O.paddingLeft))*w.x,A=N.top+(b.clientTop+parseFloat(O.paddingTop))*w.y;d*=w.x,f*=w.y,m*=w.x,p*=w.y,d+=C,f+=A,j=ra(b),b=tO(j)}}return Cg({width:m,height:p,x:d,y:f})}function qy(e,t){const n=zy(e).scrollLeft;return t?t.left+n:hl(bi(e)).left+n}function B8(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-qy(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function v0e(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=bi(r),u=t?By(t.floating):!1;if(r===l||u&&i)return n;let d={scrollLeft:0,scrollTop:0},f=fi(1);const m=fi(0),p=vi(r);if((p||!p&&!i)&&((Gu(r)!=="body"||Fh(l))&&(d=zy(r)),vi(r))){const x=hl(r);f=Gc(r),m.x=x.x+r.clientLeft,m.y=x.y+r.clientTop}const g=l&&!p&&!i?B8(l,d):fi(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+m.x+g.x,y:n.y*f.y-d.scrollTop*f.y+m.y+g.y}}function g0e(e){return Array.from(e.getClientRects())}function y0e(e){const t=bi(e),n=zy(e),r=e.ownerDocument.body,a=Qr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Qr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+qy(e);const u=-n.scrollTop;return Ua(r).direction==="rtl"&&(l+=Qr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:l,y:u}}const hL=25;function x0e(e,t){const n=ra(e),r=bi(e),a=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,d=0;if(a){i=a.width,l=a.height;const m=pE();(!m||m&&t==="fixed")&&(u=a.offsetLeft,d=a.offsetTop)}const f=qy(r);if(f<=0){const m=r.ownerDocument,p=m.body,g=getComputedStyle(p),x=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-x);j<=hL&&(i-=j)}else f<=hL&&(i+=f);return{width:i,height:l,x:u,y:d}}const b0e=new Set(["absolute","fixed"]);function w0e(e,t){const n=hl(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=vi(e)?Gc(e):fi(1),l=e.clientWidth*i.x,u=e.clientHeight*i.y,d=a*i.x,f=r*i.y;return{width:l,height:u,x:d,y:f}}function mL(e,t,n){let r;if(t==="viewport")r=x0e(e,n);else if(t==="document")r=y0e(bi(e));else if(Fa(t))r=w0e(t,n);else{const a=L8(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Cg(r)}function z8(e,t){const n=Qo(e);return n===t||!Fa(n)||Eu(n)?!1:Ua(n).position==="fixed"||z8(n,t)}function j0e(e,t){const n=t.get(e);if(n)return n;let r=hh(e,[],!1).filter(u=>Fa(u)&&Gu(u)!=="body"),a=null;const i=Ua(e).position==="fixed";let l=i?Qo(e):e;for(;Fa(l)&&!Eu(l);){const u=Ua(l),d=mE(l);!d&&u.position==="fixed"&&(a=null),(i?!d&&!a:!d&&u.position==="static"&&!!a&&b0e.has(a.position)||Fh(l)&&!d&&z8(e,l))?r=r.filter(m=>m!==l):a=u,l=Qo(l)}return t.set(e,r),r}function S0e(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?By(t)?[]:j0e(t,this._c):[].concat(n),r],u=l[0],d=l.reduce((f,m)=>{const p=mL(t,m,a);return f.top=Qr(p.top,f.top),f.right=Zo(p.right,f.right),f.bottom=Zo(p.bottom,f.bottom),f.left=Qr(p.left,f.left),f},mL(t,u,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function _0e(e){const{width:t,height:n}=I8(e);return{width:t,height:n}}function N0e(e,t,n){const r=vi(t),a=bi(t),i=n==="fixed",l=hl(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const d=fi(0);function f(){d.x=qy(a)}if(r||!r&&!i)if((Gu(t)!=="body"||Fh(a))&&(u=zy(t)),r){const x=hl(t,!0,i,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else a&&f();i&&!r&&a&&f();const m=a&&!r&&!i?B8(a,u):fi(0),p=l.left+u.scrollLeft-d.x-m.x,g=l.top+u.scrollTop-d.y-m.y;return{x:p,y:g,width:l.width,height:l.height}}function QS(e){return Ua(e).position==="static"}function pL(e,t){if(!vi(e)||Ua(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return bi(e)===n&&(n=n.ownerDocument.body),n}function q8(e,t){const n=ra(e);if(By(e))return n;if(!vi(e)){let a=Qo(e);for(;a&&!Eu(a);){if(Fa(a)&&!QS(a))return a;a=Qo(a)}return n}let r=pL(e,t);for(;r&&s0e(r)&&QS(r);)r=pL(r,t);return r&&Eu(r)&&QS(r)&&!mE(r)?n:r||f0e(e)||n}const O0e=async function(e){const t=this.getOffsetParent||q8,n=this.getDimensions,r=await n(e.floating);return{reference:N0e(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function C0e(e){return Ua(e).direction==="rtl"}const E0e={convertOffsetParentRelativeRectToViewportRelativeRect:v0e,getDocumentElement:bi,getClippingRect:S0e,getOffsetParent:q8,getElementRects:O0e,getClientRects:g0e,getDimensions:_0e,getScale:Gc,isElement:Fa,isRTL:C0e};function F8(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function A0e(e,t){let n=null,r;const a=bi(e);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),i();const f=e.getBoundingClientRect(),{left:m,top:p,width:g,height:x}=f;if(u||t(),!g||!x)return;const j=Up(p),b=Up(a.clientWidth-(m+g)),w=Up(a.clientHeight-(p+x)),N=Up(m),C={rootMargin:-j+"px "+-b+"px "+-w+"px "+-N+"px",threshold:Qr(0,Zo(1,d))||1};let A=!0;function E(k){const T=k[0].intersectionRatio;if(T!==d){if(!A)return l();T?l(!1,T):r=setTimeout(()=>{l(!1,1e-7)},1e3)}T===1&&!F8(f,e.getBoundingClientRect())&&l(),A=!1}try{n=new IntersectionObserver(E,{...C,root:a.ownerDocument})}catch{n=new IntersectionObserver(E,C)}n.observe(e)}return l(!0),i}function T0e(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=vE(e),m=a||i?[...f?hh(f):[],...hh(t)]:[];m.forEach(N=>{a&&N.addEventListener("scroll",n,{passive:!0}),i&&N.addEventListener("resize",n)});const p=f&&u?A0e(f,n):null;let g=-1,x=null;l&&(x=new ResizeObserver(N=>{let[O]=N;O&&O.target===f&&x&&(x.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=x)==null||C.observe(t)})),n()}),f&&!d&&x.observe(f),x.observe(t));let j,b=d?hl(e):null;d&&w();function w(){const N=hl(e);b&&!F8(b,N)&&n(),b=N,j=requestAnimationFrame(w)}return n(),()=>{var N;m.forEach(O=>{a&&O.removeEventListener("scroll",n),i&&O.removeEventListener("resize",n)}),p?.(),(N=x)==null||N.disconnect(),x=null,d&&cancelAnimationFrame(j)}}const k0e=t0e,P0e=n0e,M0e=Qbe,R0e=a0e,D0e=Jbe,vL=Zbe,$0e=r0e,I0e=(e,t,n)=>{const r=new Map,a={platform:E0e,...n},i={...a.platform,_c:r};return Xbe(e,t,{...a,platform:i})};var L0e=typeof document<"u",B0e=function(){},sv=L0e?y.useLayoutEffect:B0e;function Eg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Eg(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Eg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function U8(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gL(e,t){const n=U8(e);return Math.round(t*n)/n}function JS(e){const t=y.useRef(e);return sv(()=>{t.current=e}),t}function z0e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:d,open:f}=e,[m,p]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,x]=y.useState(r);Eg(g,r)||x(r);const[j,b]=y.useState(null),[w,N]=y.useState(null),O=y.useCallback(F=>{F!==k.current&&(k.current=F,b(F))},[]),C=y.useCallback(F=>{F!==T.current&&(T.current=F,N(F))},[]),A=i||j,E=l||w,k=y.useRef(null),T=y.useRef(null),P=y.useRef(m),$=d!=null,z=JS(d),D=JS(a),U=JS(f),V=y.useCallback(()=>{if(!k.current||!T.current)return;const F={placement:t,strategy:n,middleware:g};D.current&&(F.platform=D.current),I0e(k.current,T.current,F).then(K=>{const te={...K,isPositioned:U.current!==!1};H.current&&!Eg(P.current,te)&&(P.current=te,gl.flushSync(()=>{p(te)}))})},[g,t,n,D,U]);sv(()=>{f===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,p(F=>({...F,isPositioned:!1})))},[f]);const H=y.useRef(!1);sv(()=>(H.current=!0,()=>{H.current=!1}),[]),sv(()=>{if(A&&(k.current=A),E&&(T.current=E),A&&E){if(z.current)return z.current(A,E,V);V()}},[A,E,V,z,$]);const G=y.useMemo(()=>({reference:k,floating:T,setReference:O,setFloating:C}),[O,C]),L=y.useMemo(()=>({reference:A,floating:E}),[A,E]),R=y.useMemo(()=>{const F={position:n,left:0,top:0};if(!L.floating)return F;const K=gL(L.floating,m.x),te=gL(L.floating,m.y);return u?{...F,transform:"translate("+K+"px, "+te+"px)",...U8(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:te}},[n,u,L.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:V,refs:G,elements:L,floatingStyles:R}),[m,V,G,L,R])}const q0e=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?vL({element:r.current,padding:a}).fn(n):{}:r?vL({element:r,padding:a}).fn(n):{}}}},F0e=(e,t)=>({...k0e(e),options:[e,t]}),U0e=(e,t)=>({...P0e(e),options:[e,t]}),H0e=(e,t)=>({...$0e(e),options:[e,t]}),W0e=(e,t)=>({...M0e(e),options:[e,t]}),V0e=(e,t)=>({...R0e(e),options:[e,t]}),G0e=(e,t)=>({...D0e(e),options:[e,t]}),Y0e=(e,t)=>({...q0e(e),options:[e,t]});var K0e="Arrow",H8=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return o.jsx(Me.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});H8.displayName=K0e;var X0e=H8,gE="Popper",[W8,ss]=fr(gE),[Z0e,V8]=W8(gE),G8=e=>{const{__scopePopper:t,children:n}=e,[r,a]=y.useState(null);return o.jsx(Z0e,{scope:t,anchor:r,onAnchorChange:a,children:n})};G8.displayName=gE;var Y8="PopperAnchor",K8=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=V8(Y8,n),l=y.useRef(null),u=qe(t,l),d=y.useRef(null);return y.useEffect(()=>{const f=d.current;d.current=r?.current||l.current,f!==d.current&&i.onAnchorChange(d.current)}),r?null:o.jsx(Me.div,{...a,ref:u})});K8.displayName=Y8;var yE="PopperContent",[Q0e,J0e]=W8(yE),X8=y.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:x="optimized",onPlaced:j,...b}=e,w=V8(yE,n),[N,O]=y.useState(null),C=qe(t,ee=>O(ee)),[A,E]=y.useState(null),k=Ay(A),T=k?.width??0,P=k?.height??0,$=r+(i!=="center"?"-"+i:""),z=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},D=Array.isArray(f)?f:[f],U=D.length>0,V={padding:z,boundary:D.filter(twe),altBoundary:U},{refs:H,floatingStyles:G,placement:L,isPositioned:R,middlewareData:F}=z0e({strategy:"fixed",placement:$,whileElementsMounted:(...ee)=>T0e(...ee,{animationFrame:x==="always"}),elements:{reference:w.anchor},middleware:[F0e({mainAxis:a+P,alignmentAxis:l}),d&&U0e({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?H0e():void 0,...V}),d&&W0e({...V}),V0e({...V,apply:({elements:ee,rects:ae,availableWidth:Z,availableHeight:pe})=>{const{width:je,height:le}=ae.reference,Re=ee.floating.style;Re.setProperty("--radix-popper-available-width",`${Z}px`),Re.setProperty("--radix-popper-available-height",`${pe}px`),Re.setProperty("--radix-popper-anchor-width",`${je}px`),Re.setProperty("--radix-popper-anchor-height",`${le}px`)}}),A&&Y0e({element:A,padding:u}),nwe({arrowWidth:T,arrowHeight:P}),g&&G0e({strategy:"referenceHidden",...V})]}),[K,te]=J8(L),I=tn(j);Fn(()=>{R&&I?.()},[R,I]);const B=F.arrow?.x,Y=F.arrow?.y,ne=F.arrow?.centerOffset!==0,[oe,xe]=y.useState();return Fn(()=>{N&&xe(window.getComputedStyle(N).zIndex)},[N]),o.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:R?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(Q0e,{scope:n,placedSide:K,onArrowChange:E,arrowX:B,arrowY:Y,shouldHideArrow:ne,children:o.jsx(Me.div,{"data-side":K,"data-align":te,...b,ref:C,style:{...b.style,animation:R?void 0:"none"}})})})});X8.displayName=yE;var Z8="PopperArrow",ewe={top:"bottom",right:"left",bottom:"top",left:"right"},Q8=y.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=J0e(Z8,r),l=ewe[i.placedSide];return o.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:o.jsx(X0e,{...a,ref:n,style:{...a.style,display:"block"}})})});Q8.displayName=Z8;function twe(e){return e!==null}var nwe=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,l=a.arrow?.centerOffset!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[f,m]=J8(n),p={start:"0%",center:"50%",end:"100%"}[m],g=(a.arrow?.x??0)+u/2,x=(a.arrow?.y??0)+d/2;let j="",b="";return f==="bottom"?(j=l?p:`${g}px`,b=`${-d}px`):f==="top"?(j=l?p:`${g}px`,b=`${r.floating.height+d}px`):f==="right"?(j=`${-d}px`,b=l?p:`${x}px`):f==="left"&&(j=`${r.floating.width+d}px`,b=l?p:`${x}px`),{data:{x:j,y:b}}}});function J8(e){const[t,n="center"]=e.split("-");return[t,n]}var Uh=G8,Hh=K8,Fy=X8,Uy=Q8;function rwe(e){const t=awe(e),n=y.forwardRef((r,a)=>{const{children:i,...l}=r,u=y.Children.toArray(i),d=u.find(owe);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return o.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return o.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function awe(e){const t=y.forwardRef((n,r)=>{const{children:a,...i}=n;if(y.isValidElement(a)){const l=lwe(a),u=swe(i,a.props);return a.type!==y.Fragment&&(u.ref=r?Mr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var iwe=Symbol("radix.slottable");function owe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===iwe}function swe(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function lwe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var eU=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),cwe="VisuallyHidden",Hy=y.forwardRef((e,t)=>o.jsx(Me.span,{...e,ref:t,style:{...eU,...e.style}}));Hy.displayName=cwe;var uwe=Hy,dwe=[" ","Enter","ArrowUp","ArrowDown"],fwe=[" ","Enter"],ml="Select",[Wy,Vy,hwe]=_h(ml),[Yu]=fr(ml,[hwe,ss]),Gy=ss(),[mwe,ls]=Yu(ml),[pwe,vwe]=Yu(ml),tU=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:l,defaultValue:u,onValueChange:d,dir:f,name:m,autoComplete:p,disabled:g,required:x,form:j}=e,b=Gy(t),[w,N]=y.useState(null),[O,C]=y.useState(null),[A,E]=y.useState(!1),k=$u(f),[T,P]=_a({prop:r,defaultProp:a??!1,onChange:i,caller:ml}),[$,z]=_a({prop:l,defaultProp:u,onChange:d,caller:ml}),D=y.useRef(null),U=w?j||!!w.closest("form"):!0,[V,H]=y.useState(new Set),G=Array.from(V).map(L=>L.props.value).join(";");return o.jsx(Uh,{...b,children:o.jsxs(mwe,{required:x,scope:t,trigger:w,onTriggerChange:N,valueNode:O,onValueNodeChange:C,valueNodeHasChildren:A,onValueNodeHasChildrenChange:E,contentId:qn(),value:$,onValueChange:z,open:T,onOpenChange:P,dir:k,triggerPointerDownPosRef:D,disabled:g,children:[o.jsx(Wy.Provider,{scope:t,children:o.jsx(pwe,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(L=>{H(R=>new Set(R).add(L))},[]),onNativeOptionRemove:y.useCallback(L=>{H(R=>{const F=new Set(R);return F.delete(L),F})},[]),children:n})}),U?o.jsxs(NU,{"aria-hidden":!0,required:x,tabIndex:-1,name:m,autoComplete:p,value:$,onChange:L=>z(L.target.value),disabled:g,form:j,children:[$===void 0?o.jsx("option",{value:""}):null,Array.from(V)]},G):null]})})};tU.displayName=ml;var nU="SelectTrigger",rU=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=Gy(n),l=ls(nU,n),u=l.disabled||r,d=qe(t,l.onTriggerChange),f=Vy(n),m=y.useRef("touch"),[p,g,x]=CU(b=>{const w=f().filter(C=>!C.disabled),N=w.find(C=>C.value===l.value),O=EU(w,b,N);O!==void 0&&l.onValueChange(O.value)}),j=b=>{u||(l.onOpenChange(!0),x()),b&&(l.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return o.jsx(Hh,{asChild:!0,...i,children:o.jsx(Me.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":OU(l.value)?"":void 0,...a,ref:d,onClick:Se(a.onClick,b=>{b.currentTarget.focus(),m.current!=="mouse"&&j(b)}),onPointerDown:Se(a.onPointerDown,b=>{m.current=b.pointerType;const w=b.target;w.hasPointerCapture(b.pointerId)&&w.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(j(b),b.preventDefault())}),onKeyDown:Se(a.onKeyDown,b=>{const w=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&g(b.key),!(w&&b.key===" ")&&dwe.includes(b.key)&&(j(),b.preventDefault())})})})});rU.displayName=nU;var aU="SelectValue",iU=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:l="",...u}=e,d=ls(aU,n),{onValueNodeHasChildrenChange:f}=d,m=i!==void 0,p=qe(t,d.onValueNodeChange);return Fn(()=>{f(m)},[f,m]),o.jsx(Me.span,{...u,ref:p,style:{pointerEvents:"none"},children:OU(d.value)?o.jsx(o.Fragment,{children:l}):i})});iU.displayName=aU;var gwe="SelectIcon",oU=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return o.jsx(Me.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});oU.displayName=gwe;var ywe="SelectPortal",sU=e=>o.jsx(_l,{asChild:!0,...e});sU.displayName=ywe;var pl="SelectContent",lU=y.forwardRef((e,t)=>{const n=ls(pl,e.__scopeSelect),[r,a]=y.useState();if(Fn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?gl.createPortal(o.jsx(cU,{scope:e.__scopeSelect,children:o.jsx(Wy.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),i):null}return o.jsx(uU,{...e,ref:t})});lU.displayName=pl;var Da=10,[cU,cs]=Yu(pl),xwe="SelectContentImpl",bwe=rwe("SelectContent.RemoveScroll"),uU=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:l,side:u,sideOffset:d,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:j,hideWhenDetached:b,avoidCollisions:w,...N}=e,O=ls(pl,n),[C,A]=y.useState(null),[E,k]=y.useState(null),T=qe(t,ee=>A(ee)),[P,$]=y.useState(null),[z,D]=y.useState(null),U=Vy(n),[V,H]=y.useState(!1),G=y.useRef(!1);y.useEffect(()=>{if(C)return My(C)},[C]),ky();const L=y.useCallback(ee=>{const[ae,...Z]=U().map(le=>le.ref.current),[pe]=Z.slice(-1),je=document.activeElement;for(const le of ee)if(le===je||(le?.scrollIntoView({block:"nearest"}),le===ae&&E&&(E.scrollTop=0),le===pe&&E&&(E.scrollTop=E.scrollHeight),le?.focus(),document.activeElement!==je))return},[U,E]),R=y.useCallback(()=>L([P,C]),[L,P,C]);y.useEffect(()=>{V&&R()},[V,R]);const{onOpenChange:F,triggerPointerDownPosRef:K}=O;y.useEffect(()=>{if(C){let ee={x:0,y:0};const ae=pe=>{ee={x:Math.abs(Math.round(pe.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(pe.pageY)-(K.current?.y??0))}},Z=pe=>{ee.x<=10&&ee.y<=10?pe.preventDefault():C.contains(pe.target)||F(!1),document.removeEventListener("pointermove",ae),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",ae),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",Z,{capture:!0})}}},[C,F,K]),y.useEffect(()=>{const ee=()=>F(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[F]);const[te,I]=CU(ee=>{const ae=U().filter(je=>!je.disabled),Z=ae.find(je=>je.ref.current===document.activeElement),pe=EU(ae,ee,Z);pe&&setTimeout(()=>pe.ref.current.focus())}),B=y.useCallback((ee,ae,Z)=>{const pe=!G.current&&!Z;(O.value!==void 0&&O.value===ae||pe)&&($(ee),pe&&(G.current=!0))},[O.value]),Y=y.useCallback(()=>C?.focus(),[C]),ne=y.useCallback((ee,ae,Z)=>{const pe=!G.current&&!Z;(O.value!==void 0&&O.value===ae||pe)&&D(ee)},[O.value]),oe=r==="popper"?nO:dU,xe=oe===nO?{side:u,sideOffset:d,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:j,hideWhenDetached:b,avoidCollisions:w}:{};return o.jsx(cU,{scope:n,content:C,viewport:E,onViewportChange:k,itemRefCallback:B,selectedItem:P,onItemLeave:Y,itemTextRefCallback:ne,focusSelectedItem:R,selectedItemText:z,position:r,isPositioned:V,searchRef:te,children:o.jsx(qh,{as:bwe,allowPinchZoom:!0,children:o.jsx(zh,{asChild:!0,trapped:O.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:Se(a,ee=>{O.trigger?.focus({preventScroll:!0}),ee.preventDefault()}),children:o.jsx(Sl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:o.jsx(oe,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:ee=>ee.preventDefault(),...N,...xe,onPlaced:()=>H(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Se(N.onKeyDown,ee=>{const ae=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!ae&&ee.key.length===1&&I(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let pe=U().filter(je=>!je.disabled).map(je=>je.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(pe=pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const je=ee.target,le=pe.indexOf(je);pe=pe.slice(le+1)}setTimeout(()=>L(pe)),ee.preventDefault()}})})})})})})});uU.displayName=xwe;var wwe="SelectItemAlignedPosition",dU=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=ls(pl,n),l=cs(pl,n),[u,d]=y.useState(null),[f,m]=y.useState(null),p=qe(t,T=>m(T)),g=Vy(n),x=y.useRef(!1),j=y.useRef(!0),{viewport:b,selectedItem:w,selectedItemText:N,focusSelectedItem:O}=l,C=y.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&f&&b&&w&&N){const T=i.trigger.getBoundingClientRect(),P=f.getBoundingClientRect(),$=i.valueNode.getBoundingClientRect(),z=N.getBoundingClientRect();if(i.dir!=="rtl"){const je=z.left-P.left,le=$.left-je,Re=T.left-le,_e=T.width+Re,me=Math.max(_e,P.width),ve=window.innerWidth-Da,Le=Of(le,[Da,Math.max(Da,ve-me)]);u.style.minWidth=_e+"px",u.style.left=Le+"px"}else{const je=P.right-z.right,le=window.innerWidth-$.right-je,Re=window.innerWidth-T.right-le,_e=T.width+Re,me=Math.max(_e,P.width),ve=window.innerWidth-Da,Le=Of(le,[Da,Math.max(Da,ve-me)]);u.style.minWidth=_e+"px",u.style.right=Le+"px"}const D=g(),U=window.innerHeight-Da*2,V=b.scrollHeight,H=window.getComputedStyle(f),G=parseInt(H.borderTopWidth,10),L=parseInt(H.paddingTop,10),R=parseInt(H.borderBottomWidth,10),F=parseInt(H.paddingBottom,10),K=G+L+V+F+R,te=Math.min(w.offsetHeight*5,K),I=window.getComputedStyle(b),B=parseInt(I.paddingTop,10),Y=parseInt(I.paddingBottom,10),ne=T.top+T.height/2-Da,oe=U-ne,xe=w.offsetHeight/2,ee=w.offsetTop+xe,ae=G+L+ee,Z=K-ae;if(ae<=ne){const je=D.length>0&&w===D[D.length-1].ref.current;u.style.bottom="0px";const le=f.clientHeight-b.offsetTop-b.offsetHeight,Re=Math.max(oe,xe+(je?Y:0)+le+R),_e=ae+Re;u.style.height=_e+"px"}else{const je=D.length>0&&w===D[0].ref.current;u.style.top="0px";const Re=Math.max(ne,G+b.offsetTop+(je?B:0)+xe)+Z;u.style.height=Re+"px",b.scrollTop=ae-ne+b.offsetTop}u.style.margin=`${Da}px 0`,u.style.minHeight=te+"px",u.style.maxHeight=U+"px",r?.(),requestAnimationFrame(()=>x.current=!0)}},[g,i.trigger,i.valueNode,u,f,b,w,N,i.dir,r]);Fn(()=>C(),[C]);const[A,E]=y.useState();Fn(()=>{f&&E(window.getComputedStyle(f).zIndex)},[f]);const k=y.useCallback(T=>{T&&j.current===!0&&(C(),O?.(),j.current=!1)},[C,O]);return o.jsx(Swe,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:x,onScrollButtonChange:k,children:o.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:o.jsx(Me.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});dU.displayName=wwe;var jwe="SelectPopperPosition",nO=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Da,...i}=e,l=Gy(n);return o.jsx(Fy,{...l,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});nO.displayName=jwe;var[Swe,xE]=Yu(pl,{}),rO="SelectViewport",fU=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=cs(rO,n),l=xE(rO,n),u=qe(t,i.onViewportChange),d=y.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),o.jsx(Wy.Slot,{scope:n,children:o.jsx(Me.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Se(a.onScroll,f=>{const m=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=l;if(g?.current&&p){const x=Math.abs(d.current-m.scrollTop);if(x>0){const j=window.innerHeight-Da*2,b=parseFloat(p.style.minHeight),w=parseFloat(p.style.height),N=Math.max(b,w);if(N0?A:0,p.style.justifyContent="flex-end")}}}d.current=m.scrollTop})})})]})});fU.displayName=rO;var hU="SelectGroup",[_we,Nwe]=Yu(hU),Owe=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=qn();return o.jsx(_we,{scope:n,id:a,children:o.jsx(Me.div,{role:"group","aria-labelledby":a,...r,ref:t})})});Owe.displayName=hU;var mU="SelectLabel",pU=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Nwe(mU,n);return o.jsx(Me.div,{id:a.id,...r,ref:t})});pU.displayName=mU;var Ag="SelectItem",[Cwe,vU]=Yu(Ag),gU=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...l}=e,u=ls(Ag,n),d=cs(Ag,n),f=u.value===r,[m,p]=y.useState(i??""),[g,x]=y.useState(!1),j=qe(t,O=>d.itemRefCallback?.(O,r,a)),b=qn(),w=y.useRef("touch"),N=()=>{a||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return o.jsx(Cwe,{scope:n,value:r,disabled:a,textId:b,isSelected:f,onItemTextChange:y.useCallback(O=>{p(C=>C||(O?.textContent??"").trim())},[]),children:o.jsx(Wy.ItemSlot,{scope:n,value:r,disabled:a,textValue:m,children:o.jsx(Me.div,{role:"option","aria-labelledby":b,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:j,onFocus:Se(l.onFocus,()=>x(!0)),onBlur:Se(l.onBlur,()=>x(!1)),onClick:Se(l.onClick,()=>{w.current!=="mouse"&&N()}),onPointerUp:Se(l.onPointerUp,()=>{w.current==="mouse"&&N()}),onPointerDown:Se(l.onPointerDown,O=>{w.current=O.pointerType}),onPointerMove:Se(l.onPointerMove,O=>{w.current=O.pointerType,a?d.onItemLeave?.():w.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(l.onPointerLeave,O=>{O.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Se(l.onKeyDown,O=>{d.searchRef?.current!==""&&O.key===" "||(fwe.includes(O.key)&&N(),O.key===" "&&O.preventDefault())})})})})});gU.displayName=Ag;var df="SelectItemText",yU=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,l=ls(df,n),u=cs(df,n),d=vU(df,n),f=vwe(df,n),[m,p]=y.useState(null),g=qe(t,N=>p(N),d.onItemTextChange,N=>u.itemTextRefCallback?.(N,d.value,d.disabled)),x=m?.textContent,j=y.useMemo(()=>o.jsx("option",{value:d.value,disabled:d.disabled,children:x},d.value),[d.disabled,d.value,x]),{onNativeOptionAdd:b,onNativeOptionRemove:w}=f;return Fn(()=>(b(j),()=>w(j)),[b,w,j]),o.jsxs(o.Fragment,{children:[o.jsx(Me.span,{id:d.textId,...i,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?gl.createPortal(i.children,l.valueNode):null]})});yU.displayName=df;var xU="SelectItemIndicator",bU=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return vU(xU,n).isSelected?o.jsx(Me.span,{"aria-hidden":!0,...r,ref:t}):null});bU.displayName=xU;var aO="SelectScrollUpButton",wU=y.forwardRef((e,t)=>{const n=cs(aO,e.__scopeSelect),r=xE(aO,e.__scopeSelect),[a,i]=y.useState(!1),l=qe(t,r.onScrollButtonChange);return Fn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollTop>0;i(f)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?o.jsx(SU,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});wU.displayName=aO;var iO="SelectScrollDownButton",jU=y.forwardRef((e,t)=>{const n=cs(iO,e.__scopeSelect),r=xE(iO,e.__scopeSelect),[a,i]=y.useState(!1),l=qe(t,r.onScrollButtonChange);return Fn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollHeight-d.clientHeight,m=Math.ceil(d.scrollTop)d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?o.jsx(SU,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});jU.displayName=iO;var SU=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=cs("SelectScrollButton",n),l=y.useRef(null),u=Vy(n),d=y.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return y.useEffect(()=>()=>d(),[d]),Fn(()=>{u().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),o.jsx(Me.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Se(a.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Se(a.onPointerMove,()=>{i.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Se(a.onPointerLeave,()=>{d()})})}),Ewe="SelectSeparator",_U=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o.jsx(Me.div,{"aria-hidden":!0,...r,ref:t})});_U.displayName=Ewe;var oO="SelectArrow",Awe=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Gy(n),i=ls(oO,n),l=cs(oO,n);return i.open&&l.position==="popper"?o.jsx(Uy,{...a,...r,ref:t}):null});Awe.displayName=oO;var Twe="SelectBubbleInput",NU=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=y.useRef(null),i=qe(r,a),l=Ey(t);return y.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&m){const p=new Event("change",{bubbles:!0});m.call(u,t),u.dispatchEvent(p)}},[l,t]),o.jsx(Me.select,{...n,style:{...eU,...n.style},ref:i,defaultValue:t})});NU.displayName=Twe;function OU(e){return e===""||e===void 0}function CU(e){const t=tn(e),n=y.useRef(""),r=y.useRef(0),a=y.useCallback(l=>{const u=n.current+l;t(u),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(u)},[t]),i=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function EU(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=kwe(e,Math.max(i,0));a.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function kwe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Pwe=tU,AU=rU,Mwe=iU,Rwe=oU,Dwe=sU,TU=lU,$we=fU,kU=pU,PU=gU,Iwe=yU,Lwe=bU,MU=wU,RU=jU,DU=_U;const Et=Pwe,At=Mwe,wt=y.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(AU,{ref:r,className:ue("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,o.jsx(Rwe,{asChild:!0,children:o.jsx(lh,{className:"h-4 w-4 opacity-50"})})]}));wt.displayName=AU.displayName;const $U=y.forwardRef(({className:e,...t},n)=>o.jsx(MU,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(zN,{className:"h-4 w-4"})}));$U.displayName=MU.displayName;const IU=y.forwardRef(({className:e,...t},n)=>o.jsx(RU,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(lh,{className:"h-4 w-4"})}));IU.displayName=RU.displayName;const jt=y.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>o.jsx(Dwe,{children:o.jsxs(TU,{ref:a,className:ue("relative z-[100] max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[o.jsx($U,{}),o.jsx($we,{className:ue("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(IU,{})]})}));jt.displayName=TU.displayName;const Bwe=y.forwardRef(({className:e,...t},n)=>o.jsx(kU,{ref:n,className:ue("px-2 py-1.5 text-sm font-semibold",e),...t}));Bwe.displayName=kU.displayName;const Pe=y.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(PU,{ref:r,className:ue("relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2 pr-8 text-sm outline-none bg-white dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gray-100 dark:focus:bg-gray-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Lwe,{children:o.jsx(tl,{className:"h-4 w-4"})})}),o.jsx(Iwe,{children:t})]}));Pe.displayName=PU.displayName;const zwe=y.forwardRef(({className:e,...t},n)=>o.jsx(DU,{ref:n,className:ue("-mx-1 my-1 h-px bg-muted",e),...t}));zwe.displayName=DU.displayName;function qwe(e){const t=Fwe(e),n=y.forwardRef((r,a)=>{const{children:i,...l}=r,u=y.Children.toArray(i),d=u.find(Hwe);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return o.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return o.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function Fwe(e){const t=y.forwardRef((n,r)=>{const{children:a,...i}=n;if(y.isValidElement(a)){const l=Vwe(a),u=Wwe(i,a.props);return a.type!==y.Fragment&&(u.ref=r?Mr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Uwe=Symbol("radix.slottable");function Hwe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Uwe}function Wwe(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function Vwe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Yy="Popover",[LU]=fr(Yy,[ss]),Wh=ss(),[Gwe,us]=LU(Yy),BU=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,u=Wh(t),d=y.useRef(null),[f,m]=y.useState(!1),[p,g]=_a({prop:r,defaultProp:a??!1,onChange:i,caller:Yy});return o.jsx(Uh,{...u,children:o.jsx(Gwe,{scope:t,contentId:qn(),triggerRef:d,open:p,onOpenChange:g,onOpenToggle:y.useCallback(()=>g(x=>!x),[g]),hasCustomAnchor:f,onCustomAnchorAdd:y.useCallback(()=>m(!0),[]),onCustomAnchorRemove:y.useCallback(()=>m(!1),[]),modal:l,children:n})})};BU.displayName=Yy;var zU="PopoverAnchor",Ywe=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=us(zU,n),i=Wh(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=a;return y.useEffect(()=>(l(),()=>u()),[l,u]),o.jsx(Hh,{...i,...r,ref:t})});Ywe.displayName=zU;var qU="PopoverTrigger",FU=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=us(qU,n),i=Wh(n),l=qe(t,a.triggerRef),u=o.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":GU(a.open),...r,ref:l,onClick:Se(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:o.jsx(Hh,{asChild:!0,...i,children:u})});FU.displayName=qU;var bE="PopoverPortal",[Kwe,Xwe]=LU(bE,{forceMount:void 0}),UU=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=us(bE,t);return o.jsx(Kwe,{scope:t,forceMount:n,children:o.jsx(Mn,{present:n||i.open,children:o.jsx(_l,{asChild:!0,container:a,children:r})})})};UU.displayName=bE;var Au="PopoverContent",HU=y.forwardRef((e,t)=>{const n=Xwe(Au,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=us(Au,e.__scopePopover);return o.jsx(Mn,{present:r||i.open,children:i.modal?o.jsx(Qwe,{...a,ref:t}):o.jsx(Jwe,{...a,ref:t})})});HU.displayName=Au;var Zwe=qwe("PopoverContent.RemoveScroll"),Qwe=y.forwardRef((e,t)=>{const n=us(Au,e.__scopePopover),r=y.useRef(null),a=qe(t,r),i=y.useRef(!1);return y.useEffect(()=>{const l=r.current;if(l)return My(l)},[]),o.jsx(qh,{as:Zwe,allowPinchZoom:!0,children:o.jsx(WU,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Se(e.onCloseAutoFocus,l=>{l.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Se(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Se(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),Jwe=y.forwardRef((e,t)=>{const n=us(Au,e.__scopePopover),r=y.useRef(!1),a=y.useRef(!1);return o.jsx(WU,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;n.triggerRef.current?.contains(l)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),WU=y.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:m,...p}=e,g=us(Au,n),x=Wh(n);return ky(),o.jsx(zh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:o.jsx(Sl,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:m,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>g.onOpenChange(!1),children:o.jsx(Fy,{"data-state":GU(g.open),role:"dialog",id:g.contentId,...x,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),VU="PopoverClose",eje=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=us(VU,n);return o.jsx(Me.button,{type:"button",...r,ref:t,onClick:Se(e.onClick,()=>a.onOpenChange(!1))})});eje.displayName=VU;var tje="PopoverArrow",nje=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Wh(n);return o.jsx(Uy,{...a,...r,ref:t})});nje.displayName=tje;function GU(e){return e?"open":"closed"}var rje=BU,aje=FU,ije=UU,YU=HU;const Jo=rje,es=aje,oo=y.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>o.jsx(ije,{children:o.jsx(YU,{ref:a,align:t,sideOffset:n,className:ue("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...r})}));oo.displayName=YU.displayName;const Ku="/api/webui/config";async function oje(){const t=await(await Ze(`${Ku}/bot`)).json();if(!t.success)throw new Error("获取配置数据失败");return t.config}async function Tg(){const t=await(await Ze(`${Ku}/model`)).json();if(!t.success)throw new Error("获取模型配置数据失败");return t.config}async function sje(e){const n=await(await Ze(`${Ku}/bot`,{method:"POST",headers:st(),body:JSON.stringify(e)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function KU(e){const n=await(await Ze(`${Ku}/model`,{method:"POST",headers:st(),body:JSON.stringify(e)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function lje(e,t){const r=await(await Ze(`${Ku}/bot/section/${e}`,{method:"POST",headers:st(),body:JSON.stringify(t)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${e} 失败`)}async function sO(e,t){const r=await(await Ze(`${Ku}/model/section/${e}`,{method:"POST",headers:st(),body:JSON.stringify(t)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${e} 失败`)}function cje(){const[e,t]=y.useState(!0),[n,r]=y.useState(!1),[a,i]=y.useState(!1),[l,u]=y.useState(!1),{toast:d}=hr(),[f,m]=y.useState(null),[p,g]=y.useState(null),[x,j]=y.useState(null),[b,w]=y.useState(null),[N,O]=y.useState(null),[C,A]=y.useState(null),[E,k]=y.useState(null),[T,P]=y.useState(null),[$,z]=y.useState(null),[D,U]=y.useState(null),[V,H]=y.useState(null),[G,L]=y.useState(null),[R,F]=y.useState(null),[K,te]=y.useState(null),[I,B]=y.useState(null),[Y,ne]=y.useState(null),[oe,xe]=y.useState(null),[ee,ae]=y.useState(null),Z=y.useRef(null),pe=y.useRef(!0),je=y.useRef({}),le=y.useCallback(async()=>{try{t(!0);const ve=await oje();je.current=ve,m(ve.bot),g(ve.personality);const Le=ve.chat;Le.talk_value_rules||(Le.talk_value_rules=[]),j(Le),w(ve.expression),O(ve.emoji),A(ve.memory),k(ve.tool),P(ve.mood),z(ve.voice),U(ve.lpmm_knowledge),H(ve.keyword_reaction),L(ve.response_post_process),F(ve.chinese_typo),te(ve.response_splitter),B(ve.log),ne(ve.debug),xe(ve.maim_message),ae(ve.telemetry),u(!1),pe.current=!1}catch(ve){console.error("加载配置失败:",ve),d({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{t(!1)}},[d]);y.useEffect(()=>{le()},[le]);const Re=y.useCallback(async(ve,Le)=>{if(!pe.current)try{i(!0),await lje(ve,Le),u(!1)}catch(Dt){console.error(`自动保存 ${ve} 失败:`,Dt),u(!0)}finally{i(!1)}},[]),_e=y.useCallback((ve,Le)=>{pe.current||(u(!0),Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{Re(ve,Le)},2e3))},[Re]);y.useEffect(()=>{f&&!pe.current&&_e("bot",f)},[f,_e]),y.useEffect(()=>{p&&!pe.current&&_e("personality",p)},[p,_e]),y.useEffect(()=>{x&&!pe.current&&_e("chat",x)},[x,_e]),y.useEffect(()=>{b&&!pe.current&&_e("expression",b)},[b,_e]),y.useEffect(()=>{N&&!pe.current&&_e("emoji",N)},[N,_e]),y.useEffect(()=>{C&&!pe.current&&_e("memory",C)},[C,_e]),y.useEffect(()=>{E&&!pe.current&&_e("tool",E)},[E,_e]),y.useEffect(()=>{T&&!pe.current&&_e("mood",T)},[T,_e]),y.useEffect(()=>{$&&!pe.current&&_e("voice",$)},[$,_e]),y.useEffect(()=>{D&&!pe.current&&_e("lpmm_knowledge",D)},[D,_e]),y.useEffect(()=>{V&&!pe.current&&_e("keyword_reaction",V)},[V,_e]),y.useEffect(()=>{G&&!pe.current&&_e("response_post_process",G)},[G,_e]),y.useEffect(()=>{R&&!pe.current&&_e("chinese_typo",R)},[R,_e]),y.useEffect(()=>{K&&!pe.current&&_e("response_splitter",K)},[K,_e]),y.useEffect(()=>{I&&!pe.current&&_e("log",I)},[I,_e]),y.useEffect(()=>{Y&&!pe.current&&_e("debug",Y)},[Y,_e]),y.useEffect(()=>{oe&&!pe.current&&_e("maim_message",oe)},[oe,_e]),y.useEffect(()=>{ee&&!pe.current&&_e("telemetry",ee)},[ee,_e]);const me=async()=>{try{r(!0),Z.current&&clearTimeout(Z.current);const ve={...je.current,bot:f,personality:p,chat:x,expression:b,emoji:N,memory:C,tool:E,mood:T,voice:$,lpmm_knowledge:D,keyword_reaction:V,response_post_process:G,chinese_typo:R,response_splitter:K,log:I,debug:Y,maim_message:oe,telemetry:ee};await sje(ve),u(!1),d({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(ve){console.error("保存配置失败:",ve),d({title:"保存失败",description:ve.message,variant:"destructive"})}finally{r(!1)}};return e?o.jsx(Xt,{className:"h-full",children:o.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):o.jsx(Xt,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),o.jsxs(fe,{onClick:me,disabled:n||a||!l,size:"sm",className:"w-full sm:w-auto",children:[o.jsx(VC,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),n?"保存中...":a?"自动保存中...":l?"保存配置":"已保存"]})]}),o.jsxs(ol,{defaultValue:"bot",className:"w-full",children:[o.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:o.jsxs(Xo,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[o.jsx(Ct,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),o.jsx(Ct,{value:"personality",className:"flex-shrink-0",children:"人格"}),o.jsx(Ct,{value:"chat",className:"flex-shrink-0",children:"聊天"}),o.jsx(Ct,{value:"expression",className:"flex-shrink-0",children:"表达"}),o.jsx(Ct,{value:"features",className:"flex-shrink-0",children:"功能"}),o.jsx(Ct,{value:"processing",className:"flex-shrink-0",children:"处理"}),o.jsx(Ct,{value:"mood",className:"flex-shrink-0",children:"情绪"}),o.jsx(Ct,{value:"voice",className:"flex-shrink-0",children:"语音"}),o.jsx(Ct,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),o.jsx(Ct,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),o.jsx(Qt,{value:"bot",className:"space-y-4",children:f&&o.jsx(uje,{config:f,onChange:m})}),o.jsx(Qt,{value:"personality",className:"space-y-4",children:p&&o.jsx(dje,{config:p,onChange:g})}),o.jsx(Qt,{value:"chat",className:"space-y-4",children:x&&o.jsx(fje,{config:x,onChange:j})}),o.jsx(Qt,{value:"expression",className:"space-y-4",children:b&&o.jsx(hje,{config:b,onChange:w})}),o.jsx(Qt,{value:"features",className:"space-y-4",children:N&&C&&E&&o.jsx(mje,{emojiConfig:N,memoryConfig:C,toolConfig:E,onEmojiChange:O,onMemoryChange:A,onToolChange:k})}),o.jsx(Qt,{value:"processing",className:"space-y-4",children:V&&G&&R&&K&&o.jsx(pje,{keywordReactionConfig:V,responsePostProcessConfig:G,chineseTypoConfig:R,responseSplitterConfig:K,onKeywordReactionChange:H,onResponsePostProcessChange:L,onChineseTypoChange:F,onResponseSplitterChange:te})}),o.jsx(Qt,{value:"mood",className:"space-y-4",children:T&&o.jsx(vje,{config:T,onChange:P})}),o.jsx(Qt,{value:"voice",className:"space-y-4",children:$&&o.jsx(gje,{config:$,onChange:z})}),o.jsx(Qt,{value:"lpmm",className:"space-y-4",children:D&&o.jsx(yje,{config:D,onChange:U})}),o.jsxs(Qt,{value:"other",className:"space-y-4",children:[I&&o.jsx(xje,{config:I,onChange:B}),Y&&o.jsx(bje,{config:Y,onChange:ne}),oe&&o.jsx(wje,{config:oe,onChange:xe}),ee&&o.jsx(jje,{config:ee,onChange:ae})]})]})]})})}function uje({config:e,onChange:t}){const n=()=>{t({...e,platforms:[...e.platforms,""]})},r=d=>{t({...e,platforms:e.platforms.filter((f,m)=>m!==d)})},a=(d,f)=>{const m=[...e.platforms];m[d]=f,t({...e,platforms:m})},i=()=>{t({...e,alias_names:[...e.alias_names,""]})},l=d=>{t({...e,alias_names:e.alias_names.filter((f,m)=>m!==d)})},u=(d,f)=>{const m=[...e.alias_names];m[d]=f,t({...e,alias_names:m})};return o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"platform",children:"平台"}),o.jsx(Ne,{id:"platform",value:e.platform,onChange:d=>t({...e,platform:d.target.value}),placeholder:"qq"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"qq_account",children:"QQ账号"}),o.jsx(Ne,{id:"qq_account",value:e.qq_account,onChange:d=>t({...e,qq_account:d.target.value}),placeholder:"123456789"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"nickname",children:"昵称"}),o.jsx(Ne,{id:"nickname",value:e.nickname,onChange:d=>t({...e,nickname:d.target.value}),placeholder:"麦麦"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(J,{children:"其他平台账号"}),o.jsxs(fe,{onClick:n,size:"sm",variant:"outline",children:[o.jsx(er,{className:"h-4 w-4 mr-1"}),"添加"]})]}),o.jsxs("div",{className:"space-y-2",children:[e.platforms.map((d,f)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Ne,{value:d,onChange:m=>a(f,m.target.value),placeholder:"wx:114514"}),o.jsxs(Pn,{children:[o.jsx(na,{asChild:!0,children:o.jsx(fe,{size:"icon",variant:"outline",children:o.jsx(Ut,{className:"h-4 w-4"})})}),o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认删除"}),o.jsxs(wn,{children:['确定要删除平台账号 "',d||"(空)",'" 吗?此操作无法撤销。']})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:()=>r(f),children:"删除"})]})]})]})]},f)),e.platforms.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(J,{children:"别名"}),o.jsxs(fe,{onClick:i,size:"sm",variant:"outline",children:[o.jsx(er,{className:"h-4 w-4 mr-1"}),"添加"]})]}),o.jsxs("div",{className:"space-y-2",children:[e.alias_names.map((d,f)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Ne,{value:d,onChange:m=>u(f,m.target.value),placeholder:"小麦"}),o.jsxs(Pn,{children:[o.jsx(na,{asChild:!0,children:o.jsx(fe,{size:"icon",variant:"outline",children:o.jsx(Ut,{className:"h-4 w-4"})})}),o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认删除"}),o.jsxs(wn,{children:['确定要删除别名 "',d||"(空)",'" 吗?此操作无法撤销。']})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:()=>l(f),children:"删除"})]})]})]})]},f)),e.alias_names.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function dje({config:e,onChange:t}){const n=()=>{t({...e,states:[...e.states,""]})},r=i=>{t({...e,states:e.states.filter((l,u)=>u!==i)})},a=(i,l)=>{const u=[...e.states];u[i]=l,t({...e,states:u})};return o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"personality",children:"人格特质"}),o.jsx(qt,{id:"personality",value:e.personality,onChange:i=>t({...e,personality:i.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"reply_style",children:"表达风格"}),o.jsx(qt,{id:"reply_style",value:e.reply_style,onChange:i=>t({...e,reply_style:i.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"interest",children:"兴趣"}),o.jsx(qt,{id:"interest",value:e.interest,onChange:i=>t({...e,interest:i.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"plan_style",children:"说话规则与行为风格"}),o.jsx(qt,{id:"plan_style",value:e.plan_style,onChange:i=>t({...e,plan_style:i.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"visual_style",children:"识图规则"}),o.jsx(qt,{id:"visual_style",value:e.visual_style,onChange:i=>t({...e,visual_style:i.target.value}),placeholder:"识图时的处理规则",rows:3})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"private_plan_style",children:"私聊规则"}),o.jsx(qt,{id:"private_plan_style",value:e.private_plan_style,onChange:i=>t({...e,private_plan_style:i.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(J,{children:"状态列表(人格多样性)"}),o.jsxs(fe,{onClick:n,size:"sm",variant:"outline",children:[o.jsx(er,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),o.jsx("div",{className:"space-y-2",children:e.states.map((i,l)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(qt,{value:i,onChange:u=>a(l,u.target.value),placeholder:"描述一个人格状态",rows:2}),o.jsxs(Pn,{children:[o.jsx(na,{asChild:!0,children:o.jsx(fe,{size:"icon",variant:"outline",children:o.jsx(Ut,{className:"h-4 w-4"})})}),o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认删除"}),o.jsx(wn,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:()=>r(l),children:"删除"})]})]})]})]},l))})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"state_probability",children:"状态替换概率"}),o.jsx(Ne,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:e.state_probability,onChange:i=>t({...e,state_probability:parseFloat(i.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function fje({config:e,onChange:t}){const n=()=>{t({...e,talk_value_rules:[...e.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},r=u=>{t({...e,talk_value_rules:e.talk_value_rules.filter((d,f)=>f!==u)})},a=(u,d,f)=>{const m=[...e.talk_value_rules];m[u]={...m[u],[d]:f},t({...e,talk_value_rules:m})},i=({value:u,onChange:d})=>{const[f,m]=y.useState("00"),[p,g]=y.useState("00"),[x,j]=y.useState("23"),[b,w]=y.useState("59");y.useEffect(()=>{const O=u.split("-");if(O.length===2){const[C,A]=O,[E,k]=C.split(":"),[T,P]=A.split(":");E&&m(E.padStart(2,"0")),k&&g(k.padStart(2,"0")),T&&j(T.padStart(2,"0")),P&&w(P.padStart(2,"0"))}},[u]);const N=(O,C,A,E)=>{const k=`${O}:${C}-${A}:${E}`;d(k)};return o.jsxs(Jo,{children:[o.jsx(es,{asChild:!0,children:o.jsxs(fe,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[o.jsx(nl,{className:"h-4 w-4 mr-2"}),u||"选择时间段"]})}),o.jsx(oo,{className:"w-80",children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[o.jsxs("div",{children:[o.jsx(J,{className:"text-xs",children:"小时"}),o.jsxs(Et,{value:f,onValueChange:O=>{m(O),N(O,p,x,b)},children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsx(jt,{children:Array.from({length:24},(O,C)=>C).map(O=>o.jsx(Pe,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]}),o.jsxs("div",{children:[o.jsx(J,{className:"text-xs",children:"分钟"}),o.jsxs(Et,{value:p,onValueChange:O=>{g(O),N(f,O,x,b)},children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsx(jt,{children:Array.from({length:60},(O,C)=>C).map(O=>o.jsx(Pe,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[o.jsxs("div",{children:[o.jsx(J,{className:"text-xs",children:"小时"}),o.jsxs(Et,{value:x,onValueChange:O=>{j(O),N(f,p,O,b)},children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsx(jt,{children:Array.from({length:24},(O,C)=>C).map(O=>o.jsx(Pe,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]}),o.jsxs("div",{children:[o.jsx(J,{className:"text-xs",children:"分钟"}),o.jsxs(Et,{value:b,onValueChange:O=>{w(O),N(f,p,x,O)},children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsx(jt,{children:Array.from({length:60},(O,C)=>C).map(O=>o.jsx(Pe,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]})]})]})]})})]})},l=({rule:u})=>{const d=`{ target = "${u.target}", time = "${u.time}", value = ${u.value.toFixed(1)} }`;return o.jsxs(Jo,{children:[o.jsx(es,{asChild:!0,children:o.jsxs(fe,{variant:"outline",size:"sm",children:[o.jsx(ro,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(oo,{className:"w-96",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:d}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),o.jsx(Ne,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:e.talk_value,onChange:u=>t({...e,talk_value:parseFloat(u.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"mentioned_bot_reply",children:"提及回复增幅"}),o.jsx(Ne,{id:"mentioned_bot_reply",type:"number",step:"0.1",min:"0",max:"1",value:e.mentioned_bot_reply,onChange:u=>t({...e,mentioned_bot_reply:parseFloat(u.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"提及时回复概率增幅,1 为 100% 回复"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"max_context_size",children:"上下文长度"}),o.jsx(Ne,{id:"max_context_size",type:"number",min:"1",value:e.max_context_size,onChange:u=>t({...e,max_context_size:parseInt(u.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"planner_smooth",children:"规划器平滑"}),o.jsx(Ne,{id:"planner_smooth",type:"number",step:"1",min:"0",value:e.planner_smooth,onChange:u=>t({...e,planner_smooth:parseFloat(u.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(at,{id:"enable_talk_value_rules",checked:e.enable_talk_value_rules,onCheckedChange:u=>t({...e,enable_talk_value_rules:u})}),o.jsx(J,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(at,{id:"include_planner_reasoning",checked:e.include_planner_reasoning,onCheckedChange:u=>t({...e,include_planner_reasoning:u})}),o.jsx(J,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),e.enable_talk_value_rules&&o.jsxs("div",{className:"border-t pt-6",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),o.jsxs(fe,{onClick:n,size:"sm",children:[o.jsx(er,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),e.talk_value_rules&&e.talk_value_rules.length>0?o.jsx("div",{className:"space-y-4",children:e.talk_value_rules.map((u,d)=>o.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",d+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(l,{rule:u}),o.jsxs(Pn,{children:[o.jsx(na,{asChild:!0,children:o.jsx(fe,{variant:"ghost",size:"sm",children:o.jsx(Ut,{className:"h-4 w-4 text-destructive"})})}),o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认删除"}),o.jsxs(wn,{children:["确定要删除规则 #",d+1," 吗?此操作无法撤销。"]})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:()=>r(d),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{className:"text-xs font-medium",children:"配置类型"}),o.jsxs(Et,{value:u.target===""?"global":"specific",onValueChange:f=>{f==="global"?a(d,"target",""):a(d,"target","qq::group")},children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"global",children:"全局配置"}),o.jsx(Pe,{value:"specific",children:"详细配置"})]})]})]}),u.target!==""&&(()=>{const f=u.target.split(":"),m=f[0]||"qq",p=f[1]||"",g=f[2]||"group";return o.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{className:"text-xs font-medium",children:"平台"}),o.jsxs(Et,{value:m,onValueChange:x=>{a(d,"target",`${x}:${p}:${g}`)},children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"qq",children:"QQ"}),o.jsx(Pe,{value:"wx",children:"微信"})]})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{className:"text-xs font-medium",children:"群 ID"}),o.jsx(Ne,{value:p,onChange:x=>{a(d,"target",`${m}:${x.target.value}:${g}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{className:"text-xs font-medium",children:"类型"}),o.jsxs(Et,{value:g,onValueChange:x=>{a(d,"target",`${m}:${p}:${x}`)},children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"group",children:"群组(group)"}),o.jsx(Pe,{value:"private",children:"私聊(private)"})]})]})]})]}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",u.target||"(未设置)"]})]})})(),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{className:"text-xs font-medium",children:"时间段 (Time)"}),o.jsx(i,{value:u.time,onChange:f=>a(d,"time",f)}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),o.jsxs("div",{className:"grid gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(J,{htmlFor:`rule-value-${d}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),o.jsx(Ne,{id:`rule-value-${d}`,type:"number",step:"0.01",min:"0",max:"1",value:u.value,onChange:f=>{const m=parseFloat(f.target.value);isNaN(m)||a(d,"value",Math.max(0,Math.min(1,m)))},className:"w-20 h-8 text-xs"})]}),o.jsx(uE,{value:[u.value],onValueChange:f=>a(d,"value",f[0]),min:0,max:1,step:.01,className:"w-full"}),o.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[o.jsx("span",{children:"0 (完全沉默)"}),o.jsx("span",{children:"0.5"}),o.jsx("span",{children:"1.0 (正常)"})]})]})]})]},d))}):o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:o.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),o.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg",children:[o.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),o.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[o.jsxs("li",{children:["• ",o.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function hje({config:e,onChange:t}){const n=()=>{t({...e,learning_list:[...e.learning_list,["","enable","enable","1.0"]]})},r=g=>{t({...e,learning_list:e.learning_list.filter((x,j)=>j!==g)})},a=(g,x,j)=>{const b=[...e.learning_list];b[g][x]=j,t({...e,learning_list:b})},i=({rule:g})=>{const x=`["${g[0]}", "${g[1]}", "${g[2]}", "${g[3]}"]`;return o.jsxs(Jo,{children:[o.jsx(es,{asChild:!0,children:o.jsxs(fe,{variant:"outline",size:"sm",children:[o.jsx(ro,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(oo,{className:"w-96",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:x}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},l=({member:g,groupIndex:x,memberIndex:j,availableChatIds:b})=>{const w=b.includes(g)||g==="*",[N,O]=y.useState(!w);return o.jsxs("div",{className:"flex gap-2",children:[o.jsx("div",{className:"flex-1 flex gap-2",children:N?o.jsxs(o.Fragment,{children:[o.jsx(Ne,{value:g,onChange:C=>p(x,j,C.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),b.length>0&&o.jsx(fe,{size:"sm",variant:"outline",onClick:()=>O(!1),title:"切换到下拉选择",children:"下拉"})]}):o.jsxs(o.Fragment,{children:[o.jsxs(Et,{value:g,onValueChange:C=>p(x,j,C),children:[o.jsx(wt,{className:"flex-1",children:o.jsx(At,{placeholder:"选择聊天流"})}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"*",children:"* (全局共享)"}),b.map((C,A)=>o.jsx(Pe,{value:C,children:C},A))]})]}),o.jsx(fe,{size:"sm",variant:"outline",onClick:()=>O(!0),title:"切换到手动输入",children:"输入"})]})}),o.jsxs(Pn,{children:[o.jsx(na,{asChild:!0,children:o.jsx(fe,{size:"icon",variant:"outline",children:o.jsx(Ut,{className:"h-4 w-4"})})}),o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认删除"}),o.jsxs(wn,{children:['确定要删除组成员 "',g||"(空)",'" 吗?此操作无法撤销。']})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:()=>m(x,j),children:"删除"})]})]})]})]})},u=()=>{t({...e,expression_groups:[...e.expression_groups,[]]})},d=g=>{t({...e,expression_groups:e.expression_groups.filter((x,j)=>j!==g)})},f=g=>{const x=[...e.expression_groups];x[g]=[...x[g],""],t({...e,expression_groups:x})},m=(g,x)=>{const j=[...e.expression_groups];j[g]=j[g].filter((b,w)=>w!==x),t({...e,expression_groups:j})},p=(g,x,j)=>{const b=[...e.expression_groups];b[g][x]=j,t({...e,expression_groups:b})};return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),o.jsxs(fe,{onClick:n,size:"sm",variant:"outline",children:[o.jsx(er,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),o.jsxs("div",{className:"space-y-4",children:[e.learning_list.map((g,x)=>{const j=e.learning_list.some((A,E)=>E!==x&&A[0]===""),b=g[0]==="",w=g[0].split(":"),N=w[0]||"qq",O=w[1]||"",C=w[2]||"group";return o.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["规则 ",x+1," ",b&&"(全局配置)"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(i,{rule:g}),o.jsxs(Pn,{children:[o.jsx(na,{asChild:!0,children:o.jsx(fe,{size:"sm",variant:"ghost",children:o.jsx(Ut,{className:"h-4 w-4"})})}),o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认删除"}),o.jsxs(wn,{children:["确定要删除学习规则 ",x+1," 吗?此操作无法撤销。"]})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:()=>r(x),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{className:"text-xs font-medium",children:"配置类型"}),o.jsxs(Et,{value:b?"global":"specific",onValueChange:A=>{A==="global"?a(x,0,""):a(x,0,"qq::group")},disabled:j&&!b,children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"global",children:"全局配置"}),o.jsx(Pe,{value:"specific",disabled:j&&!b,children:"详细配置"})]})]}),j&&!b&&o.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!b&&o.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{className:"text-xs font-medium",children:"平台"}),o.jsxs(Et,{value:N,onValueChange:A=>{a(x,0,`${A}:${O}:${C}`)},children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"qq",children:"QQ"}),o.jsx(Pe,{value:"wx",children:"微信"})]})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{className:"text-xs font-medium",children:"群 ID"}),o.jsx(Ne,{value:O,onChange:A=>{a(x,0,`${N}:${A.target.value}:${C}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{className:"text-xs font-medium",children:"类型"}),o.jsxs(Et,{value:C,onValueChange:A=>{a(x,0,`${N}:${O}:${A}`)},children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"group",children:"群组(group)"}),o.jsx(Pe,{value:"private",children:"私聊(private)"})]})]})]})]}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",g[0]||"(未设置)"]})]}),o.jsx("div",{className:"grid gap-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(J,{className:"text-xs font-medium",children:"使用学到的表达"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),o.jsx(at,{checked:g[1]==="enable",onCheckedChange:A=>a(x,1,A?"enable":"disable")})]})}),o.jsx("div",{className:"grid gap-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(J,{className:"text-xs font-medium",children:"学习表达"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),o.jsx(at,{checked:g[2]==="enable",onCheckedChange:A=>a(x,2,A?"enable":"disable")})]})}),o.jsxs("div",{className:"grid gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(J,{className:"text-xs font-medium",children:"学习强度"}),o.jsx(Ne,{type:"number",step:"0.1",min:"0",max:"5",value:g[3],onChange:A=>{const E=parseFloat(A.target.value);isNaN(E)||a(x,3,Math.max(0,Math.min(5,E)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),o.jsx(uE,{value:[parseFloat(g[3])||1],onValueChange:A=>a(x,3,A[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),o.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[o.jsx("span",{children:"0 (不学习)"}),o.jsx("span",{children:"2.5"}),o.jsx("span",{children:"5.0 (快速学习)"})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},x)}),e.learning_list.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),o.jsxs(fe,{onClick:u,size:"sm",variant:"outline",children:[o.jsx(er,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),o.jsxs("div",{className:"space-y-4",children:[e.expression_groups.map((g,x)=>{const j=e.learning_list.map(b=>b[0]).filter(b=>b!=="");return o.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",x+1,g.length===1&&g[0]==="*"&&"(全局共享)"]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(fe,{onClick:()=>f(x),size:"sm",variant:"outline",children:o.jsx(er,{className:"h-4 w-4"})}),o.jsxs(Pn,{children:[o.jsx(na,{asChild:!0,children:o.jsx(fe,{size:"sm",variant:"ghost",children:o.jsx(Ut,{className:"h-4 w-4"})})}),o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认删除"}),o.jsxs(wn,{children:["确定要删除共享组 ",x+1," 吗?此操作无法撤销。"]})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:()=>d(x),children:"删除"})]})]})]})]})]}),o.jsx("div",{className:"space-y-2",children:g.map((b,w)=>o.jsx(l,{member:b,groupIndex:x,memberIndex:w,availableChatIds:j},w))}),o.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},x)}),e.expression_groups.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function mje({emojiConfig:e,memoryConfig:t,toolConfig:n,onEmojiChange:r,onMemoryChange:a,onToolChange:i}){return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(at,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:l=>i({...n,enable_tool:l})}),o.jsx(J,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),o.jsx(Ne,{id:"max_agent_iterations",type:"number",min:"1",value:t.max_agent_iterations,onChange:l=>a({...t,max_agent_iterations:parseInt(l.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"emoji_chance",children:"表情包激活概率"}),o.jsx(Ne,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:e.emoji_chance,onChange:l=>r({...e,emoji_chance:parseFloat(l.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"max_reg_num",children:"最大注册数量"}),o.jsx(Ne,{id:"max_reg_num",type:"number",min:"1",value:e.max_reg_num,onChange:l=>r({...e,max_reg_num:parseInt(l.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),o.jsx(Ne,{id:"check_interval",type:"number",min:"1",value:e.check_interval,onChange:l=>r({...e,check_interval:parseInt(l.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(at,{id:"do_replace",checked:e.do_replace,onCheckedChange:l=>r({...e,do_replace:l})}),o.jsx(J,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(at,{id:"steal_emoji",checked:e.steal_emoji,onCheckedChange:l=>r({...e,steal_emoji:l})}),o.jsx(J,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),o.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(at,{id:"content_filtration",checked:e.content_filtration,onCheckedChange:l=>r({...e,content_filtration:l})}),o.jsx(J,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),e.content_filtration&&o.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[o.jsx(J,{htmlFor:"filtration_prompt",children:"过滤要求"}),o.jsx(Ne,{id:"filtration_prompt",value:e.filtration_prompt,onChange:l=>r({...e,filtration_prompt:l.target.value}),placeholder:"符合公序良俗"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function pje({keywordReactionConfig:e,responsePostProcessConfig:t,chineseTypoConfig:n,responseSplitterConfig:r,onKeywordReactionChange:a,onResponsePostProcessChange:i,onChineseTypoChange:l,onResponseSplitterChange:u}){const d=()=>{a({...e,regex_rules:[...e.regex_rules,{regex:[""],reaction:""}]})},f=A=>{a({...e,regex_rules:e.regex_rules.filter((E,k)=>k!==A)})},m=(A,E,k)=>{const T=[...e.regex_rules];E==="regex"&&typeof k=="string"?T[A]={...T[A],regex:[k]}:E==="reaction"&&typeof k=="string"&&(T[A]={...T[A],reaction:k}),a({...e,regex_rules:T})},p=({regex:A,reaction:E,onRegexChange:k,onReactionChange:T})=>{const[P,$]=y.useState(!1),[z,D]=y.useState(""),[U,V]=y.useState(null),[H,G]=y.useState(""),[L,R]=y.useState({}),[F,K]=y.useState(""),te=y.useRef(null),[I,B]=y.useState("build"),Y=ee=>ee.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),ne=(ee,ae=0)=>{const Z=te.current;if(!Z)return;const pe=Z.selectionStart||0,je=Z.selectionEnd||0,le=A.substring(0,pe)+ee+A.substring(je);k(le),setTimeout(()=>{const Re=pe+ee.length+ae;Z.setSelectionRange(Re,Re),Z.focus()},0)};y.useEffect(()=>{if(!A||!z){V(null),R({}),K(E),G("");return}try{const ee=Y(A),ae=new RegExp(ee,"g"),Z=z.match(ae);V(Z),G("");const je=new RegExp(ee).exec(z);if(je&&je.groups){R(je.groups);let le=E;Object.entries(je.groups).forEach(([Re,_e])=>{le=le.replace(new RegExp(`\\[${Re}\\]`,"g"),_e||"")}),K(le)}else R({}),K(E)}catch(ee){G(ee.message),V(null),R({}),K(E)}},[A,z,E]);const oe=()=>{if(!z||!U||U.length===0)return o.jsx("span",{className:"text-muted-foreground",children:z||"请输入测试文本"});try{const ee=Y(A),ae=new RegExp(ee,"g");let Z=0;const pe=[];let je;for(;(je=ae.exec(z))!==null;)je.index>Z&&pe.push(o.jsx("span",{children:z.substring(Z,je.index)},`text-${Z}`)),pe.push(o.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:je[0]},`match-${je.index}`)),Z=je.index+je[0].length;return Z)",desc:"Python风格命名捕获组",moveCursor:-1},{label:"非捕获组",pattern:"(?:)",desc:"分组但不保存匹配结果",moveCursor:-1}]},{category:"字符类",items:[{label:"字符集",pattern:"[]",desc:"匹配括号内的任意字符",moveCursor:-1},{label:"排除字符",pattern:"[^]",desc:"匹配不在括号内的字符",moveCursor:-1},{label:"范围",pattern:"[a-z]",desc:"匹配a到z的字符"},{label:"中文字符",pattern:"[\\u4e00-\\u9fa5]",desc:"匹配中文汉字"}]},{category:"常用模板",items:[{label:"捕获词语",pattern:"(?P\\S+)",desc:"捕获一个词语"},{label:"捕获句子",pattern:"(?P.+)",desc:"捕获整个句子"},{label:"捕获数字",pattern:"(?P\\d+)",desc:"捕获一个或多个数字"},{label:"可选词语",pattern:"(?:词语1|词语2)",desc:"匹配多个可选项之一"}]}];return o.jsxs(tr,{open:P,onOpenChange:$,children:[o.jsx(zF,{asChild:!0,children:o.jsxs(fe,{variant:"outline",size:"sm",children:[o.jsx(xg,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),o.jsxs(Un,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[o.jsxs(Hn,{children:[o.jsx(Wn,{children:"正则表达式编辑器"}),o.jsx(ur,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),o.jsx(Xt,{className:"max-h-[calc(90vh-120px)]",children:o.jsxs(ol,{value:I,onValueChange:ee=>B(ee),className:"w-full",children:[o.jsxs(Xo,{className:"grid w-full grid-cols-2",children:[o.jsx(Ct,{value:"build",children:"🔧 构建器"}),o.jsx(Ct,{value:"test",children:"🧪 测试器"})]}),o.jsxs(Qt,{value:"build",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{className:"text-sm font-medium",children:"正则表达式"}),o.jsx(Ne,{ref:te,value:A,onChange:ee=>k(ee.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{className:"text-sm font-medium",children:"Reaction 内容"}),o.jsx(qt,{value:E,onChange:ee=>T(ee.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),o.jsxs("div",{className:"space-y-4 border-t pt-4",children:[xe.map(ee=>o.jsxs("div",{className:"space-y-2",children:[o.jsx("h5",{className:"text-xs font-semibold text-primary",children:ee.category}),o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:ee.items.map(ae=>o.jsx(fe,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>ne(ae.pattern,ae.moveCursor||0),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsxs("div",{className:"flex items-center gap-2 w-full",children:[o.jsx("span",{className:"text-xs font-medium",children:ae.label}),o.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:ae.pattern})]}),o.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:ae.desc})]})},ae.label))})]},ee.category)),o.jsxs("div",{className:"space-y-2 border-t pt-4",children:[o.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(fe,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>k("^(?P\\S{1,20})是这样的$"),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P\\S","{1,20}",")是这样的$"]}),o.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),o.jsx(fe,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>k("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"}),o.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),o.jsx(fe,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>k("(?P.+?)(?:是|为什么|怎么)"),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P.+?)(?:是|为什么|怎么)"}),o.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),o.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[o.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),o.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[o.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),o.jsxs("li",{children:["命名捕获组格式:",o.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),o.jsxs("li",{children:["在 reaction 中使用 ",o.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),o.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),o.jsxs(Qt,{value:"test",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{className:"text-sm font-medium",children:"当前正则表达式"}),o.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:A||"(未设置)"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),o.jsx(qt,{id:"test-text",value:z,onChange:ee=>D(ee.target.value),placeholder:`在此输入要测试的文本... +例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),H&&o.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[o.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),o.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:H})]}),!H&&z&&o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"flex items-center gap-2",children:U&&U.length>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),o.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",U.length," 处)"]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),o.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{className:"text-sm font-medium",children:"匹配高亮"}),o.jsx(Xt,{className:"h-40 rounded-md bg-muted p-3",children:o.jsx("div",{className:"text-sm break-words",children:oe()})})]}),Object.keys(L).length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{className:"text-sm font-medium",children:"命名捕获组"}),o.jsx(Xt,{className:"h-32 rounded-md border p-3",children:o.jsx("div",{className:"space-y-2",children:Object.entries(L).map(([ee,ae])=>o.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[o.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",ee,"]"]}),o.jsx("span",{className:"text-muted-foreground",children:"="}),o.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:ae})]},ee))})})]}),Object.keys(L).length>0&&E&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{className:"text-sm font-medium",children:"Reaction 替换预览"}),o.jsx(Xt,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:o.jsx("div",{className:"text-sm break-words",children:F})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),o.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[o.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),o.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[o.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),o.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),o.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),o.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},g=()=>{a({...e,keyword_rules:[...e.keyword_rules,{keywords:[],reaction:""}]})},x=A=>{a({...e,keyword_rules:e.keyword_rules.filter((E,k)=>k!==A)})},j=(A,E,k)=>{const T=[...e.keyword_rules];typeof k=="string"&&(T[A]={...T[A],reaction:k}),a({...e,keyword_rules:T})},b=A=>{const E=[...e.keyword_rules];E[A]={...E[A],keywords:[...E[A].keywords||[],""]},a({...e,keyword_rules:E})},w=(A,E)=>{const k=[...e.keyword_rules];k[A]={...k[A],keywords:(k[A].keywords||[]).filter((T,P)=>P!==E)},a({...e,keyword_rules:k})},N=(A,E,k)=>{const T=[...e.keyword_rules],P=[...T[A].keywords||[]];P[E]=k,T[A]={...T[A],keywords:P},a({...e,keyword_rules:T})},O=({rule:A})=>{const E=`{ regex = [${(A.regex||[]).map(k=>`"${k}"`).join(", ")}], reaction = "${A.reaction}" }`;return o.jsxs(Jo,{children:[o.jsx(es,{asChild:!0,children:o.jsxs(fe,{variant:"outline",size:"sm",children:[o.jsx(ro,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(oo,{className:"w-[95vw] sm:w-[500px]",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx(Xt,{className:"h-60 rounded-md bg-muted p-3",children:o.jsx("pre",{className:"font-mono text-xs break-all",children:E})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},C=({rule:A})=>{const E=`[[keyword_reaction.keyword_rules]] +keywords = [${(A.keywords||[]).map(k=>`"${k}"`).join(", ")}] +reaction = "${A.reaction}"`;return o.jsxs(Jo,{children:[o.jsx(es,{asChild:!0,children:o.jsxs(fe,{variant:"outline",size:"sm",children:[o.jsx(ro,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(oo,{className:"w-[95vw] sm:w-[500px]",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx(Xt,{className:"h-60 rounded-md bg-muted p-3",children:o.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:E})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),o.jsxs(fe,{onClick:d,size:"sm",variant:"outline",children:[o.jsx(er,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),o.jsxs("div",{className:"space-y-3",children:[e.regex_rules.map((A,E)=>o.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",E+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(p,{regex:A.regex&&A.regex[0]||"",reaction:A.reaction,onRegexChange:k=>m(E,"regex",k),onReactionChange:k=>m(E,"reaction",k)}),o.jsx(O,{rule:A}),o.jsxs(Pn,{children:[o.jsx(na,{asChild:!0,children:o.jsx(fe,{size:"sm",variant:"ghost",children:o.jsx(Ut,{className:"h-4 w-4"})})}),o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认删除"}),o.jsxs(wn,{children:["确定要删除正则规则 ",E+1," 吗?此操作无法撤销。"]})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:()=>f(E),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),o.jsx(Ne,{value:A.regex&&A.regex[0]||"",onChange:k=>m(E,"regex",k.target.value),placeholder:"例如:^(?P\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?Ppattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{className:"text-xs font-medium",children:"反应内容"}),o.jsx(qt,{value:A.reaction,onChange:k=>m(E,"reaction",k.target.value),placeholder:`触发后麦麦的反应... +可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},E)),e.regex_rules.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),o.jsxs("div",{className:"space-y-4 border-t pt-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),o.jsxs(fe,{onClick:g,size:"sm",variant:"outline",children:[o.jsx(er,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),o.jsxs("div",{className:"space-y-3",children:[e.keyword_rules.map((A,E)=>o.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",E+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(C,{rule:A}),o.jsxs(Pn,{children:[o.jsx(na,{asChild:!0,children:o.jsx(fe,{size:"sm",variant:"ghost",children:o.jsx(Ut,{className:"h-4 w-4"})})}),o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认删除"}),o.jsxs(wn,{children:["确定要删除关键词规则 ",E+1," 吗?此操作无法撤销。"]})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:()=>x(E),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(J,{className:"text-xs font-medium",children:"关键词列表"}),o.jsxs(fe,{onClick:()=>b(E),size:"sm",variant:"ghost",children:[o.jsx(er,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),o.jsxs("div",{className:"space-y-2",children:[(A.keywords||[]).map((k,T)=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ne,{value:k,onChange:P=>N(E,T,P.target.value),placeholder:"关键词",className:"flex-1"}),o.jsx(fe,{onClick:()=>w(E,T),size:"sm",variant:"ghost",children:o.jsx(Ut,{className:"h-4 w-4"})})]},T)),(!A.keywords||A.keywords.length===0)&&o.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{className:"text-xs font-medium",children:"反应内容"}),o.jsx(qt,{value:A.reaction,onChange:k=>j(E,"reaction",k.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},E)),e.keyword_rules.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(at,{id:"enable_response_post_process",checked:t.enable_response_post_process,onCheckedChange:A=>i({...t,enable_response_post_process:A})}),o.jsx(J,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),t.enable_response_post_process&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t pt-6 space-y-4",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[o.jsx(at,{id:"enable_chinese_typo",checked:n.enable,onCheckedChange:A=>l({...n,enable:A})}),o.jsx(J,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),n.enable&&o.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),o.jsx(Ne,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.error_rate,onChange:A=>l({...n,error_rate:parseFloat(A.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),o.jsx(Ne,{id:"min_freq",type:"number",min:"0",value:n.min_freq,onChange:A=>l({...n,min_freq:parseInt(A.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),o.jsx(Ne,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:n.tone_error_rate,onChange:A=>l({...n,tone_error_rate:parseFloat(A.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),o.jsx(Ne,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.word_replace_rate,onChange:A=>l({...n,word_replace_rate:parseFloat(A.target.value)})})]})]})]})}),o.jsx("div",{className:"border-t pt-6 space-y-4",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[o.jsx(at,{id:"enable_response_splitter",checked:r.enable,onCheckedChange:A=>u({...r,enable:A})}),o.jsx(J,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),r.enable&&o.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),o.jsx(Ne,{id:"max_length",type:"number",min:"1",value:r.max_length,onChange:A=>u({...r,max_length:parseInt(A.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),o.jsx(Ne,{id:"max_sentence_num",type:"number",min:"1",value:r.max_sentence_num,onChange:A=>u({...r,max_sentence_num:parseInt(A.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(at,{id:"enable_kaomoji_protection",checked:r.enable_kaomoji_protection,onCheckedChange:A=>u({...r,enable_kaomoji_protection:A})}),o.jsx(J,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(at,{id:"enable_overflow_return_all",checked:r.enable_overflow_return_all,onCheckedChange:A=>u({...r,enable_overflow_return_all:A})}),o.jsx(J,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),o.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function vje({config:e,onChange:t}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(at,{checked:e.enable_mood,onCheckedChange:n=>t({...e,enable_mood:n})}),o.jsx(J,{className:"cursor-pointer",children:"启用情绪系统"})]}),e.enable_mood&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"情绪更新阈值"}),o.jsx(Ne,{type:"number",min:"1",value:e.mood_update_threshold,onChange:n=>t({...e,mood_update_threshold:parseInt(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"情感特征"}),o.jsx(qt,{value:e.emotion_style,onChange:n=>t({...e,emotion_style:n.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function gje({config:e,onChange:t}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(at,{checked:e.enable_asr,onCheckedChange:n=>t({...e,enable_asr:n})}),o.jsx(J,{className:"cursor-pointer",children:"启用语音识别"})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function yje({config:e,onChange:t}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(at,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})}),o.jsx(J,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),e.enable&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"LPMM 模式"}),o.jsxs(Et,{value:e.lpmm_mode,onValueChange:n=>t({...e,lpmm_mode:n}),children:[o.jsx(wt,{children:o.jsx(At,{placeholder:"选择 LPMM 模式"})}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"classic",children:"经典模式"}),o.jsx(Pe,{value:"agent",children:"Agent 模式"})]})]})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"同义词搜索 TopK"}),o.jsx(Ne,{type:"number",min:"1",value:e.rag_synonym_search_top_k,onChange:n=>t({...e,rag_synonym_search_top_k:parseInt(n.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"同义词阈值"}),o.jsx(Ne,{type:"number",step:"0.1",min:"0",max:"1",value:e.rag_synonym_threshold,onChange:n=>t({...e,rag_synonym_threshold:parseFloat(n.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"实体提取线程数"}),o.jsx(Ne,{type:"number",min:"1",value:e.info_extraction_workers,onChange:n=>t({...e,info_extraction_workers:parseInt(n.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"嵌入向量维度"}),o.jsx(Ne,{type:"number",min:"1",value:e.embedding_dimension,onChange:n=>t({...e,embedding_dimension:parseInt(n.target.value)})})]})]})]})]})]})}function xje({config:e,onChange:t}){const[n,r]=y.useState(""),[a,i]=y.useState("WARNING"),l=()=>{n&&!e.suppress_libraries.includes(n)&&(t({...e,suppress_libraries:[...e.suppress_libraries,n]}),r(""))},u=x=>{t({...e,suppress_libraries:e.suppress_libraries.filter(j=>j!==x)})},d=()=>{n&&!e.library_log_levels[n]&&(t({...e,library_log_levels:{...e.library_log_levels,[n]:a}}),r(""),i("WARNING"))},f=x=>{const j={...e.library_log_levels};delete j[x],t({...e,library_log_levels:j})},m=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],p=["FULL","compact","lite"],g=["none","title","full"];return o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"日期格式"}),o.jsx(Ne,{value:e.date_style,onChange:x=>t({...e,date_style:x.target.value}),placeholder:"例如: m-d H:i:s"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"日志级别样式"}),o.jsxs(Et,{value:e.log_level_style,onValueChange:x=>t({...e,log_level_style:x}),children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsx(jt,{children:p.map(x=>o.jsx(Pe,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"日志文本颜色"}),o.jsxs(Et,{value:e.color_text,onValueChange:x=>t({...e,color_text:x}),children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsx(jt,{children:g.map(x=>o.jsx(Pe,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"全局日志级别"}),o.jsxs(Et,{value:e.log_level,onValueChange:x=>t({...e,log_level:x}),children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsx(jt,{children:m.map(x=>o.jsx(Pe,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"控制台日志级别"}),o.jsxs(Et,{value:e.console_log_level,onValueChange:x=>t({...e,console_log_level:x}),children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsx(jt,{children:m.map(x=>o.jsx(Pe,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"文件日志级别"}),o.jsxs(Et,{value:e.file_log_level,onValueChange:x=>t({...e,file_log_level:x}),children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsx(jt,{children:m.map(x=>o.jsx(Pe,{value:x,children:x},x))})]})]})]})]}),o.jsxs("div",{children:[o.jsx(J,{className:"mb-2 block",children:"完全屏蔽的库"}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx(Ne,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),l())}}),o.jsx(fe,{onClick:l,size:"sm",className:"flex-shrink-0",children:o.jsx(er,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),o.jsx("div",{className:"flex flex-wrap gap-2",children:e.suppress_libraries.map(x=>o.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[o.jsx("span",{className:"text-sm",children:x}),o.jsx(fe,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>u(x),children:o.jsx(Ut,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},x))})]}),o.jsxs("div",{children:[o.jsx(J,{className:"mb-2 block",children:"特定库的日志级别"}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx(Ne,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1"}),o.jsxs(Et,{value:a,onValueChange:i,children:[o.jsx(wt,{className:"w-32",children:o.jsx(At,{})}),o.jsx(jt,{children:m.map(x=>o.jsx(Pe,{value:x,children:x},x))})]}),o.jsx(fe,{onClick:d,size:"sm",children:o.jsx(er,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),o.jsx("div",{className:"space-y-2",children:Object.entries(e.library_log_levels).map(([x,j])=>o.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[o.jsx("span",{className:"text-sm font-medium",children:x}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm text-muted-foreground",children:j}),o.jsx(fe,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>f(x),children:o.jsx(Ut,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},x))})]})]})}function bje({config:e,onChange:t}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(J,{children:"显示 Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),o.jsx(at,{checked:e.show_prompt,onCheckedChange:n=>t({...e,show_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(J,{children:"显示回复器 Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),o.jsx(at,{checked:e.show_replyer_prompt,onCheckedChange:n=>t({...e,show_replyer_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(J,{children:"显示回复器推理"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),o.jsx(at,{checked:e.show_replyer_reasoning,onCheckedChange:n=>t({...e,show_replyer_reasoning:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(J,{children:"显示 Jargon Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),o.jsx(at,{checked:e.show_jargon_prompt,onCheckedChange:n=>t({...e,show_jargon_prompt:n})})]})]})]})}function wje({config:e,onChange:t}){const[n,r]=y.useState(""),a=()=>{n&&!e.auth_token.includes(n)&&(t({...e,auth_token:[...e.auth_token,n]}),r(""))},i=l=>{t({...e,auth_token:e.auth_token.filter((u,d)=>d!==l)})};return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(J,{children:"启用自定义服务器"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),o.jsx(at,{checked:e.use_custom,onCheckedChange:l=>t({...e,use_custom:l})})]}),e.use_custom&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"主机地址"}),o.jsx(Ne,{value:e.host,onChange:l=>t({...e,host:l.target.value}),placeholder:"127.0.0.1"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"端口号"}),o.jsx(Ne,{type:"number",value:e.port,onChange:l=>t({...e,port:parseInt(l.target.value)}),placeholder:"8090"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"连接模式"}),o.jsxs(Et,{value:e.mode,onValueChange:l=>t({...e,mode:l}),children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"ws",children:"WebSocket (ws)"}),o.jsx(Pe,{value:"tcp",children:"TCP"})]})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(at,{checked:e.use_wss,onCheckedChange:l=>t({...e,use_wss:l}),disabled:e.mode!=="ws"}),o.jsx(J,{children:"使用 WSS 安全连接"})]})]}),e.use_wss&&e.mode==="ws"&&o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"SSL 证书文件路径"}),o.jsx(Ne,{value:e.cert_file,onChange:l=>t({...e,cert_file:l.target.value}),placeholder:"cert.pem"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"SSL 密钥文件路径"}),o.jsx(Ne,{value:e.key_file,onChange:l=>t({...e,key_file:l.target.value}),placeholder:"key.pem"})]})]})]})]})]}),o.jsxs("div",{children:[o.jsx(J,{className:"mb-2 block",children:"认证令牌"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx(Ne,{value:n,onChange:l=>r(l.target.value),placeholder:"输入认证令牌",onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),a())}}),o.jsx(fe,{onClick:a,size:"sm",children:o.jsx(er,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),o.jsx("div",{className:"space-y-2",children:e.auth_token.map((l,u)=>o.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[o.jsx("span",{className:"text-sm font-mono",children:l}),o.jsx(fe,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>i(u),children:o.jsx(Ut,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},u))})]})]})}function jje({config:e,onChange:t}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(J,{children:"启用统计信息发送"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),o.jsx(at,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})})]})]})}const Nl=y.forwardRef(({className:e,...t},n)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:n,className:ue("w-full caption-bottom text-sm",e),...t})}));Nl.displayName="Table";const Ol=y.forwardRef(({className:e,...t},n)=>o.jsx("thead",{ref:n,className:ue("[&_tr]:border-b",e),...t}));Ol.displayName="TableHeader";const Cl=y.forwardRef(({className:e,...t},n)=>o.jsx("tbody",{ref:n,className:ue("[&_tr:last-child]:border-0",e),...t}));Cl.displayName="TableBody";const Sje=y.forwardRef(({className:e,...t},n)=>o.jsx("tfoot",{ref:n,className:ue("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Sje.displayName="TableFooter";const pn=y.forwardRef(({className:e,...t},n)=>o.jsx("tr",{ref:n,className:ue("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));pn.displayName="TableRow";const Je=y.forwardRef(({className:e,...t},n)=>o.jsx("th",{ref:n,className:ue("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Je.displayName="TableHead";const Ue=y.forwardRef(({className:e,...t},n)=>o.jsx("td",{ref:n,className:ue("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Ue.displayName="TableCell";const _je=y.forwardRef(({className:e,...t},n)=>o.jsx("caption",{ref:n,className:ue("mt-4 text-sm text-muted-foreground",e),...t}));_je.displayName="TableCaption";var Ky="Checkbox",[Nje]=fr(Ky),[Oje,wE]=Nje(Ky);function Cje(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:i,form:l,name:u,onCheckedChange:d,required:f,value:m="on",internal_do_not_use_render:p}=e,[g,x]=_a({prop:n,defaultProp:a??!1,onChange:d,caller:Ky}),[j,b]=y.useState(null),[w,N]=y.useState(null),O=y.useRef(!1),C=j?!!l||!!j.closest("form"):!0,A={checked:g,disabled:i,setChecked:x,control:j,setControl:b,name:u,form:l,value:m,hasConsumerStoppedPropagationRef:O,required:f,defaultChecked:Ko(a)?!1:a,isFormControl:C,bubbleInput:w,setBubbleInput:N};return o.jsx(Oje,{scope:t,...A,children:Eje(p)?p(A):r})}var XU="CheckboxTrigger",ZU=y.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:i,value:l,disabled:u,checked:d,required:f,setControl:m,setChecked:p,hasConsumerStoppedPropagationRef:g,isFormControl:x,bubbleInput:j}=wE(XU,e),b=qe(a,m),w=y.useRef(d);return y.useEffect(()=>{const N=i?.form;if(N){const O=()=>p(w.current);return N.addEventListener("reset",O),()=>N.removeEventListener("reset",O)}},[i,p]),o.jsx(Me.button,{type:"button",role:"checkbox","aria-checked":Ko(d)?"mixed":d,"aria-required":f,"data-state":nH(d),"data-disabled":u?"":void 0,disabled:u,value:l,...r,ref:b,onKeyDown:Se(t,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:Se(n,N=>{p(O=>Ko(O)?!0:!O),j&&x&&(g.current=N.isPropagationStopped(),g.current||N.stopPropagation())})})});ZU.displayName=XU;var jE=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:i,required:l,disabled:u,value:d,onCheckedChange:f,form:m,...p}=e;return o.jsx(Cje,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:u,required:l,onCheckedChange:f,name:r,form:m,value:d,internal_do_not_use_render:({isFormControl:g})=>o.jsxs(o.Fragment,{children:[o.jsx(ZU,{...p,ref:t,__scopeCheckbox:n}),g&&o.jsx(tH,{__scopeCheckbox:n})]})})});jE.displayName=Ky;var QU="CheckboxIndicator",JU=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=wE(QU,n);return o.jsx(Mn,{present:r||Ko(i.checked)||i.checked===!0,children:o.jsx(Me.span,{"data-state":nH(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});JU.displayName=QU;var eH="CheckboxBubbleInput",tH=y.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:l,required:u,disabled:d,name:f,value:m,form:p,bubbleInput:g,setBubbleInput:x}=wE(eH,e),j=qe(n,x),b=Ey(i),w=Ay(r);y.useEffect(()=>{const O=g;if(!O)return;const C=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(C,"checked").set,k=!a.current;if(b!==i&&E){const T=new Event("click",{bubbles:k});O.indeterminate=Ko(i),E.call(O,Ko(i)?!1:i),O.dispatchEvent(T)}},[g,b,i,a]);const N=y.useRef(Ko(i)?!1:i);return o.jsx(Me.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??N.current,required:u,disabled:d,name:f,value:m,form:p,...t,tabIndex:-1,ref:j,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});tH.displayName=eH;function Eje(e){return typeof e=="function"}function Ko(e){return e==="indeterminate"}function nH(e){return Ko(e)?"indeterminate":e?"checked":"unchecked"}const Tu=y.forwardRef(({className:e,...t},n)=>o.jsx(jE,{ref:n,className:ue("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:o.jsx(JU,{className:ue("grid place-content-center text-current"),children:o.jsx(tl,{className:"h-4 w-4"})})}));Tu.displayName=jE.displayName;function Aje(){const[e,t]=y.useState([]),[n,r]=y.useState(!0),[a,i]=y.useState(!1),[l,u]=y.useState(!1),[d,f]=y.useState(!1),[m,p]=y.useState(!1),[g,x]=y.useState(null),[j,b]=y.useState(null),[w,N]=y.useState(!1),[O,C]=y.useState(null),[A,E]=y.useState(!1),[k,T]=y.useState(""),[P,$]=y.useState(new Set),[z,D]=y.useState(!1),{toast:U}=hr(),V=y.useRef(null),H=y.useRef(!0);y.useEffect(()=>{G()},[]);const G=async()=>{try{r(!0);const ae=await Tg();t(ae.api_providers||[]),f(!1),H.current=!1}catch(ae){console.error("加载配置失败:",ae)}finally{r(!1)}},L=y.useCallback(async ae=>{if(!H.current)try{u(!0),await sO("api_providers",ae),f(!1)}catch(Z){console.error("自动保存失败:",Z),f(!0)}finally{u(!1)}},[]);y.useEffect(()=>{if(!H.current)return f(!0),V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{L(e)},2e3),()=>{V.current&&clearTimeout(V.current)}},[e,L]);const R=async()=>{try{i(!0),V.current&&clearTimeout(V.current);const ae=await Tg();ae.api_providers=e,await KU(ae),f(!1),U({title:"保存成功",description:"模型提供商配置已保存"})}catch(ae){console.error("保存配置失败:",ae),U({title:"保存失败",description:ae.message,variant:"destructive"})}finally{i(!1)}},F=(ae,Z)=>{x(ae||{name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),b(Z),E(!1),p(!0)},K=async()=>{if(g?.api_key)try{await navigator.clipboard.writeText(g.api_key),U({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{U({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},te=()=>{if(g){if(j!==null){const ae=[...e];ae[j]=g,t(ae)}else t([...e,g]);p(!1),x(null),b(null)}},I=ae=>{C(ae),N(!0)},B=()=>{if(O!==null){const ae=e.filter((Z,pe)=>pe!==O);t(ae),U({title:"删除成功",description:"提供商已从列表中移除"})}N(!1),C(null)},Y=ae=>{const Z=new Set(P);Z.has(ae)?Z.delete(ae):Z.add(ae),$(Z)},ne=()=>{if(P.size===ee.length)$(new Set);else{const ae=ee.map((Z,pe)=>e.findIndex(je=>je===ee[pe]));$(new Set(ae))}},oe=()=>{if(P.size===0){U({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}D(!0)},xe=()=>{const ae=e.filter((Z,pe)=>!P.has(pe));t(ae),$(new Set),D(!1),U({title:"批量删除成功",description:`已删除 ${P.size} 个提供商`})},ee=e.filter(ae=>{if(!k)return!0;const Z=k.toLowerCase();return ae.name.toLowerCase().includes(Z)||ae.base_url.toLowerCase().includes(Z)||ae.client_type.toLowerCase().includes(Z)});return n?o.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型提供商配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 API 提供商配置"})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[P.size>0&&o.jsxs(fe,{onClick:oe,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[o.jsx(Ut,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",P.size,")"]}),o.jsxs(fe,{onClick:()=>F(null,null),size:"sm",className:"w-full sm:w-auto",children:[o.jsx(er,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),o.jsxs(fe,{onClick:R,disabled:a||l||!d,size:"sm",variant:"default",className:"w-full sm:w-auto",children:[o.jsx(VC,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),a?"保存中...":l?"自动保存中...":d?"保存配置":"已保存"]})]})]}),o.jsxs(Xt,{className:"h-[calc(100vh-260px)]",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[o.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[o.jsx(Rr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Ne,{placeholder:"搜索提供商名称、URL 或类型...",value:k,onChange:ae=>T(ae.target.value),className:"pl-9"})]}),k&&o.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",ee.length," 个结果"]})]}),o.jsx("div",{className:"md:hidden space-y-3",children:ee.length===0?o.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:k?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):ee.map((ae,Z)=>o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h3",{className:"font-semibold text-base truncate",children:ae.name}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:ae.base_url})]}),o.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>F(ae,Z),children:o.jsx(Cu,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>I(Z),children:o.jsx(Ut,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),o.jsx("p",{className:"font-medium",children:ae.client_type})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),o.jsx("p",{className:"font-medium",children:ae.max_retry})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),o.jsx("p",{className:"font-medium",children:ae.timeout})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),o.jsx("p",{className:"font-medium",children:ae.retry_interval})]})]})]},Z))}),o.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:o.jsxs(Nl,{children:[o.jsx(Ol,{children:o.jsxs(pn,{children:[o.jsx(Je,{className:"w-12",children:o.jsx(Tu,{checked:P.size===ee.length&&ee.length>0,onCheckedChange:ne})}),o.jsx(Je,{children:"名称"}),o.jsx(Je,{children:"基础URL"}),o.jsx(Je,{children:"客户端类型"}),o.jsx(Je,{className:"text-right",children:"最大重试"}),o.jsx(Je,{className:"text-right",children:"超时(秒)"}),o.jsx(Je,{className:"text-right",children:"重试间隔(秒)"}),o.jsx(Je,{className:"text-right",children:"操作"})]})}),o.jsx(Cl,{children:ee.length===0?o.jsx(pn,{children:o.jsx(Ue,{colSpan:8,className:"text-center text-muted-foreground py-8",children:k?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):ee.map((ae,Z)=>{const pe=e.findIndex(je=>je===ae);return o.jsxs(pn,{children:[o.jsx(Ue,{children:o.jsx(Tu,{checked:P.has(pe),onCheckedChange:()=>Y(pe)})}),o.jsx(Ue,{className:"font-medium",children:ae.name}),o.jsx(Ue,{className:"max-w-xs truncate",title:ae.base_url,children:ae.base_url}),o.jsx(Ue,{children:ae.client_type}),o.jsx(Ue,{className:"text-right",children:ae.max_retry}),o.jsx(Ue,{className:"text-right",children:ae.timeout}),o.jsx(Ue,{className:"text-right",children:ae.retry_interval}),o.jsx(Ue,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>F(ae,pe),children:o.jsx(Cu,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>I(pe),children:o.jsx(Ut,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})})]},Z)})})]})})]}),o.jsx(tr,{open:m,onOpenChange:p,children:o.jsxs(Un,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[o.jsxs(Hn,{children:[o.jsx(Wn,{children:j!==null?"编辑提供商":"添加提供商"}),o.jsx(ur,{children:"配置 API 提供商的连接信息和参数"})]}),o.jsxs("div",{className:"grid gap-4 py-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"name",children:"名称 *"}),o.jsx(Ne,{id:"name",value:g?.name||"",onChange:ae=>x(Z=>Z?{...Z,name:ae.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"base_url",children:"基础 URL *"}),o.jsx(Ne,{id:"base_url",value:g?.base_url||"",onChange:ae=>x(Z=>Z?{...Z,base_url:ae.target.value}:null),placeholder:"https://api.example.com/v1"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"api_key",children:"API Key *"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Ne,{id:"api_key",type:A?"text":"password",value:g?.api_key||"",onChange:ae=>x(Z=>Z?{...Z,api_key:ae.target.value}:null),placeholder:"sk-...",className:"flex-1"}),o.jsx(fe,{type:"button",variant:"outline",size:"icon",onClick:()=>E(!A),title:A?"隐藏密钥":"显示密钥",children:A?o.jsx(UN,{className:"h-4 w-4"}):o.jsx(ro,{className:"h-4 w-4"})}),o.jsx(fe,{type:"button",variant:"outline",size:"icon",onClick:K,title:"复制密钥",children:o.jsx(qN,{className:"h-4 w-4"})})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"client_type",children:"客户端类型"}),o.jsxs(Et,{value:g?.client_type||"openai",onValueChange:ae=>x(Z=>Z?{...Z,client_type:ae}:null),children:[o.jsx(wt,{id:"client_type",children:o.jsx(At,{placeholder:"选择客户端类型"})}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"openai",children:"OpenAI"}),o.jsx(Pe,{value:"gemini",children:"Gemini"})]})]})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"max_retry",children:"最大重试"}),o.jsx(Ne,{id:"max_retry",type:"number",min:"0",value:g?.max_retry||2,onChange:ae=>x(Z=>Z?{...Z,max_retry:parseInt(ae.target.value)}:null)})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"timeout",children:"超时(秒)"}),o.jsx(Ne,{id:"timeout",type:"number",min:"1",value:g?.timeout||30,onChange:ae=>x(Z=>Z?{...Z,timeout:parseInt(ae.target.value)}:null)})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),o.jsx(Ne,{id:"retry_interval",type:"number",min:"1",value:g?.retry_interval||10,onChange:ae=>x(Z=>Z?{...Z,retry_interval:parseInt(ae.target.value)}:null)})]})]})]}),o.jsxs(Dr,{children:[o.jsx(fe,{variant:"outline",onClick:()=>p(!1),children:"取消"}),o.jsx(fe,{onClick:te,children:"保存"})]})]})}),o.jsx(Pn,{open:w,onOpenChange:N,children:o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认删除"}),o.jsxs(wn,{children:['确定要删除提供商 "',O!==null?e[O]?.name:"",'" 吗? 此操作无法撤销。']})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:B,children:"删除"})]})]})}),o.jsx(Pn,{open:z,onOpenChange:D,children:o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认批量删除"}),o.jsxs(wn,{children:["确定要删除选中的 ",P.size," 个提供商吗? 此操作无法撤销。"]})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:xe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}var yL=1,Tje=.9,kje=.8,Pje=.17,e_=.1,t_=.999,Mje=.9999,Rje=.99,Dje=/[\\\/_+.#"@\[\(\{&]/,$je=/[\\\/_+.#"@\[\(\{&]/g,Ije=/[\s-]/,rH=/[\s-]/g;function lO(e,t,n,r,a,i,l){if(i===t.length)return a===e.length?yL:Rje;var u=`${a},${i}`;if(l[u]!==void 0)return l[u];for(var d=r.charAt(i),f=n.indexOf(d,a),m=0,p,g,x,j;f>=0;)p=lO(e,t,n,r,f+1,i+1,l),p>m&&(f===a?p*=yL:Dje.test(e.charAt(f-1))?(p*=kje,x=e.slice(a,f-1).match($je),x&&a>0&&(p*=Math.pow(t_,x.length))):Ije.test(e.charAt(f-1))?(p*=Tje,j=e.slice(a,f-1).match(rH),j&&a>0&&(p*=Math.pow(t_,j.length))):(p*=Pje,a>0&&(p*=Math.pow(t_,f-a))),e.charAt(f)!==t.charAt(i)&&(p*=Mje)),(pp&&(p=g*e_)),p>m&&(m=p),f=n.indexOf(d,f+1);return l[u]=m,m}function xL(e){return e.toLowerCase().replace(rH," ")}function Lje(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,lO(e,t,xL(e),xL(t),0,0,{})}var Bje=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ds=Bje.reduce((e,t)=>{const n=Lh(`Primitive.${t}`),r=y.forwardRef((a,i)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(d,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),af='[cmdk-group=""]',n_='[cmdk-group-items=""]',zje='[cmdk-group-heading=""]',aH='[cmdk-item=""]',bL=`${aH}:not([aria-disabled="true"])`,cO="cmdk-item-select",kc="data-value",qje=(e,t,n)=>Lje(e,t,n),iH=y.createContext(void 0),Vh=()=>y.useContext(iH),oH=y.createContext(void 0),SE=()=>y.useContext(oH),sH=y.createContext(void 0),lH=y.forwardRef((e,t)=>{let n=Pc(()=>{var B,Y;return{search:"",value:(Y=(B=e.value)!=null?B:e.defaultValue)!=null?Y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Pc(()=>new Set),a=Pc(()=>new Map),i=Pc(()=>new Map),l=Pc(()=>new Set),u=cH(e),{label:d,children:f,value:m,onValueChange:p,filter:g,shouldFilter:x,loop:j,disablePointerSelection:b=!1,vimBindings:w=!0,...N}=e,O=qn(),C=qn(),A=qn(),E=y.useRef(null),k=Qje();vl(()=>{if(m!==void 0){let B=m.trim();n.current.value=B,T.emit()}},[m]),vl(()=>{k(6,V)},[]);let T=y.useMemo(()=>({subscribe:B=>(l.current.add(B),()=>l.current.delete(B)),snapshot:()=>n.current,setState:(B,Y,ne)=>{var oe,xe,ee,ae;if(!Object.is(n.current[B],Y)){if(n.current[B]=Y,B==="search")U(),z(),k(1,D);else if(B==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Z=document.getElementById(A);Z?Z.focus():(oe=document.getElementById(O))==null||oe.focus()}if(k(7,()=>{var Z;n.current.selectedItemId=(Z=H())==null?void 0:Z.id,T.emit()}),ne||k(5,V),((xe=u.current)==null?void 0:xe.value)!==void 0){let Z=Y??"";(ae=(ee=u.current).onValueChange)==null||ae.call(ee,Z);return}}T.emit()}},emit:()=>{l.current.forEach(B=>B())}}),[]),P=y.useMemo(()=>({value:(B,Y,ne)=>{var oe;Y!==((oe=i.current.get(B))==null?void 0:oe.value)&&(i.current.set(B,{value:Y,keywords:ne}),n.current.filtered.items.set(B,$(Y,ne)),k(2,()=>{z(),T.emit()}))},item:(B,Y)=>(r.current.add(B),Y&&(a.current.has(Y)?a.current.get(Y).add(B):a.current.set(Y,new Set([B]))),k(3,()=>{U(),z(),n.current.value||D(),T.emit()}),()=>{i.current.delete(B),r.current.delete(B),n.current.filtered.items.delete(B);let ne=H();k(4,()=>{U(),ne?.getAttribute("id")===B&&D(),T.emit()})}),group:B=>(a.current.has(B)||a.current.set(B,new Set),()=>{i.current.delete(B),a.current.delete(B)}),filter:()=>u.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:O,inputId:A,labelId:C,listInnerRef:E}),[]);function $(B,Y){var ne,oe;let xe=(oe=(ne=u.current)==null?void 0:ne.filter)!=null?oe:qje;return B?xe(B,n.current.search,Y):0}function z(){if(!n.current.search||u.current.shouldFilter===!1)return;let B=n.current.filtered.items,Y=[];n.current.filtered.groups.forEach(oe=>{let xe=a.current.get(oe),ee=0;xe.forEach(ae=>{let Z=B.get(ae);ee=Math.max(Z,ee)}),Y.push([oe,ee])});let ne=E.current;G().sort((oe,xe)=>{var ee,ae;let Z=oe.getAttribute("id"),pe=xe.getAttribute("id");return((ee=B.get(pe))!=null?ee:0)-((ae=B.get(Z))!=null?ae:0)}).forEach(oe=>{let xe=oe.closest(n_);xe?xe.appendChild(oe.parentElement===xe?oe:oe.closest(`${n_} > *`)):ne.appendChild(oe.parentElement===ne?oe:oe.closest(`${n_} > *`))}),Y.sort((oe,xe)=>xe[1]-oe[1]).forEach(oe=>{var xe;let ee=(xe=E.current)==null?void 0:xe.querySelector(`${af}[${kc}="${encodeURIComponent(oe[0])}"]`);ee?.parentElement.appendChild(ee)})}function D(){let B=G().find(ne=>ne.getAttribute("aria-disabled")!=="true"),Y=B?.getAttribute(kc);T.setState("value",Y||void 0)}function U(){var B,Y,ne,oe;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let xe=0;for(let ee of r.current){let ae=(Y=(B=i.current.get(ee))==null?void 0:B.value)!=null?Y:"",Z=(oe=(ne=i.current.get(ee))==null?void 0:ne.keywords)!=null?oe:[],pe=$(ae,Z);n.current.filtered.items.set(ee,pe),pe>0&&xe++}for(let[ee,ae]of a.current)for(let Z of ae)if(n.current.filtered.items.get(Z)>0){n.current.filtered.groups.add(ee);break}n.current.filtered.count=xe}function V(){var B,Y,ne;let oe=H();oe&&(((B=oe.parentElement)==null?void 0:B.firstChild)===oe&&((ne=(Y=oe.closest(af))==null?void 0:Y.querySelector(zje))==null||ne.scrollIntoView({block:"nearest"})),oe.scrollIntoView({block:"nearest"}))}function H(){var B;return(B=E.current)==null?void 0:B.querySelector(`${aH}[aria-selected="true"]`)}function G(){var B;return Array.from(((B=E.current)==null?void 0:B.querySelectorAll(bL))||[])}function L(B){let Y=G()[B];Y&&T.setState("value",Y.getAttribute(kc))}function R(B){var Y;let ne=H(),oe=G(),xe=oe.findIndex(ae=>ae===ne),ee=oe[xe+B];(Y=u.current)!=null&&Y.loop&&(ee=xe+B<0?oe[oe.length-1]:xe+B===oe.length?oe[0]:oe[xe+B]),ee&&T.setState("value",ee.getAttribute(kc))}function F(B){let Y=H(),ne=Y?.closest(af),oe;for(;ne&&!oe;)ne=B>0?Xje(ne,af):Zje(ne,af),oe=ne?.querySelector(bL);oe?T.setState("value",oe.getAttribute(kc)):R(B)}let K=()=>L(G().length-1),te=B=>{B.preventDefault(),B.metaKey?K():B.altKey?F(1):R(1)},I=B=>{B.preventDefault(),B.metaKey?L(0):B.altKey?F(-1):R(-1)};return y.createElement(ds.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:B=>{var Y;(Y=N.onKeyDown)==null||Y.call(N,B);let ne=B.nativeEvent.isComposing||B.keyCode===229;if(!(B.defaultPrevented||ne))switch(B.key){case"n":case"j":{w&&B.ctrlKey&&te(B);break}case"ArrowDown":{te(B);break}case"p":case"k":{w&&B.ctrlKey&&I(B);break}case"ArrowUp":{I(B);break}case"Home":{B.preventDefault(),L(0);break}case"End":{B.preventDefault(),K();break}case"Enter":{B.preventDefault();let oe=H();if(oe){let xe=new Event(cO);oe.dispatchEvent(xe)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:e1e},d),Xy(e,B=>y.createElement(oH.Provider,{value:T},y.createElement(iH.Provider,{value:P},B))))}),Fje=y.forwardRef((e,t)=>{var n,r;let a=qn(),i=y.useRef(null),l=y.useContext(sH),u=Vh(),d=cH(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:l?.forceMount;vl(()=>{if(!f)return u.item(a,l?.id)},[f]);let m=uH(a,i,[e.value,e.children,i],e.keywords),p=SE(),g=ts(k=>k.value&&k.value===m.current),x=ts(k=>f||u.filter()===!1?!0:k.search?k.filtered.items.get(a)>0:!0);y.useEffect(()=>{let k=i.current;if(!(!k||e.disabled))return k.addEventListener(cO,j),()=>k.removeEventListener(cO,j)},[x,e.onSelect,e.disabled]);function j(){var k,T;b(),(T=(k=d.current).onSelect)==null||T.call(k,m.current)}function b(){p.setState("value",m.current,!0)}if(!x)return null;let{disabled:w,value:N,onSelect:O,forceMount:C,keywords:A,...E}=e;return y.createElement(ds.div,{ref:Mr(i,t),...E,id:a,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!g,"data-disabled":!!w,"data-selected":!!g,onPointerMove:w||u.getDisablePointerSelection()?void 0:b,onClick:w?void 0:j},e.children)}),Uje=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,l=qn(),u=y.useRef(null),d=y.useRef(null),f=qn(),m=Vh(),p=ts(x=>a||m.filter()===!1?!0:x.search?x.filtered.groups.has(l):!0);vl(()=>m.group(l),[]),uH(l,u,[e.value,e.heading,d]);let g=y.useMemo(()=>({id:l,forceMount:a}),[a]);return y.createElement(ds.div,{ref:Mr(u,t),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&y.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),Xy(e,x=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},y.createElement(sH.Provider,{value:g},x))))}),Hje=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=y.useRef(null),i=ts(l=>!l.search);return!n&&!i?null:y.createElement(ds.div,{ref:Mr(a,t),...r,"cmdk-separator":"",role:"separator"})}),Wje=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=SE(),l=ts(f=>f.search),u=ts(f=>f.selectedItemId),d=Vh();return y.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),y.createElement(ds.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":u,id:d.inputId,type:"text",value:a?e.value:l,onChange:f=>{a||i.setState("search",f.target.value),n?.(f.target.value)}})}),Vje=y.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=y.useRef(null),l=y.useRef(null),u=ts(f=>f.selectedItemId),d=Vh();return y.useEffect(()=>{if(l.current&&i.current){let f=l.current,m=i.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let x=f.offsetHeight;m.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return g.observe(f),()=>{cancelAnimationFrame(p),g.unobserve(f)}}},[]),y.createElement(ds.div,{ref:Mr(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":r,id:d.listId},Xy(e,f=>y.createElement("div",{ref:Mr(l,d.listInnerRef),"cmdk-list-sizer":""},f)))}),Gje=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:l,...u}=e;return y.createElement(tE,{open:n,onOpenChange:r},y.createElement(nE,{container:l},y.createElement(Dy,{"cmdk-overlay":"",className:a}),y.createElement($y,{"aria-label":e.label,"cmdk-dialog":"",className:i},y.createElement(lH,{ref:t,...u}))))}),Yje=y.forwardRef((e,t)=>ts(n=>n.filtered.count===0)?y.createElement(ds.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Kje=y.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return y.createElement(ds.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Xy(e,l=>y.createElement("div",{"aria-hidden":!0},l)))}),Lr=Object.assign(lH,{List:Vje,Item:Fje,Input:Wje,Group:Uje,Separator:Hje,Dialog:Gje,Empty:Yje,Loading:Kje});function Xje(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Zje(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function cH(e){let t=y.useRef(e);return vl(()=>{t.current=e}),t}var vl=typeof window>"u"?y.useEffect:y.useLayoutEffect;function Pc(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function ts(e){let t=SE(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function uH(e,t,n,r=[]){let a=y.useRef(),i=Vh();return vl(()=>{var l;let u=(()=>{var f;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(f=m.current.textContent)==null?void 0:f.trim():a.current}})(),d=r.map(f=>f.trim());i.value(e,u,d),(l=t.current)==null||l.setAttribute(kc,u),a.current=u}),a}var Qje=()=>{let[e,t]=y.useState(),n=Pc(()=>new Map);return vl(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function Jje(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Xy({asChild:e,children:t},n){return e&&y.isValidElement(t)?y.cloneElement(Jje(t),{ref:t.ref},n(t.props.children)):n(t)}var e1e={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const dH=y.forwardRef(({className:e,...t},n)=>o.jsx(Lr,{ref:n,className:ue("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));dH.displayName=Lr.displayName;const fH=y.forwardRef(({className:e,...t},n)=>o.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[o.jsx(Rr,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),o.jsx(Lr.Input,{ref:n,className:ue("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));fH.displayName=Lr.Input.displayName;const hH=y.forwardRef(({className:e,...t},n)=>o.jsx(Lr.List,{ref:n,className:ue("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));hH.displayName=Lr.List.displayName;const mH=y.forwardRef((e,t)=>o.jsx(Lr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));mH.displayName=Lr.Empty.displayName;const pH=y.forwardRef(({className:e,...t},n)=>o.jsx(Lr.Group,{ref:n,className:ue("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));pH.displayName=Lr.Group.displayName;const t1e=y.forwardRef(({className:e,...t},n)=>o.jsx(Lr.Separator,{ref:n,className:ue("-mx-1 h-px bg-border",e),...t}));t1e.displayName=Lr.Separator.displayName;const vH=y.forwardRef(({className:e,...t},n)=>o.jsx(Lr.Item,{ref:n,className:ue("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));vH.displayName=Lr.Item.displayName;function n1e({options:e,selected:t,onChange:n,placeholder:r="选择选项...",emptyText:a="未找到选项",className:i}){const[l,u]=y.useState(!1),d=m=>{t.includes(m)?n(t.filter(p=>p!==m)):n([...t,m])},f=m=>{n(t.filter(p=>p!==m))};return o.jsxs(Jo,{open:l,onOpenChange:u,children:[o.jsx(es,{asChild:!0,children:o.jsxs(fe,{variant:"outline",role:"combobox","aria-expanded":l,className:ue("w-full justify-between min-h-10 h-auto",i),children:[o.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:t.length===0?o.jsx("span",{className:"text-muted-foreground",children:r}):t.map(m=>{const p=e.find(g=>g.value===m);return o.jsxs(en,{variant:"secondary",className:"cursor-pointer hover:bg-secondary/80",onClick:g=>{g.stopPropagation(),f(m)},children:[p?.label||m,o.jsx(Ih,{className:"ml-1 h-3 w-3",strokeWidth:2,fill:"none"})]},m)})}),o.jsx(ove,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),o.jsx(oo,{className:"w-full p-0",align:"start",children:o.jsxs(dH,{children:[o.jsx(fH,{placeholder:"搜索...",className:"h-9"}),o.jsxs(hH,{children:[o.jsx(mH,{children:a}),o.jsx(pH,{children:e.map(m=>{const p=t.includes(m.value);return o.jsxs(vH,{value:m.value,onSelect:()=>d(m.value),children:[o.jsx("div",{className:ue("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",p?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:o.jsx(tl,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),o.jsx("span",{children:m.label})]},m.value)})})]})]})})]})}function r1e(){const[e,t]=y.useState([]),[n,r]=y.useState([]),[a,i]=y.useState([]),[l,u]=y.useState(null),[d,f]=y.useState(!0),[m,p]=y.useState(!1),[g,x]=y.useState(!1),[j,b]=y.useState(!1),[w,N]=y.useState(!1),[O,C]=y.useState(null),[A,E]=y.useState(null),[k,T]=y.useState(!1),[P,$]=y.useState(null),[z,D]=y.useState(""),[U,V]=y.useState(new Set),[H,G]=y.useState(!1),{toast:L}=hr(),R=y.useRef(null),F=y.useRef(null),K=y.useRef(!0);y.useEffect(()=>{te()},[]);const te=async()=>{try{f(!0);const me=await Tg(),ve=me.models||[];t(ve),i(ve.map(Dt=>Dt.name));const Le=me.api_providers||[];r(Le.map(Dt=>Dt.name)),u(me.model_task_config||null),b(!1),K.current=!1}catch(me){console.error("加载配置失败:",me)}finally{f(!1)}},I=y.useCallback(async me=>{if(!K.current)try{x(!0),await sO("models",me),b(!1)}catch(ve){console.error("自动保存模型列表失败:",ve),b(!0)}finally{x(!1)}},[]),B=y.useCallback(async me=>{if(!K.current)try{x(!0),await sO("model_task_config",me),b(!1)}catch(ve){console.error("自动保存任务配置失败:",ve),b(!0)}finally{x(!1)}},[]);y.useEffect(()=>{if(!K.current)return b(!0),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{I(e)},2e3),()=>{R.current&&clearTimeout(R.current)}},[e,I]),y.useEffect(()=>{if(!(K.current||!l))return b(!0),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{B(l)},2e3),()=>{F.current&&clearTimeout(F.current)}},[l,B]);const Y=async()=>{try{p(!0),R.current&&clearTimeout(R.current),F.current&&clearTimeout(F.current);const me=await Tg();me.models=e,me.model_task_config=l,await KU(me),b(!1),L({title:"保存成功",description:"模型配置已保存"}),await te()}catch(me){console.error("保存配置失败:",me),L({title:"保存失败",description:me.message,variant:"destructive"})}finally{p(!1)}},ne=(me,ve)=>{C(me||{model_identifier:"",name:"",api_provider:n[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),E(ve),N(!0)},oe=()=>{if(O){if(A!==null){const me=[...e];me[A]=O,t(me)}else t([...e,O]);N(!1),C(null),E(null)}},xe=me=>{$(me),T(!0)},ee=()=>{if(P!==null){const me=e.filter((ve,Le)=>Le!==P);t(me),L({title:"删除成功",description:"模型已从列表中移除"})}T(!1),$(null)},ae=me=>{const ve=new Set(U);ve.has(me)?ve.delete(me):ve.add(me),V(ve)},Z=()=>{if(U.size===Re.length)V(new Set);else{const me=Re.map((ve,Le)=>e.findIndex(Dt=>Dt===Re[Le]));V(new Set(me))}},pe=()=>{if(U.size===0){L({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}G(!0)},je=()=>{const me=e.filter((ve,Le)=>!U.has(Le));t(me),V(new Set),G(!1),L({title:"批量删除成功",description:`已删除 ${U.size} 个模型`})},le=(me,ve,Le)=>{l&&u({...l,[me]:{...l[me],[ve]:Le}})},Re=e.filter(me=>{if(!z)return!0;const ve=z.toLowerCase();return me.name.toLowerCase().includes(ve)||me.model_identifier.toLowerCase().includes(ve)||me.api_provider.toLowerCase().includes(ve)}),_e=me=>l?[l.utils?.model_list||[],l.utils_small?.model_list||[],l.tool_use?.model_list||[],l.replyer?.model_list||[],l.planner?.model_list||[],l.vlm?.model_list||[],l.voice?.model_list||[],l.embedding?.model_list||[],l.lpmm_entity_extract?.model_list||[],l.lpmm_rdf_build?.model_list||[],l.lpmm_qa?.model_list||[]].some(Le=>Le.includes(me)):!1;return d?o.jsx(Xt,{className:"h-full",children:o.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):o.jsx(Xt,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理模型和任务配置"})]}),o.jsxs(fe,{onClick:Y,disabled:m||g||!j,size:"sm",className:"w-full sm:w-auto",children:[o.jsx(VC,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),m?"保存中...":g?"自动保存中...":j?"保存配置":"已保存"]})]}),o.jsxs(ol,{defaultValue:"models",className:"w-full",children:[o.jsxs(Xo,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[o.jsx(Ct,{value:"models",children:"模型配置"}),o.jsx(Ct,{value:"tasks",children:"模型任务配置"})]}),o.jsxs(Qt,{value:"models",className:"space-y-4 mt-0",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[U.size>0&&o.jsxs(fe,{onClick:pe,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[o.jsx(Ut,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",U.size,")"]}),o.jsxs(fe,{onClick:()=>ne(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(er,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[o.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[o.jsx(Rr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Ne,{placeholder:"搜索模型名称、标识符或提供商...",value:z,onChange:me=>D(me.target.value),className:"pl-9"})]}),z&&o.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Re.length," 个结果"]})]}),o.jsx("div",{className:"md:hidden space-y-3",children:Re.length===0?o.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:z?"未找到匹配的模型":"暂无模型配置"}):Re.map((me,ve)=>{const Le=_e(me.name);return o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("h3",{className:"font-semibold text-base",children:me.name}),o.jsx(en,{variant:Le?"default":"secondary",className:Le?"bg-green-600 hover:bg-green-700":"",children:Le?"已使用":"未使用"})]}),o.jsx("p",{className:"text-xs text-muted-foreground break-all",title:me.model_identifier,children:me.model_identifier})]}),o.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>ne(me,ve),children:o.jsx(Cu,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>xe(ve),children:o.jsx(Ut,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),o.jsx("p",{className:"font-medium",children:me.api_provider})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),o.jsx("p",{className:"font-medium",children:me.force_stream_mode?"是":"否"})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),o.jsxs("p",{className:"font-medium",children:["¥",me.price_in,"/M"]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),o.jsxs("p",{className:"font-medium",children:["¥",me.price_out,"/M"]})]})]})]},ve)})}),o.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:o.jsxs(Nl,{children:[o.jsx(Ol,{children:o.jsxs(pn,{children:[o.jsx(Je,{className:"w-12",children:o.jsx(Tu,{checked:U.size===Re.length&&Re.length>0,onCheckedChange:Z})}),o.jsx(Je,{className:"w-24",children:"使用状态"}),o.jsx(Je,{children:"模型名称"}),o.jsx(Je,{children:"模型标识符"}),o.jsx(Je,{children:"提供商"}),o.jsx(Je,{className:"text-right",children:"输入价格"}),o.jsx(Je,{className:"text-right",children:"输出价格"}),o.jsx(Je,{className:"text-center",children:"强制流式"}),o.jsx(Je,{className:"text-right",children:"操作"})]})}),o.jsx(Cl,{children:Re.length===0?o.jsx(pn,{children:o.jsx(Ue,{colSpan:9,className:"text-center text-muted-foreground py-8",children:z?"未找到匹配的模型":"暂无模型配置"})}):Re.map((me,ve)=>{const Le=e.findIndex(Nn=>Nn===me),Dt=_e(me.name);return o.jsxs(pn,{children:[o.jsx(Ue,{children:o.jsx(Tu,{checked:U.has(Le),onCheckedChange:()=>ae(Le)})}),o.jsx(Ue,{children:o.jsx(en,{variant:Dt?"default":"secondary",className:Dt?"bg-green-600 hover:bg-green-700":"",children:Dt?"已使用":"未使用"})}),o.jsx(Ue,{className:"font-medium",children:me.name}),o.jsx(Ue,{className:"max-w-xs truncate",title:me.model_identifier,children:me.model_identifier}),o.jsx(Ue,{children:me.api_provider}),o.jsxs(Ue,{className:"text-right",children:["¥",me.price_in,"/M"]}),o.jsxs(Ue,{className:"text-right",children:["¥",me.price_out,"/M"]}),o.jsx(Ue,{className:"text-center",children:me.force_stream_mode?"是":"否"}),o.jsx(Ue,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>ne(me,Le),children:o.jsx(Cu,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>xe(Le),children:o.jsx(Ut,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})})]},ve)})})]})})]}),o.jsxs(Qt,{value:"tasks",className:"space-y-6 mt-0",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),l&&o.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[o.jsx(Ma,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:l.utils,modelNames:a,onChange:(me,ve)=>le("utils",me,ve)}),o.jsx(Ma,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:l.utils_small,modelNames:a,onChange:(me,ve)=>le("utils_small",me,ve)}),o.jsx(Ma,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:l.tool_use,modelNames:a,onChange:(me,ve)=>le("tool_use",me,ve)}),o.jsx(Ma,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:l.replyer,modelNames:a,onChange:(me,ve)=>le("replyer",me,ve)}),o.jsx(Ma,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:l.planner,modelNames:a,onChange:(me,ve)=>le("planner",me,ve)}),o.jsx(Ma,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:l.vlm,modelNames:a,onChange:(me,ve)=>le("vlm",me,ve),hideTemperature:!0}),o.jsx(Ma,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:l.voice,modelNames:a,onChange:(me,ve)=>le("voice",me,ve),hideTemperature:!0,hideMaxTokens:!0}),o.jsx(Ma,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:l.embedding,modelNames:a,onChange:(me,ve)=>le("embedding",me,ve),hideTemperature:!0,hideMaxTokens:!0}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),o.jsx(Ma,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:l.lpmm_entity_extract,modelNames:a,onChange:(me,ve)=>le("lpmm_entity_extract",me,ve)}),o.jsx(Ma,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:l.lpmm_rdf_build,modelNames:a,onChange:(me,ve)=>le("lpmm_rdf_build",me,ve)}),o.jsx(Ma,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:l.lpmm_qa,modelNames:a,onChange:(me,ve)=>le("lpmm_qa",me,ve)})]})]})]})]}),o.jsx(tr,{open:w,onOpenChange:N,children:o.jsxs(Un,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[o.jsxs(Hn,{children:[o.jsx(Wn,{children:A!==null?"编辑模型":"添加模型"}),o.jsx(ur,{children:"配置模型的基本信息和参数"})]}),o.jsxs("div",{className:"grid gap-4 py-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"model_name",children:"模型名称 *"}),o.jsx(Ne,{id:"model_name",value:O?.name||"",onChange:me=>C(ve=>ve?{...ve,name:me.target.value}:null),placeholder:"例如: qwen3-30b"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"model_identifier",children:"模型标识符 *"}),o.jsx(Ne,{id:"model_identifier",value:O?.model_identifier||"",onChange:me=>C(ve=>ve?{...ve,model_identifier:me.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"API 提供商提供的模型 ID"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"api_provider",children:"API 提供商 *"}),o.jsxs(Et,{value:O?.api_provider||"",onValueChange:me=>C(ve=>ve?{...ve,api_provider:me}:null),children:[o.jsx(wt,{id:"api_provider",children:o.jsx(At,{placeholder:"选择提供商"})}),o.jsx(jt,{children:n.map(me=>o.jsx(Pe,{value:me,children:me},me))})]})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),o.jsx(Ne,{id:"price_in",type:"number",step:"0.1",min:"0",value:O?.price_in||0,onChange:me=>C(ve=>ve?{...ve,price_in:parseFloat(me.target.value)}:null)})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),o.jsx(Ne,{id:"price_out",type:"number",step:"0.1",min:"0",value:O?.price_out||0,onChange:me=>C(ve=>ve?{...ve,price_out:parseFloat(me.target.value)}:null)})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(at,{id:"force_stream_mode",checked:O?.force_stream_mode||!1,onCheckedChange:me=>C(ve=>ve?{...ve,force_stream_mode:me}:null)}),o.jsx(J,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),o.jsxs(Dr,{children:[o.jsx(fe,{variant:"outline",onClick:()=>N(!1),children:"取消"}),o.jsx(fe,{onClick:oe,children:"保存"})]})]})}),o.jsx(Pn,{open:k,onOpenChange:T,children:o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认删除"}),o.jsxs(wn,{children:['确定要删除模型 "',P!==null?e[P]?.name:"",'" 吗? 此操作无法撤销。']})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:ee,children:"删除"})]})]})}),o.jsx(Pn,{open:H,onOpenChange:G,children:o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认批量删除"}),o.jsxs(wn,{children:["确定要删除选中的 ",U.size," 个模型吗? 此操作无法撤销。"]})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:je,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})})}function Ma({title:e,description:t,taskConfig:n,modelNames:r,onChange:a,hideTemperature:i=!1,hideMaxTokens:l=!1}){const u=d=>{a("model_list",d)};return o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:e}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:t})]}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"模型列表"}),o.jsx(n1e,{options:r.map(d=>({label:d,value:d})),selected:n.model_list||[],onChange:u,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!i&&o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"温度"}),o.jsx(Ne,{type:"number",step:"0.1",min:"0",max:"2",value:n.temperature||.3,onChange:d=>a("temperature",parseFloat(d.target.value))})]}),!l&&o.jsxs("div",{className:"grid gap-2",children:[o.jsx(J,{children:"最大 Token"}),o.jsx(Ne,{type:"number",step:"1",min:"1",value:n.max_tokens||1024,onChange:d=>a("max_tokens",parseInt(d.target.value))})]})]})]})]})}const El="/api/webui/emoji";async function a1e(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.is_registered!==void 0&&t.append("is_registered",e.is_registered.toString()),e.is_banned!==void 0&&t.append("is_banned",e.is_banned.toString()),e.format&&t.append("format",e.format),e.sort_by&&t.append("sort_by",e.sort_by),e.sort_order&&t.append("sort_order",e.sort_order);const n=await Ze(`${El}/list?${t}`,{headers:st()});if(!n.ok)throw new Error(`获取表情包列表失败: ${n.statusText}`);return n.json()}async function i1e(e){const t=await Ze(`${El}/${e}`,{headers:st()});if(!t.ok)throw new Error(`获取表情包详情失败: ${t.statusText}`);return t.json()}async function o1e(e,t){const n=await Ze(`${El}/${e}`,{method:"PATCH",headers:st(),body:JSON.stringify(t)});if(!n.ok)throw new Error(`更新表情包失败: ${n.statusText}`);return n.json()}async function s1e(e){const t=await Ze(`${El}/${e}`,{method:"DELETE",headers:st()});if(!t.ok)throw new Error(`删除表情包失败: ${t.statusText}`);return t.json()}async function l1e(){const e=await Ze(`${El}/stats/summary`,{headers:st()});if(!e.ok)throw new Error(`获取统计数据失败: ${e.statusText}`);return e.json()}async function c1e(e){const t=await Ze(`${El}/${e}/register`,{method:"POST",headers:st()});if(!t.ok)throw new Error(`注册表情包失败: ${t.statusText}`);return t.json()}async function u1e(e){const t=await Ze(`${El}/${e}/ban`,{method:"POST",headers:st()});if(!t.ok)throw new Error(`封禁表情包失败: ${t.statusText}`);return t.json()}function d1e(){const[e,t]=y.useState([]),[n,r]=y.useState(null),[a,i]=y.useState(!1),[l,u]=y.useState(1),[d,f]=y.useState(0),[m]=y.useState(20),[p,g]=y.useState(""),[x,j]=y.useState("all"),[b,w]=y.useState("all"),[N,O]=y.useState("all"),[C,A]=y.useState(null),[E,k]=y.useState(!1),[T,P]=y.useState(!1),[$,z]=y.useState(!1),{toast:D}=hr(),U=y.useCallback(async()=>{try{i(!0);const I=await a1e({page:l,page_size:m,search:p||void 0,is_registered:x==="all"?void 0:x==="registered",is_banned:b==="all"?void 0:b==="banned",format:N==="all"?void 0:N,sort_by:"usage_count",sort_order:"desc"});t(I.data),f(I.total)}catch(I){const B=I instanceof Error?I.message:"加载表情包列表失败";D({title:"错误",description:B,variant:"destructive"})}finally{i(!1)}},[l,m,p,x,b,N,D]),V=async()=>{try{const I=await l1e();r(I.data)}catch(I){console.error("加载统计数据失败:",I)}};y.useEffect(()=>{U()},[U]),y.useEffect(()=>{V()},[]);const H=async I=>{try{const B=await i1e(I.id);A(B.data),k(!0)}catch(B){const Y=B instanceof Error?B.message:"加载详情失败";D({title:"错误",description:Y,variant:"destructive"})}},G=I=>{A(I),P(!0)},L=I=>{A(I),z(!0)},R=async()=>{if(C)try{await s1e(C.id),D({title:"成功",description:"表情包已删除"}),z(!1),A(null),U(),V()}catch(I){const B=I instanceof Error?I.message:"删除失败";D({title:"错误",description:B,variant:"destructive"})}},F=async I=>{try{await c1e(I.id),D({title:"成功",description:"表情包已注册"}),U(),V()}catch(B){const Y=B instanceof Error?B.message:"注册失败";D({title:"错误",description:Y,variant:"destructive"})}},K=async I=>{try{await u1e(I.id),D({title:"成功",description:"表情包已封禁"}),U(),V()}catch(B){const Y=B instanceof Error?B.message:"封禁失败";D({title:"错误",description:Y,variant:"destructive"})}},te=n?.formats?Object.keys(n.formats):[];return o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),n&&o.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[o.jsx(dt,{children:o.jsxs(Vt,{className:"pb-2",children:[o.jsx(Jn,{children:"总数"}),o.jsx(Gt,{className:"text-2xl",children:n.total})]})}),o.jsx(dt,{children:o.jsxs(Vt,{className:"pb-2",children:[o.jsx(Jn,{children:"已注册"}),o.jsx(Gt,{className:"text-2xl text-green-600",children:n.registered})]})}),o.jsx(dt,{children:o.jsxs(Vt,{className:"pb-2",children:[o.jsx(Jn,{children:"已封禁"}),o.jsx(Gt,{className:"text-2xl text-red-600",children:n.banned})]})}),o.jsx(dt,{children:o.jsxs(Vt,{className:"pb-2",children:[o.jsx(Jn,{children:"未注册"}),o.jsx(Gt,{className:"text-2xl text-gray-600",children:n.unregistered})]})})]}),o.jsxs(dt,{children:[o.jsx(Vt,{children:o.jsxs(Gt,{className:"flex items-center gap-2",children:[o.jsx(HN,{className:"h-5 w-5"}),"搜索和筛选"]})}),o.jsxs(ln,{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{children:"搜索"}),o.jsxs("div",{className:"relative",children:[o.jsx(Rr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(Ne,{placeholder:"描述或哈希值...",value:p,onChange:I=>{g(I.target.value),u(1)},className:"pl-8"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{children:"注册状态"}),o.jsxs(Et,{value:x,onValueChange:I=>{j(I),u(1)},children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"all",children:"全部"}),o.jsx(Pe,{value:"registered",children:"已注册"}),o.jsx(Pe,{value:"unregistered",children:"未注册"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{children:"封禁状态"}),o.jsxs(Et,{value:b,onValueChange:I=>{w(I),u(1)},children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"all",children:"全部"}),o.jsx(Pe,{value:"banned",children:"已封禁"}),o.jsx(Pe,{value:"unbanned",children:"未封禁"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{children:"格式"}),o.jsxs(Et,{value:N,onValueChange:I=>{O(I),u(1)},children:[o.jsx(wt,{children:o.jsx(At,{})}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"all",children:"全部"}),te.map(I=>o.jsxs(Pe,{value:I,children:[I.toUpperCase()," (",n?.formats[I],")"]},I))]})]})]})]}),o.jsx("div",{className:"flex justify-end",children:o.jsxs(fe,{variant:"outline",size:"sm",onClick:U,disabled:a,children:[o.jsx(rl,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"刷新"]})})]})]}),o.jsxs(dt,{children:[o.jsxs(Vt,{children:[o.jsx(Gt,{children:"表情包列表"}),o.jsxs(Jn,{children:["共 ",d," 个表情包,当前第 ",l," 页"]})]}),o.jsxs(ln,{children:[o.jsx("div",{className:"rounded-md border",children:o.jsxs(Nl,{children:[o.jsx(Ol,{children:o.jsxs(pn,{children:[o.jsx(Je,{className:"w-16",children:"预览"}),o.jsx(Je,{children:"描述"}),o.jsx(Je,{children:"格式"}),o.jsx(Je,{className:"text-center",children:"状态"}),o.jsx(Je,{className:"text-right",children:"使用次数"}),o.jsx(Je,{className:"text-right",children:"操作"})]})}),o.jsx(Cl,{children:e.length===0?o.jsx(pn,{children:o.jsx(Ue,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(I=>o.jsxs(pn,{children:[o.jsx(Ue,{children:o.jsx("div",{className:"w-12 h-12 bg-muted rounded flex items-center justify-center",children:o.jsx(kve,{className:"h-6 w-6 text-muted-foreground"})})}),o.jsx(Ue,{children:o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"font-medium",children:I.description||"无描述"}),o.jsxs("div",{className:"text-xs text-muted-foreground font-mono",children:[I.emoji_hash.slice(0,16),"..."]})]})}),o.jsx(Ue,{children:o.jsx(en,{variant:"outline",children:I.format.toUpperCase()})}),o.jsx(Ue,{children:o.jsxs("div",{className:"flex gap-2 justify-center",children:[I.is_registered&&o.jsxs(en,{variant:"default",className:"bg-green-600",children:[o.jsx(Ou,{className:"h-3 w-3 mr-1"}),"已注册"]}),I.is_banned&&o.jsxs(en,{variant:"destructive",children:[o.jsx(Vq,{className:"h-3 w-3 mr-1"}),"已封禁"]})]})}),o.jsx(Ue,{className:"text-right font-mono",children:I.usage_count}),o.jsx(Ue,{children:o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>H(I),children:o.jsx(Gq,{className:"h-4 w-4"})}),o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>G(I),children:o.jsx(YC,{className:"h-4 w-4"})}),!I.is_registered&&o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>F(I),className:"text-green-600 hover:text-green-700",children:o.jsx(Ou,{className:"h-4 w-4"})}),!I.is_banned&&o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>K(I),className:"text-orange-600 hover:text-orange-700",children:o.jsx(Wpe,{className:"h-4 w-4"})}),o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>L(I),className:"text-red-600 hover:text-red-700",children:o.jsx(Ut,{className:"h-4 w-4"})})]})})]},I.id))})]})}),d>m&&o.jsxs("div",{className:"flex items-center justify-between mt-4",children:[o.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(l-1)*m+1," 到"," ",Math.min(l*m,d)," 条,共 ",d," 条"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(fe,{variant:"outline",size:"sm",onClick:()=>u(I=>Math.max(1,I-1)),disabled:l===1,children:[o.jsx(UC,{className:"h-4 w-4"}),"上一页"]}),o.jsxs("div",{className:"text-sm",children:["第 ",l," / ",Math.ceil(d/m)," 页"]}),o.jsxs(fe,{variant:"outline",size:"sm",onClick:()=>u(I=>I+1),disabled:l>=Math.ceil(d/m),children:["下一页",o.jsx(HC,{className:"h-4 w-4"})]})]})]})]})]}),o.jsx(f1e,{emoji:C,open:E,onOpenChange:k}),o.jsx(h1e,{emoji:C,open:T,onOpenChange:P,onSuccess:()=>{U(),V()}}),o.jsx(tr,{open:$,onOpenChange:z,children:o.jsxs(Un,{children:[o.jsxs(Hn,{children:[o.jsx(Wn,{children:"确认删除"}),o.jsx(ur,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),o.jsxs(Dr,{children:[o.jsx(fe,{variant:"outline",onClick:()=>z(!1),children:"取消"}),o.jsx(fe,{variant:"destructive",onClick:R,children:"删除"})]})]})})]})}function f1e({emoji:e,open:t,onOpenChange:n}){if(!e)return null;const r=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-";return o.jsx(tr,{open:t,onOpenChange:n,children:o.jsxs(Un,{className:"max-w-2xl",children:[o.jsx(Hn,{children:o.jsx(Wn,{children:"表情包详情"})}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(J,{className:"text-muted-foreground",children:"ID"}),o.jsx("div",{className:"mt-1 font-mono",children:e.id})]}),o.jsxs("div",{children:[o.jsx(J,{className:"text-muted-foreground",children:"格式"}),o.jsx("div",{className:"mt-1",children:o.jsx(en,{variant:"outline",children:e.format.toUpperCase()})})]})]}),o.jsxs("div",{children:[o.jsx(J,{className:"text-muted-foreground",children:"文件路径"}),o.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:e.full_path})]}),o.jsxs("div",{children:[o.jsx(J,{className:"text-muted-foreground",children:"哈希值"}),o.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:e.emoji_hash})]}),o.jsxs("div",{children:[o.jsx(J,{className:"text-muted-foreground",children:"描述"}),o.jsx("div",{className:"mt-1",children:e.description||"-"})]}),o.jsxs("div",{children:[o.jsx(J,{className:"text-muted-foreground",children:"情绪标签"}),o.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.emotion&&e.emotion.length>0?e.emotion.map((a,i)=>o.jsx(en,{variant:"secondary",children:a},i)):o.jsx("span",{className:"text-sm text-muted-foreground",children:"无"})})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(J,{className:"text-muted-foreground",children:"状态"}),o.jsxs("div",{className:"mt-2 flex gap-2",children:[e.is_registered&&o.jsx(en,{variant:"default",className:"bg-green-600",children:"已注册"}),e.is_banned&&o.jsx(en,{variant:"destructive",children:"已封禁"}),!e.is_registered&&!e.is_banned&&o.jsx(en,{variant:"outline",children:"未注册"})]})]}),o.jsxs("div",{children:[o.jsx(J,{className:"text-muted-foreground",children:"使用次数"}),o.jsx("div",{className:"mt-1 font-mono text-lg",children:e.usage_count})]})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(J,{className:"text-muted-foreground",children:"记录时间"}),o.jsx("div",{className:"mt-1 text-sm",children:r(e.record_time)})]}),o.jsxs("div",{children:[o.jsx(J,{className:"text-muted-foreground",children:"注册时间"}),o.jsx("div",{className:"mt-1 text-sm",children:r(e.register_time)})]})]}),o.jsxs("div",{children:[o.jsx(J,{className:"text-muted-foreground",children:"最后使用"}),o.jsx("div",{className:"mt-1 text-sm",children:r(e.last_used_time)})]})]})]})})}function h1e({emoji:e,open:t,onOpenChange:n,onSuccess:r}){const[a,i]=y.useState(""),[l,u]=y.useState(""),[d,f]=y.useState(!1),[m,p]=y.useState(!1),[g,x]=y.useState(!1),{toast:j}=hr();y.useEffect(()=>{e&&(i(e.description||""),u(e.emotion?e.emotion.join(", "):""),f(e.is_registered),p(e.is_banned))},[e]);const b=async()=>{if(e)try{x(!0);const w=l.split(",").map(N=>N.trim()).filter(Boolean);await o1e(e.id,{description:a||void 0,emotion:w.length>0?w:void 0,is_registered:d,is_banned:m}),j({title:"成功",description:"表情包信息已更新"}),n(!1),r()}catch(w){const N=w instanceof Error?w.message:"保存失败";j({title:"错误",description:N,variant:"destructive"})}finally{x(!1)}};return e?o.jsx(tr,{open:t,onOpenChange:n,children:o.jsxs(Un,{className:"max-w-2xl",children:[o.jsxs(Hn,{children:[o.jsx(Wn,{children:"编辑表情包"}),o.jsx(ur,{children:"修改表情包的描述和标签信息"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx(J,{children:"描述"}),o.jsx(qt,{value:a,onChange:w=>i(w.target.value),placeholder:"输入表情包描述...",rows:3,className:"mt-1"})]}),o.jsxs("div",{children:[o.jsx(J,{children:"情绪标签"}),o.jsx(Ne,{value:l,onChange:w=>u(w.target.value),placeholder:"使用逗号分隔多个标签,如:开心, 微笑, 快乐",className:"mt-1"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入多个标签时使用逗号分隔"})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("input",{type:"checkbox",id:"is_registered",checked:d,onChange:w=>f(w.target.checked),className:"rounded border-gray-300"}),o.jsx(J,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("input",{type:"checkbox",id:"is_banned",checked:m,onChange:w=>p(w.target.checked),className:"rounded border-gray-300"}),o.jsx(J,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),o.jsxs(Dr,{children:[o.jsx(fe,{variant:"outline",onClick:()=>n(!1),children:"取消"}),o.jsx(fe,{onClick:b,disabled:g,children:g?"保存中...":"保存"})]})]})}):null}const Xu="/api/webui/expression";async function m1e(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.chat_id&&t.append("chat_id",e.chat_id);const n=await Ze(`${Xu}/list?${t}`,{headers:st()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取表达方式列表失败")}return n.json()}async function p1e(e){const t=await Ze(`${Xu}/${e}`,{headers:st()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"获取表达方式详情失败")}return t.json()}async function v1e(e){const t=await Ze(`${Xu}/`,{method:"POST",headers:st(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"创建表达方式失败")}return t.json()}async function g1e(e,t){const n=await Ze(`${Xu}/${e}`,{method:"PATCH",headers:st(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新表达方式失败")}return n.json()}async function y1e(e){const t=await Ze(`${Xu}/${e}`,{method:"DELETE",headers:st()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"删除表达方式失败")}return t.json()}async function x1e(){const e=await Ze(`${Xu}/stats/summary`,{headers:st()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取统计数据失败")}return e.json()}function b1e(){const[e,t]=y.useState([]),[n,r]=y.useState(!0),[a,i]=y.useState(0),[l,u]=y.useState(1),[d]=y.useState(20),[f,m]=y.useState(""),[p,g]=y.useState(null),[x,j]=y.useState(!1),[b,w]=y.useState(!1),[N,O]=y.useState(!1),[C,A]=y.useState(null),[E,k]=y.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),{toast:T}=hr(),P=async()=>{try{r(!0);const H=await m1e({page:l,page_size:d,search:f||void 0});t(H.data),i(H.total)}catch(H){T({title:"加载失败",description:H instanceof Error?H.message:"无法加载表达方式",variant:"destructive"})}finally{r(!1)}},$=async()=>{try{const H=await x1e();k(H.data)}catch(H){console.error("加载统计数据失败:",H)}};y.useEffect(()=>{P(),$()},[l,d,f]);const z=async H=>{try{const G=await p1e(H.id);g(G.data),j(!0)}catch(G){T({title:"加载详情失败",description:G instanceof Error?G.message:"无法加载表达方式详情",variant:"destructive"})}},D=H=>{g(H),w(!0)},U=async H=>{try{await y1e(H.id),T({title:"删除成功",description:`已删除表达方式: ${H.situation}`}),A(null),P(),$()}catch(G){T({title:"删除失败",description:G instanceof Error?G.message:"无法删除表达方式",variant:"destructive"})}},V=H=>H?new Date(H*1e3).toLocaleString("zh-CN"):"-";return o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[o.jsx($h,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),o.jsxs(fe,{onClick:()=>O(!0),className:"gap-2",children:[o.jsx(er,{className:"h-4 w-4"}),"新增表达方式"]})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),o.jsx("div",{className:"text-2xl font-bold mt-1",children:E.total})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:E.recent_7days})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:E.chat_count})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx(J,{htmlFor:"search",children:"搜索"}),o.jsxs("div",{className:"relative mt-1.5",children:[o.jsx(Rr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(Ne,{id:"search",placeholder:"搜索情境、风格或上下文...",value:f,onChange:H=>m(H.target.value),className:"pl-9"})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card",children:[o.jsx(Xt,{className:"h-[calc(100vh-500px)]",children:o.jsxs(Nl,{children:[o.jsx(Ol,{children:o.jsxs(pn,{children:[o.jsx(Je,{children:"情境"}),o.jsx(Je,{children:"风格"}),o.jsx(Je,{children:"聊天ID"}),o.jsx(Je,{children:"最后活跃"}),o.jsx(Je,{className:"text-right",children:"操作"})]})}),o.jsx(Cl,{children:n?o.jsx(pn,{children:o.jsx(Ue,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):e.length===0?o.jsx(pn,{children:o.jsx(Ue,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(H=>o.jsxs(pn,{children:[o.jsx(Ue,{className:"font-medium max-w-xs truncate",children:H.situation}),o.jsx(Ue,{className:"max-w-xs truncate",children:H.style}),o.jsx(Ue,{className:"font-mono text-sm",children:H.chat_id}),o.jsx(Ue,{className:"text-sm text-muted-foreground",children:V(H.last_active_time)}),o.jsx(Ue,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>z(H),children:o.jsx(ro,{className:"h-4 w-4"})}),o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>D(H),children:o.jsx(YC,{className:"h-4 w-4"})}),o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>A(H),children:o.jsx(Ut,{className:"h-4 w-4 text-destructive"})})]})})]},H.id))})]})}),a>d&&o.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",children:[o.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",a," 条记录,第 ",l," / ",Math.ceil(a/d)," 页"]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(fe,{variant:"outline",size:"sm",onClick:()=>u(l-1),disabled:l===1,children:"上一页"}),o.jsx(fe,{variant:"outline",size:"sm",onClick:()=>u(l+1),disabled:l>=Math.ceil(a/d),children:"下一页"})]})]})]}),o.jsx(w1e,{expression:p,open:x,onOpenChange:j}),o.jsx(j1e,{open:N,onOpenChange:O,onSuccess:()=>{P(),$(),O(!1)}}),o.jsx(S1e,{expression:p,open:b,onOpenChange:w,onSuccess:()=>{P(),$(),w(!1)}}),o.jsx(Pn,{open:!!C,onOpenChange:()=>A(null),children:o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认删除"}),o.jsxs(wn,{children:['确定要删除表达方式 "',C?.situation,'" 吗? 此操作不可撤销。']})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:()=>C&&U(C),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})})]})}function w1e({expression:e,open:t,onOpenChange:n}){if(!e)return null;const r=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-";return o.jsx(tr,{open:t,onOpenChange:n,children:o.jsxs(Un,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Hn,{children:[o.jsx(Wn,{children:"表达方式详情"}),o.jsx(ur,{children:"查看表达方式的完整信息"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsx(Oc,{label:"情境",value:e.situation}),o.jsx(Oc,{label:"风格",value:e.style}),o.jsx(Oc,{icon:bg,label:"聊天ID",value:e.chat_id,mono:!0}),o.jsx(Oc,{icon:bg,label:"记录ID",value:e.id.toString(),mono:!0})]}),e.context&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(J,{className:"text-xs text-muted-foreground",children:"上下文"}),o.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.context})]}),e.up_content&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(J,{className:"text-xs text-muted-foreground",children:"上文内容"}),o.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.up_content})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsx(Oc,{icon:nl,label:"最后活跃",value:r(e.last_active_time)}),o.jsx(Oc,{icon:nl,label:"创建时间",value:r(e.create_date)})]})]}),o.jsx(Dr,{children:o.jsx(fe,{onClick:()=>n(!1),children:"关闭"})})]})})}function Oc({icon:e,label:t,value:n,mono:r=!1}){return o.jsxs("div",{className:"space-y-1",children:[o.jsxs(J,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e&&o.jsx(e,{className:"h-3 w-3"}),t]}),o.jsx("div",{className:ue("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function j1e({open:e,onOpenChange:t,onSuccess:n}){const[r,a]=y.useState({situation:"",style:"",context:"",up_content:"",chat_id:""}),[i,l]=y.useState(!1),{toast:u}=hr(),d=async()=>{if(!r.situation||!r.style||!r.chat_id){u({title:"验证失败",description:"请填写必填字段:情境、风格和聊天ID",variant:"destructive"});return}try{l(!0),await v1e(r),u({title:"创建成功",description:"表达方式已创建"}),a({situation:"",style:"",context:"",up_content:"",chat_id:""}),n()}catch(f){u({title:"创建失败",description:f instanceof Error?f.message:"无法创建表达方式",variant:"destructive"})}finally{l(!1)}};return o.jsx(tr,{open:e,onOpenChange:t,children:o.jsxs(Un,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Hn,{children:[o.jsx(Wn,{children:"新增表达方式"}),o.jsx(ur,{children:"创建新的表达方式记录"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsxs(J,{htmlFor:"situation",children:["情境 ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx(Ne,{id:"situation",value:r.situation,onChange:f=>a({...r,situation:f.target.value}),placeholder:"描述使用场景"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs(J,{htmlFor:"style",children:["风格 ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx(Ne,{id:"style",value:r.style,onChange:f=>a({...r,style:f.target.value}),placeholder:"描述表达风格"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs(J,{htmlFor:"chat_id",children:["聊天ID ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx(Ne,{id:"chat_id",value:r.chat_id,onChange:f=>a({...r,chat_id:f.target.value}),placeholder:"关联的聊天ID"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"context",children:"上下文"}),o.jsx(qt,{id:"context",value:r.context,onChange:f=>a({...r,context:f.target.value}),placeholder:"上下文信息(可选)",rows:3})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"up_content",children:"上文内容"}),o.jsx(qt,{id:"up_content",value:r.up_content,onChange:f=>a({...r,up_content:f.target.value}),placeholder:"上文内容(可选)",rows:3})]})]}),o.jsxs(Dr,{children:[o.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"取消"}),o.jsx(fe,{onClick:d,disabled:i,children:i?"创建中...":"创建"})]})]})})}function S1e({expression:e,open:t,onOpenChange:n,onSuccess:r}){const[a,i]=y.useState({}),[l,u]=y.useState(!1),{toast:d}=hr();y.useEffect(()=>{e&&i({situation:e.situation,style:e.style,context:e.context||"",up_content:e.up_content||"",chat_id:e.chat_id})},[e]);const f=async()=>{if(e)try{u(!0),await g1e(e.id,a),d({title:"保存成功",description:"表达方式已更新"}),r()}catch(m){d({title:"保存失败",description:m instanceof Error?m.message:"无法更新表达方式",variant:"destructive"})}finally{u(!1)}};return e?o.jsx(tr,{open:t,onOpenChange:n,children:o.jsxs(Un,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Hn,{children:[o.jsx(Wn,{children:"编辑表达方式"}),o.jsx(ur,{children:"修改表达方式的信息"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"edit_situation",children:"情境"}),o.jsx(Ne,{id:"edit_situation",value:a.situation||"",onChange:m=>i({...a,situation:m.target.value}),placeholder:"描述使用场景"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"edit_style",children:"风格"}),o.jsx(Ne,{id:"edit_style",value:a.style||"",onChange:m=>i({...a,style:m.target.value}),placeholder:"描述表达风格"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"edit_chat_id",children:"聊天ID"}),o.jsx(Ne,{id:"edit_chat_id",value:a.chat_id||"",onChange:m=>i({...a,chat_id:m.target.value}),placeholder:"关联的聊天ID"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"edit_context",children:"上下文"}),o.jsx(qt,{id:"edit_context",value:a.context||"",onChange:m=>i({...a,context:m.target.value}),placeholder:"上下文信息",rows:3})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"edit_up_content",children:"上文内容"}),o.jsx(qt,{id:"edit_up_content",value:a.up_content||"",onChange:m=>i({...a,up_content:m.target.value}),placeholder:"上文内容",rows:3})]})]}),o.jsxs(Dr,{children:[o.jsx(fe,{variant:"outline",onClick:()=>n(!1),children:"取消"}),o.jsx(fe,{onClick:f,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}const Gh="/api/webui/person";async function _1e(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.is_known!==void 0&&t.append("is_known",e.is_known.toString()),e.platform&&t.append("platform",e.platform);const n=await Ze(`${Gh}/list?${t}`,{headers:st()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取人物列表失败")}return n.json()}async function N1e(e){const t=await Ze(`${Gh}/${e}`,{headers:st()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"获取人物详情失败")}return t.json()}async function O1e(e,t){const n=await Ze(`${Gh}/${e}`,{method:"PATCH",headers:st(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新人物信息失败")}return n.json()}async function C1e(e){const t=await Ze(`${Gh}/${e}`,{method:"DELETE",headers:st()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"删除人物信息失败")}return t.json()}async function E1e(){const e=await Ze(`${Gh}/stats/summary`,{headers:st()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取统计数据失败")}return e.json()}function A1e(){const[e,t]=y.useState([]),[n,r]=y.useState(!0),[a,i]=y.useState(0),[l,u]=y.useState(1),[d]=y.useState(20),[f,m]=y.useState(""),[p,g]=y.useState(void 0),[x,j]=y.useState(void 0),[b,w]=y.useState(null),[N,O]=y.useState(!1),[C,A]=y.useState(!1),[E,k]=y.useState(null),[T,P]=y.useState({total:0,known:0,unknown:0,platforms:{}}),{toast:$}=hr(),z=async()=>{try{r(!0);const R=await _1e({page:l,page_size:d,search:f||void 0,is_known:p,platform:x});t(R.data),i(R.total)}catch(R){$({title:"加载失败",description:R instanceof Error?R.message:"无法加载人物信息",variant:"destructive"})}finally{r(!1)}},D=async()=>{try{const R=await E1e();P(R.data)}catch(R){console.error("加载统计数据失败:",R)}};y.useEffect(()=>{z(),D()},[l,d,f,p,x]);const U=async R=>{try{const F=await N1e(R.person_id);w(F.data),O(!0)}catch(F){$({title:"加载详情失败",description:F instanceof Error?F.message:"无法加载人物详情",variant:"destructive"})}},V=R=>{w(R),A(!0)},H=async R=>{try{await C1e(R.person_id),$({title:"删除成功",description:`已删除人物信息: ${R.person_name||R.nickname||R.user_id}`}),k(null),z(),D()}catch(F){$({title:"删除失败",description:F instanceof Error?F.message:"无法删除人物信息",variant:"destructive"})}},G=y.useMemo(()=>Object.keys(T.platforms),[T.platforms]),L=R=>R?new Date(R*1e3).toLocaleString("zh-CN"):"-";return o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[o.jsx(Nge,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),o.jsx("div",{className:"text-2xl font-bold mt-1",children:T.total})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:T.known})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:T.unknown})]})]}),o.jsx("div",{className:"rounded-lg border bg-card p-4",children:o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[o.jsxs("div",{className:"sm:col-span-2",children:[o.jsx(J,{htmlFor:"search",children:"搜索"}),o.jsxs("div",{className:"relative mt-1.5",children:[o.jsx(Rr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(Ne,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:f,onChange:R=>m(R.target.value),className:"pl-9"})]})]}),o.jsxs("div",{children:[o.jsx(J,{htmlFor:"filter-known",children:"认识状态"}),o.jsxs(Et,{value:p===void 0?"all":p.toString(),onValueChange:R=>{g(R==="all"?void 0:R==="true"),u(1)},children:[o.jsx(wt,{id:"filter-known",className:"mt-1.5",children:o.jsx(At,{})}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"all",children:"全部"}),o.jsx(Pe,{value:"true",children:"已认识"}),o.jsx(Pe,{value:"false",children:"未认识"})]})]})]}),o.jsxs("div",{children:[o.jsx(J,{htmlFor:"filter-platform",children:"平台"}),o.jsxs(Et,{value:x||"all",onValueChange:R=>{j(R==="all"?void 0:R),u(1)},children:[o.jsx(wt,{id:"filter-platform",className:"mt-1.5",children:o.jsx(At,{})}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"all",children:"全部平台"}),G.map(R=>o.jsxs(Pe,{value:R,children:[R," (",T.platforms[R],")"]},R))]})]})]})]})}),o.jsxs("div",{className:"rounded-lg border bg-card",children:[o.jsx(Xt,{className:"h-[calc(100vh-500px)]",children:o.jsxs(Nl,{children:[o.jsx(Ol,{children:o.jsxs(pn,{children:[o.jsx(Je,{children:"状态"}),o.jsx(Je,{children:"名称"}),o.jsx(Je,{children:"昵称"}),o.jsx(Je,{children:"平台"}),o.jsx(Je,{children:"用户ID"}),o.jsx(Je,{children:"最后更新"}),o.jsx(Je,{className:"text-right",children:"操作"})]})}),o.jsx(Cl,{children:n?o.jsx(pn,{children:o.jsx(Ue,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):e.length===0?o.jsx(pn,{children:o.jsx(Ue,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(R=>o.jsxs(pn,{children:[o.jsx(Ue,{children:o.jsx("div",{className:ue("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",R.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:R.is_known?"已认识":"未认识"})}),o.jsx(Ue,{className:"font-medium",children:R.person_name||o.jsx("span",{className:"text-muted-foreground",children:"-"})}),o.jsx(Ue,{children:R.nickname||"-"}),o.jsx(Ue,{children:R.platform}),o.jsx(Ue,{className:"font-mono text-sm",children:R.user_id}),o.jsx(Ue,{className:"text-sm text-muted-foreground",children:L(R.last_know)}),o.jsx(Ue,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>U(R),children:o.jsx(ro,{className:"h-4 w-4"})}),o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>V(R),children:o.jsx(YC,{className:"h-4 w-4"})}),o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>k(R),children:o.jsx(Ut,{className:"h-4 w-4 text-destructive"})})]})})]},R.id))})]})}),a>d&&o.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",children:[o.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",a," 条记录,第 ",l," / ",Math.ceil(a/d)," 页"]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(fe,{variant:"outline",size:"sm",onClick:()=>u(l-1),disabled:l===1,children:"上一页"}),o.jsx(fe,{variant:"outline",size:"sm",onClick:()=>u(l+1),disabled:l>=Math.ceil(a/d),children:"下一页"})]})]})]}),o.jsx(T1e,{person:b,open:N,onOpenChange:O}),o.jsx(k1e,{person:b,open:C,onOpenChange:A,onSuccess:()=>{z(),D(),A(!1)}}),o.jsx(Pn,{open:!!E,onOpenChange:()=>k(null),children:o.jsxs(gn,{children:[o.jsxs(yn,{children:[o.jsx(bn,{children:"确认删除"}),o.jsxs(wn,{children:['确定要删除人物信息 "',E?.person_name||E?.nickname||E?.user_id,'" 吗? 此操作不可撤销。']})]}),o.jsxs(xn,{children:[o.jsx(Sn,{children:"取消"}),o.jsx(jn,{onClick:()=>E&&H(E),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})})]})}function T1e({person:e,open:t,onOpenChange:n}){if(!e)return null;const r=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-";return o.jsx(tr,{open:t,onOpenChange:n,children:o.jsxs(Un,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Hn,{children:[o.jsx(Wn,{children:"人物详情"}),o.jsxs(ur,{children:["查看 ",e.person_name||e.nickname||e.user_id," 的完整信息"]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsx(Fi,{icon:Zq,label:"人物名称",value:e.person_name}),o.jsx(Fi,{icon:$h,label:"昵称",value:e.nickname}),o.jsx(Fi,{icon:bg,label:"用户ID",value:e.user_id,mono:!0}),o.jsx(Fi,{icon:bg,label:"人物ID",value:e.person_id,mono:!0}),o.jsx(Fi,{label:"平台",value:e.platform}),o.jsx(Fi,{label:"状态",value:e.is_known?"已认识":"未认识"})]}),e.name_reason&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(J,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),o.jsx("p",{className:"mt-1 text-sm",children:e.name_reason})]}),e.memory_points&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(J,{className:"text-xs text-muted-foreground",children:"个人印象"}),o.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.memory_points})]}),e.group_nick_name&&e.group_nick_name.length>0&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(J,{className:"text-xs text-muted-foreground",children:"群昵称"}),o.jsx("div",{className:"mt-2 space-y-1",children:e.group_nick_name.map((a,i)=>o.jsxs("div",{className:"text-sm flex items-center gap-2",children:[o.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:a.group_id}),o.jsx("span",{children:"→"}),o.jsx("span",{children:a.group_nick_name})]},i))})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsx(Fi,{icon:nl,label:"认识时间",value:r(e.know_times)}),o.jsx(Fi,{icon:nl,label:"首次记录",value:r(e.know_since)}),o.jsx(Fi,{icon:nl,label:"最后更新",value:r(e.last_know)})]})]}),o.jsx(Dr,{children:o.jsx(fe,{onClick:()=>n(!1),children:"关闭"})})]})})}function Fi({icon:e,label:t,value:n,mono:r=!1}){return o.jsxs("div",{className:"space-y-1",children:[o.jsxs(J,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e&&o.jsx(e,{className:"h-3 w-3"}),t]}),o.jsx("div",{className:ue("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function k1e({person:e,open:t,onOpenChange:n,onSuccess:r}){const[a,i]=y.useState({}),[l,u]=y.useState(!1),{toast:d}=hr();y.useEffect(()=>{e&&i({person_name:e.person_name||"",name_reason:e.name_reason||"",nickname:e.nickname||"",memory_points:e.memory_points||"",is_known:e.is_known})},[e]);const f=async()=>{if(e)try{u(!0),await O1e(e.person_id,a),d({title:"保存成功",description:"人物信息已更新"}),r()}catch(m){d({title:"保存失败",description:m instanceof Error?m.message:"无法更新人物信息",variant:"destructive"})}finally{u(!1)}};return e?o.jsx(tr,{open:t,onOpenChange:n,children:o.jsxs(Un,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Hn,{children:[o.jsx(Wn,{children:"编辑人物信息"}),o.jsxs(ur,{children:["修改 ",e.person_name||e.nickname||e.user_id," 的信息"]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"person_name",children:"人物名称"}),o.jsx(Ne,{id:"person_name",value:a.person_name||"",onChange:m=>i({...a,person_name:m.target.value}),placeholder:"为这个人设置一个名称"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"nickname",children:"昵称"}),o.jsx(Ne,{id:"nickname",value:a.nickname||"",onChange:m=>i({...a,nickname:m.target.value}),placeholder:"昵称"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"name_reason",children:"名称设定原因"}),o.jsx(qt,{id:"name_reason",value:a.name_reason||"",onChange:m=>i({...a,name_reason:m.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"memory_points",children:"个人印象"}),o.jsx(qt,{id:"memory_points",value:a.memory_points||"",onChange:m=>i({...a,memory_points:m.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),o.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[o.jsxs("div",{children:[o.jsx(J,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),o.jsx(at,{id:"is_known",checked:a.is_known,onCheckedChange:m=>i({...a,is_known:m})})]})]}),o.jsxs(Dr,{children:[o.jsx(fe,{variant:"outline",onClick:()=>n(!1),children:"取消"}),o.jsx(fe,{onClick:f,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}function P1e(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const M1e={},ff={};function Gs(e,t){try{const r=(M1e[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return r in ff?ff[r]:wL(r,r.split(":"))}catch{if(e in ff)return ff[e];const n=e?.match(R1e);return n?wL(e,n.slice(1)):NaN}}const R1e=/([+-]\d\d):?(\d\d)?/;function wL(e,t){const n=+(t[0]||0),r=+(t[1]||0),a=+(t[2]||0)/60;return ff[e]=n*60+r>0?n*60+r+a:n*60-r-a}class li extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Gs(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),gH(this),uO(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new li(...n,t):new li(Date.now(),t)}withTimeZone(t){return new li(+this,t)}getTimezoneOffset(){const t=-Gs(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),uO(this),+this}[Symbol.for("constructDateFrom")](t){return new li(+new Date(t),this.timeZone)}}const jL=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!jL.test(e))return;const t=e.replace(jL,"$1UTC");li.prototype[t]&&(e.startsWith("get")?li.prototype[e]=function(){return this.internal[t]()}:(li.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),D1e(this),+this},li.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),uO(this),+this}))});function uO(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Gs(e.timeZone,e)*60))}function D1e(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),gH(e)}function gH(e){const t=Gs(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),l=a-i,u=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();l&&u&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+l);const d=a-n;d&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+d);const f=new Date(+e);f.setUTCSeconds(0);const m=a>0?f.getSeconds():(f.getSeconds()-60)%60,p=Math.round(-(Gs(e.timeZone,e)*60))%60;(p||m)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+p),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+p+m));const g=Gs(e.timeZone,e),x=g>0?Math.floor(g):Math.ceil(g),b=-new Date(+e).getTimezoneOffset()-x,w=x!==n,N=b-d;if(w&&N){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+N);const O=Gs(e.timeZone,e),C=O>0?Math.floor(O):Math.ceil(O),A=x-C;A&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+A),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+A))}}class or extends li{static tz(t,...n){return n.length?new or(...n,t):new or(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),a=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,a]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${t} GMT${n}${r}${a} (${P1e(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[n,r,a]}withTimeZone(t){return new or(+this,t)}[Symbol.for("constructDateFrom")](t){return new or(+new Date(t),this.timeZone)}}const yH=6048e5,$1e=864e5,SL=Symbol.for("constructDateFrom");function _n(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&SL in e?e[SL](t):e instanceof Date?new e.constructor(t):new Date(t)}function Rt(e,t){return _n(t||e,e)}function xH(e,t,n){const r=Rt(e,n?.in);return isNaN(t)?_n(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function bH(e,t,n){const r=Rt(e,n?.in);if(isNaN(t))return _n(e,NaN);if(!t)return r;const a=r.getDate(),i=_n(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const l=i.getDate();return a>=l?i:(r.setFullYear(i.getFullYear(),i.getMonth(),a),r)}let I1e={};function Yh(){return I1e}function ns(e,t){const n=Yh(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Rt(e,t?.in),i=a.getDay(),l=(i=i.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function _L(e){const t=Rt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Al(e,...t){const n=_n.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function ph(e,t){const n=Rt(e,t?.in);return n.setHours(0,0,0,0),n}function jH(e,t,n){const[r,a]=Al(n?.in,e,t),i=ph(r),l=ph(a),u=+i-_L(i),d=+l-_L(l);return Math.round((u-d)/$1e)}function L1e(e,t){const n=wH(e,t),r=_n(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),mh(r)}function B1e(e,t,n){return xH(e,t*7,n)}function z1e(e,t,n){return bH(e,t*12,n)}function q1e(e,t){let n,r=t?.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=_n.bind(null,a));const i=Rt(a,r);(!n||n{!r&&typeof a=="object"&&(r=_n.bind(null,a));const i=Rt(a,r);(!n||n>i||isNaN(+i))&&(n=i)}),_n(r,n||NaN)}function U1e(e,t,n){const[r,a]=Al(n?.in,e,t);return+ph(r)==+ph(a)}function SH(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function H1e(e){return!(!SH(e)&&typeof e!="number"||isNaN(+Rt(e)))}function W1e(e,t,n){const[r,a]=Al(n?.in,e,t),i=r.getFullYear()-a.getFullYear(),l=r.getMonth()-a.getMonth();return i*12+l}function V1e(e,t){const n=Rt(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function _H(e,t){const[n,r]=Al(e,t.start,t.end);return{start:n,end:r}}function G1e(e,t){const{start:n,end:r}=_H(t?.in,e);let a=+n>+r;const i=a?+n:+r,l=a?r:n;l.setHours(0,0,0,0),l.setDate(1);let u=1;const d=[];for(;+l<=i;)d.push(_n(n,l)),l.setMonth(l.getMonth()+u);return a?d.reverse():d}function Y1e(e,t){const n=Rt(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function K1e(e,t){const n=Rt(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function NH(e,t){const n=Rt(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function X1e(e,t){const{start:n,end:r}=_H(t?.in,e);let a=+n>+r;const i=a?+n:+r,l=a?r:n;l.setHours(0,0,0,0),l.setMonth(0,1);let u=1;const d=[];for(;+l<=i;)d.push(_n(n,l)),l.setFullYear(l.getFullYear()+u);return a?d.reverse():d}function OH(e,t){const n=Yh(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Rt(e,t?.in),i=a.getDay(),l=(i{let r;const a=Q1e[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Yc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const eSe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},tSe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},nSe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},rSe={date:Yc({formats:eSe,defaultWidth:"full"}),time:Yc({formats:tSe,defaultWidth:"full"}),dateTime:Yc({formats:nSe,defaultWidth:"full"})},aSe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},iSe=(e,t,n,r)=>aSe[e];function ni(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,u=n?.width?String(n.width):l;a=e.formattingValues[u]||e.formattingValues[l]}else{const l=e.defaultWidth,u=n?.width?String(n.width):e.defaultWidth;a=e.values[u]||e.values[l]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const oSe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},sSe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lSe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},cSe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},uSe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},dSe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},fSe=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},hSe={ordinalNumber:fSe,era:ni({values:oSe,defaultWidth:"wide"}),quarter:ni({values:sSe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ni({values:lSe,defaultWidth:"wide"}),day:ni({values:cSe,defaultWidth:"wide"}),dayPeriod:ni({values:uSe,defaultWidth:"wide",formattingValues:dSe,defaultFormattingWidth:"wide"})};function ri(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const l=i[0],u=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?pSe(u,p=>p.test(l)):mSe(u,p=>p.test(l));let f;f=e.valueCallback?e.valueCallback(d):d,f=n.valueCallback?n.valueCallback(f):f;const m=t.slice(l.length);return{value:f,rest:m}}}function mSe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function pSe(e,t){for(let n=0;n{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],i=t.match(e.parsePattern);if(!i)return null;let l=e.valueCallback?e.valueCallback(i[0]):i[0];l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(a.length);return{value:l,rest:u}}}const vSe=/^(\d+)(th|st|nd|rd)?/i,gSe=/\d+/i,ySe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},xSe={any:[/^b/i,/^(a|c)/i]},bSe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},wSe={any:[/1/i,/2/i,/3/i,/4/i]},jSe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},SSe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},_Se={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},NSe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},OSe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},CSe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ESe={ordinalNumber:CH({matchPattern:vSe,parsePattern:gSe,valueCallback:e=>parseInt(e,10)}),era:ri({matchPatterns:ySe,defaultMatchWidth:"wide",parsePatterns:xSe,defaultParseWidth:"any"}),quarter:ri({matchPatterns:bSe,defaultMatchWidth:"wide",parsePatterns:wSe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ri({matchPatterns:jSe,defaultMatchWidth:"wide",parsePatterns:SSe,defaultParseWidth:"any"}),day:ri({matchPatterns:_Se,defaultMatchWidth:"wide",parsePatterns:NSe,defaultParseWidth:"any"}),dayPeriod:ri({matchPatterns:OSe,defaultMatchWidth:"any",parsePatterns:CSe,defaultParseWidth:"any"})},_E={code:"en-US",formatDistance:J1e,formatLong:rSe,formatRelative:iSe,localize:hSe,match:ESe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ASe(e,t){const n=Rt(e,t?.in);return jH(n,NH(n))+1}function EH(e,t){const n=Rt(e,t?.in),r=+mh(n)-+L1e(n);return Math.round(r/yH)+1}function AH(e,t){const n=Rt(e,t?.in),r=n.getFullYear(),a=Yh(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,l=_n(t?.in||e,0);l.setFullYear(r+1,0,i),l.setHours(0,0,0,0);const u=ns(l,t),d=_n(t?.in||e,0);d.setFullYear(r,0,i),d.setHours(0,0,0,0);const f=ns(d,t);return+n>=+u?r+1:+n>=+f?r:r-1}function TSe(e,t){const n=Yh(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=AH(e,t),i=_n(t?.in||e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),ns(i,t)}function TH(e,t){const n=Rt(e,t?.in),r=+ns(n,t)-+TSe(n,t);return Math.round(r/yH)+1}function Ot(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Lo={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ot(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ot(n+1,2)},d(e,t){return Ot(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ot(e.getHours()%12||12,t.length)},H(e,t){return Ot(e.getHours(),t.length)},m(e,t){return Ot(e.getMinutes(),t.length)},s(e,t){return Ot(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return Ot(a,t.length)}},Cc={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},NL={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return Lo.y(e,t)},Y:function(e,t,n,r){const a=AH(e,r),i=a>0?a:1-a;if(t==="YY"){const l=i%100;return Ot(l,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Ot(i,t.length)},R:function(e,t){const n=wH(e);return Ot(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ot(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ot(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ot(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Lo.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ot(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=TH(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):Ot(a,t.length)},I:function(e,t,n){const r=EH(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ot(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Lo.d(e,t)},D:function(e,t,n){const r=ASe(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ot(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Ot(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Ot(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return Ot(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=Cc.noon:r===0?a=Cc.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=Cc.evening:r>=12?a=Cc.afternoon:r>=4?a=Cc.morning:a=Cc.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Lo.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Lo.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ot(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ot(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Lo.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Lo.s(e,t)},S:function(e,t){return Lo.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return CL(r);case"XXXX":case"XX":return zs(r);case"XXXXX":case"XXX":default:return zs(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return CL(r);case"xxxx":case"xx":return zs(r);case"xxxxx":case"xxx":default:return zs(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+OL(r,":");case"OOOO":default:return"GMT"+zs(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+OL(r,":");case"zzzz":default:return"GMT"+zs(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ot(r,t.length)},T:function(e,t,n){return Ot(+e,t.length)}};function OL(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+Ot(i,2)}function CL(e,t){return e%60===0?(e>0?"-":"+")+Ot(Math.abs(e)/60,2):zs(e,t)}function zs(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Ot(Math.trunc(r/60),2),i=Ot(r%60,2);return n+a+t+i}const EL=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},kH=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},kSe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return EL(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",EL(r,t)).replace("{{time}}",kH(a,t))},PSe={p:kH,P:kSe},MSe=/^D+$/,RSe=/^Y+$/,DSe=["D","DD","YY","YYYY"];function $Se(e){return MSe.test(e)}function ISe(e){return RSe.test(e)}function LSe(e,t,n){const r=BSe(e,t,n);if(console.warn(r),DSe.includes(e))throw new RangeError(r)}function BSe(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const zSe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qSe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,FSe=/^'([^]*?)'?$/,USe=/''/g,HSe=/[a-zA-Z]/;function lv(e,t,n){const r=Yh(),a=n?.locale??r.locale??_E,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,l=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,u=Rt(e,n?.in);if(!H1e(u))throw new RangeError("Invalid time value");let d=t.match(qSe).map(m=>{const p=m[0];if(p==="p"||p==="P"){const g=PSe[p];return g(m,a.formatLong)}return m}).join("").match(zSe).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const p=m[0];if(p==="'")return{isToken:!1,value:WSe(m)};if(NL[p])return{isToken:!0,value:m};if(p.match(HSe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(d=a.localize.preprocessor(u,d));const f={firstWeekContainsDate:i,weekStartsOn:l,locale:a};return d.map(m=>{if(!m.isToken)return m.value;const p=m.value;(!n?.useAdditionalWeekYearTokens&&ISe(p)||!n?.useAdditionalDayOfYearTokens&&$Se(p))&&LSe(p,t,String(e));const g=NL[p[0]];return g(u,p,a.localize,f)}).join("")}function WSe(e){const t=e.match(FSe);return t?t[1].replace(USe,"'"):e}function VSe(e,t){const n=Rt(e,t?.in),r=n.getFullYear(),a=n.getMonth(),i=_n(n,0);return i.setFullYear(r,a+1,0),i.setHours(0,0,0,0),i.getDate()}function GSe(e,t){return Rt(e,t?.in).getMonth()}function YSe(e,t){return Rt(e,t?.in).getFullYear()}function KSe(e,t){return+Rt(e)>+Rt(t)}function XSe(e,t){return+Rt(e)<+Rt(t)}function ZSe(e,t,n){const[r,a]=Al(n?.in,e,t);return+ns(r,n)==+ns(a,n)}function QSe(e,t,n){const[r,a]=Al(n?.in,e,t);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function JSe(e,t,n){const[r,a]=Al(n?.in,e,t);return r.getFullYear()===a.getFullYear()}function e_e(e,t,n){const r=Rt(e,n?.in),a=r.getFullYear(),i=r.getDate(),l=_n(e,0);l.setFullYear(a,t,15),l.setHours(0,0,0,0);const u=VSe(l);return r.setMonth(t,Math.min(i,u)),r}function t_e(e,t,n){const r=Rt(e,n?.in);return isNaN(+r)?_n(e,NaN):(r.setFullYear(t),r)}const AL=5,n_e=4;function r_e(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,a=t.addDays(e,-r+1),i=t.addDays(a,AL*7-1);return t.getMonth(e)===t.getMonth(i)?AL:n_e}function PH(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function a_e(e,t){const n=PH(e,t),r=r_e(e,t);return t.addDays(n,r*7-1)}class aa{constructor(t,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?or.tz(this.options.timeZone):new this.Date,this.newDate=(r,a,i)=>this.overrides?.newDate?this.overrides.newDate(r,a,i):this.options.timeZone?new or(r,a,i,this.options.timeZone):new Date(r,a,i),this.addDays=(r,a)=>this.overrides?.addDays?this.overrides.addDays(r,a):xH(r,a),this.addMonths=(r,a)=>this.overrides?.addMonths?this.overrides.addMonths(r,a):bH(r,a),this.addWeeks=(r,a)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,a):B1e(r,a),this.addYears=(r,a)=>this.overrides?.addYears?this.overrides.addYears(r,a):z1e(r,a),this.differenceInCalendarDays=(r,a)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,a):jH(r,a),this.differenceInCalendarMonths=(r,a)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,a):W1e(r,a),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):G1e(r),this.eachYearOfInterval=r=>{const a=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):X1e(r),i=new Set(a.map(u=>this.getYear(u)));if(i.size===a.length)return a;const l=[];return i.forEach(u=>{l.push(new Date(u,0,1))}),l},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):a_e(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):Z1e(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):V1e(r),this.endOfWeek=(r,a)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,a):OH(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):K1e(r),this.format=(r,a,i)=>{const l=this.overrides?.format?this.overrides.format(r,a,this.options):lv(r,a,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(l):l},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):EH(r),this.getMonth=(r,a)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):GSe(r,this.options),this.getYear=(r,a)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):YSe(r,this.options),this.getWeek=(r,a)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):TH(r,this.options),this.isAfter=(r,a)=>this.overrides?.isAfter?this.overrides.isAfter(r,a):KSe(r,a),this.isBefore=(r,a)=>this.overrides?.isBefore?this.overrides.isBefore(r,a):XSe(r,a),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):SH(r),this.isSameDay=(r,a)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,a):U1e(r,a),this.isSameMonth=(r,a)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,a):QSe(r,a),this.isSameYear=(r,a)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,a):JSe(r,a),this.max=r=>this.overrides?.max?this.overrides.max(r):q1e(r),this.min=r=>this.overrides?.min?this.overrides.min(r):F1e(r),this.setMonth=(r,a)=>this.overrides?.setMonth?this.overrides.setMonth(r,a):e_e(r,a),this.setYear=(r,a)=>this.overrides?.setYear?this.overrides.setYear(r,a):t_e(r,a),this.startOfBroadcastWeek=(r,a)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):PH(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):ph(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):mh(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):Y1e(r),this.startOfWeek=(r,a)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):ns(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):NH(r),this.options={locale:_E,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let a=0;a<10;a++)r[a.toString()]=n.format(a);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){const t=this.options.locale?.code;return t&&aa.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:a}=this.options,i=n?.code;if(i&&aa.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:r,numberingSystem:a}).format(t)}catch{}const l=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,l)}}aa.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const wi=new aa;class MH{constructor(t,n,r=wi){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class i_e{constructor(t,n){this.date=t,this.weeks=n}}class o_e{constructor(t,n){this.days=n,this.weekNumber=t}}function s_e(e){return W.createElement("button",{...e})}function l_e(e){return W.createElement("span",{...e})}function c_e(e){const{size:t=24,orientation:n="left",className:r}=e;return W.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&W.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&W.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&W.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&W.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function u_e(e){const{day:t,modifiers:n,...r}=e;return W.createElement("td",{...r})}function d_e(e){const{day:t,modifiers:n,...r}=e,a=W.useRef(null);return W.useEffect(()=>{n.focused&&a.current?.focus()},[n.focused]),W.createElement("button",{ref:a,...r})}var $e;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})($e||($e={}));var Jt;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Jt||(Jt={}));var Ba;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Ba||(Ba={}));var Kr;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(Kr||(Kr={}));function f_e(e){const{options:t,className:n,components:r,classNames:a,...i}=e,l=[a[$e.Dropdown],n].join(" "),u=t?.find(({value:d})=>d===i.value);return W.createElement("span",{"data-disabled":i.disabled,className:a[$e.DropdownRoot]},W.createElement(r.Select,{className:l,...i},t?.map(({value:d,label:f,disabled:m})=>W.createElement(r.Option,{key:d,value:d,disabled:m},f))),W.createElement("span",{className:a[$e.CaptionLabel],"aria-hidden":!0},u?.label,W.createElement(r.Chevron,{orientation:"down",size:18,className:a[$e.Chevron]})))}function h_e(e){return W.createElement("div",{...e})}function m_e(e){return W.createElement("div",{...e})}function p_e(e){const{calendarMonth:t,displayIndex:n,...r}=e;return W.createElement("div",{...r},e.children)}function v_e(e){const{calendarMonth:t,displayIndex:n,...r}=e;return W.createElement("div",{...r})}function g_e(e){return W.createElement("table",{...e})}function y_e(e){return W.createElement("div",{...e})}const RH=y.createContext(void 0);function Kh(){const e=y.useContext(RH);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function x_e(e){const{components:t}=Kh();return W.createElement(t.Dropdown,{...e})}function b_e(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:a,...i}=e,{components:l,classNames:u,labels:{labelPrevious:d,labelNext:f}}=Kh(),m=y.useCallback(g=>{a&&n?.(g)},[a,n]),p=y.useCallback(g=>{r&&t?.(g)},[r,t]);return W.createElement("nav",{...i},W.createElement(l.PreviousMonthButton,{type:"button",className:u[$e.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":d(r),onClick:p},W.createElement(l.Chevron,{disabled:r?void 0:!0,className:u[$e.Chevron],orientation:"left"})),W.createElement(l.NextMonthButton,{type:"button",className:u[$e.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":f(a),onClick:m},W.createElement(l.Chevron,{disabled:a?void 0:!0,orientation:"right",className:u[$e.Chevron]})))}function w_e(e){const{components:t}=Kh();return W.createElement(t.Button,{...e})}function j_e(e){return W.createElement("option",{...e})}function S_e(e){const{components:t}=Kh();return W.createElement(t.Button,{...e})}function __e(e){const{rootRef:t,...n}=e;return W.createElement("div",{...n,ref:t})}function N_e(e){return W.createElement("select",{...e})}function O_e(e){const{week:t,...n}=e;return W.createElement("tr",{...n})}function C_e(e){return W.createElement("th",{...e})}function E_e(e){return W.createElement("thead",{"aria-hidden":!0},W.createElement("tr",{...e}))}function A_e(e){const{week:t,...n}=e;return W.createElement("th",{...n})}function T_e(e){return W.createElement("th",{...e})}function k_e(e){return W.createElement("tbody",{...e})}function P_e(e){const{components:t}=Kh();return W.createElement(t.Dropdown,{...e})}const M_e=Object.freeze(Object.defineProperty({__proto__:null,Button:s_e,CaptionLabel:l_e,Chevron:c_e,Day:u_e,DayButton:d_e,Dropdown:f_e,DropdownNav:h_e,Footer:m_e,Month:p_e,MonthCaption:v_e,MonthGrid:g_e,Months:y_e,MonthsDropdown:x_e,Nav:b_e,NextMonthButton:w_e,Option:j_e,PreviousMonthButton:S_e,Root:__e,Select:N_e,Week:O_e,WeekNumber:A_e,WeekNumberHeader:T_e,Weekday:C_e,Weekdays:E_e,Weeks:k_e,YearsDropdown:P_e},Symbol.toStringTag,{value:"Module"}));function Yi(e,t,n=!1,r=wi){let{from:a,to:i}=e;const{differenceInCalendarDays:l,isSameDay:u}=r;return a&&i?(l(i,a)<0&&([a,i]=[i,a]),l(t,a)>=(n?1:0)&&l(i,t)>=(n?1:0)):!n&&i?u(i,t):!n&&a?u(a,t):!1}function DH(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function NE(e){return!!(e&&typeof e=="object"&&"from"in e)}function $H(e){return!!(e&&typeof e=="object"&&"after"in e)}function IH(e){return!!(e&&typeof e=="object"&&"before"in e)}function LH(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function BH(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Ki(e,t,n=wi){const r=Array.isArray(t)?t:[t],{isSameDay:a,differenceInCalendarDays:i,isAfter:l}=n;return r.some(u=>{if(typeof u=="boolean")return u;if(n.isDate(u))return a(e,u);if(BH(u,n))return u.includes(e);if(NE(u))return Yi(u,e,!1,n);if(LH(u))return Array.isArray(u.dayOfWeek)?u.dayOfWeek.includes(e.getDay()):u.dayOfWeek===e.getDay();if(DH(u)){const d=i(u.before,e),f=i(u.after,e),m=d>0,p=f<0;return l(u.before,u.after)?p&&m:m||p}return $H(u)?i(e,u.after)>0:IH(u)?i(u.before,e)>0:typeof u=="function"?u(e):!1})}function R_e(e,t,n,r,a){const{disabled:i,hidden:l,modifiers:u,showOutsideDays:d,broadcastCalendar:f,today:m}=t,{isSameDay:p,isSameMonth:g,startOfMonth:x,isBefore:j,endOfMonth:b,isAfter:w}=a,N=n&&x(n),O=r&&b(r),C={[Jt.focused]:[],[Jt.outside]:[],[Jt.disabled]:[],[Jt.hidden]:[],[Jt.today]:[]},A={};for(const E of e){const{date:k,displayMonth:T}=E,P=!!(T&&!g(k,T)),$=!!(N&&j(k,N)),z=!!(O&&w(k,O)),D=!!(i&&Ki(k,i,a)),U=!!(l&&Ki(k,l,a))||$||z||!f&&!d&&P||f&&d===!1&&P,V=p(k,m??a.today());P&&C.outside.push(E),D&&C.disabled.push(E),U&&C.hidden.push(E),V&&C.today.push(E),u&&Object.keys(u).forEach(H=>{const G=u?.[H];G&&Ki(k,G,a)&&(A[H]?A[H].push(E):A[H]=[E])})}return E=>{const k={[Jt.focused]:!1,[Jt.disabled]:!1,[Jt.hidden]:!1,[Jt.outside]:!1,[Jt.today]:!1},T={};for(const P in C){const $=C[P];k[P]=$.some(z=>z===E)}for(const P in A)T[P]=A[P].some($=>$===E);return{...k,...T}}}function D_e(e,t,n={}){return Object.entries(e).filter(([,a])=>a===!0).reduce((a,[i])=>(n[i]?a.push(n[i]):t[Jt[i]]?a.push(t[Jt[i]]):t[Ba[i]]&&a.push(t[Ba[i]]),a),[t[$e.Day]])}function $_e(e){return{...M_e,...e}}function I_e(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function OE(){const e={};for(const t in $e)e[$e[t]]=`rdp-${$e[t]}`;for(const t in Jt)e[Jt[t]]=`rdp-${Jt[t]}`;for(const t in Ba)e[Ba[t]]=`rdp-${Ba[t]}`;for(const t in Kr)e[Kr[t]]=`rdp-${Kr[t]}`;return e}function zH(e,t,n){return(n??new aa(t)).formatMonthYear(e)}const L_e=zH;function B_e(e,t,n){return(n??new aa(t)).format(e,"d")}function z_e(e,t=wi){return t.format(e,"LLLL")}function q_e(e,t,n){return(n??new aa(t)).format(e,"cccccc")}function F_e(e,t=wi){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function U_e(){return""}function qH(e,t=wi){return t.format(e,"yyyy")}const H_e=qH,W_e=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:zH,formatDay:B_e,formatMonthCaption:L_e,formatMonthDropdown:z_e,formatWeekNumber:F_e,formatWeekNumberHeader:U_e,formatWeekdayName:q_e,formatYearCaption:H_e,formatYearDropdown:qH},Symbol.toStringTag,{value:"Module"}));function V_e(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...W_e,...e}}function G_e(e,t,n,r,a){const{startOfMonth:i,startOfYear:l,endOfYear:u,eachMonthOfInterval:d,getMonth:f}=a;return d({start:l(e),end:u(e)}).map(g=>{const x=r.formatMonthDropdown(g,a),j=f(g),b=t&&gi(n)||!1;return{value:j,label:x,disabled:b}})}function Y_e(e,t={},n={}){let r={...t?.[$e.Day]};return Object.entries(e).filter(([,a])=>a===!0).forEach(([a])=>{r={...r,...n?.[a]}}),r}function K_e(e,t,n){const r=e.today(),a=t?e.startOfISOWeek(r):e.startOfWeek(r),i=[];for(let l=0;l<7;l++){const u=e.addDays(a,l);i.push(u)}return i}function X_e(e,t,n,r,a=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:l,eachYearOfInterval:u,getYear:d}=r,f=i(e),m=l(t),p=u({start:f,end:m});return a&&p.reverse(),p.map(g=>{const x=n.formatYearDropdown(g,r);return{value:d(g),label:x,disabled:!1}})}function FH(e,t,n,r){let a=(r??new aa(n)).format(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a}const Z_e=FH;function UH(e,t,n){return(n??new aa(t)).formatMonthYear(e)}const Q_e=UH;function J_e(e,t,n,r){let a=(r??new aa(n)).format(e,"PPPP");return t?.today&&(a=`Today, ${a}`),a}function eNe(e){return"Choose the Month"}function tNe(){return""}function nNe(e){return"Go to the Next Month"}function rNe(e){return"Go to the Previous Month"}function aNe(e,t,n){return(n??new aa(t)).format(e,"cccc")}function iNe(e,t){return`Week ${e}`}function oNe(e){return"Week Number"}function sNe(e){return"Choose the Year"}const lNe=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:Q_e,labelDay:Z_e,labelDayButton:FH,labelGrid:UH,labelGridcell:J_e,labelMonthDropdown:eNe,labelNav:tNe,labelNext:nNe,labelPrevious:rNe,labelWeekNumber:iNe,labelWeekNumberHeader:oNe,labelWeekday:aNe,labelYearDropdown:sNe},Symbol.toStringTag,{value:"Module"})),Xh=e=>e instanceof HTMLElement?e:null,r_=e=>[...e.querySelectorAll("[data-animated-month]")??[]],cNe=e=>Xh(e.querySelector("[data-animated-month]")),a_=e=>Xh(e.querySelector("[data-animated-caption]")),i_=e=>Xh(e.querySelector("[data-animated-weeks]")),uNe=e=>Xh(e.querySelector("[data-animated-nav]")),dNe=e=>Xh(e.querySelector("[data-animated-weekdays]"));function fNe(e,t,{classNames:n,months:r,focused:a,dateLib:i}){const l=y.useRef(null),u=y.useRef(r),d=y.useRef(!1);y.useLayoutEffect(()=>{const f=u.current;if(u.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||f.length===0||r.length!==f.length)return;const m=i.isSameMonth(r[0].date,f[0].date),p=i.isAfter(r[0].date,f[0].date),g=p?n[Kr.caption_after_enter]:n[Kr.caption_before_enter],x=p?n[Kr.weeks_after_enter]:n[Kr.weeks_before_enter],j=l.current,b=e.current.cloneNode(!0);if(b instanceof HTMLElement?(r_(b).forEach(C=>{if(!(C instanceof HTMLElement))return;const A=cNe(C);A&&C.contains(A)&&C.removeChild(A);const E=a_(C);E&&E.classList.remove(g);const k=i_(C);k&&k.classList.remove(x)}),l.current=b):l.current=null,d.current||m||a)return;const w=j instanceof HTMLElement?r_(j):[],N=r_(e.current);if(N?.every(O=>O instanceof HTMLElement)&&w&&w.every(O=>O instanceof HTMLElement)){d.current=!0,e.current.style.isolation="isolate";const O=uNe(e.current);O&&(O.style.zIndex="1"),N.forEach((C,A)=>{const E=w[A];if(!E)return;C.style.position="relative",C.style.overflow="hidden";const k=a_(C);k&&k.classList.add(g);const T=i_(C);T&&T.classList.add(x);const P=()=>{d.current=!1,e.current&&(e.current.style.isolation=""),O&&(O.style.zIndex=""),k&&k.classList.remove(g),T&&T.classList.remove(x),C.style.position="",C.style.overflow="",C.contains(E)&&C.removeChild(E)};E.style.pointerEvents="none",E.style.position="absolute",E.style.overflow="hidden",E.setAttribute("aria-hidden","true");const $=dNe(E);$&&($.style.opacity="0");const z=a_(E);z&&(z.classList.add(p?n[Kr.caption_before_exit]:n[Kr.caption_after_exit]),z.addEventListener("animationend",P));const D=i_(E);D&&D.classList.add(p?n[Kr.weeks_before_exit]:n[Kr.weeks_after_exit]),C.insertBefore(E,C.firstChild)})}})}function hNe(e,t,n,r){const a=e[0],i=e[e.length-1],{ISOWeek:l,fixedWeeks:u,broadcastCalendar:d}=n??{},{addDays:f,differenceInCalendarDays:m,differenceInCalendarMonths:p,endOfBroadcastWeek:g,endOfISOWeek:x,endOfMonth:j,endOfWeek:b,isAfter:w,startOfBroadcastWeek:N,startOfISOWeek:O,startOfWeek:C}=r,A=d?N(a,r):l?O(a):C(a),E=d?g(i):l?x(j(i)):b(j(i)),k=m(E,A),T=p(i,a)+1,P=[];for(let D=0;D<=k;D++){const U=f(A,D);if(t&&w(U,t))break;P.push(U)}const z=(d?35:42)*T;if(u&&P.length{const a=r.weeks.reduce((i,l)=>i.concat(l.days.slice()),t.slice());return n.concat(a.slice())},t.slice())}function pNe(e,t,n,r){const{numberOfMonths:a=1}=n,i=[];for(let l=0;lt)break;i.push(u)}return i}function TL(e,t,n,r){const{month:a,defaultMonth:i,today:l=r.today(),numberOfMonths:u=1}=e;let d=a||i||l;const{differenceInCalendarMonths:f,addMonths:m,startOfMonth:p}=r;if(n&&f(n,d){const N=n.broadcastCalendar?p(w,r):n.ISOWeek?g(w):x(w),O=n.broadcastCalendar?i(w):n.ISOWeek?l(u(w)):d(u(w)),C=t.filter(T=>T>=N&&T<=O),A=n.broadcastCalendar?35:42;if(n.fixedWeeks&&C.length{const $=A-C.length;return P>O&&P<=a(O,$)});C.push(...T)}const E=C.reduce((T,P)=>{const $=n.ISOWeek?f(P):m(P),z=T.find(U=>U.weekNumber===$),D=new MH(P,w,r);return z?z.days.push(D):T.push(new o_e($,[D])),T},[]),k=new i_e(w,E);return b.push(k),b},[]);return n.reverseMonths?j.reverse():j}function gNe(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:a,startOfDay:i,startOfMonth:l,endOfMonth:u,addYears:d,endOfYear:f,newDate:m,today:p}=t,{fromYear:g,toYear:x,fromMonth:j,toMonth:b}=e;!n&&j&&(n=j),!n&&g&&(n=t.newDate(g,0,1)),!r&&b&&(r=b),!r&&x&&(r=m(x,11,31));const w=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=l(n):g?n=m(g,0,1):!n&&w&&(n=a(d(e.today??p(),-100))),r?r=u(r):x?r=m(x,11,31):!r&&w&&(r=f(e.today??p())),[n&&i(n),r&&i(r)]}function yNe(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:i=1}=n,{startOfMonth:l,addMonths:u,differenceInCalendarMonths:d}=r,f=a?i:1,m=l(e);if(!t)return u(m,f);if(!(d(t,e)n.concat(r.weeks.slice()),t.slice())}function Zy(e,t){const[n,r]=y.useState(e);return[t===void 0?n:t,r]}function wNe(e,t){const[n,r]=gNe(e,t),{startOfMonth:a,endOfMonth:i}=t,l=TL(e,n,r,t),[u,d]=Zy(l,e.month?l:void 0);y.useEffect(()=>{const k=TL(e,n,r,t);d(k)},[e.timeZone]);const f=pNe(u,r,e,t),m=hNe(f,e.endMonth?i(e.endMonth):void 0,e,t),p=vNe(f,m,e,t),g=bNe(p),x=mNe(p),j=xNe(u,n,e,t),b=yNe(u,r,e,t),{disableNavigation:w,onMonthChange:N}=e,O=k=>g.some(T=>T.days.some(P=>P.isEqualTo(k))),C=k=>{if(w)return;let T=a(k);n&&Ta(r)&&(T=a(r)),d(T),N?.(T)};return{months:p,weeks:g,days:x,navStart:n,navEnd:r,previousMonth:j,nextMonth:b,goToMonth:C,goToDay:k=>{O(k)||C(k.date)}}}var Ja;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Ja||(Ja={}));function kL(e){return!e[Jt.disabled]&&!e[Jt.hidden]&&!e[Jt.outside]}function jNe(e,t,n,r){let a,i=-1;for(const l of e){const u=t(l);kL(u)&&(u[Jt.focused]&&ikL(t(l)))),a}function SNe(e,t,n,r,a,i,l){const{ISOWeek:u,broadcastCalendar:d}=i,{addDays:f,addMonths:m,addWeeks:p,addYears:g,endOfBroadcastWeek:x,endOfISOWeek:j,endOfWeek:b,max:w,min:N,startOfBroadcastWeek:O,startOfISOWeek:C,startOfWeek:A}=l;let k={day:f,week:p,month:m,year:g,startOfWeek:T=>d?O(T,l):u?C(T):A(T),endOfWeek:T=>d?x(T):u?j(T):b(T)}[e](n,t==="after"?1:-1);return t==="before"&&r?k=w([r,k]):t==="after"&&a&&(k=N([a,k])),k}function HH(e,t,n,r,a,i,l,u=0){if(u>365)return;const d=SNe(e,t,n.date,r,a,i,l),f=!!(i.disabled&&Ki(d,i.disabled,l)),m=!!(i.hidden&&Ki(d,i.hidden,l)),p=d,g=new MH(d,p,l);return!f&&!m?g:HH(e,t,g,r,a,i,l,u+1)}function _Ne(e,t,n,r,a){const{autoFocus:i}=e,[l,u]=y.useState(),d=jNe(t.days,n,r||(()=>!1),l),[f,m]=y.useState(i?d:void 0);return{isFocusTarget:b=>!!d?.isEqualTo(b),setFocused:m,focused:f,blur:()=>{u(f),m(void 0)},moveFocus:(b,w)=>{if(!f)return;const N=HH(b,w,f,t.navStart,t.navEnd,e,a);N&&(e.disableNavigation&&!t.days.some(C=>C.isEqualTo(N))||(t.goToDay(N),m(N)))}}}function NNe(e,t){const{selected:n,required:r,onSelect:a}=e,[i,l]=Zy(n,a?n:void 0),u=a?n:i,{isSameDay:d}=t,f=x=>u?.some(j=>d(j,x))??!1,{min:m,max:p}=e;return{selected:u,select:(x,j,b)=>{let w=[...u??[]];if(f(x)){if(u?.length===m||r&&u?.length===1)return;w=u?.filter(N=>!d(N,x))}else u?.length===p?w=[x]:w=[...w,x];return a||l(w),a?.(w,x,j,b),w},isSelected:f}}function ONe(e,t,n=0,r=0,a=!1,i=wi){const{from:l,to:u}=t||{},{isSameDay:d,isAfter:f,isBefore:m}=i;let p;if(!l&&!u)p={from:e,to:n>0?void 0:e};else if(l&&!u)d(l,e)?n===0?p={from:l,to:e}:a?p={from:l,to:void 0}:p=void 0:m(e,l)?p={from:e,to:l}:p={from:l,to:e};else if(l&&u)if(d(l,e)&&d(u,e))a?p={from:l,to:u}:p=void 0;else if(d(l,e))p={from:l,to:n>0?void 0:e};else if(d(u,e))p={from:e,to:n>0?void 0:e};else if(m(e,l))p={from:e,to:u};else if(f(e,l))p={from:l,to:e};else if(f(e,u))p={from:l,to:e};else throw new Error("Invalid range");if(p?.from&&p?.to){const g=i.differenceInCalendarDays(p.to,p.from);r>0&&g>r?p={from:e,to:void 0}:n>1&&gtypeof u!="function").some(u=>typeof u=="boolean"?u:n.isDate(u)?Yi(e,u,!1,n):BH(u,n)?u.some(d=>Yi(e,d,!1,n)):NE(u)?u.from&&u.to?PL(e,{from:u.from,to:u.to},n):!1:LH(u)?CNe(e,u.dayOfWeek,n):DH(u)?n.isAfter(u.before,u.after)?PL(e,{from:n.addDays(u.after,1),to:n.addDays(u.before,-1)},n):Ki(e.from,u,n)||Ki(e.to,u,n):$H(u)||IH(u)?Ki(e.from,u,n)||Ki(e.to,u,n):!1))return!0;const l=r.filter(u=>typeof u=="function");if(l.length){let u=e.from;const d=n.differenceInCalendarDays(e.to,e.from);for(let f=0;f<=d;f++){if(l.some(m=>m(u)))return!0;u=n.addDays(u,1)}}return!1}function ANe(e,t){const{disabled:n,excludeDisabled:r,selected:a,required:i,onSelect:l}=e,[u,d]=Zy(a,l?a:void 0),f=l?a:u;return{selected:f,select:(g,x,j)=>{const{min:b,max:w}=e,N=g?ONe(g,f,b,w,i,t):void 0;return r&&n&&N?.from&&N.to&&ENe({from:N.from,to:N.to},n,t)&&(N.from=g,N.to=void 0),l||d(N),l?.(N,g,x,j),N},isSelected:g=>f&&Yi(f,g,!1,t)}}function TNe(e,t){const{selected:n,required:r,onSelect:a}=e,[i,l]=Zy(n,a?n:void 0),u=a?n:i,{isSameDay:d}=t;return{selected:u,select:(p,g,x)=>{let j=p;return!r&&u&&u&&d(p,u)&&(j=void 0),a||l(j),a?.(j,p,g,x),j},isSelected:p=>u?d(u,p):!1}}function kNe(e,t){const n=TNe(e,t),r=NNe(e,t),a=ANe(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return a;default:return}}function PNe(e){let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new or(t.today,t.timeZone)),t.month&&(t.month=new or(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new or(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new or(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new or(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new or(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=t.selected?.map(et=>new or(et,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new or(t.selected.from,t.timeZone):void 0,to:t.selected.to?new or(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:r,labels:a,dateLib:i,locale:l,classNames:u}=y.useMemo(()=>{const et={..._E,...t.locale};return{dateLib:new aa({locale:et,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:$_e(t.components),formatters:V_e(t.formatters),labels:{...lNe,...t.labels},locale:et,classNames:{...OE(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:d,mode:f,navLayout:m,numberOfMonths:p=1,onDayBlur:g,onDayClick:x,onDayFocus:j,onDayKeyDown:b,onDayMouseEnter:w,onDayMouseLeave:N,onNextClick:O,onPrevClick:C,showWeekNumber:A,styles:E}=t,{formatCaption:k,formatDay:T,formatMonthDropdown:P,formatWeekNumber:$,formatWeekNumberHeader:z,formatWeekdayName:D,formatYearDropdown:U}=r,V=wNe(t,i),{days:H,months:G,navStart:L,navEnd:R,previousMonth:F,nextMonth:K,goToMonth:te}=V,I=R_e(H,t,L,R,i),{isSelected:B,select:Y,selected:ne}=kNe(t,i)??{},{blur:oe,focused:xe,isFocusTarget:ee,moveFocus:ae,setFocused:Z}=_Ne(t,V,I,B??(()=>!1),i),{labelDayButton:pe,labelGridcell:je,labelGrid:le,labelMonthDropdown:Re,labelNav:_e,labelPrevious:me,labelNext:ve,labelWeekday:Le,labelWeekNumber:Dt,labelWeekNumberHeader:Nn,labelYearDropdown:pr}=a,nr=y.useMemo(()=>K_e(i,t.ISOWeek),[i,t.ISOWeek]),vr=f!==void 0||x!==void 0,lt=y.useCallback(()=>{F&&(te(F),C?.(F))},[F,te,C]),rt=y.useCallback(()=>{K&&(te(K),O?.(K))},[te,K,O]),Dn=y.useCallback((et,Lt)=>He=>{He.preventDefault(),He.stopPropagation(),Z(et),Y?.(et.date,Lt,He),x?.(et.date,Lt,He)},[Y,x,Z]),hs=y.useCallback((et,Lt)=>He=>{Z(et),j?.(et.date,Lt,He)},[j,Z]),rm=y.useCallback((et,Lt)=>He=>{oe(),g?.(et.date,Lt,He)},[oe,g]),kl=y.useCallback((et,Lt)=>He=>{const gt={ArrowLeft:[He.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[He.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[He.shiftKey?"year":"week","after"],ArrowUp:[He.shiftKey?"year":"week","before"],PageUp:[He.shiftKey?"year":"month","before"],PageDown:[He.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(gt[He.key]){He.preventDefault(),He.stopPropagation();const[$n,tt]=gt[He.key];ae($n,tt)}b?.(et.date,Lt,He)},[ae,b,t.dir]),nx=y.useCallback((et,Lt)=>He=>{w?.(et.date,Lt,He)},[w]),am=y.useCallback((et,Lt)=>He=>{N?.(et.date,Lt,He)},[N]),rx=y.useCallback(et=>Lt=>{const He=Number(Lt.target.value),gt=i.setMonth(i.startOfMonth(et),He);te(gt)},[i,te]),ax=y.useCallback(et=>Lt=>{const He=Number(Lt.target.value),gt=i.setYear(i.startOfMonth(et),He);te(gt)},[i,te]),{className:ms,style:gr}=y.useMemo(()=>({className:[u[$e.Root],t.className].filter(Boolean).join(" "),style:{...E?.[$e.Root],...t.style}}),[u,t.className,t.style,E]),Ga=I_e(t),rr=y.useRef(null);fNe(rr,!!t.animate,{classNames:u,months:G,focused:xe,dateLib:i});const ix={dayPickerProps:t,selected:ne,select:Y,isSelected:B,months:G,nextMonth:K,previousMonth:F,goToMonth:te,getModifiers:I,components:n,classNames:u,styles:E,labels:a,formatters:r};return W.createElement(RH.Provider,{value:ix},W.createElement(n.Root,{rootRef:t.animate?rr:void 0,className:ms,style:gr,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Ga},W.createElement(n.Months,{className:u[$e.Months],style:E?.[$e.Months]},!t.hideNavigation&&!m&&W.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:u[$e.Nav],style:E?.[$e.Nav],"aria-label":_e(),onPreviousClick:lt,onNextClick:rt,previousMonth:F,nextMonth:K}),G.map((et,Lt)=>W.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:u[$e.Month],style:E?.[$e.Month],key:Lt,displayIndex:Lt,calendarMonth:et},m==="around"&&!t.hideNavigation&&Lt===0&&W.createElement(n.PreviousMonthButton,{type:"button",className:u[$e.PreviousMonthButton],tabIndex:F?void 0:-1,"aria-disabled":F?void 0:!0,"aria-label":me(F),onClick:lt,"data-animated-button":t.animate?"true":void 0},W.createElement(n.Chevron,{disabled:F?void 0:!0,className:u[$e.Chevron],orientation:t.dir==="rtl"?"right":"left"})),W.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:u[$e.MonthCaption],style:E?.[$e.MonthCaption],calendarMonth:et,displayIndex:Lt},d?.startsWith("dropdown")?W.createElement(n.DropdownNav,{className:u[$e.Dropdowns],style:E?.[$e.Dropdowns]},(()=>{const He=d==="dropdown"||d==="dropdown-months"?W.createElement(n.MonthsDropdown,{key:"month",className:u[$e.MonthsDropdown],"aria-label":Re(),classNames:u,components:n,disabled:!!t.disableNavigation,onChange:rx(et.date),options:G_e(et.date,L,R,r,i),style:E?.[$e.Dropdown],value:i.getMonth(et.date)}):W.createElement("span",{key:"month"},P(et.date,i)),gt=d==="dropdown"||d==="dropdown-years"?W.createElement(n.YearsDropdown,{key:"year",className:u[$e.YearsDropdown],"aria-label":pr(i.options),classNames:u,components:n,disabled:!!t.disableNavigation,onChange:ax(et.date),options:X_e(L,R,r,i,!!t.reverseYears),style:E?.[$e.Dropdown],value:i.getYear(et.date)}):W.createElement("span",{key:"year"},U(et.date,i));return i.getMonthYearOrder()==="year-first"?[gt,He]:[He,gt]})(),W.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},k(et.date,i.options,i))):W.createElement(n.CaptionLabel,{className:u[$e.CaptionLabel],role:"status","aria-live":"polite"},k(et.date,i.options,i))),m==="around"&&!t.hideNavigation&&Lt===p-1&&W.createElement(n.NextMonthButton,{type:"button",className:u[$e.NextMonthButton],tabIndex:K?void 0:-1,"aria-disabled":K?void 0:!0,"aria-label":ve(K),onClick:rt,"data-animated-button":t.animate?"true":void 0},W.createElement(n.Chevron,{disabled:K?void 0:!0,className:u[$e.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Lt===p-1&&m==="after"&&!t.hideNavigation&&W.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:u[$e.Nav],style:E?.[$e.Nav],"aria-label":_e(),onPreviousClick:lt,onNextClick:rt,previousMonth:F,nextMonth:K}),W.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":f==="multiple"||f==="range","aria-label":le(et.date,i.options,i)||void 0,className:u[$e.MonthGrid],style:E?.[$e.MonthGrid]},!t.hideWeekdays&&W.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:u[$e.Weekdays],style:E?.[$e.Weekdays]},A&&W.createElement(n.WeekNumberHeader,{"aria-label":Nn(i.options),className:u[$e.WeekNumberHeader],style:E?.[$e.WeekNumberHeader],scope:"col"},z()),nr.map(He=>W.createElement(n.Weekday,{"aria-label":Le(He,i.options,i),className:u[$e.Weekday],key:String(He),style:E?.[$e.Weekday],scope:"col"},D(He,i.options,i)))),W.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:u[$e.Weeks],style:E?.[$e.Weeks]},et.weeks.map(He=>W.createElement(n.Week,{className:u[$e.Week],key:He.weekNumber,style:E?.[$e.Week],week:He},A&&W.createElement(n.WeekNumber,{week:He,style:E?.[$e.WeekNumber],"aria-label":Dt(He.weekNumber,{locale:l}),className:u[$e.WeekNumber],scope:"row",role:"rowheader"},$(He.weekNumber,i)),He.days.map(gt=>{const{date:$n}=gt,tt=I(gt);if(tt[Jt.focused]=!tt.hidden&&!!xe?.isEqualTo(gt),tt[Ba.selected]=B?.($n)||tt.selected,NE(ne)){const{from:Ml,to:vs}=ne;tt[Ba.range_start]=!!(Ml&&vs&&i.isSameDay($n,Ml)),tt[Ba.range_end]=!!(Ml&&vs&&i.isSameDay($n,vs)),tt[Ba.range_middle]=Yi(ne,$n,!0,i)}const Pl=Y_e(tt,E,t.modifiersStyles),ps=D_e(tt,u,t.modifiersClassNames),ox=!vr&&!tt.hidden?je($n,tt,i.options,i):void 0;return W.createElement(n.Day,{key:`${i.format($n,"yyyy-MM-dd")}_${i.format(gt.displayMonth,"yyyy-MM")}`,day:gt,modifiers:tt,className:ps.join(" "),style:Pl,role:"gridcell","aria-selected":tt.selected||void 0,"aria-label":ox,"data-day":i.format($n,"yyyy-MM-dd"),"data-month":gt.outside?i.format($n,"yyyy-MM"):void 0,"data-selected":tt.selected||void 0,"data-disabled":tt.disabled||void 0,"data-hidden":tt.hidden||void 0,"data-outside":gt.outside||void 0,"data-focused":tt.focused||void 0,"data-today":tt.today||void 0},!tt.hidden&&vr?W.createElement(n.DayButton,{className:u[$e.DayButton],style:E?.[$e.DayButton],type:"button",day:gt,modifiers:tt,disabled:tt.disabled||void 0,tabIndex:ee(gt)?0:-1,"aria-label":pe($n,tt,i.options,i),onClick:Dn(gt,tt),onBlur:rm(gt,tt),onFocus:hs(gt,tt),onKeyDown:kl(gt,tt),onMouseEnter:nx(gt,tt),onMouseLeave:am(gt,tt)},T($n,i.options,i)):!tt.hidden&&T(gt.date,i.options,i))})))))))),t.footer&&W.createElement(n.Footer,{className:u[$e.Footer],style:E?.[$e.Footer],role:"status","aria-live":"polite"},t.footer)))}function ML({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:a="ghost",formatters:i,components:l,...u}){const d=OE();return o.jsx(PNe,{showOutsideDays:n,className:ue("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:f=>f.toLocaleString("default",{month:"short"}),...i},classNames:{root:ue("w-fit",d.root),months:ue("relative flex flex-col gap-4 md:flex-row",d.months),month:ue("flex w-full flex-col gap-4",d.month),nav:ue("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",d.nav),button_previous:ue(uh({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",d.button_previous),button_next:ue(uh({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",d.button_next),month_caption:ue("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",d.month_caption),dropdowns:ue("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",d.dropdowns),dropdown_root:ue("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",d.dropdown_root),dropdown:ue("bg-popover absolute inset-0 opacity-0",d.dropdown),caption_label:ue("select-none font-medium",r==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",d.caption_label),table:"w-full border-collapse",weekdays:ue("flex",d.weekdays),weekday:ue("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",d.weekday),week:ue("mt-2 flex w-full",d.week),week_number_header:ue("w-[--cell-size] select-none",d.week_number_header),week_number:ue("text-muted-foreground select-none text-[0.8rem]",d.week_number),day:ue("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",d.day),range_start:ue("bg-accent rounded-l-md",d.range_start),range_middle:ue("rounded-none",d.range_middle),range_end:ue("bg-accent rounded-r-md",d.range_end),today:ue("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",d.today),outside:ue("text-muted-foreground aria-selected:text-muted-foreground",d.outside),disabled:ue("text-muted-foreground opacity-50",d.disabled),hidden:ue("invisible",d.hidden),...t},components:{Root:({className:f,rootRef:m,...p})=>o.jsx("div",{"data-slot":"calendar",ref:m,className:ue(f),...p}),Chevron:({className:f,orientation:m,...p})=>m==="left"?o.jsx(UC,{className:ue("size-4",f),...p}):m==="right"?o.jsx(HC,{className:ue("size-4",f),...p}):o.jsx(lh,{className:ue("size-4",f),...p}),DayButton:MNe,WeekNumber:({children:f,...m})=>o.jsx("td",{...m,children:o.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:f})}),...l},...u})}function MNe({className:e,day:t,modifiers:n,...r}){const a=OE(),i=y.useRef(null);return y.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),o.jsx(fe,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:ue("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",a.day,e),...r})}class RNe{ws=null;reconnectTimeout=null;reconnectAttempts=0;maxReconnectAttempts=10;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];maxCacheSize=1e3;getWebSocketUrl(){{const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host;return`${t}//${n}/ws/logs`}}connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;const t=this.getWebSocketUrl();try{this.ws=new WebSocket(t),this.ws.onopen=()=>{this.isConnected=!0,this.reconnectAttempts=0,this.notifyConnection(!0),this.startHeartbeat()},this.ws.onmessage=n=>{try{if(n.data==="pong")return;const r=JSON.parse(n.data);this.notifyLog(r)}catch(r){console.error("解析日志消息失败:",r)}},this.ws.onerror=n=>{console.error("❌ WebSocket 错误:",n),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(n){console.error("创建 WebSocket 连接失败:",n),this.attemptReconnect()}}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return;this.reconnectAttempts+=1;const t=Math.min(1e3*this.reconnectAttempts,1e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},t)}startHeartbeat(){this.heartbeatInterval=window.setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send("ping")},3e4)}stopHeartbeat(){this.heartbeatInterval!==null&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}disconnect(){this.reconnectTimeout!==null&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.stopHeartbeat(),this.ws&&(this.ws.close(),this.ws=null),this.isConnected=!1,this.reconnectAttempts=0}onLog(t){return this.logCallbacks.add(t),()=>this.logCallbacks.delete(t)}onConnectionChange(t){return this.connectionCallbacks.add(t),t(this.isConnected),()=>this.connectionCallbacks.delete(t)}notifyLog(t){this.logCache.some(r=>r.id===t.id)||(this.logCache.push(t),this.logCache.length>this.maxCacheSize&&(this.logCache=this.logCache.slice(-this.maxCacheSize)),this.logCallbacks.forEach(r=>{try{r(t)}catch(a){console.error("日志回调执行失败:",a)}}))}notifyConnection(t){this.connectionCallbacks.forEach(n=>{try{n(t)}catch(r){console.error("连接状态回调执行失败:",r)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const Mc=new RNe;typeof window<"u"&&Mc.connect();const DNe={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},$Ne=(e,t,n)=>{let r;const a=DNe[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},INe={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},LNe={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},BNe={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},zNe={date:Yc({formats:INe,defaultWidth:"full"}),time:Yc({formats:LNe,defaultWidth:"full"}),dateTime:Yc({formats:BNe,defaultWidth:"full"})};function RL(e,t,n){const r="eeee p";return ZSe(e,t,n)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const qNe={lastWeek:RL,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:RL,other:"PP p"},FNe=(e,t,n,r)=>{const a=qNe[e];return typeof a=="function"?a(t,n,r):a},UNe={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},HNe={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},WNe={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},VNe={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},GNe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},YNe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},KNe=(e,t)=>{const n=Number(e);switch(t?.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},XNe={ordinalNumber:KNe,era:ni({values:UNe,defaultWidth:"wide"}),quarter:ni({values:HNe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ni({values:WNe,defaultWidth:"wide"}),day:ni({values:VNe,defaultWidth:"wide"}),dayPeriod:ni({values:GNe,defaultWidth:"wide",formattingValues:YNe,defaultFormattingWidth:"wide"})},ZNe=/^(第\s*)?\d+(日|时|分|秒)?/i,QNe=/\d+/i,JNe={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},eOe={any:[/^(前)/i,/^(公元)/i]},tOe={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},nOe={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},rOe={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},aOe={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},iOe={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},oOe={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},sOe={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},lOe={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},cOe={ordinalNumber:CH({matchPattern:ZNe,parsePattern:QNe,valueCallback:e=>parseInt(e,10)}),era:ri({matchPatterns:JNe,defaultMatchWidth:"wide",parsePatterns:eOe,defaultParseWidth:"any"}),quarter:ri({matchPatterns:tOe,defaultMatchWidth:"wide",parsePatterns:nOe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ri({matchPatterns:rOe,defaultMatchWidth:"wide",parsePatterns:aOe,defaultParseWidth:"any"}),day:ri({matchPatterns:iOe,defaultMatchWidth:"wide",parsePatterns:oOe,defaultParseWidth:"any"}),dayPeriod:ri({matchPatterns:sOe,defaultMatchWidth:"any",parsePatterns:lOe,defaultParseWidth:"any"})},Hp={code:"zh-CN",formatDistance:$Ne,formatLong:zNe,formatRelative:FNe,localize:XNe,match:cOe,options:{weekStartsOn:1,firstWeekContainsDate:4}};function uOe(){const[e,t]=y.useState([]),[n,r]=y.useState(""),[a,i]=y.useState("all"),[l,u]=y.useState("all"),[d,f]=y.useState(void 0),[m,p]=y.useState(void 0),[g,x]=y.useState(!0),[j,b]=y.useState(!1),w=y.useRef(null),N=y.useRef(null);y.useEffect(()=>{const D=Mc.getAllLogs();t(D);const U=Mc.onLog(()=>{t(Mc.getAllLogs())}),V=Mc.onConnectionChange(H=>{b(H)});return()=>{U(),V()}},[]),y.useEffect(()=>{g&&N.current&&N.current.scrollIntoView({behavior:"smooth",block:"end"})},[e,g]);const O=y.useMemo(()=>{const D=new Set(e.map(U=>U.module));return Array.from(D).sort()},[e]),C=D=>{switch(D){case"DEBUG":return"text-muted-foreground";case"INFO":return"text-blue-500 dark:text-blue-400";case"WARNING":return"text-yellow-600 dark:text-yellow-500";case"ERROR":return"text-red-600 dark:text-red-500";case"CRITICAL":return"text-red-700 dark:text-red-400 font-bold";default:return"text-foreground"}},A=D=>{switch(D){case"DEBUG":return"bg-secondary/50";case"INFO":return"bg-blue-500/10 dark:bg-blue-500/20";case"WARNING":return"bg-yellow-500/10 dark:bg-yellow-500/20";case"ERROR":return"bg-red-500/10 dark:bg-red-500/20";case"CRITICAL":return"bg-red-600/20 dark:bg-red-600/30";default:return"bg-muted/50"}},E=()=>{window.location.reload()},k=()=>{Mc.clearLogs(),t([])},T=()=>{const D=z.map(G=>`${G.timestamp} [${G.level.padEnd(8)}] [${G.module}] ${G.message}`).join(` +`),U=new Blob([D],{type:"text/plain;charset=utf-8"}),V=URL.createObjectURL(U),H=document.createElement("a");H.href=V,H.download=`logs-${lv(new Date,"yyyy-MM-dd-HHmmss")}.txt`,H.click(),URL.revokeObjectURL(V)},P=()=>{x(!g)},$=()=>{f(void 0),p(void 0)},z=y.useMemo(()=>e.filter(D=>{const U=n===""||D.message.toLowerCase().includes(n.toLowerCase())||D.module.toLowerCase().includes(n.toLowerCase()),V=a==="all"||D.level===a,H=l==="all"||D.module===l;let G=!0;if(d||m){const L=new Date(D.timestamp);if(d){const R=new Date(d);R.setHours(0,0,0,0),G=G&&L>=R}if(m){const R=new Date(m);R.setHours(23,59,59,999),G=G&&L<=R}}return U&&V&&H&&G}),[e,n,a,l,d,m]);return o.jsx(Xt,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 p-3 sm:p-4 lg:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:ue("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",j?"bg-green-500 animate-pulse":"bg-red-500")}),o.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:j?"已连接":"未连接"})]})]}),o.jsx(dt,{className:"p-3 sm:p-4",children:o.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(Rr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Ne,{placeholder:"搜索日志...",value:n,onChange:D=>r(D.target.value),className:"pl-9 h-9 text-sm"})]}),o.jsxs(Et,{value:a,onValueChange:i,children:[o.jsxs(wt,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[o.jsx(HN,{className:"h-4 w-4 mr-2"}),o.jsx(At,{placeholder:"级别"})]}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"all",children:"全部级别"}),o.jsx(Pe,{value:"DEBUG",children:"DEBUG"}),o.jsx(Pe,{value:"INFO",children:"INFO"}),o.jsx(Pe,{value:"WARNING",children:"WARNING"}),o.jsx(Pe,{value:"ERROR",children:"ERROR"}),o.jsx(Pe,{value:"CRITICAL",children:"CRITICAL"})]})]}),o.jsxs(Et,{value:l,onValueChange:u,children:[o.jsxs(wt,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[o.jsx(HN,{className:"h-4 w-4 mr-2"}),o.jsx(At,{placeholder:"模块"})]}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"all",children:"全部模块"}),O.map(D=>o.jsx(Pe,{value:D,children:D},D))]})]})]}),o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[o.jsxs(Jo,{children:[o.jsx(es,{asChild:!0,children:o.jsxs(fe,{variant:"outline",size:"sm",className:ue("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!d&&"text-muted-foreground"),children:[o.jsx(I3,{className:"mr-2 h-4 w-4"}),o.jsx("span",{className:"text-xs sm:text-sm",children:d?lv(d,"PPP",{locale:Hp}):"开始日期"})]})}),o.jsx(oo,{className:"w-auto p-0",align:"start",children:o.jsx(ML,{mode:"single",selected:d,onSelect:f,initialFocus:!0,locale:Hp})})]}),o.jsxs(Jo,{children:[o.jsx(es,{asChild:!0,children:o.jsxs(fe,{variant:"outline",size:"sm",className:ue("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!m&&"text-muted-foreground"),children:[o.jsx(I3,{className:"mr-2 h-4 w-4"}),o.jsx("span",{className:"text-xs sm:text-sm",children:m?lv(m,"PPP",{locale:Hp}):"结束日期"})]})}),o.jsx(oo,{className:"w-auto p-0",align:"start",children:o.jsx(ML,{mode:"single",selected:m,onSelect:p,initialFocus:!0,locale:Hp})})]}),(d||m)&&o.jsxs(fe,{variant:"outline",size:"sm",onClick:$,className:"w-full sm:w-auto h-9",children:[o.jsx(Ih,{className:"h-4 w-4 sm:mr-2"}),o.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),o.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[o.jsxs("div",{className:"flex gap-2 flex-wrap",children:[o.jsxs(fe,{variant:g?"default":"outline",size:"sm",onClick:P,className:"flex-1 sm:flex-none h-9",children:[g?o.jsx(Wve,{className:"h-4 w-4"}):o.jsx(Yve,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:g?"自动滚动":"已暂停"})]}),o.jsxs(fe,{variant:"outline",size:"sm",onClick:E,className:"flex-1 sm:flex-none h-9",children:[o.jsx(rl,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),o.jsxs(fe,{variant:"outline",size:"sm",onClick:k,className:"flex-1 sm:flex-none h-9",children:[o.jsx(Ut,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),o.jsxs(fe,{variant:"outline",size:"sm",onClick:T,className:"flex-1 sm:flex-none h-9",children:[o.jsx(FN,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),o.jsx("div",{className:"flex-1 hidden sm:block"}),o.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[o.jsxs("span",{className:"font-mono",children:[z.length," / ",e.length]}),o.jsx("span",{className:"ml-1",children:"条日志"})]})]})]})}),o.jsx(dt,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900",children:o.jsx(Xt,{className:"h-[calc(100vh-280px)] sm:h-[calc(100vh-320px)] lg:h-[calc(100vh-400px)]",children:o.jsxs("div",{ref:w,className:"p-2 sm:p-3 lg:p-4 font-mono text-xs sm:text-sm space-y-1",children:[z.length===0?o.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):z.map(D=>o.jsxs("div",{className:ue("py-2 px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",A(D.level)),children:[o.jsxs("div",{className:"flex flex-col gap-1 sm:hidden",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-gray-500 dark:text-gray-600 text-xs",children:D.timestamp}),o.jsxs("span",{className:ue("text-xs font-semibold",C(D.level)),children:["[",D.level,"]"]})]}),o.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 text-xs truncate",children:D.module}),o.jsx("div",{className:"text-gray-300 dark:text-gray-400 text-xs break-all",children:D.message})]}),o.jsxs("div",{className:"hidden sm:flex gap-3 items-start",children:[o.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[140px] lg:w-[180px] text-xs lg:text-sm",children:D.timestamp}),o.jsxs("span",{className:ue("flex-shrink-0 w-[70px] lg:w-[80px] font-semibold text-xs lg:text-sm",C(D.level)),children:["[",D.level,"]"]}),o.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[120px] lg:w-[150px] truncate text-xs lg:text-sm",children:D.module}),o.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 break-all text-xs lg:text-sm",children:D.message})]})]},D.id)),o.jsx("div",{ref:N,className:"h-4"})]})})})]})})}const dOe="Mai-with-u",fOe="plugin-repo",hOe="main",mOe="plugin_details.json";async function pOe(){try{const e=await Ze("/api/webui/plugins/fetch-raw",{method:"POST",headers:st(),body:JSON.stringify({owner:dOe,repo:fOe,branch:hOe,file_path:mOe})});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=await e.json();if(!t.success||!t.data)throw new Error(t.error||"获取插件列表失败");return JSON.parse(t.data).filter(a=>!a?.id||!a?.manifest?(console.warn("跳过无效插件数据:",a),!1):!a.manifest.name||!a.manifest.version?(console.warn("跳过缺少必需字段的插件:",a.id),!1):!0).map(a=>({id:a.id,manifest:{manifest_version:a.manifest.manifest_version||1,name:a.manifest.name,version:a.manifest.version,description:a.manifest.description||"",author:a.manifest.author||{name:"Unknown"},license:a.manifest.license||"Unknown",host_application:a.manifest.host_application||{min_version:"0.0.0"},homepage_url:a.manifest.homepage_url,repository_url:a.manifest.repository_url,keywords:a.manifest.keywords||[],categories:a.manifest.categories||[],default_locale:a.manifest.default_locale||"zh-CN",locales_path:a.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(e){throw console.error("Failed to fetch plugin list:",e),e}}async function vOe(){try{const e=await Ze("/api/webui/plugins/git-status");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.error("Failed to check Git status:",e),{installed:!1,error:"无法检测 Git 安装状态"}}}async function gOe(){try{const e=await Ze("/api/webui/plugins/version");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.error("Failed to get Maimai version:",e),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function yOe(e,t,n){const r=e.split(".").map(u=>parseInt(u)||0),a=r[0]||0,i=r[1]||0,l=r[2]||0;if(n.version_majorparseInt(p)||0),d=u[0]||0,f=u[1]||0,m=u[2]||0;if(n.version_major>d||n.version_major===d&&n.version_minor>f||n.version_major===d&&n.version_minor===f&&n.version_patch>m)return!1}return!0}function xOe(e,t){const n=window.location.protocol==="https:"?"wss:":"ws:",r=window.location.host,a=new WebSocket(`${n}//${r}/api/webui/ws/plugin-progress`);return a.onopen=()=>{console.log("Plugin progress WebSocket connected");const i=setInterval(()=>{a.readyState===WebSocket.OPEN?a.send("ping"):clearInterval(i)},3e4)},a.onmessage=i=>{try{if(i.data==="pong")return;const l=JSON.parse(i.data);e(l)}catch(l){console.error("Failed to parse progress data:",l)}},a.onerror=i=>{console.error("Plugin progress WebSocket error:",i),t?.(i)},a.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},a}async function Wp(){try{const e=await Ze("/api/webui/plugins/installed",{headers:st()});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=await e.json();if(!t.success)throw new Error(t.message||"获取已安装插件列表失败");return t.plugins||[]}catch(e){return console.error("Failed to get installed plugins:",e),[]}}function Vp(e,t){return t.some(n=>n.id===e)}function Gp(e,t){const n=t.find(r=>r.id===e);if(n)return n.manifest?.version||n.version}async function bOe(e,t,n="main"){const r=await Ze("/api/webui/plugins/install",{method:"POST",headers:st(),body:JSON.stringify({plugin_id:e,repository_url:t,branch:n})});if(!r.ok){const a=await r.json();throw new Error(a.detail||"安装失败")}return await r.json()}async function wOe(e){const t=await Ze("/api/webui/plugins/uninstall",{method:"POST",headers:st(),body:JSON.stringify({plugin_id:e})});if(!t.ok){const n=await t.json();throw new Error(n.detail||"卸载失败")}return await t.json()}async function jOe(e,t,n="main"){const r=await Ze("/api/webui/plugins/update",{method:"POST",headers:st(),body:JSON.stringify({plugin_id:e,repository_url:t,branch:n})});if(!r.ok){const a=await r.json();throw new Error(a.detail||"更新失败")}return await r.json()}function SOe(){const e=ia(),[t,n]=y.useState(null),[r,a]=y.useState(""),[i,l]=y.useState("all"),[u,d]=y.useState("all"),[f,m]=y.useState(!1),[p,g]=y.useState([]),[x,j]=y.useState(!0),[b,w]=y.useState(null),[N,O]=y.useState(null),[C,A]=y.useState(null),[E,k]=y.useState(null),[,T]=y.useState([]),{toast:P}=hr();y.useEffect(()=>{let R=null,F=!1;return(async()=>{if(R=xOe(te=>{F||(A(te),te.stage==="success"?setTimeout(()=>{F||A(null)},2e3):te.stage==="error"&&(j(!1),w(te.error||"加载失败")))},te=>{console.error("WebSocket error:",te),F||P({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(te=>{if(!R){te();return}const I=()=>{R&&R.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),te()):R&&R.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),te()):setTimeout(I,100)};I()}),!F){const te=await vOe();O(te),te.installed||P({title:"Git 未安装",description:te.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!F){const te=await gOe();k(te)}if(!F)try{j(!0),w(null);const te=await pOe();if(!F){const I=await Wp();T(I);const B=te.map(Y=>{const ne=Vp(Y.id,I),oe=Gp(Y.id,I);return{...Y,installed:ne,installed_version:oe}});for(const Y of I)!B.some(oe=>oe.id===Y.id)&&Y.manifest&&B.push({id:Y.id,manifest:{manifest_version:Y.manifest.manifest_version||1,name:Y.manifest.name,version:Y.manifest.version,description:Y.manifest.description||"",author:Y.manifest.author,license:Y.manifest.license||"Unknown",host_application:Y.manifest.host_application,homepage_url:Y.manifest.homepage_url,repository_url:Y.manifest.repository_url,keywords:Y.manifest.keywords||[],categories:Y.manifest.categories||[],default_locale:Y.manifest.default_locale||"zh-CN",locales_path:Y.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:Y.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});g(B)}}catch(te){if(!F){const I=te instanceof Error?te.message:"加载插件列表失败";w(I),P({title:"加载失败",description:I,variant:"destructive"})}}finally{F||j(!1)}})(),()=>{F=!0,R&&R.close()}},[P]);const $=R=>{if(!R.installed&&E&&!z(R))return o.jsxs(en,{variant:"destructive",className:"gap-1",children:[o.jsx(yg,{className:"h-3 w-3"}),"不兼容"]});if(R.installed){const F=R.installed_version?.trim(),K=R.manifest.version?.trim();if(F!==K){const te=F?.split(".").map(Number)||[0,0,0],I=K?.split(".").map(Number)||[0,0,0];for(let B=0;B<3;B++){if((I[B]||0)>(te[B]||0))return o.jsxs(en,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[o.jsx(yg,{className:"h-3 w-3"}),"可更新"]});if((I[B]||0)<(te[B]||0))break}}return o.jsxs(en,{variant:"default",className:"gap-1",children:[o.jsx(Ou,{className:"h-3 w-3"}),"已安装"]})}return null},z=R=>!E||!R.manifest?.host_application?!0:yOe(R.manifest.host_application.min_version,R.manifest.host_application.max_version,E),D=R=>{if(!R.installed||!R.installed_version||!R.manifest?.version)return!1;const F=R.installed_version.trim(),K=R.manifest.version.trim();if(F===K)return!1;const te=F.split(".").map(Number),I=K.split(".").map(Number);for(let B=0;B<3;B++){if((I[B]||0)>(te[B]||0))return!0;if((I[B]||0)<(te[B]||0))return!1}return!1},U=p.filter(R=>{if(!R.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",R.id),!1;const F=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(B=>B.toLowerCase().includes(r.toLowerCase())),K=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i);let te=!0;u==="installed"?te=R.installed===!0:u==="updates"&&(te=R.installed===!0&&D(R));const I=!f||!E||z(R);return F&&K&&te&&I}),V=()=>{n(null)},H=async R=>{if(!N?.installed){P({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(E&&!z(R)){P({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await bOe(R.id,R.manifest.repository_url||"","main"),P({title:"安装成功",description:`${R.manifest.name} 已成功安装`});const F=await Wp();T(F),g(K=>K.map(te=>{if(te.id===R.id){const I=Vp(te.id,F),B=Gp(te.id,F);return{...te,installed:I,installed_version:B}}return te}))}catch(F){P({title:"安装失败",description:F instanceof Error?F.message:"未知错误",variant:"destructive"})}},G=async R=>{try{await wOe(R.id),P({title:"卸载成功",description:`${R.manifest.name} 已成功卸载`});const F=await Wp();T(F),g(K=>K.map(te=>{if(te.id===R.id){const I=Vp(te.id,F),B=Gp(te.id,F);return{...te,installed:I,installed_version:B}}return te}))}catch(F){P({title:"卸载失败",description:F instanceof Error?F.message:"未知错误",variant:"destructive"})}},L=async R=>{if(!N?.installed){P({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const F=await jOe(R.id,R.manifest.repository_url||"","main");P({title:"更新成功",description:`${R.manifest.name} 已从 ${F.old_version} 更新到 ${F.new_version}`});const K=await Wp();T(K),g(te=>te.map(I=>{if(I.id===R.id){const B=Vp(I.id,K),Y=Gp(I.id,K);return{...I,installed:B,installed_version:Y}}return I}))}catch(F){P({title:"更新失败",description:F instanceof Error?F.message:"未知错误",variant:"destructive"})}};return o.jsx(Xt,{className:"h-full",children:o.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),o.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),o.jsxs(fe,{onClick:()=>e({to:"/plugin-mirrors"}),children:[o.jsx(ige,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),N&&!N.installed&&o.jsxs(dt,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[o.jsx(Vt,{children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Hc,{className:"h-5 w-5 text-orange-600"}),o.jsxs("div",{children:[o.jsx(Gt,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),o.jsx(Jn,{className:"text-orange-800 dark:text-orange-200",children:N.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),o.jsx(ln,{children:o.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",o.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),o.jsx(dt,{className:"p-4",children:o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(Rr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Ne,{placeholder:"搜索插件...",value:r,onChange:R=>a(R.target.value),className:"pl-9"})]}),o.jsxs(Et,{value:i,onValueChange:l,children:[o.jsx(wt,{className:"w-full sm:w-[200px]",children:o.jsx(At,{placeholder:"选择分类"})}),o.jsxs(jt,{children:[o.jsx(Pe,{value:"all",children:"全部分类"}),o.jsx(Pe,{value:"Developer Tools",children:"开发工具"}),o.jsx(Pe,{value:"AI Enhancement",children:"AI 增强"}),o.jsx(Pe,{value:"Utility",children:"工具类"}),o.jsx(Pe,{value:"Entertainment",children:"娱乐"}),o.jsx(Pe,{value:"Integration",children:"集成"}),o.jsx(Pe,{value:"Data Analysis",children:"数据分析"}),o.jsx(Pe,{value:"Automation",children:"自动化"}),o.jsx(Pe,{value:"Other",children:"其他"})]})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Tu,{id:"compatible-only",checked:f,onCheckedChange:R=>m(R===!0)}),o.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),o.jsx(ol,{value:u,onValueChange:d,className:"w-full",children:o.jsxs(Xo,{className:"grid w-full grid-cols-3",children:[o.jsxs(Ct,{value:"all",children:["全部插件 (",p.length,")"]}),o.jsxs(Ct,{value:"installed",children:["已安装 (",p.filter(R=>R.installed).length,")"]}),o.jsxs(Ct,{value:"updates",children:["可更新 (",p.filter(R=>R.installed&&D(R)).length,")"]})]})}),C&&C.stage==="loading"&&o.jsx(dt,{className:"p-4",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(WN,{className:"h-4 w-4 animate-spin"}),o.jsxs("span",{className:"text-sm font-medium",children:[C.operation==="fetch"&&"加载插件列表",C.operation==="install"&&`安装插件${C.plugin_id?`: ${C.plugin_id}`:""}`,C.operation==="uninstall"&&`卸载插件${C.plugin_id?`: ${C.plugin_id}`:""}`,C.operation==="update"&&`更新插件${C.plugin_id?`: ${C.plugin_id}`:""}`]})]}),o.jsxs("span",{className:"text-sm font-medium",children:[C.progress,"%"]})]}),o.jsx(lE,{value:C.progress,className:"h-2"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:C.message}),C.operation==="fetch"&&C.total_plugins>0&&o.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",C.loaded_plugins," / ",C.total_plugins," 个插件"]})]})}),C&&C.stage==="error"&&C.error&&o.jsx(dt,{className:"border-destructive bg-destructive/10",children:o.jsx(Vt,{children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Hc,{className:"h-5 w-5 text-destructive"}),o.jsxs("div",{children:[o.jsx(Gt,{className:"text-lg text-destructive",children:"加载失败"}),o.jsx(Jn,{className:"text-destructive/80",children:C.error})]})]})})}),x?o.jsxs("div",{className:"flex items-center justify-center py-12",children:[o.jsx(WN,{className:"h-8 w-8 animate-spin text-muted-foreground"}),o.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):b?o.jsx(dt,{className:"p-6",children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(Hc,{className:"h-12 w-12 text-destructive mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:b}),o.jsx(fe,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):U.length===0?o.jsx(dt,{className:"p-6",children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(Rr,{className:"h-12 w-12 text-muted-foreground mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:r||i!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:U.map(R=>o.jsxs(dt,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[o.jsxs(Vt,{children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsx(Gt,{className:"text-xl",children:R.manifest?.name||R.id}),o.jsxs("div",{className:"flex flex-col gap-1",children:[R.manifest?.categories&&R.manifest.categories[0]&&o.jsx(en,{variant:"secondary",className:"text-xs whitespace-nowrap",children:R.manifest.categories[0]}),$(R)]})]}),o.jsx(Jn,{className:"line-clamp-2",children:R.manifest?.description||"无描述"})]}),o.jsx(ln,{className:"flex-1",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(FN,{className:"h-4 w-4"}),o.jsx("span",{children:R.downloads.toLocaleString()})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(z3,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),o.jsx("span",{children:R.rating.toFixed(1)})]})]}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[R.manifest?.keywords&&R.manifest.keywords.slice(0,3).map(F=>o.jsx(en,{variant:"outline",className:"text-xs",children:F},F)),R.manifest?.keywords&&R.manifest.keywords.length>3&&o.jsxs(en,{variant:"outline",className:"text-xs",children:["+",R.manifest.keywords.length-3]})]}),o.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[o.jsxs("div",{children:["v",R.manifest?.version||"unknown"," · ",R.manifest?.author?.name||"Unknown"]}),R.manifest?.host_application&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{children:"支持:"}),o.jsxs("span",{className:"font-medium",children:[R.manifest.host_application.min_version,R.manifest.host_application.max_version?` - ${R.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),o.jsx(L5,{className:"pt-4",children:o.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[o.jsx(fe,{variant:"outline",size:"sm",onClick:()=>n(R),children:"查看详情"}),R.installed?D(R)?o.jsxs(fe,{size:"sm",disabled:!N?.installed,title:N?.installed?void 0:"Git 未安装",onClick:()=>L(R),children:[o.jsx(rl,{className:"h-4 w-4 mr-1"}),"更新"]}):o.jsxs(fe,{variant:"destructive",size:"sm",disabled:!N?.installed,title:N?.installed?void 0:"Git 未安装",onClick:()=>G(R),children:[o.jsx(Ut,{className:"h-4 w-4 mr-1"}),"卸载"]}):o.jsxs(fe,{size:"sm",disabled:!N?.installed||C?.operation==="install"||E!==null&&!z(R),title:N?.installed?E!==null&&!z(R)?`不兼容当前版本 (需要 ${R.manifest?.host_application?.min_version||"未知"}${R.manifest?.host_application?.max_version?` - ${R.manifest.host_application.max_version}`:"+"},当前 ${E?.version})`:void 0:"Git 未安装",onClick:()=>H(R),children:[o.jsx(FN,{className:"h-4 w-4 mr-1"}),C?.operation==="install"&&C?.plugin_id===R.id?"安装中...":"安装"]})]})})]},R.id))}),o.jsx(tr,{open:t!==null,onOpenChange:V,children:t&&t.manifest&&o.jsxs(Un,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsx(Hn,{children:o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"space-y-2 flex-1",children:[o.jsx(Wn,{className:"text-2xl",children:t.manifest.name}),o.jsxs(ur,{children:["作者: ",t.manifest.author?.name||"Unknown",t.manifest.author?.url&&o.jsx("a",{href:t.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:o.jsx(nv,{className:"h-3 w-3 inline"})})]})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[t.manifest.categories&&t.manifest.categories[0]&&o.jsx(en,{variant:"secondary",children:t.manifest.categories[0]}),$(t)]})]})}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"版本"}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",t.manifest?.version||"unknown"]}),t.installed&&t.installed_version&&o.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",t.installed_version]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"下载量"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:t.downloads.toLocaleString()})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"评分"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(z3,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.rating.toFixed(1)," (",t.review_count,")"]})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"许可证"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:t.manifest.license||"Unknown"})]}),o.jsxs("div",{className:"col-span-2",children:[o.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.manifest.host_application?.min_version||"未知",t.manifest.host_application?.max_version?` - ${t.manifest.host_application.max_version}`:" - 最新版本"]})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:t.manifest.keywords&&t.manifest.keywords.map(R=>o.jsx(en,{variant:"outline",children:R},R))})]}),t.detailed_description&&o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),o.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:t.detailed_description})]}),!t.detailed_description&&o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:t.manifest.description||"无描述"})]}),o.jsxs("div",{className:"space-y-2",children:[t.manifest.homepage_url&&o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"font-medium",children:"主页: "}),o.jsx("a",{href:t.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t.manifest.homepage_url})]}),t.manifest.repository_url&&o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"font-medium",children:"仓库: "}),o.jsx("a",{href:t.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t.manifest.repository_url})]})]})]}),o.jsxs(Dr,{children:[t.manifest.homepage_url&&o.jsxs(fe,{onClick:()=>window.open(t.manifest.homepage_url,"_blank"),children:[o.jsx(nv,{className:"h-4 w-4 mr-2"}),"访问主页"]}),t.manifest.repository_url&&o.jsxs(fe,{variant:"outline",onClick:()=>window.open(t.manifest.repository_url,"_blank"),children:[o.jsx(nv,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})]})})}function _Oe(){const e=ia(),{toast:t}=hr(),[n,r]=y.useState([]),[a,i]=y.useState(!0),[l,u]=y.useState(null),[d,f]=y.useState(null),[m,p]=y.useState(!1),[g,x]=y.useState(!1),[j,b]=y.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),w=y.useCallback(async()=>{try{i(!0),u(null);const T=localStorage.getItem("access-token"),P=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${T}`}});if(!P.ok)throw new Error("获取镜像源列表失败");const $=await P.json();r($.mirrors||[])}catch(T){const P=T instanceof Error?T.message:"加载镜像源失败";u(P),t({title:"加载失败",description:P,variant:"destructive"})}finally{i(!1)}},[t]);y.useEffect(()=>{w()},[w]);const N=async()=>{try{const T=localStorage.getItem("access-token"),P=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${T}`,"Content-Type":"application/json"},body:JSON.stringify(j)});if(!P.ok){const $=await P.json();throw new Error($.detail||"添加镜像源失败")}t({title:"添加成功",description:"镜像源已添加"}),p(!1),b({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),w()}catch(T){t({title:"添加失败",description:T instanceof Error?T.message:"未知错误",variant:"destructive"})}},O=async()=>{if(d)try{const T=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${d.id}`,{method:"PUT",headers:{Authorization:`Bearer ${T}`,"Content-Type":"application/json"},body:JSON.stringify({name:j.name,raw_prefix:j.raw_prefix,clone_prefix:j.clone_prefix,enabled:j.enabled,priority:j.priority})})).ok)throw new Error("更新镜像源失败");t({title:"更新成功",description:"镜像源已更新"}),x(!1),f(null),w()}catch(T){t({title:"更新失败",description:T instanceof Error?T.message:"未知错误",variant:"destructive"})}},C=async T=>{if(confirm("确定要删除这个镜像源吗?"))try{const P=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${T}`,{method:"DELETE",headers:{Authorization:`Bearer ${P}`}})).ok)throw new Error("删除镜像源失败");t({title:"删除成功",description:"镜像源已删除"}),w()}catch(P){t({title:"删除失败",description:P instanceof Error?P.message:"未知错误",variant:"destructive"})}},A=async T=>{try{const P=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${T.id}`,{method:"PUT",headers:{Authorization:`Bearer ${P}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!T.enabled})})).ok)throw new Error("更新状态失败");w()}catch(P){t({title:"更新失败",description:P instanceof Error?P.message:"未知错误",variant:"destructive"})}},E=T=>{f(T),b({id:T.id,name:T.name,raw_prefix:T.raw_prefix,clone_prefix:T.clone_prefix,enabled:T.enabled,priority:T.priority}),x(!0)},k=async(T,P)=>{const $=P==="up"?T.priority-1:T.priority+1;if(!($<1))try{const z=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${T.id}`,{method:"PUT",headers:{Authorization:`Bearer ${z}`,"Content-Type":"application/json"},body:JSON.stringify({priority:$})})).ok)throw new Error("更新优先级失败");w()}catch(z){t({title:"更新失败",description:z instanceof Error?z.message:"未知错误",variant:"destructive"})}};return o.jsx(Xt,{className:"h-full",children:o.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(fe,{variant:"ghost",size:"icon",onClick:()=>e({to:"/plugins"}),children:o.jsx(Uq,{className:"h-5 w-5"})}),o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),o.jsxs(fe,{onClick:()=>p(!0),children:[o.jsx(er,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),a?o.jsx(dt,{className:"p-6",children:o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(WN,{className:"h-8 w-8 animate-spin text-primary"})})}):l?o.jsx(dt,{className:"p-6",children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(Hc,{className:"h-12 w-12 text-destructive mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:l}),o.jsx(fe,{onClick:w,children:"重新加载"})]})}):o.jsxs(dt,{children:[o.jsx("div",{className:"hidden md:block",children:o.jsxs(Nl,{children:[o.jsx(Ol,{children:o.jsxs(pn,{children:[o.jsx(Je,{children:"状态"}),o.jsx(Je,{children:"名称"}),o.jsx(Je,{children:"ID"}),o.jsx(Je,{children:"优先级"}),o.jsx(Je,{className:"text-right",children:"操作"})]})}),o.jsx(Cl,{children:n.map(T=>o.jsxs(pn,{children:[o.jsx(Ue,{children:o.jsx(at,{checked:T.enabled,onCheckedChange:()=>A(T)})}),o.jsx(Ue,{children:o.jsxs("div",{children:[o.jsx("div",{className:"font-medium",children:T.name}),o.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",T.raw_prefix]})]})}),o.jsx(Ue,{children:o.jsx(en,{variant:"outline",children:T.id})}),o.jsx(Ue,{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-mono",children:T.priority}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(fe,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>k(T,"up"),disabled:T.priority===1,children:o.jsx(zN,{className:"h-3 w-3"})}),o.jsx(fe,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>k(T,"down"),children:o.jsx(lh,{className:"h-3 w-3"})})]})]})}),o.jsx(Ue,{className:"text-right",children:o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[o.jsx(fe,{variant:"ghost",size:"icon",onClick:()=>E(T),children:o.jsx(Cu,{className:"h-4 w-4"})}),o.jsx(fe,{variant:"ghost",size:"icon",onClick:()=>C(T.id),children:o.jsx(Ut,{className:"h-4 w-4 text-destructive"})})]})})]},T.id))})]})}),o.jsx("div",{className:"md:hidden p-4 space-y-4",children:n.map(T=>o.jsx(dt,{className:"p-4",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between",children:[o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h3",{className:"font-semibold",children:T.name}),T.enabled&&o.jsx(en,{variant:"default",className:"text-xs",children:"启用"})]}),o.jsx(en,{variant:"outline",className:"mt-1 text-xs",children:T.id})]}),o.jsx(at,{checked:T.enabled,onCheckedChange:()=>A(T)})]}),o.jsxs("div",{className:"text-sm space-y-1",children:[o.jsxs("div",{className:"text-muted-foreground",children:[o.jsx("span",{className:"font-medium",children:"Raw: "}),o.jsx("span",{className:"break-all",children:T.raw_prefix})]}),o.jsxs("div",{className:"text-muted-foreground",children:[o.jsx("span",{className:"font-medium",children:"优先级: "}),o.jsx("span",{className:"font-mono",children:T.priority})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[o.jsxs(fe,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>E(T),children:[o.jsx(Cu,{className:"h-4 w-4 mr-1"}),"编辑"]}),o.jsx(fe,{variant:"outline",size:"sm",onClick:()=>k(T,"up"),disabled:T.priority===1,children:o.jsx(zN,{className:"h-4 w-4"})}),o.jsx(fe,{variant:"outline",size:"sm",onClick:()=>k(T,"down"),children:o.jsx(lh,{className:"h-4 w-4"})}),o.jsx(fe,{variant:"destructive",size:"sm",onClick:()=>C(T.id),children:o.jsx(Ut,{className:"h-4 w-4"})})]})]})},T.id))})]}),o.jsx(tr,{open:m,onOpenChange:p,children:o.jsxs(Un,{className:"max-w-lg",children:[o.jsxs(Hn,{children:[o.jsx(Wn,{children:"添加镜像源"}),o.jsx(ur,{children:"添加新的 Git 镜像源配置"})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"add-id",children:"镜像源 ID *"}),o.jsx(Ne,{id:"add-id",placeholder:"例如: my-mirror",value:j.id,onChange:T=>b({...j,id:T.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"add-name",children:"名称 *"}),o.jsx(Ne,{id:"add-name",placeholder:"例如: 我的镜像源",value:j.name,onChange:T=>b({...j,name:T.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),o.jsx(Ne,{id:"add-raw",placeholder:"https://example.com/raw",value:j.raw_prefix,onChange:T=>b({...j,raw_prefix:T.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"add-clone",children:"克隆前缀 *"}),o.jsx(Ne,{id:"add-clone",placeholder:"https://example.com/clone",value:j.clone_prefix,onChange:T=>b({...j,clone_prefix:T.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"add-priority",children:"优先级"}),o.jsx(Ne,{id:"add-priority",type:"number",min:"1",value:j.priority,onChange:T=>b({...j,priority:parseInt(T.target.value)||1})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(at,{id:"add-enabled",checked:j.enabled,onCheckedChange:T=>b({...j,enabled:T})}),o.jsx(J,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),o.jsxs(Dr,{children:[o.jsx(fe,{variant:"outline",onClick:()=>p(!1),children:"取消"}),o.jsx(fe,{onClick:N,children:"添加"})]})]})}),o.jsx(tr,{open:g,onOpenChange:x,children:o.jsxs(Un,{className:"max-w-lg",children:[o.jsxs(Hn,{children:[o.jsx(Wn,{children:"编辑镜像源"}),o.jsx(ur,{children:"修改镜像源配置"})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{children:"镜像源 ID"}),o.jsx(Ne,{value:j.id,disabled:!0})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"edit-name",children:"名称 *"}),o.jsx(Ne,{id:"edit-name",value:j.name,onChange:T=>b({...j,name:T.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),o.jsx(Ne,{id:"edit-raw",value:j.raw_prefix,onChange:T=>b({...j,raw_prefix:T.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"edit-clone",children:"克隆前缀 *"}),o.jsx(Ne,{id:"edit-clone",value:j.clone_prefix,onChange:T=>b({...j,clone_prefix:T.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(J,{htmlFor:"edit-priority",children:"优先级"}),o.jsx(Ne,{id:"edit-priority",type:"number",min:"1",value:j.priority,onChange:T=>b({...j,priority:parseInt(T.target.value)||1})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(at,{id:"edit-enabled",checked:j.enabled,onCheckedChange:T=>b({...j,enabled:T})}),o.jsx(J,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),o.jsxs(Dr,{children:[o.jsx(fe,{variant:"outline",onClick:()=>x(!1),children:"取消"}),o.jsx(fe,{onClick:O,children:"保存"})]})]})})]})})}const NOe=Bh("pointer-events-none inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono font-medium opacity-100",{variants:{size:{sm:"h-5 text-[10px]",default:"h-6 text-xs",lg:"h-7 text-sm"}},defaultVariants:{size:"default"}}),WH=y.forwardRef(({className:e,size:t,abbrTitle:n,children:r,...a},i)=>o.jsx("kbd",{className:ue(NOe({size:t,className:e})),ref:i,...a,children:n?o.jsx("abbr",{title:n,children:r}):r}));WH.displayName="Kbd";const OOe=[{icon:wg,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:WC,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:Xq,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:Hq,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:GC,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:$h,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:Wq,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:Jpe,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:Yq,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:xg,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:Uc,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function COe({open:e,onOpenChange:t}){const[n,r]=y.useState(""),[a,i]=y.useState(0),l=ia(),u=OOe.filter(m=>m.title.toLowerCase().includes(n.toLowerCase())||m.description.toLowerCase().includes(n.toLowerCase())||m.category.toLowerCase().includes(n.toLowerCase()));y.useEffect(()=>{e&&(r(""),i(0))},[e]);const d=y.useCallback(m=>{l({to:m}),t(!1)},[l,t]),f=y.useCallback(m=>{m.key==="ArrowDown"?(m.preventDefault(),i(p=>(p+1)%u.length)):m.key==="ArrowUp"?(m.preventDefault(),i(p=>(p-1+u.length)%u.length)):m.key==="Enter"&&u[a]&&(m.preventDefault(),d(u[a].path))},[u,a,d]);return o.jsx(tr,{open:e,onOpenChange:t,children:o.jsxs(Un,{className:"max-w-2xl p-0 gap-0",children:[o.jsxs(Hn,{className:"px-4 pt-4 pb-0",children:[o.jsx(Wn,{className:"sr-only",children:"搜索"}),o.jsxs("div",{className:"relative",children:[o.jsx(Rr,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),o.jsx(Ne,{value:n,onChange:m=>{r(m.target.value),i(0)},onKeyDown:f,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),o.jsx("div",{className:"border-t",children:o.jsx(Xt,{className:"h-[400px]",children:u.length>0?o.jsx("div",{className:"p-2",children:u.map((m,p)=>{const g=m.icon;return o.jsxs("button",{onClick:()=>d(m.path),onMouseEnter:()=>i(p),className:ue("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",p===a?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[o.jsx(g,{className:"h-5 w-5 flex-shrink-0"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"font-medium text-sm",children:m.title}),o.jsx("div",{className:"text-xs text-muted-foreground truncate",children:m.description})]}),o.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:m.category})]},m.path)})}):o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[o.jsx(Rr,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:n?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),o.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}function EOe(e){const t=AOe(e),n=y.forwardRef((r,a)=>{const{children:i,...l}=r,u=y.Children.toArray(i),d=u.find(kOe);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return o.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return o.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function AOe(e){const t=y.forwardRef((n,r)=>{const{children:a,...i}=n;if(y.isValidElement(a)){const l=MOe(a),u=POe(i,a.props);return a.type!==y.Fragment&&(u.ref=r?Mr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var TOe=Symbol("radix.slottable");function kOe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TOe}function POe(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function MOe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var dO=["Enter"," "],ROe=["ArrowDown","PageUp","Home"],VH=["ArrowUp","PageDown","End"],DOe=[...ROe,...VH],$Oe={ltr:[...dO,"ArrowRight"],rtl:[...dO,"ArrowLeft"]},IOe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Zh="Menu",[vh,LOe,BOe]=_h(Zh),[Tl,GH]=fr(Zh,[BOe,ss,qg]),Qh=ss(),YH=qg(),[KH,fs]=Tl(Zh),[zOe,Jh]=Tl(Zh),XH=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:l=!0}=e,u=Qh(t),[d,f]=y.useState(null),m=y.useRef(!1),p=tn(i),g=$u(a);return y.useEffect(()=>{const x=()=>{m.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>m.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),o.jsx(Uh,{...u,children:o.jsx(KH,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:o.jsx(zOe,{scope:t,onClose:y.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:g,modal:l,children:r})})})};XH.displayName=Zh;var qOe="MenuAnchor",CE=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Qh(n);return o.jsx(Hh,{...a,...r,ref:t})});CE.displayName=qOe;var EE="MenuPortal",[FOe,ZH]=Tl(EE,{forceMount:void 0}),QH=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=fs(EE,t);return o.jsx(FOe,{scope:t,forceMount:n,children:o.jsx(Mn,{present:n||i.open,children:o.jsx(_l,{asChild:!0,container:a,children:r})})})};QH.displayName=EE;var Sa="MenuContent",[UOe,AE]=Tl(Sa),JH=y.forwardRef((e,t)=>{const n=ZH(Sa,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=fs(Sa,e.__scopeMenu),l=Jh(Sa,e.__scopeMenu);return o.jsx(vh.Provider,{scope:e.__scopeMenu,children:o.jsx(Mn,{present:r||i.open,children:o.jsx(vh.Slot,{scope:e.__scopeMenu,children:l.modal?o.jsx(HOe,{...a,ref:t}):o.jsx(WOe,{...a,ref:t})})})})}),HOe=y.forwardRef((e,t)=>{const n=fs(Sa,e.__scopeMenu),r=y.useRef(null),a=qe(t,r);return y.useEffect(()=>{const i=r.current;if(i)return My(i)},[]),o.jsx(TE,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Se(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),WOe=y.forwardRef((e,t)=>{const n=fs(Sa,e.__scopeMenu);return o.jsx(TE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),VOe=EOe("MenuContent.ScrollLock"),TE=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:x,disableOutsideScroll:j,...b}=e,w=fs(Sa,n),N=Jh(Sa,n),O=Qh(n),C=YH(n),A=LOe(n),[E,k]=y.useState(null),T=y.useRef(null),P=qe(t,T,w.onContentChange),$=y.useRef(0),z=y.useRef(""),D=y.useRef(0),U=y.useRef(null),V=y.useRef("right"),H=y.useRef(0),G=j?qh:y.Fragment,L=j?{as:VOe,allowPinchZoom:!0}:void 0,R=K=>{const te=z.current+K,I=A().filter(ee=>!ee.disabled),B=document.activeElement,Y=I.find(ee=>ee.ref.current===B)?.textValue,ne=I.map(ee=>ee.textValue),oe=aCe(ne,te,Y),xe=I.find(ee=>ee.textValue===oe)?.ref.current;(function ee(ae){z.current=ae,window.clearTimeout($.current),ae!==""&&($.current=window.setTimeout(()=>ee(""),1e3))})(te),xe&&setTimeout(()=>xe.focus())};y.useEffect(()=>()=>window.clearTimeout($.current),[]),ky();const F=y.useCallback(K=>V.current===U.current?.side&&oCe(K,U.current?.area),[]);return o.jsx(UOe,{scope:n,searchRef:z,onItemEnter:y.useCallback(K=>{F(K)&&K.preventDefault()},[F]),onItemLeave:y.useCallback(K=>{F(K)||(T.current?.focus(),k(null))},[F]),onTriggerLeave:y.useCallback(K=>{F(K)&&K.preventDefault()},[F]),pointerGraceTimerRef:D,onPointerGraceIntentChange:y.useCallback(K=>{U.current=K},[]),children:o.jsx(G,{...L,children:o.jsx(zh,{asChild:!0,trapped:a,onMountAutoFocus:Se(i,K=>{K.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:o.jsx(Sl,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:x,children:o.jsx(H5,{asChild:!0,...C,dir:N.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:k,onEntryFocus:Se(d,K=>{N.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Fy,{role:"menu","aria-orientation":"vertical","data-state":v9(w.open),"data-radix-menu-content":"",dir:N.dir,...O,...b,ref:P,style:{outline:"none",...b.style},onKeyDown:Se(b.onKeyDown,K=>{const I=K.target.closest("[data-radix-menu-content]")===K.currentTarget,B=K.ctrlKey||K.altKey||K.metaKey,Y=K.key.length===1;I&&(K.key==="Tab"&&K.preventDefault(),!B&&Y&&R(K.key));const ne=T.current;if(K.target!==ne||!DOe.includes(K.key))return;K.preventDefault();const xe=A().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);VH.includes(K.key)&&xe.reverse(),nCe(xe)}),onBlur:Se(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout($.current),z.current="")}),onPointerMove:Se(e.onPointerMove,gh(K=>{const te=K.target,I=H.current!==K.clientX;if(K.currentTarget.contains(te)&&I){const B=K.clientX>H.current?"right":"left";V.current=B,H.current=K.clientX}}))})})})})})})});JH.displayName=Sa;var GOe="MenuGroup",kE=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Me.div,{role:"group",...r,ref:t})});kE.displayName=GOe;var YOe="MenuLabel",e9=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Me.div,{...r,ref:t})});e9.displayName=YOe;var kg="MenuItem",DL="menu.itemSelect",Qy=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=y.useRef(null),l=Jh(kg,e.__scopeMenu),u=AE(kg,e.__scopeMenu),d=qe(t,i),f=y.useRef(!1),m=()=>{const p=i.current;if(!n&&p){const g=new CustomEvent(DL,{bubbles:!0,cancelable:!0});p.addEventListener(DL,x=>r?.(x),{once:!0}),MO(p,g),g.defaultPrevented?f.current=!1:l.onClose()}};return o.jsx(t9,{...a,ref:d,disabled:n,onClick:Se(e.onClick,m),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Se(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Se(e.onKeyDown,p=>{const g=u.searchRef.current!=="";n||g&&p.key===" "||dO.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Qy.displayName=kg;var t9=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,l=AE(kg,n),u=YH(n),d=y.useRef(null),f=qe(t,d),[m,p]=y.useState(!1),[g,x]=y.useState("");return y.useEffect(()=>{const j=d.current;j&&x((j.textContent??"").trim())},[i.children]),o.jsx(vh.ItemSlot,{scope:n,disabled:r,textValue:a??g,children:o.jsx(W5,{asChild:!0,...u,focusable:!r,children:o.jsx(Me.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:f,onPointerMove:Se(e.onPointerMove,gh(j=>{r?l.onItemLeave(j):(l.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(e.onPointerLeave,gh(j=>l.onItemLeave(j))),onFocus:Se(e.onFocus,()=>p(!0)),onBlur:Se(e.onBlur,()=>p(!1))})})})}),KOe="MenuCheckboxItem",n9=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return o.jsx(s9,{scope:e.__scopeMenu,checked:n,children:o.jsx(Qy,{role:"menuitemcheckbox","aria-checked":Pg(n)?"mixed":n,...a,ref:t,"data-state":RE(n),onSelect:Se(a.onSelect,()=>r?.(Pg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});n9.displayName=KOe;var r9="MenuRadioGroup",[XOe,ZOe]=Tl(r9,{value:void 0,onValueChange:()=>{}}),a9=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=tn(r);return o.jsx(XOe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:o.jsx(kE,{...a,ref:t})})});a9.displayName=r9;var i9="MenuRadioItem",o9=y.forwardRef((e,t)=>{const{value:n,...r}=e,a=ZOe(i9,e.__scopeMenu),i=n===a.value;return o.jsx(s9,{scope:e.__scopeMenu,checked:i,children:o.jsx(Qy,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":RE(i),onSelect:Se(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});o9.displayName=i9;var PE="MenuItemIndicator",[s9,QOe]=Tl(PE,{checked:!1}),l9=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=QOe(PE,n);return o.jsx(Mn,{present:r||Pg(i.checked)||i.checked===!0,children:o.jsx(Me.span,{...a,ref:t,"data-state":RE(i.checked)})})});l9.displayName=PE;var JOe="MenuSeparator",c9=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Me.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});c9.displayName=JOe;var eCe="MenuArrow",u9=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Qh(n);return o.jsx(Uy,{...a,...r,ref:t})});u9.displayName=eCe;var ME="MenuSub",[tCe,d9]=Tl(ME),f9=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:a}=e,i=fs(ME,t),l=Qh(t),[u,d]=y.useState(null),[f,m]=y.useState(null),p=tn(a);return y.useEffect(()=>(i.open===!1&&p(!1),()=>p(!1)),[i.open,p]),o.jsx(Uh,{...l,children:o.jsx(KH,{scope:t,open:r,onOpenChange:p,content:f,onContentChange:m,children:o.jsx(tCe,{scope:t,contentId:qn(),triggerId:qn(),trigger:u,onTriggerChange:d,children:n})})})};f9.displayName=ME;var hf="MenuSubTrigger",h9=y.forwardRef((e,t)=>{const n=fs(hf,e.__scopeMenu),r=Jh(hf,e.__scopeMenu),a=d9(hf,e.__scopeMenu),i=AE(hf,e.__scopeMenu),l=y.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=i,f={__scopeMenu:e.__scopeMenu},m=y.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return y.useEffect(()=>m,[m]),y.useEffect(()=>{const p=u.current;return()=>{window.clearTimeout(p),d(null)}},[u,d]),o.jsx(CE,{asChild:!0,...f,children:o.jsx(t9,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":v9(n.open),...e,ref:Mr(t,a.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Se(e.onPointerMove,gh(p=>{i.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Se(e.onPointerLeave,gh(p=>{m();const g=n.content?.getBoundingClientRect();if(g){const x=n.content?.dataset.side,j=x==="right",b=j?-5:5,w=g[j?"left":"right"],N=g[j?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:w,y:g.top},{x:N,y:g.top},{x:N,y:g.bottom},{x:w,y:g.bottom}],side:x}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Se(e.onKeyDown,p=>{const g=i.searchRef.current!=="";e.disabled||g&&p.key===" "||$Oe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});h9.displayName=hf;var m9="MenuSubContent",p9=y.forwardRef((e,t)=>{const n=ZH(Sa,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=fs(Sa,e.__scopeMenu),l=Jh(Sa,e.__scopeMenu),u=d9(m9,e.__scopeMenu),d=y.useRef(null),f=qe(t,d);return o.jsx(vh.Provider,{scope:e.__scopeMenu,children:o.jsx(Mn,{present:r||i.open,children:o.jsx(vh.Slot,{scope:e.__scopeMenu,children:o.jsx(TE,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:f,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{l.isUsingKeyboardRef.current&&d.current?.focus(),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Se(e.onFocusOutside,m=>{m.target!==u.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Se(e.onEscapeKeyDown,m=>{l.onClose(),m.preventDefault()}),onKeyDown:Se(e.onKeyDown,m=>{const p=m.currentTarget.contains(m.target),g=IOe[l.dir].includes(m.key);p&&g&&(i.onOpenChange(!1),u.trigger?.focus(),m.preventDefault())})})})})})});p9.displayName=m9;function v9(e){return e?"open":"closed"}function Pg(e){return e==="indeterminate"}function RE(e){return Pg(e)?"indeterminate":e?"checked":"unchecked"}function nCe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function rCe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function aCe(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=rCe(e,Math.max(i,0));a.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function iCe(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,l=t.length-1;ir!=g>r&&n<(p-f)*(r-m)/(g-m)+f&&(a=!a)}return a}function oCe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return iCe(n,t)}function gh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var sCe=XH,lCe=CE,cCe=QH,uCe=JH,dCe=kE,fCe=e9,hCe=Qy,mCe=n9,pCe=a9,vCe=o9,gCe=l9,yCe=c9,xCe=u9,bCe=f9,wCe=h9,jCe=p9,DE="ContextMenu",[SCe]=fr(DE,[GH]),mr=GH(),[_Ce,g9]=SCe(DE),y9=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:a,modal:i=!0}=e,[l,u]=y.useState(!1),d=mr(t),f=tn(r),m=y.useCallback(p=>{u(p),f(p)},[f]);return o.jsx(_Ce,{scope:t,open:l,onOpenChange:m,modal:i,children:o.jsx(sCe,{...d,dir:a,open:l,onOpenChange:m,modal:i,children:n})})};y9.displayName=DE;var x9="ContextMenuTrigger",b9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...a}=e,i=g9(x9,n),l=mr(n),u=y.useRef({x:0,y:0}),d=y.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),f=y.useRef(0),m=y.useCallback(()=>window.clearTimeout(f.current),[]),p=g=>{u.current={x:g.clientX,y:g.clientY},i.onOpenChange(!0)};return y.useEffect(()=>m,[m]),y.useEffect(()=>void(r&&m()),[r,m]),o.jsxs(o.Fragment,{children:[o.jsx(lCe,{...l,virtualRef:d}),o.jsx(Me.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...a,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Se(e.onContextMenu,g=>{m(),p(g),g.preventDefault()}),onPointerDown:r?e.onPointerDown:Se(e.onPointerDown,Yp(g=>{m(),f.current=window.setTimeout(()=>p(g),700)})),onPointerMove:r?e.onPointerMove:Se(e.onPointerMove,Yp(m)),onPointerCancel:r?e.onPointerCancel:Se(e.onPointerCancel,Yp(m)),onPointerUp:r?e.onPointerUp:Se(e.onPointerUp,Yp(m))})]})});b9.displayName=x9;var NCe="ContextMenuPortal",w9=e=>{const{__scopeContextMenu:t,...n}=e,r=mr(t);return o.jsx(cCe,{...r,...n})};w9.displayName=NCe;var j9="ContextMenuContent",S9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=g9(j9,n),i=mr(n),l=y.useRef(!1);return o.jsx(uCe,{...i,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{e.onCloseAutoFocus?.(u),!u.defaultPrevented&&l.current&&u.preventDefault(),l.current=!1},onInteractOutside:u=>{e.onInteractOutside?.(u),!u.defaultPrevented&&!a.modal&&(l.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});S9.displayName=j9;var OCe="ContextMenuGroup",CCe=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=mr(n);return o.jsx(dCe,{...a,...r,ref:t})});CCe.displayName=OCe;var ECe="ContextMenuLabel",_9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=mr(n);return o.jsx(fCe,{...a,...r,ref:t})});_9.displayName=ECe;var ACe="ContextMenuItem",N9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=mr(n);return o.jsx(hCe,{...a,...r,ref:t})});N9.displayName=ACe;var TCe="ContextMenuCheckboxItem",O9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=mr(n);return o.jsx(mCe,{...a,...r,ref:t})});O9.displayName=TCe;var kCe="ContextMenuRadioGroup",PCe=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=mr(n);return o.jsx(pCe,{...a,...r,ref:t})});PCe.displayName=kCe;var MCe="ContextMenuRadioItem",C9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=mr(n);return o.jsx(vCe,{...a,...r,ref:t})});C9.displayName=MCe;var RCe="ContextMenuItemIndicator",E9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=mr(n);return o.jsx(gCe,{...a,...r,ref:t})});E9.displayName=RCe;var DCe="ContextMenuSeparator",A9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=mr(n);return o.jsx(yCe,{...a,...r,ref:t})});A9.displayName=DCe;var $Ce="ContextMenuArrow",ICe=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=mr(n);return o.jsx(xCe,{...a,...r,ref:t})});ICe.displayName=$Ce;var T9="ContextMenuSub",k9=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:a,defaultOpen:i}=e,l=mr(t),[u,d]=_a({prop:a,defaultProp:i??!1,onChange:r,caller:T9});return o.jsx(bCe,{...l,open:u,onOpenChange:d,children:n})};k9.displayName=T9;var LCe="ContextMenuSubTrigger",P9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=mr(n);return o.jsx(wCe,{...a,...r,ref:t})});P9.displayName=LCe;var BCe="ContextMenuSubContent",M9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=mr(n);return o.jsx(jCe,{...a,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});M9.displayName=BCe;function Yp(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var zCe=y9,qCe=b9,FCe=w9,R9=S9,D9=_9,$9=N9,I9=O9,L9=C9,B9=E9,z9=A9,UCe=k9,q9=P9,F9=M9;const HCe=zCe,WCe=qCe,VCe=UCe,U9=y.forwardRef(({className:e,inset:t,children:n,...r},a)=>o.jsxs(q9,{ref:a,className:ue("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...r,children:[n,o.jsx(HC,{className:"ml-auto h-4 w-4"})]}));U9.displayName=q9.displayName;const H9=y.forwardRef(({className:e,...t},n)=>o.jsx(F9,{ref:n,className:ue("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",e),...t}));H9.displayName=F9.displayName;const W9=y.forwardRef(({className:e,...t},n)=>o.jsx(FCe,{children:o.jsx(R9,{ref:n,className:ue("z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",e),...t})}));W9.displayName=R9.displayName;const Ra=y.forwardRef(({className:e,inset:t,...n},r)=>o.jsx($9,{ref:r,className:ue("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Ra.displayName=$9.displayName;const GCe=y.forwardRef(({className:e,children:t,checked:n,...r},a)=>o.jsxs(I9,{ref:a,className:ue("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(B9,{children:o.jsx(tl,{className:"h-4 w-4"})})}),t]}));GCe.displayName=I9.displayName;const YCe=y.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(L9,{ref:r,className:ue("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(B9,{children:o.jsx(mve,{className:"h-2 w-2 fill-current"})})}),t]}));YCe.displayName=L9.displayName;const KCe=y.forwardRef(({className:e,inset:t,...n},r)=>o.jsx(D9,{ref:r,className:ue("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));KCe.displayName=D9.displayName;const mf=y.forwardRef(({className:e,...t},n)=>o.jsx(z9,{ref:n,className:ue("-mx-1 my-1 h-px bg-border",e),...t}));mf.displayName=z9.displayName;const Rc=({className:e,...t})=>o.jsx("span",{className:ue("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Rc.displayName="ContextMenuShortcut";var XCe=Symbol("radix.slottable");function ZCe(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=XCe,t}var[Jy]=fr("Tooltip",[ss]),ex=ss(),V9="TooltipProvider",QCe=700,fO="tooltip.open",[JCe,$E]=Jy(V9),G9=e=>{const{__scopeTooltip:t,delayDuration:n=QCe,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,l=y.useRef(!0),u=y.useRef(!1),d=y.useRef(0);return y.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),o.jsx(JCe,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:y.useCallback(f=>{u.current=f},[]),disableHoverableContent:a,children:i})};G9.displayName=V9;var yh="Tooltip",[eEe,em]=Jy(yh),Y9=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=e,d=$E(yh,e.__scopeTooltip),f=ex(t),[m,p]=y.useState(null),g=qn(),x=y.useRef(0),j=l??d.disableHoverableContent,b=u??d.delayDuration,w=y.useRef(!1),[N,O]=_a({prop:r,defaultProp:a??!1,onChange:T=>{T?(d.onOpen(),document.dispatchEvent(new CustomEvent(fO))):d.onClose(),i?.(T)},caller:yh}),C=y.useMemo(()=>N?w.current?"delayed-open":"instant-open":"closed",[N]),A=y.useCallback(()=>{window.clearTimeout(x.current),x.current=0,w.current=!1,O(!0)},[O]),E=y.useCallback(()=>{window.clearTimeout(x.current),x.current=0,O(!1)},[O]),k=y.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{w.current=!0,O(!0),x.current=0},b)},[b,O]);return y.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),o.jsx(Uh,{...f,children:o.jsx(eEe,{scope:t,contentId:g,open:N,stateAttribute:C,trigger:m,onTriggerChange:p,onTriggerEnter:y.useCallback(()=>{d.isOpenDelayedRef.current?k():A()},[d.isOpenDelayedRef,k,A]),onTriggerLeave:y.useCallback(()=>{j?E():(window.clearTimeout(x.current),x.current=0)},[E,j]),onOpen:A,onClose:E,disableHoverableContent:j,children:n})})};Y9.displayName=yh;var hO="TooltipTrigger",K9=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=em(hO,n),i=$E(hO,n),l=ex(n),u=y.useRef(null),d=qe(t,u,a.onTriggerChange),f=y.useRef(!1),m=y.useRef(!1),p=y.useCallback(()=>f.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),o.jsx(Hh,{asChild:!0,...l,children:o.jsx(Me.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:Se(e.onPointerMove,g=>{g.pointerType!=="touch"&&!m.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),m.current=!0)}),onPointerLeave:Se(e.onPointerLeave,()=>{a.onTriggerLeave(),m.current=!1}),onPointerDown:Se(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Se(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:Se(e.onBlur,a.onClose),onClick:Se(e.onClick,a.onClose)})})});K9.displayName=hO;var IE="TooltipPortal",[tEe,nEe]=Jy(IE,{forceMount:void 0}),X9=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,i=em(IE,t);return o.jsx(tEe,{scope:t,forceMount:n,children:o.jsx(Mn,{present:n||i.open,children:o.jsx(_l,{asChild:!0,container:a,children:r})})})};X9.displayName=IE;var ku="TooltipContent",Z9=y.forwardRef((e,t)=>{const n=nEe(ku,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,l=em(ku,e.__scopeTooltip);return o.jsx(Mn,{present:r||l.open,children:l.disableHoverableContent?o.jsx(Q9,{side:a,...i,ref:t}):o.jsx(rEe,{side:a,...i,ref:t})})}),rEe=y.forwardRef((e,t)=>{const n=em(ku,e.__scopeTooltip),r=$E(ku,e.__scopeTooltip),a=y.useRef(null),i=qe(t,a),[l,u]=y.useState(null),{trigger:d,onClose:f}=n,m=a.current,{onPointerInTransitChange:p}=r,g=y.useCallback(()=>{u(null),p(!1)},[p]),x=y.useCallback((j,b)=>{const w=j.currentTarget,N={x:j.clientX,y:j.clientY},O=lEe(N,w.getBoundingClientRect()),C=cEe(N,O),A=uEe(b.getBoundingClientRect()),E=fEe([...C,...A]);u(E),p(!0)},[p]);return y.useEffect(()=>()=>g(),[g]),y.useEffect(()=>{if(d&&m){const j=w=>x(w,m),b=w=>x(w,d);return d.addEventListener("pointerleave",j),m.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",j),m.removeEventListener("pointerleave",b)}}},[d,m,x,g]),y.useEffect(()=>{if(l){const j=b=>{const w=b.target,N={x:b.clientX,y:b.clientY},O=d?.contains(w)||m?.contains(w),C=!dEe(N,l);O?g():C&&(g(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,m,l,f,g]),o.jsx(Q9,{...e,ref:i})}),[aEe,iEe]=Jy(yh,{isInside:!1}),oEe=ZCe("TooltipContent"),Q9=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...u}=e,d=em(ku,n),f=ex(n),{onClose:m}=d;return y.useEffect(()=>(document.addEventListener(fO,m),()=>document.removeEventListener(fO,m)),[m]),y.useEffect(()=>{if(d.trigger){const p=g=>{g.target?.contains(d.trigger)&&m()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,m]),o.jsx(Sl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:p=>p.preventDefault(),onDismiss:m,children:o.jsxs(Fy,{"data-state":d.stateAttribute,...f,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(oEe,{children:r}),o.jsx(aEe,{scope:n,isInside:!0,children:o.jsx(uwe,{id:d.contentId,role:"tooltip",children:a||r})})]})})});Z9.displayName=ku;var J9="TooltipArrow",sEe=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=ex(n);return iEe(J9,n).isInside?null:o.jsx(Uy,{...a,...r,ref:t})});sEe.displayName=J9;function lEe(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function cEe(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function uEe(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function dEe(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,l=t.length-1;ir!=g>r&&n<(p-f)*(r-m)/(g-m)+f&&(a=!a)}return a}function fEe(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),hEe(t)}function hEe(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var mEe=G9,pEe=Y9,vEe=K9,gEe=X9,eW=Z9;const yEe=mEe,xEe=pEe,bEe=vEe,tW=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>o.jsx(gEe,{children:o.jsx(eW,{ref:r,sideOffset:t,className:ue("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n})}));tW.displayName=eW.displayName;function wEe({children:e}){Hxe();const[t,n]=y.useState(!0),[r,a]=y.useState(!1),[i,l]=y.useState(!1),{theme:u,setTheme:d}=KC(),f=RY(),m=ia();y.useEffect(()=>{const b=w=>{(w.metaKey||w.ctrlKey)&&w.key==="k"&&(w.preventDefault(),l(!0))};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[]);const p=[{title:"概览",items:[{icon:wg,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:WC,label:"麦麦主程序配置",path:"/config/bot"},{icon:Xq,label:"麦麦模型提供商配置",path:"/config/modelProvider"},{icon:Hq,label:"麦麦模型配置",path:"/config/model"}]},{title:"麦麦资源管理",items:[{icon:GC,label:"表情包管理",path:"/resource/emoji"},{icon:$h,label:"表达方式管理",path:"/resource/expression"},{icon:Wq,label:"人物信息管理",path:"/resource/person"}]},{title:"扩展与监控",items:[{icon:Yq,label:"插件市场",path:"/plugins"},{icon:xg,label:"日志查看器",path:"/logs"}]},{title:"系统",items:[{icon:Uc,label:"系统设置",path:"/settings"}]}],x=u==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":u,j=()=>{localStorage.removeItem("access-token"),m({to:"/auth"})};return o.jsx(yEe,{delayDuration:300,children:o.jsxs("div",{className:"flex h-screen overflow-hidden",children:[o.jsxs("aside",{className:ue("fixed inset-y-0 left-0 z-50 flex flex-col border-r bg-card transition-all duration-300 lg:relative lg:z-0","w-64 lg:w-auto",t?"lg:w-64":"lg:w-16",r?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[o.jsx("div",{className:"flex h-16 items-center border-b px-4",children:o.jsxs("div",{className:ue("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!t&&"lg:flex-none lg:w-8"),children:[o.jsxs("div",{className:ue("flex items-baseline gap-2",!t&&"lg:hidden"),children:[o.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),o.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:nye()})]}),!t&&o.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),o.jsx("nav",{className:"flex-1 overflow-y-auto p-4",children:o.jsx("ul",{className:ue("space-y-6",!t&&"lg:space-y-3"),children:p.map((b,w)=>o.jsxs("li",{children:[o.jsx("div",{className:ue("px-3 h-[1.25rem]","mb-2",!t&&"lg:mb-1 lg:invisible"),children:o.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:b.title})}),!t&&w>0&&o.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),o.jsx("ul",{className:"space-y-1",children:b.items.map(N=>{const O=f({to:N.path}),C=N.icon,A=o.jsxs(o.Fragment,{children:[O&&o.jsx("div",{className:"absolute left-0 top-1/2 h-8 w-1 -translate-y-1/2 rounded-r-full bg-primary transition-opacity duration-300"}),o.jsxs("div",{className:ue("flex items-center transition-all duration-300",t?"gap-3":"lg:gap-0"),children:[o.jsx(C,{className:ue("h-5 w-5 flex-shrink-0",O&&"text-primary"),strokeWidth:2,fill:"none"}),o.jsx("span",{className:ue("text-sm font-medium whitespace-nowrap transition-all duration-300",O&&"font-semibold",t?"opacity-100 max-w-[200px]":"lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:N.label})]})]});return o.jsx("li",{className:"relative",children:o.jsxs(xEe,{children:[o.jsx(bEe,{asChild:!0,children:o.jsx(OO,{to:N.path,className:ue("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",O?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",t?"px-3":"lg:px-0 lg:justify-center"),onClick:()=>a(!1),children:A})}),!t&&o.jsx(tW,{side:"right",className:"hidden lg:block",children:o.jsx("p",{children:N.label})})]})},N.path)})})]},b.title))})})]}),r&&o.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>a(!1)}),o.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[o.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-card/80 backdrop-blur-md px-4 sticky top-0 z-10",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("button",{onClick:()=>a(!r),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:o.jsx(Bve,{className:"h-5 w-5"})}),o.jsx("button",{onClick:()=>n(!t),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:t?"收起侧边栏":"展开侧边栏",children:o.jsx(UC,{className:ue("h-5 w-5 transition-transform",!t&&"rotate-180")})})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{onClick:()=>l(!0),className:"relative hidden md:flex items-center w-64 h-9 pl-9 pr-16 bg-background/50 border rounded-md hover:bg-accent/50 transition-colors text-left",children:[o.jsx(Rr,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),o.jsxs(WH,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[o.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),o.jsx(COe,{open:i,onOpenChange:l}),o.jsxs(fe,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[o.jsx(Gpe,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),o.jsx("button",{onClick:b=>{Lge(x==="dark"?"light":"dark",d,b)},className:"rounded-lg p-2 hover:bg-accent",title:x==="dark"?"切换到浅色模式":"切换到深色模式",children:x==="dark"?o.jsx(GN,{className:"h-5 w-5"}):o.jsx(VN,{className:"h-5 w-5"})}),o.jsx("div",{className:"h-6 w-px bg-border"}),o.jsxs(fe,{variant:"ghost",size:"sm",onClick:j,className:"gap-2",title:"登出系统",children:[o.jsx(B3,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),o.jsxs(HCe,{children:[o.jsx(WCe,{asChild:!0,children:o.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:e})}),o.jsxs(W9,{className:"w-64",children:[o.jsxs(Ra,{onClick:()=>m({to:"/"}),children:[o.jsx(wg,{className:"mr-2 h-4 w-4"}),"首页"]}),o.jsxs(Ra,{onClick:()=>m({to:"/settings"}),children:[o.jsx(Uc,{className:"mr-2 h-4 w-4"}),"系统设置"]}),o.jsxs(Ra,{onClick:()=>m({to:"/logs"}),children:[o.jsx(xg,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),o.jsx(mf,{}),o.jsxs(VCe,{children:[o.jsxs(U9,{children:[o.jsx(Kq,{className:"mr-2 h-4 w-4"}),"切换主题"]}),o.jsxs(H9,{className:"w-48",children:[o.jsxs(Ra,{onClick:()=>d("light"),disabled:u==="light",children:[o.jsx(GN,{className:"mr-2 h-4 w-4"}),"浅色",u==="light"&&o.jsx(Rc,{children:"✓"})]}),o.jsxs(Ra,{onClick:()=>d("dark"),disabled:u==="dark",children:[o.jsx(VN,{className:"mr-2 h-4 w-4"}),"深色",u==="dark"&&o.jsx(Rc,{children:"✓"})]}),o.jsxs(Ra,{onClick:()=>d("system"),disabled:u==="system",children:[o.jsx(Uc,{className:"mr-2 h-4 w-4"}),"跟随系统",u==="system"&&o.jsx(Rc,{children:"✓"})]})]})]}),o.jsx(mf,{}),o.jsxs(Ra,{onClick:()=>window.location.reload(),children:[o.jsx(ege,{className:"mr-2 h-4 w-4"}),"刷新页面",o.jsx(Rc,{children:"⌘R"})]}),o.jsxs(Ra,{onClick:()=>l(!0),children:[o.jsx(Rr,{className:"mr-2 h-4 w-4"}),"搜索",o.jsx(Rc,{children:"⌘K"})]}),o.jsx(mf,{}),o.jsxs(Ra,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[o.jsx(nv,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),o.jsx(mf,{}),o.jsxs(Ra,{onClick:j,className:"text-destructive focus:text-destructive",children:[o.jsx(B3,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}const tm=NY({component:()=>o.jsxs(o.Fragment,{children:[o.jsx(CO,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!l8())throw qL({to:"/auth"})}}),jEe=dr({getParentRoute:()=>tm,path:"/auth",component:Wxe}),SEe=dr({getParentRoute:()=>tm,path:"/setup",component:bbe}),Ea=dr({getParentRoute:()=>tm,id:"protected",component:()=>o.jsx(wEe,{children:o.jsx(CO,{})})}),_Ee=dr({getParentRoute:()=>Ea,path:"/",component:$ge}),NEe=dr({getParentRoute:()=>Ea,path:"/config/bot",component:cje}),OEe=dr({getParentRoute:()=>Ea,path:"/config/modelProvider",component:Aje}),CEe=dr({getParentRoute:()=>Ea,path:"/config/model",component:r1e}),EEe=dr({getParentRoute:()=>Ea,path:"/resource/emoji",component:d1e}),AEe=dr({getParentRoute:()=>Ea,path:"/resource/expression",component:b1e}),TEe=dr({getParentRoute:()=>Ea,path:"/resource/person",component:A1e}),kEe=dr({getParentRoute:()=>Ea,path:"/logs",component:uOe}),PEe=dr({getParentRoute:()=>Ea,path:"/plugins",component:SOe}),MEe=dr({getParentRoute:()=>Ea,path:"/plugin-mirrors",component:_Oe}),REe=dr({getParentRoute:()=>Ea,path:"/settings",component:Ixe}),DEe=dr({getParentRoute:()=>tm,path:"*",component:g8}),$Ee=tm.addChildren([jEe,SEe,Ea.addChildren([_Ee,NEe,OEe,CEe,EEe,AEe,TEe,PEe,MEe,kEe,REe]),DEe]),IEe=DY({routeTree:$Ee,defaultNotFoundComponent:g8});function LEe({children:e,defaultTheme:t="system",storageKey:n="ui-theme",...r}){const[a,i]=y.useState(()=>localStorage.getItem(n)||t);y.useEffect(()=>{const u=window.document.documentElement;if(u.classList.remove("light","dark"),a==="system"){const d=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";u.classList.add(d);return}u.classList.add(a)},[a]),y.useEffect(()=>{const u=localStorage.getItem("accent-color");if(u){const d=document.documentElement,m={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%"},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%"},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%"},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%"},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%"}}[u];m&&d.style.setProperty("--primary",m.hsl)}},[]);const l={theme:a,setTheme:u=>{localStorage.setItem(n,u),i(u)}};return o.jsx(Jq.Provider,{...r,value:l,children:e})}function BEe({children:e,defaultEnabled:t=!0,defaultWavesEnabled:n=!0,storageKey:r="enable-animations",wavesStorageKey:a="enable-waves-background"}){const[i,l]=y.useState(()=>{const m=localStorage.getItem(r);return m!==null?m==="true":t}),[u,d]=y.useState(()=>{const m=localStorage.getItem(a);return m!==null?m==="true":n});y.useEffect(()=>{const m=document.documentElement;i?m.classList.remove("no-animations"):m.classList.add("no-animations"),localStorage.setItem(r,String(i))},[i,r]),y.useEffect(()=>{localStorage.setItem(a,String(u))},[u,a]);const f={enableAnimations:i,setEnableAnimations:l,enableWavesBackground:u,setEnableWavesBackground:d};return o.jsx(eF.Provider,{value:f,children:e})}var LE="ToastProvider",[BE,zEe,qEe]=_h("Toast"),[nW]=fr("Toast",[qEe]),[FEe,tx]=nW(LE),rW=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:l}=e,[u,d]=y.useState(null),[f,m]=y.useState(0),p=y.useRef(!1),g=y.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${LE}\`. Expected non-empty \`string\`.`),o.jsx(BE.Provider,{scope:t,children:o.jsx(FEe,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:i,toastCount:f,viewport:u,onViewportChange:d,onToastAdd:y.useCallback(()=>m(x=>x+1),[]),onToastRemove:y.useCallback(()=>m(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:g,children:l})})};rW.displayName=LE;var aW="ToastViewport",UEe=["F8"],mO="toast.viewportPause",pO="toast.viewportResume",iW=y.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=UEe,label:a="Notifications ({hotkey})",...i}=e,l=tx(aW,n),u=zEe(n),d=y.useRef(null),f=y.useRef(null),m=y.useRef(null),p=y.useRef(null),g=qe(t,p,l.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=l.toastCount>0;y.useEffect(()=>{const w=N=>{r.length!==0&&r.every(C=>N[C]||N.code===C)&&p.current?.focus()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[r]),y.useEffect(()=>{const w=d.current,N=p.current;if(j&&w&&N){const O=()=>{if(!l.isClosePausedRef.current){const k=new CustomEvent(mO);N.dispatchEvent(k),l.isClosePausedRef.current=!0}},C=()=>{if(l.isClosePausedRef.current){const k=new CustomEvent(pO);N.dispatchEvent(k),l.isClosePausedRef.current=!1}},A=k=>{!w.contains(k.relatedTarget)&&C()},E=()=>{w.contains(document.activeElement)||C()};return w.addEventListener("focusin",O),w.addEventListener("focusout",A),w.addEventListener("pointermove",O),w.addEventListener("pointerleave",E),window.addEventListener("blur",O),window.addEventListener("focus",C),()=>{w.removeEventListener("focusin",O),w.removeEventListener("focusout",A),w.removeEventListener("pointermove",O),w.removeEventListener("pointerleave",E),window.removeEventListener("blur",O),window.removeEventListener("focus",C)}}},[j,l.isClosePausedRef]);const b=y.useCallback(({tabbingDirection:w})=>{const O=u().map(C=>{const A=C.ref.current,E=[A,...nAe(A)];return w==="forwards"?E:E.reverse()});return(w==="forwards"?O.reverse():O).flat()},[u]);return y.useEffect(()=>{const w=p.current;if(w){const N=O=>{const C=O.altKey||O.ctrlKey||O.metaKey;if(O.key==="Tab"&&!C){const E=document.activeElement,k=O.shiftKey;if(O.target===w&&k){f.current?.focus();return}const $=b({tabbingDirection:k?"backwards":"forwards"}),z=$.findIndex(D=>D===E);o_($.slice(z+1))?O.preventDefault():k?f.current?.focus():m.current?.focus()}};return w.addEventListener("keydown",N),()=>w.removeEventListener("keydown",N)}},[u,b]),o.jsxs(dye,{ref:d,role:"region","aria-label":a.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&o.jsx(vO,{ref:f,onFocusFromOutsideViewport:()=>{const w=b({tabbingDirection:"forwards"});o_(w)}}),o.jsx(BE.Slot,{scope:n,children:o.jsx(Me.ol,{tabIndex:-1,...i,ref:g})}),j&&o.jsx(vO,{ref:m,onFocusFromOutsideViewport:()=>{const w=b({tabbingDirection:"backwards"});o_(w)}})]})});iW.displayName=aW;var oW="ToastFocusProxy",vO=y.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=tx(oW,n);return o.jsx(Hy,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:l=>{const u=l.relatedTarget;!i.viewport?.contains(u)&&r()}})});vO.displayName=oW;var nm="Toast",HEe="toast.swipeStart",WEe="toast.swipeMove",VEe="toast.swipeCancel",GEe="toast.swipeEnd",sW=y.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...l}=e,[u,d]=_a({prop:r,defaultProp:a??!0,onChange:i,caller:nm});return o.jsx(Mn,{present:n||u,children:o.jsx(XEe,{open:u,...l,ref:t,onClose:()=>d(!1),onPause:tn(e.onPause),onResume:tn(e.onResume),onSwipeStart:Se(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Se(e.onSwipeMove,f=>{const{x:m,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:Se(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Se(e.onSwipeEnd,f=>{const{x:m,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),d(!1)})})})});sW.displayName=nm;var[YEe,KEe]=nW(nm,{onClose(){}}),XEe=y.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:i,onClose:l,onEscapeKeyDown:u,onPause:d,onResume:f,onSwipeStart:m,onSwipeMove:p,onSwipeCancel:g,onSwipeEnd:x,...j}=e,b=tx(nm,n),[w,N]=y.useState(null),O=qe(t,H=>N(H)),C=y.useRef(null),A=y.useRef(null),E=a||b.duration,k=y.useRef(0),T=y.useRef(E),P=y.useRef(0),{onToastAdd:$,onToastRemove:z}=b,D=tn(()=>{w?.contains(document.activeElement)&&b.viewport?.focus(),l()}),U=y.useCallback(H=>{!H||H===1/0||(window.clearTimeout(P.current),k.current=new Date().getTime(),P.current=window.setTimeout(D,H))},[D]);y.useEffect(()=>{const H=b.viewport;if(H){const G=()=>{U(T.current),f?.()},L=()=>{const R=new Date().getTime()-k.current;T.current=T.current-R,window.clearTimeout(P.current),d?.()};return H.addEventListener(mO,L),H.addEventListener(pO,G),()=>{H.removeEventListener(mO,L),H.removeEventListener(pO,G)}}},[b.viewport,E,d,f,U]),y.useEffect(()=>{i&&!b.isClosePausedRef.current&&U(E)},[i,E,b.isClosePausedRef,U]),y.useEffect(()=>($(),()=>z()),[$,z]);const V=y.useMemo(()=>w?mW(w):null,[w]);return b.viewport?o.jsxs(o.Fragment,{children:[V&&o.jsx(ZEe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:V}),o.jsx(YEe,{scope:n,onClose:D,children:gl.createPortal(o.jsx(BE.ItemSlot,{scope:n,children:o.jsx(uye,{asChild:!0,onEscapeKeyDown:Se(u,()=>{b.isFocusedToastEscapeKeyDownRef.current||D(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.jsx(Me.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":b.swipeDirection,...j,ref:O,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Se(e.onKeyDown,H=>{H.key==="Escape"&&(u?.(H.nativeEvent),H.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:Se(e.onPointerDown,H=>{H.button===0&&(C.current={x:H.clientX,y:H.clientY})}),onPointerMove:Se(e.onPointerMove,H=>{if(!C.current)return;const G=H.clientX-C.current.x,L=H.clientY-C.current.y,R=!!A.current,F=["left","right"].includes(b.swipeDirection),K=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,te=F?K(0,G):0,I=F?0:K(0,L),B=H.pointerType==="touch"?10:2,Y={x:te,y:I},ne={originalEvent:H,delta:Y};R?(A.current=Y,Kp(WEe,p,ne,{discrete:!1})):$L(Y,b.swipeDirection,B)?(A.current=Y,Kp(HEe,m,ne,{discrete:!1}),H.target.setPointerCapture(H.pointerId)):(Math.abs(G)>B||Math.abs(L)>B)&&(C.current=null)}),onPointerUp:Se(e.onPointerUp,H=>{const G=A.current,L=H.target;if(L.hasPointerCapture(H.pointerId)&&L.releasePointerCapture(H.pointerId),A.current=null,C.current=null,G){const R=H.currentTarget,F={originalEvent:H,delta:G};$L(G,b.swipeDirection,b.swipeThreshold)?Kp(GEe,x,F,{discrete:!0}):Kp(VEe,g,F,{discrete:!0}),R.addEventListener("click",K=>K.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),ZEe=e=>{const{__scopeToast:t,children:n,...r}=e,a=tx(nm,t),[i,l]=y.useState(!1),[u,d]=y.useState(!1);return eAe(()=>l(!0)),y.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),u?null:o.jsx(_l,{asChild:!0,children:o.jsx(Hy,{...r,children:i&&o.jsxs(o.Fragment,{children:[a.label," ",n]})})})},QEe="ToastTitle",lW=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return o.jsx(Me.div,{...r,ref:t})});lW.displayName=QEe;var JEe="ToastDescription",cW=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return o.jsx(Me.div,{...r,ref:t})});cW.displayName=JEe;var uW="ToastAction",dW=y.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?o.jsx(hW,{altText:n,asChild:!0,children:o.jsx(zE,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${uW}\`. Expected non-empty \`string\`.`),null)});dW.displayName=uW;var fW="ToastClose",zE=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=KEe(fW,n);return o.jsx(hW,{asChild:!0,children:o.jsx(Me.button,{type:"button",...r,ref:t,onClick:Se(e.onClick,a.onClose)})})});zE.displayName=fW;var hW=y.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return o.jsx(Me.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function mW(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),tAe(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const l=r.dataset.radixToastAnnounceAlt;l&&t.push(l)}else t.push(...mW(r))}}),t}function Kp(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?MO(a,i):a.dispatchEvent(i)}var $L=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),i=r>a;return t==="left"||t==="right"?i&&r>n:!i&&a>n};function eAe(e=()=>{}){const t=tn(e);Fn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function tAe(e){return e.nodeType===e.ELEMENT_NODE}function nAe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function o_(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var rAe=rW,pW=iW,vW=sW,gW=lW,yW=cW,xW=dW,bW=zE;const aAe=rAe,wW=y.forwardRef(({className:e,...t},n)=>o.jsx(pW,{ref:n,className:ue("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));wW.displayName=pW.displayName;const iAe=Bh("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),jW=y.forwardRef(({className:e,variant:t,...n},r)=>o.jsx(vW,{ref:r,className:ue(iAe({variant:t}),e),...n}));jW.displayName=vW.displayName;const oAe=y.forwardRef(({className:e,...t},n)=>o.jsx(xW,{ref:n,className:ue("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));oAe.displayName=xW.displayName;const SW=y.forwardRef(({className:e,...t},n)=>o.jsx(bW,{ref:n,className:ue("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:o.jsx(Ih,{className:"h-4 w-4"})}));SW.displayName=bW.displayName;const _W=y.forwardRef(({className:e,...t},n)=>o.jsx(gW,{ref:n,className:ue("text-sm font-semibold [&+div]:text-xs",e),...t}));_W.displayName=gW.displayName;const NW=y.forwardRef(({className:e,...t},n)=>o.jsx(yW,{ref:n,className:ue("text-sm opacity-90",e),...t}));NW.displayName=yW.displayName;function sAe(){const{toasts:e}=hr();return o.jsxs(aAe,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return o.jsxs(jW,{...i,children:[o.jsxs("div",{className:"grid gap-1",children:[n&&o.jsx(_W,{children:n}),r&&o.jsx(NW,{children:r})]}),a,o.jsx(SW,{})]},t)}),o.jsx(wW,{})]})}GV.createRoot(document.getElementById("root")).render(o.jsx(y.StrictMode,{children:o.jsx(LEe,{defaultTheme:"system",children:o.jsxs(BEe,{children:[o.jsx(LY,{router:IEe}),o.jsx(sAe,{})]})})})); diff --git a/webui/dist/assets/index-DCgZlSpL.css b/webui/dist/assets/index-DCgZlSpL.css new file mode 100644 index 00000000..b6e30571 --- /dev/null +++ b/webui/dist/assets/index-DCgZlSpL.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 221.2 83.2% 53.3%;--primary-foreground: 210 40% 98%;--primary-gradient: none;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 221.2 83.2% 53.3%;--radius: .5rem;--chart-1: 221.2 83.2% 53.3%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 217.2 91.2% 59.8%;--primary-foreground: 222.2 47.4% 11.2%;--primary-gradient: none;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 224.3 76.3% 48%;--chart-1: 217.2 91.2% 59.8%;--chart-2: 160 60% 50%;--chart-3: 30 80% 60%;--chart-4: 280 65% 65%;--chart-5: 340 75% 60%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-1\/4{bottom:25%}.bottom-4{bottom:1rem}.left-0{left:0}.left-1\/2{left:50%}.left-1\/4{left:25%}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-1\/4{right:25%}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-2{top:.5rem}.top-2\.5{top:.625rem}.top-3{top:.75rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.order-1{order:1}.order-2{order:2}.col-span-2{grid-column:span 2 / span 2}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.-mt-2{margin-top:-.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-4{width:1rem;height:1rem}.size-\[--cell-size\]{width:var(--cell-size);height:var(--cell-size)}.h-0\.5{height:.125rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[--cell-size\]{height:var(--cell-size)}.h-\[1\.25rem\]{height:1.25rem}.h-\[1px\]{height:1px}.h-\[250px\]{height:250px}.h-\[300px\]{height:300px}.h-\[400px\]{height:400px}.h-\[calc\(100vh-200px\)\]{height:calc(100vh - 200px)}.h-\[calc\(100vh-240px\)\]{height:calc(100vh - 240px)}.h-\[calc\(100vh-260px\)\]{height:calc(100vh - 260px)}.h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.h-\[calc\(100vh-500px\)\]{height:calc(100vh - 500px)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\[--radix-context-menu-content-available-height\]{max-height:var(--radix-context-menu-content-available-height)}.max-h-\[--radix-select-content-available-height\]{max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(90vh-120px\)\]{max-height:calc(90vh - 120px)}.max-h-screen{max-height:100vh}.min-h-10{min-height:2.5rem}.min-h-\[100px\]{min-height:100px}.min-h-\[300px\]{min-height:300px}.min-h-\[60px\]{min-height:60px}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[--cell-size\]{width:var(--cell-size)}.w-\[120px\]{width:120px}.w-\[140px\]{width:140px}.w-\[1px\]{width:1px}.w-\[70px\]{width:70px}.w-\[95vw\]{width:95vw}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[--cell-size\]{min-width:var(--cell-size)}.min-w-\[80px\]{min-width:80px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-\[200px\]{max-width:200px}.max-w-\[60px\]{max-width:60px}.max-w-\[95vw\]{max-width:95vw}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\[--radix-context-menu-content-transform-origin\]{transform-origin:var(--radix-context-menu-content-transform-origin)}.origin-\[--radix-popover-content-transform-origin\]{transform-origin:var(--radix-popover-content-transform-origin)}.origin-\[--radix-select-content-transform-origin\]{transform-origin:var(--radix-select-content-transform-origin)}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-\[1\.5px\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[--color-border\]{border-color:var(--color-border)}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-current{border-color:currentColor}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-orange-600{--tw-border-opacity: 1;border-color:rgb(234 88 12 / var(--tw-border-opacity, 1))}.border-primary{border-color:hsl(var(--primary))}.border-primary\/20{border-color:hsl(var(--primary) / .2)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-background\/50{background-color:hsl(var(--background) / .5)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-card\/80{background-color:hsl(var(--card) / .8)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-600\/20{background-color:#dc262633}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/5{background-color:hsl(var(--secondary) / .05)}.bg-secondary\/50{background-color:hsl(var(--secondary) / .5)}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-300{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.bg-slate-400{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-500{--tw-gradient-from: #6366f1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(99 102 241 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-500{--tw-gradient-from: #f97316 var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/5{--tw-gradient-from: hsl(var(--primary) / .05) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-200{--tw-gradient-from: #e2e8f0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(226 232 240 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-300{--tw-gradient-from: #cbd5e1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(203 213 225 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-400{--tw-gradient-from: #94a3b8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(148 163 184 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-background{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background)) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-cyan-500{--tw-gradient-to: #06b6d4 var(--tw-gradient-to-position)}.to-emerald-500{--tw-gradient-to: #10b981 var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position)}.to-purple-500{--tw-gradient-to: #a855f7 var(--tw-gradient-to-position)}.to-secondary\/5{--tw-gradient-to: hsl(var(--secondary) / .05) var(--tw-gradient-to-position)}.to-slate-700{--tw-gradient-to: #334155 var(--tw-gradient-to-position)}.to-slate-800{--tw-gradient-to: #1e293b var(--tw-gradient-to-position)}.to-slate-900{--tw-gradient-to: #0f172a var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-yellow-400{fill:#facc15}.p-0{padding:0}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[--cell-size\]{padding-left:var(--cell-size);padding-right:var(--cell-size)}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pl-10{padding-left:2.5rem}.pl-11{padding-left:2.75rem}.pl-2{padding-left:.5rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-10{padding-right:2.5rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-6{padding-right:1.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.text-\[150px\]{font-size:150px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/60{color:hsl(var(--muted-foreground) / .6)}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-orange-900{--tw-text-opacity: 1;color:rgb(124 45 18 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/10{color:hsl(var(--primary) / .1)}.text-primary\/30{color:hsl(var(--primary) / .3)}.text-primary\/60{color:hsl(var(--primary) / .6)}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--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(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-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-xl{--tw-backdrop-blur: blur(24px);-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,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.text-primary-gradient{color:hsl(var(--primary))}.has-gradient .text-primary-gradient{background:var(--primary-gradient);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}.\[--cell-size\:2rem\]{--cell-size: 2rem}.no-animations *,.no-animations *:before,.no-animations *:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.no-animations *:hover{transition-duration:.01ms!important}::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}::view-transition-old(root){z-index:1}::view-transition-new(root){z-index:999}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:border-primary\/50:hover{border-color:hsl(var(--primary) / .5)}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-accent\/50:hover{background-color:hsl(var(--accent) / .5)}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-white\/5:hover{background-color:#ffffff0d}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-green-700:hover{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.hover\:text-orange-700:hover{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-gray-100:focus{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--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, 0 0 #0000)}.focus\:ring-2:focus{--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, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--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(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-1:focus-visible{--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, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--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, 0 0 #0000)}.focus-visible\:ring-red-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[range-end\=true\]\:rounded-md[data-range-end=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-middle\=true\]\:rounded-none[data-range-middle=true]{border-radius:0}.data-\[range-start\=true\]\:rounded-md[data-range-start=true]{border-radius:calc(var(--radius) - 2px)}.data-\[selected\=true\]\:rounded-none[data-selected=true]{border-radius:0}.data-\[range-end\=true\]\:bg-primary[data-range-end=true]{background-color:hsl(var(--primary))}.data-\[range-middle\=true\]\:bg-accent[data-range-middle=true]{background-color:hsl(var(--accent))}.data-\[range-start\=true\]\:bg-primary[data-range-start=true],.data-\[selected-single\=true\]\:bg-primary[data-selected-single=true]{background-color:hsl(var(--primary))}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:hsl(var(--muted-foreground))}.data-\[range-end\=true\]\:text-primary-foreground[data-range-end=true]{color:hsl(var(--primary-foreground))}.data-\[range-middle\=true\]\:text-accent-foreground[data-range-middle=true]{color:hsl(var(--accent-foreground))}.data-\[range-start\=true\]\:text-primary-foreground[data-range-start=true],.data-\[selected-single\=true\]\:text-primary-foreground[data-selected-single=true]{color:hsl(var(--primary-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=active\]\:duration-300[data-state=active]{transition-duration:.3s}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:relative{position:relative}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:z-10{z-index:10}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:border-ring{border-color:hsl(var(--ring))}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-\[3px\]{--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(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-ring\/50{--tw-ring-color: hsl(var(--ring) / .5)}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:border-gray-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity, 1))}.dark\:border-yellow-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(113 63 18 / var(--tw-border-opacity, 1))}.dark\:bg-blue-500\/20:is(.dark *){background-color:#3b82f633}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950\/20:is(.dark *){background-color:#17255433}.dark\:bg-blue-950\/30:is(.dark *){background-color:#1725544d}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-orange-950\/20:is(.dark *){background-color:#43140733}.dark\:bg-red-500\/20:is(.dark *){background-color:#ef444433}.dark\:bg-red-600\/30:is(.dark *){background-color:#dc26264d}.dark\:bg-red-950\/50:is(.dark *){background-color:#450a0a80}.dark\:bg-yellow-500\/20:is(.dark *){background-color:#eab30833}.dark\:bg-yellow-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity, 1))}.dark\:bg-yellow-950\/30:is(.dark *){background-color:#4220064d}.dark\:text-blue-100:is(.dark *){--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-cyan-500:is(.dark *){--tw-text-opacity: 1;color:rgb(6 182 212 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-orange-100:is(.dark *){--tw-text-opacity: 1;color:rgb(255 237 213 / var(--tw-text-opacity, 1))}.dark\:text-orange-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 215 170 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-yellow-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-500:is(.dark *){--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:focus\:bg-gray-800:focus:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}@media(min-width:640px){.sm\:bottom-0{bottom:0}.sm\:right-0{right:0}.sm\:right-2{right:.5rem}.sm\:right-3{right:.75rem}.sm\:top-2{top:.5rem}.sm\:top-3{top:.75rem}.sm\:top-auto{top:auto}.sm\:order-1{order:1}.sm\:order-2{order:2}.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mb-3{margin-bottom:.75rem}.sm\:mb-4{margin-bottom:1rem}.sm\:mr-2{margin-right:.5rem}.sm\:mt-0{margin-top:0}.sm\:mt-2{margin-top:.5rem}.sm\:mt-3{margin-top:.75rem}.sm\:mt-6{margin-top:1.5rem}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-12{height:3rem}.sm\:h-2{height:.5rem}.sm\:h-24{height:6rem}.sm\:h-3{height:.75rem}.sm\:h-4{height:1rem}.sm\:h-\[300px\]{height:300px}.sm\:h-\[400px\]{height:400px}.sm\:h-\[500px\]{height:500px}.sm\:h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.sm\:h-\[calc\(100vh-320px\)\]{height:calc(100vh - 320px)}.sm\:w-10{width:2.5rem}.sm\:w-2{width:.5rem}.sm\:w-24{width:6rem}.sm\:w-3{width:.75rem}.sm\:w-4{width:1rem}.sm\:w-\[140px\]{width:140px}.sm\:w-\[160px\]{width:160px}.sm\:w-\[200px\]{width:200px}.sm\:w-\[500px\]{width:500px}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:max-w-2xl{max-width:42rem}.sm\:max-w-\[900px\]{max-width:900px}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:flex-1{flex:1 1 0%}.sm\:flex-none{flex:none}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-col{flex-direction:column}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-0{gap:0px}.sm\:gap-1{gap:.25rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-6{gap:1.5rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.sm\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.sm\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.sm\:space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-3{padding:.75rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:text-left{text-align:left}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\:text-\[200px\]{font-size:200px}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:768px){.md\:top-4{top:1rem}.md\:mb-6{margin-bottom:1.5rem}.md\:mb-8{margin-bottom:2rem}.md\:mt-8{margin-top:2rem}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-16{height:4rem}.md\:h-4{height:1rem}.md\:h-8{height:2rem}.md\:h-96{height:24rem}.md\:h-\[500px\]{height:500px}.md\:min-h-\[400px\]{min-height:400px}.md\:w-16{width:4rem}.md\:w-4{width:1rem}.md\:w-8{width:2rem}.md\:w-96{width:24rem}.md\:max-w-\[420px\]{max-width:420px}.md\:max-w-none{max-width:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-2{gap:.5rem}.md\:whitespace-normal{white-space:normal}.md\:p-6{padding:1.5rem}.md\:p-8{padding:2rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-base{font-size:1rem;line-height:1.5rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:1024px){.lg\:invisible{visibility:hidden}.lg\:relative{position:relative}.lg\:z-0{z-index:0}.lg\:mb-1{margin-bottom:.25rem}.lg\:block{display:block}.lg\:hidden{display:none}.lg\:h-\[calc\(100vh-400px\)\]{height:calc(100vh - 400px)}.lg\:w-16{width:4rem}.lg\:w-64{width:16rem}.lg\:w-8{width:2rem}.lg\:w-\[150px\]{width:150px}.lg\:w-\[180px\]{width:180px}.lg\:w-\[200px\]{width:200px}.lg\:w-\[240px\]{width:240px}.lg\:w-\[80px\]{width:80px}.lg\:w-auto{width:auto}.lg\:max-w-0{max-width:0px}.lg\:flex-1{flex:1 1 0%}.lg\:flex-none{flex:none}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.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-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:justify-center{justify-content:center}.lg\:gap-0{gap:0px}.lg\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.lg\:overflow-hidden{overflow:hidden}.lg\:p-4{padding:1rem}.lg\:p-6{padding:1.5rem}.lg\:px-0{padding-left:0;padding-right:0}.lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}.lg\:text-sm{font-size:.875rem;line-height:1.25rem}.lg\:opacity-0{opacity:0}}.\[\&\+div\]\:text-xs+div{font-size:.75rem;line-height:1rem}.\[\&\:first-child\[data-selected\=true\]_button\]\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\:last-child\[data-selected\=true\]_button\]\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>span\]\:text-xs>span{font-size:.75rem;line-height:1rem}.\[\&\>span\]\:opacity-70>span{opacity:.7}.\[\&\>svg\]\:size-3\.5>svg{width:.875rem;height:.875rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:invisible svg{visibility:hidden}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-slot=card-content] .\[\[data-slot\=card-content\]_\&\]\:bg-transparent,[data-slot=popover-content] .\[\[data-slot\=popover-content\]_\&\]\:bg-transparent{background-color:transparent} diff --git a/webui/dist/assets/index-DYT0dd6E.js b/webui/dist/assets/index-DYT0dd6E.js deleted file mode 100644 index aa91560f..00000000 --- a/webui/dist/assets/index-DYT0dd6E.js +++ /dev/null @@ -1,151 +0,0 @@ -function MV(e,t){for(var n=0;nr[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var fp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var g0={exports:{}},Bd={};var Mk;function RV(){if(Mk)return Bd;Mk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var u in a)u!=="key"&&(i[u]=a[u])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:i}}return Bd.Fragment=t,Bd.jsx=n,Bd.jsxs=n,Bd}var Rk;function DV(){return Rk||(Rk=1,g0.exports=RV()),g0.exports}var s=DV(),y0={exports:{}},Ve={};var Dk;function $V(){if(Dk)return Ve;Dk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function x(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function N(I,B,Y){this.props=I,this.context=B,this.refs=w,this.updater=Y||j}N.prototype.isReactComponent={},N.prototype.setState=function(I,B){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,B,"setState")},N.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function O(){}O.prototype=N.prototype;function C(I,B,Y){this.props=I,this.context=B,this.refs=w,this.updater=Y||j}var A=C.prototype=new O;A.constructor=C,b(A,N.prototype),A.isPureReactComponent=!0;var E=Array.isArray;function k(){}var T={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function $(I,B,Y){var te=Y.ref;return{$$typeof:e,type:I,key:B,ref:te!==void 0?te:null,props:Y}}function F(I,B){return $(I.type,B,I.props)}function D(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function U(I){var B={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(Y){return B[Y]})}var V=/\/+/g;function H(I,B){return typeof I=="object"&&I!==null&&I.key!=null?U(""+I.key):B.toString(36)}function G(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(k,k):(I.status="pending",I.then(function(B){I.status==="pending"&&(I.status="fulfilled",I.value=B)},function(B){I.status==="pending"&&(I.status="rejected",I.reason=B)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function L(I,B,Y,te,oe){var xe=typeof I;(xe==="undefined"||xe==="boolean")&&(I=null);var J=!1;if(I===null)J=!0;else switch(xe){case"bigint":case"string":case"number":J=!0;break;case"object":switch(I.$$typeof){case e:case t:J=!0;break;case m:return J=I._init,L(J(I._payload),B,Y,te,oe)}}if(J)return oe=oe(I),J=te===""?"."+H(I,0):te,E(oe)?(Y="",J!=null&&(Y=J.replace(V,"$&/")+"/"),L(oe,B,Y,"",function(pe){return pe})):oe!=null&&(D(oe)&&(oe=F(oe,Y+(oe.key==null||I&&I.key===oe.key?"":(""+oe.key).replace(V,"$&/")+"/")+J)),B.push(oe)),1;J=0;var ae=te===""?".":te+":";if(E(I))for(var Z=0;Z>>1,ee=L[K];if(0>>1;Ka(Y,q))tea(oe,Y)?(L[K]=oe,L[te]=q,K=te):(L[K]=Y,L[B]=q,K=B);else if(tea(oe,q))L[K]=oe,L[te]=q,K=te;else break e}}return R}function a(L,R){var q=L.sortIndex-R.sortIndex;return q!==0?q:L.id-R.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],f=[],m=1,p=null,g=3,x=!1,j=!1,b=!1,w=!1,N=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function A(L){for(var R=n(f);R!==null;){if(R.callback===null)r(f);else if(R.startTime<=L)r(f),R.sortIndex=R.expirationTime,t(d,R);else break;R=n(f)}}function E(L){if(b=!1,A(L),!j)if(n(d)!==null)j=!0,k||(k=!0,U());else{var R=n(f);R!==null&&G(E,R.startTime-L)}}var k=!1,T=-1,P=5,$=-1;function F(){return w?!0:!(e.unstable_now()-$L&&F());){var K=p.callback;if(typeof K=="function"){p.callback=null,g=p.priorityLevel;var ee=K(p.expirationTime<=L);if(L=e.unstable_now(),typeof ee=="function"){p.callback=ee,A(L),R=!0;break t}p===n(d)&&r(d),A(L)}else r(d);p=n(d)}if(p!==null)R=!0;else{var I=n(f);I!==null&&G(E,I.startTime-L),R=!1}}break e}finally{p=null,g=q,x=!1}R=void 0}}finally{R?U():k=!1}}}var U;if(typeof C=="function")U=function(){C(D)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,H=V.port2;V.port1.onmessage=D,U=function(){H.postMessage(null)}}else U=function(){N(D,0)};function G(L,R){T=N(function(){L(e.unstable_now())},R)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125K?(L.sortIndex=q,t(f,L),n(d)===null&&L===n(f)&&(b?(O(T),T=-1):b=!0,G(E,q-K))):(L.sortIndex=ee,t(d,L),j||x||(j=!0,k||(k=!0,U()))),L},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(L){var R=g;return function(){var q=g;g=R;try{return L.apply(this,arguments)}finally{g=q}}}})(w0)),w0}var Lk;function LV(){return Lk||(Lk=1,b0.exports=IV()),b0.exports}var j0={exports:{}},nr={};var Bk;function BV(){if(Bk)return nr;Bk=1;var e=vh();function t(d){var f="https://react.dev/errors/"+d;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),j0.exports=BV(),j0.exports}var qk;function zV(){if(qk)return zd;qk=1;var e=LV(),t=vh(),n=P3();function r(o){var c="https://react.dev/errors/"+o;if(1ee||(o.current=K[ee],K[ee]=null,ee--)}function Y(o,c){ee++,K[ee]=o.current,o.current=c}var te=I(null),oe=I(null),xe=I(null),J=I(null);function ae(o,c){switch(Y(xe,c),Y(oe,o),Y(te,null),c.nodeType){case 9:case 11:o=(o=c.documentElement)&&(o=o.namespaceURI)?nk(o):0;break;default:if(o=c.tagName,c=c.namespaceURI)c=nk(c),o=rk(c,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}B(te),Y(te,o)}function Z(){B(te),B(oe),B(xe)}function pe(o){o.memoizedState!==null&&Y(J,o);var c=te.current,h=rk(c,o.type);c!==h&&(Y(oe,o),Y(te,h))}function je(o){oe.current===o&&(B(te),B(oe)),J.current===o&&(B(J),Dd._currentValue=q)}var le,Re;function _e(o){if(le===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);le=c&&c[1]||"",Re=-1)":-1S||X[v]!==se[S]){var ge=` -`+X[v].replace(" at new "," at ");return o.displayName&&ge.includes("")&&(ge=ge.replace("",o.displayName)),ge}while(1<=v&&0<=S);break}}}finally{he=!1,Error.prepareStackTrace=h}return(h=o?o.displayName||o.name:"")?_e(h):""}function Le(o,c){switch(o.tag){case 26:case 27:case 5:return _e(o.type);case 16:return _e("Lazy");case 13:return o.child!==c&&c!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return ve(o.type,!1);case 11:return ve(o.type.render,!1);case 1:return ve(o.type,!0);case 31:return _e("Activity");default:return""}}function Mt(o){try{var c="",h=null;do c+=Le(o,h),h=o,o=o.return;while(o);return c}catch(v){return` -Error generating stack: `+v.message+` -`+v.stack}}var vn=Object.prototype.hasOwnProperty,fr=e.unstable_scheduleCallback,er=e.unstable_cancelCallback,hr=e.unstable_shouldYield,it=e.unstable_requestPaint,nt=e.unstable_now,Nn=e.unstable_getCurrentPriorityLevel,ds=e.unstable_ImmediatePriority,Qh=e.unstable_UserBlockingPriority,Tl=e.unstable_NormalPriority,tx=e.unstable_LowPriority,Jh=e.unstable_IdlePriority,nx=e.log,rx=e.unstable_setDisableYieldValue,fs=null,mr=null;function Wa(o){if(typeof nx=="function"&&rx(o),mr&&typeof mr.setStrictMode=="function")try{mr.setStrictMode(fs,o)}catch{}}var tr=Math.clz32?Math.clz32:$t,ax=Math.log,Je=Math.LN2;function $t(o){return o>>>=0,o===0?32:31-(ax(o)/Je|0)|0}var He=256,pt=262144,On=4194304;function et(o){var c=o&42;if(c!==0)return c;switch(o&-o){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 o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function kl(o,c,h){var v=o.pendingLanes;if(v===0)return 0;var S=0,_=o.suspendedLanes,M=o.pingedLanes;o=o.warmLanes;var z=v&134217727;return z!==0?(v=z&~_,v!==0?S=et(v):(M&=z,M!==0?S=et(M):h||(h=z&~o,h!==0&&(S=et(h))))):(z=v&~_,z!==0?S=et(z):M!==0?S=et(M):h||(h=v&~o,h!==0&&(S=et(h)))),S===0?0:c!==0&&c!==S&&(c&_)===0&&(_=S&-S,h=c&-c,_>=h||_===32&&(h&4194048)!==0)?c:S}function hs(o,c){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&c)===0}function ix(o,c){switch(o){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 Pl(){var o=On;return On<<=1,(On&62914560)===0&&(On=4194304),o}function ms(o){for(var c=[],h=0;31>h;h++)c.push(o);return c}function Ku(o,c){o.pendingLanes|=c,c!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function wW(o,c,h,v,S,_){var M=o.pendingLanes;o.pendingLanes=h,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=h,o.entangledLanes&=h,o.errorRecoveryDisabledLanes&=h,o.shellSuspendCounter=0;var z=o.entanglements,X=o.expirationTimes,se=o.hiddenUpdates;for(h=M&~h;0"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var CW=/[\n"\\]/g;function aa(o){return o.replace(CW,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function dx(o,c,h,v,S,_,M,z){o.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?o.type=M:o.removeAttribute("type"),c!=null?M==="number"?(c===0&&o.value===""||o.value!=c)&&(o.value=""+ra(c)):o.value!==""+ra(c)&&(o.value=""+ra(c)):M!=="submit"&&M!=="reset"||o.removeAttribute("value"),c!=null?fx(o,M,ra(c)):h!=null?fx(o,M,ra(h)):v!=null&&o.removeAttribute("value"),S==null&&_!=null&&(o.defaultChecked=!!_),S!=null&&(o.checked=S&&typeof S!="function"&&typeof S!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?o.name=""+ra(z):o.removeAttribute("name")}function XE(o,c,h,v,S,_,M,z){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(o.type=_),c!=null||h!=null){if(!(_!=="submit"&&_!=="reset"||c!=null)){ux(o);return}h=h!=null?""+ra(h):"",c=c!=null?""+ra(c):h,z||c===o.value||(o.value=c),o.defaultValue=c}v=v??S,v=typeof v!="function"&&typeof v!="symbol"&&!!v,o.checked=z?o.checked:!!v,o.defaultChecked=!!v,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(o.name=M),ux(o)}function fx(o,c,h){c==="number"&&nm(o.ownerDocument)===o||o.defaultValue===""+h||(o.defaultValue=""+h)}function Ll(o,c,h,v){if(o=o.options,c){c={};for(var S=0;S"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gx=!1;if(ji)try{var Ju={};Object.defineProperty(Ju,"passive",{get:function(){gx=!0}}),window.addEventListener("test",Ju,Ju),window.removeEventListener("test",Ju,Ju)}catch{gx=!1}var fo=null,yx=null,am=null;function rA(){if(am)return am;var o,c=yx,h=c.length,v,S="value"in fo?fo.value:fo.textContent,_=S.length;for(o=0;o=nd),cA=" ",uA=!1;function dA(o,c){switch(o){case"keyup":return t7.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fA(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Fl=!1;function r7(o,c){switch(o){case"compositionend":return fA(c);case"keypress":return c.which!==32?null:(uA=!0,cA);case"textInput":return o=c.data,o===cA&&uA?null:o;default:return null}}function a7(o,c){if(Fl)return o==="compositionend"||!Sx&&dA(o,c)?(o=rA(),am=yx=fo=null,Fl=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:h,offset:c-o};o=v}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=bA(h)}}function jA(o,c){return o&&c?o===c?!0:o&&o.nodeType===3?!1:c&&c.nodeType===3?jA(o,c.parentNode):"contains"in o?o.contains(c):o.compareDocumentPosition?!!(o.compareDocumentPosition(c)&16):!1:!1}function SA(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var c=nm(o.document);c instanceof o.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)o=c.contentWindow;else break;c=nm(o.document)}return c}function Ox(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c&&(c==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||c==="textarea"||o.contentEditable==="true")}var f7=ji&&"documentMode"in document&&11>=document.documentMode,Ul=null,Cx=null,od=null,Ex=!1;function _A(o,c,h){var v=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Ex||Ul==null||Ul!==nm(v)||(v=Ul,"selectionStart"in v&&Ox(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),od&&id(od,v)||(od=v,v=Zm(Cx,"onSelect"),0>=M,S-=M,Va=1<<32-tr(c)+S|h<Ze?(st=De,De=null):st=De.sibling;var dt=ce(ne,De,ie[Ze],be);if(dt===null){De===null&&(De=st);break}o&&De&&dt.alternate===null&&c(ne,De),Q=_(dt,Q,Ze),ut===null?Ie=dt:ut.sibling=dt,ut=dt,De=st}if(Ze===ie.length)return h(ne,De),lt&&_i(ne,Ze),Ie;if(De===null){for(;ZeZe?(st=De,De=null):st=De.sibling;var Ro=ce(ne,De,dt.value,be);if(Ro===null){De===null&&(De=st);break}o&&De&&Ro.alternate===null&&c(ne,De),Q=_(Ro,Q,Ze),ut===null?Ie=Ro:ut.sibling=Ro,ut=Ro,De=st}if(dt.done)return h(ne,De),lt&&_i(ne,Ze),Ie;if(De===null){for(;!dt.done;Ze++,dt=ie.next())dt=we(ne,dt.value,be),dt!==null&&(Q=_(dt,Q,Ze),ut===null?Ie=dt:ut.sibling=dt,ut=dt);return lt&&_i(ne,Ze),Ie}for(De=v(De);!dt.done;Ze++,dt=ie.next())dt=fe(De,ne,Ze,dt.value,be),dt!==null&&(o&&dt.alternate!==null&&De.delete(dt.key===null?Ze:dt.key),Q=_(dt,Q,Ze),ut===null?Ie=dt:ut.sibling=dt,ut=dt);return o&&De.forEach(function(PV){return c(ne,PV)}),lt&&_i(ne,Ze),Ie}function At(ne,Q,ie,be){if(typeof ie=="object"&&ie!==null&&ie.type===b&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:e:{for(var Ie=ie.key;Q!==null;){if(Q.key===Ie){if(Ie=ie.type,Ie===b){if(Q.tag===7){h(ne,Q.sibling),be=S(Q,ie.props.children),be.return=ne,ne=be;break e}}else if(Q.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===P&&Ns(Ie)===Q.type){h(ne,Q.sibling),be=S(Q,ie.props),fd(be,ie),be.return=ne,ne=be;break e}h(ne,Q);break}else c(ne,Q);Q=Q.sibling}ie.type===b?(be=bs(ie.props.children,ne.mode,be,ie.key),be.return=ne,ne=be):(be=mm(ie.type,ie.key,ie.props,null,ne.mode,be),fd(be,ie),be.return=ne,ne=be)}return M(ne);case j:e:{for(Ie=ie.key;Q!==null;){if(Q.key===Ie)if(Q.tag===4&&Q.stateNode.containerInfo===ie.containerInfo&&Q.stateNode.implementation===ie.implementation){h(ne,Q.sibling),be=S(Q,ie.children||[]),be.return=ne,ne=be;break e}else{h(ne,Q);break}else c(ne,Q);Q=Q.sibling}be=Dx(ie,ne.mode,be),be.return=ne,ne=be}return M(ne);case P:return ie=Ns(ie),At(ne,Q,ie,be)}if(G(ie))return Ae(ne,Q,ie,be);if(U(ie)){if(Ie=U(ie),typeof Ie!="function")throw Error(r(150));return ie=Ie.call(ie),ze(ne,Q,ie,be)}if(typeof ie.then=="function")return At(ne,Q,wm(ie),be);if(ie.$$typeof===C)return At(ne,Q,gm(ne,ie),be);jm(ne,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,Q!==null&&Q.tag===6?(h(ne,Q.sibling),be=S(Q,ie),be.return=ne,ne=be):(h(ne,Q),be=Rx(ie,ne.mode,be),be.return=ne,ne=be),M(ne)):h(ne,Q)}return function(ne,Q,ie,be){try{dd=0;var Ie=At(ne,Q,ie,be);return ec=null,Ie}catch(De){if(De===Jl||De===xm)throw De;var ut=Lr(29,De,null,ne.mode);return ut.lanes=be,ut.return=ne,ut}finally{}}}var Cs=GA(!0),YA=GA(!1),go=!1;function Gx(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Yx(o,c){o=o.updateQueue,c.updateQueue===o&&(c.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function yo(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function xo(o,c,h){var v=o.updateQueue;if(v===null)return null;if(v=v.shared,(vt&2)!==0){var S=v.pending;return S===null?c.next=c:(c.next=S.next,S.next=c),v.pending=c,c=hm(o),kA(o,null,h),c}return fm(o,v,c,h),hm(o)}function hd(o,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194048)!==0)){var v=c.lanes;v&=o.pendingLanes,h|=v,c.lanes=h,BE(o,h)}}function Kx(o,c){var h=o.updateQueue,v=o.alternate;if(v!==null&&(v=v.updateQueue,h===v)){var S=null,_=null;if(h=h.firstBaseUpdate,h!==null){do{var M={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};_===null?S=_=M:_=_.next=M,h=h.next}while(h!==null);_===null?S=_=c:_=_.next=c}else S=_=c;h={baseState:v.baseState,firstBaseUpdate:S,lastBaseUpdate:_,shared:v.shared,callbacks:v.callbacks},o.updateQueue=h;return}o=h.lastBaseUpdate,o===null?h.firstBaseUpdate=c:o.next=c,h.lastBaseUpdate=c}var Xx=!1;function md(){if(Xx){var o=Ql;if(o!==null)throw o}}function pd(o,c,h,v){Xx=!1;var S=o.updateQueue;go=!1;var _=S.firstBaseUpdate,M=S.lastBaseUpdate,z=S.shared.pending;if(z!==null){S.shared.pending=null;var X=z,se=X.next;X.next=null,M===null?_=se:M.next=se,M=X;var ge=o.alternate;ge!==null&&(ge=ge.updateQueue,z=ge.lastBaseUpdate,z!==M&&(z===null?ge.firstBaseUpdate=se:z.next=se,ge.lastBaseUpdate=X))}if(_!==null){var we=S.baseState;M=0,ge=se=X=null,z=_;do{var ce=z.lane&-536870913,fe=ce!==z.lane;if(fe?(ot&ce)===ce:(v&ce)===ce){ce!==0&&ce===Zl&&(Xx=!0),ge!==null&&(ge=ge.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var Ae=o,ze=z;ce=c;var At=h;switch(ze.tag){case 1:if(Ae=ze.payload,typeof Ae=="function"){we=Ae.call(At,we,ce);break e}we=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=ze.payload,ce=typeof Ae=="function"?Ae.call(At,we,ce):Ae,ce==null)break e;we=p({},we,ce);break e;case 2:go=!0}}ce=z.callback,ce!==null&&(o.flags|=64,fe&&(o.flags|=8192),fe=S.callbacks,fe===null?S.callbacks=[ce]:fe.push(ce))}else fe={lane:ce,tag:z.tag,payload:z.payload,callback:z.callback,next:null},ge===null?(se=ge=fe,X=we):ge=ge.next=fe,M|=ce;if(z=z.next,z===null){if(z=S.shared.pending,z===null)break;fe=z,z=fe.next,fe.next=null,S.lastBaseUpdate=fe,S.shared.pending=null}}while(!0);ge===null&&(X=we),S.baseState=X,S.firstBaseUpdate=se,S.lastBaseUpdate=ge,_===null&&(S.shared.lanes=0),_o|=M,o.lanes=M,o.memoizedState=we}}function KA(o,c){if(typeof o!="function")throw Error(r(191,o));o.call(c)}function XA(o,c){var h=o.callbacks;if(h!==null)for(o.callbacks=null,o=0;o_?_:8;var M=L.T,z={};L.T=z,pb(o,!1,c,h);try{var X=S(),se=L.S;if(se!==null&&se(z,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var ge=w7(X,v);yd(o,c,ge,Ur(o))}else yd(o,c,v,Ur(o))}catch(we){yd(o,c,{then:function(){},status:"rejected",reason:we},Ur())}finally{R.p=_,M!==null&&z.types!==null&&(M.types=z.types),L.T=M}}function C7(){}function hb(o,c,h,v){if(o.tag!==5)throw Error(r(476));var S=ET(o).queue;CT(o,S,c,q,h===null?C7:function(){return AT(o),h(v)})}function ET(o){var c=o.memoizedState;if(c!==null)return c;c={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:q},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:h},next:null},o.memoizedState=c,o=o.alternate,o!==null&&(o.memoizedState=c),c}function AT(o){var c=ET(o);c.next===null&&(c=o.alternate.memoizedState),yd(o,c.next.queue,{},Ur())}function mb(){return Vn(Dd)}function TT(){return rn().memoizedState}function kT(){return rn().memoizedState}function E7(o){for(var c=o.return;c!==null;){switch(c.tag){case 24:case 3:var h=Ur();o=yo(h);var v=xo(c,o,h);v!==null&&(Or(v,c,h),hd(v,c,h)),c={cache:Ux()},o.payload=c;return}c=c.return}}function A7(o,c,h){var v=Ur();h={lane:v,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Pm(o)?MT(c,h):(h=Px(o,c,h,v),h!==null&&(Or(h,o,v),RT(h,c,v)))}function PT(o,c,h){var v=Ur();yd(o,c,h,v)}function yd(o,c,h,v){var S={lane:v,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Pm(o))MT(c,S);else{var _=o.alternate;if(o.lanes===0&&(_===null||_.lanes===0)&&(_=c.lastRenderedReducer,_!==null))try{var M=c.lastRenderedState,z=_(M,h);if(S.hasEagerState=!0,S.eagerState=z,Ir(z,M))return fm(o,c,S,0),Rt===null&&dm(),!1}catch{}finally{}if(h=Px(o,c,S,v),h!==null)return Or(h,o,v),RT(h,c,v),!0}return!1}function pb(o,c,h,v){if(v={lane:2,revertLane:Gb(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},Pm(o)){if(c)throw Error(r(479))}else c=Px(o,h,v,2),c!==null&&Or(c,o,2)}function Pm(o){var c=o.alternate;return o===Ke||c!==null&&c===Ke}function MT(o,c){nc=Nm=!0;var h=o.pending;h===null?c.next=c:(c.next=h.next,h.next=c),o.pending=c}function RT(o,c,h){if((h&4194048)!==0){var v=c.lanes;v&=o.pendingLanes,h|=v,c.lanes=h,BE(o,h)}}var xd={readContext:Vn,use:Em,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useLayoutEffect:Zt,useInsertionEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useSyncExternalStore:Zt,useId:Zt,useHostTransitionStatus:Zt,useFormState:Zt,useActionState:Zt,useOptimistic:Zt,useMemoCache:Zt,useCacheRefresh:Zt};xd.useEffectEvent=Zt;var DT={readContext:Vn,use:Em,useCallback:function(o,c){return pr().memoizedState=[o,c===void 0?null:c],o},useContext:Vn,useEffect:yT,useImperativeHandle:function(o,c,h){h=h!=null?h.concat([o]):null,Tm(4194308,4,jT.bind(null,c,o),h)},useLayoutEffect:function(o,c){return Tm(4194308,4,o,c)},useInsertionEffect:function(o,c){Tm(4,2,o,c)},useMemo:function(o,c){var h=pr();c=c===void 0?null:c;var v=o();if(Es){Wa(!0);try{o()}finally{Wa(!1)}}return h.memoizedState=[v,c],v},useReducer:function(o,c,h){var v=pr();if(h!==void 0){var S=h(c);if(Es){Wa(!0);try{h(c)}finally{Wa(!1)}}}else S=c;return v.memoizedState=v.baseState=S,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:S},v.queue=o,o=o.dispatch=A7.bind(null,Ke,o),[v.memoizedState,o]},useRef:function(o){var c=pr();return o={current:o},c.memoizedState=o},useState:function(o){o=lb(o);var c=o.queue,h=PT.bind(null,Ke,c);return c.dispatch=h,[o.memoizedState,h]},useDebugValue:db,useDeferredValue:function(o,c){var h=pr();return fb(h,o,c)},useTransition:function(){var o=lb(!1);return o=CT.bind(null,Ke,o.queue,!0,!1),pr().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,c,h){var v=Ke,S=pr();if(lt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=c(),Rt===null)throw Error(r(349));(ot&127)!==0||nT(v,c,h)}S.memoizedState=h;var _={value:h,getSnapshot:c};return S.queue=_,yT(aT.bind(null,v,_,o),[o]),v.flags|=2048,ac(9,{destroy:void 0},rT.bind(null,v,_,h,c),null),h},useId:function(){var o=pr(),c=Rt.identifierPrefix;if(lt){var h=Ga,v=Va;h=(v&~(1<<32-tr(v)-1)).toString(32)+h,c="_"+c+"R_"+h,h=Om++,0<\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof v.is=="string"?M.createElement("select",{is:v.is}):M.createElement("select"),v.multiple?_.multiple=!0:v.size&&(_.size=v.size);break;default:_=typeof v.is=="string"?M.createElement(S,{is:v.is}):M.createElement(S)}}_[Hn]=c,_[br]=v;e:for(M=c.child;M!==null;){if(M.tag===5||M.tag===6)_.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===c)break e;for(;M.sibling===null;){if(M.return===null||M.return===c)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}c.stateNode=_;e:switch(Yn(_,S,v),S){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&Ti(c)}}return Ft(c),Ab(c,c.type,o===null?null:o.memoizedProps,c.pendingProps,h),null;case 6:if(o&&c.stateNode!=null)o.memoizedProps!==v&&Ti(c);else{if(typeof v!="string"&&c.stateNode===null)throw Error(r(166));if(o=xe.current,Kl(c)){if(o=c.stateNode,h=c.memoizedProps,v=null,S=Wn,S!==null)switch(S.tag){case 27:case 5:v=S.memoizedProps}o[Hn]=c,o=!!(o.nodeValue===h||v!==null&&v.suppressHydrationWarning===!0||ek(o.nodeValue,h)),o||po(c,!0)}else o=Qm(o).createTextNode(v),o[Hn]=c,c.stateNode=o}return Ft(c),null;case 31:if(h=c.memoizedState,o===null||o.memoizedState!==null){if(v=Kl(c),h!==null){if(o===null){if(!v)throw Error(r(318));if(o=c.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[Hn]=c}else ws(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Ft(c),o=!1}else h=Bx(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=h),o=!0;if(!o)return c.flags&256?(zr(c),c):(zr(c),null);if((c.flags&128)!==0)throw Error(r(558))}return Ft(c),null;case 13:if(v=c.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(S=Kl(c),v!==null&&v.dehydrated!==null){if(o===null){if(!S)throw Error(r(318));if(S=c.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(r(317));S[Hn]=c}else ws(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Ft(c),S=!1}else S=Bx(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=S),S=!0;if(!S)return c.flags&256?(zr(c),c):(zr(c),null)}return zr(c),(c.flags&128)!==0?(c.lanes=h,c):(h=v!==null,o=o!==null&&o.memoizedState!==null,h&&(v=c.child,S=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(S=v.alternate.memoizedState.cachePool.pool),_=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(_=v.memoizedState.cachePool.pool),_!==S&&(v.flags|=2048)),h!==o&&h&&(c.child.flags|=8192),Im(c,c.updateQueue),Ft(c),null);case 4:return Z(),o===null&&Zb(c.stateNode.containerInfo),Ft(c),null;case 10:return Oi(c.type),Ft(c),null;case 19:if(B(nn),v=c.memoizedState,v===null)return Ft(c),null;if(S=(c.flags&128)!==0,_=v.rendering,_===null)if(S)wd(v,!1);else{if(Qt!==0||o!==null&&(o.flags&128)!==0)for(o=c.child;o!==null;){if(_=_m(o),_!==null){for(c.flags|=128,wd(v,!1),o=_.updateQueue,c.updateQueue=o,Im(c,o),c.subtreeFlags=0,o=h,h=c.child;h!==null;)PA(h,o),h=h.sibling;return Y(nn,nn.current&1|2),lt&&_i(c,v.treeForkCount),c.child}o=o.sibling}v.tail!==null&&nt()>Fm&&(c.flags|=128,S=!0,wd(v,!1),c.lanes=4194304)}else{if(!S)if(o=_m(_),o!==null){if(c.flags|=128,S=!0,o=o.updateQueue,c.updateQueue=o,Im(c,o),wd(v,!0),v.tail===null&&v.tailMode==="hidden"&&!_.alternate&&!lt)return Ft(c),null}else 2*nt()-v.renderingStartTime>Fm&&h!==536870912&&(c.flags|=128,S=!0,wd(v,!1),c.lanes=4194304);v.isBackwards?(_.sibling=c.child,c.child=_):(o=v.last,o!==null?o.sibling=_:c.child=_,v.last=_)}return v.tail!==null?(o=v.tail,v.rendering=o,v.tail=o.sibling,v.renderingStartTime=nt(),o.sibling=null,h=nn.current,Y(nn,S?h&1|2:h&1),lt&&_i(c,v.treeForkCount),o):(Ft(c),null);case 22:case 23:return zr(c),Qx(),v=c.memoizedState!==null,o!==null?o.memoizedState!==null!==v&&(c.flags|=8192):v&&(c.flags|=8192),v?(h&536870912)!==0&&(c.flags&128)===0&&(Ft(c),c.subtreeFlags&6&&(c.flags|=8192)):Ft(c),h=c.updateQueue,h!==null&&Im(c,h.retryQueue),h=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==h&&(c.flags|=2048),o!==null&&B(_s),null;case 24:return h=null,o!==null&&(h=o.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),Oi(on),Ft(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function R7(o,c){switch(Ix(c),c.tag){case 1:return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 3:return Oi(on),Z(),o=c.flags,(o&65536)!==0&&(o&128)===0?(c.flags=o&-65537|128,c):null;case 26:case 27:case 5:return je(c),null;case 31:if(c.memoizedState!==null){if(zr(c),c.alternate===null)throw Error(r(340));ws()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 13:if(zr(c),o=c.memoizedState,o!==null&&o.dehydrated!==null){if(c.alternate===null)throw Error(r(340));ws()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 19:return B(nn),null;case 4:return Z(),null;case 10:return Oi(c.type),null;case 22:case 23:return zr(c),Qx(),o!==null&&B(_s),o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 24:return Oi(on),null;case 25:return null;default:return null}}function i2(o,c){switch(Ix(c),c.tag){case 3:Oi(on),Z();break;case 26:case 27:case 5:je(c);break;case 4:Z();break;case 31:c.memoizedState!==null&&zr(c);break;case 13:zr(c);break;case 19:B(nn);break;case 10:Oi(c.type);break;case 22:case 23:zr(c),Qx(),o!==null&&B(_s);break;case 24:Oi(on)}}function jd(o,c){try{var h=c.updateQueue,v=h!==null?h.lastEffect:null;if(v!==null){var S=v.next;h=S;do{if((h.tag&o)===o){v=void 0;var _=h.create,M=h.inst;v=_(),M.destroy=v}h=h.next}while(h!==S)}}catch(z){St(c,c.return,z)}}function jo(o,c,h){try{var v=c.updateQueue,S=v!==null?v.lastEffect:null;if(S!==null){var _=S.next;v=_;do{if((v.tag&o)===o){var M=v.inst,z=M.destroy;if(z!==void 0){M.destroy=void 0,S=c;var X=h,se=z;try{se()}catch(ge){St(S,X,ge)}}}v=v.next}while(v!==_)}}catch(ge){St(c,c.return,ge)}}function o2(o){var c=o.updateQueue;if(c!==null){var h=o.stateNode;try{XA(c,h)}catch(v){St(o,o.return,v)}}}function s2(o,c,h){h.props=As(o.type,o.memoizedProps),h.state=o.memoizedState;try{h.componentWillUnmount()}catch(v){St(o,c,v)}}function Sd(o,c){try{var h=o.ref;if(h!==null){switch(o.tag){case 26:case 27:case 5:var v=o.stateNode;break;case 30:v=o.stateNode;break;default:v=o.stateNode}typeof h=="function"?o.refCleanup=h(v):h.current=v}}catch(S){St(o,c,S)}}function Ya(o,c){var h=o.ref,v=o.refCleanup;if(h!==null)if(typeof v=="function")try{v()}catch(S){St(o,c,S)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(S){St(o,c,S)}else h.current=null}function l2(o){var c=o.type,h=o.memoizedProps,v=o.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":h.autoFocus&&v.focus();break e;case"img":h.src?v.src=h.src:h.srcSet&&(v.srcset=h.srcSet)}}catch(S){St(o,o.return,S)}}function Tb(o,c,h){try{var v=o.stateNode;nV(v,o.type,h,c),v[br]=c}catch(S){St(o,o.return,S)}}function c2(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Ao(o.type)||o.tag===4}function kb(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||c2(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&Ao(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Pb(o,c,h){var v=o.tag;if(v===5||v===6)o=o.stateNode,c?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(o,c):(c=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,c.appendChild(o),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=wi));else if(v!==4&&(v===27&&Ao(o.type)&&(h=o.stateNode,c=null),o=o.child,o!==null))for(Pb(o,c,h),o=o.sibling;o!==null;)Pb(o,c,h),o=o.sibling}function Lm(o,c,h){var v=o.tag;if(v===5||v===6)o=o.stateNode,c?h.insertBefore(o,c):h.appendChild(o);else if(v!==4&&(v===27&&Ao(o.type)&&(h=o.stateNode),o=o.child,o!==null))for(Lm(o,c,h),o=o.sibling;o!==null;)Lm(o,c,h),o=o.sibling}function u2(o){var c=o.stateNode,h=o.memoizedProps;try{for(var v=o.type,S=c.attributes;S.length;)c.removeAttributeNode(S[0]);Yn(c,v,h),c[Hn]=o,c[br]=h}catch(_){St(o,o.return,_)}}var ki=!1,cn=!1,Mb=!1,d2=typeof WeakSet=="function"?WeakSet:Set,En=null;function D7(o,c){if(o=o.containerInfo,e0=ip,o=SA(o),Ox(o)){if("selectionStart"in o)var h={start:o.selectionStart,end:o.selectionEnd};else e:{h=(h=o.ownerDocument)&&h.defaultView||window;var v=h.getSelection&&h.getSelection();if(v&&v.rangeCount!==0){h=v.anchorNode;var S=v.anchorOffset,_=v.focusNode;v=v.focusOffset;try{h.nodeType,_.nodeType}catch{h=null;break e}var M=0,z=-1,X=-1,se=0,ge=0,we=o,ce=null;t:for(;;){for(var fe;we!==h||S!==0&&we.nodeType!==3||(z=M+S),we!==_||v!==0&&we.nodeType!==3||(X=M+v),we.nodeType===3&&(M+=we.nodeValue.length),(fe=we.firstChild)!==null;)ce=we,we=fe;for(;;){if(we===o)break t;if(ce===h&&++se===S&&(z=M),ce===_&&++ge===v&&(X=M),(fe=we.nextSibling)!==null)break;we=ce,ce=we.parentNode}we=fe}h=z===-1||X===-1?null:{start:z,end:X}}else h=null}h=h||{start:0,end:0}}else h=null;for(t0={focusedElem:o,selectionRange:h},ip=!1,En=c;En!==null;)if(c=En,o=c.child,(c.subtreeFlags&1028)!==0&&o!==null)o.return=c,En=o;else for(;En!==null;){switch(c=En,_=c.alternate,o=c.flags,c.tag){case 0:if((o&4)!==0&&(o=c.updateQueue,o=o!==null?o.events:null,o!==null))for(h=0;h title"))),Yn(_,v,h),_[Hn]=o,Cn(_),v=_;break e;case"link":var M=gk("link","href",S).get(v+(h.href||""));if(M){for(var z=0;zAt&&(M=At,At=ze,ze=M);var ne=wA(z,ze),Q=wA(z,At);if(ne&&Q&&(fe.rangeCount!==1||fe.anchorNode!==ne.node||fe.anchorOffset!==ne.offset||fe.focusNode!==Q.node||fe.focusOffset!==Q.offset)){var ie=we.createRange();ie.setStart(ne.node,ne.offset),fe.removeAllRanges(),ze>At?(fe.addRange(ie),fe.extend(Q.node,Q.offset)):(ie.setEnd(Q.node,Q.offset),fe.addRange(ie))}}}}for(we=[],fe=z;fe=fe.parentNode;)fe.nodeType===1&&we.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;zh?32:h,L.T=null,h=zb,zb=null;var _=Oo,M=$i;if(gn=0,cc=Oo=null,$i=0,(vt&6)!==0)throw Error(r(331));var z=vt;if(vt|=4,j2(_.current),x2(_,_.current,M,h),vt=z,Ad(0,!1),mr&&typeof mr.onPostCommitFiberRoot=="function")try{mr.onPostCommitFiberRoot(fs,_)}catch{}return!0}finally{R.p=S,L.T=v,z2(o,c)}}function F2(o,c,h){c=oa(h,c),c=xb(o.stateNode,c,2),o=xo(o,c,2),o!==null&&(Ku(o,2),Ka(o))}function St(o,c,h){if(o.tag===3)F2(o,o,h);else for(;c!==null;){if(c.tag===3){F2(c,o,h);break}else if(c.tag===1){var v=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(No===null||!No.has(v))){o=oa(h,o),h=UT(2),v=xo(c,h,2),v!==null&&(HT(h,v,c,o),Ku(v,2),Ka(v));break}}c=c.return}}function Hb(o,c,h){var v=o.pingCache;if(v===null){v=o.pingCache=new L7;var S=new Set;v.set(c,S)}else S=v.get(c),S===void 0&&(S=new Set,v.set(c,S));S.has(h)||($b=!0,S.add(h),o=U7.bind(null,o,c,h),c.then(o,o))}function U7(o,c,h){var v=o.pingCache;v!==null&&v.delete(c),o.pingedLanes|=o.suspendedLanes&h,o.warmLanes&=~h,Rt===o&&(ot&h)===h&&(Qt===4||Qt===3&&(ot&62914560)===ot&&300>nt()-qm?(vt&2)===0&&uc(o,0):Ib|=h,lc===ot&&(lc=0)),Ka(o)}function U2(o,c){c===0&&(c=Pl()),o=xs(o,c),o!==null&&(Ku(o,c),Ka(o))}function H7(o){var c=o.memoizedState,h=0;c!==null&&(h=c.retryLane),U2(o,h)}function W7(o,c){var h=0;switch(o.tag){case 31:case 13:var v=o.stateNode,S=o.memoizedState;S!==null&&(h=S.retryLane);break;case 19:v=o.stateNode;break;case 22:v=o.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(c),U2(o,h)}function V7(o,c){return fr(o,c)}var Ym=null,fc=null,Wb=!1,Km=!1,Vb=!1,Eo=0;function Ka(o){o!==fc&&o.next===null&&(fc===null?Ym=fc=o:fc=fc.next=o),Km=!0,Wb||(Wb=!0,Y7())}function Ad(o,c){if(!Vb&&Km){Vb=!0;do for(var h=!1,v=Ym;v!==null;){if(o!==0){var S=v.pendingLanes;if(S===0)var _=0;else{var M=v.suspendedLanes,z=v.pingedLanes;_=(1<<31-tr(42|o)+1)-1,_&=S&~(M&~z),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(h=!0,G2(v,_))}else _=ot,_=kl(v,v===Rt?_:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(_&3)===0||hs(v,_)||(h=!0,G2(v,_));v=v.next}while(h);Vb=!1}}function G7(){H2()}function H2(){Km=Wb=!1;var o=0;Eo!==0&&aV()&&(o=Eo);for(var c=nt(),h=null,v=Ym;v!==null;){var S=v.next,_=W2(v,c);_===0?(v.next=null,h===null?Ym=S:h.next=S,S===null&&(fc=h)):(h=v,(o!==0||(_&3)!==0)&&(Km=!0)),v=S}gn!==0&&gn!==5||Ad(o),Eo!==0&&(Eo=0)}function W2(o,c){for(var h=o.suspendedLanes,v=o.pingedLanes,S=o.expirationTimes,_=o.pendingLanes&-62914561;0<_;){var M=31-tr(_),z=1<z)break;var ge=X.transferSize,we=X.initiatorType;ge&&tk(we)&&(X=X.responseEnd,M+=ge*(X"u"?null:document;function hk(o,c,h){var v=hc;if(v&&typeof c=="string"&&c){var S=aa(c);S='link[rel="'+o+'"][href="'+S+'"]',typeof h=="string"&&(S+='[crossorigin="'+h+'"]'),fk.has(S)||(fk.add(S),o={rel:o,crossOrigin:h,href:c},v.querySelector(S)===null&&(c=v.createElement("link"),Yn(c,"link",o),Cn(c),v.head.appendChild(c)))}}function hV(o){Ii.D(o),hk("dns-prefetch",o,null)}function mV(o,c){Ii.C(o,c),hk("preconnect",o,c)}function pV(o,c,h){Ii.L(o,c,h);var v=hc;if(v&&o&&c){var S='link[rel="preload"][as="'+aa(c)+'"]';c==="image"&&h&&h.imageSrcSet?(S+='[imagesrcset="'+aa(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(S+='[imagesizes="'+aa(h.imageSizes)+'"]')):S+='[href="'+aa(o)+'"]';var _=S;switch(c){case"style":_=mc(o);break;case"script":_=pc(o)}fa.has(_)||(o=p({rel:"preload",href:c==="image"&&h&&h.imageSrcSet?void 0:o,as:c},h),fa.set(_,o),v.querySelector(S)!==null||c==="style"&&v.querySelector(Md(_))||c==="script"&&v.querySelector(Rd(_))||(c=v.createElement("link"),Yn(c,"link",o),Cn(c),v.head.appendChild(c)))}}function vV(o,c){Ii.m(o,c);var h=hc;if(h&&o){var v=c&&typeof c.as=="string"?c.as:"script",S='link[rel="modulepreload"][as="'+aa(v)+'"][href="'+aa(o)+'"]',_=S;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=pc(o)}if(!fa.has(_)&&(o=p({rel:"modulepreload",href:o},c),fa.set(_,o),h.querySelector(S)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Rd(_)))return}v=h.createElement("link"),Yn(v,"link",o),Cn(v),h.head.appendChild(v)}}}function gV(o,c,h){Ii.S(o,c,h);var v=hc;if(v&&o){var S=$l(v).hoistableStyles,_=mc(o);c=c||"default";var M=S.get(_);if(!M){var z={loading:0,preload:null};if(M=v.querySelector(Md(_)))z.loading=5;else{o=p({rel:"stylesheet",href:o,"data-precedence":c},h),(h=fa.get(_))&&l0(o,h);var X=M=v.createElement("link");Cn(X),Yn(X,"link",o),X._p=new Promise(function(se,ge){X.onload=se,X.onerror=ge}),X.addEventListener("load",function(){z.loading|=1}),X.addEventListener("error",function(){z.loading|=2}),z.loading|=4,ep(M,c,v)}M={type:"stylesheet",instance:M,count:1,state:z},S.set(_,M)}}}function yV(o,c){Ii.X(o,c);var h=hc;if(h&&o){var v=$l(h).hoistableScripts,S=pc(o),_=v.get(S);_||(_=h.querySelector(Rd(S)),_||(o=p({src:o,async:!0},c),(c=fa.get(S))&&c0(o,c),_=h.createElement("script"),Cn(_),Yn(_,"link",o),h.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},v.set(S,_))}}function xV(o,c){Ii.M(o,c);var h=hc;if(h&&o){var v=$l(h).hoistableScripts,S=pc(o),_=v.get(S);_||(_=h.querySelector(Rd(S)),_||(o=p({src:o,async:!0,type:"module"},c),(c=fa.get(S))&&c0(o,c),_=h.createElement("script"),Cn(_),Yn(_,"link",o),h.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},v.set(S,_))}}function mk(o,c,h,v){var S=(S=xe.current)?Jm(S):null;if(!S)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(c=mc(h.href),h=$l(S).hoistableStyles,v=h.get(c),v||(v={type:"style",instance:null,count:0,state:null},h.set(c,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){o=mc(h.href);var _=$l(S).hoistableStyles,M=_.get(o);if(M||(S=S.ownerDocument||S,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(o,M),(_=S.querySelector(Md(o)))&&!_._p&&(M.instance=_,M.state.loading=5),fa.has(o)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},fa.set(o,h),_||bV(S,o,h,M.state))),c&&v===null)throw Error(r(528,""));return M}if(c&&v!==null)throw Error(r(529,""));return null;case"script":return c=h.async,h=h.src,typeof h=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=pc(h),h=$l(S).hoistableScripts,v=h.get(c),v||(v={type:"script",instance:null,count:0,state:null},h.set(c,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function mc(o){return'href="'+aa(o)+'"'}function Md(o){return'link[rel="stylesheet"]['+o+"]"}function pk(o){return p({},o,{"data-precedence":o.precedence,precedence:null})}function bV(o,c,h,v){o.querySelector('link[rel="preload"][as="style"]['+c+"]")?v.loading=1:(c=o.createElement("link"),v.preload=c,c.addEventListener("load",function(){return v.loading|=1}),c.addEventListener("error",function(){return v.loading|=2}),Yn(c,"link",h),Cn(c),o.head.appendChild(c))}function pc(o){return'[src="'+aa(o)+'"]'}function Rd(o){return"script[async]"+o}function vk(o,c,h){if(c.count++,c.instance===null)switch(c.type){case"style":var v=o.querySelector('style[data-href~="'+aa(h.href)+'"]');if(v)return c.instance=v,Cn(v),v;var S=p({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return v=(o.ownerDocument||o).createElement("style"),Cn(v),Yn(v,"style",S),ep(v,h.precedence,o),c.instance=v;case"stylesheet":S=mc(h.href);var _=o.querySelector(Md(S));if(_)return c.state.loading|=4,c.instance=_,Cn(_),_;v=pk(h),(S=fa.get(S))&&l0(v,S),_=(o.ownerDocument||o).createElement("link"),Cn(_);var M=_;return M._p=new Promise(function(z,X){M.onload=z,M.onerror=X}),Yn(_,"link",v),c.state.loading|=4,ep(_,h.precedence,o),c.instance=_;case"script":return _=pc(h.src),(S=o.querySelector(Rd(_)))?(c.instance=S,Cn(S),S):(v=h,(S=fa.get(_))&&(v=p({},h),c0(v,S)),o=o.ownerDocument||o,S=o.createElement("script"),Cn(S),Yn(S,"link",v),o.head.appendChild(S),c.instance=S);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(v=c.instance,c.state.loading|=4,ep(v,h.precedence,o));return c.instance}function ep(o,c,h){for(var v=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=v.length?v[v.length-1]:null,_=S,M=0;M title"):null)}function wV(o,c,h){if(h===1||c.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return o=c.disabled,typeof c.precedence=="string"&&o==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function xk(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function jV(o,c,h,v){if(h.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var S=mc(v.href),_=c.querySelector(Md(S));if(_){c=_._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(o.count++,o=np.bind(o),c.then(o,o)),h.state.loading|=4,h.instance=_,Cn(_);return}_=c.ownerDocument||c,v=pk(v),(S=fa.get(S))&&l0(v,S),_=_.createElement("link"),Cn(_);var M=_;M._p=new Promise(function(z,X){M.onload=z,M.onerror=X}),Yn(_,"link",v),h.instance=_}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(h,c),(c=h.state.preload)&&(h.state.loading&3)===0&&(o.count++,h=np.bind(o),c.addEventListener("load",h),c.addEventListener("error",h))}}var u0=0;function SV(o,c){return o.stylesheets&&o.count===0&&ap(o,o.stylesheets),0u0?50:800)+c);return o.unsuspend=h,function(){o.unsuspend=null,clearTimeout(v),clearTimeout(S)}}:null}function np(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ap(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var rp=null;function ap(o,c){o.stylesheets=null,o.unsuspend!==null&&(o.count++,rp=new Map,c.forEach(_V,o),rp=null,np.call(o))}function _V(o,c){if(!(c.state.loading&4)){var h=rp.get(o);if(h)var v=h.get(null);else{h=new Map,rp.set(o,h);for(var S=o.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),x0.exports=zV(),x0.exports}var FV=qV();const o_=new WeakMap,UV=new WeakMap,av={current:[]};let S0=!1,hf=0;const rf=new Set,hp=new Map;function M3(e){for(const t of e){if(av.current.includes(t))continue;av.current.push(t),t.recompute();const n=UV.get(t);if(n)for(const r of n){const a=o_.get(r);a?.length&&M3(a)}}}function HV(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function WV(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function R3(e){if(hf>0&&!hp.has(e)&&hp.set(e,e.prevState),rf.add(e),!(hf>0)&&!S0)try{for(S0=!0;rf.size>0;){const t=Array.from(rf);rf.clear();for(const n of t){const r=hp.get(n)??n.prevState;n.prevState=r,HV(n)}for(const n of t){const r=o_.get(n);r&&(av.current.push(n),M3(r))}for(const n of t){const r=o_.get(n);if(r)for(const a of r)WV(a)}}}finally{S0=!1,av.current=[],hp.clear()}}function mf(e){hf++;try{e()}finally{if(hf--,hf===0){const t=rf.values().next().value;t&&R3(t)}}}function VV(e){return typeof e=="function"}class GV{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var a,i;this.listeners.add(r);const l=(i=(a=this.options)==null?void 0:a.onSubscribe)==null?void 0:i.call(a,r,this);return()=>{this.listeners.delete(r),l?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,a;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):VV(t)?this.state=t(this.prevState):this.state=t,(a=(r=this.options)==null?void 0:r.onUpdate)==null||a.call(r),R3(this)}}const Uo="__TSR_index",Uk="popstate",Hk="beforeunload";function YV(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:l}))},a=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},i=async({task:l,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){l();return}const m=e.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&m.length&&p)for(const g of m){const x=iv(d.path,d.state);if(await g.blockerFn({currentLocation:t,nextLocation:x,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,u,d)=>{const f=t.state[Uo];u=Wk(f+1,u),i({task:()=>{e.pushState(l,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:u})},replace:(l,u,d)=>{const f=t.state[Uo];u=Wk(f,u),i({task:()=>{e.replaceState(l,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:u})},go:(l,u)=>{i({task:()=>{e.go(l),a({type:"GO",index:l})},navigateOpts:u,type:"GO"})},back:l=>{i({task:()=>{e.back(l?.ignoreBlocker??!1),a({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{i({task:()=>{e.forward(l?.ignoreBlocker??!1),a({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Uo]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Wk(e,t){t||(t={});const n=yO();return{...t,key:n,__TSR_key:n,[Uo]:e}}function KV(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let a=[];const i=()=>a,l=P=>a=P,u=(P=>P),d=(()=>iv(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const P=yO();t.history.replaceState({[Uo]:0,key:P,__TSR_key:P},"")}let f=d(),m,p=!1,g=!1,x=!1,j=!1;const b=()=>f;let w,N;const O=()=>{w&&(T._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),T._ignoreSubscribers=!1,w=void 0,N=void 0,m=void 0)},C=(P,$,F)=>{const D=u($);N||(m=f),f=iv($,F),w={href:D,state:F,isPush:w?.isPush||P==="push"},N||(N=Promise.resolve().then(()=>O()))},A=P=>{f=d(),T.notify({type:P})},E=async()=>{if(g){g=!1;return}const P=d(),$=P.state[Uo]-f.state[Uo],F=$===1,D=$===-1,U=!F&&!D||p;p=!1;const V=U?"GO":D?"BACK":"FORWARD",H=U?{type:"GO",index:$}:{type:D?"BACK":"FORWARD"};if(x)x=!1;else{const G=i();if(typeof document<"u"&&G.length){for(const L of G)if(await L.blockerFn({currentLocation:f,nextLocation:P,action:V})){g=!0,t.history.go(1),T.notify(H);return}}}f=d(),T.notify(H)},k=P=>{if(j){j=!1;return}let $=!1;const F=i();if(typeof document<"u"&&F.length)for(const D of F){const U=D.enableBeforeUnload??!0;if(U===!0){$=!0;break}if(typeof U=="function"&&U()===!0){$=!0;break}}if($)return P.preventDefault(),P.returnValue=""},T=YV({getLocation:b,getLength:()=>t.history.length,pushState:(P,$)=>C("push",P,$),replaceState:(P,$)=>C("replace",P,$),back:P=>(P&&(x=!0),j=!0,t.history.back()),forward:P=>{P&&(x=!0),j=!0,t.history.forward()},go:P=>{p=!0,t.history.go(P)},createHref:P=>u(P),flush:O,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Hk,k,{capture:!0}),t.removeEventListener(Uk,E)},onBlocked:()=>{m&&f!==m&&(f=m)},getBlockers:i,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(Hk,k,{capture:!0}),t.addEventListener(Uk,E),t.history.pushState=function(...P){const $=n.apply(t.history,P);return T._ignoreSubscribers||A("PUSH"),$},t.history.replaceState=function(...P){const $=r.apply(t.history,P);return T._ignoreSubscribers||A("REPLACE"),$},T}function iv(e,t){const n=e.indexOf("#"),r=e.indexOf("?"),a=yO();return{href:e,pathname:e.substring(0,n>0?r>0?Math.min(n,r):n:r>0?r:e.length),hash:n>-1?e.substring(n):"",search:r>-1?e.slice(r,n===-1?void 0:n):"",state:t||{[Uo]:0,key:a,__TSR_key:a}}}function yO(){return(Math.random()+1).toString(36).substring(7)}function s_(e){return e[e.length-1]}function XV(e){return typeof e=="function"}function Vs(e,t){return XV(e)?e(t):e}const ZV=Object.prototype.hasOwnProperty;function ga(e,t){if(e===t)return e;const n=t,r=Yk(e)&&Yk(n);if(!r&&!(ov(e)&&ov(n)))return n;const a=r?e:Vk(e);if(!a)return n;const i=r?n:Vk(n);if(!i)return n;const l=a.length,u=i.length,d=r?new Array(u):{};let f=0;for(let m=0;m"u")return!0;const n=t.prototype;return!(!Gk(n)||!n.hasOwnProperty("isPrototypeOf"))}function Gk(e){return Object.prototype.toString.call(e)==="[object Object]"}function Yk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Gs(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,a=e.length;ra||!Gs(e[l],t[l],n)))return!1;return a===i}return!1}function Gc(e){let t,n;const r=new Promise((a,i)=>{t=a,n=i});return r.status="pending",r.resolve=a=>{r.status="resolved",r.value=a,t(a),e?.(a)},r.reject=a=>{r.status="rejected",n(a)},r}function Ho(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const QV=Array.from(new Map([["%","%25"],["\\","%5C"]]).values());function Kk(e,t=QV){function n(a,i,l=0){for(let u=l;u{try{return decodeURI(u)}catch{return u}})}}if(e===""||!/%[0-9A-Fa-f]{2}/g.test(e))return e;const r=e.replaceAll(/%[0-9a-f]{2}/g,a=>a.toUpperCase());return n(r,t)}var JV="Invariant failed";function sr(e,t){if(!e)throw new Error(JV)}const si=0,nl=1,Yc=2,Kc=3;function Yi(e){return xO(e.filter(t=>t!==void 0).join("/"))}function xO(e){return e.replace(/\/{2,}/g,"/")}function bO(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Wo(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Wp(e){return Wo(bO(e))}function sv(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function eG(e,t,n){return sv(e,n)===sv(t,n)}function tG(e){const{type:t,value:n}=e;if(t===si)return n;const{prefixSegment:r,suffixSegment:a}=e;if(t===nl){const i=n.substring(1);if(r&&a)return`${r}{$${i}}${a}`;if(r)return`${r}{$${i}}`;if(a)return`{$${i}}${a}`}if(t===Kc){const i=n.substring(1);return r&&a?`${r}{-$${i}}${a}`:r?`${r}{-$${i}}`:a?`{-$${i}}${a}`:`{-$${i}}`}if(t===Yc){if(r&&a)return`${r}{$}${a}`;if(r)return`${r}{$}`;if(a)return`{$}${a}`}return n}function nG({base:e,to:t,trailingSlash:n="never",parseCache:r}){let a=Xc(e,r).slice();const i=Xc(t,r);a.length>1&&s_(a)?.value==="/"&&a.pop();for(let d=0,f=i.length;d1&&(s_(a).value==="/"?n==="never"&&a.pop():n==="always"&&a.push({type:si,value:"/"}));const l=a.map(tG);return Yi(l)}const Xc=(e,t)=>{if(!e)return[];const n=t?.get(e);if(n)return n;const r=lG(e);return t?.set(e,r),r},rG=/^\$.{1,}$/,aG=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,iG=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,oG=/^\$$/,sG=/^(.*?)\{\$\}(.*)$/;function lG(e){e=xO(e);const t=[];if(e.slice(0,1)==="/"&&(e=e.substring(1),t.push({type:si,value:"/"})),!e)return t;const n=e.split("/").filter(Boolean);return t.push(...n.map(r=>{const a=r.match(sG);if(a){const u=a[1],d=a[2];return{type:Yc,value:"$",prefixSegment:u||void 0,suffixSegment:d||void 0}}const i=r.match(iG);if(i){const u=i[1],d=i[2],f=i[3];return{type:Kc,value:d,prefixSegment:u||void 0,suffixSegment:f||void 0}}const l=r.match(aG);if(l){const u=l[1],d=l[2],f=l[3];return{type:nl,value:""+d,prefixSegment:u||void 0,suffixSegment:f||void 0}}if(rG.test(r)){const u=r.substring(1);return{type:nl,value:"$"+u,prefixSegment:void 0,suffixSegment:void 0}}return oG.test(r)?{type:Yc,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:si,value:r}})),e.slice(-1)==="/"&&(e=e.substring(1),t.push({type:si,value:"/"})),t}function _0({path:e,params:t,decodeCharMap:n,parseCache:r}){const a=Xc(e,r);function i(f){const m=t[f],p=typeof m=="string";return f==="*"||f==="_splat"?p?encodeURI(m):m:p?cG(m,n):m}let l=!1;const u={},d=Yi(a.map(f=>{if(f.type===si)return f.value;if(f.type===Yc){u._splat=t._splat,u["*"]=t._splat;const m=f.prefixSegment||"",p=f.suffixSegment||"";if(!t._splat)return l=!0,m||p?`${m}${p}`:void 0;const g=i("_splat");return`${m}${g}${p}`}if(f.type===nl){const m=f.value.substring(1);!l&&!(m in t)&&(l=!0),u[m]=t[m];const p=f.prefixSegment||"",g=f.suffixSegment||"";return`${p}${i(m)??"undefined"}${g}`}if(f.type===Kc){const m=f.value.substring(1),p=f.prefixSegment||"",g=f.suffixSegment||"";return!(m in t)||t[m]==null?p||g?`${p}${g}`:void 0:(u[m]=t[m],`${p}${i(m)??""}${g}`)}return f.value}));return{usedParams:u,interpolatedPath:d,isMissingParams:l}}function cG(e,t){let n=encodeURIComponent(e);if(t)for(const[r,a]of t)n=n.replaceAll(r,a);return n}function l_(e,t,n){const r=uG(e,t,n);if(!(t.to&&!r))return r??{}}function uG(e,{to:t,fuzzy:n,caseSensitive:r},a){const i=t,l=Xc(e.startsWith("/")?e:`/${e}`,a),u=Xc(i.startsWith("/")?i:`/${i}`,a),d={};return dG(l,u,d,n,r)?d:void 0}function dG(e,t,n,r,a){let i=0,l=0;for(;ib.value)));p&&j.startsWith(p)&&(j=j.slice(p.length)),g&&j.endsWith(g)&&(j=j.slice(0,j.length-g.length)),m=j}else m=decodeURI(Yi(f.map(p=>p.value)));return n["*"]=m,n._splat=m,!0}if(d.type===si){if(d.value==="/"&&!u?.value){l++;continue}if(u){if(a){if(d.value!==u.value)return!1}else if(d.value.toLowerCase()!==u.value.toLowerCase())return!1;i++,l++;continue}else return!1}if(d.type===nl){if(!u||u.value==="/")return!1;let f="",m=!1;if(d.prefixSegment||d.suffixSegment){const p=d.prefixSegment||"",g=d.suffixSegment||"",x=u.value;if(p&&!x.startsWith(p)||g&&!x.endsWith(g))return!1;let j=x;p&&j.startsWith(p)&&(j=j.slice(p.length)),g&&j.endsWith(g)&&(j=j.slice(0,j.length-g.length)),f=decodeURIComponent(j),m=!0}else f=decodeURIComponent(u.value),m=!0;m&&(n[d.value.substring(1)]=f,i++),l++;continue}if(d.type===Kc){if(!u){l++;continue}if(u.value==="/"){l++;continue}let f="",m=!1;if(d.prefixSegment||d.suffixSegment){const p=d.prefixSegment||"",g=d.suffixSegment||"",x=u.value;if((!p||x.startsWith(p))&&(!g||x.endsWith(g))){let j=x;p&&j.startsWith(p)&&(j=j.slice(p.length)),g&&j.endsWith(g)&&(j=j.slice(0,j.length-g.length)),f=decodeURIComponent(j),m=!0}}else{let p=!0;for(let g=l+1;g=t.length)return n["**"]=Yi(e.slice(i).map(f=>f.value)),!!r&&t[t.length-1]?.value!=="/";if(l=e.length){for(let f=l;f{if(r.isRoot||!r.path)return;const i=bO(r.fullPath);let l=Xc(i),u=0;for(;l.length>u+1&&l[u]?.value==="/";)u++;u>0&&(l=l.slice(u));let d=0,f=!1;const m=l.map((p,g)=>{if(p.value==="/")return fG;if(p.type===si)return hG;let x;p.type===nl?x=mG:p.type===Kc?(x=pG,d++):x=vG;for(let j=g+1;j{const i=Math.min(r.scores.length,a.scores.length);for(let l=0;la.parsed[l].value?1:-1;return r.index-a.index}).map((r,a)=>(r.child.rank=a,r.child))}function jG({routeTree:e,initRoute:t}){const n={},r={},a=l=>{l.forEach((u,d)=>{t?.(u,d);const f=n[u.id];if(sr(!f,`Duplicate routes found with id: ${String(u.id)}`),n[u.id]=u,!u.isRoot&&u.path){const p=Wo(u.fullPath);(!r[p]||u.fullPath.endsWith("/"))&&(r[p]=u)}const m=u.children;m?.length&&a(m)})};a([e]);const i=wG(Object.values(n));return{routesById:n,routesByPath:r,flatRoutes:i}}function La(e){return!!e?.isNotFound}function SG(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const lv="tsr-scroll-restoration-v1_3",_G=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function NG(){const e=SG();if(!e)return null;const t=e.getItem(lv);let n=t?JSON.parse(t):{};return{state:n,set:r=>(n=Vs(r,n)||n,e.setItem(lv,JSON.stringify(n)))}}const mp=NG(),c_=e=>e.state.__TSR_key||e.href;function OG(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let cv=!1;function D3({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:a,location:i}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const u=t||window.history.state?.__TSR_key,d=l[u];cv=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const p in d){const g=d[p];if(p==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(p){const x=document.querySelector(p);x&&(x.scrollLeft=g.scrollX,x.scrollTop=g.scrollY)}}break e}const f=(i??window.location).hash.split("#",2)[1];if(f){const p=window.history.state?.__hashScrollIntoViewOptions??!0;if(p){const g=document.getElementById(f);g&&g.scrollIntoView(p)}break e}const m={top:0,left:0,behavior:n};if(window.scrollTo(m),a)for(const p of a){if(p==="window")continue;const g=typeof p=="function"?p():document.querySelector(p);g&&g.scrollTo(m)}}cv=!1}function CG(e,t){if(!mp&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!mp))return;e.isScrollRestorationSetup=!0,cv=!1;const r=e.options.getScrollRestorationKey||c_;window.history.scrollRestoration="manual";const a=i=>{if(cv||!e.isScrollRestoring)return;let l="";if(i.target===document||i.target===window)l="window";else{const d=i.target.getAttribute("data-scroll-restoration-id");d?l=`[data-scroll-restoration-id="${d}"]`:l=OG(i.target)}const u=r(e.state.location);mp.set(d=>{const f=d[u]||={},m=f[l]||={};if(l==="window")m.scrollX=window.scrollX||0,m.scrollY=window.scrollY||0;else if(l){const p=document.querySelector(l);p&&(m.scrollX=p.scrollLeft||0,m.scrollY=p.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",_G(a,100),!0),e.subscribe("onRendered",i=>{const l=r(i.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(D3({storageKey:lv,key:l,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&mp.set(u=>(u[l]||={},u)))})}function EG(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function AG(e,t=String){const n=new URLSearchParams;for(const r in e){const a=e[r];a!==void 0&&n.set(r,t(a))}return n.toString()}function N0(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function TG(e){const t=new URLSearchParams(e),n={};for(const[r,a]of t.entries()){const i=n[r];i==null?n[r]=N0(a):Array.isArray(i)?i.push(N0(a)):n[r]=[i,N0(a)]}return n}const kG=MG(JSON.parse),PG=RG(JSON.stringify,JSON.parse);function MG(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=TG(t);for(const r in n){const a=n[r];if(typeof a=="string")try{n[r]=e(a)}catch{}}return n}}function RG(e,t){const n=typeof t=="function";function r(a){if(typeof a=="object"&&a!==null)try{return e(a)}catch{}else if(n&&typeof a=="string")try{return t(a),e(a)}catch{}return a}return a=>{const i=AG(a,r);return i?`?${i}`:""}}const Yr="__root__";function $3(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function ni(e){return e instanceof Response&&!!e.options}function DG(e){const t=new Map;let n,r;const a=i=>{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,n=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const l=t.get(i);if(l)return a(l),l.value},set(i,l){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const u=t.get(i);if(u)u.value=l,a(u);else{const d={key:i,value:l,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(i,d)}}}}const Vp=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ag=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),I3=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),sr(n.options.notFoundComponent);const r=e.matches.find(a=>a.routeId===n.id);sr(r,"Could not find match for route: "+n.id),e.updateMatch(r.id,a=>({...a,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,I3(e,t))},zo=(e,t,n)=>{if(!(!ni(n)&&!La(n))){if(ni(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const r=ni(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,a=>({...a,status:r,isFetching:!1,error:n})),La(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw ni(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(I3(e,n),n)}},L3=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},qd=(e,t,n,r)=>{const{id:a,routeId:i}=e.matches[t],l=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,zo(e,e.router.getMatch(a),n);try{l.options.onError?.(n)}catch(u){n=u,zo(e,e.router.getMatch(a),n)}e.updateMatch(a,u=>(u._nonReactive.beforeLoadPromise?.resolve(),u._nonReactive.beforeLoadPromise=void 0,u._nonReactive.loadPromise?.resolve(),{...u,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},$G=(e,t,n,r)=>{const a=e.router.getMatch(t),i=e.matches[n-1]?.id,l=i?e.router.getMatch(i):void 0;if(e.router.isShell()){a.ssr=r.id===Yr;return}if(l?.ssr===!1){a.ssr=!1;return}const u=x=>x===!0&&l?.ssr==="data-only"?"data-only":x,d=e.router.options.defaultSsr??!0;if(r.options.ssr===void 0){a.ssr=u(d);return}if(typeof r.options.ssr!="function"){a.ssr=u(r.options.ssr);return}const{search:f,params:m}=a,p={search:pp(f,a.searchError),params:pp(m,a.paramsError),location:e.location,matches:e.matches.map(x=>({index:x.index,pathname:x.pathname,fullPath:x.fullPath,staticData:x.staticData,id:x.id,routeId:x.routeId,search:pp(x.search,x.searchError),params:pp(x.params,x.paramsError),ssr:x.ssr}))},g=r.options.ssr(p);if(Ho(g))return g.then(x=>{a.ssr=u(x??d)});a.ssr=u(g??d)},B3=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const a=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!e.router.isServer&&!Ag(e,t)&&(n.options.loader||n.options.beforeLoad||F3(n))&&typeof a=="number"&&a!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const l=setTimeout(()=>{Vp(e)},a);r._nonReactive.pendingTimeout=l}},IG=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;B3(e,t,n,r);const a=()=>{const i=e.router.getMatch(t);i.preload&&(i.status==="redirected"||i.status==="notFound")&&zo(e,i,i.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(a):a()},LG=(e,t,n,r)=>{const a=e.router.getMatch(t),i=a._nonReactive.loadPromise;a._nonReactive.loadPromise=Gc(()=>{i?.resolve()});const{paramsError:l,searchError:u}=a;l&&qd(e,n,l,"PARSE_PARAMS"),u&&qd(e,n,u,"VALIDATE_SEARCH"),B3(e,t,r,a);const d=new AbortController,f=e.matches[n-1]?.id,g={...(f?e.router.getMatch(f):void 0)?.context??e.router.options.context??void 0,...a.__routeContext};let x=!1;const j=()=>{x||(x=!0,e.updateMatch(t,T=>({...T,isFetching:"beforeLoad",fetchCount:T.fetchCount+1,abortController:d,context:g})))},b=()=>{a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,T=>({...T,isFetching:!1}))};if(!r.options.beforeLoad){mf(()=>{j(),b()});return}a._nonReactive.beforeLoadPromise=Gc();const{search:w,params:N,cause:O}=a,C=Ag(e,t),A={search:w,abortController:d,params:N,preload:C,context:g,location:e.location,navigate:T=>e.router.navigate({...T,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:C?"preload":O,matches:e.matches,...e.router.options.additionalContext},E=T=>{if(T===void 0){mf(()=>{j(),b()});return}(ni(T)||La(T))&&(j(),qd(e,n,T,"BEFORE_LOAD")),mf(()=>{j(),e.updateMatch(t,P=>({...P,__beforeLoadContext:T,context:{...P.context,...T}})),b()})};let k;try{if(k=r.options.beforeLoad(A),Ho(k))return j(),k.catch(T=>{qd(e,n,T,"BEFORE_LOAD")}).then(E)}catch(T){j(),qd(e,n,T,"BEFORE_LOAD")}E(k)},BG=(e,t)=>{const{id:n,routeId:r}=e.matches[t],a=e.router.looseRoutesById[r],i=()=>{if(e.router.isServer){const d=$G(e,n,t,a);if(Ho(d))return d.then(u)}return u()},l=()=>LG(e,n,t,a),u=()=>{if(L3(e,n))return;const d=IG(e,n,a);return Ho(d)?d.then(l):l()};return i()},pf=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const a={matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(a),n.options.scripts?.(a),n.options.headers?.(a)]).then(([i,l,u])=>{const d=i?.meta,f=i?.links,m=i?.scripts,p=i?.styles;return{meta:d,links:f,headScripts:m,headers:u,scripts:l,styles:p}})},z3=(e,t,n,r)=>{const a=e.matchPromises[n-1],{params:i,loaderDeps:l,abortController:u,cause:d}=e.router.getMatch(t);let f=e.router.options.context??{};for(let p=0;p<=n;p++){const g=e.matches[p];if(!g)continue;const x=e.router.getMatch(g.id);x&&(f={...f,...x.__routeContext??{},...x.__beforeLoadContext??{}})}const m=Ag(e,t);return{params:i,deps:l,preload:!!m,parentMatchPromise:a,abortController:u,context:f,location:e.location,navigate:p=>e.router.navigate({...p,_fromLocation:e.location}),cause:m?"preload":d,route:r,...e.router.options.additionalContext}},Jk=async(e,t,n,r)=>{try{const a=e.router.getMatch(t);try{(!e.router.isServer||a.ssr===!0)&&q3(r);const i=r.options.loader?.(z3(e,t,n,r)),l=r.options.loader&&Ho(i);if(!!(l||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(t,p=>({...p,isFetching:"loader"})),r.options.loader){const p=l?await i:i;zo(e,e.router.getMatch(t),p),p!==void 0&&e.updateMatch(t,g=>({...g,loaderData:p}))}r._lazyPromise&&await r._lazyPromise;const d=pf(e,t,r),f=d?await d:void 0,m=a._nonReactive.minPendingPromise;m&&await m,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,p=>({...p,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...f}))}catch(i){let l=i;const u=a._nonReactive.minPendingPromise;u&&await u,La(i)&&await r.options.notFoundComponent?.preload?.(),zo(e,e.router.getMatch(t),i);try{r.options.onError?.(i)}catch(m){l=m,zo(e,e.router.getMatch(t),m)}const d=pf(e,t,r),f=d?await d:void 0;e.updateMatch(t,m=>({...m,error:l,status:"error",isFetching:!1,...f}))}}catch(a){const i=e.router.getMatch(t);if(i){const l=pf(e,t,r);if(l){const u=await l;e.updateMatch(t,d=>({...d,...u}))}i._nonReactive.loaderPromise=void 0}zo(e,i,a)}},zG=async(e,t)=>{const{id:n,routeId:r}=e.matches[t];let a=!1,i=!1;const l=e.router.looseRoutesById[r];if(L3(e,n)){if(e.router.isServer){const f=pf(e,n,l);if(f){const m=await f;e.updateMatch(n,p=>({...p,...m}))}return e.router.getMatch(n)}}else{const f=e.router.getMatch(n);if(f._nonReactive.loaderPromise){if(f.status==="success"&&!e.sync&&!f.preload)return f;await f._nonReactive.loaderPromise;const m=e.router.getMatch(n),p=m._nonReactive.error||m.error;p&&zo(e,m,p)}else{const m=Date.now()-f.updatedAt,p=Ag(e,n),g=p?l.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:l.options.staleTime??e.router.options.defaultStaleTime??0,x=l.options.shouldReload,j=typeof x=="function"?x(z3(e,n,t,l)):x,b=!!p&&!e.router.state.matches.some(C=>C.id===n),w=e.router.getMatch(n);w._nonReactive.loaderPromise=Gc(),b!==w.preload&&e.updateMatch(n,C=>({...C,preload:b}));const{status:N,invalid:O}=w;if(a=N==="success"&&(O||(j??m>g)),!(p&&l.options.preload===!1))if(a&&!e.sync)i=!0,(async()=>{try{await Jk(e,n,t,l);const C=e.router.getMatch(n);C._nonReactive.loaderPromise?.resolve(),C._nonReactive.loadPromise?.resolve(),C._nonReactive.loaderPromise=void 0}catch(C){ni(C)&&await e.router.navigate(C.options)}})();else if(N!=="success"||a&&e.sync)await Jk(e,n,t,l);else{const C=pf(e,n,l);if(C){const A=await C;e.updateMatch(n,E=>({...E,...A}))}}}}const u=e.router.getMatch(n);i||(u._nonReactive.loaderPromise?.resolve(),u._nonReactive.loadPromise?.resolve()),clearTimeout(u._nonReactive.pendingTimeout),u._nonReactive.pendingTimeout=void 0,i||(u._nonReactive.loaderPromise=void 0),u._nonReactive.dehydrated=void 0;const d=i?u.isFetching:!1;return d!==u.isFetching||u.invalid!==!1?(e.updateMatch(n,f=>({...f,isFetching:d,invalid:!1})),e.router.getMatch(n)):u};async function eP(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&Vp(t);try{for(let a=0;a{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of U3){const a=e.options[r]?.preload;a&&n.push(a())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function pp(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function F3(e){for(const t of U3)if(e.options[t]?.preload)return!0;return!1}const U3=["component","errorComponent","pendingComponent","notFoundComponent"];function qG(e){return{input:({url:t})=>{for(const n of e)t=H3(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=W3(e[n],t);return t}}}function FG(e){const t=Wp(e.basepath),n=`/${t}`,r=`${n}/`,a=e.caseSensitive?n:n.toLowerCase(),i=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const u=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return u===a?l.pathname="/":u.startsWith(i)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=Yi(["/",t,l.pathname]),l)}}function H3(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function W3(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Ys(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,a=t?.href!==n.href,i=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:a,hashChanged:i}}class UG{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,a=this.basepath??r?.basepath??"/",i=this.basepath===void 0,l=r?.rewrite;this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(g=>[encodeURIComponent(g),g])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=KV())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new GV(WG(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),CG(this));let u=!1;const d=this.options.basepath??"/",f=this.options.rewrite;if(i||a!==d||l!==f){this.basepath=d;const g=[];Wp(d)!==""&&g.push(FG({basepath:d})),f&&g.push(f),this.rewrite=g.length===0?void 0:g.length===1?g[0]:qG(g),this.history&&this.updateLatestLocation(),u=!0}u&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:n,routesByPath:r,flatRoutes:a}=jG({routeTree:this.routeTree,initRoute:(l,u)=>{l.init({originalIndex:u})}});this.routesById=n,this.routesByPath=r,this.flatRoutes=a;const i=this.options.notFoundRoute;i&&(i.init({originalIndex:99999999999}),this.routesById[i.id]=i)},this.subscribe=(n,r)=>{const a={eventType:n,fn:r};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const a=({href:d,state:f})=>{const m=new URL(d,this.origin),p=H3(this.rewrite,m),g=this.options.parseSearch(p.search),x=this.options.stringifySearch(g);p.search=x;const j=p.href.replace(p.origin,""),{pathname:b,hash:w}=p;return{href:j,publicHref:d,url:p.href,pathname:Kk(b),searchStr:x,search:ga(r?.search,g),hash:w.split("#").reverse()[0]??"",state:ga(r?.state,f)}},i=a(n),{__tempLocation:l,__tempKey:u}=i.state;if(l&&(!u||u===this.tempLocationKey)){const d=a(l);return d.state.key=i.state.key,d.state.__TSR_key=i.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:i}}return i},this.resolvePathWithBase=(n,r)=>nG({base:n,to:xO(r),trailingSlash:this.options.trailingSlash,parseCache:this.parsePathnameCache}),this.matchRoutes=(n,r,a)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},a):this.matchRoutesInternal(n,r),this.parsePathnameCache=DG(1e3),this.getMatchedRoutes=(n,r)=>VG({pathname:n,routePathname:r,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes,parseCache:this.parsePathnameCache}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(i=>i.status==="pending"),r=this.state.matches.filter(i=>i.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(i=>{this.cancelMatch(i.id)})},this.buildLocation=n=>{const r=(i={})=>{const l=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutes(l,{_buildLocation:!0}),d=s_(u);i.from;const f=i.unsafeRelative==="path"?l.pathname:i.from??d.fullPath,m=this.resolvePathWithBase(f,"."),p=d.search,g={...d.params},x=i.to?this.resolvePathWithBase(m,`${i.to}`):this.resolvePathWithBase(m,"."),j=i.params===!1||i.params===null?{}:(i.params??!0)===!0?g:Object.assign(g,Vs(i.params,g)),b=_0({path:x,params:j,parseCache:this.parsePathnameCache}).interpolatedPath,w=this.matchRoutes(b,void 0,{_buildLocation:!0}).map(F=>this.looseRoutesById[F.routeId]);if(Object.keys(j).length>0)for(const F of w){const D=F.options.params?.stringify??F.options.stringifyParams;D&&Object.assign(j,D(j))}const N=n.leaveParams?x:Kk(_0({path:x,params:j,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath);let O=p;if(n._includeValidateSearch&&this.options.search?.strict){const F={};w.forEach(D=>{if(D.options.validateSearch)try{Object.assign(F,u_(D.options.validateSearch,{...F,...O}))}catch{}}),O=F}O=GG({search:O,dest:i,destRoutes:w,_includeValidateSearch:n._includeValidateSearch}),O=ga(p,O);const C=this.options.stringifySearch(O),A=i.hash===!0?l.hash:i.hash?Vs(i.hash,l.hash):void 0,E=A?`#${A}`:"";let k=i.state===!0?l.state:i.state?Vs(i.state,l.state):{};k=ga(l.state,k);const T=`${N}${C}${E}`,P=new URL(T,this.origin),$=W3(this.rewrite,P);return{publicHref:$.pathname+$.search+$.hash,href:T,url:$.href,pathname:N,search:O,searchStr:C,state:k,hash:A??"",unmaskOnReload:i.unmaskOnReload}},a=(i={},l)=>{const u=r(i);let d=l?r(l):void 0;if(!d){let f={};const m=this.options.routeMasks?.find(p=>{const g=l_(u.pathname,{to:p.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return g?(f=g,!0):!1});if(m){const{from:p,...g}=m;l={from:n.from,...g,params:f},d=r(l)}}return d&&(u.maskedLocation=d),u};return n.mask?a(n,{from:n.from,...n.mask}):a(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:r,...a})=>{const i=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(m=>{a.state[m]=this.latestLocation.state[m]});const f=Gs(a.state,this.latestLocation.state);return d.forEach(m=>{delete a.state[m]}),f},l=Wo(this.latestLocation.href)===Wo(a.href),u=this.commitLocationPromise;if(this.commitLocationPromise=Gc(()=>{u?.resolve()}),l&&i())this.load();else{let{maskedLocation:d,hashScrollIntoView:f,...m}=a;d&&(m={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[a.replace?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:r})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:a,viewTransition:i,ignoreBlocker:l,href:u,...d}={})=>{if(u){const p=this.history.location.state.__TSR_index,g=iv(u,{__TSR_index:n?p:p+1});d.to=g.pathname,d.search=this.options.parseSearch(g.search),d.hash=g.hash.slice(1)}const f=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const m=this.commitLocation({...f,viewTransition:i,replace:n,resetScroll:r,hashScrollIntoView:a,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=({to:n,reloadDocument:r,href:a,...i})=>{if(!r&&a)try{new URL(`${a}`),r=!0}catch{}return r?(a||(a=this.buildLocation({to:n,...i}).url),i.replace?window.location.replace(a):window.location.href=a,Promise.resolve()):this.buildAndCommitLocation({...i,href:a,to:n,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const r=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),a=i=>{try{return encodeURI(decodeURI(i))}catch{return i}};if(Wp(a(this.latestLocation.href))!==Wp(a(r.href))){let i=r.url;throw this.origin&&i.startsWith(this.origin)&&(i=i.replace(this.origin,"")||"/"),$3({href:i})}}const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(a=>!n.some(i=>i.id===a.id))}))},this.load=async n=>{let r,a,i;for(i=new Promise(u=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Ys({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...Ys({resolvedLocation:f,location:d})}),await eP({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let m=[],p=[],g=[];mf(()=>{this.__store.setState(x=>{const j=x.matches,b=x.pendingMatches||x.matches;return m=j.filter(w=>!b.some(N=>N.id===w.id)),p=b.filter(w=>!j.some(N=>N.id===w.id)),g=b.filter(w=>j.some(N=>N.id===w.id)),{...x,isLoading:!1,loadedAt:Date.now(),matches:b,pendingMatches:void 0,cachedMatches:[...x.cachedMatches,...m.filter(w=>w.status!=="error")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[p,"onEnter"],[g,"onStay"]].forEach(([x,j])=>{x.forEach(b=>{this.looseRoutesById[b.routeId].options[j]?.(b)})})})})}})}catch(d){ni(d)?(r=d,this.isServer||this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):La(d)&&(a=d),this.__store.setState(f=>({...f,statusCode:r?r.status:a?404:f.matches.some(m=>m.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),u()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(u=>u.status==="error")&&(l=500),l!==void 0&&this.__store.setState(u=>({...u,statusCode:l}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,l=this.state.resolvedLocation,u=typeof r.types=="function"?r.types(Ys({resolvedLocation:l,location:i})):r.types;if(u===!1){n();return}a={update:n,types:u}}else a=n;document.startViewTransition(a)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const a=this.state.pendingMatches?.some(i=>i.id===n)?"pendingMatches":this.state.matches.some(i=>i.id===n)?"matches":this.state.cachedMatches.some(i=>i.id===n)?"cachedMatches":"";a&&this.__store.setState(i=>({...i,[a]:i[a]?.map(l=>l.id===n?r(l):l)}))})},this.getMatch=n=>{const r=a=>a.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=a=>n?.filter?.(a)??!0?{...a,invalid:!0,...n?.forcePending||a.status==="error"?{status:"pending",error:void 0}:void 0}:a;return this.__store.setState(a=>({...a,matches:a.matches.map(r),cachedMatches:a.cachedMatches.map(r),pendingMatches:a.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.resolveRedirect=n=>{if(!n.options.href){const r=this.buildLocation(n.options);let a=r.url;this.origin&&a.startsWith(this.origin)&&(a=a.replace(this.origin,"")||"/"),n.options.href=r.href,n.headers.set("Location",a)}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(a=>({...a,cachedMatches:a.cachedMatches.filter(i=>!r(i))})):this.__store.setState(a=>({...a,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const a=this.looseRoutesById[r.routeId];if(!a.options.loader)return!0;const i=(r.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=i};this.clearCache({filter:n})},this.loadRouteChunk=q3,this.preloadRoute=async n=>{const r=this.buildLocation(n);let a=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(u=>u.id)),l=new Set([...i,...this.state.cachedMatches.map(u=>u.id)]);mf(()=>{a.forEach(u=>{l.has(u.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,u]}))})});try{return a=await eP({router:this,matches:a,location:r,preload:!0,updateMatch:(u,d)=>{i.has(u)?a=a.map(f=>f.id===u?d(f):f):this.updateMatch(u,d)}}),a}catch(u){if(ni(u))return u.options.reloadDocument?void 0:await this.preloadRoute({...u.options,_fromLocation:r});La(u)||console.error(u);return}},this.matchRoute=(n,r)=>{const a={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},i=this.buildLocation(a);if(r?.pending&&this.state.status!=="pending")return!1;const u=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=l_(u.pathname,{...r,to:i.pathname},this.parsePathnameCache);return!d||n.params&&!Gs(d,n.params,{partial:!0})?!1:d&&(r?.includeSearch??!0)?Gs(u.search,i.search,{partial:!0})?d:!1:d},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??PG,parseSearch:t.parseSearch??kG}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const{foundRoute:r,matchedRoutes:a,routeParams:i}=this.getMatchedRoutes(t.pathname,n?.dest?.to);let l=!1;(r?r.path!=="/"&&i["**"]:Wo(t.pathname))&&(this.options.notFoundRoute?a.push(this.options.notFoundRoute):l=!0);const u=(()=>{if(l){if(this.options.notFoundMode!=="root")for(let m=a.length-1;m>=0;m--){const p=a[m];if(p.children)return p.id}return Yr}})(),d=[],f=m=>m?.id?m.context??this.options.context??void 0:this.options.context??void 0;return a.forEach((m,p)=>{const g=d[p-1],[x,j,b]=(()=>{const U=g?.search??t.search,V=g?._strictSearch??void 0;try{const H=u_(m.options.validateSearch,{...U})??void 0;return[{...U,...H},{...V,...H},void 0]}catch(H){let G=H;if(H instanceof uv||(G=new uv(H.message,{cause:H})),n?.throwOnError)throw G;return[U,{},G]}})(),w=m.options.loaderDeps?.({search:x})??"",N=w?JSON.stringify(w):"",{interpolatedPath:O,usedParams:C}=_0({path:m.fullPath,params:i,decodeCharMap:this.pathParamsDecodeCharMap}),A=m.id+O+N,E=this.getMatch(A),k=this.state.matches.find(U=>U.routeId===m.id),T=E?._strictParams??C;let P;if(!E){const U=m.options.params?.parse??m.options.parseParams;if(U)try{Object.assign(T,U(T))}catch(V){if(P=new HG(V.message,{cause:V}),n?.throwOnError)throw P}}Object.assign(i,T);const $=k?"stay":"enter";let F;if(E)F={...E,cause:$,params:k?ga(k.params,i):i,_strictParams:T,search:ga(k?k.search:E.search,x),_strictSearch:j};else{const U=m.options.loader||m.options.beforeLoad||m.lazyFn||F3(m)?"pending":"success";F={id:A,index:p,routeId:m.id,params:k?ga(k.params,i):i,_strictParams:T,pathname:O,updatedAt:Date.now(),search:k?ga(k.search,x):x,_strictSearch:j,searchError:void 0,status:U,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:Gc()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:$,loaderDeps:k?ga(k.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}n?.preload||(F.globalNotFound=u===m.id),F.searchError=b;const D=f(g);F.context={...D,...F.__routeContext,...F.__beforeLoadContext},d.push(F)}),d.forEach((m,p)=>{const g=this.looseRoutesById[m.routeId];if(!this.getMatch(m.id)&&n?._buildLocation!==!0){const j=d[p-1],b=f(j);if(g.options.context){const w={deps:m.loaderDeps,params:m.params,context:b??{},location:t,navigate:N=>this.navigate({...N,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d};m.__routeContext=g.options.context(w)??void 0}m.context={...b,...m.__routeContext,...m.__beforeLoadContext}}}),d}}class uv extends Error{}class HG extends Error{}function WG(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function u_(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new uv("Async validation not supported");if(n.issues)throw new uv(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function VG({pathname:e,routePathname:t,caseSensitive:n,routesByPath:r,routesById:a,flatRoutes:i,parseCache:l}){let u={};const d=Wo(e),f=x=>l_(d,{to:x.fullPath,caseSensitive:x.options?.caseSensitive??n,fuzzy:!0},l);let m=t!==void 0?r[t]:void 0;if(m)u=f(m);else{let x;for(const j of i){const b=f(j);if(b)if(j.path!=="/"&&b["**"])x||(x={foundRoute:j,routeParams:b});else{m=j,u=b;break}}!m&&x&&(m=x.foundRoute,u=x.routeParams)}let p=m||a[Yr];const g=[p];for(;p.parentRoute;)p=p.parentRoute,g.push(p);return g.reverse(),{matchedRoutes:g,routeParams:u,foundRoute:m}}function GG({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){const a=n.reduce((u,d)=>{const f=[];if("search"in d.options)d.options.search?.middlewares&&f.push(...d.options.search.middlewares);else if(d.options.preSearchFilters||d.options.postSearchFilters){const m=({search:p,next:g})=>{let x=p;"preSearchFilters"in d.options&&d.options.preSearchFilters&&(x=d.options.preSearchFilters.reduce((b,w)=>w(b),p));const j=g(x);return"postSearchFilters"in d.options&&d.options.postSearchFilters?d.options.postSearchFilters.reduce((b,w)=>w(b),j):j};f.push(m)}if(r&&d.options.validateSearch){const m=({search:p,next:g})=>{const x=g(p);try{return{...x,...u_(d.options.validateSearch,x)??void 0}}catch{return x}};f.push(m)}return u.concat(f)},[])??[],i=({search:u})=>t.search?t.search===!0?u:Vs(t.search,u):{};a.push(i);const l=(u,d)=>{if(u>=a.length)return d;const f=a[u];return f({search:d,next:p=>l(u+1,p)})};return l(0,e)}const YG="Error preloading route! ☝️";class V3{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,a=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=Yr:this.parentRoute||sr(!1);let i=a?Yr:r?.path;i&&i!=="/"&&(i=bO(i));const l=r?.id||i;let u=a?Yr:Yi([this.parentRoute.id===Yr?"":this.parentRoute.id,l]);i===Yr&&(i="/"),u!==Yr&&(u=Yi(["/",u]));const d=u===Yr?"/":Yi([this.parentRoute.fullPath,i]);this._path=i,this._id=u,this._fullPath=d,this._to=d},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class KG extends V3{constructor(t){super(t)}}function wO(e){const t=e.errorComponent??Tg;return s.jsx(XG,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?y.createElement(t,{error:n,reset:r}):e.children})}class XG extends y.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Tg({error:e}){const[t,n]=y.useState(!1);return s.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[s.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),s.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),s.jsx("div",{style:{height:".25rem"}}),t?s.jsx("div",{children:s.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?s.jsx("code",{children:e.message}):null})}):null]})}function ZG({children:e,fallback:t=null}){return QG()?s.jsx(W.Fragment,{children:e}):s.jsx(W.Fragment,{children:t})}function QG(){return W.useSyncExternalStore(JG,()=>!0,()=>!1)}function JG(){return()=>{}}var O0={exports:{}},C0={},E0={exports:{}},A0={};var tP;function eY(){if(tP)return A0;tP=1;var e=vh();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function u(p,g){var x=g(),j=r({inst:{value:x,getSnapshot:g}}),b=j[0].inst,w=j[1];return i(function(){b.value=x,b.getSnapshot=g,d(b)&&w({inst:b})},[p,x,g]),a(function(){return d(b)&&w({inst:b}),p(function(){d(b)&&w({inst:b})})},[p]),l(x),x}function d(p){var g=p.getSnapshot;p=p.value;try{var x=g();return!n(p,x)}catch{return!0}}function f(p,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return A0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,A0}var nP;function tY(){return nP||(nP=1,E0.exports=eY()),E0.exports}var rP;function nY(){if(rP)return C0;rP=1;var e=vh(),t=tY();function n(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return C0.useSyncExternalStoreWithSelector=function(f,m,p,g,x){var j=i(null);if(j.current===null){var b={hasValue:!1,value:null};j.current=b}else b=j.current;j=u(function(){function N(k){if(!O){if(O=!0,C=k,k=g(k),x!==void 0&&b.hasValue){var T=b.value;if(x(T,k))return A=T}return A=k}if(T=A,r(C,k))return T;var P=g(k);return x!==void 0&&x(T,P)?(C=k,T):(C=k,A=P)}var O=!1,C,A,E=p===void 0?null:p;return[function(){return N(m())},E===null?void 0:function(){return N(E())}]},[m,p,g,x]);var w=a(f,j[0],j[1]);return l(function(){b.hasValue=!0,b.value=w},[w]),d(w),w},C0}var aP;function rY(){return aP||(aP=1,O0.exports=nY()),O0.exports}var aY=rY();function iY(e,t=r=>r,n={}){const r=n.equal??oY;return aY.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function oY(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!t.has(r)||!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=iP(e);if(n.length!==iP(t).length)return!1;for(let r=0;r"u"?T0:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=T0,T0)}function Mr(e){const t=y.useContext(G3());return e?.warn,t}function xr(e){const t=Mr({warn:e?.router===void 0}),n=e?.router||t,r=y.useRef(void 0);return iY(n.__store,a=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const i=ga(r.current,e.select(a));return r.current=i,i}return e.select(a)}return a})}const kg=y.createContext(void 0),sY=y.createContext(void 0);function di(e){const t=y.useContext(e.from?sY:kg);return xr({select:r=>{const a=r.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(sr(!((e.shouldThrow??!0)&&!a),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),a!==void 0)return e.select?e.select(a):a},structuralSharing:e.structuralSharing})}function jO(e){return di({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function SO(e){const{select:t,...n}=e;return di({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function _O(e){return di({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function NO(e){return di({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function qa(e){const t=Mr();return y.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var pl=P3();const lY=wt(pl),vp=typeof window<"u"?y.useLayoutEffect:y.useEffect;function k0(e){const t=y.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function cY(e,t,n={},r={}){y.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const a=new IntersectionObserver(([i])=>{t(i)},n);return a.observe(e.current),()=>{a.disconnect()}},[t,n,r.disabled,e])}function uY(e){const t=y.useRef(null);return y.useImperativeHandle(e,()=>t.current,[]),t}function dY(e,t){const n=Mr(),[r,a]=y.useState(!1),i=y.useRef(!1),l=uY(t),{activeProps:u,inactiveProps:d,activeOptions:f,to:m,preload:p,preloadDelay:g,hashScrollIntoView:x,replace:j,startTransition:b,resetScroll:w,viewTransition:N,children:O,target:C,disabled:A,style:E,className:k,onClick:T,onFocus:P,onMouseEnter:$,onMouseLeave:F,onTouchStart:D,ignoreBlocker:U,params:V,search:H,hash:G,state:L,mask:R,reloadDocument:q,unsafeRelative:K,from:ee,_fromLocation:I,...B}=e,Y=xr({select:it=>it.location.search,structuralSharing:!0}),te=e.from,oe=y.useMemo(()=>({...e,from:te}),[n,Y,te,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),xe=y.useMemo(()=>n.buildLocation({...oe}),[n,oe]),J=y.useMemo(()=>{if(A)return;let it=xe.maskedLocation?xe.maskedLocation.url:xe.url,nt=!1;return n.origin&&(it.startsWith(n.origin)?it=n.history.createHref(it.replace(n.origin,""))||"/":nt=!0),{href:it,external:nt}},[A,xe.maskedLocation,xe.url,n.origin,n.history]),ae=y.useMemo(()=>{if(J?.external)return J.href;try{return new URL(m),m}catch{}},[m,J]),Z=e.reloadDocument||ae?!1:p??n.options.defaultPreload,pe=g??n.options.defaultPreloadDelay??0,je=xr({select:it=>{if(ae)return!1;if(f?.exact){if(!eG(it.location.pathname,xe.pathname,n.basepath))return!1}else{const nt=sv(it.location.pathname,n.basepath),Nn=sv(xe.pathname,n.basepath);if(!(nt.startsWith(Nn)&&(nt.length===Nn.length||nt[Nn.length]==="/")))return!1}return(f?.includeSearch??!0)&&!Gs(it.location.search,xe.search,{partial:!f?.exact,ignoreUndefined:!f?.explicitUndefined})?!1:f?.includeHash?it.location.hash===xe.hash:!0}}),le=y.useCallback(()=>{n.preloadRoute({...oe}).catch(it=>{console.warn(it),console.warn(YG)})},[n,oe]),Re=y.useCallback(it=>{it?.isIntersecting&&le()},[le]);cY(l,Re,vY,{disabled:!!A||Z!=="viewport"}),y.useEffect(()=>{i.current||!A&&Z==="render"&&(le(),i.current=!0)},[A,le,Z]);const _e=it=>{const nt=it.currentTarget.getAttribute("target"),Nn=C!==void 0?C:nt;if(!A&&!gY(it)&&!it.defaultPrevented&&(!Nn||Nn==="_self")&&it.button===0){it.preventDefault(),pl.flushSync(()=>{a(!0)});const ds=n.subscribe("onResolved",()=>{ds(),a(!1)});n.navigate({...oe,replace:j,resetScroll:w,hashScrollIntoView:x,startTransition:b,viewTransition:N,ignoreBlocker:U})}};if(ae)return{...B,ref:l,href:ae,...O&&{children:O},...C&&{target:C},...A&&{disabled:A},...E&&{style:E},...k&&{className:k},...T&&{onClick:T},...P&&{onFocus:P},...$&&{onMouseEnter:$},...F&&{onMouseLeave:F},...D&&{onTouchStart:D}};const he=it=>{A||Z&&le()},ve=he,Le=it=>{if(!(A||!Z))if(!pe)le();else{const nt=it.target;if(Fd.has(nt))return;const Nn=setTimeout(()=>{Fd.delete(nt),le()},pe);Fd.set(nt,Nn)}},Mt=it=>{if(A||!Z||!pe)return;const nt=it.target,Nn=Fd.get(nt);Nn&&(clearTimeout(Nn),Fd.delete(nt))},vn=je?Vs(u,{})??fY:P0,fr=je?P0:Vs(d,{})??P0,er=[k,vn.className,fr.className].filter(Boolean).join(" "),hr=(E||vn.style||fr.style)&&{...E,...vn.style,...fr.style};return{...B,...vn,...fr,href:J?.href,ref:l,onClick:Ud([T,_e]),onFocus:Ud([P,he]),onMouseEnter:Ud([$,Le]),onMouseLeave:Ud([F,Mt]),onTouchStart:Ud([D,ve]),disabled:!!A,target:C,...hr&&{style:hr},...er&&{className:er},...A&&hY,...je&&mY,...r&&pY}}const P0={},fY={className:"active"},hY={role:"link","aria-disabled":!0},mY={"data-status":"active","aria-current":"page"},pY={"data-transitioning":"transitioning"},Fd=new WeakMap,vY={rootMargin:"100px"},Ud=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},OO=y.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:a,ref:i,...l}=dY(r,t),u=typeof r.children=="function"?r.children({isActive:l["data-status"]==="active"}):r.children;return n===void 0&&delete l.disabled,y.createElement(n||"a",{...l,ref:i},u)});function gY(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class yY extends V3{constructor(t){super(t),this.useMatch=n=>di({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>di({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>NO({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>_O({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>SO({...n,from:this.id}),this.useLoaderData=n=>jO({...n,from:this.id}),this.useNavigate=()=>qa({from:this.fullPath}),this.Link=W.forwardRef((n,r)=>s.jsx(OO,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function cr(e){return new yY(e)}class xY extends KG{constructor(t){super(t),this.useMatch=n=>di({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>di({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>NO({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>_O({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>SO({...n,from:this.id}),this.useLoaderData=n=>jO({...n,from:this.id}),this.useNavigate=()=>qa({from:this.fullPath}),this.Link=W.forwardRef((n,r)=>s.jsx(OO,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function bY(e){return new xY(e)}function oP(e){return typeof e=="object"?new sP(e,{silent:!0}).createRoute(e):new sP(e,{silent:!0}).createRoute}class sP{constructor(t,n){this.path=t,this.createRoute=r=>{this.silent;const a=cr(r);return a.isRoot=!1,a},this.silent=n?.silent}}class lP{constructor(t){this.useMatch=n=>di({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>di({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>NO({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>_O({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>SO({...n,from:this.options.id}),this.useLoaderData=n=>jO({...n,from:this.options.id}),this.useNavigate=()=>{const n=Mr();return qa({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function cP(e){return typeof e=="object"?new lP(e):t=>new lP({id:e,...t})}function wY(){const e=Mr(),t=y.useRef({router:e,mounted:!1}),[n,r]=y.useState(!1),{hasPendingMatches:a,isLoading:i}=xr({select:p=>({isLoading:p.isLoading,hasPendingMatches:p.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),l=k0(i),u=i||n||a,d=k0(u),f=i||a,m=k0(f);return e.startTransition=p=>{r(!0),y.startTransition(()=>{p(),r(!1)})},y.useEffect(()=>{const p=e.history.subscribe(e.load),g=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Wo(e.latestLocation.href)!==Wo(g.href)&&e.commitLocation({...g,replace:!0}),()=>{p()}},[e,e.history]),vp(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(g){console.error(g)}})()},[e]),vp(()=>{l&&!i&&e.emit({type:"onLoad",...Ys(e.state)})},[l,e,i]),vp(()=>{m&&!f&&e.emit({type:"onBeforeRouteMount",...Ys(e.state)})},[f,m,e]),vp(()=>{d&&!u&&(e.emit({type:"onResolved",...Ys(e.state)}),e.__store.setState(p=>({...p,status:"idle",resolvedLocation:p.location})),EG(e))},[u,d,e]),null}function jY(e){const t=xr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return s.jsx(wO,{getResetKey:()=>t,onCatch:(n,r)=>{if(La(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(La(n))return e.fallback?.(n);throw n},children:e.children})}function SY(){return s.jsx("p",{children:"Not Found"})}function Cc(e){return s.jsx(s.Fragment,{children:e.children})}function Y3(e,t,n){return t.options.notFoundComponent?s.jsx(t.options.notFoundComponent,{data:n}):e.options.defaultNotFoundComponent?s.jsx(e.options.defaultNotFoundComponent,{data:n}):s.jsx(SY,{})}function _Y({children:e}){const t=Mr();return t.isServer?s.jsx("script",{nonce:t.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[e].filter(Boolean).join(` -`)+";$_TSR.c()"}}):null}function NY(){const e=Mr();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||c_)(e.latestLocation),r=n!==c_(e.latestLocation)?n:void 0,a={storageKey:lv,shouldScrollRestoration:!0};return r&&(a.key=r),s.jsx(_Y,{children:`(${D3.toString()})(${JSON.stringify(a)})`})}const K3=y.memo(function({matchId:t}){const n=Mr(),r=xr({select:N=>{const O=N.matches.find(C=>C.id===t);return sr(O),{routeId:O.routeId,ssr:O.ssr,_displayPending:O._displayPending}},structuralSharing:!0}),a=n.routesById[r.routeId],i=a.options.pendingComponent??n.options.defaultPendingComponent,l=i?s.jsx(i,{}):null,u=a.options.errorComponent??n.options.defaultErrorComponent,d=a.options.onCatch??n.options.defaultOnCatch,f=a.isRoot?a.options.notFoundComponent??n.options.notFoundRoute?.options.component:a.options.notFoundComponent,m=r.ssr===!1||r.ssr==="data-only",p=(!a.isRoot||a.options.wrapInSuspense||m)&&(a.options.wrapInSuspense??i??(a.options.errorComponent?.preload||m))?y.Suspense:Cc,g=u?wO:Cc,x=f?jY:Cc,j=xr({select:N=>N.loadedAt}),b=xr({select:N=>{const O=N.matches.findIndex(C=>C.id===t);return N.matches[O-1]?.routeId}}),w=a.isRoot?a.options.shellComponent??Cc:Cc;return s.jsxs(w,{children:[s.jsx(kg.Provider,{value:t,children:s.jsx(p,{fallback:l,children:s.jsx(g,{getResetKey:()=>j,errorComponent:u||Tg,onCatch:(N,O)=>{if(La(N))throw N;d?.(N,O)},children:s.jsx(x,{fallback:N=>{if(!f||N.routeId&&N.routeId!==r.routeId||!N.routeId&&!a.isRoot)throw N;return y.createElement(f,N)},children:m||r._displayPending?s.jsx(ZG,{fallback:l,children:s.jsx(uP,{matchId:t})}):s.jsx(uP,{matchId:t})})})})}),b===Yr&&n.options.scrollRestoration?s.jsxs(s.Fragment,{children:[s.jsx(OY,{}),s.jsx(NY,{})]}):null]})});function OY(){const e=Mr(),t=y.useRef(void 0);return s.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Ys(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const uP=y.memo(function({matchId:t}){const n=Mr(),{match:r,key:a,routeId:i}=xr({select:d=>{const f=d.matches.find(j=>j.id===t),m=f.routeId,g=(n.routesById[m].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:m,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:m,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),l=n.routesById[i],u=y.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?s.jsx(d,{},a):s.jsx(CO,{})},[a,l.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const d=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const f=n.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise&&!n.isServer){const m=Gc();f._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),f._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return sr(La(r.error)),Y3(n,l,r.error);if(r.status==="redirected")throw sr(ni(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error"){if(n.isServer){const d=(l.options.errorComponent??n.options.defaultErrorComponent)||Tg;return s.jsx(d,{error:r.error,reset:void 0,info:{componentStack:""}})}throw r.error}return u}),CO=y.memo(function(){const t=Mr(),n=y.useContext(kg),r=xr({select:f=>f.matches.find(m=>m.id===n)?.routeId}),a=t.routesById[r],i=xr({select:f=>{const p=f.matches.find(g=>g.id===n);return sr(p),p.globalNotFound}}),l=xr({select:f=>{const m=f.matches,p=m.findIndex(g=>g.id===n);return m[p+1]?.id}}),u=t.options.defaultPendingComponent?s.jsx(t.options.defaultPendingComponent,{}):null;if(i)return Y3(t,a,void 0);if(!l)return null;const d=s.jsx(K3,{matchId:l});return r===Yr?s.jsx(y.Suspense,{fallback:u,children:d}):d});function CY(){const e=Mr(),n=e.routesById[Yr].options.pendingComponent??e.options.defaultPendingComponent,r=n?s.jsx(n,{}):null,a=e.isServer||typeof document<"u"&&e.ssr?Cc:y.Suspense,i=s.jsxs(a,{fallback:r,children:[!e.isServer&&s.jsx(wY,{}),s.jsx(EY,{})]});return e.options.InnerWrap?s.jsx(e.options.InnerWrap,{children:i}):i}function EY(){const e=Mr(),t=xr({select:a=>a.matches[0]?.id}),n=xr({select:a=>a.loadedAt}),r=t?s.jsx(K3,{matchId:t}):null;return s.jsx(kg.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:s.jsx(wO,{getResetKey:()=>n,errorComponent:Tg,onCatch:a=>{a.message||a.toString()},children:r})})}function AY(){const e=Mr();return xr({select:t=>[t.location.href,t.resolvedLocation?.href,t.status],structuralSharing:!0}),y.useCallback(t=>{const{pending:n,caseSensitive:r,fuzzy:a,includeSearch:i,...l}=t;return e.matchRoute(l,{pending:n,caseSensitive:r,fuzzy:a,includeSearch:i})},[e])}const TY=e=>new kY(e);class kY extends UG{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=oP,globalThis.createLazyFileRoute=cP):typeof window<"u"&&(window.createFileRoute=oP,window.createLazyFileRoute=cP);function PY({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=G3(),a=s.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?s.jsx(e.options.Wrap,{children:a}):a}function MY({router:e,...t}){return s.jsx(PY,{router:e,...t,children:s.jsx(CY,{})})}function X3(e,t){return function(){return e.apply(t,arguments)}}const{toString:RY}=Object.prototype,{getPrototypeOf:EO}=Object,{iterator:Pg,toStringTag:Z3}=Symbol,Mg=(e=>t=>{const n=RY.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Fa=e=>(e=e.toLowerCase(),t=>Mg(t)===e),Rg=e=>t=>typeof t===e,{isArray:Au}=Array,Zc=Rg("undefined");function gh(e){return e!==null&&!Zc(e)&&e.constructor!==null&&!Zc(e.constructor)&&Er(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Q3=Fa("ArrayBuffer");function DY(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Q3(e.buffer),t}const $Y=Rg("string"),Er=Rg("function"),J3=Rg("number"),yh=e=>e!==null&&typeof e=="object",IY=e=>e===!0||e===!1,Gp=e=>{if(Mg(e)!=="object")return!1;const t=EO(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Z3 in e)&&!(Pg in e)},LY=e=>{if(!yh(e)||gh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},BY=Fa("Date"),zY=Fa("File"),qY=Fa("Blob"),FY=Fa("FileList"),UY=e=>yh(e)&&Er(e.pipe),HY=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Er(e.append)&&((t=Mg(e))==="formdata"||t==="object"&&Er(e.toString)&&e.toString()==="[object FormData]"))},WY=Fa("URLSearchParams"),[VY,GY,YY,KY]=["ReadableStream","Request","Response","Headers"].map(Fa),XY=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function xh(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),Au(e))for(r=0,a=e.length;r0;)if(a=n[r],t===a.toLowerCase())return a;return null}const zs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,t5=e=>!Zc(e)&&e!==zs;function d_(){const{caseless:e,skipUndefined:t}=t5(this)&&this||{},n={},r=(a,i)=>{const l=e&&e5(n,i)||i;Gp(n[l])&&Gp(a)?n[l]=d_(n[l],a):Gp(a)?n[l]=d_({},a):Au(a)?n[l]=a.slice():(!t||!Zc(a))&&(n[l]=a)};for(let a=0,i=arguments.length;a(xh(t,(a,i)=>{n&&Er(a)?e[i]=X3(a,n):e[i]=a},{allOwnKeys:r}),e),QY=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),JY=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},eK=(e,t,n,r)=>{let a,i,l;const u={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)l=a[i],(!r||r(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&EO(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},tK=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},nK=e=>{if(!e)return null;if(Au(e))return e;let t=e.length;if(!J3(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},rK=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&EO(Uint8Array)),aK=(e,t)=>{const r=(e&&e[Pg]).call(e);let a;for(;(a=r.next())&&!a.done;){const i=a.value;t.call(e,i[0],i[1])}},iK=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},oK=Fa("HTMLFormElement"),sK=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),dP=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),lK=Fa("RegExp"),n5=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};xh(n,(a,i)=>{let l;(l=t(a,i,e))!==!1&&(r[i]=l||a)}),Object.defineProperties(e,r)},cK=e=>{n5(e,(t,n)=>{if(Er(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Er(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},uK=(e,t)=>{const n={},r=a=>{a.forEach(i=>{n[i]=!0})};return Au(e)?r(e):r(String(e).split(t)),n},dK=()=>{},fK=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function hK(e){return!!(e&&Er(e.append)&&e[Z3]==="FormData"&&e[Pg])}const mK=e=>{const t=new Array(10),n=(r,a)=>{if(yh(r)){if(t.indexOf(r)>=0)return;if(gh(r))return r;if(!("toJSON"in r)){t[a]=r;const i=Au(r)?[]:{};return xh(r,(l,u)=>{const d=n(l,a+1);!Zc(d)&&(i[u]=d)}),t[a]=void 0,i}}return r};return n(e,0)},pK=Fa("AsyncFunction"),vK=e=>e&&(yh(e)||Er(e))&&Er(e.then)&&Er(e.catch),r5=((e,t)=>e?setImmediate:t?((n,r)=>(zs.addEventListener("message",({source:a,data:i})=>{a===zs&&i===n&&r.length&&r.shift()()},!1),a=>{r.push(a),zs.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Er(zs.postMessage)),gK=typeof queueMicrotask<"u"?queueMicrotask.bind(zs):typeof process<"u"&&process.nextTick||r5,yK=e=>e!=null&&Er(e[Pg]),de={isArray:Au,isArrayBuffer:Q3,isBuffer:gh,isFormData:HY,isArrayBufferView:DY,isString:$Y,isNumber:J3,isBoolean:IY,isObject:yh,isPlainObject:Gp,isEmptyObject:LY,isReadableStream:VY,isRequest:GY,isResponse:YY,isHeaders:KY,isUndefined:Zc,isDate:BY,isFile:zY,isBlob:qY,isRegExp:lK,isFunction:Er,isStream:UY,isURLSearchParams:WY,isTypedArray:rK,isFileList:FY,forEach:xh,merge:d_,extend:ZY,trim:XY,stripBOM:QY,inherits:JY,toFlatObject:eK,kindOf:Mg,kindOfTest:Fa,endsWith:tK,toArray:nK,forEachEntry:aK,matchAll:iK,isHTMLForm:oK,hasOwnProperty:dP,hasOwnProp:dP,reduceDescriptors:n5,freezeMethods:cK,toObjectSet:uK,toCamelCase:sK,noop:dK,toFiniteNumber:fK,findKey:e5,global:zs,isContextDefined:t5,isSpecCompliantForm:hK,toJSONObject:mK,isAsyncFn:pK,isThenable:vK,setImmediate:r5,asap:gK,isIterable:yK};function Xe(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}de.inherits(Xe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:de.toJSONObject(this.config),code:this.code,status:this.status}}});const a5=Xe.prototype,i5={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{i5[e]={value:e}});Object.defineProperties(Xe,i5);Object.defineProperty(a5,"isAxiosError",{value:!0});Xe.from=(e,t,n,r,a,i)=>{const l=Object.create(a5);de.toFlatObject(e,l,function(m){return m!==Error.prototype},f=>f!=="isAxiosError");const u=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return Xe.call(l,u,d,n,r,a),e&&l.cause==null&&Object.defineProperty(l,"cause",{value:e,configurable:!0}),l.name=e&&e.name||"Error",i&&Object.assign(l,i),l};const xK=null;function f_(e){return de.isPlainObject(e)||de.isArray(e)}function o5(e){return de.endsWith(e,"[]")?e.slice(0,-2):e}function fP(e,t,n){return e?e.concat(t).map(function(a,i){return a=o5(a),!n&&i?"["+a+"]":a}).join(n?".":""):t}function bK(e){return de.isArray(e)&&!e.some(f_)}const wK=de.toFlatObject(de,{},null,function(t){return/^is[A-Z]/.test(t)});function Dg(e,t,n){if(!de.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=de.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,w){return!de.isUndefined(w[b])});const r=n.metaTokens,a=n.visitor||m,i=n.dots,l=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&de.isSpecCompliantForm(t);if(!de.isFunction(a))throw new TypeError("visitor must be a function");function f(j){if(j===null)return"";if(de.isDate(j))return j.toISOString();if(de.isBoolean(j))return j.toString();if(!d&&de.isBlob(j))throw new Xe("Blob is not supported. Use a Buffer instead.");return de.isArrayBuffer(j)||de.isTypedArray(j)?d&&typeof Blob=="function"?new Blob([j]):Buffer.from(j):j}function m(j,b,w){let N=j;if(j&&!w&&typeof j=="object"){if(de.endsWith(b,"{}"))b=r?b:b.slice(0,-2),j=JSON.stringify(j);else if(de.isArray(j)&&bK(j)||(de.isFileList(j)||de.endsWith(b,"[]"))&&(N=de.toArray(j)))return b=o5(b),N.forEach(function(C,A){!(de.isUndefined(C)||C===null)&&t.append(l===!0?fP([b],A,i):l===null?b:b+"[]",f(C))}),!1}return f_(j)?!0:(t.append(fP(w,b,i),f(j)),!1)}const p=[],g=Object.assign(wK,{defaultVisitor:m,convertValue:f,isVisitable:f_});function x(j,b){if(!de.isUndefined(j)){if(p.indexOf(j)!==-1)throw Error("Circular reference detected in "+b.join("."));p.push(j),de.forEach(j,function(N,O){(!(de.isUndefined(N)||N===null)&&a.call(t,N,de.isString(O)?O.trim():O,b,g))===!0&&x(N,b?b.concat(O):[O])}),p.pop()}}if(!de.isObject(e))throw new TypeError("data must be an object");return x(e),t}function hP(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function AO(e,t){this._pairs=[],e&&Dg(e,this,t)}const s5=AO.prototype;s5.append=function(t,n){this._pairs.push([t,n])};s5.toString=function(t){const n=t?function(r){return t.call(this,r,hP)}:hP;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function jK(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function l5(e,t,n){if(!t)return e;const r=n&&n.encode||jK;de.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let i;if(a?i=a(t,n):i=de.isURLSearchParams(t)?t.toString():new AO(t,n).toString(r),i){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class mP{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){de.forEach(this.handlers,function(r){r!==null&&t(r)})}}const c5={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},SK=typeof URLSearchParams<"u"?URLSearchParams:AO,_K=typeof FormData<"u"?FormData:null,NK=typeof Blob<"u"?Blob:null,OK={isBrowser:!0,classes:{URLSearchParams:SK,FormData:_K,Blob:NK},protocols:["http","https","file","blob","url","data"]},TO=typeof window<"u"&&typeof document<"u",h_=typeof navigator=="object"&&navigator||void 0,CK=TO&&(!h_||["ReactNative","NativeScript","NS"].indexOf(h_.product)<0),EK=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",AK=TO&&window.location.href||"http://localhost",TK=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:TO,hasStandardBrowserEnv:CK,hasStandardBrowserWebWorkerEnv:EK,navigator:h_,origin:AK},Symbol.toStringTag,{value:"Module"})),or={...TK,...OK};function kK(e,t){return Dg(e,new or.classes.URLSearchParams,{visitor:function(n,r,a,i){return or.isNode&&de.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function PK(e){return de.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function MK(e){const t={},n=Object.keys(e);let r;const a=n.length;let i;for(r=0;r=n.length;return l=!l&&de.isArray(a)?a.length:l,d?(de.hasOwnProp(a,l)?a[l]=[a[l],r]:a[l]=r,!u):((!a[l]||!de.isObject(a[l]))&&(a[l]=[]),t(n,r,a[l],i)&&de.isArray(a[l])&&(a[l]=MK(a[l])),!u)}if(de.isFormData(e)&&de.isFunction(e.entries)){const n={};return de.forEachEntry(e,(r,a)=>{t(PK(r),a,n,0)}),n}return null}function RK(e,t,n){if(de.isString(e))try{return(t||JSON.parse)(e),de.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const bh={transitional:c5,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,i=de.isObject(t);if(i&&de.isHTMLForm(t)&&(t=new FormData(t)),de.isFormData(t))return a?JSON.stringify(u5(t)):t;if(de.isArrayBuffer(t)||de.isBuffer(t)||de.isStream(t)||de.isFile(t)||de.isBlob(t)||de.isReadableStream(t))return t;if(de.isArrayBufferView(t))return t.buffer;if(de.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return kK(t,this.formSerializer).toString();if((u=de.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Dg(u?{"files[]":t}:t,d&&new d,this.formSerializer)}}return i||a?(n.setContentType("application/json",!1),RK(t)):t}],transformResponse:[function(t){const n=this.transitional||bh.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(de.isResponse(t)||de.isReadableStream(t))return t;if(t&&de.isString(t)&&(r&&!this.responseType||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t,this.parseReviver)}catch(u){if(l)throw u.name==="SyntaxError"?Xe.from(u,Xe.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:or.classes.FormData,Blob:or.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};de.forEach(["delete","get","head","post","put","patch"],e=>{bh.headers[e]={}});const DK=de.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),$K=e=>{const t={};let n,r,a;return e&&e.split(` -`).forEach(function(l){a=l.indexOf(":"),n=l.substring(0,a).trim().toLowerCase(),r=l.substring(a+1).trim(),!(!n||t[n]&&DK[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},pP=Symbol("internals");function Hd(e){return e&&String(e).trim().toLowerCase()}function Yp(e){return e===!1||e==null?e:de.isArray(e)?e.map(Yp):String(e)}function IK(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const LK=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function M0(e,t,n,r,a){if(de.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!de.isString(t)){if(de.isString(r))return t.indexOf(r)!==-1;if(de.isRegExp(r))return r.test(t)}}function BK(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function zK(e,t){const n=de.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,i,l){return this[r].call(this,t,a,i,l)},configurable:!0})})}let Ar=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function i(u,d,f){const m=Hd(d);if(!m)throw new Error("header name must be a non-empty string");const p=de.findKey(a,m);(!p||a[p]===void 0||f===!0||f===void 0&&a[p]!==!1)&&(a[p||d]=Yp(u))}const l=(u,d)=>de.forEach(u,(f,m)=>i(f,m,d));if(de.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(de.isString(t)&&(t=t.trim())&&!LK(t))l($K(t),n);else if(de.isObject(t)&&de.isIterable(t)){let u={},d,f;for(const m of t){if(!de.isArray(m))throw TypeError("Object iterator must return a key-value pair");u[f=m[0]]=(d=u[f])?de.isArray(d)?[...d,m[1]]:[d,m[1]]:m[1]}l(u,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=Hd(t),t){const r=de.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return IK(a);if(de.isFunction(n))return n.call(this,a,r);if(de.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Hd(t),t){const r=de.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||M0(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function i(l){if(l=Hd(l),l){const u=de.findKey(r,l);u&&(!n||M0(r,r[u],u,n))&&(delete r[u],a=!0)}}return de.isArray(t)?t.forEach(i):i(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const i=n[r];(!t||M0(this,this[i],i,t,!0))&&(delete this[i],a=!0)}return a}normalize(t){const n=this,r={};return de.forEach(this,(a,i)=>{const l=de.findKey(r,i);if(l){n[l]=Yp(a),delete n[i];return}const u=t?BK(i):String(i).trim();u!==i&&delete n[i],n[u]=Yp(a),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return de.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&de.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` -`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[pP]=this[pP]={accessors:{}}).accessors,a=this.prototype;function i(l){const u=Hd(l);r[u]||(zK(a,l),r[u]=!0)}return de.isArray(t)?t.forEach(i):i(t),this}};Ar.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);de.reduceDescriptors(Ar.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});de.freezeMethods(Ar);function R0(e,t){const n=this||bh,r=t||n,a=Ar.from(r.headers);let i=r.data;return de.forEach(e,function(u){i=u.call(n,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function d5(e){return!!(e&&e.__CANCEL__)}function Tu(e,t,n){Xe.call(this,e??"canceled",Xe.ERR_CANCELED,t,n),this.name="CanceledError"}de.inherits(Tu,Xe,{__CANCEL__:!0});function f5(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Xe("Request failed with status code "+n.status,[Xe.ERR_BAD_REQUEST,Xe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function qK(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function FK(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,i=0,l;return t=t!==void 0?t:1e3,function(d){const f=Date.now(),m=r[i];l||(l=f),n[a]=d,r[a]=f;let p=i,g=0;for(;p!==a;)g+=n[p++],p=p%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),f-l{n=m,a=null,i&&(clearTimeout(i),i=null),e(...f)};return[(...f)=>{const m=Date.now(),p=m-n;p>=r?l(f,m):(a=f,i||(i=setTimeout(()=>{i=null,l(a)},r-p)))},()=>a&&l(a)]}const dv=(e,t,n=3)=>{let r=0;const a=FK(50,250);return UK(i=>{const l=i.loaded,u=i.lengthComputable?i.total:void 0,d=l-r,f=a(d),m=l<=u;r=l;const p={loaded:l,total:u,progress:u?l/u:void 0,bytes:d,rate:f||void 0,estimated:f&&u&&m?(u-l)/f:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(p)},n)},vP=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},gP=e=>(...t)=>de.asap(()=>e(...t)),HK=or.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,or.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(or.origin),or.navigator&&/(msie|trident)/i.test(or.navigator.userAgent)):()=>!0,WK=or.hasStandardBrowserEnv?{write(e,t,n,r,a,i,l){if(typeof document>"u")return;const u=[`${e}=${encodeURIComponent(t)}`];de.isNumber(n)&&u.push(`expires=${new Date(n).toUTCString()}`),de.isString(r)&&u.push(`path=${r}`),de.isString(a)&&u.push(`domain=${a}`),i===!0&&u.push("secure"),de.isString(l)&&u.push(`SameSite=${l}`),document.cookie=u.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function VK(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function GK(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function h5(e,t,n){let r=!VK(t);return e&&(r||n==!1)?GK(e,t):t}const yP=e=>e instanceof Ar?{...e}:e;function rl(e,t){t=t||{};const n={};function r(f,m,p,g){return de.isPlainObject(f)&&de.isPlainObject(m)?de.merge.call({caseless:g},f,m):de.isPlainObject(m)?de.merge({},m):de.isArray(m)?m.slice():m}function a(f,m,p,g){if(de.isUndefined(m)){if(!de.isUndefined(f))return r(void 0,f,p,g)}else return r(f,m,p,g)}function i(f,m){if(!de.isUndefined(m))return r(void 0,m)}function l(f,m){if(de.isUndefined(m)){if(!de.isUndefined(f))return r(void 0,f)}else return r(void 0,m)}function u(f,m,p){if(p in t)return r(f,m);if(p in e)return r(void 0,f)}const d={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(f,m,p)=>a(yP(f),yP(m),p,!0)};return de.forEach(Object.keys({...e,...t}),function(m){const p=d[m]||a,g=p(e[m],t[m],m);de.isUndefined(g)&&p!==u||(n[m]=g)}),n}const m5=e=>{const t=rl({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:i,headers:l,auth:u}=t;if(t.headers=l=Ar.from(l),t.url=l5(h5(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),de.isFormData(n)){if(or.hasStandardBrowserEnv||or.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(de.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([m,p])=>{f.includes(m.toLowerCase())&&l.set(m,p)})}}if(or.hasStandardBrowserEnv&&(r&&de.isFunction(r)&&(r=r(t)),r||r!==!1&&HK(t.url))){const d=a&&i&&WK.read(i);d&&l.set(a,d)}return t},YK=typeof XMLHttpRequest<"u",KK=YK&&function(e){return new Promise(function(n,r){const a=m5(e);let i=a.data;const l=Ar.from(a.headers).normalize();let{responseType:u,onUploadProgress:d,onDownloadProgress:f}=a,m,p,g,x,j;function b(){x&&x(),j&&j(),a.cancelToken&&a.cancelToken.unsubscribe(m),a.signal&&a.signal.removeEventListener("abort",m)}let w=new XMLHttpRequest;w.open(a.method.toUpperCase(),a.url,!0),w.timeout=a.timeout;function N(){if(!w)return;const C=Ar.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),E={data:!u||u==="text"||u==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:C,config:e,request:w};f5(function(T){n(T),b()},function(T){r(T),b()},E),w=null}"onloadend"in w?w.onloadend=N:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(N)},w.onabort=function(){w&&(r(new Xe("Request aborted",Xe.ECONNABORTED,e,w)),w=null)},w.onerror=function(A){const E=A&&A.message?A.message:"Network Error",k=new Xe(E,Xe.ERR_NETWORK,e,w);k.event=A||null,r(k),w=null},w.ontimeout=function(){let A=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const E=a.transitional||c5;a.timeoutErrorMessage&&(A=a.timeoutErrorMessage),r(new Xe(A,E.clarifyTimeoutError?Xe.ETIMEDOUT:Xe.ECONNABORTED,e,w)),w=null},i===void 0&&l.setContentType(null),"setRequestHeader"in w&&de.forEach(l.toJSON(),function(A,E){w.setRequestHeader(E,A)}),de.isUndefined(a.withCredentials)||(w.withCredentials=!!a.withCredentials),u&&u!=="json"&&(w.responseType=a.responseType),f&&([g,j]=dv(f,!0),w.addEventListener("progress",g)),d&&w.upload&&([p,x]=dv(d),w.upload.addEventListener("progress",p),w.upload.addEventListener("loadend",x)),(a.cancelToken||a.signal)&&(m=C=>{w&&(r(!C||C.type?new Tu(null,e,w):C),w.abort(),w=null)},a.cancelToken&&a.cancelToken.subscribe(m),a.signal&&(a.signal.aborted?m():a.signal.addEventListener("abort",m)));const O=qK(a.url);if(O&&or.protocols.indexOf(O)===-1){r(new Xe("Unsupported protocol "+O+":",Xe.ERR_BAD_REQUEST,e));return}w.send(i||null)})},XK=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const i=function(f){if(!a){a=!0,u();const m=f instanceof Error?f:this.reason;r.abort(m instanceof Xe?m:new Tu(m instanceof Error?m.message:m))}};let l=t&&setTimeout(()=>{l=null,i(new Xe(`timeout ${t} of ms exceeded`,Xe.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),e=null)};e.forEach(f=>f.addEventListener("abort",i));const{signal:d}=r;return d.unsubscribe=()=>de.asap(u),d}},ZK=function*(e,t){let n=e.byteLength;if(n{const a=QK(e,t);let i=0,l,u=d=>{l||(l=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:f,value:m}=await a.next();if(f){u(),d.close();return}let p=m.byteLength;if(n){let g=i+=p;n(g)}d.enqueue(new Uint8Array(m))}catch(f){throw u(f),f}},cancel(d){return u(d),a.return()}},{highWaterMark:2})},bP=64*1024,{isFunction:gp}=de,eX=(({Request:e,Response:t})=>({Request:e,Response:t}))(de.global),{ReadableStream:wP,TextEncoder:jP}=de.global,SP=(e,...t)=>{try{return!!e(...t)}catch{return!1}},tX=e=>{e=de.merge.call({skipUndefined:!0},eX,e);const{fetch:t,Request:n,Response:r}=e,a=t?gp(t):typeof fetch=="function",i=gp(n),l=gp(r);if(!a)return!1;const u=a&&gp(wP),d=a&&(typeof jP=="function"?(j=>b=>j.encode(b))(new jP):async j=>new Uint8Array(await new n(j).arrayBuffer())),f=i&&u&&SP(()=>{let j=!1;const b=new n(or.origin,{body:new wP,method:"POST",get duplex(){return j=!0,"half"}}).headers.has("Content-Type");return j&&!b}),m=l&&u&&SP(()=>de.isReadableStream(new r("").body)),p={stream:m&&(j=>j.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(j=>{!p[j]&&(p[j]=(b,w)=>{let N=b&&b[j];if(N)return N.call(b);throw new Xe(`Response type '${j}' is not supported`,Xe.ERR_NOT_SUPPORT,w)})});const g=async j=>{if(j==null)return 0;if(de.isBlob(j))return j.size;if(de.isSpecCompliantForm(j))return(await new n(or.origin,{method:"POST",body:j}).arrayBuffer()).byteLength;if(de.isArrayBufferView(j)||de.isArrayBuffer(j))return j.byteLength;if(de.isURLSearchParams(j)&&(j=j+""),de.isString(j))return(await d(j)).byteLength},x=async(j,b)=>{const w=de.toFiniteNumber(j.getContentLength());return w??g(b)};return async j=>{let{url:b,method:w,data:N,signal:O,cancelToken:C,timeout:A,onDownloadProgress:E,onUploadProgress:k,responseType:T,headers:P,withCredentials:$="same-origin",fetchOptions:F}=m5(j),D=t||fetch;T=T?(T+"").toLowerCase():"text";let U=XK([O,C&&C.toAbortSignal()],A),V=null;const H=U&&U.unsubscribe&&(()=>{U.unsubscribe()});let G;try{if(k&&f&&w!=="get"&&w!=="head"&&(G=await x(P,N))!==0){let I=new n(b,{method:"POST",body:N,duplex:"half"}),B;if(de.isFormData(N)&&(B=I.headers.get("content-type"))&&P.setContentType(B),I.body){const[Y,te]=vP(G,dv(gP(k)));N=xP(I.body,bP,Y,te)}}de.isString($)||($=$?"include":"omit");const L=i&&"credentials"in n.prototype,R={...F,signal:U,method:w.toUpperCase(),headers:P.normalize().toJSON(),body:N,duplex:"half",credentials:L?$:void 0};V=i&&new n(b,R);let q=await(i?D(V,F):D(b,R));const K=m&&(T==="stream"||T==="response");if(m&&(E||K&&H)){const I={};["status","statusText","headers"].forEach(oe=>{I[oe]=q[oe]});const B=de.toFiniteNumber(q.headers.get("content-length")),[Y,te]=E&&vP(B,dv(gP(E),!0))||[];q=new r(xP(q.body,bP,Y,()=>{te&&te(),H&&H()}),I)}T=T||"text";let ee=await p[de.findKey(p,T)||"text"](q,j);return!K&&H&&H(),await new Promise((I,B)=>{f5(I,B,{data:ee,headers:Ar.from(q.headers),status:q.status,statusText:q.statusText,config:j,request:V})})}catch(L){throw H&&H(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new Xe("Network Error",Xe.ERR_NETWORK,j,V),{cause:L.cause||L}):Xe.from(L,L&&L.code,j,V)}}},nX=new Map,p5=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,i=[r,a,n];let l=i.length,u=l,d,f,m=nX;for(;u--;)d=i[u],f=m.get(d),f===void 0&&m.set(d,f=u?new Map:tX(t)),m=f;return f};p5();const kO={http:xK,xhr:KK,fetch:{get:p5}};de.forEach(kO,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const _P=e=>`- ${e}`,rX=e=>de.isFunction(e)||e===null||e===!1;function aX(e,t){e=de.isArray(e)?e:[e];const{length:n}=e;let r,a;const i={};for(let l=0;l`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let u=n?l.length>1?`since : -`+l.map(_P).join(` -`):" "+_P(l[0]):"as no adapter specified";throw new Xe("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return a}const v5={getAdapter:aX,adapters:kO};function D0(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Tu(null,e)}function NP(e){return D0(e),e.headers=Ar.from(e.headers),e.data=R0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),v5.getAdapter(e.adapter||bh.adapter,e)(e).then(function(r){return D0(e),r.data=R0.call(e,e.transformResponse,r),r.headers=Ar.from(r.headers),r},function(r){return d5(r)||(D0(e),r&&r.response&&(r.response.data=R0.call(e,e.transformResponse,r.response),r.response.headers=Ar.from(r.response.headers))),Promise.reject(r)})}const g5="1.13.2",$g={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{$g[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const OP={};$g.transitional=function(t,n,r){function a(i,l){return"[Axios v"+g5+"] Transitional option '"+i+"'"+l+(r?". "+r:"")}return(i,l,u)=>{if(t===!1)throw new Xe(a(l," has been removed"+(n?" in "+n:"")),Xe.ERR_DEPRECATED);return n&&!OP[l]&&(OP[l]=!0,console.warn(a(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,l,u):!0}};$g.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function iX(e,t,n){if(typeof e!="object")throw new Xe("options must be an object",Xe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const i=r[a],l=t[i];if(l){const u=e[i],d=u===void 0||l(u,i,e);if(d!==!0)throw new Xe("option "+i+" must be "+d,Xe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Xe("Unknown option "+i,Xe.ERR_BAD_OPTION)}}const Kp={assertOptions:iX,validators:$g},Xa=Kp.validators;let Ks=class{constructor(t){this.defaults=t||{},this.interceptors={request:new mP,response:new mP}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` -`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=rl(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:i}=n;r!==void 0&&Kp.assertOptions(r,{silentJSONParsing:Xa.transitional(Xa.boolean),forcedJSONParsing:Xa.transitional(Xa.boolean),clarifyTimeoutError:Xa.transitional(Xa.boolean)},!1),a!=null&&(de.isFunction(a)?n.paramsSerializer={serialize:a}:Kp.assertOptions(a,{encode:Xa.function,serialize:Xa.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Kp.assertOptions(n,{baseUrl:Xa.spelling("baseURL"),withXsrfToken:Xa.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=i&&de.merge(i.common,i[n.method]);i&&de.forEach(["delete","get","head","post","put","patch","common"],j=>{delete i[j]}),n.headers=Ar.concat(l,i);const u=[];let d=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(d=d&&b.synchronous,u.unshift(b.fulfilled,b.rejected))});const f=[];this.interceptors.response.forEach(function(b){f.push(b.fulfilled,b.rejected)});let m,p=0,g;if(!d){const j=[NP.bind(this),void 0];for(j.unshift(...u),j.push(...f),g=j.length,m=Promise.resolve(n);p{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](a);r._listeners=null}),this.promise.then=a=>{let i;const l=new Promise(u=>{r.subscribe(u),i=u}).then(a);return l.cancel=function(){r.unsubscribe(i)},l},t(function(i,l,u){r.reason||(r.reason=new Tu(i,l,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new y5(function(a){t=a}),cancel:t}}};function sX(e){return function(n){return e.apply(null,n)}}function lX(e){return de.isObject(e)&&e.isAxiosError===!0}const m_={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(m_).forEach(([e,t])=>{m_[t]=e});function x5(e){const t=new Ks(e),n=X3(Ks.prototype.request,t);return de.extend(n,Ks.prototype,t,{allOwnKeys:!0}),de.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return x5(rl(e,a))},n}const an=x5(bh);an.Axios=Ks;an.CanceledError=Tu;an.CancelToken=oX;an.isCancel=d5;an.VERSION=g5;an.toFormData=Dg;an.AxiosError=Xe;an.Cancel=an.CanceledError;an.all=function(t){return Promise.all(t)};an.spread=sX;an.isAxiosError=lX;an.mergeConfig=rl;an.AxiosHeaders=Ar;an.formToJSON=e=>u5(de.isHTMLForm(e)?new FormData(e):e);an.getAdapter=v5.getAdapter;an.HttpStatusCode=m_;an.default=an;const{Axios:PEe,AxiosError:MEe,CanceledError:REe,isCancel:DEe,CancelToken:$Ee,VERSION:IEe,all:LEe,Cancel:BEe,isAxiosError:zEe,spread:qEe,toFormData:FEe,AxiosHeaders:UEe,HttpStatusCode:HEe,formToJSON:WEe,getAdapter:VEe,mergeConfig:GEe}=an;function b5(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const n=new Array(e.length+t.length);for(let r=0;r({classGroupId:e,validator:t}),w5=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),fv="-",CP=[],dX="arbitrary..",fX=e=>{const t=mX(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return hX(l);const u=l.split(fv),d=u[0]===""&&u.length>1?1:0;return j5(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],f=n[l];return d?f?cX(f,d):d:f||CP}return n[l]||CP}}},j5=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],i=n.nextPart.get(a);if(i){const f=j5(e,t+1,i);if(f)return f}const l=n.validators;if(l===null)return;const u=t===0?e.join(fv):e.slice(t).join(fv),d=l.length;for(let f=0;fe.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?dX+r:void 0})(),mX=e=>{const{theme:t,classGroups:n}=e;return pX(n,t)},pX=(e,t)=>{const n=w5();for(const r in e){const a=e[r];PO(a,n,r,t)}return n},PO=(e,t,n,r)=>{const a=e.length;for(let i=0;i{if(typeof e=="string"){gX(e,t,n);return}if(typeof e=="function"){yX(e,t,n,r);return}xX(e,t,n,r)},gX=(e,t,n)=>{const r=e===""?t:S5(t,e);r.classGroupId=n},yX=(e,t,n,r)=>{if(bX(e)){PO(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(uX(n,e))},xX=(e,t,n,r)=>{const a=Object.entries(e),i=a.length;for(let l=0;l{let n=e;const r=t.split(fv),a=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,wX=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(i,l)=>{n[i]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let l=n[i];if(l!==void 0)return l;if((l=r[i])!==void 0)return a(i,l),l},set(i,l){i in n?n[i]=l:a(i,l)}}},p_="!",EP=":",jX=[],AP=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),SX=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const i=[];let l=0,u=0,d=0,f;const m=a.length;for(let b=0;bd?f-d:void 0;return AP(i,x,g,j)};if(t){const a=t+EP,i=r;r=l=>l.startsWith(a)?i(l.slice(a.length)):AP(jX,!1,l,void 0,!0)}if(n){const a=r;r=i=>n({className:i,parseClassName:a})}return r},_X=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let i=0;i0&&(a.sort(),r.push(...a),a=[]),r.push(l)):a.push(l)}return a.length>0&&(a.sort(),r.push(...a)),r}},NX=e=>({cache:wX(e.cacheSize),parseClassName:SX(e),sortModifiers:_X(e),...fX(e)}),OX=/\s+/,CX=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:i}=t,l=[],u=e.trim().split(OX);let d="";for(let f=u.length-1;f>=0;f-=1){const m=u[f],{isExternal:p,modifiers:g,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:b}=n(m);if(p){d=m+(d.length>0?" "+d:d);continue}let w=!!b,N=r(w?j.substring(0,b):j);if(!N){if(!w){d=m+(d.length>0?" "+d:d);continue}if(N=r(j),!N){d=m+(d.length>0?" "+d:d);continue}w=!1}const O=g.length===0?"":g.length===1?g[0]:i(g).join(":"),C=x?O+p_:O,A=C+N;if(l.indexOf(A)>-1)continue;l.push(A);const E=a(N,w);for(let k=0;k0?" "+d:d)}return d},EX=(...e)=>{let t=0,n,r,a="";for(;t{if(typeof e=="string")return e;let t,n="";for(let r=0;r{let n,r,a,i;const l=d=>{const f=t.reduce((m,p)=>p(m),e());return n=NX(f),r=n.cache.get,a=n.cache.set,i=u,u(d)},u=d=>{const f=r(d);if(f)return f;const m=CX(d,n);return a(d,m),m};return i=l,(...d)=>i(EX(...d))},TX=[],yn=e=>{const t=n=>n[e]||TX;return t.isThemeGetter=!0,t},N5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,O5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,kX=/^\d+\/\d+$/,PX=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,MX=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,RX=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,DX=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$X=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gc=e=>kX.test(e),tt=e=>!!e&&!Number.isNaN(Number(e)),Do=e=>!!e&&Number.isInteger(Number(e)),$0=e=>e.endsWith("%")&&tt(e.slice(0,-1)),Li=e=>PX.test(e),IX=()=>!0,LX=e=>MX.test(e)&&!RX.test(e),C5=()=>!1,BX=e=>DX.test(e),zX=e=>$X.test(e),qX=e=>!Te(e)&&!ke(e),FX=e=>ku(e,T5,C5),Te=e=>N5.test(e),Ps=e=>ku(e,k5,LX),I0=e=>ku(e,GX,tt),TP=e=>ku(e,E5,C5),UX=e=>ku(e,A5,zX),yp=e=>ku(e,P5,BX),ke=e=>O5.test(e),Wd=e=>Pu(e,k5),HX=e=>Pu(e,YX),kP=e=>Pu(e,E5),WX=e=>Pu(e,T5),VX=e=>Pu(e,A5),xp=e=>Pu(e,P5,!0),ku=(e,t,n)=>{const r=N5.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Pu=(e,t,n=!1)=>{const r=O5.exec(e);return r?r[1]?t(r[1]):n:!1},E5=e=>e==="position"||e==="percentage",A5=e=>e==="image"||e==="url",T5=e=>e==="length"||e==="size"||e==="bg-size",k5=e=>e==="length",GX=e=>e==="number",YX=e=>e==="family-name",P5=e=>e==="shadow",KX=()=>{const e=yn("color"),t=yn("font"),n=yn("text"),r=yn("font-weight"),a=yn("tracking"),i=yn("leading"),l=yn("breakpoint"),u=yn("container"),d=yn("spacing"),f=yn("radius"),m=yn("shadow"),p=yn("inset-shadow"),g=yn("text-shadow"),x=yn("drop-shadow"),j=yn("blur"),b=yn("perspective"),w=yn("aspect"),N=yn("ease"),O=yn("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...A(),ke,Te],k=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],P=()=>[ke,Te,d],$=()=>[gc,"full","auto",...P()],F=()=>[Do,"none","subgrid",ke,Te],D=()=>["auto",{span:["full",Do,ke,Te]},Do,ke,Te],U=()=>[Do,"auto",ke,Te],V=()=>["auto","min","max","fr",ke,Te],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...P()],R=()=>[gc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],q=()=>[e,ke,Te],K=()=>[...A(),kP,TP,{position:[ke,Te]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",WX,FX,{size:[ke,Te]}],B=()=>[$0,Wd,Ps],Y=()=>["","none","full",f,ke,Te],te=()=>["",tt,Wd,Ps],oe=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[tt,$0,kP,TP],ae=()=>["","none",j,ke,Te],Z=()=>["none",tt,ke,Te],pe=()=>["none",tt,ke,Te],je=()=>[tt,ke,Te],le=()=>[gc,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Li],breakpoint:[Li],color:[IX],container:[Li],"drop-shadow":[Li],ease:["in","out","in-out"],font:[qX],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Li],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Li],shadow:[Li],spacing:["px",tt],text:[Li],"text-shadow":[Li],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",gc,Te,ke,w]}],container:["container"],columns:[{columns:[tt,Te,ke,u]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{start:$()}],end:[{end:$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[Do,"auto",ke,Te]}],basis:[{basis:[gc,"full","auto",u,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[tt,gc,"auto","initial","none",Te]}],grow:[{grow:["",tt,ke,Te]}],shrink:[{shrink:["",tt,ke,Te]}],order:[{order:[Do,"first","last","none",ke,Te]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:R()}],w:[{w:[u,"screen",...R()]}],"min-w":[{"min-w":[u,"screen","none",...R()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...R()]}],h:[{h:["screen","lh",...R()]}],"min-h":[{"min-h":["screen","lh","none",...R()]}],"max-h":[{"max-h":["screen","lh",...R()]}],"font-size":[{text:["base",n,Wd,Ps]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ke,I0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$0,Te]}],"font-family":[{font:[HX,Te,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ke,Te]}],"line-clamp":[{"line-clamp":[tt,"none",ke,I0]}],leading:[{leading:[i,...P()]}],"list-image":[{"list-image":["none",ke,Te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,Te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[tt,"from-font","auto",ke,Ps]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[tt,"auto",ke,Te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,Te]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke,Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:K()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Do,ke,Te],radial:["",ke,Te],conic:[Do,ke,Te]},VX,UX]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[tt,ke,Te]}],"outline-w":[{outline:["",tt,Wd,Ps]}],"outline-color":[{outline:q()}],shadow:[{shadow:["","none",m,xp,yp]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",p,xp,yp]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[tt,Ps]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":q()}],"text-shadow":[{"text-shadow":["none",g,xp,yp]}],"text-shadow-color":[{"text-shadow":q()}],opacity:[{opacity:[tt,ke,Te]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[tt]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":q()}],"mask-image-linear-to-color":[{"mask-linear-to":q()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":q()}],"mask-image-t-to-color":[{"mask-t-to":q()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":q()}],"mask-image-r-to-color":[{"mask-r-to":q()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":q()}],"mask-image-b-to-color":[{"mask-b-to":q()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":q()}],"mask-image-l-to-color":[{"mask-l-to":q()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":q()}],"mask-image-x-to-color":[{"mask-x-to":q()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":q()}],"mask-image-y-to-color":[{"mask-y-to":q()}],"mask-image-radial":[{"mask-radial":[ke,Te]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":q()}],"mask-image-radial-to-color":[{"mask-radial-to":q()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[tt]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":q()}],"mask-image-conic-to-color":[{"mask-conic-to":q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,Te]}],filter:[{filter:["","none",ke,Te]}],blur:[{blur:ae()}],brightness:[{brightness:[tt,ke,Te]}],contrast:[{contrast:[tt,ke,Te]}],"drop-shadow":[{"drop-shadow":["","none",x,xp,yp]}],"drop-shadow-color":[{"drop-shadow":q()}],grayscale:[{grayscale:["",tt,ke,Te]}],"hue-rotate":[{"hue-rotate":[tt,ke,Te]}],invert:[{invert:["",tt,ke,Te]}],saturate:[{saturate:[tt,ke,Te]}],sepia:[{sepia:["",tt,ke,Te]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,Te]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[tt,ke,Te]}],"backdrop-contrast":[{"backdrop-contrast":[tt,ke,Te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",tt,ke,Te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[tt,ke,Te]}],"backdrop-invert":[{"backdrop-invert":["",tt,ke,Te]}],"backdrop-opacity":[{"backdrop-opacity":[tt,ke,Te]}],"backdrop-saturate":[{"backdrop-saturate":[tt,ke,Te]}],"backdrop-sepia":[{"backdrop-sepia":["",tt,ke,Te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,Te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[tt,"initial",ke,Te]}],ease:[{ease:["linear","initial",N,ke,Te]}],delay:[{delay:[tt,ke,Te]}],animate:[{animate:["none",O,ke,Te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ke,Te]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Z()}],"rotate-x":[{"rotate-x":Z()}],"rotate-y":[{"rotate-y":Z()}],"rotate-z":[{"rotate-z":Z()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:je()}],"skew-x":[{"skew-x":je()}],"skew-y":[{"skew-y":je()}],transform:[{transform:[ke,Te,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke,Te]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke,Te]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[tt,Wd,Ps,I0]}],stroke:[{stroke:["none",...q()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},XX=AX(KX);function ue(...e){return XX(Ye(e))}const ct=y.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ue("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ct.displayName="Card";const Ut=y.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ue("flex flex-col space-y-1.5 p-6",e),...t}));Ut.displayName="CardHeader";const Ht=y.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ue("font-semibold leading-none tracking-tight",e),...t}));Ht.displayName="CardTitle";const Xn=y.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));Xn.displayName="CardDescription";const un=y.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ue("p-6 pt-0",e),...t}));un.displayName="CardContent";const M5=y.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ue("flex items-center p-6 pt-0",e),...t}));M5.displayName="CardFooter";function Se(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function ZX(e,t){const n=y.createContext(t),r=i=>{const{children:l,...u}=i,d=y.useMemo(()=>u,Object.values(u));return s.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function a(i){const l=y.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function ur(e,t=[]){let n=[];function r(i,l){const u=y.createContext(l),d=n.length;n=[...n,l];const f=p=>{const{scope:g,children:x,...j}=p,b=g?.[e]?.[d]||u,w=y.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:w,children:x})};f.displayName=i+"Provider";function m(p,g){const x=g?.[e]?.[d]||u,j=y.useContext(x);if(j)return j;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,m]}const a=()=>{const i=n.map(l=>y.createContext(l));return function(u){const d=u?.[e]||i;return y.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return a.scopeName=e,[r,QX(a,...t)]}function QX(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...u,...p}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function PP(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Tr(...e){return t=>{let n=!1;const r=e.map(a=>{const i=PP(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a{const{children:i,...l}=r,u=y.Children.toArray(i),d=u.find(tZ);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return s.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function JX(e){const t=y.forwardRef((n,r)=>{const{children:a,...i}=n;if(y.isValidElement(a)){const l=rZ(a),u=nZ(i,a.props);return a.type!==y.Fragment&&(u.ref=r?Tr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var eZ=Symbol("radix.slottable");function tZ(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===eZ}function nZ(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function rZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function wh(e){const t=e+"CollectionProvider",[n,r]=ur(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=b=>{const{scope:w,children:N}=b,O=W.useRef(null),C=W.useRef(new Map).current;return s.jsx(a,{scope:w,itemMap:C,collectionRef:O,children:N})};l.displayName=t;const u=e+"CollectionSlot",d=MP(u),f=W.forwardRef((b,w)=>{const{scope:N,children:O}=b,C=i(u,N),A=qe(w,C.collectionRef);return s.jsx(d,{ref:A,children:O})});f.displayName=u;const m=e+"CollectionItemSlot",p="data-radix-collection-item",g=MP(m),x=W.forwardRef((b,w)=>{const{scope:N,children:O,...C}=b,A=W.useRef(null),E=qe(w,A),k=i(m,N);return W.useEffect(()=>(k.itemMap.set(A,{ref:A,...C}),()=>void k.itemMap.delete(A))),s.jsx(g,{[p]:"",ref:E,children:O})});x.displayName=m;function j(b){const w=i(e+"CollectionConsumer",b);return W.useCallback(()=>{const O=w.collectionRef.current;if(!O)return[];const C=Array.from(O.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((k,T)=>C.indexOf(k.ref.current)-C.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:l,Slot:f,ItemSlot:x},j,r]}var Bn=globalThis?.document?y.useLayoutEffect:()=>{},aZ=gO[" useId ".trim().toString()]||(()=>{}),iZ=0;function kn(e){const[t,n]=y.useState(aZ());return Bn(()=>{n(r=>r??String(iZ++))},[e]),t?`radix-${t}`:""}function oZ(e){const t=sZ(e),n=y.forwardRef((r,a)=>{const{children:i,...l}=r,u=y.Children.toArray(i),d=u.find(cZ);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return s.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function sZ(e){const t=y.forwardRef((n,r)=>{const{children:a,...i}=n;if(y.isValidElement(a)){const l=dZ(a),u=uZ(i,a.props);return a.type!==y.Fragment&&(u.ref=r?Tr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lZ=Symbol("radix.slottable");function cZ(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lZ}function uZ(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function dZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fZ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Me=fZ.reduce((e,t)=>{const n=oZ(`Primitive.${t}`),r=y.forwardRef((a,i)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function MO(e,t){e&&pl.flushSync(()=>e.dispatchEvent(t))}function Xt(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>t.current?.(...n),[])}var hZ=gO[" useInsertionEffect ".trim().toString()]||Bn;function wa({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,l]=mZ({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:a;{const m=y.useRef(e!==void 0);y.useEffect(()=>{const p=m.current;p!==u&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=u},[u,r])}const f=y.useCallback(m=>{if(u){const p=pZ(m)?m(e):m;p!==e&&l.current?.(p)}else i(m)},[u,e,i,l]);return[d,f]}function mZ({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),a=y.useRef(n),i=y.useRef(t);return hZ(()=>{i.current=t},[t]),y.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}function pZ(e){return typeof e=="function"}var vZ=y.createContext(void 0);function Mu(e){const t=y.useContext(vZ);return e||t||"ltr"}var L0="rovingFocusGroup.onEntryFocus",gZ={bubbles:!1,cancelable:!0},jh="RovingFocusGroup",[v_,R5,yZ]=wh(jh),[xZ,Ig]=ur(jh,[yZ]),[bZ,wZ]=xZ(jh),D5=y.forwardRef((e,t)=>s.jsx(v_.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(v_.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(jZ,{...e,ref:t})})}));D5.displayName=jh;var jZ=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...p}=e,g=y.useRef(null),x=qe(t,g),j=Mu(i),[b,w]=wa({prop:l,defaultProp:u??null,onChange:d,caller:jh}),[N,O]=y.useState(!1),C=Xt(f),A=R5(n),E=y.useRef(!1),[k,T]=y.useState(0);return y.useEffect(()=>{const P=g.current;if(P)return P.addEventListener(L0,C),()=>P.removeEventListener(L0,C)},[C]),s.jsx(bZ,{scope:n,orientation:r,dir:j,loop:a,currentTabStopId:b,onItemFocus:y.useCallback(P=>w(P),[w]),onItemShiftTab:y.useCallback(()=>O(!0),[]),onFocusableItemAdd:y.useCallback(()=>T(P=>P+1),[]),onFocusableItemRemove:y.useCallback(()=>T(P=>P-1),[]),children:s.jsx(Me.div,{tabIndex:N||k===0?-1:0,"data-orientation":r,...p,ref:x,style:{outline:"none",...e.style},onMouseDown:Se(e.onMouseDown,()=>{E.current=!0}),onFocus:Se(e.onFocus,P=>{const $=!E.current;if(P.target===P.currentTarget&&$&&!N){const F=new CustomEvent(L0,gZ);if(P.currentTarget.dispatchEvent(F),!F.defaultPrevented){const D=A().filter(L=>L.focusable),U=D.find(L=>L.active),V=D.find(L=>L.id===b),G=[U,V,...D].filter(Boolean).map(L=>L.ref.current);L5(G,m)}}E.current=!1}),onBlur:Se(e.onBlur,()=>O(!1))})})}),$5="RovingFocusGroupItem",I5=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:l,...u}=e,d=kn(),f=i||d,m=wZ($5,n),p=m.currentTabStopId===f,g=R5(n),{onFocusableItemAdd:x,onFocusableItemRemove:j,currentTabStopId:b}=m;return y.useEffect(()=>{if(r)return x(),()=>j()},[r,x,j]),s.jsx(v_.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:s.jsx(Me.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...u,ref:t,onMouseDown:Se(e.onMouseDown,w=>{r?m.onItemFocus(f):w.preventDefault()}),onFocus:Se(e.onFocus,()=>m.onItemFocus(f)),onKeyDown:Se(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){m.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const N=NZ(w,m.orientation,m.dir);if(N!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let C=g().filter(A=>A.focusable).map(A=>A.ref.current);if(N==="last")C.reverse();else if(N==="prev"||N==="next"){N==="prev"&&C.reverse();const A=C.indexOf(w.currentTarget);C=m.loop?OZ(C,A+1):C.slice(A+1)}setTimeout(()=>L5(C))}}),children:typeof l=="function"?l({isCurrentTabStop:p,hasTabStop:b!=null}):l})})});I5.displayName=$5;var SZ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function _Z(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function NZ(e,t,n){const r=_Z(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return SZ[r]}function L5(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function OZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var B5=D5,z5=I5;function CZ(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Sn=e=>{const{present:t,children:n}=e,r=EZ(t),a=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),i=qe(r.ref,AZ(a));return typeof n=="function"||r.isPresent?y.cloneElement(a,{ref:i}):null};Sn.displayName="Presence";function EZ(e){const[t,n]=y.useState(),r=y.useRef(null),a=y.useRef(e),i=y.useRef("none"),l=e?"mounted":"unmounted",[u,d]=CZ(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const f=bp(r.current);i.current=u==="mounted"?f:"none"},[u]),Bn(()=>{const f=r.current,m=a.current;if(m!==e){const g=i.current,x=bp(f);e?d("MOUNT"):x==="none"||f?.display==="none"?d("UNMOUNT"):d(m&&g!==x?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),Bn(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,p=x=>{const b=bp(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&b&&(d("ANIMATION_END"),!a.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},g=x=>{x.target===t&&(i.current=bp(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:y.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function bp(e){return e?.animationName||"none"}function AZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Lg="Tabs",[TZ]=ur(Lg,[Ig]),q5=Ig(),[kZ,RO]=TZ(Lg),F5=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:l="horizontal",dir:u,activationMode:d="automatic",...f}=e,m=Mu(u),[p,g]=wa({prop:r,onChange:a,defaultProp:i??"",caller:Lg});return s.jsx(kZ,{scope:n,baseId:kn(),value:p,onValueChange:g,orientation:l,dir:m,activationMode:d,children:s.jsx(Me.div,{dir:m,"data-orientation":l,...f,ref:t})})});F5.displayName=Lg;var U5="TabsList",H5=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=RO(U5,n),l=q5(n);return s.jsx(B5,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(Me.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});H5.displayName=U5;var W5="TabsTrigger",V5=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,l=RO(W5,n),u=q5(n),d=K5(l.baseId,r),f=X5(l.baseId,r),m=r===l.value;return s.jsx(z5,{asChild:!0,...u,focusable:!a,active:m,children:s.jsx(Me.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:d,...i,ref:t,onMouseDown:Se(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?l.onValueChange(r):p.preventDefault()}),onKeyDown:Se(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&l.onValueChange(r)}),onFocus:Se(e.onFocus,()=>{const p=l.activationMode!=="manual";!m&&!a&&p&&l.onValueChange(r)})})})});V5.displayName=W5;var G5="TabsContent",Y5=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...l}=e,u=RO(G5,n),d=K5(u.baseId,r),f=X5(u.baseId,r),m=r===u.value,p=y.useRef(m);return y.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),s.jsx(Sn,{present:a||m,children:({present:g})=>s.jsx(Me.div,{"data-state":m?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&i})})});Y5.displayName=G5;function K5(e,t){return`${e}-trigger-${t}`}function X5(e,t){return`${e}-content-${t}`}var PZ=F5,Z5=H5,Q5=V5,J5=Y5;const al=PZ,Yo=y.forwardRef(({className:e,...t},n)=>s.jsx(Z5,{ref:n,className:ue("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Yo.displayName=Z5.displayName;const Tt=y.forwardRef(({className:e,...t},n)=>s.jsx(Q5,{ref:n,className:ue("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Tt.displayName=Q5.displayName;const Jt=y.forwardRef(({className:e,...t},n)=>s.jsx(J5,{ref:n,className:ue("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:animate-in data-[state=active]:fade-in data-[state=active]:duration-300",e),...t}));Jt.displayName=J5.displayName;function Nf(e,[t,n]){return Math.min(n,Math.max(t,e))}function MZ(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var DO="ScrollArea",[eB]=ur(DO),[RZ,Sa]=eB(DO),tB=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:i=600,...l}=e,[u,d]=y.useState(null),[f,m]=y.useState(null),[p,g]=y.useState(null),[x,j]=y.useState(null),[b,w]=y.useState(null),[N,O]=y.useState(0),[C,A]=y.useState(0),[E,k]=y.useState(!1),[T,P]=y.useState(!1),$=qe(t,D=>d(D)),F=Mu(a);return s.jsx(RZ,{scope:n,type:r,dir:F,scrollHideDelay:i,scrollArea:u,viewport:f,onViewportChange:m,content:p,onContentChange:g,scrollbarX:x,onScrollbarXChange:j,scrollbarXEnabled:E,onScrollbarXEnabledChange:k,scrollbarY:b,onScrollbarYChange:w,scrollbarYEnabled:T,onScrollbarYEnabledChange:P,onCornerWidthChange:O,onCornerHeightChange:A,children:s.jsx(Me.div,{dir:F,...l,ref:$,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})})});tB.displayName=DO;var nB="ScrollAreaViewport",rB=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,l=Sa(nB,n),u=y.useRef(null),d=qe(t,u,l.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),s.jsx(Me.div,{"data-radix-scroll-area-viewport":"",...i,ref:d,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:s.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});rB.displayName=nB;var pi="ScrollAreaScrollbar",$O=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Sa(pi,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=a,u=e.orientation==="horizontal";return y.useEffect(()=>(u?i(!0):l(!0),()=>{u?i(!1):l(!1)}),[u,i,l]),a.type==="hover"?s.jsx(DZ,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx($Z,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(aB,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(IO,{...r,ref:t}):null});$O.displayName=pi;var DZ=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Sa(pi,e.__scopeScrollArea),[i,l]=y.useState(!1);return y.useEffect(()=>{const u=a.scrollArea;let d=0;if(u){const f=()=>{window.clearTimeout(d),l(!0)},m=()=>{d=window.setTimeout(()=>l(!1),a.scrollHideDelay)};return u.addEventListener("pointerenter",f),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",f),u.removeEventListener("pointerleave",m)}}},[a.scrollArea,a.scrollHideDelay]),s.jsx(Sn,{present:n||i,children:s.jsx(aB,{"data-state":i?"visible":"hidden",...r,ref:t})})}),$Z=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Sa(pi,e.__scopeScrollArea),i=e.orientation==="horizontal",l=zg(()=>d("SCROLL_END"),100),[u,d]=MZ("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(u==="idle"){const f=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(f)}},[u,a.scrollHideDelay,d]),y.useEffect(()=>{const f=a.viewport,m=i?"scrollLeft":"scrollTop";if(f){let p=f[m];const g=()=>{const x=f[m];p!==x&&(d("SCROLL"),l()),p=x};return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[a.viewport,i,d,l]),s.jsx(Sn,{present:n||u!=="hidden",children:s.jsx(IO,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Se(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Se(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),aB=y.forwardRef((e,t)=>{const n=Sa(pi,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,l]=y.useState(!1),u=e.orientation==="horizontal",d=zg(()=>{if(n.viewport){const f=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,a=Sa(pi,e.__scopeScrollArea),i=y.useRef(null),l=y.useRef(0),[u,d]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=cB(u.viewport,u.content),m={...r,sizes:u,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:g=>l.current=g};function p(g,x){return FZ(g,l.current,u,x)}return n==="horizontal"?s.jsx(IZ,{...m,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const g=a.viewport.scrollLeft,x=RP(g,u,a.dir);i.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollLeft=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollLeft=p(g,a.dir))}}):n==="vertical"?s.jsx(LZ,{...m,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const g=a.viewport.scrollTop,x=RP(g,u);i.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollTop=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollTop=p(g))}}):null}),IZ=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Sa(pi,e.__scopeScrollArea),[l,u]=y.useState(),d=y.useRef(null),f=qe(t,d,i.onScrollbarXChange);return y.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),s.jsx(oB,{"data-orientation":"horizontal",...a,ref:f,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Bg(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,p)=>{if(i.viewport){const g=i.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),dB(g,p)&&m.preventDefault()}},onResize:()=>{d.current&&i.viewport&&l&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:mv(l.paddingLeft),paddingEnd:mv(l.paddingRight)}})}})}),LZ=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Sa(pi,e.__scopeScrollArea),[l,u]=y.useState(),d=y.useRef(null),f=qe(t,d,i.onScrollbarYChange);return y.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),s.jsx(oB,{"data-orientation":"vertical",...a,ref:f,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Bg(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,p)=>{if(i.viewport){const g=i.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),dB(g,p)&&m.preventDefault()}},onResize:()=>{d.current&&i.viewport&&l&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:mv(l.paddingTop),paddingEnd:mv(l.paddingBottom)}})}})}),[BZ,iB]=eB(pi),oB=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:u,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:m,onResize:p,...g}=e,x=Sa(pi,n),[j,b]=y.useState(null),w=qe(t,$=>b($)),N=y.useRef(null),O=y.useRef(""),C=x.viewport,A=r.content-r.viewport,E=Xt(m),k=Xt(d),T=zg(p,10);function P($){if(N.current){const F=$.clientX-N.current.left,D=$.clientY-N.current.top;f({x:F,y:D})}}return y.useEffect(()=>{const $=F=>{const D=F.target;j?.contains(D)&&E(F,A)};return document.addEventListener("wheel",$,{passive:!1}),()=>document.removeEventListener("wheel",$,{passive:!1})},[C,j,A,E]),y.useEffect(k,[r,k]),Qc(j,T),Qc(x.content,T),s.jsx(BZ,{scope:n,scrollbar:j,hasThumb:a,onThumbChange:Xt(i),onThumbPointerUp:Xt(l),onThumbPositionChange:k,onThumbPointerDown:Xt(u),children:s.jsx(Me.div,{...g,ref:w,style:{position:"absolute",...g.style},onPointerDown:Se(e.onPointerDown,$=>{$.button===0&&($.target.setPointerCapture($.pointerId),N.current=j.getBoundingClientRect(),O.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),P($))}),onPointerMove:Se(e.onPointerMove,P),onPointerUp:Se(e.onPointerUp,$=>{const F=$.target;F.hasPointerCapture($.pointerId)&&F.releasePointerCapture($.pointerId),document.body.style.webkitUserSelect=O.current,x.viewport&&(x.viewport.style.scrollBehavior=""),N.current=null})})})}),hv="ScrollAreaThumb",sB=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=iB(hv,e.__scopeScrollArea);return s.jsx(Sn,{present:n||a.hasThumb,children:s.jsx(zZ,{ref:t,...r})})}),zZ=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=Sa(hv,n),l=iB(hv,n),{onThumbPositionChange:u}=l,d=qe(t,p=>l.onThumbChange(p)),f=y.useRef(void 0),m=zg(()=>{f.current&&(f.current(),f.current=void 0)},100);return y.useEffect(()=>{const p=i.viewport;if(p){const g=()=>{if(m(),!f.current){const x=UZ(p,u);f.current=x,u()}};return u(),p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[i.viewport,m,u]),s.jsx(Me.div,{"data-state":l.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Se(e.onPointerDownCapture,p=>{const x=p.target.getBoundingClientRect(),j=p.clientX-x.left,b=p.clientY-x.top;l.onThumbPointerDown({x:j,y:b})}),onPointerUp:Se(e.onPointerUp,l.onThumbPointerUp)})});sB.displayName=hv;var LO="ScrollAreaCorner",lB=y.forwardRef((e,t)=>{const n=Sa(LO,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(qZ,{...e,ref:t}):null});lB.displayName=LO;var qZ=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Sa(LO,n),[i,l]=y.useState(0),[u,d]=y.useState(0),f=!!(i&&u);return Qc(a.scrollbarX,()=>{const m=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(m),d(m)}),Qc(a.scrollbarY,()=>{const m=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(m),l(m)}),f?s.jsx(Me.div,{...r,ref:t,style:{width:i,height:u,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function mv(e){return e?parseInt(e,10):0}function cB(e,t){const n=e/t;return isNaN(n)?0:n}function Bg(e){const t=cB(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function FZ(e,t,n,r="ltr"){const a=Bg(n),i=a/2,l=t||i,u=a-l,d=n.scrollbar.paddingStart+l,f=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,p=r==="ltr"?[0,m]:[m*-1,0];return uB([d,f],p)(e)}function RP(e,t,n="ltr"){const r=Bg(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,l=t.content-t.viewport,u=i-r,d=n==="ltr"?[0,l]:[l*-1,0],f=Nf(e,d);return uB([0,l],[0,u])(f)}function uB(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function dB(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function a(){const i={left:e.scrollLeft,top:e.scrollTop},l=n.left!==i.left,u=n.top!==i.top;(l||u)&&t(),n=i,r=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(r)};function zg(e,t){const n=Xt(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Qc(e,t){const n=Xt(t);Bn(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var fB=tB,HZ=rB,WZ=lB;const Kt=y.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(fB,{ref:r,className:ue("relative overflow-hidden",e),...n,children:[s.jsx(HZ,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(hB,{}),s.jsx(WZ,{})]}));Kt.displayName=fB.displayName;const hB=y.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx($O,{ref:r,orientation:t,className:ue("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:s.jsx(sB,{className:"relative flex-1 rounded-full bg-border"})}));hB.displayName=$O.displayName;var B0,DP;function Rr(){if(DP)return B0;DP=1;var e=Array.isArray;return B0=e,B0}var z0,$P;function mB(){if($P)return z0;$P=1;var e=typeof fp=="object"&&fp&&fp.Object===Object&&fp;return z0=e,z0}var q0,IP;function vi(){if(IP)return q0;IP=1;var e=mB(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return q0=n,q0}var F0,LP;function Sh(){if(LP)return F0;LP=1;var e=vi(),t=e.Symbol;return F0=t,F0}var U0,BP;function VZ(){if(BP)return U0;BP=1;var e=Sh(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function i(l){var u=n.call(l,a),d=l[a];try{l[a]=void 0;var f=!0}catch{}var m=r.call(l);return f&&(u?l[a]=d:delete l[a]),m}return U0=i,U0}var H0,zP;function GZ(){if(zP)return H0;zP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return H0=n,H0}var W0,qP;function io(){if(qP)return W0;qP=1;var e=Sh(),t=VZ(),n=GZ(),r="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function l(u){return u==null?u===void 0?a:r:i&&i in Object(u)?t(u):n(u)}return W0=l,W0}var V0,FP;function oo(){if(FP)return V0;FP=1;function e(t){return t!=null&&typeof t=="object"}return V0=e,V0}var G0,UP;function Ru(){if(UP)return G0;UP=1;var e=io(),t=oo(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return G0=r,G0}var Y0,HP;function BO(){if(HP)return Y0;HP=1;var e=Rr(),t=Ru(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(i,l){if(e(i))return!1;var u=typeof i;return u=="number"||u=="symbol"||u=="boolean"||i==null||t(i)?!0:r.test(i)||!n.test(i)||l!=null&&i in Object(l)}return Y0=a,Y0}var K0,WP;function ts(){if(WP)return K0;WP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return K0=e,K0}var X0,VP;function zO(){if(VP)return X0;VP=1;var e=io(),t=ts(),n="[object AsyncFunction]",r="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function l(u){if(!t(u))return!1;var d=e(u);return d==r||d==a||d==n||d==i}return X0=l,X0}var Z0,GP;function YZ(){if(GP)return Z0;GP=1;var e=vi(),t=e["__core-js_shared__"];return Z0=t,Z0}var Q0,YP;function KZ(){if(YP)return Q0;YP=1;var e=YZ(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return Q0=n,Q0}var J0,KP;function pB(){if(KP)return J0;KP=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return J0=n,J0}var ew,XP;function XZ(){if(XP)return ew;XP=1;var e=zO(),t=KZ(),n=ts(),r=pB(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,d=l.toString,f=u.hasOwnProperty,m=RegExp("^"+d.call(f).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(g){if(!n(g)||t(g))return!1;var x=e(g)?m:i;return x.test(r(g))}return ew=p,ew}var tw,ZP;function ZZ(){if(ZP)return tw;ZP=1;function e(t,n){return t?.[n]}return tw=e,tw}var nw,QP;function vl(){if(QP)return nw;QP=1;var e=XZ(),t=ZZ();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return nw=n,nw}var rw,JP;function qg(){if(JP)return rw;JP=1;var e=vl(),t=e(Object,"create");return rw=t,rw}var aw,eM;function QZ(){if(eM)return aw;eM=1;var e=qg();function t(){this.__data__=e?e(null):{},this.size=0}return aw=t,aw}var iw,tM;function JZ(){if(tM)return iw;tM=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return iw=e,iw}var ow,nM;function eQ(){if(nM)return ow;nM=1;var e=qg(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function a(i){var l=this.__data__;if(e){var u=l[i];return u===t?void 0:u}return r.call(l,i)?l[i]:void 0}return ow=a,ow}var sw,rM;function tQ(){if(rM)return sw;rM=1;var e=qg(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return sw=r,sw}var lw,aM;function nQ(){if(aM)return lw;aM=1;var e=qg(),t="__lodash_hash_undefined__";function n(r,a){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=e&&a===void 0?t:a,this}return lw=n,lw}var cw,iM;function rQ(){if(iM)return cw;iM=1;var e=QZ(),t=JZ(),n=eQ(),r=tQ(),a=nQ();function i(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u-1}return pw=t,pw}var vw,fM;function lQ(){if(fM)return vw;fM=1;var e=Fg();function t(n,r){var a=this.__data__,i=e(a,n);return i<0?(++this.size,a.push([n,r])):a[i][1]=r,this}return vw=t,vw}var gw,hM;function Ug(){if(hM)return gw;hM=1;var e=aQ(),t=iQ(),n=oQ(),r=sQ(),a=lQ();function i(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u0?1:-1},qs=function(t){return il(t)&&t.indexOf("%")===t.length-1},Ne=function(t){return kQ(t)&&!_h(t)},PQ=function(t){return Ge(t)},jn=function(t){return Ne(t)||il(t)},MQ=0,$u=function(t){var n=++MQ;return"".concat(t||"").concat(n)},gr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ne(t)&&!il(t))return r;var i;if(qs(t)){var l=t.indexOf("%");i=n*parseFloat(t.slice(0,l))/100}else i=+t;return _h(i)&&(i=r),a&&i>n&&(i=n),i},Bo=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},RQ=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function y_(e){"@babel/helpers - typeof";return y_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y_(e)}var qM={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Ki=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},FM=null,Uw=null,GO=function e(t){if(t===FM&&Array.isArray(Uw))return Uw;var n=[];return y.Children.forEach(t,function(r){Ge(r)||(CQ.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Uw=n,FM=t,n};function Jr(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return Ki(a)}):r=[Ki(t)],GO(e).forEach(function(a){var i=Qr(a,"type.displayName")||Qr(a,"type.name");r.indexOf(i)!==-1&&n.push(a)}),n}function Vr(e,t){var n=Jr(e,t);return n&&n[0]}var UM=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!Ne(r)||r<=0||!Ne(a)||a<=0)},FQ=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],UQ=function(t){return t&&t.type&&il(t.type)&&FQ.indexOf(t.type)>=0},HQ=function(t){return t&&y_(t)==="object"&&"clipDot"in t},WQ=function(t,n,r,a){var i,l=(i=Fw?.[a])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!We(t)&&(a&&l.includes(n)||IQ.includes(n))||r&&VO.includes(n)},Be=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(y.isValidElement(t)&&(a=t.props),!Du(a))return null;var i={};return Object.keys(a).forEach(function(l){var u;WQ((u=a)===null||u===void 0?void 0:u[l],l,n,r)&&(i[l]=a[l])}),i},x_=function e(t,n){if(t===n)return!0;var r=y.Children.count(t);if(r!==y.Children.count(n))return!1;if(r===0)return!0;if(r===1)return HM(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function XQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function w_(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,i=e.className,l=e.style,u=e.title,d=e.desc,f=KQ(e,YQ),m=a||{width:n,height:r,x:0,y:0},p=Ye("recharts-surface",i);return W.createElement("svg",b_({},Be(f,!0,"svg"),{className:p,width:n,height:r,style:l,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height)}),W.createElement("title",null,u),W.createElement("desc",null,d),t)}var ZQ=["children","className"];function j_(){return j_=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function JQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var ft=W.forwardRef(function(e,t){var n=e.children,r=e.className,a=QQ(e,ZQ),i=Ye("recharts-layer",r);return W.createElement("g",j_({className:i},Be(a,!0),{ref:t}),n)}),$a=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),i=2;ii?0:i+n),r=r>i?i:r,r<0&&(r+=i),i=n>r?0:r-n>>>0,n>>>=0;for(var l=Array(i);++a=i?n:e(n,r,a)}return Ww=t,Ww}var Vw,YM;function wB(){if(YM)return Vw;YM=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,i="\\ufe0e\\ufe0f",l="\\u200d",u=RegExp("["+l+e+a+i+"]");function d(f){return u.test(f)}return Vw=d,Vw}var Gw,KM;function nJ(){if(KM)return Gw;KM=1;function e(t){return t.split("")}return Gw=e,Gw}var Yw,XM;function rJ(){if(XM)return Yw;XM=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,i="\\ufe0e\\ufe0f",l="["+e+"]",u="["+a+"]",d="\\ud83c[\\udffb-\\udfff]",f="(?:"+u+"|"+d+")",m="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",j=f+"?",b="["+i+"]?",w="(?:"+x+"(?:"+[m,p,g].join("|")+")"+b+j+")*",N=b+j+w,O="(?:"+[m+u+"?",u,p,g,l].join("|")+")",C=RegExp(d+"(?="+d+")|"+O+N,"g");function A(E){return E.match(C)||[]}return Yw=A,Yw}var Kw,ZM;function aJ(){if(ZM)return Kw;ZM=1;var e=nJ(),t=wB(),n=rJ();function r(a){return t(a)?n(a):e(a)}return Kw=r,Kw}var Xw,QM;function iJ(){if(QM)return Xw;QM=1;var e=tJ(),t=wB(),n=aJ(),r=gB();function a(i){return function(l){l=r(l);var u=t(l)?n(l):void 0,d=u?u[0]:l.charAt(0),f=u?e(u,1).join(""):l.slice(1);return d[i]()+f}}return Xw=a,Xw}var Zw,JM;function oJ(){if(JM)return Zw;JM=1;var e=iJ(),t=e("toUpperCase");return Zw=t,Zw}var sJ=oJ();const Vg=wt(sJ);function Lt(e){return function(){return e}}const jB=Math.cos,gv=Math.sin,Ua=Math.sqrt,yv=Math.PI,Gg=2*yv,S_=Math.PI,__=2*S_,$s=1e-6,lJ=__-$s;function SB(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return SB;const n=10**t;return function(r){this._+=r[0];for(let a=1,i=r.length;a$s)if(!(Math.abs(p*d-f*m)>$s)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let x=r-l,j=a-u,b=d*d+f*f,w=x*x+j*j,N=Math.sqrt(b),O=Math.sqrt(g),C=i*Math.tan((S_-Math.acos((b+g-w)/(2*N*O)))/2),A=C/O,E=C/N;Math.abs(A-1)>$s&&this._append`L${t+A*m},${n+A*p}`,this._append`A${i},${i},0,0,${+(p*x>m*j)},${this._x1=t+E*d},${this._y1=n+E*f}`}}arc(t,n,r,a,i,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let u=r*Math.cos(a),d=r*Math.sin(a),f=t+u,m=n+d,p=1^l,g=l?a-i:i-a;this._x1===null?this._append`M${f},${m}`:(Math.abs(this._x1-f)>$s||Math.abs(this._y1-m)>$s)&&this._append`L${f},${m}`,r&&(g<0&&(g=g%__+__),g>lJ?this._append`A${r},${r},0,1,${p},${t-u},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=m}`:g>$s&&this._append`A${r},${r},0,${+(g>=S_)},${p},${this._x1=t+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function YO(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new uJ(t)}function KO(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function _B(e){this._context=e}_B.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Yg(e){return new _B(e)}function NB(e){return e[0]}function OB(e){return e[1]}function CB(e,t){var n=Lt(!0),r=null,a=Yg,i=null,l=YO(u);e=typeof e=="function"?e:e===void 0?NB:Lt(e),t=typeof t=="function"?t:t===void 0?OB:Lt(t);function u(d){var f,m=(d=KO(d)).length,p,g=!1,x;for(r==null&&(i=a(x=l())),f=0;f<=m;++f)!(f=x;--j)u.point(C[j],A[j]);u.lineEnd(),u.areaEnd()}N&&(C[g]=+e(w,g,p),A[g]=+t(w,g,p),u.point(r?+r(w,g,p):C[g],n?+n(w,g,p):A[g]))}if(O)return u=null,O+""||null}function m(){return CB().defined(a).curve(l).context(i)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:Lt(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:Lt(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:Lt(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:Lt(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:Lt(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:Lt(+p),f):n},f.lineX0=f.lineY0=function(){return m().x(e).y(t)},f.lineY1=function(){return m().x(e).y(n)},f.lineX1=function(){return m().x(r).y(t)},f.defined=function(p){return arguments.length?(a=typeof p=="function"?p:Lt(!!p),f):a},f.curve=function(p){return arguments.length?(l=p,i!=null&&(u=l(i)),f):l},f.context=function(p){return arguments.length?(p==null?i=u=null:u=l(i=p),f):i},f}class EB{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function dJ(e){return new EB(e,!0)}function fJ(e){return new EB(e,!1)}const XO={draw(e,t){const n=Ua(t/yv);e.moveTo(n,0),e.arc(0,0,n,0,Gg)}},hJ={draw(e,t){const n=Ua(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},AB=Ua(1/3),mJ=AB*2,pJ={draw(e,t){const n=Ua(t/mJ),r=n*AB;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},vJ={draw(e,t){const n=Ua(t),r=-n/2;e.rect(r,r,n,n)}},gJ=.8908130915292852,TB=gv(yv/10)/gv(7*yv/10),yJ=gv(Gg/10)*TB,xJ=-jB(Gg/10)*TB,bJ={draw(e,t){const n=Ua(t*gJ),r=yJ*n,a=xJ*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const l=Gg*i/5,u=jB(l),d=gv(l);e.lineTo(d*n,-u*n),e.lineTo(u*r-d*a,d*r+u*a)}e.closePath()}},Qw=Ua(3),wJ={draw(e,t){const n=-Ua(t/(Qw*3));e.moveTo(0,n*2),e.lineTo(-Qw*n,-n),e.lineTo(Qw*n,-n),e.closePath()}},ha=-.5,ma=Ua(3)/2,N_=1/Ua(12),jJ=(N_/2+1)*3,SJ={draw(e,t){const n=Ua(t/jJ),r=n/2,a=n*N_,i=r,l=n*N_+n,u=-i,d=l;e.moveTo(r,a),e.lineTo(i,l),e.lineTo(u,d),e.lineTo(ha*r-ma*a,ma*r+ha*a),e.lineTo(ha*i-ma*l,ma*i+ha*l),e.lineTo(ha*u-ma*d,ma*u+ha*d),e.lineTo(ha*r+ma*a,ha*a-ma*r),e.lineTo(ha*i+ma*l,ha*l-ma*i),e.lineTo(ha*u+ma*d,ha*d-ma*u),e.closePath()}};function _J(e,t){let n=null,r=YO(a);e=typeof e=="function"?e:Lt(e||XO),t=typeof t=="function"?t:Lt(t===void 0?64:+t);function a(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:Lt(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:Lt(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function xv(){}function bv(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function kB(e){this._context=e}kB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:bv(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:bv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function NJ(e){return new kB(e)}function PB(e){this._context=e}PB.prototype={areaStart:xv,areaEnd:xv,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:bv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OJ(e){return new PB(e)}function MB(e){this._context=e}MB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:bv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function CJ(e){return new MB(e)}function RB(e){this._context=e}RB.prototype={areaStart:xv,areaEnd:xv,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function EJ(e){return new RB(e)}function eR(e){return e<0?-1:1}function tR(e,t,n){var r=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(r||a<0&&-0),l=(n-e._y1)/(a||r<0&&-0),u=(i*a+l*r)/(r+a);return(eR(i)+eR(l))*Math.min(Math.abs(i),Math.abs(l),.5*Math.abs(u))||0}function nR(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Jw(e,t,n){var r=e._x0,a=e._y0,i=e._x1,l=e._y1,u=(i-r)/3;e._context.bezierCurveTo(r+u,a+u*t,i-u,l-u*n,i,l)}function wv(e){this._context=e}wv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Jw(this,this._t0,nR(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Jw(this,nR(this,n=tR(this,e,t)),n);break;default:Jw(this,this._t0,n=tR(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function DB(e){this._context=new $B(e)}(DB.prototype=Object.create(wv.prototype)).point=function(e,t){wv.prototype.point.call(this,t,e)};function $B(e){this._context=e}$B.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,a,i){this._context.bezierCurveTo(t,e,r,n,i,a)}};function AJ(e){return new wv(e)}function TJ(e){return new DB(e)}function IB(e){this._context=e}IB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=rR(e),a=rR(t),i=0,l=1;l=0;--t)a[t]=(l[t]-a[t+1])/i[t];for(i[n-1]=(e[n]+a[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function PJ(e){return new Kg(e,.5)}function MJ(e){return new Kg(e,0)}function RJ(e){return new Kg(e,1)}function Jc(e,t){if((l=e.length)>1)for(var n=1,r,a,i=e[t[0]],l,u=i.length;n=0;)n[t]=t;return n}function DJ(e,t){return e[t]}function $J(e){const t=[];return t.key=e,t}function IJ(){var e=Lt([]),t=O_,n=Jc,r=DJ;function a(i){var l=Array.from(e.apply(this,arguments),$J),u,d=l.length,f=-1,m;for(const p of i)for(u=0,++f;u0){for(var n,r,a=0,i=e[0].length,l;a0){for(var n=0,r=e[t[0]],a,i=r.length;n0)||!((i=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,i,l;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var LB={symbolCircle:XO,symbolCross:hJ,symbolDiamond:pJ,symbolSquare:vJ,symbolStar:bJ,symbolTriangle:wJ,symbolWye:SJ},GJ=Math.PI/180,YJ=function(t){var n="symbol".concat(Vg(t));return LB[n]||XO},KJ=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*GJ;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},XJ=function(t,n){LB["symbol".concat(Vg(t))]=n},ZO=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,i=a===void 0?64:a,l=t.sizeType,u=l===void 0?"area":l,d=WJ(t,qJ),f=iR(iR({},d),{},{type:r,size:i,sizeType:u}),m=function(){var w=YJ(r),N=_J().type(w).size(KJ(i,u,r));return N()},p=f.className,g=f.cx,x=f.cy,j=Be(f,!0);return g===+g&&x===+x&&i===+i?W.createElement("path",C_({},j,{className:Ye("recharts-symbols",p),transform:"translate(".concat(g,", ").concat(x,")"),d:m()})):null};ZO.registerSymbol=XJ;function eu(e){"@babel/helpers - typeof";return eu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eu(e)}function E_(){return E_=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var O=x.inactive?f:x.color;return W.createElement("li",E_({className:w,style:p,key:"legend-item-".concat(j)},ol(r.props,x,j)),W.createElement(w_,{width:l,height:l,viewBox:m,style:g},r.renderIcon(x)),W.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},b?b(N,x,j):N))})}},{key:"render",value:function(){var r=this.props,a=r.payload,i=r.layout,l=r.align;if(!a||!a.length)return null;var u={padding:0,margin:0,textAlign:i==="horizontal"?l:"left"};return W.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(y.PureComponent);Cf(QO,"displayName","Legend");Cf(QO,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var e1,sR;function oee(){if(sR)return e1;sR=1;var e=Ug();function t(){this.__data__=new e,this.size=0}return e1=t,e1}var t1,lR;function see(){if(lR)return t1;lR=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return t1=e,t1}var n1,cR;function lee(){if(cR)return n1;cR=1;function e(t){return this.__data__.get(t)}return n1=e,n1}var r1,uR;function cee(){if(uR)return r1;uR=1;function e(t){return this.__data__.has(t)}return r1=e,r1}var a1,dR;function uee(){if(dR)return a1;dR=1;var e=Ug(),t=FO(),n=UO(),r=200;function a(i,l){var u=this.__data__;if(u instanceof e){var d=u.__data__;if(!t||d.lengthx))return!1;var b=p.get(l),w=p.get(u);if(b&&w)return b==u&&w==l;var N=-1,O=!0,C=d&a?new e:void 0;for(p.set(l,u),p.set(u,l);++N-1&&r%1==0&&r-1&&n%1==0&&n<=e}return O1=t,O1}var C1,DR;function See(){if(DR)return C1;DR=1;var e=io(),t=nC(),n=oo(),r="[object Arguments]",a="[object Array]",i="[object Boolean]",l="[object Date]",u="[object Error]",d="[object Function]",f="[object Map]",m="[object Number]",p="[object Object]",g="[object RegExp]",x="[object Set]",j="[object String]",b="[object WeakMap]",w="[object ArrayBuffer]",N="[object DataView]",O="[object Float32Array]",C="[object Float64Array]",A="[object Int8Array]",E="[object Int16Array]",k="[object Int32Array]",T="[object Uint8Array]",P="[object Uint8ClampedArray]",$="[object Uint16Array]",F="[object Uint32Array]",D={};D[O]=D[C]=D[A]=D[E]=D[k]=D[T]=D[P]=D[$]=D[F]=!0,D[r]=D[a]=D[w]=D[i]=D[N]=D[l]=D[u]=D[d]=D[f]=D[m]=D[p]=D[g]=D[x]=D[j]=D[b]=!1;function U(V){return n(V)&&t(V.length)&&!!D[e(V)]}return C1=U,C1}var E1,$R;function YB(){if($R)return E1;$R=1;function e(t){return function(n){return t(n)}}return E1=e,E1}var of={exports:{}};of.exports;var IR;function _ee(){return IR||(IR=1,(function(e,t){var n=mB(),r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,l=i&&n.process,u=(function(){try{var d=a&&a.require&&a.require("util").types;return d||l&&l.binding&&l.binding("util")}catch{}})();e.exports=u})(of,of.exports)),of.exports}var A1,LR;function KB(){if(LR)return A1;LR=1;var e=See(),t=YB(),n=_ee(),r=n&&n.isTypedArray,a=r?t(r):e;return A1=a,A1}var T1,BR;function Nee(){if(BR)return T1;BR=1;var e=bee(),t=eC(),n=Rr(),r=GB(),a=tC(),i=KB(),l=Object.prototype,u=l.hasOwnProperty;function d(f,m){var p=n(f),g=!p&&t(f),x=!p&&!g&&r(f),j=!p&&!g&&!x&&i(f),b=p||g||x||j,w=b?e(f.length,String):[],N=w.length;for(var O in f)(m||u.call(f,O))&&!(b&&(O=="length"||x&&(O=="offset"||O=="parent")||j&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||a(O,N)))&&w.push(O);return w}return T1=d,T1}var k1,zR;function Oee(){if(zR)return k1;zR=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return k1=t,k1}var P1,qR;function XB(){if(qR)return P1;qR=1;function e(t,n){return function(r){return t(n(r))}}return P1=e,P1}var M1,FR;function Cee(){if(FR)return M1;FR=1;var e=XB(),t=e(Object.keys,Object);return M1=t,M1}var R1,UR;function Eee(){if(UR)return R1;UR=1;var e=Oee(),t=Cee(),n=Object.prototype,r=n.hasOwnProperty;function a(i){if(!e(i))return t(i);var l=[];for(var u in Object(i))r.call(i,u)&&u!="constructor"&&l.push(u);return l}return R1=a,R1}var D1,HR;function Nh(){if(HR)return D1;HR=1;var e=zO(),t=nC();function n(r){return r!=null&&t(r.length)&&!e(r)}return D1=n,D1}var $1,WR;function Xg(){if(WR)return $1;WR=1;var e=Nee(),t=Eee(),n=Nh();function r(a){return n(a)?e(a):t(a)}return $1=r,$1}var I1,VR;function Aee(){if(VR)return I1;VR=1;var e=vee(),t=xee(),n=Xg();function r(a){return e(a,n,t)}return I1=r,I1}var L1,GR;function Tee(){if(GR)return L1;GR=1;var e=Aee(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(i,l,u,d,f,m){var p=u&t,g=e(i),x=g.length,j=e(l),b=j.length;if(x!=b&&!p)return!1;for(var w=x;w--;){var N=g[w];if(!(p?N in l:r.call(l,N)))return!1}var O=m.get(i),C=m.get(l);if(O&&C)return O==l&&C==i;var A=!0;m.set(i,l),m.set(l,i);for(var E=p;++w-1}return uj=t,uj}var dj,bD;function Xee(){if(bD)return dj;bD=1;function e(t,n,r){for(var a=-1,i=t==null?0:t.length;++a=l){var N=f?null:a(d);if(N)return i(N);j=!1,g=r,w=new e}else w=f?[]:b;e:for(;++p=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dte(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function fte(e){return e.value}function hte(e,t){if(W.isValidElement(e))return W.cloneElement(e,t);if(typeof e=="function")return W.createElement(e,t);t.ref;var n=ute(t,nte);return W.createElement(QO,n)}var ED=1,Xs=(function(e){function t(){var n;rte(this,t);for(var r=arguments.length,a=new Array(r),i=0;iED||Math.abs(a.height-this.lastBoundingBox.height)>ED)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,r&&r(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Bi({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,i=a.layout,l=a.align,u=a.verticalAlign,d=a.margin,f=a.chartWidth,m=a.chartHeight,p,g;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(l==="center"&&i==="vertical"){var x=this.getBBoxSnapshot();p={left:((f||0)-x.width)/2}}else p=l==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(u==="middle"){var j=this.getBBoxSnapshot();g={top:((m||0)-j.height)/2}}else g=u==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return Bi(Bi({},p),g)}},{key:"render",value:function(){var r=this,a=this.props,i=a.content,l=a.width,u=a.height,d=a.wrapperStyle,f=a.payloadUniqBy,m=a.payload,p=Bi(Bi({position:"absolute",width:l||"auto",height:u||"auto"},this.getDefaultPosition(d)),d);return W.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(x){r.wrapperNode=x}},hte(i,Bi(Bi({},this.props),{},{payload:tz(m,f,fte)})))}}],[{key:"getWithHeight",value:function(r,a){var i=Bi(Bi({},this.defaultProps),r.props),l=i.layout;return l==="vertical"&&Ne(r.props.height)?{height:r.props.height}:l==="horizontal"?{width:r.props.width||a}:null}}])})(y.PureComponent);Zg(Xs,"displayName","Legend");Zg(Xs,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var vj,AD;function mte(){if(AD)return vj;AD=1;var e=Sh(),t=eC(),n=Rr(),r=e?e.isConcatSpreadable:void 0;function a(i){return n(i)||t(i)||!!(r&&i&&i[r])}return vj=a,vj}var gj,TD;function az(){if(TD)return gj;TD=1;var e=VB(),t=mte();function n(r,a,i,l,u){var d=-1,f=r.length;for(i||(i=t),u||(u=[]);++d0&&i(m)?a>1?n(m,a-1,i,l,u):e(u,m):l||(u[u.length]=m)}return u}return gj=n,gj}var yj,kD;function pte(){if(kD)return yj;kD=1;function e(t){return function(n,r,a){for(var i=-1,l=Object(n),u=a(n),d=u.length;d--;){var f=u[t?d:++i];if(r(l[f],f,l)===!1)break}return n}}return yj=e,yj}var xj,PD;function vte(){if(PD)return xj;PD=1;var e=pte(),t=e();return xj=t,xj}var bj,MD;function iz(){if(MD)return bj;MD=1;var e=vte(),t=Xg();function n(r,a){return r&&e(r,a,t)}return bj=n,bj}var wj,RD;function gte(){if(RD)return wj;RD=1;var e=Nh();function t(n,r){return function(a,i){if(a==null)return a;if(!e(a))return n(a,i);for(var l=a.length,u=r?l:-1,d=Object(a);(r?u--:++ur||u&&d&&m&&!f&&!p||i&&d&&m||!a&&m||!l)return 1;if(!i&&!u&&!p&&n=f)return m;var p=a[i];return m*(p=="desc"?-1:1)}}return n.index-r.index}return Oj=t,Oj}var Cj,zD;function wte(){if(zD)return Cj;zD=1;var e=HO(),t=WO(),n=gi(),r=oz(),a=yte(),i=YB(),l=bte(),u=Iu(),d=Rr();function f(m,p,g){p.length?p=e(p,function(b){return d(b)?function(w){return t(w,b.length===1?b[0]:b)}:b}):p=[u];var x=-1;p=e(p,i(n));var j=r(m,function(b,w,N){var O=e(p,function(C){return C(b)});return{criteria:O,index:++x,value:b}});return a(j,function(b,w){return l(b,w,g)})}return Cj=f,Cj}var Ej,qD;function jte(){if(qD)return Ej;qD=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return Ej=e,Ej}var Aj,FD;function Ste(){if(FD)return Aj;FD=1;var e=jte(),t=Math.max;function n(r,a,i){return a=t(a===void 0?r.length-1:a,0),function(){for(var l=arguments,u=-1,d=t(l.length-a,0),f=Array(d);++u0){if(++i>=e)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return Mj=r,Mj}var Rj,GD;function Cte(){if(GD)return Rj;GD=1;var e=Nte(),t=Ote(),n=t(e);return Rj=n,Rj}var Dj,YD;function Ete(){if(YD)return Dj;YD=1;var e=Iu(),t=Ste(),n=Cte();function r(a,i){return n(t(a,i,e),a+"")}return Dj=r,Dj}var $j,KD;function Qg(){if(KD)return $j;KD=1;var e=qO(),t=Nh(),n=tC(),r=ts();function a(i,l,u){if(!r(u))return!1;var d=typeof l;return(d=="number"?t(u)&&n(l,u.length):d=="string"&&l in u)?e(u[l],i):!1}return $j=a,$j}var Ij,XD;function Ate(){if(XD)return Ij;XD=1;var e=az(),t=wte(),n=Ete(),r=Qg(),a=n(function(i,l){if(i==null)return[];var u=l.length;return u>1&&r(i,l[0],l[1])?l=[]:u>2&&r(l[0],l[1],l[2])&&(l=[l[0]]),t(i,e(l,1),[])});return Ij=a,Ij}var Tte=Ate();const iC=wt(Tte);function Ef(e){"@babel/helpers - typeof";return Ef=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ef(e)}function k_(){return k_=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.x),"".concat(Vd,"-left"),Ne(n)&&t&&Ne(t.x)&&n=t.y),"".concat(Vd,"-top"),Ne(r)&&t&&Ne(t.y)&&rb?Math.max(m,d[r]):Math.max(p,d[r])}function Wte(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function Vte(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,i=e.reverseDirection,l=e.tooltipBox,u=e.useTranslate3d,d=e.viewBox,f,m,p;return l.height>0&&l.width>0&&n?(m=JD({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),p=JD({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),f=Wte({translateX:m,translateY:p,useTranslate3d:u})):f=Ute,{cssProperties:f,cssClasses:Hte({translateX:m,translateY:p,coordinate:n})}}function nu(e){"@babel/helpers - typeof";return nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nu(e)}function e$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function t$(e){for(var t=1;tn$||Math.abs(r.height-this.state.lastBoundingBox.height)>n$)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,a=this.props,i=a.active,l=a.allowEscapeViewBox,u=a.animationDuration,d=a.animationEasing,f=a.children,m=a.coordinate,p=a.hasPayload,g=a.isAnimationActive,x=a.offset,j=a.position,b=a.reverseDirection,w=a.useTranslate3d,N=a.viewBox,O=a.wrapperStyle,C=Vte({allowEscapeViewBox:l,coordinate:m,offsetTopLeft:x,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:w,viewBox:N}),A=C.cssClasses,E=C.cssProperties,k=t$(t$({transition:g&&i?"transform ".concat(u,"ms ").concat(d):void 0},E),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&p?"visible":"hidden",position:"absolute",top:0,left:0},O);return W.createElement("div",{tabIndex:-1,className:A,style:k,ref:function(P){r.wrapperNode=P}},f)}}])})(y.PureComponent),nne=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},gl={isSsr:nne()};function ru(e){"@babel/helpers - typeof";return ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ru(e)}function r$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function a$(e){for(var t=1;t0;return W.createElement(tne,{allowEscapeViewBox:l,animationDuration:u,animationEasing:d,isAnimationActive:g,active:i,coordinate:m,hasPayload:k,offset:x,position:w,reverseDirection:N,useTranslate3d:O,viewBox:C,wrapperStyle:A},fne(f,a$(a$({},this.props),{},{payload:E})))}}])})(y.PureComponent);oC(Qa,"displayName","Tooltip");oC(Qa,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!gl.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Bj,i$;function hne(){if(i$)return Bj;i$=1;var e=vi(),t=function(){return e.Date.now()};return Bj=t,Bj}var zj,o$;function mne(){if(o$)return zj;o$=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return zj=t,zj}var qj,s$;function pne(){if(s$)return qj;s$=1;var e=mne(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return qj=n,qj}var Fj,l$;function fz(){if(l$)return Fj;l$=1;var e=pne(),t=ts(),n=Ru(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;function d(f){if(typeof f=="number")return f;if(n(f))return r;if(t(f)){var m=typeof f.valueOf=="function"?f.valueOf():f;f=t(m)?m+"":m}if(typeof f!="string")return f===0?f:+f;f=e(f);var p=i.test(f);return p||l.test(f)?u(f.slice(2),p?2:8):a.test(f)?r:+f}return Fj=d,Fj}var Uj,c$;function vne(){if(c$)return Uj;c$=1;var e=ts(),t=hne(),n=fz(),r="Expected a function",a=Math.max,i=Math.min;function l(u,d,f){var m,p,g,x,j,b,w=0,N=!1,O=!1,C=!0;if(typeof u!="function")throw new TypeError(r);d=n(d)||0,e(f)&&(N=!!f.leading,O="maxWait"in f,g=O?a(n(f.maxWait)||0,d):g,C="trailing"in f?!!f.trailing:C);function A(V){var H=m,G=p;return m=p=void 0,w=V,x=u.apply(G,H),x}function E(V){return w=V,j=setTimeout(P,d),N?A(V):x}function k(V){var H=V-b,G=V-w,L=d-H;return O?i(L,g-G):L}function T(V){var H=V-b,G=V-w;return b===void 0||H>=d||H<0||O&&G>=g}function P(){var V=t();if(T(V))return $(V);j=setTimeout(P,k(V))}function $(V){return j=void 0,C&&m?A(V):(m=p=void 0,x)}function F(){j!==void 0&&clearTimeout(j),w=0,m=b=p=j=void 0}function D(){return j===void 0?x:$(t())}function U(){var V=t(),H=T(V);if(m=arguments,p=this,b=V,H){if(j===void 0)return E(b);if(O)return clearTimeout(j),j=setTimeout(P,d),A(b)}return j===void 0&&(j=setTimeout(P,d)),x}return U.cancel=F,U.flush=D,U}return Uj=l,Uj}var Hj,u$;function gne(){if(u$)return Hj;u$=1;var e=vne(),t=ts(),n="Expected a function";function r(a,i,l){var u=!0,d=!0;if(typeof a!="function")throw new TypeError(n);return t(l)&&(u="leading"in l?!!l.leading:u,d="trailing"in l?!!l.trailing:d),e(a,i,{leading:u,maxWait:i,trailing:d})}return Hj=r,Hj}var yne=gne();const hz=wt(yne);function Tf(e){"@babel/helpers - typeof";return Tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tf(e)}function d$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Sp(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(V=hz(V,b,{trailing:!0,leading:!1}));var H=new ResizeObserver(V),G=E.current.getBoundingClientRect(),L=G.width,R=G.height;return D(L,R),H.observe(E.current),function(){H.disconnect()}},[D,b]);var U=y.useMemo(function(){var V=$.containerWidth,H=$.containerHeight;if(V<0||H<0)return null;$a(qs(l)||qs(d),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,l,d),$a(!n||n>0,"The aspect(%s) must be greater than zero.",n);var G=qs(l)?V:l,L=qs(d)?H:d;n&&n>0&&(G?L=G/n:L&&(G=L*n),g&&L>g&&(L=g)),$a(G>0||L>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,G,L,l,d,m,p,n);var R=!Array.isArray(x)&&Ki(x.type).endsWith("Chart");return W.Children.map(x,function(q){return W.isValidElement(q)?y.cloneElement(q,Sp({width:G,height:L},R?{style:Sp({height:"100%",width:"100%",maxHeight:L,maxWidth:G},q.props.style)}:{})):q})},[n,x,d,g,p,m,$,l]);return W.createElement("div",{id:w?"".concat(w):void 0,className:Ye("recharts-responsive-container",N),style:Sp(Sp({},A),{},{width:l,height:d,minWidth:m,minHeight:p,maxHeight:g}),ref:E},U)}),Jg=function(t){return null};Jg.displayName="Cell";function kf(e){"@babel/helpers - typeof";return kf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kf(e)}function h$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function D_(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||gl.isSsr)return{width:0,height:0};var r=Mne(n),a=JSON.stringify({text:t,copyStyle:r});if(yc.widthCache[a])return yc.widthCache[a];try{var i=document.getElementById(m$);i||(i=document.createElement("span"),i.setAttribute("id",m$),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var l=D_(D_({},Pne),r);Object.assign(i.style,l),i.textContent="".concat(t);var u=i.getBoundingClientRect(),d={width:u.width,height:u.height};return yc.widthCache[a]=d,++yc.cacheCount>kne&&(yc.cacheCount=0,yc.widthCache={}),d}catch{return{width:0,height:0}}},Rne=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Pf(e){"@babel/helpers - typeof";return Pf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pf(e)}function Ov(e,t){return Lne(e)||Ine(e,t)||$ne(e,t)||Dne()}function Dne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $ne(e,t){if(e){if(typeof e=="string")return p$(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p$(e,t)}}function p$(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Qne(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function w$(e,t){return nre(e)||tre(e,t)||ere(e,t)||Jne()}function Jne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ere(e,t){if(e){if(typeof e=="string")return j$(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j$(e,t)}}function j$(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return G.reduce(function(L,R){var q=R.word,K=R.width,ee=L[L.length-1];if(ee&&(a==null||i||ee.width+K+rR.width?L:R})};if(!m)return x;for(var b="…",w=function(G){var L=p.slice(0,G),R=gz({breakAll:f,style:d,children:L+b}).wordsWithComputedWidth,q=g(R),K=q.length>l||j(q).width>Number(a);return[K,q]},N=0,O=p.length-1,C=0,A;N<=O&&C<=p.length-1;){var E=Math.floor((N+O)/2),k=E-1,T=w(k),P=w$(T,2),$=P[0],F=P[1],D=w(E),U=w$(D,1),V=U[0];if(!$&&!V&&(N=E+1),$&&V&&(O=E-1),!$&&V){A=F;break}C++}return A||x},S$=function(t){var n=Ge(t)?[]:t.toString().split(vz);return[{words:n}]},are=function(t){var n=t.width,r=t.scaleToFit,a=t.children,i=t.style,l=t.breakAll,u=t.maxLines;if((n||r)&&!gl.isSsr){var d,f,m=gz({breakAll:l,children:a,style:i});if(m){var p=m.wordsWithComputedWidth,g=m.spaceWidth;d=p,f=g}else return S$(a);return rre({breakAll:l,children:a,maxLines:u,style:i},d,f,n,r)}return S$(a)},_$="#808080",sl=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,l=t.lineHeight,u=l===void 0?"1em":l,d=t.capHeight,f=d===void 0?"0.71em":d,m=t.scaleToFit,p=m===void 0?!1:m,g=t.textAnchor,x=g===void 0?"start":g,j=t.verticalAnchor,b=j===void 0?"end":j,w=t.fill,N=w===void 0?_$:w,O=b$(t,Xne),C=y.useMemo(function(){return are({breakAll:O.breakAll,children:O.children,maxLines:O.maxLines,scaleToFit:p,style:O.style,width:O.width})},[O.breakAll,O.children,O.maxLines,p,O.style,O.width]),A=O.dx,E=O.dy,k=O.angle,T=O.className,P=O.breakAll,$=b$(O,Zne);if(!jn(r)||!jn(i))return null;var F=r+(Ne(A)?A:0),D=i+(Ne(E)?E:0),U;switch(b){case"start":U=Wj("calc(".concat(f,")"));break;case"middle":U=Wj("calc(".concat((C.length-1)/2," * -").concat(u," + (").concat(f," / 2))"));break;default:U=Wj("calc(".concat(C.length-1," * -").concat(u,")"));break}var V=[];if(p){var H=C[0].width,G=O.width;V.push("scale(".concat((Ne(G)?G/H:1)/H,")"))}return k&&V.push("rotate(".concat(k,", ").concat(F,", ").concat(D,")")),V.length&&($.transform=V.join(" ")),W.createElement("text",$_({},Be($,!0),{x:F,y:D,className:Ye("recharts-text",T),textAnchor:x,fill:N.includes("url")?_$:N}),C.map(function(L,R){var q=L.words.join(P?"":" ");return W.createElement("tspan",{x:F,dy:R===0?U:u,key:"".concat(q,"-").concat(R)},q)}))};function Vo(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function ire(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function sC(e){let t,n,r;e.length!==2?(t=Vo,n=(u,d)=>Vo(e(u),d),r=(u,d)=>e(u)-d):(t=e===Vo||e===ire?e:ore,n=e,r=e);function a(u,d,f=0,m=u.length){if(f>>1;n(u[p],d)<0?f=p+1:m=p}while(f>>1;n(u[p],d)<=0?f=p+1:m=p}while(ff&&r(u[p-1],d)>-r(u[p],d)?p-1:p}return{left:a,center:l,right:i}}function ore(){return 0}function yz(e){return e===null?NaN:+e}function*sre(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const lre=sC(Vo),Oh=lre.right;sC(yz).center;class N$ extends Map{constructor(t,n=dre){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(O$(this,t))}has(t){return super.has(O$(this,t))}set(t,n){return super.set(cre(this,t),n)}delete(t){return super.delete(ure(this,t))}}function O$({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function cre({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function ure({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function dre(e){return e!==null&&typeof e=="object"?e.valueOf():e}function fre(e=Vo){if(e===Vo)return xz;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function xz(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const hre=Math.sqrt(50),mre=Math.sqrt(10),pre=Math.sqrt(2);function Cv(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),i=r/Math.pow(10,a),l=i>=hre?10:i>=mre?5:i>=pre?2:1;let u,d,f;return a<0?(f=Math.pow(10,-a)/l,u=Math.round(e*f),d=Math.round(t*f),u/ft&&--d,f=-f):(f=Math.pow(10,a)*l,u=Math.round(e/f),d=Math.round(t/f),u*ft&&--d),d0))return[];if(e===t)return[e];const r=t=a))return[];const u=i-a+1,d=new Array(u);if(r)if(l<0)for(let f=0;f=r)&&(n=r);return n}function E$(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function bz(e,t,n=0,r=1/0,a){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(a=a===void 0?xz:fre(a);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,m=Math.log(d),p=.5*Math.exp(2*m/3),g=.5*Math.sqrt(m*p*(d-p)/d)*(f-d/2<0?-1:1),x=Math.max(n,Math.floor(t-f*p/d+g)),j=Math.min(r,Math.floor(t+(d-f)*p/d+g));bz(e,t,x,j,a)}const i=e[t];let l=n,u=r;for(Gd(e,n,t),a(e[r],i)>0&&Gd(e,n,r);l0;)--u}a(e[n],i)===0?Gd(e,n,u):(++u,Gd(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function Gd(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function vre(e,t,n){if(e=Float64Array.from(sre(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return E$(e);if(t>=1)return C$(e);var r,a=(r-1)*t,i=Math.floor(a),l=C$(bz(e,i).subarray(0,i+1)),u=E$(e.subarray(i+1));return l+(u-l)*(a-i)}}function gre(e,t,n=yz){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,a=(r-1)*t,i=Math.floor(a),l=+n(e[i],i,e),u=+n(e[i+1],i+1,e);return l+(u-l)*(a-i)}}function yre(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(a);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Np(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Np(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=bre.exec(e))?new Cr(t[1],t[2],t[3],1):(t=wre.exec(e))?new Cr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=jre.exec(e))?Np(t[1],t[2],t[3],t[4]):(t=Sre.exec(e))?Np(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=_re.exec(e))?D$(t[1],t[2]/100,t[3]/100,1):(t=Nre.exec(e))?D$(t[1],t[2]/100,t[3]/100,t[4]):A$.hasOwnProperty(e)?P$(A$[e]):e==="transparent"?new Cr(NaN,NaN,NaN,0):null}function P$(e){return new Cr(e>>16&255,e>>8&255,e&255,1)}function Np(e,t,n,r){return r<=0&&(e=t=n=NaN),new Cr(e,t,n,r)}function Ere(e){return e instanceof Ch||(e=$f(e)),e?(e=e.rgb(),new Cr(e.r,e.g,e.b,e.opacity)):new Cr}function q_(e,t,n,r){return arguments.length===1?Ere(e):new Cr(e,t,n,r??1)}function Cr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}cC(Cr,q_,jz(Ch,{brighter(e){return e=e==null?Ev:Math.pow(Ev,e),new Cr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Rf:Math.pow(Rf,e),new Cr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Cr(Zs(this.r),Zs(this.g),Zs(this.b),Av(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:M$,formatHex:M$,formatHex8:Are,formatRgb:R$,toString:R$}));function M$(){return`#${Fs(this.r)}${Fs(this.g)}${Fs(this.b)}`}function Are(){return`#${Fs(this.r)}${Fs(this.g)}${Fs(this.b)}${Fs((isNaN(this.opacity)?1:this.opacity)*255)}`}function R$(){const e=Av(this.opacity);return`${e===1?"rgb(":"rgba("}${Zs(this.r)}, ${Zs(this.g)}, ${Zs(this.b)}${e===1?")":`, ${e})`}`}function Av(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fs(e){return e=Zs(e),(e<16?"0":"")+e.toString(16)}function D$(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ra(e,t,n,r)}function Sz(e){if(e instanceof Ra)return new Ra(e.h,e.s,e.l,e.opacity);if(e instanceof Ch||(e=$f(e)),!e)return new Ra;if(e instanceof Ra)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),i=Math.max(t,n,r),l=NaN,u=i-a,d=(i+a)/2;return u?(t===i?l=(n-r)/u+(n0&&d<1?0:l,new Ra(l,u,d,e.opacity)}function Tre(e,t,n,r){return arguments.length===1?Sz(e):new Ra(e,t,n,r??1)}function Ra(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}cC(Ra,Tre,jz(Ch,{brighter(e){return e=e==null?Ev:Math.pow(Ev,e),new Ra(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Rf:Math.pow(Rf,e),new Ra(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new Cr(Vj(e>=240?e-240:e+120,a,r),Vj(e,a,r),Vj(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Ra($$(this.h),Op(this.s),Op(this.l),Av(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Av(this.opacity);return`${e===1?"hsl(":"hsla("}${$$(this.h)}, ${Op(this.s)*100}%, ${Op(this.l)*100}%${e===1?")":`, ${e})`}`}}));function $$(e){return e=(e||0)%360,e<0?e+360:e}function Op(e){return Math.max(0,Math.min(1,e||0))}function Vj(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const uC=e=>()=>e;function kre(e,t){return function(n){return e+n*t}}function Pre(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Mre(e){return(e=+e)==1?_z:function(t,n){return n-t?Pre(t,n,e):uC(isNaN(t)?n:t)}}function _z(e,t){var n=t-e;return n?kre(e,n):uC(isNaN(e)?t:e)}const I$=(function e(t){var n=Mre(t);function r(a,i){var l=n((a=q_(a)).r,(i=q_(i)).r),u=n(a.g,i.g),d=n(a.b,i.b),f=_z(a.opacity,i.opacity);return function(m){return a.r=l(m),a.g=u(m),a.b=d(m),a.opacity=f(m),a+""}}return r.gamma=e,r})(1);function Rre(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(i){for(a=0;an&&(i=t.slice(n,i),u[l]?u[l]+=i:u[++l]=i),(r=r[0])===(a=a[0])?u[l]?u[l]+=a:u[++l]=a:(u[++l]=null,d.push({i:l,x:Tv(r,a)})),n=Gj.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Wre(e,t,n){var r=e[0],a=e[1],i=t[0],l=t[1];return a2?Vre:Wre,d=f=null,p}function p(g){return g==null||isNaN(g=+g)?i:(d||(d=u(e.map(r),t,n)))(r(l(g)))}return p.invert=function(g){return l(a((f||(f=u(t,e.map(r),Tv)))(g)))},p.domain=function(g){return arguments.length?(e=Array.from(g,kv),m()):e.slice()},p.range=function(g){return arguments.length?(t=Array.from(g),m()):t.slice()},p.rangeRound=function(g){return t=Array.from(g),n=dC,m()},p.clamp=function(g){return arguments.length?(l=g?!0:yr,m()):l!==yr},p.interpolate=function(g){return arguments.length?(n=g,m()):n},p.unknown=function(g){return arguments.length?(i=g,p):i},function(g,x){return r=g,a=x,m()}}function fC(){return ey()(yr,yr)}function Gre(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Pv(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function au(e){return e=Pv(Math.abs(e)),e?e[1]:NaN}function Yre(e,t){return function(n,r){for(var a=n.length,i=[],l=0,u=e[0],d=0;a>0&&u>0&&(d+u+1>r&&(u=Math.max(1,r-d)),i.push(n.substring(a-=u,a+u)),!((d+=u+1)>r));)u=e[l=(l+1)%e.length];return i.reverse().join(t)}}function Kre(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Xre=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function If(e){if(!(t=Xre.exec(e)))throw new Error("invalid format: "+e);var t;return new hC({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}If.prototype=hC.prototype;function hC(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}hC.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Zre(e){e:for(var t=e.length,n=1,r=-1,a;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var Nz;function Qre(e,t){var n=Pv(e,t);if(!n)return e+"";var r=n[0],a=n[1],i=a-(Nz=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,l=r.length;return i===l?r:i>l?r+new Array(i-l+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Pv(e,Math.max(0,t+i-1))[0]}function B$(e,t){var n=Pv(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const z$={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Gre,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>B$(e*100,t),r:B$,s:Qre,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function q$(e){return e}var F$=Array.prototype.map,U$=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Jre(e){var t=e.grouping===void 0||e.thousands===void 0?q$:Yre(F$.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?q$:Kre(F$.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(p){p=If(p);var g=p.fill,x=p.align,j=p.sign,b=p.symbol,w=p.zero,N=p.width,O=p.comma,C=p.precision,A=p.trim,E=p.type;E==="n"?(O=!0,E="g"):z$[E]||(C===void 0&&(C=12),A=!0,E="g"),(w||g==="0"&&x==="=")&&(w=!0,g="0",x="=");var k=b==="$"?n:b==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():"",T=b==="$"?r:/[%p]/.test(E)?l:"",P=z$[E],$=/[defgprs%]/.test(E);C=C===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function F(D){var U=k,V=T,H,G,L;if(E==="c")V=P(D)+V,D="";else{D=+D;var R=D<0||1/D<0;if(D=isNaN(D)?d:P(Math.abs(D),C),A&&(D=Zre(D)),R&&+D==0&&j!=="+"&&(R=!1),U=(R?j==="("?j:u:j==="-"||j==="("?"":j)+U,V=(E==="s"?U$[8+Nz/3]:"")+V+(R&&j==="("?")":""),$){for(H=-1,G=D.length;++HL||L>57){V=(L===46?a+D.slice(H+1):D.slice(H))+V,D=D.slice(0,H);break}}}O&&!w&&(D=t(D,1/0));var q=U.length+D.length+V.length,K=q>1)+U+D+V+K.slice(q);break;default:D=K+U+D+V;break}return i(D)}return F.toString=function(){return p+""},F}function m(p,g){var x=f((p=If(p),p.type="f",p)),j=Math.max(-8,Math.min(8,Math.floor(au(g)/3)))*3,b=Math.pow(10,-j),w=U$[8+j/3];return function(N){return x(b*N)+w}}return{format:f,formatPrefix:m}}var Cp,mC,Oz;eae({thousands:",",grouping:[3],currency:["$",""]});function eae(e){return Cp=Jre(e),mC=Cp.format,Oz=Cp.formatPrefix,Cp}function tae(e){return Math.max(0,-au(Math.abs(e)))}function nae(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(au(t)/3)))*3-au(Math.abs(e)))}function rae(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,au(t)-au(e))+1}function Cz(e,t,n,r){var a=B_(e,t,n),i;switch(r=If(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=nae(a,l))&&(r.precision=i),Oz(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=rae(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=tae(a))&&(r.precision=i-(r.type==="%")*2);break}}return mC(r)}function ns(e){var t=e.domain;return e.ticks=function(n){var r=t();return I_(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return Cz(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,i=r.length-1,l=r[a],u=r[i],d,f,m=10;for(u0;){if(f=L_(l,u,n),f===d)return r[a]=l,r[i]=u,t(r);if(f>0)l=Math.floor(l/f)*f,u=Math.ceil(u/f)*f;else if(f<0)l=Math.ceil(l*f)/f,u=Math.floor(u*f)/f;else break;d=f}return e},e}function Mv(){var e=fC();return e.copy=function(){return Eh(e,Mv())},_a.apply(e,arguments),ns(e)}function Ez(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,kv),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Ez(e).unknown(t)},e=arguments.length?Array.from(e,kv):[0,1],ns(n)}function Az(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],i=e[r],l;return iMath.pow(e,t)}function lae(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function V$(e){return(t,n)=>-e(-t,n)}function pC(e){const t=e(H$,W$),n=t.domain;let r=10,a,i;function l(){return a=lae(r),i=sae(r),n()[0]<0?(a=V$(a),i=V$(i),e(aae,iae)):e(H$,W$),t}return t.base=function(u){return arguments.length?(r=+u,l()):r},t.domain=function(u){return arguments.length?(n(u),l()):n()},t.ticks=u=>{const d=n();let f=d[0],m=d[d.length-1];const p=m0){for(;g<=x;++g)for(j=1;jm)break;N.push(b)}}else for(;g<=x;++g)for(j=r-1;j>=1;--j)if(b=g>0?j/i(-g):j*i(g),!(bm)break;N.push(b)}N.length*2{if(u==null&&(u=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=If(d)).precision==null&&(d.trim=!0),d=mC(d)),u===1/0)return d;const f=Math.max(1,r*u/t.ticks().length);return m=>{let p=m/i(Math.round(a(m)));return p*rn(Az(n(),{floor:u=>i(Math.floor(a(u))),ceil:u=>i(Math.ceil(a(u)))})),t}function Tz(){const e=pC(ey()).domain([1,10]);return e.copy=()=>Eh(e,Tz()).base(e.base()),_a.apply(e,arguments),e}function G$(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Y$(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function vC(e){var t=1,n=e(G$(t),Y$(t));return n.constant=function(r){return arguments.length?e(G$(t=+r),Y$(t)):t},ns(n)}function kz(){var e=vC(ey());return e.copy=function(){return Eh(e,kz()).constant(e.constant())},_a.apply(e,arguments)}function K$(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function cae(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function uae(e){return e<0?-e*e:e*e}function gC(e){var t=e(yr,yr),n=1;function r(){return n===1?e(yr,yr):n===.5?e(cae,uae):e(K$(n),K$(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},ns(t)}function yC(){var e=gC(ey());return e.copy=function(){return Eh(e,yC()).exponent(e.exponent())},_a.apply(e,arguments),e}function dae(){return yC.apply(null,arguments).exponent(.5)}function X$(e){return Math.sign(e)*e*e}function fae(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Pz(){var e=fC(),t=[0,1],n=!1,r;function a(i){var l=fae(e(i));return isNaN(l)?r:n?Math.round(l):l}return a.invert=function(i){return e.invert(X$(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,kv)).map(X$)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(n=!!i,a):n},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return Pz(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},_a.apply(a,arguments),ns(a)}function Mz(){var e=[],t=[],n=[],r;function a(){var l=0,u=Math.max(1,t.length);for(n=new Array(u-1);++l0?n[u-1]:e[0],u=n?[r[n-1],t]:[r[f-1],r[f]]},l.unknown=function(d){return arguments.length&&(i=d),l},l.thresholds=function(){return r.slice()},l.copy=function(){return Rz().domain([e,t]).range(a).unknown(i)},_a.apply(ns(l),arguments)}function Dz(){var e=[.5],t=[0,1],n,r=1;function a(i){return i!=null&&i<=i?t[Oh(e,i,0,r)]:n}return a.domain=function(i){return arguments.length?(e=Array.from(i),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var l=t.indexOf(i);return[e[l-1],e[l]]},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return Dz().domain(e).range(t).unknown(n)},_a.apply(a,arguments)}const Yj=new Date,Kj=new Date;function _n(e,t,n,r){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const l=a(i),u=a.ceil(i);return i-l(t(i=new Date(+i),l==null?1:Math.floor(l)),i),a.range=(i,l,u)=>{const d=[];if(i=a.ceil(i),u=u==null?1:Math.floor(u),!(i0))return d;let f;do d.push(f=new Date(+i)),t(i,u),e(i);while(f_n(l=>{if(l>=l)for(;e(l),!i(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!i(l););else for(;--u>=0;)for(;t(l,1),!i(l););}),n&&(a.count=(i,l)=>(Yj.setTime(+i),Kj.setTime(+l),e(Yj),e(Kj),Math.floor(n(Yj,Kj))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(r?l=>r(l)%i===0:l=>a.count(0,l)%i===0):a)),a}const Rv=_n(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Rv.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?_n(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Rv);Rv.range;const Ui=1e3,xa=Ui*60,Hi=xa*60,Qi=Hi*24,xC=Qi*7,Z$=Qi*30,Xj=Qi*365,Us=_n(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ui)},(e,t)=>(t-e)/Ui,e=>e.getUTCSeconds());Us.range;const bC=_n(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ui)},(e,t)=>{e.setTime(+e+t*xa)},(e,t)=>(t-e)/xa,e=>e.getMinutes());bC.range;const wC=_n(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*xa)},(e,t)=>(t-e)/xa,e=>e.getUTCMinutes());wC.range;const jC=_n(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ui-e.getMinutes()*xa)},(e,t)=>{e.setTime(+e+t*Hi)},(e,t)=>(t-e)/Hi,e=>e.getHours());jC.range;const SC=_n(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Hi)},(e,t)=>(t-e)/Hi,e=>e.getUTCHours());SC.range;const Ah=_n(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*xa)/Qi,e=>e.getDate()-1);Ah.range;const ty=_n(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Qi,e=>e.getUTCDate()-1);ty.range;const $z=_n(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Qi,e=>Math.floor(e/Qi));$z.range;function yl(e){return _n(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*xa)/xC)}const ny=yl(0),Dv=yl(1),hae=yl(2),mae=yl(3),iu=yl(4),pae=yl(5),vae=yl(6);ny.range;Dv.range;hae.range;mae.range;iu.range;pae.range;vae.range;function xl(e){return _n(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/xC)}const ry=xl(0),$v=xl(1),gae=xl(2),yae=xl(3),ou=xl(4),xae=xl(5),bae=xl(6);ry.range;$v.range;gae.range;yae.range;ou.range;xae.range;bae.range;const _C=_n(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());_C.range;const NC=_n(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());NC.range;const Ji=_n(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ji.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_n(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Ji.range;const eo=_n(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());eo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_n(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});eo.range;function Iz(e,t,n,r,a,i){const l=[[Us,1,Ui],[Us,5,5*Ui],[Us,15,15*Ui],[Us,30,30*Ui],[i,1,xa],[i,5,5*xa],[i,15,15*xa],[i,30,30*xa],[a,1,Hi],[a,3,3*Hi],[a,6,6*Hi],[a,12,12*Hi],[r,1,Qi],[r,2,2*Qi],[n,1,xC],[t,1,Z$],[t,3,3*Z$],[e,1,Xj]];function u(f,m,p){const g=mw).right(l,g);if(x===l.length)return e.every(B_(f/Xj,m/Xj,p));if(x===0)return Rv.every(Math.max(B_(f,m,p),1));const[j,b]=l[g/l[x-1][2]53)return null;"w"in le||(le.w=1),"Z"in le?(_e=Qj(Yd(le.y,0,1)),he=_e.getUTCDay(),_e=he>4||he===0?$v.ceil(_e):$v(_e),_e=ty.offset(_e,(le.V-1)*7),le.y=_e.getUTCFullYear(),le.m=_e.getUTCMonth(),le.d=_e.getUTCDate()+(le.w+6)%7):(_e=Zj(Yd(le.y,0,1)),he=_e.getDay(),_e=he>4||he===0?Dv.ceil(_e):Dv(_e),_e=Ah.offset(_e,(le.V-1)*7),le.y=_e.getFullYear(),le.m=_e.getMonth(),le.d=_e.getDate()+(le.w+6)%7)}else("W"in le||"U"in le)&&("w"in le||(le.w="u"in le?le.u%7:"W"in le?1:0),he="Z"in le?Qj(Yd(le.y,0,1)).getUTCDay():Zj(Yd(le.y,0,1)).getDay(),le.m=0,le.d="W"in le?(le.w+6)%7+le.W*7-(he+5)%7:le.w+le.U*7-(he+6)%7);return"Z"in le?(le.H+=le.Z/100|0,le.M+=le.Z%100,Qj(le)):Zj(le)}}function P(Z,pe,je,le){for(var Re=0,_e=pe.length,he=je.length,ve,Le;Re<_e;){if(le>=he)return-1;if(ve=pe.charCodeAt(Re++),ve===37){if(ve=pe.charAt(Re++),Le=E[ve in Q$?pe.charAt(Re++):ve],!Le||(le=Le(Z,je,le))<0)return-1}else if(ve!=je.charCodeAt(le++))return-1}return le}function $(Z,pe,je){var le=f.exec(pe.slice(je));return le?(Z.p=m.get(le[0].toLowerCase()),je+le[0].length):-1}function F(Z,pe,je){var le=x.exec(pe.slice(je));return le?(Z.w=j.get(le[0].toLowerCase()),je+le[0].length):-1}function D(Z,pe,je){var le=p.exec(pe.slice(je));return le?(Z.w=g.get(le[0].toLowerCase()),je+le[0].length):-1}function U(Z,pe,je){var le=N.exec(pe.slice(je));return le?(Z.m=O.get(le[0].toLowerCase()),je+le[0].length):-1}function V(Z,pe,je){var le=b.exec(pe.slice(je));return le?(Z.m=w.get(le[0].toLowerCase()),je+le[0].length):-1}function H(Z,pe,je){return P(Z,t,pe,je)}function G(Z,pe,je){return P(Z,n,pe,je)}function L(Z,pe,je){return P(Z,r,pe,je)}function R(Z){return l[Z.getDay()]}function q(Z){return i[Z.getDay()]}function K(Z){return d[Z.getMonth()]}function ee(Z){return u[Z.getMonth()]}function I(Z){return a[+(Z.getHours()>=12)]}function B(Z){return 1+~~(Z.getMonth()/3)}function Y(Z){return l[Z.getUTCDay()]}function te(Z){return i[Z.getUTCDay()]}function oe(Z){return d[Z.getUTCMonth()]}function xe(Z){return u[Z.getUTCMonth()]}function J(Z){return a[+(Z.getUTCHours()>=12)]}function ae(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var pe=k(Z+="",C);return pe.toString=function(){return Z},pe},parse:function(Z){var pe=T(Z+="",!1);return pe.toString=function(){return Z},pe},utcFormat:function(Z){var pe=k(Z+="",A);return pe.toString=function(){return Z},pe},utcParse:function(Z){var pe=T(Z+="",!0);return pe.toString=function(){return Z},pe}}}var Q$={"-":"",_:" ",0:"0"},Un=/^\s*\d+/,Oae=/^%/,Cae=/[\\^$*+?|[\]().{}]/g;function mt(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",i=a.length;return r+(i[t.toLowerCase(),n]))}function Aae(e,t,n){var r=Un.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Tae(e,t,n){var r=Un.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function kae(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Pae(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Mae(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function J$(e,t,n){var r=Un.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function e4(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Rae(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Dae(e,t,n){var r=Un.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function $ae(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function t4(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Iae(e,t,n){var r=Un.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function n4(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Lae(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Bae(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function zae(e,t,n){var r=Un.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function qae(e,t,n){var r=Un.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Fae(e,t,n){var r=Oae.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Uae(e,t,n){var r=Un.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Hae(e,t,n){var r=Un.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function r4(e,t){return mt(e.getDate(),t,2)}function Wae(e,t){return mt(e.getHours(),t,2)}function Vae(e,t){return mt(e.getHours()%12||12,t,2)}function Gae(e,t){return mt(1+Ah.count(Ji(e),e),t,3)}function Lz(e,t){return mt(e.getMilliseconds(),t,3)}function Yae(e,t){return Lz(e,t)+"000"}function Kae(e,t){return mt(e.getMonth()+1,t,2)}function Xae(e,t){return mt(e.getMinutes(),t,2)}function Zae(e,t){return mt(e.getSeconds(),t,2)}function Qae(e){var t=e.getDay();return t===0?7:t}function Jae(e,t){return mt(ny.count(Ji(e)-1,e),t,2)}function Bz(e){var t=e.getDay();return t>=4||t===0?iu(e):iu.ceil(e)}function eie(e,t){return e=Bz(e),mt(iu.count(Ji(e),e)+(Ji(e).getDay()===4),t,2)}function tie(e){return e.getDay()}function nie(e,t){return mt(Dv.count(Ji(e)-1,e),t,2)}function rie(e,t){return mt(e.getFullYear()%100,t,2)}function aie(e,t){return e=Bz(e),mt(e.getFullYear()%100,t,2)}function iie(e,t){return mt(e.getFullYear()%1e4,t,4)}function oie(e,t){var n=e.getDay();return e=n>=4||n===0?iu(e):iu.ceil(e),mt(e.getFullYear()%1e4,t,4)}function sie(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+mt(t/60|0,"0",2)+mt(t%60,"0",2)}function a4(e,t){return mt(e.getUTCDate(),t,2)}function lie(e,t){return mt(e.getUTCHours(),t,2)}function cie(e,t){return mt(e.getUTCHours()%12||12,t,2)}function uie(e,t){return mt(1+ty.count(eo(e),e),t,3)}function zz(e,t){return mt(e.getUTCMilliseconds(),t,3)}function die(e,t){return zz(e,t)+"000"}function fie(e,t){return mt(e.getUTCMonth()+1,t,2)}function hie(e,t){return mt(e.getUTCMinutes(),t,2)}function mie(e,t){return mt(e.getUTCSeconds(),t,2)}function pie(e){var t=e.getUTCDay();return t===0?7:t}function vie(e,t){return mt(ry.count(eo(e)-1,e),t,2)}function qz(e){var t=e.getUTCDay();return t>=4||t===0?ou(e):ou.ceil(e)}function gie(e,t){return e=qz(e),mt(ou.count(eo(e),e)+(eo(e).getUTCDay()===4),t,2)}function yie(e){return e.getUTCDay()}function xie(e,t){return mt($v.count(eo(e)-1,e),t,2)}function bie(e,t){return mt(e.getUTCFullYear()%100,t,2)}function wie(e,t){return e=qz(e),mt(e.getUTCFullYear()%100,t,2)}function jie(e,t){return mt(e.getUTCFullYear()%1e4,t,4)}function Sie(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ou(e):ou.ceil(e),mt(e.getUTCFullYear()%1e4,t,4)}function _ie(){return"+0000"}function i4(){return"%"}function o4(e){return+e}function s4(e){return Math.floor(+e/1e3)}var xc,Fz,Uz;Nie({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Nie(e){return xc=Nae(e),Fz=xc.format,xc.parse,Uz=xc.utcFormat,xc.utcParse,xc}function Oie(e){return new Date(e)}function Cie(e){return e instanceof Date?+e:+new Date(+e)}function OC(e,t,n,r,a,i,l,u,d,f){var m=fC(),p=m.invert,g=m.domain,x=f(".%L"),j=f(":%S"),b=f("%I:%M"),w=f("%I %p"),N=f("%a %d"),O=f("%b %d"),C=f("%B"),A=f("%Y");function E(k){return(d(k)t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,i)=>vre(e,i/r))},n.copy=function(){return Gz(t).domain(e)},so.apply(n,arguments)}function iy(){var e=0,t=.5,n=1,r=1,a,i,l,u,d,f=yr,m,p=!1,g;function x(b){return isNaN(b=+b)?g:(b=.5+((b=+m(b))-i)*(r*bn}return eS=e,eS}var tS,d4;function Pie(){if(d4)return tS;d4=1;var e=oy(),t=Zz(),n=Iu();function r(a){return a&&a.length?e(a,n,t):void 0}return tS=r,tS}var Mie=Pie();const sy=wt(Mie);var nS,f4;function Qz(){if(f4)return nS;f4=1;function e(t,n){return te.e^i.s<0?1:-1;for(r=i.d.length,a=e.d.length,t=0,n=re.d[t]^i.s<0?1:-1;return r===a?0:r>a^i.s<0?1:-1};Ee.decimalPlaces=Ee.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Wt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ee.dividedBy=Ee.div=function(e){return Xi(this,new this.constructor(e))};Ee.dividedToIntegerBy=Ee.idiv=function(e){var t=this,n=t.constructor;return Dt(Xi(t,new n(e),0,1),n.precision)};Ee.equals=Ee.eq=function(e){return!this.cmp(e)};Ee.exponent=function(){return mn(this)};Ee.greaterThan=Ee.gt=function(e){return this.cmp(e)>0};Ee.greaterThanOrEqualTo=Ee.gte=function(e){return this.cmp(e)>=0};Ee.isInteger=Ee.isint=function(){return this.e>this.d.length-2};Ee.isNegative=Ee.isneg=function(){return this.s<0};Ee.isPositive=Ee.ispos=function(){return this.s>0};Ee.isZero=function(){return this.s===0};Ee.lessThan=Ee.lt=function(e){return this.cmp(e)<0};Ee.lessThanOrEqualTo=Ee.lte=function(e){return this.cmp(e)<1};Ee.logarithm=Ee.log=function(e){var t,n=this,r=n.constructor,a=r.precision,i=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Zr))throw Error(ja+"NaN");if(n.s<1)throw Error(ja+(n.s?"NaN":"-Infinity"));return n.eq(Zr)?new r(0):(Gt=!1,t=Xi(Lf(n,i),Lf(e,i),i),Gt=!0,Dt(t,a))};Ee.minus=Ee.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?n6(t,e):e6(t,(e.s=-e.s,e))};Ee.modulo=Ee.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(ja+"NaN");return n.s?(Gt=!1,t=Xi(n,e,0,1).times(e),Gt=!0,n.minus(t)):Dt(new r(n),a)};Ee.naturalExponential=Ee.exp=function(){return t6(this)};Ee.naturalLogarithm=Ee.ln=function(){return Lf(this)};Ee.negated=Ee.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ee.plus=Ee.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?e6(t,e):n6(t,(e.s=-e.s,e))};Ee.precision=Ee.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Qs+e);if(t=mn(a)+1,r=a.d.length-1,n=r*Wt+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Ee.squareRoot=Ee.sqrt=function(){var e,t,n,r,a,i,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(ja+"NaN")}for(e=mn(u),Gt=!1,a=Math.sqrt(+u),a==0||a==1/0?(t=ri(u.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=zu((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(a.toString()),n=d.precision,a=l=n+3;;)if(i=r,r=i.plus(Xi(u,i,l+2)).times(.5),ri(i.d).slice(0,l)===(t=ri(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),a==l&&t=="4999"){if(Dt(i,n+1,0),i.times(i).eq(u)){r=i;break}}else if(t!="9999")break;l+=4}return Gt=!0,Dt(r,n)};Ee.times=Ee.mul=function(e){var t,n,r,a,i,l,u,d,f,m=this,p=m.constructor,g=m.d,x=(e=new p(e)).d;if(!m.s||!e.s)return new p(0);for(e.s*=m.s,n=m.e+e.e,d=g.length,f=x.length,d=0;){for(t=0,a=d+r;a>r;)u=i[a]+x[r]*g[a-r-1]+t,i[a--]=u%An|0,t=u/An|0;i[a]=(i[a]+t)%An|0}for(;!i[--l];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,Gt?Dt(e,p.precision):e};Ee.toDecimalPlaces=Ee.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(fi(e,0,Bu),t===void 0?t=r.rounding:fi(t,0,8),Dt(n,e+mn(n)+1,t))};Ee.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=ll(r,!0):(fi(e,0,Bu),t===void 0?t=a.rounding:fi(t,0,8),r=Dt(new a(r),e+1,t),n=ll(r,!0,e+1)),n};Ee.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?ll(a):(fi(e,0,Bu),t===void 0?t=i.rounding:fi(t,0,8),r=Dt(new i(a),e+mn(a)+1,t),n=ll(r.abs(),!1,e+mn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Ee.toInteger=Ee.toint=function(){var e=this,t=e.constructor;return Dt(new t(e),mn(e)+1,t.rounding)};Ee.toNumber=function(){return+this};Ee.toPower=Ee.pow=function(e){var t,n,r,a,i,l,u=this,d=u.constructor,f=12,m=+(e=new d(e));if(!e.s)return new d(Zr);if(u=new d(u),!u.s){if(e.s<1)throw Error(ja+"Infinity");return u}if(u.eq(Zr))return u;if(r=d.precision,e.eq(Zr))return Dt(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,i=u.s,l){if((n=m<0?-m:m)<=Jz){for(a=new d(Zr),t=Math.ceil(r/Wt+4),Gt=!1;n%2&&(a=a.times(u),y4(a.d,t)),n=zu(n/2),n!==0;)u=u.times(u),y4(u.d,t);return Gt=!0,e.s<0?new d(Zr).div(a):Dt(a,r)}}else if(i<0)throw Error(ja+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,Gt=!1,a=e.times(Lf(u,r+f)),Gt=!0,a=t6(a),a.s=i,a};Ee.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=mn(a),r=ll(a,n<=i.toExpNeg||n>=i.toExpPos)):(fi(e,1,Bu),t===void 0?t=i.rounding:fi(t,0,8),a=Dt(new i(a),e,t),n=mn(a),r=ll(a,e<=n||n<=i.toExpNeg,e)),r};Ee.toSignificantDigits=Ee.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(fi(e,1,Bu),t===void 0?t=r.rounding:fi(t,0,8)),Dt(new r(n),e,t)};Ee.toString=Ee.valueOf=Ee.val=Ee.toJSON=Ee[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=mn(e),n=e.constructor;return ll(e,t<=n.toExpNeg||t>=n.toExpPos)};function e6(e,t){var n,r,a,i,l,u,d,f,m=e.constructor,p=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),Gt?Dt(t,p):t;if(d=e.d,f=t.d,l=e.e,a=t.e,d=d.slice(),i=l-a,i){for(i<0?(r=d,i=-i,u=f.length):(r=f,a=l,u=d.length),l=Math.ceil(p/Wt),u=l>u?l+1:u+1,i>u&&(i=u,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(u=d.length,i=f.length,u-i<0&&(i=u,r=f,f=d,d=r),n=0;i;)n=(d[--i]=d[i]+f[i]+n)/An|0,d[i]%=An;for(n&&(d.unshift(n),++a),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=a,Gt?Dt(t,p):t}function fi(e,t,n){if(e!==~~e||en)throw Error(Qs+e)}function ri(e){var t,n,r,a=e.length-1,i="",l=e[0];if(a>0){for(i+=l,t=1;tl?1:-1;else for(u=d=0;ua[u]?1:-1;break}return d}function n(r,a,i){for(var l=0;i--;)r[i]-=l,l=r[i]1;)r.shift()}return function(r,a,i,l){var u,d,f,m,p,g,x,j,b,w,N,O,C,A,E,k,T,P,$=r.constructor,F=r.s==a.s?1:-1,D=r.d,U=a.d;if(!r.s)return new $(r);if(!a.s)throw Error(ja+"Division by zero");for(d=r.e-a.e,T=U.length,E=D.length,x=new $(F),j=x.d=[],f=0;U[f]==(D[f]||0);)++f;if(U[f]>(D[f]||0)&&--d,i==null?O=i=$.precision:l?O=i+(mn(r)-mn(a))+1:O=i,O<0)return new $(0);if(O=O/Wt+2|0,f=0,T==1)for(m=0,U=U[0],O++;(f1&&(U=e(U,m),D=e(D,m),T=U.length,E=D.length),A=T,b=D.slice(0,T),w=b.length;w=An/2&&++k;do m=0,u=t(U,b,T,w),u<0?(N=b[0],T!=w&&(N=N*An+(b[1]||0)),m=N/k|0,m>1?(m>=An&&(m=An-1),p=e(U,m),g=p.length,w=b.length,u=t(p,b,g,w),u==1&&(m--,n(p,T16)throw Error(AC+mn(e));if(!e.s)return new m(Zr);for(Gt=!1,u=p,l=new m(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(r=Math.log(Is(2,f))/Math.LN10*2+5|0,u+=r,n=a=i=new m(Zr),m.precision=u;;){if(a=Dt(a.times(e),u),n=n.times(++d),l=i.plus(Xi(a,n,u)),ri(l.d).slice(0,u)===ri(i.d).slice(0,u)){for(;f--;)i=Dt(i.times(i),u);return m.precision=p,t==null?(Gt=!0,Dt(i,p)):i}i=l}}function mn(e){for(var t=e.e*Wt,n=e.d[0];n>=10;n/=10)t++;return t}function sS(e,t,n){if(t>e.LN10.sd())throw Gt=!0,n&&(e.precision=n),Error(ja+"LN10 precision limit exceeded");return Dt(new e(e.LN10),t)}function Lo(e){for(var t="";e--;)t+="0";return t}function Lf(e,t){var n,r,a,i,l,u,d,f,m,p=1,g=10,x=e,j=x.d,b=x.constructor,w=b.precision;if(x.s<1)throw Error(ja+(x.s?"NaN":"-Infinity"));if(x.eq(Zr))return new b(0);if(t==null?(Gt=!1,f=w):f=t,x.eq(10))return t==null&&(Gt=!0),sS(b,f);if(f+=g,b.precision=f,n=ri(j),r=n.charAt(0),i=mn(x),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)x=x.times(e),n=ri(x.d),r=n.charAt(0),p++;i=mn(x),r>1?(x=new b("0."+n),i++):x=new b(r+"."+n.slice(1))}else return d=sS(b,f+2,w).times(i+""),x=Lf(new b(r+"."+n.slice(1)),f-g).plus(d),b.precision=w,t==null?(Gt=!0,Dt(x,w)):x;for(u=l=x=Xi(x.minus(Zr),x.plus(Zr),f),m=Dt(x.times(x),f),a=3;;){if(l=Dt(l.times(m),f),d=u.plus(Xi(l,new b(a),f)),ri(d.d).slice(0,f)===ri(u.d).slice(0,f))return u=u.times(2),i!==0&&(u=u.plus(sS(b,f+2,w).times(i+""))),u=Xi(u,new b(p),f),b.precision=w,t==null?(Gt=!0,Dt(u,w)):u;u=d,a+=2}}function g4(e,t){var n,r,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=zu(n/Wt),e.d=[],r=(n+1)%Wt,n<0&&(r+=Wt),rIv||e.e<-Iv))throw Error(AC+n)}else e.s=0,e.e=0,e.d=[0];return e}function Dt(e,t,n){var r,a,i,l,u,d,f,m,p=e.d;for(l=1,i=p[0];i>=10;i/=10)l++;if(r=t-l,r<0)r+=Wt,a=t,f=p[m=0];else{if(m=Math.ceil((r+1)/Wt),i=p.length,m>=i)return e;for(f=i=p[m],l=1;i>=10;i/=10)l++;r%=Wt,a=r-Wt+l}if(n!==void 0&&(i=Is(10,l-a-1),u=f/i%10|0,d=t<0||p[m+1]!==void 0||f%i,d=n<4?(u||d)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||d||n==6&&(r>0?a>0?f/Is(10,l-a):0:p[m-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(i=mn(e),p.length=1,t=t-i-1,p[0]=Is(10,(Wt-t%Wt)%Wt),e.e=zu(-t/Wt)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=m,i=1,m--):(p.length=m+1,i=Is(10,Wt-r),p[m]=a>0?(f/Is(10,l-a)%Is(10,a)|0)*i:0),d)for(;;)if(m==0){(p[0]+=i)==An&&(p[0]=1,++e.e);break}else{if(p[m]+=i,p[m]!=An)break;p[m--]=0,i=1}for(r=p.length;p[--r]===0;)p.pop();if(Gt&&(e.e>Iv||e.e<-Iv))throw Error(AC+mn(e));return e}function n6(e,t){var n,r,a,i,l,u,d,f,m,p,g=e.constructor,x=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),Gt?Dt(t,x):t;if(d=e.d,p=t.d,r=t.e,f=e.e,d=d.slice(),l=f-r,l){for(m=l<0,m?(n=d,l=-l,u=p.length):(n=p,r=f,u=d.length),a=Math.max(Math.ceil(x/Wt),u)+2,l>a&&(l=a,n.length=1),n.reverse(),a=l;a--;)n.push(0);n.reverse()}else{for(a=d.length,u=p.length,m=a0;--a)d[u++]=0;for(a=p.length;a>l;){if(d[--a]0?i=i.charAt(0)+"."+i.slice(1)+Lo(r):l>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Lo(-a-1)+i,n&&(r=n-l)>0&&(i+=Lo(r))):a>=l?(i+=Lo(a+1-l),n&&(r=n-a-1)>0&&(i=i+"."+Lo(r))):((r=a+1)0&&(a+1===l&&(i+="."),i+=Lo(r))),e.s<0?"-"+i:i}function y4(e,t){if(e.length>t)return e.length=t,!0}function r6(e){var t,n,r;function a(i){var l=this;if(!(l instanceof a))return new a(i);if(l.constructor=a,i instanceof a){l.s=i.s,l.e=i.e,l.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Qs+i);if(i>0)l.s=1;else if(i<0)i=-i,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(i===~~i&&i<1e7){l.e=0,l.d=[i];return}return g4(l,i.toString())}else if(typeof i!="string")throw Error(Qs+i);if(i.charCodeAt(0)===45?(i=i.slice(1),l.s=-1):l.s=1,Uie.test(i))g4(l,i);else throw Error(Qs+i)}if(a.prototype=Ee,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=r6,a.config=a.set=Hie,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(Qs+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Qs+n+": "+r);return this}var TC=r6(Fie);Zr=new TC(1);const kt=TC;function Wie(e){return Kie(e)||Yie(e)||Gie(e)||Vie()}function Vie(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gie(e,t){if(e){if(typeof e=="string")return H_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H_(e,t)}}function Yie(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Kie(e){if(Array.isArray(e))return H_(e)}function H_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,a):e(t-l,x4(function(){for(var u=arguments.length,d=new Array(u),f=0;fe.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,i=void 0;try{for(var l=e[Symbol.iterator](),u;!(r=(u=l.next()).done)&&(n.push(u.value),!(t&&n.length===t));r=!0);}catch(d){a=!0,i=d}finally{try{!r&&l.return!=null&&l.return()}finally{if(a)throw i}}return n}}function uoe(e){if(Array.isArray(e))return e}function l6(e){var t=Bf(e,2),n=t[0],r=t[1],a=n,i=r;return n>r&&(a=r,i=n),[a,i]}function c6(e,t,n){if(e.lte(0))return new kt(0);var r=uy.getDigitCount(e.toNumber()),a=new kt(10).pow(r),i=e.div(a),l=r!==1?.05:.1,u=new kt(Math.ceil(i.div(l).toNumber())).add(n).mul(l),d=u.mul(a);return t?d:new kt(Math.ceil(d))}function doe(e,t,n){var r=1,a=new kt(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new kt(10).pow(uy.getDigitCount(e)-1),a=new kt(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new kt(Math.floor(e)))}else e===0?a=new kt(Math.floor((t-1)/2)):n||(a=new kt(Math.floor(e)));var l=Math.floor((t-1)/2),u=Jie(Qie(function(d){return a.add(new kt(d-l).mul(r)).toNumber()}),W_);return u(0,t)}function u6(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new kt(0),tickMin:new kt(0),tickMax:new kt(0)};var i=c6(new kt(t).sub(e).div(n-1),r,a),l;e<=0&&t>=0?l=new kt(0):(l=new kt(e).add(t).div(2),l=l.sub(new kt(l).mod(i)));var u=Math.ceil(l.sub(e).div(i).toNumber()),d=Math.ceil(new kt(t).sub(l).div(i).toNumber()),f=u+d+1;return f>n?u6(e,t,n,r,a+1):(f0?d+(n-f):d,u=t>0?u:u+(n-f)),{step:i,tickMin:l.sub(new kt(u).mul(i)),tickMax:l.add(new kt(d).mul(i))})}function foe(e){var t=Bf(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=Math.max(a,2),u=l6([n,r]),d=Bf(u,2),f=d[0],m=d[1];if(f===-1/0||m===1/0){var p=m===1/0?[f].concat(G_(W_(0,a-1).map(function(){return 1/0}))):[].concat(G_(W_(0,a-1).map(function(){return-1/0})),[m]);return n>r?V_(p):p}if(f===m)return doe(f,a,i);var g=u6(f,m,l,i),x=g.step,j=g.tickMin,b=g.tickMax,w=uy.rangeStep(j,b.add(new kt(.1).mul(x)),x);return n>r?V_(w):w}function hoe(e,t){var n=Bf(e,2),r=n[0],a=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=l6([r,a]),u=Bf(l,2),d=u[0],f=u[1];if(d===-1/0||f===1/0)return[r,a];if(d===f)return[d];var m=Math.max(t,2),p=c6(new kt(f).sub(d).div(m-1),i,0),g=[].concat(G_(uy.rangeStep(new kt(d),new kt(f).sub(new kt(.99).mul(p)),p)),[f]);return r>a?V_(g):g}var moe=o6(foe),poe=o6(hoe),voe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function su(e){"@babel/helpers - typeof";return su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},su(e)}function Lv(){return Lv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Soe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function _oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Noe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,l=-1,u=(n=r?.length)!==null&&n!==void 0?n:0;if(u<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var d=i.range,f=0;f0?a[f-1].coordinate:a[u-1].coordinate,p=a[f].coordinate,g=f>=u-1?a[0].coordinate:a[f+1].coordinate,x=void 0;if(vr(p-m)!==vr(g-p)){var j=[];if(vr(g-p)===vr(d[1]-d[0])){x=g;var b=p+d[1]-d[0];j[0]=Math.min(b,(b+m)/2),j[1]=Math.max(b,(b+m)/2)}else{x=m;var w=g+d[1]-d[0];j[0]=Math.min(p,(w+p)/2),j[1]=Math.max(p,(w+p)/2)}var N=[Math.min(p,(x+p)/2),Math.max(p,(x+p)/2)];if(t>N[0]&&t<=N[1]||t>=j[0]&&t<=j[1]){l=a[f].index;break}}else{var O=Math.min(m,g),C=Math.max(m,g);if(t>(O+p)/2&&t<=(C+p)/2){l=a[f].index;break}}}else for(var A=0;A0&&A(r[A].coordinate+r[A-1].coordinate)/2&&t<=(r[A].coordinate+r[A+1].coordinate)/2||A===u-1&&t>(r[A].coordinate+r[A-1].coordinate)/2){l=r[A].index;break}return l},kC=function(t){var n,r=t,a=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?en(en({},t.type.defaultProps),t.props):t.props,l=i.stroke,u=i.fill,d;switch(a){case"Line":d=l;break;case"Area":case"Radar":d=l&&l!=="none"?l:u;break;default:d=u;break}return d},Foe=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var l={},u=Object.keys(i),d=0,f=u.length;d=0});if(N&&N.length){var O=N[0].type.defaultProps,C=O!==void 0?en(en({},O),N[0].props):N[0].props,A=C.barSize,E=C[w];l[E]||(l[E]=[]);var k=Ge(A)?n:A;l[E].push({item:N[0],stackList:N.slice(1),barSize:Ge(k)?void 0:gr(k,r,0)})}}return l},Uoe=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,i=t.sizeList,l=i===void 0?[]:i,u=t.maxBarSize,d=l.length;if(d<1)return null;var f=gr(n,a,0,!0),m,p=[];if(l[0].barSize===+l[0].barSize){var g=!1,x=a/d,j=l.reduce(function(A,E){return A+E.barSize||0},0);j+=(d-1)*f,j>=a&&(j-=(d-1)*f,f=0),j>=a&&x>0&&(g=!0,x*=.9,j=d*x);var b=(a-j)/2>>0,w={offset:b-f,size:0};m=l.reduce(function(A,E){var k={item:E.item,position:{offset:w.offset+w.size+f,size:g?x:E.barSize}},T=[].concat(j4(A),[k]);return w=T[T.length-1].position,E.stackList&&E.stackList.length&&E.stackList.forEach(function(P){T.push({item:P,position:w})}),T},p)}else{var N=gr(r,a,0,!0);a-2*N-(d-1)*f<=0&&(f=0);var O=(a-2*N-(d-1)*f)/d;O>1&&(O>>=0);var C=u===+u?Math.min(O,u):O;m=l.reduce(function(A,E,k){var T=[].concat(j4(A),[{item:E.item,position:{offset:N+(O+f)*k+(O-C)/2,size:C}}]);return E.stackList&&E.stackList.length&&E.stackList.forEach(function(P){T.push({item:P,position:T[T.length-1].position})}),T},p)}return m},Hoe=function(t,n,r,a){var i=r.children,l=r.width,u=r.margin,d=l-(u.left||0)-(u.right||0),f=m6({children:i,legendWidth:d});if(f){var m=a||{},p=m.width,g=m.height,x=f.align,j=f.verticalAlign,b=f.layout;if((b==="vertical"||b==="horizontal"&&j==="middle")&&x!=="center"&&Ne(t[x]))return en(en({},t),{},qc({},x,t[x]+(p||0)));if((b==="horizontal"||b==="vertical"&&x==="center")&&j!=="middle"&&Ne(t[j]))return en(en({},t),{},qc({},j,t[j]+(g||0)))}return t},Woe=function(t,n,r){return Ge(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},p6=function(t,n,r,a,i){var l=n.props.children,u=Jr(l,kh).filter(function(f){return Woe(a,i,f.props.direction)});if(u&&u.length){var d=u.map(function(f){return f.props.dataKey});return t.reduce(function(f,m){var p=wn(m,r);if(Ge(p))return f;var g=Array.isArray(p)?[ly(p),sy(p)]:[p,p],x=d.reduce(function(j,b){var w=wn(m,b,0),N=g[0]-Math.abs(Array.isArray(w)?w[0]:w),O=g[1]+Math.abs(Array.isArray(w)?w[1]:w);return[Math.min(N,j[0]),Math.max(O,j[1])]},[1/0,-1/0]);return[Math.min(x[0],f[0]),Math.max(x[1],f[1])]},[1/0,-1/0])}return null},Voe=function(t,n,r,a,i){var l=n.map(function(u){return p6(t,u,r,i,a)}).filter(function(u){return!Ge(u)});return l&&l.length?l.reduce(function(u,d){return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]):null},v6=function(t,n,r,a,i){var l=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&p6(t,d,f,a)||yf(t,f,r,i)});if(r==="number")return l.reduce(function(d,f){return[Math.min(d[0],f[0]),Math.max(d[1],f[1])]},[1/0,-1/0]);var u={};return l.reduce(function(d,f){for(var m=0,p=f.length;m=2?vr(u[0]-u[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var m=(t.ticks||t.niceTicks).map(function(p){var g=i?i.indexOf(p):p;return{coordinate:a(g)+f,value:p,offset:f}});return m.filter(function(p){return!_h(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,g){return{coordinate:a(p)+f,value:p,index:g,offset:f}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(p){return{coordinate:a(p)+f,value:p,offset:f}}):a.domain().map(function(p,g){return{coordinate:a(p)+f,value:i?i[p]:p,index:g,offset:f}})},lS=new WeakMap,Ep=function(t,n){if(typeof n!="function")return t;lS.has(t)||lS.set(t,new WeakMap);var r=lS.get(t);if(r.has(n))return r.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,a),a},x6=function(t,n,r){var a=t.scale,i=t.type,l=t.layout,u=t.axisType;if(a==="auto")return l==="radial"&&u==="radiusAxis"?{scale:Mf(),realScaleType:"band"}:l==="radial"&&u==="angleAxis"?{scale:Mv(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:gf(),realScaleType:"point"}:i==="category"?{scale:Mf(),realScaleType:"band"}:{scale:Mv(),realScaleType:"linear"};if(il(a)){var d="scale".concat(Vg(a));return{scale:(l4[d]||gf)(),realScaleType:l4[d]?d:"point"}}return We(a)?{scale:a}:{scale:gf(),realScaleType:"point"}},_4=1e-4,b6=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,a=t.range(),i=Math.min(a[0],a[1])-_4,l=Math.max(a[0],a[1])+_4,u=t(n[0]),d=t(n[r-1]);(ul||dl)&&t.domain([n[0],n[r-1]])}},Goe=function(t,n){if(!t)return null;for(var r=0,a=t.length;ra)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]=0?(t[u][r][0]=i,t[u][r][1]=i+d,i=t[u][r][1]):(t[u][r][0]=l,t[u][r][1]=l+d,l=t[u][r][1])}},Xoe=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r=0?(t[l][r][0]=i,t[l][r][1]=i+u,i=t[l][r][1]):(t[l][r][0]=0,t[l][r][1]=0)}},Zoe={sign:Koe,expand:LJ,none:Jc,silhouette:BJ,wiggle:zJ,positive:Xoe},Qoe=function(t,n,r){var a=n.map(function(u){return u.props.dataKey}),i=Zoe[r],l=IJ().keys(a).value(function(u,d){return+wn(u,d,0)}).order(O_).offset(i);return l(t)},Joe=function(t,n,r,a,i,l){if(!t)return null;var u=l?n.reverse():n,d={},f=u.reduce(function(p,g){var x,j=(x=g.type)!==null&&x!==void 0&&x.defaultProps?en(en({},g.type.defaultProps),g.props):g.props,b=j.stackId,w=j.hide;if(w)return p;var N=j[r],O=p[N]||{hasStack:!1,stackGroups:{}};if(jn(b)){var C=O.stackGroups[b]||{numericAxisId:r,cateAxisId:a,items:[]};C.items.push(g),O.hasStack=!0,O.stackGroups[b]=C}else O.stackGroups[$u("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[g]};return en(en({},p),{},qc({},N,O))},d),m={};return Object.keys(f).reduce(function(p,g){var x=f[g];if(x.hasStack){var j={};x.stackGroups=Object.keys(x.stackGroups).reduce(function(b,w){var N=x.stackGroups[w];return en(en({},b),{},qc({},w,{numericAxisId:r,cateAxisId:a,items:N.items,stackedData:Qoe(t,N.items,i)}))},j)}return en(en({},p),{},qc({},g,x))},m)},w6=function(t,n){var r=n.realScaleType,a=n.type,i=n.tickCount,l=n.originalDomain,u=n.allowDecimals,d=r||n.scale;if(d!=="auto"&&d!=="linear")return null;if(i&&a==="number"&&l&&(l[0]==="auto"||l[1]==="auto")){var f=t.domain();if(!f.length)return null;var m=moe(f,i,u);return t.domain([ly(m),sy(m)]),{niceTicks:m}}if(i&&a==="number"){var p=t.domain(),g=poe(p,i,u);return{niceTicks:g}}return null};function N4(e){var t=e.axis,n=e.ticks,r=e.bandSize,a=e.entry,i=e.index,l=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ge(a[t.dataKey])){var u=pv(n,"value",a[t.dataKey]);if(u)return u.coordinate+r/2}return n[i]?n[i].coordinate+r/2:null}var d=wn(a,Ge(l)?t.dataKey:l);return Ge(d)?null:t.scale(d)}var O4=function(t){var n=t.axis,r=t.ticks,a=t.offset,i=t.bandSize,l=t.entry,u=t.index;if(n.type==="category")return r[u]?r[u].coordinate+a:null;var d=wn(l,n.dataKey,n.domain[u]);return Ge(d)?null:n.scale(d)-i/2+a},ese=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return a<=0&&i>=0?0:i<0?i:a}return r[0]},tse=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?en(en({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(jn(i)){var l=n[i];if(l){var u=l.items.indexOf(t);return u>=0?l.stackedData[u]:null}}return null},nse=function(t){return t.reduce(function(n,r){return[ly(r.concat([n[0]]).filter(Ne)),sy(r.concat([n[1]]).filter(Ne))]},[1/0,-1/0])},j6=function(t,n,r){return Object.keys(t).reduce(function(a,i){var l=t[i],u=l.stackedData,d=u.reduce(function(f,m){var p=nse(m.slice(n,r+1));return[Math.min(f[0],p[0]),Math.max(f[1],p[1])]},[1/0,-1/0]);return[Math.min(d[0],a[0]),Math.max(d[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},C4=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,E4=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Z_=function(t,n,r){if(We(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(Ne(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(C4.test(t[0])){var i=+C4.exec(t[0])[1];a[0]=n[0]-i}else We(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(Ne(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(E4.test(t[1])){var l=+E4.exec(t[1])[1];a[1]=n[1]+l}else We(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},zv=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!r||a>0)return a}if(t&&n&&n.length>=2){for(var i=iC(n,function(p){return p.coordinate}),l=1/0,u=1,d=i.length;ue.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},dse=function(t,n,r,a,i){var l=t.width,u=t.height,d=t.startAngle,f=t.endAngle,m=gr(t.cx,l,l/2),p=gr(t.cy,u,u/2),g=N6(l,u,r),x=gr(t.innerRadius,g,0),j=gr(t.outerRadius,g,g*.8),b=Object.keys(n);return b.reduce(function(w,N){var O=n[N],C=O.domain,A=O.reversed,E;if(Ge(O.range))a==="angleAxis"?E=[d,f]:a==="radiusAxis"&&(E=[x,j]),A&&(E=[E[1],E[0]]);else{E=O.range;var k=E,T=ise(k,2);d=T[0],f=T[1]}var P=x6(O,i),$=P.realScaleType,F=P.scale;F.domain(C).range(E),b6(F);var D=w6(F,qi(qi({},O),{},{realScaleType:$})),U=qi(qi(qi({},O),D),{},{range:E,radius:j,realScaleType:$,scale:F,cx:m,cy:p,innerRadius:x,outerRadius:j,startAngle:d,endAngle:f});return qi(qi({},w),{},_6({},N,U))},{})},fse=function(t,n){var r=t.x,a=t.y,i=n.x,l=n.y;return Math.sqrt(Math.pow(r-i,2)+Math.pow(a-l,2))},hse=function(t,n){var r=t.x,a=t.y,i=n.cx,l=n.cy,u=fse({x:r,y:a},{x:i,y:l});if(u<=0)return{radius:u};var d=(r-i)/u,f=Math.acos(d);return a>l&&(f=2*Math.PI-f),{radius:u,angle:use(f),angleInRadian:f}},mse=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),i=Math.floor(r/360),l=Math.min(a,i);return{startAngle:n-l*360,endAngle:r-l*360}},pse=function(t,n){var r=n.startAngle,a=n.endAngle,i=Math.floor(r/360),l=Math.floor(a/360),u=Math.min(i,l);return t+u*360},P4=function(t,n){var r=t.x,a=t.y,i=hse({x:r,y:a},n),l=i.radius,u=i.angle,d=n.innerRadius,f=n.outerRadius;if(lf)return!1;if(l===0)return!0;var m=mse(n),p=m.startAngle,g=m.endAngle,x=u,j;if(p<=g){for(;x>g;)x-=360;for(;x=p&&x<=g}else{for(;x>p;)x-=360;for(;x=g&&x<=p}return j?qi(qi({},n),{},{radius:l,angle:pse(x,n)}):null},O6=function(t){return!y.isValidElement(t)&&!We(t)&&typeof t!="boolean"?t.className:""};function Uf(e){"@babel/helpers - typeof";return Uf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uf(e)}var vse=["offset"];function gse(e){return wse(e)||bse(e)||xse(e)||yse()}function yse(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xse(e,t){if(e){if(typeof e=="string")return Q_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q_(e,t)}}function bse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wse(e){if(Array.isArray(e))return Q_(e)}function Q_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Sse(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function M4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function bn(e){for(var t=1;t=0?1:-1,C,A;a==="insideStart"?(C=x+O*l,A=b):a==="insideEnd"?(C=j-O*l,A=!b):a==="end"&&(C=j+O*l,A=b),A=N<=0?A:!A;var E=Bt(f,m,w,C),k=Bt(f,m,w,C+(A?1:-1)*359),T="M".concat(E.x,",").concat(E.y,` - A`).concat(w,",").concat(w,",0,1,").concat(A?0:1,`, - `).concat(k.x,",").concat(k.y),P=Ge(t.id)?$u("recharts-radial-line-"):t.id;return W.createElement("text",Hf({},r,{dominantBaseline:"central",className:Ye("recharts-radial-bar-label",u)}),W.createElement("defs",null,W.createElement("path",{id:P,d:T})),W.createElement("textPath",{xlinkHref:"#".concat(P)},n))},Tse=function(t){var n=t.viewBox,r=t.offset,a=t.position,i=n,l=i.cx,u=i.cy,d=i.innerRadius,f=i.outerRadius,m=i.startAngle,p=i.endAngle,g=(m+p)/2;if(a==="outside"){var x=Bt(l,u,f+r,g),j=x.x,b=x.y;return{x:j,y:b,textAnchor:j>=l?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"end"};var w=(d+f)/2,N=Bt(l,u,w,g),O=N.x,C=N.y;return{x:O,y:C,textAnchor:"middle",verticalAnchor:"middle"}},kse=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,i=t.position,l=n,u=l.x,d=l.y,f=l.width,m=l.height,p=m>=0?1:-1,g=p*a,x=p>0?"end":"start",j=p>0?"start":"end",b=f>=0?1:-1,w=b*a,N=b>0?"end":"start",O=b>0?"start":"end";if(i==="top"){var C={x:u+f/2,y:d-p*a,textAnchor:"middle",verticalAnchor:x};return bn(bn({},C),r?{height:Math.max(d-r.y,0),width:f}:{})}if(i==="bottom"){var A={x:u+f/2,y:d+m+g,textAnchor:"middle",verticalAnchor:j};return bn(bn({},A),r?{height:Math.max(r.y+r.height-(d+m),0),width:f}:{})}if(i==="left"){var E={x:u-w,y:d+m/2,textAnchor:N,verticalAnchor:"middle"};return bn(bn({},E),r?{width:Math.max(E.x-r.x,0),height:m}:{})}if(i==="right"){var k={x:u+f+w,y:d+m/2,textAnchor:O,verticalAnchor:"middle"};return bn(bn({},k),r?{width:Math.max(r.x+r.width-k.x,0),height:m}:{})}var T=r?{width:f,height:m}:{};return i==="insideLeft"?bn({x:u+w,y:d+m/2,textAnchor:O,verticalAnchor:"middle"},T):i==="insideRight"?bn({x:u+f-w,y:d+m/2,textAnchor:N,verticalAnchor:"middle"},T):i==="insideTop"?bn({x:u+f/2,y:d+g,textAnchor:"middle",verticalAnchor:j},T):i==="insideBottom"?bn({x:u+f/2,y:d+m-g,textAnchor:"middle",verticalAnchor:x},T):i==="insideTopLeft"?bn({x:u+w,y:d+g,textAnchor:O,verticalAnchor:j},T):i==="insideTopRight"?bn({x:u+f-w,y:d+g,textAnchor:N,verticalAnchor:j},T):i==="insideBottomLeft"?bn({x:u+w,y:d+m-g,textAnchor:O,verticalAnchor:x},T):i==="insideBottomRight"?bn({x:u+f-w,y:d+m-g,textAnchor:N,verticalAnchor:x},T):Du(i)&&(Ne(i.x)||qs(i.x))&&(Ne(i.y)||qs(i.y))?bn({x:u+gr(i.x,f),y:d+gr(i.y,m),textAnchor:"end",verticalAnchor:"end"},T):bn({x:u+f/2,y:d+m/2,textAnchor:"middle",verticalAnchor:"middle"},T)},Pse=function(t){return"cx"in t&&Ne(t.cx)};function Tn(e){var t=e.offset,n=t===void 0?5:t,r=jse(e,vse),a=bn({offset:n},r),i=a.viewBox,l=a.position,u=a.value,d=a.children,f=a.content,m=a.className,p=m===void 0?"":m,g=a.textBreakAll;if(!i||Ge(u)&&Ge(d)&&!y.isValidElement(f)&&!We(f))return null;if(y.isValidElement(f))return y.cloneElement(f,a);var x;if(We(f)){if(x=y.createElement(f,a),y.isValidElement(x))return x}else x=Cse(a);var j=Pse(i),b=Be(a,!0);if(j&&(l==="insideStart"||l==="insideEnd"||l==="end"))return Ase(a,x,b);var w=j?Tse(a):kse(a);return W.createElement(sl,Hf({className:Ye("recharts-label",p)},b,w,{breakAll:g}),x)}Tn.displayName="Label";var C6=function(t){var n=t.cx,r=t.cy,a=t.angle,i=t.startAngle,l=t.endAngle,u=t.r,d=t.radius,f=t.innerRadius,m=t.outerRadius,p=t.x,g=t.y,x=t.top,j=t.left,b=t.width,w=t.height,N=t.clockWise,O=t.labelViewBox;if(O)return O;if(Ne(b)&&Ne(w)){if(Ne(p)&&Ne(g))return{x:p,y:g,width:b,height:w};if(Ne(x)&&Ne(j))return{x,y:j,width:b,height:w}}return Ne(p)&&Ne(g)?{x:p,y:g,width:0,height:0}:Ne(n)&&Ne(r)?{cx:n,cy:r,startAngle:i||a||0,endAngle:l||a||0,innerRadius:f||0,outerRadius:m||d||u||0,clockWise:N}:t.viewBox?t.viewBox:{}},Mse=function(t,n){return t?t===!0?W.createElement(Tn,{key:"label-implicit",viewBox:n}):jn(t)?W.createElement(Tn,{key:"label-implicit",viewBox:n,value:t}):y.isValidElement(t)?t.type===Tn?y.cloneElement(t,{key:"label-implicit",viewBox:n}):W.createElement(Tn,{key:"label-implicit",content:t,viewBox:n}):We(t)?W.createElement(Tn,{key:"label-implicit",content:t,viewBox:n}):Du(t)?W.createElement(Tn,Hf({viewBox:n},t,{key:"label-implicit"})):null:null},Rse=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var a=t.children,i=C6(t),l=Jr(a,Tn).map(function(d,f){return y.cloneElement(d,{viewBox:n||i,key:"label-".concat(f)})});if(!r)return l;var u=Mse(t.label,n||i);return[u].concat(gse(l))};Tn.parseViewBox=C6;Tn.renderCallByParent=Rse;var cS,R4;function Dse(){if(R4)return cS;R4=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return cS=e,cS}var $se=Dse();const Ise=wt($se);function Wf(e){"@babel/helpers - typeof";return Wf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wf(e)}var Lse=["valueAccessor"],Bse=["data","dataKey","clockWise","id","textBreakAll"];function zse(e){return Hse(e)||Use(e)||Fse(e)||qse()}function qse(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fse(e,t){if(e){if(typeof e=="string")return J_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J_(e,t)}}function Use(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Hse(e){if(Array.isArray(e))return J_(e)}function J_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Yse(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Kse=function(t){return Array.isArray(t.value)?Ise(t.value):t.value};function Zi(e){var t=e.valueAccessor,n=t===void 0?Kse:t,r=I4(e,Lse),a=r.data,i=r.dataKey,l=r.clockWise,u=r.id,d=r.textBreakAll,f=I4(r,Bse);return!a||!a.length?null:W.createElement(ft,{className:"recharts-label-list"},a.map(function(m,p){var g=Ge(i)?n(m,p):wn(m&&m.payload,i),x=Ge(u)?{}:{id:"".concat(u,"-").concat(p)};return W.createElement(Tn,Fv({},Be(m,!0),f,x,{parentViewBox:m.parentViewBox,value:g,textBreakAll:d,viewBox:Tn.parseViewBox(Ge(l)?m:$4($4({},m),{},{clockWise:l})),key:"label-".concat(p),index:p}))}))}Zi.displayName="LabelList";function Xse(e,t){return e?e===!0?W.createElement(Zi,{key:"labelList-implicit",data:t}):W.isValidElement(e)||We(e)?W.createElement(Zi,{key:"labelList-implicit",data:t,content:e}):Du(e)?W.createElement(Zi,Fv({data:t},e,{key:"labelList-implicit"})):null:null}function Zse(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,a=Jr(r,Zi).map(function(l,u){return y.cloneElement(l,{data:t,key:"labelList-".concat(u)})});if(!n)return a;var i=Xse(e.label,t);return[i].concat(zse(a))}Zi.renderCallByParent=Zse;function Vf(e){"@babel/helpers - typeof";return Vf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vf(e)}function eN(){return eN=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(l>f),`, - `).concat(p.x,",").concat(p.y,` - `);if(a>0){var x=Bt(n,r,a,l),j=Bt(n,r,a,f);g+="L ".concat(j.x,",").concat(j.y,` - A `).concat(a,",").concat(a,`,0, - `).concat(+(Math.abs(d)>180),",").concat(+(l<=f),`, - `).concat(x.x,",").concat(x.y," Z")}else g+="L ".concat(n,",").concat(r," Z");return g},nle=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,l=t.cornerRadius,u=t.forceCornerRadius,d=t.cornerIsExternal,f=t.startAngle,m=t.endAngle,p=vr(m-f),g=Ap({cx:n,cy:r,radius:i,angle:f,sign:p,cornerRadius:l,cornerIsExternal:d}),x=g.circleTangency,j=g.lineTangency,b=g.theta,w=Ap({cx:n,cy:r,radius:i,angle:m,sign:-p,cornerRadius:l,cornerIsExternal:d}),N=w.circleTangency,O=w.lineTangency,C=w.theta,A=d?Math.abs(f-m):Math.abs(f-m)-b-C;if(A<0)return u?"M ".concat(j.x,",").concat(j.y,` - a`).concat(l,",").concat(l,",0,0,1,").concat(l*2,`,0 - a`).concat(l,",").concat(l,",0,0,1,").concat(-l*2,`,0 - `):E6({cx:n,cy:r,innerRadius:a,outerRadius:i,startAngle:f,endAngle:m});var E="M ".concat(j.x,",").concat(j.y,` - A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(x.x,",").concat(x.y,` - A`).concat(i,",").concat(i,",0,").concat(+(A>180),",").concat(+(p<0),",").concat(N.x,",").concat(N.y,` - A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(O.x,",").concat(O.y,` - `);if(a>0){var k=Ap({cx:n,cy:r,radius:a,angle:f,sign:p,isExternal:!0,cornerRadius:l,cornerIsExternal:d}),T=k.circleTangency,P=k.lineTangency,$=k.theta,F=Ap({cx:n,cy:r,radius:a,angle:m,sign:-p,isExternal:!0,cornerRadius:l,cornerIsExternal:d}),D=F.circleTangency,U=F.lineTangency,V=F.theta,H=d?Math.abs(f-m):Math.abs(f-m)-$-V;if(H<0&&l===0)return"".concat(E,"L").concat(n,",").concat(r,"Z");E+="L".concat(U.x,",").concat(U.y,` - A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(D.x,",").concat(D.y,` - A`).concat(a,",").concat(a,",0,").concat(+(H>180),",").concat(+(p>0),",").concat(T.x,",").concat(T.y,` - A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(P.x,",").concat(P.y,"Z")}else E+="L".concat(n,",").concat(r,"Z");return E},rle={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},A6=function(t){var n=B4(B4({},rle),t),r=n.cx,a=n.cy,i=n.innerRadius,l=n.outerRadius,u=n.cornerRadius,d=n.forceCornerRadius,f=n.cornerIsExternal,m=n.startAngle,p=n.endAngle,g=n.className;if(l0&&Math.abs(m-p)<360?w=nle({cx:r,cy:a,innerRadius:i,outerRadius:l,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:m,endAngle:p}):w=E6({cx:r,cy:a,innerRadius:i,outerRadius:l,startAngle:m,endAngle:p}),W.createElement("path",eN({},Be(n,!0),{className:x,d:w,role:"img"}))};function Gf(e){"@babel/helpers - typeof";return Gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gf(e)}function tN(){return tN=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function jle(e,t){return bl(e.getTime(),t.getTime())}function Sle(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function _le(e,t){return e===t}function X4(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var a=new Array(r),i=e.entries(),l,u,d=0;(l=i.next())&&!l.done;){for(var f=t.entries(),m=!1,p=0;(u=f.next())&&!u.done;){if(a[p]){p++;continue}var g=l.value,x=u.value;if(n.equals(g[0],x[0],d,p,e,t,n)&&n.equals(g[1],x[1],g[0],x[0],e,t,n)){m=a[p]=!0;break}p++}if(!m)return!1;d++}return!0}var Nle=bl;function Ole(e,t,n){var r=K4(e),a=r.length;if(K4(t).length!==a)return!1;for(;a-- >0;)if(!T6(e,t,n,r[a]))return!1;return!0}function Jd(e,t,n){var r=G4(e),a=r.length;if(G4(t).length!==a)return!1;for(var i,l,u;a-- >0;)if(i=r[a],!T6(e,t,n,i)||(l=Y4(e,i),u=Y4(t,i),(l||u)&&(!l||!u||l.configurable!==u.configurable||l.enumerable!==u.enumerable||l.writable!==u.writable)))return!1;return!0}function Cle(e,t){return bl(e.valueOf(),t.valueOf())}function Ele(e,t){return e.source===t.source&&e.flags===t.flags}function Z4(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var a=new Array(r),i=e.values(),l,u;(l=i.next())&&!l.done;){for(var d=t.values(),f=!1,m=0;(u=d.next())&&!u.done;){if(!a[m]&&n.equals(l.value,u.value,l.value,u.value,e,t,n)){f=a[m]=!0;break}m++}if(!f)return!1}return!0}function Ale(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Tle(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function T6(e,t,n,r){return(r===ble||r===xle||r===yle)&&(e.$$typeof||t.$$typeof)?!0:gle(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var kle="[object Arguments]",Ple="[object Boolean]",Mle="[object Date]",Rle="[object Error]",Dle="[object Map]",$le="[object Number]",Ile="[object Object]",Lle="[object RegExp]",Ble="[object Set]",zle="[object String]",qle="[object URL]",Fle=Array.isArray,Q4=typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView:null,J4=Object.assign,Ule=Object.prototype.toString.call.bind(Object.prototype.toString);function Hle(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,a=e.areFunctionsEqual,i=e.areMapsEqual,l=e.areNumbersEqual,u=e.areObjectsEqual,d=e.arePrimitiveWrappersEqual,f=e.areRegExpsEqual,m=e.areSetsEqual,p=e.areTypedArraysEqual,g=e.areUrlsEqual,x=e.unknownTagComparators;return function(b,w,N){if(b===w)return!0;if(b==null||w==null)return!1;var O=typeof b;if(O!==typeof w)return!1;if(O!=="object")return O==="number"?l(b,w,N):O==="function"?a(b,w,N):!1;var C=b.constructor;if(C!==w.constructor)return!1;if(C===Object)return u(b,w,N);if(Fle(b))return t(b,w,N);if(Q4!=null&&Q4(b))return p(b,w,N);if(C===Date)return n(b,w,N);if(C===RegExp)return f(b,w,N);if(C===Map)return i(b,w,N);if(C===Set)return m(b,w,N);var A=Ule(b);if(A===Mle)return n(b,w,N);if(A===Lle)return f(b,w,N);if(A===Dle)return i(b,w,N);if(A===Ble)return m(b,w,N);if(A===Ile)return typeof b.then!="function"&&typeof w.then!="function"&&u(b,w,N);if(A===qle)return g(b,w,N);if(A===Rle)return r(b,w,N);if(A===kle)return u(b,w,N);if(A===Ple||A===$le||A===zle)return d(b,w,N);if(x){var E=x[A];if(!E){var k=vle(b);k&&(E=x[k])}if(E)return E(b,w,N)}return!1}}function Wle(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,a={areArraysEqual:r?Jd:wle,areDatesEqual:jle,areErrorsEqual:Sle,areFunctionsEqual:_le,areMapsEqual:r?V4(X4,Jd):X4,areNumbersEqual:Nle,areObjectsEqual:r?Jd:Ole,arePrimitiveWrappersEqual:Cle,areRegExpsEqual:Ele,areSetsEqual:r?V4(Z4,Jd):Z4,areTypedArraysEqual:r?Jd:Ale,areUrlsEqual:Tle,unknownTagComparators:void 0};if(n&&(a=J4({},a,n(a))),t){var i=kp(a.areArraysEqual),l=kp(a.areMapsEqual),u=kp(a.areObjectsEqual),d=kp(a.areSetsEqual);a=J4({},a,{areArraysEqual:i,areMapsEqual:l,areObjectsEqual:u,areSetsEqual:d})}return a}function Vle(e){return function(t,n,r,a,i,l,u){return e(t,n,u)}}function Gle(e){var t=e.circular,n=e.comparator,r=e.createState,a=e.equals,i=e.strict;if(r)return function(d,f){var m=r(),p=m.cache,g=p===void 0?t?new WeakMap:void 0:p,x=m.meta;return n(d,f,{cache:g,equals:a,meta:x,strict:i})};if(t)return function(d,f){return n(d,f,{cache:new WeakMap,equals:a,meta:void 0,strict:i})};var l={cache:void 0,equals:a,meta:void 0,strict:i};return function(d,f){return n(d,f,l)}}var Yle=as();as({strict:!0});as({circular:!0});as({circular:!0,strict:!0});as({createInternalComparator:function(){return bl}});as({strict:!0,createInternalComparator:function(){return bl}});as({circular:!0,createInternalComparator:function(){return bl}});as({circular:!0,createInternalComparator:function(){return bl},strict:!0});function as(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,a=e.createState,i=e.strict,l=i===void 0?!1:i,u=Wle(e),d=Hle(u),f=r?r(d):Vle(d);return Gle({circular:n,comparator:d,createState:a,equals:f,strict:l})}function Kle(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function eI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(i){n<0&&(n=i),i-n>t?(e(i),n=-1):Kle(a)};requestAnimationFrame(r)}function nN(e){"@babel/helpers - typeof";return nN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nN(e)}function Xle(e){return ece(e)||Jle(e)||Qle(e)||Zle()}function Zle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qle(e,t){if(e){if(typeof e=="string")return tI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tI(e,t)}}function tI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?1:N<0?0:N},b=function(N){for(var O=N>1?1:N,C=O,A=0;A<8;++A){var E=p(C)-O,k=x(C);if(Math.abs(E-O)0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,i=a===void 0?8:a,l=t.dt,u=l===void 0?17:l,d=function(m,p,g){var x=-(m-p)*r,j=g*i,b=g+(x-j)*u/1e3,w=g*u/1e3+m;return Math.abs(w-p)e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function kce(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i=0)&&(n[a]=e[a]);return n}function hS(e){return Dce(e)||Rce(e)||Mce(e)||Pce()}function Pce(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mce(e,t){if(e){if(typeof e=="string")return sN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sN(e,t)}}function Rce(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Dce(e){if(Array.isArray(e))return sN(e)}function sN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vv(e){return Vv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Vv(e)}var hi=(function(e){zce(n,e);var t=qce(n);function n(r,a){var i;$ce(this,n),i=t.call(this,r,a);var l=i.props,u=l.isActive,d=l.attributeName,f=l.from,m=l.to,p=l.steps,g=l.children,x=l.duration;if(i.handleStyleChange=i.handleStyleChange.bind(uN(i)),i.changeStyle=i.changeStyle.bind(uN(i)),!u||x<=0)return i.state={style:{}},typeof g=="function"&&(i.state={style:m}),cN(i);if(p&&p.length)i.state={style:p[0].style};else if(f){if(typeof g=="function")return i.state={style:f},cN(i);i.state={style:d?sf({},d,f):f}}else i.state={style:{}};return i}return Lce(n,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,l=a.canBegin;this.mounted=!0,!(!i||!l)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,l=i.isActive,u=i.canBegin,d=i.attributeName,f=i.shouldReAnimate,m=i.to,p=i.from,g=this.state.style;if(u){if(!l){var x={style:d?sf({},d,m):m};this.state&&g&&(d&&g[d]!==m||!d&&g!==m)&&this.setState(x);return}if(!(Yle(a.to,m)&&a.canBegin&&a.isActive)){var j=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var b=j||f?p:a.to;if(this.state&&g){var w={style:d?sf({},d,b):b};(d&&g[d]!==b||!d&&g!==b)&&this.setState(w)}this.runAnimation(Ea(Ea({},this.props),{},{from:b,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,l=a.from,u=a.to,d=a.duration,f=a.easing,m=a.begin,p=a.onAnimationEnd,g=a.onAnimationStart,x=Ece(l,u,gce(f),d,this.changeStyle),j=function(){i.stopJSAnimation=x()};this.manager.start([g,m,j,d,p])}},{key:"runStepAnimation",value:function(a){var i=this,l=a.steps,u=a.begin,d=a.onAnimationStart,f=l[0],m=f.style,p=f.duration,g=p===void 0?0:p,x=function(b,w,N){if(N===0)return b;var O=w.duration,C=w.easing,A=C===void 0?"ease":C,E=w.style,k=w.properties,T=w.onAnimationEnd,P=N>0?l[N-1]:w,$=k||Object.keys(E);if(typeof A=="function"||A==="spring")return[].concat(hS(b),[i.runJSAnimation.bind(i,{from:P.style,to:E,duration:O,easing:A}),O]);var F=aI($,O,A),D=Ea(Ea(Ea({},P.style),E),{},{transition:F});return[].concat(hS(b),[D,O,T]).filter(ice)};return this.manager.start([d].concat(hS(l.reduce(x,[m,Math.max(g,u)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=tce());var i=a.begin,l=a.duration,u=a.attributeName,d=a.to,f=a.easing,m=a.onAnimationStart,p=a.onAnimationEnd,g=a.steps,x=a.children,j=this.manager;if(this.unSubscribe=j.subscribe(this.handleStyleChange),typeof f=="function"||typeof x=="function"||f==="spring"){this.runJSAnimation(a);return}if(g.length>1){this.runStepAnimation(a);return}var b=u?sf({},u,d):d,w=aI(Object.keys(b),l,f);j.start([m,i,Ea(Ea({},b),{},{transition:w}),l,p])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var l=a.duration;a.attributeName,a.easing;var u=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var d=Tce(a,Ace),f=y.Children.count(i),m=this.state.style;if(typeof i=="function")return i(m);if(!u||f===0||l<=0)return i;var p=function(x){var j=x.props,b=j.style,w=b===void 0?{}:b,N=j.className,O=y.cloneElement(x,Ea(Ea({},d),{},{style:Ea(Ea({},w),m),className:N}));return O};return f===1?p(y.Children.only(i)):W.createElement("div",null,y.Children.map(i,function(g){return p(g)}))}}]),n})(y.PureComponent);hi.displayName="Animate";hi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};hi.propTypes={from:yt.oneOfType([yt.object,yt.string]),to:yt.oneOfType([yt.object,yt.string]),attributeName:yt.string,duration:yt.number,begin:yt.number,easing:yt.oneOfType([yt.string,yt.func]),steps:yt.arrayOf(yt.shape({duration:yt.number.isRequired,style:yt.object.isRequired,easing:yt.oneOfType([yt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),yt.func]),properties:yt.arrayOf("string"),onAnimationEnd:yt.func})),children:yt.oneOfType([yt.node,yt.func]),isActive:yt.bool,canBegin:yt.bool,onAnimationEnd:yt.func,shouldReAnimate:yt.bool,onAnimationStart:yt.func,onAnimationReStart:yt.func};function Xf(e){"@babel/helpers - typeof";return Xf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xf(e)}function Gv(){return Gv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?1:-1,d=r>=0?1:-1,f=a>=0&&r>=0||a<0&&r<0?1:0,m;if(l>0&&i instanceof Array){for(var p=[0,0,0,0],g=0,x=4;gl?l:i[g];m="M".concat(t,",").concat(n+u*p[0]),p[0]>0&&(m+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(f,",").concat(t+d*p[0],",").concat(n)),m+="L ".concat(t+r-d*p[1],",").concat(n),p[1]>0&&(m+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(f,`, - `).concat(t+r,",").concat(n+u*p[1])),m+="L ".concat(t+r,",").concat(n+a-u*p[2]),p[2]>0&&(m+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(f,`, - `).concat(t+r-d*p[2],",").concat(n+a)),m+="L ".concat(t+d*p[3],",").concat(n+a),p[3]>0&&(m+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(f,`, - `).concat(t,",").concat(n+a-u*p[3])),m+="Z"}else if(l>0&&i===+i&&i>0){var j=Math.min(l,i);m="M ".concat(t,",").concat(n+u*j,` - A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+d*j,",").concat(n,` - L `).concat(t+r-d*j,",").concat(n,` - A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r,",").concat(n+u*j,` - L `).concat(t+r,",").concat(n+a-u*j,` - A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r-d*j,",").concat(n+a,` - L `).concat(t+d*j,",").concat(n+a,` - A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t,",").concat(n+a-u*j," Z")}else m="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return m},Zce=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,i=n.x,l=n.y,u=n.width,d=n.height;if(Math.abs(u)>0&&Math.abs(d)>0){var f=Math.min(i,i+u),m=Math.max(i,i+u),p=Math.min(l,l+d),g=Math.max(l,l+d);return r>=f&&r<=m&&a>=p&&a<=g}return!1},Qce={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},PC=function(t){var n=fI(fI({},Qce),t),r=y.useRef(),a=y.useState(-1),i=Uce(a,2),l=i[0],u=i[1];y.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var A=r.current.getTotalLength();A&&u(A)}catch{}},[]);var d=n.x,f=n.y,m=n.width,p=n.height,g=n.radius,x=n.className,j=n.animationEasing,b=n.animationDuration,w=n.animationBegin,N=n.isAnimationActive,O=n.isUpdateAnimationActive;if(d!==+d||f!==+f||m!==+m||p!==+p||m===0||p===0)return null;var C=Ye("recharts-rectangle",x);return O?W.createElement(hi,{canBegin:l>0,from:{width:m,height:p,x:d,y:f},to:{width:m,height:p,x:d,y:f},duration:b,animationEasing:j,isActive:O},function(A){var E=A.width,k=A.height,T=A.x,P=A.y;return W.createElement(hi,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:b,isActive:N,easing:j},W.createElement("path",Gv({},Be(n,!0),{className:C,d:hI(T,P,E,k,g),ref:r})))}):W.createElement("path",Gv({},Be(n,!0),{className:C,d:hI(d,f,m,p,g)}))},Jce=["points","className","baseLinePoints","connectNulls"];function Dc(){return Dc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function mI(e){return iue(e)||aue(e)||rue(e)||nue()}function nue(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rue(e,t){if(e){if(typeof e=="string")return dN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dN(e,t)}}function aue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function iue(e){if(Array.isArray(e))return dN(e)}function dN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){pI(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),pI(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},bf=function(t,n){var r=oue(t);n&&(r=[r.reduce(function(i,l){return[].concat(mI(i),mI(l))},[])]);var a=r.map(function(i){return i.reduce(function(l,u,d){return"".concat(l).concat(d===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},sue=function(t,n,r){var a=bf(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(bf(n.reverse(),r).slice(1))},lue=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,l=eue(t,Jce);if(!n||!n.length)return null;var u=Ye("recharts-polygon",r);if(a&&a.length){var d=l.stroke&&l.stroke!=="none",f=sue(n,a,i);return W.createElement("g",{className:u},W.createElement("path",Dc({},Be(l,!0),{fill:f.slice(-1)==="Z"?l.fill:"none",stroke:"none",d:f})),d?W.createElement("path",Dc({},Be(l,!0),{fill:"none",d:bf(n,i)})):null,d?W.createElement("path",Dc({},Be(l,!0),{fill:"none",d:bf(a,i)})):null)}var m=bf(n,i);return W.createElement("path",Dc({},Be(l,!0),{fill:m.slice(-1)==="Z"?l.fill:"none",className:u,d:m}))};function fN(){return fN=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var vue=function(t,n,r,a,i,l){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(l,",").concat(n,"h").concat(r)},gue=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,l=t.top,u=l===void 0?0:l,d=t.left,f=d===void 0?0:d,m=t.width,p=m===void 0?0:m,g=t.height,x=g===void 0?0:g,j=t.className,b=mue(t,cue),w=uue({x:r,y:i,top:u,left:f,width:p,height:x},b);return!Ne(r)||!Ne(i)||!Ne(p)||!Ne(x)||!Ne(u)||!Ne(f)?null:W.createElement("path",hN({},Be(w,!0),{className:Ye("recharts-cross",j),d:vue(r,i,p,x,u,f)}))},mS,gI;function yue(){if(gI)return mS;gI=1;var e=oy(),t=Zz(),n=gi();function r(a,i){return a&&a.length?e(a,n(i,2),t):void 0}return mS=r,mS}var xue=yue();const bue=wt(xue);var pS,yI;function wue(){if(yI)return pS;yI=1;var e=oy(),t=gi(),n=Qz();function r(a,i){return a&&a.length?e(a,t(i,2),n):void 0}return pS=r,pS}var jue=wue();const Sue=wt(jue);var _ue=["cx","cy","angle","ticks","axisLine"],Nue=["ticks","tick","angle","tickFormatter","stroke"];function cu(e){"@babel/helpers - typeof";return cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cu(e)}function wf(){return wf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Oue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Cue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wI(e,t){for(var n=0;n_I?l=a==="outer"?"start":"end":i<-_I?l=a==="outer"?"end":"start":l="middle",l}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,l=r.radius,u=r.axisLine,d=r.axisLineType,f=Ds(Ds({},Be(this.props,!1)),{},{fill:"none"},Be(u,!1));if(d==="circle")return W.createElement(dy,Bs({className:"recharts-polar-angle-axis-line"},f,{cx:a,cy:i,r:l}));var m=this.props.ticks,p=m.map(function(g){return Bt(a,i,l,g.coordinate)});return W.createElement(lue,Bs({className:"recharts-polar-angle-axis-line"},f,{points:p}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,l=a.tick,u=a.tickLine,d=a.tickFormatter,f=a.stroke,m=Be(this.props,!1),p=Be(l,!1),g=Ds(Ds({},m),{},{fill:"none"},Be(u,!1)),x=i.map(function(j,b){var w=r.getTickLineCoord(j),N=r.getTickTextAnchor(j),O=Ds(Ds(Ds({textAnchor:N},m),{},{stroke:"none",fill:f},p),{},{index:b,payload:j,x:w.x2,y:w.y2});return W.createElement(ft,Bs({className:Ye("recharts-polar-angle-axis-tick",O6(l)),key:"tick-".concat(j.coordinate)},ol(r.props,j,b)),u&&W.createElement("line",Bs({className:"recharts-polar-angle-axis-tick-line"},g,w)),l&&t.renderTickItem(l,O,d?d(j.value,b):j.value))});return W.createElement(ft,{className:"recharts-polar-angle-axis-ticks"},x)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.radius,l=r.axisLine;return i<=0||!a||!a.length?null:W.createElement(ft,{className:Ye("recharts-polar-angle-axis",this.props.className)},l&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var l;return W.isValidElement(r)?l=W.cloneElement(r,a):We(r)?l=r(a):l=W.createElement(sl,Bs({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),l}}])})(y.PureComponent);my(py,"displayName","PolarAngleAxis");my(py,"axisType","angleAxis");my(py,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var vS,NI;function Fue(){if(NI)return vS;NI=1;var e=XB(),t=e(Object.getPrototypeOf,Object);return vS=t,vS}var gS,OI;function Uue(){if(OI)return gS;OI=1;var e=io(),t=Fue(),n=oo(),r="[object Object]",a=Function.prototype,i=Object.prototype,l=a.toString,u=i.hasOwnProperty,d=l.call(Object);function f(m){if(!n(m)||e(m)!=r)return!1;var p=t(m);if(p===null)return!0;var g=u.call(p,"constructor")&&p.constructor;return typeof g=="function"&&g instanceof g&&l.call(g)==d}return gS=f,gS}var Hue=Uue();const Wue=wt(Hue);var yS,CI;function Vue(){if(CI)return yS;CI=1;var e=io(),t=oo(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return yS=r,yS}var Gue=Vue();const Yue=wt(Gue);function Qf(e){"@babel/helpers - typeof";return Qf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qf(e)}function Xv(){return Xv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:g,x:d,y:f},to:{upperWidth:m,lowerWidth:p,height:g,x:d,y:f},duration:b,animationEasing:j,isActive:N},function(C){var A=C.upperWidth,E=C.lowerWidth,k=C.height,T=C.x,P=C.y;return W.createElement(hi,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:b,easing:j},W.createElement("path",Xv({},Be(n,!0),{className:O,d:kI(T,P,A,E,k),ref:r})))}):W.createElement("g",null,W.createElement("path",Xv({},Be(n,!0),{className:O,d:kI(d,f,m,p,g)})))},ide=["option","shapeType","propTransformer","activeClassName","isActive"];function Jf(e){"@babel/helpers - typeof";return Jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jf(e)}function ode(e,t){if(e==null)return{};var n=sde(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sde(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function PI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Zv(e){for(var t=1;t0?Qr(C,"paddingAngle",0):0;if(E){var T=Kr(E.endAngle-E.startAngle,C.endAngle-C.startAngle),P=It(It({},C),{},{startAngle:O+k,endAngle:O+T(b)+k});w.push(P),O=P.endAngle}else{var $=C.endAngle,F=C.startAngle,D=Kr(0,$-F),U=D(b),V=It(It({},C),{},{startAngle:O+k,endAngle:O+U+k});w.push(V),O=V.endAngle}}),W.createElement(ft,null,r.renderSectorsStatically(w))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var l=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[l].focus(),a.setState({sectorToFocus:l});break}case"ArrowRight":{var u=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[u].focus(),a.setState({sectorToFocus:u});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,i=r.isAnimationActive,l=this.state.prevSectors;return i&&a&&a.length&&(!l||!Th(l,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,a=this.props,i=a.hide,l=a.sectors,u=a.className,d=a.label,f=a.cx,m=a.cy,p=a.innerRadius,g=a.outerRadius,x=a.isAnimationActive,j=this.state.isAnimationFinished;if(i||!l||!l.length||!Ne(f)||!Ne(m)||!Ne(p)||!Ne(g))return null;var b=Ye("recharts-pie",u);return W.createElement(ft,{tabIndex:this.props.rootTabIndex,className:b,ref:function(N){r.pieRef=N}},this.renderSectors(),d&&this.renderLabels(l),Tn.renderCallByParent(this.props,null,!1),(!x||j)&&Zi.renderCallByParent(this.props,l,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return a.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:r.sectors!==a.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,a){return r>a?"start":r=360?O:O-1)*d,A=w-O*x-C,E=a.reduce(function(P,$){var F=wn($,N,0);return P+(Ne(F)?F:0)},0),k;if(E>0){var T;k=a.map(function(P,$){var F=wn(P,N,0),D=wn(P,m,$),U=(Ne(F)?F:0)/E,V;$?V=T.endAngle+vr(b)*d*(F!==0?1:0):V=l;var H=V+vr(b)*((F!==0?x:0)+U*A),G=(V+H)/2,L=(j.innerRadius+j.outerRadius)/2,R=[{name:D,value:F,payload:P,dataKey:N,type:g}],q=Bt(j.cx,j.cy,L,G);return T=It(It(It({percent:U,cornerRadius:i,name:D,tooltipPayload:R,midAngle:G,middleRadius:L,tooltipPosition:q},P),j),{},{value:wn(P,N),startAngle:V,endAngle:H,payload:P,paddingAngle:vr(b)*d}),T})}return It(It({},j),{},{sectors:k,data:a})});var xS,$I;function Ede(){if($I)return xS;$I=1;var e=Math.ceil,t=Math.max;function n(r,a,i,l){for(var u=-1,d=t(e((a-r)/(i||1)),0),f=Array(d);d--;)f[l?d:++u]=r,r+=i;return f}return xS=n,xS}var bS,II;function H6(){if(II)return bS;II=1;var e=fz(),t=1/0,n=17976931348623157e292;function r(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var i=a<0?-1:1;return i*n}return a===a?a:0}return bS=r,bS}var wS,LI;function Ade(){if(LI)return wS;LI=1;var e=Ede(),t=Qg(),n=H6();function r(a){return function(i,l,u){return u&&typeof u!="number"&&t(i,l,u)&&(l=u=void 0),i=n(i),l===void 0?(l=i,i=0):l=n(l),u=u===void 0?i0&&r.handleDrag(a.changedTouches[0])}),Wr(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,i=a.endIndex,l=a.onDragEnd,u=a.startIndex;l?.({endIndex:i,startIndex:u})}),r.detachDragEndListener()}),Wr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Wr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Wr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Wr(r,"handleSlideDragStart",function(a){var i=HI(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return qde(t,e),Ide(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,i=r.endX,l=this.state.scaleValues,u=this.props,d=u.gap,f=u.data,m=f.length-1,p=Math.min(a,i),g=Math.max(a,i),x=t.getIndexInRange(l,p),j=t.getIndexInRange(l,g);return{startIndex:x-x%d,endIndex:j===m?m:j-j%d}}},{key:"getTextOfTick",value:function(r){var a=this.props,i=a.data,l=a.tickFormatter,u=a.dataKey,d=wn(i[r],u,r);return We(l)?l(d,r):d}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,i=a.slideMoveStartX,l=a.startX,u=a.endX,d=this.props,f=d.x,m=d.width,p=d.travellerWidth,g=d.startIndex,x=d.endIndex,j=d.onChange,b=r.pageX-i;b>0?b=Math.min(b,f+m-p-u,f+m-p-l):b<0&&(b=Math.max(b,f-l,f-u));var w=this.getIndex({startX:l+b,endX:u+b});(w.startIndex!==g||w.endIndex!==x)&&j&&j(w),this.setState({startX:l+b,endX:u+b,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var i=HI(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,i=a.brushMoveStartX,l=a.movingTravellerId,u=a.endX,d=a.startX,f=this.state[l],m=this.props,p=m.x,g=m.width,x=m.travellerWidth,j=m.onChange,b=m.gap,w=m.data,N={startX:this.state.startX,endX:this.state.endX},O=r.pageX-i;O>0?O=Math.min(O,p+g-x-f):O<0&&(O=Math.max(O,p-f)),N[l]=f+O;var C=this.getIndex(N),A=C.startIndex,E=C.endIndex,k=function(){var P=w.length-1;return l==="startX"&&(u>d?A%b===0:E%b===0)||ud?E%b===0:A%b===0)||u>d&&E===P};this.setState(Wr(Wr({},l,f+O),"brushMoveStartX",r.pageX),function(){j&&k()&&j(C)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var i=this,l=this.state,u=l.scaleValues,d=l.startX,f=l.endX,m=this.state[a],p=u.indexOf(m);if(p!==-1){var g=p+r;if(!(g===-1||g>=u.length)){var x=u[g];a==="startX"&&x>=f||a==="endX"&&x<=d||this.setState(Wr({},a,x),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,i=r.y,l=r.width,u=r.height,d=r.fill,f=r.stroke;return W.createElement("rect",{stroke:f,fill:d,x:a,y:i,width:l,height:u})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,i=r.y,l=r.width,u=r.height,d=r.data,f=r.children,m=r.padding,p=y.Children.only(f);return p?W.cloneElement(p,{x:a,y:i,width:l,height:u,margin:m,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(r,a){var i,l,u=this,d=this.props,f=d.y,m=d.travellerWidth,p=d.height,g=d.traveller,x=d.ariaLabel,j=d.data,b=d.startIndex,w=d.endIndex,N=Math.max(r,this.props.x),O=SS(SS({},Be(this.props,!1)),{},{x:N,y:f,width:m,height:p}),C=x||"Min value: ".concat((i=j[b])===null||i===void 0?void 0:i.name,", Max value: ").concat((l=j[w])===null||l===void 0?void 0:l.name);return W.createElement(ft,{tabIndex:0,role:"slider","aria-label":C,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(E){["ArrowLeft","ArrowRight"].includes(E.key)&&(E.preventDefault(),E.stopPropagation(),u.handleTravellerMoveKeyboard(E.key==="ArrowRight"?1:-1,a))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(g,O))}},{key:"renderSlide",value:function(r,a){var i=this.props,l=i.y,u=i.height,d=i.stroke,f=i.travellerWidth,m=Math.min(r,a)+f,p=Math.max(Math.abs(a-r)-f,0);return W.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:d,fillOpacity:.2,x:m,y:l,width:p,height:u})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,i=r.endIndex,l=r.y,u=r.height,d=r.travellerWidth,f=r.stroke,m=this.state,p=m.startX,g=m.endX,x=5,j={pointerEvents:"none",fill:f};return W.createElement(ft,{className:"recharts-brush-texts"},W.createElement(sl,eg({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,g)-x,y:l+u/2},j),this.getTextOfTick(a)),W.createElement(sl,eg({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,g)+d+x,y:l+u/2},j),this.getTextOfTick(i)))}},{key:"render",value:function(){var r=this.props,a=r.data,i=r.className,l=r.children,u=r.x,d=r.y,f=r.width,m=r.height,p=r.alwaysShowText,g=this.state,x=g.startX,j=g.endX,b=g.isTextActive,w=g.isSlideMoving,N=g.isTravellerMoving,O=g.isTravellerFocused;if(!a||!a.length||!Ne(u)||!Ne(d)||!Ne(f)||!Ne(m)||f<=0||m<=0)return null;var C=Ye("recharts-brush",i),A=W.Children.count(l)===1,E=Dde("userSelect","none");return W.createElement(ft,{className:C,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:E},this.renderBackground(),A&&this.renderPanorama(),this.renderSlide(x,j),this.renderTravellerLayer(x,"startX"),this.renderTravellerLayer(j,"endX"),(b||w||N||O||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,i=r.y,l=r.width,u=r.height,d=r.stroke,f=Math.floor(i+u/2)-1;return W.createElement(W.Fragment,null,W.createElement("rect",{x:a,y:i,width:l,height:u,fill:d,stroke:"none"}),W.createElement("line",{x1:a+1,y1:f,x2:a+l-1,y2:f,fill:"none",stroke:"#fff"}),W.createElement("line",{x1:a+1,y1:f+2,x2:a+l-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var i;return W.isValidElement(r)?i=W.cloneElement(r,a):We(r)?i=r(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(r,a){var i=r.data,l=r.width,u=r.x,d=r.travellerWidth,f=r.updateId,m=r.startIndex,p=r.endIndex;if(i!==a.prevData||f!==a.prevUpdateId)return SS({prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:u,prevWidth:l},i&&i.length?Ude({data:i,width:l,x:u,travellerWidth:d,startIndex:m,endIndex:p}):{scale:null,scaleValues:null});if(a.scale&&(l!==a.prevWidth||u!==a.prevX||d!==a.prevTravellerWidth)){a.scale.range([u,u+l-d]);var g=a.scale.domain().map(function(x){return a.scale(x)});return{prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:u,prevWidth:l,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:g}}return null}},{key:"getIndexInRange",value:function(r,a){for(var i=r.length,l=0,u=i-1;u-l>1;){var d=Math.floor((l+u)/2);r[d]>a?u=d:l=d}return a>=r[u]?u:l}}])})(y.PureComponent);Wr(hu,"displayName","Brush");Wr(hu,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var _S,WI;function Hde(){if(WI)return _S;WI=1;var e=aC();function t(n,r){var a;return e(n,function(i,l,u){return a=r(i,l,u),!a}),!!a}return _S=t,_S}var NS,VI;function Wde(){if(VI)return NS;VI=1;var e=UB(),t=gi(),n=Hde(),r=Rr(),a=Qg();function i(l,u,d){var f=r(l)?e:n;return d&&a(l,u,d)&&(u=void 0),f(l,t(u,3))}return NS=i,NS}var Vde=Wde();const Gde=wt(Vde);var ci=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},OS,GI;function Yde(){if(GI)return OS;GI=1;var e=sz();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return OS=t,OS}var CS,YI;function Kde(){if(YI)return CS;YI=1;var e=Yde(),t=iz(),n=gi();function r(a,i){var l={};return i=n(i,3),t(a,function(u,d,f){e(l,d,i(u,d,f))}),l}return CS=r,CS}var Xde=Kde();const Zde=wt(Xde);var ES,KI;function Qde(){if(KI)return ES;KI=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sfe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function lfe(e,t){var n=e.x,r=e.y,a=ofe(e,nfe),i="".concat(n),l=parseInt(i,10),u="".concat(r),d=parseInt(u,10),f="".concat(t.height||a.height),m=parseInt(f,10),p="".concat(t.width||a.width),g=parseInt(p,10);return ef(ef(ef(ef(ef({},t),a),l?{x:l}:{}),d?{y:d}:{}),{},{height:m,width:g,name:t.name,radius:t.radius})}function JI(e){return W.createElement(q6,yN({shapeType:"rectangle",propTransformer:lfe,activeClassName:"recharts-active-bar"},e))}var cfe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var i=Ne(r)||PQ(r);return i?t(r,a):(i||sr(!1),n)}},ufe=["value","background"],K6;function mu(e){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mu(e)}function dfe(e,t){if(e==null)return{};var n=ffe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ffe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ng(){return ng=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(G)0&&Math.abs(H)0&&(V=Math.min((te||0)-(H[oe-1]||0),V))}),Number.isFinite(V)){var G=V/U,L=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(T=G*L/2),b.padding==="no-gap"){var R=gr(t.barCategoryGap,G*L),q=G*L/2;T=q-R-(q-R)/L*R}}}a==="xAxis"?P=[r.left+(C.left||0)+(T||0),r.left+r.width-(C.right||0)-(T||0)]:a==="yAxis"?P=d==="horizontal"?[r.top+r.height-(C.bottom||0),r.top+(C.top||0)]:[r.top+(C.top||0)+(T||0),r.top+r.height-(C.bottom||0)-(T||0)]:P=b.range,E&&(P=[P[1],P[0]]);var K=x6(b,i,g),ee=K.scale,I=K.realScaleType;ee.domain(N).range(P),b6(ee);var B=w6(ee,Pa(Pa({},b),{},{realScaleType:I}));a==="xAxis"?(D=w==="top"&&!A||w==="bottom"&&A,$=r.left,F=p[k]-D*b.height):a==="yAxis"&&(D=w==="left"&&!A||w==="right"&&A,$=p[k]-D*b.width,F=r.top);var Y=Pa(Pa(Pa({},b),B),{},{realScaleType:I,x:$,y:F,scale:ee,width:a==="xAxis"?r.width:b.width,height:a==="yAxis"?r.height:b.height});return Y.bandSize=zv(Y,B),!b.hide&&a==="xAxis"?p[k]+=(D?-1:1)*Y.height:b.hide||(p[k]+=(D?-1:1)*Y.width),Pa(Pa({},x),{},yy({},j,Y))},{})},eq=function(t,n){var r=t.x,a=t.y,i=n.x,l=n.y;return{x:Math.min(r,i),y:Math.min(a,l),width:Math.abs(i-r),height:Math.abs(l-a)}},Sfe=function(t){var n=t.x1,r=t.y1,a=t.x2,i=t.y2;return eq({x:n,y:r},{x:a,y:i})},tq=(function(){function e(t){bfe(this,e),this.scale=t}return wfe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,i=r.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(n)+u}default:return this.scale(n)}if(a){var d=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+d}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],i=r[r.length-1];return a<=i?n>=a&&n<=i:n>=i&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])})();yy(tq,"EPS",1e-4);var MC=function(t){var n=Object.keys(t).reduce(function(r,a){return Pa(Pa({},r),{},yy({},a,tq.create(t[a])))},{});return Pa(Pa({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=i.bandAware,u=i.position;return Zde(a,function(d,f){return n[f].apply(d,{bandAware:l,position:u})})},isInRange:function(a){return Y6(a,function(i,l){return n[l].isInRange(i)})}})};function _fe(e){return(e%180+180)%180}var Nfe=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=_fe(a),l=i*Math.PI/180,u=Math.atan(r/n),d=l>u&&l-1?d[f?i[m]:m]:void 0}}return kS=r,kS}var PS,iL;function Cfe(){if(iL)return PS;iL=1;var e=H6();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return PS=t,PS}var MS,oL;function Efe(){if(oL)return MS;oL=1;var e=ez(),t=gi(),n=Cfe(),r=Math.max;function a(i,l,u){var d=i==null?0:i.length;if(!d)return-1;var f=u==null?0:n(u);return f<0&&(f=r(d+f,0)),e(i,t(l,3),f)}return MS=a,MS}var RS,sL;function Afe(){if(sL)return RS;sL=1;var e=Ofe(),t=Efe(),n=e(t);return RS=n,RS}var Tfe=Afe();const kfe=wt(Tfe);var Pfe=vB();const Mfe=wt(Pfe);var Rfe=Mfe(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),RC=y.createContext(void 0),DC=y.createContext(void 0),nq=y.createContext(void 0),rq=y.createContext({}),aq=y.createContext(void 0),iq=y.createContext(0),oq=y.createContext(0),lL=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,i=n.offset,l=t.clipPathId,u=t.children,d=t.width,f=t.height,m=Rfe(i);return W.createElement(RC.Provider,{value:r},W.createElement(DC.Provider,{value:a},W.createElement(rq.Provider,{value:i},W.createElement(nq.Provider,{value:m},W.createElement(aq.Provider,{value:l},W.createElement(iq.Provider,{value:f},W.createElement(oq.Provider,{value:d},u)))))))},Dfe=function(){return y.useContext(aq)},sq=function(t){var n=y.useContext(RC);n==null&&sr(!1);var r=n[t];return r==null&&sr(!1),r},$fe=function(){var t=y.useContext(RC);return Bo(t)},Ife=function(){var t=y.useContext(DC),n=kfe(t,function(r){return Y6(r.domain,Number.isFinite)});return n||Bo(t)},lq=function(t){var n=y.useContext(DC);n==null&&sr(!1);var r=n[t];return r==null&&sr(!1),r},Lfe=function(){var t=y.useContext(nq);return t},Bfe=function(){return y.useContext(rq)},$C=function(){return y.useContext(oq)},IC=function(){return y.useContext(iq)};function pu(e){"@babel/helpers - typeof";return pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pu(e)}function zfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qfe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*a)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-a)<=0}function jhe(e,t){return pq(e,t+1)}function She(e,t,n,r,a){for(var i=(r||[]).slice(),l=t.start,u=t.end,d=0,f=1,m=l,p=function(){var j=r?.[d];if(j===void 0)return{v:pq(r,f)};var b=d,w,N=function(){return w===void 0&&(w=n(j,b)),w},O=j.coordinate,C=d===0||sg(e,O,N,m,u);C||(d=0,m=l,f+=1),C&&(m=O+e*(N()/2+a),d+=f)},g;f<=i.length;)if(g=p(),g)return g.v;return[]}function ah(e){"@babel/helpers - typeof";return ah=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ah(e)}function vL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rr(e){for(var t=1;t0?x.coordinate-w*e:x.coordinate})}else i[g]=x=rr(rr({},x),{},{tickCoord:x.coordinate});var N=sg(e,x.tickCoord,b,u,d);N&&(d=x.tickCoord-e*(b()/2+a),i[g]=rr(rr({},x),{},{isShow:!0}))},m=l-1;m>=0;m--)f(m);return i}function Ehe(e,t,n,r,a,i){var l=(r||[]).slice(),u=l.length,d=t.start,f=t.end;if(i){var m=r[u-1],p=n(m,u-1),g=e*(m.coordinate+e*p/2-f);l[u-1]=m=rr(rr({},m),{},{tickCoord:g>0?m.coordinate-g*e:m.coordinate});var x=sg(e,m.tickCoord,function(){return p},d,f);x&&(f=m.tickCoord-e*(p/2+a),l[u-1]=rr(rr({},m),{},{isShow:!0}))}for(var j=i?u-1:u,b=function(O){var C=l[O],A,E=function(){return A===void 0&&(A=n(C,O)),A};if(O===0){var k=e*(C.coordinate-e*E()/2-d);l[O]=C=rr(rr({},C),{},{tickCoord:k<0?C.coordinate-k*e:C.coordinate})}else l[O]=C=rr(rr({},C),{},{tickCoord:C.coordinate});var T=sg(e,C.tickCoord,E,d,f);T&&(d=C.tickCoord+e*(E()/2+a),l[O]=rr(rr({},C),{},{isShow:!0}))},w=0;w=2?vr(a[1].coordinate-a[0].coordinate):1,N=whe(i,w,x);return d==="equidistantPreserveStart"?She(w,N,b,a,l):(d==="preserveStart"||d==="preserveStartEnd"?g=Ehe(w,N,b,a,l,d==="preserveStartEnd"):g=Che(w,N,b,a,l),g.filter(function(O){return O.isShow}))}var Ahe=["viewBox"],The=["viewBox"],khe=["ticks"];function yu(e){"@babel/helpers - typeof";return yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yu(e)}function Ic(){return Ic=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Phe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Mhe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yL(e,t){for(var n=0;n0?d(this.props):d(x)),l<=0||u<=0||!j||!j.length?null:W.createElement(ft,{className:Ye("recharts-cartesian-axis",f),ref:function(w){r.layerReference=w}},i&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),Tn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,i){var l,u=Ye(a.className,"recharts-cartesian-axis-tick-value");return W.isValidElement(r)?l=W.cloneElement(r,xn(xn({},a),{},{className:u})):We(r)?l=r(xn(xn({},a),{},{className:u})):l=W.createElement(sl,Ic({},a,{className:"recharts-cartesian-axis-tick-value"}),i),l}}])})(y.Component);qC(qu,"displayName","CartesianAxis");qC(qu,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var zhe=["x1","y1","x2","y2","key"],qhe=["offset"];function cl(e){"@babel/helpers - typeof";return cl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cl(e)}function xL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ir(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Whe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Vhe=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,a=t.x,i=t.y,l=t.width,u=t.height,d=t.ry;return W.createElement("rect",{x:a,y:i,ry:d,width:l,height:u,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function yq(e,t){var n;if(W.isValidElement(e))n=W.cloneElement(e,t);else if(We(e))n=e(t);else{var r=t.x1,a=t.y1,i=t.x2,l=t.y2,u=t.key,d=bL(t,zhe),f=Be(d,!1);f.offset;var m=bL(f,qhe);n=W.createElement("line",Hs({},m,{x1:r,y1:a,x2:i,y2:l,fill:"none",key:u}))}return n}function Ghe(e){var t=e.x,n=e.width,r=e.horizontal,a=r===void 0?!0:r,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var l=i.map(function(u,d){var f=ir(ir({},e),{},{x1:t,y1:u,x2:t+n,y2:u,key:"line-".concat(d),index:d});return yq(a,f)});return W.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function Yhe(e){var t=e.y,n=e.height,r=e.vertical,a=r===void 0?!0:r,i=e.verticalPoints;if(!a||!i||!i.length)return null;var l=i.map(function(u,d){var f=ir(ir({},e),{},{x1:u,y1:t,x2:u,y2:t+n,key:"line-".concat(d),index:d});return yq(a,f)});return W.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function Khe(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,a=e.y,i=e.width,l=e.height,u=e.horizontalPoints,d=e.horizontal,f=d===void 0?!0:d;if(!f||!t||!t.length)return null;var m=u.map(function(g){return Math.round(g+a-a)}).sort(function(g,x){return g-x});a!==m[0]&&m.unshift(0);var p=m.map(function(g,x){var j=!m[x+1],b=j?a+l-g:m[x+1]-g;if(b<=0)return null;var w=x%t.length;return W.createElement("rect",{key:"react-".concat(x),y:g,x:r,height:b,width:i,stroke:"none",fill:t[w],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return W.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function Xhe(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,a=e.fillOpacity,i=e.x,l=e.y,u=e.width,d=e.height,f=e.verticalPoints;if(!n||!r||!r.length)return null;var m=f.map(function(g){return Math.round(g+i-i)}).sort(function(g,x){return g-x});i!==m[0]&&m.unshift(0);var p=m.map(function(g,x){var j=!m[x+1],b=j?i+u-g:m[x+1]-g;if(b<=0)return null;var w=x%r.length;return W.createElement("rect",{key:"react-".concat(x),x:g,y:l,width:b,height:d,stroke:"none",fill:r[w],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return W.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var Zhe=function(t,n){var r=t.xAxis,a=t.width,i=t.height,l=t.offset;return y6(zC(ir(ir(ir({},qu.defaultProps),r),{},{ticks:Wi(r,!0),viewBox:{x:0,y:0,width:a,height:i}})),l.left,l.left+l.width,n)},Qhe=function(t,n){var r=t.yAxis,a=t.width,i=t.height,l=t.offset;return y6(zC(ir(ir(ir({},qu.defaultProps),r),{},{ticks:Wi(r,!0),viewBox:{x:0,y:0,width:a,height:i}})),l.top,l.top+l.height,n)},bc={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function lf(e){var t,n,r,a,i,l,u=$C(),d=IC(),f=Bfe(),m=ir(ir({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:bc.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:bc.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:bc.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:bc.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:bc.vertical,verticalFill:(l=e.verticalFill)!==null&&l!==void 0?l:bc.verticalFill,x:Ne(e.x)?e.x:f.left,y:Ne(e.y)?e.y:f.top,width:Ne(e.width)?e.width:f.width,height:Ne(e.height)?e.height:f.height}),p=m.x,g=m.y,x=m.width,j=m.height,b=m.syncWithTicks,w=m.horizontalValues,N=m.verticalValues,O=$fe(),C=Ife();if(!Ne(x)||x<=0||!Ne(j)||j<=0||!Ne(p)||p!==+p||!Ne(g)||g!==+g)return null;var A=m.verticalCoordinatesGenerator||Zhe,E=m.horizontalCoordinatesGenerator||Qhe,k=m.horizontalPoints,T=m.verticalPoints;if((!k||!k.length)&&We(E)){var P=w&&w.length,$=E({yAxis:C?ir(ir({},C),{},{ticks:P?w:C.ticks}):void 0,width:u,height:d,offset:f},P?!0:b);$a(Array.isArray($),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(cl($),"]")),Array.isArray($)&&(k=$)}if((!T||!T.length)&&We(A)){var F=N&&N.length,D=A({xAxis:O?ir(ir({},O),{},{ticks:F?N:O.ticks}):void 0,width:u,height:d,offset:f},F?!0:b);$a(Array.isArray(D),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(cl(D),"]")),Array.isArray(D)&&(T=D)}return W.createElement("g",{className:"recharts-cartesian-grid"},W.createElement(Vhe,{fill:m.fill,fillOpacity:m.fillOpacity,x:m.x,y:m.y,width:m.width,height:m.height,ry:m.ry}),W.createElement(Ghe,Hs({},m,{offset:f,horizontalPoints:k,xAxis:O,yAxis:C})),W.createElement(Yhe,Hs({},m,{offset:f,verticalPoints:T,xAxis:O,yAxis:C})),W.createElement(Khe,Hs({},m,{horizontalPoints:k})),W.createElement(Xhe,Hs({},m,{verticalPoints:T})))}lf.displayName="CartesianGrid";var Jhe=["type","layout","connectNulls","ref"],eme=["key"];function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}function wL(e,t){if(e==null)return{};var n=tme(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tme(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function jf(){return jf=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);np){x=[].concat(wc(d.slice(0,j)),[p-b]);break}var w=x.length%2===0?[0,g]:[g];return[].concat(wc(t.repeat(d,m)),wc(x),w).map(function(N){return"".concat(N,"px")}).join(", ")}),Ma(n,"id",$u("recharts-line-")),Ma(n,"pathRef",function(l){n.mainCurve=l}),Ma(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Ma(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return dme(t,e),sme(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,l=i.points,u=i.xAxis,d=i.yAxis,f=i.layout,m=i.children,p=Jr(m,kh);if(!p)return null;var g=function(b,w){return{x:b.x,y:b.y,value:b.value,errorVal:wn(b.payload,w)}},x={clipPath:r?"url(#clipPath-".concat(a,")"):null};return W.createElement(ft,x,p.map(function(j){return W.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:l,xAxis:u,yAxis:d,layout:f,dataPointFormatter:g})}))}},{key:"renderDots",value:function(r,a,i){var l=this.props.isAnimationActive;if(l&&!this.state.isAnimationFinished)return null;var u=this.props,d=u.dot,f=u.points,m=u.dataKey,p=Be(this.props,!1),g=Be(d,!0),x=f.map(function(b,w){var N=Hr(Hr(Hr({key:"dot-".concat(w),r:3},p),g),{},{index:w,cx:b.x,cy:b.y,value:b.value,dataKey:m,payload:b.payload,points:f});return t.renderDotItem(d,N)}),j={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return W.createElement(ft,jf({className:"recharts-line-dots",key:"dots"},j),x)}},{key:"renderCurveStatically",value:function(r,a,i,l){var u=this.props,d=u.type,f=u.layout,m=u.connectNulls;u.ref;var p=wL(u,Jhe),g=Hr(Hr(Hr({},Be(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:r},l),{},{type:d,layout:f,connectNulls:m});return W.createElement(Uv,jf({},g,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,a){var i=this,l=this.props,u=l.points,d=l.strokeDasharray,f=l.isAnimationActive,m=l.animationBegin,p=l.animationDuration,g=l.animationEasing,x=l.animationId,j=l.animateNewValues,b=l.width,w=l.height,N=this.state,O=N.prevPoints,C=N.totalLength;return W.createElement(hi,{begin:m,duration:p,isActive:f,easing:g,from:{t:0},to:{t:1},key:"line-".concat(x),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(A){var E=A.t;if(O){var k=O.length/u.length,T=u.map(function(U,V){var H=Math.floor(V*k);if(O[H]){var G=O[H],L=Kr(G.x,U.x),R=Kr(G.y,U.y);return Hr(Hr({},U),{},{x:L(E),y:R(E)})}if(j){var q=Kr(b*2,U.x),K=Kr(w/2,U.y);return Hr(Hr({},U),{},{x:q(E),y:K(E)})}return Hr(Hr({},U),{},{x:U.x,y:U.y})});return i.renderCurveStatically(T,r,a)}var P=Kr(0,C),$=P(E),F;if(d){var D="".concat(d).split(/[,\s]+/gim).map(function(U){return parseFloat(U)});F=i.getStrokeDasharray($,C,D)}else F=i.generateSimpleStrokeDasharray(C,$);return i.renderCurveStatically(u,r,a,{strokeDasharray:F})})}},{key:"renderCurve",value:function(r,a){var i=this.props,l=i.points,u=i.isAnimationActive,d=this.state,f=d.prevPoints,m=d.totalLength;return u&&l&&l.length&&(!f&&m>0||!Th(f,l))?this.renderCurveWithAnimation(r,a):this.renderCurveStatically(l,r,a)}},{key:"render",value:function(){var r,a=this.props,i=a.hide,l=a.dot,u=a.points,d=a.className,f=a.xAxis,m=a.yAxis,p=a.top,g=a.left,x=a.width,j=a.height,b=a.isAnimationActive,w=a.id;if(i||!u||!u.length)return null;var N=this.state.isAnimationFinished,O=u.length===1,C=Ye("recharts-line",d),A=f&&f.allowDataOverflow,E=m&&m.allowDataOverflow,k=A||E,T=Ge(w)?this.id:w,P=(r=Be(l,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},$=P.r,F=$===void 0?3:$,D=P.strokeWidth,U=D===void 0?2:D,V=HQ(l)?l:{},H=V.clipDot,G=H===void 0?!0:H,L=F*2+U;return W.createElement(ft,{className:C},A||E?W.createElement("defs",null,W.createElement("clipPath",{id:"clipPath-".concat(T)},W.createElement("rect",{x:A?g:g-x/2,y:E?p:p-j/2,width:A?x:x*2,height:E?j:j*2})),!G&&W.createElement("clipPath",{id:"clipPath-dots-".concat(T)},W.createElement("rect",{x:g-L/2,y:p-L/2,width:x+L,height:j+L}))):null,!O&&this.renderCurve(k,T),this.renderErrorBar(k,T),(O||l)&&this.renderDots(k,G,T),(!b||N)&&Zi.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:a.curPoints}:r.points!==a.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,a){for(var i=r.length%2!==0?[].concat(wc(r),[0]):r,l=[],u=0;ue.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tpe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function npe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rpe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?l:t&&t.length&&Ne(a)&&Ne(i)?t.slice(a,i+1):[]};function Mq(e){return e==="number"?[0,"auto"]:void 0}var IN=function(t,n,r,a){var i=t.graphicalItems,l=t.tooltipAxis,u=Sy(n,t);return r<0||!i||!i.length||r>=u.length?null:i.reduce(function(d,f){var m,p=(m=f.props.data)!==null&&m!==void 0?m:n;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var g;if(l.dataKey&&!l.allowDuplicatedCategory){var x=p===void 0?u:p;g=pv(x,l.dataKey,a)}else g=p&&p[r]||u[r];return g?[].concat(Su(d),[S6(f,g)]):d},[])},TL=function(t,n,r,a){var i=a||{x:t.chartX,y:t.chartY},l=ppe(i,r),u=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,m=qoe(l,u,f,d);if(m>=0&&f){var p=f[m]&&f[m].value,g=IN(t,n,m,p),x=vpe(r,u,m,i);return{activeTooltipIndex:m,activeLabel:p,activePayload:g,activeCoordinate:x}}return null},gpe=function(t,n){var r=n.axes,a=n.graphicalItems,i=n.axisType,l=n.axisIdKey,u=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,m=t.layout,p=t.children,g=t.stackOffset,x=g6(m,i);return r.reduce(function(j,b){var w,N=b.type.defaultProps!==void 0?ye(ye({},b.type.defaultProps),b.props):b.props,O=N.type,C=N.dataKey,A=N.allowDataOverflow,E=N.allowDuplicatedCategory,k=N.scale,T=N.ticks,P=N.includeHidden,$=N[l];if(j[$])return j;var F=Sy(t.data,{graphicalItems:a.filter(function(B){var Y,te=l in B.props?B.props[l]:(Y=B.type.defaultProps)===null||Y===void 0?void 0:Y[l];return te===$}),dataStartIndex:d,dataEndIndex:f}),D=F.length,U,V,H;Ume(N.domain,A,O)&&(U=Z_(N.domain,null,A),x&&(O==="number"||k!=="auto")&&(H=yf(F,C,"category")));var G=Mq(O);if(!U||U.length===0){var L,R=(L=N.domain)!==null&&L!==void 0?L:G;if(C){if(U=yf(F,C,O),O==="category"&&x){var q=RQ(U);E&&q?(V=U,U=Jv(0,D)):E||(U=A4(R,U,b).reduce(function(B,Y){return B.indexOf(Y)>=0?B:[].concat(Su(B),[Y])},[]))}else if(O==="category")E?U=U.filter(function(B){return B!==""&&!Ge(B)}):U=A4(R,U,b).reduce(function(B,Y){return B.indexOf(Y)>=0||Y===""||Ge(Y)?B:[].concat(Su(B),[Y])},[]);else if(O==="number"){var K=Voe(F,a.filter(function(B){var Y,te,oe=l in B.props?B.props[l]:(Y=B.type.defaultProps)===null||Y===void 0?void 0:Y[l],xe="hide"in B.props?B.props.hide:(te=B.type.defaultProps)===null||te===void 0?void 0:te.hide;return oe===$&&(P||!xe)}),C,i,m);K&&(U=K)}x&&(O==="number"||k!=="auto")&&(H=yf(F,C,"category"))}else x?U=Jv(0,D):u&&u[$]&&u[$].hasStack&&O==="number"?U=g==="expand"?[0,1]:j6(u[$].stackGroups,d,f):U=v6(F,a.filter(function(B){var Y=l in B.props?B.props[l]:B.type.defaultProps[l],te="hide"in B.props?B.props.hide:B.type.defaultProps.hide;return Y===$&&(P||!te)}),O,m,!0);if(O==="number")U=RN(p,U,$,i,T),R&&(U=Z_(R,U,A));else if(O==="category"&&R){var ee=R,I=U.every(function(B){return ee.indexOf(B)>=0});I&&(U=ee)}}return ye(ye({},j),{},Fe({},$,ye(ye({},N),{},{axisType:i,domain:U,categoricalDomain:H,duplicateDomain:V,originalDomain:(w=N.domain)!==null&&w!==void 0?w:G,isCategorical:x,layout:m})))},{})},ype=function(t,n){var r=n.graphicalItems,a=n.Axis,i=n.axisType,l=n.axisIdKey,u=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,m=t.layout,p=t.children,g=Sy(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),x=g.length,j=g6(m,i),b=-1;return r.reduce(function(w,N){var O=N.type.defaultProps!==void 0?ye(ye({},N.type.defaultProps),N.props):N.props,C=O[l],A=Mq("number");if(!w[C]){b++;var E;return j?E=Jv(0,x):u&&u[C]&&u[C].hasStack?(E=j6(u[C].stackGroups,d,f),E=RN(p,E,C,i)):(E=Z_(A,v6(g,r.filter(function(k){var T,P,$=l in k.props?k.props[l]:(T=k.type.defaultProps)===null||T===void 0?void 0:T[l],F="hide"in k.props?k.props.hide:(P=k.type.defaultProps)===null||P===void 0?void 0:P.hide;return $===C&&!F}),"number",m),a.defaultProps.allowDataOverflow),E=RN(p,E,C,i)),ye(ye({},w),{},Fe({},C,ye(ye({axisType:i},a.defaultProps),{},{hide:!0,orientation:Qr(hpe,"".concat(i,".").concat(b%2),null),domain:E,originalDomain:A,isCategorical:j,layout:m})))}return w},{})},xpe=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,i=n.AxisComp,l=n.graphicalItems,u=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,m=t.children,p="".concat(a,"Id"),g=Jr(m,i),x={};return g&&g.length?x=gpe(t,{axes:g,graphicalItems:l,axisType:a,axisIdKey:p,stackGroups:u,dataStartIndex:d,dataEndIndex:f}):l&&l.length&&(x=ype(t,{Axis:i,graphicalItems:l,axisType:a,axisIdKey:p,stackGroups:u,dataStartIndex:d,dataEndIndex:f})),x},bpe=function(t){var n=Bo(t),r=Wi(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:iC(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:zv(n,r)}},kL=function(t){var n=t.children,r=t.defaultShowTooltip,a=Vr(n,hu),i=0,l=0;return t.data&&t.data.length!==0&&(l=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(l=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:l,activeTooltipIndex:-1,isTooltipActive:!!r}},wpe=function(t){return!t||!t.length?!1:t.some(function(n){var r=Ki(n&&n.type);return r&&r.indexOf("Bar")>=0})},PL=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},jpe=function(t,n){var r=t.props,a=t.graphicalItems,i=t.xAxisMap,l=i===void 0?{}:i,u=t.yAxisMap,d=u===void 0?{}:u,f=r.width,m=r.height,p=r.children,g=r.margin||{},x=Vr(p,hu),j=Vr(p,Xs),b=Object.keys(d).reduce(function(E,k){var T=d[k],P=T.orientation;return!T.mirror&&!T.hide?ye(ye({},E),{},Fe({},P,E[P]+T.width)):E},{left:g.left||0,right:g.right||0}),w=Object.keys(l).reduce(function(E,k){var T=l[k],P=T.orientation;return!T.mirror&&!T.hide?ye(ye({},E),{},Fe({},P,Qr(E,"".concat(P))+T.height)):E},{top:g.top||0,bottom:g.bottom||0}),N=ye(ye({},w),b),O=N.bottom;x&&(N.bottom+=x.props.height||hu.defaultProps.height),j&&n&&(N=Hoe(N,a,r,n));var C=f-N.left-N.right,A=m-N.top-N.bottom;return ye(ye({brushBottom:O},N),{},{width:Math.max(C,0),height:Math.max(A,0)})},Spe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},FC=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,l=t.validateTooltipEventTypes,u=l===void 0?["axis"]:l,d=t.axisComponents,f=t.legendContent,m=t.formatAxisMap,p=t.defaultProps,g=function(N,O){var C=O.graphicalItems,A=O.stackGroups,E=O.offset,k=O.updateId,T=O.dataStartIndex,P=O.dataEndIndex,$=N.barSize,F=N.layout,D=N.barGap,U=N.barCategoryGap,V=N.maxBarSize,H=PL(F),G=H.numericAxisName,L=H.cateAxisName,R=wpe(C),q=[];return C.forEach(function(K,ee){var I=Sy(N.data,{graphicalItems:[K],dataStartIndex:T,dataEndIndex:P}),B=K.type.defaultProps!==void 0?ye(ye({},K.type.defaultProps),K.props):K.props,Y=B.dataKey,te=B.maxBarSize,oe=B["".concat(G,"Id")],xe=B["".concat(L,"Id")],J={},ae=d.reduce(function(er,hr){var it=O["".concat(hr.axisType,"Map")],nt=B["".concat(hr.axisType,"Id")];it&&it[nt]||hr.axisType==="zAxis"||sr(!1);var Nn=it[nt];return ye(ye({},er),{},Fe(Fe({},hr.axisType,Nn),"".concat(hr.axisType,"Ticks"),Wi(Nn)))},J),Z=ae[L],pe=ae["".concat(L,"Ticks")],je=A&&A[oe]&&A[oe].hasStack&&tse(K,A[oe].stackGroups),le=Ki(K.type).indexOf("Bar")>=0,Re=zv(Z,pe),_e=[],he=R&&Foe({barSize:$,stackGroups:A,totalSize:Spe(ae,L)});if(le){var ve,Le,Mt=Ge(te)?V:te,vn=(ve=(Le=zv(Z,pe,!0))!==null&&Le!==void 0?Le:Mt)!==null&&ve!==void 0?ve:0;_e=Uoe({barGap:D,barCategoryGap:U,bandSize:vn!==Re?vn:Re,sizeList:he[xe],maxBarSize:Mt}),vn!==Re&&(_e=_e.map(function(er){return ye(ye({},er),{},{position:ye(ye({},er.position),{},{offset:er.position.offset-vn/2})})}))}var fr=K&&K.type&&K.type.getComposedData;fr&&q.push({props:ye(ye({},fr(ye(ye({},ae),{},{displayedData:I,props:N,dataKey:Y,item:K,bandSize:Re,barPosition:_e,offset:E,stackedData:je,layout:F,dataStartIndex:T,dataEndIndex:P}))),{},Fe(Fe(Fe({key:K.key||"item-".concat(ee)},G,ae[G]),L,ae[L]),"animationId",k)),childIndex:GQ(K,N.children),item:K})}),q},x=function(N,O){var C=N.props,A=N.dataStartIndex,E=N.dataEndIndex,k=N.updateId;if(!UM({props:C}))return null;var T=C.children,P=C.layout,$=C.stackOffset,F=C.data,D=C.reverseStackOrder,U=PL(P),V=U.numericAxisName,H=U.cateAxisName,G=Jr(T,r),L=Joe(F,G,"".concat(V,"Id"),"".concat(H,"Id"),$,D),R=d.reduce(function(B,Y){var te="".concat(Y.axisType,"Map");return ye(ye({},B),{},Fe({},te,xpe(C,ye(ye({},Y),{},{graphicalItems:G,stackGroups:Y.axisType===V&&L,dataStartIndex:A,dataEndIndex:E}))))},{}),q=jpe(ye(ye({},R),{},{props:C,graphicalItems:G}),O?.legendBBox);Object.keys(R).forEach(function(B){R[B]=m(C,R[B],q,B.replace("Map",""),n)});var K=R["".concat(H,"Map")],ee=bpe(K),I=g(C,ye(ye({},R),{},{dataStartIndex:A,dataEndIndex:E,updateId:k,graphicalItems:G,stackGroups:L,offset:q}));return ye(ye({formattedGraphicalItems:I,graphicalItems:G,offset:q,stackGroups:L},ee),R)},j=(function(w){function N(O){var C,A,E;return npe(this,N),E=ipe(this,N,[O]),Fe(E,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Fe(E,"accessibilityManager",new Fme),Fe(E,"handleLegendBBoxUpdate",function(k){if(k){var T=E.state,P=T.dataStartIndex,$=T.dataEndIndex,F=T.updateId;E.setState(ye({legendBBox:k},x({props:E.props,dataStartIndex:P,dataEndIndex:$,updateId:F},ye(ye({},E.state),{},{legendBBox:k}))))}}),Fe(E,"handleReceiveSyncEvent",function(k,T,P){if(E.props.syncId===k){if(P===E.eventEmitterSymbol&&typeof E.props.syncMethod!="function")return;E.applySyncEvent(T)}}),Fe(E,"handleBrushChange",function(k){var T=k.startIndex,P=k.endIndex;if(T!==E.state.dataStartIndex||P!==E.state.dataEndIndex){var $=E.state.updateId;E.setState(function(){return ye({dataStartIndex:T,dataEndIndex:P},x({props:E.props,dataStartIndex:T,dataEndIndex:P,updateId:$},E.state))}),E.triggerSyncEvent({dataStartIndex:T,dataEndIndex:P})}}),Fe(E,"handleMouseEnter",function(k){var T=E.getMouseInfo(k);if(T){var P=ye(ye({},T),{},{isTooltipActive:!0});E.setState(P),E.triggerSyncEvent(P);var $=E.props.onMouseEnter;We($)&&$(P,k)}}),Fe(E,"triggeredAfterMouseMove",function(k){var T=E.getMouseInfo(k),P=T?ye(ye({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};E.setState(P),E.triggerSyncEvent(P);var $=E.props.onMouseMove;We($)&&$(P,k)}),Fe(E,"handleItemMouseEnter",function(k){E.setState(function(){return{isTooltipActive:!0,activeItem:k,activePayload:k.tooltipPayload,activeCoordinate:k.tooltipPosition||{x:k.cx,y:k.cy}}})}),Fe(E,"handleItemMouseLeave",function(){E.setState(function(){return{isTooltipActive:!1}})}),Fe(E,"handleMouseMove",function(k){k.persist(),E.throttleTriggeredAfterMouseMove(k)}),Fe(E,"handleMouseLeave",function(k){E.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};E.setState(T),E.triggerSyncEvent(T);var P=E.props.onMouseLeave;We(P)&&P(T,k)}),Fe(E,"handleOuterEvent",function(k){var T=VQ(k),P=Qr(E.props,"".concat(T));if(T&&We(P)){var $,F;/.*touch.*/i.test(T)?F=E.getMouseInfo(k.changedTouches[0]):F=E.getMouseInfo(k),P(($=F)!==null&&$!==void 0?$:{},k)}}),Fe(E,"handleClick",function(k){var T=E.getMouseInfo(k);if(T){var P=ye(ye({},T),{},{isTooltipActive:!0});E.setState(P),E.triggerSyncEvent(P);var $=E.props.onClick;We($)&&$(P,k)}}),Fe(E,"handleMouseDown",function(k){var T=E.props.onMouseDown;if(We(T)){var P=E.getMouseInfo(k);T(P,k)}}),Fe(E,"handleMouseUp",function(k){var T=E.props.onMouseUp;if(We(T)){var P=E.getMouseInfo(k);T(P,k)}}),Fe(E,"handleTouchMove",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&E.throttleTriggeredAfterMouseMove(k.changedTouches[0])}),Fe(E,"handleTouchStart",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&E.handleMouseDown(k.changedTouches[0])}),Fe(E,"handleTouchEnd",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&E.handleMouseUp(k.changedTouches[0])}),Fe(E,"handleDoubleClick",function(k){var T=E.props.onDoubleClick;if(We(T)){var P=E.getMouseInfo(k);T(P,k)}}),Fe(E,"handleContextMenu",function(k){var T=E.props.onContextMenu;if(We(T)){var P=E.getMouseInfo(k);T(P,k)}}),Fe(E,"triggerSyncEvent",function(k){E.props.syncId!==void 0&&IS.emit(LS,E.props.syncId,k,E.eventEmitterSymbol)}),Fe(E,"applySyncEvent",function(k){var T=E.props,P=T.layout,$=T.syncMethod,F=E.state.updateId,D=k.dataStartIndex,U=k.dataEndIndex;if(k.dataStartIndex!==void 0||k.dataEndIndex!==void 0)E.setState(ye({dataStartIndex:D,dataEndIndex:U},x({props:E.props,dataStartIndex:D,dataEndIndex:U,updateId:F},E.state)));else if(k.activeTooltipIndex!==void 0){var V=k.chartX,H=k.chartY,G=k.activeTooltipIndex,L=E.state,R=L.offset,q=L.tooltipTicks;if(!R)return;if(typeof $=="function")G=$(q,k);else if($==="value"){G=-1;for(var K=0;K=0){var je,le;if(V.dataKey&&!V.allowDuplicatedCategory){var Re=typeof V.dataKey=="function"?pe:"payload.".concat(V.dataKey.toString());je=pv(K,Re,G),le=ee&&I&&pv(I,Re,G)}else je=K?.[H],le=ee&&I&&I[H];if(xe||oe){var _e=k.props.activeIndex!==void 0?k.props.activeIndex:H;return[y.cloneElement(k,ye(ye(ye({},$.props),ae),{},{activeIndex:_e})),null,null]}if(!Ge(je))return[Z].concat(Su(E.renderActivePoints({item:$,activePoint:je,basePoint:le,childIndex:H,isRange:ee})))}else{var he,ve=(he=E.getItemByXY(E.state.activeCoordinate))!==null&&he!==void 0?he:{graphicalItem:Z},Le=ve.graphicalItem,Mt=Le.item,vn=Mt===void 0?k:Mt,fr=Le.childIndex,er=ye(ye(ye({},$.props),ae),{},{activeIndex:fr});return[y.cloneElement(vn,er),null,null]}return ee?[Z,null,null]:[Z,null]}),Fe(E,"renderCustomized",function(k,T,P){return y.cloneElement(k,ye(ye({key:"recharts-customized-".concat(P)},E.props),E.state))}),Fe(E,"renderMap",{CartesianGrid:{handler:Mp,once:!0},ReferenceArea:{handler:E.renderReferenceElement},ReferenceLine:{handler:Mp},ReferenceDot:{handler:E.renderReferenceElement},XAxis:{handler:Mp},YAxis:{handler:Mp},Brush:{handler:E.renderBrush,once:!0},Bar:{handler:E.renderGraphicChild},Line:{handler:E.renderGraphicChild},Area:{handler:E.renderGraphicChild},Radar:{handler:E.renderGraphicChild},RadialBar:{handler:E.renderGraphicChild},Scatter:{handler:E.renderGraphicChild},Pie:{handler:E.renderGraphicChild},Funnel:{handler:E.renderGraphicChild},Tooltip:{handler:E.renderCursor,once:!0},PolarGrid:{handler:E.renderPolarGrid,once:!0},PolarAngleAxis:{handler:E.renderPolarAxis},PolarRadiusAxis:{handler:E.renderPolarAxis},Customized:{handler:E.renderCustomized}}),E.clipPathId="".concat((C=O.id)!==null&&C!==void 0?C:$u("recharts"),"-clip"),E.throttleTriggeredAfterMouseMove=hz(E.triggeredAfterMouseMove,(A=O.throttleDelay)!==null&&A!==void 0?A:1e3/60),E.state={},E}return lpe(N,w),ape(N,[{key:"componentDidMount",value:function(){var C,A;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C:0,top:(A=this.props.margin.top)!==null&&A!==void 0?A:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var C=this.props,A=C.children,E=C.data,k=C.height,T=C.layout,P=Vr(A,Qa);if(P){var $=P.props.defaultIndex;if(!(typeof $!="number"||$<0||$>this.state.tooltipTicks.length-1)){var F=this.state.tooltipTicks[$]&&this.state.tooltipTicks[$].value,D=IN(this.state,E,$,F),U=this.state.tooltipTicks[$].coordinate,V=(this.state.offset.top+k)/2,H=T==="horizontal",G=H?{x:U,y:V}:{y:U,x:V},L=this.state.formattedGraphicalItems.find(function(q){var K=q.item;return K.type.name==="Scatter"});L&&(G=ye(ye({},G),L.props.points[$].tooltipPosition),D=L.props.points[$].tooltipPayload);var R={activeTooltipIndex:$,isTooltipActive:!0,activeLabel:F,activePayload:D,activeCoordinate:G};this.setState(R),this.renderCursor(P),this.accessibilityManager.setIndex($)}}}},{key:"getSnapshotBeforeUpdate",value:function(C,A){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==A.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==C.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==C.margin){var E,k;this.accessibilityManager.setDetails({offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0}})}return null}},{key:"componentDidUpdate",value:function(C){x_([Vr(C.children,Qa)],[Vr(this.props.children,Qa)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var C=Vr(this.props.children,Qa);if(C&&typeof C.props.shared=="boolean"){var A=C.props.shared?"axis":"item";return u.indexOf(A)>=0?A:i}return i}},{key:"getMouseInfo",value:function(C){if(!this.container)return null;var A=this.container,E=A.getBoundingClientRect(),k=Rne(E),T={chartX:Math.round(C.pageX-k.left),chartY:Math.round(C.pageY-k.top)},P=E.width/A.offsetWidth||1,$=this.inRange(T.chartX,T.chartY,P);if(!$)return null;var F=this.state,D=F.xAxisMap,U=F.yAxisMap,V=this.getTooltipEventType(),H=TL(this.state,this.props.data,this.props.layout,$);if(V!=="axis"&&D&&U){var G=Bo(D).scale,L=Bo(U).scale,R=G&&G.invert?G.invert(T.chartX):null,q=L&&L.invert?L.invert(T.chartY):null;return ye(ye({},T),{},{xValue:R,yValue:q},H)}return H?ye(ye({},T),H):null}},{key:"inRange",value:function(C,A){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=this.props.layout,T=C/E,P=A/E;if(k==="horizontal"||k==="vertical"){var $=this.state.offset,F=T>=$.left&&T<=$.left+$.width&&P>=$.top&&P<=$.top+$.height;return F?{x:T,y:P}:null}var D=this.state,U=D.angleAxisMap,V=D.radiusAxisMap;if(U&&V){var H=Bo(U);return P4({x:T,y:P},H)}return null}},{key:"parseEventsOfWrapper",value:function(){var C=this.props.children,A=this.getTooltipEventType(),E=Vr(C,Qa),k={};E&&A==="axis"&&(E.props.trigger==="click"?k={onClick:this.handleClick}:k={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=vv(this.props,this.handleOuterEvent);return ye(ye({},T),k)}},{key:"addListener",value:function(){IS.on(LS,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){IS.removeListener(LS,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(C,A,E){for(var k=this.state.formattedGraphicalItems,T=0,P=k.length;T");return e}const Ec=y.forwardRef(({id:e,className:t,children:n,config:r,...a},i)=>{const l=y.useId(),u=`chart-${e||l.replace(/:/g,"")}`;return s.jsx(Rq.Provider,{value:{config:r},children:s.jsxs("div",{"data-chart":u,ref:i,className:ue("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",t),...a,children:[s.jsx(Cpe,{id:u,config:r}),s.jsx(Cne,{children:n})]})})});Ec.displayName="Chart";const Cpe=({id:e,config:t})=>{const n=Object.entries(t).filter(([,r])=>r.theme||r.color);return n.length?s.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(Ope).map(([r,a])=>` -${a} [data-chart=${e}] { -${n.map(([i,l])=>{const u=l.theme?.[r]||l.color;return u?` --color-${i}: ${u};`:null}).join(` -`)} -} -`).join(` -`)}}):null},tf=Qa,Ac=y.forwardRef(({active:e,payload:t,className:n,indicator:r="dot",hideLabel:a=!1,hideIndicator:i=!1,label:l,labelFormatter:u,labelClassName:d,formatter:f,color:m,nameKey:p,labelKey:g},x)=>{const{config:j}=Dq(),b=y.useMemo(()=>{if(a||!t?.length)return null;const[N]=t,O=`${g||N?.dataKey||N?.name||"value"}`,C=LN(j,N,O),A=!g&&typeof l=="string"?j[l]?.label||l:C?.label;return u?s.jsx("div",{className:ue("font-medium",d),children:u(A,t)}):A?s.jsx("div",{className:ue("font-medium",d),children:A}):null},[l,u,t,a,d,j,g]);if(!e||!t?.length)return null;const w=t.length===1&&r!=="dot";return s.jsxs("div",{ref:x,className:ue("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",n),children:[w?null:b,s.jsx("div",{className:"grid gap-1.5",children:t.filter(N=>N.type!=="none").map((N,O)=>{const C=`${p||N.name||N.dataKey||"value"}`,A=LN(j,N,C),E=m||N.payload.fill||N.color;return s.jsx("div",{className:ue("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",r==="dot"&&"items-center"),children:f&&N?.value!==void 0&&N.name?f(N.value,N.name,N,O,N.payload):s.jsxs(s.Fragment,{children:[A?.icon?s.jsx(A.icon,{}):!i&&s.jsx("div",{className:ue("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":r==="dot","w-1":r==="line","w-0 border-[1.5px] border-dashed bg-transparent":r==="dashed","my-0.5":w&&r==="dashed"}),style:{"--color-bg":E,"--color-border":E}}),s.jsxs("div",{className:ue("flex flex-1 justify-between leading-none",w?"items-end":"items-center"),children:[s.jsxs("div",{className:"grid gap-1.5",children:[w?b:null,s.jsx("span",{className:"text-muted-foreground",children:A?.label||N.name})]}),N.value&&s.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:N.value.toLocaleString()})]})]})},N.dataKey)})})]})});Ac.displayName="ChartTooltip";const Epe=Xs,$q=y.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:r="bottom",nameKey:a},i)=>{const{config:l}=Dq();return n?.length?s.jsx("div",{ref:i,className:ue("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",e),children:n.filter(u=>u.type!=="none").map(u=>{const d=`${a||u.dataKey||"value"}`,f=LN(l,u,d);return s.jsxs("div",{className:ue("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[f?.icon&&!t?s.jsx(f.icon,{}):s.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:u.color}}),f?.label]},u.value)})}):null});$q.displayName="ChartLegend";function LN(e,t,n){if(typeof t!="object"||t===null)return;const r="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let a=n;return n in t&&typeof t[n]=="string"?a=t[n]:r&&n in r&&typeof r[n]=="string"&&(a=r[n]),a in e?e[a]:e[n]}const Ape=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Tpe=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),ML=e=>{const t=Tpe(e);return t.charAt(0).toUpperCase()+t.slice(1)},Iq=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),kpe=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Ppe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Mpe=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:l,...u},d)=>y.createElement("svg",{ref:d,...Ppe,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Iq("lucide",a),...!i&&!kpe(u)&&{"aria-hidden":"true"},...u},[...l.map(([f,m])=>y.createElement(f,m)),...Array.isArray(i)?i:[i]]));const Ce=(e,t)=>{const n=y.forwardRef(({className:r,...a},i)=>y.createElement(Mpe,{ref:i,iconNode:t,className:Iq(`lucide-${Ape(ML(e))}`,`lucide-${e}`,r),...a}));return n.displayName=ML(e),n};const Rpe=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Dpe=Ce("activity",Rpe);const $pe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Lq=Ce("arrow-left",$pe);const Ipe=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Lpe=Ce("ban",Ipe);const Bpe=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],zpe=Ce("book-open",Bpe);const qpe=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],Bq=Ce("boxes",qpe);const Fpe=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],RL=Ce("calendar",Fpe);const Upe=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],zq=Ce("chart-column",Upe);const Hpe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Js=Ce("check",Hpe);const Wpe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],sh=Ce("chevron-down",Wpe);const Vpe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],UC=Ce("chevron-left",Vpe);const Gpe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],HC=Ce("chevron-right",Gpe);const Ype=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],BN=Ce("chevron-up",Ype);const Kpe=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Xpe=Ce("chevrons-up-down",Kpe);const Zpe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],hg=Ce("circle-alert",Zpe);const Qpe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],mg=Ce("circle-check",Qpe);const Jpe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],eve=Ce("circle-question-mark",Jpe);const tve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],qq=Ce("circle-user",tve);const nve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Fq=Ce("circle-x",nve);const rve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ave=Ce("circle",rve);const ive=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],el=Ce("clock",ive);const ove=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],zN=Ce("copy",ove);const sve=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],lve=Ce("database",sve);const cve=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],uve=Ce("dollar-sign",cve);const dve=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],qN=Ce("download",dve);const fve=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Zp=Ce("external-link",fve);const hve=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],FN=Ce("eye-off",hve);const mve=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],to=Ce("eye",mve);const pve=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],pg=Ce("file-search",pve);const vve=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],WC=Ce("file-text",vve);const gve=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],UN=Ce("funnel",gve);const yve=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],vg=Ce("hash",yve);const xve=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],gg=Ce("house",xve);const bve=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],wve=Ce("image",bve);const jve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Uq=Ce("info",jve);const Sve=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],_ve=Ce("key",Sve);const Nve=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],HN=Ce("loader-circle",Nve);const Ove=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],DL=Ce("lock",Ove);const Cve=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],$L=Ce("log-out",Cve);const Eve=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Ave=Ce("menu",Eve);const Tve=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Mh=Ce("message-square",Tve);const kve=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],WN=Ce("moon",kve);const Pve=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Hq=Ce("package",Pve);const Mve=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Rve=Ce("palette",Mve);const Dve=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],$ve=Ce("pause",Dve);const Ive=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],_u=Ce("pencil",Ive);const Lve=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Bve=Ce("play",Lve);const zve=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Zn=Ce("plus",zve);const qve=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],tl=Ce("refresh-cw",qve);const Fve=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Uve=Ce("rotate-cw",Fve);const Hve=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],VC=Ce("save",Hve);const Wve=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],kr=Ce("search",Wve);const Vve=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Wq=Ce("server",Vve);const Gve=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Yve=Ce("settings-2",Gve);const Kve=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Sf=Ce("settings",Kve);const Xve=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Zve=Ce("shield",Xve);const Qve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],Vq=Ce("smile",Qve);const Jve=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],GC=Ce("square-pen",Jve);const ege=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],IL=Ce("star",ege);const tge=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],VN=Ce("sun",tge);const nge=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],rge=Ce("terminal",nge);const age=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],zt=Ce("trash-2",age);const ige=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],oge=Ce("trending-up",ige);const sge=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Fc=Ce("triangle-alert",sge);const lge=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],cge=Ce("user",lge);const uge=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],dge=Ce("users",uge);const fge=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],_y=Ce("x",fge);const hge=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],GN=Ce("zap",hge);var mge=Symbol.for("react.lazy"),yg=gO[" use ".trim().toString()];function pge(e){return typeof e=="object"&&e!==null&&"then"in e}function Gq(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===mge&&"_payload"in e&&pge(e._payload)}function Ny(e){const t=gge(e),n=y.forwardRef((r,a)=>{let{children:i,...l}=r;Gq(i)&&typeof yg=="function"&&(i=yg(i._payload));const u=y.Children.toArray(i),d=u.find(xge);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return s.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var vge=Ny("Slot");function gge(e){const t=y.forwardRef((n,r)=>{let{children:a,...i}=n;if(Gq(a)&&typeof yg=="function"&&(a=yg(a._payload)),y.isValidElement(a)){const l=wge(a),u=bge(i,a.props);return a.type!==y.Fragment&&(u.ref=r?Tr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yge=Symbol("radix.slottable");function xge(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yge}function bge(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function wge(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const LL=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,BL=Ye,Rh=(e,t)=>n=>{var r;if(t?.variants==null)return BL(e,n?.class,n?.className);const{variants:a,defaultVariants:i}=t,l=Object.keys(a).map(f=>{const m=n?.[f],p=i?.[f];if(m===null)return null;const g=LL(m)||LL(p);return a[f][g]}),u=n&&Object.entries(n).reduce((f,m)=>{let[p,g]=m;return g===void 0||(f[p]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,m)=>{let{class:p,className:g,...x}=m;return Object.entries(x).every(j=>{let[b,w]=j;return Array.isArray(w)?w.includes({...i,...u}[b]):{...i,...u}[b]===w})?[...f,p,g]:f},[]);return BL(e,l,d,n?.class,n?.className)},lh=Rh("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),me=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const l=r?vge:"button";return s.jsx(l,{className:ue(lh({variant:t,size:n,className:e})),ref:i,...a})});me.displayName="Button";function jge(){const[e,t]=y.useState(null),[n,r]=y.useState(!0),[a,i]=y.useState(24),[l,u]=y.useState(!0),d=y.useCallback(async()=>{try{const O=localStorage.getItem("token"),C=await an.get(`/api/webui/statistics/dashboard?hours=${a}`,{headers:{Authorization:`Bearer ${O}`}});t(C.data),r(!1)}catch(O){console.error("Failed to fetch dashboard data:",O),r(!1)}},[a]);if(y.useEffect(()=>{d()},[d]),y.useEffect(()=>{if(!l)return;const O=setInterval(()=>{d()},3e4);return()=>clearInterval(O)},[l,d]),n||!e)return s.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx(tl,{className:"h-12 w-12 animate-spin mx-auto text-muted-foreground"}),s.jsx("p",{className:"text-muted-foreground",children:"加载统计数据中..."})]})});const{summary:f,model_stats:m,hourly_data:p,daily_data:g,recent_activity:x}=e,j=O=>{const C=Math.floor(O/3600),A=Math.floor(O%3600/60);return`${C}小时${A}分钟`},b=O=>new Date(O).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),w=m.slice(0,6).map(O=>({name:O.model_name,value:O.request_count,fill:`hsl(var(--chart-${m.indexOf(O)%5+1}))`})),N={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return s.jsx(Kt,{className:"h-full",children:s.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(al,{value:a.toString(),onValueChange:O=>i(Number(O)),children:s.jsxs(Yo,{className:"grid grid-cols-3 w-full sm:w-auto",children:[s.jsx(Tt,{value:"24",children:"24小时"}),s.jsx(Tt,{value:"168",children:"7天"}),s.jsx(Tt,{value:"720",children:"30天"})]})}),s.jsxs(me,{variant:l?"default":"outline",size:"sm",onClick:()=>u(!l),className:"gap-2",children:[s.jsx(tl,{className:`h-4 w-4 ${l?"animate-spin":""}`}),s.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),s.jsx(me,{variant:"outline",size:"sm",onClick:d,children:s.jsx(tl,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[s.jsxs(ct,{children:[s.jsxs(Ut,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(Ht,{className:"text-sm font-medium",children:"总请求数"}),s.jsx(Dpe,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(un,{children:[s.jsx("div",{className:"text-2xl font-bold",children:f.total_requests.toLocaleString()}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",a<48?a+"小时":Math.floor(a/24)+"天"]})]})]}),s.jsxs(ct,{children:[s.jsxs(Ut,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(Ht,{className:"text-sm font-medium",children:"总花费"}),s.jsx(uve,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(un,{children:[s.jsxs("div",{className:"text-2xl font-bold",children:["¥",f.total_cost.toFixed(2)]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:f.cost_per_hour>0?`¥${f.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),s.jsxs(ct,{children:[s.jsxs(Ut,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(Ht,{className:"text-sm font-medium",children:"Token消耗"}),s.jsx(lve,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(un,{children:[s.jsxs("div",{className:"text-2xl font-bold",children:[(f.total_tokens/1e3).toFixed(1),"K"]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:f.tokens_per_hour>0?`${(f.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),s.jsxs(ct,{children:[s.jsxs(Ut,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(Ht,{className:"text-sm font-medium",children:"平均响应"}),s.jsx(GN,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(un,{children:[s.jsxs("div",{className:"text-2xl font-bold",children:[f.avg_response_time.toFixed(2),"s"]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),s.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[s.jsxs(ct,{children:[s.jsxs(Ut,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(Ht,{className:"text-sm font-medium",children:"在线时长"}),s.jsx(el,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(un,{children:s.jsx("div",{className:"text-xl font-bold",children:j(f.online_time)})})]}),s.jsxs(ct,{children:[s.jsxs(Ut,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(Ht,{className:"text-sm font-medium",children:"消息处理"}),s.jsx(Mh,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(un,{children:[s.jsx("div",{className:"text-xl font-bold",children:f.total_messages.toLocaleString()}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",f.total_replies.toLocaleString()," 条"]})]})]}),s.jsxs(ct,{children:[s.jsxs(Ut,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(Ht,{className:"text-sm font-medium",children:"成本效率"}),s.jsx(oge,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(un,{children:[s.jsx("div",{className:"text-xl font-bold",children:f.total_messages>0?`¥${(f.total_cost/f.total_messages*100).toFixed(2)}`:"¥0.00"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),s.jsxs(al,{defaultValue:"trends",className:"space-y-4",children:[s.jsxs(Yo,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[s.jsx(Tt,{value:"trends",children:"趋势"}),s.jsx(Tt,{value:"models",children:"模型"}),s.jsx(Tt,{value:"activity",children:"活动"}),s.jsx(Tt,{value:"daily",children:"日统计"})]}),s.jsxs(Jt,{value:"trends",className:"space-y-4",children:[s.jsxs(ct,{children:[s.jsxs(Ut,{children:[s.jsx(Ht,{children:"请求趋势"}),s.jsxs(Xn,{children:["最近",a,"小时的请求量变化"]})]}),s.jsx(un,{children:s.jsx(Ec,{config:N,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:s.jsxs(_pe,{data:p,children:[s.jsx(lf,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),s.jsx(Fo,{dataKey:"timestamp",tickFormatter:O=>b(O),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),s.jsx(Fi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),s.jsx(tf,{content:s.jsx(Ac,{labelFormatter:O=>b(O)})}),s.jsx(Ph,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),s.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[s.jsxs(ct,{children:[s.jsxs(Ut,{children:[s.jsx(Ht,{children:"花费趋势"}),s.jsx(Xn,{children:"API调用成本变化"})]}),s.jsx(un,{children:s.jsx(Ec,{config:N,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:s.jsxs(zS,{data:p,children:[s.jsx(lf,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),s.jsx(Fo,{dataKey:"timestamp",tickFormatter:O=>b(O),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),s.jsx(Fi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),s.jsx(tf,{content:s.jsx(Ac,{labelFormatter:O=>b(O)})}),s.jsx(ai,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),s.jsxs(ct,{children:[s.jsxs(Ut,{children:[s.jsx(Ht,{children:"Token消耗"}),s.jsx(Xn,{children:"Token使用量变化"})]}),s.jsx(un,{children:s.jsx(Ec,{config:N,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:s.jsxs(zS,{data:p,children:[s.jsx(lf,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),s.jsx(Fo,{dataKey:"timestamp",tickFormatter:O=>b(O),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),s.jsx(Fi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),s.jsx(tf,{content:s.jsx(Ac,{labelFormatter:O=>b(O)})}),s.jsx(ai,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),s.jsx(Jt,{value:"models",className:"space-y-4",children:s.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[s.jsxs(ct,{children:[s.jsxs(Ut,{children:[s.jsx(Ht,{children:"模型请求分布"}),s.jsx(Xn,{children:"各模型使用占比"})]}),s.jsx(un,{children:s.jsx(Ec,{config:Object.fromEntries(m.slice(0,6).map((O,C)=>[O.model_name,{label:O.model_name,color:`hsl(var(--chart-${C%5+1}))`}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:s.jsxs(Npe,{children:[s.jsx(tf,{content:s.jsx(Ac,{})}),s.jsx(lo,{data:w,cx:"50%",cy:"50%",labelLine:!1,label:({name:O,percent:C})=>`${O} ${C?(C*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:w.map((O,C)=>s.jsx(Jg,{fill:O.fill},`cell-${C}`))})]})})})]}),s.jsxs(ct,{children:[s.jsxs(Ut,{children:[s.jsx(Ht,{children:"模型详细统计"}),s.jsx(Xn,{children:"请求数、花费和性能"})]}),s.jsx(un,{children:s.jsx(Kt,{className:"h-[300px] sm:h-[400px]",children:s.jsx("div",{className:"space-y-3",children:m.map((O,C)=>s.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:O.model_name}),s.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${C%5+1}))`}})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),s.jsx("span",{className:"ml-1 font-medium",children:O.request_count.toLocaleString()})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"花费:"}),s.jsxs("span",{className:"ml-1 font-medium",children:["¥",O.total_cost.toFixed(2)]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),s.jsxs("span",{className:"ml-1 font-medium",children:[(O.total_tokens/1e3).toFixed(1),"K"]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),s.jsxs("span",{className:"ml-1 font-medium",children:[O.avg_response_time.toFixed(2),"s"]})]})]})]},C))})})})]})]})}),s.jsx(Jt,{value:"activity",children:s.jsxs(ct,{children:[s.jsxs(Ut,{children:[s.jsx(Ht,{children:"最近活动"}),s.jsx(Xn,{children:"最新的API调用记录"})]}),s.jsx(un,{children:s.jsx(Kt,{className:"h-[400px] sm:h-[500px]",children:s.jsx("div",{className:"space-y-2",children:x.map((O,C)=>s.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"font-medium text-sm truncate",children:O.model}),s.jsx("div",{className:"text-xs text-muted-foreground",children:O.request_type})]}),s.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:b(O.timestamp)})]}),s.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),s.jsx("span",{className:"ml-1",children:O.tokens})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"花费:"}),s.jsxs("span",{className:"ml-1",children:["¥",O.cost.toFixed(4)]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),s.jsxs("span",{className:"ml-1",children:[O.time_cost.toFixed(2),"s"]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"状态:"}),s.jsx("span",{className:`ml-1 ${O.status==="success"?"text-green-600":"text-red-600"}`,children:O.status})]})]})]},C))})})})]})}),s.jsx(Jt,{value:"daily",children:s.jsxs(ct,{children:[s.jsxs(Ut,{children:[s.jsx(Ht,{children:"每日统计"}),s.jsx(Xn,{children:"最近7天的数据汇总"})]}),s.jsx(un,{children:s.jsx(Ec,{config:{requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"}},className:"h-[400px] sm:h-[500px] w-full aspect-auto",children:s.jsxs(zS,{data:g,children:[s.jsx(lf,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),s.jsx(Fo,{dataKey:"timestamp",tickFormatter:O=>{const C=new Date(O);return`${C.getMonth()+1}/${C.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),s.jsx(Fi,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),s.jsx(Fi,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),s.jsx(tf,{content:s.jsx(Ac,{labelFormatter:O=>new Date(O).toLocaleDateString("zh-CN")})}),s.jsx(Epe,{content:s.jsx($q,{})}),s.jsx(ai,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),s.jsx(ai,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]})]})})}const Sge={theme:"system",setTheme:()=>null},Yq=y.createContext(Sge),YC=()=>{const e=y.useContext(Yq);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},_ge=(e,t,n)=>{const r=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||r){t(e);return}const a=n.clientX,i=n.clientY,l=Math.hypot(Math.max(a,innerWidth-a),Math.max(i,innerHeight-i));document.startViewTransition(()=>{t(e)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${a}px ${i}px)`,`circle(${l}px at ${a}px ${i}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},Kq=y.createContext(void 0),Xq=()=>{const e=y.useContext(Kq);if(e===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return e};function Oy(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Cy(e){const[t,n]=y.useState(void 0);return Bn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,u;if("borderBoxSize"in i){const d=i.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,u=f.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ey="Switch",[Nge]=ur(Ey),[Oge,Cge]=Nge(Ey),Zq=y.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:i,required:l,disabled:u,value:d="on",onCheckedChange:f,form:m,...p}=e,[g,x]=y.useState(null),j=qe(t,C=>x(C)),b=y.useRef(!1),w=g?m||!!g.closest("form"):!0,[N,O]=wa({prop:a,defaultProp:i??!1,onChange:f,caller:Ey});return s.jsxs(Oge,{scope:n,checked:N,disabled:u,children:[s.jsx(Me.button,{type:"button",role:"switch","aria-checked":N,"aria-required":l,"data-state":tF(N),"data-disabled":u?"":void 0,disabled:u,value:d,...p,ref:j,onClick:Se(e.onClick,C=>{O(A=>!A),w&&(b.current=C.isPropagationStopped(),b.current||C.stopPropagation())})}),w&&s.jsx(eF,{control:g,bubbles:!b.current,name:r,value:d,checked:N,required:l,disabled:u,form:m,style:{transform:"translateX(-100%)"}})]})});Zq.displayName=Ey;var Qq="SwitchThumb",Jq=y.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=Cge(Qq,n);return s.jsx(Me.span,{"data-state":tF(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});Jq.displayName=Qq;var Ege="SwitchBubbleInput",eF=y.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const l=y.useRef(null),u=qe(l,i),d=Oy(n),f=Cy(t);return y.useEffect(()=>{const m=l.current;if(!m)return;const p=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&x){const j=new Event("click",{bubbles:r});x.call(m,n),m.dispatchEvent(j)}},[d,n,r]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:u,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});eF.displayName=Ege;function tF(e){return e?"checked":"unchecked"}var nF=Zq,Age=Jq;const ht=y.forwardRef(({className:e,...t},n)=>s.jsx(nF,{className:ue("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:s.jsx(Age,{className:ue("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));ht.displayName=nF.displayName;var Tge=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kge=Tge.reduce((e,t)=>{const n=Ny(`Primitive.${t}`),r=y.forwardRef((a,i)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Pge="Label",rF=y.forwardRef((e,t)=>s.jsx(kge.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));rF.displayName=Pge;var aF=rF;const Mge=Rh("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),re=y.forwardRef(({className:e,...t},n)=>s.jsx(aF,{ref:n,className:ue(Mge(),e),...t}));re.displayName=aF.displayName;const Oe=y.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:ue("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Oe.displayName="Input";const Rge=1,Dge=1e6;let qS=0;function $ge(){return qS=(qS+1)%Number.MAX_SAFE_INTEGER,qS.toString()}const FS=new Map,zL=e=>{if(FS.has(e))return;const t=setTimeout(()=>{FS.delete(e),_f({type:"REMOVE_TOAST",toastId:e})},Dge);FS.set(e,t)},Ige=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Rge)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?zL(n):e.toasts.forEach(r=>{zL(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Qp=[];let Jp={toasts:[]};function _f(e){Jp=Ige(Jp,e),Qp.forEach(t=>{t(Jp)})}function Lge({...e}){const t=$ge(),n=a=>_f({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>_f({type:"DISMISS_TOAST",toastId:t});return _f({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function Dr(){const[e,t]=y.useState(Jp);return y.useEffect(()=>(Qp.push(t),()=>{const n=Qp.indexOf(t);n>-1&&Qp.splice(n,1)}),[e]),{...e,toast:Lge,dismiss:n=>_f({type:"DISMISS_TOAST",toastId:n})}}const Bge=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:e=>e.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:e=>/[A-Z]/.test(e)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:e=>/[a-z]/.test(e)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:e=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(e)}];function zge(e){const t=Bge.map(r=>({id:r.id,label:r.label,description:r.description,passed:r.validate(e)}));return{isValid:t.every(r=>r.passed),rules:t}}const KC="0.4.0",iF="MaiBot Dashboard",qge=`${iF} v${KC}`,Fge=(e="v")=>`${e}${KC}`;function Uge(e,t=globalThis?.document){const n=Xt(e);y.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Hge="DismissableLayer",YN="dismissableLayer.update",Wge="dismissableLayer.pointerDownOutside",Vge="dismissableLayer.focusOutside",qL,oF=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wl=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:u,...d}=e,f=y.useContext(oF),[m,p]=y.useState(null),g=m?.ownerDocument??globalThis?.document,[,x]=y.useState({}),j=qe(t,T=>p(T)),b=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=b.indexOf(w),O=m?b.indexOf(m):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,A=O>=N,E=Yge(T=>{const P=T.target,$=[...f.branches].some(F=>F.contains(P));!A||$||(a?.(T),l?.(T),T.defaultPrevented||u?.())},g),k=Kge(T=>{const P=T.target;[...f.branches].some(F=>F.contains(P))||(i?.(T),l?.(T),T.defaultPrevented||u?.())},g);return Uge(T=>{O===f.layers.size-1&&(r?.(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},g),y.useEffect(()=>{if(m)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(qL=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),FL(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=qL)}},[m,g,n,f]),y.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),FL())},[m,f]),y.useEffect(()=>{const T=()=>x({});return document.addEventListener(YN,T),()=>document.removeEventListener(YN,T)},[]),s.jsx(Me.div,{...d,ref:j,style:{pointerEvents:C?A?"auto":"none":void 0,...e.style},onFocusCapture:Se(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Se(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Se(e.onPointerDownCapture,E.onPointerDownCapture)})});wl.displayName=Hge;var Gge="DismissableLayerBranch",sF=y.forwardRef((e,t)=>{const n=y.useContext(oF),r=y.useRef(null),a=qe(t,r);return y.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(Me.div,{...e,ref:a})});sF.displayName=Gge;function Yge(e,t=globalThis?.document){const n=Xt(e),r=y.useRef(!1),a=y.useRef(()=>{});return y.useEffect(()=>{const i=u=>{if(u.target&&!r.current){let d=function(){lF(Wge,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Kge(e,t=globalThis?.document){const n=Xt(e),r=y.useRef(!1);return y.useEffect(()=>{const a=i=>{i.target&&!r.current&&lF(Vge,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function FL(){const e=new CustomEvent(YN);document.dispatchEvent(e)}function lF(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?MO(a,i):a.dispatchEvent(i)}var Xge=wl,Zge=sF,US="focusScope.autoFocusOnMount",HS="focusScope.autoFocusOnUnmount",UL={bubbles:!1,cancelable:!0},Qge="FocusScope",Dh=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[u,d]=y.useState(null),f=Xt(a),m=Xt(i),p=y.useRef(null),g=qe(t,b=>d(b)),x=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let b=function(C){if(x.paused||!u)return;const A=C.target;u.contains(A)?p.current=A:Io(p.current,{select:!0})},w=function(C){if(x.paused||!u)return;const A=C.relatedTarget;A!==null&&(u.contains(A)||Io(p.current,{select:!0}))},N=function(C){if(document.activeElement===document.body)for(const E of C)E.removedNodes.length>0&&Io(u)};document.addEventListener("focusin",b),document.addEventListener("focusout",w);const O=new MutationObserver(N);return u&&O.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",w),O.disconnect()}}},[r,u,x.paused]),y.useEffect(()=>{if(u){WL.add(x);const b=document.activeElement;if(!u.contains(b)){const N=new CustomEvent(US,UL);u.addEventListener(US,f),u.dispatchEvent(N),N.defaultPrevented||(Jge(aye(cF(u)),{select:!0}),document.activeElement===b&&Io(u))}return()=>{u.removeEventListener(US,f),setTimeout(()=>{const N=new CustomEvent(HS,UL);u.addEventListener(HS,m),u.dispatchEvent(N),N.defaultPrevented||Io(b??document.body,{select:!0}),u.removeEventListener(HS,m),WL.remove(x)},0)}}},[u,f,m,x]);const j=y.useCallback(b=>{if(!n&&!r||x.paused)return;const w=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,N=document.activeElement;if(w&&N){const O=b.currentTarget,[C,A]=eye(O);C&&A?!b.shiftKey&&N===A?(b.preventDefault(),n&&Io(C,{select:!0})):b.shiftKey&&N===C&&(b.preventDefault(),n&&Io(A,{select:!0})):N===O&&b.preventDefault()}},[n,r,x.paused]);return s.jsx(Me.div,{tabIndex:-1,...l,ref:g,onKeyDown:j})});Dh.displayName=Qge;function Jge(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Io(r,{select:t}),document.activeElement!==n)return}function eye(e){const t=cF(e),n=HL(t,e),r=HL(t.reverse(),e);return[n,r]}function cF(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function HL(e,t){for(const n of e)if(!tye(n,{upTo:t}))return n}function tye(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function nye(e){return e instanceof HTMLInputElement&&"select"in e}function Io(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&nye(e)&&t&&e.select()}}var WL=rye();function rye(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=VL(e,t),e.unshift(t)},remove(t){e=VL(e,t),e[0]?.resume()}}}function VL(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function aye(e){return e.filter(t=>t.tagName!=="A")}var iye="Portal",jl=y.forwardRef((e,t)=>{const{container:n,...r}=e,[a,i]=y.useState(!1);Bn(()=>i(!0),[]);const l=n||a&&globalThis?.document?.body;return l?lY.createPortal(s.jsx(Me.div,{...r,ref:t}),l):null});jl.displayName=iye;var WS=0;function Ay(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??GL()),document.body.insertAdjacentElement("beforeend",e[1]??GL()),WS++,()=>{WS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),WS--}},[])}function GL(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ja=function(){return Ja=Object.assign||function(t){for(var n,r=1,a=arguments.length;r"u")return jye;var t=Sye(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Nye=hF(),Uc="data-scroll-locked",Oye=function(e,t,n,r){var a=e.left,i=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),` - .`.concat(sye,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(u,"px ").concat(r,`; - } - body[`).concat(Uc,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(a,`px; - padding-top: `).concat(i,`px; - padding-right: `).concat(l,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(u,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(ev,` { - right: `).concat(u,"px ").concat(r,`; - } - - .`).concat(tv,` { - margin-right: `).concat(u,"px ").concat(r,`; - } - - .`).concat(ev," .").concat(ev,` { - right: 0 `).concat(r,`; - } - - .`).concat(tv," .").concat(tv,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(Uc,`] { - `).concat(lye,": ").concat(u,`px; - } -`)},KL=function(){var e=parseInt(document.body.getAttribute(Uc)||"0",10);return isFinite(e)?e:0},Cye=function(){y.useEffect(function(){return document.body.setAttribute(Uc,(KL()+1).toString()),function(){var e=KL()-1;e<=0?document.body.removeAttribute(Uc):document.body.setAttribute(Uc,e.toString())}},[])},Eye=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;Cye();var i=y.useMemo(function(){return _ye(a)},[a]);return y.createElement(Nye,{styles:Oye(i,!t,a,n?"":"!important")})},KN=!1;if(typeof window<"u")try{var Rp=Object.defineProperty({},"passive",{get:function(){return KN=!0,!0}});window.addEventListener("test",Rp,Rp),window.removeEventListener("test",Rp,Rp)}catch{KN=!1}var jc=KN?{passive:!1}:!1,Aye=function(e){return e.tagName==="TEXTAREA"},mF=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Aye(e)&&n[t]==="visible")},Tye=function(e){return mF(e,"overflowY")},kye=function(e){return mF(e,"overflowX")},XL=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=pF(e,r);if(a){var i=vF(e,r),l=i[1],u=i[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Pye=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Mye=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},pF=function(e,t){return e==="v"?Tye(t):kye(t)},vF=function(e,t){return e==="v"?Pye(t):Mye(t)},Rye=function(e,t){return e==="h"&&t==="rtl"?-1:1},Dye=function(e,t,n,r,a){var i=Rye(e,window.getComputedStyle(t).direction),l=i*r,u=n.target,d=t.contains(u),f=!1,m=l>0,p=0,g=0;do{if(!u)break;var x=vF(e,u),j=x[0],b=x[1],w=x[2],N=b-w-i*j;(j||N)&&pF(e,u)&&(p+=N,g+=j);var O=u.parentNode;u=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(m&&Math.abs(p)<1||!m&&Math.abs(g)<1)&&(f=!0),f},Dp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ZL=function(e){return[e.deltaX,e.deltaY]},QL=function(e){return e&&"current"in e?e.current:e},$ye=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Iye=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},Lye=0,Sc=[];function Bye(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),a=y.useState(Lye++)[0],i=y.useState(hF)[0],l=y.useRef(e);y.useEffect(function(){l.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var b=oye([e.lockRef.current],(e.shards||[]).map(QL),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=y.useCallback(function(b,w){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var N=Dp(b),O=n.current,C="deltaX"in b?b.deltaX:O[0]-N[0],A="deltaY"in b?b.deltaY:O[1]-N[1],E,k=b.target,T=Math.abs(C)>Math.abs(A)?"h":"v";if("touches"in b&&T==="h"&&k.type==="range")return!1;var P=XL(T,k);if(!P)return!0;if(P?E=T:(E=T==="v"?"h":"v",P=XL(T,k)),!P)return!1;if(!r.current&&"changedTouches"in b&&(C||A)&&(r.current=E),!E)return!0;var $=r.current||E;return Dye($,w,b,$==="h"?C:A)},[]),d=y.useCallback(function(b){var w=b;if(!(!Sc.length||Sc[Sc.length-1]!==i)){var N="deltaY"in w?ZL(w):Dp(w),O=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&$ye(E.delta,N)})[0];if(O&&O.should){w.cancelable&&w.preventDefault();return}if(!O){var C=(l.current.shards||[]).map(QL).filter(Boolean).filter(function(E){return E.contains(w.target)}),A=C.length>0?u(w,C[0]):!l.current.noIsolation;A&&w.cancelable&&w.preventDefault()}}},[]),f=y.useCallback(function(b,w,N,O){var C={name:b,delta:w,target:N,should:O,shadowParent:zye(N)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(A){return A!==C})},1)},[]),m=y.useCallback(function(b){n.current=Dp(b),r.current=void 0},[]),p=y.useCallback(function(b){f(b.type,ZL(b),b.target,u(b,e.lockRef.current))},[]),g=y.useCallback(function(b){f(b.type,Dp(b),b.target,u(b,e.lockRef.current))},[]);y.useEffect(function(){return Sc.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",d,jc),document.addEventListener("touchmove",d,jc),document.addEventListener("touchstart",m,jc),function(){Sc=Sc.filter(function(b){return b!==i}),document.removeEventListener("wheel",d,jc),document.removeEventListener("touchmove",d,jc),document.removeEventListener("touchstart",m,jc)}},[]);var x=e.removeScrollBar,j=e.inert;return y.createElement(y.Fragment,null,j?y.createElement(i,{styles:Iye(a)}):null,x?y.createElement(Eye,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function zye(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const qye=pye(fF,Bye);var $h=y.forwardRef(function(e,t){return y.createElement(Ty,Ja({},e,{ref:t,sideCar:qye}))});$h.classNames=Ty.classNames;var Fye=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},_c=new WeakMap,$p=new WeakMap,Ip={},KS=0,gF=function(e){return e&&(e.host||gF(e.parentNode))},Uye=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=gF(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Hye=function(e,t,n,r){var a=Uye(t,Array.isArray(e)?e:[e]);Ip[n]||(Ip[n]=new WeakMap);var i=Ip[n],l=[],u=new Set,d=new Set(a),f=function(p){!p||u.has(p)||(u.add(p),f(p.parentNode))};a.forEach(f);var m=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(g){if(u.has(g))m(g);else try{var x=g.getAttribute(r),j=x!==null&&x!=="false",b=(_c.get(g)||0)+1,w=(i.get(g)||0)+1;_c.set(g,b),i.set(g,w),l.push(g),b===1&&j&&$p.set(g,!0),w===1&&g.setAttribute(n,"true"),j||g.setAttribute(r,"true")}catch(N){console.error("aria-hidden: cannot operate on ",g,N)}})};return m(t),u.clear(),KS++,function(){l.forEach(function(p){var g=_c.get(p)-1,x=i.get(p)-1;_c.set(p,g),i.set(p,x),g||($p.has(p)||p.removeAttribute(r),$p.delete(p)),x||p.removeAttribute(n)}),KS--,KS||(_c=new WeakMap,_c=new WeakMap,$p=new WeakMap,Ip={})}},ky=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=Fye(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),Hye(r,a,n,"aria-hidden")):function(){return null}};function Wye(e){const t=Vye(e),n=y.forwardRef((r,a)=>{const{children:i,...l}=r,u=y.Children.toArray(i),d=u.find(Yye);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return s.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function Vye(e){const t=y.forwardRef((n,r)=>{const{children:a,...i}=n;if(y.isValidElement(a)){const l=Xye(a),u=Kye(i,a.props);return a.type!==y.Fragment&&(u.ref=r?Tr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gye=Symbol("radix.slottable");function Yye(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Gye}function Kye(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function Xye(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Py="Dialog",[yF,xF]=ur(Py),[Zye,Ha]=yF(Py),bF=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,u=y.useRef(null),d=y.useRef(null),[f,m]=wa({prop:r,defaultProp:a??!1,onChange:i,caller:Py});return s.jsx(Zye,{scope:t,triggerRef:u,contentRef:d,contentId:kn(),titleId:kn(),descriptionId:kn(),open:f,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(p=>!p),[m]),modal:l,children:n})};bF.displayName=Py;var wF="DialogTrigger",jF=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ha(wF,n),i=qe(t,a.triggerRef);return s.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":QC(a.open),...r,ref:i,onClick:Se(e.onClick,a.onOpenToggle)})});jF.displayName=wF;var XC="DialogPortal",[Qye,SF]=yF(XC,{forceMount:void 0}),_F=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Ha(XC,t);return s.jsx(Qye,{scope:t,forceMount:n,children:y.Children.map(r,l=>s.jsx(Sn,{present:n||i.open,children:s.jsx(jl,{asChild:!0,container:a,children:l})}))})};_F.displayName=XC;var xg="DialogOverlay",NF=y.forwardRef((e,t)=>{const n=SF(xg,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Ha(xg,e.__scopeDialog);return i.modal?s.jsx(Sn,{present:r||i.open,children:s.jsx(exe,{...a,ref:t})}):null});NF.displayName=xg;var Jye=Wye("DialogOverlay.RemoveScroll"),exe=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ha(xg,n);return s.jsx($h,{as:Jye,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(Me.div,{"data-state":QC(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ul="DialogContent",OF=y.forwardRef((e,t)=>{const n=SF(ul,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Ha(ul,e.__scopeDialog);return s.jsx(Sn,{present:r||i.open,children:i.modal?s.jsx(txe,{...a,ref:t}):s.jsx(nxe,{...a,ref:t})})});OF.displayName=ul;var txe=y.forwardRef((e,t)=>{const n=Ha(ul,e.__scopeDialog),r=y.useRef(null),a=qe(t,n.contentRef,r);return y.useEffect(()=>{const i=r.current;if(i)return ky(i)},[]),s.jsx(CF,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Se(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Se(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&i.preventDefault()}),onFocusOutside:Se(e.onFocusOutside,i=>i.preventDefault())})}),nxe=y.forwardRef((e,t)=>{const n=Ha(ul,e.__scopeDialog),r=y.useRef(!1),a=y.useRef(!1);return s.jsx(CF,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;n.triggerRef.current?.contains(l)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),CF=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=e,u=Ha(ul,n),d=y.useRef(null),f=qe(t,d);return Ay(),s.jsxs(s.Fragment,{children:[s.jsx(Dh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(wl,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":QC(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(axe,{titleId:u.titleId}),s.jsx(oxe,{contentRef:d,descriptionId:u.descriptionId})]})]})}),ZC="DialogTitle",EF=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ha(ZC,n);return s.jsx(Me.h2,{id:a.titleId,...r,ref:t})});EF.displayName=ZC;var AF="DialogDescription",TF=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ha(AF,n);return s.jsx(Me.p,{id:a.descriptionId,...r,ref:t})});TF.displayName=AF;var kF="DialogClose",PF=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ha(kF,n);return s.jsx(Me.button,{type:"button",...r,ref:t,onClick:Se(e.onClick,()=>a.onOpenChange(!1))})});PF.displayName=kF;function QC(e){return e?"open":"closed"}var MF="DialogTitleWarning",[rxe,RF]=ZX(MF,{contentName:ul,titleName:ZC,docsSlug:"dialog"}),axe=({titleId:e})=>{const t=RF(MF),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ixe="DialogDescriptionWarning",oxe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${RF(ixe).contentName}}.`;return y.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},JC=bF,DF=jF,eE=_F,My=NF,Ry=OF,tE=EF,nE=TF,rE=PF;const Jn=JC,$F=DF,sxe=eE,IF=y.forwardRef(({className:e,...t},n)=>s.jsx(My,{ref:n,className:ue("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));IF.displayName=My.displayName;const zn=y.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(sxe,{children:[s.jsx(IF,{}),s.jsxs(Ry,{ref:r,className:ue("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,s.jsxs(rE,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[s.jsx(_y,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));zn.displayName=Ry.displayName;const qn=({className:e,...t})=>s.jsx("div",{className:ue("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});qn.displayName="DialogHeader";const Pr=({className:e,...t})=>s.jsx("div",{className:ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Pr.displayName="DialogFooter";const Fn=y.forwardRef(({className:e,...t},n)=>s.jsx(tE,{ref:n,className:ue("text-lg font-semibold leading-none tracking-tight",e),...t}));Fn.displayName=tE.displayName;const lr=y.forwardRef(({className:e,...t},n)=>s.jsx(nE,{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));lr.displayName=nE.displayName;var lxe=Symbol("radix.slottable");function cxe(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=lxe,t}var LF="AlertDialog",[uxe]=ur(LF,[xF]),co=xF(),BF=e=>{const{__scopeAlertDialog:t,...n}=e,r=co(t);return s.jsx(JC,{...r,...n,modal:!0})};BF.displayName=LF;var dxe="AlertDialogTrigger",zF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=co(n);return s.jsx(DF,{...a,...r,ref:t})});zF.displayName=dxe;var fxe="AlertDialogPortal",qF=e=>{const{__scopeAlertDialog:t,...n}=e,r=co(t);return s.jsx(eE,{...r,...n})};qF.displayName=fxe;var hxe="AlertDialogOverlay",FF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=co(n);return s.jsx(My,{...a,...r,ref:t})});FF.displayName=hxe;var Hc="AlertDialogContent",[mxe,pxe]=uxe(Hc),vxe=cxe("AlertDialogContent"),UF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=co(n),l=y.useRef(null),u=qe(t,l),d=y.useRef(null);return s.jsx(rxe,{contentName:Hc,titleName:HF,docsSlug:"alert-dialog",children:s.jsx(mxe,{scope:n,cancelRef:d,children:s.jsxs(Ry,{role:"alertdialog",...i,...a,ref:u,onOpenAutoFocus:Se(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[s.jsx(vxe,{children:r}),s.jsx(yxe,{contentRef:l})]})})})});UF.displayName=Hc;var HF="AlertDialogTitle",WF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=co(n);return s.jsx(tE,{...a,...r,ref:t})});WF.displayName=HF;var VF="AlertDialogDescription",GF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=co(n);return s.jsx(nE,{...a,...r,ref:t})});GF.displayName=VF;var gxe="AlertDialogAction",YF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=co(n);return s.jsx(rE,{...a,...r,ref:t})});YF.displayName=gxe;var KF="AlertDialogCancel",XF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=pxe(KF,n),i=co(n),l=qe(t,a);return s.jsx(rE,{...i,...r,ref:l})});XF.displayName=KF;var yxe=({contentRef:e})=>{const t=`\`${Hc}\` requires a description for the component to be accessible for screen reader users. - -You can add a description to the \`${Hc}\` by passing a \`${VF}\` component as a child, which also benefits sighted users by adding visible context to the dialog. - -Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Hc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. - -For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return y.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},xxe=BF,bxe=zF,wxe=qF,ZF=FF,QF=UF,JF=YF,e8=XF,t8=WF,n8=GF;const Qn=xxe,Ia=bxe,jxe=wxe,r8=y.forwardRef(({className:e,...t},n)=>s.jsx(ZF,{className:ue("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));r8.displayName=ZF.displayName;const Pn=y.forwardRef(({className:e,...t},n)=>s.jsxs(jxe,{children:[s.jsx(r8,{}),s.jsx(QF,{ref:n,className:ue("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Pn.displayName=QF.displayName;const Mn=({className:e,...t})=>s.jsx("div",{className:ue("flex flex-col space-y-2 text-center sm:text-left",e),...t});Mn.displayName="AlertDialogHeader";const Rn=({className:e,...t})=>s.jsx("div",{className:ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Rn.displayName="AlertDialogFooter";const Dn=y.forwardRef(({className:e,...t},n)=>s.jsx(t8,{ref:n,className:ue("text-lg font-semibold",e),...t}));Dn.displayName=t8.displayName;const $n=y.forwardRef(({className:e,...t},n)=>s.jsx(n8,{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));$n.displayName=n8.displayName;const In=y.forwardRef(({className:e,...t},n)=>s.jsx(JF,{ref:n,className:ue(lh(),e),...t}));In.displayName=JF.displayName;const Ln=y.forwardRef(({className:e,...t},n)=>s.jsx(e8,{ref:n,className:ue(lh({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Ln.displayName=e8.displayName;function Sxe(){return s.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[s.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),s.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),s.jsxs(al,{defaultValue:"appearance",className:"w-full",children:[s.jsxs(Yo,{className:"grid w-full max-w-full sm:max-w-2xl grid-cols-3",children:[s.jsxs(Tt,{value:"appearance",className:"gap-2",children:[s.jsx(Sf,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"外观"]}),s.jsxs(Tt,{value:"security",className:"gap-2",children:[s.jsx(Zve,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"安全"]}),s.jsxs(Tt,{value:"about",className:"gap-2",children:[s.jsx(Uq,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"关于"]})]}),s.jsxs(Kt,{className:"h-[calc(100vh-280px)] mt-6",children:[s.jsx(Jt,{value:"appearance",className:"mt-0",children:s.jsx(_xe,{})}),s.jsx(Jt,{value:"security",className:"mt-0",children:s.jsx(Nxe,{})}),s.jsx(Jt,{value:"about",className:"mt-0",children:s.jsx(Oxe,{})})]})]})]})}function JL(e){const t=document.documentElement,r={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[e];if(r)t.style.setProperty("--primary",r.hsl),r.gradient?(t.style.setProperty("--primary-gradient",r.gradient),t.classList.add("has-gradient")):(t.style.removeProperty("--primary-gradient"),t.classList.remove("has-gradient"));else if(e.startsWith("#")){const a=i=>{i=i.replace("#","");const l=parseInt(i.substring(0,2),16)/255,u=parseInt(i.substring(2,4),16)/255,d=parseInt(i.substring(4,6),16)/255,f=Math.max(l,u,d),m=Math.min(l,u,d);let p=0,g=0;const x=(f+m)/2;if(f!==m){const j=f-m;switch(g=x>.5?j/(2-f-m):j/(f+m),f){case l:p=((u-d)/j+(ulocalStorage.getItem("accent-color")||"blue");y.useEffect(()=>{const f=localStorage.getItem("accent-color")||"blue";JL(f)},[]);const d=f=>{u(f),localStorage.setItem("accent-color",f),JL(f)};return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"主题模式"}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[s.jsx(XS,{value:"light",current:e,onChange:t,label:"浅色",description:"始终使用浅色主题"}),s.jsx(XS,{value:"dark",current:e,onChange:t,label:"深色",description:"始终使用深色主题"}),s.jsx(XS,{value:"system",current:e,onChange:t,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"主题色"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium mb-3",children:"单色"}),s.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-3",children:[s.jsx(va,{value:"blue",current:l,onChange:d,label:"蓝色",colorClass:"bg-blue-500"}),s.jsx(va,{value:"purple",current:l,onChange:d,label:"紫色",colorClass:"bg-purple-500"}),s.jsx(va,{value:"green",current:l,onChange:d,label:"绿色",colorClass:"bg-green-500"}),s.jsx(va,{value:"orange",current:l,onChange:d,label:"橙色",colorClass:"bg-orange-500"}),s.jsx(va,{value:"pink",current:l,onChange:d,label:"粉色",colorClass:"bg-pink-500"}),s.jsx(va,{value:"red",current:l,onChange:d,label:"红色",colorClass:"bg-red-500"})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium mb-3",children:"渐变色"}),s.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-3",children:[s.jsx(va,{value:"gradient-sunset",current:l,onChange:d,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),s.jsx(va,{value:"gradient-ocean",current:l,onChange:d,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),s.jsx(va,{value:"gradient-forest",current:l,onChange:d,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),s.jsx(va,{value:"gradient-aurora",current:l,onChange:d,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),s.jsx(va,{value:"gradient-fire",current:l,onChange:d,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),s.jsx(va,{value:"gradient-twilight",current:l,onChange:d,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium mb-3",children:"自定义颜色"}),s.jsxs("div",{className:"flex gap-4 items-center",children:[s.jsx("div",{className:"flex-1",children:s.jsx("input",{type:"color",value:l.startsWith("#")?l:"#3b82f6",onChange:f=>d(f.target.value),className:"h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),s.jsx("div",{className:"flex-1",children:s.jsx(Oe,{type:"text",value:l,onChange:f=>d(f.target.value),placeholder:"#3b82f6",className:"font-mono"})})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"动画效果"}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"rounded-lg border bg-card p-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5 flex-1",children:[s.jsx(re,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),s.jsx(ht,{id:"animations",checked:n,onCheckedChange:r})]})}),s.jsx("div",{className:"rounded-lg border bg-card p-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5 flex-1",children:[s.jsx(re,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),s.jsx(ht,{id:"waves-background",checked:a,onCheckedChange:i})]})})]})]})]})}function Nxe(){const e=qa(),[t,n]=y.useState(""),[r,a]=y.useState(""),[i,l]=y.useState(!1),[u,d]=y.useState(!1),[f,m]=y.useState(!1),[p,g]=y.useState(!1),[x,j]=y.useState(!1),[b,w]=y.useState(!1),[N,O]=y.useState(""),[C,A]=y.useState(!1),{toast:E}=Dr(),k=y.useMemo(()=>zge(r),[r]),T=()=>localStorage.getItem("access-token")||"",P=async H=>{try{await navigator.clipboard.writeText(H),j(!0),E({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>j(!1),2e3)}catch{E({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},$=async()=>{if(!r.trim()){E({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!k.isValid){const H=k.rules.filter(G=>!G.passed).map(G=>G.label).join(", ");E({title:"格式错误",description:`Token 不符合要求: ${H}`,variant:"destructive"});return}m(!0);try{const H=T(),G=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${H}`},body:JSON.stringify({new_token:r.trim()})}),L=await G.json();G.ok&&L.success?(localStorage.setItem("access-token",r.trim()),a(""),t&&n(r.trim()),E({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{localStorage.removeItem("access-token"),e({to:"/auth"})},1500)):E({title:"更新失败",description:L.message||"无法更新 Token",variant:"destructive"})}catch(H){console.error("更新 Token 错误:",H),E({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{m(!1)}},F=async()=>{g(!0);try{const H=T(),G=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${H}`}}),L=await G.json();G.ok&&L.success?(localStorage.setItem("access-token",L.token),n(L.token),O(L.token),w(!0),A(!1),E({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):E({title:"生成失败",description:L.message||"无法生成新 Token",variant:"destructive"})}catch(H){console.error("生成 Token 错误:",H),E({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{g(!1)}},D=async()=>{try{await navigator.clipboard.writeText(N),A(!0),E({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{E({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},U=()=>{w(!1),setTimeout(()=>{O(""),A(!1)},300),setTimeout(()=>{localStorage.removeItem("access-token"),e({to:"/auth"})},500)},V=H=>{H||U()};return s.jsxs("div",{className:"space-y-6",children:[s.jsx(Jn,{open:b,onOpenChange:V,children:s.jsxs(zn,{className:"sm:max-w-md",children:[s.jsxs(qn,{children:[s.jsxs(Fn,{className:"flex items-center gap-2",children:[s.jsx(Fc,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),s.jsx(lr,{children:"这是您的新 Token,请立即保存。关闭此窗口后将跳转到登录页面。"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[s.jsx(re,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),s.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:N})]}),s.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Fc,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),s.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[s.jsx("p",{className:"font-semibold",children:"重要提示"}),s.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[s.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),s.jsx("li",{children:"请立即复制并保存到安全的位置"}),s.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),s.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),s.jsxs(Pr,{className:"gap-2 sm:gap-0",children:[s.jsx(me,{variant:"outline",onClick:D,className:"gap-2",children:C?s.jsxs(s.Fragment,{children:[s.jsx(Js,{className:"h-4 w-4 text-green-500"}),"已复制"]}):s.jsxs(s.Fragment,{children:[s.jsx(zN,{className:"h-4 w-4"}),"复制 Token"]})}),s.jsx(me,{onClick:U,children:"我已保存,关闭"})]})]})}),s.jsxs("div",{className:"rounded-lg border bg-card p-6",children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"当前 Access Token"}),s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"current-token",children:"您的访问令牌"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Oe,{id:"current-token",type:i?"text":"password",value:t||T(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),s.jsx("button",{onClick:()=>{t||n(T()),l(!i)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:i?"隐藏":"显示",children:i?s.jsx(FN,{className:"h-4 w-4 text-muted-foreground"}):s.jsx(to,{className:"h-4 w-4 text-muted-foreground"})})]}),s.jsx(me,{variant:"outline",size:"icon",onClick:()=>P(T()),title:"复制到剪贴板",children:x?s.jsx(Js,{className:"h-4 w-4 text-green-500"}):s.jsx(zN,{className:"h-4 w-4"})}),s.jsxs(Qn,{children:[s.jsx(Ia,{asChild:!0,children:s.jsxs(me,{variant:"outline",disabled:p,className:"gap-2",children:[s.jsx(tl,{className:ue("h-4 w-4",p&&"animate-spin")}),"重新生成"]})}),s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsx(Dn,{children:"确认重新生成 Token"}),s.jsx($n,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:F,children:"确认生成"})]})]})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),s.jsxs("div",{className:"rounded-lg border bg-card p-6",children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"自定义 Access Token"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"new-token",children:"新的访问令牌"}),s.jsxs("div",{className:"relative",children:[s.jsx(Oe,{id:"new-token",type:u?"text":"password",value:r,onChange:H=>a(H.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),s.jsx("button",{onClick:()=>d(!u),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:u?"隐藏":"显示",children:u?s.jsx(FN,{className:"h-4 w-4 text-muted-foreground"}):s.jsx(to,{className:"h-4 w-4 text-muted-foreground"})})]}),r&&s.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),s.jsx("div",{className:"space-y-1.5",children:k.rules.map(H=>s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[H.passed?s.jsx(mg,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):s.jsx(Fq,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),s.jsx("span",{className:ue(H.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:H.label})]},H.id))}),k.isValid&&s.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:s.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[s.jsx(Js,{className:"h-4 w-4"}),s.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),s.jsx(me,{onClick:$,disabled:f||!k.isValid||!r,className:"w-full sm:w-auto",children:f?"更新中...":"更新自定义 Token"})]})]}),s.jsxs("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-4",children:[s.jsx("h4",{className:"font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),s.jsxs("ul",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[s.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),s.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),s.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),s.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),s.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),s.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function Oxe(){return s.jsx("div",{className:"space-y-6",children:s.jsxs("div",{className:"rounded-lg border bg-card p-6",children:[s.jsxs("h3",{className:"text-lg font-semibold mb-4",children:["关于 ",iF]}),s.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[s.jsxs("p",{children:["版本: ",KC]}),s.jsx("p",{children:"基于 React 19 + Vite + TanStack Router"})]})]})})}function XS({value:e,current:t,onChange:n,label:r,description:a}){const i=t===e;return s.jsxs("button",{onClick:()=>n(e),className:ue("relative rounded-lg border-2 p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",i?"border-primary bg-accent":"border-border"),children:[i&&s.jsx("div",{className:"absolute top-3 right-3 h-2 w-2 rounded-full bg-primary"}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"font-medium",children:r}),s.jsx("div",{className:"text-xs text-muted-foreground",children:a})]}),s.jsxs("div",{className:"mt-3 flex gap-1",children:[e==="light"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),s.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),s.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),e==="dark"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),s.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),s.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),e==="system"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),s.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),s.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function va({value:e,current:t,onChange:n,label:r,colorClass:a}){const i=t===e;return s.jsxs("button",{onClick:()=>n(e),className:ue("relative rounded-lg border-2 p-3 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",i?"border-primary bg-accent":"border-border"),children:[i&&s.jsx("div",{className:"absolute top-2 right-2 h-2 w-2 rounded-full bg-primary"}),s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx("div",{className:ue("h-10 w-10 rounded-full",a)}),s.jsx("div",{className:"text-xs font-medium",children:r})]})]})}class Cxe{grad3;p;perm;constructor(t=0){this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.p=[];for(let n=0;n<256;n++)this.p[n]=Math.floor(Math.random()*256);this.perm=[];for(let n=0;n<512;n++)this.perm[n]=this.p[n&255]}dot(t,n,r){return t[0]*n+t[1]*r}mix(t,n,r){return(1-r)*t+r*n}fade(t){return t*t*t*(t*(t*6-15)+10)}perlin2(t,n){const r=Math.floor(t)&255,a=Math.floor(n)&255;t-=Math.floor(t),n-=Math.floor(n);const i=this.fade(t),l=this.fade(n),u=this.perm[r]+a,d=this.perm[u],f=this.perm[u+1],m=this.perm[r+1]+a,p=this.perm[m],g=this.perm[m+1];return this.mix(this.mix(this.dot(this.grad3[d%12],t,n),this.dot(this.grad3[p%12],t-1,n),i),this.mix(this.dot(this.grad3[f%12],t,n-1),this.dot(this.grad3[g%12],t-1,n-1),i),l)}}function Exe(){const e=y.useRef(null),t=y.useRef(null),n=y.useRef(void 0),r=y.useRef({mouse:{x:-10,y:0,lx:0,ly:0,sx:0,sy:0,v:0,vs:0,a:0,set:!1},lines:[],paths:[],noise:new Cxe(Math.random()),bounding:null});return y.useEffect(()=>{const a=t.current,i=e.current;if(!a||!i)return;const l=r.current,u=()=>{const b=a.getBoundingClientRect();l.bounding=b,i.style.width=`${b.width}px`,i.style.height=`${b.height}px`},d=()=>{if(!l.bounding)return;const{width:b,height:w}=l.bounding;l.lines=[],l.paths.forEach($=>$.remove()),l.paths=[];const N=10,O=32,C=b+200,A=w+30,E=Math.ceil(C/N),k=Math.ceil(A/O),T=(b-N*E)/2,P=(w-O*k)/2;for(let $=0;$<=E;$++){const F=[];for(let U=0;U<=k;U++){const V={x:T+N*$,y:P+O*U,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};F.push(V)}const D=document.createElementNS("http://www.w3.org/2000/svg","path");i.appendChild(D),l.paths.push(D),l.lines.push(F)}},f=b=>{const{lines:w,mouse:N,noise:O}=l;w.forEach(C=>{C.forEach(A=>{const E=O.perlin2((A.x+b*.0125)*.002,(A.y+b*.005)*.0015)*12;A.wave.x=Math.cos(E)*32,A.wave.y=Math.sin(E)*16;const k=A.x-N.sx,T=A.y-N.sy,P=Math.hypot(k,T),$=Math.max(175,N.vs);if(P<$){const F=1-P/$,D=Math.cos(P*.001)*F;A.cursor.vx+=Math.cos(N.a)*D*$*N.vs*65e-5,A.cursor.vy+=Math.sin(N.a)*D*$*N.vs*65e-5}A.cursor.vx+=(0-A.cursor.x)*.005,A.cursor.vy+=(0-A.cursor.y)*.005,A.cursor.vx*=.925,A.cursor.vy*=.925,A.cursor.x+=A.cursor.vx*2,A.cursor.y+=A.cursor.vy*2,A.cursor.x=Math.min(100,Math.max(-100,A.cursor.x)),A.cursor.y=Math.min(100,Math.max(-100,A.cursor.y))})})},m=(b,w=!0)=>{const N={x:b.x+b.wave.x+(w?b.cursor.x:0),y:b.y+b.wave.y+(w?b.cursor.y:0)};return N.x=Math.round(N.x*10)/10,N.y=Math.round(N.y*10)/10,N},p=()=>{const{lines:b,paths:w}=l;b.forEach((N,O)=>{let C=m(N[0],!1),A=`M ${C.x} ${C.y}`;N.forEach((E,k)=>{const T=k===N.length-1;C=m(E,!T),A+=`L ${C.x} ${C.y}`}),w[O].setAttribute("d",A)})},g=b=>{const{mouse:w}=l;w.sx+=(w.x-w.sx)*.1,w.sy+=(w.y-w.sy)*.1;const N=w.x-w.lx,O=w.y-w.ly,C=Math.hypot(N,O);w.v=C,w.vs+=(C-w.vs)*.1,w.vs=Math.min(100,w.vs),w.lx=w.x,w.ly=w.y,w.a=Math.atan2(O,N),a&&(a.style.setProperty("--x",`${w.sx}px`),a.style.setProperty("--y",`${w.sy}px`)),f(b),p(),n.current=requestAnimationFrame(g)},x=b=>{if(!l.bounding)return;const{mouse:w}=l;w.x=b.pageX-l.bounding.left,w.y=b.pageY-l.bounding.top+window.scrollY,w.set||(w.sx=w.x,w.sy=w.y,w.lx=w.x,w.ly=w.y,w.set=!0)},j=()=>{u(),d()};return u(),d(),window.addEventListener("resize",j),window.addEventListener("mousemove",x),n.current=requestAnimationFrame(g),()=>{window.removeEventListener("resize",j),window.removeEventListener("mousemove",x),n.current&&cancelAnimationFrame(n.current)}},[]),s.jsxs("div",{ref:t,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[s.jsx("div",{className:"waves-cursor",style:{position:"absolute",top:0,left:0,width:"0.5rem",height:"0.5rem",background:"hsl(var(--primary) / 0.3)",borderRadius:"50%",transform:"translate3d(calc(var(--x, -0.5rem) - 50%), calc(var(--y, 50%) - 50%), 0)",willChange:"transform",pointerEvents:"none"}}),s.jsx("svg",{ref:e,style:{display:"block",width:"100%",height:"100%"},children:s.jsx("style",{children:` - path { - fill: none; - stroke: hsl(var(--primary) / 0.20); - stroke-width: 1px; - } - `})})]})}function Axe(){const e=qa();y.useEffect(()=>{localStorage.getItem("access-token")||e({to:"/auth"})},[e])}function a8(){return!!localStorage.getItem("access-token")}function Txe(){const[e,t]=y.useState(""),[n,r]=y.useState(!1),[a,i]=y.useState(""),l=qa(),{enableWavesBackground:u,setEnableWavesBackground:d}=Xq(),{theme:f,setTheme:m}=YC();y.useEffect(()=>{a8()&&l({to:"/"})},[l]);const g=f==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":f,x=()=>{m(g==="dark"?"light":"dark")},j=async b=>{if(b.preventDefault(),i(""),!e.trim()){i("请输入 Access Token");return}r(!0);try{const w=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e.trim()})}),N=await w.json();w.ok&&N.valid?(localStorage.setItem("access-token",e.trim()),l({to:"/"})):i(N.message||"Token 验证失败,请检查后重试")}catch(w){console.error("Token 验证错误:",w),i("连接服务器失败,请检查网络连接")}finally{r(!1)}};return s.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[u&&s.jsx(Exe,{}),s.jsxs(ct,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[s.jsx("button",{onClick:x,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:g==="dark"?"切换到浅色模式":"切换到深色模式",children:g==="dark"?s.jsx(VN,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):s.jsx(WN,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),s.jsxs(Ut,{className:"space-y-4 text-center",children:[s.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:s.jsx(DL,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ht,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),s.jsx(Xn,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),s.jsx(un,{children:s.jsxs("form",{onSubmit:j,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),s.jsxs("div",{className:"relative",children:[s.jsx(_ve,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),s.jsx(Oe,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:e,onChange:b=>t(b.target.value),className:ue("pl-10",a&&"border-red-500 focus-visible:ring-red-500"),disabled:n,autoFocus:!0,autoComplete:"off"})]})]}),a&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-red-50 p-3 text-sm text-red-600 dark:bg-red-950/50 dark:text-red-400",children:[s.jsx(hg,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),s.jsx("span",{children:a})]}),s.jsx(me,{type:"submit",className:"w-full",disabled:n,children:n?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),s.jsxs(Jn,{children:[s.jsx($F,{asChild:!0,children:s.jsxs("button",{className:"w-full text-center text-sm text-primary hover:text-primary/80 transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[s.jsx(eve,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),s.jsxs(zn,{className:"sm:max-w-md",children:[s.jsxs(qn,{children:[s.jsxs(Fn,{className:"flex items-center gap-2",children:[s.jsx(DL,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),s.jsx(lr,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(rge,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),s.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[s.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),s.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),s.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(WC,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),s.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:s.jsx("code",{className:"text-primary",children:"data/webui.json"})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",s.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),s.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(hg,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),s.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[s.jsx("p",{className:"font-semibold",children:"安全提示"}),s.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[s.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),s.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]}),s.jsxs(Qn,{children:[s.jsx(Ia,{asChild:!0,children:s.jsxs("button",{className:"w-full text-center text-sm text-muted-foreground hover:text-foreground transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[s.jsx(GN,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsxs(Dn,{className:"flex items-center gap-2",children:[s.jsx(GN,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),s.jsx($n,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),s.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:()=>d(!1),children:"关闭动画"})]})]})]})]})})]}),s.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:s.jsx("p",{children:qge})})]})}function i8(){const e=qa();return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs("div",{className:"w-full max-w-2xl text-center",children:[s.jsxs("div",{className:"relative mb-8",children:[s.jsx("h1",{className:"text-[150px] font-black leading-none text-primary/10 select-none sm:text-[200px]",children:"404"}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s.jsx(kr,{className:"h-20 w-20 text-primary/30 sm:h-24 sm:w-24"})})]}),s.jsxs("div",{className:"space-y-4 mb-8",children:[s.jsx("h2",{className:"text-2xl font-bold text-foreground sm:text-3xl",children:"页面未找到"}),s.jsx("p",{className:"text-base text-muted-foreground sm:text-lg max-w-md mx-auto",children:"抱歉,您访问的页面不存在或已被移除。请检查 URL 是否正确,或返回首页继续浏览。"})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[s.jsxs(me,{size:"lg",onClick:()=>e({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[s.jsx(gg,{className:"h-4 w-4"}),"返回首页"]}),s.jsxs(me,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[s.jsx(Lq,{className:"h-4 w-4"}),"返回上一页"]})]}),s.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}const fn=y.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:ue("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));fn.displayName="Textarea";var o8=["PageUp","PageDown"],s8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],l8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Fu="Slider",[XN,kxe,Pxe]=wh(Fu),[c8]=ur(Fu,[Pxe]),[Mxe,Dy]=c8(Fu),u8=y.forwardRef((e,t)=>{const{name:n,min:r=0,max:a=100,step:i=1,orientation:l="horizontal",disabled:u=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[r],value:m,onValueChange:p=()=>{},onValueCommit:g=()=>{},inverted:x=!1,form:j,...b}=e,w=y.useRef(new Set),N=y.useRef(0),C=l==="horizontal"?Rxe:Dxe,[A=[],E]=wa({prop:m,defaultProp:f,onChange:D=>{[...w.current][N.current]?.focus(),p(D)}}),k=y.useRef(A);function T(D){const U=zxe(A,D);F(D,U)}function P(D){F(D,N.current)}function $(){const D=k.current[N.current];A[N.current]!==D&&g(A)}function F(D,U,{commit:V}={commit:!1}){const H=Hxe(i),G=Wxe(Math.round((D-r)/i)*i+r,H),L=Nf(G,[r,a]);E((R=[])=>{const q=Lxe(R,L,U);if(Uxe(q,d*i)){N.current=q.indexOf(L);const K=String(q)!==String(R);return K&&V&&g(q),K?q:R}else return R})}return s.jsx(Mxe,{scope:e.__scopeSlider,name:n,disabled:u,min:r,max:a,valueIndexToChangeRef:N,thumbs:w.current,values:A,orientation:l,form:j,children:s.jsx(XN.Provider,{scope:e.__scopeSlider,children:s.jsx(XN.Slot,{scope:e.__scopeSlider,children:s.jsx(C,{"aria-disabled":u,"data-disabled":u?"":void 0,...b,ref:t,onPointerDown:Se(b.onPointerDown,()=>{u||(k.current=A)}),min:r,max:a,inverted:x,onSlideStart:u?void 0:T,onSlideMove:u?void 0:P,onSlideEnd:u?void 0:$,onHomeKeyDown:()=>!u&&F(r,0,{commit:!0}),onEndKeyDown:()=>!u&&F(a,A.length-1,{commit:!0}),onStepKeyDown:({event:D,direction:U})=>{if(!u){const G=o8.includes(D.key)||D.shiftKey&&s8.includes(D.key)?10:1,L=N.current,R=A[L],q=i*G*U;F(R+q,L,{commit:!0})}}})})})})});u8.displayName=Fu;var[d8,f8]=c8(Fu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Rxe=y.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:i,onSlideStart:l,onSlideMove:u,onSlideEnd:d,onStepKeyDown:f,...m}=e,[p,g]=y.useState(null),x=qe(t,C=>g(C)),j=y.useRef(void 0),b=Mu(a),w=b==="ltr",N=w&&!i||!w&&i;function O(C){const A=j.current||p.getBoundingClientRect(),E=[0,A.width],T=aE(E,N?[n,r]:[r,n]);return j.current=A,T(C-A.left)}return s.jsx(d8,{scope:e.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:s.jsx(h8,{dir:b,"data-orientation":"horizontal",...m,ref:x,style:{...m.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const A=O(C.clientX);l?.(A)},onSlideMove:C=>{const A=O(C.clientX);u?.(A)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:C=>{const E=l8[N?"from-left":"from-right"].includes(C.key);f?.({event:C,direction:E?-1:1})}})})}),Dxe=y.forwardRef((e,t)=>{const{min:n,max:r,inverted:a,onSlideStart:i,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,m=y.useRef(null),p=qe(t,m),g=y.useRef(void 0),x=!a;function j(b){const w=g.current||m.current.getBoundingClientRect(),N=[0,w.height],C=aE(N,x?[r,n]:[n,r]);return g.current=w,C(b-w.top)}return s.jsx(d8,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:s.jsx(h8,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const w=j(b.clientY);i?.(w)},onSlideMove:b=>{const w=j(b.clientY);l?.(w)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:b=>{const N=l8[x?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:N?-1:1})}})})}),h8=y.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:l,onEndKeyDown:u,onStepKeyDown:d,...f}=e,m=Dy(Fu,n);return s.jsx(Me.span,{...f,ref:t,onKeyDown:Se(e.onKeyDown,p=>{p.key==="Home"?(l(p),p.preventDefault()):p.key==="End"?(u(p),p.preventDefault()):o8.concat(s8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Se(e.onPointerDown,p=>{const g=p.target;g.setPointerCapture(p.pointerId),p.preventDefault(),m.thumbs.has(g)?g.focus():r(p)}),onPointerMove:Se(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:Se(e.onPointerUp,p=>{const g=p.target;g.hasPointerCapture(p.pointerId)&&(g.releasePointerCapture(p.pointerId),i(p))})})}),m8="SliderTrack",p8=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=Dy(m8,n);return s.jsx(Me.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});p8.displayName=m8;var ZN="SliderRange",v8=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=Dy(ZN,n),i=f8(ZN,n),l=y.useRef(null),u=qe(t,l),d=a.values.length,f=a.values.map(g=>x8(g,a.min,a.max)),m=d>1?Math.min(...f):0,p=100-Math.max(...f);return s.jsx(Me.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:u,style:{...e.style,[i.startEdge]:m+"%",[i.endEdge]:p+"%"}})});v8.displayName=ZN;var QN="SliderThumb",g8=y.forwardRef((e,t)=>{const n=kxe(e.__scopeSlider),[r,a]=y.useState(null),i=qe(t,u=>a(u)),l=y.useMemo(()=>r?n().findIndex(u=>u.ref.current===r):-1,[n,r]);return s.jsx($xe,{...e,ref:i,index:l})}),$xe=y.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...i}=e,l=Dy(QN,n),u=f8(QN,n),[d,f]=y.useState(null),m=qe(t,O=>f(O)),p=d?l.form||!!d.closest("form"):!0,g=Cy(d),x=l.values[r],j=x===void 0?0:x8(x,l.min,l.max),b=Bxe(r,l.values.length),w=g?.[u.size],N=w?qxe(w,j,u.direction):0;return y.useEffect(()=>{if(d)return l.thumbs.add(d),()=>{l.thumbs.delete(d)}},[d,l.thumbs]),s.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${j}% + ${N}px)`},children:[s.jsx(XN.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(Me.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":l.min,"aria-valuenow":x,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...i,ref:m,style:x===void 0?{display:"none"}:e.style,onFocus:Se(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),p&&s.jsx(y8,{name:a??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:x},r)]})});g8.displayName=QN;var Ixe="RadioBubbleInput",y8=y.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=y.useRef(null),i=qe(a,r),l=Oy(t);return y.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&m){const p=new Event("input",{bubbles:!0});m.call(u,t),u.dispatchEvent(p)}},[l,t]),s.jsx(Me.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});y8.displayName=Ixe;function Lxe(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,i)=>a-i)}function x8(e,t,n){const i=100/(n-t)*(e-t);return Nf(i,[0,100])}function Bxe(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function zxe(e,t){if(e.length===1)return 0;const n=e.map(a=>Math.abs(a-t)),r=Math.min(...n);return n.indexOf(r)}function qxe(e,t,n){const r=e/2,i=aE([0,50],[0,r]);return(r-i(t)*n)*n}function Fxe(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Uxe(e,t){if(t>0){const n=Fxe(e);return Math.min(...n)>=t}return!0}function aE(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Hxe(e){return(String(e).split(".")[1]||"").length}function Wxe(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var b8=u8,Vxe=p8,Gxe=v8,Yxe=g8;const iE=y.forwardRef(({className:e,...t},n)=>s.jsxs(b8,{ref:n,className:ue("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(Vxe,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:s.jsx(Gxe,{className:"absolute h-full bg-primary"})}),s.jsx(Yxe,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));iE.displayName=b8.displayName;const Kxe=["top","right","bottom","left"],Ko=Math.min,Xr=Math.max,bg=Math.round,Lp=Math.floor,ui=e=>({x:e,y:e}),Xxe={left:"right",right:"left",bottom:"top",top:"bottom"},Zxe={start:"end",end:"start"};function JN(e,t,n){return Xr(e,Ko(t,n))}function no(e,t){return typeof e=="function"?e(t):e}function ro(e){return e.split("-")[0]}function Uu(e){return e.split("-")[1]}function oE(e){return e==="x"?"y":"x"}function sE(e){return e==="y"?"height":"width"}const Qxe=new Set(["top","bottom"]);function ii(e){return Qxe.has(ro(e))?"y":"x"}function lE(e){return oE(ii(e))}function Jxe(e,t,n){n===void 0&&(n=!1);const r=Uu(e),a=lE(e),i=sE(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=wg(l)),[l,wg(l)]}function ebe(e){const t=wg(e);return[eO(e),t,eO(t)]}function eO(e){return e.replace(/start|end/g,t=>Zxe[t])}const e3=["left","right"],t3=["right","left"],tbe=["top","bottom"],nbe=["bottom","top"];function rbe(e,t,n){switch(e){case"top":case"bottom":return n?t?t3:e3:t?e3:t3;case"left":case"right":return t?tbe:nbe;default:return[]}}function abe(e,t,n,r){const a=Uu(e);let i=rbe(ro(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(eO)))),i}function wg(e){return e.replace(/left|right|bottom|top/g,t=>Xxe[t])}function ibe(e){return{top:0,right:0,bottom:0,left:0,...e}}function w8(e){return typeof e!="number"?ibe(e):{top:e,right:e,bottom:e,left:e}}function jg(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function n3(e,t,n){let{reference:r,floating:a}=e;const i=ii(t),l=lE(t),u=sE(l),d=ro(t),f=i==="y",m=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,g=r[u]/2-a[u]/2;let x;switch(d){case"top":x={x:m,y:r.y-a.height};break;case"bottom":x={x:m,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-a.width,y:p};break;default:x={x:r.x,y:r.y}}switch(Uu(t)){case"start":x[l]-=g*(n&&f?-1:1);break;case"end":x[l]+=g*(n&&f?-1:1);break}return x}const obe=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:m,y:p}=n3(f,r,d),g=r,x={},j=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:l,elements:u,middlewareData:d}=t,{element:f,padding:m=0}=no(e,t)||{};if(f==null)return{};const p=w8(m),g={x:n,y:r},x=lE(a),j=sE(x),b=await l.getDimensions(f),w=x==="y",N=w?"top":"left",O=w?"bottom":"right",C=w?"clientHeight":"clientWidth",A=i.reference[j]+i.reference[x]-g[x]-i.floating[j],E=g[x]-i.reference[x],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let T=k?k[C]:0;(!T||!await(l.isElement==null?void 0:l.isElement(k)))&&(T=u.floating[C]||i.floating[j]);const P=A/2-E/2,$=T/2-b[j]/2-1,F=Ko(p[N],$),D=Ko(p[O],$),U=F,V=T-b[j]-D,H=T/2-b[j]/2+P,G=JN(U,H,V),L=!d.arrow&&Uu(a)!=null&&H!==G&&i.reference[j]/2-(HH<=0)){var D,U;const H=(((D=i.flip)==null?void 0:D.index)||0)+1,G=T[H];if(G&&(!(p==="alignment"?O!==ii(G):!1)||F.every(q=>ii(q.placement)===O?q.overflows[0]>0:!0)))return{data:{index:H,overflows:F},reset:{placement:G}};let L=(U=F.filter(R=>R.overflows[0]<=0).sort((R,q)=>R.overflows[1]-q.overflows[1])[0])==null?void 0:U.placement;if(!L)switch(x){case"bestFit":{var V;const R=(V=F.filter(q=>{if(k){const K=ii(q.placement);return K===O||K==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(K=>K>0).reduce((K,ee)=>K+ee,0)]).sort((q,K)=>q[1]-K[1])[0])==null?void 0:V[0];R&&(L=R);break}case"initialPlacement":L=u;break}if(a!==L)return{reset:{placement:L}}}return{}}}};function r3(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function a3(e){return Kxe.some(t=>e[t]>=0)}const cbe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=no(e,t);switch(r){case"referenceHidden":{const i=await ch(t,{...a,elementContext:"reference"}),l=r3(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:a3(l)}}}case"escaped":{const i=await ch(t,{...a,altBoundary:!0}),l=r3(i,n.floating);return{data:{escapedOffsets:l,escaped:a3(l)}}}default:return{}}}}},j8=new Set(["left","top"]);async function ube(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=ro(n),u=Uu(n),d=ii(n)==="y",f=j8.has(l)?-1:1,m=i&&d?-1:1,p=no(t,e);let{mainAxis:g,crossAxis:x,alignmentAxis:j}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof j=="number"&&(x=u==="end"?j*-1:j),d?{x:x*m,y:g*f}:{x:g*f,y:x*m}}const dbe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:u}=t,d=await ube(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+d.x,y:i+d.y,data:{...d,placement:l}}}}},fbe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:w=>{let{x:N,y:O}=w;return{x:N,y:O}}},...d}=no(e,t),f={x:n,y:r},m=await ch(t,d),p=ii(ro(a)),g=oE(p);let x=f[g],j=f[p];if(i){const w=g==="y"?"top":"left",N=g==="y"?"bottom":"right",O=x+m[w],C=x-m[N];x=JN(O,x,C)}if(l){const w=p==="y"?"top":"left",N=p==="y"?"bottom":"right",O=j+m[w],C=j-m[N];j=JN(O,j,C)}const b=u.fn({...t,[g]:x,[p]:j});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[g]:i,[p]:l}}}}}},hbe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=no(e,t),m={x:n,y:r},p=ii(a),g=oE(p);let x=m[g],j=m[p];const b=no(u,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const C=g==="y"?"height":"width",A=i.reference[g]-i.floating[C]+w.mainAxis,E=i.reference[g]+i.reference[C]-w.mainAxis;xE&&(x=E)}if(f){var N,O;const C=g==="y"?"width":"height",A=j8.has(ro(a)),E=i.reference[p]-i.floating[C]+(A&&((N=l.offset)==null?void 0:N[p])||0)+(A?0:w.crossAxis),k=i.reference[p]+i.reference[C]+(A?0:((O=l.offset)==null?void 0:O[p])||0)-(A?w.crossAxis:0);jk&&(j=k)}return{[g]:x,[p]:j}}}},mbe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:l,elements:u}=t,{apply:d=()=>{},...f}=no(e,t),m=await ch(t,f),p=ro(a),g=Uu(a),x=ii(a)==="y",{width:j,height:b}=i.floating;let w,N;p==="top"||p==="bottom"?(w=p,N=g===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(N=p,w=g==="end"?"top":"bottom");const O=b-m.top-m.bottom,C=j-m.left-m.right,A=Ko(b-m[w],O),E=Ko(j-m[N],C),k=!t.middlewareData.shift;let T=A,P=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=O),k&&!g){const F=Xr(m.left,0),D=Xr(m.right,0),U=Xr(m.top,0),V=Xr(m.bottom,0);x?P=j-2*(F!==0||D!==0?F+D:Xr(m.left,m.right)):T=b-2*(U!==0||V!==0?U+V:Xr(m.top,m.bottom))}await d({...t,availableWidth:P,availableHeight:T});const $=await l.getDimensions(u.floating);return j!==$.width||b!==$.height?{reset:{rects:!0}}:{}}}};function $y(){return typeof window<"u"}function Hu(e){return S8(e)?(e.nodeName||"").toLowerCase():"#document"}function ea(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yi(e){var t;return(t=(S8(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function S8(e){return $y()?e instanceof Node||e instanceof ea(e).Node:!1}function Ba(e){return $y()?e instanceof Element||e instanceof ea(e).Element:!1}function mi(e){return $y()?e instanceof HTMLElement||e instanceof ea(e).HTMLElement:!1}function i3(e){return!$y()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ea(e).ShadowRoot}const pbe=new Set(["inline","contents"]);function Ih(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=za(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!pbe.has(a)}const vbe=new Set(["table","td","th"]);function gbe(e){return vbe.has(Hu(e))}const ybe=[":popover-open",":modal"];function Iy(e){return ybe.some(t=>{try{return e.matches(t)}catch{return!1}})}const xbe=["transform","translate","scale","rotate","perspective"],bbe=["transform","translate","scale","rotate","perspective","filter"],wbe=["paint","layout","strict","content"];function cE(e){const t=uE(),n=Ba(e)?za(e):e;return xbe.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||bbe.some(r=>(n.willChange||"").includes(r))||wbe.some(r=>(n.contain||"").includes(r))}function jbe(e){let t=Xo(e);for(;mi(t)&&!Nu(t);){if(cE(t))return t;if(Iy(t))return null;t=Xo(t)}return null}function uE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Sbe=new Set(["html","body","#document"]);function Nu(e){return Sbe.has(Hu(e))}function za(e){return ea(e).getComputedStyle(e)}function Ly(e){return Ba(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xo(e){if(Hu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||i3(e)&&e.host||yi(e);return i3(t)?t.host:t}function _8(e){const t=Xo(e);return Nu(t)?e.ownerDocument?e.ownerDocument.body:e.body:mi(t)&&Ih(t)?t:_8(t)}function uh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=_8(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=ea(a);if(i){const u=tO(l);return t.concat(l,l.visualViewport||[],Ih(a)?a:[],u&&n?uh(u):[])}return t.concat(a,uh(a,[],n))}function tO(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function N8(e){const t=za(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=mi(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=bg(n)!==i||bg(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function dE(e){return Ba(e)?e:e.contextElement}function Wc(e){const t=dE(e);if(!mi(t))return ui(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=N8(t);let l=(i?bg(n.width):n.width)/r,u=(i?bg(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const _be=ui(0);function O8(e){const t=ea(e);return!uE()||!t.visualViewport?_be:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Nbe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ea(e)?!1:t}function dl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=dE(e);let l=ui(1);t&&(r?Ba(r)&&(l=Wc(r)):l=Wc(e));const u=Nbe(i,n,r)?O8(i):ui(0);let d=(a.left+u.x)/l.x,f=(a.top+u.y)/l.y,m=a.width/l.x,p=a.height/l.y;if(i){const g=ea(i),x=r&&Ba(r)?ea(r):r;let j=g,b=tO(j);for(;b&&r&&x!==j;){const w=Wc(b),N=b.getBoundingClientRect(),O=za(b),C=N.left+(b.clientLeft+parseFloat(O.paddingLeft))*w.x,A=N.top+(b.clientTop+parseFloat(O.paddingTop))*w.y;d*=w.x,f*=w.y,m*=w.x,p*=w.y,d+=C,f+=A,j=ea(b),b=tO(j)}}return jg({width:m,height:p,x:d,y:f})}function By(e,t){const n=Ly(e).scrollLeft;return t?t.left+n:dl(yi(e)).left+n}function C8(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-By(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function Obe(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=yi(r),u=t?Iy(t.floating):!1;if(r===l||u&&i)return n;let d={scrollLeft:0,scrollTop:0},f=ui(1);const m=ui(0),p=mi(r);if((p||!p&&!i)&&((Hu(r)!=="body"||Ih(l))&&(d=Ly(r)),mi(r))){const x=dl(r);f=Wc(r),m.x=x.x+r.clientLeft,m.y=x.y+r.clientTop}const g=l&&!p&&!i?C8(l,d):ui(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+m.x+g.x,y:n.y*f.y-d.scrollTop*f.y+m.y+g.y}}function Cbe(e){return Array.from(e.getClientRects())}function Ebe(e){const t=yi(e),n=Ly(e),r=e.ownerDocument.body,a=Xr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Xr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+By(e);const u=-n.scrollTop;return za(r).direction==="rtl"&&(l+=Xr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:l,y:u}}const o3=25;function Abe(e,t){const n=ea(e),r=yi(e),a=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,d=0;if(a){i=a.width,l=a.height;const m=uE();(!m||m&&t==="fixed")&&(u=a.offsetLeft,d=a.offsetTop)}const f=By(r);if(f<=0){const m=r.ownerDocument,p=m.body,g=getComputedStyle(p),x=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-x);j<=o3&&(i-=j)}else f<=o3&&(i+=f);return{width:i,height:l,x:u,y:d}}const Tbe=new Set(["absolute","fixed"]);function kbe(e,t){const n=dl(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=mi(e)?Wc(e):ui(1),l=e.clientWidth*i.x,u=e.clientHeight*i.y,d=a*i.x,f=r*i.y;return{width:l,height:u,x:d,y:f}}function s3(e,t,n){let r;if(t==="viewport")r=Abe(e,n);else if(t==="document")r=Ebe(yi(e));else if(Ba(t))r=kbe(t,n);else{const a=O8(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return jg(r)}function E8(e,t){const n=Xo(e);return n===t||!Ba(n)||Nu(n)?!1:za(n).position==="fixed"||E8(n,t)}function Pbe(e,t){const n=t.get(e);if(n)return n;let r=uh(e,[],!1).filter(u=>Ba(u)&&Hu(u)!=="body"),a=null;const i=za(e).position==="fixed";let l=i?Xo(e):e;for(;Ba(l)&&!Nu(l);){const u=za(l),d=cE(l);!d&&u.position==="fixed"&&(a=null),(i?!d&&!a:!d&&u.position==="static"&&!!a&&Tbe.has(a.position)||Ih(l)&&!d&&E8(e,l))?r=r.filter(m=>m!==l):a=u,l=Xo(l)}return t.set(e,r),r}function Mbe(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?Iy(t)?[]:Pbe(t,this._c):[].concat(n),r],u=l[0],d=l.reduce((f,m)=>{const p=s3(t,m,a);return f.top=Xr(p.top,f.top),f.right=Ko(p.right,f.right),f.bottom=Ko(p.bottom,f.bottom),f.left=Xr(p.left,f.left),f},s3(t,u,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Rbe(e){const{width:t,height:n}=N8(e);return{width:t,height:n}}function Dbe(e,t,n){const r=mi(t),a=yi(t),i=n==="fixed",l=dl(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const d=ui(0);function f(){d.x=By(a)}if(r||!r&&!i)if((Hu(t)!=="body"||Ih(a))&&(u=Ly(t)),r){const x=dl(t,!0,i,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else a&&f();i&&!r&&a&&f();const m=a&&!r&&!i?C8(a,u):ui(0),p=l.left+u.scrollLeft-d.x-m.x,g=l.top+u.scrollTop-d.y-m.y;return{x:p,y:g,width:l.width,height:l.height}}function ZS(e){return za(e).position==="static"}function l3(e,t){if(!mi(e)||za(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return yi(e)===n&&(n=n.ownerDocument.body),n}function A8(e,t){const n=ea(e);if(Iy(e))return n;if(!mi(e)){let a=Xo(e);for(;a&&!Nu(a);){if(Ba(a)&&!ZS(a))return a;a=Xo(a)}return n}let r=l3(e,t);for(;r&&gbe(r)&&ZS(r);)r=l3(r,t);return r&&Nu(r)&&ZS(r)&&!cE(r)?n:r||jbe(e)||n}const $be=async function(e){const t=this.getOffsetParent||A8,n=this.getDimensions,r=await n(e.floating);return{reference:Dbe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ibe(e){return za(e).direction==="rtl"}const Lbe={convertOffsetParentRelativeRectToViewportRelativeRect:Obe,getDocumentElement:yi,getClippingRect:Mbe,getOffsetParent:A8,getElementRects:$be,getClientRects:Cbe,getDimensions:Rbe,getScale:Wc,isElement:Ba,isRTL:Ibe};function T8(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bbe(e,t){let n=null,r;const a=yi(e);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),i();const f=e.getBoundingClientRect(),{left:m,top:p,width:g,height:x}=f;if(u||t(),!g||!x)return;const j=Lp(p),b=Lp(a.clientWidth-(m+g)),w=Lp(a.clientHeight-(p+x)),N=Lp(m),C={rootMargin:-j+"px "+-b+"px "+-w+"px "+-N+"px",threshold:Xr(0,Ko(1,d))||1};let A=!0;function E(k){const T=k[0].intersectionRatio;if(T!==d){if(!A)return l();T?l(!1,T):r=setTimeout(()=>{l(!1,1e-7)},1e3)}T===1&&!T8(f,e.getBoundingClientRect())&&l(),A=!1}try{n=new IntersectionObserver(E,{...C,root:a.ownerDocument})}catch{n=new IntersectionObserver(E,C)}n.observe(e)}return l(!0),i}function zbe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=dE(e),m=a||i?[...f?uh(f):[],...uh(t)]:[];m.forEach(N=>{a&&N.addEventListener("scroll",n,{passive:!0}),i&&N.addEventListener("resize",n)});const p=f&&u?Bbe(f,n):null;let g=-1,x=null;l&&(x=new ResizeObserver(N=>{let[O]=N;O&&O.target===f&&x&&(x.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=x)==null||C.observe(t)})),n()}),f&&!d&&x.observe(f),x.observe(t));let j,b=d?dl(e):null;d&&w();function w(){const N=dl(e);b&&!T8(b,N)&&n(),b=N,j=requestAnimationFrame(w)}return n(),()=>{var N;m.forEach(O=>{a&&O.removeEventListener("scroll",n),i&&O.removeEventListener("resize",n)}),p?.(),(N=x)==null||N.disconnect(),x=null,d&&cancelAnimationFrame(j)}}const qbe=dbe,Fbe=fbe,Ube=lbe,Hbe=mbe,Wbe=cbe,c3=sbe,Vbe=hbe,Gbe=(e,t,n)=>{const r=new Map,a={platform:Lbe,...n},i={...a.platform,_c:r};return obe(e,t,{...a,platform:i})};var Ybe=typeof document<"u",Kbe=function(){},nv=Ybe?y.useLayoutEffect:Kbe;function Sg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Sg(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Sg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function k8(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function u3(e,t){const n=k8(e);return Math.round(t*n)/n}function QS(e){const t=y.useRef(e);return nv(()=>{t.current=e}),t}function Xbe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:d,open:f}=e,[m,p]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,x]=y.useState(r);Sg(g,r)||x(r);const[j,b]=y.useState(null),[w,N]=y.useState(null),O=y.useCallback(q=>{q!==k.current&&(k.current=q,b(q))},[]),C=y.useCallback(q=>{q!==T.current&&(T.current=q,N(q))},[]),A=i||j,E=l||w,k=y.useRef(null),T=y.useRef(null),P=y.useRef(m),$=d!=null,F=QS(d),D=QS(a),U=QS(f),V=y.useCallback(()=>{if(!k.current||!T.current)return;const q={placement:t,strategy:n,middleware:g};D.current&&(q.platform=D.current),Gbe(k.current,T.current,q).then(K=>{const ee={...K,isPositioned:U.current!==!1};H.current&&!Sg(P.current,ee)&&(P.current=ee,pl.flushSync(()=>{p(ee)}))})},[g,t,n,D,U]);nv(()=>{f===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,p(q=>({...q,isPositioned:!1})))},[f]);const H=y.useRef(!1);nv(()=>(H.current=!0,()=>{H.current=!1}),[]),nv(()=>{if(A&&(k.current=A),E&&(T.current=E),A&&E){if(F.current)return F.current(A,E,V);V()}},[A,E,V,F,$]);const G=y.useMemo(()=>({reference:k,floating:T,setReference:O,setFloating:C}),[O,C]),L=y.useMemo(()=>({reference:A,floating:E}),[A,E]),R=y.useMemo(()=>{const q={position:n,left:0,top:0};if(!L.floating)return q;const K=u3(L.floating,m.x),ee=u3(L.floating,m.y);return u?{...q,transform:"translate("+K+"px, "+ee+"px)",...k8(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:ee}},[n,u,L.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:V,refs:G,elements:L,floatingStyles:R}),[m,V,G,L,R])}const Zbe=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?c3({element:r.current,padding:a}).fn(n):{}:r?c3({element:r,padding:a}).fn(n):{}}}},Qbe=(e,t)=>({...qbe(e),options:[e,t]}),Jbe=(e,t)=>({...Fbe(e),options:[e,t]}),e0e=(e,t)=>({...Vbe(e),options:[e,t]}),t0e=(e,t)=>({...Ube(e),options:[e,t]}),n0e=(e,t)=>({...Hbe(e),options:[e,t]}),r0e=(e,t)=>({...Wbe(e),options:[e,t]}),a0e=(e,t)=>({...Zbe(e),options:[e,t]});var i0e="Arrow",P8=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(Me.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});P8.displayName=i0e;var o0e=P8,fE="Popper",[M8,is]=ur(fE),[s0e,R8]=M8(fE),D8=e=>{const{__scopePopper:t,children:n}=e,[r,a]=y.useState(null);return s.jsx(s0e,{scope:t,anchor:r,onAnchorChange:a,children:n})};D8.displayName=fE;var $8="PopperAnchor",I8=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=R8($8,n),l=y.useRef(null),u=qe(t,l),d=y.useRef(null);return y.useEffect(()=>{const f=d.current;d.current=r?.current||l.current,f!==d.current&&i.onAnchorChange(d.current)}),r?null:s.jsx(Me.div,{...a,ref:u})});I8.displayName=$8;var hE="PopperContent",[l0e,c0e]=M8(hE),L8=y.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:x="optimized",onPlaced:j,...b}=e,w=R8(hE,n),[N,O]=y.useState(null),C=qe(t,J=>O(J)),[A,E]=y.useState(null),k=Cy(A),T=k?.width??0,P=k?.height??0,$=r+(i!=="center"?"-"+i:""),F=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},D=Array.isArray(f)?f:[f],U=D.length>0,V={padding:F,boundary:D.filter(d0e),altBoundary:U},{refs:H,floatingStyles:G,placement:L,isPositioned:R,middlewareData:q}=Xbe({strategy:"fixed",placement:$,whileElementsMounted:(...J)=>zbe(...J,{animationFrame:x==="always"}),elements:{reference:w.anchor},middleware:[Qbe({mainAxis:a+P,alignmentAxis:l}),d&&Jbe({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?e0e():void 0,...V}),d&&t0e({...V}),n0e({...V,apply:({elements:J,rects:ae,availableWidth:Z,availableHeight:pe})=>{const{width:je,height:le}=ae.reference,Re=J.floating.style;Re.setProperty("--radix-popper-available-width",`${Z}px`),Re.setProperty("--radix-popper-available-height",`${pe}px`),Re.setProperty("--radix-popper-anchor-width",`${je}px`),Re.setProperty("--radix-popper-anchor-height",`${le}px`)}}),A&&a0e({element:A,padding:u}),f0e({arrowWidth:T,arrowHeight:P}),g&&r0e({strategy:"referenceHidden",...V})]}),[K,ee]=q8(L),I=Xt(j);Bn(()=>{R&&I?.()},[R,I]);const B=q.arrow?.x,Y=q.arrow?.y,te=q.arrow?.centerOffset!==0,[oe,xe]=y.useState();return Bn(()=>{N&&xe(window.getComputedStyle(N).zIndex)},[N]),s.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:R?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[q.transformOrigin?.x,q.transformOrigin?.y].join(" "),...q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(l0e,{scope:n,placedSide:K,onArrowChange:E,arrowX:B,arrowY:Y,shouldHideArrow:te,children:s.jsx(Me.div,{"data-side":K,"data-align":ee,...b,ref:C,style:{...b.style,animation:R?void 0:"none"}})})})});L8.displayName=hE;var B8="PopperArrow",u0e={top:"bottom",right:"left",bottom:"top",left:"right"},z8=y.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=c0e(B8,r),l=u0e[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:s.jsx(o0e,{...a,ref:n,style:{...a.style,display:"block"}})})});z8.displayName=B8;function d0e(e){return e!==null}var f0e=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,l=a.arrow?.centerOffset!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[f,m]=q8(n),p={start:"0%",center:"50%",end:"100%"}[m],g=(a.arrow?.x??0)+u/2,x=(a.arrow?.y??0)+d/2;let j="",b="";return f==="bottom"?(j=l?p:`${g}px`,b=`${-d}px`):f==="top"?(j=l?p:`${g}px`,b=`${r.floating.height+d}px`):f==="right"?(j=`${-d}px`,b=l?p:`${x}px`):f==="left"&&(j=`${r.floating.width+d}px`,b=l?p:`${x}px`),{data:{x:j,y:b}}}});function q8(e){const[t,n="center"]=e.split("-");return[t,n]}var Lh=D8,Bh=I8,zy=L8,qy=z8;function h0e(e){const t=m0e(e),n=y.forwardRef((r,a)=>{const{children:i,...l}=r,u=y.Children.toArray(i),d=u.find(v0e);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return s.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function m0e(e){const t=y.forwardRef((n,r)=>{const{children:a,...i}=n;if(y.isValidElement(a)){const l=y0e(a),u=g0e(i,a.props);return a.type!==y.Fragment&&(u.ref=r?Tr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var p0e=Symbol("radix.slottable");function v0e(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===p0e}function g0e(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function y0e(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var F8=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),x0e="VisuallyHidden",Fy=y.forwardRef((e,t)=>s.jsx(Me.span,{...e,ref:t,style:{...F8,...e.style}}));Fy.displayName=x0e;var b0e=Fy,w0e=[" ","Enter","ArrowUp","ArrowDown"],j0e=[" ","Enter"],fl="Select",[Uy,Hy,S0e]=wh(fl),[Wu]=ur(fl,[S0e,is]),Wy=is(),[_0e,os]=Wu(fl),[N0e,O0e]=Wu(fl),U8=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:l,defaultValue:u,onValueChange:d,dir:f,name:m,autoComplete:p,disabled:g,required:x,form:j}=e,b=Wy(t),[w,N]=y.useState(null),[O,C]=y.useState(null),[A,E]=y.useState(!1),k=Mu(f),[T,P]=wa({prop:r,defaultProp:a??!1,onChange:i,caller:fl}),[$,F]=wa({prop:l,defaultProp:u,onChange:d,caller:fl}),D=y.useRef(null),U=w?j||!!w.closest("form"):!0,[V,H]=y.useState(new Set),G=Array.from(V).map(L=>L.props.value).join(";");return s.jsx(Lh,{...b,children:s.jsxs(_0e,{required:x,scope:t,trigger:w,onTriggerChange:N,valueNode:O,onValueNodeChange:C,valueNodeHasChildren:A,onValueNodeHasChildrenChange:E,contentId:kn(),value:$,onValueChange:F,open:T,onOpenChange:P,dir:k,triggerPointerDownPosRef:D,disabled:g,children:[s.jsx(Uy.Provider,{scope:t,children:s.jsx(N0e,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(L=>{H(R=>new Set(R).add(L))},[]),onNativeOptionRemove:y.useCallback(L=>{H(R=>{const q=new Set(R);return q.delete(L),q})},[]),children:n})}),U?s.jsxs(hU,{"aria-hidden":!0,required:x,tabIndex:-1,name:m,autoComplete:p,value:$,onChange:L=>F(L.target.value),disabled:g,form:j,children:[$===void 0?s.jsx("option",{value:""}):null,Array.from(V)]},G):null]})})};U8.displayName=fl;var H8="SelectTrigger",W8=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=Wy(n),l=os(H8,n),u=l.disabled||r,d=qe(t,l.onTriggerChange),f=Hy(n),m=y.useRef("touch"),[p,g,x]=pU(b=>{const w=f().filter(C=>!C.disabled),N=w.find(C=>C.value===l.value),O=vU(w,b,N);O!==void 0&&l.onValueChange(O.value)}),j=b=>{u||(l.onOpenChange(!0),x()),b&&(l.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return s.jsx(Bh,{asChild:!0,...i,children:s.jsx(Me.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":mU(l.value)?"":void 0,...a,ref:d,onClick:Se(a.onClick,b=>{b.currentTarget.focus(),m.current!=="mouse"&&j(b)}),onPointerDown:Se(a.onPointerDown,b=>{m.current=b.pointerType;const w=b.target;w.hasPointerCapture(b.pointerId)&&w.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(j(b),b.preventDefault())}),onKeyDown:Se(a.onKeyDown,b=>{const w=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&g(b.key),!(w&&b.key===" ")&&w0e.includes(b.key)&&(j(),b.preventDefault())})})})});W8.displayName=H8;var V8="SelectValue",G8=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:l="",...u}=e,d=os(V8,n),{onValueNodeHasChildrenChange:f}=d,m=i!==void 0,p=qe(t,d.onValueNodeChange);return Bn(()=>{f(m)},[f,m]),s.jsx(Me.span,{...u,ref:p,style:{pointerEvents:"none"},children:mU(d.value)?s.jsx(s.Fragment,{children:l}):i})});G8.displayName=V8;var C0e="SelectIcon",Y8=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(Me.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});Y8.displayName=C0e;var E0e="SelectPortal",K8=e=>s.jsx(jl,{asChild:!0,...e});K8.displayName=E0e;var hl="SelectContent",X8=y.forwardRef((e,t)=>{const n=os(hl,e.__scopeSelect),[r,a]=y.useState();if(Bn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?pl.createPortal(s.jsx(Z8,{scope:e.__scopeSelect,children:s.jsx(Uy.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(Q8,{...e,ref:t})});X8.displayName=hl;var ka=10,[Z8,ss]=Wu(hl),A0e="SelectContentImpl",T0e=h0e("SelectContent.RemoveScroll"),Q8=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:l,side:u,sideOffset:d,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:j,hideWhenDetached:b,avoidCollisions:w,...N}=e,O=os(hl,n),[C,A]=y.useState(null),[E,k]=y.useState(null),T=qe(t,J=>A(J)),[P,$]=y.useState(null),[F,D]=y.useState(null),U=Hy(n),[V,H]=y.useState(!1),G=y.useRef(!1);y.useEffect(()=>{if(C)return ky(C)},[C]),Ay();const L=y.useCallback(J=>{const[ae,...Z]=U().map(le=>le.ref.current),[pe]=Z.slice(-1),je=document.activeElement;for(const le of J)if(le===je||(le?.scrollIntoView({block:"nearest"}),le===ae&&E&&(E.scrollTop=0),le===pe&&E&&(E.scrollTop=E.scrollHeight),le?.focus(),document.activeElement!==je))return},[U,E]),R=y.useCallback(()=>L([P,C]),[L,P,C]);y.useEffect(()=>{V&&R()},[V,R]);const{onOpenChange:q,triggerPointerDownPosRef:K}=O;y.useEffect(()=>{if(C){let J={x:0,y:0};const ae=pe=>{J={x:Math.abs(Math.round(pe.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(pe.pageY)-(K.current?.y??0))}},Z=pe=>{J.x<=10&&J.y<=10?pe.preventDefault():C.contains(pe.target)||q(!1),document.removeEventListener("pointermove",ae),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",ae),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",Z,{capture:!0})}}},[C,q,K]),y.useEffect(()=>{const J=()=>q(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[q]);const[ee,I]=pU(J=>{const ae=U().filter(je=>!je.disabled),Z=ae.find(je=>je.ref.current===document.activeElement),pe=vU(ae,J,Z);pe&&setTimeout(()=>pe.ref.current.focus())}),B=y.useCallback((J,ae,Z)=>{const pe=!G.current&&!Z;(O.value!==void 0&&O.value===ae||pe)&&($(J),pe&&(G.current=!0))},[O.value]),Y=y.useCallback(()=>C?.focus(),[C]),te=y.useCallback((J,ae,Z)=>{const pe=!G.current&&!Z;(O.value!==void 0&&O.value===ae||pe)&&D(J)},[O.value]),oe=r==="popper"?nO:J8,xe=oe===nO?{side:u,sideOffset:d,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:j,hideWhenDetached:b,avoidCollisions:w}:{};return s.jsx(Z8,{scope:n,content:C,viewport:E,onViewportChange:k,itemRefCallback:B,selectedItem:P,onItemLeave:Y,itemTextRefCallback:te,focusSelectedItem:R,selectedItemText:F,position:r,isPositioned:V,searchRef:ee,children:s.jsx($h,{as:T0e,allowPinchZoom:!0,children:s.jsx(Dh,{asChild:!0,trapped:O.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Se(a,J=>{O.trigger?.focus({preventScroll:!0}),J.preventDefault()}),children:s.jsx(wl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:s.jsx(oe,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:J=>J.preventDefault(),...N,...xe,onPlaced:()=>H(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Se(N.onKeyDown,J=>{const ae=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!ae&&J.key.length===1&&I(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let pe=U().filter(je=>!je.disabled).map(je=>je.ref.current);if(["ArrowUp","End"].includes(J.key)&&(pe=pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const je=J.target,le=pe.indexOf(je);pe=pe.slice(le+1)}setTimeout(()=>L(pe)),J.preventDefault()}})})})})})})});Q8.displayName=A0e;var k0e="SelectItemAlignedPosition",J8=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=os(hl,n),l=ss(hl,n),[u,d]=y.useState(null),[f,m]=y.useState(null),p=qe(t,T=>m(T)),g=Hy(n),x=y.useRef(!1),j=y.useRef(!0),{viewport:b,selectedItem:w,selectedItemText:N,focusSelectedItem:O}=l,C=y.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&f&&b&&w&&N){const T=i.trigger.getBoundingClientRect(),P=f.getBoundingClientRect(),$=i.valueNode.getBoundingClientRect(),F=N.getBoundingClientRect();if(i.dir!=="rtl"){const je=F.left-P.left,le=$.left-je,Re=T.left-le,_e=T.width+Re,he=Math.max(_e,P.width),ve=window.innerWidth-ka,Le=Nf(le,[ka,Math.max(ka,ve-he)]);u.style.minWidth=_e+"px",u.style.left=Le+"px"}else{const je=P.right-F.right,le=window.innerWidth-$.right-je,Re=window.innerWidth-T.right-le,_e=T.width+Re,he=Math.max(_e,P.width),ve=window.innerWidth-ka,Le=Nf(le,[ka,Math.max(ka,ve-he)]);u.style.minWidth=_e+"px",u.style.right=Le+"px"}const D=g(),U=window.innerHeight-ka*2,V=b.scrollHeight,H=window.getComputedStyle(f),G=parseInt(H.borderTopWidth,10),L=parseInt(H.paddingTop,10),R=parseInt(H.borderBottomWidth,10),q=parseInt(H.paddingBottom,10),K=G+L+V+q+R,ee=Math.min(w.offsetHeight*5,K),I=window.getComputedStyle(b),B=parseInt(I.paddingTop,10),Y=parseInt(I.paddingBottom,10),te=T.top+T.height/2-ka,oe=U-te,xe=w.offsetHeight/2,J=w.offsetTop+xe,ae=G+L+J,Z=K-ae;if(ae<=te){const je=D.length>0&&w===D[D.length-1].ref.current;u.style.bottom="0px";const le=f.clientHeight-b.offsetTop-b.offsetHeight,Re=Math.max(oe,xe+(je?Y:0)+le+R),_e=ae+Re;u.style.height=_e+"px"}else{const je=D.length>0&&w===D[0].ref.current;u.style.top="0px";const Re=Math.max(te,G+b.offsetTop+(je?B:0)+xe)+Z;u.style.height=Re+"px",b.scrollTop=ae-te+b.offsetTop}u.style.margin=`${ka}px 0`,u.style.minHeight=ee+"px",u.style.maxHeight=U+"px",r?.(),requestAnimationFrame(()=>x.current=!0)}},[g,i.trigger,i.valueNode,u,f,b,w,N,i.dir,r]);Bn(()=>C(),[C]);const[A,E]=y.useState();Bn(()=>{f&&E(window.getComputedStyle(f).zIndex)},[f]);const k=y.useCallback(T=>{T&&j.current===!0&&(C(),O?.(),j.current=!1)},[C,O]);return s.jsx(M0e,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:x,onScrollButtonChange:k,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:s.jsx(Me.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});J8.displayName=k0e;var P0e="SelectPopperPosition",nO=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=ka,...i}=e,l=Wy(n);return s.jsx(zy,{...l,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});nO.displayName=P0e;var[M0e,mE]=Wu(hl,{}),rO="SelectViewport",eU=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=ss(rO,n),l=mE(rO,n),u=qe(t,i.onViewportChange),d=y.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),s.jsx(Uy.Slot,{scope:n,children:s.jsx(Me.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Se(a.onScroll,f=>{const m=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=l;if(g?.current&&p){const x=Math.abs(d.current-m.scrollTop);if(x>0){const j=window.innerHeight-ka*2,b=parseFloat(p.style.minHeight),w=parseFloat(p.style.height),N=Math.max(b,w);if(N0?A:0,p.style.justifyContent="flex-end")}}}d.current=m.scrollTop})})})]})});eU.displayName=rO;var tU="SelectGroup",[R0e,D0e]=Wu(tU),$0e=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=kn();return s.jsx(R0e,{scope:n,id:a,children:s.jsx(Me.div,{role:"group","aria-labelledby":a,...r,ref:t})})});$0e.displayName=tU;var nU="SelectLabel",rU=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=D0e(nU,n);return s.jsx(Me.div,{id:a.id,...r,ref:t})});rU.displayName=nU;var _g="SelectItem",[I0e,aU]=Wu(_g),iU=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...l}=e,u=os(_g,n),d=ss(_g,n),f=u.value===r,[m,p]=y.useState(i??""),[g,x]=y.useState(!1),j=qe(t,O=>d.itemRefCallback?.(O,r,a)),b=kn(),w=y.useRef("touch"),N=()=>{a||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(I0e,{scope:n,value:r,disabled:a,textId:b,isSelected:f,onItemTextChange:y.useCallback(O=>{p(C=>C||(O?.textContent??"").trim())},[]),children:s.jsx(Uy.ItemSlot,{scope:n,value:r,disabled:a,textValue:m,children:s.jsx(Me.div,{role:"option","aria-labelledby":b,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:j,onFocus:Se(l.onFocus,()=>x(!0)),onBlur:Se(l.onBlur,()=>x(!1)),onClick:Se(l.onClick,()=>{w.current!=="mouse"&&N()}),onPointerUp:Se(l.onPointerUp,()=>{w.current==="mouse"&&N()}),onPointerDown:Se(l.onPointerDown,O=>{w.current=O.pointerType}),onPointerMove:Se(l.onPointerMove,O=>{w.current=O.pointerType,a?d.onItemLeave?.():w.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(l.onPointerLeave,O=>{O.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Se(l.onKeyDown,O=>{d.searchRef?.current!==""&&O.key===" "||(j0e.includes(O.key)&&N(),O.key===" "&&O.preventDefault())})})})})});iU.displayName=_g;var cf="SelectItemText",oU=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,l=os(cf,n),u=ss(cf,n),d=aU(cf,n),f=O0e(cf,n),[m,p]=y.useState(null),g=qe(t,N=>p(N),d.onItemTextChange,N=>u.itemTextRefCallback?.(N,d.value,d.disabled)),x=m?.textContent,j=y.useMemo(()=>s.jsx("option",{value:d.value,disabled:d.disabled,children:x},d.value),[d.disabled,d.value,x]),{onNativeOptionAdd:b,onNativeOptionRemove:w}=f;return Bn(()=>(b(j),()=>w(j)),[b,w,j]),s.jsxs(s.Fragment,{children:[s.jsx(Me.span,{id:d.textId,...i,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?pl.createPortal(i.children,l.valueNode):null]})});oU.displayName=cf;var sU="SelectItemIndicator",lU=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return aU(sU,n).isSelected?s.jsx(Me.span,{"aria-hidden":!0,...r,ref:t}):null});lU.displayName=sU;var aO="SelectScrollUpButton",cU=y.forwardRef((e,t)=>{const n=ss(aO,e.__scopeSelect),r=mE(aO,e.__scopeSelect),[a,i]=y.useState(!1),l=qe(t,r.onScrollButtonChange);return Bn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollTop>0;i(f)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?s.jsx(dU,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});cU.displayName=aO;var iO="SelectScrollDownButton",uU=y.forwardRef((e,t)=>{const n=ss(iO,e.__scopeSelect),r=mE(iO,e.__scopeSelect),[a,i]=y.useState(!1),l=qe(t,r.onScrollButtonChange);return Bn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollHeight-d.clientHeight,m=Math.ceil(d.scrollTop)d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?s.jsx(dU,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});uU.displayName=iO;var dU=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=ss("SelectScrollButton",n),l=y.useRef(null),u=Hy(n),d=y.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return y.useEffect(()=>()=>d(),[d]),Bn(()=>{u().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),s.jsx(Me.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Se(a.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Se(a.onPointerMove,()=>{i.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Se(a.onPointerLeave,()=>{d()})})}),L0e="SelectSeparator",fU=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(Me.div,{"aria-hidden":!0,...r,ref:t})});fU.displayName=L0e;var oO="SelectArrow",B0e=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Wy(n),i=os(oO,n),l=ss(oO,n);return i.open&&l.position==="popper"?s.jsx(qy,{...a,...r,ref:t}):null});B0e.displayName=oO;var z0e="SelectBubbleInput",hU=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=y.useRef(null),i=qe(r,a),l=Oy(t);return y.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&m){const p=new Event("change",{bubbles:!0});m.call(u,t),u.dispatchEvent(p)}},[l,t]),s.jsx(Me.select,{...n,style:{...F8,...n.style},ref:i,defaultValue:t})});hU.displayName=z0e;function mU(e){return e===""||e===void 0}function pU(e){const t=Xt(e),n=y.useRef(""),r=y.useRef(0),a=y.useCallback(l=>{const u=n.current+l;t(u),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(u)},[t]),i=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function vU(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=q0e(e,Math.max(i,0));a.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function q0e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var F0e=U8,gU=W8,U0e=G8,H0e=Y8,W0e=K8,yU=X8,V0e=eU,xU=rU,bU=iU,G0e=oU,Y0e=lU,wU=cU,jU=uU,SU=fU;const Nt=F0e,Ot=U0e,xt=y.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(gU,{ref:r,className:ue("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,s.jsx(H0e,{asChild:!0,children:s.jsx(sh,{className:"h-4 w-4 opacity-50"})})]}));xt.displayName=gU.displayName;const _U=y.forwardRef(({className:e,...t},n)=>s.jsx(wU,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(BN,{className:"h-4 w-4"})}));_U.displayName=wU.displayName;const NU=y.forwardRef(({className:e,...t},n)=>s.jsx(jU,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(sh,{className:"h-4 w-4"})}));NU.displayName=jU.displayName;const bt=y.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(W0e,{children:s.jsxs(yU,{ref:a,className:ue("relative z-[100] max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[s.jsx(_U,{}),s.jsx(V0e,{className:ue("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(NU,{})]})}));bt.displayName=yU.displayName;const K0e=y.forwardRef(({className:e,...t},n)=>s.jsx(xU,{ref:n,className:ue("px-2 py-1.5 text-sm font-semibold",e),...t}));K0e.displayName=xU.displayName;const Pe=y.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(bU,{ref:r,className:ue("relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2 pr-8 text-sm outline-none bg-white dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gray-100 dark:focus:bg-gray-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Y0e,{children:s.jsx(Js,{className:"h-4 w-4"})})}),s.jsx(G0e,{children:t})]}));Pe.displayName=bU.displayName;const X0e=y.forwardRef(({className:e,...t},n)=>s.jsx(SU,{ref:n,className:ue("-mx-1 my-1 h-px bg-muted",e),...t}));X0e.displayName=SU.displayName;function Z0e(e){const t=Q0e(e),n=y.forwardRef((r,a)=>{const{children:i,...l}=r,u=y.Children.toArray(i),d=u.find(ewe);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return s.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function Q0e(e){const t=y.forwardRef((n,r)=>{const{children:a,...i}=n;if(y.isValidElement(a)){const l=nwe(a),u=twe(i,a.props);return a.type!==y.Fragment&&(u.ref=r?Tr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var J0e=Symbol("radix.slottable");function ewe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===J0e}function twe(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function nwe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Vy="Popover",[OU]=ur(Vy,[is]),zh=is(),[rwe,ls]=OU(Vy),CU=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,u=zh(t),d=y.useRef(null),[f,m]=y.useState(!1),[p,g]=wa({prop:r,defaultProp:a??!1,onChange:i,caller:Vy});return s.jsx(Lh,{...u,children:s.jsx(rwe,{scope:t,contentId:kn(),triggerRef:d,open:p,onOpenChange:g,onOpenToggle:y.useCallback(()=>g(x=>!x),[g]),hasCustomAnchor:f,onCustomAnchorAdd:y.useCallback(()=>m(!0),[]),onCustomAnchorRemove:y.useCallback(()=>m(!1),[]),modal:l,children:n})})};CU.displayName=Vy;var EU="PopoverAnchor",awe=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ls(EU,n),i=zh(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=a;return y.useEffect(()=>(l(),()=>u()),[l,u]),s.jsx(Bh,{...i,...r,ref:t})});awe.displayName=EU;var AU="PopoverTrigger",TU=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ls(AU,n),i=zh(n),l=qe(t,a.triggerRef),u=s.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":DU(a.open),...r,ref:l,onClick:Se(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:s.jsx(Bh,{asChild:!0,...i,children:u})});TU.displayName=AU;var pE="PopoverPortal",[iwe,owe]=OU(pE,{forceMount:void 0}),kU=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=ls(pE,t);return s.jsx(iwe,{scope:t,forceMount:n,children:s.jsx(Sn,{present:n||i.open,children:s.jsx(jl,{asChild:!0,container:a,children:r})})})};kU.displayName=pE;var Ou="PopoverContent",PU=y.forwardRef((e,t)=>{const n=owe(Ou,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=ls(Ou,e.__scopePopover);return s.jsx(Sn,{present:r||i.open,children:i.modal?s.jsx(lwe,{...a,ref:t}):s.jsx(cwe,{...a,ref:t})})});PU.displayName=Ou;var swe=Z0e("PopoverContent.RemoveScroll"),lwe=y.forwardRef((e,t)=>{const n=ls(Ou,e.__scopePopover),r=y.useRef(null),a=qe(t,r),i=y.useRef(!1);return y.useEffect(()=>{const l=r.current;if(l)return ky(l)},[]),s.jsx($h,{as:swe,allowPinchZoom:!0,children:s.jsx(MU,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Se(e.onCloseAutoFocus,l=>{l.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Se(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Se(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),cwe=y.forwardRef((e,t)=>{const n=ls(Ou,e.__scopePopover),r=y.useRef(!1),a=y.useRef(!1);return s.jsx(MU,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;n.triggerRef.current?.contains(l)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),MU=y.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:m,...p}=e,g=ls(Ou,n),x=zh(n);return Ay(),s.jsx(Dh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(wl,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:m,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>g.onOpenChange(!1),children:s.jsx(zy,{"data-state":DU(g.open),role:"dialog",id:g.contentId,...x,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),RU="PopoverClose",uwe=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ls(RU,n);return s.jsx(Me.button,{type:"button",...r,ref:t,onClick:Se(e.onClick,()=>a.onOpenChange(!1))})});uwe.displayName=RU;var dwe="PopoverArrow",fwe=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=zh(n);return s.jsx(qy,{...a,...r,ref:t})});fwe.displayName=dwe;function DU(e){return e?"open":"closed"}var hwe=CU,mwe=TU,pwe=kU,$U=PU;const Zo=hwe,Qo=mwe,ao=y.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(pwe,{children:s.jsx($U,{ref:a,align:t,sideOffset:n,className:ue("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...r})}));ao.displayName=$U.displayName;const Vu="/api/webui/config";async function vwe(){const t=await(await fetch(`${Vu}/bot`)).json();if(!t.success)throw new Error("获取配置数据失败");return t.config}async function Ng(){const t=await(await fetch(`${Vu}/model`)).json();if(!t.success)throw new Error("获取模型配置数据失败");return t.config}async function gwe(e){const t=localStorage.getItem("access-token"),r=await(await fetch(`${Vu}/bot`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||"保存配置失败")}async function IU(e){const t=localStorage.getItem("access-token"),r=await(await fetch(`${Vu}/model`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||"保存配置失败")}async function ywe(e,t){const n=localStorage.getItem("access-token"),a=await(await fetch(`${Vu}/bot/section/${e}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(t)})).json();if(!a.success)throw new Error(a.message||`保存配置节 ${e} 失败`)}async function sO(e,t){const n=localStorage.getItem("access-token"),a=await(await fetch(`${Vu}/model/section/${e}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(t)})).json();if(!a.success)throw new Error(a.message||`保存配置节 ${e} 失败`)}function xwe(){const[e,t]=y.useState(!0),[n,r]=y.useState(!1),[a,i]=y.useState(!1),[l,u]=y.useState(!1),{toast:d}=Dr(),[f,m]=y.useState(null),[p,g]=y.useState(null),[x,j]=y.useState(null),[b,w]=y.useState(null),[N,O]=y.useState(null),[C,A]=y.useState(null),[E,k]=y.useState(null),[T,P]=y.useState(null),[$,F]=y.useState(null),[D,U]=y.useState(null),[V,H]=y.useState(null),[G,L]=y.useState(null),[R,q]=y.useState(null),[K,ee]=y.useState(null),[I,B]=y.useState(null),[Y,te]=y.useState(null),[oe,xe]=y.useState(null),[J,ae]=y.useState(null),Z=y.useRef(null),pe=y.useRef(!0),je=y.useRef({}),le=y.useCallback(async()=>{try{t(!0);const ve=await vwe();je.current=ve,m(ve.bot),g(ve.personality);const Le=ve.chat;Le.talk_value_rules||(Le.talk_value_rules=[]),j(Le),w(ve.expression),O(ve.emoji),A(ve.memory),k(ve.tool),P(ve.mood),F(ve.voice),U(ve.lpmm_knowledge),H(ve.keyword_reaction),L(ve.response_post_process),q(ve.chinese_typo),ee(ve.response_splitter),B(ve.log),te(ve.debug),xe(ve.maim_message),ae(ve.telemetry),u(!1),pe.current=!1}catch(ve){console.error("加载配置失败:",ve),d({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{t(!1)}},[d]);y.useEffect(()=>{le()},[le]);const Re=y.useCallback(async(ve,Le)=>{if(!pe.current)try{i(!0),await ywe(ve,Le),u(!1)}catch(Mt){console.error(`自动保存 ${ve} 失败:`,Mt),u(!0)}finally{i(!1)}},[]),_e=y.useCallback((ve,Le)=>{pe.current||(u(!0),Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{Re(ve,Le)},2e3))},[Re]);y.useEffect(()=>{f&&!pe.current&&_e("bot",f)},[f,_e]),y.useEffect(()=>{p&&!pe.current&&_e("personality",p)},[p,_e]),y.useEffect(()=>{x&&!pe.current&&_e("chat",x)},[x,_e]),y.useEffect(()=>{b&&!pe.current&&_e("expression",b)},[b,_e]),y.useEffect(()=>{N&&!pe.current&&_e("emoji",N)},[N,_e]),y.useEffect(()=>{C&&!pe.current&&_e("memory",C)},[C,_e]),y.useEffect(()=>{E&&!pe.current&&_e("tool",E)},[E,_e]),y.useEffect(()=>{T&&!pe.current&&_e("mood",T)},[T,_e]),y.useEffect(()=>{$&&!pe.current&&_e("voice",$)},[$,_e]),y.useEffect(()=>{D&&!pe.current&&_e("lpmm_knowledge",D)},[D,_e]),y.useEffect(()=>{V&&!pe.current&&_e("keyword_reaction",V)},[V,_e]),y.useEffect(()=>{G&&!pe.current&&_e("response_post_process",G)},[G,_e]),y.useEffect(()=>{R&&!pe.current&&_e("chinese_typo",R)},[R,_e]),y.useEffect(()=>{K&&!pe.current&&_e("response_splitter",K)},[K,_e]),y.useEffect(()=>{I&&!pe.current&&_e("log",I)},[I,_e]),y.useEffect(()=>{Y&&!pe.current&&_e("debug",Y)},[Y,_e]),y.useEffect(()=>{oe&&!pe.current&&_e("maim_message",oe)},[oe,_e]),y.useEffect(()=>{J&&!pe.current&&_e("telemetry",J)},[J,_e]);const he=async()=>{try{r(!0),Z.current&&clearTimeout(Z.current);const ve={...je.current,bot:f,personality:p,chat:x,expression:b,emoji:N,memory:C,tool:E,mood:T,voice:$,lpmm_knowledge:D,keyword_reaction:V,response_post_process:G,chinese_typo:R,response_splitter:K,log:I,debug:Y,maim_message:oe,telemetry:J};await gwe(ve),u(!1),d({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(ve){console.error("保存配置失败:",ve),d({title:"保存失败",description:ve.message,variant:"destructive"})}finally{r(!1)}};return e?s.jsx(Kt,{className:"h-full",children:s.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):s.jsx(Kt,{className:"h-full",children:s.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),s.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),s.jsxs(me,{onClick:he,disabled:n||a||!l,size:"sm",className:"w-full sm:w-auto",children:[s.jsx(VC,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),n?"保存中...":a?"自动保存中...":l?"保存配置":"已保存"]})]}),s.jsxs(al,{defaultValue:"bot",className:"w-full",children:[s.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:s.jsxs(Yo,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[s.jsx(Tt,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),s.jsx(Tt,{value:"personality",className:"flex-shrink-0",children:"人格"}),s.jsx(Tt,{value:"chat",className:"flex-shrink-0",children:"聊天"}),s.jsx(Tt,{value:"expression",className:"flex-shrink-0",children:"表达"}),s.jsx(Tt,{value:"features",className:"flex-shrink-0",children:"功能"}),s.jsx(Tt,{value:"processing",className:"flex-shrink-0",children:"处理"}),s.jsx(Tt,{value:"mood",className:"flex-shrink-0",children:"情绪"}),s.jsx(Tt,{value:"voice",className:"flex-shrink-0",children:"语音"}),s.jsx(Tt,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),s.jsx(Tt,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),s.jsx(Jt,{value:"bot",className:"space-y-4",children:f&&s.jsx(bwe,{config:f,onChange:m})}),s.jsx(Jt,{value:"personality",className:"space-y-4",children:p&&s.jsx(wwe,{config:p,onChange:g})}),s.jsx(Jt,{value:"chat",className:"space-y-4",children:x&&s.jsx(jwe,{config:x,onChange:j})}),s.jsx(Jt,{value:"expression",className:"space-y-4",children:b&&s.jsx(Swe,{config:b,onChange:w})}),s.jsx(Jt,{value:"features",className:"space-y-4",children:N&&C&&E&&s.jsx(_we,{emojiConfig:N,memoryConfig:C,toolConfig:E,onEmojiChange:O,onMemoryChange:A,onToolChange:k})}),s.jsx(Jt,{value:"processing",className:"space-y-4",children:V&&G&&R&&K&&s.jsx(Nwe,{keywordReactionConfig:V,responsePostProcessConfig:G,chineseTypoConfig:R,responseSplitterConfig:K,onKeywordReactionChange:H,onResponsePostProcessChange:L,onChineseTypoChange:q,onResponseSplitterChange:ee})}),s.jsx(Jt,{value:"mood",className:"space-y-4",children:T&&s.jsx(Owe,{config:T,onChange:P})}),s.jsx(Jt,{value:"voice",className:"space-y-4",children:$&&s.jsx(Cwe,{config:$,onChange:F})}),s.jsx(Jt,{value:"lpmm",className:"space-y-4",children:D&&s.jsx(Ewe,{config:D,onChange:U})}),s.jsxs(Jt,{value:"other",className:"space-y-4",children:[I&&s.jsx(Awe,{config:I,onChange:B}),Y&&s.jsx(Twe,{config:Y,onChange:te}),oe&&s.jsx(kwe,{config:oe,onChange:xe}),J&&s.jsx(Pwe,{config:J,onChange:ae})]})]})]})})}function bwe({config:e,onChange:t}){const n=()=>{t({...e,platforms:[...e.platforms,""]})},r=d=>{t({...e,platforms:e.platforms.filter((f,m)=>m!==d)})},a=(d,f)=>{const m=[...e.platforms];m[d]=f,t({...e,platforms:m})},i=()=>{t({...e,alias_names:[...e.alias_names,""]})},l=d=>{t({...e,alias_names:e.alias_names.filter((f,m)=>m!==d)})},u=(d,f)=>{const m=[...e.alias_names];m[d]=f,t({...e,alias_names:m})};return s.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),s.jsxs("div",{className:"grid gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"platform",children:"平台"}),s.jsx(Oe,{id:"platform",value:e.platform,onChange:d=>t({...e,platform:d.target.value}),placeholder:"qq"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"qq_account",children:"QQ账号"}),s.jsx(Oe,{id:"qq_account",value:e.qq_account,onChange:d=>t({...e,qq_account:d.target.value}),placeholder:"123456789"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"nickname",children:"昵称"}),s.jsx(Oe,{id:"nickname",value:e.nickname,onChange:d=>t({...e,nickname:d.target.value}),placeholder:"麦麦"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(re,{children:"其他平台账号"}),s.jsxs(me,{onClick:n,size:"sm",variant:"outline",children:[s.jsx(Zn,{className:"h-4 w-4 mr-1"}),"添加"]})]}),s.jsxs("div",{className:"space-y-2",children:[e.platforms.map((d,f)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Oe,{value:d,onChange:m=>a(f,m.target.value),placeholder:"wx:114514"}),s.jsxs(Qn,{children:[s.jsx(Ia,{asChild:!0,children:s.jsx(me,{size:"icon",variant:"outline",children:s.jsx(zt,{className:"h-4 w-4"})})}),s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsx(Dn,{children:"确认删除"}),s.jsxs($n,{children:['确定要删除平台账号 "',d||"(空)",'" 吗?此操作无法撤销。']})]}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:()=>r(f),children:"删除"})]})]})]})]},f)),e.platforms.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(re,{children:"别名"}),s.jsxs(me,{onClick:i,size:"sm",variant:"outline",children:[s.jsx(Zn,{className:"h-4 w-4 mr-1"}),"添加"]})]}),s.jsxs("div",{className:"space-y-2",children:[e.alias_names.map((d,f)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Oe,{value:d,onChange:m=>u(f,m.target.value),placeholder:"小麦"}),s.jsxs(Qn,{children:[s.jsx(Ia,{asChild:!0,children:s.jsx(me,{size:"icon",variant:"outline",children:s.jsx(zt,{className:"h-4 w-4"})})}),s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsx(Dn,{children:"确认删除"}),s.jsxs($n,{children:['确定要删除别名 "',d||"(空)",'" 吗?此操作无法撤销。']})]}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:()=>l(f),children:"删除"})]})]})]})]},f)),e.alias_names.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function wwe({config:e,onChange:t}){const n=()=>{t({...e,states:[...e.states,""]})},r=i=>{t({...e,states:e.states.filter((l,u)=>u!==i)})},a=(i,l)=>{const u=[...e.states];u[i]=l,t({...e,states:u})};return s.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),s.jsxs("div",{className:"grid gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"personality",children:"人格特质"}),s.jsx(fn,{id:"personality",value:e.personality,onChange:i=>t({...e,personality:i.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"reply_style",children:"表达风格"}),s.jsx(fn,{id:"reply_style",value:e.reply_style,onChange:i=>t({...e,reply_style:i.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"interest",children:"兴趣"}),s.jsx(fn,{id:"interest",value:e.interest,onChange:i=>t({...e,interest:i.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"plan_style",children:"说话规则与行为风格"}),s.jsx(fn,{id:"plan_style",value:e.plan_style,onChange:i=>t({...e,plan_style:i.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"visual_style",children:"识图规则"}),s.jsx(fn,{id:"visual_style",value:e.visual_style,onChange:i=>t({...e,visual_style:i.target.value}),placeholder:"识图时的处理规则",rows:3})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"private_plan_style",children:"私聊规则"}),s.jsx(fn,{id:"private_plan_style",value:e.private_plan_style,onChange:i=>t({...e,private_plan_style:i.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(re,{children:"状态列表(人格多样性)"}),s.jsxs(me,{onClick:n,size:"sm",variant:"outline",children:[s.jsx(Zn,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),s.jsx("div",{className:"space-y-2",children:e.states.map((i,l)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx(fn,{value:i,onChange:u=>a(l,u.target.value),placeholder:"描述一个人格状态",rows:2}),s.jsxs(Qn,{children:[s.jsx(Ia,{asChild:!0,children:s.jsx(me,{size:"icon",variant:"outline",children:s.jsx(zt,{className:"h-4 w-4"})})}),s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsx(Dn,{children:"确认删除"}),s.jsx($n,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:()=>r(l),children:"删除"})]})]})]})]},l))})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"state_probability",children:"状态替换概率"}),s.jsx(Oe,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:e.state_probability,onChange:i=>t({...e,state_probability:parseFloat(i.target.value)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function jwe({config:e,onChange:t}){const n=()=>{t({...e,talk_value_rules:[...e.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},r=u=>{t({...e,talk_value_rules:e.talk_value_rules.filter((d,f)=>f!==u)})},a=(u,d,f)=>{const m=[...e.talk_value_rules];m[u]={...m[u],[d]:f},t({...e,talk_value_rules:m})},i=({value:u,onChange:d})=>{const[f,m]=y.useState("00"),[p,g]=y.useState("00"),[x,j]=y.useState("23"),[b,w]=y.useState("59");y.useEffect(()=>{const O=u.split("-");if(O.length===2){const[C,A]=O,[E,k]=C.split(":"),[T,P]=A.split(":");E&&m(E.padStart(2,"0")),k&&g(k.padStart(2,"0")),T&&j(T.padStart(2,"0")),P&&w(P.padStart(2,"0"))}},[u]);const N=(O,C,A,E)=>{const k=`${O}:${C}-${A}:${E}`;d(k)};return s.jsxs(Zo,{children:[s.jsx(Qo,{asChild:!0,children:s.jsxs(me,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[s.jsx(el,{className:"h-4 w-4 mr-2"}),u||"选择时间段"]})}),s.jsx(ao,{className:"w-80",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),s.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[s.jsxs("div",{children:[s.jsx(re,{className:"text-xs",children:"小时"}),s.jsxs(Nt,{value:f,onValueChange:O=>{m(O),N(O,p,x,b)},children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsx(bt,{children:Array.from({length:24},(O,C)=>C).map(O=>s.jsx(Pe,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]}),s.jsxs("div",{children:[s.jsx(re,{className:"text-xs",children:"分钟"}),s.jsxs(Nt,{value:p,onValueChange:O=>{g(O),N(f,O,x,b)},children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsx(bt,{children:Array.from({length:60},(O,C)=>C).map(O=>s.jsx(Pe,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),s.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[s.jsxs("div",{children:[s.jsx(re,{className:"text-xs",children:"小时"}),s.jsxs(Nt,{value:x,onValueChange:O=>{j(O),N(f,p,O,b)},children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsx(bt,{children:Array.from({length:24},(O,C)=>C).map(O=>s.jsx(Pe,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]}),s.jsxs("div",{children:[s.jsx(re,{className:"text-xs",children:"分钟"}),s.jsxs(Nt,{value:b,onValueChange:O=>{w(O),N(f,p,x,O)},children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsx(bt,{children:Array.from({length:60},(O,C)=>C).map(O=>s.jsx(Pe,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]})]})]})]})})]})},l=({rule:u})=>{const d=`{ target = "${u.target}", time = "${u.time}", value = ${u.value.toFixed(1)} }`;return s.jsxs(Zo,{children:[s.jsx(Qo,{asChild:!0,children:s.jsxs(me,{variant:"outline",size:"sm",children:[s.jsx(to,{className:"h-4 w-4 mr-1"}),"预览"]})}),s.jsx(ao,{className:"w-96",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),s.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:d}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return s.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),s.jsxs("div",{className:"grid gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),s.jsx(Oe,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:e.talk_value,onChange:u=>t({...e,talk_value:parseFloat(u.target.value)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"mentioned_bot_reply",children:"提及回复增幅"}),s.jsx(Oe,{id:"mentioned_bot_reply",type:"number",step:"0.1",min:"0",max:"1",value:e.mentioned_bot_reply,onChange:u=>t({...e,mentioned_bot_reply:parseFloat(u.target.value)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"提及时回复概率增幅,1 为 100% 回复"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"max_context_size",children:"上下文长度"}),s.jsx(Oe,{id:"max_context_size",type:"number",min:"1",value:e.max_context_size,onChange:u=>t({...e,max_context_size:parseInt(u.target.value)})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"planner_smooth",children:"规划器平滑"}),s.jsx(Oe,{id:"planner_smooth",type:"number",step:"1",min:"0",value:e.planner_smooth,onChange:u=>t({...e,planner_smooth:parseFloat(u.target.value)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ht,{id:"enable_talk_value_rules",checked:e.enable_talk_value_rules,onCheckedChange:u=>t({...e,enable_talk_value_rules:u})}),s.jsx(re,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ht,{id:"include_planner_reasoning",checked:e.include_planner_reasoning,onCheckedChange:u=>t({...e,include_planner_reasoning:u})}),s.jsx(re,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),e.enable_talk_value_rules&&s.jsxs("div",{className:"border-t pt-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),s.jsxs(me,{onClick:n,size:"sm",children:[s.jsx(Zn,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),e.talk_value_rules&&e.talk_value_rules.length>0?s.jsx("div",{className:"space-y-4",children:e.talk_value_rules.map((u,d)=>s.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",d+1]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(l,{rule:u}),s.jsxs(Qn,{children:[s.jsx(Ia,{asChild:!0,children:s.jsx(me,{variant:"ghost",size:"sm",children:s.jsx(zt,{className:"h-4 w-4 text-destructive"})})}),s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsx(Dn,{children:"确认删除"}),s.jsxs($n,{children:["确定要删除规则 #",d+1," 吗?此操作无法撤销。"]})]}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:()=>r(d),children:"删除"})]})]})]})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{className:"text-xs font-medium",children:"配置类型"}),s.jsxs(Nt,{value:u.target===""?"global":"specific",onValueChange:f=>{f==="global"?a(d,"target",""):a(d,"target","qq::group")},children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"global",children:"全局配置"}),s.jsx(Pe,{value:"specific",children:"详细配置"})]})]})]}),u.target!==""&&(()=>{const f=u.target.split(":"),m=f[0]||"qq",p=f[1]||"",g=f[2]||"group";return s.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{className:"text-xs font-medium",children:"平台"}),s.jsxs(Nt,{value:m,onValueChange:x=>{a(d,"target",`${x}:${p}:${g}`)},children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"qq",children:"QQ"}),s.jsx(Pe,{value:"wx",children:"微信"})]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{className:"text-xs font-medium",children:"群 ID"}),s.jsx(Oe,{value:p,onChange:x=>{a(d,"target",`${m}:${x.target.value}:${g}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{className:"text-xs font-medium",children:"类型"}),s.jsxs(Nt,{value:g,onValueChange:x=>{a(d,"target",`${m}:${p}:${x}`)},children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"group",children:"群组(group)"}),s.jsx(Pe,{value:"private",children:"私聊(private)"})]})]})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",u.target||"(未设置)"]})]})})(),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{className:"text-xs font-medium",children:"时间段 (Time)"}),s.jsx(i,{value:u.time,onChange:f=>a(d,"time",f)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),s.jsxs("div",{className:"grid gap-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(re,{htmlFor:`rule-value-${d}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),s.jsx(Oe,{id:`rule-value-${d}`,type:"number",step:"0.01",min:"0",max:"1",value:u.value,onChange:f=>{const m=parseFloat(f.target.value);isNaN(m)||a(d,"value",Math.max(0,Math.min(1,m)))},className:"w-20 h-8 text-xs"})]}),s.jsx(iE,{value:[u.value],onValueChange:f=>a(d,"value",f[0]),min:0,max:1,step:.01,className:"w-full"}),s.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[s.jsx("span",{children:"0 (完全沉默)"}),s.jsx("span",{children:"0.5"}),s.jsx("span",{children:"1.0 (正常)"})]})]})]})]},d))}):s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:s.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),s.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg",children:[s.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),s.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[s.jsxs("li",{children:["• ",s.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),s.jsxs("li",{children:["• ",s.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),s.jsxs("li",{children:["• ",s.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),s.jsxs("li",{children:["• ",s.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),s.jsxs("li",{children:["• ",s.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function Swe({config:e,onChange:t}){const n=()=>{t({...e,learning_list:[...e.learning_list,["","enable","enable","1.0"]]})},r=g=>{t({...e,learning_list:e.learning_list.filter((x,j)=>j!==g)})},a=(g,x,j)=>{const b=[...e.learning_list];b[g][x]=j,t({...e,learning_list:b})},i=({rule:g})=>{const x=`["${g[0]}", "${g[1]}", "${g[2]}", "${g[3]}"]`;return s.jsxs(Zo,{children:[s.jsx(Qo,{asChild:!0,children:s.jsxs(me,{variant:"outline",size:"sm",children:[s.jsx(to,{className:"h-4 w-4 mr-1"}),"预览"]})}),s.jsx(ao,{className:"w-96",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),s.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:x}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},l=({member:g,groupIndex:x,memberIndex:j,availableChatIds:b})=>{const w=b.includes(g)||g==="*",[N,O]=y.useState(!w);return s.jsxs("div",{className:"flex gap-2",children:[s.jsx("div",{className:"flex-1 flex gap-2",children:N?s.jsxs(s.Fragment,{children:[s.jsx(Oe,{value:g,onChange:C=>p(x,j,C.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),b.length>0&&s.jsx(me,{size:"sm",variant:"outline",onClick:()=>O(!1),title:"切换到下拉选择",children:"下拉"})]}):s.jsxs(s.Fragment,{children:[s.jsxs(Nt,{value:g,onValueChange:C=>p(x,j,C),children:[s.jsx(xt,{className:"flex-1",children:s.jsx(Ot,{placeholder:"选择聊天流"})}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"*",children:"* (全局共享)"}),b.map((C,A)=>s.jsx(Pe,{value:C,children:C},A))]})]}),s.jsx(me,{size:"sm",variant:"outline",onClick:()=>O(!0),title:"切换到手动输入",children:"输入"})]})}),s.jsxs(Qn,{children:[s.jsx(Ia,{asChild:!0,children:s.jsx(me,{size:"icon",variant:"outline",children:s.jsx(zt,{className:"h-4 w-4"})})}),s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsx(Dn,{children:"确认删除"}),s.jsxs($n,{children:['确定要删除组成员 "',g||"(空)",'" 吗?此操作无法撤销。']})]}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:()=>m(x,j),children:"删除"})]})]})]})]})},u=()=>{t({...e,expression_groups:[...e.expression_groups,[]]})},d=g=>{t({...e,expression_groups:e.expression_groups.filter((x,j)=>j!==g)})},f=g=>{const x=[...e.expression_groups];x[g]=[...x[g],""],t({...e,expression_groups:x})},m=(g,x)=>{const j=[...e.expression_groups];j[g]=j[g].filter((b,w)=>w!==x),t({...e,expression_groups:j})},p=(g,x,j)=>{const b=[...e.expression_groups];b[g][x]=j,t({...e,expression_groups:b})};return s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),s.jsxs(me,{onClick:n,size:"sm",variant:"outline",children:[s.jsx(Zn,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),s.jsxs("div",{className:"space-y-4",children:[e.learning_list.map((g,x)=>{const j=e.learning_list.some((A,E)=>E!==x&&A[0]===""),b=g[0]==="",w=g[0].split(":"),N=w[0]||"qq",O=w[1]||"",C=w[2]||"group";return s.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"text-sm font-medium",children:["规则 ",x+1," ",b&&"(全局配置)"]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(i,{rule:g}),s.jsxs(Qn,{children:[s.jsx(Ia,{asChild:!0,children:s.jsx(me,{size:"sm",variant:"ghost",children:s.jsx(zt,{className:"h-4 w-4"})})}),s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsx(Dn,{children:"确认删除"}),s.jsxs($n,{children:["确定要删除学习规则 ",x+1," 吗?此操作无法撤销。"]})]}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:()=>r(x),children:"删除"})]})]})]})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{className:"text-xs font-medium",children:"配置类型"}),s.jsxs(Nt,{value:b?"global":"specific",onValueChange:A=>{A==="global"?a(x,0,""):a(x,0,"qq::group")},disabled:j&&!b,children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"global",children:"全局配置"}),s.jsx(Pe,{value:"specific",disabled:j&&!b,children:"详细配置"})]})]}),j&&!b&&s.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!b&&s.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{className:"text-xs font-medium",children:"平台"}),s.jsxs(Nt,{value:N,onValueChange:A=>{a(x,0,`${A}:${O}:${C}`)},children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"qq",children:"QQ"}),s.jsx(Pe,{value:"wx",children:"微信"})]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{className:"text-xs font-medium",children:"群 ID"}),s.jsx(Oe,{value:O,onChange:A=>{a(x,0,`${N}:${A.target.value}:${C}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{className:"text-xs font-medium",children:"类型"}),s.jsxs(Nt,{value:C,onValueChange:A=>{a(x,0,`${N}:${O}:${A}`)},children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"group",children:"群组(group)"}),s.jsx(Pe,{value:"private",children:"私聊(private)"})]})]})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",g[0]||"(未设置)"]})]}),s.jsx("div",{className:"grid gap-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(re,{className:"text-xs font-medium",children:"使用学到的表达"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),s.jsx(ht,{checked:g[1]==="enable",onCheckedChange:A=>a(x,1,A?"enable":"disable")})]})}),s.jsx("div",{className:"grid gap-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(re,{className:"text-xs font-medium",children:"学习表达"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),s.jsx(ht,{checked:g[2]==="enable",onCheckedChange:A=>a(x,2,A?"enable":"disable")})]})}),s.jsxs("div",{className:"grid gap-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(re,{className:"text-xs font-medium",children:"学习强度"}),s.jsx(Oe,{type:"number",step:"0.1",min:"0",max:"5",value:g[3],onChange:A=>{const E=parseFloat(A.target.value);isNaN(E)||a(x,3,Math.max(0,Math.min(5,E)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),s.jsx(iE,{value:[parseFloat(g[3])||1],onValueChange:A=>a(x,3,A[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),s.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[s.jsx("span",{children:"0 (不学习)"}),s.jsx("span",{children:"2.5"}),s.jsx("span",{children:"5.0 (快速学习)"})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},x)}),e.learning_list.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),s.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),s.jsxs(me,{onClick:u,size:"sm",variant:"outline",children:[s.jsx(Zn,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),s.jsxs("div",{className:"space-y-4",children:[e.expression_groups.map((g,x)=>{const j=e.learning_list.map(b=>b[0]).filter(b=>b!=="");return s.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",x+1,g.length===1&&g[0]==="*"&&"(全局共享)"]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(me,{onClick:()=>f(x),size:"sm",variant:"outline",children:s.jsx(Zn,{className:"h-4 w-4"})}),s.jsxs(Qn,{children:[s.jsx(Ia,{asChild:!0,children:s.jsx(me,{size:"sm",variant:"ghost",children:s.jsx(zt,{className:"h-4 w-4"})})}),s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsx(Dn,{children:"确认删除"}),s.jsxs($n,{children:["确定要删除共享组 ",x+1," 吗?此操作无法撤销。"]})]}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:()=>d(x),children:"删除"})]})]})]})]})]}),s.jsx("div",{className:"space-y-2",children:g.map((b,w)=>s.jsx(l,{member:b,groupIndex:x,memberIndex:w,availableChatIds:j},w))}),s.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},x)}),e.expression_groups.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function _we({emojiConfig:e,memoryConfig:t,toolConfig:n,onEmojiChange:r,onMemoryChange:a,onToolChange:i}){return s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ht,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:l=>i({...n,enable_tool:l})}),s.jsx(re,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),s.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),s.jsx(Oe,{id:"max_agent_iterations",type:"number",min:"1",value:t.max_agent_iterations,onChange:l=>a({...t,max_agent_iterations:parseInt(l.target.value)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),s.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),s.jsxs("div",{className:"grid gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"emoji_chance",children:"表情包激活概率"}),s.jsx(Oe,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:e.emoji_chance,onChange:l=>r({...e,emoji_chance:parseFloat(l.target.value)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"max_reg_num",children:"最大注册数量"}),s.jsx(Oe,{id:"max_reg_num",type:"number",min:"1",value:e.max_reg_num,onChange:l=>r({...e,max_reg_num:parseInt(l.target.value)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),s.jsx(Oe,{id:"check_interval",type:"number",min:"1",value:e.check_interval,onChange:l=>r({...e,check_interval:parseInt(l.target.value)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ht,{id:"do_replace",checked:e.do_replace,onCheckedChange:l=>r({...e,do_replace:l})}),s.jsx(re,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ht,{id:"steal_emoji",checked:e.steal_emoji,onCheckedChange:l=>r({...e,steal_emoji:l})}),s.jsx(re,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),s.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ht,{id:"content_filtration",checked:e.content_filtration,onCheckedChange:l=>r({...e,content_filtration:l})}),s.jsx(re,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),e.content_filtration&&s.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[s.jsx(re,{htmlFor:"filtration_prompt",children:"过滤要求"}),s.jsx(Oe,{id:"filtration_prompt",value:e.filtration_prompt,onChange:l=>r({...e,filtration_prompt:l.target.value}),placeholder:"符合公序良俗"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function Nwe({keywordReactionConfig:e,responsePostProcessConfig:t,chineseTypoConfig:n,responseSplitterConfig:r,onKeywordReactionChange:a,onResponsePostProcessChange:i,onChineseTypoChange:l,onResponseSplitterChange:u}){const d=()=>{a({...e,regex_rules:[...e.regex_rules,{regex:[""],reaction:""}]})},f=A=>{a({...e,regex_rules:e.regex_rules.filter((E,k)=>k!==A)})},m=(A,E,k)=>{const T=[...e.regex_rules];E==="regex"&&typeof k=="string"?T[A]={...T[A],regex:[k]}:E==="reaction"&&typeof k=="string"&&(T[A]={...T[A],reaction:k}),a({...e,regex_rules:T})},p=({regex:A,reaction:E,onRegexChange:k,onReactionChange:T})=>{const[P,$]=y.useState(!1),[F,D]=y.useState(""),[U,V]=y.useState(null),[H,G]=y.useState(""),[L,R]=y.useState({}),[q,K]=y.useState(""),ee=y.useRef(null),[I,B]=y.useState("build"),Y=J=>J.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),te=(J,ae=0)=>{const Z=ee.current;if(!Z)return;const pe=Z.selectionStart||0,je=Z.selectionEnd||0,le=A.substring(0,pe)+J+A.substring(je);k(le),setTimeout(()=>{const Re=pe+J.length+ae;Z.setSelectionRange(Re,Re),Z.focus()},0)};y.useEffect(()=>{if(!A||!F){V(null),R({}),K(E),G("");return}try{const J=Y(A),ae=new RegExp(J,"g"),Z=F.match(ae);V(Z),G("");const je=new RegExp(J).exec(F);if(je&&je.groups){R(je.groups);let le=E;Object.entries(je.groups).forEach(([Re,_e])=>{le=le.replace(new RegExp(`\\[${Re}\\]`,"g"),_e||"")}),K(le)}else R({}),K(E)}catch(J){G(J.message),V(null),R({}),K(E)}},[A,F,E]);const oe=()=>{if(!F||!U||U.length===0)return s.jsx("span",{className:"text-muted-foreground",children:F||"请输入测试文本"});try{const J=Y(A),ae=new RegExp(J,"g");let Z=0;const pe=[];let je;for(;(je=ae.exec(F))!==null;)je.index>Z&&pe.push(s.jsx("span",{children:F.substring(Z,je.index)},`text-${Z}`)),pe.push(s.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:je[0]},`match-${je.index}`)),Z=je.index+je[0].length;return Z)",desc:"Python风格命名捕获组",moveCursor:-1},{label:"非捕获组",pattern:"(?:)",desc:"分组但不保存匹配结果",moveCursor:-1}]},{category:"字符类",items:[{label:"字符集",pattern:"[]",desc:"匹配括号内的任意字符",moveCursor:-1},{label:"排除字符",pattern:"[^]",desc:"匹配不在括号内的字符",moveCursor:-1},{label:"范围",pattern:"[a-z]",desc:"匹配a到z的字符"},{label:"中文字符",pattern:"[\\u4e00-\\u9fa5]",desc:"匹配中文汉字"}]},{category:"常用模板",items:[{label:"捕获词语",pattern:"(?P\\S+)",desc:"捕获一个词语"},{label:"捕获句子",pattern:"(?P.+)",desc:"捕获整个句子"},{label:"捕获数字",pattern:"(?P\\d+)",desc:"捕获一个或多个数字"},{label:"可选词语",pattern:"(?:词语1|词语2)",desc:"匹配多个可选项之一"}]}];return s.jsxs(Jn,{open:P,onOpenChange:$,children:[s.jsx($F,{asChild:!0,children:s.jsxs(me,{variant:"outline",size:"sm",children:[s.jsx(pg,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),s.jsxs(zn,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[s.jsxs(qn,{children:[s.jsx(Fn,{children:"正则表达式编辑器"}),s.jsx(lr,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),s.jsx(Kt,{className:"max-h-[calc(90vh-120px)]",children:s.jsxs(al,{value:I,onValueChange:J=>B(J),className:"w-full",children:[s.jsxs(Yo,{className:"grid w-full grid-cols-2",children:[s.jsx(Tt,{value:"build",children:"🔧 构建器"}),s.jsx(Tt,{value:"test",children:"🧪 测试器"})]}),s.jsxs(Jt,{value:"build",className:"space-y-4 mt-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{className:"text-sm font-medium",children:"正则表达式"}),s.jsx(Oe,{ref:ee,value:A,onChange:J=>k(J.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{className:"text-sm font-medium",children:"Reaction 内容"}),s.jsx(fn,{value:E,onChange:J=>T(J.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),s.jsxs("div",{className:"space-y-4 border-t pt-4",children:[xe.map(J=>s.jsxs("div",{className:"space-y-2",children:[s.jsx("h5",{className:"text-xs font-semibold text-primary",children:J.category}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:J.items.map(ae=>s.jsx(me,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>te(ae.pattern,ae.moveCursor||0),children:s.jsxs("div",{className:"flex flex-col items-start w-full",children:[s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[s.jsx("span",{className:"text-xs font-medium",children:ae.label}),s.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:ae.pattern})]}),s.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:ae.desc})]})},ae.label))})]},J.category)),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(me,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>k("^(?P\\S{1,20})是这样的$"),children:s.jsxs("div",{className:"flex flex-col items-start w-full",children:[s.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P\\S","{1,20}",")是这样的$"]}),s.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),s.jsx(me,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>k("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"),children:s.jsxs("div",{className:"flex flex-col items-start w-full",children:[s.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"}),s.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),s.jsx(me,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>k("(?P.+?)(?:是|为什么|怎么)"),children:s.jsxs("div",{className:"flex flex-col items-start w-full",children:[s.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P.+?)(?:是|为什么|怎么)"}),s.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),s.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),s.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[s.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),s.jsxs("li",{children:["命名捕获组格式:",s.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),s.jsxs("li",{children:["在 reaction 中使用 ",s.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),s.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),s.jsxs(Jt,{value:"test",className:"space-y-4 mt-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{className:"text-sm font-medium",children:"当前正则表达式"}),s.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:A||"(未设置)"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),s.jsx(fn,{id:"test-text",value:F,onChange:J=>D(J.target.value),placeholder:`在此输入要测试的文本... -例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),H&&s.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[s.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),s.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:H})]}),!H&&F&&s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"flex items-center gap-2",children:U&&U.length>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),s.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",U.length," 处)"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),s.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{className:"text-sm font-medium",children:"匹配高亮"}),s.jsx(Kt,{className:"h-40 rounded-md bg-muted p-3",children:s.jsx("div",{className:"text-sm break-words",children:oe()})})]}),Object.keys(L).length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{className:"text-sm font-medium",children:"命名捕获组"}),s.jsx(Kt,{className:"h-32 rounded-md border p-3",children:s.jsx("div",{className:"space-y-2",children:Object.entries(L).map(([J,ae])=>s.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[s.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",J,"]"]}),s.jsx("span",{className:"text-muted-foreground",children:"="}),s.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:ae})]},J))})})]}),Object.keys(L).length>0&&E&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{className:"text-sm font-medium",children:"Reaction 替换预览"}),s.jsx(Kt,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:s.jsx("div",{className:"text-sm break-words",children:q})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),s.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),s.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[s.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),s.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),s.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),s.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},g=()=>{a({...e,keyword_rules:[...e.keyword_rules,{keywords:[],reaction:""}]})},x=A=>{a({...e,keyword_rules:e.keyword_rules.filter((E,k)=>k!==A)})},j=(A,E,k)=>{const T=[...e.keyword_rules];typeof k=="string"&&(T[A]={...T[A],reaction:k}),a({...e,keyword_rules:T})},b=A=>{const E=[...e.keyword_rules];E[A]={...E[A],keywords:[...E[A].keywords||[],""]},a({...e,keyword_rules:E})},w=(A,E)=>{const k=[...e.keyword_rules];k[A]={...k[A],keywords:(k[A].keywords||[]).filter((T,P)=>P!==E)},a({...e,keyword_rules:k})},N=(A,E,k)=>{const T=[...e.keyword_rules],P=[...T[A].keywords||[]];P[E]=k,T[A]={...T[A],keywords:P},a({...e,keyword_rules:T})},O=({rule:A})=>{const E=`{ regex = [${(A.regex||[]).map(k=>`"${k}"`).join(", ")}], reaction = "${A.reaction}" }`;return s.jsxs(Zo,{children:[s.jsx(Qo,{asChild:!0,children:s.jsxs(me,{variant:"outline",size:"sm",children:[s.jsx(to,{className:"h-4 w-4 mr-1"}),"预览"]})}),s.jsx(ao,{className:"w-[95vw] sm:w-[500px]",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),s.jsx(Kt,{className:"h-60 rounded-md bg-muted p-3",children:s.jsx("pre",{className:"font-mono text-xs break-all",children:E})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},C=({rule:A})=>{const E=`[[keyword_reaction.keyword_rules]] -keywords = [${(A.keywords||[]).map(k=>`"${k}"`).join(", ")}] -reaction = "${A.reaction}"`;return s.jsxs(Zo,{children:[s.jsx(Qo,{asChild:!0,children:s.jsxs(me,{variant:"outline",size:"sm",children:[s.jsx(to,{className:"h-4 w-4 mr-1"}),"预览"]})}),s.jsx(ao,{className:"w-[95vw] sm:w-[500px]",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),s.jsx(Kt,{className:"h-60 rounded-md bg-muted p-3",children:s.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:E})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),s.jsxs(me,{onClick:d,size:"sm",variant:"outline",children:[s.jsx(Zn,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),s.jsxs("div",{className:"space-y-3",children:[e.regex_rules.map((A,E)=>s.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",E+1]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(p,{regex:A.regex&&A.regex[0]||"",reaction:A.reaction,onRegexChange:k=>m(E,"regex",k),onReactionChange:k=>m(E,"reaction",k)}),s.jsx(O,{rule:A}),s.jsxs(Qn,{children:[s.jsx(Ia,{asChild:!0,children:s.jsx(me,{size:"sm",variant:"ghost",children:s.jsx(zt,{className:"h-4 w-4"})})}),s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsx(Dn,{children:"确认删除"}),s.jsxs($n,{children:["确定要删除正则规则 ",E+1," 吗?此操作无法撤销。"]})]}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:()=>f(E),children:"删除"})]})]})]})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),s.jsx(Oe,{value:A.regex&&A.regex[0]||"",onChange:k=>m(E,"regex",k.target.value),placeholder:"例如:^(?P\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?Ppattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{className:"text-xs font-medium",children:"反应内容"}),s.jsx(fn,{value:A.reaction,onChange:k=>m(E,"reaction",k.target.value),placeholder:`触发后麦麦的反应... -可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},E)),e.regex_rules.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),s.jsxs("div",{className:"space-y-4 border-t pt-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),s.jsxs(me,{onClick:g,size:"sm",variant:"outline",children:[s.jsx(Zn,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),s.jsxs("div",{className:"space-y-3",children:[e.keyword_rules.map((A,E)=>s.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",E+1]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(C,{rule:A}),s.jsxs(Qn,{children:[s.jsx(Ia,{asChild:!0,children:s.jsx(me,{size:"sm",variant:"ghost",children:s.jsx(zt,{className:"h-4 w-4"})})}),s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsx(Dn,{children:"确认删除"}),s.jsxs($n,{children:["确定要删除关键词规则 ",E+1," 吗?此操作无法撤销。"]})]}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:()=>x(E),children:"删除"})]})]})]})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(re,{className:"text-xs font-medium",children:"关键词列表"}),s.jsxs(me,{onClick:()=>b(E),size:"sm",variant:"ghost",children:[s.jsx(Zn,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),s.jsxs("div",{className:"space-y-2",children:[(A.keywords||[]).map((k,T)=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Oe,{value:k,onChange:P=>N(E,T,P.target.value),placeholder:"关键词",className:"flex-1"}),s.jsx(me,{onClick:()=>w(E,T),size:"sm",variant:"ghost",children:s.jsx(zt,{className:"h-4 w-4"})})]},T)),(!A.keywords||A.keywords.length===0)&&s.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{className:"text-xs font-medium",children:"反应内容"}),s.jsx(fn,{value:A.reaction,onChange:k=>j(E,"reaction",k.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},E)),e.keyword_rules.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),s.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ht,{id:"enable_response_post_process",checked:t.enable_response_post_process,onCheckedChange:A=>i({...t,enable_response_post_process:A})}),s.jsx(re,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),t.enable_response_post_process&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t pt-6 space-y-4",children:s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[s.jsx(ht,{id:"enable_chinese_typo",checked:n.enable,onCheckedChange:A=>l({...n,enable:A})}),s.jsx(re,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),s.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),n.enable&&s.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),s.jsx(Oe,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.error_rate,onChange:A=>l({...n,error_rate:parseFloat(A.target.value)})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),s.jsx(Oe,{id:"min_freq",type:"number",min:"0",value:n.min_freq,onChange:A=>l({...n,min_freq:parseInt(A.target.value)})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),s.jsx(Oe,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:n.tone_error_rate,onChange:A=>l({...n,tone_error_rate:parseFloat(A.target.value)})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),s.jsx(Oe,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.word_replace_rate,onChange:A=>l({...n,word_replace_rate:parseFloat(A.target.value)})})]})]})]})}),s.jsx("div",{className:"border-t pt-6 space-y-4",children:s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[s.jsx(ht,{id:"enable_response_splitter",checked:r.enable,onCheckedChange:A=>u({...r,enable:A})}),s.jsx(re,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),s.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),r.enable&&s.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),s.jsx(Oe,{id:"max_length",type:"number",min:"1",value:r.max_length,onChange:A=>u({...r,max_length:parseInt(A.target.value)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),s.jsx(Oe,{id:"max_sentence_num",type:"number",min:"1",value:r.max_sentence_num,onChange:A=>u({...r,max_sentence_num:parseInt(A.target.value)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ht,{id:"enable_kaomoji_protection",checked:r.enable_kaomoji_protection,onCheckedChange:A=>u({...r,enable_kaomoji_protection:A})}),s.jsx(re,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ht,{id:"enable_overflow_return_all",checked:r.enable_overflow_return_all,onCheckedChange:A=>u({...r,enable_overflow_return_all:A})}),s.jsx(re,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),s.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function Owe({config:e,onChange:t}){return s.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),s.jsxs("div",{className:"grid gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ht,{checked:e.enable_mood,onCheckedChange:n=>t({...e,enable_mood:n})}),s.jsx(re,{className:"cursor-pointer",children:"启用情绪系统"})]}),e.enable_mood&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"情绪更新阈值"}),s.jsx(Oe,{type:"number",min:"1",value:e.mood_update_threshold,onChange:n=>t({...e,mood_update_threshold:parseInt(n.target.value)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"情感特征"}),s.jsx(fn,{value:e.emotion_style,onChange:n=>t({...e,emotion_style:n.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function Cwe({config:e,onChange:t}){return s.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ht,{checked:e.enable_asr,onCheckedChange:n=>t({...e,enable_asr:n})}),s.jsx(re,{className:"cursor-pointer",children:"启用语音识别"})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function Ewe({config:e,onChange:t}){return s.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),s.jsxs("div",{className:"grid gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ht,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})}),s.jsx(re,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),e.enable&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"LPMM 模式"}),s.jsxs(Nt,{value:e.lpmm_mode,onValueChange:n=>t({...e,lpmm_mode:n}),children:[s.jsx(xt,{children:s.jsx(Ot,{placeholder:"选择 LPMM 模式"})}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"classic",children:"经典模式"}),s.jsx(Pe,{value:"agent",children:"Agent 模式"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"同义词搜索 TopK"}),s.jsx(Oe,{type:"number",min:"1",value:e.rag_synonym_search_top_k,onChange:n=>t({...e,rag_synonym_search_top_k:parseInt(n.target.value)})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"同义词阈值"}),s.jsx(Oe,{type:"number",step:"0.1",min:"0",max:"1",value:e.rag_synonym_threshold,onChange:n=>t({...e,rag_synonym_threshold:parseFloat(n.target.value)})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"实体提取线程数"}),s.jsx(Oe,{type:"number",min:"1",value:e.info_extraction_workers,onChange:n=>t({...e,info_extraction_workers:parseInt(n.target.value)})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"嵌入向量维度"}),s.jsx(Oe,{type:"number",min:"1",value:e.embedding_dimension,onChange:n=>t({...e,embedding_dimension:parseInt(n.target.value)})})]})]})]})]})]})}function Awe({config:e,onChange:t}){const[n,r]=y.useState(""),[a,i]=y.useState("WARNING"),l=()=>{n&&!e.suppress_libraries.includes(n)&&(t({...e,suppress_libraries:[...e.suppress_libraries,n]}),r(""))},u=x=>{t({...e,suppress_libraries:e.suppress_libraries.filter(j=>j!==x)})},d=()=>{n&&!e.library_log_levels[n]&&(t({...e,library_log_levels:{...e.library_log_levels,[n]:a}}),r(""),i("WARNING"))},f=x=>{const j={...e.library_log_levels};delete j[x],t({...e,library_log_levels:j})},m=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],p=["FULL","compact","lite"],g=["none","title","full"];return s.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"日期格式"}),s.jsx(Oe,{value:e.date_style,onChange:x=>t({...e,date_style:x.target.value}),placeholder:"例如: m-d H:i:s"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"日志级别样式"}),s.jsxs(Nt,{value:e.log_level_style,onValueChange:x=>t({...e,log_level_style:x}),children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsx(bt,{children:p.map(x=>s.jsx(Pe,{value:x,children:x},x))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"日志文本颜色"}),s.jsxs(Nt,{value:e.color_text,onValueChange:x=>t({...e,color_text:x}),children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsx(bt,{children:g.map(x=>s.jsx(Pe,{value:x,children:x},x))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"全局日志级别"}),s.jsxs(Nt,{value:e.log_level,onValueChange:x=>t({...e,log_level:x}),children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsx(bt,{children:m.map(x=>s.jsx(Pe,{value:x,children:x},x))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"控制台日志级别"}),s.jsxs(Nt,{value:e.console_log_level,onValueChange:x=>t({...e,console_log_level:x}),children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsx(bt,{children:m.map(x=>s.jsx(Pe,{value:x,children:x},x))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"文件日志级别"}),s.jsxs(Nt,{value:e.file_log_level,onValueChange:x=>t({...e,file_log_level:x}),children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsx(bt,{children:m.map(x=>s.jsx(Pe,{value:x,children:x},x))})]})]})]})]}),s.jsxs("div",{children:[s.jsx(re,{className:"mb-2 block",children:"完全屏蔽的库"}),s.jsxs("div",{className:"flex gap-2 mb-2",children:[s.jsx(Oe,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),l())}}),s.jsx(me,{onClick:l,size:"sm",className:"flex-shrink-0",children:s.jsx(Zn,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:e.suppress_libraries.map(x=>s.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[s.jsx("span",{className:"text-sm",children:x}),s.jsx(me,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>u(x),children:s.jsx(zt,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},x))})]}),s.jsxs("div",{children:[s.jsx(re,{className:"mb-2 block",children:"特定库的日志级别"}),s.jsxs("div",{className:"flex gap-2 mb-2",children:[s.jsx(Oe,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1"}),s.jsxs(Nt,{value:a,onValueChange:i,children:[s.jsx(xt,{className:"w-32",children:s.jsx(Ot,{})}),s.jsx(bt,{children:m.map(x=>s.jsx(Pe,{value:x,children:x},x))})]}),s.jsx(me,{onClick:d,size:"sm",children:s.jsx(Zn,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),s.jsx("div",{className:"space-y-2",children:Object.entries(e.library_log_levels).map(([x,j])=>s.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[s.jsx("span",{className:"text-sm font-medium",children:x}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:j}),s.jsx(me,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>f(x),children:s.jsx(zt,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},x))})]})]})}function Twe({config:e,onChange:t}){return s.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(re,{children:"显示 Prompt"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),s.jsx(ht,{checked:e.show_prompt,onCheckedChange:n=>t({...e,show_prompt:n})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(re,{children:"显示回复器 Prompt"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),s.jsx(ht,{checked:e.show_replyer_prompt,onCheckedChange:n=>t({...e,show_replyer_prompt:n})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(re,{children:"显示回复器推理"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),s.jsx(ht,{checked:e.show_replyer_reasoning,onCheckedChange:n=>t({...e,show_replyer_reasoning:n})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(re,{children:"显示 Jargon Prompt"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),s.jsx(ht,{checked:e.show_jargon_prompt,onCheckedChange:n=>t({...e,show_jargon_prompt:n})})]})]})]})}function kwe({config:e,onChange:t}){const[n,r]=y.useState(""),a=()=>{n&&!e.auth_token.includes(n)&&(t({...e,auth_token:[...e.auth_token,n]}),r(""))},i=l=>{t({...e,auth_token:e.auth_token.filter((u,d)=>d!==l)})};return s.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(re,{children:"启用自定义服务器"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),s.jsx(ht,{checked:e.use_custom,onCheckedChange:l=>t({...e,use_custom:l})})]}),e.use_custom&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"主机地址"}),s.jsx(Oe,{value:e.host,onChange:l=>t({...e,host:l.target.value}),placeholder:"127.0.0.1"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"端口号"}),s.jsx(Oe,{type:"number",value:e.port,onChange:l=>t({...e,port:parseInt(l.target.value)}),placeholder:"8090"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"连接模式"}),s.jsxs(Nt,{value:e.mode,onValueChange:l=>t({...e,mode:l}),children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"ws",children:"WebSocket (ws)"}),s.jsx(Pe,{value:"tcp",children:"TCP"})]})]})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ht,{checked:e.use_wss,onCheckedChange:l=>t({...e,use_wss:l}),disabled:e.mode!=="ws"}),s.jsx(re,{children:"使用 WSS 安全连接"})]})]}),e.use_wss&&e.mode==="ws"&&s.jsxs("div",{className:"grid gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"SSL 证书文件路径"}),s.jsx(Oe,{value:e.cert_file,onChange:l=>t({...e,cert_file:l.target.value}),placeholder:"cert.pem"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"SSL 密钥文件路径"}),s.jsx(Oe,{value:e.key_file,onChange:l=>t({...e,key_file:l.target.value}),placeholder:"key.pem"})]})]})]})]})]}),s.jsxs("div",{children:[s.jsx(re,{className:"mb-2 block",children:"认证令牌"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),s.jsxs("div",{className:"flex gap-2 mb-2",children:[s.jsx(Oe,{value:n,onChange:l=>r(l.target.value),placeholder:"输入认证令牌",onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),a())}}),s.jsx(me,{onClick:a,size:"sm",children:s.jsx(Zn,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),s.jsx("div",{className:"space-y-2",children:e.auth_token.map((l,u)=>s.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[s.jsx("span",{className:"text-sm font-mono",children:l}),s.jsx(me,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>i(u),children:s.jsx(zt,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},u))})]})]})}function Pwe({config:e,onChange:t}){return s.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(re,{children:"启用统计信息发送"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),s.jsx(ht,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})})]})]})}const Sl=y.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:n,className:ue("w-full caption-bottom text-sm",e),...t})}));Sl.displayName="Table";const _l=y.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:ue("[&_tr]:border-b",e),...t}));_l.displayName="TableHeader";const Nl=y.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:ue("[&_tr:last-child]:border-0",e),...t}));Nl.displayName="TableBody";const Mwe=y.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:ue("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Mwe.displayName="TableFooter";const hn=y.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:ue("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));hn.displayName="TableRow";const Qe=y.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:ue("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Qe.displayName="TableHead";const Ue=y.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:ue("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Ue.displayName="TableCell";const Rwe=y.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:ue("mt-4 text-sm text-muted-foreground",e),...t}));Rwe.displayName="TableCaption";var Gy="Checkbox",[Dwe]=ur(Gy),[$we,vE]=Dwe(Gy);function Iwe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:i,form:l,name:u,onCheckedChange:d,required:f,value:m="on",internal_do_not_use_render:p}=e,[g,x]=wa({prop:n,defaultProp:a??!1,onChange:d,caller:Gy}),[j,b]=y.useState(null),[w,N]=y.useState(null),O=y.useRef(!1),C=j?!!l||!!j.closest("form"):!0,A={checked:g,disabled:i,setChecked:x,control:j,setControl:b,name:u,form:l,value:m,hasConsumerStoppedPropagationRef:O,required:f,defaultChecked:Go(a)?!1:a,isFormControl:C,bubbleInput:w,setBubbleInput:N};return s.jsx($we,{scope:t,...A,children:Lwe(p)?p(A):r})}var LU="CheckboxTrigger",BU=y.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:i,value:l,disabled:u,checked:d,required:f,setControl:m,setChecked:p,hasConsumerStoppedPropagationRef:g,isFormControl:x,bubbleInput:j}=vE(LU,e),b=qe(a,m),w=y.useRef(d);return y.useEffect(()=>{const N=i?.form;if(N){const O=()=>p(w.current);return N.addEventListener("reset",O),()=>N.removeEventListener("reset",O)}},[i,p]),s.jsx(Me.button,{type:"button",role:"checkbox","aria-checked":Go(d)?"mixed":d,"aria-required":f,"data-state":HU(d),"data-disabled":u?"":void 0,disabled:u,value:l,...r,ref:b,onKeyDown:Se(t,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:Se(n,N=>{p(O=>Go(O)?!0:!O),j&&x&&(g.current=N.isPropagationStopped(),g.current||N.stopPropagation())})})});BU.displayName=LU;var gE=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:i,required:l,disabled:u,value:d,onCheckedChange:f,form:m,...p}=e;return s.jsx(Iwe,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:u,required:l,onCheckedChange:f,name:r,form:m,value:d,internal_do_not_use_render:({isFormControl:g})=>s.jsxs(s.Fragment,{children:[s.jsx(BU,{...p,ref:t,__scopeCheckbox:n}),g&&s.jsx(UU,{__scopeCheckbox:n})]})})});gE.displayName=Gy;var zU="CheckboxIndicator",qU=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=vE(zU,n);return s.jsx(Sn,{present:r||Go(i.checked)||i.checked===!0,children:s.jsx(Me.span,{"data-state":HU(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});qU.displayName=zU;var FU="CheckboxBubbleInput",UU=y.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:l,required:u,disabled:d,name:f,value:m,form:p,bubbleInput:g,setBubbleInput:x}=vE(FU,e),j=qe(n,x),b=Oy(i),w=Cy(r);y.useEffect(()=>{const O=g;if(!O)return;const C=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(C,"checked").set,k=!a.current;if(b!==i&&E){const T=new Event("click",{bubbles:k});O.indeterminate=Go(i),E.call(O,Go(i)?!1:i),O.dispatchEvent(T)}},[g,b,i,a]);const N=y.useRef(Go(i)?!1:i);return s.jsx(Me.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??N.current,required:u,disabled:d,name:f,value:m,form:p,...t,tabIndex:-1,ref:j,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});UU.displayName=FU;function Lwe(e){return typeof e=="function"}function Go(e){return e==="indeterminate"}function HU(e){return Go(e)?"indeterminate":e?"checked":"unchecked"}const Cu=y.forwardRef(({className:e,...t},n)=>s.jsx(gE,{ref:n,className:ue("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:s.jsx(qU,{className:ue("grid place-content-center text-current"),children:s.jsx(Js,{className:"h-4 w-4"})})}));Cu.displayName=gE.displayName;function Bwe(){const[e,t]=y.useState([]),[n,r]=y.useState(!0),[a,i]=y.useState(!1),[l,u]=y.useState(!1),[d,f]=y.useState(!1),[m,p]=y.useState(!1),[g,x]=y.useState(null),[j,b]=y.useState(null),[w,N]=y.useState(!1),[O,C]=y.useState(null),[A,E]=y.useState(!1),[k,T]=y.useState(""),[P,$]=y.useState(new Set),[F,D]=y.useState(!1),{toast:U}=Dr(),V=y.useRef(null),H=y.useRef(!0);y.useEffect(()=>{G()},[]);const G=async()=>{try{r(!0);const ae=await Ng();t(ae.api_providers||[]),f(!1),H.current=!1}catch(ae){console.error("加载配置失败:",ae)}finally{r(!1)}},L=y.useCallback(async ae=>{if(!H.current)try{u(!0),await sO("api_providers",ae),f(!1)}catch(Z){console.error("自动保存失败:",Z),f(!0)}finally{u(!1)}},[]);y.useEffect(()=>{if(!H.current)return f(!0),V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{L(e)},2e3),()=>{V.current&&clearTimeout(V.current)}},[e,L]);const R=async()=>{try{i(!0),V.current&&clearTimeout(V.current);const ae=await Ng();ae.api_providers=e,await IU(ae),f(!1),U({title:"保存成功",description:"模型提供商配置已保存"})}catch(ae){console.error("保存配置失败:",ae),U({title:"保存失败",description:ae.message,variant:"destructive"})}finally{i(!1)}},q=(ae,Z)=>{x(ae||{name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),b(Z),E(!1),p(!0)},K=async()=>{if(g?.api_key)try{await navigator.clipboard.writeText(g.api_key),U({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{U({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},ee=()=>{if(g){if(j!==null){const ae=[...e];ae[j]=g,t(ae)}else t([...e,g]);p(!1),x(null),b(null)}},I=ae=>{C(ae),N(!0)},B=()=>{if(O!==null){const ae=e.filter((Z,pe)=>pe!==O);t(ae),U({title:"删除成功",description:"提供商已从列表中移除"})}N(!1),C(null)},Y=ae=>{const Z=new Set(P);Z.has(ae)?Z.delete(ae):Z.add(ae),$(Z)},te=()=>{if(P.size===J.length)$(new Set);else{const ae=J.map((Z,pe)=>e.findIndex(je=>je===J[pe]));$(new Set(ae))}},oe=()=>{if(P.size===0){U({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}D(!0)},xe=()=>{const ae=e.filter((Z,pe)=>!P.has(pe));t(ae),$(new Set),D(!1),U({title:"批量删除成功",description:`已删除 ${P.size} 个提供商`})},J=e.filter(ae=>{if(!k)return!0;const Z=k.toLowerCase();return ae.name.toLowerCase().includes(Z)||ae.base_url.toLowerCase().includes(Z)||ae.client_type.toLowerCase().includes(Z)});return n?s.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):s.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型提供商配置"}),s.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 API 提供商配置"})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[P.size>0&&s.jsxs(me,{onClick:oe,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[s.jsx(zt,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",P.size,")"]}),s.jsxs(me,{onClick:()=>q(null,null),size:"sm",className:"w-full sm:w-auto",children:[s.jsx(Zn,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),s.jsxs(me,{onClick:R,disabled:a||l||!d,size:"sm",variant:"default",className:"w-full sm:w-auto",children:[s.jsx(VC,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),a?"保存中...":l?"自动保存中...":d?"保存配置":"已保存"]})]})]}),s.jsxs(Kt,{className:"h-[calc(100vh-260px)]",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[s.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[s.jsx(kr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(Oe,{placeholder:"搜索提供商名称、URL 或类型...",value:k,onChange:ae=>T(ae.target.value),className:"pl-9"})]}),k&&s.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",J.length," 个结果"]})]}),s.jsx("div",{className:"md:hidden space-y-3",children:J.length===0?s.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:k?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):J.map((ae,Z)=>s.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"font-semibold text-base truncate",children:ae.name}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:ae.base_url})]}),s.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>q(ae,Z),children:s.jsx(_u,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>I(Z),children:s.jsx(zt,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),s.jsx("p",{className:"font-medium",children:ae.client_type})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),s.jsx("p",{className:"font-medium",children:ae.max_retry})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),s.jsx("p",{className:"font-medium",children:ae.timeout})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),s.jsx("p",{className:"font-medium",children:ae.retry_interval})]})]})]},Z))}),s.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:s.jsxs(Sl,{children:[s.jsx(_l,{children:s.jsxs(hn,{children:[s.jsx(Qe,{className:"w-12",children:s.jsx(Cu,{checked:P.size===J.length&&J.length>0,onCheckedChange:te})}),s.jsx(Qe,{children:"名称"}),s.jsx(Qe,{children:"基础URL"}),s.jsx(Qe,{children:"客户端类型"}),s.jsx(Qe,{className:"text-right",children:"最大重试"}),s.jsx(Qe,{className:"text-right",children:"超时(秒)"}),s.jsx(Qe,{className:"text-right",children:"重试间隔(秒)"}),s.jsx(Qe,{className:"text-right",children:"操作"})]})}),s.jsx(Nl,{children:J.length===0?s.jsx(hn,{children:s.jsx(Ue,{colSpan:8,className:"text-center text-muted-foreground py-8",children:k?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):J.map((ae,Z)=>{const pe=e.findIndex(je=>je===ae);return s.jsxs(hn,{children:[s.jsx(Ue,{children:s.jsx(Cu,{checked:P.has(pe),onCheckedChange:()=>Y(pe)})}),s.jsx(Ue,{className:"font-medium",children:ae.name}),s.jsx(Ue,{className:"max-w-xs truncate",title:ae.base_url,children:ae.base_url}),s.jsx(Ue,{children:ae.client_type}),s.jsx(Ue,{className:"text-right",children:ae.max_retry}),s.jsx(Ue,{className:"text-right",children:ae.timeout}),s.jsx(Ue,{className:"text-right",children:ae.retry_interval}),s.jsx(Ue,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>q(ae,pe),children:s.jsx(_u,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>I(pe),children:s.jsx(zt,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})})]},Z)})})]})})]}),s.jsx(Jn,{open:m,onOpenChange:p,children:s.jsxs(zn,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(qn,{children:[s.jsx(Fn,{children:j!==null?"编辑提供商":"添加提供商"}),s.jsx(lr,{children:"配置 API 提供商的连接信息和参数"})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"name",children:"名称 *"}),s.jsx(Oe,{id:"name",value:g?.name||"",onChange:ae=>x(Z=>Z?{...Z,name:ae.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"base_url",children:"基础 URL *"}),s.jsx(Oe,{id:"base_url",value:g?.base_url||"",onChange:ae=>x(Z=>Z?{...Z,base_url:ae.target.value}:null),placeholder:"https://api.example.com/v1"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"api_key",children:"API Key *"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Oe,{id:"api_key",type:A?"text":"password",value:g?.api_key||"",onChange:ae=>x(Z=>Z?{...Z,api_key:ae.target.value}:null),placeholder:"sk-...",className:"flex-1"}),s.jsx(me,{type:"button",variant:"outline",size:"icon",onClick:()=>E(!A),title:A?"隐藏密钥":"显示密钥",children:A?s.jsx(FN,{className:"h-4 w-4"}):s.jsx(to,{className:"h-4 w-4"})}),s.jsx(me,{type:"button",variant:"outline",size:"icon",onClick:K,title:"复制密钥",children:s.jsx(zN,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"client_type",children:"客户端类型"}),s.jsxs(Nt,{value:g?.client_type||"openai",onValueChange:ae=>x(Z=>Z?{...Z,client_type:ae}:null),children:[s.jsx(xt,{id:"client_type",children:s.jsx(Ot,{placeholder:"选择客户端类型"})}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"openai",children:"OpenAI"}),s.jsx(Pe,{value:"gemini",children:"Gemini"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"max_retry",children:"最大重试"}),s.jsx(Oe,{id:"max_retry",type:"number",min:"0",value:g?.max_retry||2,onChange:ae=>x(Z=>Z?{...Z,max_retry:parseInt(ae.target.value)}:null)})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"timeout",children:"超时(秒)"}),s.jsx(Oe,{id:"timeout",type:"number",min:"1",value:g?.timeout||30,onChange:ae=>x(Z=>Z?{...Z,timeout:parseInt(ae.target.value)}:null)})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),s.jsx(Oe,{id:"retry_interval",type:"number",min:"1",value:g?.retry_interval||10,onChange:ae=>x(Z=>Z?{...Z,retry_interval:parseInt(ae.target.value)}:null)})]})]})]}),s.jsxs(Pr,{children:[s.jsx(me,{variant:"outline",onClick:()=>p(!1),children:"取消"}),s.jsx(me,{onClick:ee,children:"保存"})]})]})}),s.jsx(Qn,{open:w,onOpenChange:N,children:s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsx(Dn,{children:"确认删除"}),s.jsxs($n,{children:['确定要删除提供商 "',O!==null?e[O]?.name:"",'" 吗? 此操作无法撤销。']})]}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:B,children:"删除"})]})]})}),s.jsx(Qn,{open:F,onOpenChange:D,children:s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsx(Dn,{children:"确认批量删除"}),s.jsxs($n,{children:["确定要删除选中的 ",P.size," 个提供商吗? 此操作无法撤销。"]})]}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:xe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}const zwe=Rh("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function tn({className:e,variant:t,...n}){return s.jsx("div",{className:ue(zwe({variant:t}),e),...n})}var d3=1,qwe=.9,Fwe=.8,Uwe=.17,JS=.1,e_=.999,Hwe=.9999,Wwe=.99,Vwe=/[\\\/_+.#"@\[\(\{&]/,Gwe=/[\\\/_+.#"@\[\(\{&]/g,Ywe=/[\s-]/,WU=/[\s-]/g;function lO(e,t,n,r,a,i,l){if(i===t.length)return a===e.length?d3:Wwe;var u=`${a},${i}`;if(l[u]!==void 0)return l[u];for(var d=r.charAt(i),f=n.indexOf(d,a),m=0,p,g,x,j;f>=0;)p=lO(e,t,n,r,f+1,i+1,l),p>m&&(f===a?p*=d3:Vwe.test(e.charAt(f-1))?(p*=Fwe,x=e.slice(a,f-1).match(Gwe),x&&a>0&&(p*=Math.pow(e_,x.length))):Ywe.test(e.charAt(f-1))?(p*=qwe,j=e.slice(a,f-1).match(WU),j&&a>0&&(p*=Math.pow(e_,j.length))):(p*=Uwe,a>0&&(p*=Math.pow(e_,f-a))),e.charAt(f)!==t.charAt(i)&&(p*=Hwe)),(pp&&(p=g*JS)),p>m&&(m=p),f=n.indexOf(d,f+1);return l[u]=m,m}function f3(e){return e.toLowerCase().replace(WU," ")}function Kwe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,lO(e,t,f3(e),f3(t),0,0,{})}var Xwe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cs=Xwe.reduce((e,t)=>{const n=Ny(`Primitive.${t}`),r=y.forwardRef((a,i)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),nf='[cmdk-group=""]',t_='[cmdk-group-items=""]',Zwe='[cmdk-group-heading=""]',VU='[cmdk-item=""]',h3=`${VU}:not([aria-disabled="true"])`,cO="cmdk-item-select",Tc="data-value",Qwe=(e,t,n)=>Kwe(e,t,n),GU=y.createContext(void 0),qh=()=>y.useContext(GU),YU=y.createContext(void 0),yE=()=>y.useContext(YU),KU=y.createContext(void 0),XU=y.forwardRef((e,t)=>{let n=kc(()=>{var B,Y;return{search:"",value:(Y=(B=e.value)!=null?B:e.defaultValue)!=null?Y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=kc(()=>new Set),a=kc(()=>new Map),i=kc(()=>new Map),l=kc(()=>new Set),u=ZU(e),{label:d,children:f,value:m,onValueChange:p,filter:g,shouldFilter:x,loop:j,disablePointerSelection:b=!1,vimBindings:w=!0,...N}=e,O=kn(),C=kn(),A=kn(),E=y.useRef(null),k=c1e();ml(()=>{if(m!==void 0){let B=m.trim();n.current.value=B,T.emit()}},[m]),ml(()=>{k(6,V)},[]);let T=y.useMemo(()=>({subscribe:B=>(l.current.add(B),()=>l.current.delete(B)),snapshot:()=>n.current,setState:(B,Y,te)=>{var oe,xe,J,ae;if(!Object.is(n.current[B],Y)){if(n.current[B]=Y,B==="search")U(),F(),k(1,D);else if(B==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Z=document.getElementById(A);Z?Z.focus():(oe=document.getElementById(O))==null||oe.focus()}if(k(7,()=>{var Z;n.current.selectedItemId=(Z=H())==null?void 0:Z.id,T.emit()}),te||k(5,V),((xe=u.current)==null?void 0:xe.value)!==void 0){let Z=Y??"";(ae=(J=u.current).onValueChange)==null||ae.call(J,Z);return}}T.emit()}},emit:()=>{l.current.forEach(B=>B())}}),[]),P=y.useMemo(()=>({value:(B,Y,te)=>{var oe;Y!==((oe=i.current.get(B))==null?void 0:oe.value)&&(i.current.set(B,{value:Y,keywords:te}),n.current.filtered.items.set(B,$(Y,te)),k(2,()=>{F(),T.emit()}))},item:(B,Y)=>(r.current.add(B),Y&&(a.current.has(Y)?a.current.get(Y).add(B):a.current.set(Y,new Set([B]))),k(3,()=>{U(),F(),n.current.value||D(),T.emit()}),()=>{i.current.delete(B),r.current.delete(B),n.current.filtered.items.delete(B);let te=H();k(4,()=>{U(),te?.getAttribute("id")===B&&D(),T.emit()})}),group:B=>(a.current.has(B)||a.current.set(B,new Set),()=>{i.current.delete(B),a.current.delete(B)}),filter:()=>u.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:O,inputId:A,labelId:C,listInnerRef:E}),[]);function $(B,Y){var te,oe;let xe=(oe=(te=u.current)==null?void 0:te.filter)!=null?oe:Qwe;return B?xe(B,n.current.search,Y):0}function F(){if(!n.current.search||u.current.shouldFilter===!1)return;let B=n.current.filtered.items,Y=[];n.current.filtered.groups.forEach(oe=>{let xe=a.current.get(oe),J=0;xe.forEach(ae=>{let Z=B.get(ae);J=Math.max(Z,J)}),Y.push([oe,J])});let te=E.current;G().sort((oe,xe)=>{var J,ae;let Z=oe.getAttribute("id"),pe=xe.getAttribute("id");return((J=B.get(pe))!=null?J:0)-((ae=B.get(Z))!=null?ae:0)}).forEach(oe=>{let xe=oe.closest(t_);xe?xe.appendChild(oe.parentElement===xe?oe:oe.closest(`${t_} > *`)):te.appendChild(oe.parentElement===te?oe:oe.closest(`${t_} > *`))}),Y.sort((oe,xe)=>xe[1]-oe[1]).forEach(oe=>{var xe;let J=(xe=E.current)==null?void 0:xe.querySelector(`${nf}[${Tc}="${encodeURIComponent(oe[0])}"]`);J?.parentElement.appendChild(J)})}function D(){let B=G().find(te=>te.getAttribute("aria-disabled")!=="true"),Y=B?.getAttribute(Tc);T.setState("value",Y||void 0)}function U(){var B,Y,te,oe;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let xe=0;for(let J of r.current){let ae=(Y=(B=i.current.get(J))==null?void 0:B.value)!=null?Y:"",Z=(oe=(te=i.current.get(J))==null?void 0:te.keywords)!=null?oe:[],pe=$(ae,Z);n.current.filtered.items.set(J,pe),pe>0&&xe++}for(let[J,ae]of a.current)for(let Z of ae)if(n.current.filtered.items.get(Z)>0){n.current.filtered.groups.add(J);break}n.current.filtered.count=xe}function V(){var B,Y,te;let oe=H();oe&&(((B=oe.parentElement)==null?void 0:B.firstChild)===oe&&((te=(Y=oe.closest(nf))==null?void 0:Y.querySelector(Zwe))==null||te.scrollIntoView({block:"nearest"})),oe.scrollIntoView({block:"nearest"}))}function H(){var B;return(B=E.current)==null?void 0:B.querySelector(`${VU}[aria-selected="true"]`)}function G(){var B;return Array.from(((B=E.current)==null?void 0:B.querySelectorAll(h3))||[])}function L(B){let Y=G()[B];Y&&T.setState("value",Y.getAttribute(Tc))}function R(B){var Y;let te=H(),oe=G(),xe=oe.findIndex(ae=>ae===te),J=oe[xe+B];(Y=u.current)!=null&&Y.loop&&(J=xe+B<0?oe[oe.length-1]:xe+B===oe.length?oe[0]:oe[xe+B]),J&&T.setState("value",J.getAttribute(Tc))}function q(B){let Y=H(),te=Y?.closest(nf),oe;for(;te&&!oe;)te=B>0?s1e(te,nf):l1e(te,nf),oe=te?.querySelector(h3);oe?T.setState("value",oe.getAttribute(Tc)):R(B)}let K=()=>L(G().length-1),ee=B=>{B.preventDefault(),B.metaKey?K():B.altKey?q(1):R(1)},I=B=>{B.preventDefault(),B.metaKey?L(0):B.altKey?q(-1):R(-1)};return y.createElement(cs.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:B=>{var Y;(Y=N.onKeyDown)==null||Y.call(N,B);let te=B.nativeEvent.isComposing||B.keyCode===229;if(!(B.defaultPrevented||te))switch(B.key){case"n":case"j":{w&&B.ctrlKey&&ee(B);break}case"ArrowDown":{ee(B);break}case"p":case"k":{w&&B.ctrlKey&&I(B);break}case"ArrowUp":{I(B);break}case"Home":{B.preventDefault(),L(0);break}case"End":{B.preventDefault(),K();break}case"Enter":{B.preventDefault();let oe=H();if(oe){let xe=new Event(cO);oe.dispatchEvent(xe)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:d1e},d),Yy(e,B=>y.createElement(YU.Provider,{value:T},y.createElement(GU.Provider,{value:P},B))))}),Jwe=y.forwardRef((e,t)=>{var n,r;let a=kn(),i=y.useRef(null),l=y.useContext(KU),u=qh(),d=ZU(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:l?.forceMount;ml(()=>{if(!f)return u.item(a,l?.id)},[f]);let m=QU(a,i,[e.value,e.children,i],e.keywords),p=yE(),g=Jo(k=>k.value&&k.value===m.current),x=Jo(k=>f||u.filter()===!1?!0:k.search?k.filtered.items.get(a)>0:!0);y.useEffect(()=>{let k=i.current;if(!(!k||e.disabled))return k.addEventListener(cO,j),()=>k.removeEventListener(cO,j)},[x,e.onSelect,e.disabled]);function j(){var k,T;b(),(T=(k=d.current).onSelect)==null||T.call(k,m.current)}function b(){p.setState("value",m.current,!0)}if(!x)return null;let{disabled:w,value:N,onSelect:O,forceMount:C,keywords:A,...E}=e;return y.createElement(cs.div,{ref:Tr(i,t),...E,id:a,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!g,"data-disabled":!!w,"data-selected":!!g,onPointerMove:w||u.getDisablePointerSelection()?void 0:b,onClick:w?void 0:j},e.children)}),e1e=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,l=kn(),u=y.useRef(null),d=y.useRef(null),f=kn(),m=qh(),p=Jo(x=>a||m.filter()===!1?!0:x.search?x.filtered.groups.has(l):!0);ml(()=>m.group(l),[]),QU(l,u,[e.value,e.heading,d]);let g=y.useMemo(()=>({id:l,forceMount:a}),[a]);return y.createElement(cs.div,{ref:Tr(u,t),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&y.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),Yy(e,x=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},y.createElement(KU.Provider,{value:g},x))))}),t1e=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=y.useRef(null),i=Jo(l=>!l.search);return!n&&!i?null:y.createElement(cs.div,{ref:Tr(a,t),...r,"cmdk-separator":"",role:"separator"})}),n1e=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=yE(),l=Jo(f=>f.search),u=Jo(f=>f.selectedItemId),d=qh();return y.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),y.createElement(cs.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":u,id:d.inputId,type:"text",value:a?e.value:l,onChange:f=>{a||i.setState("search",f.target.value),n?.(f.target.value)}})}),r1e=y.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=y.useRef(null),l=y.useRef(null),u=Jo(f=>f.selectedItemId),d=qh();return y.useEffect(()=>{if(l.current&&i.current){let f=l.current,m=i.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let x=f.offsetHeight;m.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return g.observe(f),()=>{cancelAnimationFrame(p),g.unobserve(f)}}},[]),y.createElement(cs.div,{ref:Tr(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":r,id:d.listId},Yy(e,f=>y.createElement("div",{ref:Tr(l,d.listInnerRef),"cmdk-list-sizer":""},f)))}),a1e=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:l,...u}=e;return y.createElement(JC,{open:n,onOpenChange:r},y.createElement(eE,{container:l},y.createElement(My,{"cmdk-overlay":"",className:a}),y.createElement(Ry,{"aria-label":e.label,"cmdk-dialog":"",className:i},y.createElement(XU,{ref:t,...u}))))}),i1e=y.forwardRef((e,t)=>Jo(n=>n.filtered.count===0)?y.createElement(cs.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),o1e=y.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return y.createElement(cs.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Yy(e,l=>y.createElement("div",{"aria-hidden":!0},l)))}),$r=Object.assign(XU,{List:r1e,Item:Jwe,Input:n1e,Group:e1e,Separator:t1e,Dialog:a1e,Empty:i1e,Loading:o1e});function s1e(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function l1e(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function ZU(e){let t=y.useRef(e);return ml(()=>{t.current=e}),t}var ml=typeof window>"u"?y.useEffect:y.useLayoutEffect;function kc(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function Jo(e){let t=yE(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function QU(e,t,n,r=[]){let a=y.useRef(),i=qh();return ml(()=>{var l;let u=(()=>{var f;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(f=m.current.textContent)==null?void 0:f.trim():a.current}})(),d=r.map(f=>f.trim());i.value(e,u,d),(l=t.current)==null||l.setAttribute(Tc,u),a.current=u}),a}var c1e=()=>{let[e,t]=y.useState(),n=kc(()=>new Map);return ml(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function u1e(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Yy({asChild:e,children:t},n){return e&&y.isValidElement(t)?y.cloneElement(u1e(t),{ref:t.ref},n(t.props.children)):n(t)}var d1e={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const JU=y.forwardRef(({className:e,...t},n)=>s.jsx($r,{ref:n,className:ue("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));JU.displayName=$r.displayName;const eH=y.forwardRef(({className:e,...t},n)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(kr,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx($r.Input,{ref:n,className:ue("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));eH.displayName=$r.Input.displayName;const tH=y.forwardRef(({className:e,...t},n)=>s.jsx($r.List,{ref:n,className:ue("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));tH.displayName=$r.List.displayName;const nH=y.forwardRef((e,t)=>s.jsx($r.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));nH.displayName=$r.Empty.displayName;const rH=y.forwardRef(({className:e,...t},n)=>s.jsx($r.Group,{ref:n,className:ue("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));rH.displayName=$r.Group.displayName;const f1e=y.forwardRef(({className:e,...t},n)=>s.jsx($r.Separator,{ref:n,className:ue("-mx-1 h-px bg-border",e),...t}));f1e.displayName=$r.Separator.displayName;const aH=y.forwardRef(({className:e,...t},n)=>s.jsx($r.Item,{ref:n,className:ue("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));aH.displayName=$r.Item.displayName;function h1e({options:e,selected:t,onChange:n,placeholder:r="选择选项...",emptyText:a="未找到选项",className:i}){const[l,u]=y.useState(!1),d=m=>{t.includes(m)?n(t.filter(p=>p!==m)):n([...t,m])},f=m=>{n(t.filter(p=>p!==m))};return s.jsxs(Zo,{open:l,onOpenChange:u,children:[s.jsx(Qo,{asChild:!0,children:s.jsxs(me,{variant:"outline",role:"combobox","aria-expanded":l,className:ue("w-full justify-between min-h-10 h-auto",i),children:[s.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:t.length===0?s.jsx("span",{className:"text-muted-foreground",children:r}):t.map(m=>{const p=e.find(g=>g.value===m);return s.jsxs(tn,{variant:"secondary",className:"cursor-pointer hover:bg-secondary/80",onClick:g=>{g.stopPropagation(),f(m)},children:[p?.label||m,s.jsx(_y,{className:"ml-1 h-3 w-3",strokeWidth:2,fill:"none"})]},m)})}),s.jsx(Xpe,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),s.jsx(ao,{className:"w-full p-0",align:"start",children:s.jsxs(JU,{children:[s.jsx(eH,{placeholder:"搜索...",className:"h-9"}),s.jsxs(tH,{children:[s.jsx(nH,{children:a}),s.jsx(rH,{children:e.map(m=>{const p=t.includes(m.value);return s.jsxs(aH,{value:m.value,onSelect:()=>d(m.value),children:[s.jsx("div",{className:ue("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",p?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:s.jsx(Js,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),s.jsx("span",{children:m.label})]},m.value)})})]})]})})]})}function m1e(){const[e,t]=y.useState([]),[n,r]=y.useState([]),[a,i]=y.useState([]),[l,u]=y.useState(null),[d,f]=y.useState(!0),[m,p]=y.useState(!1),[g,x]=y.useState(!1),[j,b]=y.useState(!1),[w,N]=y.useState(!1),[O,C]=y.useState(null),[A,E]=y.useState(null),[k,T]=y.useState(!1),[P,$]=y.useState(null),[F,D]=y.useState(""),[U,V]=y.useState(new Set),[H,G]=y.useState(!1),{toast:L}=Dr(),R=y.useRef(null),q=y.useRef(null),K=y.useRef(!0);y.useEffect(()=>{ee()},[]);const ee=async()=>{try{f(!0);const he=await Ng(),ve=he.models||[];t(ve),i(ve.map(Mt=>Mt.name));const Le=he.api_providers||[];r(Le.map(Mt=>Mt.name)),u(he.model_task_config||null),b(!1),K.current=!1}catch(he){console.error("加载配置失败:",he)}finally{f(!1)}},I=y.useCallback(async he=>{if(!K.current)try{x(!0),await sO("models",he),b(!1)}catch(ve){console.error("自动保存模型列表失败:",ve),b(!0)}finally{x(!1)}},[]),B=y.useCallback(async he=>{if(!K.current)try{x(!0),await sO("model_task_config",he),b(!1)}catch(ve){console.error("自动保存任务配置失败:",ve),b(!0)}finally{x(!1)}},[]);y.useEffect(()=>{if(!K.current)return b(!0),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{I(e)},2e3),()=>{R.current&&clearTimeout(R.current)}},[e,I]),y.useEffect(()=>{if(!(K.current||!l))return b(!0),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>{B(l)},2e3),()=>{q.current&&clearTimeout(q.current)}},[l,B]);const Y=async()=>{try{p(!0),R.current&&clearTimeout(R.current),q.current&&clearTimeout(q.current);const he=await Ng();he.models=e,he.model_task_config=l,await IU(he),b(!1),L({title:"保存成功",description:"模型配置已保存"}),await ee()}catch(he){console.error("保存配置失败:",he),L({title:"保存失败",description:he.message,variant:"destructive"})}finally{p(!1)}},te=(he,ve)=>{C(he||{model_identifier:"",name:"",api_provider:n[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),E(ve),N(!0)},oe=()=>{if(O){if(A!==null){const he=[...e];he[A]=O,t(he)}else t([...e,O]);N(!1),C(null),E(null)}},xe=he=>{$(he),T(!0)},J=()=>{if(P!==null){const he=e.filter((ve,Le)=>Le!==P);t(he),L({title:"删除成功",description:"模型已从列表中移除"})}T(!1),$(null)},ae=he=>{const ve=new Set(U);ve.has(he)?ve.delete(he):ve.add(he),V(ve)},Z=()=>{if(U.size===Re.length)V(new Set);else{const he=Re.map((ve,Le)=>e.findIndex(Mt=>Mt===Re[Le]));V(new Set(he))}},pe=()=>{if(U.size===0){L({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}G(!0)},je=()=>{const he=e.filter((ve,Le)=>!U.has(Le));t(he),V(new Set),G(!1),L({title:"批量删除成功",description:`已删除 ${U.size} 个模型`})},le=(he,ve,Le)=>{l&&u({...l,[he]:{...l[he],[ve]:Le}})},Re=e.filter(he=>{if(!F)return!0;const ve=F.toLowerCase();return he.name.toLowerCase().includes(ve)||he.model_identifier.toLowerCase().includes(ve)||he.api_provider.toLowerCase().includes(ve)}),_e=he=>l?[l.utils?.model_list||[],l.utils_small?.model_list||[],l.tool_use?.model_list||[],l.replyer?.model_list||[],l.planner?.model_list||[],l.vlm?.model_list||[],l.voice?.model_list||[],l.embedding?.model_list||[],l.lpmm_entity_extract?.model_list||[],l.lpmm_rdf_build?.model_list||[],l.lpmm_qa?.model_list||[]].some(Le=>Le.includes(he)):!1;return d?s.jsx(Kt,{className:"h-full",children:s.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):s.jsx(Kt,{className:"h-full",children:s.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型配置"}),s.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理模型和任务配置"})]}),s.jsxs(me,{onClick:Y,disabled:m||g||!j,size:"sm",className:"w-full sm:w-auto",children:[s.jsx(VC,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),m?"保存中...":g?"自动保存中...":j?"保存配置":"已保存"]})]}),s.jsxs(al,{defaultValue:"models",className:"w-full",children:[s.jsxs(Yo,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[s.jsx(Tt,{value:"models",children:"模型配置"}),s.jsx(Tt,{value:"tasks",children:"模型任务配置"})]}),s.jsxs(Jt,{value:"models",className:"space-y-4 mt-0",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),s.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[U.size>0&&s.jsxs(me,{onClick:pe,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[s.jsx(zt,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",U.size,")"]}),s.jsxs(me,{onClick:()=>te(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[s.jsx(Zn,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[s.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[s.jsx(kr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(Oe,{placeholder:"搜索模型名称、标识符或提供商...",value:F,onChange:he=>D(he.target.value),className:"pl-9"})]}),F&&s.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Re.length," 个结果"]})]}),s.jsx("div",{className:"md:hidden space-y-3",children:Re.length===0?s.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:F?"未找到匹配的模型":"暂无模型配置"}):Re.map((he,ve)=>{const Le=_e(he.name);return s.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("h3",{className:"font-semibold text-base",children:he.name}),s.jsx(tn,{variant:Le?"default":"secondary",className:Le?"bg-green-600 hover:bg-green-700":"",children:Le?"已使用":"未使用"})]}),s.jsx("p",{className:"text-xs text-muted-foreground break-all",title:he.model_identifier,children:he.model_identifier})]}),s.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>te(he,ve),children:s.jsx(_u,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>xe(ve),children:s.jsx(zt,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),s.jsx("p",{className:"font-medium",children:he.api_provider})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),s.jsx("p",{className:"font-medium",children:he.force_stream_mode?"是":"否"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),s.jsxs("p",{className:"font-medium",children:["¥",he.price_in,"/M"]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),s.jsxs("p",{className:"font-medium",children:["¥",he.price_out,"/M"]})]})]})]},ve)})}),s.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:s.jsxs(Sl,{children:[s.jsx(_l,{children:s.jsxs(hn,{children:[s.jsx(Qe,{className:"w-12",children:s.jsx(Cu,{checked:U.size===Re.length&&Re.length>0,onCheckedChange:Z})}),s.jsx(Qe,{className:"w-24",children:"使用状态"}),s.jsx(Qe,{children:"模型名称"}),s.jsx(Qe,{children:"模型标识符"}),s.jsx(Qe,{children:"提供商"}),s.jsx(Qe,{className:"text-right",children:"输入价格"}),s.jsx(Qe,{className:"text-right",children:"输出价格"}),s.jsx(Qe,{className:"text-center",children:"强制流式"}),s.jsx(Qe,{className:"text-right",children:"操作"})]})}),s.jsx(Nl,{children:Re.length===0?s.jsx(hn,{children:s.jsx(Ue,{colSpan:9,className:"text-center text-muted-foreground py-8",children:F?"未找到匹配的模型":"暂无模型配置"})}):Re.map((he,ve)=>{const Le=e.findIndex(vn=>vn===he),Mt=_e(he.name);return s.jsxs(hn,{children:[s.jsx(Ue,{children:s.jsx(Cu,{checked:U.has(Le),onCheckedChange:()=>ae(Le)})}),s.jsx(Ue,{children:s.jsx(tn,{variant:Mt?"default":"secondary",className:Mt?"bg-green-600 hover:bg-green-700":"",children:Mt?"已使用":"未使用"})}),s.jsx(Ue,{className:"font-medium",children:he.name}),s.jsx(Ue,{className:"max-w-xs truncate",title:he.model_identifier,children:he.model_identifier}),s.jsx(Ue,{children:he.api_provider}),s.jsxs(Ue,{className:"text-right",children:["¥",he.price_in,"/M"]}),s.jsxs(Ue,{className:"text-right",children:["¥",he.price_out,"/M"]}),s.jsx(Ue,{className:"text-center",children:he.force_stream_mode?"是":"否"}),s.jsx(Ue,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>te(he,Le),children:s.jsx(_u,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>xe(Le),children:s.jsx(zt,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})})]},ve)})})]})})]}),s.jsxs(Jt,{value:"tasks",className:"space-y-6 mt-0",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),l&&s.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[s.jsx(Aa,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:l.utils,modelNames:a,onChange:(he,ve)=>le("utils",he,ve)}),s.jsx(Aa,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:l.utils_small,modelNames:a,onChange:(he,ve)=>le("utils_small",he,ve)}),s.jsx(Aa,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:l.tool_use,modelNames:a,onChange:(he,ve)=>le("tool_use",he,ve)}),s.jsx(Aa,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:l.replyer,modelNames:a,onChange:(he,ve)=>le("replyer",he,ve)}),s.jsx(Aa,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:l.planner,modelNames:a,onChange:(he,ve)=>le("planner",he,ve)}),s.jsx(Aa,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:l.vlm,modelNames:a,onChange:(he,ve)=>le("vlm",he,ve),hideTemperature:!0}),s.jsx(Aa,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:l.voice,modelNames:a,onChange:(he,ve)=>le("voice",he,ve),hideTemperature:!0,hideMaxTokens:!0}),s.jsx(Aa,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:l.embedding,modelNames:a,onChange:(he,ve)=>le("embedding",he,ve),hideTemperature:!0,hideMaxTokens:!0}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),s.jsx(Aa,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:l.lpmm_entity_extract,modelNames:a,onChange:(he,ve)=>le("lpmm_entity_extract",he,ve)}),s.jsx(Aa,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:l.lpmm_rdf_build,modelNames:a,onChange:(he,ve)=>le("lpmm_rdf_build",he,ve)}),s.jsx(Aa,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:l.lpmm_qa,modelNames:a,onChange:(he,ve)=>le("lpmm_qa",he,ve)})]})]})]})]}),s.jsx(Jn,{open:w,onOpenChange:N,children:s.jsxs(zn,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(qn,{children:[s.jsx(Fn,{children:A!==null?"编辑模型":"添加模型"}),s.jsx(lr,{children:"配置模型的基本信息和参数"})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"model_name",children:"模型名称 *"}),s.jsx(Oe,{id:"model_name",value:O?.name||"",onChange:he=>C(ve=>ve?{...ve,name:he.target.value}:null),placeholder:"例如: qwen3-30b"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"model_identifier",children:"模型标识符 *"}),s.jsx(Oe,{id:"model_identifier",value:O?.model_identifier||"",onChange:he=>C(ve=>ve?{...ve,model_identifier:he.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"API 提供商提供的模型 ID"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"api_provider",children:"API 提供商 *"}),s.jsxs(Nt,{value:O?.api_provider||"",onValueChange:he=>C(ve=>ve?{...ve,api_provider:he}:null),children:[s.jsx(xt,{id:"api_provider",children:s.jsx(Ot,{placeholder:"选择提供商"})}),s.jsx(bt,{children:n.map(he=>s.jsx(Pe,{value:he,children:he},he))})]})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),s.jsx(Oe,{id:"price_in",type:"number",step:"0.1",min:"0",value:O?.price_in||0,onChange:he=>C(ve=>ve?{...ve,price_in:parseFloat(he.target.value)}:null)})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),s.jsx(Oe,{id:"price_out",type:"number",step:"0.1",min:"0",value:O?.price_out||0,onChange:he=>C(ve=>ve?{...ve,price_out:parseFloat(he.target.value)}:null)})]})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ht,{id:"force_stream_mode",checked:O?.force_stream_mode||!1,onCheckedChange:he=>C(ve=>ve?{...ve,force_stream_mode:he}:null)}),s.jsx(re,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),s.jsxs(Pr,{children:[s.jsx(me,{variant:"outline",onClick:()=>N(!1),children:"取消"}),s.jsx(me,{onClick:oe,children:"保存"})]})]})}),s.jsx(Qn,{open:k,onOpenChange:T,children:s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsx(Dn,{children:"确认删除"}),s.jsxs($n,{children:['确定要删除模型 "',P!==null?e[P]?.name:"",'" 吗? 此操作无法撤销。']})]}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:J,children:"删除"})]})]})}),s.jsx(Qn,{open:H,onOpenChange:G,children:s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsx(Dn,{children:"确认批量删除"}),s.jsxs($n,{children:["确定要删除选中的 ",U.size," 个模型吗? 此操作无法撤销。"]})]}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:je,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})})}function Aa({title:e,description:t,taskConfig:n,modelNames:r,onChange:a,hideTemperature:i=!1,hideMaxTokens:l=!1}){const u=d=>{a("model_list",d)};return s.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:e}),s.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:t})]}),s.jsxs("div",{className:"grid gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"模型列表"}),s.jsx(h1e,{options:r.map(d=>({label:d,value:d})),selected:n.model_list||[],onChange:u,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!i&&s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"温度"}),s.jsx(Oe,{type:"number",step:"0.1",min:"0",max:"2",value:n.temperature||.3,onChange:d=>a("temperature",parseFloat(d.target.value))})]}),!l&&s.jsxs("div",{className:"grid gap-2",children:[s.jsx(re,{children:"最大 Token"}),s.jsx(Oe,{type:"number",step:"1",min:"1",value:n.max_tokens||1024,onChange:d=>a("max_tokens",parseInt(d.target.value))})]})]})]})]})}const Ol="/api/webui/emoji";function Cl(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function p1e(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.is_registered!==void 0&&t.append("is_registered",e.is_registered.toString()),e.is_banned!==void 0&&t.append("is_banned",e.is_banned.toString()),e.format&&t.append("format",e.format),e.sort_by&&t.append("sort_by",e.sort_by),e.sort_order&&t.append("sort_order",e.sort_order);const n=await fetch(`${Ol}/list?${t}`,{headers:Cl()});if(!n.ok)throw new Error(`获取表情包列表失败: ${n.statusText}`);return n.json()}async function v1e(e){const t=await fetch(`${Ol}/${e}`,{headers:Cl()});if(!t.ok)throw new Error(`获取表情包详情失败: ${t.statusText}`);return t.json()}async function g1e(e,t){const n=await fetch(`${Ol}/${e}`,{method:"PATCH",headers:Cl(),body:JSON.stringify(t)});if(!n.ok)throw new Error(`更新表情包失败: ${n.statusText}`);return n.json()}async function y1e(e){const t=await fetch(`${Ol}/${e}`,{method:"DELETE",headers:Cl()});if(!t.ok)throw new Error(`删除表情包失败: ${t.statusText}`);return t.json()}async function x1e(){const e=await fetch(`${Ol}/stats/summary`,{headers:Cl()});if(!e.ok)throw new Error(`获取统计数据失败: ${e.statusText}`);return e.json()}async function b1e(e){const t=await fetch(`${Ol}/${e}/register`,{method:"POST",headers:Cl()});if(!t.ok)throw new Error(`注册表情包失败: ${t.statusText}`);return t.json()}async function w1e(e){const t=await fetch(`${Ol}/${e}/ban`,{method:"POST",headers:Cl()});if(!t.ok)throw new Error(`封禁表情包失败: ${t.statusText}`);return t.json()}function j1e(){const[e,t]=y.useState([]),[n,r]=y.useState(null),[a,i]=y.useState(!1),[l,u]=y.useState(1),[d,f]=y.useState(0),[m]=y.useState(20),[p,g]=y.useState(""),[x,j]=y.useState("all"),[b,w]=y.useState("all"),[N,O]=y.useState("all"),[C,A]=y.useState(null),[E,k]=y.useState(!1),[T,P]=y.useState(!1),[$,F]=y.useState(!1),{toast:D}=Dr(),U=y.useCallback(async()=>{try{i(!0);const I=await p1e({page:l,page_size:m,search:p||void 0,is_registered:x==="all"?void 0:x==="registered",is_banned:b==="all"?void 0:b==="banned",format:N==="all"?void 0:N,sort_by:"usage_count",sort_order:"desc"});t(I.data),f(I.total)}catch(I){const B=I instanceof Error?I.message:"加载表情包列表失败";D({title:"错误",description:B,variant:"destructive"})}finally{i(!1)}},[l,m,p,x,b,N,D]),V=async()=>{try{const I=await x1e();r(I.data)}catch(I){console.error("加载统计数据失败:",I)}};y.useEffect(()=>{U()},[U]),y.useEffect(()=>{V()},[]);const H=async I=>{try{const B=await v1e(I.id);A(B.data),k(!0)}catch(B){const Y=B instanceof Error?B.message:"加载详情失败";D({title:"错误",description:Y,variant:"destructive"})}},G=I=>{A(I),P(!0)},L=I=>{A(I),F(!0)},R=async()=>{if(C)try{await y1e(C.id),D({title:"成功",description:"表情包已删除"}),F(!1),A(null),U(),V()}catch(I){const B=I instanceof Error?I.message:"删除失败";D({title:"错误",description:B,variant:"destructive"})}},q=async I=>{try{await b1e(I.id),D({title:"成功",description:"表情包已注册"}),U(),V()}catch(B){const Y=B instanceof Error?B.message:"注册失败";D({title:"错误",description:Y,variant:"destructive"})}},K=async I=>{try{await w1e(I.id),D({title:"成功",description:"表情包已封禁"}),U(),V()}catch(B){const Y=B instanceof Error?B.message:"封禁失败";D({title:"错误",description:Y,variant:"destructive"})}},ee=n?.formats?Object.keys(n.formats):[];return s.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),n&&s.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[s.jsx(ct,{children:s.jsxs(Ut,{className:"pb-2",children:[s.jsx(Xn,{children:"总数"}),s.jsx(Ht,{className:"text-2xl",children:n.total})]})}),s.jsx(ct,{children:s.jsxs(Ut,{className:"pb-2",children:[s.jsx(Xn,{children:"已注册"}),s.jsx(Ht,{className:"text-2xl text-green-600",children:n.registered})]})}),s.jsx(ct,{children:s.jsxs(Ut,{className:"pb-2",children:[s.jsx(Xn,{children:"已封禁"}),s.jsx(Ht,{className:"text-2xl text-red-600",children:n.banned})]})}),s.jsx(ct,{children:s.jsxs(Ut,{className:"pb-2",children:[s.jsx(Xn,{children:"未注册"}),s.jsx(Ht,{className:"text-2xl text-gray-600",children:n.unregistered})]})})]}),s.jsxs(ct,{children:[s.jsx(Ut,{children:s.jsxs(Ht,{className:"flex items-center gap-2",children:[s.jsx(UN,{className:"h-5 w-5"}),"搜索和筛选"]})}),s.jsxs(un,{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{children:"搜索"}),s.jsxs("div",{className:"relative",children:[s.jsx(kr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Oe,{placeholder:"描述或哈希值...",value:p,onChange:I=>{g(I.target.value),u(1)},className:"pl-8"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{children:"注册状态"}),s.jsxs(Nt,{value:x,onValueChange:I=>{j(I),u(1)},children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"all",children:"全部"}),s.jsx(Pe,{value:"registered",children:"已注册"}),s.jsx(Pe,{value:"unregistered",children:"未注册"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{children:"封禁状态"}),s.jsxs(Nt,{value:b,onValueChange:I=>{w(I),u(1)},children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"all",children:"全部"}),s.jsx(Pe,{value:"banned",children:"已封禁"}),s.jsx(Pe,{value:"unbanned",children:"未封禁"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{children:"格式"}),s.jsxs(Nt,{value:N,onValueChange:I=>{O(I),u(1)},children:[s.jsx(xt,{children:s.jsx(Ot,{})}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"all",children:"全部"}),ee.map(I=>s.jsxs(Pe,{value:I,children:[I.toUpperCase()," (",n?.formats[I],")"]},I))]})]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(me,{variant:"outline",size:"sm",onClick:U,disabled:a,children:[s.jsx(tl,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"刷新"]})})]})]}),s.jsxs(ct,{children:[s.jsxs(Ut,{children:[s.jsx(Ht,{children:"表情包列表"}),s.jsxs(Xn,{children:["共 ",d," 个表情包,当前第 ",l," 页"]})]}),s.jsxs(un,{children:[s.jsx("div",{className:"rounded-md border",children:s.jsxs(Sl,{children:[s.jsx(_l,{children:s.jsxs(hn,{children:[s.jsx(Qe,{className:"w-16",children:"预览"}),s.jsx(Qe,{children:"描述"}),s.jsx(Qe,{children:"格式"}),s.jsx(Qe,{className:"text-center",children:"状态"}),s.jsx(Qe,{className:"text-right",children:"使用次数"}),s.jsx(Qe,{className:"text-right",children:"操作"})]})}),s.jsx(Nl,{children:e.length===0?s.jsx(hn,{children:s.jsx(Ue,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(I=>s.jsxs(hn,{children:[s.jsx(Ue,{children:s.jsx("div",{className:"w-12 h-12 bg-muted rounded flex items-center justify-center",children:s.jsx(wve,{className:"h-6 w-6 text-muted-foreground"})})}),s.jsx(Ue,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"font-medium",children:I.description||"无描述"}),s.jsxs("div",{className:"text-xs text-muted-foreground font-mono",children:[I.emoji_hash.slice(0,16),"..."]})]})}),s.jsx(Ue,{children:s.jsx(tn,{variant:"outline",children:I.format.toUpperCase()})}),s.jsx(Ue,{children:s.jsxs("div",{className:"flex gap-2 justify-center",children:[I.is_registered&&s.jsxs(tn,{variant:"default",className:"bg-green-600",children:[s.jsx(mg,{className:"h-3 w-3 mr-1"}),"已注册"]}),I.is_banned&&s.jsxs(tn,{variant:"destructive",children:[s.jsx(Fq,{className:"h-3 w-3 mr-1"}),"已封禁"]})]})}),s.jsx(Ue,{className:"text-right font-mono",children:I.usage_count}),s.jsx(Ue,{children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>H(I),children:s.jsx(Uq,{className:"h-4 w-4"})}),s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>G(I),children:s.jsx(GC,{className:"h-4 w-4"})}),!I.is_registered&&s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>q(I),className:"text-green-600 hover:text-green-700",children:s.jsx(mg,{className:"h-4 w-4"})}),!I.is_banned&&s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>K(I),className:"text-orange-600 hover:text-orange-700",children:s.jsx(Lpe,{className:"h-4 w-4"})}),s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>L(I),className:"text-red-600 hover:text-red-700",children:s.jsx(zt,{className:"h-4 w-4"})})]})})]},I.id))})]})}),d>m&&s.jsxs("div",{className:"flex items-center justify-between mt-4",children:[s.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(l-1)*m+1," 到"," ",Math.min(l*m,d)," 条,共 ",d," 条"]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(me,{variant:"outline",size:"sm",onClick:()=>u(I=>Math.max(1,I-1)),disabled:l===1,children:[s.jsx(UC,{className:"h-4 w-4"}),"上一页"]}),s.jsxs("div",{className:"text-sm",children:["第 ",l," / ",Math.ceil(d/m)," 页"]}),s.jsxs(me,{variant:"outline",size:"sm",onClick:()=>u(I=>I+1),disabled:l>=Math.ceil(d/m),children:["下一页",s.jsx(HC,{className:"h-4 w-4"})]})]})]})]})]}),s.jsx(S1e,{emoji:C,open:E,onOpenChange:k}),s.jsx(_1e,{emoji:C,open:T,onOpenChange:P,onSuccess:()=>{U(),V()}}),s.jsx(Jn,{open:$,onOpenChange:F,children:s.jsxs(zn,{children:[s.jsxs(qn,{children:[s.jsx(Fn,{children:"确认删除"}),s.jsx(lr,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),s.jsxs(Pr,{children:[s.jsx(me,{variant:"outline",onClick:()=>F(!1),children:"取消"}),s.jsx(me,{variant:"destructive",onClick:R,children:"删除"})]})]})})]})}function S1e({emoji:e,open:t,onOpenChange:n}){if(!e)return null;const r=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-";return s.jsx(Jn,{open:t,onOpenChange:n,children:s.jsxs(zn,{className:"max-w-2xl",children:[s.jsx(qn,{children:s.jsx(Fn,{children:"表情包详情"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(re,{className:"text-muted-foreground",children:"ID"}),s.jsx("div",{className:"mt-1 font-mono",children:e.id})]}),s.jsxs("div",{children:[s.jsx(re,{className:"text-muted-foreground",children:"格式"}),s.jsx("div",{className:"mt-1",children:s.jsx(tn,{variant:"outline",children:e.format.toUpperCase()})})]})]}),s.jsxs("div",{children:[s.jsx(re,{className:"text-muted-foreground",children:"文件路径"}),s.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:e.full_path})]}),s.jsxs("div",{children:[s.jsx(re,{className:"text-muted-foreground",children:"哈希值"}),s.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:e.emoji_hash})]}),s.jsxs("div",{children:[s.jsx(re,{className:"text-muted-foreground",children:"描述"}),s.jsx("div",{className:"mt-1",children:e.description||"-"})]}),s.jsxs("div",{children:[s.jsx(re,{className:"text-muted-foreground",children:"情绪标签"}),s.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.emotion&&e.emotion.length>0?e.emotion.map((a,i)=>s.jsx(tn,{variant:"secondary",children:a},i)):s.jsx("span",{className:"text-sm text-muted-foreground",children:"无"})})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(re,{className:"text-muted-foreground",children:"状态"}),s.jsxs("div",{className:"mt-2 flex gap-2",children:[e.is_registered&&s.jsx(tn,{variant:"default",className:"bg-green-600",children:"已注册"}),e.is_banned&&s.jsx(tn,{variant:"destructive",children:"已封禁"}),!e.is_registered&&!e.is_banned&&s.jsx(tn,{variant:"outline",children:"未注册"})]})]}),s.jsxs("div",{children:[s.jsx(re,{className:"text-muted-foreground",children:"使用次数"}),s.jsx("div",{className:"mt-1 font-mono text-lg",children:e.usage_count})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(re,{className:"text-muted-foreground",children:"记录时间"}),s.jsx("div",{className:"mt-1 text-sm",children:r(e.record_time)})]}),s.jsxs("div",{children:[s.jsx(re,{className:"text-muted-foreground",children:"注册时间"}),s.jsx("div",{className:"mt-1 text-sm",children:r(e.register_time)})]})]}),s.jsxs("div",{children:[s.jsx(re,{className:"text-muted-foreground",children:"最后使用"}),s.jsx("div",{className:"mt-1 text-sm",children:r(e.last_used_time)})]})]})]})})}function _1e({emoji:e,open:t,onOpenChange:n,onSuccess:r}){const[a,i]=y.useState(""),[l,u]=y.useState(""),[d,f]=y.useState(!1),[m,p]=y.useState(!1),[g,x]=y.useState(!1),{toast:j}=Dr();y.useEffect(()=>{e&&(i(e.description||""),u(e.emotion?e.emotion.join(", "):""),f(e.is_registered),p(e.is_banned))},[e]);const b=async()=>{if(e)try{x(!0);const w=l.split(",").map(N=>N.trim()).filter(Boolean);await g1e(e.id,{description:a||void 0,emotion:w.length>0?w:void 0,is_registered:d,is_banned:m}),j({title:"成功",description:"表情包信息已更新"}),n(!1),r()}catch(w){const N=w instanceof Error?w.message:"保存失败";j({title:"错误",description:N,variant:"destructive"})}finally{x(!1)}};return e?s.jsx(Jn,{open:t,onOpenChange:n,children:s.jsxs(zn,{className:"max-w-2xl",children:[s.jsxs(qn,{children:[s.jsx(Fn,{children:"编辑表情包"}),s.jsx(lr,{children:"修改表情包的描述和标签信息"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(re,{children:"描述"}),s.jsx(fn,{value:a,onChange:w=>i(w.target.value),placeholder:"输入表情包描述...",rows:3,className:"mt-1"})]}),s.jsxs("div",{children:[s.jsx(re,{children:"情绪标签"}),s.jsx(Oe,{value:l,onChange:w=>u(w.target.value),placeholder:"使用逗号分隔多个标签,如:开心, 微笑, 快乐",className:"mt-1"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入多个标签时使用逗号分隔"})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("input",{type:"checkbox",id:"is_registered",checked:d,onChange:w=>f(w.target.checked),className:"rounded border-gray-300"}),s.jsx(re,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("input",{type:"checkbox",id:"is_banned",checked:m,onChange:w=>p(w.target.checked),className:"rounded border-gray-300"}),s.jsx(re,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),s.jsxs(Pr,{children:[s.jsx(me,{variant:"outline",onClick:()=>n(!1),children:"取消"}),s.jsx(me,{onClick:b,disabled:g,children:g?"保存中...":"保存"})]})]})}):null}const Gu="/api/webui/expression";function Yu(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function N1e(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.chat_id&&t.append("chat_id",e.chat_id);const n=await fetch(`${Gu}/list?${t}`,{headers:Yu()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取表达方式列表失败")}return n.json()}async function O1e(e){const t=await fetch(`${Gu}/${e}`,{headers:Yu()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"获取表达方式详情失败")}return t.json()}async function C1e(e){const t=await fetch(`${Gu}/`,{method:"POST",headers:Yu(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"创建表达方式失败")}return t.json()}async function E1e(e,t){const n=await fetch(`${Gu}/${e}`,{method:"PATCH",headers:Yu(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新表达方式失败")}return n.json()}async function A1e(e){const t=await fetch(`${Gu}/${e}`,{method:"DELETE",headers:Yu()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"删除表达方式失败")}return t.json()}async function T1e(){const e=await fetch(`${Gu}/stats/summary`,{headers:Yu()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取统计数据失败")}return e.json()}function k1e(){const[e,t]=y.useState([]),[n,r]=y.useState(!0),[a,i]=y.useState(0),[l,u]=y.useState(1),[d]=y.useState(20),[f,m]=y.useState(""),[p,g]=y.useState(null),[x,j]=y.useState(!1),[b,w]=y.useState(!1),[N,O]=y.useState(!1),[C,A]=y.useState(null),[E,k]=y.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),{toast:T}=Dr(),P=async()=>{try{r(!0);const H=await N1e({page:l,page_size:d,search:f||void 0});t(H.data),i(H.total)}catch(H){T({title:"加载失败",description:H instanceof Error?H.message:"无法加载表达方式",variant:"destructive"})}finally{r(!1)}},$=async()=>{try{const H=await T1e();k(H.data)}catch(H){console.error("加载统计数据失败:",H)}};y.useEffect(()=>{P(),$()},[l,d,f]);const F=async H=>{try{const G=await O1e(H.id);g(G.data),j(!0)}catch(G){T({title:"加载详情失败",description:G instanceof Error?G.message:"无法加载表达方式详情",variant:"destructive"})}},D=H=>{g(H),w(!0)},U=async H=>{try{await A1e(H.id),T({title:"删除成功",description:`已删除表达方式: ${H.situation}`}),A(null),P(),$()}catch(G){T({title:"删除失败",description:G instanceof Error?G.message:"无法删除表达方式",variant:"destructive"})}},V=H=>H?new Date(H*1e3).toLocaleString("zh-CN"):"-";return s.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[s.jsx(Mh,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),s.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),s.jsxs(me,{onClick:()=>O(!0),className:"gap-2",children:[s.jsx(Zn,{className:"h-4 w-4"}),"新增表达方式"]})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),s.jsx("div",{className:"text-2xl font-bold mt-1",children:E.total})]}),s.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),s.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:E.recent_7days})]}),s.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),s.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:E.chat_count})]})]}),s.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[s.jsx(re,{htmlFor:"search",children:"搜索"}),s.jsxs("div",{className:"relative mt-1.5",children:[s.jsx(kr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Oe,{id:"search",placeholder:"搜索情境、风格或上下文...",value:f,onChange:H=>m(H.target.value),className:"pl-9"})]})]}),s.jsxs("div",{className:"rounded-lg border bg-card",children:[s.jsx(Kt,{className:"h-[calc(100vh-500px)]",children:s.jsxs(Sl,{children:[s.jsx(_l,{children:s.jsxs(hn,{children:[s.jsx(Qe,{children:"情境"}),s.jsx(Qe,{children:"风格"}),s.jsx(Qe,{children:"聊天ID"}),s.jsx(Qe,{children:"最后活跃"}),s.jsx(Qe,{className:"text-right",children:"操作"})]})}),s.jsx(Nl,{children:n?s.jsx(hn,{children:s.jsx(Ue,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):e.length===0?s.jsx(hn,{children:s.jsx(Ue,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(H=>s.jsxs(hn,{children:[s.jsx(Ue,{className:"font-medium max-w-xs truncate",children:H.situation}),s.jsx(Ue,{className:"max-w-xs truncate",children:H.style}),s.jsx(Ue,{className:"font-mono text-sm",children:H.chat_id}),s.jsx(Ue,{className:"text-sm text-muted-foreground",children:V(H.last_active_time)}),s.jsx(Ue,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>F(H),children:s.jsx(to,{className:"h-4 w-4"})}),s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>D(H),children:s.jsx(GC,{className:"h-4 w-4"})}),s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>A(H),children:s.jsx(zt,{className:"h-4 w-4 text-destructive"})})]})})]},H.id))})]})}),a>d&&s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",children:[s.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",a," 条记录,第 ",l," / ",Math.ceil(a/d)," 页"]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(me,{variant:"outline",size:"sm",onClick:()=>u(l-1),disabled:l===1,children:"上一页"}),s.jsx(me,{variant:"outline",size:"sm",onClick:()=>u(l+1),disabled:l>=Math.ceil(a/d),children:"下一页"})]})]})]}),s.jsx(P1e,{expression:p,open:x,onOpenChange:j}),s.jsx(M1e,{open:N,onOpenChange:O,onSuccess:()=>{P(),$(),O(!1)}}),s.jsx(R1e,{expression:p,open:b,onOpenChange:w,onSuccess:()=>{P(),$(),w(!1)}}),s.jsx(Qn,{open:!!C,onOpenChange:()=>A(null),children:s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsx(Dn,{children:"确认删除"}),s.jsxs($n,{children:['确定要删除表达方式 "',C?.situation,'" 吗? 此操作不可撤销。']})]}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:()=>C&&U(C),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})})]})}function P1e({expression:e,open:t,onOpenChange:n}){if(!e)return null;const r=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-";return s.jsx(Jn,{open:t,onOpenChange:n,children:s.jsxs(zn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[s.jsxs(qn,{children:[s.jsx(Fn,{children:"表达方式详情"}),s.jsx(lr,{children:"查看表达方式的完整信息"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(Nc,{label:"情境",value:e.situation}),s.jsx(Nc,{label:"风格",value:e.style}),s.jsx(Nc,{icon:vg,label:"聊天ID",value:e.chat_id,mono:!0}),s.jsx(Nc,{icon:vg,label:"记录ID",value:e.id.toString(),mono:!0})]}),e.context&&s.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[s.jsx(re,{className:"text-xs text-muted-foreground",children:"上下文"}),s.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.context})]}),e.up_content&&s.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[s.jsx(re,{className:"text-xs text-muted-foreground",children:"上文内容"}),s.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.up_content})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(Nc,{icon:el,label:"最后活跃",value:r(e.last_active_time)}),s.jsx(Nc,{icon:el,label:"创建时间",value:r(e.create_date)})]})]}),s.jsx(Pr,{children:s.jsx(me,{onClick:()=>n(!1),children:"关闭"})})]})})}function Nc({icon:e,label:t,value:n,mono:r=!1}){return s.jsxs("div",{className:"space-y-1",children:[s.jsxs(re,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e&&s.jsx(e,{className:"h-3 w-3"}),t]}),s.jsx("div",{className:ue("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function M1e({open:e,onOpenChange:t,onSuccess:n}){const[r,a]=y.useState({situation:"",style:"",context:"",up_content:"",chat_id:""}),[i,l]=y.useState(!1),{toast:u}=Dr(),d=async()=>{if(!r.situation||!r.style||!r.chat_id){u({title:"验证失败",description:"请填写必填字段:情境、风格和聊天ID",variant:"destructive"});return}try{l(!0),await C1e(r),u({title:"创建成功",description:"表达方式已创建"}),a({situation:"",style:"",context:"",up_content:"",chat_id:""}),n()}catch(f){u({title:"创建失败",description:f instanceof Error?f.message:"无法创建表达方式",variant:"destructive"})}finally{l(!1)}};return s.jsx(Jn,{open:e,onOpenChange:t,children:s.jsxs(zn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[s.jsxs(qn,{children:[s.jsx(Fn,{children:"新增表达方式"}),s.jsx(lr,{children:"创建新的表达方式记录"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs(re,{htmlFor:"situation",children:["情境 ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(Oe,{id:"situation",value:r.situation,onChange:f=>a({...r,situation:f.target.value}),placeholder:"描述使用场景"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(re,{htmlFor:"style",children:["风格 ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(Oe,{id:"style",value:r.style,onChange:f=>a({...r,style:f.target.value}),placeholder:"描述表达风格"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(re,{htmlFor:"chat_id",children:["聊天ID ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(Oe,{id:"chat_id",value:r.chat_id,onChange:f=>a({...r,chat_id:f.target.value}),placeholder:"关联的聊天ID"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"context",children:"上下文"}),s.jsx(fn,{id:"context",value:r.context,onChange:f=>a({...r,context:f.target.value}),placeholder:"上下文信息(可选)",rows:3})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"up_content",children:"上文内容"}),s.jsx(fn,{id:"up_content",value:r.up_content,onChange:f=>a({...r,up_content:f.target.value}),placeholder:"上文内容(可选)",rows:3})]})]}),s.jsxs(Pr,{children:[s.jsx(me,{variant:"outline",onClick:()=>t(!1),children:"取消"}),s.jsx(me,{onClick:d,disabled:i,children:i?"创建中...":"创建"})]})]})})}function R1e({expression:e,open:t,onOpenChange:n,onSuccess:r}){const[a,i]=y.useState({}),[l,u]=y.useState(!1),{toast:d}=Dr();y.useEffect(()=>{e&&i({situation:e.situation,style:e.style,context:e.context||"",up_content:e.up_content||"",chat_id:e.chat_id})},[e]);const f=async()=>{if(e)try{u(!0),await E1e(e.id,a),d({title:"保存成功",description:"表达方式已更新"}),r()}catch(m){d({title:"保存失败",description:m instanceof Error?m.message:"无法更新表达方式",variant:"destructive"})}finally{u(!1)}};return e?s.jsx(Jn,{open:t,onOpenChange:n,children:s.jsxs(zn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[s.jsxs(qn,{children:[s.jsx(Fn,{children:"编辑表达方式"}),s.jsx(lr,{children:"修改表达方式的信息"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"edit_situation",children:"情境"}),s.jsx(Oe,{id:"edit_situation",value:a.situation||"",onChange:m=>i({...a,situation:m.target.value}),placeholder:"描述使用场景"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"edit_style",children:"风格"}),s.jsx(Oe,{id:"edit_style",value:a.style||"",onChange:m=>i({...a,style:m.target.value}),placeholder:"描述表达风格"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"edit_chat_id",children:"聊天ID"}),s.jsx(Oe,{id:"edit_chat_id",value:a.chat_id||"",onChange:m=>i({...a,chat_id:m.target.value}),placeholder:"关联的聊天ID"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"edit_context",children:"上下文"}),s.jsx(fn,{id:"edit_context",value:a.context||"",onChange:m=>i({...a,context:m.target.value}),placeholder:"上下文信息",rows:3})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"edit_up_content",children:"上文内容"}),s.jsx(fn,{id:"edit_up_content",value:a.up_content||"",onChange:m=>i({...a,up_content:m.target.value}),placeholder:"上文内容",rows:3})]})]}),s.jsxs(Pr,{children:[s.jsx(me,{variant:"outline",onClick:()=>n(!1),children:"取消"}),s.jsx(me,{onClick:f,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}const Fh="/api/webui/person";function Uh(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function D1e(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.is_known!==void 0&&t.append("is_known",e.is_known.toString()),e.platform&&t.append("platform",e.platform);const n=await fetch(`${Fh}/list?${t}`,{headers:Uh()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取人物列表失败")}return n.json()}async function $1e(e){const t=await fetch(`${Fh}/${e}`,{headers:Uh()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"获取人物详情失败")}return t.json()}async function I1e(e,t){const n=await fetch(`${Fh}/${e}`,{method:"PATCH",headers:Uh(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新人物信息失败")}return n.json()}async function L1e(e){const t=await fetch(`${Fh}/${e}`,{method:"DELETE",headers:Uh()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"删除人物信息失败")}return t.json()}async function B1e(){const e=await fetch(`${Fh}/stats/summary`,{headers:Uh()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取统计数据失败")}return e.json()}function z1e(){const[e,t]=y.useState([]),[n,r]=y.useState(!0),[a,i]=y.useState(0),[l,u]=y.useState(1),[d]=y.useState(20),[f,m]=y.useState(""),[p,g]=y.useState(void 0),[x,j]=y.useState(void 0),[b,w]=y.useState(null),[N,O]=y.useState(!1),[C,A]=y.useState(!1),[E,k]=y.useState(null),[T,P]=y.useState({total:0,known:0,unknown:0,platforms:{}}),{toast:$}=Dr(),F=async()=>{try{r(!0);const R=await D1e({page:l,page_size:d,search:f||void 0,is_known:p,platform:x});t(R.data),i(R.total)}catch(R){$({title:"加载失败",description:R instanceof Error?R.message:"无法加载人物信息",variant:"destructive"})}finally{r(!1)}},D=async()=>{try{const R=await B1e();P(R.data)}catch(R){console.error("加载统计数据失败:",R)}};y.useEffect(()=>{F(),D()},[l,d,f,p,x]);const U=async R=>{try{const q=await $1e(R.person_id);w(q.data),O(!0)}catch(q){$({title:"加载详情失败",description:q instanceof Error?q.message:"无法加载人物详情",variant:"destructive"})}},V=R=>{w(R),A(!0)},H=async R=>{try{await L1e(R.person_id),$({title:"删除成功",description:`已删除人物信息: ${R.person_name||R.nickname||R.user_id}`}),k(null),F(),D()}catch(q){$({title:"删除失败",description:q instanceof Error?q.message:"无法删除人物信息",variant:"destructive"})}},G=y.useMemo(()=>Object.keys(T.platforms),[T.platforms]),L=R=>R?new Date(R*1e3).toLocaleString("zh-CN"):"-";return s.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[s.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[s.jsx(dge,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),s.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),s.jsx("div",{className:"text-2xl font-bold mt-1",children:T.total})]}),s.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),s.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:T.known})]}),s.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),s.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:T.unknown})]})]}),s.jsx("div",{className:"rounded-lg border bg-card p-4",children:s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[s.jsxs("div",{className:"sm:col-span-2",children:[s.jsx(re,{htmlFor:"search",children:"搜索"}),s.jsxs("div",{className:"relative mt-1.5",children:[s.jsx(kr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Oe,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:f,onChange:R=>m(R.target.value),className:"pl-9"})]})]}),s.jsxs("div",{children:[s.jsx(re,{htmlFor:"filter-known",children:"认识状态"}),s.jsxs(Nt,{value:p===void 0?"all":p.toString(),onValueChange:R=>{g(R==="all"?void 0:R==="true"),u(1)},children:[s.jsx(xt,{id:"filter-known",className:"mt-1.5",children:s.jsx(Ot,{})}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"all",children:"全部"}),s.jsx(Pe,{value:"true",children:"已认识"}),s.jsx(Pe,{value:"false",children:"未认识"})]})]})]}),s.jsxs("div",{children:[s.jsx(re,{htmlFor:"filter-platform",children:"平台"}),s.jsxs(Nt,{value:x||"all",onValueChange:R=>{j(R==="all"?void 0:R),u(1)},children:[s.jsx(xt,{id:"filter-platform",className:"mt-1.5",children:s.jsx(Ot,{})}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"all",children:"全部平台"}),G.map(R=>s.jsxs(Pe,{value:R,children:[R," (",T.platforms[R],")"]},R))]})]})]})]})}),s.jsxs("div",{className:"rounded-lg border bg-card",children:[s.jsx(Kt,{className:"h-[calc(100vh-500px)]",children:s.jsxs(Sl,{children:[s.jsx(_l,{children:s.jsxs(hn,{children:[s.jsx(Qe,{children:"状态"}),s.jsx(Qe,{children:"名称"}),s.jsx(Qe,{children:"昵称"}),s.jsx(Qe,{children:"平台"}),s.jsx(Qe,{children:"用户ID"}),s.jsx(Qe,{children:"最后更新"}),s.jsx(Qe,{className:"text-right",children:"操作"})]})}),s.jsx(Nl,{children:n?s.jsx(hn,{children:s.jsx(Ue,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):e.length===0?s.jsx(hn,{children:s.jsx(Ue,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(R=>s.jsxs(hn,{children:[s.jsx(Ue,{children:s.jsx("div",{className:ue("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",R.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:R.is_known?"已认识":"未认识"})}),s.jsx(Ue,{className:"font-medium",children:R.person_name||s.jsx("span",{className:"text-muted-foreground",children:"-"})}),s.jsx(Ue,{children:R.nickname||"-"}),s.jsx(Ue,{children:R.platform}),s.jsx(Ue,{className:"font-mono text-sm",children:R.user_id}),s.jsx(Ue,{className:"text-sm text-muted-foreground",children:L(R.last_know)}),s.jsx(Ue,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>U(R),children:s.jsx(to,{className:"h-4 w-4"})}),s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>V(R),children:s.jsx(GC,{className:"h-4 w-4"})}),s.jsx(me,{variant:"ghost",size:"sm",onClick:()=>k(R),children:s.jsx(zt,{className:"h-4 w-4 text-destructive"})})]})})]},R.id))})]})}),a>d&&s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",children:[s.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",a," 条记录,第 ",l," / ",Math.ceil(a/d)," 页"]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(me,{variant:"outline",size:"sm",onClick:()=>u(l-1),disabled:l===1,children:"上一页"}),s.jsx(me,{variant:"outline",size:"sm",onClick:()=>u(l+1),disabled:l>=Math.ceil(a/d),children:"下一页"})]})]})]}),s.jsx(q1e,{person:b,open:N,onOpenChange:O}),s.jsx(F1e,{person:b,open:C,onOpenChange:A,onSuccess:()=>{F(),D(),A(!1)}}),s.jsx(Qn,{open:!!E,onOpenChange:()=>k(null),children:s.jsxs(Pn,{children:[s.jsxs(Mn,{children:[s.jsx(Dn,{children:"确认删除"}),s.jsxs($n,{children:['确定要删除人物信息 "',E?.person_name||E?.nickname||E?.user_id,'" 吗? 此操作不可撤销。']})]}),s.jsxs(Rn,{children:[s.jsx(Ln,{children:"取消"}),s.jsx(In,{onClick:()=>E&&H(E),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})})]})}function q1e({person:e,open:t,onOpenChange:n}){if(!e)return null;const r=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-";return s.jsx(Jn,{open:t,onOpenChange:n,children:s.jsxs(zn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[s.jsxs(qn,{children:[s.jsx(Fn,{children:"人物详情"}),s.jsxs(lr,{children:["查看 ",e.person_name||e.nickname||e.user_id," 的完整信息"]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(zi,{icon:cge,label:"人物名称",value:e.person_name}),s.jsx(zi,{icon:Mh,label:"昵称",value:e.nickname}),s.jsx(zi,{icon:vg,label:"用户ID",value:e.user_id,mono:!0}),s.jsx(zi,{icon:vg,label:"人物ID",value:e.person_id,mono:!0}),s.jsx(zi,{label:"平台",value:e.platform}),s.jsx(zi,{label:"状态",value:e.is_known?"已认识":"未认识"})]}),e.name_reason&&s.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[s.jsx(re,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),s.jsx("p",{className:"mt-1 text-sm",children:e.name_reason})]}),e.memory_points&&s.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[s.jsx(re,{className:"text-xs text-muted-foreground",children:"个人印象"}),s.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.memory_points})]}),e.group_nick_name&&e.group_nick_name.length>0&&s.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[s.jsx(re,{className:"text-xs text-muted-foreground",children:"群昵称"}),s.jsx("div",{className:"mt-2 space-y-1",children:e.group_nick_name.map((a,i)=>s.jsxs("div",{className:"text-sm flex items-center gap-2",children:[s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:a.group_id}),s.jsx("span",{children:"→"}),s.jsx("span",{children:a.group_nick_name})]},i))})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsx(zi,{icon:el,label:"认识时间",value:r(e.know_times)}),s.jsx(zi,{icon:el,label:"首次记录",value:r(e.know_since)}),s.jsx(zi,{icon:el,label:"最后更新",value:r(e.last_know)})]})]}),s.jsx(Pr,{children:s.jsx(me,{onClick:()=>n(!1),children:"关闭"})})]})})}function zi({icon:e,label:t,value:n,mono:r=!1}){return s.jsxs("div",{className:"space-y-1",children:[s.jsxs(re,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e&&s.jsx(e,{className:"h-3 w-3"}),t]}),s.jsx("div",{className:ue("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function F1e({person:e,open:t,onOpenChange:n,onSuccess:r}){const[a,i]=y.useState({}),[l,u]=y.useState(!1),{toast:d}=Dr();y.useEffect(()=>{e&&i({person_name:e.person_name||"",name_reason:e.name_reason||"",nickname:e.nickname||"",memory_points:e.memory_points||"",is_known:e.is_known})},[e]);const f=async()=>{if(e)try{u(!0),await I1e(e.person_id,a),d({title:"保存成功",description:"人物信息已更新"}),r()}catch(m){d({title:"保存失败",description:m instanceof Error?m.message:"无法更新人物信息",variant:"destructive"})}finally{u(!1)}};return e?s.jsx(Jn,{open:t,onOpenChange:n,children:s.jsxs(zn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[s.jsxs(qn,{children:[s.jsx(Fn,{children:"编辑人物信息"}),s.jsxs(lr,{children:["修改 ",e.person_name||e.nickname||e.user_id," 的信息"]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"person_name",children:"人物名称"}),s.jsx(Oe,{id:"person_name",value:a.person_name||"",onChange:m=>i({...a,person_name:m.target.value}),placeholder:"为这个人设置一个名称"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"nickname",children:"昵称"}),s.jsx(Oe,{id:"nickname",value:a.nickname||"",onChange:m=>i({...a,nickname:m.target.value}),placeholder:"昵称"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"name_reason",children:"名称设定原因"}),s.jsx(fn,{id:"name_reason",value:a.name_reason||"",onChange:m=>i({...a,name_reason:m.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"memory_points",children:"个人印象"}),s.jsx(fn,{id:"memory_points",value:a.memory_points||"",onChange:m=>i({...a,memory_points:m.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),s.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[s.jsxs("div",{children:[s.jsx(re,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),s.jsx(ht,{id:"is_known",checked:a.is_known,onCheckedChange:m=>i({...a,is_known:m})})]})]}),s.jsxs(Pr,{children:[s.jsx(me,{variant:"outline",onClick:()=>n(!1),children:"取消"}),s.jsx(me,{onClick:f,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}function U1e(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const H1e={},uf={};function Ws(e,t){try{const r=(H1e[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return r in uf?uf[r]:m3(r,r.split(":"))}catch{if(e in uf)return uf[e];const n=e?.match(W1e);return n?m3(e,n.slice(1)):NaN}}const W1e=/([+-]\d\d):?(\d\d)?/;function m3(e,t){const n=+(t[0]||0),r=+(t[1]||0),a=+(t[2]||0)/60;return uf[e]=n*60+r>0?n*60+r+a:n*60-r-a}class oi extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Ws(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),iH(this),uO(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new oi(...n,t):new oi(Date.now(),t)}withTimeZone(t){return new oi(+this,t)}getTimezoneOffset(){const t=-Ws(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),uO(this),+this}[Symbol.for("constructDateFrom")](t){return new oi(+new Date(t),this.timeZone)}}const p3=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!p3.test(e))return;const t=e.replace(p3,"$1UTC");oi.prototype[t]&&(e.startsWith("get")?oi.prototype[e]=function(){return this.internal[t]()}:(oi.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),V1e(this),+this},oi.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),uO(this),+this}))});function uO(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Ws(e.timeZone,e)*60))}function V1e(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),iH(e)}function iH(e){const t=Ws(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),l=a-i,u=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();l&&u&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+l);const d=a-n;d&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+d);const f=new Date(+e);f.setUTCSeconds(0);const m=a>0?f.getSeconds():(f.getSeconds()-60)%60,p=Math.round(-(Ws(e.timeZone,e)*60))%60;(p||m)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+p),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+p+m));const g=Ws(e.timeZone,e),x=g>0?Math.floor(g):Math.ceil(g),b=-new Date(+e).getTimezoneOffset()-x,w=x!==n,N=b-d;if(w&&N){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+N);const O=Ws(e.timeZone,e),C=O>0?Math.floor(O):Math.ceil(O),A=x-C;A&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+A),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+A))}}class ar extends oi{static tz(t,...n){return n.length?new ar(...n,t):new ar(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),a=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,a]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${t} GMT${n}${r}${a} (${U1e(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[n,r,a]}withTimeZone(t){return new ar(+this,t)}[Symbol.for("constructDateFrom")](t){return new ar(+new Date(t),this.timeZone)}}const oH=6048e5,G1e=864e5,v3=Symbol.for("constructDateFrom");function pn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&v3 in e?e[v3](t):e instanceof Date?new e.constructor(t):new Date(t)}function Pt(e,t){return pn(t||e,e)}function sH(e,t,n){const r=Pt(e,n?.in);return isNaN(t)?pn(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function lH(e,t,n){const r=Pt(e,n?.in);if(isNaN(t))return pn(e,NaN);if(!t)return r;const a=r.getDate(),i=pn(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const l=i.getDate();return a>=l?i:(r.setFullYear(i.getFullYear(),i.getMonth(),a),r)}let Y1e={};function Hh(){return Y1e}function es(e,t){const n=Hh(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Pt(e,t?.in),i=a.getDay(),l=(i=i.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function g3(e){const t=Pt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function El(e,...t){const n=pn.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function fh(e,t){const n=Pt(e,t?.in);return n.setHours(0,0,0,0),n}function uH(e,t,n){const[r,a]=El(n?.in,e,t),i=fh(r),l=fh(a),u=+i-g3(i),d=+l-g3(l);return Math.round((u-d)/G1e)}function K1e(e,t){const n=cH(e,t),r=pn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),dh(r)}function X1e(e,t,n){return sH(e,t*7,n)}function Z1e(e,t,n){return lH(e,t*12,n)}function Q1e(e,t){let n,r=t?.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=pn.bind(null,a));const i=Pt(a,r);(!n||n{!r&&typeof a=="object"&&(r=pn.bind(null,a));const i=Pt(a,r);(!n||n>i||isNaN(+i))&&(n=i)}),pn(r,n||NaN)}function eje(e,t,n){const[r,a]=El(n?.in,e,t);return+fh(r)==+fh(a)}function dH(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function tje(e){return!(!dH(e)&&typeof e!="number"||isNaN(+Pt(e)))}function nje(e,t,n){const[r,a]=El(n?.in,e,t),i=r.getFullYear()-a.getFullYear(),l=r.getMonth()-a.getMonth();return i*12+l}function rje(e,t){const n=Pt(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function fH(e,t){const[n,r]=El(e,t.start,t.end);return{start:n,end:r}}function aje(e,t){const{start:n,end:r}=fH(t?.in,e);let a=+n>+r;const i=a?+n:+r,l=a?r:n;l.setHours(0,0,0,0),l.setDate(1);let u=1;const d=[];for(;+l<=i;)d.push(pn(n,l)),l.setMonth(l.getMonth()+u);return a?d.reverse():d}function ije(e,t){const n=Pt(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function oje(e,t){const n=Pt(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function hH(e,t){const n=Pt(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function sje(e,t){const{start:n,end:r}=fH(t?.in,e);let a=+n>+r;const i=a?+n:+r,l=a?r:n;l.setHours(0,0,0,0),l.setMonth(0,1);let u=1;const d=[];for(;+l<=i;)d.push(pn(n,l)),l.setFullYear(l.getFullYear()+u);return a?d.reverse():d}function mH(e,t){const n=Hh(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Pt(e,t?.in),i=a.getDay(),l=(i{let r;const a=cje[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Vc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const dje={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},fje={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},hje={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},mje={date:Vc({formats:dje,defaultWidth:"full"}),time:Vc({formats:fje,defaultWidth:"full"}),dateTime:Vc({formats:hje,defaultWidth:"full"})},pje={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},vje=(e,t,n,r)=>pje[e];function ei(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,u=n?.width?String(n.width):l;a=e.formattingValues[u]||e.formattingValues[l]}else{const l=e.defaultWidth,u=n?.width?String(n.width):e.defaultWidth;a=e.values[u]||e.values[l]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const gje={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yje={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},xje={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},bje={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wje={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},jje={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Sje=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},_je={ordinalNumber:Sje,era:ei({values:gje,defaultWidth:"wide"}),quarter:ei({values:yje,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ei({values:xje,defaultWidth:"wide"}),day:ei({values:bje,defaultWidth:"wide"}),dayPeriod:ei({values:wje,defaultWidth:"wide",formattingValues:jje,defaultFormattingWidth:"wide"})};function ti(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const l=i[0],u=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?Oje(u,p=>p.test(l)):Nje(u,p=>p.test(l));let f;f=e.valueCallback?e.valueCallback(d):d,f=n.valueCallback?n.valueCallback(f):f;const m=t.slice(l.length);return{value:f,rest:m}}}function Nje(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Oje(e,t){for(let n=0;n{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],i=t.match(e.parsePattern);if(!i)return null;let l=e.valueCallback?e.valueCallback(i[0]):i[0];l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(a.length);return{value:l,rest:u}}}const Cje=/^(\d+)(th|st|nd|rd)?/i,Eje=/\d+/i,Aje={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Tje={any:[/^b/i,/^(a|c)/i]},kje={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Pje={any:[/1/i,/2/i,/3/i,/4/i]},Mje={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Rje={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Dje={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},$je={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ije={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Lje={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Bje={ordinalNumber:pH({matchPattern:Cje,parsePattern:Eje,valueCallback:e=>parseInt(e,10)}),era:ti({matchPatterns:Aje,defaultMatchWidth:"wide",parsePatterns:Tje,defaultParseWidth:"any"}),quarter:ti({matchPatterns:kje,defaultMatchWidth:"wide",parsePatterns:Pje,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ti({matchPatterns:Mje,defaultMatchWidth:"wide",parsePatterns:Rje,defaultParseWidth:"any"}),day:ti({matchPatterns:Dje,defaultMatchWidth:"wide",parsePatterns:$je,defaultParseWidth:"any"}),dayPeriod:ti({matchPatterns:Ije,defaultMatchWidth:"any",parsePatterns:Lje,defaultParseWidth:"any"})},xE={code:"en-US",formatDistance:uje,formatLong:mje,formatRelative:vje,localize:_je,match:Bje,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zje(e,t){const n=Pt(e,t?.in);return uH(n,hH(n))+1}function vH(e,t){const n=Pt(e,t?.in),r=+dh(n)-+K1e(n);return Math.round(r/oH)+1}function gH(e,t){const n=Pt(e,t?.in),r=n.getFullYear(),a=Hh(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,l=pn(t?.in||e,0);l.setFullYear(r+1,0,i),l.setHours(0,0,0,0);const u=es(l,t),d=pn(t?.in||e,0);d.setFullYear(r,0,i),d.setHours(0,0,0,0);const f=es(d,t);return+n>=+u?r+1:+n>=+f?r:r-1}function qje(e,t){const n=Hh(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=gH(e,t),i=pn(t?.in||e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),es(i,t)}function yH(e,t){const n=Pt(e,t?.in),r=+es(n,t)-+qje(n,t);return Math.round(r/oH)+1}function _t(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const $o={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return _t(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):_t(n+1,2)},d(e,t){return _t(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return _t(e.getHours()%12||12,t.length)},H(e,t){return _t(e.getHours(),t.length)},m(e,t){return _t(e.getMinutes(),t.length)},s(e,t){return _t(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return _t(a,t.length)}},Oc={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},y3={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return $o.y(e,t)},Y:function(e,t,n,r){const a=gH(e,r),i=a>0?a:1-a;if(t==="YY"){const l=i%100;return _t(l,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):_t(i,t.length)},R:function(e,t){const n=cH(e);return _t(n,t.length)},u:function(e,t){const n=e.getFullYear();return _t(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return _t(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return _t(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return $o.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return _t(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=yH(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):_t(a,t.length)},I:function(e,t,n){const r=vH(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):_t(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):$o.d(e,t)},D:function(e,t,n){const r=zje(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):_t(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return _t(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return _t(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return _t(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=Oc.noon:r===0?a=Oc.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=Oc.evening:r>=12?a=Oc.afternoon:r>=4?a=Oc.morning:a=Oc.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return $o.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):$o.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):_t(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):_t(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):$o.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):$o.s(e,t)},S:function(e,t){return $o.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return b3(r);case"XXXX":case"XX":return Ls(r);case"XXXXX":case"XXX":default:return Ls(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return b3(r);case"xxxx":case"xx":return Ls(r);case"xxxxx":case"xxx":default:return Ls(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+x3(r,":");case"OOOO":default:return"GMT"+Ls(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+x3(r,":");case"zzzz":default:return"GMT"+Ls(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return _t(r,t.length)},T:function(e,t,n){return _t(+e,t.length)}};function x3(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+_t(i,2)}function b3(e,t){return e%60===0?(e>0?"-":"+")+_t(Math.abs(e)/60,2):Ls(e,t)}function Ls(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=_t(Math.trunc(r/60),2),i=_t(r%60,2);return n+a+t+i}const w3=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},xH=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Fje=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return w3(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",w3(r,t)).replace("{{time}}",xH(a,t))},Uje={p:xH,P:Fje},Hje=/^D+$/,Wje=/^Y+$/,Vje=["D","DD","YY","YYYY"];function Gje(e){return Hje.test(e)}function Yje(e){return Wje.test(e)}function Kje(e,t,n){const r=Xje(e,t,n);if(console.warn(r),Vje.includes(e))throw new RangeError(r)}function Xje(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Zje=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Qje=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Jje=/^'([^]*?)'?$/,eSe=/''/g,tSe=/[a-zA-Z]/;function rv(e,t,n){const r=Hh(),a=n?.locale??r.locale??xE,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,l=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,u=Pt(e,n?.in);if(!tje(u))throw new RangeError("Invalid time value");let d=t.match(Qje).map(m=>{const p=m[0];if(p==="p"||p==="P"){const g=Uje[p];return g(m,a.formatLong)}return m}).join("").match(Zje).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const p=m[0];if(p==="'")return{isToken:!1,value:nSe(m)};if(y3[p])return{isToken:!0,value:m};if(p.match(tSe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(d=a.localize.preprocessor(u,d));const f={firstWeekContainsDate:i,weekStartsOn:l,locale:a};return d.map(m=>{if(!m.isToken)return m.value;const p=m.value;(!n?.useAdditionalWeekYearTokens&&Yje(p)||!n?.useAdditionalDayOfYearTokens&&Gje(p))&&Kje(p,t,String(e));const g=y3[p[0]];return g(u,p,a.localize,f)}).join("")}function nSe(e){const t=e.match(Jje);return t?t[1].replace(eSe,"'"):e}function rSe(e,t){const n=Pt(e,t?.in),r=n.getFullYear(),a=n.getMonth(),i=pn(n,0);return i.setFullYear(r,a+1,0),i.setHours(0,0,0,0),i.getDate()}function aSe(e,t){return Pt(e,t?.in).getMonth()}function iSe(e,t){return Pt(e,t?.in).getFullYear()}function oSe(e,t){return+Pt(e)>+Pt(t)}function sSe(e,t){return+Pt(e)<+Pt(t)}function lSe(e,t,n){const[r,a]=El(n?.in,e,t);return+es(r,n)==+es(a,n)}function cSe(e,t,n){const[r,a]=El(n?.in,e,t);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function uSe(e,t,n){const[r,a]=El(n?.in,e,t);return r.getFullYear()===a.getFullYear()}function dSe(e,t,n){const r=Pt(e,n?.in),a=r.getFullYear(),i=r.getDate(),l=pn(e,0);l.setFullYear(a,t,15),l.setHours(0,0,0,0);const u=rSe(l);return r.setMonth(t,Math.min(i,u)),r}function fSe(e,t,n){const r=Pt(e,n?.in);return isNaN(+r)?pn(e,NaN):(r.setFullYear(t),r)}const j3=5,hSe=4;function mSe(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,a=t.addDays(e,-r+1),i=t.addDays(a,j3*7-1);return t.getMonth(e)===t.getMonth(i)?j3:hSe}function bH(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function pSe(e,t){const n=bH(e,t),r=mSe(e,t);return t.addDays(n,r*7-1)}class ta{constructor(t,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?ar.tz(this.options.timeZone):new this.Date,this.newDate=(r,a,i)=>this.overrides?.newDate?this.overrides.newDate(r,a,i):this.options.timeZone?new ar(r,a,i,this.options.timeZone):new Date(r,a,i),this.addDays=(r,a)=>this.overrides?.addDays?this.overrides.addDays(r,a):sH(r,a),this.addMonths=(r,a)=>this.overrides?.addMonths?this.overrides.addMonths(r,a):lH(r,a),this.addWeeks=(r,a)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,a):X1e(r,a),this.addYears=(r,a)=>this.overrides?.addYears?this.overrides.addYears(r,a):Z1e(r,a),this.differenceInCalendarDays=(r,a)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,a):uH(r,a),this.differenceInCalendarMonths=(r,a)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,a):nje(r,a),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):aje(r),this.eachYearOfInterval=r=>{const a=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):sje(r),i=new Set(a.map(u=>this.getYear(u)));if(i.size===a.length)return a;const l=[];return i.forEach(u=>{l.push(new Date(u,0,1))}),l},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):pSe(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):lje(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):rje(r),this.endOfWeek=(r,a)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,a):mH(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):oje(r),this.format=(r,a,i)=>{const l=this.overrides?.format?this.overrides.format(r,a,this.options):rv(r,a,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(l):l},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):vH(r),this.getMonth=(r,a)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):aSe(r,this.options),this.getYear=(r,a)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):iSe(r,this.options),this.getWeek=(r,a)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):yH(r,this.options),this.isAfter=(r,a)=>this.overrides?.isAfter?this.overrides.isAfter(r,a):oSe(r,a),this.isBefore=(r,a)=>this.overrides?.isBefore?this.overrides.isBefore(r,a):sSe(r,a),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):dH(r),this.isSameDay=(r,a)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,a):eje(r,a),this.isSameMonth=(r,a)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,a):cSe(r,a),this.isSameYear=(r,a)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,a):uSe(r,a),this.max=r=>this.overrides?.max?this.overrides.max(r):Q1e(r),this.min=r=>this.overrides?.min?this.overrides.min(r):J1e(r),this.setMonth=(r,a)=>this.overrides?.setMonth?this.overrides.setMonth(r,a):dSe(r,a),this.setYear=(r,a)=>this.overrides?.setYear?this.overrides.setYear(r,a):fSe(r,a),this.startOfBroadcastWeek=(r,a)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):bH(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):fh(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):dh(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):ije(r),this.startOfWeek=(r,a)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):es(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):hH(r),this.options={locale:xE,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let a=0;a<10;a++)r[a.toString()]=n.format(a);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){const t=this.options.locale?.code;return t&&ta.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:a}=this.options,i=n?.code;if(i&&ta.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:r,numberingSystem:a}).format(t)}catch{}const l=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,l)}}ta.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const xi=new ta;class wH{constructor(t,n,r=xi){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class vSe{constructor(t,n){this.date=t,this.weeks=n}}class gSe{constructor(t,n){this.days=n,this.weekNumber=t}}function ySe(e){return W.createElement("button",{...e})}function xSe(e){return W.createElement("span",{...e})}function bSe(e){const{size:t=24,orientation:n="left",className:r}=e;return W.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&W.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&W.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&W.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&W.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function wSe(e){const{day:t,modifiers:n,...r}=e;return W.createElement("td",{...r})}function jSe(e){const{day:t,modifiers:n,...r}=e,a=W.useRef(null);return W.useEffect(()=>{n.focused&&a.current?.focus()},[n.focused]),W.createElement("button",{ref:a,...r})}var $e;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})($e||($e={}));var Yt;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Yt||(Yt={}));var Da;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Da||(Da={}));var Gr;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(Gr||(Gr={}));function SSe(e){const{options:t,className:n,components:r,classNames:a,...i}=e,l=[a[$e.Dropdown],n].join(" "),u=t?.find(({value:d})=>d===i.value);return W.createElement("span",{"data-disabled":i.disabled,className:a[$e.DropdownRoot]},W.createElement(r.Select,{className:l,...i},t?.map(({value:d,label:f,disabled:m})=>W.createElement(r.Option,{key:d,value:d,disabled:m},f))),W.createElement("span",{className:a[$e.CaptionLabel],"aria-hidden":!0},u?.label,W.createElement(r.Chevron,{orientation:"down",size:18,className:a[$e.Chevron]})))}function _Se(e){return W.createElement("div",{...e})}function NSe(e){return W.createElement("div",{...e})}function OSe(e){const{calendarMonth:t,displayIndex:n,...r}=e;return W.createElement("div",{...r},e.children)}function CSe(e){const{calendarMonth:t,displayIndex:n,...r}=e;return W.createElement("div",{...r})}function ESe(e){return W.createElement("table",{...e})}function ASe(e){return W.createElement("div",{...e})}const jH=y.createContext(void 0);function Wh(){const e=y.useContext(jH);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function TSe(e){const{components:t}=Wh();return W.createElement(t.Dropdown,{...e})}function kSe(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:a,...i}=e,{components:l,classNames:u,labels:{labelPrevious:d,labelNext:f}}=Wh(),m=y.useCallback(g=>{a&&n?.(g)},[a,n]),p=y.useCallback(g=>{r&&t?.(g)},[r,t]);return W.createElement("nav",{...i},W.createElement(l.PreviousMonthButton,{type:"button",className:u[$e.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":d(r),onClick:p},W.createElement(l.Chevron,{disabled:r?void 0:!0,className:u[$e.Chevron],orientation:"left"})),W.createElement(l.NextMonthButton,{type:"button",className:u[$e.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":f(a),onClick:m},W.createElement(l.Chevron,{disabled:a?void 0:!0,orientation:"right",className:u[$e.Chevron]})))}function PSe(e){const{components:t}=Wh();return W.createElement(t.Button,{...e})}function MSe(e){return W.createElement("option",{...e})}function RSe(e){const{components:t}=Wh();return W.createElement(t.Button,{...e})}function DSe(e){const{rootRef:t,...n}=e;return W.createElement("div",{...n,ref:t})}function $Se(e){return W.createElement("select",{...e})}function ISe(e){const{week:t,...n}=e;return W.createElement("tr",{...n})}function LSe(e){return W.createElement("th",{...e})}function BSe(e){return W.createElement("thead",{"aria-hidden":!0},W.createElement("tr",{...e}))}function zSe(e){const{week:t,...n}=e;return W.createElement("th",{...n})}function qSe(e){return W.createElement("th",{...e})}function FSe(e){return W.createElement("tbody",{...e})}function USe(e){const{components:t}=Wh();return W.createElement(t.Dropdown,{...e})}const HSe=Object.freeze(Object.defineProperty({__proto__:null,Button:ySe,CaptionLabel:xSe,Chevron:bSe,Day:wSe,DayButton:jSe,Dropdown:SSe,DropdownNav:_Se,Footer:NSe,Month:OSe,MonthCaption:CSe,MonthGrid:ESe,Months:ASe,MonthsDropdown:TSe,Nav:kSe,NextMonthButton:PSe,Option:MSe,PreviousMonthButton:RSe,Root:DSe,Select:$Se,Week:ISe,WeekNumber:zSe,WeekNumberHeader:qSe,Weekday:LSe,Weekdays:BSe,Weeks:FSe,YearsDropdown:USe},Symbol.toStringTag,{value:"Module"}));function Vi(e,t,n=!1,r=xi){let{from:a,to:i}=e;const{differenceInCalendarDays:l,isSameDay:u}=r;return a&&i?(l(i,a)<0&&([a,i]=[i,a]),l(t,a)>=(n?1:0)&&l(i,t)>=(n?1:0)):!n&&i?u(i,t):!n&&a?u(a,t):!1}function SH(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function bE(e){return!!(e&&typeof e=="object"&&"from"in e)}function _H(e){return!!(e&&typeof e=="object"&&"after"in e)}function NH(e){return!!(e&&typeof e=="object"&&"before"in e)}function OH(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function CH(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Gi(e,t,n=xi){const r=Array.isArray(t)?t:[t],{isSameDay:a,differenceInCalendarDays:i,isAfter:l}=n;return r.some(u=>{if(typeof u=="boolean")return u;if(n.isDate(u))return a(e,u);if(CH(u,n))return u.includes(e);if(bE(u))return Vi(u,e,!1,n);if(OH(u))return Array.isArray(u.dayOfWeek)?u.dayOfWeek.includes(e.getDay()):u.dayOfWeek===e.getDay();if(SH(u)){const d=i(u.before,e),f=i(u.after,e),m=d>0,p=f<0;return l(u.before,u.after)?p&&m:m||p}return _H(u)?i(e,u.after)>0:NH(u)?i(u.before,e)>0:typeof u=="function"?u(e):!1})}function WSe(e,t,n,r,a){const{disabled:i,hidden:l,modifiers:u,showOutsideDays:d,broadcastCalendar:f,today:m}=t,{isSameDay:p,isSameMonth:g,startOfMonth:x,isBefore:j,endOfMonth:b,isAfter:w}=a,N=n&&x(n),O=r&&b(r),C={[Yt.focused]:[],[Yt.outside]:[],[Yt.disabled]:[],[Yt.hidden]:[],[Yt.today]:[]},A={};for(const E of e){const{date:k,displayMonth:T}=E,P=!!(T&&!g(k,T)),$=!!(N&&j(k,N)),F=!!(O&&w(k,O)),D=!!(i&&Gi(k,i,a)),U=!!(l&&Gi(k,l,a))||$||F||!f&&!d&&P||f&&d===!1&&P,V=p(k,m??a.today());P&&C.outside.push(E),D&&C.disabled.push(E),U&&C.hidden.push(E),V&&C.today.push(E),u&&Object.keys(u).forEach(H=>{const G=u?.[H];G&&Gi(k,G,a)&&(A[H]?A[H].push(E):A[H]=[E])})}return E=>{const k={[Yt.focused]:!1,[Yt.disabled]:!1,[Yt.hidden]:!1,[Yt.outside]:!1,[Yt.today]:!1},T={};for(const P in C){const $=C[P];k[P]=$.some(F=>F===E)}for(const P in A)T[P]=A[P].some($=>$===E);return{...k,...T}}}function VSe(e,t,n={}){return Object.entries(e).filter(([,a])=>a===!0).reduce((a,[i])=>(n[i]?a.push(n[i]):t[Yt[i]]?a.push(t[Yt[i]]):t[Da[i]]&&a.push(t[Da[i]]),a),[t[$e.Day]])}function GSe(e){return{...HSe,...e}}function YSe(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function wE(){const e={};for(const t in $e)e[$e[t]]=`rdp-${$e[t]}`;for(const t in Yt)e[Yt[t]]=`rdp-${Yt[t]}`;for(const t in Da)e[Da[t]]=`rdp-${Da[t]}`;for(const t in Gr)e[Gr[t]]=`rdp-${Gr[t]}`;return e}function EH(e,t,n){return(n??new ta(t)).formatMonthYear(e)}const KSe=EH;function XSe(e,t,n){return(n??new ta(t)).format(e,"d")}function ZSe(e,t=xi){return t.format(e,"LLLL")}function QSe(e,t,n){return(n??new ta(t)).format(e,"cccccc")}function JSe(e,t=xi){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function e_e(){return""}function AH(e,t=xi){return t.format(e,"yyyy")}const t_e=AH,n_e=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:EH,formatDay:XSe,formatMonthCaption:KSe,formatMonthDropdown:ZSe,formatWeekNumber:JSe,formatWeekNumberHeader:e_e,formatWeekdayName:QSe,formatYearCaption:t_e,formatYearDropdown:AH},Symbol.toStringTag,{value:"Module"}));function r_e(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...n_e,...e}}function a_e(e,t,n,r,a){const{startOfMonth:i,startOfYear:l,endOfYear:u,eachMonthOfInterval:d,getMonth:f}=a;return d({start:l(e),end:u(e)}).map(g=>{const x=r.formatMonthDropdown(g,a),j=f(g),b=t&&gi(n)||!1;return{value:j,label:x,disabled:b}})}function i_e(e,t={},n={}){let r={...t?.[$e.Day]};return Object.entries(e).filter(([,a])=>a===!0).forEach(([a])=>{r={...r,...n?.[a]}}),r}function o_e(e,t,n){const r=e.today(),a=t?e.startOfISOWeek(r):e.startOfWeek(r),i=[];for(let l=0;l<7;l++){const u=e.addDays(a,l);i.push(u)}return i}function s_e(e,t,n,r,a=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:l,eachYearOfInterval:u,getYear:d}=r,f=i(e),m=l(t),p=u({start:f,end:m});return a&&p.reverse(),p.map(g=>{const x=n.formatYearDropdown(g,r);return{value:d(g),label:x,disabled:!1}})}function TH(e,t,n,r){let a=(r??new ta(n)).format(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a}const l_e=TH;function kH(e,t,n){return(n??new ta(t)).formatMonthYear(e)}const c_e=kH;function u_e(e,t,n,r){let a=(r??new ta(n)).format(e,"PPPP");return t?.today&&(a=`Today, ${a}`),a}function d_e(e){return"Choose the Month"}function f_e(){return""}function h_e(e){return"Go to the Next Month"}function m_e(e){return"Go to the Previous Month"}function p_e(e,t,n){return(n??new ta(t)).format(e,"cccc")}function v_e(e,t){return`Week ${e}`}function g_e(e){return"Week Number"}function y_e(e){return"Choose the Year"}const x_e=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:c_e,labelDay:l_e,labelDayButton:TH,labelGrid:kH,labelGridcell:u_e,labelMonthDropdown:d_e,labelNav:f_e,labelNext:h_e,labelPrevious:m_e,labelWeekNumber:v_e,labelWeekNumberHeader:g_e,labelWeekday:p_e,labelYearDropdown:y_e},Symbol.toStringTag,{value:"Module"})),Vh=e=>e instanceof HTMLElement?e:null,n_=e=>[...e.querySelectorAll("[data-animated-month]")??[]],b_e=e=>Vh(e.querySelector("[data-animated-month]")),r_=e=>Vh(e.querySelector("[data-animated-caption]")),a_=e=>Vh(e.querySelector("[data-animated-weeks]")),w_e=e=>Vh(e.querySelector("[data-animated-nav]")),j_e=e=>Vh(e.querySelector("[data-animated-weekdays]"));function S_e(e,t,{classNames:n,months:r,focused:a,dateLib:i}){const l=y.useRef(null),u=y.useRef(r),d=y.useRef(!1);y.useLayoutEffect(()=>{const f=u.current;if(u.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||f.length===0||r.length!==f.length)return;const m=i.isSameMonth(r[0].date,f[0].date),p=i.isAfter(r[0].date,f[0].date),g=p?n[Gr.caption_after_enter]:n[Gr.caption_before_enter],x=p?n[Gr.weeks_after_enter]:n[Gr.weeks_before_enter],j=l.current,b=e.current.cloneNode(!0);if(b instanceof HTMLElement?(n_(b).forEach(C=>{if(!(C instanceof HTMLElement))return;const A=b_e(C);A&&C.contains(A)&&C.removeChild(A);const E=r_(C);E&&E.classList.remove(g);const k=a_(C);k&&k.classList.remove(x)}),l.current=b):l.current=null,d.current||m||a)return;const w=j instanceof HTMLElement?n_(j):[],N=n_(e.current);if(N?.every(O=>O instanceof HTMLElement)&&w&&w.every(O=>O instanceof HTMLElement)){d.current=!0,e.current.style.isolation="isolate";const O=w_e(e.current);O&&(O.style.zIndex="1"),N.forEach((C,A)=>{const E=w[A];if(!E)return;C.style.position="relative",C.style.overflow="hidden";const k=r_(C);k&&k.classList.add(g);const T=a_(C);T&&T.classList.add(x);const P=()=>{d.current=!1,e.current&&(e.current.style.isolation=""),O&&(O.style.zIndex=""),k&&k.classList.remove(g),T&&T.classList.remove(x),C.style.position="",C.style.overflow="",C.contains(E)&&C.removeChild(E)};E.style.pointerEvents="none",E.style.position="absolute",E.style.overflow="hidden",E.setAttribute("aria-hidden","true");const $=j_e(E);$&&($.style.opacity="0");const F=r_(E);F&&(F.classList.add(p?n[Gr.caption_before_exit]:n[Gr.caption_after_exit]),F.addEventListener("animationend",P));const D=a_(E);D&&D.classList.add(p?n[Gr.weeks_before_exit]:n[Gr.weeks_after_exit]),C.insertBefore(E,C.firstChild)})}})}function __e(e,t,n,r){const a=e[0],i=e[e.length-1],{ISOWeek:l,fixedWeeks:u,broadcastCalendar:d}=n??{},{addDays:f,differenceInCalendarDays:m,differenceInCalendarMonths:p,endOfBroadcastWeek:g,endOfISOWeek:x,endOfMonth:j,endOfWeek:b,isAfter:w,startOfBroadcastWeek:N,startOfISOWeek:O,startOfWeek:C}=r,A=d?N(a,r):l?O(a):C(a),E=d?g(i):l?x(j(i)):b(j(i)),k=m(E,A),T=p(i,a)+1,P=[];for(let D=0;D<=k;D++){const U=f(A,D);if(t&&w(U,t))break;P.push(U)}const F=(d?35:42)*T;if(u&&P.length{const a=r.weeks.reduce((i,l)=>i.concat(l.days.slice()),t.slice());return n.concat(a.slice())},t.slice())}function O_e(e,t,n,r){const{numberOfMonths:a=1}=n,i=[];for(let l=0;lt)break;i.push(u)}return i}function S3(e,t,n,r){const{month:a,defaultMonth:i,today:l=r.today(),numberOfMonths:u=1}=e;let d=a||i||l;const{differenceInCalendarMonths:f,addMonths:m,startOfMonth:p}=r;if(n&&f(n,d){const N=n.broadcastCalendar?p(w,r):n.ISOWeek?g(w):x(w),O=n.broadcastCalendar?i(w):n.ISOWeek?l(u(w)):d(u(w)),C=t.filter(T=>T>=N&&T<=O),A=n.broadcastCalendar?35:42;if(n.fixedWeeks&&C.length{const $=A-C.length;return P>O&&P<=a(O,$)});C.push(...T)}const E=C.reduce((T,P)=>{const $=n.ISOWeek?f(P):m(P),F=T.find(U=>U.weekNumber===$),D=new wH(P,w,r);return F?F.days.push(D):T.push(new gSe($,[D])),T},[]),k=new vSe(w,E);return b.push(k),b},[]);return n.reverseMonths?j.reverse():j}function E_e(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:a,startOfDay:i,startOfMonth:l,endOfMonth:u,addYears:d,endOfYear:f,newDate:m,today:p}=t,{fromYear:g,toYear:x,fromMonth:j,toMonth:b}=e;!n&&j&&(n=j),!n&&g&&(n=t.newDate(g,0,1)),!r&&b&&(r=b),!r&&x&&(r=m(x,11,31));const w=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=l(n):g?n=m(g,0,1):!n&&w&&(n=a(d(e.today??p(),-100))),r?r=u(r):x?r=m(x,11,31):!r&&w&&(r=f(e.today??p())),[n&&i(n),r&&i(r)]}function A_e(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:i=1}=n,{startOfMonth:l,addMonths:u,differenceInCalendarMonths:d}=r,f=a?i:1,m=l(e);if(!t)return u(m,f);if(!(d(t,e)n.concat(r.weeks.slice()),t.slice())}function Ky(e,t){const[n,r]=y.useState(e);return[t===void 0?n:t,r]}function P_e(e,t){const[n,r]=E_e(e,t),{startOfMonth:a,endOfMonth:i}=t,l=S3(e,n,r,t),[u,d]=Ky(l,e.month?l:void 0);y.useEffect(()=>{const k=S3(e,n,r,t);d(k)},[e.timeZone]);const f=O_e(u,r,e,t),m=__e(f,e.endMonth?i(e.endMonth):void 0,e,t),p=C_e(f,m,e,t),g=k_e(p),x=N_e(p),j=T_e(u,n,e,t),b=A_e(u,r,e,t),{disableNavigation:w,onMonthChange:N}=e,O=k=>g.some(T=>T.days.some(P=>P.isEqualTo(k))),C=k=>{if(w)return;let T=a(k);n&&Ta(r)&&(T=a(r)),d(T),N?.(T)};return{months:p,weeks:g,days:x,navStart:n,navEnd:r,previousMonth:j,nextMonth:b,goToMonth:C,goToDay:k=>{O(k)||C(k.date)}}}var Za;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Za||(Za={}));function _3(e){return!e[Yt.disabled]&&!e[Yt.hidden]&&!e[Yt.outside]}function M_e(e,t,n,r){let a,i=-1;for(const l of e){const u=t(l);_3(u)&&(u[Yt.focused]&&i_3(t(l)))),a}function R_e(e,t,n,r,a,i,l){const{ISOWeek:u,broadcastCalendar:d}=i,{addDays:f,addMonths:m,addWeeks:p,addYears:g,endOfBroadcastWeek:x,endOfISOWeek:j,endOfWeek:b,max:w,min:N,startOfBroadcastWeek:O,startOfISOWeek:C,startOfWeek:A}=l;let k={day:f,week:p,month:m,year:g,startOfWeek:T=>d?O(T,l):u?C(T):A(T),endOfWeek:T=>d?x(T):u?j(T):b(T)}[e](n,t==="after"?1:-1);return t==="before"&&r?k=w([r,k]):t==="after"&&a&&(k=N([a,k])),k}function PH(e,t,n,r,a,i,l,u=0){if(u>365)return;const d=R_e(e,t,n.date,r,a,i,l),f=!!(i.disabled&&Gi(d,i.disabled,l)),m=!!(i.hidden&&Gi(d,i.hidden,l)),p=d,g=new wH(d,p,l);return!f&&!m?g:PH(e,t,g,r,a,i,l,u+1)}function D_e(e,t,n,r,a){const{autoFocus:i}=e,[l,u]=y.useState(),d=M_e(t.days,n,r||(()=>!1),l),[f,m]=y.useState(i?d:void 0);return{isFocusTarget:b=>!!d?.isEqualTo(b),setFocused:m,focused:f,blur:()=>{u(f),m(void 0)},moveFocus:(b,w)=>{if(!f)return;const N=PH(b,w,f,t.navStart,t.navEnd,e,a);N&&(e.disableNavigation&&!t.days.some(C=>C.isEqualTo(N))||(t.goToDay(N),m(N)))}}}function $_e(e,t){const{selected:n,required:r,onSelect:a}=e,[i,l]=Ky(n,a?n:void 0),u=a?n:i,{isSameDay:d}=t,f=x=>u?.some(j=>d(j,x))??!1,{min:m,max:p}=e;return{selected:u,select:(x,j,b)=>{let w=[...u??[]];if(f(x)){if(u?.length===m||r&&u?.length===1)return;w=u?.filter(N=>!d(N,x))}else u?.length===p?w=[x]:w=[...w,x];return a||l(w),a?.(w,x,j,b),w},isSelected:f}}function I_e(e,t,n=0,r=0,a=!1,i=xi){const{from:l,to:u}=t||{},{isSameDay:d,isAfter:f,isBefore:m}=i;let p;if(!l&&!u)p={from:e,to:n>0?void 0:e};else if(l&&!u)d(l,e)?n===0?p={from:l,to:e}:a?p={from:l,to:void 0}:p=void 0:m(e,l)?p={from:e,to:l}:p={from:l,to:e};else if(l&&u)if(d(l,e)&&d(u,e))a?p={from:l,to:u}:p=void 0;else if(d(l,e))p={from:l,to:n>0?void 0:e};else if(d(u,e))p={from:e,to:n>0?void 0:e};else if(m(e,l))p={from:e,to:u};else if(f(e,l))p={from:l,to:e};else if(f(e,u))p={from:l,to:e};else throw new Error("Invalid range");if(p?.from&&p?.to){const g=i.differenceInCalendarDays(p.to,p.from);r>0&&g>r?p={from:e,to:void 0}:n>1&&gtypeof u!="function").some(u=>typeof u=="boolean"?u:n.isDate(u)?Vi(e,u,!1,n):CH(u,n)?u.some(d=>Vi(e,d,!1,n)):bE(u)?u.from&&u.to?N3(e,{from:u.from,to:u.to},n):!1:OH(u)?L_e(e,u.dayOfWeek,n):SH(u)?n.isAfter(u.before,u.after)?N3(e,{from:n.addDays(u.after,1),to:n.addDays(u.before,-1)},n):Gi(e.from,u,n)||Gi(e.to,u,n):_H(u)||NH(u)?Gi(e.from,u,n)||Gi(e.to,u,n):!1))return!0;const l=r.filter(u=>typeof u=="function");if(l.length){let u=e.from;const d=n.differenceInCalendarDays(e.to,e.from);for(let f=0;f<=d;f++){if(l.some(m=>m(u)))return!0;u=n.addDays(u,1)}}return!1}function z_e(e,t){const{disabled:n,excludeDisabled:r,selected:a,required:i,onSelect:l}=e,[u,d]=Ky(a,l?a:void 0),f=l?a:u;return{selected:f,select:(g,x,j)=>{const{min:b,max:w}=e,N=g?I_e(g,f,b,w,i,t):void 0;return r&&n&&N?.from&&N.to&&B_e({from:N.from,to:N.to},n,t)&&(N.from=g,N.to=void 0),l||d(N),l?.(N,g,x,j),N},isSelected:g=>f&&Vi(f,g,!1,t)}}function q_e(e,t){const{selected:n,required:r,onSelect:a}=e,[i,l]=Ky(n,a?n:void 0),u=a?n:i,{isSameDay:d}=t;return{selected:u,select:(p,g,x)=>{let j=p;return!r&&u&&u&&d(p,u)&&(j=void 0),a||l(j),a?.(j,p,g,x),j},isSelected:p=>u?d(u,p):!1}}function F_e(e,t){const n=q_e(e,t),r=$_e(e,t),a=z_e(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return a;default:return}}function U_e(e){let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new ar(t.today,t.timeZone)),t.month&&(t.month=new ar(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new ar(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new ar(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new ar(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new ar(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=t.selected?.map(Je=>new ar(Je,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new ar(t.selected.from,t.timeZone):void 0,to:t.selected.to?new ar(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:r,labels:a,dateLib:i,locale:l,classNames:u}=y.useMemo(()=>{const Je={...xE,...t.locale};return{dateLib:new ta({locale:Je,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:GSe(t.components),formatters:r_e(t.formatters),labels:{...x_e,...t.labels},locale:Je,classNames:{...wE(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:d,mode:f,navLayout:m,numberOfMonths:p=1,onDayBlur:g,onDayClick:x,onDayFocus:j,onDayKeyDown:b,onDayMouseEnter:w,onDayMouseLeave:N,onNextClick:O,onPrevClick:C,showWeekNumber:A,styles:E}=t,{formatCaption:k,formatDay:T,formatMonthDropdown:P,formatWeekNumber:$,formatWeekNumberHeader:F,formatWeekdayName:D,formatYearDropdown:U}=r,V=P_e(t,i),{days:H,months:G,navStart:L,navEnd:R,previousMonth:q,nextMonth:K,goToMonth:ee}=V,I=WSe(H,t,L,R,i),{isSelected:B,select:Y,selected:te}=F_e(t,i)??{},{blur:oe,focused:xe,isFocusTarget:J,moveFocus:ae,setFocused:Z}=D_e(t,V,I,B??(()=>!1),i),{labelDayButton:pe,labelGridcell:je,labelGrid:le,labelMonthDropdown:Re,labelNav:_e,labelPrevious:he,labelNext:ve,labelWeekday:Le,labelWeekNumber:Mt,labelWeekNumberHeader:vn,labelYearDropdown:fr}=a,er=y.useMemo(()=>o_e(i,t.ISOWeek),[i,t.ISOWeek]),hr=f!==void 0||x!==void 0,it=y.useCallback(()=>{q&&(ee(q),C?.(q))},[q,ee,C]),nt=y.useCallback(()=>{K&&(ee(K),O?.(K))},[ee,K,O]),Nn=y.useCallback((Je,$t)=>He=>{He.preventDefault(),He.stopPropagation(),Z(Je),Y?.(Je.date,$t,He),x?.(Je.date,$t,He)},[Y,x,Z]),ds=y.useCallback((Je,$t)=>He=>{Z(Je),j?.(Je.date,$t,He)},[j,Z]),Qh=y.useCallback((Je,$t)=>He=>{oe(),g?.(Je.date,$t,He)},[oe,g]),Tl=y.useCallback((Je,$t)=>He=>{const pt={ArrowLeft:[He.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[He.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[He.shiftKey?"year":"week","after"],ArrowUp:[He.shiftKey?"year":"week","before"],PageUp:[He.shiftKey?"year":"month","before"],PageDown:[He.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(pt[He.key]){He.preventDefault(),He.stopPropagation();const[On,et]=pt[He.key];ae(On,et)}b?.(Je.date,$t,He)},[ae,b,t.dir]),tx=y.useCallback((Je,$t)=>He=>{w?.(Je.date,$t,He)},[w]),Jh=y.useCallback((Je,$t)=>He=>{N?.(Je.date,$t,He)},[N]),nx=y.useCallback(Je=>$t=>{const He=Number($t.target.value),pt=i.setMonth(i.startOfMonth(Je),He);ee(pt)},[i,ee]),rx=y.useCallback(Je=>$t=>{const He=Number($t.target.value),pt=i.setYear(i.startOfMonth(Je),He);ee(pt)},[i,ee]),{className:fs,style:mr}=y.useMemo(()=>({className:[u[$e.Root],t.className].filter(Boolean).join(" "),style:{...E?.[$e.Root],...t.style}}),[u,t.className,t.style,E]),Wa=YSe(t),tr=y.useRef(null);S_e(tr,!!t.animate,{classNames:u,months:G,focused:xe,dateLib:i});const ax={dayPickerProps:t,selected:te,select:Y,isSelected:B,months:G,nextMonth:K,previousMonth:q,goToMonth:ee,getModifiers:I,components:n,classNames:u,styles:E,labels:a,formatters:r};return W.createElement(jH.Provider,{value:ax},W.createElement(n.Root,{rootRef:t.animate?tr:void 0,className:fs,style:mr,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Wa},W.createElement(n.Months,{className:u[$e.Months],style:E?.[$e.Months]},!t.hideNavigation&&!m&&W.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:u[$e.Nav],style:E?.[$e.Nav],"aria-label":_e(),onPreviousClick:it,onNextClick:nt,previousMonth:q,nextMonth:K}),G.map((Je,$t)=>W.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:u[$e.Month],style:E?.[$e.Month],key:$t,displayIndex:$t,calendarMonth:Je},m==="around"&&!t.hideNavigation&&$t===0&&W.createElement(n.PreviousMonthButton,{type:"button",className:u[$e.PreviousMonthButton],tabIndex:q?void 0:-1,"aria-disabled":q?void 0:!0,"aria-label":he(q),onClick:it,"data-animated-button":t.animate?"true":void 0},W.createElement(n.Chevron,{disabled:q?void 0:!0,className:u[$e.Chevron],orientation:t.dir==="rtl"?"right":"left"})),W.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:u[$e.MonthCaption],style:E?.[$e.MonthCaption],calendarMonth:Je,displayIndex:$t},d?.startsWith("dropdown")?W.createElement(n.DropdownNav,{className:u[$e.Dropdowns],style:E?.[$e.Dropdowns]},(()=>{const He=d==="dropdown"||d==="dropdown-months"?W.createElement(n.MonthsDropdown,{key:"month",className:u[$e.MonthsDropdown],"aria-label":Re(),classNames:u,components:n,disabled:!!t.disableNavigation,onChange:nx(Je.date),options:a_e(Je.date,L,R,r,i),style:E?.[$e.Dropdown],value:i.getMonth(Je.date)}):W.createElement("span",{key:"month"},P(Je.date,i)),pt=d==="dropdown"||d==="dropdown-years"?W.createElement(n.YearsDropdown,{key:"year",className:u[$e.YearsDropdown],"aria-label":fr(i.options),classNames:u,components:n,disabled:!!t.disableNavigation,onChange:rx(Je.date),options:s_e(L,R,r,i,!!t.reverseYears),style:E?.[$e.Dropdown],value:i.getYear(Je.date)}):W.createElement("span",{key:"year"},U(Je.date,i));return i.getMonthYearOrder()==="year-first"?[pt,He]:[He,pt]})(),W.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},k(Je.date,i.options,i))):W.createElement(n.CaptionLabel,{className:u[$e.CaptionLabel],role:"status","aria-live":"polite"},k(Je.date,i.options,i))),m==="around"&&!t.hideNavigation&&$t===p-1&&W.createElement(n.NextMonthButton,{type:"button",className:u[$e.NextMonthButton],tabIndex:K?void 0:-1,"aria-disabled":K?void 0:!0,"aria-label":ve(K),onClick:nt,"data-animated-button":t.animate?"true":void 0},W.createElement(n.Chevron,{disabled:K?void 0:!0,className:u[$e.Chevron],orientation:t.dir==="rtl"?"left":"right"})),$t===p-1&&m==="after"&&!t.hideNavigation&&W.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:u[$e.Nav],style:E?.[$e.Nav],"aria-label":_e(),onPreviousClick:it,onNextClick:nt,previousMonth:q,nextMonth:K}),W.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":f==="multiple"||f==="range","aria-label":le(Je.date,i.options,i)||void 0,className:u[$e.MonthGrid],style:E?.[$e.MonthGrid]},!t.hideWeekdays&&W.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:u[$e.Weekdays],style:E?.[$e.Weekdays]},A&&W.createElement(n.WeekNumberHeader,{"aria-label":vn(i.options),className:u[$e.WeekNumberHeader],style:E?.[$e.WeekNumberHeader],scope:"col"},F()),er.map(He=>W.createElement(n.Weekday,{"aria-label":Le(He,i.options,i),className:u[$e.Weekday],key:String(He),style:E?.[$e.Weekday],scope:"col"},D(He,i.options,i)))),W.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:u[$e.Weeks],style:E?.[$e.Weeks]},Je.weeks.map(He=>W.createElement(n.Week,{className:u[$e.Week],key:He.weekNumber,style:E?.[$e.Week],week:He},A&&W.createElement(n.WeekNumber,{week:He,style:E?.[$e.WeekNumber],"aria-label":Mt(He.weekNumber,{locale:l}),className:u[$e.WeekNumber],scope:"row",role:"rowheader"},$(He.weekNumber,i)),He.days.map(pt=>{const{date:On}=pt,et=I(pt);if(et[Yt.focused]=!et.hidden&&!!xe?.isEqualTo(pt),et[Da.selected]=B?.(On)||et.selected,bE(te)){const{from:Pl,to:ms}=te;et[Da.range_start]=!!(Pl&&ms&&i.isSameDay(On,Pl)),et[Da.range_end]=!!(Pl&&ms&&i.isSameDay(On,ms)),et[Da.range_middle]=Vi(te,On,!0,i)}const kl=i_e(et,E,t.modifiersStyles),hs=VSe(et,u,t.modifiersClassNames),ix=!hr&&!et.hidden?je(On,et,i.options,i):void 0;return W.createElement(n.Day,{key:`${i.format(On,"yyyy-MM-dd")}_${i.format(pt.displayMonth,"yyyy-MM")}`,day:pt,modifiers:et,className:hs.join(" "),style:kl,role:"gridcell","aria-selected":et.selected||void 0,"aria-label":ix,"data-day":i.format(On,"yyyy-MM-dd"),"data-month":pt.outside?i.format(On,"yyyy-MM"):void 0,"data-selected":et.selected||void 0,"data-disabled":et.disabled||void 0,"data-hidden":et.hidden||void 0,"data-outside":pt.outside||void 0,"data-focused":et.focused||void 0,"data-today":et.today||void 0},!et.hidden&&hr?W.createElement(n.DayButton,{className:u[$e.DayButton],style:E?.[$e.DayButton],type:"button",day:pt,modifiers:et,disabled:et.disabled||void 0,tabIndex:J(pt)?0:-1,"aria-label":pe(On,et,i.options,i),onClick:Nn(pt,et),onBlur:Qh(pt,et),onFocus:ds(pt,et),onKeyDown:Tl(pt,et),onMouseEnter:tx(pt,et),onMouseLeave:Jh(pt,et)},T(On,i.options,i)):!et.hidden&&T(pt.date,i.options,i))})))))))),t.footer&&W.createElement(n.Footer,{className:u[$e.Footer],style:E?.[$e.Footer],role:"status","aria-live":"polite"},t.footer)))}function O3({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:a="ghost",formatters:i,components:l,...u}){const d=wE();return s.jsx(U_e,{showOutsideDays:n,className:ue("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:f=>f.toLocaleString("default",{month:"short"}),...i},classNames:{root:ue("w-fit",d.root),months:ue("relative flex flex-col gap-4 md:flex-row",d.months),month:ue("flex w-full flex-col gap-4",d.month),nav:ue("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",d.nav),button_previous:ue(lh({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",d.button_previous),button_next:ue(lh({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",d.button_next),month_caption:ue("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",d.month_caption),dropdowns:ue("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",d.dropdowns),dropdown_root:ue("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",d.dropdown_root),dropdown:ue("bg-popover absolute inset-0 opacity-0",d.dropdown),caption_label:ue("select-none font-medium",r==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",d.caption_label),table:"w-full border-collapse",weekdays:ue("flex",d.weekdays),weekday:ue("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",d.weekday),week:ue("mt-2 flex w-full",d.week),week_number_header:ue("w-[--cell-size] select-none",d.week_number_header),week_number:ue("text-muted-foreground select-none text-[0.8rem]",d.week_number),day:ue("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",d.day),range_start:ue("bg-accent rounded-l-md",d.range_start),range_middle:ue("rounded-none",d.range_middle),range_end:ue("bg-accent rounded-r-md",d.range_end),today:ue("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",d.today),outside:ue("text-muted-foreground aria-selected:text-muted-foreground",d.outside),disabled:ue("text-muted-foreground opacity-50",d.disabled),hidden:ue("invisible",d.hidden),...t},components:{Root:({className:f,rootRef:m,...p})=>s.jsx("div",{"data-slot":"calendar",ref:m,className:ue(f),...p}),Chevron:({className:f,orientation:m,...p})=>m==="left"?s.jsx(UC,{className:ue("size-4",f),...p}):m==="right"?s.jsx(HC,{className:ue("size-4",f),...p}):s.jsx(sh,{className:ue("size-4",f),...p}),DayButton:H_e,WeekNumber:({children:f,...m})=>s.jsx("td",{...m,children:s.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:f})}),...l},...u})}function H_e({className:e,day:t,modifiers:n,...r}){const a=wE(),i=y.useRef(null);return y.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),s.jsx(me,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:ue("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",a.day,e),...r})}class W_e{ws=null;reconnectTimeout=null;reconnectAttempts=0;maxReconnectAttempts=10;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];maxCacheSize=1e3;getWebSocketUrl(){{const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host;return`${t}//${n}/ws/logs`}}connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;const t=this.getWebSocketUrl();try{this.ws=new WebSocket(t),this.ws.onopen=()=>{this.isConnected=!0,this.reconnectAttempts=0,this.notifyConnection(!0),this.startHeartbeat()},this.ws.onmessage=n=>{try{if(n.data==="pong")return;const r=JSON.parse(n.data);this.notifyLog(r)}catch(r){console.error("解析日志消息失败:",r)}},this.ws.onerror=n=>{console.error("❌ WebSocket 错误:",n),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(n){console.error("创建 WebSocket 连接失败:",n),this.attemptReconnect()}}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return;this.reconnectAttempts+=1;const t=Math.min(1e3*this.reconnectAttempts,1e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},t)}startHeartbeat(){this.heartbeatInterval=window.setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send("ping")},3e4)}stopHeartbeat(){this.heartbeatInterval!==null&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}disconnect(){this.reconnectTimeout!==null&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.stopHeartbeat(),this.ws&&(this.ws.close(),this.ws=null),this.isConnected=!1,this.reconnectAttempts=0}onLog(t){return this.logCallbacks.add(t),()=>this.logCallbacks.delete(t)}onConnectionChange(t){return this.connectionCallbacks.add(t),t(this.isConnected),()=>this.connectionCallbacks.delete(t)}notifyLog(t){this.logCache.some(r=>r.id===t.id)||(this.logCache.push(t),this.logCache.length>this.maxCacheSize&&(this.logCache=this.logCache.slice(-this.maxCacheSize)),this.logCallbacks.forEach(r=>{try{r(t)}catch(a){console.error("日志回调执行失败:",a)}}))}notifyConnection(t){this.connectionCallbacks.forEach(n=>{try{n(t)}catch(r){console.error("连接状态回调执行失败:",r)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const Pc=new W_e;typeof window<"u"&&Pc.connect();const V_e={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},G_e=(e,t,n)=>{let r;const a=V_e[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},Y_e={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},K_e={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},X_e={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Z_e={date:Vc({formats:Y_e,defaultWidth:"full"}),time:Vc({formats:K_e,defaultWidth:"full"}),dateTime:Vc({formats:X_e,defaultWidth:"full"})};function C3(e,t,n){const r="eeee p";return lSe(e,t,n)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const Q_e={lastWeek:C3,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:C3,other:"PP p"},J_e=(e,t,n,r)=>{const a=Q_e[e];return typeof a=="function"?a(t,n,r):a},eNe={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},tNe={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},nNe={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},rNe={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},aNe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},iNe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},oNe=(e,t)=>{const n=Number(e);switch(t?.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},sNe={ordinalNumber:oNe,era:ei({values:eNe,defaultWidth:"wide"}),quarter:ei({values:tNe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ei({values:nNe,defaultWidth:"wide"}),day:ei({values:rNe,defaultWidth:"wide"}),dayPeriod:ei({values:aNe,defaultWidth:"wide",formattingValues:iNe,defaultFormattingWidth:"wide"})},lNe=/^(第\s*)?\d+(日|时|分|秒)?/i,cNe=/\d+/i,uNe={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},dNe={any:[/^(前)/i,/^(公元)/i]},fNe={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},hNe={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},mNe={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},pNe={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},vNe={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},gNe={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},yNe={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},xNe={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},bNe={ordinalNumber:pH({matchPattern:lNe,parsePattern:cNe,valueCallback:e=>parseInt(e,10)}),era:ti({matchPatterns:uNe,defaultMatchWidth:"wide",parsePatterns:dNe,defaultParseWidth:"any"}),quarter:ti({matchPatterns:fNe,defaultMatchWidth:"wide",parsePatterns:hNe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ti({matchPatterns:mNe,defaultMatchWidth:"wide",parsePatterns:pNe,defaultParseWidth:"any"}),day:ti({matchPatterns:vNe,defaultMatchWidth:"wide",parsePatterns:gNe,defaultParseWidth:"any"}),dayPeriod:ti({matchPatterns:yNe,defaultMatchWidth:"any",parsePatterns:xNe,defaultParseWidth:"any"})},Bp={code:"zh-CN",formatDistance:G_e,formatLong:Z_e,formatRelative:J_e,localize:sNe,match:bNe,options:{weekStartsOn:1,firstWeekContainsDate:4}};function wNe(){const[e,t]=y.useState([]),[n,r]=y.useState(""),[a,i]=y.useState("all"),[l,u]=y.useState("all"),[d,f]=y.useState(void 0),[m,p]=y.useState(void 0),[g,x]=y.useState(!0),[j,b]=y.useState(!1),w=y.useRef(null),N=y.useRef(null);y.useEffect(()=>{const D=Pc.getAllLogs();t(D);const U=Pc.onLog(()=>{t(Pc.getAllLogs())}),V=Pc.onConnectionChange(H=>{b(H)});return()=>{U(),V()}},[]),y.useEffect(()=>{g&&N.current&&N.current.scrollIntoView({behavior:"smooth",block:"end"})},[e,g]);const O=y.useMemo(()=>{const D=new Set(e.map(U=>U.module));return Array.from(D).sort()},[e]),C=D=>{switch(D){case"DEBUG":return"text-muted-foreground";case"INFO":return"text-blue-500 dark:text-blue-400";case"WARNING":return"text-yellow-600 dark:text-yellow-500";case"ERROR":return"text-red-600 dark:text-red-500";case"CRITICAL":return"text-red-700 dark:text-red-400 font-bold";default:return"text-foreground"}},A=D=>{switch(D){case"DEBUG":return"bg-secondary/50";case"INFO":return"bg-blue-500/10 dark:bg-blue-500/20";case"WARNING":return"bg-yellow-500/10 dark:bg-yellow-500/20";case"ERROR":return"bg-red-500/10 dark:bg-red-500/20";case"CRITICAL":return"bg-red-600/20 dark:bg-red-600/30";default:return"bg-muted/50"}},E=()=>{window.location.reload()},k=()=>{Pc.clearLogs(),t([])},T=()=>{const D=F.map(G=>`${G.timestamp} [${G.level.padEnd(8)}] [${G.module}] ${G.message}`).join(` -`),U=new Blob([D],{type:"text/plain;charset=utf-8"}),V=URL.createObjectURL(U),H=document.createElement("a");H.href=V,H.download=`logs-${rv(new Date,"yyyy-MM-dd-HHmmss")}.txt`,H.click(),URL.revokeObjectURL(V)},P=()=>{x(!g)},$=()=>{f(void 0),p(void 0)},F=y.useMemo(()=>e.filter(D=>{const U=n===""||D.message.toLowerCase().includes(n.toLowerCase())||D.module.toLowerCase().includes(n.toLowerCase()),V=a==="all"||D.level===a,H=l==="all"||D.module===l;let G=!0;if(d||m){const L=new Date(D.timestamp);if(d){const R=new Date(d);R.setHours(0,0,0,0),G=G&&L>=R}if(m){const R=new Date(m);R.setHours(23,59,59,999),G=G&&L<=R}}return U&&V&&H&&G}),[e,n,a,l,d,m]);return s.jsx(Kt,{className:"h-full",children:s.jsxs("div",{className:"space-y-4 p-3 sm:p-4 lg:p-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),s.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:ue("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",j?"bg-green-500 animate-pulse":"bg-red-500")}),s.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:j?"已连接":"未连接"})]})]}),s.jsx(ct,{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[s.jsxs("div",{className:"flex-1 relative",children:[s.jsx(kr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(Oe,{placeholder:"搜索日志...",value:n,onChange:D=>r(D.target.value),className:"pl-9 h-9 text-sm"})]}),s.jsxs(Nt,{value:a,onValueChange:i,children:[s.jsxs(xt,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[s.jsx(UN,{className:"h-4 w-4 mr-2"}),s.jsx(Ot,{placeholder:"级别"})]}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"all",children:"全部级别"}),s.jsx(Pe,{value:"DEBUG",children:"DEBUG"}),s.jsx(Pe,{value:"INFO",children:"INFO"}),s.jsx(Pe,{value:"WARNING",children:"WARNING"}),s.jsx(Pe,{value:"ERROR",children:"ERROR"}),s.jsx(Pe,{value:"CRITICAL",children:"CRITICAL"})]})]}),s.jsxs(Nt,{value:l,onValueChange:u,children:[s.jsxs(xt,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[s.jsx(UN,{className:"h-4 w-4 mr-2"}),s.jsx(Ot,{placeholder:"模块"})]}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"all",children:"全部模块"}),O.map(D=>s.jsx(Pe,{value:D,children:D},D))]})]})]}),s.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[s.jsxs(Zo,{children:[s.jsx(Qo,{asChild:!0,children:s.jsxs(me,{variant:"outline",size:"sm",className:ue("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!d&&"text-muted-foreground"),children:[s.jsx(RL,{className:"mr-2 h-4 w-4"}),s.jsx("span",{className:"text-xs sm:text-sm",children:d?rv(d,"PPP",{locale:Bp}):"开始日期"})]})}),s.jsx(ao,{className:"w-auto p-0",align:"start",children:s.jsx(O3,{mode:"single",selected:d,onSelect:f,initialFocus:!0,locale:Bp})})]}),s.jsxs(Zo,{children:[s.jsx(Qo,{asChild:!0,children:s.jsxs(me,{variant:"outline",size:"sm",className:ue("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!m&&"text-muted-foreground"),children:[s.jsx(RL,{className:"mr-2 h-4 w-4"}),s.jsx("span",{className:"text-xs sm:text-sm",children:m?rv(m,"PPP",{locale:Bp}):"结束日期"})]})}),s.jsx(ao,{className:"w-auto p-0",align:"start",children:s.jsx(O3,{mode:"single",selected:m,onSelect:p,initialFocus:!0,locale:Bp})})]}),(d||m)&&s.jsxs(me,{variant:"outline",size:"sm",onClick:$,className:"w-full sm:w-auto h-9",children:[s.jsx(_y,{className:"h-4 w-4 sm:mr-2"}),s.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),s.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),s.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[s.jsxs("div",{className:"flex gap-2 flex-wrap",children:[s.jsxs(me,{variant:g?"default":"outline",size:"sm",onClick:P,className:"flex-1 sm:flex-none h-9",children:[g?s.jsx($ve,{className:"h-4 w-4"}):s.jsx(Bve,{className:"h-4 w-4"}),s.jsx("span",{className:"ml-2 text-sm",children:g?"自动滚动":"已暂停"})]}),s.jsxs(me,{variant:"outline",size:"sm",onClick:E,className:"flex-1 sm:flex-none h-9",children:[s.jsx(tl,{className:"h-4 w-4"}),s.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),s.jsxs(me,{variant:"outline",size:"sm",onClick:k,className:"flex-1 sm:flex-none h-9",children:[s.jsx(zt,{className:"h-4 w-4"}),s.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),s.jsxs(me,{variant:"outline",size:"sm",onClick:T,className:"flex-1 sm:flex-none h-9",children:[s.jsx(qN,{className:"h-4 w-4"}),s.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),s.jsx("div",{className:"flex-1 hidden sm:block"}),s.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[s.jsxs("span",{className:"font-mono",children:[F.length," / ",e.length]}),s.jsx("span",{className:"ml-1",children:"条日志"})]})]})]})}),s.jsx(ct,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900",children:s.jsx(Kt,{className:"h-[calc(100vh-280px)] sm:h-[calc(100vh-320px)] lg:h-[calc(100vh-400px)]",children:s.jsxs("div",{ref:w,className:"p-2 sm:p-3 lg:p-4 font-mono text-xs sm:text-sm space-y-1",children:[F.length===0?s.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):F.map(D=>s.jsxs("div",{className:ue("py-2 px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",A(D.level)),children:[s.jsxs("div",{className:"flex flex-col gap-1 sm:hidden",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-500 dark:text-gray-600 text-xs",children:D.timestamp}),s.jsxs("span",{className:ue("text-xs font-semibold",C(D.level)),children:["[",D.level,"]"]})]}),s.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 text-xs truncate",children:D.module}),s.jsx("div",{className:"text-gray-300 dark:text-gray-400 text-xs break-all",children:D.message})]}),s.jsxs("div",{className:"hidden sm:flex gap-3 items-start",children:[s.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[140px] lg:w-[180px] text-xs lg:text-sm",children:D.timestamp}),s.jsxs("span",{className:ue("flex-shrink-0 w-[70px] lg:w-[80px] font-semibold text-xs lg:text-sm",C(D.level)),children:["[",D.level,"]"]}),s.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[120px] lg:w-[150px] truncate text-xs lg:text-sm",children:D.module}),s.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 break-all text-xs lg:text-sm",children:D.message})]})]},D.id)),s.jsx("div",{ref:N,className:"h-4"})]})})})]})})}function jNe(){return s.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"统计信息"}),s.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"查看详细的统计数据和分析"})]}),s.jsx("div",{className:"rounded-lg border bg-card p-6",children:s.jsx("p",{className:"text-muted-foreground",children:"功能开发中..."})})]})}const SNe="Mai-with-u",_Ne="plugin-repo",NNe="main",ONe="plugin_details.json";async function CNe(){try{const e=localStorage.getItem("access-token"),t=await fetch("/api/webui/plugins/fetch-raw",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({owner:SNe,repo:_Ne,branch:NNe,file_path:ONe})});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const n=await t.json();if(!n.success||!n.data)throw new Error(n.error||"获取插件列表失败");return JSON.parse(n.data).filter(i=>!i?.id||!i?.manifest?(console.warn("跳过无效插件数据:",i),!1):!i.manifest.name||!i.manifest.version?(console.warn("跳过缺少必需字段的插件:",i.id),!1):!0).map(i=>({id:i.id,manifest:{manifest_version:i.manifest.manifest_version||1,name:i.manifest.name,version:i.manifest.version,description:i.manifest.description||"",author:i.manifest.author||{name:"Unknown"},license:i.manifest.license||"Unknown",host_application:i.manifest.host_application||{min_version:"0.0.0"},homepage_url:i.manifest.homepage_url,repository_url:i.manifest.repository_url,keywords:i.manifest.keywords||[],categories:i.manifest.categories||[],default_locale:i.manifest.default_locale||"zh-CN",locales_path:i.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(e){throw console.error("Failed to fetch plugin list:",e),e}}async function ENe(){try{const e=await fetch("/api/webui/plugins/git-status");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.error("Failed to check Git status:",e),{installed:!1,error:"无法检测 Git 安装状态"}}}async function ANe(){try{const e=await fetch("/api/webui/plugins/version");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.error("Failed to get Maimai version:",e),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function TNe(e,t,n){const r=e.split(".").map(u=>parseInt(u)||0),a=r[0]||0,i=r[1]||0,l=r[2]||0;if(n.version_majorparseInt(p)||0),d=u[0]||0,f=u[1]||0,m=u[2]||0;if(n.version_major>d||n.version_major===d&&n.version_minor>f||n.version_major===d&&n.version_minor===f&&n.version_patch>m)return!1}return!0}function kNe(e,t){const n=window.location.protocol==="https:"?"wss:":"ws:",r=window.location.host,a=new WebSocket(`${n}//${r}/api/webui/ws/plugin-progress`);return a.onopen=()=>{console.log("Plugin progress WebSocket connected");const i=setInterval(()=>{a.readyState===WebSocket.OPEN?a.send("ping"):clearInterval(i)},3e4)},a.onmessage=i=>{try{if(i.data==="pong")return;const l=JSON.parse(i.data);e(l)}catch(l){console.error("Failed to parse progress data:",l)}},a.onerror=i=>{console.error("Plugin progress WebSocket error:",i),t?.(i)},a.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},a}async function zp(){try{const e=localStorage.getItem("access-token"),t=await fetch("/api/webui/plugins/installed",{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const n=await t.json();if(!n.success)throw new Error(n.message||"获取已安装插件列表失败");return n.plugins||[]}catch(e){return console.error("Failed to get installed plugins:",e),[]}}function qp(e,t){return t.some(n=>n.id===e)}function Fp(e,t){const n=t.find(r=>r.id===e);if(n)return n.manifest?.version||n.version}async function PNe(e,t,n="main"){const r=localStorage.getItem("access-token"),a=await fetch("/api/webui/plugins/install",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({plugin_id:e,repository_url:t,branch:n})});if(!a.ok){const i=await a.json();throw new Error(i.detail||"安装失败")}return await a.json()}async function MNe(e){const t=localStorage.getItem("access-token"),n=await fetch("/api/webui/plugins/uninstall",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({plugin_id:e})});if(!n.ok){const r=await n.json();throw new Error(r.detail||"卸载失败")}return await n.json()}async function RNe(e,t,n="main"){const r=localStorage.getItem("access-token"),a=await fetch("/api/webui/plugins/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({plugin_id:e,repository_url:t,branch:n})});if(!a.ok){const i=await a.json();throw new Error(i.detail||"更新失败")}return await a.json()}function DNe(e,t=[]){let n=[];function r(i,l){const u=y.createContext(l);u.displayName=i+"Context";const d=n.length;n=[...n,l];const f=p=>{const{scope:g,children:x,...j}=p,b=g?.[e]?.[d]||u,w=y.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:w,children:x})};f.displayName=i+"Provider";function m(p,g){const x=g?.[e]?.[d]||u,j=y.useContext(x);if(j)return j;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,m]}const a=()=>{const i=n.map(l=>y.createContext(l));return function(u){const d=u?.[e]||i;return y.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return a.scopeName=e,[r,$Ne(a,...t)]}function $Ne(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...u,...p}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var INe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],MH=INe.reduce((e,t)=>{const n=Ny(`Primitive.${t}`),r=y.forwardRef((a,i)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),jE="Progress",SE=100,[LNe]=DNe(jE),[BNe,zNe]=LNe(jE),RH=y.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=qNe,...l}=e;(a||a===0)&&!E3(a)&&console.error(FNe(`${a}`,"Progress"));const u=E3(a)?a:SE;r!==null&&!A3(r,u)&&console.error(UNe(`${r}`,"Progress"));const d=A3(r,u)?r:null,f=Og(d)?i(d,u):void 0;return s.jsx(BNe,{scope:n,value:d,max:u,children:s.jsx(MH.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":Og(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":IH(d,u),"data-value":d??void 0,"data-max":u,...l,ref:t})})});RH.displayName=jE;var DH="ProgressIndicator",$H=y.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=zNe(DH,n);return s.jsx(MH.div,{"data-state":IH(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});$H.displayName=DH;function qNe(e,t){return`${Math.round(e/t*100)}%`}function IH(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Og(e){return typeof e=="number"}function E3(e){return Og(e)&&!isNaN(e)&&e>0}function A3(e,t){return Og(e)&&!isNaN(e)&&e<=t&&e>=0}function FNe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${SE}\`.`}function UNe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: - - a positive number - - less than the value passed to \`max\` (or ${SE} if no \`max\` prop is set) - - \`null\` or \`undefined\` if the progress is indeterminate. - -Defaulting to \`null\`.`}var LH=RH,HNe=$H;const BH=y.forwardRef(({className:e,value:t,...n},r)=>s.jsx(LH,{ref:r,className:ue("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:s.jsx(HNe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));BH.displayName=LH.displayName;function WNe(){const e=qa(),[t,n]=y.useState(null),[r,a]=y.useState(""),[i,l]=y.useState("all"),[u,d]=y.useState("all"),[f,m]=y.useState(!1),[p,g]=y.useState([]),[x,j]=y.useState(!0),[b,w]=y.useState(null),[N,O]=y.useState(null),[C,A]=y.useState(null),[E,k]=y.useState(null),[,T]=y.useState([]),{toast:P}=Dr();y.useEffect(()=>{let R=null,q=!1;return(async()=>{if(R=kNe(ee=>{q||(A(ee),ee.stage==="success"?setTimeout(()=>{q||A(null)},2e3):ee.stage==="error"&&(j(!1),w(ee.error||"加载失败")))},ee=>{console.error("WebSocket error:",ee),q||P({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(ee=>{if(!R){ee();return}const I=()=>{R&&R.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),ee()):R&&R.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),ee()):setTimeout(I,100)};I()}),!q){const ee=await ENe();O(ee),ee.installed||P({title:"Git 未安装",description:ee.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!q){const ee=await ANe();k(ee)}if(!q)try{j(!0),w(null);const ee=await CNe();if(!q){const I=await zp();T(I);const B=ee.map(Y=>{const te=qp(Y.id,I),oe=Fp(Y.id,I);return{...Y,installed:te,installed_version:oe}});for(const Y of I)!B.some(oe=>oe.id===Y.id)&&Y.manifest&&B.push({id:Y.id,manifest:{manifest_version:Y.manifest.manifest_version||1,name:Y.manifest.name,version:Y.manifest.version,description:Y.manifest.description||"",author:Y.manifest.author,license:Y.manifest.license||"Unknown",host_application:Y.manifest.host_application,homepage_url:Y.manifest.homepage_url,repository_url:Y.manifest.repository_url,keywords:Y.manifest.keywords||[],categories:Y.manifest.categories||[],default_locale:Y.manifest.default_locale||"zh-CN",locales_path:Y.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:Y.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});g(B)}}catch(ee){if(!q){const I=ee instanceof Error?ee.message:"加载插件列表失败";w(I),P({title:"加载失败",description:I,variant:"destructive"})}}finally{q||j(!1)}})(),()=>{q=!0,R&&R.close()}},[P]);const $=R=>{if(!R.installed&&E&&!F(R))return s.jsxs(tn,{variant:"destructive",className:"gap-1",children:[s.jsx(hg,{className:"h-3 w-3"}),"不兼容"]});if(R.installed){const q=R.installed_version?.trim(),K=R.manifest.version?.trim();if(q!==K){const ee=q?.split(".").map(Number)||[0,0,0],I=K?.split(".").map(Number)||[0,0,0];for(let B=0;B<3;B++){if((I[B]||0)>(ee[B]||0))return s.jsxs(tn,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[s.jsx(hg,{className:"h-3 w-3"}),"可更新"]});if((I[B]||0)<(ee[B]||0))break}}return s.jsxs(tn,{variant:"default",className:"gap-1",children:[s.jsx(mg,{className:"h-3 w-3"}),"已安装"]})}return null},F=R=>!E||!R.manifest?.host_application?!0:TNe(R.manifest.host_application.min_version,R.manifest.host_application.max_version,E),D=R=>{if(!R.installed||!R.installed_version||!R.manifest?.version)return!1;const q=R.installed_version.trim(),K=R.manifest.version.trim();if(q===K)return!1;const ee=q.split(".").map(Number),I=K.split(".").map(Number);for(let B=0;B<3;B++){if((I[B]||0)>(ee[B]||0))return!0;if((I[B]||0)<(ee[B]||0))return!1}return!1},U=p.filter(R=>{if(!R.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",R.id),!1;const q=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(B=>B.toLowerCase().includes(r.toLowerCase())),K=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i);let ee=!0;u==="installed"?ee=R.installed===!0:u==="updates"&&(ee=R.installed===!0&&D(R));const I=!f||!E||F(R);return q&&K&&ee&&I}),V=()=>{n(null)},H=async R=>{if(!N?.installed){P({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(E&&!F(R)){P({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await PNe(R.id,R.manifest.repository_url||"","main"),P({title:"安装成功",description:`${R.manifest.name} 已成功安装`});const q=await zp();T(q),g(K=>K.map(ee=>{if(ee.id===R.id){const I=qp(ee.id,q),B=Fp(ee.id,q);return{...ee,installed:I,installed_version:B}}return ee}))}catch(q){P({title:"安装失败",description:q instanceof Error?q.message:"未知错误",variant:"destructive"})}},G=async R=>{try{await MNe(R.id),P({title:"卸载成功",description:`${R.manifest.name} 已成功卸载`});const q=await zp();T(q),g(K=>K.map(ee=>{if(ee.id===R.id){const I=qp(ee.id,q),B=Fp(ee.id,q);return{...ee,installed:I,installed_version:B}}return ee}))}catch(q){P({title:"卸载失败",description:q instanceof Error?q.message:"未知错误",variant:"destructive"})}},L=async R=>{if(!N?.installed){P({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const q=await RNe(R.id,R.manifest.repository_url||"","main");P({title:"更新成功",description:`${R.manifest.name} 已从 ${q.old_version} 更新到 ${q.new_version}`});const K=await zp();T(K),g(ee=>ee.map(I=>{if(I.id===R.id){const B=qp(I.id,K),Y=Fp(I.id,K);return{...I,installed:B,installed_version:Y}}return I}))}catch(q){P({title:"更新失败",description:q instanceof Error?q.message:"未知错误",variant:"destructive"})}};return s.jsx(Kt,{className:"h-full",children:s.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),s.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),s.jsxs(me,{onClick:()=>e({to:"/plugin-mirrors"}),children:[s.jsx(Yve,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),N&&!N.installed&&s.jsxs(ct,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[s.jsx(Ut,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Fc,{className:"h-5 w-5 text-orange-600"}),s.jsxs("div",{children:[s.jsx(Ht,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),s.jsx(Xn,{className:"text-orange-800 dark:text-orange-200",children:N.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),s.jsx(un,{children:s.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",s.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),s.jsx(ct,{className:"p-4",children:s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[s.jsxs("div",{className:"flex-1 relative",children:[s.jsx(kr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(Oe,{placeholder:"搜索插件...",value:r,onChange:R=>a(R.target.value),className:"pl-9"})]}),s.jsxs(Nt,{value:i,onValueChange:l,children:[s.jsx(xt,{className:"w-full sm:w-[200px]",children:s.jsx(Ot,{placeholder:"选择分类"})}),s.jsxs(bt,{children:[s.jsx(Pe,{value:"all",children:"全部分类"}),s.jsx(Pe,{value:"Developer Tools",children:"开发工具"}),s.jsx(Pe,{value:"AI Enhancement",children:"AI 增强"}),s.jsx(Pe,{value:"Utility",children:"工具类"}),s.jsx(Pe,{value:"Entertainment",children:"娱乐"}),s.jsx(Pe,{value:"Integration",children:"集成"}),s.jsx(Pe,{value:"Data Analysis",children:"数据分析"}),s.jsx(Pe,{value:"Automation",children:"自动化"}),s.jsx(Pe,{value:"Other",children:"其他"})]})]})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Cu,{id:"compatible-only",checked:f,onCheckedChange:R=>m(R===!0)}),s.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),s.jsx(al,{value:u,onValueChange:d,className:"w-full",children:s.jsxs(Yo,{className:"grid w-full grid-cols-3",children:[s.jsxs(Tt,{value:"all",children:["全部插件 (",p.length,")"]}),s.jsxs(Tt,{value:"installed",children:["已安装 (",p.filter(R=>R.installed).length,")"]}),s.jsxs(Tt,{value:"updates",children:["可更新 (",p.filter(R=>R.installed&&D(R)).length,")"]})]})}),C&&C.stage==="loading"&&s.jsx(ct,{className:"p-4",children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(HN,{className:"h-4 w-4 animate-spin"}),s.jsxs("span",{className:"text-sm font-medium",children:[C.operation==="fetch"&&"加载插件列表",C.operation==="install"&&`安装插件${C.plugin_id?`: ${C.plugin_id}`:""}`,C.operation==="uninstall"&&`卸载插件${C.plugin_id?`: ${C.plugin_id}`:""}`,C.operation==="update"&&`更新插件${C.plugin_id?`: ${C.plugin_id}`:""}`]})]}),s.jsxs("span",{className:"text-sm font-medium",children:[C.progress,"%"]})]}),s.jsx(BH,{value:C.progress,className:"h-2"}),s.jsx("div",{className:"text-xs text-muted-foreground",children:C.message}),C.operation==="fetch"&&C.total_plugins>0&&s.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",C.loaded_plugins," / ",C.total_plugins," 个插件"]})]})}),C&&C.stage==="error"&&C.error&&s.jsx(ct,{className:"border-destructive bg-destructive/10",children:s.jsx(Ut,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Fc,{className:"h-5 w-5 text-destructive"}),s.jsxs("div",{children:[s.jsx(Ht,{className:"text-lg text-destructive",children:"加载失败"}),s.jsx(Xn,{className:"text-destructive/80",children:C.error})]})]})})}),x?s.jsxs("div",{className:"flex items-center justify-center py-12",children:[s.jsx(HN,{className:"h-8 w-8 animate-spin text-muted-foreground"}),s.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):b?s.jsx(ct,{className:"p-6",children:s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[s.jsx(Fc,{className:"h-12 w-12 text-destructive mb-4"}),s.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:b}),s.jsx(me,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):U.length===0?s.jsx(ct,{className:"p-6",children:s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[s.jsx(kr,{className:"h-12 w-12 text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:r||i!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:U.map(R=>s.jsxs(ct,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[s.jsxs(Ut,{children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx(Ht,{className:"text-xl",children:R.manifest?.name||R.id}),s.jsxs("div",{className:"flex flex-col gap-1",children:[R.manifest?.categories&&R.manifest.categories[0]&&s.jsx(tn,{variant:"secondary",className:"text-xs whitespace-nowrap",children:R.manifest.categories[0]}),$(R)]})]}),s.jsx(Xn,{className:"line-clamp-2",children:R.manifest?.description||"无描述"})]}),s.jsx(un,{className:"flex-1",children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(qN,{className:"h-4 w-4"}),s.jsx("span",{children:R.downloads.toLocaleString()})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(IL,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),s.jsx("span",{children:R.rating.toFixed(1)})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[R.manifest?.keywords&&R.manifest.keywords.slice(0,3).map(q=>s.jsx(tn,{variant:"outline",className:"text-xs",children:q},q)),R.manifest?.keywords&&R.manifest.keywords.length>3&&s.jsxs(tn,{variant:"outline",className:"text-xs",children:["+",R.manifest.keywords.length-3]})]}),s.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[s.jsxs("div",{children:["v",R.manifest?.version||"unknown"," · ",R.manifest?.author?.name||"Unknown"]}),R.manifest?.host_application&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{children:"支持:"}),s.jsxs("span",{className:"font-medium",children:[R.manifest.host_application.min_version,R.manifest.host_application.max_version?` - ${R.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),s.jsx(M5,{className:"pt-4",children:s.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[s.jsx(me,{variant:"outline",size:"sm",onClick:()=>n(R),children:"查看详情"}),R.installed?D(R)?s.jsxs(me,{size:"sm",disabled:!N?.installed,title:N?.installed?void 0:"Git 未安装",onClick:()=>L(R),children:[s.jsx(tl,{className:"h-4 w-4 mr-1"}),"更新"]}):s.jsxs(me,{variant:"destructive",size:"sm",disabled:!N?.installed,title:N?.installed?void 0:"Git 未安装",onClick:()=>G(R),children:[s.jsx(zt,{className:"h-4 w-4 mr-1"}),"卸载"]}):s.jsxs(me,{size:"sm",disabled:!N?.installed||C?.operation==="install"||E!==null&&!F(R),title:N?.installed?E!==null&&!F(R)?`不兼容当前版本 (需要 ${R.manifest?.host_application?.min_version||"未知"}${R.manifest?.host_application?.max_version?` - ${R.manifest.host_application.max_version}`:"+"},当前 ${E?.version})`:void 0:"Git 未安装",onClick:()=>H(R),children:[s.jsx(qN,{className:"h-4 w-4 mr-1"}),C?.operation==="install"&&C?.plugin_id===R.id?"安装中...":"安装"]})]})})]},R.id))}),s.jsx(Jn,{open:t!==null,onOpenChange:V,children:t&&t.manifest&&s.jsxs(zn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[s.jsx(qn,{children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"space-y-2 flex-1",children:[s.jsx(Fn,{className:"text-2xl",children:t.manifest.name}),s.jsxs(lr,{children:["作者: ",t.manifest.author?.name||"Unknown",t.manifest.author?.url&&s.jsx("a",{href:t.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:s.jsx(Zp,{className:"h-3 w-3 inline"})})]})]}),s.jsxs("div",{className:"flex flex-col gap-2",children:[t.manifest.categories&&t.manifest.categories[0]&&s.jsx(tn,{variant:"secondary",children:t.manifest.categories[0]}),$(t)]})]})}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"版本"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",t.manifest?.version||"unknown"]}),t.installed&&t.installed_version&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",t.installed_version]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"下载量"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:t.downloads.toLocaleString()})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"评分"}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(IL,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.rating.toFixed(1)," (",t.review_count,")"]})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"许可证"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:t.manifest.license||"Unknown"})]}),s.jsxs("div",{className:"col-span-2",children:[s.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.manifest.host_application?.min_version||"未知",t.manifest.host_application?.max_version?` - ${t.manifest.host_application.max_version}`:" - 最新版本"]})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:t.manifest.keywords&&t.manifest.keywords.map(R=>s.jsx(tn,{variant:"outline",children:R},R))})]}),t.detailed_description&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),s.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:t.detailed_description})]}),!t.detailed_description&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:t.manifest.description||"无描述"})]}),s.jsxs("div",{className:"space-y-2",children:[t.manifest.homepage_url&&s.jsxs("div",{className:"text-sm",children:[s.jsx("span",{className:"font-medium",children:"主页: "}),s.jsx("a",{href:t.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t.manifest.homepage_url})]}),t.manifest.repository_url&&s.jsxs("div",{className:"text-sm",children:[s.jsx("span",{className:"font-medium",children:"仓库: "}),s.jsx("a",{href:t.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t.manifest.repository_url})]})]})]}),s.jsxs(Pr,{children:[t.manifest.homepage_url&&s.jsxs(me,{onClick:()=>window.open(t.manifest.homepage_url,"_blank"),children:[s.jsx(Zp,{className:"h-4 w-4 mr-2"}),"访问主页"]}),t.manifest.repository_url&&s.jsxs(me,{variant:"outline",onClick:()=>window.open(t.manifest.repository_url,"_blank"),children:[s.jsx(Zp,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})]})})}function VNe(){const e=qa(),{toast:t}=Dr(),[n,r]=y.useState([]),[a,i]=y.useState(!0),[l,u]=y.useState(null),[d,f]=y.useState(null),[m,p]=y.useState(!1),[g,x]=y.useState(!1),[j,b]=y.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),w=y.useCallback(async()=>{try{i(!0),u(null);const T=localStorage.getItem("access-token"),P=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${T}`}});if(!P.ok)throw new Error("获取镜像源列表失败");const $=await P.json();r($.mirrors||[])}catch(T){const P=T instanceof Error?T.message:"加载镜像源失败";u(P),t({title:"加载失败",description:P,variant:"destructive"})}finally{i(!1)}},[t]);y.useEffect(()=>{w()},[w]);const N=async()=>{try{const T=localStorage.getItem("access-token"),P=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${T}`,"Content-Type":"application/json"},body:JSON.stringify(j)});if(!P.ok){const $=await P.json();throw new Error($.detail||"添加镜像源失败")}t({title:"添加成功",description:"镜像源已添加"}),p(!1),b({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),w()}catch(T){t({title:"添加失败",description:T instanceof Error?T.message:"未知错误",variant:"destructive"})}},O=async()=>{if(d)try{const T=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${d.id}`,{method:"PUT",headers:{Authorization:`Bearer ${T}`,"Content-Type":"application/json"},body:JSON.stringify({name:j.name,raw_prefix:j.raw_prefix,clone_prefix:j.clone_prefix,enabled:j.enabled,priority:j.priority})})).ok)throw new Error("更新镜像源失败");t({title:"更新成功",description:"镜像源已更新"}),x(!1),f(null),w()}catch(T){t({title:"更新失败",description:T instanceof Error?T.message:"未知错误",variant:"destructive"})}},C=async T=>{if(confirm("确定要删除这个镜像源吗?"))try{const P=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${T}`,{method:"DELETE",headers:{Authorization:`Bearer ${P}`}})).ok)throw new Error("删除镜像源失败");t({title:"删除成功",description:"镜像源已删除"}),w()}catch(P){t({title:"删除失败",description:P instanceof Error?P.message:"未知错误",variant:"destructive"})}},A=async T=>{try{const P=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${T.id}`,{method:"PUT",headers:{Authorization:`Bearer ${P}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!T.enabled})})).ok)throw new Error("更新状态失败");w()}catch(P){t({title:"更新失败",description:P instanceof Error?P.message:"未知错误",variant:"destructive"})}},E=T=>{f(T),b({id:T.id,name:T.name,raw_prefix:T.raw_prefix,clone_prefix:T.clone_prefix,enabled:T.enabled,priority:T.priority}),x(!0)},k=async(T,P)=>{const $=P==="up"?T.priority-1:T.priority+1;if(!($<1))try{const F=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${T.id}`,{method:"PUT",headers:{Authorization:`Bearer ${F}`,"Content-Type":"application/json"},body:JSON.stringify({priority:$})})).ok)throw new Error("更新优先级失败");w()}catch(F){t({title:"更新失败",description:F instanceof Error?F.message:"未知错误",variant:"destructive"})}};return s.jsx(Kt,{className:"h-full",children:s.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(me,{variant:"ghost",size:"icon",onClick:()=>e({to:"/plugins"}),children:s.jsx(Lq,{className:"h-5 w-5"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),s.jsxs(me,{onClick:()=>p(!0),children:[s.jsx(Zn,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),a?s.jsx(ct,{className:"p-6",children:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(HN,{className:"h-8 w-8 animate-spin text-primary"})})}):l?s.jsx(ct,{className:"p-6",children:s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[s.jsx(Fc,{className:"h-12 w-12 text-destructive mb-4"}),s.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:l}),s.jsx(me,{onClick:w,children:"重新加载"})]})}):s.jsxs(ct,{children:[s.jsx("div",{className:"hidden md:block",children:s.jsxs(Sl,{children:[s.jsx(_l,{children:s.jsxs(hn,{children:[s.jsx(Qe,{children:"状态"}),s.jsx(Qe,{children:"名称"}),s.jsx(Qe,{children:"ID"}),s.jsx(Qe,{children:"优先级"}),s.jsx(Qe,{className:"text-right",children:"操作"})]})}),s.jsx(Nl,{children:n.map(T=>s.jsxs(hn,{children:[s.jsx(Ue,{children:s.jsx(ht,{checked:T.enabled,onCheckedChange:()=>A(T)})}),s.jsx(Ue,{children:s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:T.name}),s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",T.raw_prefix]})]})}),s.jsx(Ue,{children:s.jsx(tn,{variant:"outline",children:T.id})}),s.jsx(Ue,{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-mono",children:T.priority}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(me,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>k(T,"up"),disabled:T.priority===1,children:s.jsx(BN,{className:"h-3 w-3"})}),s.jsx(me,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>k(T,"down"),children:s.jsx(sh,{className:"h-3 w-3"})})]})]})}),s.jsx(Ue,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(me,{variant:"ghost",size:"icon",onClick:()=>E(T),children:s.jsx(_u,{className:"h-4 w-4"})}),s.jsx(me,{variant:"ghost",size:"icon",onClick:()=>C(T.id),children:s.jsx(zt,{className:"h-4 w-4 text-destructive"})})]})})]},T.id))})]})}),s.jsx("div",{className:"md:hidden p-4 space-y-4",children:n.map(T=>s.jsx(ct,{className:"p-4",children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h3",{className:"font-semibold",children:T.name}),T.enabled&&s.jsx(tn,{variant:"default",className:"text-xs",children:"启用"})]}),s.jsx(tn,{variant:"outline",className:"mt-1 text-xs",children:T.id})]}),s.jsx(ht,{checked:T.enabled,onCheckedChange:()=>A(T)})]}),s.jsxs("div",{className:"text-sm space-y-1",children:[s.jsxs("div",{className:"text-muted-foreground",children:[s.jsx("span",{className:"font-medium",children:"Raw: "}),s.jsx("span",{className:"break-all",children:T.raw_prefix})]}),s.jsxs("div",{className:"text-muted-foreground",children:[s.jsx("span",{className:"font-medium",children:"优先级: "}),s.jsx("span",{className:"font-mono",children:T.priority})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[s.jsxs(me,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>E(T),children:[s.jsx(_u,{className:"h-4 w-4 mr-1"}),"编辑"]}),s.jsx(me,{variant:"outline",size:"sm",onClick:()=>k(T,"up"),disabled:T.priority===1,children:s.jsx(BN,{className:"h-4 w-4"})}),s.jsx(me,{variant:"outline",size:"sm",onClick:()=>k(T,"down"),children:s.jsx(sh,{className:"h-4 w-4"})}),s.jsx(me,{variant:"destructive",size:"sm",onClick:()=>C(T.id),children:s.jsx(zt,{className:"h-4 w-4"})})]})]})},T.id))})]}),s.jsx(Jn,{open:m,onOpenChange:p,children:s.jsxs(zn,{className:"max-w-lg",children:[s.jsxs(qn,{children:[s.jsx(Fn,{children:"添加镜像源"}),s.jsx(lr,{children:"添加新的 Git 镜像源配置"})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"add-id",children:"镜像源 ID *"}),s.jsx(Oe,{id:"add-id",placeholder:"例如: my-mirror",value:j.id,onChange:T=>b({...j,id:T.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"add-name",children:"名称 *"}),s.jsx(Oe,{id:"add-name",placeholder:"例如: 我的镜像源",value:j.name,onChange:T=>b({...j,name:T.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),s.jsx(Oe,{id:"add-raw",placeholder:"https://example.com/raw",value:j.raw_prefix,onChange:T=>b({...j,raw_prefix:T.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"add-clone",children:"克隆前缀 *"}),s.jsx(Oe,{id:"add-clone",placeholder:"https://example.com/clone",value:j.clone_prefix,onChange:T=>b({...j,clone_prefix:T.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"add-priority",children:"优先级"}),s.jsx(Oe,{id:"add-priority",type:"number",min:"1",value:j.priority,onChange:T=>b({...j,priority:parseInt(T.target.value)||1})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ht,{id:"add-enabled",checked:j.enabled,onCheckedChange:T=>b({...j,enabled:T})}),s.jsx(re,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),s.jsxs(Pr,{children:[s.jsx(me,{variant:"outline",onClick:()=>p(!1),children:"取消"}),s.jsx(me,{onClick:N,children:"添加"})]})]})}),s.jsx(Jn,{open:g,onOpenChange:x,children:s.jsxs(zn,{className:"max-w-lg",children:[s.jsxs(qn,{children:[s.jsx(Fn,{children:"编辑镜像源"}),s.jsx(lr,{children:"修改镜像源配置"})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{children:"镜像源 ID"}),s.jsx(Oe,{value:j.id,disabled:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"edit-name",children:"名称 *"}),s.jsx(Oe,{id:"edit-name",value:j.name,onChange:T=>b({...j,name:T.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),s.jsx(Oe,{id:"edit-raw",value:j.raw_prefix,onChange:T=>b({...j,raw_prefix:T.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"edit-clone",children:"克隆前缀 *"}),s.jsx(Oe,{id:"edit-clone",value:j.clone_prefix,onChange:T=>b({...j,clone_prefix:T.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(re,{htmlFor:"edit-priority",children:"优先级"}),s.jsx(Oe,{id:"edit-priority",type:"number",min:"1",value:j.priority,onChange:T=>b({...j,priority:parseInt(T.target.value)||1})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ht,{id:"edit-enabled",checked:j.enabled,onCheckedChange:T=>b({...j,enabled:T})}),s.jsx(re,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),s.jsxs(Pr,{children:[s.jsx(me,{variant:"outline",onClick:()=>x(!1),children:"取消"}),s.jsx(me,{onClick:O,children:"保存"})]})]})})]})})}const GNe=Rh("pointer-events-none inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono font-medium opacity-100",{variants:{size:{sm:"h-5 text-[10px]",default:"h-6 text-xs",lg:"h-7 text-sm"}},defaultVariants:{size:"default"}}),zH=y.forwardRef(({className:e,size:t,abbrTitle:n,children:r,...a},i)=>s.jsx("kbd",{className:ue(GNe({size:t,className:e})),ref:i,...a,children:n?s.jsx("abbr",{title:n,children:r}):r}));zH.displayName="Kbd";const YNe=[{icon:gg,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:WC,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:Wq,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:Bq,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:Vq,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:Mh,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:qq,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:zq,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:Hq,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:pg,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:Sf,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function KNe({open:e,onOpenChange:t}){const[n,r]=y.useState(""),[a,i]=y.useState(0),l=qa(),u=YNe.filter(m=>m.title.toLowerCase().includes(n.toLowerCase())||m.description.toLowerCase().includes(n.toLowerCase())||m.category.toLowerCase().includes(n.toLowerCase()));y.useEffect(()=>{e&&(r(""),i(0))},[e]);const d=y.useCallback(m=>{l({to:m}),t(!1)},[l,t]),f=y.useCallback(m=>{m.key==="ArrowDown"?(m.preventDefault(),i(p=>(p+1)%u.length)):m.key==="ArrowUp"?(m.preventDefault(),i(p=>(p-1+u.length)%u.length)):m.key==="Enter"&&u[a]&&(m.preventDefault(),d(u[a].path))},[u,a,d]);return s.jsx(Jn,{open:e,onOpenChange:t,children:s.jsxs(zn,{className:"max-w-2xl p-0 gap-0",children:[s.jsxs(qn,{className:"px-4 pt-4 pb-0",children:[s.jsx(Fn,{className:"sr-only",children:"搜索"}),s.jsxs("div",{className:"relative",children:[s.jsx(kr,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),s.jsx(Oe,{value:n,onChange:m=>{r(m.target.value),i(0)},onKeyDown:f,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),s.jsx("div",{className:"border-t",children:s.jsx(Kt,{className:"h-[400px]",children:u.length>0?s.jsx("div",{className:"p-2",children:u.map((m,p)=>{const g=m.icon;return s.jsxs("button",{onClick:()=>d(m.path),onMouseEnter:()=>i(p),className:ue("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",p===a?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[s.jsx(g,{className:"h-5 w-5 flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"font-medium text-sm",children:m.title}),s.jsx("div",{className:"text-xs text-muted-foreground truncate",children:m.description})]}),s.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:m.category})]},m.path)})}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(kr,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:n?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),s.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),s.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}function XNe(e){const t=ZNe(e),n=y.forwardRef((r,a)=>{const{children:i,...l}=r,u=y.Children.toArray(i),d=u.find(JNe);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return s.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function ZNe(e){const t=y.forwardRef((n,r)=>{const{children:a,...i}=n;if(y.isValidElement(a)){const l=tOe(a),u=eOe(i,a.props);return a.type!==y.Fragment&&(u.ref=r?Tr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var QNe=Symbol("radix.slottable");function JNe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===QNe}function eOe(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function tOe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var dO=["Enter"," "],nOe=["ArrowDown","PageUp","Home"],qH=["ArrowUp","PageDown","End"],rOe=[...nOe,...qH],aOe={ltr:[...dO,"ArrowRight"],rtl:[...dO,"ArrowLeft"]},iOe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Gh="Menu",[hh,oOe,sOe]=wh(Gh),[Al,FH]=ur(Gh,[sOe,is,Ig]),Yh=is(),UH=Ig(),[HH,us]=Al(Gh),[lOe,Kh]=Al(Gh),WH=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:l=!0}=e,u=Yh(t),[d,f]=y.useState(null),m=y.useRef(!1),p=Xt(i),g=Mu(a);return y.useEffect(()=>{const x=()=>{m.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>m.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),s.jsx(Lh,{...u,children:s.jsx(HH,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:s.jsx(lOe,{scope:t,onClose:y.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:g,modal:l,children:r})})})};WH.displayName=Gh;var cOe="MenuAnchor",_E=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Yh(n);return s.jsx(Bh,{...a,...r,ref:t})});_E.displayName=cOe;var NE="MenuPortal",[uOe,VH]=Al(NE,{forceMount:void 0}),GH=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=us(NE,t);return s.jsx(uOe,{scope:t,forceMount:n,children:s.jsx(Sn,{present:n||i.open,children:s.jsx(jl,{asChild:!0,container:a,children:r})})})};GH.displayName=NE;var ba="MenuContent",[dOe,OE]=Al(ba),YH=y.forwardRef((e,t)=>{const n=VH(ba,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=us(ba,e.__scopeMenu),l=Kh(ba,e.__scopeMenu);return s.jsx(hh.Provider,{scope:e.__scopeMenu,children:s.jsx(Sn,{present:r||i.open,children:s.jsx(hh.Slot,{scope:e.__scopeMenu,children:l.modal?s.jsx(fOe,{...a,ref:t}):s.jsx(hOe,{...a,ref:t})})})})}),fOe=y.forwardRef((e,t)=>{const n=us(ba,e.__scopeMenu),r=y.useRef(null),a=qe(t,r);return y.useEffect(()=>{const i=r.current;if(i)return ky(i)},[]),s.jsx(CE,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Se(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),hOe=y.forwardRef((e,t)=>{const n=us(ba,e.__scopeMenu);return s.jsx(CE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),mOe=XNe("MenuContent.ScrollLock"),CE=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:x,disableOutsideScroll:j,...b}=e,w=us(ba,n),N=Kh(ba,n),O=Yh(n),C=UH(n),A=oOe(n),[E,k]=y.useState(null),T=y.useRef(null),P=qe(t,T,w.onContentChange),$=y.useRef(0),F=y.useRef(""),D=y.useRef(0),U=y.useRef(null),V=y.useRef("right"),H=y.useRef(0),G=j?$h:y.Fragment,L=j?{as:mOe,allowPinchZoom:!0}:void 0,R=K=>{const ee=F.current+K,I=A().filter(J=>!J.disabled),B=document.activeElement,Y=I.find(J=>J.ref.current===B)?.textValue,te=I.map(J=>J.textValue),oe=OOe(te,ee,Y),xe=I.find(J=>J.textValue===oe)?.ref.current;(function J(ae){F.current=ae,window.clearTimeout($.current),ae!==""&&($.current=window.setTimeout(()=>J(""),1e3))})(ee),xe&&setTimeout(()=>xe.focus())};y.useEffect(()=>()=>window.clearTimeout($.current),[]),Ay();const q=y.useCallback(K=>V.current===U.current?.side&&EOe(K,U.current?.area),[]);return s.jsx(dOe,{scope:n,searchRef:F,onItemEnter:y.useCallback(K=>{q(K)&&K.preventDefault()},[q]),onItemLeave:y.useCallback(K=>{q(K)||(T.current?.focus(),k(null))},[q]),onTriggerLeave:y.useCallback(K=>{q(K)&&K.preventDefault()},[q]),pointerGraceTimerRef:D,onPointerGraceIntentChange:y.useCallback(K=>{U.current=K},[]),children:s.jsx(G,{...L,children:s.jsx(Dh,{asChild:!0,trapped:a,onMountAutoFocus:Se(i,K=>{K.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:s.jsx(wl,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:x,children:s.jsx(B5,{asChild:!0,...C,dir:N.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:k,onEntryFocus:Se(d,K=>{N.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(zy,{role:"menu","aria-orientation":"vertical","data-state":d9(w.open),"data-radix-menu-content":"",dir:N.dir,...O,...b,ref:P,style:{outline:"none",...b.style},onKeyDown:Se(b.onKeyDown,K=>{const I=K.target.closest("[data-radix-menu-content]")===K.currentTarget,B=K.ctrlKey||K.altKey||K.metaKey,Y=K.key.length===1;I&&(K.key==="Tab"&&K.preventDefault(),!B&&Y&&R(K.key));const te=T.current;if(K.target!==te||!rOe.includes(K.key))return;K.preventDefault();const xe=A().filter(J=>!J.disabled).map(J=>J.ref.current);qH.includes(K.key)&&xe.reverse(),_Oe(xe)}),onBlur:Se(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout($.current),F.current="")}),onPointerMove:Se(e.onPointerMove,mh(K=>{const ee=K.target,I=H.current!==K.clientX;if(K.currentTarget.contains(ee)&&I){const B=K.clientX>H.current?"right":"left";V.current=B,H.current=K.clientX}}))})})})})})})});YH.displayName=ba;var pOe="MenuGroup",EE=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Me.div,{role:"group",...r,ref:t})});EE.displayName=pOe;var vOe="MenuLabel",KH=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Me.div,{...r,ref:t})});KH.displayName=vOe;var Cg="MenuItem",T3="menu.itemSelect",Xy=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=y.useRef(null),l=Kh(Cg,e.__scopeMenu),u=OE(Cg,e.__scopeMenu),d=qe(t,i),f=y.useRef(!1),m=()=>{const p=i.current;if(!n&&p){const g=new CustomEvent(T3,{bubbles:!0,cancelable:!0});p.addEventListener(T3,x=>r?.(x),{once:!0}),MO(p,g),g.defaultPrevented?f.current=!1:l.onClose()}};return s.jsx(XH,{...a,ref:d,disabled:n,onClick:Se(e.onClick,m),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Se(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Se(e.onKeyDown,p=>{const g=u.searchRef.current!=="";n||g&&p.key===" "||dO.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Xy.displayName=Cg;var XH=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,l=OE(Cg,n),u=UH(n),d=y.useRef(null),f=qe(t,d),[m,p]=y.useState(!1),[g,x]=y.useState("");return y.useEffect(()=>{const j=d.current;j&&x((j.textContent??"").trim())},[i.children]),s.jsx(hh.ItemSlot,{scope:n,disabled:r,textValue:a??g,children:s.jsx(z5,{asChild:!0,...u,focusable:!r,children:s.jsx(Me.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:f,onPointerMove:Se(e.onPointerMove,mh(j=>{r?l.onItemLeave(j):(l.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(e.onPointerLeave,mh(j=>l.onItemLeave(j))),onFocus:Se(e.onFocus,()=>p(!0)),onBlur:Se(e.onBlur,()=>p(!1))})})})}),gOe="MenuCheckboxItem",ZH=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(n9,{scope:e.__scopeMenu,checked:n,children:s.jsx(Xy,{role:"menuitemcheckbox","aria-checked":Eg(n)?"mixed":n,...a,ref:t,"data-state":kE(n),onSelect:Se(a.onSelect,()=>r?.(Eg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});ZH.displayName=gOe;var QH="MenuRadioGroup",[yOe,xOe]=Al(QH,{value:void 0,onValueChange:()=>{}}),JH=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=Xt(r);return s.jsx(yOe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:s.jsx(EE,{...a,ref:t})})});JH.displayName=QH;var e9="MenuRadioItem",t9=y.forwardRef((e,t)=>{const{value:n,...r}=e,a=xOe(e9,e.__scopeMenu),i=n===a.value;return s.jsx(n9,{scope:e.__scopeMenu,checked:i,children:s.jsx(Xy,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":kE(i),onSelect:Se(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});t9.displayName=e9;var AE="MenuItemIndicator",[n9,bOe]=Al(AE,{checked:!1}),r9=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=bOe(AE,n);return s.jsx(Sn,{present:r||Eg(i.checked)||i.checked===!0,children:s.jsx(Me.span,{...a,ref:t,"data-state":kE(i.checked)})})});r9.displayName=AE;var wOe="MenuSeparator",a9=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Me.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});a9.displayName=wOe;var jOe="MenuArrow",i9=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Yh(n);return s.jsx(qy,{...a,...r,ref:t})});i9.displayName=jOe;var TE="MenuSub",[SOe,o9]=Al(TE),s9=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:a}=e,i=us(TE,t),l=Yh(t),[u,d]=y.useState(null),[f,m]=y.useState(null),p=Xt(a);return y.useEffect(()=>(i.open===!1&&p(!1),()=>p(!1)),[i.open,p]),s.jsx(Lh,{...l,children:s.jsx(HH,{scope:t,open:r,onOpenChange:p,content:f,onContentChange:m,children:s.jsx(SOe,{scope:t,contentId:kn(),triggerId:kn(),trigger:u,onTriggerChange:d,children:n})})})};s9.displayName=TE;var df="MenuSubTrigger",l9=y.forwardRef((e,t)=>{const n=us(df,e.__scopeMenu),r=Kh(df,e.__scopeMenu),a=o9(df,e.__scopeMenu),i=OE(df,e.__scopeMenu),l=y.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=i,f={__scopeMenu:e.__scopeMenu},m=y.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return y.useEffect(()=>m,[m]),y.useEffect(()=>{const p=u.current;return()=>{window.clearTimeout(p),d(null)}},[u,d]),s.jsx(_E,{asChild:!0,...f,children:s.jsx(XH,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":d9(n.open),...e,ref:Tr(t,a.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Se(e.onPointerMove,mh(p=>{i.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Se(e.onPointerLeave,mh(p=>{m();const g=n.content?.getBoundingClientRect();if(g){const x=n.content?.dataset.side,j=x==="right",b=j?-5:5,w=g[j?"left":"right"],N=g[j?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:w,y:g.top},{x:N,y:g.top},{x:N,y:g.bottom},{x:w,y:g.bottom}],side:x}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Se(e.onKeyDown,p=>{const g=i.searchRef.current!=="";e.disabled||g&&p.key===" "||aOe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});l9.displayName=df;var c9="MenuSubContent",u9=y.forwardRef((e,t)=>{const n=VH(ba,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=us(ba,e.__scopeMenu),l=Kh(ba,e.__scopeMenu),u=o9(c9,e.__scopeMenu),d=y.useRef(null),f=qe(t,d);return s.jsx(hh.Provider,{scope:e.__scopeMenu,children:s.jsx(Sn,{present:r||i.open,children:s.jsx(hh.Slot,{scope:e.__scopeMenu,children:s.jsx(CE,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:f,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{l.isUsingKeyboardRef.current&&d.current?.focus(),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Se(e.onFocusOutside,m=>{m.target!==u.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Se(e.onEscapeKeyDown,m=>{l.onClose(),m.preventDefault()}),onKeyDown:Se(e.onKeyDown,m=>{const p=m.currentTarget.contains(m.target),g=iOe[l.dir].includes(m.key);p&&g&&(i.onOpenChange(!1),u.trigger?.focus(),m.preventDefault())})})})})})});u9.displayName=c9;function d9(e){return e?"open":"closed"}function Eg(e){return e==="indeterminate"}function kE(e){return Eg(e)?"indeterminate":e?"checked":"unchecked"}function _Oe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function NOe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function OOe(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=NOe(e,Math.max(i,0));a.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function COe(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,l=t.length-1;ir!=g>r&&n<(p-f)*(r-m)/(g-m)+f&&(a=!a)}return a}function EOe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return COe(n,t)}function mh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var AOe=WH,TOe=_E,kOe=GH,POe=YH,MOe=EE,ROe=KH,DOe=Xy,$Oe=ZH,IOe=JH,LOe=t9,BOe=r9,zOe=a9,qOe=i9,FOe=s9,UOe=l9,HOe=u9,PE="ContextMenu",[WOe]=ur(PE,[FH]),dr=FH(),[VOe,f9]=WOe(PE),h9=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:a,modal:i=!0}=e,[l,u]=y.useState(!1),d=dr(t),f=Xt(r),m=y.useCallback(p=>{u(p),f(p)},[f]);return s.jsx(VOe,{scope:t,open:l,onOpenChange:m,modal:i,children:s.jsx(AOe,{...d,dir:a,open:l,onOpenChange:m,modal:i,children:n})})};h9.displayName=PE;var m9="ContextMenuTrigger",p9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...a}=e,i=f9(m9,n),l=dr(n),u=y.useRef({x:0,y:0}),d=y.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),f=y.useRef(0),m=y.useCallback(()=>window.clearTimeout(f.current),[]),p=g=>{u.current={x:g.clientX,y:g.clientY},i.onOpenChange(!0)};return y.useEffect(()=>m,[m]),y.useEffect(()=>void(r&&m()),[r,m]),s.jsxs(s.Fragment,{children:[s.jsx(TOe,{...l,virtualRef:d}),s.jsx(Me.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...a,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Se(e.onContextMenu,g=>{m(),p(g),g.preventDefault()}),onPointerDown:r?e.onPointerDown:Se(e.onPointerDown,Up(g=>{m(),f.current=window.setTimeout(()=>p(g),700)})),onPointerMove:r?e.onPointerMove:Se(e.onPointerMove,Up(m)),onPointerCancel:r?e.onPointerCancel:Se(e.onPointerCancel,Up(m)),onPointerUp:r?e.onPointerUp:Se(e.onPointerUp,Up(m))})]})});p9.displayName=m9;var GOe="ContextMenuPortal",v9=e=>{const{__scopeContextMenu:t,...n}=e,r=dr(t);return s.jsx(kOe,{...r,...n})};v9.displayName=GOe;var g9="ContextMenuContent",y9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=f9(g9,n),i=dr(n),l=y.useRef(!1);return s.jsx(POe,{...i,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{e.onCloseAutoFocus?.(u),!u.defaultPrevented&&l.current&&u.preventDefault(),l.current=!1},onInteractOutside:u=>{e.onInteractOutside?.(u),!u.defaultPrevented&&!a.modal&&(l.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});y9.displayName=g9;var YOe="ContextMenuGroup",KOe=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=dr(n);return s.jsx(MOe,{...a,...r,ref:t})});KOe.displayName=YOe;var XOe="ContextMenuLabel",x9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=dr(n);return s.jsx(ROe,{...a,...r,ref:t})});x9.displayName=XOe;var ZOe="ContextMenuItem",b9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=dr(n);return s.jsx(DOe,{...a,...r,ref:t})});b9.displayName=ZOe;var QOe="ContextMenuCheckboxItem",w9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=dr(n);return s.jsx($Oe,{...a,...r,ref:t})});w9.displayName=QOe;var JOe="ContextMenuRadioGroup",eCe=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=dr(n);return s.jsx(IOe,{...a,...r,ref:t})});eCe.displayName=JOe;var tCe="ContextMenuRadioItem",j9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=dr(n);return s.jsx(LOe,{...a,...r,ref:t})});j9.displayName=tCe;var nCe="ContextMenuItemIndicator",S9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=dr(n);return s.jsx(BOe,{...a,...r,ref:t})});S9.displayName=nCe;var rCe="ContextMenuSeparator",_9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=dr(n);return s.jsx(zOe,{...a,...r,ref:t})});_9.displayName=rCe;var aCe="ContextMenuArrow",iCe=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=dr(n);return s.jsx(qOe,{...a,...r,ref:t})});iCe.displayName=aCe;var N9="ContextMenuSub",O9=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:a,defaultOpen:i}=e,l=dr(t),[u,d]=wa({prop:a,defaultProp:i??!1,onChange:r,caller:N9});return s.jsx(FOe,{...l,open:u,onOpenChange:d,children:n})};O9.displayName=N9;var oCe="ContextMenuSubTrigger",C9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=dr(n);return s.jsx(UOe,{...a,...r,ref:t})});C9.displayName=oCe;var sCe="ContextMenuSubContent",E9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=dr(n);return s.jsx(HOe,{...a,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});E9.displayName=sCe;function Up(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var lCe=h9,cCe=p9,uCe=v9,A9=y9,T9=x9,k9=b9,P9=w9,M9=j9,R9=S9,D9=_9,dCe=O9,$9=C9,I9=E9;const fCe=lCe,hCe=cCe,mCe=dCe,L9=y.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs($9,{ref:a,className:ue("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...r,children:[n,s.jsx(HC,{className:"ml-auto h-4 w-4"})]}));L9.displayName=$9.displayName;const B9=y.forwardRef(({className:e,...t},n)=>s.jsx(I9,{ref:n,className:ue("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",e),...t}));B9.displayName=I9.displayName;const z9=y.forwardRef(({className:e,...t},n)=>s.jsx(uCe,{children:s.jsx(A9,{ref:n,className:ue("z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",e),...t})}));z9.displayName=A9.displayName;const Ta=y.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(k9,{ref:r,className:ue("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Ta.displayName=k9.displayName;const pCe=y.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs(P9,{ref:a,className:ue("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(R9,{children:s.jsx(Js,{className:"h-4 w-4"})})}),t]}));pCe.displayName=P9.displayName;const vCe=y.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(M9,{ref:r,className:ue("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(R9,{children:s.jsx(ave,{className:"h-2 w-2 fill-current"})})}),t]}));vCe.displayName=M9.displayName;const gCe=y.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(T9,{ref:r,className:ue("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));gCe.displayName=T9.displayName;const ff=y.forwardRef(({className:e,...t},n)=>s.jsx(D9,{ref:n,className:ue("-mx-1 my-1 h-px bg-border",e),...t}));ff.displayName=D9.displayName;const Mc=({className:e,...t})=>s.jsx("span",{className:ue("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Mc.displayName="ContextMenuShortcut";var yCe=Symbol("radix.slottable");function xCe(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=yCe,t}var[Zy]=ur("Tooltip",[is]),Qy=is(),q9="TooltipProvider",bCe=700,fO="tooltip.open",[wCe,ME]=Zy(q9),F9=e=>{const{__scopeTooltip:t,delayDuration:n=bCe,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,l=y.useRef(!0),u=y.useRef(!1),d=y.useRef(0);return y.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),s.jsx(wCe,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:y.useCallback(f=>{u.current=f},[]),disableHoverableContent:a,children:i})};F9.displayName=q9;var ph="Tooltip",[jCe,Xh]=Zy(ph),U9=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=e,d=ME(ph,e.__scopeTooltip),f=Qy(t),[m,p]=y.useState(null),g=kn(),x=y.useRef(0),j=l??d.disableHoverableContent,b=u??d.delayDuration,w=y.useRef(!1),[N,O]=wa({prop:r,defaultProp:a??!1,onChange:T=>{T?(d.onOpen(),document.dispatchEvent(new CustomEvent(fO))):d.onClose(),i?.(T)},caller:ph}),C=y.useMemo(()=>N?w.current?"delayed-open":"instant-open":"closed",[N]),A=y.useCallback(()=>{window.clearTimeout(x.current),x.current=0,w.current=!1,O(!0)},[O]),E=y.useCallback(()=>{window.clearTimeout(x.current),x.current=0,O(!1)},[O]),k=y.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{w.current=!0,O(!0),x.current=0},b)},[b,O]);return y.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),s.jsx(Lh,{...f,children:s.jsx(jCe,{scope:t,contentId:g,open:N,stateAttribute:C,trigger:m,onTriggerChange:p,onTriggerEnter:y.useCallback(()=>{d.isOpenDelayedRef.current?k():A()},[d.isOpenDelayedRef,k,A]),onTriggerLeave:y.useCallback(()=>{j?E():(window.clearTimeout(x.current),x.current=0)},[E,j]),onOpen:A,onClose:E,disableHoverableContent:j,children:n})})};U9.displayName=ph;var hO="TooltipTrigger",H9=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Xh(hO,n),i=ME(hO,n),l=Qy(n),u=y.useRef(null),d=qe(t,u,a.onTriggerChange),f=y.useRef(!1),m=y.useRef(!1),p=y.useCallback(()=>f.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),s.jsx(Bh,{asChild:!0,...l,children:s.jsx(Me.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:Se(e.onPointerMove,g=>{g.pointerType!=="touch"&&!m.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),m.current=!0)}),onPointerLeave:Se(e.onPointerLeave,()=>{a.onTriggerLeave(),m.current=!1}),onPointerDown:Se(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Se(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:Se(e.onBlur,a.onClose),onClick:Se(e.onClick,a.onClose)})})});H9.displayName=hO;var RE="TooltipPortal",[SCe,_Ce]=Zy(RE,{forceMount:void 0}),W9=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,i=Xh(RE,t);return s.jsx(SCe,{scope:t,forceMount:n,children:s.jsx(Sn,{present:n||i.open,children:s.jsx(jl,{asChild:!0,container:a,children:r})})})};W9.displayName=RE;var Eu="TooltipContent",V9=y.forwardRef((e,t)=>{const n=_Ce(Eu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,l=Xh(Eu,e.__scopeTooltip);return s.jsx(Sn,{present:r||l.open,children:l.disableHoverableContent?s.jsx(G9,{side:a,...i,ref:t}):s.jsx(NCe,{side:a,...i,ref:t})})}),NCe=y.forwardRef((e,t)=>{const n=Xh(Eu,e.__scopeTooltip),r=ME(Eu,e.__scopeTooltip),a=y.useRef(null),i=qe(t,a),[l,u]=y.useState(null),{trigger:d,onClose:f}=n,m=a.current,{onPointerInTransitChange:p}=r,g=y.useCallback(()=>{u(null),p(!1)},[p]),x=y.useCallback((j,b)=>{const w=j.currentTarget,N={x:j.clientX,y:j.clientY},O=TCe(N,w.getBoundingClientRect()),C=kCe(N,O),A=PCe(b.getBoundingClientRect()),E=RCe([...C,...A]);u(E),p(!0)},[p]);return y.useEffect(()=>()=>g(),[g]),y.useEffect(()=>{if(d&&m){const j=w=>x(w,m),b=w=>x(w,d);return d.addEventListener("pointerleave",j),m.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",j),m.removeEventListener("pointerleave",b)}}},[d,m,x,g]),y.useEffect(()=>{if(l){const j=b=>{const w=b.target,N={x:b.clientX,y:b.clientY},O=d?.contains(w)||m?.contains(w),C=!MCe(N,l);O?g():C&&(g(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,m,l,f,g]),s.jsx(G9,{...e,ref:i})}),[OCe,CCe]=Zy(ph,{isInside:!1}),ECe=xCe("TooltipContent"),G9=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...u}=e,d=Xh(Eu,n),f=Qy(n),{onClose:m}=d;return y.useEffect(()=>(document.addEventListener(fO,m),()=>document.removeEventListener(fO,m)),[m]),y.useEffect(()=>{if(d.trigger){const p=g=>{g.target?.contains(d.trigger)&&m()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,m]),s.jsx(wl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:p=>p.preventDefault(),onDismiss:m,children:s.jsxs(zy,{"data-state":d.stateAttribute,...f,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(ECe,{children:r}),s.jsx(OCe,{scope:n,isInside:!0,children:s.jsx(b0e,{id:d.contentId,role:"tooltip",children:a||r})})]})})});V9.displayName=Eu;var Y9="TooltipArrow",ACe=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Qy(n);return CCe(Y9,n).isInside?null:s.jsx(qy,{...a,...r,ref:t})});ACe.displayName=Y9;function TCe(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function kCe(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function PCe(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function MCe(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,l=t.length-1;ir!=g>r&&n<(p-f)*(r-m)/(g-m)+f&&(a=!a)}return a}function RCe(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),DCe(t)}function DCe(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var $Ce=F9,ICe=U9,LCe=H9,BCe=W9,K9=V9;const zCe=$Ce,qCe=ICe,FCe=LCe,X9=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(BCe,{children:s.jsx(K9,{ref:r,sideOffset:t,className:ue("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n})}));X9.displayName=K9.displayName;function UCe({children:e}){Axe();const[t,n]=y.useState(!0),[r,a]=y.useState(!1),[i,l]=y.useState(!1),{theme:u,setTheme:d}=YC(),f=AY(),m=qa();y.useEffect(()=>{const b=w=>{(w.metaKey||w.ctrlKey)&&w.key==="k"&&(w.preventDefault(),l(!0))};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[]);const p=[{title:"概览",items:[{icon:gg,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:WC,label:"麦麦主程序配置",path:"/config/bot"},{icon:Wq,label:"麦麦模型提供商配置",path:"/config/modelProvider"},{icon:Bq,label:"麦麦模型配置",path:"/config/model"}]},{title:"麦麦资源管理",items:[{icon:Vq,label:"表情包管理",path:"/resource/emoji"},{icon:Mh,label:"表达方式管理",path:"/resource/expression"},{icon:qq,label:"人物信息管理",path:"/resource/person"}]},{title:"扩展与监控",items:[{icon:zq,label:"统计信息",path:"/statistics"},{icon:Hq,label:"插件市场",path:"/plugins"},{icon:pg,label:"日志查看器",path:"/logs"}]},{title:"系统",items:[{icon:Sf,label:"系统设置",path:"/settings"}]}],x=u==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":u,j=()=>{localStorage.removeItem("access-token"),m({to:"/auth"})};return s.jsx(zCe,{delayDuration:300,children:s.jsxs("div",{className:"flex h-screen overflow-hidden",children:[s.jsxs("aside",{className:ue("fixed inset-y-0 left-0 z-50 flex flex-col border-r bg-card transition-all duration-300 lg:relative lg:z-0","w-64 lg:w-auto",t?"lg:w-64":"lg:w-16",r?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[s.jsx("div",{className:"flex h-16 items-center border-b px-4",children:s.jsxs("div",{className:ue("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!t&&"lg:flex-none lg:w-8"),children:[s.jsxs("div",{className:ue("flex items-baseline gap-2",!t&&"lg:hidden"),children:[s.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),s.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:Fge()})]}),!t&&s.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),s.jsx("nav",{className:"flex-1 overflow-y-auto p-4",children:s.jsx("ul",{className:ue("space-y-6",!t&&"lg:space-y-3"),children:p.map((b,w)=>s.jsxs("li",{children:[s.jsx("div",{className:ue("px-3 h-[1.25rem]","mb-2",!t&&"lg:mb-1 lg:invisible"),children:s.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:b.title})}),!t&&w>0&&s.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),s.jsx("ul",{className:"space-y-1",children:b.items.map(N=>{const O=f({to:N.path}),C=N.icon,A=s.jsxs(s.Fragment,{children:[O&&s.jsx("div",{className:"absolute left-0 top-1/2 h-8 w-1 -translate-y-1/2 rounded-r-full bg-primary transition-opacity duration-300"}),s.jsxs("div",{className:ue("flex items-center transition-all duration-300",t?"gap-3":"lg:gap-0"),children:[s.jsx(C,{className:ue("h-5 w-5 flex-shrink-0",O&&"text-primary"),strokeWidth:2,fill:"none"}),s.jsx("span",{className:ue("text-sm font-medium whitespace-nowrap transition-all duration-300",O&&"font-semibold",t?"opacity-100 max-w-[200px]":"lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:N.label})]})]});return s.jsx("li",{className:"relative",children:s.jsxs(qCe,{children:[s.jsx(FCe,{asChild:!0,children:s.jsx(OO,{to:N.path,className:ue("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",O?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",t?"px-3":"lg:px-0 lg:justify-center"),onClick:()=>a(!1),children:A})}),!t&&s.jsx(X9,{side:"right",className:"hidden lg:block",children:s.jsx("p",{children:N.label})})]})},N.path)})})]},b.title))})})]}),r&&s.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>a(!1)}),s.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[s.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-card/80 backdrop-blur-md px-4 sticky top-0 z-10",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("button",{onClick:()=>a(!r),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:s.jsx(Ave,{className:"h-5 w-5"})}),s.jsx("button",{onClick:()=>n(!t),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:t?"收起侧边栏":"展开侧边栏",children:s.jsx(UC,{className:ue("h-5 w-5 transition-transform",!t&&"rotate-180")})})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("button",{onClick:()=>l(!0),className:"relative hidden md:flex items-center w-64 h-9 pl-9 pr-16 bg-background/50 border rounded-md hover:bg-accent/50 transition-colors text-left",children:[s.jsx(kr,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),s.jsxs(zH,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[s.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),s.jsx(KNe,{open:i,onOpenChange:l}),s.jsxs(me,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[s.jsx(zpe,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),s.jsx("button",{onClick:b=>{_ge(x==="dark"?"light":"dark",d,b)},className:"rounded-lg p-2 hover:bg-accent",title:x==="dark"?"切换到浅色模式":"切换到深色模式",children:x==="dark"?s.jsx(VN,{className:"h-5 w-5"}):s.jsx(WN,{className:"h-5 w-5"})}),s.jsx("div",{className:"h-6 w-px bg-border"}),s.jsxs(me,{variant:"ghost",size:"sm",onClick:j,className:"gap-2",title:"登出系统",children:[s.jsx($L,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),s.jsxs(fCe,{children:[s.jsx(hCe,{asChild:!0,children:s.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:e})}),s.jsxs(z9,{className:"w-64",children:[s.jsxs(Ta,{onClick:()=>m({to:"/"}),children:[s.jsx(gg,{className:"mr-2 h-4 w-4"}),"首页"]}),s.jsxs(Ta,{onClick:()=>m({to:"/settings"}),children:[s.jsx(Sf,{className:"mr-2 h-4 w-4"}),"系统设置"]}),s.jsxs(Ta,{onClick:()=>m({to:"/logs"}),children:[s.jsx(pg,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),s.jsx(ff,{}),s.jsxs(mCe,{children:[s.jsxs(L9,{children:[s.jsx(Rve,{className:"mr-2 h-4 w-4"}),"切换主题"]}),s.jsxs(B9,{className:"w-48",children:[s.jsxs(Ta,{onClick:()=>d("light"),disabled:u==="light",children:[s.jsx(VN,{className:"mr-2 h-4 w-4"}),"浅色",u==="light"&&s.jsx(Mc,{children:"✓"})]}),s.jsxs(Ta,{onClick:()=>d("dark"),disabled:u==="dark",children:[s.jsx(WN,{className:"mr-2 h-4 w-4"}),"深色",u==="dark"&&s.jsx(Mc,{children:"✓"})]}),s.jsxs(Ta,{onClick:()=>d("system"),disabled:u==="system",children:[s.jsx(Sf,{className:"mr-2 h-4 w-4"}),"跟随系统",u==="system"&&s.jsx(Mc,{children:"✓"})]})]})]}),s.jsx(ff,{}),s.jsxs(Ta,{onClick:()=>window.location.reload(),children:[s.jsx(Uve,{className:"mr-2 h-4 w-4"}),"刷新页面",s.jsx(Mc,{children:"⌘R"})]}),s.jsxs(Ta,{onClick:()=>l(!0),children:[s.jsx(kr,{className:"mr-2 h-4 w-4"}),"搜索",s.jsx(Mc,{children:"⌘K"})]}),s.jsx(ff,{}),s.jsxs(Ta,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[s.jsx(Zp,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),s.jsx(ff,{}),s.jsxs(Ta,{onClick:j,className:"text-destructive focus:text-destructive",children:[s.jsx($L,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}const Jy=bY({component:()=>s.jsxs(s.Fragment,{children:[s.jsx(CO,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!a8())throw $3({to:"/auth"})}}),HCe=cr({getParentRoute:()=>Jy,path:"/auth",component:Txe}),na=cr({getParentRoute:()=>Jy,id:"protected",component:()=>s.jsx(UCe,{children:s.jsx(CO,{})})}),WCe=cr({getParentRoute:()=>na,path:"/",component:jge}),VCe=cr({getParentRoute:()=>na,path:"/config/bot",component:xwe}),GCe=cr({getParentRoute:()=>na,path:"/config/modelProvider",component:Bwe}),YCe=cr({getParentRoute:()=>na,path:"/config/model",component:m1e}),KCe=cr({getParentRoute:()=>na,path:"/resource/emoji",component:j1e}),XCe=cr({getParentRoute:()=>na,path:"/resource/expression",component:k1e}),ZCe=cr({getParentRoute:()=>na,path:"/resource/person",component:z1e}),QCe=cr({getParentRoute:()=>na,path:"/logs",component:wNe}),JCe=cr({getParentRoute:()=>na,path:"/statistics",component:jNe}),eEe=cr({getParentRoute:()=>na,path:"/plugins",component:WNe}),tEe=cr({getParentRoute:()=>na,path:"/plugin-mirrors",component:VNe}),nEe=cr({getParentRoute:()=>na,path:"/settings",component:Sxe}),rEe=cr({getParentRoute:()=>Jy,path:"*",component:i8}),aEe=Jy.addChildren([HCe,na.addChildren([WCe,VCe,GCe,YCe,KCe,XCe,ZCe,JCe,eEe,tEe,QCe,nEe]),rEe]),iEe=TY({routeTree:aEe,defaultNotFoundComponent:i8});function oEe({children:e,defaultTheme:t="system",storageKey:n="ui-theme",...r}){const[a,i]=y.useState(()=>localStorage.getItem(n)||t);y.useEffect(()=>{const u=window.document.documentElement;if(u.classList.remove("light","dark"),a==="system"){const d=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";u.classList.add(d);return}u.classList.add(a)},[a]),y.useEffect(()=>{const u=localStorage.getItem("accent-color");if(u){const d=document.documentElement,m={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%"},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%"},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%"},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%"},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%"}}[u];m&&d.style.setProperty("--primary",m.hsl)}},[]);const l={theme:a,setTheme:u=>{localStorage.setItem(n,u),i(u)}};return s.jsx(Yq.Provider,{...r,value:l,children:e})}function sEe({children:e,defaultEnabled:t=!0,defaultWavesEnabled:n=!0,storageKey:r="enable-animations",wavesStorageKey:a="enable-waves-background"}){const[i,l]=y.useState(()=>{const m=localStorage.getItem(r);return m!==null?m==="true":t}),[u,d]=y.useState(()=>{const m=localStorage.getItem(a);return m!==null?m==="true":n});y.useEffect(()=>{const m=document.documentElement;i?m.classList.remove("no-animations"):m.classList.add("no-animations"),localStorage.setItem(r,String(i))},[i,r]),y.useEffect(()=>{localStorage.setItem(a,String(u))},[u,a]);const f={enableAnimations:i,setEnableAnimations:l,enableWavesBackground:u,setEnableWavesBackground:d};return s.jsx(Kq.Provider,{value:f,children:e})}var DE="ToastProvider",[$E,lEe,cEe]=wh("Toast"),[Z9]=ur("Toast",[cEe]),[uEe,ex]=Z9(DE),Q9=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:l}=e,[u,d]=y.useState(null),[f,m]=y.useState(0),p=y.useRef(!1),g=y.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${DE}\`. Expected non-empty \`string\`.`),s.jsx($E.Provider,{scope:t,children:s.jsx(uEe,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:i,toastCount:f,viewport:u,onViewportChange:d,onToastAdd:y.useCallback(()=>m(x=>x+1),[]),onToastRemove:y.useCallback(()=>m(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:g,children:l})})};Q9.displayName=DE;var J9="ToastViewport",dEe=["F8"],mO="toast.viewportPause",pO="toast.viewportResume",eW=y.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=dEe,label:a="Notifications ({hotkey})",...i}=e,l=ex(J9,n),u=lEe(n),d=y.useRef(null),f=y.useRef(null),m=y.useRef(null),p=y.useRef(null),g=qe(t,p,l.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=l.toastCount>0;y.useEffect(()=>{const w=N=>{r.length!==0&&r.every(C=>N[C]||N.code===C)&&p.current?.focus()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[r]),y.useEffect(()=>{const w=d.current,N=p.current;if(j&&w&&N){const O=()=>{if(!l.isClosePausedRef.current){const k=new CustomEvent(mO);N.dispatchEvent(k),l.isClosePausedRef.current=!0}},C=()=>{if(l.isClosePausedRef.current){const k=new CustomEvent(pO);N.dispatchEvent(k),l.isClosePausedRef.current=!1}},A=k=>{!w.contains(k.relatedTarget)&&C()},E=()=>{w.contains(document.activeElement)||C()};return w.addEventListener("focusin",O),w.addEventListener("focusout",A),w.addEventListener("pointermove",O),w.addEventListener("pointerleave",E),window.addEventListener("blur",O),window.addEventListener("focus",C),()=>{w.removeEventListener("focusin",O),w.removeEventListener("focusout",A),w.removeEventListener("pointermove",O),w.removeEventListener("pointerleave",E),window.removeEventListener("blur",O),window.removeEventListener("focus",C)}}},[j,l.isClosePausedRef]);const b=y.useCallback(({tabbingDirection:w})=>{const O=u().map(C=>{const A=C.ref.current,E=[A,..._Ee(A)];return w==="forwards"?E:E.reverse()});return(w==="forwards"?O.reverse():O).flat()},[u]);return y.useEffect(()=>{const w=p.current;if(w){const N=O=>{const C=O.altKey||O.ctrlKey||O.metaKey;if(O.key==="Tab"&&!C){const E=document.activeElement,k=O.shiftKey;if(O.target===w&&k){f.current?.focus();return}const $=b({tabbingDirection:k?"backwards":"forwards"}),F=$.findIndex(D=>D===E);i_($.slice(F+1))?O.preventDefault():k?f.current?.focus():m.current?.focus()}};return w.addEventListener("keydown",N),()=>w.removeEventListener("keydown",N)}},[u,b]),s.jsxs(Zge,{ref:d,role:"region","aria-label":a.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&s.jsx(vO,{ref:f,onFocusFromOutsideViewport:()=>{const w=b({tabbingDirection:"forwards"});i_(w)}}),s.jsx($E.Slot,{scope:n,children:s.jsx(Me.ol,{tabIndex:-1,...i,ref:g})}),j&&s.jsx(vO,{ref:m,onFocusFromOutsideViewport:()=>{const w=b({tabbingDirection:"backwards"});i_(w)}})]})});eW.displayName=J9;var tW="ToastFocusProxy",vO=y.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=ex(tW,n);return s.jsx(Fy,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:l=>{const u=l.relatedTarget;!i.viewport?.contains(u)&&r()}})});vO.displayName=tW;var Zh="Toast",fEe="toast.swipeStart",hEe="toast.swipeMove",mEe="toast.swipeCancel",pEe="toast.swipeEnd",nW=y.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...l}=e,[u,d]=wa({prop:r,defaultProp:a??!0,onChange:i,caller:Zh});return s.jsx(Sn,{present:n||u,children:s.jsx(yEe,{open:u,...l,ref:t,onClose:()=>d(!1),onPause:Xt(e.onPause),onResume:Xt(e.onResume),onSwipeStart:Se(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Se(e.onSwipeMove,f=>{const{x:m,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:Se(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Se(e.onSwipeEnd,f=>{const{x:m,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),d(!1)})})})});nW.displayName=Zh;var[vEe,gEe]=Z9(Zh,{onClose(){}}),yEe=y.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:i,onClose:l,onEscapeKeyDown:u,onPause:d,onResume:f,onSwipeStart:m,onSwipeMove:p,onSwipeCancel:g,onSwipeEnd:x,...j}=e,b=ex(Zh,n),[w,N]=y.useState(null),O=qe(t,H=>N(H)),C=y.useRef(null),A=y.useRef(null),E=a||b.duration,k=y.useRef(0),T=y.useRef(E),P=y.useRef(0),{onToastAdd:$,onToastRemove:F}=b,D=Xt(()=>{w?.contains(document.activeElement)&&b.viewport?.focus(),l()}),U=y.useCallback(H=>{!H||H===1/0||(window.clearTimeout(P.current),k.current=new Date().getTime(),P.current=window.setTimeout(D,H))},[D]);y.useEffect(()=>{const H=b.viewport;if(H){const G=()=>{U(T.current),f?.()},L=()=>{const R=new Date().getTime()-k.current;T.current=T.current-R,window.clearTimeout(P.current),d?.()};return H.addEventListener(mO,L),H.addEventListener(pO,G),()=>{H.removeEventListener(mO,L),H.removeEventListener(pO,G)}}},[b.viewport,E,d,f,U]),y.useEffect(()=>{i&&!b.isClosePausedRef.current&&U(E)},[i,E,b.isClosePausedRef,U]),y.useEffect(()=>($(),()=>F()),[$,F]);const V=y.useMemo(()=>w?cW(w):null,[w]);return b.viewport?s.jsxs(s.Fragment,{children:[V&&s.jsx(xEe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:V}),s.jsx(vEe,{scope:n,onClose:D,children:pl.createPortal(s.jsx($E.ItemSlot,{scope:n,children:s.jsx(Xge,{asChild:!0,onEscapeKeyDown:Se(u,()=>{b.isFocusedToastEscapeKeyDownRef.current||D(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(Me.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":b.swipeDirection,...j,ref:O,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Se(e.onKeyDown,H=>{H.key==="Escape"&&(u?.(H.nativeEvent),H.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:Se(e.onPointerDown,H=>{H.button===0&&(C.current={x:H.clientX,y:H.clientY})}),onPointerMove:Se(e.onPointerMove,H=>{if(!C.current)return;const G=H.clientX-C.current.x,L=H.clientY-C.current.y,R=!!A.current,q=["left","right"].includes(b.swipeDirection),K=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,ee=q?K(0,G):0,I=q?0:K(0,L),B=H.pointerType==="touch"?10:2,Y={x:ee,y:I},te={originalEvent:H,delta:Y};R?(A.current=Y,Hp(hEe,p,te,{discrete:!1})):k3(Y,b.swipeDirection,B)?(A.current=Y,Hp(fEe,m,te,{discrete:!1}),H.target.setPointerCapture(H.pointerId)):(Math.abs(G)>B||Math.abs(L)>B)&&(C.current=null)}),onPointerUp:Se(e.onPointerUp,H=>{const G=A.current,L=H.target;if(L.hasPointerCapture(H.pointerId)&&L.releasePointerCapture(H.pointerId),A.current=null,C.current=null,G){const R=H.currentTarget,q={originalEvent:H,delta:G};k3(G,b.swipeDirection,b.swipeThreshold)?Hp(pEe,x,q,{discrete:!0}):Hp(mEe,g,q,{discrete:!0}),R.addEventListener("click",K=>K.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),xEe=e=>{const{__scopeToast:t,children:n,...r}=e,a=ex(Zh,t),[i,l]=y.useState(!1),[u,d]=y.useState(!1);return jEe(()=>l(!0)),y.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),u?null:s.jsx(jl,{asChild:!0,children:s.jsx(Fy,{...r,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},bEe="ToastTitle",rW=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Me.div,{...r,ref:t})});rW.displayName=bEe;var wEe="ToastDescription",aW=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Me.div,{...r,ref:t})});aW.displayName=wEe;var iW="ToastAction",oW=y.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(lW,{altText:n,asChild:!0,children:s.jsx(IE,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${iW}\`. Expected non-empty \`string\`.`),null)});oW.displayName=iW;var sW="ToastClose",IE=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=gEe(sW,n);return s.jsx(lW,{asChild:!0,children:s.jsx(Me.button,{type:"button",...r,ref:t,onClick:Se(e.onClick,a.onClose)})})});IE.displayName=sW;var lW=y.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(Me.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function cW(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),SEe(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const l=r.dataset.radixToastAnnounceAlt;l&&t.push(l)}else t.push(...cW(r))}}),t}function Hp(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?MO(a,i):a.dispatchEvent(i)}var k3=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),i=r>a;return t==="left"||t==="right"?i&&r>n:!i&&a>n};function jEe(e=()=>{}){const t=Xt(e);Bn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function SEe(e){return e.nodeType===e.ELEMENT_NODE}function _Ee(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function i_(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var NEe=Q9,uW=eW,dW=nW,fW=rW,hW=aW,mW=oW,pW=IE;const OEe=NEe,vW=y.forwardRef(({className:e,...t},n)=>s.jsx(uW,{ref:n,className:ue("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));vW.displayName=uW.displayName;const CEe=Rh("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),gW=y.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(dW,{ref:r,className:ue(CEe({variant:t}),e),...n}));gW.displayName=dW.displayName;const EEe=y.forwardRef(({className:e,...t},n)=>s.jsx(mW,{ref:n,className:ue("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));EEe.displayName=mW.displayName;const yW=y.forwardRef(({className:e,...t},n)=>s.jsx(pW,{ref:n,className:ue("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(_y,{className:"h-4 w-4"})}));yW.displayName=pW.displayName;const xW=y.forwardRef(({className:e,...t},n)=>s.jsx(fW,{ref:n,className:ue("text-sm font-semibold [&+div]:text-xs",e),...t}));xW.displayName=fW.displayName;const bW=y.forwardRef(({className:e,...t},n)=>s.jsx(hW,{ref:n,className:ue("text-sm opacity-90",e),...t}));bW.displayName=hW.displayName;function AEe(){const{toasts:e}=Dr();return s.jsxs(OEe,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return s.jsxs(gW,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(xW,{children:n}),r&&s.jsx(bW,{children:r})]}),a,s.jsx(yW,{})]},t)}),s.jsx(vW,{})]})}FV.createRoot(document.getElementById("root")).render(s.jsx(y.StrictMode,{children:s.jsx(oEe,{defaultTheme:"system",children:s.jsxs(sEe,{children:[s.jsx(MY,{router:iEe}),s.jsx(AEe,{})]})})})); diff --git a/webui/dist/index.html b/webui/dist/index.html index 8f73a47e..c815e271 100644 --- a/webui/dist/index.html +++ b/webui/dist/index.html @@ -5,8 +5,8 @@ MaiBot Dashboard - - + +