[object Object]

← back to Bertha

chore(alshi-dash,kalshi-dash): update 23 files (.jsx) [+5386/-1995] Files changed: D kalshi-dash/dist/assets/index-BwLNFh82.css D kalshi-dash/dist/assets/index-CabsjIzZ.js M kalshi-dash/dist/index.html M kalshi-dash/index.html M kalshi-dash/src/Layout.jsx M kalshi-dash/src/Login.jsx M kalshi-dash/src/index.css M kalshi-dash/src/pages/Dashboard.jsx M kalshi-dash/src/pages/Heatmap.jsx M kalshi-dash/src/pages/Intelligence.jsx M kalshi-dash/src/pages/Markets.jsx M kalshi-dash/src/pages/Orbit.jsx M kalshi-dash/src/pages/Orders.jsx M kalshi-dash/src/pages/Positions.jsx M kalshi-dash/src/pages/Pulse.jsx ... and 8 more

bc3495601a24f3bf3de4804579b2ad33eec17c6f · 2026-03-01 21:34:00 +0000 · DW Commit Agent

Files touched

Diff

commit bc3495601a24f3bf3de4804579b2ad33eec17c6f
Author: DW Commit Agent <commit-agent@dw-agents.com>
Date:   Sun Mar 1 21:34:00 2026 +0000

    chore(alshi-dash,kalshi-dash): update 23 files (.jsx) [+5386/-1995]
    Files changed:
      D kalshi-dash/dist/assets/index-BwLNFh82.css
       D kalshi-dash/dist/assets/index-CabsjIzZ.js
       M kalshi-dash/dist/index.html
       M kalshi-dash/index.html
       M kalshi-dash/src/Layout.jsx
       M kalshi-dash/src/Login.jsx
       M kalshi-dash/src/index.css
       M kalshi-dash/src/pages/Dashboard.jsx
       M kalshi-dash/src/pages/Heatmap.jsx
       M kalshi-dash/src/pages/Intelligence.jsx
       M kalshi-dash/src/pages/Markets.jsx
       M kalshi-dash/src/pages/Orbit.jsx
       M kalshi-dash/src/pages/Orders.jsx
       M kalshi-dash/src/pages/Positions.jsx
       M kalshi-dash/src/pages/Pulse.jsx
      ... and 8 more
---
 kalshi-dash/dist/assets/index-BCeiPTH6.css         |    1 +
 kalshi-dash/dist/assets/index-BwLNFh82.css         |    1 -
 kalshi-dash/dist/assets/index-CabsjIzZ.js          |  146 ---
 kalshi-dash/dist/assets/index-Cwmd51q1.js          |  158 +++
 kalshi-dash/dist/index.html                        |    7 +-
 .../docs/plans/2026-03-01-ken-neon-redesign.md     |   32 +
 kalshi-dash/index.html                             |    3 +-
 kalshi-dash/src/Layout.jsx                         |  256 ++++-
 kalshi-dash/src/Login.jsx                          |  284 ++++-
 kalshi-dash/src/index.css                          |  330 +++++-
 kalshi-dash/src/pages/Dashboard.jsx                | 1123 +++++++++++++-------
 kalshi-dash/src/pages/Heatmap.jsx                  |  337 +++---
 kalshi-dash/src/pages/Intelligence.jsx             |  351 ++++--
 kalshi-dash/src/pages/Markets.jsx                  |  354 ++++--
 kalshi-dash/src/pages/Orbit.jsx                    |  385 ++++---
 kalshi-dash/src/pages/Orders.jsx                   |  300 +++++-
 kalshi-dash/src/pages/Positions.jsx                |  747 ++++++++-----
 kalshi-dash/src/pages/Pulse.jsx                    |  412 ++++---
 kalshi-dash/src/pages/Risk.jsx                     |  545 +++++++---
 kalshi-dash/src/pages/Settings.jsx                 |  565 +++++++---
 kalshi-dash/src/pages/Signals.jsx                  |  487 +++++++--
 kalshi-dash/src/pages/Trading.jsx                  |  406 +++++--
 kalshi-dash/src/pages/Weather.jsx                  |  151 ++-
 23 files changed, 5386 insertions(+), 1995 deletions(-)

diff --git a/kalshi-dash/dist/assets/index-BCeiPTH6.css b/kalshi-dash/dist/assets/index-BCeiPTH6.css
new file mode 100644
index 0000000..62cec88
--- /dev/null
+++ b/kalshi-dash/dist/assets/index-BCeiPTH6.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}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.-top-2{top:-.5rem}.bottom-0{bottom:0}.bottom-3{bottom:.75rem}.left-0{left:0}.left-1{left:.25rem}.left-3{left:.75rem}.left-6{left:1.5rem}.right-0{right:0}.right-2{right:.5rem}.right-3{right:.75rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-3{top:.75rem}.z-10{z-index:10}.z-20{z-index:20}.col-span-2{grid-column:span 2 / span 2}.mx-0\.5{margin-left:.125rem;margin-right:.125rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-7{margin-bottom:1.75rem}.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-4{margin-right:1rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-auto{margin-top:auto}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.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-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-full{height:100%}.max-h-48{max-height:12rem}.min-h-screen{min-height:100vh}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-3{width:.75rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-\[180px\]{max-width:180px}.max-w-\[192px\]{max-width:192px}.max-w-\[200px\]{max-width:200px}.max-w-\[250px\]{max-width:250px}.max-w-\[280px\]{max-width:280px}.max-w-\[300px\]{max-width:300px}.max-w-\[400px\]{max-width:400px}.max-w-lg{max-width:32rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-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))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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 ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@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-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.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))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.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}.gap-px{gap:1px}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-y-1{row-gap:.25rem}.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-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * 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-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-amber-500{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-amber-500\/15{border-color:#f59e0b26}.border-amber-500\/20{border-color:#f59e0b33}.border-amber-500\/25{border-color:#f59e0b40}.border-amber-500\/30{border-color:#f59e0b4d}.border-amber-500\/40{border-color:#f59e0b66}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-blue-500\/20{border-color:#3b82f633}.border-blue-500\/25{border-color:#3b82f640}.border-blue-500\/30{border-color:#3b82f64d}.border-cyan-500\/30{border-color:#06b6d44d}.border-gray-400\/30{border-color:#9ca3af4d}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.border-gray-700\/20{border-color:#37415133}.border-gray-700\/30{border-color:#3741514d}.border-gray-700\/50{border-color:#37415180}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-green-500\/15{border-color:#22c55e26}.border-green-500\/20{border-color:#22c55e33}.border-green-500\/25{border-color:#22c55e40}.border-green-500\/30{border-color:#22c55e4d}.border-orange-700\/30{border-color:#c2410c4d}.border-purple-500\/30{border-color:#a855f74d}.border-red-500\/10{border-color:#ef44441a}.border-red-500\/20{border-color:#ef444433}.border-red-500\/25{border-color:#ef444440}.border-red-500\/30{border-color:#ef44444d}.border-yellow-500\/30{border-color:#eab3084d}.border-t-transparent{border-top-color:transparent}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-amber-500\/15{background-color:#f59e0b26}.bg-amber-500\/20{background-color:#f59e0b33}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/15{background-color:#3b82f626}.bg-blue-500\/20{background-color:#3b82f633}.bg-gray-400\/20{background-color:#9ca3af33}.bg-gray-500\/20{background-color:#6b728033}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-gray-800\/30{background-color:#1f29374d}.bg-gray-800\/40{background-color:#1f293766}.bg-gray-800\/50{background-color:#1f293780}.bg-gray-800\/60{background-color:#1f293799}.bg-gray-900\/80{background-color:#111827cc}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / 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-500\/10{background-color:#22c55e1a}.bg-green-500\/15{background-color:#22c55e26}.bg-green-500\/20{background-color:#22c55e33}.bg-green-500\/30{background-color:#22c55e4d}.bg-green-500\/5{background-color:#22c55e0d}.bg-orange-700\/20{background-color:#c2410c33}.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-500\/15{background-color:#ef444426}.bg-red-500\/20{background-color:#ef444433}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/15{background-color:#eab30826}.bg-yellow-500\/30{background-color:#eab3084d}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.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-amber-500\/15{--tw-gradient-from: rgb(245 158 11 / .15) var(--tw-gradient-from-position);--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-500\/20{--tw-gradient-from: rgb(245 158 11 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-500\/5{--tw-gradient-from: rgb(245 158 11 / .05) var(--tw-gradient-from-position);--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-500\/20{--tw-gradient-from: rgb(59 130 246 / .2) 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-blue-500\/5{--tw-gradient-from: rgb(59 130 246 / .05) 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-cyan-500\/20{--tw-gradient-from: rgb(6 182 212 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-400\/10{--tw-gradient-from: rgb(156 163 175 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(156 163 175 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-800\/30{--tw-gradient-from: rgb(31 41 55 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 41 55 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-800\/95{--tw-gradient-from: rgb(31 41 55 / .95) var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 41 55 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500\/20{--tw-gradient-from: rgb(34 197 94 / .2) 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-green-500\/5{--tw-gradient-from: rgb(34 197 94 / .05) 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-orange-700\/10{--tw-gradient-from: rgb(194 65 12 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(194 65 12 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500\/20{--tw-gradient-from: rgb(168 85 247 / .2) 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)}.via-transparent{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), transparent var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-amber-500\/5{--tw-gradient-to: rgb(245 158 11 / .05) var(--tw-gradient-to-position)}.to-blue-500\/5{--tw-gradient-to: rgb(59 130 246 / .05) var(--tw-gradient-to-position)}.to-cyan-500\/5{--tw-gradient-to: rgb(6 182 212 / .05) var(--tw-gradient-to-position)}.to-gray-400\/5{--tw-gradient-to: rgb(156 163 175 / .05) var(--tw-gradient-to-position)}.to-gray-900\/95{--tw-gradient-to: rgb(17 24 39 / .95) var(--tw-gradient-to-position)}.to-green-500\/5{--tw-gradient-to: rgb(34 197 94 / .05) var(--tw-gradient-to-position)}.to-orange-700\/5{--tw-gradient-to: rgb(194 65 12 / .05) var(--tw-gradient-to-position)}.to-purple-500\/5{--tw-gradient-to: rgb(168 85 247 / .05) var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.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-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.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-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-10{padding-bottom:2.5rem}.pb-3{padding-bottom:.75rem}.pl-5{padding-left:1.25rem}.pl-8{padding-left:2rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.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-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[9px\]{font-size:9px}.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-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-cyan-300{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.text-gray-100{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / 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-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.ring{--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)}.ring-1{--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)}.ring-2{--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)}.ring-amber-400{--tw-ring-opacity: 1;--tw-ring-color: rgb(251 191 36 / var(--tw-ring-opacity, 1))}.ring-cyan-500\/30{--tw-ring-color: rgb(6 182 212 / .3)}.blur{--tw-blur: blur(8px);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)!important}.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-sm{--tw-backdrop-blur: blur(4px);-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-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-300{transition-duration:.3s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}:root{--bg: #0E0E10;--surface: #141419;--surface-el: #1C1C24;--border: #2A2A35;--border-light: #3A3A48;--cyan: #00F0FF;--cyan-dim: rgba(0, 240, 255, .15);--cyan-glow: rgba(0, 240, 255, .08);--orange: #F7931A;--orange-dim: rgba(247, 147, 26, .15);--green: #00C389;--green-dim: rgba(0, 195, 137, .15);--red: #FF5C5C;--red-dim: rgba(255, 92, 92, .15);--blue: #3B82F6;--blue-dim: rgba(59, 130, 246, .15);--purple: #A855F7;--purple-dim: rgba(168, 85, 247, .15);--text: #E0E0E0;--text-dim: #A8A8A8;--text-muted: #6B7280;--radius-sm: 6px;--radius-md: 10px;--radius-lg: 14px;--radius-xl: 20px;--transition: .15s ease;--font-heading: "Space Grotesk", sans-serif;--font-body: "Inter", sans-serif;--font-mono: "JetBrains Mono", monospace}body{background:var(--bg);color:var(--text);font-family:var(--font-body);margin:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}h1,h2,h3,h4,h5,h6{font-family:var(--font-heading);font-weight:700;letter-spacing:-.02em}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:var(--bg)}::-webkit-scrollbar-thumb{background:#374151;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#4b5563}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:1.25rem;transition:all var(--transition)}.card:hover{border-color:var(--border-light);box-shadow:0 0 20px var(--cyan-glow)}.card-elevated{background:var(--surface-el);border:1px solid var(--border);border-radius:var(--radius-lg);padding:1.25rem}.card-glow{background:var(--surface);border:1px solid rgba(0,240,255,.2);border-radius:var(--radius-lg);padding:1.25rem;box-shadow:0 0 30px var(--cyan-glow),inset 0 1px #00f0ff0d}.stat-v{font-family:var(--font-mono);font-size:1.75rem;font-weight:600;line-height:1;letter-spacing:-.02em}.stat-label{font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted);font-family:var(--font-body)}.badge{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:9999px;font-size:.7rem;font-weight:600;font-family:var(--font-body);letter-spacing:.02em}.bg-cyan{background:var(--cyan-dim);color:var(--cyan)}.bg-green{background:var(--green-dim);color:var(--green)}.bg-red{background:var(--red-dim);color:var(--red)}.bg-yellow,.bg-orange{background:var(--orange-dim);color:var(--orange)}.bg-blue{background:var(--blue-dim);color:var(--blue)}.bg-purple{background:var(--purple-dim);color:var(--purple)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:.5rem 1rem;border-radius:var(--radius-md);font-weight:600;font-size:.85rem;font-family:var(--font-body);cursor:pointer;border:none;transition:all var(--transition)}.btn-p{background:var(--cyan);color:#0e0e10}.btn-p:hover{background:#00d4e0;transform:translateY(-1px);box-shadow:0 4px 12px #00f0ff40}.btn-orange{background:var(--orange);color:#0e0e10}.btn-orange:hover{background:#e5850f}.btn-d{background:var(--red);color:#fff}.btn-d:hover{background:#e04a4a}.btn-s{background:var(--green);color:#0e0e10}.btn-s:hover{background:#00a875}.btn-o{background:transparent;border:1px solid var(--border);color:var(--text-dim)}.btn-o:hover{border-color:var(--cyan);color:var(--cyan)}.btn-ghost{background:transparent;color:var(--text-dim);border:none}.btn-ghost:hover{color:var(--cyan);background:var(--cyan-glow)}.btn-sm{padding:.35rem .75rem;font-size:.75rem}.btn-lg{padding:.75rem 1.5rem;font-size:1rem}table{width:100%;border-collapse:collapse}th{text-align:left;padding:.75rem;font-size:.65rem;text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted);font-family:var(--font-body);font-weight:600;border-bottom:1px solid var(--border)}td{padding:.75rem;border-bottom:1px solid rgba(42,42,53,.5);font-size:.85rem}tr:hover td{background:var(--cyan-glow)}.input{width:100%;padding:.6rem .85rem;background:var(--surface-el);border:1px solid var(--border);border-radius:var(--radius-md);color:var(--text);font-family:var(--font-body);font-size:.85rem;transition:all var(--transition);outline:none}.input:focus{border-color:var(--cyan);box-shadow:0 0 0 3px #00f0ff1a}.input::-moz-placeholder{color:var(--text-muted)}.input::placeholder{color:var(--text-muted)}.kalshi-gradient{background:linear-gradient(135deg,var(--cyan),var(--orange));-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}.gradient-cyan{background:linear-gradient(135deg,var(--cyan),#0088FF);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}.pulse-cyan{animation:pulse-c 2s infinite}@keyframes pulse-c{0%,to{box-shadow:0 0 #00f0ff66}50%{box-shadow:0 0 0 6px #00f0ff00}}.pulse-g{animation:pg 2s infinite}@keyframes pg{0%,to{box-shadow:0 0 #00c38966}50%{box-shadow:0 0 0 6px #00c38900}}.glow-cyan{box-shadow:0 0 20px #00f0ff26,0 0 60px #00f0ff0d}.fade-in{animation:fadeIn .3s ease-out}@keyframes fadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.section-title{font-family:var(--font-heading);font-size:1.25rem;font-weight:700;color:var(--text);display:flex;align-items:center;gap:10px}.section-subtitle{font-size:.8rem;color:var(--text-muted);margin-top:2px}.toggle{position:relative;width:40px;height:22px;background:var(--border);border-radius:11px;cursor:pointer;transition:background var(--transition)}.toggle.active{background:var(--cyan)}.toggle:after{content:"";position:absolute;top:2px;left:2px;width:18px;height:18px;background:#fff;border-radius:50%;transition:transform var(--transition)}.toggle.active:after{transform:translate(18px)}.progress-bar{height:4px;background:var(--border);border-radius:2px;overflow:hidden}.progress-fill{height:100%;border-radius:2px;background:linear-gradient(90deg,var(--cyan),#0088FF);transition:width .5s ease}.mono{font-family:var(--font-mono)}.heading{font-family:var(--font-heading)}.text-cyan{color:var(--cyan)}.text-orange{color:var(--orange)}.text-green{color:var(--green)}.text-red{color:var(--red)}.text-dim{color:var(--text-dim)}.text-muted{color:var(--text-muted)}.border-cyan{border-color:var(--cyan)!important}.last\:border-0:last-child{border-width:0px}.hover\:border-gray-500:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.hover\:bg-gray-800\/60:hover{background-color:#1f293799}.hover\:text-amber-400:hover{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.hover\:text-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.hover\:text-gray-300:hover{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.focus\:border-amber-500:focus{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.group:hover .group-hover\:opacity-100{opacity:1}@media (min-width: 640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 768px){.md\:col-span-2{grid-column:span 2 / span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 1280px){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}
diff --git a/kalshi-dash/dist/assets/index-BwLNFh82.css b/kalshi-dash/dist/assets/index-BwLNFh82.css
deleted file mode 100644
index 424e151..0000000
--- a/kalshi-dash/dist/assets/index-BwLNFh82.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}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.-top-2{top:-.5rem}.bottom-0{bottom:0}.bottom-3{bottom:.75rem}.left-0{left:0}.left-1{left:.25rem}.left-3{left:.75rem}.left-6{left:1.5rem}.right-0{right:0}.right-2{right:.5rem}.right-3{right:.75rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-3{top:.75rem}.z-10{z-index:10}.z-20{z-index:20}.col-span-2{grid-column:span 2 / span 2}.row-span-2{grid-row:span 2 / span 2}.mx-0\.5{margin-left:.125rem;margin-right:.125rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-4{margin-right:1rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-auto{margin-top:auto}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.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-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-8{height:2rem}.h-full{height:100%}.max-h-48{max-height:12rem}.min-h-screen{min-height:100vh}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-3{width:.75rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-48{max-width:12rem}.max-w-4xl{max-width:56rem}.max-w-\[1600px\]{max-width:1600px}.max-w-\[180px\]{max-width:180px}.max-w-\[200px\]{max-width:200px}.max-w-\[250px\]{max-width:250px}.max-w-\[280px\]{max-width:280px}.max-w-\[300px\]{max-width:300px}.max-w-\[400px\]{max-width:400px}.max-w-md{max-width:28rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-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))}.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))}.rotate-90{--tw-rotate: 90deg;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))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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 ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@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-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.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}.gap-px{gap:1px}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-y-1{row-gap:.25rem}.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-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * 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}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-amber-500{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-amber-500\/15{border-color:#f59e0b26}.border-amber-500\/20{border-color:#f59e0b33}.border-amber-500\/25{border-color:#f59e0b40}.border-amber-500\/30{border-color:#f59e0b4d}.border-amber-500\/40{border-color:#f59e0b66}.border-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-blue-500\/20{border-color:#3b82f633}.border-blue-500\/25{border-color:#3b82f640}.border-blue-500\/30{border-color:#3b82f64d}.border-cyan-500\/30{border-color:#06b6d44d}.border-gray-400\/30{border-color:#9ca3af4d}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.border-gray-700\/20{border-color:#37415133}.border-gray-700\/30{border-color:#3741514d}.border-gray-700\/50{border-color:#37415180}.border-gray-700\/60{border-color:#37415199}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-gray-800\/40{border-color:#1f293766}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-green-500\/15{border-color:#22c55e26}.border-green-500\/20{border-color:#22c55e33}.border-green-500\/25{border-color:#22c55e40}.border-green-500\/30{border-color:#22c55e4d}.border-green-500\/40{border-color:#22c55e66}.border-orange-700\/30{border-color:#c2410c4d}.border-purple-500\/30{border-color:#a855f74d}.border-red-500\/10{border-color:#ef44441a}.border-red-500\/20{border-color:#ef444433}.border-red-500\/25{border-color:#ef444440}.border-red-500\/30{border-color:#ef44444d}.border-red-500\/40{border-color:#ef444466}.border-transparent{border-color:transparent}.border-yellow-500\/30{border-color:#eab3084d}.border-yellow-500\/40{border-color:#eab30866}.border-t-transparent{border-top-color:transparent}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-amber-500\/15{background-color:#f59e0b26}.bg-amber-500\/20{background-color:#f59e0b33}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/15{background-color:#3b82f626}.bg-blue-500\/20{background-color:#3b82f633}.bg-gray-400\/20{background-color:#9ca3af33}.bg-gray-500\/20{background-color:#6b728033}.bg-gray-500\/5{background-color:#6b72800d}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.bg-gray-700\/50{background-color:#37415180}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-gray-800\/10{background-color:#1f29371a}.bg-gray-800\/20{background-color:#1f293733}.bg-gray-800\/30{background-color:#1f29374d}.bg-gray-800\/40{background-color:#1f293766}.bg-gray-800\/50{background-color:#1f293780}.bg-gray-800\/60{background-color:#1f293799}.bg-gray-900\/20{background-color:#11182733}.bg-gray-900\/40{background-color:#11182766}.bg-gray-900\/50{background-color:#11182780}.bg-gray-900\/60{background-color:#11182799}.bg-gray-900\/80{background-color:#111827cc}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / 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-500\/10{background-color:#22c55e1a}.bg-green-500\/15{background-color:#22c55e26}.bg-green-500\/20{background-color:#22c55e33}.bg-green-500\/30{background-color:#22c55e4d}.bg-green-500\/5{background-color:#22c55e0d}.bg-orange-700\/20{background-color:#c2410c33}.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-500\/15{background-color:#ef444426}.bg-red-500\/20{background-color:#ef444433}.bg-red-500\/5{background-color:#ef44440d}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/15{background-color:#eab30826}.bg-yellow-500\/20{background-color:#eab30833}.bg-yellow-500\/30{background-color:#eab3084d}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.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-amber-500\/15{--tw-gradient-from: rgb(245 158 11 / .15) var(--tw-gradient-from-position);--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-500\/20{--tw-gradient-from: rgb(245 158 11 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-500\/5{--tw-gradient-from: rgb(245 158 11 / .05) var(--tw-gradient-from-position);--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-500\/20{--tw-gradient-from: rgb(59 130 246 / .2) 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-blue-500\/5{--tw-gradient-from: rgb(59 130 246 / .05) 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-cyan-500\/20{--tw-gradient-from: rgb(6 182 212 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-400\/10{--tw-gradient-from: rgb(156 163 175 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(156 163 175 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-800\/30{--tw-gradient-from: rgb(31 41 55 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 41 55 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-800\/90{--tw-gradient-from: rgb(31 41 55 / .9) var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 41 55 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-800\/95{--tw-gradient-from: rgb(31 41 55 / .95) var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 41 55 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500\/20{--tw-gradient-from: rgb(34 197 94 / .2) 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-green-500\/5{--tw-gradient-from: rgb(34 197 94 / .05) 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-orange-500\/20{--tw-gradient-from: rgb(249 115 22 / .2) 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-orange-700\/10{--tw-gradient-from: rgb(194 65 12 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(194 65 12 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-pink-500\/20{--tw-gradient-from: rgb(236 72 153 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(236 72 153 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500\/20{--tw-gradient-from: rgb(168 85 247 / .2) 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-slate-500\/20{--tw-gradient-from: rgb(100 116 139 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(100 116 139 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-yellow-500\/20{--tw-gradient-from: rgb(234 179 8 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(234 179 8 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-transparent{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), transparent var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-amber-500\/5{--tw-gradient-to: rgb(245 158 11 / .05) var(--tw-gradient-to-position)}.to-amber-600\/10{--tw-gradient-to: rgb(217 119 6 / .1) var(--tw-gradient-to-position)}.to-blue-500\/5{--tw-gradient-to: rgb(59 130 246 / .05) var(--tw-gradient-to-position)}.to-blue-600\/10{--tw-gradient-to: rgb(37 99 235 / .1) var(--tw-gradient-to-position)}.to-cyan-500\/5{--tw-gradient-to: rgb(6 182 212 / .05) var(--tw-gradient-to-position)}.to-cyan-600\/10{--tw-gradient-to: rgb(8 145 178 / .1) var(--tw-gradient-to-position)}.to-gray-400\/5{--tw-gradient-to: rgb(156 163 175 / .05) var(--tw-gradient-to-position)}.to-gray-900\/90{--tw-gradient-to: rgb(17 24 39 / .9) var(--tw-gradient-to-position)}.to-gray-900\/95{--tw-gradient-to: rgb(17 24 39 / .95) var(--tw-gradient-to-position)}.to-green-500\/5{--tw-gradient-to: rgb(34 197 94 / .05) var(--tw-gradient-to-position)}.to-green-600\/10{--tw-gradient-to: rgb(22 163 74 / .1) var(--tw-gradient-to-position)}.to-orange-600\/10{--tw-gradient-to: rgb(234 88 12 / .1) var(--tw-gradient-to-position)}.to-orange-700\/5{--tw-gradient-to: rgb(194 65 12 / .05) var(--tw-gradient-to-position)}.to-pink-600\/10{--tw-gradient-to: rgb(219 39 119 / .1) var(--tw-gradient-to-position)}.to-purple-500\/5{--tw-gradient-to: rgb(168 85 247 / .05) var(--tw-gradient-to-position)}.to-purple-600\/10{--tw-gradient-to: rgb(147 51 234 / .1) var(--tw-gradient-to-position)}.to-slate-600\/10{--tw-gradient-to: rgb(71 85 105 / .1) var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.to-yellow-600\/10{--tw-gradient-to: rgb(202 138 4 / .1) var(--tw-gradient-to-position)}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.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-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.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-10{padding-top:2.5rem;padding-bottom:2.5rem}.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-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-10{padding-bottom:2.5rem}.pl-8{padding-left:2rem}.pr-10{padding-right:2.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.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-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[9px\]{font-size:9px}.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-extrabold{font-weight:800}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-cyan-300{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-gray-100{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / 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-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.ring{--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)}.ring-1{--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)}.ring-2{--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)}.ring-amber-400{--tw-ring-opacity: 1;--tw-ring-color: rgb(251 191 36 / var(--tw-ring-opacity, 1))}.ring-cyan-500\/30{--tw-ring-color: rgb(6 182 212 / .3)}.blur{--tw-blur: blur(8px);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)!important}.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-sm{--tw-backdrop-blur: blur(4px);-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-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}:root{--bg: #0a0e1a;--card: #111827;--border: #1e293b;--accent: #f59e0b}body{background:var(--bg);color:#e2e8f0;font-family:Inter,sans-serif;margin:0}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:var(--bg)}::-webkit-scrollbar-thumb{background:#374151;border-radius:3px}.card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:1.25rem}.stat-v{font-size:1.75rem;font-weight:700;line-height:1}.badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:9999px;font-size:.75rem;font-weight:600}.bg-green{background:#10b98126;color:#10b981}.bg-red{background:#ef444426;color:#ef4444}.bg-yellow{background:#f59e0b26;color:#f59e0b}.bg-blue{background:#3b82f626;color:#3b82f6}.bg-orange{background:#f9731626;color:#f97316}.pulse-g{animation:pg 2s infinite}@keyframes pg{0%,to{box-shadow:0 0 #f59e0b66}50%{box-shadow:0 0 0 6px #f59e0b00}}.btn{padding:.5rem 1rem;border-radius:8px;font-weight:600;font-size:.875rem;cursor:pointer;border:none;transition:all .15s}.btn-p{background:#f59e0b;color:#111}.btn-p:hover{background:#d97706}.btn-d{background:#ef4444;color:#fff}.btn-d:hover{background:#dc2626}.btn-s{background:#10b981;color:#fff}.btn-s:hover{background:#059669}.btn-o{background:transparent;border:1px solid var(--border);color:#9ca3af}.btn-o:hover{border-color:#f59e0b;color:#f59e0b}table{width:100%;border-collapse:collapse}th{text-align:left;padding:.75rem;font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;color:#64748b;border-bottom:1px solid var(--border)}td{padding:.75rem;border-bottom:1px solid rgba(30,41,59,.5);font-size:.85rem}tr:hover td{background:#f59e0b08}.kalshi-gradient{background:linear-gradient(135deg,#f59e0b,#f97316);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}.last\:border-0:last-child{border-width:0px}.hover\:border-gray-500:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.hover\:border-gray-600:hover{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.hover\:bg-gray-800\/20:hover{background-color:#1f293733}.hover\:bg-gray-800\/30:hover{background-color:#1f29374d}.hover\:bg-gray-800\/50:hover{background-color:#1f293780}.hover\:bg-gray-800\/60:hover{background-color:#1f293799}.hover\:text-amber-300:hover{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.hover\:text-amber-400:hover{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.hover\:text-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.hover\:text-gray-300:hover{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.focus\:border-amber-500:focus{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:opacity-100{opacity:1}@media (min-width: 768px){.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}
diff --git a/kalshi-dash/dist/assets/index-CabsjIzZ.js b/kalshi-dash/dist/assets/index-CabsjIzZ.js
deleted file mode 100644
index 4e20e85..0000000
--- a/kalshi-dash/dist/assets/index-CabsjIzZ.js
+++ /dev/null
@@ -1,146 +0,0 @@
-function h2(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(n,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>n[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"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(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 n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var dl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var X1={exports:{}},Tu={},Q1={exports:{}},ne={};/**
- * @license React
- * react.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var Zs=Symbol.for("react.element"),p2=Symbol.for("react.portal"),m2=Symbol.for("react.fragment"),g2=Symbol.for("react.strict_mode"),y2=Symbol.for("react.profiler"),v2=Symbol.for("react.provider"),x2=Symbol.for("react.context"),b2=Symbol.for("react.forward_ref"),j2=Symbol.for("react.suspense"),w2=Symbol.for("react.memo"),S2=Symbol.for("react.lazy"),Pg=Symbol.iterator;function _2(e){return e===null||typeof e!="object"?null:(e=Pg&&e[Pg]||e["@@iterator"],typeof e=="function"?e:null)}var Z1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},J1=Object.assign,ej={};function Gi(e,t,r){this.props=e,this.context=t,this.refs=ej,this.updater=r||Z1}Gi.prototype.isReactComponent={};Gi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Gi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function tj(){}tj.prototype=Gi.prototype;function vm(e,t,r){this.props=e,this.context=t,this.refs=ej,this.updater=r||Z1}var xm=vm.prototype=new tj;xm.constructor=vm;J1(xm,Gi.prototype);xm.isPureReactComponent=!0;var kg=Array.isArray,rj=Object.prototype.hasOwnProperty,bm={current:null},nj={key:!0,ref:!0,__self:!0,__source:!0};function aj(e,t,r){var n,a={},i=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)rj.call(t,n)&&!nj.hasOwnProperty(n)&&(a[n]=t[n]);var l=arguments.length-2;if(l===1)a.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)a[n]===void 0&&(a[n]=l[n]);return{$$typeof:Zs,type:e,key:i,ref:o,props:a,_owner:bm.current}}function N2(e,t){return{$$typeof:Zs,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function jm(e){return typeof e=="object"&&e!==null&&e.$$typeof===Zs}function O2(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Ag=/\/+/g;function Kf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?O2(""+e.key):t.toString(36)}function Gl(e,t,r,n,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Zs:case p2:o=!0}}if(o)return o=e,a=a(o),e=n===""?"."+Kf(o,0):n,kg(a)?(r="",e!=null&&(r=e.replace(Ag,"$&/")+"/"),Gl(a,t,r,"",function(u){return u})):a!=null&&(jm(a)&&(a=N2(a,r+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(Ag,"$&/")+"/")+e)),t.push(a)),1;if(o=0,n=n===""?".":n+":",kg(e))for(var l=0;l<e.length;l++){i=e[l];var c=n+Kf(i,l);o+=Gl(i,t,r,c,a)}else if(c=_2(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=n+Kf(i,l++),o+=Gl(i,t,r,c,a);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function hl(e,t,r){if(e==null)return e;var n=[],a=0;return Gl(e,n,"","",function(i){return t.call(r,i,a++)}),n}function P2(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var gt={current:null},Yl={transition:null},k2={ReactCurrentDispatcher:gt,ReactCurrentBatchConfig:Yl,ReactCurrentOwner:bm};function ij(){throw Error("act(...) is not supported in production builds of React.")}ne.Children={map:hl,forEach:function(e,t,r){hl(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return hl(e,function(){t++}),t},toArray:function(e){return hl(e,function(t){return t})||[]},only:function(e){if(!jm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ne.Component=Gi;ne.Fragment=m2;ne.Profiler=y2;ne.PureComponent=vm;ne.StrictMode=g2;ne.Suspense=j2;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=k2;ne.act=ij;ne.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=J1({},e.props),a=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=bm.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)rj.call(t,c)&&!nj.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:Zs,type:e.type,key:a,ref:i,props:n,_owner:o}};ne.createContext=function(e){return e={$$typeof:x2,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:v2,_context:e},e.Consumer=e};ne.createElement=aj;ne.createFactory=function(e){var t=aj.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:b2,render:e}};ne.isValidElement=jm;ne.lazy=function(e){return{$$typeof:S2,_payload:{_status:-1,_result:e},_init:P2}};ne.memo=function(e,t){return{$$typeof:w2,type:e,compare:t===void 0?null:t}};ne.startTransition=function(e){var t=Yl.transition;Yl.transition={};try{e()}finally{Yl.transition=t}};ne.unstable_act=ij;ne.useCallback=function(e,t){return gt.current.useCallback(e,t)};ne.useContext=function(e){return gt.current.useContext(e)};ne.useDebugValue=function(){};ne.useDeferredValue=function(e){return gt.current.useDeferredValue(e)};ne.useEffect=function(e,t){return gt.current.useEffect(e,t)};ne.useId=function(){return gt.current.useId()};ne.useImperativeHandle=function(e,t,r){return gt.current.useImperativeHandle(e,t,r)};ne.useInsertionEffect=function(e,t){return gt.current.useInsertionEffect(e,t)};ne.useLayoutEffect=function(e,t){return gt.current.useLayoutEffect(e,t)};ne.useMemo=function(e,t){return gt.current.useMemo(e,t)};ne.useReducer=function(e,t,r){return gt.current.useReducer(e,t,r)};ne.useRef=function(e){return gt.current.useRef(e)};ne.useState=function(e){return gt.current.useState(e)};ne.useSyncExternalStore=function(e,t,r){return gt.current.useSyncExternalStore(e,t,r)};ne.useTransition=function(){return gt.current.useTransition()};ne.version="18.3.1";Q1.exports=ne;var O=Q1.exports;const E=fe(O),A2=h2({__proto__:null,default:E},[O]);/**
- * @license React
- * react-jsx-runtime.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var $2=O,E2=Symbol.for("react.element"),C2=Symbol.for("react.fragment"),T2=Object.prototype.hasOwnProperty,M2=$2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,I2={key:!0,ref:!0,__self:!0,__source:!0};function oj(e,t,r){var n,a={},i=null,o=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)T2.call(t,n)&&!I2.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)a[n]===void 0&&(a[n]=t[n]);return{$$typeof:E2,type:e,key:i,ref:o,props:a,_owner:M2.current}}Tu.Fragment=C2;Tu.jsx=oj;Tu.jsxs=oj;X1.exports=Tu;var s=X1.exports,qd={},sj={exports:{}},Dt={},lj={exports:{}},cj={};/**
- * @license React
- * scheduler.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */(function(e){function t(L,R){var F=L.length;L.push(R);e:for(;0<F;){var K=F-1>>>1,z=L[K];if(0<a(z,R))L[K]=R,L[F]=z,F=K;else break e}}function r(L){return L.length===0?null:L[0]}function n(L){if(L.length===0)return null;var R=L[0],F=L.pop();if(F!==R){L[0]=F;e:for(var K=0,z=L.length,q=z>>>1;K<q;){var ie=2*(K+1)-1,_e=L[ie],Me=ie+1,Bt=L[Me];if(0>a(_e,F))Me<z&&0>a(Bt,_e)?(L[K]=Bt,L[Me]=F,K=Me):(L[K]=_e,L[ie]=F,K=ie);else if(Me<z&&0>a(Bt,F))L[K]=Bt,L[Me]=F,K=Me;else break e}}return R}function a(L,R){var F=L.sortIndex-R.sortIndex;return F!==0?F:L.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,v=!1,b=!1,x=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(L){for(var R=r(u);R!==null;){if(R.callback===null)n(u);else if(R.startTime<=L)n(u),R.sortIndex=R.expirationTime,t(c,R);else break;R=r(u)}}function S(L){if(b=!1,g(L),!v)if(r(c)!==null)v=!0,I(j);else{var R=r(u);R!==null&&B(S,R.startTime-L)}}function j(L,R){v=!1,b&&(b=!1,y(N),N=-1),p=!0;var F=h;try{for(g(R),f=r(c);f!==null&&(!(f.expirationTime>R)||L&&!T());){var K=f.callback;if(typeof K=="function"){f.callback=null,h=f.priorityLevel;var z=K(f.expirationTime<=R);R=e.unstable_now(),typeof z=="function"?f.callback=z:f===r(c)&&n(c),g(R)}else n(c);f=r(c)}if(f!==null)var q=!0;else{var ie=r(u);ie!==null&&B(S,ie.startTime-R),q=!1}return q}finally{f=null,h=F,p=!1}}var w=!1,_=null,N=-1,P=5,k=-1;function T(){return!(e.unstable_now()-k<P)}function C(){if(_!==null){var L=e.unstable_now();k=L;var R=!0;try{R=_(!0,L)}finally{R?$():(w=!1,_=null)}}else w=!1}var $;if(typeof m=="function")$=function(){m(C)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,A=M.port2;M.port1.onmessage=C,$=function(){A.postMessage(null)}}else $=function(){x(C,0)};function I(L){_=L,w||(w=!0,$())}function B(L,R){N=x(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_continueExecution=function(){v||p||(v=!0,I(j))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(L){switch(h){case 1:case 2:case 3:var R=3;break;default:R=h}var F=h;h=R;try{return L()}finally{h=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,R){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var F=h;h=L;try{return R()}finally{h=F}},e.unstable_scheduleCallback=function(L,R,F){var K=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?K+F:K):F=K,L){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=F+z,L={id:d++,callback:R,priorityLevel:L,startTime:F,expirationTime:z,sortIndex:-1},F>K?(L.sortIndex=F,t(u,L),r(c)===null&&L===r(u)&&(b?(y(N),N=-1):b=!0,B(S,F-K))):(L.sortIndex=z,t(c,L),v||p||(v=!0,I(j))),L},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(L){var R=h;return function(){var F=h;h=R;try{return L.apply(this,arguments)}finally{h=F}}}})(cj);lj.exports=cj;var L2=lj.exports;/**
- * @license React
- * react-dom.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var D2=O,Lt=L2;function H(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var uj=new Set,Zo={};function Sa(e,t){di(e,t),di(e+"Capture",t)}function di(e,t){for(Zo[e]=t,e=0;e<t.length;e++)uj.add(t[e])}var Ur=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xd=Object.prototype.hasOwnProperty,R2=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,$g={},Eg={};function B2(e){return Xd.call(Eg,e)?!0:Xd.call($g,e)?!1:R2.test(e)?Eg[e]=!0:($g[e]=!0,!1)}function F2(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function z2(e,t,r,n){if(t===null||typeof t>"u"||F2(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function yt(e,t,r,n,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var at={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){at[e]=new yt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];at[t]=new yt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){at[e]=new yt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){at[e]=new yt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){at[e]=new yt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){at[e]=new yt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){at[e]=new yt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){at[e]=new yt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){at[e]=new yt(e,5,!1,e.toLowerCase(),null,!1,!1)});var wm=/[\-:]([a-z])/g;function Sm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(wm,Sm);at[t]=new yt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(wm,Sm);at[t]=new yt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(wm,Sm);at[t]=new yt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){at[e]=new yt(e,1,!1,e.toLowerCase(),null,!1,!1)});at.xlinkHref=new yt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){at[e]=new yt(e,1,!1,e.toLowerCase(),null,!0,!0)});function _m(e,t,r,n){var a=at.hasOwnProperty(t)?at[t]:null;(a!==null?a.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(z2(t,r,a,n)&&(r=null),n||a===null?B2(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):a.mustUseProperty?e[a.propertyName]=r===null?a.type===3?!1:"":r:(t=a.attributeName,n=a.attributeNamespace,r===null?e.removeAttribute(t):(a=a.type,r=a===3||a===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var qr=D2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,pl=Symbol.for("react.element"),Ra=Symbol.for("react.portal"),Ba=Symbol.for("react.fragment"),Nm=Symbol.for("react.strict_mode"),Qd=Symbol.for("react.profiler"),fj=Symbol.for("react.provider"),dj=Symbol.for("react.context"),Om=Symbol.for("react.forward_ref"),Zd=Symbol.for("react.suspense"),Jd=Symbol.for("react.suspense_list"),Pm=Symbol.for("react.memo"),nn=Symbol.for("react.lazy"),hj=Symbol.for("react.offscreen"),Cg=Symbol.iterator;function fo(e){return e===null||typeof e!="object"?null:(e=Cg&&e[Cg]||e["@@iterator"],typeof e=="function"?e:null)}var $e=Object.assign,Vf;function Eo(e){if(Vf===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Vf=t&&t[1]||""}return`
-`+Vf+e}var Gf=!1;function Yf(e,t){if(!e||Gf)return"";Gf=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var a=u.stack.split(`
-`),i=n.stack.split(`
-`),o=a.length-1,l=i.length-1;1<=o&&0<=l&&a[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==i[l]){var c=`
-`+a[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Gf=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Eo(e):""}function U2(e){switch(e.tag){case 5:return Eo(e.type);case 16:return Eo("Lazy");case 13:return Eo("Suspense");case 19:return Eo("SuspenseList");case 0:case 2:case 15:return e=Yf(e.type,!1),e;case 11:return e=Yf(e.type.render,!1),e;case 1:return e=Yf(e.type,!0),e;default:return""}}function eh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ba:return"Fragment";case Ra:return"Portal";case Qd:return"Profiler";case Nm:return"StrictMode";case Zd:return"Suspense";case Jd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case dj:return(e.displayName||"Context")+".Consumer";case fj:return(e._context.displayName||"Context")+".Provider";case Om:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pm:return t=e.displayName||null,t!==null?t:eh(e.type)||"Memo";case nn:t=e._payload,e=e._init;try{return eh(e(t))}catch{}}return null}function W2(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return eh(t);case 8:return t===Nm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function On(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function H2(e){var t=pj(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ml(e){e._valueTracker||(e._valueTracker=H2(e))}function mj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=pj(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function oc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function th(e,t){var r=t.checked;return $e({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Tg(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=On(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function gj(e,t){t=t.checked,t!=null&&_m(e,"checked",t,!1)}function rh(e,t){gj(e,t);var r=On(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?nh(e,t.type,r):t.hasOwnProperty("defaultValue")&&nh(e,t.type,On(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Mg(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function nh(e,t,r){(t!=="number"||oc(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Co=Array.isArray;function ti(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a<r.length;a++)t["$"+r[a]]=!0;for(r=0;r<e.length;r++)a=t.hasOwnProperty("$"+e[r].value),e[r].selected!==a&&(e[r].selected=a),a&&n&&(e[r].defaultSelected=!0)}else{for(r=""+On(r),t=null,a=0;a<e.length;a++){if(e[a].value===r){e[a].selected=!0,n&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function ah(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return $e({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ig(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(H(92));if(Co(r)){if(1<r.length)throw Error(H(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:On(r)}}function yj(e,t){var r=On(t.value),n=On(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Lg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function vj(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ih(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?vj(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var gl,xj=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,a){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(gl=gl||document.createElement("div"),gl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=gl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Jo(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Do={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},K2=["Webkit","ms","Moz","O"];Object.keys(Do).forEach(function(e){K2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Do[t]=Do[e]})});function bj(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Do.hasOwnProperty(e)&&Do[e]?(""+t).trim():t+"px"}function jj(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=bj(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var V2=$e({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function oh(e,t){if(t){if(V2[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function sh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lh=null;function km(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ch=null,ri=null,ni=null;function Dg(e){if(e=tl(e)){if(typeof ch!="function")throw Error(H(280));var t=e.stateNode;t&&(t=Ru(t),ch(e.stateNode,e.type,t))}}function wj(e){ri?ni?ni.push(e):ni=[e]:ri=e}function Sj(){if(ri){var e=ri,t=ni;if(ni=ri=null,Dg(e),t)for(e=0;e<t.length;e++)Dg(t[e])}}function _j(e,t){return e(t)}function Nj(){}var qf=!1;function Oj(e,t,r){if(qf)return e(t,r);qf=!0;try{return _j(e,t,r)}finally{qf=!1,(ri!==null||ni!==null)&&(Nj(),Sj())}}function es(e,t){var r=e.stateNode;if(r===null)return null;var n=Ru(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(H(231,t,typeof r));return r}var uh=!1;if(Ur)try{var ho={};Object.defineProperty(ho,"passive",{get:function(){uh=!0}}),window.addEventListener("test",ho,ho),window.removeEventListener("test",ho,ho)}catch{uh=!1}function G2(e,t,r,n,a,i,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(d){this.onError(d)}}var Ro=!1,sc=null,lc=!1,fh=null,Y2={onError:function(e){Ro=!0,sc=e}};function q2(e,t,r,n,a,i,o,l,c){Ro=!1,sc=null,G2.apply(Y2,arguments)}function X2(e,t,r,n,a,i,o,l,c){if(q2.apply(this,arguments),Ro){if(Ro){var u=sc;Ro=!1,sc=null}else throw Error(H(198));lc||(lc=!0,fh=u)}}function _a(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Pj(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Rg(e){if(_a(e)!==e)throw Error(H(188))}function Q2(e){var t=e.alternate;if(!t){if(t=_a(e),t===null)throw Error(H(188));return t!==e?null:e}for(var r=e,n=t;;){var a=r.return;if(a===null)break;var i=a.alternate;if(i===null){if(n=a.return,n!==null){r=n;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===r)return Rg(a),e;if(i===n)return Rg(a),t;i=i.sibling}throw Error(H(188))}if(r.return!==n.return)r=a,n=i;else{for(var o=!1,l=a.child;l;){if(l===r){o=!0,r=a,n=i;break}if(l===n){o=!0,n=a,r=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===r){o=!0,r=i,n=a;break}if(l===n){o=!0,n=i,r=a;break}l=l.sibling}if(!o)throw Error(H(189))}}if(r.alternate!==n)throw Error(H(190))}if(r.tag!==3)throw Error(H(188));return r.stateNode.current===r?e:t}function kj(e){return e=Q2(e),e!==null?Aj(e):null}function Aj(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Aj(e);if(t!==null)return t;e=e.sibling}return null}var $j=Lt.unstable_scheduleCallback,Bg=Lt.unstable_cancelCallback,Z2=Lt.unstable_shouldYield,J2=Lt.unstable_requestPaint,Ie=Lt.unstable_now,eP=Lt.unstable_getCurrentPriorityLevel,Am=Lt.unstable_ImmediatePriority,Ej=Lt.unstable_UserBlockingPriority,cc=Lt.unstable_NormalPriority,tP=Lt.unstable_LowPriority,Cj=Lt.unstable_IdlePriority,Mu=null,xr=null;function rP(e){if(xr&&typeof xr.onCommitFiberRoot=="function")try{xr.onCommitFiberRoot(Mu,e,void 0,(e.current.flags&128)===128)}catch{}}var lr=Math.clz32?Math.clz32:iP,nP=Math.log,aP=Math.LN2;function iP(e){return e>>>=0,e===0?32:31-(nP(e)/aP|0)|0}var yl=64,vl=4194304;function To(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function uc(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~a;l!==0?n=To(l):(i&=o,i!==0&&(n=To(i)))}else o=r&~a,o!==0?n=To(o):i!==0&&(n=To(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-lr(t),a=1<<r,n|=e[r],t&=~a;return n}function oP(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function sP(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-lr(i),l=1<<o,c=a[o];c===-1?(!(l&r)||l&n)&&(a[o]=oP(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function dh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Tj(){var e=yl;return yl<<=1,!(yl&4194240)&&(yl=64),e}function Xf(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Js(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-lr(t),e[t]=r}function lP(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var a=31-lr(r),i=1<<a;t[a]=0,n[a]=-1,e[a]=-1,r&=~i}}function $m(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-lr(r),a=1<<n;a&t|e[n]&t&&(e[n]|=t),r&=~a}}var ue=0;function Mj(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ij,Em,Lj,Dj,Rj,hh=!1,xl=[],gn=null,yn=null,vn=null,ts=new Map,rs=new Map,sn=[],cP="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Fg(e,t){switch(e){case"focusin":case"focusout":gn=null;break;case"dragenter":case"dragleave":yn=null;break;case"mouseover":case"mouseout":vn=null;break;case"pointerover":case"pointerout":ts.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":rs.delete(t.pointerId)}}function po(e,t,r,n,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[a]},t!==null&&(t=tl(t),t!==null&&Em(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function uP(e,t,r,n,a){switch(t){case"focusin":return gn=po(gn,e,t,r,n,a),!0;case"dragenter":return yn=po(yn,e,t,r,n,a),!0;case"mouseover":return vn=po(vn,e,t,r,n,a),!0;case"pointerover":var i=a.pointerId;return ts.set(i,po(ts.get(i)||null,e,t,r,n,a)),!0;case"gotpointercapture":return i=a.pointerId,rs.set(i,po(rs.get(i)||null,e,t,r,n,a)),!0}return!1}function Bj(e){var t=Zn(e.target);if(t!==null){var r=_a(t);if(r!==null){if(t=r.tag,t===13){if(t=Pj(r),t!==null){e.blockedOn=t,Rj(e.priority,function(){Lj(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ql(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=ph(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);lh=n,r.target.dispatchEvent(n),lh=null}else return t=tl(r),t!==null&&Em(t),e.blockedOn=r,!1;t.shift()}return!0}function zg(e,t,r){ql(e)&&r.delete(t)}function fP(){hh=!1,gn!==null&&ql(gn)&&(gn=null),yn!==null&&ql(yn)&&(yn=null),vn!==null&&ql(vn)&&(vn=null),ts.forEach(zg),rs.forEach(zg)}function mo(e,t){e.blockedOn===t&&(e.blockedOn=null,hh||(hh=!0,Lt.unstable_scheduleCallback(Lt.unstable_NormalPriority,fP)))}function ns(e){function t(a){return mo(a,e)}if(0<xl.length){mo(xl[0],e);for(var r=1;r<xl.length;r++){var n=xl[r];n.blockedOn===e&&(n.blockedOn=null)}}for(gn!==null&&mo(gn,e),yn!==null&&mo(yn,e),vn!==null&&mo(vn,e),ts.forEach(t),rs.forEach(t),r=0;r<sn.length;r++)n=sn[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<sn.length&&(r=sn[0],r.blockedOn===null);)Bj(r),r.blockedOn===null&&sn.shift()}var ai=qr.ReactCurrentBatchConfig,fc=!0;function dP(e,t,r,n){var a=ue,i=ai.transition;ai.transition=null;try{ue=1,Cm(e,t,r,n)}finally{ue=a,ai.transition=i}}function hP(e,t,r,n){var a=ue,i=ai.transition;ai.transition=null;try{ue=4,Cm(e,t,r,n)}finally{ue=a,ai.transition=i}}function Cm(e,t,r,n){if(fc){var a=ph(e,t,r,n);if(a===null)od(e,t,n,dc,r),Fg(e,n);else if(uP(a,e,t,r,n))n.stopPropagation();else if(Fg(e,n),t&4&&-1<cP.indexOf(e)){for(;a!==null;){var i=tl(a);if(i!==null&&Ij(i),i=ph(e,t,r,n),i===null&&od(e,t,n,dc,r),i===a)break;a=i}a!==null&&n.stopPropagation()}else od(e,t,n,null,r)}}var dc=null;function ph(e,t,r,n){if(dc=null,e=km(n),e=Zn(e),e!==null)if(t=_a(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Pj(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return dc=e,null}function Fj(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(eP()){case Am:return 1;case Ej:return 4;case cc:case tP:return 16;case Cj:return 536870912;default:return 16}default:return 16}}var un=null,Tm=null,Xl=null;function zj(){if(Xl)return Xl;var e,t=Tm,r=t.length,n,a="value"in un?un.value:un.textContent,i=a.length;for(e=0;e<r&&t[e]===a[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===a[i-n];n++);return Xl=a.slice(e,1<n?1-n:void 0)}function Ql(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function bl(){return!0}function Ug(){return!1}function Rt(e){function t(r,n,a,i,o){this._reactName=r,this._targetInst=a,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?bl:Ug,this.isPropagationStopped=Ug,this}return $e(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=bl)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=bl)},persist:function(){},isPersistent:bl}),t}var Yi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mm=Rt(Yi),el=$e({},Yi,{view:0,detail:0}),pP=Rt(el),Qf,Zf,go,Iu=$e({},el,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Im,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==go&&(go&&e.type==="mousemove"?(Qf=e.screenX-go.screenX,Zf=e.screenY-go.screenY):Zf=Qf=0,go=e),Qf)},movementY:function(e){return"movementY"in e?e.movementY:Zf}}),Wg=Rt(Iu),mP=$e({},Iu,{dataTransfer:0}),gP=Rt(mP),yP=$e({},el,{relatedTarget:0}),Jf=Rt(yP),vP=$e({},Yi,{animationName:0,elapsedTime:0,pseudoElement:0}),xP=Rt(vP),bP=$e({},Yi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jP=Rt(bP),wP=$e({},Yi,{data:0}),Hg=Rt(wP),SP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_P={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},NP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function OP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=NP[e])?!!t[e]:!1}function Im(){return OP}var PP=$e({},el,{key:function(e){if(e.key){var t=SP[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ql(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?_P[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Im,charCode:function(e){return e.type==="keypress"?Ql(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ql(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),kP=Rt(PP),AP=$e({},Iu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kg=Rt(AP),$P=$e({},el,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Im}),EP=Rt($P),CP=$e({},Yi,{propertyName:0,elapsedTime:0,pseudoElement:0}),TP=Rt(CP),MP=$e({},Iu,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),IP=Rt(MP),LP=[9,13,27,32],Lm=Ur&&"CompositionEvent"in window,Bo=null;Ur&&"documentMode"in document&&(Bo=document.documentMode);var DP=Ur&&"TextEvent"in window&&!Bo,Uj=Ur&&(!Lm||Bo&&8<Bo&&11>=Bo),Vg=" ",Gg=!1;function Wj(e,t){switch(e){case"keyup":return LP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hj(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fa=!1;function RP(e,t){switch(e){case"compositionend":return Hj(t);case"keypress":return t.which!==32?null:(Gg=!0,Vg);case"textInput":return e=t.data,e===Vg&&Gg?null:e;default:return null}}function BP(e,t){if(Fa)return e==="compositionend"||!Lm&&Wj(e,t)?(e=zj(),Xl=Tm=un=null,Fa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Uj&&t.locale!=="ko"?null:t.data;default:return null}}var FP={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Yg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!FP[e.type]:t==="textarea"}function Kj(e,t,r,n){wj(n),t=hc(t,"onChange"),0<t.length&&(r=new Mm("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Fo=null,as=null;function zP(e){rw(e,0)}function Lu(e){var t=Wa(e);if(mj(t))return e}function UP(e,t){if(e==="change")return t}var Vj=!1;if(Ur){var ed;if(Ur){var td="oninput"in document;if(!td){var qg=document.createElement("div");qg.setAttribute("oninput","return;"),td=typeof qg.oninput=="function"}ed=td}else ed=!1;Vj=ed&&(!document.documentMode||9<document.documentMode)}function Xg(){Fo&&(Fo.detachEvent("onpropertychange",Gj),as=Fo=null)}function Gj(e){if(e.propertyName==="value"&&Lu(as)){var t=[];Kj(t,as,e,km(e)),Oj(zP,t)}}function WP(e,t,r){e==="focusin"?(Xg(),Fo=t,as=r,Fo.attachEvent("onpropertychange",Gj)):e==="focusout"&&Xg()}function HP(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Lu(as)}function KP(e,t){if(e==="click")return Lu(t)}function VP(e,t){if(e==="input"||e==="change")return Lu(t)}function GP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fr=typeof Object.is=="function"?Object.is:GP;function is(e,t){if(fr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var a=r[n];if(!Xd.call(t,a)||!fr(e[a],t[a]))return!1}return!0}function Qg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zg(e,t){var r=Qg(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Qg(r)}}function Yj(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yj(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qj(){for(var e=window,t=oc();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=oc(e.document)}return t}function Dm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function YP(e){var t=qj(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Yj(r.ownerDocument.documentElement,r)){if(n!==null&&Dm(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=Zg(r,i);var o=Zg(r,n);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var qP=Ur&&"documentMode"in document&&11>=document.documentMode,za=null,mh=null,zo=null,gh=!1;function Jg(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;gh||za==null||za!==oc(n)||(n=za,"selectionStart"in n&&Dm(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),zo&&is(zo,n)||(zo=n,n=hc(mh,"onSelect"),0<n.length&&(t=new Mm("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=za)))}function jl(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Ua={animationend:jl("Animation","AnimationEnd"),animationiteration:jl("Animation","AnimationIteration"),animationstart:jl("Animation","AnimationStart"),transitionend:jl("Transition","TransitionEnd")},rd={},Xj={};Ur&&(Xj=document.createElement("div").style,"AnimationEvent"in window||(delete Ua.animationend.animation,delete Ua.animationiteration.animation,delete Ua.animationstart.animation),"TransitionEvent"in window||delete Ua.transitionend.transition);function Du(e){if(rd[e])return rd[e];if(!Ua[e])return e;var t=Ua[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Xj)return rd[e]=t[r];return e}var Qj=Du("animationend"),Zj=Du("animationiteration"),Jj=Du("animationstart"),ew=Du("transitionend"),tw=new Map,ey="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function kn(e,t){tw.set(e,t),Sa(t,[e])}for(var nd=0;nd<ey.length;nd++){var ad=ey[nd],XP=ad.toLowerCase(),QP=ad[0].toUpperCase()+ad.slice(1);kn(XP,"on"+QP)}kn(Qj,"onAnimationEnd");kn(Zj,"onAnimationIteration");kn(Jj,"onAnimationStart");kn("dblclick","onDoubleClick");kn("focusin","onFocus");kn("focusout","onBlur");kn(ew,"onTransitionEnd");di("onMouseEnter",["mouseout","mouseover"]);di("onMouseLeave",["mouseout","mouseover"]);di("onPointerEnter",["pointerout","pointerover"]);di("onPointerLeave",["pointerout","pointerover"]);Sa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Sa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Sa("onBeforeInput",["compositionend","keypress","textInput","paste"]);Sa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Sa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Sa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ZP=new Set("cancel close invalid load scroll toggle".split(" ").concat(Mo));function ty(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,X2(n,t,void 0,e),e.currentTarget=null}function rw(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],a=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var o=n.length-1;0<=o;o--){var l=n[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;ty(a,l,u),i=c}else for(o=0;o<n.length;o++){if(l=n[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;ty(a,l,u),i=c}}}if(lc)throw e=fh,lc=!1,fh=null,e}function be(e,t){var r=t[jh];r===void 0&&(r=t[jh]=new Set);var n=e+"__bubble";r.has(n)||(nw(t,e,2,!1),r.add(n))}function id(e,t,r){var n=0;t&&(n|=4),nw(r,e,n,t)}var wl="_reactListening"+Math.random().toString(36).slice(2);function os(e){if(!e[wl]){e[wl]=!0,uj.forEach(function(r){r!=="selectionchange"&&(ZP.has(r)||id(r,!1,e),id(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wl]||(t[wl]=!0,id("selectionchange",!1,t))}}function nw(e,t,r,n){switch(Fj(t)){case 1:var a=dP;break;case 4:a=hP;break;default:a=Cm}r=a.bind(null,t,r,e),a=void 0,!uh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),n?a!==void 0?e.addEventListener(t,r,{capture:!0,passive:a}):e.addEventListener(t,r,!0):a!==void 0?e.addEventListener(t,r,{passive:a}):e.addEventListener(t,r,!1)}function od(e,t,r,n,a){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=n.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=Zn(l),o===null)return;if(c=o.tag,c===5||c===6){n=i=o;continue e}l=l.parentNode}}n=n.return}Oj(function(){var u=i,d=km(r),f=[];e:{var h=tw.get(e);if(h!==void 0){var p=Mm,v=e;switch(e){case"keypress":if(Ql(r)===0)break e;case"keydown":case"keyup":p=kP;break;case"focusin":v="focus",p=Jf;break;case"focusout":v="blur",p=Jf;break;case"beforeblur":case"afterblur":p=Jf;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Wg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=gP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=EP;break;case Qj:case Zj:case Jj:p=xP;break;case ew:p=TP;break;case"scroll":p=pP;break;case"wheel":p=IP;break;case"copy":case"cut":case"paste":p=jP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Kg}var b=(t&4)!==0,x=!b&&e==="scroll",y=b?h!==null?h+"Capture":null:h;b=[];for(var m=u,g;m!==null;){g=m;var S=g.stateNode;if(g.tag===5&&S!==null&&(g=S,y!==null&&(S=es(m,y),S!=null&&b.push(ss(m,S,g)))),x)break;m=m.return}0<b.length&&(h=new p(h,v,null,r,d),f.push({event:h,listeners:b}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&r!==lh&&(v=r.relatedTarget||r.fromElement)&&(Zn(v)||v[Wr]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(v=r.relatedTarget||r.toElement,p=u,v=v?Zn(v):null,v!==null&&(x=_a(v),v!==x||v.tag!==5&&v.tag!==6)&&(v=null)):(p=null,v=u),p!==v)){if(b=Wg,S="onMouseLeave",y="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(b=Kg,S="onPointerLeave",y="onPointerEnter",m="pointer"),x=p==null?h:Wa(p),g=v==null?h:Wa(v),h=new b(S,m+"leave",p,r,d),h.target=x,h.relatedTarget=g,S=null,Zn(d)===u&&(b=new b(y,m+"enter",v,r,d),b.target=g,b.relatedTarget=x,S=b),x=S,p&&v)t:{for(b=p,y=v,m=0,g=b;g;g=Ca(g))m++;for(g=0,S=y;S;S=Ca(S))g++;for(;0<m-g;)b=Ca(b),m--;for(;0<g-m;)y=Ca(y),g--;for(;m--;){if(b===y||y!==null&&b===y.alternate)break t;b=Ca(b),y=Ca(y)}b=null}else b=null;p!==null&&ry(f,h,p,b,!1),v!==null&&x!==null&&ry(f,x,v,b,!0)}}e:{if(h=u?Wa(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var j=UP;else if(Yg(h))if(Vj)j=VP;else{j=HP;var w=WP}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=KP);if(j&&(j=j(e,u))){Kj(f,j,r,d);break e}w&&w(e,h,u),e==="focusout"&&(w=h._wrapperState)&&w.controlled&&h.type==="number"&&nh(h,"number",h.value)}switch(w=u?Wa(u):window,e){case"focusin":(Yg(w)||w.contentEditable==="true")&&(za=w,mh=u,zo=null);break;case"focusout":zo=mh=za=null;break;case"mousedown":gh=!0;break;case"contextmenu":case"mouseup":case"dragend":gh=!1,Jg(f,r,d);break;case"selectionchange":if(qP)break;case"keydown":case"keyup":Jg(f,r,d)}var _;if(Lm)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else Fa?Wj(e,r)&&(N="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(N="onCompositionStart");N&&(Uj&&r.locale!=="ko"&&(Fa||N!=="onCompositionStart"?N==="onCompositionEnd"&&Fa&&(_=zj()):(un=d,Tm="value"in un?un.value:un.textContent,Fa=!0)),w=hc(u,N),0<w.length&&(N=new Hg(N,e,null,r,d),f.push({event:N,listeners:w}),_?N.data=_:(_=Hj(r),_!==null&&(N.data=_)))),(_=DP?RP(e,r):BP(e,r))&&(u=hc(u,"onBeforeInput"),0<u.length&&(d=new Hg("onBeforeInput","beforeinput",null,r,d),f.push({event:d,listeners:u}),d.data=_))}rw(f,t)})}function ss(e,t,r){return{instance:e,listener:t,currentTarget:r}}function hc(e,t){for(var r=t+"Capture",n=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=es(e,r),i!=null&&n.unshift(ss(e,i,a)),i=es(e,t),i!=null&&n.push(ss(e,i,a))),e=e.return}return n}function Ca(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ry(e,t,r,n,a){for(var i=t._reactName,o=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,a?(c=es(r,i),c!=null&&o.unshift(ss(r,c,l))):a||(c=es(r,i),c!=null&&o.push(ss(r,c,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var JP=/\r\n?/g,ek=/\u0000|\uFFFD/g;function ny(e){return(typeof e=="string"?e:""+e).replace(JP,`
-`).replace(ek,"")}function Sl(e,t,r){if(t=ny(t),ny(e)!==t&&r)throw Error(H(425))}function pc(){}var yh=null,vh=null;function xh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var bh=typeof setTimeout=="function"?setTimeout:void 0,tk=typeof clearTimeout=="function"?clearTimeout:void 0,ay=typeof Promise=="function"?Promise:void 0,rk=typeof queueMicrotask=="function"?queueMicrotask:typeof ay<"u"?function(e){return ay.resolve(null).then(e).catch(nk)}:bh;function nk(e){setTimeout(function(){throw e})}function sd(e,t){var r=t,n=0;do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(n===0){e.removeChild(a),ns(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=a}while(r);ns(t)}function xn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function iy(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var qi=Math.random().toString(36).slice(2),gr="__reactFiber$"+qi,ls="__reactProps$"+qi,Wr="__reactContainer$"+qi,jh="__reactEvents$"+qi,ak="__reactListeners$"+qi,ik="__reactHandles$"+qi;function Zn(e){var t=e[gr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Wr]||r[gr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=iy(e);e!==null;){if(r=e[gr])return r;e=iy(e)}return t}e=r,r=e.parentNode}return null}function tl(e){return e=e[gr]||e[Wr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Wa(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function Ru(e){return e[ls]||null}var wh=[],Ha=-1;function An(e){return{current:e}}function Se(e){0>Ha||(e.current=wh[Ha],wh[Ha]=null,Ha--)}function ve(e,t){Ha++,wh[Ha]=e.current,e.current=t}var Pn={},ut=An(Pn),Nt=An(!1),fa=Pn;function hi(e,t){var r=e.type.contextTypes;if(!r)return Pn;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Ot(e){return e=e.childContextTypes,e!=null}function mc(){Se(Nt),Se(ut)}function oy(e,t,r){if(ut.current!==Pn)throw Error(H(168));ve(ut,t),ve(Nt,r)}function aw(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(H(108,W2(e)||"Unknown",a));return $e({},r,n)}function gc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Pn,fa=ut.current,ve(ut,e),ve(Nt,Nt.current),!0}function sy(e,t,r){var n=e.stateNode;if(!n)throw Error(H(169));r?(e=aw(e,t,fa),n.__reactInternalMemoizedMergedChildContext=e,Se(Nt),Se(ut),ve(ut,e)):Se(Nt),ve(Nt,r)}var Cr=null,Bu=!1,ld=!1;function iw(e){Cr===null?Cr=[e]:Cr.push(e)}function ok(e){Bu=!0,iw(e)}function $n(){if(!ld&&Cr!==null){ld=!0;var e=0,t=ue;try{var r=Cr;for(ue=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Cr=null,Bu=!1}catch(a){throw Cr!==null&&(Cr=Cr.slice(e+1)),$j(Am,$n),a}finally{ue=t,ld=!1}}return null}var Ka=[],Va=0,yc=null,vc=0,Wt=[],Ht=0,da=null,Tr=1,Mr="";function Vn(e,t){Ka[Va++]=vc,Ka[Va++]=yc,yc=e,vc=t}function ow(e,t,r){Wt[Ht++]=Tr,Wt[Ht++]=Mr,Wt[Ht++]=da,da=e;var n=Tr;e=Mr;var a=32-lr(n)-1;n&=~(1<<a),r+=1;var i=32-lr(t)+a;if(30<i){var o=a-a%5;i=(n&(1<<o)-1).toString(32),n>>=o,a-=o,Tr=1<<32-lr(t)+a|r<<a|n,Mr=i+e}else Tr=1<<i|r<<a|n,Mr=e}function Rm(e){e.return!==null&&(Vn(e,1),ow(e,1,0))}function Bm(e){for(;e===yc;)yc=Ka[--Va],Ka[Va]=null,vc=Ka[--Va],Ka[Va]=null;for(;e===da;)da=Wt[--Ht],Wt[Ht]=null,Mr=Wt[--Ht],Wt[Ht]=null,Tr=Wt[--Ht],Wt[Ht]=null}var Mt=null,Tt=null,Ne=!1,or=null;function sw(e,t){var r=Vt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function ly(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Mt=e,Tt=xn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Mt=e,Tt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=da!==null?{id:Tr,overflow:Mr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Vt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Mt=e,Tt=null,!0):!1;default:return!1}}function Sh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function _h(e){if(Ne){var t=Tt;if(t){var r=t;if(!ly(e,t)){if(Sh(e))throw Error(H(418));t=xn(r.nextSibling);var n=Mt;t&&ly(e,t)?sw(n,r):(e.flags=e.flags&-4097|2,Ne=!1,Mt=e)}}else{if(Sh(e))throw Error(H(418));e.flags=e.flags&-4097|2,Ne=!1,Mt=e}}}function cy(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Mt=e}function _l(e){if(e!==Mt)return!1;if(!Ne)return cy(e),Ne=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!xh(e.type,e.memoizedProps)),t&&(t=Tt)){if(Sh(e))throw lw(),Error(H(418));for(;t;)sw(e,t),t=xn(t.nextSibling)}if(cy(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Tt=xn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Tt=null}}else Tt=Mt?xn(e.stateNode.nextSibling):null;return!0}function lw(){for(var e=Tt;e;)e=xn(e.nextSibling)}function pi(){Tt=Mt=null,Ne=!1}function Fm(e){or===null?or=[e]:or.push(e)}var sk=qr.ReactCurrentBatchConfig;function yo(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(H(309));var n=r.stateNode}if(!n)throw Error(H(147,e));var a=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=a.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(H(284));if(!r._owner)throw Error(H(290,e))}return e}function Nl(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function uy(e){var t=e._init;return t(e._payload)}function cw(e){function t(y,m){if(e){var g=y.deletions;g===null?(y.deletions=[m],y.flags|=16):g.push(m)}}function r(y,m){if(!e)return null;for(;m!==null;)t(y,m),m=m.sibling;return null}function n(y,m){for(y=new Map;m!==null;)m.key!==null?y.set(m.key,m):y.set(m.index,m),m=m.sibling;return y}function a(y,m){return y=Sn(y,m),y.index=0,y.sibling=null,y}function i(y,m,g){return y.index=g,e?(g=y.alternate,g!==null?(g=g.index,g<m?(y.flags|=2,m):g):(y.flags|=2,m)):(y.flags|=1048576,m)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,m,g,S){return m===null||m.tag!==6?(m=md(g,y.mode,S),m.return=y,m):(m=a(m,g),m.return=y,m)}function c(y,m,g,S){var j=g.type;return j===Ba?d(y,m,g.props.children,S,g.key):m!==null&&(m.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===nn&&uy(j)===m.type)?(S=a(m,g.props),S.ref=yo(y,m,g),S.return=y,S):(S=ac(g.type,g.key,g.props,null,y.mode,S),S.ref=yo(y,m,g),S.return=y,S)}function u(y,m,g,S){return m===null||m.tag!==4||m.stateNode.containerInfo!==g.containerInfo||m.stateNode.implementation!==g.implementation?(m=gd(g,y.mode,S),m.return=y,m):(m=a(m,g.children||[]),m.return=y,m)}function d(y,m,g,S,j){return m===null||m.tag!==7?(m=la(g,y.mode,S,j),m.return=y,m):(m=a(m,g),m.return=y,m)}function f(y,m,g){if(typeof m=="string"&&m!==""||typeof m=="number")return m=md(""+m,y.mode,g),m.return=y,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case pl:return g=ac(m.type,m.key,m.props,null,y.mode,g),g.ref=yo(y,null,m),g.return=y,g;case Ra:return m=gd(m,y.mode,g),m.return=y,m;case nn:var S=m._init;return f(y,S(m._payload),g)}if(Co(m)||fo(m))return m=la(m,y.mode,g,null),m.return=y,m;Nl(y,m)}return null}function h(y,m,g,S){var j=m!==null?m.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return j!==null?null:l(y,m,""+g,S);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case pl:return g.key===j?c(y,m,g,S):null;case Ra:return g.key===j?u(y,m,g,S):null;case nn:return j=g._init,h(y,m,j(g._payload),S)}if(Co(g)||fo(g))return j!==null?null:d(y,m,g,S,null);Nl(y,g)}return null}function p(y,m,g,S,j){if(typeof S=="string"&&S!==""||typeof S=="number")return y=y.get(g)||null,l(m,y,""+S,j);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case pl:return y=y.get(S.key===null?g:S.key)||null,c(m,y,S,j);case Ra:return y=y.get(S.key===null?g:S.key)||null,u(m,y,S,j);case nn:var w=S._init;return p(y,m,g,w(S._payload),j)}if(Co(S)||fo(S))return y=y.get(g)||null,d(m,y,S,j,null);Nl(m,S)}return null}function v(y,m,g,S){for(var j=null,w=null,_=m,N=m=0,P=null;_!==null&&N<g.length;N++){_.index>N?(P=_,_=null):P=_.sibling;var k=h(y,_,g[N],S);if(k===null){_===null&&(_=P);break}e&&_&&k.alternate===null&&t(y,_),m=i(k,m,N),w===null?j=k:w.sibling=k,w=k,_=P}if(N===g.length)return r(y,_),Ne&&Vn(y,N),j;if(_===null){for(;N<g.length;N++)_=f(y,g[N],S),_!==null&&(m=i(_,m,N),w===null?j=_:w.sibling=_,w=_);return Ne&&Vn(y,N),j}for(_=n(y,_);N<g.length;N++)P=p(_,y,N,g[N],S),P!==null&&(e&&P.alternate!==null&&_.delete(P.key===null?N:P.key),m=i(P,m,N),w===null?j=P:w.sibling=P,w=P);return e&&_.forEach(function(T){return t(y,T)}),Ne&&Vn(y,N),j}function b(y,m,g,S){var j=fo(g);if(typeof j!="function")throw Error(H(150));if(g=j.call(g),g==null)throw Error(H(151));for(var w=j=null,_=m,N=m=0,P=null,k=g.next();_!==null&&!k.done;N++,k=g.next()){_.index>N?(P=_,_=null):P=_.sibling;var T=h(y,_,k.value,S);if(T===null){_===null&&(_=P);break}e&&_&&T.alternate===null&&t(y,_),m=i(T,m,N),w===null?j=T:w.sibling=T,w=T,_=P}if(k.done)return r(y,_),Ne&&Vn(y,N),j;if(_===null){for(;!k.done;N++,k=g.next())k=f(y,k.value,S),k!==null&&(m=i(k,m,N),w===null?j=k:w.sibling=k,w=k);return Ne&&Vn(y,N),j}for(_=n(y,_);!k.done;N++,k=g.next())k=p(_,y,N,k.value,S),k!==null&&(e&&k.alternate!==null&&_.delete(k.key===null?N:k.key),m=i(k,m,N),w===null?j=k:w.sibling=k,w=k);return e&&_.forEach(function(C){return t(y,C)}),Ne&&Vn(y,N),j}function x(y,m,g,S){if(typeof g=="object"&&g!==null&&g.type===Ba&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case pl:e:{for(var j=g.key,w=m;w!==null;){if(w.key===j){if(j=g.type,j===Ba){if(w.tag===7){r(y,w.sibling),m=a(w,g.props.children),m.return=y,y=m;break e}}else if(w.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===nn&&uy(j)===w.type){r(y,w.sibling),m=a(w,g.props),m.ref=yo(y,w,g),m.return=y,y=m;break e}r(y,w);break}else t(y,w);w=w.sibling}g.type===Ba?(m=la(g.props.children,y.mode,S,g.key),m.return=y,y=m):(S=ac(g.type,g.key,g.props,null,y.mode,S),S.ref=yo(y,m,g),S.return=y,y=S)}return o(y);case Ra:e:{for(w=g.key;m!==null;){if(m.key===w)if(m.tag===4&&m.stateNode.containerInfo===g.containerInfo&&m.stateNode.implementation===g.implementation){r(y,m.sibling),m=a(m,g.children||[]),m.return=y,y=m;break e}else{r(y,m);break}else t(y,m);m=m.sibling}m=gd(g,y.mode,S),m.return=y,y=m}return o(y);case nn:return w=g._init,x(y,m,w(g._payload),S)}if(Co(g))return v(y,m,g,S);if(fo(g))return b(y,m,g,S);Nl(y,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,m!==null&&m.tag===6?(r(y,m.sibling),m=a(m,g),m.return=y,y=m):(r(y,m),m=md(g,y.mode,S),m.return=y,y=m),o(y)):r(y,m)}return x}var mi=cw(!0),uw=cw(!1),xc=An(null),bc=null,Ga=null,zm=null;function Um(){zm=Ga=bc=null}function Wm(e){var t=xc.current;Se(xc),e._currentValue=t}function Nh(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function ii(e,t){bc=e,zm=Ga=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(St=!0),e.firstContext=null)}function Xt(e){var t=e._currentValue;if(zm!==e)if(e={context:e,memoizedValue:t,next:null},Ga===null){if(bc===null)throw Error(H(308));Ga=e,bc.dependencies={lanes:0,firstContext:e}}else Ga=Ga.next=e;return t}var Jn=null;function Hm(e){Jn===null?Jn=[e]:Jn.push(e)}function fw(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,Hm(t)):(r.next=a.next,a.next=r),t.interleaved=r,Hr(e,n)}function Hr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var an=!1;function Km(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function dw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Rr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function bn(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,se&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,Hr(e,r)}return a=n.interleaved,a===null?(t.next=t,Hm(n)):(t.next=a.next,a.next=t),n.interleaved=t,Hr(e,r)}function Zl(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,$m(e,r)}}function fy(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?a=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?a=i=t:i=i.next=t}else a=i=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function jc(e,t,r,n){var a=e.updateQueue;an=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=a.baseState;o=0,d=u=c=null,l=i;do{var h=l.lane,p=l.eventTime;if((n&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,b=l;switch(h=t,p=r,b.tag){case 1:if(v=b.payload,typeof v=="function"){f=v.call(p,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=b.payload,h=typeof v=="function"?v.call(p,f,h):v,h==null)break e;f=$e({},f,h);break e;case 2:an=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=a.effects,h===null?a.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,o|=h;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;h=l,l=h.next,h.next=null,a.lastBaseUpdate=h,a.shared.pending=null}}while(!0);if(d===null&&(c=f),a.baseState=c,a.firstBaseUpdate=u,a.lastBaseUpdate=d,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);pa|=o,e.lanes=o,e.memoizedState=f}}function dy(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],a=n.callback;if(a!==null){if(n.callback=null,n=r,typeof a!="function")throw Error(H(191,a));a.call(n)}}}var rl={},br=An(rl),cs=An(rl),us=An(rl);function ea(e){if(e===rl)throw Error(H(174));return e}function Vm(e,t){switch(ve(us,t),ve(cs,e),ve(br,rl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ih(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ih(t,e)}Se(br),ve(br,t)}function gi(){Se(br),Se(cs),Se(us)}function hw(e){ea(us.current);var t=ea(br.current),r=ih(t,e.type);t!==r&&(ve(cs,e),ve(br,r))}function Gm(e){cs.current===e&&(Se(br),Se(cs))}var ke=An(0);function wc(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var cd=[];function Ym(){for(var e=0;e<cd.length;e++)cd[e]._workInProgressVersionPrimary=null;cd.length=0}var Jl=qr.ReactCurrentDispatcher,ud=qr.ReactCurrentBatchConfig,ha=0,Ae=null,He=null,Xe=null,Sc=!1,Uo=!1,fs=0,lk=0;function it(){throw Error(H(321))}function qm(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!fr(e[r],t[r]))return!1;return!0}function Xm(e,t,r,n,a,i){if(ha=i,Ae=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Jl.current=e===null||e.memoizedState===null?dk:hk,e=r(n,a),Uo){i=0;do{if(Uo=!1,fs=0,25<=i)throw Error(H(301));i+=1,Xe=He=null,t.updateQueue=null,Jl.current=pk,e=r(n,a)}while(Uo)}if(Jl.current=_c,t=He!==null&&He.next!==null,ha=0,Xe=He=Ae=null,Sc=!1,t)throw Error(H(300));return e}function Qm(){var e=fs!==0;return fs=0,e}function mr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?Ae.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Qt(){if(He===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var t=Xe===null?Ae.memoizedState:Xe.next;if(t!==null)Xe=t,He=e;else{if(e===null)throw Error(H(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},Xe===null?Ae.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function ds(e,t){return typeof t=="function"?t(e):t}function fd(e){var t=Qt(),r=t.queue;if(r===null)throw Error(H(311));r.lastRenderedReducer=e;var n=He,a=n.baseQueue,i=r.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}n.baseQueue=a=i,r.pending=null}if(a!==null){i=a.next,n=n.baseState;var l=o=null,c=null,u=i;do{var d=u.lane;if((ha&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,o=n):c=c.next=f,Ae.lanes|=d,pa|=d}u=u.next}while(u!==null&&u!==i);c===null?o=n:c.next=l,fr(n,t.memoizedState)||(St=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){a=e;do i=a.lane,Ae.lanes|=i,pa|=i,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function dd(e){var t=Qt(),r=t.queue;if(r===null)throw Error(H(311));r.lastRenderedReducer=e;var n=r.dispatch,a=r.pending,i=t.memoizedState;if(a!==null){r.pending=null;var o=a=a.next;do i=e(i,o.action),o=o.next;while(o!==a);fr(i,t.memoizedState)||(St=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function pw(){}function mw(e,t){var r=Ae,n=Qt(),a=t(),i=!fr(n.memoizedState,a);if(i&&(n.memoizedState=a,St=!0),n=n.queue,Zm(vw.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||Xe!==null&&Xe.memoizedState.tag&1){if(r.flags|=2048,hs(9,yw.bind(null,r,n,a,t),void 0,null),Ze===null)throw Error(H(349));ha&30||gw(r,t,a)}return a}function gw(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ae.updateQueue,t===null?(t={lastEffect:null,stores:null},Ae.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function yw(e,t,r,n){t.value=r,t.getSnapshot=n,xw(t)&&bw(e)}function vw(e,t,r){return r(function(){xw(t)&&bw(e)})}function xw(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!fr(e,r)}catch{return!0}}function bw(e){var t=Hr(e,1);t!==null&&cr(t,e,1,-1)}function hy(e){var t=mr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:e},t.queue=e,e=e.dispatch=fk.bind(null,Ae,e),[t.memoizedState,e]}function hs(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Ae.updateQueue,t===null?(t={lastEffect:null,stores:null},Ae.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function jw(){return Qt().memoizedState}function ec(e,t,r,n){var a=mr();Ae.flags|=e,a.memoizedState=hs(1|t,r,void 0,n===void 0?null:n)}function Fu(e,t,r,n){var a=Qt();n=n===void 0?null:n;var i=void 0;if(He!==null){var o=He.memoizedState;if(i=o.destroy,n!==null&&qm(n,o.deps)){a.memoizedState=hs(t,r,i,n);return}}Ae.flags|=e,a.memoizedState=hs(1|t,r,i,n)}function py(e,t){return ec(8390656,8,e,t)}function Zm(e,t){return Fu(2048,8,e,t)}function ww(e,t){return Fu(4,2,e,t)}function Sw(e,t){return Fu(4,4,e,t)}function _w(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Nw(e,t,r){return r=r!=null?r.concat([e]):null,Fu(4,4,_w.bind(null,t,e),r)}function Jm(){}function Ow(e,t){var r=Qt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&qm(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Pw(e,t){var r=Qt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&qm(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function kw(e,t,r){return ha&21?(fr(r,t)||(r=Tj(),Ae.lanes|=r,pa|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,St=!0),e.memoizedState=r)}function ck(e,t){var r=ue;ue=r!==0&&4>r?r:4,e(!0);var n=ud.transition;ud.transition={};try{e(!1),t()}finally{ue=r,ud.transition=n}}function Aw(){return Qt().memoizedState}function uk(e,t,r){var n=wn(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},$w(e))Ew(t,r);else if(r=fw(e,t,r,n),r!==null){var a=mt();cr(r,e,n,a),Cw(r,t,n)}}function fk(e,t,r){var n=wn(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if($w(e))Ew(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,r);if(a.hasEagerState=!0,a.eagerState=l,fr(l,o)){var c=t.interleaved;c===null?(a.next=a,Hm(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}r=fw(e,t,a,n),r!==null&&(a=mt(),cr(r,e,n,a),Cw(r,t,n))}}function $w(e){var t=e.alternate;return e===Ae||t!==null&&t===Ae}function Ew(e,t){Uo=Sc=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Cw(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,$m(e,r)}}var _c={readContext:Xt,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useInsertionEffect:it,useLayoutEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useMutableSource:it,useSyncExternalStore:it,useId:it,unstable_isNewReconciler:!1},dk={readContext:Xt,useCallback:function(e,t){return mr().memoizedState=[e,t===void 0?null:t],e},useContext:Xt,useEffect:py,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ec(4194308,4,_w.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ec(4194308,4,e,t)},useInsertionEffect:function(e,t){return ec(4,2,e,t)},useMemo:function(e,t){var r=mr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=mr();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=uk.bind(null,Ae,e),[n.memoizedState,e]},useRef:function(e){var t=mr();return e={current:e},t.memoizedState=e},useState:hy,useDebugValue:Jm,useDeferredValue:function(e){return mr().memoizedState=e},useTransition:function(){var e=hy(!1),t=e[0];return e=ck.bind(null,e[1]),mr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ae,a=mr();if(Ne){if(r===void 0)throw Error(H(407));r=r()}else{if(r=t(),Ze===null)throw Error(H(349));ha&30||gw(n,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,py(vw.bind(null,n,i,e),[e]),n.flags|=2048,hs(9,yw.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=mr(),t=Ze.identifierPrefix;if(Ne){var r=Mr,n=Tr;r=(n&~(1<<32-lr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=fs++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=lk++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},hk={readContext:Xt,useCallback:Ow,useContext:Xt,useEffect:Zm,useImperativeHandle:Nw,useInsertionEffect:ww,useLayoutEffect:Sw,useMemo:Pw,useReducer:fd,useRef:jw,useState:function(){return fd(ds)},useDebugValue:Jm,useDeferredValue:function(e){var t=Qt();return kw(t,He.memoizedState,e)},useTransition:function(){var e=fd(ds)[0],t=Qt().memoizedState;return[e,t]},useMutableSource:pw,useSyncExternalStore:mw,useId:Aw,unstable_isNewReconciler:!1},pk={readContext:Xt,useCallback:Ow,useContext:Xt,useEffect:Zm,useImperativeHandle:Nw,useInsertionEffect:ww,useLayoutEffect:Sw,useMemo:Pw,useReducer:dd,useRef:jw,useState:function(){return dd(ds)},useDebugValue:Jm,useDeferredValue:function(e){var t=Qt();return He===null?t.memoizedState=e:kw(t,He.memoizedState,e)},useTransition:function(){var e=dd(ds)[0],t=Qt().memoizedState;return[e,t]},useMutableSource:pw,useSyncExternalStore:mw,useId:Aw,unstable_isNewReconciler:!1};function nr(e,t){if(e&&e.defaultProps){t=$e({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Oh(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:$e({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var zu={isMounted:function(e){return(e=e._reactInternals)?_a(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=mt(),a=wn(e),i=Rr(n,a);i.payload=t,r!=null&&(i.callback=r),t=bn(e,i,a),t!==null&&(cr(t,e,a,n),Zl(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=mt(),a=wn(e),i=Rr(n,a);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=bn(e,i,a),t!==null&&(cr(t,e,a,n),Zl(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=mt(),n=wn(e),a=Rr(r,n);a.tag=2,t!=null&&(a.callback=t),t=bn(e,a,n),t!==null&&(cr(t,e,n,r),Zl(t,e,n))}};function my(e,t,r,n,a,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,o):t.prototype&&t.prototype.isPureReactComponent?!is(r,n)||!is(a,i):!0}function Tw(e,t,r){var n=!1,a=Pn,i=t.contextType;return typeof i=="object"&&i!==null?i=Xt(i):(a=Ot(t)?fa:ut.current,n=t.contextTypes,i=(n=n!=null)?hi(e,a):Pn),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=zu,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function gy(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&zu.enqueueReplaceState(t,t.state,null)}function Ph(e,t,r,n){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},Km(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=Xt(i):(i=Ot(t)?fa:ut.current,a.context=hi(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Oh(e,t,i,r),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&zu.enqueueReplaceState(a,a.state,null),jc(e,r,a,n),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function yi(e,t){try{var r="",n=t;do r+=U2(n),n=n.return;while(n);var a=r}catch(i){a=`
-Error generating stack: `+i.message+`
-`+i.stack}return{value:e,source:t,stack:a,digest:null}}function hd(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function kh(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var mk=typeof WeakMap=="function"?WeakMap:Map;function Mw(e,t,r){r=Rr(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Oc||(Oc=!0,Rh=n),kh(e,t)},r}function Iw(e,t,r){r=Rr(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var a=t.value;r.payload=function(){return n(a)},r.callback=function(){kh(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){kh(e,t),typeof n!="function"&&(jn===null?jn=new Set([this]):jn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function yy(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new mk;var a=new Set;n.set(t,a)}else a=n.get(t),a===void 0&&(a=new Set,n.set(t,a));a.has(r)||(a.add(r),e=Ak.bind(null,e,t,r),t.then(e,e))}function vy(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function xy(e,t,r,n,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Rr(-1,1),t.tag=2,bn(r,t,1))),r.lanes|=1),e)}var gk=qr.ReactCurrentOwner,St=!1;function ft(e,t,r,n){t.child=e===null?uw(t,null,r,n):mi(t,e.child,r,n)}function by(e,t,r,n,a){r=r.render;var i=t.ref;return ii(t,a),n=Xm(e,t,r,n,i,a),r=Qm(),e!==null&&!St?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Kr(e,t,a)):(Ne&&r&&Rm(t),t.flags|=1,ft(e,t,n,a),t.child)}function jy(e,t,r,n,a){if(e===null){var i=r.type;return typeof i=="function"&&!s0(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,Lw(e,t,i,n,a)):(e=ac(r.type,null,n,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var o=i.memoizedProps;if(r=r.compare,r=r!==null?r:is,r(o,n)&&e.ref===t.ref)return Kr(e,t,a)}return t.flags|=1,e=Sn(i,n),e.ref=t.ref,e.return=t,t.child=e}function Lw(e,t,r,n,a){if(e!==null){var i=e.memoizedProps;if(is(i,n)&&e.ref===t.ref)if(St=!1,t.pendingProps=n=i,(e.lanes&a)!==0)e.flags&131072&&(St=!0);else return t.lanes=e.lanes,Kr(e,t,a)}return Ah(e,t,r,n,a)}function Dw(e,t,r){var n=t.pendingProps,a=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ve(qa,$t),$t|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ve(qa,$t),$t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,ve(qa,$t),$t|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,ve(qa,$t),$t|=n;return ft(e,t,a,r),t.child}function Rw(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Ah(e,t,r,n,a){var i=Ot(r)?fa:ut.current;return i=hi(t,i),ii(t,a),r=Xm(e,t,r,n,i,a),n=Qm(),e!==null&&!St?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Kr(e,t,a)):(Ne&&n&&Rm(t),t.flags|=1,ft(e,t,r,a),t.child)}function wy(e,t,r,n,a){if(Ot(r)){var i=!0;gc(t)}else i=!1;if(ii(t,a),t.stateNode===null)tc(e,t),Tw(t,r,n),Ph(t,r,n,a),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=Xt(u):(u=Ot(r)?fa:ut.current,u=hi(t,u));var d=r.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||c!==u)&&gy(t,o,n,u),an=!1;var h=t.memoizedState;o.state=h,jc(t,n,o,a),c=t.memoizedState,l!==n||h!==c||Nt.current||an?(typeof d=="function"&&(Oh(t,r,d,n),c=t.memoizedState),(l=an||my(t,r,l,n,h,c,u))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),o.props=n,o.state=c,o.context=u,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,dw(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:nr(t.type,l),o.props=u,f=t.pendingProps,h=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=Xt(c):(c=Ot(r)?fa:ut.current,c=hi(t,c));var p=r.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==f||h!==c)&&gy(t,o,n,c),an=!1,h=t.memoizedState,o.state=h,jc(t,n,o,a);var v=t.memoizedState;l!==f||h!==v||Nt.current||an?(typeof p=="function"&&(Oh(t,r,p,n),v=t.memoizedState),(u=an||my(t,r,u,n,h,v,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,v,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,v,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=v),o.props=n,o.state=v,o.context=c,n=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return $h(e,t,r,n,i,a)}function $h(e,t,r,n,a,i){Rw(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return a&&sy(t,r,!1),Kr(e,t,i);n=t.stateNode,gk.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=mi(t,e.child,null,i),t.child=mi(t,null,l,i)):ft(e,t,l,i),t.memoizedState=n.state,a&&sy(t,r,!0),t.child}function Bw(e){var t=e.stateNode;t.pendingContext?oy(e,t.pendingContext,t.pendingContext!==t.context):t.context&&oy(e,t.context,!1),Vm(e,t.containerInfo)}function Sy(e,t,r,n,a){return pi(),Fm(a),t.flags|=256,ft(e,t,r,n),t.child}var Eh={dehydrated:null,treeContext:null,retryLane:0};function Ch(e){return{baseLanes:e,cachePool:null,transitions:null}}function Fw(e,t,r){var n=t.pendingProps,a=ke.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),ve(ke,a&1),e===null)return _h(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,i?(n=t.mode,i=t.child,o={mode:"hidden",children:o},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Hu(o,n,0,null),e=la(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Ch(r),t.memoizedState=Eh,e):e0(t,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return yk(e,t,o,n,l,a,r);if(i){i=n.fallback,o=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&t.child!==a?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=Sn(a,c),n.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=Sn(l,i):(i=la(i,o,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,o=e.child.memoizedState,o=o===null?Ch(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~r,t.memoizedState=Eh,n}return i=e.child,e=i.sibling,n=Sn(i,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function e0(e,t){return t=Hu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ol(e,t,r,n){return n!==null&&Fm(n),mi(t,e.child,null,r),e=e0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yk(e,t,r,n,a,i,o){if(r)return t.flags&256?(t.flags&=-257,n=hd(Error(H(422))),Ol(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,a=t.mode,n=Hu({mode:"visible",children:n.children},a,0,null),i=la(i,a,o,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&mi(t,e.child,null,o),t.child.memoizedState=Ch(o),t.memoizedState=Eh,i);if(!(t.mode&1))return Ol(e,t,o,null);if(a.data==="$!"){if(n=a.nextSibling&&a.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(H(419)),n=hd(i,n,void 0),Ol(e,t,o,n)}if(l=(o&e.childLanes)!==0,St||l){if(n=Ze,n!==null){switch(o&-o){case 4:a=2;break;case 16:a=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(n.suspendedLanes|o)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Hr(e,a),cr(n,e,a,-1))}return o0(),n=hd(Error(H(421))),Ol(e,t,o,n)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=$k.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,Tt=xn(a.nextSibling),Mt=t,Ne=!0,or=null,e!==null&&(Wt[Ht++]=Tr,Wt[Ht++]=Mr,Wt[Ht++]=da,Tr=e.id,Mr=e.overflow,da=t),t=e0(t,n.children),t.flags|=4096,t)}function _y(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Nh(e.return,t,r)}function pd(e,t,r,n,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=a)}function zw(e,t,r){var n=t.pendingProps,a=n.revealOrder,i=n.tail;if(ft(e,t,n.children,r),n=ke.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_y(e,r,t);else if(e.tag===19)_y(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(ve(ke,n),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&wc(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),pd(t,!1,a,r,i);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&wc(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}pd(t,!0,r,null,i);break;case"together":pd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function tc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Kr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),pa|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,r=Sn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Sn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function vk(e,t,r){switch(t.tag){case 3:Bw(t),pi();break;case 5:hw(t);break;case 1:Ot(t.type)&&gc(t);break;case 4:Vm(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,a=t.memoizedProps.value;ve(xc,n._currentValue),n._currentValue=a;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(ve(ke,ke.current&1),t.flags|=128,null):r&t.child.childLanes?Fw(e,t,r):(ve(ke,ke.current&1),e=Kr(e,t,r),e!==null?e.sibling:null);ve(ke,ke.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return zw(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ve(ke,ke.current),n)break;return null;case 22:case 23:return t.lanes=0,Dw(e,t,r)}return Kr(e,t,r)}var Uw,Th,Ww,Hw;Uw=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Th=function(){};Ww=function(e,t,r,n){var a=e.memoizedProps;if(a!==n){e=t.stateNode,ea(br.current);var i=null;switch(r){case"input":a=th(e,a),n=th(e,n),i=[];break;case"select":a=$e({},a,{value:void 0}),n=$e({},n,{value:void 0}),i=[];break;case"textarea":a=ah(e,a),n=ah(e,n),i=[];break;default:typeof a.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=pc)}oh(r,n);var o;r=null;for(u in a)if(!n.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var l=a[u];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Zo.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(l=a!=null?a[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Zo.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&be("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Hw=function(e,t,r,n){r!==n&&(t.flags|=4)};function vo(e,t){if(!Ne)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags&14680064,n|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function xk(e,t,r){var n=t.pendingProps;switch(Bm(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(t),null;case 1:return Ot(t.type)&&mc(),ot(t),null;case 3:return n=t.stateNode,gi(),Se(Nt),Se(ut),Ym(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(_l(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,or!==null&&(zh(or),or=null))),Th(e,t),ot(t),null;case 5:Gm(t);var a=ea(us.current);if(r=t.type,e!==null&&t.stateNode!=null)Ww(e,t,r,n,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(H(166));return ot(t),null}if(e=ea(br.current),_l(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[gr]=t,n[ls]=i,e=(t.mode&1)!==0,r){case"dialog":be("cancel",n),be("close",n);break;case"iframe":case"object":case"embed":be("load",n);break;case"video":case"audio":for(a=0;a<Mo.length;a++)be(Mo[a],n);break;case"source":be("error",n);break;case"img":case"image":case"link":be("error",n),be("load",n);break;case"details":be("toggle",n);break;case"input":Tg(n,i),be("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},be("invalid",n);break;case"textarea":Ig(n,i),be("invalid",n)}oh(r,i),a=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&Sl(n.textContent,l,e),a=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Sl(n.textContent,l,e),a=["children",""+l]):Zo.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&be("scroll",n)}switch(r){case"input":ml(n),Mg(n,i,!0);break;case"textarea":ml(n),Lg(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=pc)}n=a,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=vj(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[gr]=t,e[ls]=n,Uw(e,t,!1,!1),t.stateNode=e;e:{switch(o=sh(r,n),r){case"dialog":be("cancel",e),be("close",e),a=n;break;case"iframe":case"object":case"embed":be("load",e),a=n;break;case"video":case"audio":for(a=0;a<Mo.length;a++)be(Mo[a],e);a=n;break;case"source":be("error",e),a=n;break;case"img":case"image":case"link":be("error",e),be("load",e),a=n;break;case"details":be("toggle",e),a=n;break;case"input":Tg(e,n),a=th(e,n),be("invalid",e);break;case"option":a=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},a=$e({},n,{value:void 0}),be("invalid",e);break;case"textarea":Ig(e,n),a=ah(e,n),be("invalid",e);break;default:a=n}oh(r,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?jj(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&xj(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Jo(e,c):typeof c=="number"&&Jo(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Zo.hasOwnProperty(i)?c!=null&&i==="onScroll"&&be("scroll",e):c!=null&&_m(e,i,c,o))}switch(r){case"input":ml(e),Mg(e,n,!1);break;case"textarea":ml(e),Lg(e);break;case"option":n.value!=null&&e.setAttribute("value",""+On(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?ti(e,!!n.multiple,i,!1):n.defaultValue!=null&&ti(e,!!n.multiple,n.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=pc)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ot(t),null;case 6:if(e&&t.stateNode!=null)Hw(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(H(166));if(r=ea(us.current),ea(br.current),_l(t)){if(n=t.stateNode,r=t.memoizedProps,n[gr]=t,(i=n.nodeValue!==r)&&(e=Mt,e!==null))switch(e.tag){case 3:Sl(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Sl(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[gr]=t,t.stateNode=n}return ot(t),null;case 13:if(Se(ke),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ne&&Tt!==null&&t.mode&1&&!(t.flags&128))lw(),pi(),t.flags|=98560,i=!1;else if(i=_l(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(H(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[gr]=t}else pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ot(t),i=!1}else or!==null&&(zh(or),or=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||ke.current&1?Ve===0&&(Ve=3):o0())),t.updateQueue!==null&&(t.flags|=4),ot(t),null);case 4:return gi(),Th(e,t),e===null&&os(t.stateNode.containerInfo),ot(t),null;case 10:return Wm(t.type._context),ot(t),null;case 17:return Ot(t.type)&&mc(),ot(t),null;case 19:if(Se(ke),i=t.memoizedState,i===null)return ot(t),null;if(n=(t.flags&128)!==0,o=i.rendering,o===null)if(n)vo(i,!1);else{if(Ve!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=wc(e),o!==null){for(t.flags|=128,vo(i,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ve(ke,ke.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ie()>vi&&(t.flags|=128,n=!0,vo(i,!1),t.lanes=4194304)}else{if(!n)if(e=wc(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),vo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ne)return ot(t),null}else 2*Ie()-i.renderingStartTime>vi&&r!==1073741824&&(t.flags|=128,n=!0,vo(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(r=i.last,r!==null?r.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ie(),t.sibling=null,r=ke.current,ve(ke,n?r&1|2:r&1),t):(ot(t),null);case 22:case 23:return i0(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?$t&1073741824&&(ot(t),t.subtreeFlags&6&&(t.flags|=8192)):ot(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function bk(e,t){switch(Bm(t),t.tag){case 1:return Ot(t.type)&&mc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return gi(),Se(Nt),Se(ut),Ym(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Gm(t),null;case 13:if(Se(ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Se(ke),null;case 4:return gi(),null;case 10:return Wm(t.type._context),null;case 22:case 23:return i0(),null;case 24:return null;default:return null}}var Pl=!1,lt=!1,jk=typeof WeakSet=="function"?WeakSet:Set,G=null;function Ya(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ce(e,t,n)}else r.current=null}function Mh(e,t,r){try{r()}catch(n){Ce(e,t,n)}}var Ny=!1;function wk(e,t){if(yh=fc,e=qj(),Dm(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==r||a!==0&&f.nodeType!==3||(l=o+a),f!==i||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===r&&++u===a&&(l=o),h===i&&++d===n&&(c=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(vh={focusedElem:e,selectionRange:r},fc=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var b=v.memoizedProps,x=v.memoizedState,y=t.stateNode,m=y.getSnapshotBeforeUpdate(t.elementType===t.type?b:nr(t.type,b),x);y.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(S){Ce(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return v=Ny,Ny=!1,v}function Wo(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&Mh(t,r,i)}a=a.next}while(a!==n)}}function Uu(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Ih(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Kw(e){var t=e.alternate;t!==null&&(e.alternate=null,Kw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[gr],delete t[ls],delete t[jh],delete t[ak],delete t[ik])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Vw(e){return e.tag===5||e.tag===3||e.tag===4}function Oy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Lh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=pc));else if(n!==4&&(e=e.child,e!==null))for(Lh(e,t,r),e=e.sibling;e!==null;)Lh(e,t,r),e=e.sibling}function Dh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Dh(e,t,r),e=e.sibling;e!==null;)Dh(e,t,r),e=e.sibling}var rt=null,ar=!1;function tn(e,t,r){for(r=r.child;r!==null;)Gw(e,t,r),r=r.sibling}function Gw(e,t,r){if(xr&&typeof xr.onCommitFiberUnmount=="function")try{xr.onCommitFiberUnmount(Mu,r)}catch{}switch(r.tag){case 5:lt||Ya(r,t);case 6:var n=rt,a=ar;rt=null,tn(e,t,r),rt=n,ar=a,rt!==null&&(ar?(e=rt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):rt.removeChild(r.stateNode));break;case 18:rt!==null&&(ar?(e=rt,r=r.stateNode,e.nodeType===8?sd(e.parentNode,r):e.nodeType===1&&sd(e,r),ns(e)):sd(rt,r.stateNode));break;case 4:n=rt,a=ar,rt=r.stateNode.containerInfo,ar=!0,tn(e,t,r),rt=n,ar=a;break;case 0:case 11:case 14:case 15:if(!lt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Mh(r,t,o),a=a.next}while(a!==n)}tn(e,t,r);break;case 1:if(!lt&&(Ya(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Ce(r,t,l)}tn(e,t,r);break;case 21:tn(e,t,r);break;case 22:r.mode&1?(lt=(n=lt)||r.memoizedState!==null,tn(e,t,r),lt=n):tn(e,t,r);break;default:tn(e,t,r)}}function Py(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new jk),t.forEach(function(n){var a=Ek.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function tr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var a=r[n];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:rt=l.stateNode,ar=!1;break e;case 3:rt=l.stateNode.containerInfo,ar=!0;break e;case 4:rt=l.stateNode.containerInfo,ar=!0;break e}l=l.return}if(rt===null)throw Error(H(160));Gw(i,o,a),rt=null,ar=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(u){Ce(a,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Yw(t,e),t=t.sibling}function Yw(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(tr(t,e),hr(e),n&4){try{Wo(3,e,e.return),Uu(3,e)}catch(b){Ce(e,e.return,b)}try{Wo(5,e,e.return)}catch(b){Ce(e,e.return,b)}}break;case 1:tr(t,e),hr(e),n&512&&r!==null&&Ya(r,r.return);break;case 5:if(tr(t,e),hr(e),n&512&&r!==null&&Ya(r,r.return),e.flags&32){var a=e.stateNode;try{Jo(a,"")}catch(b){Ce(e,e.return,b)}}if(n&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,o=r!==null?r.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&gj(a,i),sh(l,o);var u=sh(l,i);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];d==="style"?jj(a,f):d==="dangerouslySetInnerHTML"?xj(a,f):d==="children"?Jo(a,f):_m(a,d,f,u)}switch(l){case"input":rh(a,i);break;case"textarea":yj(a,i);break;case"select":var h=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?ti(a,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?ti(a,!!i.multiple,i.defaultValue,!0):ti(a,!!i.multiple,i.multiple?[]:"",!1))}a[ls]=i}catch(b){Ce(e,e.return,b)}}break;case 6:if(tr(t,e),hr(e),n&4){if(e.stateNode===null)throw Error(H(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(b){Ce(e,e.return,b)}}break;case 3:if(tr(t,e),hr(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{ns(t.containerInfo)}catch(b){Ce(e,e.return,b)}break;case 4:tr(t,e),hr(e);break;case 13:tr(t,e),hr(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(n0=Ie())),n&4&&Py(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(lt=(u=lt)||d,tr(t,e),lt=u):tr(t,e),hr(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(G=e,d=e.child;d!==null;){for(f=G=d;G!==null;){switch(h=G,p=h.child,h.tag){case 0:case 11:case 14:case 15:Wo(4,h,h.return);break;case 1:Ya(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(b){Ce(n,r,b)}}break;case 5:Ya(h,h.return);break;case 22:if(h.memoizedState!==null){Ay(f);continue}}p!==null?(p.return=h,G=p):Ay(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=bj("display",o))}catch(b){Ce(e,e.return,b)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(b){Ce(e,e.return,b)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:tr(t,e),hr(e),n&4&&Py(e);break;case 21:break;default:tr(t,e),hr(e)}}function hr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Vw(r)){var n=r;break e}r=r.return}throw Error(H(160))}switch(n.tag){case 5:var a=n.stateNode;n.flags&32&&(Jo(a,""),n.flags&=-33);var i=Oy(e);Dh(e,i,a);break;case 3:case 4:var o=n.stateNode.containerInfo,l=Oy(e);Lh(e,l,o);break;default:throw Error(H(161))}}catch(c){Ce(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sk(e,t,r){G=e,qw(e)}function qw(e,t,r){for(var n=(e.mode&1)!==0;G!==null;){var a=G,i=a.child;if(a.tag===22&&n){var o=a.memoizedState!==null||Pl;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||lt;l=Pl;var u=lt;if(Pl=o,(lt=c)&&!u)for(G=a;G!==null;)o=G,c=o.child,o.tag===22&&o.memoizedState!==null?$y(a):c!==null?(c.return=o,G=c):$y(a);for(;i!==null;)G=i,qw(i),i=i.sibling;G=a,Pl=l,lt=u}ky(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,G=i):ky(e)}}function ky(e){for(;G!==null;){var t=G;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:lt||Uu(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!lt)if(r===null)n.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:nr(t.type,r.memoizedProps);n.componentDidUpdate(a,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&dy(t,i,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}dy(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&ns(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}lt||t.flags&512&&Ih(t)}catch(h){Ce(t,t.return,h)}}if(t===e){G=null;break}if(r=t.sibling,r!==null){r.return=t.return,G=r;break}G=t.return}}function Ay(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var r=t.sibling;if(r!==null){r.return=t.return,G=r;break}G=t.return}}function $y(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Uu(4,t)}catch(c){Ce(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var a=t.return;try{n.componentDidMount()}catch(c){Ce(t,a,c)}}var i=t.return;try{Ih(t)}catch(c){Ce(t,i,c)}break;case 5:var o=t.return;try{Ih(t)}catch(c){Ce(t,o,c)}}}catch(c){Ce(t,t.return,c)}if(t===e){G=null;break}var l=t.sibling;if(l!==null){l.return=t.return,G=l;break}G=t.return}}var _k=Math.ceil,Nc=qr.ReactCurrentDispatcher,t0=qr.ReactCurrentOwner,Yt=qr.ReactCurrentBatchConfig,se=0,Ze=null,De=null,nt=0,$t=0,qa=An(0),Ve=0,ps=null,pa=0,Wu=0,r0=0,Ho=null,jt=null,n0=0,vi=1/0,$r=null,Oc=!1,Rh=null,jn=null,kl=!1,fn=null,Pc=0,Ko=0,Bh=null,rc=-1,nc=0;function mt(){return se&6?Ie():rc!==-1?rc:rc=Ie()}function wn(e){return e.mode&1?se&2&&nt!==0?nt&-nt:sk.transition!==null?(nc===0&&(nc=Tj()),nc):(e=ue,e!==0||(e=window.event,e=e===void 0?16:Fj(e.type)),e):1}function cr(e,t,r,n){if(50<Ko)throw Ko=0,Bh=null,Error(H(185));Js(e,r,n),(!(se&2)||e!==Ze)&&(e===Ze&&(!(se&2)&&(Wu|=r),Ve===4&&ln(e,nt)),Pt(e,n),r===1&&se===0&&!(t.mode&1)&&(vi=Ie()+500,Bu&&$n()))}function Pt(e,t){var r=e.callbackNode;sP(e,t);var n=uc(e,e===Ze?nt:0);if(n===0)r!==null&&Bg(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&Bg(r),t===1)e.tag===0?ok(Ey.bind(null,e)):iw(Ey.bind(null,e)),rk(function(){!(se&6)&&$n()}),r=null;else{switch(Mj(n)){case 1:r=Am;break;case 4:r=Ej;break;case 16:r=cc;break;case 536870912:r=Cj;break;default:r=cc}r=nS(r,Xw.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Xw(e,t){if(rc=-1,nc=0,se&6)throw Error(H(327));var r=e.callbackNode;if(oi()&&e.callbackNode!==r)return null;var n=uc(e,e===Ze?nt:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=kc(e,n);else{t=n;var a=se;se|=2;var i=Zw();(Ze!==e||nt!==t)&&($r=null,vi=Ie()+500,sa(e,t));do try{Pk();break}catch(l){Qw(e,l)}while(!0);Um(),Nc.current=i,se=a,De!==null?t=0:(Ze=null,nt=0,t=Ve)}if(t!==0){if(t===2&&(a=dh(e),a!==0&&(n=a,t=Fh(e,a))),t===1)throw r=ps,sa(e,0),ln(e,n),Pt(e,Ie()),r;if(t===6)ln(e,n);else{if(a=e.current.alternate,!(n&30)&&!Nk(a)&&(t=kc(e,n),t===2&&(i=dh(e),i!==0&&(n=i,t=Fh(e,i))),t===1))throw r=ps,sa(e,0),ln(e,n),Pt(e,Ie()),r;switch(e.finishedWork=a,e.finishedLanes=n,t){case 0:case 1:throw Error(H(345));case 2:Gn(e,jt,$r);break;case 3:if(ln(e,n),(n&130023424)===n&&(t=n0+500-Ie(),10<t)){if(uc(e,0)!==0)break;if(a=e.suspendedLanes,(a&n)!==n){mt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=bh(Gn.bind(null,e,jt,$r),t);break}Gn(e,jt,$r);break;case 4:if(ln(e,n),(n&4194240)===n)break;for(t=e.eventTimes,a=-1;0<n;){var o=31-lr(n);i=1<<o,o=t[o],o>a&&(a=o),n&=~i}if(n=a,n=Ie()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*_k(n/1960))-n,10<n){e.timeoutHandle=bh(Gn.bind(null,e,jt,$r),n);break}Gn(e,jt,$r);break;case 5:Gn(e,jt,$r);break;default:throw Error(H(329))}}}return Pt(e,Ie()),e.callbackNode===r?Xw.bind(null,e):null}function Fh(e,t){var r=Ho;return e.current.memoizedState.isDehydrated&&(sa(e,t).flags|=256),e=kc(e,t),e!==2&&(t=jt,jt=r,t!==null&&zh(t)),e}function zh(e){jt===null?jt=e:jt.push.apply(jt,e)}function Nk(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var a=r[n],i=a.getSnapshot;a=a.value;try{if(!fr(i(),a))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ln(e,t){for(t&=~r0,t&=~Wu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-lr(t),n=1<<r;e[r]=-1,t&=~n}}function Ey(e){if(se&6)throw Error(H(327));oi();var t=uc(e,0);if(!(t&1))return Pt(e,Ie()),null;var r=kc(e,t);if(e.tag!==0&&r===2){var n=dh(e);n!==0&&(t=n,r=Fh(e,n))}if(r===1)throw r=ps,sa(e,0),ln(e,t),Pt(e,Ie()),r;if(r===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Gn(e,jt,$r),Pt(e,Ie()),null}function a0(e,t){var r=se;se|=1;try{return e(t)}finally{se=r,se===0&&(vi=Ie()+500,Bu&&$n())}}function ma(e){fn!==null&&fn.tag===0&&!(se&6)&&oi();var t=se;se|=1;var r=Yt.transition,n=ue;try{if(Yt.transition=null,ue=1,e)return e()}finally{ue=n,Yt.transition=r,se=t,!(se&6)&&$n()}}function i0(){$t=qa.current,Se(qa)}function sa(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,tk(r)),De!==null)for(r=De.return;r!==null;){var n=r;switch(Bm(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&mc();break;case 3:gi(),Se(Nt),Se(ut),Ym();break;case 5:Gm(n);break;case 4:gi();break;case 13:Se(ke);break;case 19:Se(ke);break;case 10:Wm(n.type._context);break;case 22:case 23:i0()}r=r.return}if(Ze=e,De=e=Sn(e.current,null),nt=$t=t,Ve=0,ps=null,r0=Wu=pa=0,jt=Ho=null,Jn!==null){for(t=0;t<Jn.length;t++)if(r=Jn[t],n=r.interleaved,n!==null){r.interleaved=null;var a=n.next,i=r.pending;if(i!==null){var o=i.next;i.next=a,n.next=o}r.pending=n}Jn=null}return e}function Qw(e,t){do{var r=De;try{if(Um(),Jl.current=_c,Sc){for(var n=Ae.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}Sc=!1}if(ha=0,Xe=He=Ae=null,Uo=!1,fs=0,t0.current=null,r===null||r.return===null){Ve=1,ps=t,De=null;break}e:{var i=e,o=r.return,l=r,c=t;if(t=nt,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=vy(o);if(p!==null){p.flags&=-257,xy(p,o,l,i,t),p.mode&1&&yy(i,u,t),t=p,c=u;var v=t.updateQueue;if(v===null){var b=new Set;b.add(c),t.updateQueue=b}else v.add(c);break e}else{if(!(t&1)){yy(i,u,t),o0();break e}c=Error(H(426))}}else if(Ne&&l.mode&1){var x=vy(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),xy(x,o,l,i,t),Fm(yi(c,l));break e}}i=c=yi(c,l),Ve!==4&&(Ve=2),Ho===null?Ho=[i]:Ho.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=Mw(i,c,t);fy(i,y);break e;case 1:l=c;var m=i.type,g=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(jn===null||!jn.has(g)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=Iw(i,l,t);fy(i,S);break e}}i=i.return}while(i!==null)}eS(r)}catch(j){t=j,De===r&&r!==null&&(De=r=r.return);continue}break}while(!0)}function Zw(){var e=Nc.current;return Nc.current=_c,e===null?_c:e}function o0(){(Ve===0||Ve===3||Ve===2)&&(Ve=4),Ze===null||!(pa&268435455)&&!(Wu&268435455)||ln(Ze,nt)}function kc(e,t){var r=se;se|=2;var n=Zw();(Ze!==e||nt!==t)&&($r=null,sa(e,t));do try{Ok();break}catch(a){Qw(e,a)}while(!0);if(Um(),se=r,Nc.current=n,De!==null)throw Error(H(261));return Ze=null,nt=0,Ve}function Ok(){for(;De!==null;)Jw(De)}function Pk(){for(;De!==null&&!Z2();)Jw(De)}function Jw(e){var t=rS(e.alternate,e,$t);e.memoizedProps=e.pendingProps,t===null?eS(e):De=t,t0.current=null}function eS(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=bk(r,t),r!==null){r.flags&=32767,De=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ve=6,De=null;return}}else if(r=xk(r,t,$t),r!==null){De=r;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Ve===0&&(Ve=5)}function Gn(e,t,r){var n=ue,a=Yt.transition;try{Yt.transition=null,ue=1,kk(e,t,r,n)}finally{Yt.transition=a,ue=n}return null}function kk(e,t,r,n){do oi();while(fn!==null);if(se&6)throw Error(H(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(lP(e,i),e===Ze&&(De=Ze=null,nt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||kl||(kl=!0,nS(cc,function(){return oi(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=Yt.transition,Yt.transition=null;var o=ue;ue=1;var l=se;se|=4,t0.current=null,wk(e,r),Yw(r,e),YP(vh),fc=!!yh,vh=yh=null,e.current=r,Sk(r),J2(),se=l,ue=o,Yt.transition=i}else e.current=r;if(kl&&(kl=!1,fn=e,Pc=a),i=e.pendingLanes,i===0&&(jn=null),rP(r.stateNode),Pt(e,Ie()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],n(a.value,{componentStack:a.stack,digest:a.digest});if(Oc)throw Oc=!1,e=Rh,Rh=null,e;return Pc&1&&e.tag!==0&&oi(),i=e.pendingLanes,i&1?e===Bh?Ko++:(Ko=0,Bh=e):Ko=0,$n(),null}function oi(){if(fn!==null){var e=Mj(Pc),t=Yt.transition,r=ue;try{if(Yt.transition=null,ue=16>e?16:e,fn===null)var n=!1;else{if(e=fn,fn=null,Pc=0,se&6)throw Error(H(331));var a=se;for(se|=4,G=e.current;G!==null;){var i=G,o=i.child;if(G.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(G=u;G!==null;){var d=G;switch(d.tag){case 0:case 11:case 15:Wo(8,d,i)}var f=d.child;if(f!==null)f.return=d,G=f;else for(;G!==null;){d=G;var h=d.sibling,p=d.return;if(Kw(d),d===u){G=null;break}if(h!==null){h.return=p,G=h;break}G=p}}}var v=i.alternate;if(v!==null){var b=v.child;if(b!==null){v.child=null;do{var x=b.sibling;b.sibling=null,b=x}while(b!==null)}}G=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,G=o;else e:for(;G!==null;){if(i=G,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Wo(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,G=y;break e}G=i.return}}var m=e.current;for(G=m;G!==null;){o=G;var g=o.child;if(o.subtreeFlags&2064&&g!==null)g.return=o,G=g;else e:for(o=m;G!==null;){if(l=G,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Uu(9,l)}}catch(j){Ce(l,l.return,j)}if(l===o){G=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,G=S;break e}G=l.return}}if(se=a,$n(),xr&&typeof xr.onPostCommitFiberRoot=="function")try{xr.onPostCommitFiberRoot(Mu,e)}catch{}n=!0}return n}finally{ue=r,Yt.transition=t}}return!1}function Cy(e,t,r){t=yi(r,t),t=Mw(e,t,1),e=bn(e,t,1),t=mt(),e!==null&&(Js(e,1,t),Pt(e,t))}function Ce(e,t,r){if(e.tag===3)Cy(e,e,r);else for(;t!==null;){if(t.tag===3){Cy(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(jn===null||!jn.has(n))){e=yi(r,e),e=Iw(t,e,1),t=bn(t,e,1),e=mt(),t!==null&&(Js(t,1,e),Pt(t,e));break}}t=t.return}}function Ak(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=mt(),e.pingedLanes|=e.suspendedLanes&r,Ze===e&&(nt&r)===r&&(Ve===4||Ve===3&&(nt&130023424)===nt&&500>Ie()-n0?sa(e,0):r0|=r),Pt(e,t)}function tS(e,t){t===0&&(e.mode&1?(t=vl,vl<<=1,!(vl&130023424)&&(vl=4194304)):t=1);var r=mt();e=Hr(e,t),e!==null&&(Js(e,t,r),Pt(e,r))}function $k(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),tS(e,r)}function Ek(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(H(314))}n!==null&&n.delete(t),tS(e,r)}var rS;rS=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Nt.current)St=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return St=!1,vk(e,t,r);St=!!(e.flags&131072)}else St=!1,Ne&&t.flags&1048576&&ow(t,vc,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;tc(e,t),e=t.pendingProps;var a=hi(t,ut.current);ii(t,r),a=Xm(null,t,n,e,a,r);var i=Qm();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ot(n)?(i=!0,gc(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Km(t),a.updater=zu,t.stateNode=a,a._reactInternals=t,Ph(t,n,e,r),t=$h(null,t,n,!0,i,r)):(t.tag=0,Ne&&i&&Rm(t),ft(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(tc(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=Tk(n),e=nr(n,e),a){case 0:t=Ah(null,t,n,e,r);break e;case 1:t=wy(null,t,n,e,r);break e;case 11:t=by(null,t,n,e,r);break e;case 14:t=jy(null,t,n,nr(n.type,e),r);break e}throw Error(H(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:nr(n,a),Ah(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:nr(n,a),wy(e,t,n,a,r);case 3:e:{if(Bw(t),e===null)throw Error(H(387));n=t.pendingProps,i=t.memoizedState,a=i.element,dw(e,t),jc(t,n,null,r);var o=t.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=yi(Error(H(423)),t),t=Sy(e,t,n,r,a);break e}else if(n!==a){a=yi(Error(H(424)),t),t=Sy(e,t,n,r,a);break e}else for(Tt=xn(t.stateNode.containerInfo.firstChild),Mt=t,Ne=!0,or=null,r=uw(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(pi(),n===a){t=Kr(e,t,r);break e}ft(e,t,n,r)}t=t.child}return t;case 5:return hw(t),e===null&&_h(t),n=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,xh(n,a)?o=null:i!==null&&xh(n,i)&&(t.flags|=32),Rw(e,t),ft(e,t,o,r),t.child;case 6:return e===null&&_h(t),null;case 13:return Fw(e,t,r);case 4:return Vm(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=mi(t,null,n,r):ft(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:nr(n,a),by(e,t,n,a,r);case 7:return ft(e,t,t.pendingProps,r),t.child;case 8:return ft(e,t,t.pendingProps.children,r),t.child;case 12:return ft(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,ve(xc,n._currentValue),n._currentValue=o,i!==null)if(fr(i.value,o)){if(i.children===a.children&&!Nt.current){t=Kr(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=Rr(-1,r&-r),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),Nh(i.return,r,t),l.lanes|=r;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(H(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Nh(o,r,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}ft(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,ii(t,r),a=Xt(a),n=n(a),t.flags|=1,ft(e,t,n,r),t.child;case 14:return n=t.type,a=nr(n,t.pendingProps),a=nr(n.type,a),jy(e,t,n,a,r);case 15:return Lw(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:nr(n,a),tc(e,t),t.tag=1,Ot(n)?(e=!0,gc(t)):e=!1,ii(t,r),Tw(t,n,a),Ph(t,n,a,r),$h(null,t,n,!0,e,r);case 19:return zw(e,t,r);case 22:return Dw(e,t,r)}throw Error(H(156,t.tag))};function nS(e,t){return $j(e,t)}function Ck(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vt(e,t,r,n){return new Ck(e,t,r,n)}function s0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Tk(e){if(typeof e=="function")return s0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Om)return 11;if(e===Pm)return 14}return 2}function Sn(e,t){var r=e.alternate;return r===null?(r=Vt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function ac(e,t,r,n,a,i){var o=2;if(n=e,typeof e=="function")s0(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ba:return la(r.children,a,i,t);case Nm:o=8,a|=8;break;case Qd:return e=Vt(12,r,t,a|2),e.elementType=Qd,e.lanes=i,e;case Zd:return e=Vt(13,r,t,a),e.elementType=Zd,e.lanes=i,e;case Jd:return e=Vt(19,r,t,a),e.elementType=Jd,e.lanes=i,e;case hj:return Hu(r,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fj:o=10;break e;case dj:o=9;break e;case Om:o=11;break e;case Pm:o=14;break e;case nn:o=16,n=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=Vt(o,r,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function la(e,t,r,n){return e=Vt(7,e,n,t),e.lanes=r,e}function Hu(e,t,r,n){return e=Vt(22,e,n,t),e.elementType=hj,e.lanes=r,e.stateNode={isHidden:!1},e}function md(e,t,r){return e=Vt(6,e,null,t),e.lanes=r,e}function gd(e,t,r){return t=Vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Mk(e,t,r,n,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xf(0),this.expirationTimes=Xf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xf(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function l0(e,t,r,n,a,i,o,l,c){return e=new Mk(e,t,r,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Vt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Km(i),e}function Ik(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ra,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function aS(e){if(!e)return Pn;e=e._reactInternals;e:{if(_a(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ot(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var r=e.type;if(Ot(r))return aw(e,r,t)}return t}function iS(e,t,r,n,a,i,o,l,c){return e=l0(r,n,!0,e,a,i,o,l,c),e.context=aS(null),r=e.current,n=mt(),a=wn(r),i=Rr(n,a),i.callback=t??null,bn(r,i,a),e.current.lanes=a,Js(e,a,n),Pt(e,n),e}function Ku(e,t,r,n){var a=t.current,i=mt(),o=wn(a);return r=aS(r),t.context===null?t.context=r:t.pendingContext=r,t=Rr(i,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=bn(a,t,o),e!==null&&(cr(e,a,o,i),Zl(e,a,o)),o}function Ac(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ty(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function c0(e,t){Ty(e,t),(e=e.alternate)&&Ty(e,t)}function Lk(){return null}var oS=typeof reportError=="function"?reportError:function(e){console.error(e)};function u0(e){this._internalRoot=e}Vu.prototype.render=u0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));Ku(e,t,null,null)};Vu.prototype.unmount=u0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ma(function(){Ku(null,e,null,null)}),t[Wr]=null}};function Vu(e){this._internalRoot=e}Vu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Dj();e={blockedOn:null,target:e,priority:t};for(var r=0;r<sn.length&&t!==0&&t<sn[r].priority;r++);sn.splice(r,0,e),r===0&&Bj(e)}};function f0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Gu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function My(){}function Dk(e,t,r,n,a){if(a){if(typeof n=="function"){var i=n;n=function(){var u=Ac(o);i.call(u)}}var o=iS(t,n,e,0,null,!1,!1,"",My);return e._reactRootContainer=o,e[Wr]=o.current,os(e.nodeType===8?e.parentNode:e),ma(),o}for(;a=e.lastChild;)e.removeChild(a);if(typeof n=="function"){var l=n;n=function(){var u=Ac(c);l.call(u)}}var c=l0(e,0,!1,null,null,!1,!1,"",My);return e._reactRootContainer=c,e[Wr]=c.current,os(e.nodeType===8?e.parentNode:e),ma(function(){Ku(t,c,r,n)}),c}function Yu(e,t,r,n,a){var i=r._reactRootContainer;if(i){var o=i;if(typeof a=="function"){var l=a;a=function(){var c=Ac(o);l.call(c)}}Ku(t,o,e,a)}else o=Dk(r,t,e,a,n);return Ac(o)}Ij=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=To(t.pendingLanes);r!==0&&($m(t,r|1),Pt(t,Ie()),!(se&6)&&(vi=Ie()+500,$n()))}break;case 13:ma(function(){var n=Hr(e,1);if(n!==null){var a=mt();cr(n,e,1,a)}}),c0(e,1)}};Em=function(e){if(e.tag===13){var t=Hr(e,134217728);if(t!==null){var r=mt();cr(t,e,134217728,r)}c0(e,134217728)}};Lj=function(e){if(e.tag===13){var t=wn(e),r=Hr(e,t);if(r!==null){var n=mt();cr(r,e,t,n)}c0(e,t)}};Dj=function(){return ue};Rj=function(e,t){var r=ue;try{return ue=e,t()}finally{ue=r}};ch=function(e,t,r){switch(t){case"input":if(rh(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var a=Ru(n);if(!a)throw Error(H(90));mj(n),rh(n,a)}}}break;case"textarea":yj(e,r);break;case"select":t=r.value,t!=null&&ti(e,!!r.multiple,t,!1)}};_j=a0;Nj=ma;var Rk={usingClientEntryPoint:!1,Events:[tl,Wa,Ru,wj,Sj,a0]},xo={findFiberByHostInstance:Zn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Bk={bundleType:xo.bundleType,version:xo.version,rendererPackageName:xo.rendererPackageName,rendererConfig:xo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:qr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=kj(e),e===null?null:e.stateNode},findFiberByHostInstance:xo.findFiberByHostInstance||Lk,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Al=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Al.isDisabled&&Al.supportsFiber)try{Mu=Al.inject(Bk),xr=Al}catch{}}Dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Rk;Dt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f0(t))throw Error(H(200));return Ik(e,t,null,r)};Dt.createRoot=function(e,t){if(!f0(e))throw Error(H(299));var r=!1,n="",a=oS;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=l0(e,1,!1,null,null,r,!1,n,a),e[Wr]=t.current,os(e.nodeType===8?e.parentNode:e),new u0(t)};Dt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=kj(t),e=e===null?null:e.stateNode,e};Dt.flushSync=function(e){return ma(e)};Dt.hydrate=function(e,t,r){if(!Gu(t))throw Error(H(200));return Yu(null,e,t,!0,r)};Dt.hydrateRoot=function(e,t,r){if(!f0(e))throw Error(H(405));var n=r!=null&&r.hydratedSources||null,a=!1,i="",o=oS;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=iS(t,null,e,1,r??null,a,!1,i,o),e[Wr]=t.current,os(e),n)for(e=0;e<n.length;e++)r=n[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new Vu(t)};Dt.render=function(e,t,r){if(!Gu(t))throw Error(H(200));return Yu(null,e,t,!1,r)};Dt.unmountComponentAtNode=function(e){if(!Gu(e))throw Error(H(40));return e._reactRootContainer?(ma(function(){Yu(null,null,e,!1,function(){e._reactRootContainer=null,e[Wr]=null})}),!0):!1};Dt.unstable_batchedUpdates=a0;Dt.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Gu(r))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return Yu(e,t,r,!1,n)};Dt.version="18.3.1-next-f1338f8080-20240426";function sS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sS)}catch(e){console.error(e)}}sS(),sj.exports=Dt;var Fk=sj.exports,Iy=Fk;qd.createRoot=Iy.createRoot,qd.hydrateRoot=Iy.hydrateRoot;/**
- * @remix-run/router v1.23.2
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */function ms(){return ms=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ms.apply(this,arguments)}var dn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(dn||(dn={}));const Ly="popstate";function zk(e){e===void 0&&(e={});function t(n,a){let{pathname:i,search:o,hash:l}=n.location;return Uh("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:$c(a)}return Wk(t,r,null,e)}function Re(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function d0(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Uk(){return Math.random().toString(36).substr(2,8)}function Dy(e,t){return{usr:e.state,key:e.key,idx:t}}function Uh(e,t,r,n){return r===void 0&&(r=null),ms({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Xi(t):t,{state:r,key:t&&t.key||n||Uk()})}function $c(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Xi(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Wk(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,l=dn.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(ms({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=dn.Pop;let x=d(),y=x==null?null:x-u;u=x,c&&c({action:l,location:b.location,delta:y})}function h(x,y){l=dn.Push;let m=Uh(b.location,x,y);u=d()+1;let g=Dy(m,u),S=b.createHref(m);try{o.pushState(g,"",S)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;a.location.assign(S)}i&&c&&c({action:l,location:b.location,delta:1})}function p(x,y){l=dn.Replace;let m=Uh(b.location,x,y);u=d();let g=Dy(m,u),S=b.createHref(m);o.replaceState(g,"",S),i&&c&&c({action:l,location:b.location,delta:0})}function v(x){let y=a.location.origin!=="null"?a.location.origin:a.location.href,m=typeof x=="string"?x:$c(x);return m=m.replace(/ $/,"%20"),Re(y,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,y)}let b={get action(){return l},get location(){return e(a,o)},listen(x){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(Ly,f),c=x,()=>{a.removeEventListener(Ly,f),c=null}},createHref(x){return t(a,x)},createURL:v,encodeLocation(x){let y=v(x);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:p,go(x){return o.go(x)}};return b}var Ry;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ry||(Ry={}));function Hk(e,t,r){return r===void 0&&(r="/"),Kk(e,t,r)}function Kk(e,t,r,n){let a=typeof t=="string"?Xi(t):t,i=h0(a.pathname||"/",r);if(i==null)return null;let o=lS(e);Vk(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=aA(i);l=tA(o[c],u)}return l}function lS(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(Re(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=_n([n,c.relativePath]),d=r.concat(c);i.children&&i.children.length>0&&(Re(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),lS(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:Jk(u,i.index),routesMeta:d})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let c of cS(i.path))a(i,o,c)}),t}function cS(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=cS(n.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Vk(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:eA(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Gk=/^:[\w-]+$/,Yk=3,qk=2,Xk=1,Qk=10,Zk=-2,By=e=>e==="*";function Jk(e,t){let r=e.split("/"),n=r.length;return r.some(By)&&(n+=Zk),t&&(n+=qk),r.filter(a=>!By(a)).reduce((a,i)=>a+(Gk.test(i)?Yk:i===""?Xk:Qk),n)}function eA(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function tA(e,t,r){let{routesMeta:n}=e,a={},i="/",o=[];for(let l=0;l<n.length;++l){let c=n[l],u=l===n.length-1,d=i==="/"?t:t.slice(i.length)||"/",f=rA({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f)return null;Object.assign(a,f.params),o.push({params:a,pathname:_n([i,f.pathname]),pathnameBase:cA(_n([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=_n([i,f.pathnameBase]))}return o}function rA(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=nA(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((u,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let b=l[f]||"";o=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const v=l[f];return p&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function nA(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),d0(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function aA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return d0(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function h0(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const iA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,oA=e=>iA.test(e);function sA(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Xi(e):e,i;if(r)if(oA(r))i=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),d0(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?i=Fy(r.substring(1),"/"):i=Fy(r,t)}else i=t;return{pathname:i,search:uA(n),hash:fA(a)}}function Fy(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function yd(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function lA(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function uS(e,t){let r=lA(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function fS(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=Xi(e):(a=ms({},e),Re(!a.pathname||!a.pathname.includes("?"),yd("?","pathname","search",a)),Re(!a.pathname||!a.pathname.includes("#"),yd("#","pathname","hash",a)),Re(!a.search||!a.search.includes("#"),yd("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;a.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=sA(a,l),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const _n=e=>e.join("/").replace(/\/\/+/g,"/"),cA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),uA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,fA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function dA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const dS=["post","put","patch","delete"];new Set(dS);const hA=["get",...dS];new Set(hA);/**
- * React Router v6.30.3
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */function gs(){return gs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gs.apply(this,arguments)}const p0=O.createContext(null),pA=O.createContext(null),Na=O.createContext(null),qu=O.createContext(null),En=O.createContext({outlet:null,matches:[],isDataRoute:!1}),hS=O.createContext(null);function mA(e,t){let{relative:r}=t===void 0?{}:t;nl()||Re(!1);let{basename:n,navigator:a}=O.useContext(Na),{hash:i,pathname:o,search:l}=mS(e,{relative:r}),c=o;return n!=="/"&&(c=o==="/"?n:_n([n,o])),a.createHref({pathname:c,search:l,hash:i})}function nl(){return O.useContext(qu)!=null}function al(){return nl()||Re(!1),O.useContext(qu).location}function pS(e){O.useContext(Na).static||O.useLayoutEffect(e)}function Xu(){let{isDataRoute:e}=O.useContext(En);return e?$A():gA()}function gA(){nl()||Re(!1);let e=O.useContext(p0),{basename:t,future:r,navigator:n}=O.useContext(Na),{matches:a}=O.useContext(En),{pathname:i}=al(),o=JSON.stringify(uS(a,r.v7_relativeSplatPath)),l=O.useRef(!1);return pS(()=>{l.current=!0}),O.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let f=fS(u,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:_n([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,o,i,e])}const yA=O.createContext(null);function vA(e){let t=O.useContext(En).outlet;return t&&O.createElement(yA.Provider,{value:e},t)}function mS(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=O.useContext(Na),{matches:a}=O.useContext(En),{pathname:i}=al(),o=JSON.stringify(uS(a,n.v7_relativeSplatPath));return O.useMemo(()=>fS(e,JSON.parse(o),i,r==="path"),[e,o,i,r])}function xA(e,t){return bA(e,t)}function bA(e,t,r,n){nl()||Re(!1);let{navigator:a}=O.useContext(Na),{matches:i}=O.useContext(En),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=al(),d;if(t){var f;let x=typeof t=="string"?Xi(t):t;c==="/"||(f=x.pathname)!=null&&f.startsWith(c)||Re(!1),d=x}else d=u;let h=d.pathname||"/",p=h;if(c!=="/"){let x=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(x.length).join("/")}let v=Hk(e,{pathname:p}),b=NA(v&&v.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:_n([c,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:_n([c,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,r,n);return t&&b?O.createElement(qu.Provider,{value:{location:gs({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:dn.Pop}},b):b}function jA(){let e=AA(),t=dA(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return O.createElement(O.Fragment,null,O.createElement("h2",null,"Unexpected Application Error!"),O.createElement("h3",{style:{fontStyle:"italic"}},t),r?O.createElement("pre",{style:a},r):null,null)}const wA=O.createElement(jA,null);class SA extends O.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?O.createElement(En.Provider,{value:this.props.routeContext},O.createElement(hS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function _A(e){let{routeContext:t,match:r,children:n}=e,a=O.useContext(p0);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),O.createElement(En.Provider,{value:t},n)}function NA(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(a=r)==null?void 0:a.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||Re(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:p}=r,v=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||v){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let p,v=!1,b=null,x=null;r&&(p=l&&f.route.id?l[f.route.id]:void 0,b=f.route.errorElement||wA,c&&(u<0&&h===0?(EA("route-fallback"),v=!0,x=null):u===h&&(v=!0,x=f.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,h+1)),m=()=>{let g;return p?g=b:v?g=x:f.route.Component?g=O.createElement(f.route.Component,null):f.route.element?g=f.route.element:g=d,O.createElement(_A,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:r!=null},children:g})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?O.createElement(SA,{location:r.location,revalidation:r.revalidation,component:b,error:p,children:m(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):m()},null)}var gS=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(gS||{}),yS=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(yS||{});function OA(e){let t=O.useContext(p0);return t||Re(!1),t}function PA(e){let t=O.useContext(pA);return t||Re(!1),t}function kA(e){let t=O.useContext(En);return t||Re(!1),t}function vS(e){let t=kA(),r=t.matches[t.matches.length-1];return r.route.id||Re(!1),r.route.id}function AA(){var e;let t=O.useContext(hS),r=PA(),n=vS();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function $A(){let{router:e}=OA(gS.UseNavigateStable),t=vS(yS.UseNavigateStable),r=O.useRef(!1);return pS(()=>{r.current=!0}),O.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,gs({fromRouteId:t},i)))},[e,t])}const zy={};function EA(e,t,r){zy[e]||(zy[e]=!0)}function CA(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function TA(e){return vA(e.context)}function et(e){Re(!1)}function MA(e){let{basename:t="/",children:r=null,location:n,navigationType:a=dn.Pop,navigator:i,static:o=!1,future:l}=e;nl()&&Re(!1);let c=t.replace(/^\/*/,"/"),u=O.useMemo(()=>({basename:c,navigator:i,static:o,future:gs({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof n=="string"&&(n=Xi(n));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:v="default"}=n,b=O.useMemo(()=>{let x=h0(d,c);return x==null?null:{location:{pathname:x,search:f,hash:h,state:p,key:v},navigationType:a}},[c,d,f,h,p,v,a]);return b==null?null:O.createElement(Na.Provider,{value:u},O.createElement(qu.Provider,{children:r,value:b}))}function IA(e){let{children:t,location:r}=e;return xA(Wh(t),r)}new Promise(()=>{});function Wh(e,t){t===void 0&&(t=[]);let r=[];return O.Children.forEach(e,(n,a)=>{if(!O.isValidElement(n))return;let i=[...t,a];if(n.type===O.Fragment){r.push.apply(r,Wh(n.props.children,i));return}n.type!==et&&Re(!1),!n.props.index||!n.props.children||Re(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Wh(n.props.children,i)),r.push(o)}),r}/**
- * React Router DOM v6.30.3
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */function Hh(){return Hh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hh.apply(this,arguments)}function LA(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function DA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function RA(e,t){return e.button===0&&(!t||t==="_self")&&!DA(e)}const BA=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],FA="6";try{window.__reactRouterVersion=FA}catch{}const zA="startTransition",Uy=A2[zA];function UA(e){let{basename:t,children:r,future:n,window:a}=e,i=O.useRef();i.current==null&&(i.current=zk({window:a,v5Compat:!0}));let o=i.current,[l,c]=O.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},d=O.useCallback(f=>{u&&Uy?Uy(()=>c(f)):c(f)},[c,u]);return O.useLayoutEffect(()=>o.listen(d),[o,d]),O.useEffect(()=>CA(n),[n]),O.createElement(MA,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const WA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",HA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Da=O.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:i,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=LA(t,BA),{basename:p}=O.useContext(Na),v,b=!1;if(typeof u=="string"&&HA.test(u)&&(v=u,WA))try{let g=new URL(window.location.href),S=u.startsWith("//")?new URL(g.protocol+u):new URL(u),j=h0(S.pathname,p);S.origin===g.origin&&j!=null?u=j+S.search+S.hash:b=!0}catch{}let x=mA(u,{relative:a}),y=KA(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:a,viewTransition:f});function m(g){n&&n(g),g.defaultPrevented||y(g)}return O.createElement("a",Hh({},h,{href:v||x,onClick:b||i?n:m,ref:r,target:c}))});var Wy;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Wy||(Wy={}));var Hy;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Hy||(Hy={}));function KA(e,t){let{target:r,replace:n,state:a,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=Xu(),u=al(),d=mS(e,{relative:o});return O.useCallback(f=>{if(RA(f,r)){f.preventDefault();let h=n!==void 0?n:$c(u)===$c(d);c(e,{replace:h,state:a,preventScrollReset:i,relative:o,viewTransition:l})}},[u,c,d,n,a,r,e,i,o,l])}const VA="/api";async function Pe(e,t={}){const r=await fetch(`${VA}${e}`,{...t,credentials:"same-origin",headers:{"Content-Type":"application/json",...t.headers}});return r.status===401&&!e.startsWith("/auth/")?(window.location.href="/login",{}):r.json()}async function pe(e,t){return Pe(e,{method:"POST",body:JSON.stringify(t)})}async function m0(){try{return(await Pe("/auth/session")).authenticated===!0}catch{return!1}}async function GA(e,t){return(await pe("/auth/login",{username:e,password:t})).success===!0}async function YA(e){return await pe("/auth/google",{credential:e})}async function qA(){try{return await Pe("/auth/google-config")}catch{return{configured:!1}}}async function XA(){await pe("/auth/logout",{}),window.location.href="/login"}function QA(){const[e,t]=O.useState(""),[r,n]=O.useState(""),[a,i]=O.useState(!1),[o,l]=O.useState(""),[c,u]=O.useState(!1),[d,f]=O.useState(!0),[h,p]=O.useState(!1),[v,b]=O.useState(null),x=O.useRef(null),y=Xu();O.useEffect(()=>{m0().then(w=>{w?y("/"):f(!1)}),qA().then(w=>{w.configured&&w.client_id&&(b(w.client_id),m(w.client_id))})},[]);function m(w){if(document.getElementById("google-gsi")){g(w);return}const _=document.createElement("script");_.id="google-gsi",_.src="https://accounts.google.com/gsi/client",_.async=!0,_.defer=!0,_.onload=()=>g(w),document.head.appendChild(_)}function g(w){var _,N;(N=(_=window.google)==null?void 0:_.accounts)!=null&&N.id&&(window.google.accounts.id.initialize({client_id:w,callback:S,auto_select:!1}),p(!0))}O.useEffect(()=>{var w,_;h&&x.current&&((_=(w=window.google)==null?void 0:w.accounts)!=null&&_.id)&&window.google.accounts.id.renderButton(x.current,{type:"standard",theme:"filled_black",size:"large",text:"signin_with",shape:"pill",width:360})},[h]);async function S(w){l(""),u(!0);try{const _=await YA(w.credential);_.success?y("/"):l(_.error||"Google login failed")}catch{l("Connection error")}u(!1)}async function j(w){w.preventDefault(),l(""),u(!0);try{await GA(e,r)?y("/"):l("Invalid credentials")}catch{l("Connection error")}u(!1)}return d?s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})}):s.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:s.jsxs("div",{className:"w-full max-w-md",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-2xl mb-4",style:{background:"linear-gradient(135deg,#f59e0b,#f97316)"},children:s.jsx("span",{className:"text-3xl font-black text-black",children:"K"})}),s.jsx("h1",{className:"text-3xl font-extrabold kalshi-gradient",children:"KEN TRADER"}),s.jsx("p",{className:"text-gray-400 mt-2 text-sm",children:"Event Contracts Trading System"}),s.jsx("p",{className:"text-xs text-green-400 mt-1",children:"CFTC-Regulated DCM"})]}),o&&s.jsxs("div",{className:"text-red-400 text-sm bg-red-500/10 rounded-lg p-3 flex items-center gap-2 mb-4",children:[s.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),o]}),v&&s.jsxs("div",{className:"mb-4",children:[s.jsx("div",{ref:x,className:"flex justify-center"}),s.jsxs("div",{className:"relative my-5",children:[s.jsx("div",{className:"absolute inset-0 flex items-center",children:s.jsx("div",{className:"w-full border-t border-gray-800"})}),s.jsx("div",{className:"relative flex justify-center text-xs",children:s.jsx("span",{className:"px-3 text-gray-500",style:{background:"var(--bg)"},children:"or sign in with password"})})]})]}),s.jsxs("form",{onSubmit:j,className:"card space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Username"}),s.jsx("input",{type:"text",value:e,onChange:w=>t(w.target.value),required:!0,autoComplete:"username",className:"w-full bg-gray-800/50 border border-gray-700 rounded-lg px-3 py-2.5 text-sm focus:outline-none focus:border-amber-500 transition",placeholder:"admin"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Password"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:a?"text":"password",value:r,onChange:w=>n(w.target.value),required:!0,autoComplete:"current-password",className:"w-full bg-gray-800/50 border border-gray-700 rounded-lg px-3 py-2.5 pr-10 text-sm focus:outline-none focus:border-amber-500 transition",placeholder:"Enter password"}),s.jsx("button",{type:"button",onClick:()=>i(!a),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300",children:s.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:a?"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.879L21 21":"M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})})})]})]}),s.jsxs("button",{type:"submit",disabled:c,className:"btn btn-p w-full py-2.5 flex items-center justify-center gap-2 disabled:opacity-50",children:[c&&s.jsx("span",{className:"animate-spin w-4 h-4 border-2 border-black border-t-transparent rounded-full"}),c?"Signing in...":"Sign In"]})]}),s.jsx("p",{className:"text-center text-gray-600 text-[10px] mt-4",children:"Ken operates as a CFTC-regulated Designated Contract Market"})]})})}const ZA=[{to:"/",label:"Dashboard",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"},{to:"/markets",label:"Markets",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"},{to:"/signals",label:"Signals",d:"M13 10V3L4 14h7v7l9-11h-7z"},{to:"/intelligence",label:"Intel Feed",d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"},{to:"/trading",label:"Trading",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},{to:"/positions",label:"Positions",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},{to:"/orders",label:"Orders",d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"},{to:"/heatmap",label:"Heatmap",d:"M4 5a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1V5zm10 0a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1V5zM4 15a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1v-4zm10 0a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"},{to:"/orbit",label:"Orbit",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},{to:"/pulse",label:"Pulse",d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},{to:"/weather",label:"Weather",d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"},{to:"/risk",label:"Portfauxlios",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"},{to:"/settings",label:"Settings",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"}];function JA(){const e=al(),t=Xu(),[r,n]=O.useState(null),[a,i]=O.useState(!1),[o,l]=O.useState(!1);return O.useEffect(()=>{m0().then(c=>{if(!c){t("/login");return}l(!0);const u=()=>Pe("/health").then(n).catch(()=>{});u();const d=setInterval(u,15e3);return()=>clearInterval(d)})},[]),o?s.jsxs("div",{className:"flex min-h-screen",children:[s.jsxs("aside",{className:`${a?"w-16":"w-56"} bg-gray-900/50 border-r border-gray-800 flex flex-col transition-all duration-200`,children:[s.jsxs("div",{className:"p-4 border-b border-gray-800 flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"linear-gradient(135deg,#f59e0b,#f97316)"},children:s.jsx("span",{className:"text-black font-bold text-sm",children:"K"})}),!a&&s.jsx("span",{className:"font-bold text-sm kalshi-gradient",children:"KEN TRADER"})]}),s.jsx("nav",{className:"flex-1 p-2 space-y-0.5",children:ZA.map(c=>{const u=e.pathname===c.to||c.to!=="/"&&e.pathname.startsWith(c.to);return s.jsxs(Da,{to:c.to,className:`flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition ${u?"bg-amber-500/15 text-amber-400 font-medium":"text-gray-400 hover:text-gray-200 hover:bg-gray-800/50"}`,children:[s.jsx("svg",{className:"flex-shrink-0",style:{width:18,height:18},fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:c.d})}),!a&&s.jsx("span",{children:c.label})]},c.to)})}),s.jsxs("div",{className:"p-3 border-t border-gray-800",children:[!a&&r&&s.jsxs("div",{className:"space-y-1.5 text-[11px]",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"Env"}),s.jsx("span",{className:r.env==="demo"?"text-yellow-400":"text-green-400",children:(r.env||"demo").toUpperCase()})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"API"}),s.jsx("span",{className:r.kalshi_connected?"text-green-400":"text-gray-500",children:r.kalshi_connected?"CONNECTED":"OFF"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"DB"}),s.jsx("span",{className:r.db_connected?"text-green-400":"text-red-400",children:r.db_connected?"OK":"DOWN"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"Safe Mode"}),s.jsx("span",{className:r.safe_mode?"text-yellow-400":"text-green-400",children:r.safe_mode?"ON":"OFF"})]})]}),s.jsxs("div",{className:"flex gap-1 mt-2",children:[s.jsx("button",{onClick:()=>i(!a),className:"flex-1 flex items-center justify-center py-1.5 text-gray-500 hover:text-gray-300",children:s.jsx("svg",{className:`w-4 h-4 transition-transform ${a?"":"rotate-180"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"})})}),!a&&s.jsx("button",{onClick:XA,className:"px-2 py-1 text-xs text-gray-500 hover:text-red-400",children:"Logout"})]})]})]}),s.jsx("main",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-6 max-w-[1600px] mx-auto",children:s.jsx(TA,{})})})]}):s.jsx("div",{className:"flex items-center justify-center min-h-screen",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})})}const e$=[{title:"Event Contracts",desc:"Betting on weather like a person who never learned to just look outside. CFTC-regulated, at least.",icon:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"},{title:"Weather Intelligence",desc:"We schlepp forecast data from the government so you don't have to read the almanac yourself.",icon:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"},{title:"Automated Execution",desc:"The machine places your bets so your hands stay clean. Safe mode included, because I worry.",icon:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"}],t$=["Hook up to Ken (demo first, like a sensible person)","Snoop around the weather contracts","Schlep in the NWS settlement data","Let the computer do the math you were too lazy to learn","Set some limits so you don't lose your shirt","Place the bets (on paper first, God willing)"];function r$({next:e}){return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-4xl font-bold kalshi-gradient mb-3",children:"Oy, Look Who Finally Showed Up"}),s.jsx("p",{className:"text-gray-400 text-lg",children:"So you want to bet on the weather? Your mother would be so proud."})]}),s.jsx("div",{className:"grid grid-cols-3 gap-4",children:e$.map(t=>s.jsxs("div",{className:"card text-center",children:[s.jsx("div",{className:"w-10 h-10 rounded-lg bg-amber-500/10 flex items-center justify-center mx-auto mb-3",children:s.jsx("svg",{className:"w-5 h-5 text-amber-400",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t.icon})})}),s.jsx("h3",{className:"font-semibold text-sm mb-1",children:t.title}),s.jsx("p",{className:"text-xs text-gray-500 leading-relaxed",children:t.desc})]},t.title))}),s.jsxs("div",{className:"card",children:[s.jsx("h3",{className:"font-semibold text-sm mb-3",children:"Listen, this is how it works"}),s.jsx("div",{className:"grid grid-cols-2 gap-2",children:t$.map((t,r)=>s.jsxs("div",{className:"flex items-center gap-3 py-1.5",children:[s.jsx("span",{className:"w-6 h-6 rounded-full bg-amber-500/15 text-amber-400 flex items-center justify-center text-xs font-bold flex-shrink-0",children:r+1}),s.jsx("span",{className:"text-sm text-gray-300",children:t})]},r))})]}),s.jsx("div",{className:"card bg-green-500/5 border-green-500/20",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("svg",{className:"w-5 h-5 text-green-400 mt-0.5 flex-shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-green-400",children:"At least it's legal, thank God"}),s.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Ken is a real CFTC-regulated exchange, not some offshore mishegoss. You'll need an account with API access. Go make one already, I'll wait."})]})]})}),s.jsx("div",{className:"flex justify-center",children:s.jsx("button",{onClick:e,className:"btn btn-p px-8 py-3 text-base font-bold rounded-xl",children:"Nu, Let's Go Already"})})]})}function n$({data:e,update:t,next:r,back:n}){var x,y,m;const[a,i]=O.useState(((x=e.keys)==null?void 0:x.api_key)||""),[o,l]=O.useState(((y=e.keys)==null?void 0:y.private_key)||""),[c,u]=O.useState(((m=e.keys)==null?void 0:m.env)||"demo"),[d,f]=O.useState(!1),[h,p]=O.useState(null);async function v(){f(!0),p(null);try{const g=await pe("/kalshi",{action:"save_keys",api_key:a,private_key:o,env:c});g.success?(t({keys:{api_key:a,private_key:"***",env:c}}),r()):p(g.error||"Failed to save")}catch{p("Connection error")}f(!1)}function b(){t({keys:null,skippedConnect:!0}),r()}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Give Me the Keys"}),s.jsx("p",{className:"text-gray-400 text-sm",children:"Your API credentials, darling. I don't have all day."})]}),s.jsxs("div",{className:"card space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1.5 font-medium",children:"Which playground are we using?"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>u("demo"),className:`flex-1 py-2 rounded-lg text-sm font-medium transition ${c==="demo"?"bg-yellow-500/15 text-yellow-400 border border-yellow-500/30":"bg-gray-800/50 text-gray-500 border border-gray-700"}`,children:"Demo (Smart)"}),s.jsx("button",{onClick:()=>u("prod"),className:`flex-1 py-2 rounded-lg text-sm font-medium transition ${c==="prod"?"bg-green-500/15 text-green-400 border border-green-500/30":"bg-gray-800/50 text-gray-500 border border-gray-700"}`,children:"Production (Brave)"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1.5 font-medium",children:"API Key ID (the one they gave you)"}),s.jsx("input",{type:"text",value:a,onChange:g=>i(g.target.value),placeholder:"Paste it here, bubeleh",className:"w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none font-mono"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1.5 font-medium",children:"Private Key (the whole megillah, PEM format)"}),s.jsx("textarea",{value:o,onChange:g=>l(g.target.value),placeholder:`-----BEGIN RSA PRIVATE KEY-----
-...
------END RSA PRIVATE KEY-----`,rows:6,className:"w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none font-mono text-xs leading-relaxed"}),s.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"Don't worry, I keep it locked up tighter than your grandmother's jewelry box"})]}),h&&s.jsx("p",{className:"text-red-400 text-xs",children:h})]}),s.jsxs("div",{className:"card bg-gray-800/30",children:[s.jsx("h3",{className:"text-sm font-medium mb-2",children:"What, you don't have keys yet? Oy vey."}),s.jsxs("ol",{className:"text-xs text-gray-400 space-y-1.5 list-decimal list-inside",children:[s.jsxs("li",{children:["Go log into ",s.jsx("span",{className:"text-amber-400 font-mono",children:"ken.com"})," like a mensch"]}),s.jsx("li",{children:"Find Settings → API Keys (it's not that hard, look around)"}),s.jsxs("li",{children:['Click "Create API Key" and ',s.jsx("strong",{children:"download that private key file immediately"})]}),s.jsx("li",{children:"Copy the Key ID and paste the PEM contents up there. Simple."})]}),s.jsx("p",{className:"text-[10px] text-red-400 mt-2",children:"Listen to me — that private key file? You can only download it ONCE. Lose it and you start over. Don't say I didn't warn you."})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{onClick:b,className:"text-sm text-gray-500 hover:text-gray-300",children:"Skip (play pretend)"}),s.jsx("button",{onClick:v,disabled:d||!a||!o,className:"btn btn-p",children:d?"Saving, patience...":"Save & Continue"})]})]})]})}function a$({data:e,update:t,next:r,back:n}){const[a,i]=O.useState(null),[o,l]=O.useState(null),[c,u]=O.useState(!0),[d,f]=O.useState(!1);O.useEffect(()=>{h()},[]);async function h(){u(!0);try{const x=await pe("/kalshi",{action:"test_connection"});i(x),x.success&&e.keys&&!e.skippedConnect&&p()}catch{i({error:!0})}u(!1)}async function p(){f(!0);try{const x=await pe("/kalshi",{action:"get_balance"});l(x),x.success&&t({connectionOk:!0})}catch{l({error:!0})}f(!1)}const v=e.skippedConnect,b=({title:x,loading:y,result:m,skippedMsg:g})=>s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[g?s.jsx("div",{className:"w-5 h-5 rounded-full bg-yellow-500 flex items-center justify-center",children:s.jsx("span",{className:"text-white text-xs font-bold",children:"—"})}):y?s.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-amber-500 border-t-transparent rounded-full"}):m!=null&&m.success?s.jsx("div",{className:"w-5 h-5 rounded-full bg-green-500 flex items-center justify-center",children:s.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}):m!=null&&m.error?s.jsx("div",{className:"w-5 h-5 rounded-full bg-red-500 flex items-center justify-center",children:s.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}):s.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-600"}),s.jsx("h3",{className:"font-semibold text-sm",children:x})]}),g?s.jsx("p",{className:"text-xs text-yellow-400",children:g}):m!=null&&m.success?s.jsxs("div",{className:"space-y-1 text-xs text-gray-400",children:[m.exchange_status&&s.jsxs("p",{children:["Exchange: ",s.jsx("span",{className:"text-green-400 font-mono",children:m.exchange_status})]}),m.balance!==void 0&&s.jsxs("p",{children:["Balance: ",s.jsxs("span",{className:"text-green-400 font-mono",children:["$",(m.balance/100).toFixed(2)]})]}),m.env&&s.jsxs("p",{children:["Env: ",s.jsx("span",{className:"text-amber-400 font-mono",children:m.env.toUpperCase()})]})]}):m!=null&&m.error?s.jsx("p",{className:"text-xs text-red-400",children:typeof m.error=="string"?m.error:"Connection failed"}):null]});return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Let's See If This Thing Works"}),s.jsx("p",{className:"text-gray-400 text-sm",children:"I'm checking your wiring. Hold your horses."})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(b,{title:"Is Ken Even Open?",loading:c,result:a}),s.jsx(b,{title:"Do They Know Who You Are?",loading:d,result:o,skippedMsg:v?"You skipped this — playing pretend, remember?":e.keys?null:"No keys, no entry. What did you expect?"})]}),!c&&!d&&s.jsx("div",{className:"flex justify-center",children:s.jsx("button",{onClick:h,className:"text-xs text-gray-500 hover:text-gray-300",children:"Try again, maybe this time it'll listen"})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),s.jsx("button",{onClick:r,className:"btn btn-p",children:"Continue"})]})]})}function i$({data:e,update:t,next:r,back:n}){var h,p;const[a,i]=O.useState(!0),[o,l]=O.useState(null),[c,u]=O.useState(null);O.useEffect(()=>{d()},[]);async function d(){var v;i(!0),u(null);try{const b=await pe("/kalshi",{action:"get_events",params:{status:"open",limit:50}});l(b);const x=((v=b.events)==null?void 0:v.length)||0;t({marketsLoaded:x})}catch{u("Failed to load markets")}i(!1)}const f=((o==null?void 0:o.events)||[]).filter(v=>(v.category||"").toLowerCase().includes("climate")||(v.category||"").toLowerCase().includes("weather")||(v.title||"").toLowerCase().includes("temperature")||(v.title||"").toLowerCase().includes("rain")||(v.title||"").toLowerCase().includes("snow")||(v.title||"").toLowerCase().includes("precipitation"));return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Let's See What They're Selling"}),s.jsx("p",{className:"text-gray-400 text-sm",children:"I'm snooping through the markets. You're welcome."})]}),s.jsx("div",{className:"card",children:a?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[s.jsx("div",{className:"animate-spin w-10 h-10 border-3 border-amber-500 border-t-transparent rounded-full"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Schlepping markets from Ken... patience is a virtue"})]}):c?s.jsxs("div",{className:"text-center py-8",children:[s.jsx("p",{className:"text-red-400 text-sm mb-3",children:c}),s.jsx("button",{onClick:d,className:"btn btn-s text-sm",children:"Retry"})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"stat-v text-amber-400",children:((h=o==null?void 0:o.events)==null?void 0:h.length)||0}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Things to Bet On"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"stat-v text-blue-400",children:f.length}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Weather Bets (Our Thing)"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"stat-v text-green-400",children:((p=o==null?void 0:o.markets)==null?void 0:p.length)||"—"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Individual Contracts"})]})]}),f.length>0&&s.jsxs("div",{className:"border-t border-gray-800 pt-3",children:[s.jsx("p",{className:"text-xs text-gray-500 mb-2 uppercase font-medium",children:"Weather Bets I Found For You"}),s.jsx("div",{className:"space-y-1.5 max-h-48 overflow-y-auto",children:f.slice(0,12).map((v,b)=>s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 flex-shrink-0"}),s.jsx("span",{className:"text-gray-300 truncate",children:v.title}),s.jsx("span",{className:"text-gray-600 ml-auto font-mono text-[10px]",children:v.event_ticker})]},b))})]}),f.length===0&&s.jsx("p",{className:"text-center text-gray-500 text-sm py-4",children:"No weather bets right now. What, the weather took a day off? Other markets are there at least."})]})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),s.jsx("button",{onClick:r,disabled:a,className:"btn btn-p",children:a?"Loading...":"Continue"})]})]})}function o$({data:e,update:t,next:r,back:n}){var f;const[a,i]=O.useState(!0),[o,l]=O.useState(null),[c,u]=O.useState(null);O.useEffect(()=>{d()},[]);async function d(){i(!0),u(null);try{const h=await pe("/weather",{action:"fetch_all"});l(h),t({weatherFetched:!0})}catch{u("Failed to fetch weather data")}i(!1)}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Checking the Weather, Darling"}),s.jsx("p",{className:"text-gray-400 text-sm",children:"I'm schlepping in the government weather reports. In my day we just looked outside."})]}),s.jsx("div",{className:"card",children:a?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[s.jsx("div",{className:"animate-spin w-10 h-10 border-3 border-blue-500 border-t-transparent rounded-full"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Fetching from the National Weather Service... they take their sweet time"})]}):c?s.jsxs("div",{className:"text-center py-8",children:[s.jsx("p",{className:"text-red-400 text-sm mb-3",children:c}),s.jsx("button",{onClick:d,className:"btn btn-s text-sm",children:"Retry"})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-center gap-3 py-4",children:[s.jsx("div",{className:"w-12 h-12 rounded-full bg-green-500/10 flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-green-400",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold text-green-400",children:"Got the Weather, Finally"}),s.jsx("p",{className:"text-xs text-gray-400",children:"All the fancy government data, right here in your tuchas seat"})]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"text-center p-3 bg-gray-800/30 rounded-lg",children:[s.jsx("p",{className:"stat-v text-blue-400",children:(o==null?void 0:o.stations)||"—"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Stations"})]}),s.jsxs("div",{className:"text-center p-3 bg-gray-800/30 rounded-lg",children:[s.jsx("p",{className:"stat-v text-amber-400",children:(o==null?void 0:o.data_points)||"—"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Data Points"})]}),s.jsxs("div",{className:"text-center p-3 bg-gray-800/30 rounded-lg",children:[s.jsx("p",{className:"stat-v text-green-400",children:((f=o==null?void 0:o.metrics)==null?void 0:f.length)||"—"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Metrics"})]})]})]})}),s.jsxs("div",{className:"card bg-gray-800/30",children:[s.jsx("p",{className:"text-xs text-gray-500 mb-1 font-medium",children:"How They Settle (Pay Attention)"}),s.jsxs("p",{className:"text-xs text-gray-400",children:["Ken settles on the ",s.jsx("span",{className:"text-amber-400",children:"final NWS Daily Climate Report"}),". A trace of rain? That's zero. Missing data? Also zero. And listen — the first report is the last word. They don't go back and change it, even if the weatherman was wrong. Such is life."]})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),s.jsx("button",{onClick:r,disabled:a,className:"btn btn-p",children:a?"Fetching...":"Continue"})]})]})}function s$({data:e,update:t,next:r,back:n}){const[a,i]=O.useState(!0),[o,l]=O.useState(null),[c,u]=O.useState(null);O.useEffect(()=>{d()},[]);async function d(){i(!0),u(null);try{const p=await pe("/kalshi",{action:"run_predictions"});l(p),t({predictionsRun:!0})}catch{u("Failed to generate predictions")}i(!1)}const f=(o==null?void 0:o.predictions)||[],h=f.filter(p=>(p.edge_bps||0)>0);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"The Machine Is Thinking"}),s.jsx("p",{className:"text-gray-400 text-sm",children:"Running the numbers so you don't have to use that head of yours"})]}),s.jsx("div",{className:"card",children:a?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[s.jsx("div",{className:"animate-spin w-10 h-10 border-3 border-green-500 border-t-transparent rounded-full"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Crunching numbers... in my day we did this with an abacus"})]}):c?s.jsxs("div",{className:"text-center py-8",children:[s.jsx("p",{className:"text-red-400 text-sm mb-3",children:c}),s.jsx("button",{onClick:d,className:"btn btn-s text-sm",children:"Retry"})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"stat-v text-amber-400",children:f.length}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Opinions"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"stat-v text-green-400",children:h.length}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Worth a Look"})]}),s.jsxs("div",{className:"text-center",children:[s.jsxs("p",{className:"stat-v text-blue-400",children:[(o==null?void 0:o.avg_edge_bps)||0,"bps"]}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Your Edge (God Willing)"})]})]}),f.length>0&&s.jsx("div",{className:"border-t border-gray-800 pt-3",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Contract"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Price"}),s.jsx("th",{children:"Edge"}),s.jsx("th",{children:"Signal"})]})}),s.jsx("tbody",{children:f.slice(0,6).map((p,v)=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-[180px]",children:s.jsx("span",{className:"truncate block text-xs",children:p.ticker||p.market})}),s.jsx("td",{children:s.jsx("span",{className:`badge ${p.side==="yes"?"bg-green":"bg-red"}`,children:(p.side||"yes").toUpperCase()})}),s.jsxs("td",{className:"font-mono text-sm",children:[p.price_cents||"—","c"]}),s.jsxs("td",{className:`font-mono text-sm ${(p.edge_bps||0)>0?"text-green-400":"text-gray-500"}`,children:[p.edge_bps||0,"bps"]}),s.jsx("td",{children:s.jsx("span",{className:`badge ${(p.edge_bps||0)>0?"bg-green":"bg-yellow"}`,children:(p.edge_bps||0)>0?"BUY":"HOLD"})})]},v))})]})})]})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),s.jsx("button",{onClick:r,disabled:a,className:"btn btn-p",children:a?"Processing...":"Continue"})]})]})}const Ky=[{name:"Conservative",maxContracts:5,maxDollars:25,dailyLoss:10,color:"blue",desc:"Like your bubbe taught you — small bets, tight grip on the purse strings."},{name:"Moderate",maxContracts:20,maxDollars:100,dailyLoss:50,color:"amber",desc:"Not too much, not too little. Like Goldilocks, but with money.",recommended:!0},{name:"Aggressive",maxContracts:50,maxDollars:500,dailyLoss:200,color:"red",desc:"What are you, a big shot? Don't come crying to me when it goes sideways."}];function l$({data:e,update:t,next:r,back:n}){const[a,i]=O.useState(e.riskProfile||"Moderate"),[o,l]=O.useState(!1);async function c(){l(!0);const u=Ky.find(d=>d.name===a);try{await pe("/risk",{action:"update_config",max_contracts_per_market:u.maxContracts,max_dollars_at_risk:u.maxDollars,daily_loss_cap:u.dailyLoss,risk_profile:u.name}),t({riskProfile:a}),r()}catch{}l(!1)}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"How Much Are You Willing to Lose?"}),s.jsx("p",{className:"text-gray-400 text-sm",children:'Pick one. And no, "all of it" is not an option.'})]}),s.jsx("div",{className:"grid grid-cols-3 gap-4",children:Ky.map(u=>{const f={blue:{ring:"#3b82f6",text:"text-blue-400"},amber:{ring:"#f59e0b",text:"text-amber-400"},red:{ring:"#ef4444",text:"text-red-400"}}[u.color];return s.jsxs("button",{onClick:()=>i(u.name),className:"card text-left transition-all relative",style:a===u.name?{boxShadow:`0 0 0 2px ${f.ring}`}:{},children:[u.recommended&&s.jsx("span",{className:"absolute -top-2 right-3 text-[9px] font-bold uppercase px-2 py-0.5 rounded-full bg-amber-500 text-black",children:"Recommended"}),s.jsx("h3",{className:`font-bold text-lg mb-1 ${f.text}`,children:u.name}),s.jsx("p",{className:"text-xs text-gray-500 mb-3",children:u.desc}),s.jsxs("div",{className:"space-y-1.5 text-xs",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"Max Contracts"}),s.jsx("span",{className:"font-mono text-gray-300",children:u.maxContracts})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"Max $ at Risk"}),s.jsxs("span",{className:"font-mono text-gray-300",children:["$",u.maxDollars]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"Daily Loss Cap"}),s.jsxs("span",{className:"font-mono text-gray-300",children:["$",u.dailyLoss]})]})]})]},u.name)})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),s.jsx("button",{onClick:c,disabled:o,className:"btn btn-p",children:o?"Saving...":"Save & Continue"})]})]})}const vd=[{key:"keys",label:"Gave me the API keys (good)",check:e=>!!e.keys},{key:"conn",label:"Connection actually works (miracle)",check:e=>!!e.connectionOk},{key:"markets",label:"Found some markets to bet on",check:e=>e.marketsLoaded>0},{key:"weather",label:"Got the weather data (finally)",check:e=>!!e.weatherFetched},{key:"preds",label:"The machine made its predictions",check:e=>!!e.predictionsRun},{key:"risk",label:"Set some limits (smart)",check:e=>!!e.riskProfile}];function c$({data:e,complete:t,back:r}){const[n,a]=O.useState(!0),[i,o]=O.useState(!1),l=vd.filter(d=>d.check(e)).length,c=e.skippedConnect;async function u(){o(!0),await t()}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Alright, Mazel Tov"}),s.jsx("p",{className:"text-gray-400 text-sm",children:"Let's see if you actually did everything right. I have my doubts."})]}),s.jsxs("div",{className:"card",children:[s.jsx("h3",{className:"font-semibold text-sm mb-3",children:"Your Report Card"}),s.jsx("div",{className:"space-y-2",children:vd.map(d=>{const f=d.check(e),h=d.key==="keys"&&c;return s.jsxs("div",{className:"flex items-center gap-3",children:[f?s.jsx("div",{className:"w-5 h-5 rounded-full bg-green-500 flex items-center justify-center flex-shrink-0",children:s.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}):h?s.jsx("div",{className:"w-5 h-5 rounded-full bg-yellow-500 flex items-center justify-center flex-shrink-0",children:s.jsx("span",{className:"text-white text-[10px] font-bold",children:"—"})}):s.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-700 flex-shrink-0"}),s.jsxs("span",{className:`text-sm ${f?"text-gray-200":h?"text-yellow-400":"text-gray-500"}`,children:[d.label,h?" (skipped)":""]})]},d.key)})}),s.jsxs("p",{className:"text-xs text-gray-500 mt-3 pt-3 border-t border-gray-800",children:[l,"/",vd.length," steps completed"]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"card text-center",children:[s.jsx("p",{className:"stat-v text-amber-400",children:e.marketsLoaded||0}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Markets"})]}),s.jsxs("div",{className:"card text-center",children:[s.jsx("p",{className:"stat-v text-blue-400",children:e.riskProfile||"—"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Risk Profile"})]}),s.jsxs("div",{className:"card text-center",children:[s.jsx("p",{className:"stat-v text-green-400",children:e.keys?(e.keys.env||"demo").toUpperCase():"PAPER"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Mode"})]})]}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-sm",children:"Safe Mode (I Recommend It)"}),s.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:n?"Paper trading — playing pretend, like a sensible person":"Live orders! With real money! Oy gevalt."})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:`text-xs font-medium ${n?"text-yellow-400":"text-gray-500"}`,children:"Safe"}),s.jsx("button",{onClick:()=>a(!n),disabled:!e.keys,className:`w-11 h-6 rounded-full transition-colors relative ${n?"bg-yellow-500/30":"bg-green-500/30"} ${e.keys?"":"opacity-50 cursor-not-allowed"}`,children:s.jsx("div",{className:`w-4 h-4 rounded-full absolute top-1 transition-all ${n?"left-1 bg-yellow-400":"left-6 bg-green-400"}`})}),s.jsx("span",{className:`text-xs font-medium ${n?"text-gray-500":"text-green-400"}`,children:"Live"})]})]}),!n&&s.jsx("div",{className:"mt-3 p-2 bg-red-500/10 border border-red-500/20 rounded-lg",children:s.jsx("p",{className:"text-xs text-red-400",children:"Live mode means real money, bubeleh. Real. Money. Don't say I didn't warn you. Make sure you've got funds and your limits are set, or so help me."})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("button",{onClick:r,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),s.jsx("button",{onClick:u,disabled:i,className:"btn btn-p text-lg px-8 py-3 rounded-xl font-bold",children:i?"Starting up, hold your horses...":"Go Make Some Gelt Already"})]})]})}const $l=[{label:"Shalom",icon:"1"},{label:"Keys",icon:"2"},{label:"Test It",icon:"3"},{label:"Snoop",icon:"4"},{label:"Weather",icon:"5"},{label:"Predict",icon:"6"},{label:"Limits",icon:"7"},{label:"Mazel Tov",icon:"8"}],u$=[r$,n$,a$,i$,o$,s$,l$,c$];function f$(){const e=Xu(),[t,r]=O.useState(!1),[n,a]=O.useState(0),[i,o]=O.useState({keys:null,connectionOk:!1,marketsLoaded:0,weatherFetched:!1,predictionsRun:!1,riskProfile:null});O.useEffect(()=>{m0().then(p=>{if(!p){e("/login");return}r(!0),Pe("/setup").then(v=>{if(v.setup_complete){e("/");return}v.setup_progress&&(a(v.setup_progress.step||0),o(b=>({...b,...v.setup_progress.data})))}).catch(()=>{})})},[]),O.useEffect(()=>{t&&n>0&&pe("/setup",{action:"save_progress",progress:{step:n,data:i}}).catch(()=>{})},[n]);function l(){n<$l.length-1&&a(p=>p+1)}function c(){n>0&&a(p=>p-1)}function u(p){p<=n&&a(p)}function d(p){o(v=>({...v,...p}))}async function f(){await pe("/setup",{action:"complete",progress:{step:$l.length-1,data:i}}),e("/")}if(!t)return s.jsx("div",{className:"flex items-center justify-center min-h-screen",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})});const h=u$[n];return s.jsxs("div",{className:"min-h-screen flex flex-col",style:{background:"var(--bg)"},children:[s.jsxs("div",{className:"flex items-center gap-3 px-6 py-4 border-b border-gray-800",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"linear-gradient(135deg,#f59e0b,#f97316)"},children:s.jsx("span",{className:"text-black font-bold text-sm",children:"K"})}),s.jsx("span",{className:"font-bold text-sm kalshi-gradient",children:"KEN SETUP — SIT, WE'LL TALK"})]}),s.jsx("div",{className:"px-6 py-5",children:s.jsx("div",{className:"max-w-3xl mx-auto flex items-center",children:$l.map((p,v)=>s.jsxs(E.Fragment,{children:[s.jsxs("button",{onClick:()=>u(v),disabled:v>n,className:"flex flex-col items-center gap-1.5 group",style:{minWidth:56},children:[s.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold transition-all ${v<n?"bg-green-500 text-white":v===n?"bg-amber-500 text-black":"bg-gray-800 text-gray-500"} ${v<=n?"cursor-pointer":"cursor-default"}`,style:v===n?{animation:"pg 2s infinite"}:{},children:v<n?s.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):p.icon}),s.jsx("span",{className:`text-[10px] font-medium ${v<n?"text-green-400":v===n?"text-amber-400":"text-gray-600"}`,children:p.label})]}),v<$l.length-1&&s.jsx("div",{className:`h-0.5 flex-1 transition-colors ${v<n?"bg-green-500":"bg-gray-800"}`})]},v))})}),s.jsx("div",{className:"flex-1 flex items-start justify-center px-6 pb-10",children:s.jsx("div",{className:"w-full max-w-2xl",children:s.jsx(h,{data:i,update:d,next:l,back:c,complete:f,step:n})},n)})]})}function xS(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=xS(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function te(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=xS(e))&&(n&&(n+=" "),n+=t);return n}var d$=Array.isArray,kt=d$,h$=typeof dl=="object"&&dl&&dl.Object===Object&&dl,bS=h$,p$=bS,m$=typeof self=="object"&&self&&self.Object===Object&&self,g$=p$||m$||Function("return this")(),Nr=g$,y$=Nr,v$=y$.Symbol,il=v$,Vy=il,jS=Object.prototype,x$=jS.hasOwnProperty,b$=jS.toString,bo=Vy?Vy.toStringTag:void 0;function j$(e){var t=x$.call(e,bo),r=e[bo];try{e[bo]=void 0;var n=!0}catch{}var a=b$.call(e);return n&&(t?e[bo]=r:delete e[bo]),a}var w$=j$,S$=Object.prototype,_$=S$.toString;function N$(e){return _$.call(e)}var O$=N$,Gy=il,P$=w$,k$=O$,A$="[object Null]",$$="[object Undefined]",Yy=Gy?Gy.toStringTag:void 0;function E$(e){return e==null?e===void 0?$$:A$:Yy&&Yy in Object(e)?P$(e):k$(e)}var Xr=E$;function C$(e){return e!=null&&typeof e=="object"}var Qr=C$,T$=Xr,M$=Qr,I$="[object Symbol]";function L$(e){return typeof e=="symbol"||M$(e)&&T$(e)==I$}var Qi=L$,D$=kt,R$=Qi,B$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F$=/^\w*$/;function z$(e,t){if(D$(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||R$(e)?!0:F$.test(e)||!B$.test(e)||t!=null&&e in Object(t)}var g0=z$;function U$(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Cn=U$;const Zi=fe(Cn);var W$=Xr,H$=Cn,K$="[object AsyncFunction]",V$="[object Function]",G$="[object GeneratorFunction]",Y$="[object Proxy]";function q$(e){if(!H$(e))return!1;var t=W$(e);return t==V$||t==G$||t==K$||t==Y$}var y0=q$;const Z=fe(y0);var X$=Nr,Q$=X$["__core-js_shared__"],Z$=Q$,xd=Z$,qy=function(){var e=/[^.]+$/.exec(xd&&xd.keys&&xd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function J$(e){return!!qy&&qy in e}var eE=J$,tE=Function.prototype,rE=tE.toString;function nE(e){if(e!=null){try{return rE.call(e)}catch{}try{return e+""}catch{}}return""}var wS=nE,aE=y0,iE=eE,oE=Cn,sE=wS,lE=/[\\^$.*+?()[\]{}|]/g,cE=/^\[object .+?Constructor\]$/,uE=Function.prototype,fE=Object.prototype,dE=uE.toString,hE=fE.hasOwnProperty,pE=RegExp("^"+dE.call(hE).replace(lE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mE(e){if(!oE(e)||iE(e))return!1;var t=aE(e)?pE:cE;return t.test(sE(e))}var gE=mE;function yE(e,t){return e==null?void 0:e[t]}var vE=yE,xE=gE,bE=vE;function jE(e,t){var r=bE(e,t);return xE(r)?r:void 0}var Oa=jE,wE=Oa,SE=wE(Object,"create"),Qu=SE,Xy=Qu;function _E(){this.__data__=Xy?Xy(null):{},this.size=0}var NE=_E;function OE(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var PE=OE,kE=Qu,AE="__lodash_hash_undefined__",$E=Object.prototype,EE=$E.hasOwnProperty;function CE(e){var t=this.__data__;if(kE){var r=t[e];return r===AE?void 0:r}return EE.call(t,e)?t[e]:void 0}var TE=CE,ME=Qu,IE=Object.prototype,LE=IE.hasOwnProperty;function DE(e){var t=this.__data__;return ME?t[e]!==void 0:LE.call(t,e)}var RE=DE,BE=Qu,FE="__lodash_hash_undefined__";function zE(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=BE&&t===void 0?FE:t,this}var UE=zE,WE=NE,HE=PE,KE=TE,VE=RE,GE=UE;function Ji(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ji.prototype.clear=WE;Ji.prototype.delete=HE;Ji.prototype.get=KE;Ji.prototype.has=VE;Ji.prototype.set=GE;var YE=Ji;function qE(){this.__data__=[],this.size=0}var XE=qE;function QE(e,t){return e===t||e!==e&&t!==t}var v0=QE,ZE=v0;function JE(e,t){for(var r=e.length;r--;)if(ZE(e[r][0],t))return r;return-1}var Zu=JE,eC=Zu,tC=Array.prototype,rC=tC.splice;function nC(e){var t=this.__data__,r=eC(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():rC.call(t,r,1),--this.size,!0}var aC=nC,iC=Zu;function oC(e){var t=this.__data__,r=iC(t,e);return r<0?void 0:t[r][1]}var sC=oC,lC=Zu;function cC(e){return lC(this.__data__,e)>-1}var uC=cC,fC=Zu;function dC(e,t){var r=this.__data__,n=fC(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var hC=dC,pC=XE,mC=aC,gC=sC,yC=uC,vC=hC;function eo(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}eo.prototype.clear=pC;eo.prototype.delete=mC;eo.prototype.get=gC;eo.prototype.has=yC;eo.prototype.set=vC;var Ju=eo,xC=Oa,bC=Nr,jC=xC(bC,"Map"),x0=jC,Qy=YE,wC=Ju,SC=x0;function _C(){this.size=0,this.__data__={hash:new Qy,map:new(SC||wC),string:new Qy}}var NC=_C;function OC(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var PC=OC,kC=PC;function AC(e,t){var r=e.__data__;return kC(t)?r[typeof t=="string"?"string":"hash"]:r.map}var ef=AC,$C=ef;function EC(e){var t=$C(this,e).delete(e);return this.size-=t?1:0,t}var CC=EC,TC=ef;function MC(e){return TC(this,e).get(e)}var IC=MC,LC=ef;function DC(e){return LC(this,e).has(e)}var RC=DC,BC=ef;function FC(e,t){var r=BC(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var zC=FC,UC=NC,WC=CC,HC=IC,KC=RC,VC=zC;function to(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}to.prototype.clear=UC;to.prototype.delete=WC;to.prototype.get=HC;to.prototype.has=KC;to.prototype.set=VC;var b0=to,SS=b0,GC="Expected a function";function j0(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(GC);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(j0.Cache||SS),r}j0.Cache=SS;var _S=j0;const YC=fe(_S);var qC=_S,XC=500;function QC(e){var t=qC(e,function(n){return r.size===XC&&r.clear(),n}),r=t.cache;return t}var ZC=QC,JC=ZC,eT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tT=/\\(\\)?/g,rT=JC(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(eT,function(r,n,a,i){t.push(a?i.replace(tT,"$1"):n||r)}),t}),nT=rT;function aT(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}var w0=aT,Zy=il,iT=w0,oT=kt,sT=Qi,Jy=Zy?Zy.prototype:void 0,ev=Jy?Jy.toString:void 0;function NS(e){if(typeof e=="string")return e;if(oT(e))return iT(e,NS)+"";if(sT(e))return ev?ev.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var lT=NS,cT=lT;function uT(e){return e==null?"":cT(e)}var OS=uT,fT=kt,dT=g0,hT=nT,pT=OS;function mT(e,t){return fT(e)?e:dT(e,t)?[e]:hT(pT(e))}var PS=mT,gT=Qi;function yT(e){if(typeof e=="string"||gT(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var tf=yT,vT=PS,xT=tf;function bT(e,t){t=vT(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[xT(t[r++])];return r&&r==n?e:void 0}var S0=bT,jT=S0;function wT(e,t,r){var n=e==null?void 0:jT(e,t);return n===void 0?r:n}var kS=wT;const It=fe(kS);function ST(e){return e==null}var _T=ST;const J=fe(_T);var NT=Xr,OT=kt,PT=Qr,kT="[object String]";function AT(e){return typeof e=="string"||!OT(e)&&PT(e)&&NT(e)==kT}var $T=AT;const ga=fe($T);var AS={exports:{}},de={};/**
- * @license React
- * react-is.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var _0=Symbol.for("react.element"),N0=Symbol.for("react.portal"),rf=Symbol.for("react.fragment"),nf=Symbol.for("react.strict_mode"),af=Symbol.for("react.profiler"),of=Symbol.for("react.provider"),sf=Symbol.for("react.context"),ET=Symbol.for("react.server_context"),lf=Symbol.for("react.forward_ref"),cf=Symbol.for("react.suspense"),uf=Symbol.for("react.suspense_list"),ff=Symbol.for("react.memo"),df=Symbol.for("react.lazy"),CT=Symbol.for("react.offscreen"),$S;$S=Symbol.for("react.module.reference");function Jt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case _0:switch(e=e.type,e){case rf:case af:case nf:case cf:case uf:return e;default:switch(e=e&&e.$$typeof,e){case ET:case sf:case lf:case df:case ff:case of:return e;default:return t}}case N0:return t}}}de.ContextConsumer=sf;de.ContextProvider=of;de.Element=_0;de.ForwardRef=lf;de.Fragment=rf;de.Lazy=df;de.Memo=ff;de.Portal=N0;de.Profiler=af;de.StrictMode=nf;de.Suspense=cf;de.SuspenseList=uf;de.isAsyncMode=function(){return!1};de.isConcurrentMode=function(){return!1};de.isContextConsumer=function(e){return Jt(e)===sf};de.isContextProvider=function(e){return Jt(e)===of};de.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===_0};de.isForwardRef=function(e){return Jt(e)===lf};de.isFragment=function(e){return Jt(e)===rf};de.isLazy=function(e){return Jt(e)===df};de.isMemo=function(e){return Jt(e)===ff};de.isPortal=function(e){return Jt(e)===N0};de.isProfiler=function(e){return Jt(e)===af};de.isStrictMode=function(e){return Jt(e)===nf};de.isSuspense=function(e){return Jt(e)===cf};de.isSuspenseList=function(e){return Jt(e)===uf};de.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===rf||e===af||e===nf||e===cf||e===uf||e===CT||typeof e=="object"&&e!==null&&(e.$$typeof===df||e.$$typeof===ff||e.$$typeof===of||e.$$typeof===sf||e.$$typeof===lf||e.$$typeof===$S||e.getModuleId!==void 0)};de.typeOf=Jt;AS.exports=de;var TT=AS.exports,MT=Xr,IT=Qr,LT="[object Number]";function DT(e){return typeof e=="number"||IT(e)&&MT(e)==LT}var ES=DT;const RT=fe(ES);var BT=ES;function FT(e){return BT(e)&&e!=+e}var zT=FT;const ro=fe(zT);var dt=function(t){return t===0?0:t>0?1:-1},ta=function(t){return ga(t)&&t.indexOf("%")===t.length-1},W=function(t){return RT(t)&&!ro(t)},UT=function(t){return J(t)},Ge=function(t){return W(t)||ga(t)},WT=0,no=function(t){var r=++WT;return"".concat(t||"").concat(r)},ht=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!W(t)&&!ga(t))return n;var i;if(ta(t)){var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return ro(i)&&(i=n),a&&i>r&&(i=r),i},cn=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},HT=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a<r;a++)if(!n[t[a]])n[t[a]]=!0;else return!0;return!1},wt=function(t,r){return W(t)&&W(r)?function(n){return t+n*(r-t)}:function(){return r}};function Ec(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):It(n,t))===r})}var KT=function(t,r){return W(t)&&W(r)?t-r:ga(t)&&ga(r)?t.localeCompare(r):t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():String(t).localeCompare(String(r))};function si(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function Kh(e){"@babel/helpers - typeof";return Kh=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},Kh(e)}var VT=["viewBox","children"],GT=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],tv=["points","pathLength"],bd={svg:VT,polygon:tv,polyline:tv},O0=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Cc=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(O.isValidElement(t)&&(n=t.props),!Zi(n))return null;var a={};return Object.keys(n).forEach(function(i){O0.includes(i)&&(a[i]=r||function(o){return n[i](n,o)})}),a},YT=function(t,r,n){return function(a){return t(r,n,a),null}},ya=function(t,r,n){if(!Zi(t)||Kh(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];O0.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=YT(o,r,n))}),a},qT=["children"],XT=["children"];function rv(e,t){if(e==null)return{};var r=QT(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function QT(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Vh(e){"@babel/helpers - typeof";return Vh=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},Vh(e)}var nv={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"},Br=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},av=null,jd=null,P0=function e(t){if(t===av&&Array.isArray(jd))return jd;var r=[];return O.Children.forEach(t,function(n){J(n)||(TT.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),jd=r,av=t,r};function qt(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return Br(a)}):n=[Br(t)],P0(e).forEach(function(a){var i=It(a,"type.displayName")||It(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function Et(e,t){var r=qt(e,t);return r&&r[0]}var iv=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!W(n)||n<=0||!W(a)||a<=0)},ZT=["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"],JT=function(t){return t&&t.type&&ga(t.type)&&ZT.indexOf(t.type)>=0},e5=function(t){return t&&Vh(t)==="object"&&"clipDot"in t},t5=function(t,r,n,a){var i,o=(i=bd==null?void 0:bd[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!Z(t)&&(a&&o.includes(r)||GT.includes(r))||n&&O0.includes(r)},X=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(O.isValidElement(t)&&(a=t.props),!Zi(a))return null;var i={};return Object.keys(a).forEach(function(o){var l;t5((l=a)===null||l===void 0?void 0:l[o],o,r,n)&&(i[o]=a[o])}),i},Gh=function e(t,r){if(t===r)return!0;var n=O.Children.count(t);if(n!==O.Children.count(r))return!1;if(n===0)return!0;if(n===1)return ov(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a<n;a++){var i=t[a],o=r[a];if(Array.isArray(i)||Array.isArray(o)){if(!e(i,o))return!1}else if(!ov(i,o))return!1}return!0},ov=function(t,r){if(J(t)&&J(r))return!0;if(!J(t)&&!J(r)){var n=t.props||{},a=n.children,i=rv(n,qT),o=r.props||{},l=o.children,c=rv(o,XT);return a&&l?si(i,c)&&Gh(a,l):!a&&!l?si(i,c):!1}return!1},sv=function(t,r){var n=[],a={};return P0(t).forEach(function(i,o){if(JT(i))n.push(i);else if(i){var l=Br(i.type),c=r[l]||{},u=c.handler,d=c.once;if(u&&(!d||!a[l])){var f=u(i,l,o);n.push(f),a[l]=!0}}}),n},r5=function(t){var r=t&&t.type;return r&&nv[r]?nv[r]:null},n5=function(t,r){return P0(r).indexOf(t)},a5=["children","width","height","viewBox","className","style","title","desc"];function Yh(){return Yh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yh.apply(this,arguments)}function i5(e,t){if(e==null)return{};var r=o5(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function o5(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function qh(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,o=e.style,l=e.title,c=e.desc,u=i5(e,a5),d=a||{width:r,height:n,x:0,y:0},f=te("recharts-surface",i);return E.createElement("svg",Yh({},X(u,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),E.createElement("title",null,l),E.createElement("desc",null,c),t)}var s5=["children","className"];function Xh(){return Xh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xh.apply(this,arguments)}function l5(e,t){if(e==null)return{};var r=c5(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c5(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var ae=E.forwardRef(function(e,t){var r=e.children,n=e.className,a=l5(e,s5),i=te("recharts-layer",n);return E.createElement("g",Xh({className:i},X(a,!0),{ref:t}),r)}),ur=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i]};function u5(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n<a;)i[n]=e[n+t];return i}var f5=u5,d5=f5;function h5(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:d5(e,t,r)}var p5=h5,m5="\\ud800-\\udfff",g5="\\u0300-\\u036f",y5="\\ufe20-\\ufe2f",v5="\\u20d0-\\u20ff",x5=g5+y5+v5,b5="\\ufe0e\\ufe0f",j5="\\u200d",w5=RegExp("["+j5+m5+x5+b5+"]");function S5(e){return w5.test(e)}var CS=S5;function _5(e){return e.split("")}var N5=_5,TS="\\ud800-\\udfff",O5="\\u0300-\\u036f",P5="\\ufe20-\\ufe2f",k5="\\u20d0-\\u20ff",A5=O5+P5+k5,$5="\\ufe0e\\ufe0f",E5="["+TS+"]",Qh="["+A5+"]",Zh="\\ud83c[\\udffb-\\udfff]",C5="(?:"+Qh+"|"+Zh+")",MS="[^"+TS+"]",IS="(?:\\ud83c[\\udde6-\\uddff]){2}",LS="[\\ud800-\\udbff][\\udc00-\\udfff]",T5="\\u200d",DS=C5+"?",RS="["+$5+"]?",M5="(?:"+T5+"(?:"+[MS,IS,LS].join("|")+")"+RS+DS+")*",I5=RS+DS+M5,L5="(?:"+[MS+Qh+"?",Qh,IS,LS,E5].join("|")+")",D5=RegExp(Zh+"(?="+Zh+")|"+L5+I5,"g");function R5(e){return e.match(D5)||[]}var B5=R5,F5=N5,z5=CS,U5=B5;function W5(e){return z5(e)?U5(e):F5(e)}var H5=W5,K5=p5,V5=CS,G5=H5,Y5=OS;function q5(e){return function(t){t=Y5(t);var r=V5(t)?G5(t):void 0,n=r?r[0]:t.charAt(0),a=r?K5(r,1).join(""):t.slice(1);return n[e]()+a}}var X5=q5,Q5=X5,Z5=Q5("toUpperCase"),J5=Z5;const hf=fe(J5);function ye(e){return function(){return e}}const BS=Math.cos,Tc=Math.sin,dr=Math.sqrt,Mc=Math.PI,pf=2*Mc,Jh=Math.PI,ep=2*Jh,Yn=1e-6,e4=ep-Yn;function FS(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function t4(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return FS;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;a<i;++a)this._+=Math.round(arguments[a]*r)/r+n[a]}}class r4{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?FS:t4(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,a){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+a}`}bezierCurveTo(t,r,n,a,i,o){this._append`C${+t},${+r},${+n},${+a},${this._x1=+i},${this._y1=+o}`}arcTo(t,r,n,a,i){if(t=+t,r=+r,n=+n,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,l=this._y1,c=n-t,u=a-r,d=o-t,f=l-r,h=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>Yn)if(!(Math.abs(f*c-u*d)>Yn)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,v=a-l,b=c*c+u*u,x=p*p+v*v,y=Math.sqrt(b),m=Math.sqrt(h),g=i*Math.tan((Jh-Math.acos((b+h-x)/(2*y*m)))/2),S=g/m,j=g/y;Math.abs(S-1)>Yn&&this._append`L${t+S*d},${r+S*f}`,this._append`A${i},${i},0,0,${+(f*p>d*v)},${this._x1=t+j*c},${this._y1=r+j*u}`}}arc(t,r,n,a,i,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(a),c=n*Math.sin(a),u=t+l,d=r+c,f=1^o,h=o?a-i:i-a;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Yn||Math.abs(this._y1-d)>Yn)&&this._append`L${u},${d}`,n&&(h<0&&(h=h%ep+ep),h>e4?this._append`A${n},${n},0,1,${f},${t-l},${r-c}A${n},${n},0,1,${f},${this._x1=u},${this._y1=d}`:h>Yn&&this._append`A${n},${n},0,${+(h>=Jh)},${f},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function k0(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new r4(t)}function A0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function zS(e){this._context=e}zS.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 mf(e){return new zS(e)}function US(e){return e[0]}function WS(e){return e[1]}function HS(e,t){var r=ye(!0),n=null,a=mf,i=null,o=k0(l);e=typeof e=="function"?e:e===void 0?US:ye(e),t=typeof t=="function"?t:t===void 0?WS:ye(t);function l(c){var u,d=(c=A0(c)).length,f,h=!1,p;for(n==null&&(i=a(p=o())),u=0;u<=d;++u)!(u<d&&r(f=c[u],u,c))===h&&((h=!h)?i.lineStart():i.lineEnd()),h&&i.point(+e(f,u,c),+t(f,u,c));if(p)return i=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:ye(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:ye(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:ye(!!c),l):r},l.curve=function(c){return arguments.length?(a=c,n!=null&&(i=a(n)),l):a},l.context=function(c){return arguments.length?(c==null?n=i=null:i=a(n=c),l):n},l}function El(e,t,r){var n=null,a=ye(!0),i=null,o=mf,l=null,c=k0(u);e=typeof e=="function"?e:e===void 0?US:ye(+e),t=typeof t=="function"?t:ye(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?WS:ye(+r);function u(f){var h,p,v,b=(f=A0(f)).length,x,y=!1,m,g=new Array(b),S=new Array(b);for(i==null&&(l=o(m=c())),h=0;h<=b;++h){if(!(h<b&&a(x=f[h],h,f))===y)if(y=!y)p=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),v=h-1;v>=p;--v)l.point(g[v],S[v]);l.lineEnd(),l.areaEnd()}y&&(g[h]=+e(x,h,f),S[h]=+t(x,h,f),l.point(n?+n(x,h,f):g[h],r?+r(x,h,f):S[h]))}if(m)return l=null,m+""||null}function d(){return HS().defined(a).curve(o).context(i)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:ye(+f),n=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ye(+f),u):e},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ye(+f),u):n},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:ye(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ye(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ye(+f),u):r},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(r)},u.lineX1=function(){return d().x(n).y(t)},u.defined=function(f){return arguments.length?(a=typeof f=="function"?f:ye(!!f),u):a},u.curve=function(f){return arguments.length?(o=f,i!=null&&(l=o(i)),u):o},u.context=function(f){return arguments.length?(f==null?i=l=null:l=o(i=f),u):i},u}class KS{constructor(t,r){this._context=t,this._x=r}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,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function n4(e){return new KS(e,!0)}function a4(e){return new KS(e,!1)}const $0={draw(e,t){const r=dr(t/Mc);e.moveTo(r,0),e.arc(0,0,r,0,pf)}},i4={draw(e,t){const r=dr(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},VS=dr(1/3),o4=VS*2,s4={draw(e,t){const r=dr(t/o4),n=r*VS;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},l4={draw(e,t){const r=dr(t),n=-r/2;e.rect(n,n,r,r)}},c4=.8908130915292852,GS=Tc(Mc/10)/Tc(7*Mc/10),u4=Tc(pf/10)*GS,f4=-BS(pf/10)*GS,d4={draw(e,t){const r=dr(t*c4),n=u4*r,a=f4*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const o=pf*i/5,l=BS(o),c=Tc(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*a,c*n+l*a)}e.closePath()}},wd=dr(3),h4={draw(e,t){const r=-dr(t/(wd*3));e.moveTo(0,r*2),e.lineTo(-wd*r,-r),e.lineTo(wd*r,-r),e.closePath()}},Ft=-.5,zt=dr(3)/2,tp=1/dr(12),p4=(tp/2+1)*3,m4={draw(e,t){const r=dr(t/p4),n=r/2,a=r*tp,i=n,o=r*tp+r,l=-i,c=o;e.moveTo(n,a),e.lineTo(i,o),e.lineTo(l,c),e.lineTo(Ft*n-zt*a,zt*n+Ft*a),e.lineTo(Ft*i-zt*o,zt*i+Ft*o),e.lineTo(Ft*l-zt*c,zt*l+Ft*c),e.lineTo(Ft*n+zt*a,Ft*a-zt*n),e.lineTo(Ft*i+zt*o,Ft*o-zt*i),e.lineTo(Ft*l+zt*c,Ft*c-zt*l),e.closePath()}};function g4(e,t){let r=null,n=k0(a);e=typeof e=="function"?e:ye(e||$0),t=typeof t=="function"?t:ye(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:ye(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:ye(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function Ic(){}function Lc(e,t,r){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+r)/6)}function YS(e){this._context=e}YS.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:Lc(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:Lc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function y4(e){return new YS(e)}function qS(e){this._context=e}qS.prototype={areaStart:Ic,areaEnd:Ic,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:Lc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function v4(e){return new qS(e)}function XS(e){this._context=e}XS.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 r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Lc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function x4(e){return new XS(e)}function QS(e){this._context=e}QS.prototype={areaStart:Ic,areaEnd:Ic,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 b4(e){return new QS(e)}function lv(e){return e<0?-1:1}function cv(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),o=(r-e._y1)/(a||n<0&&-0),l=(i*a+o*n)/(n+a);return(lv(i)+lv(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function uv(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Sd(e,t,r){var n=e._x0,a=e._y0,i=e._x1,o=e._y1,l=(i-n)/3;e._context.bezierCurveTo(n+l,a+l*t,i-l,o-l*r,i,o)}function Dc(e){this._context=e}Dc.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:Sd(this,this._t0,uv(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 r=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,Sd(this,uv(this,r=cv(this,e,t)),r);break;default:Sd(this,this._t0,r=cv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function ZS(e){this._context=new JS(e)}(ZS.prototype=Object.create(Dc.prototype)).point=function(e,t){Dc.prototype.point.call(this,t,e)};function JS(e){this._context=e}JS.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,r,n,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function j4(e){return new Dc(e)}function w4(e){return new ZS(e)}function e_(e){this._context=e}e_.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,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=fv(e),a=fv(t),i=0,o=1;o<r;++i,++o)this._context.bezierCurveTo(n[0][i],a[0][i],n[1][i],a[1][i],e[o],t[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function fv(e){var t,r=e.length-1,n,a=new Array(r),i=new Array(r),o=new Array(r);for(a[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)a[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[r-1]=2,i[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=a[t]/i[t-1],i[t]-=n,o[t]-=n*o[t-1];for(a[r-1]=o[r-1]/i[r-1],t=r-2;t>=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function S4(e){return new e_(e)}function gf(e,t){this._context=e,this._t=t}gf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=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 r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function _4(e){return new gf(e,.5)}function N4(e){return new gf(e,0)}function O4(e){return new gf(e,1)}function xi(e,t){if((o=e.length)>1)for(var r=1,n,a,i=e[t[0]],o,l=i.length;r<o;++r)for(a=i,i=e[t[r]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(a[n][1])?a[n][0]:a[n][1]}function rp(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function P4(e,t){return e[t]}function k4(e){const t=[];return t.key=e,t}function A4(){var e=ye([]),t=rp,r=xi,n=P4;function a(i){var o=Array.from(e.apply(this,arguments),k4),l,c=o.length,u=-1,d;for(const f of i)for(l=0,++u;l<c;++l)(o[l][u]=[0,+n(f,o[l].key,u,i)]).data=f;for(l=0,d=A0(t(o));l<c;++l)o[d[l]].index=l;return r(o,d),o}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:ye(Array.from(i)),a):e},a.value=function(i){return arguments.length?(n=typeof i=="function"?i:ye(+i),a):n},a.order=function(i){return arguments.length?(t=i==null?rp:typeof i=="function"?i:ye(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(r=i??xi,a):r},a}function $4(e,t){if((n=e.length)>0){for(var r,n,a=0,i=e[0].length,o;a<i;++a){for(o=r=0;r<n;++r)o+=e[r][a][1]||0;if(o)for(r=0;r<n;++r)e[r][a][1]/=o}xi(e,t)}}function E4(e,t){if((a=e.length)>0){for(var r=0,n=e[t[0]],a,i=n.length;r<i;++r){for(var o=0,l=0;o<a;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}xi(e,t)}}function C4(e,t){if(!(!((o=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,o;n<i;++n){for(var l=0,c=0,u=0;l<o;++l){for(var d=e[t[l]],f=d[n][1]||0,h=d[n-1][1]||0,p=(f-h)/2,v=0;v<l;++v){var b=e[t[v]],x=b[n][1]||0,y=b[n-1][1]||0;p+=x-y}c+=f,u+=p*f}a[n-1][1]+=a[n-1][0]=r,c&&(r-=u/c)}a[n-1][1]+=a[n-1][0]=r,xi(e,t)}}function ys(e){"@babel/helpers - typeof";return ys=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},ys(e)}var T4=["type","size","sizeType"];function np(){return np=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},np.apply(this,arguments)}function dv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function hv(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dv(Object(r),!0).forEach(function(n){M4(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function M4(e,t,r){return t=I4(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function I4(e){var t=L4(e,"string");return ys(t)=="symbol"?t:t+""}function L4(e,t){if(ys(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ys(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function D4(e,t){if(e==null)return{};var r=R4(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function R4(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var t_={symbolCircle:$0,symbolCross:i4,symbolDiamond:s4,symbolSquare:l4,symbolStar:d4,symbolTriangle:h4,symbolWye:m4},B4=Math.PI/180,F4=function(t){var r="symbol".concat(hf(t));return t_[r]||$0},z4=function(t,r,n){if(r==="area")return t;switch(n){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*B4;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}},U4=function(t,r){t_["symbol".concat(hf(t))]=r},E0=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,o=t.sizeType,l=o===void 0?"area":o,c=D4(t,T4),u=hv(hv({},c),{},{type:n,size:i,sizeType:l}),d=function(){var x=F4(n),y=g4().type(x).size(z4(i,l,n));return y()},f=u.className,h=u.cx,p=u.cy,v=X(u,!0);return h===+h&&p===+p&&i===+i?E.createElement("path",np({},v,{className:te("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};E0.registerSymbol=U4;function bi(e){"@babel/helpers - typeof";return bi=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},bi(e)}function ap(){return ap=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ap.apply(this,arguments)}function pv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function W4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pv(Object(r),!0).forEach(function(n){vs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function H4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K4(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n_(n.key),n)}}function V4(e,t,r){return t&&K4(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function G4(e,t,r){return t=Rc(t),Y4(e,r_()?Reflect.construct(t,r||[],Rc(e).constructor):t.apply(e,r))}function Y4(e,t){if(t&&(bi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return q4(e)}function q4(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(r_=function(){return!!e})()}function Rc(e){return Rc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rc(e)}function X4(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ip(e,t)}function ip(e,t){return ip=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},ip(e,t)}function vs(e,t,r){return t=n_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n_(e){var t=Q4(e,"string");return bi(t)=="symbol"?t:t+""}function Q4(e,t){if(bi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(bi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ut=32,C0=function(e){function t(){return H4(this,t),G4(this,t,arguments)}return X4(t,e),V4(t,[{key:"renderIcon",value:function(n){var a=this.props.inactiveColor,i=Ut/2,o=Ut/6,l=Ut/3,c=n.inactive?a:n.color;if(n.type==="plainline")return E.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:i,x2:Ut,y2:i,className:"recharts-legend-icon"});if(n.type==="line")return E.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
-            A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(i,`
-            H`).concat(Ut,"M").concat(2*l,",").concat(i,`
-            A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(n.type==="rect")return E.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Ut/8,"h").concat(Ut,"v").concat(Ut*3/4,"h").concat(-Ut,"z"),className:"recharts-legend-icon"});if(E.isValidElement(n.legendIcon)){var u=W4({},n);return delete u.legendIcon,E.cloneElement(n.legendIcon,u)}return E.createElement(E0,{fill:c,cx:i,cy:i,size:Ut,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,a=this.props,i=a.payload,o=a.iconSize,l=a.layout,c=a.formatter,u=a.inactiveColor,d={x:0,y:0,width:Ut,height:Ut},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(p,v){var b=p.formatter||c,x=te(vs(vs({"recharts-legend-item":!0},"legend-item-".concat(v),!0),"inactive",p.inactive));if(p.type==="none")return null;var y=Z(p.value)?null:p.value;ur(!Z(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var m=p.inactive?u:p.color;return E.createElement("li",ap({className:x,style:f,key:"legend-item-".concat(v)},ya(n.props,p,v)),E.createElement(qh,{width:o,height:o,viewBox:d,style:h},n.renderIcon(p)),E.createElement("span",{className:"recharts-legend-item-text",style:{color:m}},b?b(y,p,v):y))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,o=n.align;if(!a||!a.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return E.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(O.PureComponent);vs(C0,"displayName","Legend");vs(C0,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Z4=Ju;function J4(){this.__data__=new Z4,this.size=0}var eM=J4;function tM(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var rM=tM;function nM(e){return this.__data__.get(e)}var aM=nM;function iM(e){return this.__data__.has(e)}var oM=iM,sM=Ju,lM=x0,cM=b0,uM=200;function fM(e,t){var r=this.__data__;if(r instanceof sM){var n=r.__data__;if(!lM||n.length<uM-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new cM(n)}return r.set(e,t),this.size=r.size,this}var dM=fM,hM=Ju,pM=eM,mM=rM,gM=aM,yM=oM,vM=dM;function ao(e){var t=this.__data__=new hM(e);this.size=t.size}ao.prototype.clear=pM;ao.prototype.delete=mM;ao.prototype.get=gM;ao.prototype.has=yM;ao.prototype.set=vM;var a_=ao,xM="__lodash_hash_undefined__";function bM(e){return this.__data__.set(e,xM),this}var jM=bM;function wM(e){return this.__data__.has(e)}var SM=wM,_M=b0,NM=jM,OM=SM;function Bc(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new _M;++t<r;)this.add(e[t])}Bc.prototype.add=Bc.prototype.push=NM;Bc.prototype.has=OM;var i_=Bc;function PM(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var o_=PM;function kM(e,t){return e.has(t)}var s_=kM,AM=i_,$M=o_,EM=s_,CM=1,TM=2;function MM(e,t,r,n,a,i){var o=r&CM,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var u=i.get(e),d=i.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,p=r&TM?new AM:void 0;for(i.set(e,t),i.set(t,e);++f<l;){var v=e[f],b=t[f];if(n)var x=o?n(b,v,f,t,e,i):n(v,b,f,e,t,i);if(x!==void 0){if(x)continue;h=!1;break}if(p){if(!$M(t,function(y,m){if(!EM(p,m)&&(v===y||a(v,y,r,n,i)))return p.push(m)})){h=!1;break}}else if(!(v===b||a(v,b,r,n,i))){h=!1;break}}return i.delete(e),i.delete(t),h}var l_=MM,IM=Nr,LM=IM.Uint8Array,DM=LM;function RM(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}var BM=RM;function FM(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var T0=FM,mv=il,gv=DM,zM=v0,UM=l_,WM=BM,HM=T0,KM=1,VM=2,GM="[object Boolean]",YM="[object Date]",qM="[object Error]",XM="[object Map]",QM="[object Number]",ZM="[object RegExp]",JM="[object Set]",e3="[object String]",t3="[object Symbol]",r3="[object ArrayBuffer]",n3="[object DataView]",yv=mv?mv.prototype:void 0,_d=yv?yv.valueOf:void 0;function a3(e,t,r,n,a,i,o){switch(r){case n3:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case r3:return!(e.byteLength!=t.byteLength||!i(new gv(e),new gv(t)));case GM:case YM:case QM:return zM(+e,+t);case qM:return e.name==t.name&&e.message==t.message;case ZM:case e3:return e==t+"";case XM:var l=WM;case JM:var c=n&KM;if(l||(l=HM),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;n|=VM,o.set(e,t);var d=UM(l(e),l(t),n,a,i,o);return o.delete(e),d;case t3:if(_d)return _d.call(e)==_d.call(t)}return!1}var i3=a3;function o3(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var c_=o3,s3=c_,l3=kt;function c3(e,t,r){var n=t(e);return l3(e)?n:s3(n,r(e))}var u3=c3;function f3(e,t){for(var r=-1,n=e==null?0:e.length,a=0,i=[];++r<n;){var o=e[r];t(o,r,e)&&(i[a++]=o)}return i}var d3=f3;function h3(){return[]}var p3=h3,m3=d3,g3=p3,y3=Object.prototype,v3=y3.propertyIsEnumerable,vv=Object.getOwnPropertySymbols,x3=vv?function(e){return e==null?[]:(e=Object(e),m3(vv(e),function(t){return v3.call(e,t)}))}:g3,b3=x3;function j3(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var w3=j3,S3=Xr,_3=Qr,N3="[object Arguments]";function O3(e){return _3(e)&&S3(e)==N3}var P3=O3,xv=P3,k3=Qr,u_=Object.prototype,A3=u_.hasOwnProperty,$3=u_.propertyIsEnumerable,E3=xv(function(){return arguments}())?xv:function(e){return k3(e)&&A3.call(e,"callee")&&!$3.call(e,"callee")},M0=E3,Fc={exports:{}};function C3(){return!1}var T3=C3;Fc.exports;(function(e,t){var r=Nr,n=T3,a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===a,l=o?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;e.exports=u})(Fc,Fc.exports);var f_=Fc.exports,M3=9007199254740991,I3=/^(?:0|[1-9]\d*)$/;function L3(e,t){var r=typeof e;return t=t??M3,!!t&&(r=="number"||r!="symbol"&&I3.test(e))&&e>-1&&e%1==0&&e<t}var I0=L3,D3=9007199254740991;function R3(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=D3}var L0=R3,B3=Xr,F3=L0,z3=Qr,U3="[object Arguments]",W3="[object Array]",H3="[object Boolean]",K3="[object Date]",V3="[object Error]",G3="[object Function]",Y3="[object Map]",q3="[object Number]",X3="[object Object]",Q3="[object RegExp]",Z3="[object Set]",J3="[object String]",eI="[object WeakMap]",tI="[object ArrayBuffer]",rI="[object DataView]",nI="[object Float32Array]",aI="[object Float64Array]",iI="[object Int8Array]",oI="[object Int16Array]",sI="[object Int32Array]",lI="[object Uint8Array]",cI="[object Uint8ClampedArray]",uI="[object Uint16Array]",fI="[object Uint32Array]",je={};je[nI]=je[aI]=je[iI]=je[oI]=je[sI]=je[lI]=je[cI]=je[uI]=je[fI]=!0;je[U3]=je[W3]=je[tI]=je[H3]=je[rI]=je[K3]=je[V3]=je[G3]=je[Y3]=je[q3]=je[X3]=je[Q3]=je[Z3]=je[J3]=je[eI]=!1;function dI(e){return z3(e)&&F3(e.length)&&!!je[B3(e)]}var hI=dI;function pI(e){return function(t){return e(t)}}var d_=pI,zc={exports:{}};zc.exports;(function(e,t){var r=bS,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,o=i&&r.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(zc,zc.exports);var mI=zc.exports,gI=hI,yI=d_,bv=mI,jv=bv&&bv.isTypedArray,vI=jv?yI(jv):gI,h_=vI,xI=w3,bI=M0,jI=kt,wI=f_,SI=I0,_I=h_,NI=Object.prototype,OI=NI.hasOwnProperty;function PI(e,t){var r=jI(e),n=!r&&bI(e),a=!r&&!n&&wI(e),i=!r&&!n&&!a&&_I(e),o=r||n||a||i,l=o?xI(e.length,String):[],c=l.length;for(var u in e)(t||OI.call(e,u))&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||SI(u,c)))&&l.push(u);return l}var kI=PI,AI=Object.prototype;function $I(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||AI;return e===r}var EI=$I;function CI(e,t){return function(r){return e(t(r))}}var p_=CI,TI=p_,MI=TI(Object.keys,Object),II=MI,LI=EI,DI=II,RI=Object.prototype,BI=RI.hasOwnProperty;function FI(e){if(!LI(e))return DI(e);var t=[];for(var r in Object(e))BI.call(e,r)&&r!="constructor"&&t.push(r);return t}var zI=FI,UI=y0,WI=L0;function HI(e){return e!=null&&WI(e.length)&&!UI(e)}var ol=HI,KI=kI,VI=zI,GI=ol;function YI(e){return GI(e)?KI(e):VI(e)}var yf=YI,qI=u3,XI=b3,QI=yf;function ZI(e){return qI(e,QI,XI)}var JI=ZI,wv=JI,eL=1,tL=Object.prototype,rL=tL.hasOwnProperty;function nL(e,t,r,n,a,i){var o=r&eL,l=wv(e),c=l.length,u=wv(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in t:rL.call(t,h)))return!1}var p=i.get(e),v=i.get(t);if(p&&v)return p==t&&v==e;var b=!0;i.set(e,t),i.set(t,e);for(var x=o;++f<c;){h=l[f];var y=e[h],m=t[h];if(n)var g=o?n(m,y,h,t,e,i):n(y,m,h,e,t,i);if(!(g===void 0?y===m||a(y,m,r,n,i):g)){b=!1;break}x||(x=h=="constructor")}if(b&&!x){var S=e.constructor,j=t.constructor;S!=j&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof j=="function"&&j instanceof j)&&(b=!1)}return i.delete(e),i.delete(t),b}var aL=nL,iL=Oa,oL=Nr,sL=iL(oL,"DataView"),lL=sL,cL=Oa,uL=Nr,fL=cL(uL,"Promise"),dL=fL,hL=Oa,pL=Nr,mL=hL(pL,"Set"),m_=mL,gL=Oa,yL=Nr,vL=gL(yL,"WeakMap"),xL=vL,op=lL,sp=x0,lp=dL,cp=m_,up=xL,g_=Xr,io=wS,Sv="[object Map]",bL="[object Object]",_v="[object Promise]",Nv="[object Set]",Ov="[object WeakMap]",Pv="[object DataView]",jL=io(op),wL=io(sp),SL=io(lp),_L=io(cp),NL=io(up),qn=g_;(op&&qn(new op(new ArrayBuffer(1)))!=Pv||sp&&qn(new sp)!=Sv||lp&&qn(lp.resolve())!=_v||cp&&qn(new cp)!=Nv||up&&qn(new up)!=Ov)&&(qn=function(e){var t=g_(e),r=t==bL?e.constructor:void 0,n=r?io(r):"";if(n)switch(n){case jL:return Pv;case wL:return Sv;case SL:return _v;case _L:return Nv;case NL:return Ov}return t});var OL=qn,Nd=a_,PL=l_,kL=i3,AL=aL,kv=OL,Av=kt,$v=f_,$L=h_,EL=1,Ev="[object Arguments]",Cv="[object Array]",Cl="[object Object]",CL=Object.prototype,Tv=CL.hasOwnProperty;function TL(e,t,r,n,a,i){var o=Av(e),l=Av(t),c=o?Cv:kv(e),u=l?Cv:kv(t);c=c==Ev?Cl:c,u=u==Ev?Cl:u;var d=c==Cl,f=u==Cl,h=c==u;if(h&&$v(e)){if(!$v(t))return!1;o=!0,d=!1}if(h&&!d)return i||(i=new Nd),o||$L(e)?PL(e,t,r,n,a,i):kL(e,t,c,r,n,a,i);if(!(r&EL)){var p=d&&Tv.call(e,"__wrapped__"),v=f&&Tv.call(t,"__wrapped__");if(p||v){var b=p?e.value():e,x=v?t.value():t;return i||(i=new Nd),a(b,x,r,n,i)}}return h?(i||(i=new Nd),AL(e,t,r,n,a,i)):!1}var ML=TL,IL=ML,Mv=Qr;function y_(e,t,r,n,a){return e===t?!0:e==null||t==null||!Mv(e)&&!Mv(t)?e!==e&&t!==t:IL(e,t,r,n,y_,a)}var D0=y_,LL=a_,DL=D0,RL=1,BL=2;function FL(e,t,r,n){var a=r.length,i=a,o=!n;if(e==null)return!i;for(e=Object(e);a--;){var l=r[a];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<i;){l=r[a];var c=l[0],u=e[c],d=l[1];if(o&&l[2]){if(u===void 0&&!(c in e))return!1}else{var f=new LL;if(n)var h=n(u,d,c,e,t,f);if(!(h===void 0?DL(d,u,RL|BL,n,f):h))return!1}}return!0}var zL=FL,UL=Cn;function WL(e){return e===e&&!UL(e)}var v_=WL,HL=v_,KL=yf;function VL(e){for(var t=KL(e),r=t.length;r--;){var n=t[r],a=e[n];t[r]=[n,a,HL(a)]}return t}var GL=VL;function YL(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var x_=YL,qL=zL,XL=GL,QL=x_;function ZL(e){var t=XL(e);return t.length==1&&t[0][2]?QL(t[0][0],t[0][1]):function(r){return r===e||qL(r,e,t)}}var JL=ZL;function eD(e,t){return e!=null&&t in Object(e)}var tD=eD,rD=PS,nD=M0,aD=kt,iD=I0,oD=L0,sD=tf;function lD(e,t,r){t=rD(t,e);for(var n=-1,a=t.length,i=!1;++n<a;){var o=sD(t[n]);if(!(i=e!=null&&r(e,o)))break;e=e[o]}return i||++n!=a?i:(a=e==null?0:e.length,!!a&&oD(a)&&iD(o,a)&&(aD(e)||nD(e)))}var cD=lD,uD=tD,fD=cD;function dD(e,t){return e!=null&&fD(e,t,uD)}var hD=dD,pD=D0,mD=kS,gD=hD,yD=g0,vD=v_,xD=x_,bD=tf,jD=1,wD=2;function SD(e,t){return yD(e)&&vD(t)?xD(bD(e),t):function(r){var n=mD(r,e);return n===void 0&&n===t?gD(r,e):pD(t,n,jD|wD)}}var _D=SD;function ND(e){return e}var oo=ND;function OD(e){return function(t){return t==null?void 0:t[e]}}var PD=OD,kD=S0;function AD(e){return function(t){return kD(t,e)}}var $D=AD,ED=PD,CD=$D,TD=g0,MD=tf;function ID(e){return TD(e)?ED(MD(e)):CD(e)}var LD=ID,DD=JL,RD=_D,BD=oo,FD=kt,zD=LD;function UD(e){return typeof e=="function"?e:e==null?BD:typeof e=="object"?FD(e)?RD(e[0],e[1]):DD(e):zD(e)}var Or=UD;function WD(e,t,r,n){for(var a=e.length,i=r+(n?1:-1);n?i--:++i<a;)if(t(e[i],i,e))return i;return-1}var b_=WD;function HD(e){return e!==e}var KD=HD;function VD(e,t,r){for(var n=r-1,a=e.length;++n<a;)if(e[n]===t)return n;return-1}var GD=VD,YD=b_,qD=KD,XD=GD;function QD(e,t,r){return t===t?XD(e,t,r):YD(e,qD,r)}var ZD=QD,JD=ZD;function eR(e,t){var r=e==null?0:e.length;return!!r&&JD(e,t,0)>-1}var tR=eR;function rR(e,t,r){for(var n=-1,a=e==null?0:e.length;++n<a;)if(r(t,e[n]))return!0;return!1}var nR=rR;function aR(){}var iR=aR,Od=m_,oR=iR,sR=T0,lR=1/0,cR=Od&&1/sR(new Od([,-0]))[1]==lR?function(e){return new Od(e)}:oR,uR=cR,fR=i_,dR=tR,hR=nR,pR=s_,mR=uR,gR=T0,yR=200;function vR(e,t,r){var n=-1,a=dR,i=e.length,o=!0,l=[],c=l;if(r)o=!1,a=hR;else if(i>=yR){var u=t?null:mR(e);if(u)return gR(u);o=!1,a=pR,c=new fR}else c=t?[]:l;e:for(;++n<i;){var d=e[n],f=t?t(d):d;if(d=r||d!==0?d:0,o&&f===f){for(var h=c.length;h--;)if(c[h]===f)continue e;t&&c.push(f),l.push(d)}else a(c,f,r)||(c!==l&&c.push(f),l.push(d))}return l}var xR=vR,bR=Or,jR=xR;function wR(e,t){return e&&e.length?jR(e,bR(t)):[]}var SR=wR;const Iv=fe(SR);function j_(e,t,r){return t===!0?Iv(e,r):Z(t)?Iv(e,t):e}function ji(e){"@babel/helpers - typeof";return ji=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},ji(e)}var _R=["ref"];function Lv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function kr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lv(Object(r),!0).forEach(function(n){vf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dv(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,S_(n.key),n)}}function OR(e,t,r){return t&&Dv(e.prototype,t),r&&Dv(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function PR(e,t,r){return t=Uc(t),kR(e,w_()?Reflect.construct(t,r||[],Uc(e).constructor):t.apply(e,r))}function kR(e,t){if(t&&(ji(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return AR(e)}function AR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(w_=function(){return!!e})()}function Uc(e){return Uc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Uc(e)}function $R(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fp(e,t)}function fp(e,t){return fp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},fp(e,t)}function vf(e,t,r){return t=S_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S_(e){var t=ER(e,"string");return ji(t)=="symbol"?t:t+""}function ER(e,t){if(ji(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ji(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function CR(e,t){if(e==null)return{};var r=TR(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function TR(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function MR(e){return e.value}function IR(e,t){if(E.isValidElement(e))return E.cloneElement(e,t);if(typeof e=="function")return E.createElement(e,t);t.ref;var r=CR(t,_R);return E.createElement(C0,r)}var Rv=1,li=function(e){function t(){var r;NR(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=PR(this,t,[].concat(a)),vf(r,"lastBoundingBox",{width:-1,height:-1}),r}return $R(t,e),OR(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>Rv||Math.abs(a.height-this.lastBoundingBox.height)>Rv)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?kr({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,o=a.align,l=a.verticalAlign,c=a.margin,u=a.chartWidth,d=a.chartHeight,f,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&i==="vertical"){var p=this.getBBoxSnapshot();f={left:((u||0)-p.width)/2}}else f=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var v=this.getBBoxSnapshot();h={top:((d||0)-v.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return kr(kr({},f),h)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,o=a.width,l=a.height,c=a.wrapperStyle,u=a.payloadUniqBy,d=a.payload,f=kr(kr({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return E.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){n.wrapperNode=p}},IR(i,kr(kr({},this.props),{},{payload:j_(d,u,MR)})))}}],[{key:"getWithHeight",value:function(n,a){var i=kr(kr({},this.defaultProps),n.props),o=i.layout;return o==="vertical"&&W(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||a}:null}}])}(O.PureComponent);vf(li,"displayName","Legend");vf(li,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Bv=il,LR=M0,DR=kt,Fv=Bv?Bv.isConcatSpreadable:void 0;function RR(e){return DR(e)||LR(e)||!!(Fv&&e&&e[Fv])}var BR=RR,FR=c_,zR=BR;function __(e,t,r,n,a){var i=-1,o=e.length;for(r||(r=zR),a||(a=[]);++i<o;){var l=e[i];t>0&&r(l)?t>1?__(l,t-1,r,n,a):FR(a,l):n||(a[a.length]=l)}return a}var N_=__;function UR(e){return function(t,r,n){for(var a=-1,i=Object(t),o=n(t),l=o.length;l--;){var c=o[e?l:++a];if(r(i[c],c,i)===!1)break}return t}}var WR=UR,HR=WR,KR=HR(),VR=KR,GR=VR,YR=yf;function qR(e,t){return e&&GR(e,t,YR)}var O_=qR,XR=ol;function QR(e,t){return function(r,n){if(r==null)return r;if(!XR(r))return e(r,n);for(var a=r.length,i=t?a:-1,o=Object(r);(t?i--:++i<a)&&n(o[i],i,o)!==!1;);return r}}var ZR=QR,JR=O_,e8=ZR,t8=e8(JR),R0=t8,r8=R0,n8=ol;function a8(e,t){var r=-1,n=n8(e)?Array(e.length):[];return r8(e,function(a,i,o){n[++r]=t(a,i,o)}),n}var P_=a8;function i8(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var o8=i8,zv=Qi;function s8(e,t){if(e!==t){var r=e!==void 0,n=e===null,a=e===e,i=zv(e),o=t!==void 0,l=t===null,c=t===t,u=zv(t);if(!l&&!u&&!i&&e>t||i&&o&&c&&!l&&!u||n&&o&&c||!r&&c||!a)return 1;if(!n&&!i&&!u&&e<t||u&&r&&a&&!n&&!i||l&&r&&a||!o&&a||!c)return-1}return 0}var l8=s8,c8=l8;function u8(e,t,r){for(var n=-1,a=e.criteria,i=t.criteria,o=a.length,l=r.length;++n<o;){var c=c8(a[n],i[n]);if(c){if(n>=l)return c;var u=r[n];return c*(u=="desc"?-1:1)}}return e.index-t.index}var f8=u8,Pd=w0,d8=S0,h8=Or,p8=P_,m8=o8,g8=d_,y8=f8,v8=oo,x8=kt;function b8(e,t,r){t.length?t=Pd(t,function(i){return x8(i)?function(o){return d8(o,i.length===1?i[0]:i)}:i}):t=[v8];var n=-1;t=Pd(t,g8(h8));var a=p8(e,function(i,o,l){var c=Pd(t,function(u){return u(i)});return{criteria:c,index:++n,value:i}});return m8(a,function(i,o){return y8(i,o,r)})}var j8=b8;function w8(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var S8=w8,_8=S8,Uv=Math.max;function N8(e,t,r){return t=Uv(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=Uv(n.length-t,0),o=Array(i);++a<i;)o[a]=n[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=n[a];return l[t]=r(o),_8(e,this,l)}}var O8=N8;function P8(e){return function(){return e}}var k8=P8,A8=Oa,$8=function(){try{var e=A8(Object,"defineProperty");return e({},"",{}),e}catch{}}(),k_=$8,E8=k8,Wv=k_,C8=oo,T8=Wv?function(e,t){return Wv(e,"toString",{configurable:!0,enumerable:!1,value:E8(t),writable:!0})}:C8,M8=T8,I8=800,L8=16,D8=Date.now;function R8(e){var t=0,r=0;return function(){var n=D8(),a=L8-(n-r);if(r=n,a>0){if(++t>=I8)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var B8=R8,F8=M8,z8=B8,U8=z8(F8),W8=U8,H8=oo,K8=O8,V8=W8;function G8(e,t){return V8(K8(e,t,H8),e+"")}var Y8=G8,q8=v0,X8=ol,Q8=I0,Z8=Cn;function J8(e,t,r){if(!Z8(r))return!1;var n=typeof t;return(n=="number"?X8(r)&&Q8(t,r.length):n=="string"&&t in r)?q8(r[t],e):!1}var xf=J8,e6=N_,t6=j8,r6=Y8,Hv=xf,n6=r6(function(e,t){if(e==null)return[];var r=t.length;return r>1&&Hv(e,t[0],t[1])?t=[]:r>2&&Hv(t[0],t[1],t[2])&&(t=[t[0]]),t6(e,e6(t,1),[])}),a6=n6;const B0=fe(a6);function xs(e){"@babel/helpers - typeof";return xs=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},xs(e)}function dp(){return dp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dp.apply(this,arguments)}function i6(e,t){return c6(e)||l6(e,t)||s6(e,t)||o6()}function o6(){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 s6(e,t){if(e){if(typeof e=="string")return Kv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Kv(e,t)}}function Kv(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function l6(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function c6(e){if(Array.isArray(e))return e}function Vv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function kd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vv(Object(r),!0).forEach(function(n){u6(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function u6(e,t,r){return t=f6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f6(e){var t=d6(e,"string");return xs(t)=="symbol"?t:t+""}function d6(e,t){if(xs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(xs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function h6(e){return Array.isArray(e)&&Ge(e[0])&&Ge(e[1])?e.join(" ~ "):e}var p6=function(t){var r=t.separator,n=r===void 0?" : ":r,a=t.contentStyle,i=a===void 0?{}:a,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,h=t.itemSorter,p=t.wrapperClassName,v=t.labelClassName,b=t.label,x=t.labelFormatter,y=t.accessibilityLayer,m=y===void 0?!1:y,g=function(){if(d&&d.length){var C={padding:0,margin:0},$=(h?B0(d,h):d).map(function(M,A){if(M.type==="none")return null;var I=kd({display:"block",paddingTop:4,paddingBottom:4,color:M.color||"#000"},l),B=M.formatter||f||h6,L=M.value,R=M.name,F=L,K=R;if(B&&F!=null&&K!=null){var z=B(L,R,M,A,d);if(Array.isArray(z)){var q=i6(z,2);F=q[0],K=q[1]}else F=z}return E.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(A),style:I},Ge(K)?E.createElement("span",{className:"recharts-tooltip-item-name"},K):null,Ge(K)?E.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,E.createElement("span",{className:"recharts-tooltip-item-value"},F),E.createElement("span",{className:"recharts-tooltip-item-unit"},M.unit||""))});return E.createElement("ul",{className:"recharts-tooltip-item-list",style:C},$)}return null},S=kd({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),j=kd({margin:0},u),w=!J(b),_=w?b:"",N=te("recharts-default-tooltip",p),P=te("recharts-tooltip-label",v);w&&x&&d!==void 0&&d!==null&&(_=x(b,d));var k=m?{role:"status","aria-live":"assertive"}:{};return E.createElement("div",dp({className:N,style:S},k),E.createElement("p",{className:P,style:j},E.isValidElement(_)?_:"".concat(_)),g())};function bs(e){"@babel/helpers - typeof";return bs=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},bs(e)}function Tl(e,t,r){return t=m6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m6(e){var t=g6(e,"string");return bs(t)=="symbol"?t:t+""}function g6(e,t){if(bs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(bs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jo="recharts-tooltip-wrapper",y6={visibility:"hidden"};function v6(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return te(jo,Tl(Tl(Tl(Tl({},"".concat(jo,"-right"),W(r)&&t&&W(t.x)&&r>=t.x),"".concat(jo,"-left"),W(r)&&t&&W(t.x)&&r<t.x),"".concat(jo,"-bottom"),W(n)&&t&&W(t.y)&&n>=t.y),"".concat(jo,"-top"),W(n)&&t&&W(t.y)&&n<t.y))}function Gv(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,a=e.offsetTopLeft,i=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(i&&W(i[n]))return i[n];var d=r[n]-l-a,f=r[n]+a;if(t[n])return o[n]?d:f;if(o[n]){var h=d,p=c[n];return h<p?Math.max(f,c[n]):Math.max(d,c[n])}var v=f+l,b=c[n]+u;return v>b?Math.max(d,c[n]):Math.max(f,c[n])}function x6(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function b6(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return o.height>0&&o.width>0&&r?(d=Gv({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=Gv({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=x6({translateX:d,translateY:f,useTranslate3d:l})):u=y6,{cssProperties:u,cssClasses:v6({translateX:d,translateY:f,coordinate:r})}}function wi(e){"@babel/helpers - typeof";return wi=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},wi(e)}function Yv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function qv(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yv(Object(r),!0).forEach(function(n){pp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function j6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w6(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$_(n.key),n)}}function S6(e,t,r){return t&&w6(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _6(e,t,r){return t=Wc(t),N6(e,A_()?Reflect.construct(t,r||[],Wc(e).constructor):t.apply(e,r))}function N6(e,t){if(t&&(wi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return O6(e)}function O6(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(A_=function(){return!!e})()}function Wc(e){return Wc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wc(e)}function P6(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hp(e,t)}function hp(e,t){return hp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},hp(e,t)}function pp(e,t,r){return t=$_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $_(e){var t=k6(e,"string");return wi(t)=="symbol"?t:t+""}function k6(e,t){if(wi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(wi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Xv=1,A6=function(e){function t(){var r;j6(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=_6(this,t,[].concat(a)),pp(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),pp(r,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,d;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=r.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),r}return P6(t,e),S6(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>Xv||Math.abs(n.height-this.state.lastBoundingBox.height)>Xv)&&this.setState({lastBoundingBox:{width:n.width,height:n.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 n,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.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 n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.children,d=a.coordinate,f=a.hasPayload,h=a.isAnimationActive,p=a.offset,v=a.position,b=a.reverseDirection,x=a.useTranslate3d,y=a.viewBox,m=a.wrapperStyle,g=b6({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:p,position:v,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:y}),S=g.cssClasses,j=g.cssProperties,w=qv(qv({transition:h&&i?"transform ".concat(l,"ms ").concat(c):void 0},j),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&f?"visible":"hidden",position:"absolute",top:0,left:0},m);return E.createElement("div",{tabIndex:-1,className:S,style:w,ref:function(N){n.wrapperNode=N}},u)}}])}(O.PureComponent),$6=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Pa={isSsr:$6()};function Si(e){"@babel/helpers - typeof";return Si=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},Si(e)}function Qv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Zv(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qv(Object(r),!0).forEach(function(n){F0(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function E6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C6(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,C_(n.key),n)}}function T6(e,t,r){return t&&C6(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function M6(e,t,r){return t=Hc(t),I6(e,E_()?Reflect.construct(t,r||[],Hc(e).constructor):t.apply(e,r))}function I6(e,t){if(t&&(Si(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return L6(e)}function L6(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(E_=function(){return!!e})()}function Hc(e){return Hc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Hc(e)}function D6(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mp(e,t)}function mp(e,t){return mp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},mp(e,t)}function F0(e,t,r){return t=C_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C_(e){var t=R6(e,"string");return Si(t)=="symbol"?t:t+""}function R6(e,t){if(Si(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Si(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function B6(e){return e.dataKey}function F6(e,t){return E.isValidElement(e)?E.cloneElement(e,t):typeof e=="function"?E.createElement(e,t):E.createElement(p6,t)}var bt=function(e){function t(){return E6(this,t),M6(this,t,arguments)}return D6(t,e),T6(t,[{key:"render",value:function(){var n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.content,d=a.coordinate,f=a.filterNull,h=a.isAnimationActive,p=a.offset,v=a.payload,b=a.payloadUniqBy,x=a.position,y=a.reverseDirection,m=a.useTranslate3d,g=a.viewBox,S=a.wrapperStyle,j=v??[];f&&j.length&&(j=j_(v.filter(function(_){return _.value!=null&&(_.hide!==!0||n.props.includeHidden)}),b,B6));var w=j.length>0;return E.createElement(A6,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:i,coordinate:d,hasPayload:w,offset:p,position:x,reverseDirection:y,useTranslate3d:m,viewBox:g,wrapperStyle:S},F6(u,Zv(Zv({},this.props),{},{payload:j})))}}])}(O.PureComponent);F0(bt,"displayName","Tooltip");F0(bt,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Pa.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 z6=Nr,U6=function(){return z6.Date.now()},W6=U6,H6=/\s/;function K6(e){for(var t=e.length;t--&&H6.test(e.charAt(t)););return t}var V6=K6,G6=V6,Y6=/^\s+/;function q6(e){return e&&e.slice(0,G6(e)+1).replace(Y6,"")}var X6=q6,Q6=X6,Jv=Cn,Z6=Qi,ex=NaN,J6=/^[-+]0x[0-9a-f]+$/i,eB=/^0b[01]+$/i,tB=/^0o[0-7]+$/i,rB=parseInt;function nB(e){if(typeof e=="number")return e;if(Z6(e))return ex;if(Jv(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Jv(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Q6(e);var r=eB.test(e);return r||tB.test(e)?rB(e.slice(2),r?2:8):J6.test(e)?ex:+e}var T_=nB,aB=Cn,Ad=W6,tx=T_,iB="Expected a function",oB=Math.max,sB=Math.min;function lB(e,t,r){var n,a,i,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(iB);t=tx(t)||0,aB(r)&&(d=!!r.leading,f="maxWait"in r,i=f?oB(tx(r.maxWait)||0,t):i,h="trailing"in r?!!r.trailing:h);function p(w){var _=n,N=a;return n=a=void 0,u=w,o=e.apply(N,_),o}function v(w){return u=w,l=setTimeout(y,t),d?p(w):o}function b(w){var _=w-c,N=w-u,P=t-_;return f?sB(P,i-N):P}function x(w){var _=w-c,N=w-u;return c===void 0||_>=t||_<0||f&&N>=i}function y(){var w=Ad();if(x(w))return m(w);l=setTimeout(y,b(w))}function m(w){return l=void 0,h&&n?p(w):(n=a=void 0,o)}function g(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function S(){return l===void 0?o:m(Ad())}function j(){var w=Ad(),_=x(w);if(n=arguments,a=this,c=w,_){if(l===void 0)return v(c);if(f)return clearTimeout(l),l=setTimeout(y,t),p(c)}return l===void 0&&(l=setTimeout(y,t)),o}return j.cancel=g,j.flush=S,j}var cB=lB,uB=cB,fB=Cn,dB="Expected a function";function hB(e,t,r){var n=!0,a=!0;if(typeof e!="function")throw new TypeError(dB);return fB(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),uB(e,t,{leading:n,maxWait:t,trailing:a})}var pB=hB;const M_=fe(pB);function js(e){"@babel/helpers - typeof";return js=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},js(e)}function rx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ml(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rx(Object(r),!0).forEach(function(n){mB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mB(e,t,r){return t=gB(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gB(e){var t=yB(e,"string");return js(t)=="symbol"?t:t+""}function yB(e,t){if(js(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(js(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vB(e,t){return wB(e)||jB(e,t)||bB(e,t)||xB()}function xB(){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 bB(e,t){if(e){if(typeof e=="string")return nx(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nx(e,t)}}function nx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jB(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function wB(e){if(Array.isArray(e))return e}var _i=O.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,a=n===void 0?{width:-1,height:-1}:n,i=e.width,o=i===void 0?"100%":i,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,h=e.maxHeight,p=e.children,v=e.debounce,b=v===void 0?0:v,x=e.id,y=e.className,m=e.onResize,g=e.style,S=g===void 0?{}:g,j=O.useRef(null),w=O.useRef();w.current=m,O.useImperativeHandle(t,function(){return Object.defineProperty(j.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),j.current},configurable:!0})});var _=O.useState({containerWidth:a.width,containerHeight:a.height}),N=vB(_,2),P=N[0],k=N[1],T=O.useCallback(function($,M){k(function(A){var I=Math.round($),B=Math.round(M);return A.containerWidth===I&&A.containerHeight===B?A:{containerWidth:I,containerHeight:B}})},[]);O.useEffect(function(){var $=function(R){var F,K=R[0].contentRect,z=K.width,q=K.height;T(z,q),(F=w.current)===null||F===void 0||F.call(w,z,q)};b>0&&($=M_($,b,{trailing:!0,leading:!1}));var M=new ResizeObserver($),A=j.current.getBoundingClientRect(),I=A.width,B=A.height;return T(I,B),M.observe(j.current),function(){M.disconnect()}},[T,b]);var C=O.useMemo(function(){var $=P.containerWidth,M=P.containerHeight;if($<0||M<0)return null;ur(ta(o)||ta(c),`The width(%s) and height(%s) are both fixed numbers,
-       maybe you don't need to use a ResponsiveContainer.`,o,c),ur(!r||r>0,"The aspect(%s) must be greater than zero.",r);var A=ta(o)?$:o,I=ta(c)?M:c;r&&r>0&&(A?I=A/r:I&&(A=I*r),h&&I>h&&(I=h)),ur(A>0||I>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.`,A,I,o,c,d,f,r);var B=!Array.isArray(p)&&Br(p.type).endsWith("Chart");return E.Children.map(p,function(L){return E.isValidElement(L)?O.cloneElement(L,Ml({width:A,height:I},B?{style:Ml({height:"100%",width:"100%",maxHeight:I,maxWidth:A},L.props.style)}:{})):L})},[r,p,c,h,f,d,P,o]);return E.createElement("div",{id:x?"".concat(x):void 0,className:te("recharts-responsive-container",y),style:Ml(Ml({},S),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:j},C)}),va=function(t){return null};va.displayName="Cell";function ws(e){"@babel/helpers - typeof";return ws=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},ws(e)}function ax(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function gp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ax(Object(r),!0).forEach(function(n){SB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ax(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SB(e,t,r){return t=_B(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _B(e){var t=NB(e,"string");return ws(t)=="symbol"?t:t+""}function NB(e,t){if(ws(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ws(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ta={widthCache:{},cacheCount:0},OB=2e3,PB={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},ix="recharts_measurement_span";function kB(e){var t=gp({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var Vo=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Pa.isSsr)return{width:0,height:0};var n=kB(r),a=JSON.stringify({text:t,copyStyle:n});if(Ta.widthCache[a])return Ta.widthCache[a];try{var i=document.getElementById(ix);i||(i=document.createElement("span"),i.setAttribute("id",ix),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=gp(gp({},PB),n);Object.assign(i.style,o),i.textContent="".concat(t);var l=i.getBoundingClientRect(),c={width:l.width,height:l.height};return Ta.widthCache[a]=c,++Ta.cacheCount>OB&&(Ta.cacheCount=0,Ta.widthCache={}),c}catch{return{width:0,height:0}}},AB=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Ss(e){"@babel/helpers - typeof";return Ss=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},Ss(e)}function Kc(e,t){return TB(e)||CB(e,t)||EB(e,t)||$B()}function $B(){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 EB(e,t){if(e){if(typeof e=="string")return ox(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ox(e,t)}}function ox(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function CB(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function TB(e){if(Array.isArray(e))return e}function MB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sx(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,LB(n.key),n)}}function IB(e,t,r){return t&&sx(e.prototype,t),r&&sx(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function LB(e){var t=DB(e,"string");return Ss(t)=="symbol"?t:t+""}function DB(e,t){if(Ss(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ss(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var lx=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,cx=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,RB=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,BB=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,I_={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},FB=Object.keys(I_),Xa="NaN";function zB(e,t){return e*I_[t]}var Il=function(){function e(t,r){MB(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!RB.test(r)&&(this.num=NaN,this.unit=""),FB.includes(r)&&(this.num=zB(t,r),this.unit="px")}return IB(e,[{key:"add",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,a=(n=BB.exec(r))!==null&&n!==void 0?n:[],i=Kc(a,3),o=i[1],l=i[2];return new e(parseFloat(o),l??"")}}])}();function L_(e){if(e.includes(Xa))return Xa;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=lx.exec(t))!==null&&r!==void 0?r:[],a=Kc(n,4),i=a[1],o=a[2],l=a[3],c=Il.parse(i??""),u=Il.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return Xa;t=t.replace(lx,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=cx.exec(t))!==null&&f!==void 0?f:[],p=Kc(h,4),v=p[1],b=p[2],x=p[3],y=Il.parse(v??""),m=Il.parse(x??""),g=b==="+"?y.add(m):y.subtract(m);if(g.isNaN())return Xa;t=t.replace(cx,g.toString())}return t}var ux=/\(([^()]*)\)/;function UB(e){for(var t=e;t.includes("(");){var r=ux.exec(t),n=Kc(r,2),a=n[1];t=t.replace(ux,L_(a))}return t}function WB(e){var t=e.replace(/\s+/g,"");return t=UB(t),t=L_(t),t}function HB(e){try{return WB(e)}catch{return Xa}}function $d(e){var t=HB(e.slice(5,-1));return t===Xa?"":t}var KB=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],VB=["dx","dy","angle","className","breakAll"];function yp(){return yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yp.apply(this,arguments)}function fx(e,t){if(e==null)return{};var r=GB(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function GB(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function dx(e,t){return QB(e)||XB(e,t)||qB(e,t)||YB()}function YB(){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 qB(e,t){if(e){if(typeof e=="string")return hx(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hx(e,t)}}function hx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function XB(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function QB(e){if(Array.isArray(e))return e}var D_=/[ \f\n\r\t\v\u2028\u2029]+/,R_=function(t){var r=t.children,n=t.breakAll,a=t.style;try{var i=[];J(r)||(n?i=r.toString().split(""):i=r.toString().split(D_));var o=i.map(function(c){return{word:c,width:Vo(c,a).width}}),l=n?0:Vo(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},ZB=function(t,r,n,a,i){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=W(o),f=l,h=function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return A.reduce(function(I,B){var L=B.word,R=B.width,F=I[I.length-1];if(F&&(a==null||i||F.width+R+n<Number(a)))F.words.push(L),F.width+=R+n;else{var K={words:[L],width:R};I.push(K)}return I},[])},p=h(r),v=function(A){return A.reduce(function(I,B){return I.width>B.width?I:B})};if(!d)return p;for(var b="…",x=function(A){var I=f.slice(0,A),B=R_({breakAll:u,style:c,children:I+b}).wordsWithComputedWidth,L=h(B),R=L.length>o||v(L).width>Number(a);return[R,L]},y=0,m=f.length-1,g=0,S;y<=m&&g<=f.length-1;){var j=Math.floor((y+m)/2),w=j-1,_=x(w),N=dx(_,2),P=N[0],k=N[1],T=x(j),C=dx(T,1),$=C[0];if(!P&&!$&&(y=j+1),P&&$&&(m=j-1),!P&&$){S=k;break}g++}return S||p},px=function(t){var r=J(t)?[]:t.toString().split(D_);return[{words:r}]},JB=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,l=t.maxLines;if((r||n)&&!Pa.isSsr){var c,u,d=R_({breakAll:o,children:a,style:i});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return px(a);return ZB({breakAll:o,children:a,maxLines:l,style:i},c,u,r,n)}return px(a)},mx="#808080",xa=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,h=t.textAnchor,p=h===void 0?"start":h,v=t.verticalAnchor,b=v===void 0?"end":v,x=t.fill,y=x===void 0?mx:x,m=fx(t,KB),g=O.useMemo(function(){return JB({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:f,style:m.style,width:m.width})},[m.breakAll,m.children,m.maxLines,f,m.style,m.width]),S=m.dx,j=m.dy,w=m.angle,_=m.className,N=m.breakAll,P=fx(m,VB);if(!Ge(n)||!Ge(i))return null;var k=n+(W(S)?S:0),T=i+(W(j)?j:0),C;switch(b){case"start":C=$d("calc(".concat(u,")"));break;case"middle":C=$d("calc(".concat((g.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:C=$d("calc(".concat(g.length-1," * -").concat(l,")"));break}var $=[];if(f){var M=g[0].width,A=m.width;$.push("scale(".concat((W(A)?A/M:1)/M,")"))}return w&&$.push("rotate(".concat(w,", ").concat(k,", ").concat(T,")")),$.length&&(P.transform=$.join(" ")),E.createElement("text",yp({},X(P,!0),{x:k,y:T,className:te("recharts-text",_),textAnchor:p,fill:y.includes("url")?mx:y}),g.map(function(I,B){var L=I.words.join(N?"":" ");return E.createElement("tspan",{x:k,dy:B===0?C:l,key:"".concat(L,"-").concat(B)},L)}))};function Nn(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function eF(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function z0(e){let t,r,n;e.length!==2?(t=Nn,r=(l,c)=>Nn(e(l),c),n=(l,c)=>e(l)-c):(t=e===Nn||e===eF?e:tF,r=e,n=e);function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function i(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function o(l,c,u=0,d=l.length){const f=a(l,c,u,d-1);return f>u&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:a,center:o,right:i}}function tF(){return 0}function B_(e){return e===null?NaN:+e}function*rF(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const nF=z0(Nn),sl=nF.right;z0(B_).center;class gx extends Map{constructor(t,r=oF){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(yx(this,t))}has(t){return super.has(yx(this,t))}set(t,r){return super.set(aF(this,t),r)}delete(t){return super.delete(iF(this,t))}}function yx({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function aF({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function iF({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function oF(e){return e!==null&&typeof e=="object"?e.valueOf():e}function sF(e=Nn){if(e===Nn)return F_;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function F_(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const lF=Math.sqrt(50),cF=Math.sqrt(10),uF=Math.sqrt(2);function Vc(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),o=i>=lF?10:i>=cF?5:i>=uF?2:1;let l,c,u;return a<0?(u=Math.pow(10,-a)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,a)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?Vc(e,t,r*2):[l,c,u]}function vp(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[a,i,o]=n?Vc(t,e,r):Vc(e,t,r);if(!(i>=a))return[];const l=i-a+1,c=new Array(l);if(n)if(o<0)for(let u=0;u<l;++u)c[u]=(i-u)/-o;else for(let u=0;u<l;++u)c[u]=(i-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(a+u)/-o;else for(let u=0;u<l;++u)c[u]=(a+u)*o;return c}function xp(e,t,r){return t=+t,e=+e,r=+r,Vc(e,t,r)[2]}function bp(e,t,r){t=+t,e=+e,r=+r;const n=t<e,a=n?xp(t,e,r):xp(e,t,r);return(n?-1:1)*(a<0?1/-a:a)}function vx(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function xx(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function z_(e,t,r=0,n=1/0,a){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(a=a===void 0?F_:sF(a);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),p=Math.max(r,Math.floor(t-u*f/c+h)),v=Math.min(n,Math.floor(t+(c-u)*f/c+h));z_(e,t,p,v,a)}const i=e[t];let o=r,l=n;for(wo(e,r,t),a(e[n],i)>0&&wo(e,r,n);o<l;){for(wo(e,o,l),++o,--l;a(e[o],i)<0;)++o;for(;a(e[l],i)>0;)--l}a(e[r],i)===0?wo(e,r,l):(++l,wo(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function wo(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function fF(e,t,r){if(e=Float64Array.from(rF(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return xx(e);if(t>=1)return vx(e);var n,a=(n-1)*t,i=Math.floor(a),o=vx(z_(e,i).subarray(0,i+1)),l=xx(e.subarray(i+1));return o+(l-o)*(a-i)}}function dF(e,t,r=B_){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,i=Math.floor(a),o=+r(e[i],i,e),l=+r(e[i+1],i+1,e);return o+(l-o)*(a-i)}}function hF(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n<a;)i[n]=e+n*r;return i}function er(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Zr(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const jp=Symbol("implicit");function U0(){var e=new gx,t=[],r=[],n=jp;function a(i){let o=e.get(i);if(o===void 0){if(n!==jp)return n;e.set(i,o=t.push(i)-1)}return r[o%r.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new gx;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(i){return arguments.length?(r=Array.from(i),a):r.slice()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return U0(t,r).unknown(n)},er.apply(a,arguments),a}function _s(){var e=U0().unknown(void 0),t=e.domain,r=e.range,n=0,a=1,i,o,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,p=a<n,v=p?a:n,b=p?n:a;i=(b-v)/Math.max(1,h-c+u*2),l&&(i=Math.floor(i)),v+=(b-v-i*(h-c))*d,o=i*(1-c),l&&(v=Math.round(v),o=Math.round(o));var x=hF(h).map(function(y){return v+i*y});return r(p?x.reverse():x)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([n,a]=h,n=+n,a=+a,f()):[n,a]},e.rangeRound=function(h){return[n,a]=h,n=+n,a=+a,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(h){return arguments.length?(l=!!h,f()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d},e.copy=function(){return _s(t(),[n,a]).round(l).paddingInner(c).paddingOuter(u).align(d)},er.apply(f(),arguments)}function U_(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return U_(t())},e}function Go(){return U_(_s.apply(null,arguments).paddingInner(1))}function W0(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function W_(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function ll(){}var Ns=.7,Gc=1/Ns,ci="\\s*([+-]?\\d+)\\s*",Os="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",jr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pF=/^#([0-9a-f]{3,8})$/,mF=new RegExp(`^rgb\\(${ci},${ci},${ci}\\)$`),gF=new RegExp(`^rgb\\(${jr},${jr},${jr}\\)$`),yF=new RegExp(`^rgba\\(${ci},${ci},${ci},${Os}\\)$`),vF=new RegExp(`^rgba\\(${jr},${jr},${jr},${Os}\\)$`),xF=new RegExp(`^hsl\\(${Os},${jr},${jr}\\)$`),bF=new RegExp(`^hsla\\(${Os},${jr},${jr},${Os}\\)$`),bx={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};W0(ll,Ps,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:jx,formatHex:jx,formatHex8:jF,formatHsl:wF,formatRgb:wx,toString:wx});function jx(){return this.rgb().formatHex()}function jF(){return this.rgb().formatHex8()}function wF(){return H_(this).formatHsl()}function wx(){return this.rgb().formatRgb()}function Ps(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=pF.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Sx(t):r===3?new _t(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Ll(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Ll(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=mF.exec(e))?new _t(t[1],t[2],t[3],1):(t=gF.exec(e))?new _t(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=yF.exec(e))?Ll(t[1],t[2],t[3],t[4]):(t=vF.exec(e))?Ll(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=xF.exec(e))?Ox(t[1],t[2]/100,t[3]/100,1):(t=bF.exec(e))?Ox(t[1],t[2]/100,t[3]/100,t[4]):bx.hasOwnProperty(e)?Sx(bx[e]):e==="transparent"?new _t(NaN,NaN,NaN,0):null}function Sx(e){return new _t(e>>16&255,e>>8&255,e&255,1)}function Ll(e,t,r,n){return n<=0&&(e=t=r=NaN),new _t(e,t,r,n)}function SF(e){return e instanceof ll||(e=Ps(e)),e?(e=e.rgb(),new _t(e.r,e.g,e.b,e.opacity)):new _t}function wp(e,t,r,n){return arguments.length===1?SF(e):new _t(e,t,r,n??1)}function _t(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}W0(_t,wp,W_(ll,{brighter(e){return e=e==null?Gc:Math.pow(Gc,e),new _t(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ns:Math.pow(Ns,e),new _t(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _t(ca(this.r),ca(this.g),ca(this.b),Yc(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:_x,formatHex:_x,formatHex8:_F,formatRgb:Nx,toString:Nx}));function _x(){return`#${ra(this.r)}${ra(this.g)}${ra(this.b)}`}function _F(){return`#${ra(this.r)}${ra(this.g)}${ra(this.b)}${ra((isNaN(this.opacity)?1:this.opacity)*255)}`}function Nx(){const e=Yc(this.opacity);return`${e===1?"rgb(":"rgba("}${ca(this.r)}, ${ca(this.g)}, ${ca(this.b)}${e===1?")":`, ${e})`}`}function Yc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ca(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ra(e){return e=ca(e),(e<16?"0":"")+e.toString(16)}function Ox(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new sr(e,t,r,n)}function H_(e){if(e instanceof sr)return new sr(e.h,e.s,e.l,e.opacity);if(e instanceof ll||(e=Ps(e)),!e)return new sr;if(e instanceof sr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),o=NaN,l=i-a,c=(i+a)/2;return l?(t===i?o=(r-n)/l+(r<n)*6:r===i?o=(n-t)/l+2:o=(t-r)/l+4,l/=c<.5?i+a:2-i-a,o*=60):l=c>0&&c<1?0:o,new sr(o,l,c,e.opacity)}function NF(e,t,r,n){return arguments.length===1?H_(e):new sr(e,t,r,n??1)}function sr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}W0(sr,NF,W_(ll,{brighter(e){return e=e==null?Gc:Math.pow(Gc,e),new sr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ns:Math.pow(Ns,e),new sr(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,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new _t(Ed(e>=240?e-240:e+120,a,n),Ed(e,a,n),Ed(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new sr(Px(this.h),Dl(this.s),Dl(this.l),Yc(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=Yc(this.opacity);return`${e===1?"hsl(":"hsla("}${Px(this.h)}, ${Dl(this.s)*100}%, ${Dl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Px(e){return e=(e||0)%360,e<0?e+360:e}function Dl(e){return Math.max(0,Math.min(1,e||0))}function Ed(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const H0=e=>()=>e;function OF(e,t){return function(r){return e+r*t}}function PF(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function kF(e){return(e=+e)==1?K_:function(t,r){return r-t?PF(t,r,e):H0(isNaN(t)?r:t)}}function K_(e,t){var r=t-e;return r?OF(e,r):H0(isNaN(e)?t:e)}const kx=function e(t){var r=kF(t);function n(a,i){var o=r((a=wp(a)).r,(i=wp(i)).r),l=r(a.g,i.g),c=r(a.b,i.b),u=K_(a.opacity,i.opacity);return function(d){return a.r=o(d),a.g=l(d),a.b=c(d),a.opacity=u(d),a+""}}return n.gamma=e,n}(1);function AF(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;a<r;++a)n[a]=e[a]*(1-i)+t[a]*i;return n}}function $F(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function EF(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,a=new Array(n),i=new Array(r),o;for(o=0;o<n;++o)a[o]=so(e[o],t[o]);for(;o<r;++o)i[o]=t[o];return function(l){for(o=0;o<n;++o)i[o]=a[o](l);return i}}function CF(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function qc(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function TF(e,t){var r={},n={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?r[a]=so(e[a],t[a]):n[a]=t[a];return function(i){for(a in r)n[a]=r[a](i);return n}}var Sp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Cd=new RegExp(Sp.source,"g");function MF(e){return function(){return e}}function IF(e){return function(t){return e(t)+""}}function LF(e,t){var r=Sp.lastIndex=Cd.lastIndex=0,n,a,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(n=Sp.exec(e))&&(a=Cd.exec(t));)(i=a.index)>r&&(i=t.slice(r,i),l[o]?l[o]+=i:l[++o]=i),(n=n[0])===(a=a[0])?l[o]?l[o]+=a:l[++o]=a:(l[++o]=null,c.push({i:o,x:qc(n,a)})),r=Cd.lastIndex;return r<t.length&&(i=t.slice(r),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?IF(c[0].x):MF(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function so(e,t){var r=typeof t,n;return t==null||r==="boolean"?H0(t):(r==="number"?qc:r==="string"?(n=Ps(t))?(t=n,kx):LF:t instanceof Ps?kx:t instanceof Date?CF:$F(t)?AF:Array.isArray(t)?EF:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?TF:qc)(e,t)}function K0(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function DF(e,t){t===void 0&&(t=e,e=so);for(var r=0,n=t.length-1,a=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(a,a=t[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return i[l](o-l)}}function RF(e){return function(){return e}}function Xc(e){return+e}var Ax=[0,1];function pt(e){return e}function _p(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:RF(isNaN(t)?NaN:.5)}function BF(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function FF(e,t,r){var n=e[0],a=e[1],i=t[0],o=t[1];return a<n?(n=_p(a,n),i=r(o,i)):(n=_p(n,a),i=r(i,o)),function(l){return i(n(l))}}function zF(e,t,r){var n=Math.min(e.length,t.length)-1,a=new Array(n),i=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)a[o]=_p(e[o],e[o+1]),i[o]=r(t[o],t[o+1]);return function(l){var c=sl(e,l,1,n)-1;return i[c](a[c](l))}}function cl(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function bf(){var e=Ax,t=Ax,r=so,n,a,i,o=pt,l,c,u;function d(){var h=Math.min(e.length,t.length);return o!==pt&&(o=BF(e[0],e[h-1])),l=h>2?zF:FF,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?i:(c||(c=l(e.map(n),t,r)))(n(o(h)))}return f.invert=function(h){return o(a((u||(u=l(t,e.map(n),qc)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Xc),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=K0,d()},f.clamp=function(h){return arguments.length?(o=h?!0:pt,d()):o!==pt},f.interpolate=function(h){return arguments.length?(r=h,d()):r},f.unknown=function(h){return arguments.length?(i=h,f):i},function(h,p){return n=h,a=p,d()}}function V0(){return bf()(pt,pt)}function UF(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Qc(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Ni(e){return e=Qc(Math.abs(e)),e?e[1]:NaN}function WF(e,t){return function(r,n){for(var a=r.length,i=[],o=0,l=e[0],c=0;a>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),i.push(r.substring(a-=l,a+l)),!((c+=l+1)>n));)l=e[o=(o+1)%e.length];return i.reverse().join(t)}}function HF(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var KF=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ks(e){if(!(t=KF.exec(e)))throw new Error("invalid format: "+e);var t;return new G0({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]})}ks.prototype=G0.prototype;function G0(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+""}G0.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 VF(e){e:for(var t=e.length,r=1,n=-1,a;r<t;++r)switch(e[r]){case".":n=a=r;break;case"0":n===0&&(n=r),a=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var Zc;function GF(e,t){var r=Qc(e,t);if(!r)return Zc=void 0,e.toPrecision(t);var n=r[0],a=r[1],i=a-(Zc=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Qc(e,Math.max(0,t+i-1))[0]}function $x(e,t){var r=Qc(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const Ex={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:UF,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)=>$x(e*100,t),r:$x,s:GF,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Cx(e){return e}var Tx=Array.prototype.map,Mx=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function YF(e){var t=e.grouping===void 0||e.thousands===void 0?Cx:WF(Tx.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?Cx:HF(Tx.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=ks(f);var p=f.fill,v=f.align,b=f.sign,x=f.symbol,y=f.zero,m=f.width,g=f.comma,S=f.precision,j=f.trim,w=f.type;w==="n"?(g=!0,w="g"):Ex[w]||(S===void 0&&(S=12),j=!0,w="g"),(y||p==="0"&&v==="=")&&(y=!0,p="0",v="=");var _=(h&&h.prefix!==void 0?h.prefix:"")+(x==="$"?r:x==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():""),N=(x==="$"?n:/[%p]/.test(w)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),P=Ex[w],k=/[defgprs%]/.test(w);S=S===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function T(C){var $=_,M=N,A,I,B;if(w==="c")M=P(C)+M,C="";else{C=+C;var L=C<0||1/C<0;if(C=isNaN(C)?c:P(Math.abs(C),S),j&&(C=VF(C)),L&&+C==0&&b!=="+"&&(L=!1),$=(L?b==="("?b:l:b==="-"||b==="("?"":b)+$,M=(w==="s"&&!isNaN(C)&&Zc!==void 0?Mx[8+Zc/3]:"")+M+(L&&b==="("?")":""),k){for(A=-1,I=C.length;++A<I;)if(B=C.charCodeAt(A),48>B||B>57){M=(B===46?a+C.slice(A+1):C.slice(A))+M,C=C.slice(0,A);break}}}g&&!y&&(C=t(C,1/0));var R=$.length+C.length+M.length,F=R<m?new Array(m-R+1).join(p):"";switch(g&&y&&(C=t(F+C,F.length?m-M.length:1/0),F=""),v){case"<":C=$+C+M+F;break;case"=":C=$+F+C+M;break;case"^":C=F.slice(0,R=F.length>>1)+$+C+M+F.slice(R);break;default:C=F+$+C+M;break}return i(C)}return T.toString=function(){return f+""},T}function d(f,h){var p=Math.max(-8,Math.min(8,Math.floor(Ni(h)/3)))*3,v=Math.pow(10,-p),b=u((f=ks(f),f.type="f",f),{suffix:Mx[8+p/3]});return function(x){return b(v*x)}}return{format:u,formatPrefix:d}}var Rl,Y0,V_;qF({thousands:",",grouping:[3],currency:["$",""]});function qF(e){return Rl=YF(e),Y0=Rl.format,V_=Rl.formatPrefix,Rl}function XF(e){return Math.max(0,-Ni(Math.abs(e)))}function QF(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ni(t)/3)))*3-Ni(Math.abs(e)))}function ZF(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ni(t)-Ni(e))+1}function G_(e,t,r,n){var a=bp(e,t,r),i;switch(n=ks(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=QF(a,o))&&(n.precision=i),V_(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=ZF(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=XF(a))&&(n.precision=i-(n.type==="%")*2);break}}return Y0(n)}function Tn(e){var t=e.domain;return e.ticks=function(r){var n=t();return vp(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return G_(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,o=n[a],l=n[i],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=a,a=i,i=u);d-- >0;){if(u=xp(o,l,r),u===c)return n[a]=o,n[i]=l,t(n);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function Jc(){var e=V0();return e.copy=function(){return cl(e,Jc())},er.apply(e,arguments),Tn(e)}function Y_(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Xc),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Y_(e).unknown(t)},e=arguments.length?Array.from(e,Xc):[0,1],Tn(r)}function q_(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],o;return i<a&&(o=r,r=n,n=o,o=a,a=i,i=o),e[r]=t.floor(a),e[n]=t.ceil(i),e}function Ix(e){return Math.log(e)}function Lx(e){return Math.exp(e)}function JF(e){return-Math.log(-e)}function ez(e){return-Math.exp(-e)}function tz(e){return isFinite(e)?+("1e"+e):e<0?0:e}function rz(e){return e===10?tz:e===Math.E?Math.exp:t=>Math.pow(e,t)}function nz(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 Dx(e){return(t,r)=>-e(-t,r)}function q0(e){const t=e(Ix,Lx),r=t.domain;let n=10,a,i;function o(){return a=nz(n),i=rz(n),r()[0]<0?(a=Dx(a),i=Dx(i),e(JF,ez)):e(Ix,Lx),t}return t.base=function(l){return arguments.length?(n=+l,o()):n},t.domain=function(l){return arguments.length?(r(l),o()):r()},t.ticks=l=>{const c=r();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let h=a(u),p=a(d),v,b;const x=l==null?10:+l;let y=[];if(!(n%1)&&p-h<x){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(v=1;v<n;++v)if(b=h<0?v/i(-h):v*i(h),!(b<u)){if(b>d)break;y.push(b)}}else for(;h<=p;++h)for(v=n-1;v>=1;--v)if(b=h>0?v/i(-h):v*i(h),!(b<u)){if(b>d)break;y.push(b)}y.length*2<x&&(y=vp(u,d,x))}else y=vp(h,p,Math.min(p-h,x)).map(i);return f?y.reverse():y},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=ks(c)).precision==null&&(c.trim=!0),c=Y0(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return d=>{let f=d/i(Math.round(a(d)));return f*n<n-.5&&(f*=n),f<=u?c(d):""}},t.nice=()=>r(q_(r(),{floor:l=>i(Math.floor(a(l))),ceil:l=>i(Math.ceil(a(l)))})),t}function X_(){const e=q0(bf()).domain([1,10]);return e.copy=()=>cl(e,X_()).base(e.base()),er.apply(e,arguments),e}function Rx(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Bx(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function X0(e){var t=1,r=e(Rx(t),Bx(t));return r.constant=function(n){return arguments.length?e(Rx(t=+n),Bx(t)):t},Tn(r)}function Q_(){var e=X0(bf());return e.copy=function(){return cl(e,Q_()).constant(e.constant())},er.apply(e,arguments)}function Fx(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function az(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function iz(e){return e<0?-e*e:e*e}function Q0(e){var t=e(pt,pt),r=1;function n(){return r===1?e(pt,pt):r===.5?e(az,iz):e(Fx(r),Fx(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},Tn(t)}function Z0(){var e=Q0(bf());return e.copy=function(){return cl(e,Z0()).exponent(e.exponent())},er.apply(e,arguments),e}function oz(){return Z0.apply(null,arguments).exponent(.5)}function zx(e){return Math.sign(e)*e*e}function sz(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Z_(){var e=V0(),t=[0,1],r=!1,n;function a(i){var o=sz(e(i));return isNaN(o)?n:r?Math.round(o):o}return a.invert=function(i){return e.invert(zx(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,Xc)).map(zx)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return Z_(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},er.apply(a,arguments),Tn(a)}function J_(){var e=[],t=[],r=[],n;function a(){var o=0,l=Math.max(1,t.length);for(r=new Array(l-1);++o<l;)r[o-1]=dF(e,o/l);return i}function i(o){return o==null||isNaN(o=+o)?n:t[sl(r,o)]}return i.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Nn),a()},i.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.quantiles=function(){return r.slice()},i.copy=function(){return J_().domain(e).range(t).unknown(n)},er.apply(i,arguments)}function eN(){var e=0,t=1,r=1,n=[.5],a=[0,1],i;function o(c){return c!=null&&c<=c?a[sl(n,c,0,r)]:i}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(r=(a=Array.from(c)).length-1,l()):a.slice()},o.invertExtent=function(c){var u=a.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,n[0]]:u>=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(c){return arguments.length&&(i=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return eN().domain([e,t]).range(a).unknown(i)},er.apply(Tn(o),arguments)}function tN(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[sl(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return tN().domain(e).range(t).unknown(r)},er.apply(a,arguments)}const Td=new Date,Md=new Date;function Ye(e,t,r,n){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 o=a(i),l=a.ceil(i);return i-o<l-i?o:l},a.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,l)=>{const c=[];if(i=a.ceil(i),l=l==null?1:Math.floor(l),!(i<o)||!(l>0))return c;let u;do c.push(u=new Date(+i)),t(i,l),e(i);while(u<i&&i<o);return c},a.filter=i=>Ye(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!i(o););else for(;--l>=0;)for(;t(o,1),!i(o););}),r&&(a.count=(i,o)=>(Td.setTime(+i),Md.setTime(+o),e(Td),e(Md),Math.floor(r(Td,Md))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?o=>n(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const eu=Ye(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);eu.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ye(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):eu);eu.range;const Ir=1e3,Gt=Ir*60,Lr=Gt*60,Vr=Lr*24,J0=Vr*7,Ux=Vr*30,Id=Vr*365,na=Ye(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ir)},(e,t)=>(t-e)/Ir,e=>e.getUTCSeconds());na.range;const eg=Ye(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ir)},(e,t)=>{e.setTime(+e+t*Gt)},(e,t)=>(t-e)/Gt,e=>e.getMinutes());eg.range;const tg=Ye(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Gt)},(e,t)=>(t-e)/Gt,e=>e.getUTCMinutes());tg.range;const rg=Ye(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ir-e.getMinutes()*Gt)},(e,t)=>{e.setTime(+e+t*Lr)},(e,t)=>(t-e)/Lr,e=>e.getHours());rg.range;const ng=Ye(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Lr)},(e,t)=>(t-e)/Lr,e=>e.getUTCHours());ng.range;const ul=Ye(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Gt)/Vr,e=>e.getDate()-1);ul.range;const jf=Ye(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vr,e=>e.getUTCDate()-1);jf.range;const rN=Ye(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vr,e=>Math.floor(e/Vr));rN.range;function ka(e){return Ye(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Gt)/J0)}const wf=ka(0),tu=ka(1),lz=ka(2),cz=ka(3),Oi=ka(4),uz=ka(5),fz=ka(6);wf.range;tu.range;lz.range;cz.range;Oi.range;uz.range;fz.range;function Aa(e){return Ye(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/J0)}const Sf=Aa(0),ru=Aa(1),dz=Aa(2),hz=Aa(3),Pi=Aa(4),pz=Aa(5),mz=Aa(6);Sf.range;ru.range;dz.range;hz.range;Pi.range;pz.range;mz.range;const ag=Ye(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());ag.range;const ig=Ye(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());ig.range;const Gr=Ye(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());Gr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ye(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Gr.range;const Yr=Ye(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());Yr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ye(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Yr.range;function nN(e,t,r,n,a,i){const o=[[na,1,Ir],[na,5,5*Ir],[na,15,15*Ir],[na,30,30*Ir],[i,1,Gt],[i,5,5*Gt],[i,15,15*Gt],[i,30,30*Gt],[a,1,Lr],[a,3,3*Lr],[a,6,6*Lr],[a,12,12*Lr],[n,1,Vr],[n,2,2*Vr],[r,1,J0],[t,1,Ux],[t,3,3*Ux],[e,1,Id]];function l(u,d,f){const h=d<u;h&&([u,d]=[d,u]);const p=f&&typeof f.range=="function"?f:c(u,d,f),v=p?p.range(u,+d+1):[];return h?v.reverse():v}function c(u,d,f){const h=Math.abs(d-u)/f,p=z0(([,,x])=>x).right(o,h);if(p===o.length)return e.every(bp(u/Id,d/Id,f));if(p===0)return eu.every(Math.max(bp(u,d,f),1));const[v,b]=o[h/o[p-1][2]<o[p][2]/h?p-1:p];return v.every(b)}return[l,c]}const[gz,yz]=nN(Yr,ig,Sf,rN,ng,tg),[vz,xz]=nN(Gr,ag,wf,ul,rg,eg);function Ld(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Dd(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function So(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function bz(e){var t=e.dateTime,r=e.date,n=e.time,a=e.periods,i=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=_o(a),d=No(a),f=_o(i),h=No(i),p=_o(o),v=No(o),b=_o(l),x=No(l),y=_o(c),m=No(c),g={a:B,A:L,b:R,B:F,c:null,d:Yx,e:Yx,f:Wz,g:Jz,G:t9,H:Fz,I:zz,j:Uz,L:aN,m:Hz,M:Kz,p:K,q:z,Q:Qx,s:Zx,S:Vz,u:Gz,U:Yz,V:qz,w:Xz,W:Qz,x:null,X:null,y:Zz,Y:e9,Z:r9,"%":Xx},S={a:q,A:ie,b:_e,B:Me,c:null,d:qx,e:qx,f:o9,g:g9,G:v9,H:n9,I:a9,j:i9,L:oN,m:s9,M:l9,p:Bt,q:vt,Q:Qx,s:Zx,S:c9,u:u9,U:f9,V:d9,w:h9,W:p9,x:null,X:null,y:m9,Y:y9,Z:x9,"%":Xx},j={a:k,A:T,b:C,B:$,c:M,d:Vx,e:Vx,f:Lz,g:Kx,G:Hx,H:Gx,I:Gx,j:Cz,L:Iz,m:Ez,M:Tz,p:P,q:$z,Q:Rz,s:Bz,S:Mz,u:Nz,U:Oz,V:Pz,w:_z,W:kz,x:A,X:I,y:Kx,Y:Hx,Z:Az,"%":Dz};g.x=w(r,g),g.X=w(n,g),g.c=w(t,g),S.x=w(r,S),S.X=w(n,S),S.c=w(t,S);function w(V,ee){return function(re){var U=[],Ee=-1,oe=0,Fe=V.length,ze,xt,en;for(re instanceof Date||(re=new Date(+re));++Ee<Fe;)V.charCodeAt(Ee)===37&&(U.push(V.slice(oe,Ee)),(xt=Wx[ze=V.charAt(++Ee)])!=null?ze=V.charAt(++Ee):xt=ze==="e"?" ":"0",(en=ee[ze])&&(ze=en(re,xt)),U.push(ze),oe=Ee+1);return U.push(V.slice(oe,Ee)),U.join("")}}function _(V,ee){return function(re){var U=So(1900,void 0,1),Ee=N(U,V,re+="",0),oe,Fe;if(Ee!=re.length)return null;if("Q"in U)return new Date(U.Q);if("s"in U)return new Date(U.s*1e3+("L"in U?U.L:0));if(ee&&!("Z"in U)&&(U.Z=0),"p"in U&&(U.H=U.H%12+U.p*12),U.m===void 0&&(U.m="q"in U?U.q:0),"V"in U){if(U.V<1||U.V>53)return null;"w"in U||(U.w=1),"Z"in U?(oe=Dd(So(U.y,0,1)),Fe=oe.getUTCDay(),oe=Fe>4||Fe===0?ru.ceil(oe):ru(oe),oe=jf.offset(oe,(U.V-1)*7),U.y=oe.getUTCFullYear(),U.m=oe.getUTCMonth(),U.d=oe.getUTCDate()+(U.w+6)%7):(oe=Ld(So(U.y,0,1)),Fe=oe.getDay(),oe=Fe>4||Fe===0?tu.ceil(oe):tu(oe),oe=ul.offset(oe,(U.V-1)*7),U.y=oe.getFullYear(),U.m=oe.getMonth(),U.d=oe.getDate()+(U.w+6)%7)}else("W"in U||"U"in U)&&("w"in U||(U.w="u"in U?U.u%7:"W"in U?1:0),Fe="Z"in U?Dd(So(U.y,0,1)).getUTCDay():Ld(So(U.y,0,1)).getDay(),U.m=0,U.d="W"in U?(U.w+6)%7+U.W*7-(Fe+5)%7:U.w+U.U*7-(Fe+6)%7);return"Z"in U?(U.H+=U.Z/100|0,U.M+=U.Z%100,Dd(U)):Ld(U)}}function N(V,ee,re,U){for(var Ee=0,oe=ee.length,Fe=re.length,ze,xt;Ee<oe;){if(U>=Fe)return-1;if(ze=ee.charCodeAt(Ee++),ze===37){if(ze=ee.charAt(Ee++),xt=j[ze in Wx?ee.charAt(Ee++):ze],!xt||(U=xt(V,re,U))<0)return-1}else if(ze!=re.charCodeAt(U++))return-1}return U}function P(V,ee,re){var U=u.exec(ee.slice(re));return U?(V.p=d.get(U[0].toLowerCase()),re+U[0].length):-1}function k(V,ee,re){var U=p.exec(ee.slice(re));return U?(V.w=v.get(U[0].toLowerCase()),re+U[0].length):-1}function T(V,ee,re){var U=f.exec(ee.slice(re));return U?(V.w=h.get(U[0].toLowerCase()),re+U[0].length):-1}function C(V,ee,re){var U=y.exec(ee.slice(re));return U?(V.m=m.get(U[0].toLowerCase()),re+U[0].length):-1}function $(V,ee,re){var U=b.exec(ee.slice(re));return U?(V.m=x.get(U[0].toLowerCase()),re+U[0].length):-1}function M(V,ee,re){return N(V,t,ee,re)}function A(V,ee,re){return N(V,r,ee,re)}function I(V,ee,re){return N(V,n,ee,re)}function B(V){return o[V.getDay()]}function L(V){return i[V.getDay()]}function R(V){return c[V.getMonth()]}function F(V){return l[V.getMonth()]}function K(V){return a[+(V.getHours()>=12)]}function z(V){return 1+~~(V.getMonth()/3)}function q(V){return o[V.getUTCDay()]}function ie(V){return i[V.getUTCDay()]}function _e(V){return c[V.getUTCMonth()]}function Me(V){return l[V.getUTCMonth()]}function Bt(V){return a[+(V.getUTCHours()>=12)]}function vt(V){return 1+~~(V.getUTCMonth()/3)}return{format:function(V){var ee=w(V+="",g);return ee.toString=function(){return V},ee},parse:function(V){var ee=_(V+="",!1);return ee.toString=function(){return V},ee},utcFormat:function(V){var ee=w(V+="",S);return ee.toString=function(){return V},ee},utcParse:function(V){var ee=_(V+="",!0);return ee.toString=function(){return V},ee}}}var Wx={"-":"",_:" ",0:"0"},Je=/^\s*\d+/,jz=/^%/,wz=/[\\^$*+?|[\]().{}]/g;function le(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(t)+a:a)}function Sz(e){return e.replace(wz,"\\$&")}function _o(e){return new RegExp("^(?:"+e.map(Sz).join("|")+")","i")}function No(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function _z(e,t,r){var n=Je.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Nz(e,t,r){var n=Je.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Oz(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Pz(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function kz(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Hx(e,t,r){var n=Je.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Kx(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Az(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function $z(e,t,r){var n=Je.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Ez(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Vx(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Cz(e,t,r){var n=Je.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Gx(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Tz(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Mz(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Iz(e,t,r){var n=Je.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Lz(e,t,r){var n=Je.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Dz(e,t,r){var n=jz.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Rz(e,t,r){var n=Je.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Bz(e,t,r){var n=Je.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function Yx(e,t){return le(e.getDate(),t,2)}function Fz(e,t){return le(e.getHours(),t,2)}function zz(e,t){return le(e.getHours()%12||12,t,2)}function Uz(e,t){return le(1+ul.count(Gr(e),e),t,3)}function aN(e,t){return le(e.getMilliseconds(),t,3)}function Wz(e,t){return aN(e,t)+"000"}function Hz(e,t){return le(e.getMonth()+1,t,2)}function Kz(e,t){return le(e.getMinutes(),t,2)}function Vz(e,t){return le(e.getSeconds(),t,2)}function Gz(e){var t=e.getDay();return t===0?7:t}function Yz(e,t){return le(wf.count(Gr(e)-1,e),t,2)}function iN(e){var t=e.getDay();return t>=4||t===0?Oi(e):Oi.ceil(e)}function qz(e,t){return e=iN(e),le(Oi.count(Gr(e),e)+(Gr(e).getDay()===4),t,2)}function Xz(e){return e.getDay()}function Qz(e,t){return le(tu.count(Gr(e)-1,e),t,2)}function Zz(e,t){return le(e.getFullYear()%100,t,2)}function Jz(e,t){return e=iN(e),le(e.getFullYear()%100,t,2)}function e9(e,t){return le(e.getFullYear()%1e4,t,4)}function t9(e,t){var r=e.getDay();return e=r>=4||r===0?Oi(e):Oi.ceil(e),le(e.getFullYear()%1e4,t,4)}function r9(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+le(t/60|0,"0",2)+le(t%60,"0",2)}function qx(e,t){return le(e.getUTCDate(),t,2)}function n9(e,t){return le(e.getUTCHours(),t,2)}function a9(e,t){return le(e.getUTCHours()%12||12,t,2)}function i9(e,t){return le(1+jf.count(Yr(e),e),t,3)}function oN(e,t){return le(e.getUTCMilliseconds(),t,3)}function o9(e,t){return oN(e,t)+"000"}function s9(e,t){return le(e.getUTCMonth()+1,t,2)}function l9(e,t){return le(e.getUTCMinutes(),t,2)}function c9(e,t){return le(e.getUTCSeconds(),t,2)}function u9(e){var t=e.getUTCDay();return t===0?7:t}function f9(e,t){return le(Sf.count(Yr(e)-1,e),t,2)}function sN(e){var t=e.getUTCDay();return t>=4||t===0?Pi(e):Pi.ceil(e)}function d9(e,t){return e=sN(e),le(Pi.count(Yr(e),e)+(Yr(e).getUTCDay()===4),t,2)}function h9(e){return e.getUTCDay()}function p9(e,t){return le(ru.count(Yr(e)-1,e),t,2)}function m9(e,t){return le(e.getUTCFullYear()%100,t,2)}function g9(e,t){return e=sN(e),le(e.getUTCFullYear()%100,t,2)}function y9(e,t){return le(e.getUTCFullYear()%1e4,t,4)}function v9(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Pi(e):Pi.ceil(e),le(e.getUTCFullYear()%1e4,t,4)}function x9(){return"+0000"}function Xx(){return"%"}function Qx(e){return+e}function Zx(e){return Math.floor(+e/1e3)}var Ma,lN,cN;b9({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 b9(e){return Ma=bz(e),lN=Ma.format,Ma.parse,cN=Ma.utcFormat,Ma.utcParse,Ma}function j9(e){return new Date(e)}function w9(e){return e instanceof Date?+e:+new Date(+e)}function og(e,t,r,n,a,i,o,l,c,u){var d=V0(),f=d.invert,h=d.domain,p=u(".%L"),v=u(":%S"),b=u("%I:%M"),x=u("%I %p"),y=u("%a %d"),m=u("%b %d"),g=u("%B"),S=u("%Y");function j(w){return(c(w)<w?p:l(w)<w?v:o(w)<w?b:i(w)<w?x:n(w)<w?a(w)<w?y:m:r(w)<w?g:S)(w)}return d.invert=function(w){return new Date(f(w))},d.domain=function(w){return arguments.length?h(Array.from(w,w9)):h().map(j9)},d.ticks=function(w){var _=h();return e(_[0],_[_.length-1],w??10)},d.tickFormat=function(w,_){return _==null?j:u(_)},d.nice=function(w){var _=h();return(!w||typeof w.range!="function")&&(w=t(_[0],_[_.length-1],w??10)),w?h(q_(_,w)):d},d.copy=function(){return cl(d,og(e,t,r,n,a,i,o,l,c,u))},d}function S9(){return er.apply(og(vz,xz,Gr,ag,wf,ul,rg,eg,na,lN).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function _9(){return er.apply(og(gz,yz,Yr,ig,Sf,jf,ng,tg,na,cN).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function _f(){var e=0,t=1,r,n,a,i,o=pt,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:o(a===0?.5:(f=(i(f)-r)*a,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,r=i(e=+e),n=i(t=+t),a=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(o=f,u):o};function d(f){return function(h){var p,v;return arguments.length?([p,v]=h,o=f(p,v),u):[o(0),o(1)]}}return u.range=d(so),u.rangeRound=d(K0),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return i=f,r=f(e),n=f(t),a=r===n?0:1/(n-r),u}}function Mn(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function uN(){var e=Tn(_f()(pt));return e.copy=function(){return Mn(e,uN())},Zr.apply(e,arguments)}function fN(){var e=q0(_f()).domain([1,10]);return e.copy=function(){return Mn(e,fN()).base(e.base())},Zr.apply(e,arguments)}function dN(){var e=X0(_f());return e.copy=function(){return Mn(e,dN()).constant(e.constant())},Zr.apply(e,arguments)}function sg(){var e=Q0(_f());return e.copy=function(){return Mn(e,sg()).exponent(e.exponent())},Zr.apply(e,arguments)}function N9(){return sg.apply(null,arguments).exponent(.5)}function hN(){var e=[],t=pt;function r(n){if(n!=null&&!isNaN(n=+n))return t((sl(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let a of n)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Nn),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,a)=>t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>fF(e,i/n))},r.copy=function(){return hN(t).domain(e)},Zr.apply(r,arguments)}function Nf(){var e=0,t=.5,r=1,n=1,a,i,o,l,c,u=pt,d,f=!1,h;function p(b){return isNaN(b=+b)?h:(b=.5+((b=+d(b))-i)*(n*b<n*i?l:c),u(f?Math.max(0,Math.min(1,b)):b))}p.domain=function(b){return arguments.length?([e,t,r]=b,a=d(e=+e),i=d(t=+t),o=d(r=+r),l=a===i?0:.5/(i-a),c=i===o?0:.5/(o-i),n=i<a?-1:1,p):[e,t,r]},p.clamp=function(b){return arguments.length?(f=!!b,p):f},p.interpolator=function(b){return arguments.length?(u=b,p):u};function v(b){return function(x){var y,m,g;return arguments.length?([y,m,g]=x,u=DF(b,[y,m,g]),p):[u(0),u(.5),u(1)]}}return p.range=v(so),p.rangeRound=v(K0),p.unknown=function(b){return arguments.length?(h=b,p):h},function(b){return d=b,a=b(e),i=b(t),o=b(r),l=a===i?0:.5/(i-a),c=i===o?0:.5/(o-i),n=i<a?-1:1,p}}function pN(){var e=Tn(Nf()(pt));return e.copy=function(){return Mn(e,pN())},Zr.apply(e,arguments)}function mN(){var e=q0(Nf()).domain([.1,1,10]);return e.copy=function(){return Mn(e,mN()).base(e.base())},Zr.apply(e,arguments)}function gN(){var e=X0(Nf());return e.copy=function(){return Mn(e,gN()).constant(e.constant())},Zr.apply(e,arguments)}function lg(){var e=Q0(Nf());return e.copy=function(){return Mn(e,lg()).exponent(e.exponent())},Zr.apply(e,arguments)}function O9(){return lg.apply(null,arguments).exponent(.5)}const Jx=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:_s,scaleDiverging:pN,scaleDivergingLog:mN,scaleDivergingPow:lg,scaleDivergingSqrt:O9,scaleDivergingSymlog:gN,scaleIdentity:Y_,scaleImplicit:jp,scaleLinear:Jc,scaleLog:X_,scaleOrdinal:U0,scalePoint:Go,scalePow:Z0,scaleQuantile:J_,scaleQuantize:eN,scaleRadial:Z_,scaleSequential:uN,scaleSequentialLog:fN,scaleSequentialPow:sg,scaleSequentialQuantile:hN,scaleSequentialSqrt:N9,scaleSequentialSymlog:dN,scaleSqrt:oz,scaleSymlog:Q_,scaleThreshold:tN,scaleTime:S9,scaleUtc:_9,tickFormat:G_},Symbol.toStringTag,{value:"Module"}));var P9=Qi;function k9(e,t,r){for(var n=-1,a=e.length;++n<a;){var i=e[n],o=t(i);if(o!=null&&(l===void 0?o===o&&!P9(o):r(o,l)))var l=o,c=i}return c}var Of=k9;function A9(e,t){return e>t}var yN=A9,$9=Of,E9=yN,C9=oo;function T9(e){return e&&e.length?$9(e,C9,E9):void 0}var M9=T9;const hn=fe(M9);function I9(e,t){return e<t}var vN=I9,L9=Of,D9=vN,R9=oo;function B9(e){return e&&e.length?L9(e,R9,D9):void 0}var F9=B9;const Pf=fe(F9);var z9=w0,U9=Or,W9=P_,H9=kt;function K9(e,t){var r=H9(e)?z9:W9;return r(e,U9(t))}var V9=K9,G9=N_,Y9=V9;function q9(e,t){return G9(Y9(e,t),1)}var X9=q9;const Q9=fe(X9);var Z9=D0;function J9(e,t){return Z9(e,t)}var e7=J9;const ki=fe(e7);var lo=1e9,t7={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},ug,Oe=!0,Zt="[DecimalError] ",ua=Zt+"Invalid argument: ",cg=Zt+"Exponent out of range: ",co=Math.floor,Xn=Math.pow,r7=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ct,qe=1e7,we=7,xN=9007199254740991,nu=co(xN/we),Y={};Y.absoluteValue=Y.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Y.comparedTo=Y.cmp=function(e){var t,r,n,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=n<a?n:a;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};Y.decimalPlaces=Y.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*we;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Y.dividedBy=Y.div=function(e){return Fr(this,new this.constructor(e))};Y.dividedToIntegerBy=Y.idiv=function(e){var t=this,r=t.constructor;return me(Fr(t,new r(e),0,1),r.precision)};Y.equals=Y.eq=function(e){return!this.cmp(e)};Y.exponent=function(){return Be(this)};Y.greaterThan=Y.gt=function(e){return this.cmp(e)>0};Y.greaterThanOrEqualTo=Y.gte=function(e){return this.cmp(e)>=0};Y.isInteger=Y.isint=function(){return this.e>this.d.length-2};Y.isNegative=Y.isneg=function(){return this.s<0};Y.isPositive=Y.ispos=function(){return this.s>0};Y.isZero=function(){return this.s===0};Y.lessThan=Y.lt=function(e){return this.cmp(e)<0};Y.lessThanOrEqualTo=Y.lte=function(e){return this.cmp(e)<1};Y.logarithm=Y.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Ct))throw Error(Zt+"NaN");if(r.s<1)throw Error(Zt+(r.s?"NaN":"-Infinity"));return r.eq(Ct)?new n(0):(Oe=!1,t=Fr(As(r,i),As(e,i),i),Oe=!0,me(t,a))};Y.minus=Y.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?wN(t,e):bN(t,(e.s=-e.s,e))};Y.modulo=Y.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(Zt+"NaN");return r.s?(Oe=!1,t=Fr(r,e,0,1).times(e),Oe=!0,r.minus(t)):me(new n(r),a)};Y.naturalExponential=Y.exp=function(){return jN(this)};Y.naturalLogarithm=Y.ln=function(){return As(this)};Y.negated=Y.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Y.plus=Y.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?bN(t,e):wN(t,(e.s=-e.s,e))};Y.precision=Y.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ua+e);if(t=Be(a)+1,n=a.d.length-1,r=n*we+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Y.squareRoot=Y.sqrt=function(){var e,t,r,n,a,i,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Zt+"NaN")}for(e=Be(l),Oe=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=yr(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=co((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),n=new c(t)):n=new c(a.toString()),r=c.precision,a=o=r+3;;)if(i=n,n=i.plus(Fr(l,i,o+2)).times(.5),yr(i.d).slice(0,o)===(t=yr(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(me(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(t!="9999")break;o+=4}return Oe=!0,me(n,r)};Y.times=Y.mul=function(e){var t,r,n,a,i,o,l,c,u,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,r=d.e+e.e,c=h.length,u=p.length,c<u&&(i=h,h=p,p=i,o=c,c=u,u=o),i=[],o=c+u,n=o;n--;)i.push(0);for(n=u;--n>=0;){for(t=0,a=c+n;a>n;)l=i[a]+p[n]*h[a-n-1]+t,i[a--]=l%qe|0,t=l/qe|0;i[a]=(i[a]+t)%qe|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,Oe?me(e,f.precision):e};Y.toDecimalPlaces=Y.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Sr(e,0,lo),t===void 0?t=n.rounding:Sr(t,0,8),me(r,e+Be(r)+1,t))};Y.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=ba(n,!0):(Sr(e,0,lo),t===void 0?t=a.rounding:Sr(t,0,8),n=me(new a(n),e+1,t),r=ba(n,!0,e+1)),r};Y.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?ba(a):(Sr(e,0,lo),t===void 0?t=i.rounding:Sr(t,0,8),n=me(new i(a),e+Be(a)+1,t),r=ba(n.abs(),!1,e+Be(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};Y.toInteger=Y.toint=function(){var e=this,t=e.constructor;return me(new t(e),Be(e)+1,t.rounding)};Y.toNumber=function(){return+this};Y.toPower=Y.pow=function(e){var t,r,n,a,i,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(Ct);if(l=new c(l),!l.s){if(e.s<1)throw Error(Zt+"Infinity");return l}if(l.eq(Ct))return l;if(n=c.precision,e.eq(Ct))return me(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=l.s,o){if((r=d<0?-d:d)<=xN){for(a=new c(Ct),t=Math.ceil(n/we+4),Oe=!1;r%2&&(a=a.times(l),tb(a.d,t)),r=co(r/2),r!==0;)l=l.times(l),tb(l.d,t);return Oe=!0,e.s<0?new c(Ct).div(a):me(a,n)}}else if(i<0)throw Error(Zt+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,Oe=!1,a=e.times(As(l,n+u)),Oe=!0,a=jN(a),a.s=i,a};Y.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=Be(a),n=ba(a,r<=i.toExpNeg||r>=i.toExpPos)):(Sr(e,1,lo),t===void 0?t=i.rounding:Sr(t,0,8),a=me(new i(a),e,t),r=Be(a),n=ba(a,e<=r||r<=i.toExpNeg,e)),n};Y.toSignificantDigits=Y.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Sr(e,1,lo),t===void 0?t=n.rounding:Sr(t,0,8)),me(new n(r),e,t)};Y.toString=Y.valueOf=Y.val=Y.toJSON=Y[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Be(e),r=e.constructor;return ba(e,t<=r.toExpNeg||t>=r.toExpPos)};function bN(e,t){var r,n,a,i,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),Oe?me(t,f):t;if(c=e.d,u=t.d,o=e.e,a=t.e,c=c.slice(),i=o-a,i){for(i<0?(n=c,i=-i,l=u.length):(n=u,a=o,l=c.length),o=Math.ceil(f/we),l=o>l?o+1:l+1,i>l&&(i=l,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(l=c.length,i=u.length,l-i<0&&(i=l,n=u,u=c,c=n),r=0;i;)r=(c[--i]=c[i]+u[i]+r)/qe|0,c[i]%=qe;for(r&&(c.unshift(r),++a),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=a,Oe?me(t,f):t}function Sr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(ua+e)}function yr(e){var t,r,n,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;t<a;t++)n=e[t]+"",r=we-n.length,r&&(i+=on(r)),i+=n;o=e[t],n=o+"",r=we-n.length,r&&(i+=on(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var Fr=function(){function e(n,a){var i,o=0,l=n.length;for(n=n.slice();l--;)i=n[l]*a+o,n[l]=i%qe|0,o=i/qe|0;return o&&n.unshift(o),n}function t(n,a,i,o){var l,c;if(i!=o)c=i>o?1:-1;else for(l=c=0;l<i;l++)if(n[l]!=a[l]){c=n[l]>a[l]?1:-1;break}return c}function r(n,a,i){for(var o=0;i--;)n[i]-=o,o=n[i]<a[i]?1:0,n[i]=o*qe+n[i]-a[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,a,i,o){var l,c,u,d,f,h,p,v,b,x,y,m,g,S,j,w,_,N,P=n.constructor,k=n.s==a.s?1:-1,T=n.d,C=a.d;if(!n.s)return new P(n);if(!a.s)throw Error(Zt+"Division by zero");for(c=n.e-a.e,_=C.length,j=T.length,p=new P(k),v=p.d=[],u=0;C[u]==(T[u]||0);)++u;if(C[u]>(T[u]||0)&&--c,i==null?m=i=P.precision:o?m=i+(Be(n)-Be(a))+1:m=i,m<0)return new P(0);if(m=m/we+2|0,u=0,_==1)for(d=0,C=C[0],m++;(u<j||d)&&m--;u++)g=d*qe+(T[u]||0),v[u]=g/C|0,d=g%C|0;else{for(d=qe/(C[0]+1)|0,d>1&&(C=e(C,d),T=e(T,d),_=C.length,j=T.length),S=_,b=T.slice(0,_),x=b.length;x<_;)b[x++]=0;N=C.slice(),N.unshift(0),w=C[0],C[1]>=qe/2&&++w;do d=0,l=t(C,b,_,x),l<0?(y=b[0],_!=x&&(y=y*qe+(b[1]||0)),d=y/w|0,d>1?(d>=qe&&(d=qe-1),f=e(C,d),h=f.length,x=b.length,l=t(f,b,h,x),l==1&&(d--,r(f,_<h?N:C,h))):(d==0&&(l=d=1),f=C.slice()),h=f.length,h<x&&f.unshift(0),r(b,f,x),l==-1&&(x=b.length,l=t(C,b,_,x),l<1&&(d++,r(b,_<x?N:C,x))),x=b.length):l===0&&(d++,b=[0]),v[u++]=d,l&&b[0]?b[x++]=T[S]||0:(b=[T[S]],x=1);while((S++<j||b[0]!==void 0)&&m--)}return v[0]||v.shift(),p.e=c,me(p,o?i+Be(p)+1:i)}}();function jN(e,t){var r,n,a,i,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(Be(e)>16)throw Error(cg+Be(e));if(!e.s)return new d(Ct);for(Oe=!1,l=f,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(Xn(2,u))/Math.LN10*2+5|0,l+=n,r=a=i=new d(Ct),d.precision=l;;){if(a=me(a.times(e),l),r=r.times(++c),o=i.plus(Fr(a,r,l)),yr(o.d).slice(0,l)===yr(i.d).slice(0,l)){for(;u--;)i=me(i.times(i),l);return d.precision=f,t==null?(Oe=!0,me(i,f)):i}i=o}}function Be(e){for(var t=e.e*we,r=e.d[0];r>=10;r/=10)t++;return t}function Rd(e,t,r){if(t>e.LN10.sd())throw Oe=!0,r&&(e.precision=r),Error(Zt+"LN10 precision limit exceeded");return me(new e(e.LN10),t)}function on(e){for(var t="";e--;)t+="0";return t}function As(e,t){var r,n,a,i,o,l,c,u,d,f=1,h=10,p=e,v=p.d,b=p.constructor,x=b.precision;if(p.s<1)throw Error(Zt+(p.s?"NaN":"-Infinity"));if(p.eq(Ct))return new b(0);if(t==null?(Oe=!1,u=x):u=t,p.eq(10))return t==null&&(Oe=!0),Rd(b,u);if(u+=h,b.precision=u,r=yr(v),n=r.charAt(0),i=Be(p),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=yr(p.d),n=r.charAt(0),f++;i=Be(p),n>1?(p=new b("0."+r),i++):p=new b(n+"."+r.slice(1))}else return c=Rd(b,u+2,x).times(i+""),p=As(new b(n+"."+r.slice(1)),u-h).plus(c),b.precision=x,t==null?(Oe=!0,me(p,x)):p;for(l=o=p=Fr(p.minus(Ct),p.plus(Ct),u),d=me(p.times(p),u),a=3;;){if(o=me(o.times(d),u),c=l.plus(Fr(o,new b(a),u)),yr(c.d).slice(0,u)===yr(l.d).slice(0,u))return l=l.times(2),i!==0&&(l=l.plus(Rd(b,u+2,x).times(i+""))),l=Fr(l,new b(f),u),b.precision=x,t==null?(Oe=!0,me(l,x)):l;l=c,a+=2}}function eb(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=co(r/we),e.d=[],n=(r+1)%we,r<0&&(n+=we),n<a){for(n&&e.d.push(+t.slice(0,n)),a-=we;n<a;)e.d.push(+t.slice(n,n+=we));t=t.slice(n),n=we-t.length}else n-=a;for(;n--;)t+="0";if(e.d.push(+t),Oe&&(e.e>nu||e.e<-nu))throw Error(cg+r)}else e.s=0,e.e=0,e.d=[0];return e}function me(e,t,r){var n,a,i,o,l,c,u,d,f=e.d;for(o=1,i=f[0];i>=10;i/=10)o++;if(n=t-o,n<0)n+=we,a=t,u=f[d=0];else{if(d=Math.ceil((n+1)/we),i=f.length,d>=i)return e;for(u=i=f[d],o=1;i>=10;i/=10)o++;n%=we,a=n-we+o}if(r!==void 0&&(i=Xn(10,o-a-1),l=u/i%10|0,c=t<0||f[d+1]!==void 0||u%i,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?a>0?u/Xn(10,o-a):0:f[d-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(i=Be(e),f.length=1,t=t-i-1,f[0]=Xn(10,(we-t%we)%we),e.e=co(-t/we)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=d,i=1,d--):(f.length=d+1,i=Xn(10,we-n),f[d]=a>0?(u/Xn(10,o-a)%Xn(10,a)|0)*i:0),c)for(;;)if(d==0){(f[0]+=i)==qe&&(f[0]=1,++e.e);break}else{if(f[d]+=i,f[d]!=qe)break;f[d--]=0,i=1}for(n=f.length;f[--n]===0;)f.pop();if(Oe&&(e.e>nu||e.e<-nu))throw Error(cg+Be(e));return e}function wN(e,t){var r,n,a,i,o,l,c,u,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),Oe?me(t,p):t;if(c=e.d,f=t.d,n=t.e,u=e.e,c=c.slice(),o=u-n,o){for(d=o<0,d?(r=c,o=-o,l=f.length):(r=f,n=u,l=c.length),a=Math.max(Math.ceil(p/we),l)+2,o>a&&(o=a,r.length=1),r.reverse(),a=o;a--;)r.push(0);r.reverse()}else{for(a=c.length,l=f.length,d=a<l,d&&(l=a),a=0;a<l;a++)if(c[a]!=f[a]){d=c[a]<f[a];break}o=0}for(d&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,a=f.length-l;a>0;--a)c[l++]=0;for(a=f.length;a>o;){if(c[--a]<f[a]){for(i=a;i&&c[--i]===0;)c[i]=qe-1;--c[i],c[a]+=qe}c[a]-=f[a]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,Oe?me(t,p):t):new h(0)}function ba(e,t,r){var n,a=Be(e),i=yr(e.d),o=i.length;return t?(r&&(n=r-o)>0?i=i.charAt(0)+"."+i.slice(1)+on(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+on(-a-1)+i,r&&(n=r-o)>0&&(i+=on(n))):a>=o?(i+=on(a+1-o),r&&(n=r-a-1)>0&&(i=i+"."+on(n))):((n=a+1)<o&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-o)>0&&(a+1===o&&(i+="."),i+=on(n))),e.s<0?"-"+i:i}function tb(e,t){if(e.length>t)return e.length=t,!0}function SN(e){var t,r,n;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(ua+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return eb(o,i.toString())}else if(typeof i!="string")throw Error(ua+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,r7.test(i))eb(o,i);else throw Error(ua+i)}if(a.prototype=Y,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=SN,a.config=a.set=n7,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return a.config(e),a}function n7(e){if(!e||typeof e!="object")throw Error(Zt+"Object expected");var t,r,n,a=["precision",1,lo,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((n=e[r=a[t]])!==void 0)if(co(n)===n&&n>=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(ua+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(ua+r+": "+n);return this}var ug=SN(t7);Ct=new ug(1);const he=ug;function a7(e){return l7(e)||s7(e)||o7(e)||i7()}function i7(){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 o7(e,t){if(e){if(typeof e=="string")return Np(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Np(e,t)}}function s7(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function l7(e){if(Array.isArray(e))return Np(e)}function Np(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var c7=function(t){return t},_N={},NN=function(t){return t===_N},rb=function(t){return function r(){return arguments.length===0||arguments.length===1&&NN(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},u7=function e(t,r){return t===1?r:rb(function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var o=a.filter(function(l){return l!==_N}).length;return o>=t?r.apply(void 0,a):e(t-o,rb(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=a.map(function(f){return NN(f)?c.shift():f});return r.apply(void 0,a7(d).concat(c))}))})},kf=function(t){return u7(t.length,t)},Op=function(t,r){for(var n=[],a=t;a<r;++a)n[a-t]=a;return n},f7=kf(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),d7=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return c7;var a=r.reverse(),i=a[0],o=a.slice(1);return function(){return o.reduce(function(l,c){return c(l)},i.apply(void 0,arguments))}},Pp=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},ON=function(t){var r=null,n=null;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return r&&i.every(function(l,c){return l===r[c]})||(r=i,n=t.apply(void 0,i)),n}};function h7(e){var t;return e===0?t=1:t=Math.floor(new he(e).abs().log(10).toNumber())+1,t}function p7(e,t,r){for(var n=new he(e),a=0,i=[];n.lt(t)&&a<1e5;)i.push(n.toNumber()),n=n.add(r),a++;return i}var m7=kf(function(e,t,r){var n=+e,a=+t;return n+r*(a-n)}),g7=kf(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),y7=kf(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const Af={rangeStep:p7,getDigitCount:h7,interpolateNumber:m7,uninterpolateNumber:g7,uninterpolateTruncation:y7};function kp(e){return b7(e)||x7(e)||PN(e)||v7()}function v7(){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 x7(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function b7(e){if(Array.isArray(e))return Ap(e)}function $s(e,t){return S7(e)||w7(e,t)||PN(e,t)||j7()}function j7(){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 PN(e,t){if(e){if(typeof e=="string")return Ap(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ap(e,t)}}function Ap(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function w7(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),l;!(n=(l=o.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(c){a=!0,i=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(a)throw i}}return r}}function S7(e){if(Array.isArray(e))return e}function kN(e){var t=$s(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function AN(e,t,r){if(e.lte(0))return new he(0);var n=Af.getDigitCount(e.toNumber()),a=new he(10).pow(n),i=e.div(a),o=n!==1?.05:.1,l=new he(Math.ceil(i.div(o).toNumber())).add(r).mul(o),c=l.mul(a);return t?c:new he(Math.ceil(c))}function _7(e,t,r){var n=1,a=new he(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new he(10).pow(Af.getDigitCount(e)-1),a=new he(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new he(Math.floor(e)))}else e===0?a=new he(Math.floor((t-1)/2)):r||(a=new he(Math.floor(e)));var o=Math.floor((t-1)/2),l=d7(f7(function(c){return a.add(new he(c-o).mul(n)).toNumber()}),Op);return l(0,t)}function $N(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new he(0),tickMin:new he(0),tickMax:new he(0)};var i=AN(new he(t).sub(e).div(r-1),n,a),o;e<=0&&t>=0?o=new he(0):(o=new he(e).add(t).div(2),o=o.sub(new he(o).mod(i)));var l=Math.ceil(o.sub(e).div(i).toNumber()),c=Math.ceil(new he(t).sub(o).div(i).toNumber()),u=l+c+1;return u>r?$N(e,t,r,n,a+1):(u<r&&(c=t>0?c+(r-u):c,l=t>0?l:l+(r-u)),{step:i,tickMin:o.sub(new he(l).mul(i)),tickMax:o.add(new he(c).mul(i))})}function N7(e){var t=$s(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),l=kN([r,n]),c=$s(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(kp(Op(0,a-1).map(function(){return 1/0}))):[].concat(kp(Op(0,a-1).map(function(){return-1/0})),[d]);return r>n?Pp(f):f}if(u===d)return _7(u,a,i);var h=$N(u,d,o,i),p=h.step,v=h.tickMin,b=h.tickMax,x=Af.rangeStep(v,b.add(new he(.1).mul(p)),p);return r>n?Pp(x):x}function O7(e,t){var r=$s(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=kN([n,a]),l=$s(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[n,a];if(c===u)return[c];var d=Math.max(t,2),f=AN(new he(u).sub(c).div(d-1),i,0),h=[].concat(kp(Af.rangeStep(new he(c),new he(u).sub(new he(.99).mul(f)),f)),[u]);return n>a?Pp(h):h}var P7=ON(N7),k7=ON(O7),A7="Invariant failed";function ja(e,t){throw new Error(A7)}var $7=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Ai(e){"@babel/helpers - typeof";return Ai=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},Ai(e)}function au(){return au=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},au.apply(this,arguments)}function E7(e,t){return I7(e)||M7(e,t)||T7(e,t)||C7()}function C7(){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 T7(e,t){if(e){if(typeof e=="string")return nb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nb(e,t)}}function nb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function M7(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function I7(e){if(Array.isArray(e))return e}function L7(e,t){if(e==null)return{};var r=D7(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function D7(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function R7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function B7(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,TN(n.key),n)}}function F7(e,t,r){return t&&B7(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function z7(e,t,r){return t=iu(t),U7(e,EN()?Reflect.construct(t,r||[],iu(e).constructor):t.apply(e,r))}function U7(e,t){if(t&&(Ai(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return W7(e)}function W7(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function EN(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(EN=function(){return!!e})()}function iu(e){return iu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},iu(e)}function H7(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$p(e,t)}function $p(e,t){return $p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},$p(e,t)}function CN(e,t,r){return t=TN(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TN(e){var t=K7(e,"string");return Ai(t)=="symbol"?t:t+""}function K7(e,t){if(Ai(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ai(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var $f=function(e){function t(){return R7(this,t),z7(this,t,arguments)}return H7(t,e),F7(t,[{key:"render",value:function(){var n=this.props,a=n.offset,i=n.layout,o=n.width,l=n.dataKey,c=n.data,u=n.dataPointFormatter,d=n.xAxis,f=n.yAxis,h=L7(n,$7),p=X(h,!1);this.props.direction==="x"&&d.type!=="number"&&ja();var v=c.map(function(b){var x=u(b,l),y=x.x,m=x.y,g=x.value,S=x.errorVal;if(!S)return null;var j=[],w,_;if(Array.isArray(S)){var N=E7(S,2);w=N[0],_=N[1]}else w=_=S;if(i==="vertical"){var P=d.scale,k=m+a,T=k+o,C=k-o,$=P(g-w),M=P(g+_);j.push({x1:M,y1:T,x2:M,y2:C}),j.push({x1:$,y1:k,x2:M,y2:k}),j.push({x1:$,y1:T,x2:$,y2:C})}else if(i==="horizontal"){var A=f.scale,I=y+a,B=I-o,L=I+o,R=A(g-w),F=A(g+_);j.push({x1:B,y1:F,x2:L,y2:F}),j.push({x1:I,y1:R,x2:I,y2:F}),j.push({x1:B,y1:R,x2:L,y2:R})}return E.createElement(ae,au({className:"recharts-errorBar",key:"bar-".concat(j.map(function(K){return"".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))},p),j.map(function(K){return E.createElement("line",au({},K,{key:"line-".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))}))});return E.createElement(ae,{className:"recharts-errorBars"},v)}}])}(E.Component);CN($f,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});CN($f,"displayName","ErrorBar");function Es(e){"@babel/helpers - typeof";return Es=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},Es(e)}function ab(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function zn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ab(Object(r),!0).forEach(function(n){V7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ab(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function V7(e,t,r){return t=G7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function G7(e){var t=Y7(e,"string");return Es(t)=="symbol"?t:t+""}function Y7(e,t){if(Es(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Es(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MN=function(t){var r=t.children,n=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=Et(r,li);if(!o)return null;var l=li.defaultProps,c=l!==void 0?zn(zn({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:i==="children"?u=(n||[]).reduce(function(d,f){var h=f.item,p=f.props,v=p.sectors||p.data||[];return d.concat(v.map(function(b){return{type:o.props.iconType||h.props.legendType,value:b.name,color:b.fill,payload:b}}))},[]):u=(n||[]).map(function(d){var f=d.item,h=f.type.defaultProps,p=h!==void 0?zn(zn({},h),f.props):{},v=p.dataKey,b=p.name,x=p.legendType,y=p.hide;return{inactive:y,dataKey:v,type:c.iconType||x||"square",color:fg(f),value:b||v,payload:p}}),zn(zn(zn({},c),li.getWithHeight(o,a)),{},{payload:u,item:o})};function Cs(e){"@babel/helpers - typeof";return Cs=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},Cs(e)}function ib(e){return Z7(e)||Q7(e)||X7(e)||q7()}function q7(){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 X7(e,t){if(e){if(typeof e=="string")return Ep(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ep(e,t)}}function Q7(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Z7(e){if(Array.isArray(e))return Ep(e)}function Ep(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ob(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Te(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ob(Object(r),!0).forEach(function(n){ui(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ob(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ui(e,t,r){return t=J7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function J7(e){var t=eU(e,"string");return Cs(t)=="symbol"?t:t+""}function eU(e,t){if(Cs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Cs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ke(e,t,r){return J(e)||J(t)?r:Ge(t)?It(e,t,r):Z(t)?t(e):r}function Yo(e,t,r,n){var a=Q9(e,function(l){return Ke(l,t)});if(r==="number"){var i=a.filter(function(l){return W(l)||parseFloat(l)});return i.length?[Pf(i),hn(i)]:[1/0,-1/0]}var o=n?a.filter(function(l){return!J(l)}):a;return o.map(function(l){return Ge(l)||l instanceof Date?l:""})}var tU=function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,u=0;u<l;u++){var d=u>0?a[u-1].coordinate:a[l-1].coordinate,f=a[u].coordinate,h=u>=l-1?a[0].coordinate:a[u+1].coordinate,p=void 0;if(dt(f-d)!==dt(h-f)){var v=[];if(dt(h-f)===dt(c[1]-c[0])){p=h;var b=f+c[1]-c[0];v[0]=Math.min(b,(b+d)/2),v[1]=Math.max(b,(b+d)/2)}else{p=d;var x=h+c[1]-c[0];v[0]=Math.min(f,(x+f)/2),v[1]=Math.max(f,(x+f)/2)}var y=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>y[0]&&t<=y[1]||t>=v[0]&&t<=v[1]){o=a[u].index;break}}else{var m=Math.min(d,h),g=Math.max(d,h);if(t>(m+f)/2&&t<=(g+f)/2){o=a[u].index;break}}}else for(var S=0;S<l;S++)if(S===0&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S>0&&S<l-1&&t>(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===l-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},fg=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Te(Te({},t.type.defaultProps),t.props):t.props,o=i.stroke,l=i.fill,c;switch(a){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},rU=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},l=Object.keys(i),c=0,u=l.length;c<u;c++)for(var d=i[l[c]].stackGroups,f=Object.keys(d),h=0,p=f.length;h<p;h++){var v=d[f[h]],b=v.items,x=v.cateAxisId,y=b.filter(function(_){return Br(_.type).indexOf("Bar")>=0});if(y&&y.length){var m=y[0].type.defaultProps,g=m!==void 0?Te(Te({},m),y[0].props):y[0].props,S=g.barSize,j=g[x];o[j]||(o[j]=[]);var w=J(S)?r:S;o[j].push({item:y[0],stackList:y.slice(1),barSize:J(w)?void 0:ht(w,n,0)})}}return o},nU=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=ht(r,a,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=a/c,v=o.reduce(function(S,j){return S+j.barSize||0},0);v+=(c-1)*u,v>=a&&(v-=(c-1)*u,u=0),v>=a&&p>0&&(h=!0,p*=.9,v=c*p);var b=(a-v)/2>>0,x={offset:b-u,size:0};d=o.reduce(function(S,j){var w={item:j.item,position:{offset:x.offset+x.size+u,size:h?p:j.barSize}},_=[].concat(ib(S),[w]);return x=_[_.length-1].position,j.stackList&&j.stackList.length&&j.stackList.forEach(function(N){_.push({item:N,position:x})}),_},f)}else{var y=ht(n,a,0,!0);a-2*y-(c-1)*u<=0&&(u=0);var m=(a-2*y-(c-1)*u)/c;m>1&&(m>>=0);var g=l===+l?Math.min(m,l):m;d=o.reduce(function(S,j,w){var _=[].concat(ib(S),[{item:j.item,position:{offset:y+(m+u)*w+(m-g)/2,size:g}}]);return j.stackList&&j.stackList.length&&j.stackList.forEach(function(N){_.push({item:N,position:_[_.length-1].position})}),_},f)}return d},aU=function(t,r,n,a){var i=n.children,o=n.width,l=n.margin,c=o-(l.left||0)-(l.right||0),u=MN({children:i,legendWidth:c});if(u){var d=a||{},f=d.width,h=d.height,p=u.align,v=u.verticalAlign,b=u.layout;if((b==="vertical"||b==="horizontal"&&v==="middle")&&p!=="center"&&W(t[p]))return Te(Te({},t),{},ui({},p,t[p]+(f||0)));if((b==="horizontal"||b==="vertical"&&p==="center")&&v!=="middle"&&W(t[v]))return Te(Te({},t),{},ui({},v,t[v]+(h||0)))}return t},iU=function(t,r,n){return J(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},IN=function(t,r,n,a,i){var o=r.props.children,l=qt(o,$f).filter(function(u){return iU(a,i,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=Ke(d,n);if(J(f))return u;var h=Array.isArray(f)?[Pf(f),hn(f)]:[f,f],p=c.reduce(function(v,b){var x=Ke(d,b,0),y=h[0]-Math.abs(Array.isArray(x)?x[0]:x),m=h[1]+Math.abs(Array.isArray(x)?x[1]:x);return[Math.min(y,v[0]),Math.max(m,v[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},oU=function(t,r,n,a,i){var o=r.map(function(l){return IN(t,l,n,i,a)}).filter(function(l){return!J(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},LN=function(t,r,n,a,i){var o=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&IN(t,c,u,a)||Yo(t,u,n,i)});if(n==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},DN=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},RN=function(t,r,n,a){if(a)return t.map(function(c){return c.coordinate});var i,o,l=t.map(function(c){return c.coordinate===r&&(i=!0),c.coordinate===n&&(o=!0),c.coordinate});return i||l.push(r),o||l.push(n),l},Dr=function(t,r,n){if(!t)return null;var a=t.scale,i=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,u=(r||n)&&o==="category"&&a.bandwidth?a.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?dt(l[0]-l[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=i?i.indexOf(f):f;return{coordinate:a(h)+u,value:f,offset:u}});return d.filter(function(f){return!ro(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:a(f)+u,value:f,index:h,offset:u}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(f){return{coordinate:a(f)+u,value:f,offset:u}}):a.domain().map(function(f,h){return{coordinate:a(f)+u,value:i?i[f]:f,index:h,offset:u}})},Bd=new WeakMap,Bl=function(t,r){if(typeof r!="function")return t;Bd.has(t)||Bd.set(t,new WeakMap);var n=Bd.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},BN=function(t,r,n){var a=t.scale,i=t.type,o=t.layout,l=t.axisType;if(a==="auto")return o==="radial"&&l==="radiusAxis"?{scale:_s(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:Jc(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Go(),realScaleType:"point"}:i==="category"?{scale:_s(),realScaleType:"band"}:{scale:Jc(),realScaleType:"linear"};if(ga(a)){var c="scale".concat(hf(a));return{scale:(Jx[c]||Go)(),realScaleType:Jx[c]?c:"point"}}return Z(a)?{scale:a}:{scale:Go(),realScaleType:"point"}},sb=1e-4,FN=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-sb,o=Math.max(a[0],a[1])+sb,l=t(r[0]),c=t(r[n-1]);(l<i||l>o||c<i||c>o)&&t.domain([r[0],r[n-1]])}},sU=function(t,r){if(!t)return null;for(var n=0,a=t.length;n<a;n++)if(t[n].item===r)return t[n].position;return null},lU=function(t,r){if(!r||r.length!==2||!W(r[0])||!W(r[1]))return t;var n=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]),i=[t[0],t[1]];return(!W(t[0])||t[0]<n)&&(i[0]=n),(!W(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<n&&(i[1]=n),i},cU=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,o=0,l=0;l<r;++l){var c=ro(t[l][n][1])?t[l][n][0]:t[l][n][1];c>=0?(t[l][n][0]=i,t[l][n][1]=i+c,i=t[l][n][1]):(t[l][n][0]=o,t[l][n][1]=o+c,o=t[l][n][1])}},uU=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,o=0;o<r;++o){var l=ro(t[o][n][1])?t[o][n][0]:t[o][n][1];l>=0?(t[o][n][0]=i,t[o][n][1]=i+l,i=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},fU={sign:cU,expand:$4,none:xi,silhouette:E4,wiggle:C4,positive:uU},dU=function(t,r,n){var a=r.map(function(l){return l.props.dataKey}),i=fU[n],o=A4().keys(a).value(function(l,c){return+Ke(l,c,0)}).order(rp).offset(i);return o(t)},hU=function(t,r,n,a,i,o){if(!t)return null;var l=o?r.reverse():r,c={},u=l.reduce(function(f,h){var p,v=(p=h.type)!==null&&p!==void 0&&p.defaultProps?Te(Te({},h.type.defaultProps),h.props):h.props,b=v.stackId,x=v.hide;if(x)return f;var y=v[n],m=f[y]||{hasStack:!1,stackGroups:{}};if(Ge(b)){var g=m.stackGroups[b]||{numericAxisId:n,cateAxisId:a,items:[]};g.items.push(h),m.hasStack=!0,m.stackGroups[b]=g}else m.stackGroups[no("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[h]};return Te(Te({},f),{},ui({},y,m))},c),d={};return Object.keys(u).reduce(function(f,h){var p=u[h];if(p.hasStack){var v={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(b,x){var y=p.stackGroups[x];return Te(Te({},b),{},ui({},x,{numericAxisId:n,cateAxisId:a,items:y.items,stackedData:dU(t,y.items,i)}))},v)}return Te(Te({},f),{},ui({},h,p))},d)},zN=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,o=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=P7(u,i,l);return t.domain([Pf(d),hn(d)]),{niceTicks:d}}if(i&&a==="number"){var f=t.domain(),h=k7(f,i,l);return{niceTicks:h}}return null};function lb(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!J(a[t.dataKey])){var l=Ec(r,"value",a[t.dataKey]);if(l)return l.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var c=Ke(a,J(o)?t.dataKey:o);return J(c)?null:t.scale(c)}var cb=function(t){var r=t.axis,n=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,l=t.index;if(r.type==="category")return n[l]?n[l].coordinate+a:null;var c=Ke(o,r.dataKey,r.domain[l]);return J(c)?null:r.scale(c)-i/2+a},pU=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},mU=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Te(Te({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Ge(i)){var o=r[i];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},gU=function(t){return t.reduce(function(r,n){return[Pf(n.concat([r[0]]).filter(W)),hn(n.concat([r[1]]).filter(W))]},[1/0,-1/0])},UN=function(t,r,n){return Object.keys(t).reduce(function(a,i){var o=t[i],l=o.stackedData,c=l.reduce(function(u,d){var f=gU(d.slice(r,n+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],a[0]),Math.max(c[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},ub=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,fb=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Cp=function(t,r,n){if(Z(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(W(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(ub.test(t[0])){var i=+ub.exec(t[0])[1];a[0]=r[0]-i}else Z(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(W(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(fb.test(t[1])){var o=+fb.exec(t[1])[1];a[1]=r[1]+o}else Z(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},ou=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=B0(r,function(f){return f.coordinate}),o=1/0,l=1,c=i.length;l<c;l++){var u=i[l],d=i[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},db=function(t,r,n){return!t||!t.length||ki(t,It(n,"type.defaultProps.domain"))?r:t},WN=function(t,r){var n=t.type.defaultProps?Te(Te({},t.type.defaultProps),t.props):t.props,a=n.dataKey,i=n.name,o=n.unit,l=n.formatter,c=n.tooltipType,u=n.chartType,d=n.hide;return Te(Te({},X(t,!1)),{},{dataKey:a,unit:o,formatter:l,name:i||a,color:fg(t),value:Ke(r,a),type:c,payload:r,chartType:u,hide:d})};function Ts(e){"@babel/helpers - typeof";return Ts=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},Ts(e)}function hb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Er(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hb(Object(r),!0).forEach(function(n){HN(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function HN(e,t,r){return t=yU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yU(e){var t=vU(e,"string");return Ts(t)=="symbol"?t:t+""}function vU(e,t){if(Ts(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ts(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xU(e,t){return SU(e)||wU(e,t)||jU(e,t)||bU()}function bU(){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 jU(e,t){if(e){if(typeof e=="string")return pb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pb(e,t)}}function pb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function wU(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function SU(e){if(Array.isArray(e))return e}var su=Math.PI/180,_U=function(t){return t*180/Math.PI},xe=function(t,r,n,a){return{x:t+Math.cos(-su*a)*n,y:r+Math.sin(-su*a)*n}},KN=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},NU=function(t,r,n,a,i){var o=t.width,l=t.height,c=t.startAngle,u=t.endAngle,d=ht(t.cx,o,o/2),f=ht(t.cy,l,l/2),h=KN(o,l,n),p=ht(t.innerRadius,h,0),v=ht(t.outerRadius,h,h*.8),b=Object.keys(r);return b.reduce(function(x,y){var m=r[y],g=m.domain,S=m.reversed,j;if(J(m.range))a==="angleAxis"?j=[c,u]:a==="radiusAxis"&&(j=[p,v]),S&&(j=[j[1],j[0]]);else{j=m.range;var w=j,_=xU(w,2);c=_[0],u=_[1]}var N=BN(m,i),P=N.realScaleType,k=N.scale;k.domain(g).range(j),FN(k);var T=zN(k,Er(Er({},m),{},{realScaleType:P})),C=Er(Er(Er({},m),T),{},{range:j,radius:v,realScaleType:P,scale:k,cx:d,cy:f,innerRadius:p,outerRadius:v,startAngle:c,endAngle:u});return Er(Er({},x),{},HN({},y,C))},{})},OU=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-o,2))},PU=function(t,r){var n=t.x,a=t.y,i=r.cx,o=r.cy,l=OU({x:n,y:a},{x:i,y:o});if(l<=0)return{radius:l};var c=(n-i)/l,u=Math.acos(c);return a>o&&(u=2*Math.PI-u),{radius:l,angle:_U(u),angleInRadian:u}},kU=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(a,i);return{startAngle:r-o*360,endAngle:n-o*360}},AU=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),o=Math.floor(a/360),l=Math.min(i,o);return t+l*360},mb=function(t,r){var n=t.x,a=t.y,i=PU({x:n,y:a},r),o=i.radius,l=i.angle,c=r.innerRadius,u=r.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=kU(r),f=d.startAngle,h=d.endAngle,p=l,v;if(f<=h){for(;p>h;)p-=360;for(;p<f;)p+=360;v=p>=f&&p<=h}else{for(;p>f;)p-=360;for(;p<h;)p+=360;v=p>=h&&p<=f}return v?Er(Er({},r),{},{radius:o,angle:AU(p,r)}):null},VN=function(t){return!O.isValidElement(t)&&!Z(t)&&typeof t!="boolean"?t.className:""};function Ms(e){"@babel/helpers - typeof";return Ms=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},Ms(e)}var $U=["offset"];function EU(e){return IU(e)||MU(e)||TU(e)||CU()}function CU(){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 TU(e,t){if(e){if(typeof e=="string")return Tp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tp(e,t)}}function MU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function IU(e){if(Array.isArray(e))return Tp(e)}function Tp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function LU(e,t){if(e==null)return{};var r=DU(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function DU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function gb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function We(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gb(Object(r),!0).forEach(function(n){RU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function RU(e,t,r){return t=BU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BU(e){var t=FU(e,"string");return Ms(t)=="symbol"?t:t+""}function FU(e,t){if(Ms(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ms(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Is(){return Is=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Is.apply(this,arguments)}var zU=function(t){var r=t.value,n=t.formatter,a=J(t.children)?r:t.children;return Z(n)?n(a):a},UU=function(t,r){var n=dt(r-t),a=Math.min(Math.abs(r-t),360);return n*a},WU=function(t,r,n){var a=t.position,i=t.viewBox,o=t.offset,l=t.className,c=i,u=c.cx,d=c.cy,f=c.innerRadius,h=c.outerRadius,p=c.startAngle,v=c.endAngle,b=c.clockWise,x=(f+h)/2,y=UU(p,v),m=y>=0?1:-1,g,S;a==="insideStart"?(g=p+m*o,S=b):a==="insideEnd"?(g=v-m*o,S=!b):a==="end"&&(g=v+m*o,S=b),S=y<=0?S:!S;var j=xe(u,d,x,g),w=xe(u,d,x,g+(S?1:-1)*359),_="M".concat(j.x,",").concat(j.y,`
-    A`).concat(x,",").concat(x,",0,1,").concat(S?0:1,`,
-    `).concat(w.x,",").concat(w.y),N=J(t.id)?no("recharts-radial-line-"):t.id;return E.createElement("text",Is({},n,{dominantBaseline:"central",className:te("recharts-radial-bar-label",l)}),E.createElement("defs",null,E.createElement("path",{id:N,d:_})),E.createElement("textPath",{xlinkHref:"#".concat(N)},r))},HU=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,o=i.cx,l=i.cy,c=i.innerRadius,u=i.outerRadius,d=i.startAngle,f=i.endAngle,h=(d+f)/2;if(a==="outside"){var p=xe(o,l,u+n,h),v=p.x,b=p.y;return{x:v,y:b,textAnchor:v>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var x=(c+u)/2,y=xe(o,l,x,h),m=y.x,g=y.y;return{x:m,y:g,textAnchor:"middle",verticalAnchor:"middle"}},KU=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,o=r,l=o.x,c=o.y,u=o.width,d=o.height,f=d>=0?1:-1,h=f*a,p=f>0?"end":"start",v=f>0?"start":"end",b=u>=0?1:-1,x=b*a,y=b>0?"end":"start",m=b>0?"start":"end";if(i==="top"){var g={x:l+u/2,y:c-f*a,textAnchor:"middle",verticalAnchor:p};return We(We({},g),n?{height:Math.max(c-n.y,0),width:u}:{})}if(i==="bottom"){var S={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:v};return We(We({},S),n?{height:Math.max(n.y+n.height-(c+d),0),width:u}:{})}if(i==="left"){var j={x:l-x,y:c+d/2,textAnchor:y,verticalAnchor:"middle"};return We(We({},j),n?{width:Math.max(j.x-n.x,0),height:d}:{})}if(i==="right"){var w={x:l+u+x,y:c+d/2,textAnchor:m,verticalAnchor:"middle"};return We(We({},w),n?{width:Math.max(n.x+n.width-w.x,0),height:d}:{})}var _=n?{width:u,height:d}:{};return i==="insideLeft"?We({x:l+x,y:c+d/2,textAnchor:m,verticalAnchor:"middle"},_):i==="insideRight"?We({x:l+u-x,y:c+d/2,textAnchor:y,verticalAnchor:"middle"},_):i==="insideTop"?We({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:v},_):i==="insideBottom"?We({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:p},_):i==="insideTopLeft"?We({x:l+x,y:c+h,textAnchor:m,verticalAnchor:v},_):i==="insideTopRight"?We({x:l+u-x,y:c+h,textAnchor:y,verticalAnchor:v},_):i==="insideBottomLeft"?We({x:l+x,y:c+d-h,textAnchor:m,verticalAnchor:p},_):i==="insideBottomRight"?We({x:l+u-x,y:c+d-h,textAnchor:y,verticalAnchor:p},_):Zi(i)&&(W(i.x)||ta(i.x))&&(W(i.y)||ta(i.y))?We({x:l+ht(i.x,u),y:c+ht(i.y,d),textAnchor:"end",verticalAnchor:"end"},_):We({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},_)},VU=function(t){return"cx"in t&&W(t.cx)};function Qe(e){var t=e.offset,r=t===void 0?5:t,n=LU(e,$U),a=We({offset:r},n),i=a.viewBox,o=a.position,l=a.value,c=a.children,u=a.content,d=a.className,f=d===void 0?"":d,h=a.textBreakAll;if(!i||J(l)&&J(c)&&!O.isValidElement(u)&&!Z(u))return null;if(O.isValidElement(u))return O.cloneElement(u,a);var p;if(Z(u)){if(p=O.createElement(u,a),O.isValidElement(p))return p}else p=zU(a);var v=VU(i),b=X(a,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return WU(a,p,b);var x=v?HU(a):KU(a);return E.createElement(xa,Is({className:te("recharts-label",f)},b,x,{breakAll:h}),p)}Qe.displayName="Label";var GN=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,h=t.y,p=t.top,v=t.left,b=t.width,x=t.height,y=t.clockWise,m=t.labelViewBox;if(m)return m;if(W(b)&&W(x)){if(W(f)&&W(h))return{x:f,y:h,width:b,height:x};if(W(p)&&W(v))return{x:p,y:v,width:b,height:x}}return W(f)&&W(h)?{x:f,y:h,width:0,height:0}:W(r)&&W(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:o||a||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:y}:t.viewBox?t.viewBox:{}},GU=function(t,r){return t?t===!0?E.createElement(Qe,{key:"label-implicit",viewBox:r}):Ge(t)?E.createElement(Qe,{key:"label-implicit",viewBox:r,value:t}):O.isValidElement(t)?t.type===Qe?O.cloneElement(t,{key:"label-implicit",viewBox:r}):E.createElement(Qe,{key:"label-implicit",content:t,viewBox:r}):Z(t)?E.createElement(Qe,{key:"label-implicit",content:t,viewBox:r}):Zi(t)?E.createElement(Qe,Is({viewBox:r},t,{key:"label-implicit"})):null:null},YU=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var a=t.children,i=GN(t),o=qt(a,Qe).map(function(c,u){return O.cloneElement(c,{viewBox:r||i,key:"label-".concat(u)})});if(!n)return o;var l=GU(t.label,r||i);return[l].concat(EU(o))};Qe.parseViewBox=GN;Qe.renderCallByParent=YU;function qU(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var XU=qU;const QU=fe(XU);function Ls(e){"@babel/helpers - typeof";return Ls=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},Ls(e)}var ZU=["valueAccessor"],JU=["data","dataKey","clockWise","id","textBreakAll"];function eW(e){return aW(e)||nW(e)||rW(e)||tW()}function tW(){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 rW(e,t){if(e){if(typeof e=="string")return Mp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Mp(e,t)}}function nW(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function aW(e){if(Array.isArray(e))return Mp(e)}function Mp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function lu(){return lu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lu.apply(this,arguments)}function yb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function vb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yb(Object(r),!0).forEach(function(n){iW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iW(e,t,r){return t=oW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oW(e){var t=sW(e,"string");return Ls(t)=="symbol"?t:t+""}function sW(e,t){if(Ls(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ls(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xb(e,t){if(e==null)return{};var r=lW(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lW(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var cW=function(t){return Array.isArray(t.value)?QU(t.value):t.value};function zr(e){var t=e.valueAccessor,r=t===void 0?cW:t,n=xb(e,ZU),a=n.data,i=n.dataKey,o=n.clockWise,l=n.id,c=n.textBreakAll,u=xb(n,JU);return!a||!a.length?null:E.createElement(ae,{className:"recharts-label-list"},a.map(function(d,f){var h=J(i)?r(d,f):Ke(d&&d.payload,i),p=J(l)?{}:{id:"".concat(l,"-").concat(f)};return E.createElement(Qe,lu({},X(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:Qe.parseViewBox(J(o)?d:vb(vb({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}zr.displayName="LabelList";function uW(e,t){return e?e===!0?E.createElement(zr,{key:"labelList-implicit",data:t}):E.isValidElement(e)||Z(e)?E.createElement(zr,{key:"labelList-implicit",data:t,content:e}):Zi(e)?E.createElement(zr,lu({data:t},e,{key:"labelList-implicit"})):null:null}function fW(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,a=qt(n,zr).map(function(o,l){return O.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!r)return a;var i=uW(e.label,t);return[i].concat(eW(a))}zr.renderCallByParent=fW;function Ds(e){"@babel/helpers - typeof";return Ds=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},Ds(e)}function Ip(){return Ip=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ip.apply(this,arguments)}function bb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function jb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bb(Object(r),!0).forEach(function(n){dW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dW(e,t,r){return t=hW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hW(e){var t=pW(e,"string");return Ds(t)=="symbol"?t:t+""}function pW(e,t){if(Ds(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ds(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mW=function(t,r){var n=dt(r-t),a=Math.min(Math.abs(r-t),359.999);return n*a},Fl=function(t){var r=t.cx,n=t.cy,a=t.radius,i=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+a,f=Math.asin(c/d)/su,h=u?i:i+o*f,p=xe(r,n,d,h),v=xe(r,n,a,h),b=u?i-o*f:i,x=xe(r,n,d*Math.cos(f*su),b);return{center:p,circleTangency:v,lineTangency:x,theta:f}},YN=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,l=t.endAngle,c=mW(o,l),u=o+c,d=xe(r,n,i,o),f=xe(r,n,i,u),h="M ".concat(d.x,",").concat(d.y,`
-    A `).concat(i,",").concat(i,`,0,
-    `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
-    `).concat(f.x,",").concat(f.y,`
-  `);if(a>0){var p=xe(r,n,a,o),v=xe(r,n,a,u);h+="L ".concat(v.x,",").concat(v.y,`
-            A `).concat(a,",").concat(a,`,0,
-            `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`,
-            `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},gW=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=dt(d-u),h=Fl({cx:r,cy:n,radius:i,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),p=h.circleTangency,v=h.lineTangency,b=h.theta,x=Fl({cx:r,cy:n,radius:i,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),y=x.circleTangency,m=x.lineTangency,g=x.theta,S=c?Math.abs(u-d):Math.abs(u-d)-b-g;if(S<0)return l?"M ".concat(v.x,",").concat(v.y,`
-        a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
-        a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
-      `):YN({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:u,endAngle:d});var j="M ".concat(v.x,",").concat(v.y,`
-    A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(p.x,",").concat(p.y,`
-    A`).concat(i,",").concat(i,",0,").concat(+(S>180),",").concat(+(f<0),",").concat(y.x,",").concat(y.y,`
-    A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(m.x,",").concat(m.y,`
-  `);if(a>0){var w=Fl({cx:r,cy:n,radius:a,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),_=w.circleTangency,N=w.lineTangency,P=w.theta,k=Fl({cx:r,cy:n,radius:a,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),T=k.circleTangency,C=k.lineTangency,$=k.theta,M=c?Math.abs(u-d):Math.abs(u-d)-P-$;if(M<0&&o===0)return"".concat(j,"L").concat(r,",").concat(n,"Z");j+="L".concat(C.x,",").concat(C.y,`
-      A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(T.x,",").concat(T.y,`
-      A`).concat(a,",").concat(a,",0,").concat(+(M>180),",").concat(+(f>0),",").concat(_.x,",").concat(_.y,`
-      A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(N.x,",").concat(N.y,"Z")}else j+="L".concat(r,",").concat(n,"Z");return j},yW={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},qN=function(t){var r=jb(jb({},yW),t),n=r.cx,a=r.cy,i=r.innerRadius,o=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,d=r.startAngle,f=r.endAngle,h=r.className;if(o<i||d===f)return null;var p=te("recharts-sector",h),v=o-i,b=ht(l,v,0,!0),x;return b>0&&Math.abs(d-f)<360?x=gW({cx:n,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(b,v/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):x=YN({cx:n,cy:a,innerRadius:i,outerRadius:o,startAngle:d,endAngle:f}),E.createElement("path",Ip({},X(r,!0),{className:p,d:x,role:"img"}))};function Rs(e){"@babel/helpers - typeof";return Rs=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},Rs(e)}function Lp(){return Lp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lp.apply(this,arguments)}function wb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Sb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wb(Object(r),!0).forEach(function(n){vW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vW(e,t,r){return t=xW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xW(e){var t=bW(e,"string");return Rs(t)=="symbol"?t:t+""}function bW(e,t){if(Rs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Rs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _b={curveBasisClosed:v4,curveBasisOpen:x4,curveBasis:y4,curveBumpX:n4,curveBumpY:a4,curveLinearClosed:b4,curveLinear:mf,curveMonotoneX:j4,curveMonotoneY:w4,curveNatural:S4,curveStep:_4,curveStepAfter:O4,curveStepBefore:N4},zl=function(t){return t.x===+t.x&&t.y===+t.y},Oo=function(t){return t.x},Po=function(t){return t.y},jW=function(t,r){if(Z(t))return t;var n="curve".concat(hf(t));return(n==="curveMonotone"||n==="curveBump")&&r?_b["".concat(n).concat(r==="vertical"?"Y":"X")]:_b[n]||mf},wW=function(t){var r=t.type,n=r===void 0?"linear":r,a=t.points,i=a===void 0?[]:a,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=jW(n,l),f=u?i.filter(function(b){return zl(b)}):i,h;if(Array.isArray(o)){var p=u?o.filter(function(b){return zl(b)}):o,v=f.map(function(b,x){return Sb(Sb({},b),{},{base:p[x]})});return l==="vertical"?h=El().y(Po).x1(Oo).x0(function(b){return b.base.x}):h=El().x(Oo).y1(Po).y0(function(b){return b.base.y}),h.defined(zl).curve(d),h(v)}return l==="vertical"&&W(o)?h=El().y(Po).x1(Oo).x0(o):W(o)?h=El().x(Oo).y1(Po).y0(o):h=HS().x(Oo).y(Po),h.defined(zl).curve(d),h(f)},fi=function(t){var r=t.className,n=t.points,a=t.path,i=t.pathRef;if((!n||!n.length)&&!a)return null;var o=n&&n.length?wW(t):a;return O.createElement("path",Lp({},X(t,!1),Cc(t),{className:te("recharts-curve",r),d:o,ref:i}))},XN={exports:{}},SW="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",_W=SW,NW=_W;function QN(){}function ZN(){}ZN.resetWarningCache=QN;var OW=function(){function e(n,a,i,o,l,c){if(c!==NW){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ZN,resetWarningCache:QN};return r.PropTypes=r,r};XN.exports=OW();var PW=XN.exports;const ce=fe(PW),{getOwnPropertyNames:kW,getOwnPropertySymbols:AW}=Object,{hasOwnProperty:$W}=Object.prototype;function Fd(e,t){return function(n,a,i){return e(n,a,i)&&t(n,a,i)}}function Ul(e){return function(r,n,a){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,a);const{cache:i}=a,o=i.get(r),l=i.get(n);if(o&&l)return o===n&&l===r;i.set(r,n),i.set(n,r);const c=e(r,n,a);return i.delete(r),i.delete(n),c}}function EW(e){return e!=null?e[Symbol.toStringTag]:void 0}function Nb(e){return kW(e).concat(AW(e))}const CW=Object.hasOwn||((e,t)=>$W.call(e,t));function $a(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const TW="__v",MW="__o",IW="_owner",{getOwnPropertyDescriptor:Ob,keys:Pb}=Object;function LW(e,t){return e.byteLength===t.byteLength&&cu(new Uint8Array(e),new Uint8Array(t))}function DW(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function RW(e,t){return e.byteLength===t.byteLength&&cu(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function BW(e,t){return $a(e.getTime(),t.getTime())}function FW(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function zW(e,t){return e===t}function kb(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.entries();let o,l,c=0;for(;(o=i.next())&&!o.done;){const u=t.entries();let d=!1,f=0;for(;(l=u.next())&&!l.done;){if(a[f]){f++;continue}const h=o.value,p=l.value;if(r.equals(h[0],p[0],c,f,e,t,r)&&r.equals(h[1],p[1],h[0],p[0],e,t,r)){d=a[f]=!0;break}f++}if(!d)return!1;c++}return!0}const UW=$a;function WW(e,t,r){const n=Pb(e);let a=n.length;if(Pb(t).length!==a)return!1;for(;a-- >0;)if(!JN(e,t,r,n[a]))return!1;return!0}function ko(e,t,r){const n=Nb(e);let a=n.length;if(Nb(t).length!==a)return!1;let i,o,l;for(;a-- >0;)if(i=n[a],!JN(e,t,r,i)||(o=Ob(e,i),l=Ob(t,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function HW(e,t){return $a(e.valueOf(),t.valueOf())}function KW(e,t){return e.source===t.source&&e.flags===t.flags}function Ab(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.values();let o,l;for(;(o=i.next())&&!o.done;){const c=t.values();let u=!1,d=0;for(;(l=c.next())&&!l.done;){if(!a[d]&&r.equals(o.value,l.value,o.value,l.value,e,t,r)){u=a[d]=!0;break}d++}if(!u)return!1}return!0}function cu(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function VW(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 JN(e,t,r,n){return(n===IW||n===MW||n===TW)&&(e.$$typeof||t.$$typeof)?!0:CW(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const GW="[object ArrayBuffer]",YW="[object Arguments]",qW="[object Boolean]",XW="[object DataView]",QW="[object Date]",ZW="[object Error]",JW="[object Map]",eH="[object Number]",tH="[object Object]",rH="[object RegExp]",nH="[object Set]",aH="[object String]",iH={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},oH="[object URL]",sH=Object.prototype.toString;function lH({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:f,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:v}){return function(x,y,m){if(x===y)return!0;if(x==null||y==null)return!1;const g=typeof x;if(g!==typeof y)return!1;if(g!=="object")return g==="number"?l(x,y,m):g==="function"?i(x,y,m):!1;const S=x.constructor;if(S!==y.constructor)return!1;if(S===Object)return c(x,y,m);if(Array.isArray(x))return t(x,y,m);if(S===Date)return n(x,y,m);if(S===RegExp)return d(x,y,m);if(S===Map)return o(x,y,m);if(S===Set)return f(x,y,m);const j=sH.call(x);if(j===QW)return n(x,y,m);if(j===rH)return d(x,y,m);if(j===JW)return o(x,y,m);if(j===nH)return f(x,y,m);if(j===tH)return typeof x.then!="function"&&typeof y.then!="function"&&c(x,y,m);if(j===oH)return p(x,y,m);if(j===ZW)return a(x,y,m);if(j===YW)return c(x,y,m);if(iH[j])return h(x,y,m);if(j===GW)return e(x,y,m);if(j===XW)return r(x,y,m);if(j===qW||j===eH||j===aH)return u(x,y,m);if(v){let w=v[j];if(!w){const _=EW(x);_&&(w=v[_])}if(w)return w(x,y,m)}return!1}}function cH({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:LW,areArraysEqual:r?ko:DW,areDataViewsEqual:RW,areDatesEqual:BW,areErrorsEqual:FW,areFunctionsEqual:zW,areMapsEqual:r?Fd(kb,ko):kb,areNumbersEqual:UW,areObjectsEqual:r?ko:WW,arePrimitiveWrappersEqual:HW,areRegExpsEqual:KW,areSetsEqual:r?Fd(Ab,ko):Ab,areTypedArraysEqual:r?Fd(cu,ko):cu,areUrlsEqual:VW,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const a=Ul(n.areArraysEqual),i=Ul(n.areMapsEqual),o=Ul(n.areObjectsEqual),l=Ul(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:l})}return n}function uH(e){return function(t,r,n,a,i,o,l){return e(t,r,l)}}function fH({circular:e,comparator:t,createState:r,equals:n,strict:a}){if(r)return function(l,c){const{cache:u=e?new WeakMap:void 0,meta:d}=r();return t(l,c,{cache:u,equals:n,meta:d,strict:a})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:n,meta:void 0,strict:a})};const i={cache:void 0,equals:n,meta:void 0,strict:a};return function(l,c){return t(l,c,i)}}const dH=In();In({strict:!0});In({circular:!0});In({circular:!0,strict:!0});In({createInternalComparator:()=>$a});In({strict:!0,createInternalComparator:()=>$a});In({circular:!0,createInternalComparator:()=>$a});In({circular:!0,createInternalComparator:()=>$a,strict:!0});function In(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:a=!1}=e,i=cH(e),o=lH(i),l=r?r(o):uH(o);return fH({circular:t,comparator:o,createState:n,equals:l,strict:a})}function hH(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function $b(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):hH(a)};requestAnimationFrame(n)}function Dp(e){"@babel/helpers - typeof";return Dp=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},Dp(e)}function pH(e){return vH(e)||yH(e)||gH(e)||mH()}function mH(){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 gH(e,t){if(e){if(typeof e=="string")return Eb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Eb(e,t)}}function Eb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yH(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vH(e){if(Array.isArray(e))return e}function xH(){var e={},t=function(){return null},r=!1,n=function a(i){if(!r){if(Array.isArray(i)){if(!i.length)return;var o=i,l=pH(o),c=l[0],u=l.slice(1);if(typeof c=="number"){$b(a.bind(null,u),c);return}a(c),$b(a.bind(null,u));return}Dp(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){r=!0},start:function(i){r=!1,n(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function Bs(e){"@babel/helpers - typeof";return Bs=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},Bs(e)}function Cb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Tb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Cb(Object(r),!0).forEach(function(n){eO(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function eO(e,t,r){return t=bH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bH(e){var t=jH(e,"string");return Bs(t)==="symbol"?t:String(t)}function jH(e,t){if(Bs(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Bs(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wH=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,a){return n.filter(function(i){return a.includes(i)})})},SH=function(t){return t},_H=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},qo=function(t,r){return Object.keys(r).reduce(function(n,a){return Tb(Tb({},n),{},eO({},a,t(a,r[a])))},{})},Mb=function(t,r,n){return t.map(function(a){return"".concat(_H(a)," ").concat(r,"ms ").concat(n)}).join(",")};function NH(e,t){return kH(e)||PH(e,t)||tO(e,t)||OH()}function OH(){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 PH(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function kH(e){if(Array.isArray(e))return e}function AH(e){return CH(e)||EH(e)||tO(e)||$H()}function $H(){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 tO(e,t){if(e){if(typeof e=="string")return Rp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rp(e,t)}}function EH(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function CH(e){if(Array.isArray(e))return Rp(e)}function Rp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var uu=1e-4,rO=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},nO=function(t,r){return t.map(function(n,a){return n*Math.pow(r,a)}).reduce(function(n,a){return n+a})},Ib=function(t,r){return function(n){var a=rO(t,r);return nO(a,n)}},TH=function(t,r){return function(n){var a=rO(t,r),i=[].concat(AH(a.map(function(o,l){return o*l}).slice(1)),[0]);return nO(i,n)}},Lb=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0],i=r[1],o=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":a=0,i=0,o=1,l=1;break;case"ease":a=.25,i=.1,o=.25,l=1;break;case"ease-in":a=.42,i=0,o=1,l=1;break;case"ease-out":a=.42,i=0,o=.58,l=1;break;case"ease-in-out":a=0,i=0,o=.58,l=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(x){return parseFloat(x)}),d=NH(u,4);a=d[0],i=d[1],o=d[2],l=d[3]}}}var f=Ib(a,o),h=Ib(i,l),p=TH(a,o),v=function(y){return y>1?1:y<0?0:y},b=function(y){for(var m=y>1?1:y,g=m,S=0;S<8;++S){var j=f(g)-m,w=p(g);if(Math.abs(j-m)<uu||w<uu)return h(g);g=v(g-j/w)}return h(g)};return b.isStepper=!1,b},MH=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,o=t.dt,l=o===void 0?17:o,c=function(d,f,h){var p=-(d-f)*n,v=h*i,b=h+(p-v)*l/1e3,x=h*l/1e3+d;return Math.abs(x-f)<uu&&Math.abs(b)<uu?[f,0]:[x,b]};return c.isStepper=!0,c.dt=l,c},IH=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Lb(a);case"spring":return MH();default:if(a.split("(")[0]==="cubic-bezier")return Lb(a)}return typeof a=="function"?a:null};function Fs(e){"@babel/helpers - typeof";return Fs=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},Fs(e)}function Db(e){return RH(e)||DH(e)||aO(e)||LH()}function LH(){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 DH(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function RH(e){if(Array.isArray(e))return Fp(e)}function Rb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rb(Object(r),!0).forEach(function(n){Bp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bp(e,t,r){return t=BH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BH(e){var t=FH(e,"string");return Fs(t)==="symbol"?t:String(t)}function FH(e,t){if(Fs(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fs(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zH(e,t){return HH(e)||WH(e,t)||aO(e,t)||UH()}function UH(){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 aO(e,t){if(e){if(typeof e=="string")return Fp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fp(e,t)}}function Fp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function WH(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function HH(e){if(Array.isArray(e))return e}var fu=function(t,r,n){return t+(r-t)*n},zp=function(t){var r=t.from,n=t.to;return r!==n},KH=function e(t,r,n){var a=qo(function(i,o){if(zp(o)){var l=t(o.from,o.to,o.velocity),c=zH(l,2),u=c[0],d=c[1];return tt(tt({},o),{},{from:u,velocity:d})}return o},r);return n<1?qo(function(i,o){return zp(o)?tt(tt({},o),{},{velocity:fu(o.velocity,a[i].velocity,n),from:fu(o.from,a[i].from,n)}):o},r):e(t,a,n-1)};const VH=function(e,t,r,n,a){var i=wH(e,t),o=i.reduce(function(x,y){return tt(tt({},x),{},Bp({},y,[e[y],t[y]]))},{}),l=i.reduce(function(x,y){return tt(tt({},x),{},Bp({},y,{from:e[y],velocity:0,to:t[y]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return qo(function(y,m){return m.from},l)},p=function(){return!Object.values(l).filter(zp).length},v=function(y){u||(u=y);var m=y-u,g=m/r.dt;l=KH(r,l,g),a(tt(tt(tt({},e),t),h())),u=y,p()||(c=requestAnimationFrame(f))},b=function(y){d||(d=y);var m=(y-d)/n,g=qo(function(j,w){return fu.apply(void 0,Db(w).concat([r(m)]))},o);if(a(tt(tt(tt({},e),t),g)),m<1)c=requestAnimationFrame(f);else{var S=qo(function(j,w){return fu.apply(void 0,Db(w).concat([r(1)]))},o);a(tt(tt(tt({},e),t),S))}};return f=r.isStepper?v:b,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function $i(e){"@babel/helpers - typeof";return $i=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},$i(e)}var GH=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function YH(e,t){if(e==null)return{};var r=qH(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qH(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function zd(e){return JH(e)||ZH(e)||QH(e)||XH()}function XH(){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 QH(e,t){if(e){if(typeof e=="string")return Up(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Up(e,t)}}function ZH(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function JH(e){if(Array.isArray(e))return Up(e)}function Up(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Bb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function rr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bb(Object(r),!0).forEach(function(n){Io(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Io(e,t,r){return t=iO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tK(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,iO(n.key),n)}}function rK(e,t,r){return t&&tK(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function iO(e){var t=nK(e,"string");return $i(t)==="symbol"?t:String(t)}function nK(e,t){if($i(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if($i(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aK(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wp(e,t)}function Wp(e,t){return Wp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Wp(e,t)}function iK(e){var t=oK();return function(){var n=du(e),a;if(t){var i=du(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return Hp(this,a)}}function Hp(e,t){if(t&&($i(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kp(e)}function Kp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oK(){if(typeof Reflect>"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 du(e){return du=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},du(e)}var _r=function(e){aK(r,e);var t=iK(r);function r(n,a){var i;eK(this,r),i=t.call(this,n,a);var o=i.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,f=o.steps,h=o.children,p=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(Kp(i)),i.changeStyle=i.changeStyle.bind(Kp(i)),!l||p<=0)return i.state={style:{}},typeof h=="function"&&(i.state={style:d}),Hp(i);if(f&&f.length)i.state={style:f[0].style};else if(u){if(typeof h=="function")return i.state={style:u},Hp(i);i.state={style:c?Io({},c,u):u}}else i.state={style:{}};return i}return rK(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,l=i.canBegin,c=i.attributeName,u=i.shouldReAnimate,d=i.to,f=i.from,h=this.state.style;if(l){if(!o){var p={style:c?Io({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(p);return}if(!(dH(a.to,d)&&a.canBegin&&a.isActive)){var v=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var b=v||u?f:a.to;if(this.state&&h){var x={style:c?Io({},c,b):b};(c&&h[c]!==b||!c&&h!==b)&&this.setState(x)}this.runAnimation(rr(rr({},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,o=a.from,l=a.to,c=a.duration,u=a.easing,d=a.begin,f=a.onAnimationEnd,h=a.onAnimationStart,p=VH(o,l,IH(u),c,this.changeStyle),v=function(){i.stopJSAnimation=p()};this.manager.start([h,d,v,c,f])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,l=a.begin,c=a.onAnimationStart,u=o[0],d=u.style,f=u.duration,h=f===void 0?0:f,p=function(b,x,y){if(y===0)return b;var m=x.duration,g=x.easing,S=g===void 0?"ease":g,j=x.style,w=x.properties,_=x.onAnimationEnd,N=y>0?o[y-1]:x,P=w||Object.keys(j);if(typeof S=="function"||S==="spring")return[].concat(zd(b),[i.runJSAnimation.bind(i,{from:N.style,to:j,duration:m,easing:S}),m]);var k=Mb(P,m,S),T=rr(rr(rr({},N.style),j),{},{transition:k});return[].concat(zd(b),[T,m,_]).filter(SH)};return this.manager.start([c].concat(zd(o.reduce(p,[d,Math.max(h,l)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=xH());var i=a.begin,o=a.duration,l=a.attributeName,c=a.to,u=a.easing,d=a.onAnimationStart,f=a.onAnimationEnd,h=a.steps,p=a.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(a);return}if(h.length>1){this.runStepAnimation(a);return}var b=l?Io({},l,c):c,x=Mb(Object.keys(b),o,u);v.start([d,i,rr(rr({},b),{},{transition:x}),o,f])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var l=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var c=YH(a,GH),u=O.Children.count(i),d=this.state.style;if(typeof i=="function")return i(d);if(!l||u===0||o<=0)return i;var f=function(p){var v=p.props,b=v.style,x=b===void 0?{}:b,y=v.className,m=O.cloneElement(p,rr(rr({},c),{},{style:rr(rr({},x),d),className:y}));return m};return u===1?f(O.Children.only(i)):E.createElement("div",null,O.Children.map(i,function(h){return f(h)}))}}]),r}(O.PureComponent);_r.displayName="Animate";_r.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};_r.propTypes={from:ce.oneOfType([ce.object,ce.string]),to:ce.oneOfType([ce.object,ce.string]),attributeName:ce.string,duration:ce.number,begin:ce.number,easing:ce.oneOfType([ce.string,ce.func]),steps:ce.arrayOf(ce.shape({duration:ce.number.isRequired,style:ce.object.isRequired,easing:ce.oneOfType([ce.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),ce.func]),properties:ce.arrayOf("string"),onAnimationEnd:ce.func})),children:ce.oneOfType([ce.node,ce.func]),isActive:ce.bool,canBegin:ce.bool,onAnimationEnd:ce.func,shouldReAnimate:ce.bool,onAnimationStart:ce.func,onAnimationReStart:ce.func};function zs(e){"@babel/helpers - typeof";return zs=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},zs(e)}function hu(){return hu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hu.apply(this,arguments)}function sK(e,t){return fK(e)||uK(e,t)||cK(e,t)||lK()}function lK(){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 cK(e,t){if(e){if(typeof e=="string")return Fb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fb(e,t)}}function Fb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function uK(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function fK(e){if(Array.isArray(e))return e}function zb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ub(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zb(Object(r),!0).forEach(function(n){dK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dK(e,t,r){return t=hK(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hK(e){var t=pK(e,"string");return zs(t)=="symbol"?t:t+""}function pK(e,t){if(zs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(zs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wb=function(t,r,n,a,i){var o=Math.min(Math.abs(n)/2,Math.abs(a)/2),l=a>=0?1:-1,c=n>=0?1:-1,u=a>=0&&n>=0||a<0&&n<0?1:0,d;if(o>0&&i instanceof Array){for(var f=[0,0,0,0],h=0,p=4;h<p;h++)f[h]=i[h]>o?o:i[h];d="M".concat(t,",").concat(r+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(r)),d+="L ".concat(t+n-c*f[1],",").concat(r),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
-        `).concat(t+n,",").concat(r+l*f[1])),d+="L ".concat(t+n,",").concat(r+a-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
-        `).concat(t+n-c*f[2],",").concat(r+a)),d+="L ".concat(t+c*f[3],",").concat(r+a),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
-        `).concat(t,",").concat(r+a-l*f[3])),d+="Z"}else if(o>0&&i===+i&&i>0){var v=Math.min(o,i);d="M ".concat(t,",").concat(r+l*v,`
-            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+c*v,",").concat(r,`
-            L `).concat(t+n-c*v,",").concat(r,`
-            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+n,",").concat(r+l*v,`
-            L `).concat(t+n,",").concat(r+a-l*v,`
-            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+n-c*v,",").concat(r+a,`
-            L `).concat(t+c*v,",").concat(r+a,`
-            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t,",").concat(r+a-l*v," Z")}else d="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return d},mK=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,o=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(i,i+l),d=Math.max(i,i+l),f=Math.min(o,o+c),h=Math.max(o,o+c);return n>=u&&n<=d&&a>=f&&a<=h}return!1},gK={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},dg=function(t){var r=Ub(Ub({},gK),t),n=O.useRef(),a=O.useState(-1),i=sK(a,2),o=i[0],l=i[1];O.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&l(S)}catch{}},[]);var c=r.x,u=r.y,d=r.width,f=r.height,h=r.radius,p=r.className,v=r.animationEasing,b=r.animationDuration,x=r.animationBegin,y=r.isAnimationActive,m=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var g=te("recharts-rectangle",p);return m?E.createElement(_r,{canBegin:o>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:b,animationEasing:v,isActive:m},function(S){var j=S.width,w=S.height,_=S.x,N=S.y;return E.createElement(_r,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:b,isActive:y,easing:v},E.createElement("path",hu({},X(r,!0),{className:g,d:Wb(_,N,j,w,h),ref:n})))}):E.createElement("path",hu({},X(r,!0),{className:g,d:Wb(c,u,d,f,h)}))},yK=["points","className","baseLinePoints","connectNulls"];function Qa(){return Qa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qa.apply(this,arguments)}function vK(e,t){if(e==null)return{};var r=xK(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xK(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Hb(e){return SK(e)||wK(e)||jK(e)||bK()}function bK(){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 jK(e,t){if(e){if(typeof e=="string")return Vp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vp(e,t)}}function wK(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function SK(e){if(Array.isArray(e))return Vp(e)}function Vp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Kb=function(t){return t&&t.x===+t.x&&t.y===+t.y},_K=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){Kb(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),Kb(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Xo=function(t,r){var n=_K(t);r&&(n=[n.reduce(function(i,o){return[].concat(Hb(i),Hb(o))},[])]);var a=n.map(function(i){return i.reduce(function(o,l,c){return"".concat(o).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return n.length===1?"".concat(a,"Z"):a},NK=function(t,r,n){var a=Xo(t,n);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(Xo(r.reverse(),n).slice(1))},OK=function(t){var r=t.points,n=t.className,a=t.baseLinePoints,i=t.connectNulls,o=vK(t,yK);if(!r||!r.length)return null;var l=te("recharts-polygon",n);if(a&&a.length){var c=o.stroke&&o.stroke!=="none",u=NK(r,a,i);return E.createElement("g",{className:l},E.createElement("path",Qa({},X(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),c?E.createElement("path",Qa({},X(o,!0),{fill:"none",d:Xo(r,i)})):null,c?E.createElement("path",Qa({},X(o,!0),{fill:"none",d:Xo(a,i)})):null)}var d=Xo(r,i);return E.createElement("path",Qa({},X(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",className:l,d}))};function Gp(){return Gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gp.apply(this,arguments)}var Ef=function(t){var r=t.cx,n=t.cy,a=t.r,i=t.className,o=te("recharts-dot",i);return r===+r&&n===+n&&a===+a?O.createElement("circle",Gp({},X(t,!1),Cc(t),{className:o,cx:r,cy:n,r:a})):null};function Us(e){"@babel/helpers - typeof";return Us=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},Us(e)}var PK=["x","y","top","left","width","height","className"];function Yp(){return Yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yp.apply(this,arguments)}function Vb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function kK(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vb(Object(r),!0).forEach(function(n){AK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AK(e,t,r){return t=$K(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $K(e){var t=EK(e,"string");return Us(t)=="symbol"?t:t+""}function EK(e,t){if(Us(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Us(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CK(e,t){if(e==null)return{};var r=TK(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function TK(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var MK=function(t,r,n,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(r,"h").concat(n)},IK=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,h=t.height,p=h===void 0?0:h,v=t.className,b=CK(t,PK),x=kK({x:n,y:i,top:l,left:u,width:f,height:p},b);return!W(n)||!W(i)||!W(f)||!W(p)||!W(l)||!W(u)?null:E.createElement("path",Yp({},X(x,!0),{className:te("recharts-cross",v),d:MK(n,i,f,p,l,u)}))},LK=Of,DK=yN,RK=Or;function BK(e,t){return e&&e.length?LK(e,RK(t),DK):void 0}var FK=BK;const zK=fe(FK);var UK=Of,WK=Or,HK=vN;function KK(e,t){return e&&e.length?UK(e,WK(t),HK):void 0}var VK=KK;const GK=fe(VK);var YK=["cx","cy","angle","ticks","axisLine"],qK=["ticks","tick","angle","tickFormatter","stroke"];function Ei(e){"@babel/helpers - typeof";return Ei=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},Ei(e)}function Qo(){return Qo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qo.apply(this,arguments)}function Gb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Un(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gb(Object(r),!0).forEach(function(n){Cf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Yb(e,t){if(e==null)return{};var r=XK(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function XK(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function QK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qb(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,sO(n.key),n)}}function ZK(e,t,r){return t&&qb(e.prototype,t),r&&qb(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function JK(e,t,r){return t=pu(t),eV(e,oO()?Reflect.construct(t,r||[],pu(e).constructor):t.apply(e,r))}function eV(e,t){if(t&&(Ei(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tV(e)}function tV(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oO=function(){return!!e})()}function pu(e){return pu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},pu(e)}function rV(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qp(e,t)}function qp(e,t){return qp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},qp(e,t)}function Cf(e,t,r){return t=sO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sO(e){var t=nV(e,"string");return Ei(t)=="symbol"?t:t+""}function nV(e,t){if(Ei(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ei(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Tf=function(e){function t(){return QK(this,t),JK(this,t,arguments)}return rV(t,e),ZK(t,[{key:"getTickValueCoord",value:function(n){var a=n.coordinate,i=this.props,o=i.angle,l=i.cx,c=i.cy;return xe(l,c,a,o)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,a;switch(n){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var n=this.props,a=n.cx,i=n.cy,o=n.angle,l=n.ticks,c=zK(l,function(d){return d.coordinate||0}),u=GK(l,function(d){return d.coordinate||0});return{cx:a,cy:i,startAngle:o,endAngle:o,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,o=n.angle,l=n.ticks,c=n.axisLine,u=Yb(n,YK),d=l.reduce(function(v,b){return[Math.min(v[0],b.coordinate),Math.max(v[1],b.coordinate)]},[1/0,-1/0]),f=xe(a,i,d[0],o),h=xe(a,i,d[1],o),p=Un(Un(Un({},X(u,!1)),{},{fill:"none"},X(c,!1)),{},{x1:f.x,y1:f.y,x2:h.x,y2:h.y});return E.createElement("line",Qo({className:"recharts-polar-radius-axis-line"},p))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,o=a.tick,l=a.angle,c=a.tickFormatter,u=a.stroke,d=Yb(a,qK),f=this.getTickTextAnchor(),h=X(d,!1),p=X(o,!1),v=i.map(function(b,x){var y=n.getTickValueCoord(b),m=Un(Un(Un(Un({textAnchor:f,transform:"rotate(".concat(90-l,", ").concat(y.x,", ").concat(y.y,")")},h),{},{stroke:"none",fill:u},p),{},{index:x},y),{},{payload:b});return E.createElement(ae,Qo({className:te("recharts-polar-radius-axis-tick",VN(o)),key:"tick-".concat(b.coordinate)},ya(n.props,b,x)),t.renderTickItem(o,m,c?c(b.value,x):b.value))});return E.createElement(ae,{className:"recharts-polar-radius-axis-ticks"},v)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.axisLine,o=n.tick;return!a||!a.length?null:E.createElement(ae,{className:te("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),Qe.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(n,a,i){var o;return E.isValidElement(n)?o=E.cloneElement(n,a):Z(n)?o=n(a):o=E.createElement(xa,Qo({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])}(O.PureComponent);Cf(Tf,"displayName","PolarRadiusAxis");Cf(Tf,"axisType","radiusAxis");Cf(Tf,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Ci(e){"@babel/helpers - typeof";return Ci=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},Ci(e)}function Qn(){return Qn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qn.apply(this,arguments)}function Xb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Wn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xb(Object(r),!0).forEach(function(n){Mf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qb(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,cO(n.key),n)}}function iV(e,t,r){return t&&Qb(e.prototype,t),r&&Qb(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function oV(e,t,r){return t=mu(t),sV(e,lO()?Reflect.construct(t,r||[],mu(e).constructor):t.apply(e,r))}function sV(e,t){if(t&&(Ci(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lV(e)}function lV(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lO=function(){return!!e})()}function mu(e){return mu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},mu(e)}function cV(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xp(e,t)}function Xp(e,t){return Xp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Xp(e,t)}function Mf(e,t,r){return t=cO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cO(e){var t=uV(e,"string");return Ci(t)=="symbol"?t:t+""}function uV(e,t){if(Ci(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ci(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fV=Math.PI/180,Zb=1e-5,If=function(e){function t(){return aV(this,t),oV(this,t,arguments)}return cV(t,e),iV(t,[{key:"getTickLineCoord",value:function(n){var a=this.props,i=a.cx,o=a.cy,l=a.radius,c=a.orientation,u=a.tickSize,d=u||8,f=xe(i,o,l,n.coordinate),h=xe(i,o,l+(c==="inner"?-1:1)*d,n.coordinate);return{x1:f.x,y1:f.y,x2:h.x,y2:h.y}}},{key:"getTickTextAnchor",value:function(n){var a=this.props.orientation,i=Math.cos(-n.coordinate*fV),o;return i>Zb?o=a==="outer"?"start":"end":i<-Zb?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,o=n.radius,l=n.axisLine,c=n.axisLineType,u=Wn(Wn({},X(this.props,!1)),{},{fill:"none"},X(l,!1));if(c==="circle")return E.createElement(Ef,Qn({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:o}));var d=this.props.ticks,f=d.map(function(h){return xe(a,i,o,h.coordinate)});return E.createElement(OK,Qn({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,o=a.tick,l=a.tickLine,c=a.tickFormatter,u=a.stroke,d=X(this.props,!1),f=X(o,!1),h=Wn(Wn({},d),{},{fill:"none"},X(l,!1)),p=i.map(function(v,b){var x=n.getTickLineCoord(v),y=n.getTickTextAnchor(v),m=Wn(Wn(Wn({textAnchor:y},d),{},{stroke:"none",fill:u},f),{},{index:b,payload:v,x:x.x2,y:x.y2});return E.createElement(ae,Qn({className:te("recharts-polar-angle-axis-tick",VN(o)),key:"tick-".concat(v.coordinate)},ya(n.props,v,b)),l&&E.createElement("line",Qn({className:"recharts-polar-angle-axis-tick-line"},h,x)),o&&t.renderTickItem(o,m,c?c(v.value,b):v.value))});return E.createElement(ae,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.radius,o=n.axisLine;return i<=0||!a||!a.length?null:E.createElement(ae,{className:te("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,a,i){var o;return E.isValidElement(n)?o=E.cloneElement(n,a):Z(n)?o=n(a):o=E.createElement(xa,Qn({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])}(O.PureComponent);Mf(If,"displayName","PolarAngleAxis");Mf(If,"axisType","angleAxis");Mf(If,"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 dV=p_,hV=dV(Object.getPrototypeOf,Object),pV=hV,mV=Xr,gV=pV,yV=Qr,vV="[object Object]",xV=Function.prototype,bV=Object.prototype,uO=xV.toString,jV=bV.hasOwnProperty,wV=uO.call(Object);function SV(e){if(!yV(e)||mV(e)!=vV)return!1;var t=gV(e);if(t===null)return!0;var r=jV.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&uO.call(r)==wV}var _V=SV;const NV=fe(_V);var OV=Xr,PV=Qr,kV="[object Boolean]";function AV(e){return e===!0||e===!1||PV(e)&&OV(e)==kV}var $V=AV;const EV=fe($V);function Ws(e){"@babel/helpers - typeof";return Ws=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},Ws(e)}function gu(){return gu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gu.apply(this,arguments)}function CV(e,t){return LV(e)||IV(e,t)||MV(e,t)||TV()}function TV(){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 MV(e,t){if(e){if(typeof e=="string")return Jb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Jb(e,t)}}function Jb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function IV(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function LV(e){if(Array.isArray(e))return e}function e1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function t1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?e1(Object(r),!0).forEach(function(n){DV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):e1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function DV(e,t,r){return t=RV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RV(e){var t=BV(e,"string");return Ws(t)=="symbol"?t:t+""}function BV(e,t){if(Ws(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ws(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var r1=function(t,r,n,a,i){var o=n-a,l;return l="M ".concat(t,",").concat(r),l+="L ".concat(t+n,",").concat(r),l+="L ".concat(t+n-o/2,",").concat(r+i),l+="L ".concat(t+n-o/2-a,",").concat(r+i),l+="L ".concat(t,",").concat(r," Z"),l},FV={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},zV=function(t){var r=t1(t1({},FV),t),n=O.useRef(),a=O.useState(-1),i=CV(a,2),o=i[0],l=i[1];O.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var g=n.current.getTotalLength();g&&l(g)}catch{}},[]);var c=r.x,u=r.y,d=r.upperWidth,f=r.lowerWidth,h=r.height,p=r.className,v=r.animationEasing,b=r.animationDuration,x=r.animationBegin,y=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||h!==+h||d===0&&f===0||h===0)return null;var m=te("recharts-trapezoid",p);return y?E.createElement(_r,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:c,y:u},duration:b,animationEasing:v,isActive:y},function(g){var S=g.upperWidth,j=g.lowerWidth,w=g.height,_=g.x,N=g.y;return E.createElement(_r,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:b,easing:v},E.createElement("path",gu({},X(r,!0),{className:m,d:r1(_,N,S,j,w),ref:n})))}):E.createElement("g",null,E.createElement("path",gu({},X(r,!0),{className:m,d:r1(c,u,d,f,h)})))},UV=["option","shapeType","propTransformer","activeClassName","isActive"];function Hs(e){"@babel/helpers - typeof";return Hs=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},Hs(e)}function WV(e,t){if(e==null)return{};var r=HV(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function HV(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function n1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function yu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?n1(Object(r),!0).forEach(function(n){KV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KV(e,t,r){return t=VV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VV(e){var t=GV(e,"string");return Hs(t)=="symbol"?t:t+""}function GV(e,t){if(Hs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Hs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function YV(e,t){return yu(yu({},t),e)}function qV(e,t){return e==="symbols"}function a1(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return E.createElement(dg,r);case"trapezoid":return E.createElement(zV,r);case"sector":return E.createElement(qN,r);case"symbols":if(qV(t))return E.createElement(E0,r);break;default:return null}}function XV(e){return O.isValidElement(e)?e.props:e}function fO(e){var t=e.option,r=e.shapeType,n=e.propTransformer,a=n===void 0?YV:n,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,l=e.isActive,c=WV(e,UV),u;if(O.isValidElement(t))u=O.cloneElement(t,yu(yu({},c),XV(t)));else if(Z(t))u=t(c);else if(NV(t)&&!EV(t)){var d=a(t,c);u=E.createElement(a1,{shapeType:r,elementProps:d})}else{var f=c;u=E.createElement(a1,{shapeType:r,elementProps:f})}return l?E.createElement(ae,{className:o},u):u}function Lf(e,t){return t!=null&&"trapezoids"in e.props}function Df(e,t){return t!=null&&"sectors"in e.props}function Ks(e,t){return t!=null&&"points"in e.props}function QV(e,t){var r,n,a=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,i=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return a&&i}function ZV(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function JV(e,t){var r=e.x===t.x,n=e.y===t.y,a=e.z===t.z;return r&&n&&a}function eG(e,t){var r;return Lf(e,t)?r=QV:Df(e,t)?r=ZV:Ks(e,t)&&(r=JV),r}function tG(e,t){var r;return Lf(e,t)?r="trapezoids":Df(e,t)?r="sectors":Ks(e,t)&&(r="points"),r}function rG(e,t){if(Lf(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(Df(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return Ks(e,t)?t.payload:{}}function nG(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,a=tG(r,t),i=rG(r,t),o=n.filter(function(c,u){var d=ki(i,c),f=r.props[a].filter(function(v){var b=eG(r,t);return b(v,t)}),h=r.props[a].indexOf(f[f.length-1]),p=u===h;return d&&p}),l=n.indexOf(o[o.length-1]);return l}var ic;function Ti(e){"@babel/helpers - typeof";return Ti=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},Ti(e)}function Za(){return Za=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Za.apply(this,arguments)}function i1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ge(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?i1(Object(r),!0).forEach(function(n){Kt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,hO(n.key),n)}}function iG(e,t,r){return t&&o1(e.prototype,t),r&&o1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function oG(e,t,r){return t=vu(t),sG(e,dO()?Reflect.construct(t,r||[],vu(e).constructor):t.apply(e,r))}function sG(e,t){if(t&&(Ti(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lG(e)}function lG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dO=function(){return!!e})()}function vu(e){return vu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vu(e)}function cG(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qp(e,t)}function Qp(e,t){return Qp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Qp(e,t)}function Kt(e,t,r){return t=hO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hO(e){var t=uG(e,"string");return Ti(t)=="symbol"?t:t+""}function uG(e,t){if(Ti(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ti(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Pr=function(e){function t(r){var n;return aG(this,t),n=oG(this,t,[r]),Kt(n,"pieRef",null),Kt(n,"sectorRefs",[]),Kt(n,"id",no("recharts-pie-")),Kt(n,"handleAnimationEnd",function(){var a=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),Z(a)&&a()}),Kt(n,"handleAnimationStart",function(){var a=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),Z(a)&&a()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return cG(t,e),iG(t,[{key:"isActiveIndex",value:function(n){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(n)!==-1:n===a}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,l=i.labelLine,c=i.dataKey,u=i.valueKey,d=X(this.props,!1),f=X(o,!1),h=X(l,!1),p=o&&o.offsetRadius||20,v=n.map(function(b,x){var y=(b.startAngle+b.endAngle)/2,m=xe(b.cx,b.cy,b.outerRadius+p,y),g=ge(ge(ge(ge({},d),b),{},{stroke:"none"},f),{},{index:x,textAnchor:t.getTextAnchor(m.x,b.cx)},m),S=ge(ge(ge(ge({},d),b),{},{fill:"none",stroke:b.fill},h),{},{index:x,points:[xe(b.cx,b.cy,b.outerRadius,y),m]}),j=c;return J(c)&&J(u)?j="value":J(c)&&(j=u),E.createElement(ae,{key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(x)},l&&t.renderLabelLineItem(l,S,"line"),t.renderLabelItem(o,g,Ke(b,j)))});return E.createElement(ae,{className:"recharts-pie-labels"},v)}},{key:"renderSectorsStatically",value:function(n){var a=this,i=this.props,o=i.activeShape,l=i.blendStroke,c=i.inactiveShape;return n.map(function(u,d){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&n.length!==1)return null;var f=a.isActiveIndex(d),h=c&&a.hasActiveIndex()?c:null,p=f?o:h,v=ge(ge({},u),{},{stroke:l?u.fill:u.stroke,tabIndex:-1});return E.createElement(ae,Za({ref:function(x){x&&!a.sectorRefs.includes(x)&&a.sectorRefs.push(x)},tabIndex:-1,className:"recharts-pie-sector"},ya(a.props,u,d),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(d)}),E.createElement(fO,Za({option:p,isActive:f,shapeType:"sector"},v)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,a=this.props,i=a.sectors,o=a.isAnimationActive,l=a.animationBegin,c=a.animationDuration,u=a.animationEasing,d=a.animationId,f=this.state,h=f.prevSectors,p=f.prevIsAnimationActive;return E.createElement(_r,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d,"-").concat(p),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(v){var b=v.t,x=[],y=i&&i[0],m=y.startAngle;return i.forEach(function(g,S){var j=h&&h[S],w=S>0?It(g,"paddingAngle",0):0;if(j){var _=wt(j.endAngle-j.startAngle,g.endAngle-g.startAngle),N=ge(ge({},g),{},{startAngle:m+w,endAngle:m+_(b)+w});x.push(N),m=N.endAngle}else{var P=g.endAngle,k=g.startAngle,T=wt(0,P-k),C=T(b),$=ge(ge({},g),{},{startAngle:m+w,endAngle:m+C+w});x.push($),m=$.endAngle}}),E.createElement(ae,null,n.renderSectorsStatically(x))})}},{key:"attachKeyboardHandlers",value:function(n){var a=this;n.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[l].focus(),a.setState({sectorToFocus:l});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,a=n.sectors,i=n.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!ki(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,a=this.props,i=a.hide,o=a.sectors,l=a.className,c=a.label,u=a.cx,d=a.cy,f=a.innerRadius,h=a.outerRadius,p=a.isAnimationActive,v=this.state.isAnimationFinished;if(i||!o||!o.length||!W(u)||!W(d)||!W(f)||!W(h))return null;var b=te("recharts-pie",l);return E.createElement(ae,{tabIndex:this.props.rootTabIndex,className:b,ref:function(y){n.pieRef=y}},this.renderSectors(),c&&this.renderLabels(o),Qe.renderCallByParent(this.props,null,!1),(!p||v)&&zr.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return a.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:n.sectors!==a.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,a){return n>a?"start":n<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,a,i){if(E.isValidElement(n))return E.cloneElement(n,a);if(Z(n))return n(a);var o=te("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return E.createElement(fi,Za({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(n,a,i){if(E.isValidElement(n))return E.cloneElement(n,a);var o=i;if(Z(n)&&(o=n(a),E.isValidElement(o)))return o;var l=te("recharts-pie-label-text",typeof n!="boolean"&&!Z(n)?n.className:"");return E.createElement(xa,Za({},a,{alignmentBaseline:"middle",className:l}),o)}}])}(O.PureComponent);ic=Pr;Kt(Pr,"displayName","Pie");Kt(Pr,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!Pa.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Kt(Pr,"parseDeltaAngle",function(e,t){var r=dt(t-e),n=Math.min(Math.abs(t-e),360);return r*n});Kt(Pr,"getRealPieData",function(e){var t=e.data,r=e.children,n=X(e,!1),a=qt(r,va);return t&&t.length?t.map(function(i,o){return ge(ge(ge({payload:i},n),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return ge(ge({},n),i.props)}):[]});Kt(Pr,"parseCoordinateOfPie",function(e,t){var r=t.top,n=t.left,a=t.width,i=t.height,o=KN(a,i),l=n+ht(e.cx,a,a/2),c=r+ht(e.cy,i,i/2),u=ht(e.innerRadius,o,0),d=ht(e.outerRadius,o,o*.8),f=e.maxRadius||Math.sqrt(a*a+i*i)/2;return{cx:l,cy:c,innerRadius:u,outerRadius:d,maxRadius:f}});Kt(Pr,"getComposedData",function(e){var t=e.item,r=e.offset,n=t.type.defaultProps!==void 0?ge(ge({},t.type.defaultProps),t.props):t.props,a=ic.getRealPieData(n);if(!a||!a.length)return null;var i=n.cornerRadius,o=n.startAngle,l=n.endAngle,c=n.paddingAngle,u=n.dataKey,d=n.nameKey,f=n.valueKey,h=n.tooltipType,p=Math.abs(n.minAngle),v=ic.parseCoordinateOfPie(n,r),b=ic.parseDeltaAngle(o,l),x=Math.abs(b),y=u;J(u)&&J(f)?(ur(!1,`Use "dataKey" to specify the value of pie,
-      the props "valueKey" will be deprecated in 1.1.0`),y="value"):J(u)&&(ur(!1,`Use "dataKey" to specify the value of pie,
-      the props "valueKey" will be deprecated in 1.1.0`),y=f);var m=a.filter(function(N){return Ke(N,y,0)!==0}).length,g=(x>=360?m:m-1)*c,S=x-m*p-g,j=a.reduce(function(N,P){var k=Ke(P,y,0);return N+(W(k)?k:0)},0),w;if(j>0){var _;w=a.map(function(N,P){var k=Ke(N,y,0),T=Ke(N,d,P),C=(W(k)?k:0)/j,$;P?$=_.endAngle+dt(b)*c*(k!==0?1:0):$=o;var M=$+dt(b)*((k!==0?p:0)+C*S),A=($+M)/2,I=(v.innerRadius+v.outerRadius)/2,B=[{name:T,value:k,payload:N,dataKey:y,type:h}],L=xe(v.cx,v.cy,I,A);return _=ge(ge(ge({percent:C,cornerRadius:i,name:T,tooltipPayload:B,midAngle:A,middleRadius:I,tooltipPosition:L},N),v),{},{value:Ke(N,y),startAngle:$,endAngle:M,payload:N,paddingAngle:dt(b)*c}),_})}return ge(ge({},v),{},{sectors:w,data:a})});var fG=Math.ceil,dG=Math.max;function hG(e,t,r,n){for(var a=-1,i=dG(fG((t-e)/(r||1)),0),o=Array(i);i--;)o[n?i:++a]=e,e+=r;return o}var pG=hG,mG=T_,s1=1/0,gG=17976931348623157e292;function yG(e){if(!e)return e===0?e:0;if(e=mG(e),e===s1||e===-s1){var t=e<0?-1:1;return t*gG}return e===e?e:0}var pO=yG,vG=pG,xG=xf,Ud=pO;function bG(e){return function(t,r,n){return n&&typeof n!="number"&&xG(t,r,n)&&(r=n=void 0),t=Ud(t),r===void 0?(r=t,t=0):r=Ud(r),n=n===void 0?t<r?1:-1:Ud(n),vG(t,r,n,e)}}var jG=bG,wG=jG,SG=wG(),_G=SG;const xu=fe(_G);function Vs(e){"@babel/helpers - typeof";return Vs=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},Vs(e)}function l1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function c1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?l1(Object(r),!0).forEach(function(n){mO(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mO(e,t,r){return t=NG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function NG(e){var t=OG(e,"string");return Vs(t)=="symbol"?t:t+""}function OG(e,t){if(Vs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Vs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var PG=["Webkit","Moz","O","ms"],kG=function(t,r){var n=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=PG.reduce(function(i,o){return c1(c1({},i),{},mO({},o+n,r))},{});return a[t]=r,a};function Mi(e){"@babel/helpers - typeof";return Mi=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},Mi(e)}function bu(){return bu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bu.apply(this,arguments)}function u1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Wd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?u1(Object(r),!0).forEach(function(n){At(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,yO(n.key),n)}}function $G(e,t,r){return t&&f1(e.prototype,t),r&&f1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function EG(e,t,r){return t=ju(t),CG(e,gO()?Reflect.construct(t,r||[],ju(e).constructor):t.apply(e,r))}function CG(e,t){if(t&&(Mi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return TG(e)}function TG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gO=function(){return!!e})()}function ju(e){return ju=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ju(e)}function MG(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zp(e,t)}function Zp(e,t){return Zp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Zp(e,t)}function At(e,t,r){return t=yO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yO(e){var t=IG(e,"string");return Mi(t)=="symbol"?t:t+""}function IG(e,t){if(Mi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Mi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var LG=function(t){var r=t.data,n=t.startIndex,a=t.endIndex,i=t.x,o=t.width,l=t.travellerWidth;if(!r||!r.length)return{};var c=r.length,u=Go().domain(xu(0,c)).range([i,i+o-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(a),scale:u,scaleValues:d}},d1=function(t){return t.changedTouches&&!!t.changedTouches.length},Ii=function(e){function t(r){var n;return AG(this,t),n=EG(this,t,[r]),At(n,"handleDrag",function(a){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(a):n.state.isSlideMoving&&n.handleSlideDrag(a)}),At(n,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&n.handleDrag(a.changedTouches[0])}),At(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,o=a.onDragEnd,l=a.startIndex;o==null||o({endIndex:i,startIndex:l})}),n.detachDragEndListener()}),At(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),At(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),At(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),At(n,"handleSlideDragStart",function(a){var i=d1(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return MG(t,e),$G(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(a,i),h=Math.max(a,i),p=t.getIndexInRange(o,f),v=t.getIndexInRange(o,h);return{startIndex:p-p%c,endIndex:v===d?d:v-v%c}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,o=a.tickFormatter,l=a.dataKey,c=Ke(i[n],l,n);return Z(o)?o(c,n):c}},{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(n){var a=this.state,i=a.slideMoveStartX,o=a.startX,l=a.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,p=c.endIndex,v=c.onChange,b=n.pageX-i;b>0?b=Math.min(b,u+d-f-l,u+d-f-o):b<0&&(b=Math.max(b,u-o,u-l));var x=this.getIndex({startX:o+b,endX:l+b});(x.startIndex!==h||x.endIndex!==p)&&v&&v(x),this.setState({startX:o+b,endX:l+b,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=d1(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,l=a.endX,c=a.startX,u=this.state[o],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,v=d.onChange,b=d.gap,x=d.data,y={startX:this.state.startX,endX:this.state.endX},m=n.pageX-i;m>0?m=Math.min(m,f+h-p-u):m<0&&(m=Math.max(m,f-u)),y[o]=u+m;var g=this.getIndex(y),S=g.startIndex,j=g.endIndex,w=function(){var N=x.length-1;return o==="startX"&&(l>c?S%b===0:j%b===0)||l<c&&j===N||o==="endX"&&(l>c?j%b===0:S%b===0)||l>c&&j===N};this.setState(At(At({},o,u+m),"brushMoveStartX",n.pageX),function(){v&&w()&&v(g)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[a],f=l.indexOf(d);if(f!==-1){var h=f+n;if(!(h===-1||h>=l.length)){var p=l[h];a==="startX"&&p>=u||a==="endX"&&p<=c||this.setState(At({},a,p),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,l=n.height,c=n.fill,u=n.stroke;return E.createElement("rect",{stroke:u,fill:c,x:a,y:i,width:o,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,l=n.height,c=n.data,u=n.children,d=n.padding,f=O.Children.only(u);return f?E.cloneElement(f,{x:a,y:i,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,p=c.ariaLabel,v=c.data,b=c.startIndex,x=c.endIndex,y=Math.max(n,this.props.x),m=Wd(Wd({},X(this.props,!1)),{},{x:y,y:u,width:d,height:f}),g=p||"Min value: ".concat((i=v[b])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=v[x])===null||o===void 0?void 0:o.name);return E.createElement(ae,{tabIndex:0,role:"slider","aria-label":g,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(j){["ArrowLeft","ArrowRight"].includes(j.key)&&(j.preventDefault(),j.stopPropagation(),l.handleTravellerMoveKeyboard(j.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,m))}},{key:"renderSlide",value:function(n,a){var i=this.props,o=i.y,l=i.height,c=i.stroke,u=i.travellerWidth,d=Math.min(n,a)+u,f=Math.max(Math.abs(a-n)-u,0);return E.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:o,width:f,height:l})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,o=n.y,l=n.height,c=n.travellerWidth,u=n.stroke,d=this.state,f=d.startX,h=d.endX,p=5,v={pointerEvents:"none",fill:u};return E.createElement(ae,{className:"recharts-brush-texts"},E.createElement(xa,bu({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:o+l/2},v),this.getTextOfTick(a)),E.createElement(xa,bu({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+p,y:o+l/2},v),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,o=n.children,l=n.x,c=n.y,u=n.width,d=n.height,f=n.alwaysShowText,h=this.state,p=h.startX,v=h.endX,b=h.isTextActive,x=h.isSlideMoving,y=h.isTravellerMoving,m=h.isTravellerFocused;if(!a||!a.length||!W(l)||!W(c)||!W(u)||!W(d)||u<=0||d<=0)return null;var g=te("recharts-brush",i),S=E.Children.count(o)===1,j=kG("userSelect","none");return E.createElement(ae,{className:g,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:j},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,v),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(v,"endX"),(b||x||y||m||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,o=n.width,l=n.height,c=n.stroke,u=Math.floor(i+l/2)-1;return E.createElement(E.Fragment,null,E.createElement("rect",{x:a,y:i,width:o,height:l,fill:c,stroke:"none"}),E.createElement("line",{x1:a+1,y1:u,x2:a+o-1,y2:u,fill:"none",stroke:"#fff"}),E.createElement("line",{x1:a+1,y1:u+2,x2:a+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return E.isValidElement(n)?i=E.cloneElement(n,a):Z(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,o=n.width,l=n.x,c=n.travellerWidth,u=n.updateId,d=n.startIndex,f=n.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return Wd({prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},i&&i.length?LG({data:i,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||l!==a.prevX||c!==a.prevTravellerWidth)){a.scale.range([l,l+o-c]);var h=a.scale.domain().map(function(p){return a.scale(p)});return{prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,o=0,l=i-1;l-o>1;){var c=Math.floor((o+l)/2);n[c]>a?l=c:o=c}return a>=n[l]?l:o}}])}(O.PureComponent);At(Ii,"displayName","Brush");At(Ii,"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 DG=R0;function RG(e,t){var r;return DG(e,function(n,a,i){return r=t(n,a,i),!r}),!!r}var BG=RG,FG=o_,zG=Or,UG=BG,WG=kt,HG=xf;function KG(e,t,r){var n=WG(e)?FG:UG;return r&&HG(e,t,r)&&(t=void 0),n(e,zG(t))}var VG=KG;const GG=fe(VG);var wr=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},h1=k_;function YG(e,t,r){t=="__proto__"&&h1?h1(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var qG=YG,XG=qG,QG=O_,ZG=Or;function JG(e,t){var r={};return t=ZG(t),QG(e,function(n,a,i){XG(r,a,t(n,a,i))}),r}var eY=JG;const tY=fe(eY);function rY(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}var nY=rY,aY=R0;function iY(e,t){var r=!0;return aY(e,function(n,a,i){return r=!!t(n,a,i),r}),r}var oY=iY,sY=nY,lY=oY,cY=Or,uY=kt,fY=xf;function dY(e,t,r){var n=uY(e)?sY:lY;return r&&fY(e,t,r)&&(t=void 0),n(e,cY(t))}var hY=dY;const vO=fe(hY);var pY=["x","y"];function Gs(e){"@babel/helpers - typeof";return Gs=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},Gs(e)}function Jp(){return Jp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jp.apply(this,arguments)}function p1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ao(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?p1(Object(r),!0).forEach(function(n){mY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mY(e,t,r){return t=gY(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gY(e){var t=yY(e,"string");return Gs(t)=="symbol"?t:t+""}function yY(e,t){if(Gs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Gs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vY(e,t){if(e==null)return{};var r=xY(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xY(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function bY(e,t){var r=e.x,n=e.y,a=vY(e,pY),i="".concat(r),o=parseInt(i,10),l="".concat(n),c=parseInt(l,10),u="".concat(t.height||a.height),d=parseInt(u,10),f="".concat(t.width||a.width),h=parseInt(f,10);return Ao(Ao(Ao(Ao(Ao({},t),a),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function m1(e){return E.createElement(fO,Jp({shapeType:"rectangle",propTransformer:bY,activeClassName:"recharts-active-bar"},e))}var jY=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var i=W(n)||UT(n);return i?t(n,a):(i||ja(),r)}},wY=["value","background"],xO;function Li(e){"@babel/helpers - typeof";return Li=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},Li(e)}function SY(e,t){if(e==null)return{};var r=_Y(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _Y(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wu(){return wu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wu.apply(this,arguments)}function g1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Le(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?g1(Object(r),!0).forEach(function(n){pn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,jO(n.key),n)}}function OY(e,t,r){return t&&y1(e.prototype,t),r&&y1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function PY(e,t,r){return t=Su(t),kY(e,bO()?Reflect.construct(t,r||[],Su(e).constructor):t.apply(e,r))}function kY(e,t){if(t&&(Li(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return AY(e)}function AY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bO=function(){return!!e})()}function Su(e){return Su=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Su(e)}function $Y(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&em(e,t)}function em(e,t){return em=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},em(e,t)}function pn(e,t,r){return t=jO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jO(e){var t=EY(e,"string");return Li(t)=="symbol"?t:t+""}function EY(e,t){if(Li(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Li(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ln=function(e){function t(){var r;NY(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=PY(this,t,[].concat(a)),pn(r,"state",{isAnimationFinished:!1}),pn(r,"id",no("recharts-bar-")),pn(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),pn(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return $Y(t,e),OY(t,[{key:"renderRectanglesStatically",value:function(n){var a=this,i=this.props,o=i.shape,l=i.dataKey,c=i.activeIndex,u=i.activeBar,d=X(this.props,!1);return n&&n.map(function(f,h){var p=h===c,v=p?u:o,b=Le(Le(Le({},d),f),{},{isActive:p,option:v,index:h,dataKey:l,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return E.createElement(ae,wu({className:"recharts-bar-rectangle"},ya(a.props,f,h),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(h)}),E.createElement(m1,b))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,a=this.props,i=a.data,o=a.layout,l=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,d=a.animationEasing,f=a.animationId,h=this.state.prevData;return E.createElement(_r,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(p){var v=p.t,b=i.map(function(x,y){var m=h&&h[y];if(m){var g=wt(m.x,x.x),S=wt(m.y,x.y),j=wt(m.width,x.width),w=wt(m.height,x.height);return Le(Le({},x),{},{x:g(v),y:S(v),width:j(v),height:w(v)})}if(o==="horizontal"){var _=wt(0,x.height),N=_(v);return Le(Le({},x),{},{y:x.y+x.height-N,height:N})}var P=wt(0,x.width),k=P(v);return Le(Le({},x),{},{width:k})});return E.createElement(ae,null,n.renderRectanglesStatically(b))})}},{key:"renderRectangles",value:function(){var n=this.props,a=n.data,i=n.isAnimationActive,o=this.state.prevData;return i&&a&&a.length&&(!o||!ki(o,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var n=this,a=this.props,i=a.data,o=a.dataKey,l=a.activeIndex,c=X(this.props.background,!1);return i.map(function(u,d){u.value;var f=u.background,h=SY(u,wY);if(!f)return null;var p=Le(Le(Le(Le(Le({},h),{},{fill:"#eee"},f),c),ya(n.props,u,d)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return E.createElement(m1,wu({key:"background-bar-".concat(d),option:n.props.background,isActive:d===l},p))})}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.data,l=i.xAxis,c=i.yAxis,u=i.layout,d=i.children,f=qt(d,$f);if(!f)return null;var h=u==="vertical"?o[0].height/2:o[0].width/2,p=function(x,y){var m=Array.isArray(x.value)?x.value[1]:x.value;return{x:x.x,y:x.y,value:m,errorVal:Ke(x,y)}},v={clipPath:n?"url(#clipPath-".concat(a,")"):null};return E.createElement(ae,v,f.map(function(b){return E.cloneElement(b,{key:"error-bar-".concat(a,"-").concat(b.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:p})}))}},{key:"render",value:function(){var n=this.props,a=n.hide,i=n.data,o=n.className,l=n.xAxis,c=n.yAxis,u=n.left,d=n.top,f=n.width,h=n.height,p=n.isAnimationActive,v=n.background,b=n.id;if(a||!i||!i.length)return null;var x=this.state.isAnimationFinished,y=te("recharts-bar",o),m=l&&l.allowDataOverflow,g=c&&c.allowDataOverflow,S=m||g,j=J(b)?this.id:b;return E.createElement(ae,{className:y},m||g?E.createElement("defs",null,E.createElement("clipPath",{id:"clipPath-".concat(j)},E.createElement("rect",{x:m?u:u-f/2,y:g?d:d-h/2,width:m?f:f*2,height:g?h:h*2}))):null,E.createElement(ae,{className:"recharts-bar-rectangles",clipPath:S?"url(#clipPath-".concat(j,")"):null},v?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(S,j),(!p||x)&&zr.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:a.curData}:n.data!==a.curData?{curData:n.data}:null}}])}(O.PureComponent);xO=Ln;pn(Ln,"displayName","Bar");pn(Ln,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Pa.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});pn(Ln,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,a=e.bandSize,i=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,p=sU(n,r);if(!p)return null;var v=t.layout,b=r.type.defaultProps,x=b!==void 0?Le(Le({},b),r.props):r.props,y=x.dataKey,m=x.children,g=x.minPointSize,S=v==="horizontal"?o:i,j=u?S.scale.domain():null,w=pU({numericAxis:S}),_=qt(m,va),N=f.map(function(P,k){var T,C,$,M,A,I;u?T=lU(u[d+k],j):(T=Ke(P,y),Array.isArray(T)||(T=[w,T]));var B=jY(g,xO.defaultProps.minPointSize)(T[1],k);if(v==="horizontal"){var L,R=[o.scale(T[0]),o.scale(T[1])],F=R[0],K=R[1];C=cb({axis:i,ticks:l,bandSize:a,offset:p.offset,entry:P,index:k}),$=(L=K??F)!==null&&L!==void 0?L:void 0,M=p.size;var z=F-K;if(A=Number.isNaN(z)?0:z,I={x:C,y:o.y,width:M,height:o.height},Math.abs(B)>0&&Math.abs(A)<Math.abs(B)){var q=dt(A||B)*(Math.abs(B)-Math.abs(A));$-=q,A+=q}}else{var ie=[i.scale(T[0]),i.scale(T[1])],_e=ie[0],Me=ie[1];if(C=_e,$=cb({axis:o,ticks:c,bandSize:a,offset:p.offset,entry:P,index:k}),M=Me-_e,A=p.size,I={x:i.x,y:$,width:i.width,height:A},Math.abs(B)>0&&Math.abs(M)<Math.abs(B)){var Bt=dt(M||B)*(Math.abs(B)-Math.abs(M));M+=Bt}}return Le(Le(Le({},P),{},{x:C,y:$,width:M,height:A,value:u?T:T[1],payload:P,background:I},_&&_[k]&&_[k].props),{},{tooltipPayload:[WN(r,P)],tooltipPosition:{x:C+M/2,y:$+A/2}})});return Le({data:N,layout:v},h)});function Ys(e){"@babel/helpers - typeof";return Ys=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},Ys(e)}function CY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wO(n.key),n)}}function TY(e,t,r){return t&&v1(e.prototype,t),r&&v1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function x1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ir(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x1(Object(r),!0).forEach(function(n){Rf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rf(e,t,r){return t=wO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wO(e){var t=MY(e,"string");return Ys(t)=="symbol"?t:t+""}function MY(e,t){if(Ys(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ys(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var SO=function(t,r,n,a,i){var o=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(r),f={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},h=!!Et(u,Ln);return d.reduce(function(p,v){var b=r[v],x=b.orientation,y=b.domain,m=b.padding,g=m===void 0?{}:m,S=b.mirror,j=b.reversed,w="".concat(x).concat(S?"Mirror":""),_,N,P,k,T;if(b.type==="number"&&(b.padding==="gap"||b.padding==="no-gap")){var C=y[1]-y[0],$=1/0,M=b.categoricalDomain.sort(KT);if(M.forEach(function(ie,_e){_e>0&&($=Math.min((ie||0)-(M[_e-1]||0),$))}),Number.isFinite($)){var A=$/C,I=b.layout==="vertical"?n.height:n.width;if(b.padding==="gap"&&(_=A*I/2),b.padding==="no-gap"){var B=ht(t.barCategoryGap,A*I),L=A*I/2;_=L-B-(L-B)/I*B}}}a==="xAxis"?N=[n.left+(g.left||0)+(_||0),n.left+n.width-(g.right||0)-(_||0)]:a==="yAxis"?N=c==="horizontal"?[n.top+n.height-(g.bottom||0),n.top+(g.top||0)]:[n.top+(g.top||0)+(_||0),n.top+n.height-(g.bottom||0)-(_||0)]:N=b.range,j&&(N=[N[1],N[0]]);var R=BN(b,i,h),F=R.scale,K=R.realScaleType;F.domain(y).range(N),FN(F);var z=zN(F,ir(ir({},b),{},{realScaleType:K}));a==="xAxis"?(T=x==="top"&&!S||x==="bottom"&&S,P=n.left,k=f[w]-T*b.height):a==="yAxis"&&(T=x==="left"&&!S||x==="right"&&S,P=f[w]-T*b.width,k=n.top);var q=ir(ir(ir({},b),z),{},{realScaleType:K,x:P,y:k,scale:F,width:a==="xAxis"?n.width:b.width,height:a==="yAxis"?n.height:b.height});return q.bandSize=ou(q,z),!b.hide&&a==="xAxis"?f[w]+=(T?-1:1)*q.height:b.hide||(f[w]+=(T?-1:1)*q.width),ir(ir({},p),{},Rf({},v,q))},{})},_O=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return{x:Math.min(n,i),y:Math.min(a,o),width:Math.abs(i-n),height:Math.abs(o-a)}},IY=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return _O({x:r,y:n},{x:a,y:i})},NO=function(){function e(t){CY(this,e),this.scale=t}return TY(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(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(a){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])}();Rf(NO,"EPS",1e-4);var hg=function(t){var r=Object.keys(t).reduce(function(n,a){return ir(ir({},n),{},Rf({},a,NO.create(t[a])))},{});return ir(ir({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,l=i.position;return tY(a,function(c,u){return r[u].apply(c,{bandAware:o,position:l})})},isInRange:function(a){return vO(a,function(i,o){return r[o].isInRange(i)})}})};function LY(e){return(e%180+180)%180}var DY=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=LY(a),o=i*Math.PI/180,l=Math.atan(n/r),c=o>l&&o<Math.PI-l?n/Math.sin(o):r/Math.cos(o);return Math.abs(c)},RY=Or,BY=ol,FY=yf;function zY(e){return function(t,r,n){var a=Object(t);if(!BY(t)){var i=RY(r);t=FY(t),r=function(l){return i(a[l],l,a)}}var o=e(t,r,n);return o>-1?a[i?t[o]:o]:void 0}}var UY=zY,WY=pO;function HY(e){var t=WY(e),r=t%1;return t===t?r?t-r:t:0}var KY=HY,VY=b_,GY=Or,YY=KY,qY=Math.max;function XY(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:YY(r);return a<0&&(a=qY(n+a,0)),VY(e,GY(t),a)}var QY=XY,ZY=UY,JY=QY,eq=ZY(JY),tq=eq;const rq=fe(tq);var nq=YC(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("")}),pg=O.createContext(void 0),mg=O.createContext(void 0),OO=O.createContext(void 0),PO=O.createContext({}),kO=O.createContext(void 0),AO=O.createContext(0),$O=O.createContext(0),b1=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=nq(i);return E.createElement(pg.Provider,{value:n},E.createElement(mg.Provider,{value:a},E.createElement(PO.Provider,{value:i},E.createElement(OO.Provider,{value:d},E.createElement(kO.Provider,{value:o},E.createElement(AO.Provider,{value:u},E.createElement($O.Provider,{value:c},l)))))))},aq=function(){return O.useContext(kO)},EO=function(t){var r=O.useContext(pg);r==null&&ja();var n=r[t];return n==null&&ja(),n},iq=function(){var t=O.useContext(pg);return cn(t)},oq=function(){var t=O.useContext(mg),r=rq(t,function(n){return vO(n.domain,Number.isFinite)});return r||cn(t)},CO=function(t){var r=O.useContext(mg);r==null&&ja();var n=r[t];return n==null&&ja(),n},sq=function(){var t=O.useContext(OO);return t},lq=function(){return O.useContext(PO)},gg=function(){return O.useContext($O)},yg=function(){return O.useContext(AO)};function Di(e){"@babel/helpers - typeof";return Di=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},Di(e)}function cq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uq(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,MO(n.key),n)}}function fq(e,t,r){return t&&uq(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function dq(e,t,r){return t=_u(t),hq(e,TO()?Reflect.construct(t,r||[],_u(e).constructor):t.apply(e,r))}function hq(e,t){if(t&&(Di(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pq(e)}function pq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function TO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TO=function(){return!!e})()}function _u(e){return _u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_u(e)}function mq(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tm(e,t)}function tm(e,t){return tm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},tm(e,t)}function j1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function w1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?j1(Object(r),!0).forEach(function(n){vg(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vg(e,t,r){return t=MO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MO(e){var t=gq(e,"string");return Di(t)=="symbol"?t:t+""}function gq(e,t){if(Di(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Di(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function yq(e,t){return jq(e)||bq(e,t)||xq(e,t)||vq()}function vq(){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 xq(e,t){if(e){if(typeof e=="string")return S1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return S1(e,t)}}function S1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function bq(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function jq(e){if(Array.isArray(e))return e}function rm(){return rm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rm.apply(this,arguments)}var wq=function(t,r){var n;return E.isValidElement(t)?n=E.cloneElement(t,r):Z(t)?n=t(r):n=E.createElement("line",rm({},r,{className:"recharts-reference-line-line"})),n},Sq=function(t,r,n,a,i,o,l,c,u){var d=i.x,f=i.y,h=i.width,p=i.height;if(n){var v=u.y,b=t.y.apply(v,{position:o});if(wr(u,"discard")&&!t.y.isInRange(b))return null;var x=[{x:d+h,y:b},{x:d,y:b}];return c==="left"?x.reverse():x}if(r){var y=u.x,m=t.x.apply(y,{position:o});if(wr(u,"discard")&&!t.x.isInRange(m))return null;var g=[{x:m,y:f+p},{x:m,y:f}];return l==="top"?g.reverse():g}if(a){var S=u.segment,j=S.map(function(w){return t.apply(w,{position:o})});return wr(u,"discard")&&GG(j,function(w){return!t.isInRange(w)})?null:j}return null};function _q(e){var t=e.x,r=e.y,n=e.segment,a=e.xAxisId,i=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=aq(),d=EO(a),f=CO(i),h=sq();if(!u||!h)return null;ur(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=hg({x:d.scale,y:f.scale}),v=Ge(t),b=Ge(r),x=n&&n.length===2,y=Sq(p,v,b,x,h,e.position,d.orientation,f.orientation,e);if(!y)return null;var m=yq(y,2),g=m[0],S=g.x,j=g.y,w=m[1],_=w.x,N=w.y,P=wr(e,"hidden")?"url(#".concat(u,")"):void 0,k=w1(w1({clipPath:P},X(e,!0)),{},{x1:S,y1:j,x2:_,y2:N});return E.createElement(ae,{className:te("recharts-reference-line",l)},wq(o,k),Qe.renderCallByParent(e,IY({x1:S,y1:j,x2:_,y2:N})))}var xg=function(e){function t(){return cq(this,t),dq(this,t,arguments)}return mq(t,e),fq(t,[{key:"render",value:function(){return E.createElement(_q,this.props)}}])}(E.Component);vg(xg,"displayName","ReferenceLine");vg(xg,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function nm(){return nm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nm.apply(this,arguments)}function Ri(e){"@babel/helpers - typeof";return Ri=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},Ri(e)}function _1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function N1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_1(Object(r),!0).forEach(function(n){Bf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Nq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oq(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,LO(n.key),n)}}function Pq(e,t,r){return t&&Oq(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function kq(e,t,r){return t=Nu(t),Aq(e,IO()?Reflect.construct(t,r||[],Nu(e).constructor):t.apply(e,r))}function Aq(e,t){if(t&&(Ri(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $q(e)}function $q(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function IO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(IO=function(){return!!e})()}function Nu(e){return Nu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Nu(e)}function Eq(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&am(e,t)}function am(e,t){return am=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},am(e,t)}function Bf(e,t,r){return t=LO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LO(e){var t=Cq(e,"string");return Ri(t)=="symbol"?t:t+""}function Cq(e,t){if(Ri(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ri(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Tq=function(t){var r=t.x,n=t.y,a=t.xAxis,i=t.yAxis,o=hg({x:a.scale,y:i.scale}),l=o.apply({x:r,y:n},{bandAware:!0});return wr(t,"discard")&&!o.isInRange(l)?null:l},Ff=function(e){function t(){return Nq(this,t),kq(this,t,arguments)}return Eq(t,e),Pq(t,[{key:"render",value:function(){var n=this.props,a=n.x,i=n.y,o=n.r,l=n.alwaysShow,c=n.clipPathId,u=Ge(a),d=Ge(i);if(ur(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=Tq(this.props);if(!f)return null;var h=f.x,p=f.y,v=this.props,b=v.shape,x=v.className,y=wr(this.props,"hidden")?"url(#".concat(c,")"):void 0,m=N1(N1({clipPath:y},X(this.props,!0)),{},{cx:h,cy:p});return E.createElement(ae,{className:te("recharts-reference-dot",x)},t.renderDot(b,m),Qe.renderCallByParent(this.props,{x:h-o,y:p-o,width:2*o,height:2*o}))}}])}(E.Component);Bf(Ff,"displayName","ReferenceDot");Bf(Ff,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Bf(Ff,"renderDot",function(e,t){var r;return E.isValidElement(e)?r=E.cloneElement(e,t):Z(e)?r=e(t):r=E.createElement(Ef,nm({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function im(){return im=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},im.apply(this,arguments)}function Bi(e){"@babel/helpers - typeof";return Bi=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},Bi(e)}function O1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function P1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?O1(Object(r),!0).forEach(function(n){zf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Iq(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,RO(n.key),n)}}function Lq(e,t,r){return t&&Iq(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Dq(e,t,r){return t=Ou(t),Rq(e,DO()?Reflect.construct(t,r||[],Ou(e).constructor):t.apply(e,r))}function Rq(e,t){if(t&&(Bi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bq(e)}function Bq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function DO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(DO=function(){return!!e})()}function Ou(e){return Ou=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ou(e)}function Fq(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&om(e,t)}function om(e,t){return om=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},om(e,t)}function zf(e,t,r){return t=RO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RO(e){var t=zq(e,"string");return Bi(t)=="symbol"?t:t+""}function zq(e,t){if(Bi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Bi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Uq=function(t,r,n,a,i){var o=i.x1,l=i.x2,c=i.y1,u=i.y2,d=i.xAxis,f=i.yAxis;if(!d||!f)return null;var h=hg({x:d.scale,y:f.scale}),p={x:t?h.x.apply(o,{position:"start"}):h.x.rangeMin,y:n?h.y.apply(c,{position:"start"}):h.y.rangeMin},v={x:r?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:a?h.y.apply(u,{position:"end"}):h.y.rangeMax};return wr(i,"discard")&&(!h.isInRange(p)||!h.isInRange(v))?null:_O(p,v)},Uf=function(e){function t(){return Mq(this,t),Dq(this,t,arguments)}return Fq(t,e),Lq(t,[{key:"render",value:function(){var n=this.props,a=n.x1,i=n.x2,o=n.y1,l=n.y2,c=n.className,u=n.alwaysShow,d=n.clipPathId;ur(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Ge(a),h=Ge(i),p=Ge(o),v=Ge(l),b=this.props.shape;if(!f&&!h&&!p&&!v&&!b)return null;var x=Uq(f,h,p,v,this.props);if(!x&&!b)return null;var y=wr(this.props,"hidden")?"url(#".concat(d,")"):void 0;return E.createElement(ae,{className:te("recharts-reference-area",c)},t.renderRect(b,P1(P1({clipPath:y},X(this.props,!0)),x)),Qe.renderCallByParent(this.props,x))}}])}(E.Component);zf(Uf,"displayName","ReferenceArea");zf(Uf,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});zf(Uf,"renderRect",function(e,t){var r;return E.isValidElement(e)?r=E.cloneElement(e,t):Z(e)?r=e(t):r=E.createElement(dg,im({},t,{className:"recharts-reference-area-rect"})),r});function BO(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],a=0;a<e.length;a+=t)n.push(e[a]);return n}function Wq(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return DY(n,r)}function Hq(e,t,r){var n=r==="width",a=e.x,i=e.y,o=e.width,l=e.height;return t===1?{start:n?a:i,end:n?a+o:i+l}:{start:n?a+o:i+l,end:n?a:i}}function Pu(e,t,r,n,a){if(e*t<e*n||e*t>e*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function Kq(e,t){return BO(e,t+1)}function Vq(e,t,r,n,a){for(var i=(n||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,f=function(){var v=n==null?void 0:n[c];if(v===void 0)return{v:BO(n,u)};var b=c,x,y=function(){return x===void 0&&(x=r(v,b)),x},m=v.coordinate,g=c===0||Pu(e,m,y,d,l);g||(c=0,d=o,u+=1),g&&(d=m+e*(y()/2+a),c+=u)},h;u<=i.length;)if(h=f(),h)return h.v;return[]}function qs(e){"@babel/helpers - typeof";return qs=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},qs(e)}function k1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function st(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?k1(Object(r),!0).forEach(function(n){Gq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Gq(e,t,r){return t=Yq(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yq(e){var t=qq(e,"string");return qs(t)=="symbol"?t:t+""}function qq(e,t){if(qs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(qs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xq(e,t,r,n,a){for(var i=(n||[]).slice(),o=i.length,l=t.start,c=t.end,u=function(h){var p=i[h],v,b=function(){return v===void 0&&(v=r(p,h)),v};if(h===o-1){var x=e*(p.coordinate+e*b()/2-c);i[h]=p=st(st({},p),{},{tickCoord:x>0?p.coordinate-x*e:p.coordinate})}else i[h]=p=st(st({},p),{},{tickCoord:p.coordinate});var y=Pu(e,p.tickCoord,b,l,c);y&&(c=p.tickCoord-e*(b()/2+a),i[h]=st(st({},p),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return i}function Qq(e,t,r,n,a,i){var o=(n||[]).slice(),l=o.length,c=t.start,u=t.end;if(i){var d=n[l-1],f=r(d,l-1),h=e*(d.coordinate+e*f/2-u);o[l-1]=d=st(st({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=Pu(e,d.tickCoord,function(){return f},c,u);p&&(u=d.tickCoord-e*(f/2+a),o[l-1]=st(st({},d),{},{isShow:!0}))}for(var v=i?l-1:l,b=function(m){var g=o[m],S,j=function(){return S===void 0&&(S=r(g,m)),S};if(m===0){var w=e*(g.coordinate-e*j()/2-c);o[m]=g=st(st({},g),{},{tickCoord:w<0?g.coordinate-w*e:g.coordinate})}else o[m]=g=st(st({},g),{},{tickCoord:g.coordinate});var _=Pu(e,g.tickCoord,j,c,u);_&&(c=g.tickCoord+e*(j()/2+a),o[m]=st(st({},g),{},{isShow:!0}))},x=0;x<v;x++)b(x);return o}function bg(e,t,r){var n=e.tick,a=e.ticks,i=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!a||!a.length||!n)return[];if(W(c)||Pa.isSsr)return Kq(a,typeof c=="number"&&W(c)?c:0);var h=[],p=l==="top"||l==="bottom"?"width":"height",v=d&&p==="width"?Vo(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},b=function(g,S){var j=Z(u)?u(g.value,S):g.value;return p==="width"?Wq(Vo(j,{fontSize:t,letterSpacing:r}),v,f):Vo(j,{fontSize:t,letterSpacing:r})[p]},x=a.length>=2?dt(a[1].coordinate-a[0].coordinate):1,y=Hq(i,x,p);return c==="equidistantPreserveStart"?Vq(x,y,b,a,o):(c==="preserveStart"||c==="preserveStartEnd"?h=Qq(x,y,b,a,o,c==="preserveStartEnd"):h=Xq(x,y,b,a,o),h.filter(function(m){return m.isShow}))}var Zq=["viewBox"],Jq=["viewBox"],eX=["ticks"];function Fi(e){"@babel/helpers - typeof";return Fi=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},Fi(e)}function Ja(){return Ja=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ja.apply(this,arguments)}function A1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?A1(Object(r),!0).forEach(function(n){jg(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Hd(e,t){if(e==null)return{};var r=tX(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function rX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zO(n.key),n)}}function nX(e,t,r){return t&&$1(e.prototype,t),r&&$1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function aX(e,t,r){return t=ku(t),iX(e,FO()?Reflect.construct(t,r||[],ku(e).constructor):t.apply(e,r))}function iX(e,t){if(t&&(Fi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oX(e)}function oX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FO=function(){return!!e})()}function ku(e){return ku=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ku(e)}function sX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sm(e,t)}function sm(e,t){return sm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},sm(e,t)}function jg(e,t,r){return t=zO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zO(e){var t=lX(e,"string");return Fi(t)=="symbol"?t:t+""}function lX(e,t){if(Fi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var uo=function(e){function t(r){var n;return rX(this,t),n=aX(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return sX(t,e),nX(t,[{key:"shouldComponentUpdate",value:function(n,a){var i=n.viewBox,o=Hd(n,Zq),l=this.props,c=l.viewBox,u=Hd(l,Jq);return!si(i,c)||!si(o,u)||!si(a,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var a=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var a=this.props,i=a.x,o=a.y,l=a.width,c=a.height,u=a.orientation,d=a.tickSize,f=a.mirror,h=a.tickMargin,p,v,b,x,y,m,g=f?-1:1,S=n.tickSize||d,j=W(n.tickCoord)?n.tickCoord:n.coordinate;switch(u){case"top":p=v=n.coordinate,x=o+ +!f*c,b=x-g*S,m=b-g*h,y=j;break;case"left":b=x=n.coordinate,v=i+ +!f*l,p=v-g*S,y=p-g*h,m=j;break;case"right":b=x=n.coordinate,v=i+ +f*l,p=v+g*S,y=p+g*h,m=j;break;default:p=v=n.coordinate,x=o+ +f*c,b=x+g*S,m=b+g*h,y=j;break}return{line:{x1:p,y1:b,x2:v,y2:x},tick:{x:y,y:m}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,o;switch(a){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,o="end";switch(a){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,l=n.height,c=n.orientation,u=n.mirror,d=n.axisLine,f=Ue(Ue(Ue({},X(this.props,!1)),X(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=Ue(Ue({},f),{},{x1:a,y1:i+h*l,x2:a+o,y2:i+h*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);f=Ue(Ue({},f),{},{x1:a+p*o,y1:i,x2:a+p*o,y2:i+l})}return E.createElement("line",Ja({},f,{className:te("recharts-cartesian-axis-line",It(d,"className"))}))}},{key:"renderTicks",value:function(n,a,i){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,h=l.unit,p=bg(Ue(Ue({},this.props),{},{ticks:n}),a,i),v=this.getTickTextAnchor(),b=this.getTickVerticalAnchor(),x=X(this.props,!1),y=X(d,!1),m=Ue(Ue({},x),{},{fill:"none"},X(c,!1)),g=p.map(function(S,j){var w=o.getTickLineCoord(S),_=w.line,N=w.tick,P=Ue(Ue(Ue(Ue({textAnchor:v,verticalAnchor:b},x),{},{stroke:"none",fill:u},y),N),{},{index:j,payload:S,visibleTicksCount:p.length,tickFormatter:f});return E.createElement(ae,Ja({className:"recharts-cartesian-axis-tick",key:"tick-".concat(S.value,"-").concat(S.coordinate,"-").concat(S.tickCoord)},ya(o.props,S,j)),c&&E.createElement("line",Ja({},m,_,{className:te("recharts-cartesian-axis-tick-line",It(c,"className"))})),d&&t.renderTickItem(d,P,"".concat(Z(f)?f(S.value,j):S.value).concat(h||"")))});return E.createElement("g",{className:"recharts-cartesian-axis-ticks"},g)}},{key:"render",value:function(){var n=this,a=this.props,i=a.axisLine,o=a.width,l=a.height,c=a.ticksGenerator,u=a.className,d=a.hide;if(d)return null;var f=this.props,h=f.ticks,p=Hd(f,eX),v=h;return Z(c)&&(v=h&&h.length>0?c(this.props):c(p)),o<=0||l<=0||!v||!v.length?null:E.createElement(ae,{className:te("recharts-cartesian-axis",u),ref:function(x){n.layerReference=x}},i&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),Qe.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var o,l=te(a.className,"recharts-cartesian-axis-tick-value");return E.isValidElement(n)?o=E.cloneElement(n,Ue(Ue({},a),{},{className:l})):Z(n)?o=n(Ue(Ue({},a),{},{className:l})):o=E.createElement(xa,Ja({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])}(O.Component);jg(uo,"displayName","CartesianAxis");jg(uo,"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 cX=["x1","y1","x2","y2","key"],uX=["offset"];function wa(e){"@babel/helpers - typeof";return wa=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},wa(e)}function E1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ct(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?E1(Object(r),!0).forEach(function(n){fX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fX(e,t,r){return t=dX(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dX(e){var t=hX(e,"string");return wa(t)=="symbol"?t:t+""}function hX(e,t){if(wa(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(wa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aa(){return aa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aa.apply(this,arguments)}function C1(e,t){if(e==null)return{};var r=pX(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function pX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var mX=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,i=t.y,o=t.width,l=t.height,c=t.ry;return E.createElement("rect",{x:a,y:i,ry:c,width:o,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function UO(e,t){var r;if(E.isValidElement(e))r=E.cloneElement(e,t);else if(Z(e))r=e(t);else{var n=t.x1,a=t.y1,i=t.x2,o=t.y2,l=t.key,c=C1(t,cX),u=X(c,!1);u.offset;var d=C1(u,uX);r=E.createElement("line",aa({},d,{x1:n,y1:a,x2:i,y2:o,fill:"none",key:l}))}return r}function gX(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(l,c){var u=ct(ct({},e),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return UO(a,u)});return E.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function yX(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,i=e.verticalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(l,c){var u=ct(ct({},e),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return UO(a,u)});return E.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function vX(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,i=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var v=!d[p+1],b=v?a+o-h:d[p+1]-h;if(b<=0)return null;var x=p%t.length;return E.createElement("rect",{key:"react-".concat(p),y:h,x:n,height:b,width:i,stroke:"none",fill:t[x],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return E.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function xX(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,i=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var d=u.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var v=!d[p+1],b=v?i+l-h:d[p+1]-h;if(b<=0)return null;var x=p%n.length;return E.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:b,height:c,stroke:"none",fill:n[x],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return E.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var bX=function(t,r){var n=t.xAxis,a=t.width,i=t.height,o=t.offset;return RN(bg(ct(ct(ct({},uo.defaultProps),n),{},{ticks:Dr(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.left,o.left+o.width,r)},jX=function(t,r){var n=t.yAxis,a=t.width,i=t.height,o=t.offset;return RN(bg(ct(ct(ct({},uo.defaultProps),n),{},{ticks:Dr(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.top,o.top+o.height,r)},Ia={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function wg(e){var t,r,n,a,i,o,l=gg(),c=yg(),u=lq(),d=ct(ct({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Ia.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Ia.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Ia.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Ia.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:Ia.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Ia.verticalFill,x:W(e.x)?e.x:u.left,y:W(e.y)?e.y:u.top,width:W(e.width)?e.width:u.width,height:W(e.height)?e.height:u.height}),f=d.x,h=d.y,p=d.width,v=d.height,b=d.syncWithTicks,x=d.horizontalValues,y=d.verticalValues,m=iq(),g=oq();if(!W(p)||p<=0||!W(v)||v<=0||!W(f)||f!==+f||!W(h)||h!==+h)return null;var S=d.verticalCoordinatesGenerator||bX,j=d.horizontalCoordinatesGenerator||jX,w=d.horizontalPoints,_=d.verticalPoints;if((!w||!w.length)&&Z(j)){var N=x&&x.length,P=j({yAxis:g?ct(ct({},g),{},{ticks:N?x:g.ticks}):void 0,width:l,height:c,offset:u},N?!0:b);ur(Array.isArray(P),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(wa(P),"]")),Array.isArray(P)&&(w=P)}if((!_||!_.length)&&Z(S)){var k=y&&y.length,T=S({xAxis:m?ct(ct({},m),{},{ticks:k?y:m.ticks}):void 0,width:l,height:c,offset:u},k?!0:b);ur(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(wa(T),"]")),Array.isArray(T)&&(_=T)}return E.createElement("g",{className:"recharts-cartesian-grid"},E.createElement(mX,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),E.createElement(gX,aa({},d,{offset:u,horizontalPoints:w,xAxis:m,yAxis:g})),E.createElement(yX,aa({},d,{offset:u,verticalPoints:_,xAxis:m,yAxis:g})),E.createElement(vX,aa({},d,{horizontalPoints:w})),E.createElement(xX,aa({},d,{verticalPoints:_})))}wg.displayName="CartesianGrid";var wX=["layout","type","stroke","connectNulls","isRange","ref"],SX=["key"],WO;function zi(e){"@babel/helpers - typeof";return zi=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},zi(e)}function HO(e,t){if(e==null)return{};var r=_X(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _X(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ia(){return ia=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ia.apply(this,arguments)}function T1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function rn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?T1(Object(r),!0).forEach(function(n){vr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,VO(n.key),n)}}function OX(e,t,r){return t&&M1(e.prototype,t),r&&M1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function PX(e,t,r){return t=Au(t),kX(e,KO()?Reflect.construct(t,r||[],Au(e).constructor):t.apply(e,r))}function kX(e,t){if(t&&(zi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return AX(e)}function AX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KO=function(){return!!e})()}function Au(e){return Au=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Au(e)}function $X(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lm(e,t)}function lm(e,t){return lm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},lm(e,t)}function vr(e,t,r){return t=VO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VO(e){var t=EX(e,"string");return zi(t)=="symbol"?t:t+""}function EX(e,t){if(zi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(zi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Jr=function(e){function t(){var r;NX(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=PX(this,t,[].concat(a)),vr(r,"state",{isAnimationFinished:!0}),vr(r,"id",no("recharts-area-")),vr(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Z(o)&&o()}),vr(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Z(o)&&o()}),r}return $X(t,e),OX(t,[{key:"renderDots",value:function(n,a,i){var o=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(o&&!l)return null;var c=this.props,u=c.dot,d=c.points,f=c.dataKey,h=X(this.props,!1),p=X(u,!0),v=d.map(function(x,y){var m=rn(rn(rn({key:"dot-".concat(y),r:3},h),p),{},{index:y,cx:x.x,cy:x.y,dataKey:f,value:x.value,payload:x.payload,points:d});return t.renderDotItem(u,m)}),b={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return E.createElement(ae,ia({className:"recharts-area-dots"},b),v)}},{key:"renderHorizontalRect",value:function(n){var a=this.props,i=a.baseLine,o=a.points,l=a.strokeWidth,c=o[0].x,u=o[o.length-1].x,d=n*Math.abs(c-u),f=hn(o.map(function(h){return h.y||0}));return W(i)&&typeof i=="number"?f=Math.max(i,f):i&&Array.isArray(i)&&i.length&&(f=Math.max(hn(i.map(function(h){return h.y||0})),f)),W(f)?E.createElement("rect",{x:c<u?c:c-d,y:0,width:d,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var a=this.props,i=a.baseLine,o=a.points,l=a.strokeWidth,c=o[0].y,u=o[o.length-1].y,d=n*Math.abs(c-u),f=hn(o.map(function(h){return h.x||0}));return W(i)&&typeof i=="number"?f=Math.max(i,f):i&&Array.isArray(i)&&i.length&&(f=Math.max(hn(i.map(function(h){return h.x||0})),f)),W(f)?E.createElement("rect",{x:0,y:c<u?c:c-d,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(d)}):null}},{key:"renderClipRect",value:function(n){var a=this.props.layout;return a==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,a,i,o){var l=this.props,c=l.layout,u=l.type,d=l.stroke,f=l.connectNulls,h=l.isRange;l.ref;var p=HO(l,wX);return E.createElement(ae,{clipPath:i?"url(#clipPath-".concat(o,")"):null},E.createElement(fi,ia({},X(p,!0),{points:n,connectNulls:f,type:u,baseLine:a,layout:c,stroke:"none",className:"recharts-area-area"})),d!=="none"&&E.createElement(fi,ia({},X(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:n})),d!=="none"&&h&&E.createElement(fi,ia({},X(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:a})))}},{key:"renderAreaWithAnimation",value:function(n,a){var i=this,o=this.props,l=o.points,c=o.baseLine,u=o.isAnimationActive,d=o.animationBegin,f=o.animationDuration,h=o.animationEasing,p=o.animationId,v=this.state,b=v.prevPoints,x=v.prevBaseLine;return E.createElement(_r,{begin:d,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"area-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(y){var m=y.t;if(b){var g=b.length/l.length,S=l.map(function(N,P){var k=Math.floor(P*g);if(b[k]){var T=b[k],C=wt(T.x,N.x),$=wt(T.y,N.y);return rn(rn({},N),{},{x:C(m),y:$(m)})}return N}),j;if(W(c)&&typeof c=="number"){var w=wt(x,c);j=w(m)}else if(J(c)||ro(c)){var _=wt(x,0);j=_(m)}else j=c.map(function(N,P){var k=Math.floor(P*g);if(x[k]){var T=x[k],C=wt(T.x,N.x),$=wt(T.y,N.y);return rn(rn({},N),{},{x:C(m),y:$(m)})}return N});return i.renderAreaStatically(S,j,n,a)}return E.createElement(ae,null,E.createElement("defs",null,E.createElement("clipPath",{id:"animationClipPath-".concat(a)},i.renderClipRect(m))),E.createElement(ae,{clipPath:"url(#animationClipPath-".concat(a,")")},i.renderAreaStatically(l,c,n,a)))})}},{key:"renderArea",value:function(n,a){var i=this.props,o=i.points,l=i.baseLine,c=i.isAnimationActive,u=this.state,d=u.prevPoints,f=u.prevBaseLine,h=u.totalLength;return c&&o&&o.length&&(!d&&h>0||!ki(d,o)||!ki(f,l))?this.renderAreaWithAnimation(n,a):this.renderAreaStatically(o,l,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,o=a.dot,l=a.points,c=a.className,u=a.top,d=a.left,f=a.xAxis,h=a.yAxis,p=a.width,v=a.height,b=a.isAnimationActive,x=a.id;if(i||!l||!l.length)return null;var y=this.state.isAnimationFinished,m=l.length===1,g=te("recharts-area",c),S=f&&f.allowDataOverflow,j=h&&h.allowDataOverflow,w=S||j,_=J(x)?this.id:x,N=(n=X(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},P=N.r,k=P===void 0?3:P,T=N.strokeWidth,C=T===void 0?2:T,$=e5(o)?o:{},M=$.clipDot,A=M===void 0?!0:M,I=k*2+C;return E.createElement(ae,{className:g},S||j?E.createElement("defs",null,E.createElement("clipPath",{id:"clipPath-".concat(_)},E.createElement("rect",{x:S?d:d-p/2,y:j?u:u-v/2,width:S?p:p*2,height:j?v:v*2})),!A&&E.createElement("clipPath",{id:"clipPath-dots-".concat(_)},E.createElement("rect",{x:d-I/2,y:u-I/2,width:p+I,height:v+I}))):null,m?null:this.renderArea(w,_),(o||m)&&this.renderDots(w,A,_),(!b||y)&&zr.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:a.curPoints,prevBaseLine:a.curBaseLine}:n.points!==a.curPoints||n.baseLine!==a.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(O.PureComponent);WO=Jr;vr(Jr,"displayName","Area");vr(Jr,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Pa.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});vr(Jr,"getBaseValue",function(e,t,r,n){var a=e.layout,i=e.baseValue,o=t.props.baseValue,l=o??i;if(W(l)&&typeof l=="number")return l;var c=a==="horizontal"?n:r,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return l==="dataMin"?f:l==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});vr(Jr,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,a=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,p=t.layout,v=u&&u.length,b=WO.getBaseValue(t,r,n,a),x=p==="horizontal",y=!1,m=f.map(function(S,j){var w;v?w=u[d+j]:(w=Ke(S,c),Array.isArray(w)?y=!0:w=[b,w]);var _=w[1]==null||v&&Ke(S,c)==null;return x?{x:lb({axis:n,ticks:i,bandSize:l,entry:S,index:j}),y:_?null:a.scale(w[1]),value:w,payload:S}:{x:_?null:n.scale(w[1]),y:lb({axis:a,ticks:o,bandSize:l,entry:S,index:j}),value:w,payload:S}}),g;return v||y?g=m.map(function(S){var j=Array.isArray(S.value)?S.value[0]:null;return x?{x:S.x,y:j!=null&&S.y!=null?a.scale(j):null}:{x:j!=null?n.scale(j):null,y:S.y}}):g=x?a.scale(b):n.scale(b),rn({points:m,baseLine:g,layout:p,isRange:y},h)});vr(Jr,"renderDotItem",function(e,t){var r;if(E.isValidElement(e))r=E.cloneElement(e,t);else if(Z(e))r=e(t);else{var n=te("recharts-area-dot",typeof e!="boolean"?e.className:""),a=t.key,i=HO(t,SX);r=E.createElement(Ef,ia({},i,{key:a,className:n}))}return r});function Ui(e){"@babel/helpers - typeof";return Ui=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},Ui(e)}function CX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TX(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,qO(n.key),n)}}function MX(e,t,r){return t&&TX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function IX(e,t,r){return t=$u(t),LX(e,GO()?Reflect.construct(t,r||[],$u(e).constructor):t.apply(e,r))}function LX(e,t){if(t&&(Ui(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return DX(e)}function DX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GO=function(){return!!e})()}function $u(e){return $u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$u(e)}function RX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cm(e,t)}function cm(e,t){return cm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},cm(e,t)}function YO(e,t,r){return t=qO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qO(e){var t=BX(e,"string");return Ui(t)=="symbol"?t:t+""}function BX(e,t){if(Ui(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ui(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function um(){return um=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},um.apply(this,arguments)}function FX(e){var t=e.xAxisId,r=gg(),n=yg(),a=EO(t);return a==null?null:O.createElement(uo,um({},a,{className:te("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return Dr(o,!0)}}))}var Dn=function(e){function t(){return CX(this,t),IX(this,t,arguments)}return RX(t,e),MX(t,[{key:"render",value:function(){return O.createElement(FX,this.props)}}])}(O.Component);YO(Dn,"displayName","XAxis");YO(Dn,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function Wi(e){"@babel/helpers - typeof";return Wi=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},Wi(e)}function zX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UX(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ZO(n.key),n)}}function WX(e,t,r){return t&&UX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function HX(e,t,r){return t=Eu(t),KX(e,XO()?Reflect.construct(t,r||[],Eu(e).constructor):t.apply(e,r))}function KX(e,t){if(t&&(Wi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return VX(e)}function VX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(XO=function(){return!!e})()}function Eu(e){return Eu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Eu(e)}function GX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fm(e,t)}function fm(e,t){return fm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},fm(e,t)}function QO(e,t,r){return t=ZO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZO(e){var t=YX(e,"string");return Wi(t)=="symbol"?t:t+""}function YX(e,t){if(Wi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Wi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function dm(){return dm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dm.apply(this,arguments)}var qX=function(t){var r=t.yAxisId,n=gg(),a=yg(),i=CO(r);return i==null?null:O.createElement(uo,dm({},i,{className:te("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:a},ticksGenerator:function(l){return Dr(l,!0)}}))},Rn=function(e){function t(){return zX(this,t),HX(this,t,arguments)}return GX(t,e),WX(t,[{key:"render",value:function(){return O.createElement(qX,this.props)}}])}(O.Component);QO(Rn,"displayName","YAxis");QO(Rn,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function I1(e){return JX(e)||ZX(e)||QX(e)||XX()}function XX(){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 QX(e,t){if(e){if(typeof e=="string")return hm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hm(e,t)}}function ZX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function JX(e){if(Array.isArray(e))return hm(e)}function hm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var pm=function(t,r,n,a,i){var o=qt(t,xg),l=qt(t,Ff),c=[].concat(I1(o),I1(l)),u=qt(t,Uf),d="".concat(a,"Id"),f=a[0],h=r;if(c.length&&(h=c.reduce(function(b,x){if(x.props[d]===n&&wr(x.props,"extendDomain")&&W(x.props[f])){var y=x.props[f];return[Math.min(b[0],y),Math.max(b[1],y)]}return b},h)),u.length){var p="".concat(f,"1"),v="".concat(f,"2");h=u.reduce(function(b,x){if(x.props[d]===n&&wr(x.props,"extendDomain")&&W(x.props[p])&&W(x.props[v])){var y=x.props[p],m=x.props[v];return[Math.min(b[0],y,m),Math.max(b[1],y,m)]}return b},h)}return i&&i.length&&(h=i.reduce(function(b,x){return W(x)?[Math.min(b[0],x),Math.max(b[1],x)]:b},h)),h},JO={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function a(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function i(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new a(d,f||c,h),v=r?r+u:u;return c._events[v]?c._events[v].fn?c._events[v]=[c._events[v],p]:c._events[v].push(p):(c._events[v]=p,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=r?r+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,p=f.length,v=new Array(p);h<p;h++)v[h]=f[h].fn;return v},l.prototype.listenerCount=function(u){var d=r?r+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,h,p,v){var b=r?r+u:u;if(!this._events[b])return!1;var x=this._events[b],y=arguments.length,m,g;if(x.fn){switch(x.once&&this.removeListener(u,x.fn,void 0,!0),y){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,d),!0;case 3:return x.fn.call(x.context,d,f),!0;case 4:return x.fn.call(x.context,d,f,h),!0;case 5:return x.fn.call(x.context,d,f,h,p),!0;case 6:return x.fn.call(x.context,d,f,h,p,v),!0}for(g=1,m=new Array(y-1);g<y;g++)m[g-1]=arguments[g];x.fn.apply(x.context,m)}else{var S=x.length,j;for(g=0;g<S;g++)switch(x[g].once&&this.removeListener(u,x[g].fn,void 0,!0),y){case 1:x[g].fn.call(x[g].context);break;case 2:x[g].fn.call(x[g].context,d);break;case 3:x[g].fn.call(x[g].context,d,f);break;case 4:x[g].fn.call(x[g].context,d,f,h);break;default:if(!m)for(j=1,m=new Array(y-1);j<y;j++)m[j-1]=arguments[j];x[g].fn.apply(x[g].context,m)}}return!0},l.prototype.on=function(u,d,f){return i(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return i(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,h){var p=r?r+u:u;if(!this._events[p])return this;if(!d)return o(this,p),this;var v=this._events[p];if(v.fn)v.fn===d&&(!h||v.once)&&(!f||v.context===f)&&o(this,p);else{for(var b=0,x=[],y=v.length;b<y;b++)(v[b].fn!==d||h&&!v[b].once||f&&v[b].context!==f)&&x.push(v[b]);x.length?this._events[p]=x.length===1?x[0]:x:o(this,p)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=r?r+u:u,this._events[d]&&o(this,d)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(JO);var eQ=JO.exports;const tQ=fe(eQ);var Kd=new tQ,Vd="recharts.syncMouseEvents";function Xs(e){"@babel/helpers - typeof";return Xs=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},Xs(e)}function rQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,e2(n.key),n)}}function aQ(e,t,r){return t&&nQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gd(e,t,r){return t=e2(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function e2(e){var t=iQ(e,"string");return Xs(t)=="symbol"?t:t+""}function iQ(e,t){if(Xs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Xs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var oQ=function(){function e(){rQ(this,e),Gd(this,"activeIndex",0),Gd(this,"coordinateList",[]),Gd(this,"layout","horizontal")}return aQ(e,[{key:"setDetails",value:function(r){var n,a=r.coordinateList,i=a===void 0?null:a,o=r.container,l=o===void 0?null:o,c=r.layout,u=c===void 0?null:c,d=r.offset,f=d===void 0?null:d,h=r.mouseHandlerCallback,p=h===void 0?null:h;this.coordinateList=(n=i??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=p??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),i=a.x,o=a.y,l=a.height,c=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,d=((n=window)===null||n===void 0?void 0:n.scrollY)||0,f=i+c+u,h=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function sQ(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],a=e==null?void 0:e[1];if(n&&a&&W(n)&&W(a))return!0}return!1}function lQ(e,t,r,n){var a=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-a,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function t2(e){var t=e.cx,r=e.cy,n=e.radius,a=e.startAngle,i=e.endAngle,o=xe(t,r,n,a),l=xe(t,r,n,i);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:a,endAngle:i}}function cQ(e,t,r){var n,a,i,o;if(e==="horizontal")n=t.x,i=n,a=r.top,o=r.top+r.height;else if(e==="vertical")a=t.y,o=a,n=r.left,i=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,f=t.angle,h=xe(l,c,u,f),p=xe(l,c,d,f);n=h.x,a=h.y,i=p.x,o=p.y}else return t2(t);return[{x:n,y:a},{x:i,y:o}]}function Qs(e){"@babel/helpers - typeof";return Qs=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},Qs(e)}function L1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Wl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?L1(Object(r),!0).forEach(function(n){uQ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uQ(e,t,r){return t=fQ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fQ(e){var t=dQ(e,"string");return Qs(t)=="symbol"?t:t+""}function dQ(e,t){if(Qs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Qs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hQ(e){var t,r,n=e.element,a=e.tooltipEventType,i=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,h=e.chartName,p=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!p||!i||!o||h!=="ScatterChart"&&a!=="axis")return null;var v,b=fi;if(h==="ScatterChart")v=o,b=IK;else if(h==="BarChart")v=lQ(f,o,c,d),b=dg;else if(f==="radial"){var x=t2(o),y=x.cx,m=x.cy,g=x.radius,S=x.startAngle,j=x.endAngle;v={cx:y,cy:m,startAngle:S,endAngle:j,innerRadius:g,outerRadius:g},b=qN}else v={points:cQ(f,o,c)},b=fi;var w=Wl(Wl(Wl(Wl({stroke:"#ccc",pointerEvents:"none"},c),v),X(p,!1)),{},{payload:l,payloadIndex:u,className:te("recharts-tooltip-cursor",p.className)});return O.isValidElement(p)?O.cloneElement(p,w):O.createElement(b,w)}var pQ=["item"],mQ=["children","className","width","height","style","compact","title","desc"];function Hi(e){"@babel/helpers - typeof";return Hi=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},Hi(e)}function ei(){return ei=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ei.apply(this,arguments)}function D1(e,t){return vQ(e)||yQ(e,t)||n2(e,t)||gQ()}function gQ(){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 yQ(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function vQ(e){if(Array.isArray(e))return e}function R1(e,t){if(e==null)return{};var r=xQ(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function bQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a2(n.key),n)}}function wQ(e,t,r){return t&&jQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function SQ(e,t,r){return t=Cu(t),_Q(e,r2()?Reflect.construct(t,r||[],Cu(e).constructor):t.apply(e,r))}function _Q(e,t){if(t&&(Hi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NQ(e)}function NQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r2(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(r2=function(){return!!e})()}function Cu(e){return Cu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Cu(e)}function OQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mm(e,t)}function mm(e,t){return mm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},mm(e,t)}function Ki(e){return AQ(e)||kQ(e)||n2(e)||PQ()}function PQ(){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 n2(e,t){if(e){if(typeof e=="string")return gm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gm(e,t)}}function kQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function AQ(e){if(Array.isArray(e))return gm(e)}function gm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function B1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?B1(Object(r),!0).forEach(function(n){Q(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Q(e,t,r){return t=a2(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a2(e){var t=$Q(e,"string");return Hi(t)=="symbol"?t:t+""}function $Q(e,t){if(Hi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Hi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var EQ={xAxis:["bottom","top"],yAxis:["left","right"]},CQ={width:"100%",height:"100%"},i2={x:0,y:0};function Hl(e){return e}var TQ=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},MQ=function(t,r,n,a){var i=r.find(function(d){return d&&d.index===n});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var o=i.coordinate,l=a.radius;return D(D(D({},a),xe(a.cx,a.cy,l,o)),{},{angle:o,radius:l})}var c=i.coordinate,u=a.angle;return D(D(D({},a),xe(a.cx,a.cy,c,u)),{},{angle:u,radius:c})}return i2},Wf=function(t,r){var n=r.graphicalItems,a=r.dataStartIndex,i=r.dataEndIndex,o=(n??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(Ki(l),Ki(u)):l},[]);return o.length>0?o:t&&t.length&&W(a)&&W(i)?t.slice(a,i+1):[]};function o2(e){return e==="number"?[0,"auto"]:void 0}var ym=function(t,r,n,a){var i=t.graphicalItems,o=t.tooltipAxis,l=Wf(r,t);return n<0||!i||!i.length||n>=l.length?null:i.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:r;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=f===void 0?l:f;h=Ec(p,o.dataKey,a)}else h=f&&f[n]||l[n];return h?[].concat(Ki(c),[WN(u,h)]):c},[])},F1=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},o=TQ(i,n),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=tU(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=ym(t,r,d,f),p=MQ(n,l,d,i);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},IQ=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,p=DN(d,i);return n.reduce(function(v,b){var x,y=b.type.defaultProps!==void 0?D(D({},b.type.defaultProps),b.props):b.props,m=y.type,g=y.dataKey,S=y.allowDataOverflow,j=y.allowDuplicatedCategory,w=y.scale,_=y.ticks,N=y.includeHidden,P=y[o];if(v[P])return v;var k=Wf(t.data,{graphicalItems:a.filter(function(z){var q,ie=o in z.props?z.props[o]:(q=z.type.defaultProps)===null||q===void 0?void 0:q[o];return ie===P}),dataStartIndex:c,dataEndIndex:u}),T=k.length,C,$,M;sQ(y.domain,S,m)&&(C=Cp(y.domain,null,S),p&&(m==="number"||w!=="auto")&&(M=Yo(k,g,"category")));var A=o2(m);if(!C||C.length===0){var I,B=(I=y.domain)!==null&&I!==void 0?I:A;if(g){if(C=Yo(k,g,m),m==="category"&&p){var L=HT(C);j&&L?($=C,C=xu(0,T)):j||(C=db(B,C,b).reduce(function(z,q){return z.indexOf(q)>=0?z:[].concat(Ki(z),[q])},[]))}else if(m==="category")j?C=C.filter(function(z){return z!==""&&!J(z)}):C=db(B,C,b).reduce(function(z,q){return z.indexOf(q)>=0||q===""||J(q)?z:[].concat(Ki(z),[q])},[]);else if(m==="number"){var R=oU(k,a.filter(function(z){var q,ie,_e=o in z.props?z.props[o]:(q=z.type.defaultProps)===null||q===void 0?void 0:q[o],Me="hide"in z.props?z.props.hide:(ie=z.type.defaultProps)===null||ie===void 0?void 0:ie.hide;return _e===P&&(N||!Me)}),g,i,d);R&&(C=R)}p&&(m==="number"||w!=="auto")&&(M=Yo(k,g,"category"))}else p?C=xu(0,T):l&&l[P]&&l[P].hasStack&&m==="number"?C=h==="expand"?[0,1]:UN(l[P].stackGroups,c,u):C=LN(k,a.filter(function(z){var q=o in z.props?z.props[o]:z.type.defaultProps[o],ie="hide"in z.props?z.props.hide:z.type.defaultProps.hide;return q===P&&(N||!ie)}),m,d,!0);if(m==="number")C=pm(f,C,P,i,_),B&&(C=Cp(B,C,S));else if(m==="category"&&B){var F=B,K=C.every(function(z){return F.indexOf(z)>=0});K&&(C=F)}}return D(D({},v),{},Q({},P,D(D({},y),{},{axisType:i,domain:C,categoricalDomain:M,duplicateDomain:$,originalDomain:(x=y.domain)!==null&&x!==void 0?x:A,isCategorical:p,layout:d})))},{})},LQ=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,h=Wf(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),p=h.length,v=DN(d,i),b=-1;return n.reduce(function(x,y){var m=y.type.defaultProps!==void 0?D(D({},y.type.defaultProps),y.props):y.props,g=m[o],S=o2("number");if(!x[g]){b++;var j;return v?j=xu(0,p):l&&l[g]&&l[g].hasStack?(j=UN(l[g].stackGroups,c,u),j=pm(f,j,g,i)):(j=Cp(S,LN(h,n.filter(function(w){var _,N,P=o in w.props?w.props[o]:(_=w.type.defaultProps)===null||_===void 0?void 0:_[o],k="hide"in w.props?w.props.hide:(N=w.type.defaultProps)===null||N===void 0?void 0:N.hide;return P===g&&!k}),"number",d),a.defaultProps.allowDataOverflow),j=pm(f,j,g,i)),D(D({},x),{},Q({},g,D(D({axisType:i},a.defaultProps),{},{hide:!0,orientation:It(EQ,"".concat(i,".").concat(b%2),null),domain:j,originalDomain:S,isCategorical:v,layout:d})))}return x},{})},DQ=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,o=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.children,f="".concat(a,"Id"),h=qt(d,i),p={};return h&&h.length?p=IQ(t,{axes:h,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(p=LQ(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},RQ=function(t){var r=cn(t),n=Dr(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:B0(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:ou(r,n)}},z1=function(t){var r=t.children,n=t.defaultShowTooltip,a=Et(r,Ii),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},BQ=function(t){return!t||!t.length?!1:t.some(function(r){var n=Br(r&&r.type);return n&&n.indexOf("Bar")>=0})},U1=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"}},FQ=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,l=t.yAxisMap,c=l===void 0?{}:l,u=n.width,d=n.height,f=n.children,h=n.margin||{},p=Et(f,Ii),v=Et(f,li),b=Object.keys(c).reduce(function(j,w){var _=c[w],N=_.orientation;return!_.mirror&&!_.hide?D(D({},j),{},Q({},N,j[N]+_.width)):j},{left:h.left||0,right:h.right||0}),x=Object.keys(o).reduce(function(j,w){var _=o[w],N=_.orientation;return!_.mirror&&!_.hide?D(D({},j),{},Q({},N,It(j,"".concat(N))+_.height)):j},{top:h.top||0,bottom:h.bottom||0}),y=D(D({},x),b),m=y.bottom;p&&(y.bottom+=p.props.height||Ii.defaultProps.height),v&&r&&(y=aU(y,a,n,r));var g=u-y.left-y.right,S=d-y.top-y.bottom;return D(D({brushBottom:m},y),{},{width:Math.max(g,0),height:Math.max(S,0)})},zQ=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},Sg=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(y,m){var g=m.graphicalItems,S=m.stackGroups,j=m.offset,w=m.updateId,_=m.dataStartIndex,N=m.dataEndIndex,P=y.barSize,k=y.layout,T=y.barGap,C=y.barCategoryGap,$=y.maxBarSize,M=U1(k),A=M.numericAxisName,I=M.cateAxisName,B=BQ(g),L=[];return g.forEach(function(R,F){var K=Wf(y.data,{graphicalItems:[R],dataStartIndex:_,dataEndIndex:N}),z=R.type.defaultProps!==void 0?D(D({},R.type.defaultProps),R.props):R.props,q=z.dataKey,ie=z.maxBarSize,_e=z["".concat(A,"Id")],Me=z["".concat(I,"Id")],Bt={},vt=c.reduce(function(Bn,Fn){var Hf=m["".concat(Fn.axisType,"Map")],Ng=z["".concat(Fn.axisType,"Id")];Hf&&Hf[Ng]||Fn.axisType==="zAxis"||ja();var Og=Hf[Ng];return D(D({},Bn),{},Q(Q({},Fn.axisType,Og),"".concat(Fn.axisType,"Ticks"),Dr(Og)))},Bt),V=vt[I],ee=vt["".concat(I,"Ticks")],re=S&&S[_e]&&S[_e].hasStack&&mU(R,S[_e].stackGroups),U=Br(R.type).indexOf("Bar")>=0,Ee=ou(V,ee),oe=[],Fe=B&&rU({barSize:P,stackGroups:S,totalSize:zQ(vt,I)});if(U){var ze,xt,en=J(ie)?$:ie,Ea=(ze=(xt=ou(V,ee,!0))!==null&&xt!==void 0?xt:en)!==null&&ze!==void 0?ze:0;oe=nU({barGap:T,barCategoryGap:C,bandSize:Ea!==Ee?Ea:Ee,sizeList:Fe[Me],maxBarSize:en}),Ea!==Ee&&(oe=oe.map(function(Bn){return D(D({},Bn),{},{position:D(D({},Bn.position),{},{offset:Bn.position.offset-Ea/2})})}))}var fl=R&&R.type&&R.type.getComposedData;fl&&L.push({props:D(D({},fl(D(D({},vt),{},{displayedData:K,props:y,dataKey:q,item:R,bandSize:Ee,barPosition:oe,offset:j,stackedData:re,layout:k,dataStartIndex:_,dataEndIndex:N}))),{},Q(Q(Q({key:R.key||"item-".concat(F)},A,vt[A]),I,vt[I]),"animationId",w)),childIndex:n5(R,y.children),item:R})}),L},p=function(y,m){var g=y.props,S=y.dataStartIndex,j=y.dataEndIndex,w=y.updateId;if(!iv({props:g}))return null;var _=g.children,N=g.layout,P=g.stackOffset,k=g.data,T=g.reverseStackOrder,C=U1(N),$=C.numericAxisName,M=C.cateAxisName,A=qt(_,n),I=hU(k,A,"".concat($,"Id"),"".concat(M,"Id"),P,T),B=c.reduce(function(z,q){var ie="".concat(q.axisType,"Map");return D(D({},z),{},Q({},ie,DQ(g,D(D({},q),{},{graphicalItems:A,stackGroups:q.axisType===$&&I,dataStartIndex:S,dataEndIndex:j}))))},{}),L=FQ(D(D({},B),{},{props:g,graphicalItems:A}),m==null?void 0:m.legendBBox);Object.keys(B).forEach(function(z){B[z]=d(g,B[z],L,z.replace("Map",""),r)});var R=B["".concat(M,"Map")],F=RQ(R),K=h(g,D(D({},B),{},{dataStartIndex:S,dataEndIndex:j,updateId:w,graphicalItems:A,stackGroups:I,offset:L}));return D(D({formattedGraphicalItems:K,graphicalItems:A,offset:L,stackGroups:I},F),B)},v=function(x){function y(m){var g,S,j;return bQ(this,y),j=SQ(this,y,[m]),Q(j,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Q(j,"accessibilityManager",new oQ),Q(j,"handleLegendBBoxUpdate",function(w){if(w){var _=j.state,N=_.dataStartIndex,P=_.dataEndIndex,k=_.updateId;j.setState(D({legendBBox:w},p({props:j.props,dataStartIndex:N,dataEndIndex:P,updateId:k},D(D({},j.state),{},{legendBBox:w}))))}}),Q(j,"handleReceiveSyncEvent",function(w,_,N){if(j.props.syncId===w){if(N===j.eventEmitterSymbol&&typeof j.props.syncMethod!="function")return;j.applySyncEvent(_)}}),Q(j,"handleBrushChange",function(w){var _=w.startIndex,N=w.endIndex;if(_!==j.state.dataStartIndex||N!==j.state.dataEndIndex){var P=j.state.updateId;j.setState(function(){return D({dataStartIndex:_,dataEndIndex:N},p({props:j.props,dataStartIndex:_,dataEndIndex:N,updateId:P},j.state))}),j.triggerSyncEvent({dataStartIndex:_,dataEndIndex:N})}}),Q(j,"handleMouseEnter",function(w){var _=j.getMouseInfo(w);if(_){var N=D(D({},_),{},{isTooltipActive:!0});j.setState(N),j.triggerSyncEvent(N);var P=j.props.onMouseEnter;Z(P)&&P(N,w)}}),Q(j,"triggeredAfterMouseMove",function(w){var _=j.getMouseInfo(w),N=_?D(D({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};j.setState(N),j.triggerSyncEvent(N);var P=j.props.onMouseMove;Z(P)&&P(N,w)}),Q(j,"handleItemMouseEnter",function(w){j.setState(function(){return{isTooltipActive:!0,activeItem:w,activePayload:w.tooltipPayload,activeCoordinate:w.tooltipPosition||{x:w.cx,y:w.cy}}})}),Q(j,"handleItemMouseLeave",function(){j.setState(function(){return{isTooltipActive:!1}})}),Q(j,"handleMouseMove",function(w){w.persist(),j.throttleTriggeredAfterMouseMove(w)}),Q(j,"handleMouseLeave",function(w){j.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};j.setState(_),j.triggerSyncEvent(_);var N=j.props.onMouseLeave;Z(N)&&N(_,w)}),Q(j,"handleOuterEvent",function(w){var _=r5(w),N=It(j.props,"".concat(_));if(_&&Z(N)){var P,k;/.*touch.*/i.test(_)?k=j.getMouseInfo(w.changedTouches[0]):k=j.getMouseInfo(w),N((P=k)!==null&&P!==void 0?P:{},w)}}),Q(j,"handleClick",function(w){var _=j.getMouseInfo(w);if(_){var N=D(D({},_),{},{isTooltipActive:!0});j.setState(N),j.triggerSyncEvent(N);var P=j.props.onClick;Z(P)&&P(N,w)}}),Q(j,"handleMouseDown",function(w){var _=j.props.onMouseDown;if(Z(_)){var N=j.getMouseInfo(w);_(N,w)}}),Q(j,"handleMouseUp",function(w){var _=j.props.onMouseUp;if(Z(_)){var N=j.getMouseInfo(w);_(N,w)}}),Q(j,"handleTouchMove",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&j.throttleTriggeredAfterMouseMove(w.changedTouches[0])}),Q(j,"handleTouchStart",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&j.handleMouseDown(w.changedTouches[0])}),Q(j,"handleTouchEnd",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&j.handleMouseUp(w.changedTouches[0])}),Q(j,"handleDoubleClick",function(w){var _=j.props.onDoubleClick;if(Z(_)){var N=j.getMouseInfo(w);_(N,w)}}),Q(j,"handleContextMenu",function(w){var _=j.props.onContextMenu;if(Z(_)){var N=j.getMouseInfo(w);_(N,w)}}),Q(j,"triggerSyncEvent",function(w){j.props.syncId!==void 0&&Kd.emit(Vd,j.props.syncId,w,j.eventEmitterSymbol)}),Q(j,"applySyncEvent",function(w){var _=j.props,N=_.layout,P=_.syncMethod,k=j.state.updateId,T=w.dataStartIndex,C=w.dataEndIndex;if(w.dataStartIndex!==void 0||w.dataEndIndex!==void 0)j.setState(D({dataStartIndex:T,dataEndIndex:C},p({props:j.props,dataStartIndex:T,dataEndIndex:C,updateId:k},j.state)));else if(w.activeTooltipIndex!==void 0){var $=w.chartX,M=w.chartY,A=w.activeTooltipIndex,I=j.state,B=I.offset,L=I.tooltipTicks;if(!B)return;if(typeof P=="function")A=P(L,w);else if(P==="value"){A=-1;for(var R=0;R<L.length;R++)if(L[R].value===w.activeLabel){A=R;break}}var F=D(D({},B),{},{x:B.left,y:B.top}),K=Math.min($,F.x+F.width),z=Math.min(M,F.y+F.height),q=L[A]&&L[A].value,ie=ym(j.state,j.props.data,A),_e=L[A]?{x:N==="horizontal"?L[A].coordinate:K,y:N==="horizontal"?z:L[A].coordinate}:i2;j.setState(D(D({},w),{},{activeLabel:q,activeCoordinate:_e,activePayload:ie,activeTooltipIndex:A}))}else j.setState(w)}),Q(j,"renderCursor",function(w){var _,N=j.state,P=N.isTooltipActive,k=N.activeCoordinate,T=N.activePayload,C=N.offset,$=N.activeTooltipIndex,M=N.tooltipAxisBandSize,A=j.getTooltipEventType(),I=(_=w.props.active)!==null&&_!==void 0?_:P,B=j.props.layout,L=w.key||"_recharts-cursor";return E.createElement(hQ,{key:L,activeCoordinate:k,activePayload:T,activeTooltipIndex:$,chartName:r,element:w,isActive:I,layout:B,offset:C,tooltipAxisBandSize:M,tooltipEventType:A})}),Q(j,"renderPolarAxis",function(w,_,N){var P=It(w,"type.axisType"),k=It(j.state,"".concat(P,"Map")),T=w.type.defaultProps,C=T!==void 0?D(D({},T),w.props):w.props,$=k&&k[C["".concat(P,"Id")]];return O.cloneElement(w,D(D({},$),{},{className:te(P,$.className),key:w.key||"".concat(_,"-").concat(N),ticks:Dr($,!0)}))}),Q(j,"renderPolarGrid",function(w){var _=w.props,N=_.radialLines,P=_.polarAngles,k=_.polarRadius,T=j.state,C=T.radiusAxisMap,$=T.angleAxisMap,M=cn(C),A=cn($),I=A.cx,B=A.cy,L=A.innerRadius,R=A.outerRadius;return O.cloneElement(w,{polarAngles:Array.isArray(P)?P:Dr(A,!0).map(function(F){return F.coordinate}),polarRadius:Array.isArray(k)?k:Dr(M,!0).map(function(F){return F.coordinate}),cx:I,cy:B,innerRadius:L,outerRadius:R,key:w.key||"polar-grid",radialLines:N})}),Q(j,"renderLegend",function(){var w=j.state.formattedGraphicalItems,_=j.props,N=_.children,P=_.width,k=_.height,T=j.props.margin||{},C=P-(T.left||0)-(T.right||0),$=MN({children:N,formattedGraphicalItems:w,legendWidth:C,legendContent:u});if(!$)return null;var M=$.item,A=R1($,pQ);return O.cloneElement(M,D(D({},A),{},{chartWidth:P,chartHeight:k,margin:T,onBBoxUpdate:j.handleLegendBBoxUpdate}))}),Q(j,"renderTooltip",function(){var w,_=j.props,N=_.children,P=_.accessibilityLayer,k=Et(N,bt);if(!k)return null;var T=j.state,C=T.isTooltipActive,$=T.activeCoordinate,M=T.activePayload,A=T.activeLabel,I=T.offset,B=(w=k.props.active)!==null&&w!==void 0?w:C;return O.cloneElement(k,{viewBox:D(D({},I),{},{x:I.left,y:I.top}),active:B,label:A,payload:B?M:[],coordinate:$,accessibilityLayer:P})}),Q(j,"renderBrush",function(w){var _=j.props,N=_.margin,P=_.data,k=j.state,T=k.offset,C=k.dataStartIndex,$=k.dataEndIndex,M=k.updateId;return O.cloneElement(w,{key:w.key||"_recharts-brush",onChange:Bl(j.handleBrushChange,w.props.onChange),data:P,x:W(w.props.x)?w.props.x:T.left,y:W(w.props.y)?w.props.y:T.top+T.height+T.brushBottom-(N.bottom||0),width:W(w.props.width)?w.props.width:T.width,startIndex:C,endIndex:$,updateId:"brush-".concat(M)})}),Q(j,"renderReferenceElement",function(w,_,N){if(!w)return null;var P=j,k=P.clipPathId,T=j.state,C=T.xAxisMap,$=T.yAxisMap,M=T.offset,A=w.type.defaultProps||{},I=w.props,B=I.xAxisId,L=B===void 0?A.xAxisId:B,R=I.yAxisId,F=R===void 0?A.yAxisId:R;return O.cloneElement(w,{key:w.key||"".concat(_,"-").concat(N),xAxis:C[L],yAxis:$[F],viewBox:{x:M.left,y:M.top,width:M.width,height:M.height},clipPathId:k})}),Q(j,"renderActivePoints",function(w){var _=w.item,N=w.activePoint,P=w.basePoint,k=w.childIndex,T=w.isRange,C=[],$=_.props.key,M=_.item.type.defaultProps!==void 0?D(D({},_.item.type.defaultProps),_.item.props):_.item.props,A=M.activeDot,I=M.dataKey,B=D(D({index:k,dataKey:I,cx:N.x,cy:N.y,r:4,fill:fg(_.item),strokeWidth:2,stroke:"#fff",payload:N.payload,value:N.value},X(A,!1)),Cc(A));return C.push(y.renderActiveDot(A,B,"".concat($,"-activePoint-").concat(k))),P?C.push(y.renderActiveDot(A,D(D({},B),{},{cx:P.x,cy:P.y}),"".concat($,"-basePoint-").concat(k))):T&&C.push(null),C}),Q(j,"renderGraphicChild",function(w,_,N){var P=j.filterFormatItem(w,_,N);if(!P)return null;var k=j.getTooltipEventType(),T=j.state,C=T.isTooltipActive,$=T.tooltipAxis,M=T.activeTooltipIndex,A=T.activeLabel,I=j.props.children,B=Et(I,bt),L=P.props,R=L.points,F=L.isRange,K=L.baseLine,z=P.item.type.defaultProps!==void 0?D(D({},P.item.type.defaultProps),P.item.props):P.item.props,q=z.activeDot,ie=z.hide,_e=z.activeBar,Me=z.activeShape,Bt=!!(!ie&&C&&B&&(q||_e||Me)),vt={};k!=="axis"&&B&&B.props.trigger==="click"?vt={onClick:Bl(j.handleItemMouseEnter,w.props.onClick)}:k!=="axis"&&(vt={onMouseLeave:Bl(j.handleItemMouseLeave,w.props.onMouseLeave),onMouseEnter:Bl(j.handleItemMouseEnter,w.props.onMouseEnter)});var V=O.cloneElement(w,D(D({},P.props),vt));function ee(Fn){return typeof $.dataKey=="function"?$.dataKey(Fn.payload):null}if(Bt)if(M>=0){var re,U;if($.dataKey&&!$.allowDuplicatedCategory){var Ee=typeof $.dataKey=="function"?ee:"payload.".concat($.dataKey.toString());re=Ec(R,Ee,A),U=F&&K&&Ec(K,Ee,A)}else re=R==null?void 0:R[M],U=F&&K&&K[M];if(Me||_e){var oe=w.props.activeIndex!==void 0?w.props.activeIndex:M;return[O.cloneElement(w,D(D(D({},P.props),vt),{},{activeIndex:oe})),null,null]}if(!J(re))return[V].concat(Ki(j.renderActivePoints({item:P,activePoint:re,basePoint:U,childIndex:M,isRange:F})))}else{var Fe,ze=(Fe=j.getItemByXY(j.state.activeCoordinate))!==null&&Fe!==void 0?Fe:{graphicalItem:V},xt=ze.graphicalItem,en=xt.item,Ea=en===void 0?w:en,fl=xt.childIndex,Bn=D(D(D({},P.props),vt),{},{activeIndex:fl});return[O.cloneElement(Ea,Bn),null,null]}return F?[V,null,null]:[V,null]}),Q(j,"renderCustomized",function(w,_,N){return O.cloneElement(w,D(D({key:"recharts-customized-".concat(N)},j.props),j.state))}),Q(j,"renderMap",{CartesianGrid:{handler:Hl,once:!0},ReferenceArea:{handler:j.renderReferenceElement},ReferenceLine:{handler:Hl},ReferenceDot:{handler:j.renderReferenceElement},XAxis:{handler:Hl},YAxis:{handler:Hl},Brush:{handler:j.renderBrush,once:!0},Bar:{handler:j.renderGraphicChild},Line:{handler:j.renderGraphicChild},Area:{handler:j.renderGraphicChild},Radar:{handler:j.renderGraphicChild},RadialBar:{handler:j.renderGraphicChild},Scatter:{handler:j.renderGraphicChild},Pie:{handler:j.renderGraphicChild},Funnel:{handler:j.renderGraphicChild},Tooltip:{handler:j.renderCursor,once:!0},PolarGrid:{handler:j.renderPolarGrid,once:!0},PolarAngleAxis:{handler:j.renderPolarAxis},PolarRadiusAxis:{handler:j.renderPolarAxis},Customized:{handler:j.renderCustomized}}),j.clipPathId="".concat((g=m.id)!==null&&g!==void 0?g:no("recharts"),"-clip"),j.throttleTriggeredAfterMouseMove=M_(j.triggeredAfterMouseMove,(S=m.throttleDelay)!==null&&S!==void 0?S:1e3/60),j.state={},j}return OQ(y,x),wQ(y,[{key:"componentDidMount",value:function(){var g,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(g=this.props.margin.left)!==null&&g!==void 0?g:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var g=this.props,S=g.children,j=g.data,w=g.height,_=g.layout,N=Et(S,bt);if(N){var P=N.props.defaultIndex;if(!(typeof P!="number"||P<0||P>this.state.tooltipTicks.length-1)){var k=this.state.tooltipTicks[P]&&this.state.tooltipTicks[P].value,T=ym(this.state,j,P,k),C=this.state.tooltipTicks[P].coordinate,$=(this.state.offset.top+w)/2,M=_==="horizontal",A=M?{x:C,y:$}:{y:C,x:$},I=this.state.formattedGraphicalItems.find(function(L){var R=L.item;return R.type.name==="Scatter"});I&&(A=D(D({},A),I.props.points[P].tooltipPosition),T=I.props.points[P].tooltipPayload);var B={activeTooltipIndex:P,isTooltipActive:!0,activeLabel:k,activePayload:T,activeCoordinate:A};this.setState(B),this.renderCursor(N),this.accessibilityManager.setIndex(P)}}}},{key:"getSnapshotBeforeUpdate",value:function(g,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==g.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==g.margin){var j,w;this.accessibilityManager.setDetails({offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0}})}return null}},{key:"componentDidUpdate",value:function(g){Gh([Et(g.children,bt)],[Et(this.props.children,bt)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var g=Et(this.props.children,bt);if(g&&typeof g.props.shared=="boolean"){var S=g.props.shared?"axis":"item";return l.indexOf(S)>=0?S:i}return i}},{key:"getMouseInfo",value:function(g){if(!this.container)return null;var S=this.container,j=S.getBoundingClientRect(),w=AB(j),_={chartX:Math.round(g.pageX-w.left),chartY:Math.round(g.pageY-w.top)},N=j.width/S.offsetWidth||1,P=this.inRange(_.chartX,_.chartY,N);if(!P)return null;var k=this.state,T=k.xAxisMap,C=k.yAxisMap,$=this.getTooltipEventType(),M=F1(this.state,this.props.data,this.props.layout,P);if($!=="axis"&&T&&C){var A=cn(T).scale,I=cn(C).scale,B=A&&A.invert?A.invert(_.chartX):null,L=I&&I.invert?I.invert(_.chartY):null;return D(D({},_),{},{xValue:B,yValue:L},M)}return M?D(D({},_),M):null}},{key:"inRange",value:function(g,S){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,w=this.props.layout,_=g/j,N=S/j;if(w==="horizontal"||w==="vertical"){var P=this.state.offset,k=_>=P.left&&_<=P.left+P.width&&N>=P.top&&N<=P.top+P.height;return k?{x:_,y:N}:null}var T=this.state,C=T.angleAxisMap,$=T.radiusAxisMap;if(C&&$){var M=cn(C);return mb({x:_,y:N},M)}return null}},{key:"parseEventsOfWrapper",value:function(){var g=this.props.children,S=this.getTooltipEventType(),j=Et(g,bt),w={};j&&S==="axis"&&(j.props.trigger==="click"?w={onClick:this.handleClick}:w={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 _=Cc(this.props,this.handleOuterEvent);return D(D({},_),w)}},{key:"addListener",value:function(){Kd.on(Vd,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Kd.removeListener(Vd,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(g,S,j){for(var w=this.state.formattedGraphicalItems,_=0,N=w.length;_<N;_++){var P=w[_];if(P.item===g||P.props.key===g.key||S===Br(P.item.type)&&j===P.childIndex)return P}return null}},{key:"renderClipPath",value:function(){var g=this.clipPathId,S=this.state.offset,j=S.left,w=S.top,_=S.height,N=S.width;return E.createElement("defs",null,E.createElement("clipPath",{id:g},E.createElement("rect",{x:j,y:w,height:_,width:N})))}},{key:"getXScales",value:function(){var g=this.state.xAxisMap;return g?Object.entries(g).reduce(function(S,j){var w=D1(j,2),_=w[0],N=w[1];return D(D({},S),{},Q({},_,N.scale))},{}):null}},{key:"getYScales",value:function(){var g=this.state.yAxisMap;return g?Object.entries(g).reduce(function(S,j){var w=D1(j,2),_=w[0],N=w[1];return D(D({},S),{},Q({},_,N.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(g){var S;return(S=this.state.xAxisMap)===null||S===void 0||(S=S[g])===null||S===void 0?void 0:S.scale}},{key:"getYScaleByAxisId",value:function(g){var S;return(S=this.state.yAxisMap)===null||S===void 0||(S=S[g])===null||S===void 0?void 0:S.scale}},{key:"getItemByXY",value:function(g){var S=this.state,j=S.formattedGraphicalItems,w=S.activeItem;if(j&&j.length)for(var _=0,N=j.length;_<N;_++){var P=j[_],k=P.props,T=P.item,C=T.type.defaultProps!==void 0?D(D({},T.type.defaultProps),T.props):T.props,$=Br(T.type);if($==="Bar"){var M=(k.data||[]).find(function(L){return mK(g,L)});if(M)return{graphicalItem:P,payload:M}}else if($==="RadialBar"){var A=(k.data||[]).find(function(L){return mb(g,L)});if(A)return{graphicalItem:P,payload:A}}else if(Lf(P,w)||Df(P,w)||Ks(P,w)){var I=nG({graphicalItem:P,activeTooltipItem:w,itemData:C.data}),B=C.activeIndex===void 0?I:C.activeIndex;return{graphicalItem:D(D({},P),{},{childIndex:B}),payload:Ks(P,w)?C.data[I]:P.props.data[I]}}}return null}},{key:"render",value:function(){var g=this;if(!iv(this))return null;var S=this.props,j=S.children,w=S.className,_=S.width,N=S.height,P=S.style,k=S.compact,T=S.title,C=S.desc,$=R1(S,mQ),M=X($,!1);if(k)return E.createElement(b1,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},E.createElement(qh,ei({},M,{width:_,height:N,title:T,desc:C}),this.renderClipPath(),sv(j,this.renderMap)));if(this.props.accessibilityLayer){var A,I;M.tabIndex=(A=this.props.tabIndex)!==null&&A!==void 0?A:0,M.role=(I=this.props.role)!==null&&I!==void 0?I:"application",M.onKeyDown=function(L){g.accessibilityManager.keyboardEvent(L)},M.onFocus=function(){g.accessibilityManager.focus()}}var B=this.parseEventsOfWrapper();return E.createElement(b1,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},E.createElement("div",ei({className:te("recharts-wrapper",w),style:D({position:"relative",cursor:"default",width:_,height:N},P)},B,{ref:function(R){g.container=R}}),E.createElement(qh,ei({},M,{width:_,height:N,title:T,desc:C,style:CQ}),this.renderClipPath(),sv(j,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(O.Component);Q(v,"displayName",r),Q(v,"defaultProps",D({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Q(v,"getDerivedStateFromProps",function(x,y){var m=x.dataKey,g=x.data,S=x.children,j=x.width,w=x.height,_=x.layout,N=x.stackOffset,P=x.margin,k=y.dataStartIndex,T=y.dataEndIndex;if(y.updateId===void 0){var C=z1(x);return D(D(D({},C),{},{updateId:0},p(D(D({props:x},C),{},{updateId:0}),y)),{},{prevDataKey:m,prevData:g,prevWidth:j,prevHeight:w,prevLayout:_,prevStackOffset:N,prevMargin:P,prevChildren:S})}if(m!==y.prevDataKey||g!==y.prevData||j!==y.prevWidth||w!==y.prevHeight||_!==y.prevLayout||N!==y.prevStackOffset||!si(P,y.prevMargin)){var $=z1(x),M={chartX:y.chartX,chartY:y.chartY,isTooltipActive:y.isTooltipActive},A=D(D({},F1(y,g,_)),{},{updateId:y.updateId+1}),I=D(D(D({},$),M),A);return D(D(D({},I),p(D({props:x},I),y)),{},{prevDataKey:m,prevData:g,prevWidth:j,prevHeight:w,prevLayout:_,prevStackOffset:N,prevMargin:P,prevChildren:S})}if(!Gh(S,y.prevChildren)){var B,L,R,F,K=Et(S,Ii),z=K&&(B=(L=K.props)===null||L===void 0?void 0:L.startIndex)!==null&&B!==void 0?B:k,q=K&&(R=(F=K.props)===null||F===void 0?void 0:F.endIndex)!==null&&R!==void 0?R:T,ie=z!==k||q!==T,_e=!J(g),Me=_e&&!ie?y.updateId:y.updateId+1;return D(D({updateId:Me},p(D(D({props:x},y),{},{updateId:Me,dataStartIndex:z,dataEndIndex:q}),y)),{},{prevChildren:S,dataStartIndex:z,dataEndIndex:q})}return null}),Q(v,"renderActiveDot",function(x,y,m){var g;return O.isValidElement(x)?g=O.cloneElement(x,y):Z(x)?g=x(y):g=E.createElement(Ef,y),E.createElement(ae,{className:"recharts-active-dot",key:m},g)});var b=O.forwardRef(function(y,m){return E.createElement(v,ei({},y,{ref:m}))});return b.displayName=v.displayName,b},s2=Sg({chartName:"BarChart",GraphicalChild:Ln,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Dn},{axisType:"yAxis",AxisComp:Rn}],formatAxisMap:SO}),l2=Sg({chartName:"PieChart",GraphicalChild:Pr,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:If},{axisType:"radiusAxis",AxisComp:Tf}],formatAxisMap:NU,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),c2=Sg({chartName:"AreaChart",GraphicalChild:Jr,axisComponents:[{axisType:"xAxis",AxisComp:Dn},{axisType:"yAxis",AxisComp:Rn}],formatAxisMap:SO});function Kl({cents:e}){const t=Number(e||0),r=(t/100).toFixed(2);return t>0?s.jsxs("span",{className:"text-green-400 font-mono font-bold",children:["+$",r]}):t<0?s.jsxs("span",{className:"text-red-400 font-mono font-bold",children:["-$",Math.abs(t/100).toFixed(2)]}):s.jsx("span",{className:"text-gray-500 font-mono",children:"$0.00"})}function W1({wins:e,losses:t}){const r=e+t;if(!r)return s.jsx("span",{className:"text-gray-500",children:"—"});const n=(e/r*100).toFixed(0);return s.jsxs("span",{className:n>=80?"text-green-400":n>=50?"text-amber-400":"text-red-400",children:[e,"/",r," (",n,"%)"]})}function H1({wins:e,losses:t,pnl:r}){const n=e+t,a=n>0?e/n:0;return a>=.9&&r>0?s.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-bold bg-green-500/20 text-green-400 border border-green-500/30",children:"ADD MORE"}):a>=.65&&r>0?s.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-bold bg-amber-500/20 text-amber-400 border border-amber-500/30",children:"HOLD"}):r<0?s.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-bold bg-red-500/20 text-red-400 border border-red-500/30",children:"REDUCE"}):s.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-bold bg-gray-500/20 text-gray-400 border border-gray-600",children:"WATCH"})}function UQ({opportunities:e}){const t=e||[];if(!t.length)return s.jsxs("div",{className:"card border border-gray-700/50 bg-gradient-to-br from-gray-800/30 to-transparent",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"text-lg",children:"🔍"}),s.jsx("h2",{className:"font-semibold",children:"Best Opportunities Right Now"})]}),s.jsx("p",{className:"text-gray-500 text-sm text-center py-6",children:"No fresh signals — waiting for next pipeline cycle..."})]});const r=[{bg:"from-amber-500/15 to-amber-500/5",border:"border-amber-500/30",medal:"🥇",rank:"bg-amber-500/20 text-amber-400"},{bg:"from-gray-400/10 to-gray-400/5",border:"border-gray-400/30",medal:"🥈",rank:"bg-gray-400/20 text-gray-300"},{bg:"from-orange-700/10 to-orange-700/5",border:"border-orange-700/30",medal:"🥉",rank:"bg-orange-700/20 text-orange-400"}];return s.jsxs("div",{className:"card border border-amber-500/20 bg-gradient-to-br from-amber-500/5 via-transparent to-green-500/5",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("span",{className:"text-lg",children:"🎯"}),s.jsx("h2",{className:"font-semibold",children:"Best Opportunities Right Now"}),s.jsx("span",{className:"ml-auto text-[10px] text-gray-500 uppercase font-medium",children:"Live Signals"})]}),s.jsx("div",{className:"space-y-3",children:t.map((n,a)=>{const i=r[a]||r[2],o=n.hist_trades>0;return s.jsx("div",{className:`rounded-xl p-4 bg-gradient-to-r ${i.bg} border ${i.border}`,children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-2xl mt-1",children:i.medal}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-semibold text-gray-100 hover:text-amber-400 truncate transition",children:n.title})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[s.jsxs("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold ${n.direction==="NO"?"bg-red-500/20 text-red-400 border border-red-500/30":"bg-green-500/20 text-green-400 border border-green-500/30"}`,children:["BUY ",n.direction]}),s.jsxs("span",{className:"text-xs text-gray-400",children:["Edge: ",s.jsxs("span",{className:"text-amber-400 font-bold",children:[n.edge_pct,"%"]})]}),s.jsxs("span",{className:"text-xs text-gray-400",children:["Conf: ",s.jsxs("span",{className:"text-blue-400 font-bold",children:[n.confidence,"%"]})]}),n.price_cents>0&&s.jsxs("span",{className:"text-xs text-gray-400",children:["Price: ",s.jsxs("span",{className:"font-mono text-gray-200",children:[n.price_cents,"¢"]})]}),o&&s.jsxs("span",{className:"text-xs text-gray-400",children:["History: ",s.jsxs("span",{className:`font-bold ${parseFloat(n.hist_wr)>=80?"text-green-400":parseFloat(n.hist_wr)>=50?"text-amber-400":"text-red-400"}`,children:[n.hist_wr,"% WR"]}),s.jsxs("span",{className:"text-gray-500 ml-1",children:["(",n.hist_trades," trades, ",n.hist_pnl/100>=0?"+":"","$",(n.hist_pnl/100).toFixed(0),")"]})]}),!o&&s.jsx("span",{className:"text-[10px] text-gray-600 italic",children:"New market — no history"})]}),s.jsx("p",{className:"text-[11px] text-gray-400 leading-relaxed",children:n.why})]})]})},n.ticker)})})]})}function WQ({topMarkets:e,seedMoney:t,balance:r}){const n=(e||[]).slice(0,3);if(!n.length)return null;const a=n.reduce((u,d)=>u+d.wins/(d.wins+d.losses),0)/n.length*100,i=n.length>0?Math.round(n.reduce((u,d)=>{const f=d.wins/(d.wins+d.losses||1);return u+(f>=.9?95:80)},0)/n.length):95,o=t?t/100:5e4,l=r?r/100:o,c=o>0?(l-o)/o*100:0;return s.jsxs("div",{className:"card border border-green-500/15 bg-gradient-to-br from-green-500/5 via-transparent to-amber-500/5",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("span",{className:"text-lg",children:"⚡"}),s.jsx("h2",{className:"font-semibold",children:"Winning Strategy — Live Flow"})]}),s.jsx("div",{className:"flex items-center justify-between gap-2 mb-5",children:[{icon:"🏦",label:`Start: $${o.toLocaleString()}`,sub:`Now $${l.toLocaleString()} (${c>=0?"+":""}${c.toFixed(1)}%)`,color:"from-cyan-500/20 to-cyan-500/5",border:"border-cyan-500/30",isStart:!0},{icon:"→",isArrow:!0},{icon:"📡",label:"Signal Found",sub:"AI scans 135 markets",color:"from-blue-500/20 to-blue-500/5",border:"border-blue-500/30"},{icon:"→",isArrow:!0},{icon:"🎯",label:`Buy NO at ${i}¢`,sub:"High-prob event",color:"from-amber-500/20 to-amber-500/5",border:"border-amber-500/30"},{icon:"→",isArrow:!0},{icon:"⏱️",label:"Hold 5min–2hr",sub:"TP +3¢ / SL -5¢",color:"from-purple-500/20 to-purple-500/5",border:"border-purple-500/30"},{icon:"→",isArrow:!0},{icon:"💰",label:`Collect ${100-i}¢`,sub:`${a.toFixed(0)}% of the time`,color:"from-green-500/20 to-green-500/5",border:"border-green-500/30"}].map((u,d)=>u.isArrow?s.jsx("div",{className:"text-gray-600 text-lg animate-pulse",children:"→"},d):s.jsxs("div",{className:`flex-1 rounded-xl p-3 bg-gradient-to-b ${u.color} border ${u.border} text-center ${u.isStart?"ring-1 ring-cyan-500/30":""}`,children:[s.jsx("div",{className:"text-2xl mb-1",children:u.icon}),s.jsx("p",{className:`text-xs font-semibold ${u.isStart?"text-cyan-300":"text-gray-200"}`,children:u.label}),s.jsx("p",{className:`text-[10px] ${u.isStart&&c>=0?"text-green-500":u.isStart?"text-red-400":"text-gray-500"}`,children:u.sub})]},d))}),s.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 text-center border border-gray-700",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Cost Per Trade"}),s.jsxs("p",{className:"text-lg font-bold text-amber-400",children:[i,"¢"]}),s.jsx("p",{className:"text-[10px] text-gray-600",children:"buying NO side"})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 text-center border border-gray-700",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Profit on Win"}),s.jsxs("p",{className:"text-lg font-bold text-green-400",children:[100-i,"¢"]}),s.jsx("p",{className:"text-[10px] text-gray-600",children:"per contract"})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 text-center border border-gray-700",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Return Multiple"}),s.jsxs("p",{className:"text-lg font-bold text-green-400",children:[((100-i)/i*100).toFixed(0),"%"]}),s.jsx("p",{className:"text-[10px] text-gray-600",children:"per winning trade"})]})]})]})}function HQ({topMarkets:e,worstMarkets:t,strategies:r}){const n=(e||[]).filter(c=>c.wins/(c.wins+c.losses||1)>=.9&&c.pnl>0),a=(t||[]).filter(c=>c.pnl<-5e3),i=(r||[]).filter(c=>c.pnl<-1e4&&c.win_rate<20).slice(0,3),o=[];n.length>0&&o.push({priority:"HIGH",color:"green",icon:"🚀",title:`Double down on ${n.length} near-certain markets`,detail:n.slice(0,2).map(c=>{var u;return((u=c.title)==null?void 0:u.split("?")[0])||c.ticker}).join(", "),reason:`${n.length} markets have 90%+ win rate — the edge is proven`}),a.length>0&&o.push({priority:"HIGH",color:"red",icon:"🛑",title:`Exit ${a.length} bleeding market(s)`,detail:a.slice(0,2).map(c=>{var u;return((u=c.title)==null?void 0:u.split("?")[0])||c.ticker}).join(", "),reason:`0% win rate, losing $${Math.abs(a.reduce((c,u)=>c+u.pnl,0)/100).toFixed(0)} total`}),i.length>0&&o.push({priority:"MED",color:"amber",icon:"⚙️",title:`Consider disabling ${i.length} strategy(ies)`,detail:i.map(c=>c.name).join(", "),reason:"Sub-20% win rate — these are coin flips minus fees"}),o.push({priority:"INFO",color:"blue",icon:"📊",title:"Keep hyper-trading high-prob NO markets",detail:"The 95¢+ NO strategy is the #1 edge — scale it up",reason:"Compounding small spreads at 99%+ win rate = consistent returns"});const l={green:{bg:"bg-green-500/10",border:"border-green-500/25",text:"text-green-400",badge:"bg-green-500/20"},red:{bg:"bg-red-500/10",border:"border-red-500/25",text:"text-red-400",badge:"bg-red-500/20"},amber:{bg:"bg-amber-500/10",border:"border-amber-500/25",text:"text-amber-400",badge:"bg-amber-500/20"},blue:{bg:"bg-blue-500/10",border:"border-blue-500/25",text:"text-blue-400",badge:"bg-blue-500/20"}};return s.jsxs("div",{className:"card border border-amber-500/15 bg-gradient-to-br from-amber-500/5 to-transparent",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("span",{className:"text-lg",children:"🎯"}),s.jsx("h2",{className:"font-semibold",children:"What To Do Next"})]}),s.jsx("div",{className:"space-y-3",children:o.map((c,u)=>{const d=l[c.color];return s.jsxs("div",{className:`rounded-xl p-3 ${d.bg} border ${d.border} flex gap-3`,children:[s.jsx("span",{className:"text-xl mt-0.5",children:c.icon}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[s.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded ${d.badge} ${d.text} uppercase`,children:c.priority}),s.jsx("span",{className:`text-sm font-semibold ${d.text}`,children:c.title})]}),s.jsx("p",{className:"text-xs text-gray-300",children:c.detail}),s.jsx("p",{className:"text-[10px] text-gray-500 mt-1",children:c.reason})]})]},u)})})]})}function KQ({strategies:e}){const t=[...e||[]].sort((n,a)=>a.pnl-n.pnl).slice(0,10);if(!t.length)return null;Math.max(...t.map(n=>Math.abs(n.pnl)));const r=t.map(n=>({name:n.name,pnl:n.pnl/100,fill:n.pnl>=0?"#22c55e":"#ef4444"}));return s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"text-lg",children:"📈"}),s.jsx("h2",{className:"font-semibold",children:"Strategy P&L — Top 10"})]}),s.jsx(_i,{width:"100%",height:250,children:s.jsxs(s2,{data:r,layout:"vertical",margin:{left:70,right:20},children:[s.jsx(wg,{strokeDasharray:"3 3",stroke:"#1f2937",horizontal:!1}),s.jsx(Dn,{type:"number",stroke:"#6b7280",tickFormatter:n=>`$${n}`}),s.jsx(Rn,{type:"category",dataKey:"name",stroke:"#6b7280",tick:{fontSize:11},width:65}),s.jsx(bt,{contentStyle:{background:"#1f2937",border:"1px solid #374151",borderRadius:8},formatter:n=>[`$${n.toFixed(2)}`,"P&L"]}),s.jsx(Ln,{dataKey:"pnl",radius:[0,4,4,0],children:r.map((n,a)=>s.jsx(va,{fill:n.fill},a))})]})})]})}function VQ({todayWins:e,todayLosses:t}){const r=(e||0)+(t||0);if(!r)return null;const n=(e/r*100).toFixed(1),a=[{name:"Wins",value:e,fill:"#22c55e"},{name:"Losses",value:t,fill:"#ef4444"}];return s.jsxs("div",{className:"card flex flex-col items-center justify-center",children:[s.jsx("h3",{className:"text-xs text-gray-500 uppercase mb-2",children:"Today's Win Rate"}),s.jsxs("div",{className:"relative",style:{width:140,height:140},children:[s.jsx(_i,{width:"100%",height:"100%",children:s.jsx(l2,{children:s.jsx(Pr,{data:a,innerRadius:45,outerRadius:65,paddingAngle:2,dataKey:"value",startAngle:90,endAngle:-270,children:a.map((i,o)=>s.jsx(va,{fill:i.fill},o))})})}),s.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[s.jsxs("span",{className:`text-2xl font-bold ${Number(n)>=50?"text-green-400":"text-red-400"}`,children:[n,"%"]}),s.jsxs("span",{className:"text-[10px] text-gray-500",children:[r.toLocaleString()," trades"]})]})]}),s.jsxs("div",{className:"flex gap-4 mt-2 text-xs",children:[s.jsxs("span",{className:"text-green-400",children:[e==null?void 0:e.toLocaleString()," W"]}),s.jsxs("span",{className:"text-red-400",children:[t==null?void 0:t.toLocaleString()," L"]})]})]})}function GQ(){var d;const[e,t]=O.useState(null),[r,n]=O.useState(!0);O.useEffect(()=>{a();const f=setInterval(a,3e4);return()=>clearInterval(f)},[]);async function a(){try{const f=await Pe("/dashboard");t(f)}catch{}n(!1)}if(r)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})});const i=e||{},o=(i.pnl_history||[]).map((f,h)=>({day:h+1,pnl:f})),l=i.today_trades>0?(i.today_wins/i.today_trades*100).toFixed(1):"0",c=(i.strategies||[]).filter(f=>f.pnl>0).slice(0,5),u=(i.strategies||[]).filter(f=>f.pnl<0).slice(-5).reverse();return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Dashboard"}),s.jsx("p",{className:"text-gray-500 text-sm",children:"Ken event contracts overview"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`badge ${i.env==="prod"?"bg-green":"bg-yellow"}`,children:(i.env||"DEMO").toUpperCase()}),i.safe_mode&&s.jsx("span",{className:"badge bg-yellow",children:"SAFE MODE"})]})]}),s.jsx("div",{className:"grid grid-cols-5 gap-4",children:[{label:"Balance",value:i.balance?`$${(i.balance/100).toLocaleString(void 0,{minimumFractionDigits:2})}`:"—",color:"text-green-400"},{label:"Positions",value:i.position_count??"—",color:"text-amber-400"},{label:"Open Markets",value:i.open_orders??"—",color:"text-blue-400"},{label:"Today P&L",value:i.daily_pnl?`$${(i.daily_pnl/100).toLocaleString(void 0,{minimumFractionDigits:2})}`:"$0.00",color:(i.daily_pnl||0)>=0?"text-green-400":"text-red-400"},{label:"Markets Tracked",value:i.markets_tracked??"—",color:"text-purple-400"}].map(f=>s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-xs text-gray-500 uppercase mb-1",children:f.label}),s.jsx("p",{className:`stat-v ${f.color}`,children:f.value})]},f.label))}),i.seed_money>0&&s.jsxs("div",{className:"card border border-blue-500/20 bg-gradient-to-r from-blue-500/5 via-transparent to-green-500/5",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"text-lg",children:"💰"}),s.jsx("h2",{className:"font-semibold",children:"Capital & Economics"})]}),s.jsxs("div",{className:"grid grid-cols-6 gap-3 text-center",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Seed Money"}),s.jsxs("p",{className:"text-lg font-bold text-blue-400",children:["$",(i.seed_money/100).toLocaleString(void 0,{minimumFractionDigits:0})]}),s.jsxs("p",{className:"text-[10px] text-gray-600",children:[i.num_portfolios," portfolios"]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Current Balance"}),s.jsxs("p",{className:"text-lg font-bold text-green-400",children:["$",(i.balance/100).toLocaleString(void 0,{minimumFractionDigits:0})]}),s.jsx("p",{className:"text-[10px] text-gray-600",children:"all portfolios"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Net P&L"}),s.jsxs("p",{className:`text-lg font-bold ${i.net_pnl_from_seed>=0?"text-green-400":"text-red-400"}`,children:[i.net_pnl_from_seed>=0?"+":"","$",(i.net_pnl_from_seed/100).toLocaleString(void 0,{minimumFractionDigits:0})]}),s.jsxs("p",{className:`text-[10px] ${i.roi_pct>=0?"text-green-500":"text-red-500"}`,children:[i.roi_pct>=0?"+":"",i.roi_pct,"% ROI"]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Capital Deployed"}),s.jsxs("p",{className:"text-lg font-bold text-amber-400",children:["$",(i.total_invested/100).toLocaleString(void 0,{minimumFractionDigits:0})]}),s.jsx("p",{className:"text-[10px] text-gray-600",children:"total traded"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Capital at Risk"}),s.jsxs("p",{className:"text-lg font-bold text-red-400",children:["$",(i.capital_at_risk/100).toLocaleString(void 0,{minimumFractionDigits:0})]}),s.jsx("p",{className:"text-[10px] text-gray-600",children:"open positions"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Daily Budget"}),s.jsxs("p",{className:"text-lg font-bold text-purple-400",children:["$",(i.daily_budget/100).toLocaleString(void 0,{minimumFractionDigits:0})]}),s.jsx("p",{className:"text-[10px] text-gray-600",children:"across strategies"})]})]}),((d=i.daily_economics)==null?void 0:d.length)>0&&s.jsxs("div",{className:"mt-4 pt-3 border-t border-gray-700/50",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase mb-2",children:"Daily Breakdown (Last 7 Days)"}),s.jsx("div",{className:"grid grid-cols-7 gap-1 text-center text-[10px]",children:(i.daily_economics||[]).slice(0,7).reverse().map((f,h)=>{const p=new Date(f.day).toLocaleDateString("en-US",{weekday:"short",month:"numeric",day:"numeric",timeZone:"America/Los_Angeles"});return s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-2 border border-gray-700/50",children:[s.jsx("p",{className:"text-gray-500 font-medium",children:p}),s.jsxs("p",{className:`font-bold font-mono ${f.net_pnl>=0?"text-green-400":"text-red-400"}`,children:[f.net_pnl>=0?"+":"","$",(f.net_pnl/100).toFixed(0)]}),s.jsxs("p",{className:"text-gray-600",children:[f.trades," trades"]}),s.jsxs("p",{className:"text-gray-600",children:[f.wins,"W / ",f.losses,"L"]})]},h)})})]})]}),s.jsx(UQ,{opportunities:i.top_opportunities}),s.jsxs("div",{className:"card border border-amber-500/20 bg-gradient-to-r from-amber-500/5 to-transparent",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"text-lg",children:"📊"}),s.jsx("h2",{className:"font-semibold",children:"Today's Lessons"}),s.jsx("span",{className:"ml-auto text-xs text-gray-500",children:new Date().toLocaleDateString("en-US",{weekday:"long",month:"short",day:"numeric"})})]}),s.jsxs("div",{className:"grid grid-cols-4 gap-4 text-center",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Trades Resolved"}),s.jsx("p",{className:"text-xl font-bold text-amber-400",children:(i.today_trades||0).toLocaleString()})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Wins / Losses"}),s.jsxs("p",{className:"text-xl font-bold",children:[s.jsx("span",{className:"text-green-400",children:i.today_wins||0}),s.jsx("span",{className:"text-gray-600 mx-1",children:"/"}),s.jsx("span",{className:"text-red-400",children:i.today_losses||0})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Win Rate"}),s.jsxs("p",{className:`text-xl font-bold ${Number(l)>=50?"text-green-400":"text-red-400"}`,children:[l,"%"]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Day P&L"}),s.jsxs("p",{className:`text-xl font-bold ${(i.daily_pnl||0)>=0?"text-green-400":"text-red-400"}`,children:[(i.daily_pnl||0)>=0?"+":"","$",((i.daily_pnl||0)/100).toLocaleString(void 0,{minimumFractionDigits:2})]})]})]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsx("div",{className:"col-span-2",children:s.jsx(WQ,{topMarkets:i.top_markets,seedMoney:i.seed_money,balance:i.balance})}),s.jsx(VQ,{todayWins:i.today_wins,todayLosses:i.today_losses})]}),s.jsx(HQ,{topMarkets:i.top_markets,worstMarkets:i.worst_markets,strategies:i.strategies}),(i.top_markets||[]).length>0&&s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"text-lg",children:"🏆"}),s.jsx("h2",{className:"font-semibold",children:"Top Markets — Money Makers"})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"Market"}),s.jsx("th",{className:"text-right",children:"Trades"}),s.jsx("th",{className:"text-right",children:"Wins"}),s.jsx("th",{className:"text-right",children:"P&L"}),s.jsx("th",{children:"Edge"}),s.jsx("th",{children:"Signal"})]})}),s.jsx("tbody",{children:(i.top_markets||[]).map((f,h)=>{var p;return s.jsxs("tr",{children:[s.jsxs("td",{className:"max-w-[300px]",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Da,{to:`/positions?market=${encodeURIComponent(f.ticker)}`,className:"text-sm text-gray-200 hover:text-amber-400 transition truncate block",children:f.title}),s.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent(((p=f.title)==null?void 0:p.split("?")[0])||f.ticker)}`,target:"_blank",rel:"noopener noreferrer",className:"text-gray-600 hover:text-amber-400 flex-shrink-0",title:"Search on Kalshi",children:"↗"})]}),s.jsx("span",{className:"text-[10px] font-mono text-gray-600",children:f.ticker})]}),s.jsx("td",{className:"text-right font-mono text-sm text-gray-400",children:f.trades}),s.jsx("td",{className:"text-right text-sm",children:s.jsx(W1,{wins:f.wins,losses:f.losses})}),s.jsx("td",{className:"text-right text-sm",children:s.jsx(Kl,{cents:f.pnl})}),s.jsx("td",{className:"text-xs text-gray-400 whitespace-nowrap",children:f.edge}),s.jsx("td",{className:"text-center",children:s.jsx(H1,{wins:f.wins,losses:f.losses,pnl:f.pnl})})]},h)})})]})})]}),(i.worst_markets||[]).length>0&&s.jsxs("div",{className:"card border border-red-500/10",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"text-lg",children:"⚠️"}),s.jsx("h2",{className:"font-semibold text-red-400",children:"Bleeding Markets — Consider Exiting"})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"Market"}),s.jsx("th",{className:"text-right",children:"Trades"}),s.jsx("th",{className:"text-right",children:"Wins"}),s.jsx("th",{className:"text-right",children:"P&L"}),s.jsx("th",{children:"Edge"}),s.jsx("th",{children:"Signal"})]})}),s.jsx("tbody",{children:(i.worst_markets||[]).map((f,h)=>{var p;return s.jsxs("tr",{children:[s.jsxs("td",{className:"max-w-[300px]",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Da,{to:`/positions?market=${encodeURIComponent(f.ticker)}`,className:"text-sm text-gray-200 hover:text-red-400 transition truncate block",children:f.title}),s.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent(((p=f.title)==null?void 0:p.split("?")[0])||f.ticker)}`,target:"_blank",rel:"noopener noreferrer",className:"text-gray-600 hover:text-red-400 flex-shrink-0",title:"Search on Kalshi",children:"↗"})]}),s.jsx("span",{className:"text-[10px] font-mono text-gray-600",children:f.ticker})]}),s.jsx("td",{className:"text-right font-mono text-sm text-gray-400",children:f.trades}),s.jsx("td",{className:"text-right text-sm",children:s.jsx(W1,{wins:f.wins,losses:f.losses})}),s.jsx("td",{className:"text-right text-sm",children:s.jsx(Kl,{cents:f.pnl})}),s.jsx("td",{className:"text-xs text-gray-400 whitespace-nowrap",children:f.edge}),s.jsx("td",{className:"text-center",children:s.jsx(H1,{wins:f.wins,losses:f.losses,pnl:f.pnl})})]},h)})})]})})]}),o.length>0&&s.jsxs("div",{className:"card",children:[s.jsx("h2",{className:"font-semibold mb-3",children:"P&L History (Daily)"}),s.jsx(_i,{width:"100%",height:200,children:s.jsxs(c2,{data:o,children:[s.jsx(wg,{strokeDasharray:"3 3",stroke:"#1f2937"}),s.jsx(Dn,{dataKey:"day",stroke:"#6b7280"}),s.jsx(Rn,{stroke:"#6b7280",tickFormatter:f=>`$${f}`}),s.jsx(bt,{contentStyle:{background:"#1f2937",border:"1px solid #374151",borderRadius:8}}),s.jsx(Jr,{type:"monotone",dataKey:"pnl",stroke:"#f59e0b",fill:"#f59e0b",fillOpacity:.1})]})})]}),s.jsx(KQ,{strategies:i.strategies}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"text-lg",children:"🥇"}),s.jsx("h2",{className:"font-semibold",children:"Top Strategies"})]}),s.jsxs("div",{className:"space-y-2",children:[c.map((f,h)=>s.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-gray-800 last:border-0",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-sm font-medium text-gray-200",children:f.name}),s.jsx("span",{className:"ml-2 text-[10px] text-gray-600",children:f.strategy})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("span",{className:"text-xs text-gray-500",children:[f.win_rate,"% WR"]}),s.jsx(Kl,{cents:f.pnl})]})]},h)),c.length===0&&s.jsx("p",{className:"text-gray-600 text-sm text-center py-4",children:"No profitable strategies yet"})]})]}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"text-lg",children:"📉"}),s.jsx("h2",{className:"font-semibold",children:"Losing Strategies"})]}),s.jsxs("div",{className:"space-y-2",children:[u.map((f,h)=>s.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-gray-800 last:border-0",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-sm font-medium text-gray-300",children:f.name}),s.jsx("span",{className:"ml-2 text-[10px] text-gray-600",children:f.strategy})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("span",{className:"text-xs text-gray-500",children:[f.win_rate,"% WR"]}),s.jsx(Kl,{cents:f.pnl})]})]},h)),u.length===0&&s.jsx("p",{className:"text-gray-600 text-sm text-center py-4",children:"No losing strategies"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"card",children:[s.jsx("h2",{className:"font-semibold mb-3",children:"Recent Fills"}),(i.recent_fills||[]).length>0?s.jsx("div",{className:"space-y-2",children:(i.recent_fills||[]).slice(0,5).map((f,h)=>{var p;return s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-mono text-xs text-gray-400",children:f.ticker}),s.jsx("span",{className:`ml-2 badge ${f.side==="yes"?"bg-green":"bg-red"}`,children:(p=f.side)==null?void 0:p.toUpperCase()})]}),s.jsxs("span",{className:"font-mono text-gray-300",children:[f.count,"@",f.yes_price,"c"]})]},h)})}):s.jsx("p",{className:"text-gray-600 text-sm text-center py-6",children:"No recent fills"})]}),s.jsxs("div",{className:"card",children:[s.jsx("h2",{className:"font-semibold mb-3",children:"Quick Actions"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Da,{to:"/markets",className:"flex items-center gap-3 p-3 rounded-lg bg-gray-800/30 hover:bg-gray-800/60 transition",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center",children:s.jsx("svg",{className:"w-4 h-4 text-amber-400",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"})})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Browse Markets"}),s.jsx("p",{className:"text-xs text-gray-500",children:"Find weather contracts"})]})]}),s.jsxs(Da,{to:"/positions",className:"flex items-center gap-3 p-3 rounded-lg bg-gray-800/30 hover:bg-gray-800/60 transition",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-green-500/10 flex items-center justify-center",children:s.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"View Positions"}),s.jsx("p",{className:"text-xs text-gray-500",children:"Current portfolio"})]})]}),s.jsxs(Da,{to:"/settings",className:"flex items-center gap-3 p-3 rounded-lg bg-gray-800/30 hover:bg-gray-800/60 transition",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-blue-500/10 flex items-center justify-center",children:s.jsxs("svg",{className:"w-4 h-4 text-blue-400",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:[s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Scan Config"}),s.jsx("p",{className:"text-xs text-gray-500",children:"Intervals & risk params"})]})]})]})]})]})]})}function YQ({m:e,onOrderbook:t}){const[r,n]=O.useState(null),[a,i]=O.useState(!1),[o,l]=O.useState(!1);async function c(){if(a){i(!1);return}i(!0),l(!0);try{const u=await pe("/kalshi",{action:"get_orderbook",ticker:e.ticker});u.success&&n(u.orderbook)}catch{}l(!1)}return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"bg-gray-800/20",children:[s.jsx("td",{className:"pl-8 max-w-[250px]",children:s.jsx("span",{className:"truncate block text-sm",children:e.title||e.subtitle||e.ticker})}),s.jsx("td",{className:"font-mono text-xs",children:s.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((e.ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"text-amber-400 hover:text-amber-300 hover:underline transition",children:e.ticker})}),s.jsxs("td",{className:"font-mono text-green-400",children:[e.yes_bid??"—","¢"]}),s.jsxs("td",{className:"font-mono text-red-400",children:[e.yes_ask??"—","¢"]}),s.jsx("td",{className:"font-mono text-gray-400",children:(e.volume||0).toLocaleString()}),s.jsx("td",{className:"font-mono text-gray-400",children:e.open_interest?e.open_interest.toLocaleString():"—"}),s.jsx("td",{children:s.jsx("button",{onClick:c,className:`text-xs transition ${a?"text-amber-300":"text-gray-500 hover:text-amber-400"}`,children:a?"▾ Book":"▸ Book"})})]}),a&&s.jsx("tr",{className:"bg-gray-800/10",children:s.jsx("td",{colSpan:7,className:"p-3",children:o?s.jsx("div",{className:"flex items-center justify-center h-16",children:s.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-amber-500 border-t-transparent rounded-full"})}):r?s.jsxs("div",{className:"grid grid-cols-2 gap-4 max-w-xl",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-[10px] text-green-400 uppercase tracking-wider mb-1 font-semibold",children:"YES Bids"}),s.jsxs("div",{className:"space-y-0.5",children:[(r.yes||[]).slice(0,8).map((u,d)=>s.jsxs("div",{className:"flex justify-between text-xs px-2 py-0.5 rounded relative overflow-hidden",children:[s.jsx("div",{className:"absolute inset-0 bg-green-500/10",style:{width:`${Math.min((u[1]||0)*2,100)}%`}}),s.jsxs("span",{className:"font-mono text-green-400 relative z-10",children:[u[0],"¢"]}),s.jsx("span",{className:"font-mono text-gray-500 relative z-10",children:u[1]})]},d)),(!r.yes||r.yes.length===0)&&s.jsx("div",{className:"text-[10px] text-gray-600 text-center py-2",children:"Empty"})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-[10px] text-red-400 uppercase tracking-wider mb-1 font-semibold",children:"NO Bids"}),s.jsxs("div",{className:"space-y-0.5",children:[(r.no||[]).slice(0,8).map((u,d)=>s.jsxs("div",{className:"flex justify-between text-xs px-2 py-0.5 rounded relative overflow-hidden",children:[s.jsx("div",{className:"absolute inset-0 bg-red-500/10",style:{width:`${Math.min((u[1]||0)*2,100)}%`}}),s.jsxs("span",{className:"font-mono text-red-400 relative z-10",children:[u[0],"¢"]}),s.jsx("span",{className:"font-mono text-gray-500 relative z-10",children:u[1]})]},d)),(!r.no||r.no.length===0)&&s.jsx("div",{className:"text-[10px] text-gray-600 text-center py-2",children:"Empty"})]})]})]}):s.jsx("div",{className:"text-xs text-gray-600 text-center",children:"No orderbook data"})})})]})}function qQ({e}){const[t,r]=O.useState(!1),[n,a]=O.useState([]),[i,o]=O.useState(!1);async function l(){if(t){r(!1);return}if(r(!0),!(n.length>0)){o(!0);try{const c=await pe("/kalshi",{action:"get_markets",params:{event_ticker:e.event_ticker}});a(c.markets||[])}catch{}o(!1)}}return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:`cursor-pointer transition ${t?"bg-gray-800/40":"hover:bg-gray-800/20"}`,onClick:l,children:[s.jsx("td",{className:"max-w-[300px]",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`text-gray-500 text-xs transition-transform ${t?"rotate-90":""}`,children:"▶"}),s.jsx("span",{className:"truncate block font-medium",children:e.title})]})}),s.jsx("td",{children:s.jsx("span",{className:"badge bg-orange",children:e.category||"—"})}),s.jsx("td",{className:"font-mono text-xs",children:s.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((e.event_ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"text-amber-400 hover:text-amber-300 hover:underline transition",onClick:c=>c.stopPropagation(),children:e.event_ticker})}),s.jsx("td",{className:"text-sm",children:e.mutually_exclusive?"ME":"—"}),s.jsx("td",{className:"text-xs text-gray-500",onClick:c=>c.stopPropagation(),children:t?s.jsxs("span",{className:"text-amber-400",children:[n.length||"..."," contracts"]}):s.jsx("span",{className:"text-gray-500 hover:text-amber-400 transition",children:"View Contracts"})})]}),t&&s.jsx("tr",{children:s.jsx("td",{colSpan:5,className:"p-0",children:s.jsx("div",{className:"border-l-2 border-amber-500/30 ml-4 bg-gray-900/40",children:i?s.jsx("div",{className:"flex items-center justify-center py-6",children:s.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-amber-500 border-t-transparent rounded-full"})}):n.length===0?s.jsx("div",{className:"text-center text-gray-600 text-xs py-4",children:"No contracts found"}):s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"text-[10px] text-gray-500 uppercase",children:[s.jsx("th",{className:"pl-8 text-left py-1",children:"Contract"}),s.jsx("th",{className:"text-left py-1",children:"Ticker"}),s.jsx("th",{className:"text-left py-1",children:"Yes Bid"}),s.jsx("th",{className:"text-left py-1",children:"Yes Ask"}),s.jsx("th",{className:"text-left py-1",children:"Volume"}),s.jsx("th",{className:"text-left py-1",children:"Open Int."}),s.jsx("th",{className:"text-left py-1",children:"Book"})]})}),s.jsx("tbody",{children:n.map(c=>s.jsx(YQ,{m:c},c.ticker))})]})})})})]})}function XQ(){const[e,t]=O.useState([]),[r,n]=O.useState(!0),[a,i]=O.useState("");O.useEffect(()=>{o()},[]);async function o(){n(!0);try{const c=await pe("/kalshi",{action:"get_events",params:{status:"open",limit:100}});t(c.events||[])}catch{}n(!1)}const l=e.filter(c=>!a||(c.title||"").toLowerCase().includes(a.toLowerCase())||(c.category||"").toLowerCase().includes(a.toLowerCase()));return r?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Markets"}),s.jsxs("p",{className:"text-gray-500 text-sm",children:[e.length," events loaded"]})]}),s.jsx("button",{onClick:o,className:"btn btn-o text-sm",children:"Refresh"})]}),s.jsx("input",{type:"text",value:a,onChange:c=>i(c.target.value),placeholder:"Filter by name or category...",className:"w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none"}),s.jsx("div",{className:"card overflow-x-auto",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Event"}),s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Markets"}),s.jsx("th",{children:"Action"})]})}),s.jsx("tbody",{children:l.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:5,className:"text-center text-gray-500 py-8",children:"No events found"})}):l.map(c=>s.jsx(qQ,{e:c},c.event_ticker))})]})})]})}const Ar=e=>`$${(e/100).toFixed(2)}`,pr=e=>{const t=e/100;return`${t>=0?"+":""}$${t.toFixed(2)}`},La=e=>e>=0?"text-green-400":"text-red-400",Hn=e=>e==="BUY_YES"?"YES":"NO",Kn=e=>e==="BUY_YES"?"bg-green":"bg-red",$o=e=>`https://kalshi.com/search?query=${encodeURIComponent((e||"").split("-")[0])}`,K1=e=>{if(!e)return"";const t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`};function QQ(){var C;const[e,t]=O.useState([]),[r,n]=O.useState([]),[a,i]=O.useState({}),[o,l]=O.useState(!0),[c,u]=O.useState(null),[d,f]=O.useState(null),[h,p]=O.useState({}),[v,b]=O.useState(null),[x,y]=O.useState("grouped"),[m,g]=O.useState("cost"),S=O.useCallback(async()=>{try{const $=await Pe("/positions");$.success&&(t($.positions||[]),n($.grouped||[]),i($.summary||{}))}catch{}l(!1)},[]);O.useEffect(()=>{S();const $=setInterval(S,3e4);return()=>clearInterval($)},[S]);async function j($,M){const A=`${$}_${M}`;if(!h[A]){b(A);try{const I=await pe("/positions/trades",{ticker:$,direction:M,limit:50});I.success&&p(B=>({...B,[A]:I.trades||[]}))}catch{}b(null)}}function w($){u(M=>M===$?null:$),f(null)}function _($,M){const A=`${$}_${M}`;d===A?f(null):(f(A),j($,M))}const N=[...e].sort(($,M)=>m==="pnl"?M.realized_pnl_cents-$.realized_pnl_cents:m==="contracts"?M.open_contracts-$.open_contracts:M.open_cost_cents-$.open_cost_cents),P=e.filter($=>$.realized_pnl_cents>0).sort(($,M)=>M.realized_pnl_cents-$.realized_pnl_cents),k=e.filter($=>$.realized_pnl_cents<0).sort(($,M)=>$.realized_pnl_cents-M.realized_pnl_cents),T=e.filter($=>$.realized_pnl_cents===0);return o?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Positions"}),s.jsxs("p",{className:"text-gray-500 text-sm",children:[a.positionCount||0," active positions • ",((C=a.totalTrades)==null?void 0:C.toLocaleString())||0," total trades"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex bg-gray-800 rounded-lg p-0.5",children:[["grouped","Grouped"],["flat","All"],["pnl","P&L"]].map(([$,M])=>s.jsx("button",{onClick:()=>y($),className:`px-3 py-1 text-xs font-semibold rounded-md transition ${x===$?"bg-amber-500 text-black":"text-gray-400 hover:text-gray-200"}`,children:M},$))}),s.jsx("button",{onClick:S,className:"btn btn-o text-sm",children:"Refresh"})]})]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-xs text-gray-500 uppercase mb-1",children:"Positions"}),s.jsx("p",{className:"stat-v text-amber-400",children:a.positionCount||0})]}),s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-xs text-gray-500 uppercase mb-1",children:"Total Cost"}),s.jsx("p",{className:"stat-v text-gray-300",children:Ar(a.totalCost||0)})]}),s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-xs text-gray-500 uppercase mb-1",children:"Realized P&L"}),s.jsx("p",{className:`stat-v ${La(a.totalPnl||0)}`,children:pr(a.totalPnl||0)})]}),s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-xs text-gray-500 uppercase mb-1",children:"Contracts"}),s.jsx("p",{className:"stat-v text-blue-400",children:(a.totalContracts||0).toLocaleString()})]}),s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-xs text-gray-500 uppercase mb-1",children:"Win Rate"}),s.jsx("p",{className:"stat-v text-green-400",children:e.length>0?`${Math.round(P.length/(P.length+k.length)*100)}%`:"—"})]})]}),a.totalPnl!==0&&s.jsxs("div",{className:"card p-3",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs mb-2",children:[s.jsxs("span",{className:"text-green-400 font-semibold",children:[P.length," winners"]}),s.jsxs("span",{className:"text-gray-500",children:[T.length," flat"]}),s.jsxs("span",{className:"text-red-400 font-semibold",children:[k.length," losers"]})]}),s.jsx("div",{className:"flex h-3 rounded-full overflow-hidden bg-gray-800",children:(()=>{const $=P.reduce((A,I)=>A+I.realized_pnl_cents,0)+Math.abs(k.reduce((A,I)=>A+I.realized_pnl_cents,0));if(!$)return null;const M=P.reduce((A,I)=>A+I.realized_pnl_cents,0)/$*100;return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"bg-green-500 transition-all",style:{width:`${M}%`}}),s.jsx("div",{className:"bg-red-500 transition-all",style:{width:`${100-M}%`}})]})})()})]}),x==="grouped"&&s.jsx("div",{className:"space-y-3",children:r.map($=>{const M=c===$.event;return s.jsxs("div",{className:"card p-0 overflow-hidden",children:[s.jsxs("button",{onClick:()=>w($.event),className:"w-full flex items-center gap-3 p-4 hover:bg-gray-800/50 transition text-left",children:[s.jsx("span",{className:`text-xs transform transition ${M?"rotate-90":""}`,children:"▶"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-mono text-amber-400 text-sm font-bold",children:$.event}),s.jsx("span",{className:"badge bg-yellow",children:$.positions.length})]}),s.jsx("p",{className:"text-xs text-gray-500 truncate mt-0.5",children:$.title})]}),s.jsxs("div",{className:"flex items-center gap-6 text-right flex-shrink-0",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-gray-500",children:"Cost"}),s.jsx("p",{className:"font-mono text-sm text-gray-300",children:Ar($.totalCost)})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-gray-500",children:"Contracts"}),s.jsx("p",{className:"font-mono text-sm text-blue-400",children:$.totalContracts.toLocaleString()})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-gray-500",children:"Realized P&L"}),s.jsx("p",{className:`font-mono text-sm font-bold ${La($.totalPnl)}`,children:pr($.totalPnl)})]})]})]}),M&&s.jsx("div",{className:"border-t border-gray-800",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{}),s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Contracts"}),s.jsx("th",{children:"Avg Entry"}),s.jsx("th",{children:"Cost"}),s.jsx("th",{children:"Realized P&L"}),s.jsx("th",{children:"Trades"}),s.jsx("th",{children:"Last Trade"})]})}),s.jsx("tbody",{children:$.positions.map(A=>{var F,K;const I=`${A.ticker}_${A.direction}`,B=d===I,L=h[I]||[],R=v===I;return s.jsxs(E.Fragment,{children:[s.jsxs("tr",{className:"cursor-pointer",onClick:()=>_(A.ticker,A.direction),children:[s.jsx("td",{className:"w-6",children:s.jsx("span",{className:`text-xs transform transition inline-block ${B?"rotate-90":""}`,children:"▶"})}),s.jsx("td",{children:s.jsx("a",{href:$o(A.ticker),target:"_blank",rel:"noopener noreferrer",className:"font-mono text-sm text-amber-400 hover:text-amber-300 hover:underline",onClick:z=>z.stopPropagation(),children:A.ticker})}),s.jsx("td",{children:s.jsx("span",{className:`badge ${Kn(A.direction)}`,children:Hn(A.direction)})}),s.jsx("td",{className:"font-mono",children:(F=A.open_contracts)==null?void 0:F.toLocaleString()}),s.jsxs("td",{className:"font-mono text-gray-400",children:[A.avg_entry_price,"¢"]}),s.jsx("td",{className:"font-mono text-gray-300",children:Ar(A.open_cost_cents)}),s.jsx("td",{className:`font-mono font-bold ${La(A.realized_pnl_cents)}`,children:pr(A.realized_pnl_cents)}),s.jsx("td",{className:"font-mono text-gray-500",children:(K=A.total_trades)==null?void 0:K.toLocaleString()}),s.jsx("td",{className:"text-xs text-gray-500",children:K1(A.last_trade_at)})]}),B&&s.jsx("tr",{children:s.jsx("td",{colSpan:9,className:"p-0",children:s.jsxs("div",{className:"bg-gray-900/50 border-y border-gray-800 p-3",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("span",{className:"text-xs font-bold text-gray-400 uppercase",children:["Trade History — ",A.ticker]}),s.jsxs("div",{className:"flex gap-3 text-xs text-gray-500",children:[s.jsxs("span",{children:["Open: ",s.jsx("b",{className:"text-blue-400",children:A.open_trades})]}),s.jsxs("span",{children:["Closed: ",s.jsx("b",{className:"text-gray-400",children:A.closed_trades})]}),s.jsxs("span",{children:["Entry Range: ",s.jsxs("b",{className:"text-amber-400",children:[A.min_entry,"¢ – ",A.max_entry,"¢"]})]}),s.jsxs("span",{children:["First: ",s.jsx("b",{children:new Date(A.first_trade_at).toLocaleDateString()})]})]})]}),R?s.jsx("div",{className:"flex justify-center py-4",children:s.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-amber-500 border-t-transparent rounded-full"})}):L.length>0?s.jsx("div",{className:"overflow-x-auto max-h-48 overflow-y-auto",children:s.jsxs("table",{className:"text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-xs",children:"Time"}),s.jsx("th",{className:"text-xs",children:"Direction"}),s.jsx("th",{className:"text-xs",children:"Contracts"}),s.jsx("th",{className:"text-xs",children:"Entry Price"}),s.jsx("th",{className:"text-xs",children:"Cost"}),s.jsx("th",{className:"text-xs",children:"P&L"}),s.jsx("th",{className:"text-xs",children:"Status"})]})}),s.jsx("tbody",{children:L.map((z,q)=>s.jsxs("tr",{className:"hover:bg-gray-800/30",children:[s.jsx("td",{className:"font-mono text-gray-500",children:new Date(z.created_at).toLocaleString()}),s.jsx("td",{children:s.jsx("span",{className:`badge ${Kn(z.direction)}`,children:Hn(z.direction)})}),s.jsx("td",{className:"font-mono",children:z.contracts}),s.jsxs("td",{className:"font-mono text-amber-400",children:[z.entry_price_cents,"¢"]}),s.jsx("td",{className:"font-mono text-gray-400",children:Ar(z.cost_cents||0)}),s.jsx("td",{className:`font-mono ${La(z.pnl_cents||0)}`,children:z.pnl_cents!=null?pr(z.pnl_cents):"—"}),s.jsx("td",{children:s.jsx("span",{className:`badge ${z.status==="open"?"bg-blue":z.status==="closed"?"bg-green":"bg-yellow"}`,children:z.status})})]},q))})]})}):s.jsx("p",{className:"text-center text-gray-600 py-3 text-xs",children:"No trade details available"})]})})})]},I)})})]})})]},$.event)})}),x==="flat"&&s.jsxs("div",{className:"card overflow-x-auto p-0",children:[s.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-gray-800",children:[s.jsx("span",{className:"text-xs text-gray-500",children:"Sort by:"}),[["cost","Cost"],["pnl","P&L"],["contracts","Contracts"]].map(([$,M])=>s.jsx("button",{onClick:()=>g($),className:`text-xs font-semibold px-2 py-1 rounded ${m===$?"bg-amber-500/20 text-amber-400":"text-gray-500 hover:text-gray-300"}`,children:M},$))]}),s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"#"}),s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Market"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Contracts"}),s.jsx("th",{children:"Avg Entry"}),s.jsx("th",{children:"Cost"}),s.jsx("th",{children:"Realized P&L"}),s.jsx("th",{children:"Trades"}),s.jsx("th",{children:"Last Trade"})]})}),s.jsx("tbody",{children:N.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:10,className:"text-center text-gray-500 py-8",children:"No open positions"})}):N.map(($,M)=>{var R,F;const A=`${$.ticker}_${$.direction}`,I=d===A,B=h[A]||[],L=v===A;return s.jsxs(E.Fragment,{children:[s.jsxs("tr",{className:"cursor-pointer",onClick:()=>_($.ticker,$.direction),children:[s.jsx("td",{className:"text-gray-500",children:M+1}),s.jsx("td",{children:s.jsx("a",{href:$o($.ticker),target:"_blank",rel:"noopener noreferrer",className:"font-mono text-sm text-amber-400 hover:text-amber-300 hover:underline",onClick:K=>K.stopPropagation(),children:$.ticker})}),s.jsx("td",{className:"text-xs text-gray-400 max-w-48 truncate",children:$.title}),s.jsx("td",{children:s.jsx("span",{className:`badge ${Kn($.direction)}`,children:Hn($.direction)})}),s.jsx("td",{className:"font-mono",children:(R=$.open_contracts)==null?void 0:R.toLocaleString()}),s.jsxs("td",{className:"font-mono text-gray-400",children:[$.avg_entry_price,"¢"]}),s.jsx("td",{className:"font-mono text-gray-300",children:Ar($.open_cost_cents)}),s.jsx("td",{className:`font-mono font-bold ${La($.realized_pnl_cents)}`,children:pr($.realized_pnl_cents)}),s.jsx("td",{className:"font-mono text-gray-500",children:(F=$.total_trades)==null?void 0:F.toLocaleString()}),s.jsx("td",{className:"text-xs text-gray-500",children:K1($.last_trade_at)})]}),I&&s.jsx("tr",{children:s.jsx("td",{colSpan:10,className:"p-0",children:s.jsxs("div",{className:"bg-gray-900/50 border-y border-gray-800 p-3",children:[s.jsxs("div",{className:"flex items-center gap-4 mb-2 text-xs text-gray-500",children:[s.jsxs("span",{children:["Open: ",s.jsx("b",{className:"text-blue-400",children:$.open_trades})]}),s.jsxs("span",{children:["Closed: ",s.jsx("b",{className:"text-gray-400",children:$.closed_trades})]}),s.jsxs("span",{children:["Entry Range: ",s.jsxs("b",{className:"text-amber-400",children:[$.min_entry,"¢–",$.max_entry,"¢"]})]})]}),L?s.jsx("div",{className:"flex justify-center py-4",children:s.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-amber-500 border-t-transparent rounded-full"})}):B.length>0?s.jsx("div",{className:"overflow-auto max-h-48",children:s.jsxs("table",{className:"text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Time"}),s.jsx("th",{children:"Dir"}),s.jsx("th",{children:"Qty"}),s.jsx("th",{children:"Entry"}),s.jsx("th",{children:"Cost"}),s.jsx("th",{children:"P&L"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:B.map((K,z)=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-mono text-gray-500",children:new Date(K.created_at).toLocaleString()}),s.jsx("td",{children:s.jsx("span",{className:`badge ${Kn(K.direction)}`,children:Hn(K.direction)})}),s.jsx("td",{className:"font-mono",children:K.contracts}),s.jsxs("td",{className:"font-mono text-amber-400",children:[K.entry_price_cents,"¢"]}),s.jsx("td",{className:"font-mono text-gray-400",children:Ar(K.cost_cents||0)}),s.jsx("td",{className:`font-mono ${La(K.pnl_cents||0)}`,children:K.pnl_cents!=null?pr(K.pnl_cents):"—"}),s.jsx("td",{children:s.jsx("span",{className:`badge ${K.status==="open"?"bg-blue":"bg-green"}`,children:K.status})})]},z))})]})}):s.jsx("p",{className:"text-center text-gray-600 py-2 text-xs",children:"No trade details"})]})})})]},A)})})]})]}),x==="pnl"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"card p-0 overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 bg-green-500/5 border-b border-gray-800",children:[s.jsx("span",{className:"text-green-400 font-bold text-sm",children:"Winners"}),s.jsx("span",{className:"badge bg-green",children:P.length}),s.jsx("div",{className:"flex-1"}),s.jsx("span",{className:"font-mono text-green-400 font-bold",children:pr(P.reduce(($,M)=>$+M.realized_pnl_cents,0))})]}),s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Market"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Contracts"}),s.jsx("th",{children:"Cost"}),s.jsx("th",{children:"Realized P&L"}),s.jsx("th",{children:"ROI"})]})}),s.jsx("tbody",{children:P.map($=>{var A;const M=$.open_cost_cents>0?($.realized_pnl_cents/$.open_cost_cents*100).toFixed(0):"∞";return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("a",{href:$o($.ticker),target:"_blank",rel:"noopener",className:"font-mono text-sm text-amber-400 hover:underline",children:$.ticker})}),s.jsx("td",{className:"text-xs text-gray-400 max-w-48 truncate",children:$.title}),s.jsx("td",{children:s.jsx("span",{className:`badge ${Kn($.direction)}`,children:Hn($.direction)})}),s.jsx("td",{className:"font-mono",children:(A=$.open_contracts)==null?void 0:A.toLocaleString()}),s.jsx("td",{className:"font-mono text-gray-400",children:Ar($.open_cost_cents)}),s.jsx("td",{className:"font-mono font-bold text-green-400",children:pr($.realized_pnl_cents)}),s.jsxs("td",{className:"font-mono text-green-300",children:[M,"%"]})]},`${$.ticker}_${$.direction}`)})})]})]}),s.jsxs("div",{className:"card p-0 overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 bg-red-500/5 border-b border-gray-800",children:[s.jsx("span",{className:"text-red-400 font-bold text-sm",children:"Losers"}),s.jsx("span",{className:"badge bg-red",children:k.length}),s.jsx("div",{className:"flex-1"}),s.jsx("span",{className:"font-mono text-red-400 font-bold",children:pr(k.reduce(($,M)=>$+M.realized_pnl_cents,0))})]}),s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Market"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Contracts"}),s.jsx("th",{children:"Cost"}),s.jsx("th",{children:"Realized P&L"}),s.jsx("th",{children:"ROI"})]})}),s.jsx("tbody",{children:k.map($=>{var A;const M=$.open_cost_cents>0?($.realized_pnl_cents/$.open_cost_cents*100).toFixed(0):"—";return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("a",{href:$o($.ticker),target:"_blank",rel:"noopener",className:"font-mono text-sm text-amber-400 hover:underline",children:$.ticker})}),s.jsx("td",{className:"text-xs text-gray-400 max-w-48 truncate",children:$.title}),s.jsx("td",{children:s.jsx("span",{className:`badge ${Kn($.direction)}`,children:Hn($.direction)})}),s.jsx("td",{className:"font-mono",children:(A=$.open_contracts)==null?void 0:A.toLocaleString()}),s.jsx("td",{className:"font-mono text-gray-400",children:Ar($.open_cost_cents)}),s.jsx("td",{className:"font-mono font-bold text-red-400",children:pr($.realized_pnl_cents)}),s.jsxs("td",{className:"font-mono text-red-300",children:[M,"%"]})]},`${$.ticker}_${$.direction}`)})})]})]}),T.length>0&&s.jsxs("div",{className:"card p-0 overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 bg-gray-500/5 border-b border-gray-800",children:[s.jsx("span",{className:"text-gray-400 font-bold text-sm",children:"Flat (No Realized P&L)"}),s.jsx("span",{className:"badge bg-yellow",children:T.length})]}),s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Market"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Contracts"}),s.jsx("th",{children:"Cost"})]})}),s.jsx("tbody",{children:T.map($=>{var M;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("a",{href:$o($.ticker),target:"_blank",rel:"noopener",className:"font-mono text-sm text-amber-400 hover:underline",children:$.ticker})}),s.jsx("td",{className:"text-xs text-gray-400 max-w-48 truncate",children:$.title}),s.jsx("td",{children:s.jsx("span",{className:`badge ${Kn($.direction)}`,children:Hn($.direction)})}),s.jsx("td",{className:"font-mono",children:(M=$.open_contracts)==null?void 0:M.toLocaleString()}),s.jsx("td",{className:"font-mono text-gray-400",children:Ar($.open_cost_cents)})]},`${$.ticker}_${$.direction}`)})})]})]})]})]})}function ZQ(){const[e,t]=O.useState([]),[r,n]=O.useState([]),[a,i]=O.useState(!0),[o,l]=O.useState("orders");O.useEffect(()=>{c()},[]);async function c(){i(!0);try{const[d,f]=await Promise.all([pe("/kalshi",{action:"get_orders"}),pe("/kalshi",{action:"get_fills"})]);t(d.orders||[]),n(f.fills||[])}catch{}i(!1)}async function u(d){try{await pe("/kalshi",{action:"cancel_order",order_id:d}),c()}catch{}}return a?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Orders & Fills"}),s.jsxs("p",{className:"text-gray-500 text-sm",children:[e.length," orders, ",r.length," fills"]})]}),s.jsx("button",{onClick:c,className:"btn btn-o text-sm",children:"Refresh"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("button",{onClick:()=>l("orders"),className:`btn text-sm ${o==="orders"?"btn-p":"btn-o"}`,children:["Orders (",e.length,")"]}),s.jsxs("button",{onClick:()=>l("fills"),className:`btn text-sm ${o==="fills"?"btn-p":"btn-o"}`,children:["Fills (",r.length,")"]})]}),o==="orders"?s.jsx("div",{className:"card overflow-x-auto",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Action"}),s.jsx("th",{children:"Type"}),s.jsx("th",{children:"Price"}),s.jsx("th",{children:"Qty"}),s.jsx("th",{children:"Filled"}),s.jsx("th",{children:"Status"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:e.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:9,className:"text-center text-gray-500 py-8",children:"No orders"})}):e.map((d,f)=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-mono text-xs",children:s.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((d.ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"text-amber-400 hover:text-amber-300 hover:underline transition",children:d.ticker})}),s.jsx("td",{children:s.jsx("span",{className:`badge ${d.side==="yes"?"bg-green":"bg-red"}`,children:(d.side||"").toUpperCase()})}),s.jsx("td",{className:"text-xs text-gray-400",children:(d.action||"").toUpperCase()}),s.jsx("td",{className:"text-xs",children:d.type}),s.jsxs("td",{className:"font-mono",children:[d.yes_price||d.no_price||"—","c"]}),s.jsx("td",{className:"font-mono",children:d.count||d.remaining_count||0}),s.jsx("td",{className:"font-mono text-green-400",children:d.count-(d.remaining_count||0)}),s.jsx("td",{children:s.jsx("span",{className:`badge ${d.status==="resting"?"bg-blue":d.status==="filled"?"bg-green":d.status==="canceled"?"bg-red":"bg-yellow"}`,children:d.status})}),s.jsx("td",{children:d.status==="resting"&&s.jsx("button",{onClick:()=>u(d.order_id),className:"text-xs text-red-400 hover:text-red-300",children:"Cancel"})})]},f))})]})}):s.jsx("div",{className:"card overflow-x-auto",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Action"}),s.jsx("th",{children:"Price"}),s.jsx("th",{children:"Qty"}),s.jsx("th",{children:"Taker"}),s.jsx("th",{children:"Time"})]})}),s.jsx("tbody",{children:r.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"text-center text-gray-500 py-8",children:"No fills"})}):r.map((d,f)=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-mono text-xs",children:s.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((d.ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"text-amber-400 hover:text-amber-300 hover:underline transition",children:d.ticker})}),s.jsx("td",{children:s.jsx("span",{className:`badge ${d.side==="yes"?"bg-green":"bg-red"}`,children:(d.side||"").toUpperCase()})}),s.jsx("td",{className:"text-xs text-gray-400",children:(d.action||"").toUpperCase()}),s.jsxs("td",{className:"font-mono",children:[d.yes_price||d.no_price||"—","c"]}),s.jsx("td",{className:"font-mono",children:d.count}),s.jsx("td",{children:d.is_taker?s.jsx("span",{className:"text-yellow-400 text-xs",children:"TAKER"}):s.jsx("span",{className:"text-green-400 text-xs",children:"MAKER"})}),s.jsx("td",{className:"text-xs text-gray-500",children:d.created_time?new Date(d.created_time).toLocaleString():"—"})]},f))})]})})]})}function JQ(){const[e,t]=O.useState(null),[r,n]=O.useState(!0);O.useEffect(()=>{a()},[]);async function a(){n(!0);try{const o=await pe("/weather",{action:"get_data"});t(o)}catch{}n(!1)}async function i(){n(!0);try{const o=await pe("/weather",{action:"fetch_all"});t(o)}catch{}n(!1)}return r?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Weather Data"}),s.jsx("p",{className:"text-gray-500 text-sm",children:"NWS settlement data for Ken weather contracts"})]}),s.jsx("button",{onClick:i,className:"btn btn-p text-sm",children:"Fetch Latest"})]}),s.jsx("div",{className:"grid grid-cols-4 gap-4",children:["Stations","Forecasts","Observations","Metrics"].map((o,l)=>s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-xs text-gray-500 uppercase mb-1",children:o}),s.jsx("p",{className:"stat-v text-blue-400",children:(e==null?void 0:e[o.toLowerCase()])||"—"})]},o))}),s.jsxs("div",{className:"card",children:[s.jsx("h2",{className:"font-semibold mb-3",children:"Settlement Rule Reference"}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-gray-500 text-xs uppercase mb-2",children:"Temperature Contracts"}),s.jsxs("ul",{className:"space-y-1 text-xs text-gray-400",children:[s.jsx("li",{children:"Source: NWS Daily Climate Report (final)"}),s.jsx("li",{children:"Station: Market-specified (e.g. KORD, KLGA)"}),s.jsx("li",{children:"Values: Tmax/Tmin in degrees F"}),s.jsx("li",{children:"Missing data: treated as 0"})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-gray-500 text-xs uppercase mb-2",children:"Precipitation Contracts"}),s.jsxs("ul",{className:"space-y-1 text-xs text-gray-400",children:[s.jsx("li",{children:"Source: NWS Daily Climate Report (first complete)"}),s.jsx("li",{children:"Trace: counted as 0.00 inches"}),s.jsx("li",{children:"Missing: counted as 0.00 inches"}),s.jsx("li",{children:"Revisions: do NOT change settlement"})]})]})]})]}),((e==null?void 0:e.outcomes)||[]).length>0&&s.jsxs("div",{className:"card overflow-x-auto",children:[s.jsx("h2",{className:"font-semibold mb-3",children:"Recent Observations"}),s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Station"}),s.jsx("th",{children:"Metric"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Source"}),s.jsx("th",{children:"Date"})]})}),s.jsx("tbody",{children:e.outcomes.map((o,l)=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-mono text-sm",children:o.station_id}),s.jsx("td",{children:s.jsx("span",{className:"badge bg-blue",children:o.metric})}),s.jsxs("td",{className:"font-mono",children:[o.value,o.units]}),s.jsx("td",{className:"text-xs text-gray-400",children:o.source}),s.jsx("td",{className:"text-xs text-gray-400",children:o.period_end})]},l))})]})]})]})}const eZ={aggressive:"#ef4444",conservative:"#3b82f6",weather:"#06b6d4",momentum:"#f59e0b",contrarian:"#a855f7",ai_enhanced:"#ec4899",mc_validated:"#8b5cf6",scalper:"#10b981",patient:"#6366f1",random:"#f97316",penny_pincher:"#84cc16",spray_pray:"#14b8a6",nickel_slots:"#eab308",degen_lite:"#e11d48",politics_junkie:"#7c3aed",double_down:"#dc2626",volatility_rider:"#0ea5e9",whale:"#1d4ed8",yolo:"#be123c",full_send:"#ea580c",kelly_criterion:"#4f46e5",sharpe_sniper:"#059669",bayesian_blend:"#7c3aed",ensemble_lock:"#0891b2",mean_revert:"#4338ca",info_ratio:"#b45309",anti_fomo:"#64748b",nightcrawler:"#334155",heatseeker:"#dc2626",quant_core:"#2563eb"},tZ="#f59e0b";function u2(e){return e.startsWith("etf_")?tZ:eZ[e]||"#6b7280"}function rZ({won:e,lost:t,total:r}){if(!r)return s.jsx("span",{className:"text-[10px] text-gray-600",children:"no trades"});const n=e/r*100,a=t/r*100;return s.jsxs("div",{className:"flex h-2 rounded-full overflow-hidden bg-gray-800 w-full",children:[e>0&&s.jsx("div",{className:"bg-green-500",style:{width:`${n}%`}}),t>0&&s.jsx("div",{className:"bg-red-500",style:{width:`${a}%`}})]})}function nZ({streak:e}){if(e===0)return s.jsx("span",{className:"text-gray-600 text-xs",children:"—"});const t=e>0;return s.jsxs("span",{className:`text-xs font-mono font-bold ${t?"text-green-400":"text-red-400"}`,children:[t?"+":"",e]})}function aZ({p:e,dailyPnl:t,expanded:r,onToggle:n}){const a=(e.total_returned_cents-e.total_invested_cents)/100,i=e.trades_won+e.trades_lost+e.trades_expired,o=e.total_invested_cents/100,l=e.total_returned_cents/100,c=i>0,u=u2(e.strategy);return s.jsx("div",{className:`rounded-xl border transition-all cursor-pointer hover:border-gray-600 ${c?"bg-gray-900/60 border-gray-700/60":"bg-gray-900/20 border-gray-800/40 opacity-60"} ${r?"col-span-2 row-span-2":""}`,onClick:n,children:s.jsxs("div",{className:"p-3",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{background:u}}),s.jsx("span",{className:"font-semibold text-sm text-gray-100",children:e.name}),s.jsxs("span",{className:"text-[10px] text-gray-500 font-mono",children:["#",e.id]})]}),s.jsxs("span",{className:`text-sm font-mono font-bold ${a>=0?"text-green-400":"text-red-400"}`,children:[a>=0?"+":"",a.toFixed(2)]})]}),s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-md font-mono",style:{background:`${u}15`,color:u,border:`1px solid ${u}30`},children:e.strategy}),s.jsx(nZ,{streak:e.streak})]}),s.jsxs("div",{className:"mb-2",children:[s.jsx(rZ,{won:e.trades_won,lost:e.trades_lost,total:i}),s.jsxs("div",{className:"flex justify-between mt-1",children:[s.jsxs("span",{className:"text-[10px] text-gray-500",children:[e.trades_won,"W / ",e.trades_lost,"L"]}),s.jsxs("span",{className:"text-[10px] text-gray-500",children:[e.win_rate||0,"%"]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1 text-[11px]",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"Invested"}),s.jsxs("span",{className:"text-gray-300 font-mono",children:["$",o.toFixed(2)]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"Returned"}),s.jsxs("span",{className:"text-gray-300 font-mono",children:["$",l.toFixed(2)]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"Budget/Day"}),s.jsxs("span",{className:"text-gray-300 font-mono",children:["$",(e.daily_budget_cents/100).toFixed(2)]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"Today"}),s.jsxs("span",{className:"text-gray-300 font-mono",children:[e.trades_today," trades"]})]})]}),r&&t&&t.length>0&&s.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-800",children:[s.jsx("p",{className:"text-[10px] text-gray-500 mb-1",children:"Cumulative P&L"}),s.jsx(_i,{width:"100%",height:80,children:s.jsxs(c2,{data:t,children:[s.jsx(Dn,{dataKey:"date",hide:!0}),s.jsx(Rn,{hide:!0,domain:["dataMin","dataMax"]}),s.jsx(bt,{contentStyle:{background:"#1f2937",border:"1px solid #374151",borderRadius:8,fontSize:11},formatter:d=>[`$${(d/100).toFixed(2)}`,"P&L"],labelFormatter:d=>d}),s.jsx(Jr,{type:"monotone",dataKey:"cumulative",stroke:u,fill:u,fillOpacity:.1,strokeWidth:1.5,dot:!1})]})}),s.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:e.description})]})]})})}function iZ(){const[e,t]=O.useState([]),[r,n]=O.useState({}),[a,i]=O.useState(!0),[o,l]=O.useState("all"),[c,u]=O.useState("pnl"),[d,f]=O.useState(null);O.useEffect(()=>{h()},[]);async function h(){try{const[g,S]=await Promise.all([Pe("/portfolios"),Pe("/portfolio-trades?include_history=true").catch(()=>({}))]);t(g||[]),S!=null&&S.byPortfolio&&n(S.byPortfolio)}catch{}i(!1)}const p=O.useMemo(()=>{let g=[...e];return o==="active"&&(g=g.filter(S=>S.trades_won+S.trades_lost>0)),o==="dormant"&&(g=g.filter(S=>S.trades_won+S.trades_lost===0)),o==="etf"&&(g=g.filter(S=>S.strategy.startsWith("etf_"))),o==="core"&&(g=g.filter(S=>!S.strategy.startsWith("etf_"))),c==="pnl"&&g.sort((S,j)=>j.total_returned_cents-j.total_invested_cents-(S.total_returned_cents-S.total_invested_cents)),c==="winrate"&&g.sort((S,j)=>(j.win_rate||0)-(S.win_rate||0)),c==="invested"&&g.sort((S,j)=>j.total_invested_cents-S.total_invested_cents),c==="name"&&g.sort((S,j)=>S.name.localeCompare(j.name)),c==="id"&&g.sort((S,j)=>S.id-j.id),g},[e,o,c]),v=O.useMemo(()=>{const g=e.reduce((T,C)=>T+C.total_invested_cents,0),S=e.reduce((T,C)=>T+C.total_returned_cents,0),j=e.reduce((T,C)=>T+C.trades_won,0),w=e.reduce((T,C)=>T+C.trades_lost,0),_=e.filter(T=>T.trades_won+T.trades_lost>0).length,N=e.length-_,P=[...e].sort((T,C)=>C.total_returned_cents-C.total_invested_cents-(T.total_returned_cents-T.total_invested_cents))[0],k=[...e].sort((T,C)=>T.total_returned_cents-T.total_invested_cents-(C.total_returned_cents-C.total_invested_cents))[0];return{totalInvested:g,totalReturned:S,totalWins:j,totalLosses:w,active:_,dormant:N,bestPf:P,worstPf:k}},[e]),b=O.useMemo(()=>[...e].map(g=>({name:g.name,pnl:(g.total_returned_cents-g.total_invested_cents)/100,strategy:g.strategy})).filter(g=>g.pnl!==0).sort((g,S)=>S.pnl-g.pnl).slice(0,20),[e]),x=O.useMemo(()=>{const g={};return e.forEach(S=>{const j=S.strategy.startsWith("etf_")?"ETF Baskets":S.strategy;g[j]||(g[j]={name:j,value:0}),g[j].value+=S.total_invested_cents}),Object.values(g).filter(S=>S.value>0).sort((S,j)=>j.value-S.value)},[e]);if(a)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})});const y=(v.totalReturned-v.totalInvested)/100,m=v.totalWins+v.totalLosses;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Portfauxlios"}),s.jsx("p",{className:"text-gray-500 text-sm",children:"All 50 portfolios — performance, P&L, and strategy breakdown"})]}),s.jsx("div",{className:"grid grid-cols-6 gap-3",children:[{label:"Total P&L",value:`${y>=0?"+":""}$${y.toFixed(2)}`,color:y>=0?"text-green-400":"text-red-400"},{label:"Invested",value:`$${(v.totalInvested/100).toFixed(2)}`,color:"text-amber-400"},{label:"Returned",value:`$${(v.totalReturned/100).toFixed(2)}`,color:"text-blue-400"},{label:"Win Rate",value:m?`${(v.totalWins/m*100).toFixed(1)}%`:"0%",color:"text-purple-400"},{label:"Active",value:v.active,color:"text-green-400"},{label:"Dormant",value:v.dormant,color:"text-gray-500"}].map(g=>s.jsxs("div",{className:"card text-center",children:[s.jsx("div",{className:`text-lg font-bold font-mono ${g.color}`,children:g.value}),s.jsx("div",{className:"text-[10px] text-gray-500 uppercase tracking-wider mt-1",children:g.label})]},g.label))}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"card col-span-2",children:[s.jsx("h2",{className:"font-semibold text-sm mb-3",children:"P&L by Portfolio"}),b.length>0?s.jsx(_i,{width:"100%",height:220,children:s.jsxs(s2,{data:b,margin:{left:10,right:10},children:[s.jsx(Dn,{dataKey:"name",tick:{fill:"#6b7280",fontSize:9},angle:-45,textAnchor:"end",height:60}),s.jsx(Rn,{tick:{fill:"#6b7280",fontSize:10},tickFormatter:g=>`$${g}`}),s.jsx(bt,{contentStyle:{background:"#1f2937",border:"1px solid #374151",borderRadius:8,fontSize:11},formatter:g=>[`$${g.toFixed(2)}`,"P&L"]}),s.jsx(Ln,{dataKey:"pnl",radius:[4,4,0,0],children:b.map((g,S)=>s.jsx(va,{fill:g.pnl>=0?"#22c55e":"#ef4444",fillOpacity:.8},S))})]})}):s.jsx("div",{className:"text-center text-gray-600 py-10 text-sm",children:"No P&L data yet"})]}),s.jsxs("div",{className:"card",children:[s.jsx("h2",{className:"font-semibold text-sm mb-3",children:"Capital Allocation"}),x.length>0?s.jsx(_i,{width:"100%",height:220,children:s.jsxs(l2,{children:[s.jsx(Pr,{data:x,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",innerRadius:40,outerRadius:75,paddingAngle:2,strokeWidth:0,children:x.map((g,S)=>s.jsx(va,{fill:u2(g.name==="ETF Baskets"?"etf_":g.name),fillOpacity:.8},S))}),s.jsx(bt,{contentStyle:{background:"#1f2937",border:"1px solid #374151",borderRadius:8,fontSize:11},formatter:g=>[`$${(g/100).toFixed(2)}`,"Invested"]})]})}):s.jsx("div",{className:"text-center text-gray-600 py-10 text-sm",children:"No allocations yet"})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.bestPf&&s.jsxs("div",{className:"card border-green-500/20",children:[s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:"text-green-400 text-xs font-semibold uppercase tracking-wider",children:"Best Performer"})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"font-bold text-gray-100",children:v.bestPf.name}),s.jsx("span",{className:"text-green-400 font-mono font-bold",children:((v.bestPf.total_returned_cents-v.bestPf.total_invested_cents)/100).toFixed(2)})]}),s.jsxs("span",{className:"text-[10px] text-gray-500",children:[v.bestPf.strategy," — ",v.bestPf.win_rate||0,"% win rate"]})]}),v.worstPf&&s.jsxs("div",{className:"card border-red-500/20",children:[s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:"text-red-400 text-xs font-semibold uppercase tracking-wider",children:"Worst Performer"})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"font-bold text-gray-100",children:v.worstPf.name}),s.jsx("span",{className:"text-red-400 font-mono font-bold",children:((v.worstPf.total_returned_cents-v.worstPf.total_invested_cents)/100).toFixed(2)})]}),s.jsxs("span",{className:"text-[10px] text-gray-500",children:[v.worstPf.strategy," — ",v.worstPf.win_rate||0,"% win rate"]})]})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"flex gap-2",children:["all","active","dormant","etf","core"].map(g=>s.jsx("button",{onClick:()=>l(g),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition ${o===g?"bg-amber-500/15 text-amber-400 border border-amber-500/30":"bg-gray-800/40 text-gray-400 hover:text-gray-200 border border-transparent"}`,children:g==="all"?`All (${e.length})`:g==="active"?`Active (${v.active})`:g==="dormant"?`Dormant (${v.dormant})`:g==="etf"?"ETF Baskets":"Core Strategies"},g))}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-gray-500",children:"Sort:"}),["pnl","winrate","invested","name","id"].map(g=>s.jsx("button",{onClick:()=>u(g),className:`px-2 py-1 rounded text-[11px] transition ${c===g?"text-amber-400 bg-amber-500/10":"text-gray-500 hover:text-gray-300"}`,children:g==="pnl"?"P&L":g==="winrate"?"Win%":g.charAt(0).toUpperCase()+g.slice(1)},g))]})]}),s.jsx("div",{className:"grid grid-cols-4 gap-3",children:p.map(g=>{var S;return s.jsx(aZ,{p:g,dailyPnl:((S=r[g.id])==null?void 0:S.daily)||[],expanded:d===g.id,onToggle:()=>f(d===g.id?null:g.id)},g.id)})}),p.length===0&&s.jsx("div",{className:"text-center py-12 text-gray-500",children:"No portfolios match this filter"})]})}const oZ=[{label:"30s",ms:3e4},{label:"1m",ms:6e4},{label:"2m",ms:12e4},{label:"5m",ms:3e5},{label:"8m",ms:48e4},{label:"10m",ms:6e5},{label:"15m",ms:9e5},{label:"30m",ms:18e5},{label:"60m",ms:36e5}];function sZ(e){return e>=36e5?`${e/36e5}h`:e>=6e4?`${e/6e4}m`:`${e/1e3}s`}function Vl({label:e,value:t,onChange:r,description:n}){return s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-gray-200",children:e}),s.jsx("p",{className:"text-[10px] text-gray-500",children:n})]}),s.jsx("span",{className:"font-mono text-amber-400 text-lg font-bold",children:sZ(t)})]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:oZ.map(a=>s.jsx("button",{onClick:()=>r(a.ms),className:`px-2.5 py-1 rounded text-xs font-medium transition ${t===a.ms?"bg-amber-500/20 text-amber-400 border border-amber-500/40":"bg-gray-800/60 text-gray-500 border border-gray-700 hover:border-gray-500 hover:text-gray-300"}`,children:a.label},a.ms))})]})}function lZ(){const[e,t]=O.useState(null),[r,n]=O.useState(!0),[a,i]=O.useState(""),[o,l]=O.useState(""),[c,u]=O.useState("demo"),[d,f]=O.useState(!1),[h,p]=O.useState(null),[v,b]=O.useState(null),[x,y]=O.useState(null),[m,g]=O.useState(!1);O.useEffect(()=>{S(),j();const k=setInterval(j,3e4);return()=>clearInterval(k)},[]);async function S(){try{const k=await pe("/kalshi",{action:"status"});t(k),k.env&&u(k.env)}catch{}n(!1)}async function j(){try{const k=await Pe("/scan-config");b(k)}catch{}}async function w(k,T){g(!0),y(null);try{const C=await Pe("/scan-config",{method:"POST",body:JSON.stringify({[k]:T})});C.success?(b(C),y({type:"ok",text:`Updated ${k.replace(/_/g," ")}`})):y({type:"err",text:C.error||"Failed"})}catch{y({type:"err",text:"Connection error"})}g(!1),setTimeout(()=>y(null),3e3)}async function _(){f(!0),p(null);try{const k=await pe("/kalshi",{action:"save_keys",api_key:a,private_key:o,env:c});k.success?(p({type:"ok",text:"Keys saved"}),S(),i(""),l("")):p({type:"err",text:k.error||"Failed"})}catch{p({type:"err",text:"Connection error"})}f(!1)}async function N(){try{await pe("/kalshi",{action:"disconnect"}),S()}catch{}}async function P(){p(null);try{const k=await pe("/kalshi",{action:"test_connection"});p({type:k.success?"ok":"err",text:k.success?`Connected! Exchange: ${k.exchange_status}`:"Connection failed"})}catch{p({type:"err",text:"Connection error"})}}return r?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})}):s.jsxs("div",{className:"space-y-6",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Settings"}),v&&s.jsxs("div",{className:"card space-y-5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"font-semibold",children:"Scan & Pipeline Configuration"}),s.jsx("p",{className:"text-[10px] text-gray-500",children:"Adjust intervals, thresholds, and risk parameters in real-time"})]}),m&&s.jsx("span",{className:"text-xs text-amber-400 animate-pulse",children:"Saving..."})]}),x&&s.jsx("p",{className:`text-xs px-3 py-1.5 rounded ${x.type==="ok"?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,children:x.text}),s.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 bg-gray-800/40 rounded-lg border border-gray-700",children:[s.jsx("span",{className:"text-[10px] text-gray-500 uppercase font-medium",children:"Cached Markets"}),s.jsx("span",{className:"font-mono text-xl font-bold text-amber-400",children:v.cached_markets||0})]}),s.jsx(Vl,{label:"Market Scan",description:"How often to fetch & analyze all active Kalshi markets",value:v.scan_interval_ms,onChange:k=>w("scan_interval_ms",k)}),s.jsx(Vl,{label:"Signal Pipeline",description:"News sentiment + probability + Monte Carlo signal generation",value:v.signal_pipeline_ms,onChange:k=>w("signal_pipeline_ms",k)}),s.jsx(Vl,{label:"Intelligence Sweep",description:"Reddit, news feeds, Bluesky, Mastodon, Lemmy + 20 more sources",value:v.reddit_interval_ms,onChange:k=>w("reddit_interval_ms",k)}),s.jsx(Vl,{label:"Trade Resolution",description:"Take-profit/stop-loss check on open portfolio positions",value:v.resolve_interval_ms,onChange:k=>w("resolve_interval_ms",k)}),s.jsxs("div",{className:"border-t border-gray-700 pt-4 space-y-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Risk Parameters"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-gray-200",children:"Min Edge Threshold"}),s.jsx("p",{className:"text-[10px] text-gray-500",children:"Minimum statistical edge required to approve a signal"})]}),s.jsxs("span",{className:"font-mono text-amber-400 text-lg font-bold",children:[(v.min_edge_threshold*100).toFixed(1),"%"]})]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:[.01,.02,.03,.05,.08,.1,.15,.2].map(k=>s.jsxs("button",{onClick:()=>w("min_edge_threshold",k),className:`px-2.5 py-1 rounded text-xs font-medium transition ${Math.abs(v.min_edge_threshold-k)<.001?"bg-amber-500/20 text-amber-400 border border-amber-500/40":"bg-gray-800/60 text-gray-500 border border-gray-700 hover:border-gray-500 hover:text-gray-300"}`,children:[(k*100).toFixed(0),"%"]},k))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-gray-200",children:"Min Liquidity (24h Vol)"}),s.jsx("p",{className:"text-[10px] text-gray-500",children:"Minimum 24-hour trading volume to consider a market"})]}),s.jsx("span",{className:"font-mono text-amber-400 text-lg font-bold",children:v.min_liquidity})]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:[0,10,25,50,100,250,500,1e3].map(k=>s.jsx("button",{onClick:()=>w("min_liquidity",k),className:`px-2.5 py-1 rounded text-xs font-medium transition ${v.min_liquidity===k?"bg-amber-500/20 text-amber-400 border border-amber-500/40":"bg-gray-800/60 text-gray-500 border border-gray-700 hover:border-gray-500 hover:text-gray-300"}`,children:k===0?"None":k},k))})]})]})]}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"flex items-center gap-4 mb-3",children:[s.jsx("span",{className:`w-3 h-3 rounded-full ${e!=null&&e.connected?"bg-green-500 pulse-g":"bg-gray-600"}`}),s.jsx("h2",{className:"font-semibold",children:"Ken API Connection"})]}),e!=null&&e.connected?s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"API Key"}),s.jsx("span",{className:"font-mono text-gray-300",children:e.api_key_masked||"***"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"Environment"}),s.jsx("span",{className:e.env==="prod"?"text-green-400":"text-yellow-400",children:(e.env||"demo").toUpperCase()})]}),s.jsxs("div",{className:"flex gap-2 mt-3",children:[s.jsx("button",{onClick:P,className:"btn btn-o text-sm",children:"Test Connection"}),s.jsx("button",{onClick:N,className:"btn btn-d text-sm",children:"Disconnect"})]})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>u("demo"),className:`flex-1 py-2 rounded-lg text-sm font-medium transition ${c==="demo"?"bg-yellow-500/15 text-yellow-400 border border-yellow-500/30":"bg-gray-800/50 text-gray-500 border border-gray-700"}`,children:"Demo"}),s.jsx("button",{onClick:()=>u("prod"),className:`flex-1 py-2 rounded-lg text-sm font-medium transition ${c==="prod"?"bg-green-500/15 text-green-400 border border-green-500/30":"bg-gray-800/50 text-gray-500 border border-gray-700"}`,children:"Production"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1",children:"API Key ID"}),s.jsx("input",{type:"text",value:a,onChange:k=>i(k.target.value),placeholder:"Your API key",className:"w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none font-mono"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1",children:"Private Key (PEM)"}),s.jsx("textarea",{value:o,onChange:k=>l(k.target.value),placeholder:"-----BEGIN RSA PRIVATE KEY-----",rows:4,className:"w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none font-mono text-xs"})]}),s.jsx("button",{onClick:_,disabled:d||!a,className:"btn btn-p w-full",children:d?"Saving...":"Save & Connect"})]}),h&&s.jsx("p",{className:`text-xs mt-2 ${h.type==="ok"?"text-green-400":"text-red-400"}`,children:h.text})]}),s.jsxs("div",{className:"card",children:[s.jsx("h2",{className:"font-semibold mb-3",children:"Ken API Reference"}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 text-xs text-gray-400",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-gray-500 uppercase mb-1 font-medium",children:"Environments"}),s.jsxs("p",{children:["Demo: ",s.jsx("span",{className:"font-mono text-amber-400",children:"demo-api.kalshi.co"})]}),s.jsxs("p",{children:["Prod: ",s.jsx("span",{className:"font-mono text-green-400",children:"api.elections.kalshi.com"})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-gray-500 uppercase mb-1 font-medium",children:"Auth"}),s.jsx("p",{children:"Method: RSA-PSS + SHA-256"}),s.jsx("p",{children:"Headers: KALSHI-ACCESS-KEY, TIMESTAMP, SIGNATURE"})]})]})]})]})}const cZ={BUY_YES:"bg-green",BUY_NO:"bg-red"};function uZ(e){if(!e)return null;const t=e.match(/on\s+"([^"]+)"/);return t?t[1]:null}function fZ({s:e}){const[t,r]=O.useState(!1),n=uZ(e.reasoning)||e.market_id,a=parseFloat(e.expected_edge)||0,i=parseFloat(e.confidence)||0;return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:`cursor-pointer transition ${t?"bg-gray-800/40":"hover:bg-gray-800/20"}`,onClick:()=>r(!t),children:[s.jsx("td",{className:"text-xs text-gray-500 whitespace-nowrap",children:new Date(e.created_at).toLocaleTimeString()}),s.jsxs("td",{className:"max-w-[280px]",children:[s.jsx("a",{href:e.kalshi_url||`https://kalshi.com/search?query=${encodeURIComponent((e.market_id||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"text-amber-400 hover:text-amber-300 hover:underline transition text-sm truncate block",onClick:o=>o.stopPropagation(),children:n}),s.jsx("span",{className:"text-[10px] font-mono text-gray-600",children:e.market_id})]}),s.jsx("td",{children:s.jsx("span",{className:`badge ${cZ[e.direction]||"bg-yellow"}`,children:e.direction})}),s.jsxs("td",{className:`font-mono ${a>0?"text-green-400":"text-red-400"}`,children:[(a*100).toFixed(1),"%"]}),s.jsx("td",{className:"font-mono text-gray-400",children:e.size_recommendation||"—"}),s.jsx("td",{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-16 h-1.5 bg-gray-700 rounded-full overflow-hidden",children:s.jsx("div",{className:`h-full rounded-full ${i>.7?"bg-green-500":i>.5?"bg-amber-500":"bg-red-500"}`,style:{width:`${i*100}%`}})}),s.jsxs("span",{className:"text-xs text-gray-400",children:[(i*100).toFixed(0),"%"]})]})}),s.jsx("td",{children:s.jsx("span",{className:`badge ${e.risk_approved?"bg-green":"bg-red"}`,children:e.risk_approved?"APPROVED":"BLOCKED"})}),s.jsx("td",{className:"text-xs text-gray-500",children:t?"▾":"▸"})]}),t&&s.jsx("tr",{className:"bg-gray-800/20",children:s.jsxs("td",{colSpan:8,className:"p-3",children:[s.jsx("div",{className:"text-xs text-gray-400 leading-relaxed max-w-4xl",children:e.reasoning}),e.sources&&s.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:(typeof e.sources=="string"?e.sources.split(","):Array.isArray(e.sources)?e.sources:[]).map((o,l)=>s.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-gray-700/50 text-gray-500",children:o.trim()},l))})]})})]})}function dZ({s:e}){const[t,r]=O.useState(!1),n=e.market_title||e.market_id,a=parseFloat(e.edge)||0;return s.jsx(s.Fragment,{children:s.jsxs("tr",{className:`cursor-pointer transition ${t?"bg-gray-800/40":"hover:bg-gray-800/20"}`,onClick:()=>r(!t),children:[s.jsx("td",{className:"text-xs text-gray-500 whitespace-nowrap",children:new Date(e.created_at).toLocaleTimeString()}),s.jsxs("td",{className:"max-w-[250px]",children:[s.jsx("a",{href:e.kalshi_url||`https://kalshi.com/search?query=${encodeURIComponent((e.market_id||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"text-amber-400 hover:text-amber-300 hover:underline transition text-sm truncate block",onClick:i=>i.stopPropagation(),children:n}),s.jsx("span",{className:"text-[10px] font-mono text-gray-600",children:e.market_id})]}),s.jsxs("td",{className:"font-mono text-gray-400",children:[(parseFloat(e.prior_probability)*100).toFixed(1),"%"]}),s.jsxs("td",{className:`font-mono ${parseFloat(e.sentiment_impact)>0?"text-green-400":"text-red-400"}`,children:[parseFloat(e.sentiment_impact)>0?"+":"",(parseFloat(e.sentiment_impact)*100).toFixed(2),"%"]}),s.jsxs("td",{className:"font-mono text-amber-400",children:[(parseFloat(e.adjusted_probability)*100).toFixed(1),"%"]}),s.jsxs("td",{className:"font-mono text-gray-400",children:[(parseFloat(e.market_probability)*100).toFixed(1),"%"]}),s.jsxs("td",{className:`font-mono font-bold ${a>0?"text-green-400":a<0?"text-red-400":"text-gray-400"}`,children:[a>0?"+":"",(a*100).toFixed(1),"%"]}),s.jsx("td",{className:"text-gray-400",children:e.num_articles})]})})}function hZ(){var p,v,b,x,y,m;const[e,t]=O.useState(null),[r,n]=O.useState(null),[a,i]=O.useState(!0),[o,l]=O.useState("signals");O.useEffect(()=>{c();const g=setInterval(c,3e4);return()=>clearInterval(g)},[]);async function c(){try{const[g,S]=await Promise.all([Pe("/signals"),Pe("/signals/dashboard")]);t(g),n(S)}catch{}i(!1)}if(a)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})});const u=(r==null?void 0:r.stats)||{},d=(e==null?void 0:e.signals)||[],f=(e==null?void 0:e.probabilityShifts)||[],h=(r==null?void 0:r.sourceBreakdown)||[];return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Signal Pipeline"}),s.jsx("p",{className:"text-gray-500 text-sm",children:"News → Sentiment → Probability → Signals → Risk"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("span",{className:"text-xs text-gray-500",children:[((p=e==null?void 0:e.pipeline)==null?void 0:p.cachedMarkets)||0," markets tracked"]}),s.jsx("button",{onClick:c,className:"btn btn-o text-sm",children:"Refresh"})]})]}),s.jsx("div",{className:"grid grid-cols-6 gap-3",children:[{label:"Signals (24h)",value:u.total_signals||0,color:"text-amber-400"},{label:"Approved",value:u.approved_signals||0,color:"text-green-400"},{label:"BUY YES",value:u.buy_yes||0,color:"text-green-400"},{label:"BUY NO",value:u.buy_no||0,color:"text-red-400"},{label:"Avg Edge",value:u.avg_edge?`${(u.avg_edge*100).toFixed(1)}%`:"—",color:"text-blue-400"},{label:"Avg Confidence",value:u.avg_confidence?`${(u.avg_confidence*100).toFixed(0)}%`:"—",color:"text-purple-400"}].map(g=>s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase mb-1",children:g.label}),s.jsx("p",{className:`text-xl font-bold ${g.color}`,children:g.value})]},g.label))}),s.jsx("div",{className:"flex gap-1 border-b border-gray-800 pb-1",children:["signals","shifts","sources"].map(g=>s.jsx("button",{onClick:()=>l(g),className:`px-4 py-2 text-sm rounded-t-lg transition ${o===g?"bg-gray-800 text-amber-400 font-medium":"text-gray-500 hover:text-gray-300"}`,children:g==="signals"?`Strategy Signals (${d.length})`:g==="shifts"?`Probability Shifts (${f.length})`:`Source Breakdown (${h.length})`},g))}),o==="signals"&&s.jsx("div",{className:"card overflow-x-auto",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Time"}),s.jsx("th",{children:"Market"}),s.jsx("th",{children:"Direction"}),s.jsx("th",{children:"Edge"}),s.jsx("th",{children:"Size"}),s.jsx("th",{children:"Confidence"}),s.jsx("th",{children:"Risk"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:d.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:8,className:"text-center text-gray-500 py-8",children:"No signals yet"})}):d.map(g=>s.jsx(fZ,{s:g},g.id))})]})}),o==="shifts"&&s.jsx("div",{className:"card overflow-x-auto",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Time"}),s.jsx("th",{children:"Market"}),s.jsx("th",{children:"Prior"}),s.jsx("th",{children:"Impact"}),s.jsx("th",{children:"Adjusted"}),s.jsx("th",{children:"Market Price"}),s.jsx("th",{children:"Edge"}),s.jsx("th",{children:"Articles"})]})}),s.jsx("tbody",{children:f.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:8,className:"text-center text-gray-500 py-8",children:"No probability shifts yet"})}):f.map((g,S)=>s.jsx(dZ,{s:g},S))})]})}),o==="sources"&&s.jsx("div",{className:"card",children:s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-3",children:"Active Sources (last hour)"}),s.jsx("div",{className:"space-y-2",children:h.length===0?s.jsx("p",{className:"text-gray-600 text-sm",children:"No recent data"}):h.map((g,S)=>s.jsxs("div",{className:"flex items-center justify-between p-2 rounded bg-gray-800/30",children:[s.jsx("span",{className:"text-sm font-medium",children:g.source}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("span",{className:"text-xs text-gray-500",children:[g.cnt," items"]}),s.jsxs("span",{className:`text-xs font-mono ${parseFloat(g.avg_sent)>.05?"text-green-400":parseFloat(g.avg_sent)<-.05?"text-red-400":"text-gray-400"}`,children:[parseFloat(g.avg_sent)>0?"+":"",(parseFloat(g.avg_sent)*100).toFixed(0),"%"]})]})]},S))})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-3",children:"Pipeline Config"}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("div",{className:"flex justify-between p-2 rounded bg-gray-800/30",children:[s.jsx("span",{className:"text-gray-500",children:"Market Scan"}),s.jsx("span",{children:"Every 15 min"})]}),s.jsxs("div",{className:"flex justify-between p-2 rounded bg-gray-800/30",children:[s.jsx("span",{className:"text-gray-500",children:"Signal Pipeline"}),s.jsx("span",{children:"Every 5 min"})]}),s.jsxs("div",{className:"flex justify-between p-2 rounded bg-gray-800/30",children:[s.jsx("span",{className:"text-gray-500",children:"Intelligence Sweep"}),s.jsx("span",{children:"Every 30 min"})]}),s.jsxs("div",{className:"flex justify-between p-2 rounded bg-gray-800/30",children:[s.jsx("span",{className:"text-gray-500",children:"Min Edge Threshold"}),s.jsxs("span",{children:[((((b=(v=e==null?void 0:e.pipeline)==null?void 0:v.riskLimits)==null?void 0:b.minEdgeThreshold)||.05)*100).toFixed(0),"%"]})]}),s.jsxs("div",{className:"flex justify-between p-2 rounded bg-gray-800/30",children:[s.jsx("span",{className:"text-gray-500",children:"Min Liquidity"}),s.jsxs("span",{children:[((y=(x=e==null?void 0:e.pipeline)==null?void 0:x.riskLimits)==null?void 0:y.minLiquidity)||100," vol"]})]}),s.jsxs("div",{className:"flex justify-between p-2 rounded bg-gray-800/30",children:[s.jsx("span",{className:"text-gray-500",children:"Cached Markets"}),s.jsx("span",{className:"text-amber-400",children:((m=e==null?void 0:e.pipeline)==null?void 0:m.cachedMarkets)||0})]})]})]})]})})]})}const V1={reddit_hot:"🔴",reddit:"📋",google_news:"📰",hackernews:"🟠",metaculus:"🔮",manifold:"📊",gdelt_tv:"📺",youtube:"▶️",lemmy:"🟢",lobsters:"🦞",tildes:"~",bluesky:"🦋",mastodon:"🐘",predictit:"💰",fred:"📈",nws:"⛈️",govtrack:"🏛️",discord:"💬"};function pZ(){const[e,t]=O.useState(null),[r,n]=O.useState(!0),[a,i]=O.useState(""),[o,l]=O.useState("captured_at"),[c,u]=O.useState("desc");O.useEffect(()=>{d();const m=setInterval(d,6e4);return()=>clearInterval(m)},[]);async function d(){try{const m=await Pe("/intelligence");t(m)}catch{}n(!1)}if(r)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})});const f=(e==null?void 0:e.totals)||{},h=(e==null?void 0:e.sourceCounts)||[],p=((e==null?void 0:e.recent)||[]).filter(m=>!a||m.source.toLowerCase().includes(a.toLowerCase())||(m.post_title||"").toLowerCase().includes(a.toLowerCase())||(m.keyword||"").toLowerCase().includes(a.toLowerCase()));function v(m){o===m?u(g=>g==="asc"?"desc":"asc"):(l(m),u(m==="captured_at"?"desc":"asc"))}const b=(m,g)=>{let S,j;switch(o){case"captured_at":S=new Date(m.captured_at),j=new Date(g.captured_at);break;case"source":S=m.source||"",j=g.source||"";break;case"keyword":S=m.keyword||m.subreddit||"",j=g.keyword||g.subreddit||"";break;case"post_title":S=(m.post_title||"").toLowerCase(),j=(g.post_title||"").toLowerCase();break;case"score":S=Number(m.score||0),j=Number(g.score||0);break;case"sentiment":S=parseFloat(m.sentiment_score||0),j=parseFloat(g.sentiment_score||0);break;default:return 0}return S<j?c==="asc"?-1:1:S>j?c==="asc"?1:-1:0},x=[...p].sort(b),y=({col:m,label:g})=>s.jsxs("th",{onClick:()=>v(m),className:"cursor-pointer select-none hover:text-amber-400 transition",children:[g," ",o===m?c==="asc"?"▲":"▼":s.jsx("span",{className:"text-gray-600",children:"⇅"})]});return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Intelligence Feed"}),s.jsx("p",{className:"text-gray-500 text-sm",children:"Real-time data from 20+ sources"})]}),s.jsx("button",{onClick:d,className:"btn btn-o text-sm",children:"Refresh"})]}),s.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Total Items"}),s.jsx("p",{className:"text-xl font-bold text-amber-400",children:Number(f.total_items||0).toLocaleString()})]}),s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Last Hour"}),s.jsx("p",{className:"text-xl font-bold text-green-400",children:f.last_hour||0})]}),s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Last 4 Hours"}),s.jsx("p",{className:"text-xl font-bold text-blue-400",children:f.last_4h||0})]}),s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Avg Sentiment (1h)"}),s.jsx("p",{className:`text-xl font-bold ${parseFloat(f.avg_sentiment_1h)>0?"text-green-400":parseFloat(f.avg_sentiment_1h)<0?"text-red-400":"text-gray-400"}`,children:f.avg_sentiment_1h?`${(parseFloat(f.avg_sentiment_1h)*100).toFixed(1)}%`:"—"})]})]}),s.jsxs("div",{className:"card",children:[s.jsx("h2",{className:"font-semibold mb-3",children:"Active Sources"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:h.map((m,g)=>s.jsxs("button",{onClick:()=>i(a===m.source?"":m.source),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs transition ${a===m.source?"bg-amber-500/20 text-amber-400 border border-amber-500/30":"bg-gray-800/50 text-gray-400 border border-gray-700 hover:border-gray-600"}`,children:[s.jsx("span",{children:V1[m.source]||"📡"}),s.jsx("span",{className:"font-medium",children:m.source}),s.jsx("span",{className:"text-gray-500",children:m.cnt}),s.jsxs("span",{className:`font-mono ${parseFloat(m.avg_sent)>.05?"text-green-400":parseFloat(m.avg_sent)<-.05?"text-red-400":"text-gray-500"}`,children:[parseFloat(m.avg_sent)>0?"+":"",(parseFloat(m.avg_sent)*100).toFixed(0),"%"]})]},g))})]}),s.jsx("input",{type:"text",value:a,onChange:m=>i(m.target.value),placeholder:"Filter by source, keyword, or title...",className:"w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none"}),s.jsx("div",{className:"card overflow-x-auto",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx(y,{col:"captured_at",label:"Time"}),s.jsx(y,{col:"source",label:"Source"}),s.jsx(y,{col:"keyword",label:"Topic"}),s.jsx(y,{col:"post_title",label:"Title"}),s.jsx(y,{col:"score",label:"Score"}),s.jsx(y,{col:"sentiment",label:"Sentiment"})]})}),s.jsx("tbody",{children:x.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center text-gray-500 py-8",children:"No items match filter"})}):x.slice(0,50).map((m,g)=>s.jsxs("tr",{children:[s.jsx("td",{className:"text-xs text-gray-500 whitespace-nowrap",children:new Date(m.captured_at).toLocaleTimeString()}),s.jsx("td",{children:s.jsxs("span",{className:"badge bg-blue text-xs",children:[V1[m.source]||"📡"," ",m.source]})}),s.jsx("td",{className:"text-xs text-gray-500",children:m.keyword||m.subreddit||"—"}),s.jsx("td",{className:"max-w-[400px]",children:m.post_url?s.jsx("a",{href:m.post_url,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-gray-300 hover:text-amber-400 truncate block",children:m.post_title}):s.jsx("span",{className:"text-sm text-gray-300 truncate block",children:m.post_title})}),s.jsxs("td",{className:"font-mono text-xs text-gray-400",children:[m.score||0,m.num_comments?` / ${m.num_comments}c`:""]}),s.jsx("td",{children:s.jsxs("span",{className:`font-mono text-xs ${parseFloat(m.sentiment_score)>.1?"text-green-400":parseFloat(m.sentiment_score)<-.1?"text-red-400":"text-gray-500"}`,children:[parseFloat(m.sentiment_score)>0?"+":"",(parseFloat(m.sentiment_score)*100).toFixed(0),"%"]})})]},g))})]})})]})}function mZ(){const[e,t]=O.useState(null),[r,n]=O.useState(null),[a,i]=O.useState(null),[o,l]=O.useState(!0),[c,u]=O.useState("");O.useEffect(()=>{d();const y=setInterval(d,15e3);return()=>clearInterval(y)},[]);async function d(){try{const[y,m,g]=await Promise.all([pe("/trading/mode",{action:"get"}),Pe("/trading/history"),Pe("/system")]);t(y),n(m),i(g)}catch{}l(!1)}async function f(y,m={}){u(y);try{await pe("/trading/mode",{action:y,...m}),await d()}catch{}u("")}if(o)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})});const h=(e==null?void 0:e.trade_config)||{},p=(e==null?void 0:e.trader_state)||{},v=(r==null?void 0:r.summary)||{},b=(r==null?void 0:r.trades)||[],x=(a==null?void 0:a.memory)||{};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Trading Control"}),s.jsx("p",{className:"text-gray-500 text-sm",children:"Mode, execution, and P&L"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`badge ${(e==null?void 0:e.env)==="prod"?"bg-green":"bg-yellow"}`,children:((e==null?void 0:e.env)||"demo").toUpperCase()}),(e==null?void 0:e.safe_mode)&&s.jsx("span",{className:"badge bg-yellow",children:"SAFE"}),(e==null?void 0:e.auto_trader_enabled)&&s.jsx("span",{className:"badge bg-green",children:"AUTO"})]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"card",children:[s.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-3",children:"Environment"}),s.jsxs("div",{className:"flex gap-2 mb-3",children:[s.jsx("button",{onClick:()=>f("switch_env",{env:"demo"}),className:`flex-1 py-2 rounded-lg text-sm font-medium transition ${(e==null?void 0:e.env)==="demo"?"bg-amber-500/20 text-amber-400 border border-amber-500/40":"bg-gray-800 text-gray-500 border border-gray-700"}`,disabled:c==="switch_env",children:"DEMO"}),s.jsx("button",{onClick:()=>f("switch_env",{env:"prod"}),className:`flex-1 py-2 rounded-lg text-sm font-medium transition ${(e==null?void 0:e.env)==="prod"?"bg-green-500/20 text-green-400 border border-green-500/40":"bg-gray-800 text-gray-500 border border-gray-700"}`,disabled:c==="switch_env",children:"PROD"})]}),s.jsxs("p",{className:"text-[10px] text-gray-600",children:["API keys: ",e!=null&&e.kalshi_connected?"Configured":"Not set"]})]}),s.jsxs("div",{className:"card",children:[s.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-3",children:"Safe Mode"}),s.jsx("button",{onClick:()=>f("toggle_safe_mode"),className:`w-full py-3 rounded-lg text-sm font-bold transition ${e!=null&&e.safe_mode?"bg-yellow-500/20 text-yellow-400 border border-yellow-500/40":"bg-red-500/20 text-red-400 border border-red-500/40"}`,disabled:c==="toggle_safe_mode",children:e!=null&&e.safe_mode?"SAFE MODE ON — Click to Disable":"SAFE MODE OFF — LIVE TRADING"}),s.jsx("p",{className:"text-[10px] text-gray-600 mt-2",children:e!=null&&e.safe_mode?"No real orders will be placed":"Real orders will be executed!"})]}),s.jsxs("div",{className:"card",children:[s.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-3",children:"Auto Trader"}),s.jsx("button",{onClick:()=>f("toggle_auto_trader"),className:`w-full py-3 rounded-lg text-sm font-bold transition ${e!=null&&e.auto_trader_enabled?"bg-green-500/20 text-green-400 border border-green-500/40":"bg-gray-800 text-gray-500 border border-gray-700"}`,disabled:c==="toggle_auto_trader",children:e!=null&&e.auto_trader_enabled?"AUTO TRADER: ON":"AUTO TRADER: OFF"}),s.jsxs("p",{className:"text-[10px] text-gray-600 mt-2",children:["Min confidence: ",h.min_confidence,"% | Budget: $",(h.budget_cents/100).toFixed(0)]})]})]}),s.jsx("div",{className:"grid grid-cols-6 gap-3",children:[{label:"Total Trades",value:v.total_trades||0,color:"text-amber-400"},{label:"Open",value:v.open_trades||0,color:"text-blue-400"},{label:"Wins",value:v.winning_trades||0,color:"text-green-400"},{label:"Losses",value:v.losing_trades||0,color:"text-red-400"},{label:"Total P&L",value:v.total_pnl?`$${(parseInt(v.total_pnl)/100).toFixed(2)}`:"$0.00",color:parseInt(v.total_pnl||0)>=0?"text-green-400":"text-red-400"},{label:"Exposure",value:`$${(parseInt(v.open_exposure||0)/100).toFixed(2)}`,color:"text-purple-400"}].map(y=>s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase mb-1",children:y.label}),s.jsx("p",{className:`text-lg font-bold ${y.color}`,children:y.value})]},y.label))}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"card",children:[s.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-3",children:"Trade Config"}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("div",{className:"flex justify-between p-2 bg-gray-800/30 rounded",children:[s.jsx("span",{className:"text-gray-500",children:"Budget"}),s.jsxs("span",{className:"font-mono",children:["$",(h.budget_cents/100).toFixed(0)]})]}),s.jsxs("div",{className:"flex justify-between p-2 bg-gray-800/30 rounded",children:[s.jsx("span",{className:"text-gray-500",children:"Max per trade"}),s.jsxs("span",{className:"font-mono",children:["$",(h.max_position_cents/100).toFixed(0)]})]}),s.jsxs("div",{className:"flex justify-between p-2 bg-gray-800/30 rounded",children:[s.jsx("span",{className:"text-gray-500",children:"Max positions"}),s.jsx("span",{className:"font-mono",children:h.max_open_positions})]}),s.jsxs("div",{className:"flex justify-between p-2 bg-gray-800/30 rounded",children:[s.jsx("span",{className:"text-gray-500",children:"Daily loss limit"}),s.jsxs("span",{className:"font-mono",children:["$",(h.daily_loss_limit_cents/100).toFixed(0)]})]}),s.jsxs("div",{className:"flex justify-between p-2 bg-gray-800/30 rounded",children:[s.jsx("span",{className:"text-gray-500",children:"Min confidence"}),s.jsxs("span",{className:"font-mono",children:[h.min_confidence,"%"]})]}),s.jsxs("div",{className:"flex justify-between p-2 bg-gray-800/30 rounded",children:[s.jsx("span",{className:"text-gray-500",children:"Take profit"}),s.jsxs("span",{className:"font-mono",children:[h.take_profit_pct,"%"]})]}),s.jsxs("div",{className:"flex justify-between p-2 bg-gray-800/30 rounded",children:[s.jsx("span",{className:"text-gray-500",children:"Stop loss"}),s.jsxs("span",{className:"font-mono",children:[h.stop_loss_pct,"%"]})]})]})]}),s.jsxs("div",{className:"card",children:[s.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-3",children:"System Health"}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("div",{className:"flex justify-between p-2 bg-gray-800/30 rounded",children:[s.jsx("span",{className:"text-gray-500",children:"Memory (RSS)"}),s.jsxs("span",{className:"font-mono",children:[x.rss_mb||"?","MB"]})]}),s.jsxs("div",{className:"flex justify-between p-2 bg-gray-800/30 rounded",children:[s.jsx("span",{className:"text-gray-500",children:"Heap Used"}),s.jsxs("span",{className:"font-mono",children:[x.heapUsed_mb||"?","MB"]})]}),s.jsxs("div",{className:"flex justify-between p-2 bg-gray-800/30 rounded",children:[s.jsx("span",{className:"text-gray-500",children:"Heap Total"}),s.jsxs("span",{className:"font-mono",children:[x.heapTotal_mb||"?","MB"]})]}),s.jsxs("div",{className:"flex justify-between p-2 bg-gray-800/30 rounded",children:[s.jsx("span",{className:"text-gray-500",children:"Uptime"}),s.jsxs("span",{className:"font-mono",children:[(a==null?void 0:a.uptime_hours)||"?","h"]})]}),s.jsxs("div",{className:"flex justify-between p-2 bg-gray-800/30 rounded",children:[s.jsx("span",{className:"text-gray-500",children:"Cached Markets"}),s.jsx("span",{className:"font-mono text-amber-400",children:(a==null?void 0:a.cachedMarkets)||0})]}),s.jsxs("div",{className:"flex justify-between p-2 bg-gray-800/30 rounded",children:[s.jsx("span",{className:"text-gray-500",children:"PID"}),s.jsx("span",{className:"font-mono text-gray-400",children:(a==null?void 0:a.pid)||"?"})]}),s.jsxs("div",{className:"flex justify-between p-2 bg-gray-800/30 rounded",children:[s.jsx("span",{className:"text-gray-500",children:"Available Budget"}),s.jsxs("span",{className:"font-mono text-green-400",children:["$",((p.available||0)/100).toFixed(2)]})]})]})]})]}),s.jsxs("div",{className:"card overflow-x-auto",children:[s.jsx("h3",{className:"font-semibold mb-3",children:"Trade History"}),s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Time"}),s.jsx("th",{children:"Market"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Qty"}),s.jsx("th",{children:"Entry"}),s.jsx("th",{children:"Exit"}),s.jsx("th",{children:"P&L"}),s.jsx("th",{children:"Type"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:b.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:9,className:"text-center text-gray-500 py-8",children:"No trades yet — signals are generating, waiting for execution"})}):b.map((y,m)=>{const g=parseInt(y.pnl_cents)||0;return s.jsxs("tr",{children:[s.jsxs("td",{className:"text-xs text-gray-500 whitespace-nowrap",children:[new Date(y.created_at).toLocaleDateString()," ",new Date(y.created_at).toLocaleTimeString()]}),s.jsx("td",{className:"max-w-[200px] truncate text-sm",children:s.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((y.ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"text-amber-400 hover:text-amber-300 hover:underline transition",children:y.title||y.ticker})}),s.jsx("td",{children:s.jsx("span",{className:`badge ${y.side==="yes"?"bg-green":"bg-red"}`,children:(y.side||"").toUpperCase()})}),s.jsx("td",{className:"font-mono text-gray-400",children:y.count}),s.jsxs("td",{className:"font-mono text-gray-400",children:[y.price_cents,"c"]}),s.jsx("td",{className:"font-mono text-gray-400",children:y.exit_price?`${y.exit_price}c`:"—"}),s.jsx("td",{className:`font-mono font-bold ${g>0?"text-green-400":g<0?"text-red-400":"text-gray-500"}`,children:g!==0?`${g>0?"+":""}$${(g/100).toFixed(2)}`:"—"}),s.jsx("td",{className:"text-xs text-gray-500",children:y.signal_type}),s.jsx("td",{children:s.jsx("span",{className:`badge ${y.status==="open"?"bg-blue":y.status==="profit"?"bg-green":y.status==="stopped"?"bg-red":"bg-yellow"}`,children:y.status})})]},m)})})]})]})]})}const gZ={trump:"Politics",president:"Politics",impeach:"Politics",congress:"Politics",senate:"Politics",house:"Politics",governor:"Politics",election:"Politics",democrat:"Politics",republican:"Politics",vote:"Politics",biden:"Politics",vance:"Politics",cabinet:"Politics",scotus:"Politics",supreme:"Politics",pardon:"Politics",approval:"Politics",poll:"Politics",secretary:"Politics",defense:"Politics",attorney:"Politics",gdp:"Economy",inflation:"Economy",cpi:"Economy",fed:"Economy","interest rate":"Economy",unemployment:"Economy",jobs:"Economy",payroll:"Economy",recession:"Economy",stock:"Economy",sp500:"Economy","s&p":"Economy",nasdaq:"Economy",dow:"Economy",treasury:"Economy",bond:"Economy",debt:"Economy",trade:"Economy",tariff:"Economy",deficit:"Economy",temperature:"Weather",rain:"Weather",snow:"Weather",hurricane:"Weather",weather:"Weather",tornado:"Weather",flood:"Weather",heat:"Weather",cold:"Weather",storm:"Weather",wind:"Weather",precipitation:"Weather",climate:"Weather",bitcoin:"Crypto",btc:"Crypto",ethereum:"Crypto",eth:"Crypto",crypto:"Crypto",token:"Crypto",blockchain:"Crypto",defi:"Crypto",nfl:"Sports",nba:"Sports",mlb:"Sports",nhl:"Sports",soccer:"Sports",tennis:"Sports","super bowl":"Sports",championship:"Sports",game:"Sports",match:"Sports",playoff:"Sports","world series":"Sports",ai:"Tech",spacex:"Tech",tesla:"Tech",apple:"Tech",google:"Tech",meta:"Tech",openai:"Tech",chatgpt:"Tech",tech:"Tech",rocket:"Tech",launch:"Tech",oscar:"Culture",movie:"Culture",tv:"Culture",celebrity:"Culture",grammy:"Culture",award:"Culture",music:"Culture",entertainment:"Culture",oil:"Energy",gas:"Energy",energy:"Energy",solar:"Energy",opec:"Energy",crude:"Energy",coal:"Energy",renewable:"Energy"},mn={Politics:{bg:"#3b82f6",glow:"rgba(59,130,246,0.3)",gradient:"from-blue-500/20 to-blue-600/10"},Economy:{bg:"#22c55e",glow:"rgba(34,197,94,0.3)",gradient:"from-green-500/20 to-green-600/10"},Weather:{bg:"#06b6d4",glow:"rgba(6,182,212,0.3)",gradient:"from-cyan-500/20 to-cyan-600/10"},Crypto:{bg:"#f59e0b",glow:"rgba(245,158,11,0.3)",gradient:"from-amber-500/20 to-amber-600/10"},Sports:{bg:"#a855f7",glow:"rgba(168,85,247,0.3)",gradient:"from-purple-500/20 to-purple-600/10"},Tech:{bg:"#ec4899",glow:"rgba(236,72,153,0.3)",gradient:"from-pink-500/20 to-pink-600/10"},Culture:{bg:"#f97316",glow:"rgba(249,115,22,0.3)",gradient:"from-orange-500/20 to-orange-600/10"},Energy:{bg:"#eab308",glow:"rgba(234,179,8,0.3)",gradient:"from-yellow-500/20 to-yellow-600/10"},Other:{bg:"#64748b",glow:"rgba(100,116,139,0.3)",gradient:"from-slate-500/20 to-slate-600/10"}};function G1(e){const t=(e||"").toLowerCase();for(const[r,n]of Object.entries(gZ))if(t.includes(r))return n;return"Other"}function Y1(e){return e>5e4?"#22c55e":e>1e4?"#4ade80":e>1e3?"#86efac":e>0?"#bbf7d0":e===0?"#475569":e>-1e3?"#fecaca":e>-1e4?"#f87171":"#ef4444"}function q1(e){return e>5e4?"rgba(34,197,94,0.35)":e>1e4?"rgba(34,197,94,0.25)":e>1e3?"rgba(34,197,94,0.15)":e>0?"rgba(34,197,94,0.08)":e===0?"rgba(100,116,139,0.15)":e>-1e3?"rgba(239,68,68,0.08)":e>-1e4?"rgba(239,68,68,0.15)":"rgba(239,68,68,0.30)"}function oa(e,t,r,n,a){if(!e.length)return[];if(e.length===1)return[{...e[0],x:t,y:r,w:n,h:a}];const i=e.reduce((p,v)=>p+v.size,0);if(i===0)return e.map(p=>({...p,x:t,y:r,w:0,h:0}));let o=0,l=0;const c=i*.5;for(let p=0;p<e.length;p++)if(o+=e[p].size,o>=c){l=p+1;break}l===0&&(l=1),l>=e.length&&(l=e.length-1);const u=e.slice(0,l),d=e.slice(l),h=u.reduce((p,v)=>p+v.size,0)/i;if(n>=a){const p=n*h;return[...oa(u,t,r,p,a),...oa(d,t+p,r,n-p,a)]}else{const p=a*h;return[...oa(u,t,r,n,p),...oa(d,t,r+p,n,a-p)]}}function f2({item:e,onClick:t,isSelected:r}){const n=(e.pnl/100).toFixed(2),a=e.trades>0?(e.wins/e.trades*100).toFixed(0):"0",i=e.w<120||e.h<80,o=e.w<80||e.h<50;return s.jsxs("div",{onClick:()=>t(e),className:"absolute cursor-pointer transition-all duration-300 overflow-hidden group",style:{left:e.x,top:e.y,width:e.w,height:e.h,backgroundColor:q1(e.pnl),border:r?"2px solid #f59e0b":"1px solid rgba(30,41,59,0.8)",borderRadius:6,zIndex:r?10:1},children:[s.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-200",style:{background:`radial-gradient(circle at center, ${q1(e.pnl)}, transparent)`}}),s.jsxs("div",{className:"relative h-full p-1.5 flex flex-col justify-between z-10",children:[!o&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"truncate text-[10px] font-medium text-gray-200 leading-tight",children:e.shortTitle}),s.jsxs("div",{className:"flex items-end justify-between mt-auto",children:[s.jsxs("span",{className:"font-mono font-bold text-xs",style:{color:Y1(e.pnl)},children:[e.pnl>=0?"+":"",n>999?`$${(e.pnl/100/1e3).toFixed(1)}k`:`$${n}`]}),!i&&s.jsxs("span",{className:`text-[9px] font-bold ${Number(a)>=80?"text-green-400":Number(a)>=50?"text-amber-400":"text-red-400"}`,children:[a,"%"]})]})]}),o&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("span",{className:"font-mono font-bold text-[10px]",style:{color:Y1(e.pnl)},children:[e.pnl>=0?"+":"",(e.pnl/100).toFixed(0)]})})]})]})}function yZ({category:e,items:t,x:r,y:n,w:a,h:i,onTileClick:o,selectedTicker:l}){const c=mn[e]||mn.Other,u=t.reduce((p,v)=>p+v.pnl,0),d=t.reduce((p,v)=>p+v.trades,0),f=Math.min(28,i*.15),h=oa(t,0,0,a,i-f);return s.jsxs("div",{className:"absolute overflow-hidden",style:{left:r,top:n,width:a,height:i,borderRadius:8,border:`1px solid ${c.bg}40`},children:[s.jsxs("div",{className:"flex items-center justify-between px-2 relative z-20",style:{height:f,background:`linear-gradient(135deg, ${c.bg}30, ${c.bg}10)`,borderBottom:`1px solid ${c.bg}40`},children:[s.jsx("span",{className:"text-xs font-bold tracking-wide",style:{color:c.bg},children:e}),s.jsxs("span",{className:"text-[10px] font-mono",style:{color:u>=0?"#22c55e":"#ef4444"},children:[u>=0?"+":"","$",(u/100).toFixed(0)," | ",d," trades"]})]}),s.jsx("div",{className:"relative",style:{height:i-f},children:h.map(p=>s.jsx(f2,{item:{...p,y:p.y},onClick:o,isSelected:l===p.ticker},p.ticker))})]})}function vZ({market:e,onClose:t}){if(!e)return null;const r=(e.pnl/100).toFixed(2),n=e.trades>0?(e.wins/e.trades*100).toFixed(1):"0";return s.jsxs("div",{className:"card border border-amber-500/30 bg-gradient-to-br from-gray-800/90 to-gray-900/90 backdrop-blur-sm",children:[s.jsxs("div",{className:"flex items-start justify-between mb-3",children:[s.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[s.jsx("h3",{className:"text-sm font-bold text-gray-100 truncate",children:e.title}),s.jsx("p",{className:"text-xs text-gray-500 font-mono mt-1",children:e.ticker})]}),s.jsx("button",{onClick:t,className:"text-gray-500 hover:text-gray-300 text-lg leading-none",children:"×"})]}),s.jsxs("div",{className:"grid grid-cols-4 gap-3 text-center",children:[s.jsxs("div",{className:"rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"P&L"}),s.jsxs("p",{className:`text-lg font-bold font-mono ${e.pnl>=0?"text-green-400":"text-red-400"}`,children:[e.pnl>=0?"+":"","$",r]})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Win Rate"}),s.jsxs("p",{className:`text-lg font-bold ${Number(n)>=80?"text-green-400":Number(n)>=50?"text-amber-400":"text-red-400"}`,children:[n,"%"]})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Total Trades"}),s.jsx("p",{className:"text-lg font-bold text-amber-400",children:e.trades.toLocaleString()})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Record"}),s.jsxs("p",{className:"text-lg font-bold",children:[s.jsx("span",{className:"text-green-400",children:e.wins}),s.jsx("span",{className:"text-gray-600 mx-0.5",children:"-"}),s.jsx("span",{className:"text-red-400",children:e.losses})]})]})]}),s.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs",children:[s.jsxs("span",{className:"text-gray-500",children:["Category: ",s.jsx("span",{style:{color:(mn[e.category]||mn.Other).bg},children:e.category})]}),e.url&&s.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-amber-400 hover:text-amber-300 transition",children:"View on Kalshi →"})]}),e.edge&&s.jsx("div",{className:"mt-2 text-[11px] text-gray-400 bg-gray-800/40 rounded-lg px-3 py-2 border border-gray-700/30",children:e.edge})]})}function xZ(){const e=[{label:"> $500",color:"#22c55e",bg:"rgba(34,197,94,0.35)"},{label:"$100-500",color:"#4ade80",bg:"rgba(34,197,94,0.25)"},{label:"$10-100",color:"#86efac",bg:"rgba(34,197,94,0.15)"},{label:"$0-10",color:"#bbf7d0",bg:"rgba(34,197,94,0.08)"},{label:"$0",color:"#475569",bg:"rgba(100,116,139,0.15)"},{label:"-$10",color:"#fecaca",bg:"rgba(239,68,68,0.08)"},{label:"-$100",color:"#f87171",bg:"rgba(239,68,68,0.15)"},{label:"< -$100",color:"#ef4444",bg:"rgba(239,68,68,0.30)"}];return s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[s.jsx("span",{className:"text-[10px] text-gray-500 mr-1",children:"P&L:"}),e.map(t=>s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"w-3 h-3 rounded-sm border border-gray-700/50",style:{backgroundColor:t.bg}}),s.jsx("span",{className:"text-[9px] text-gray-500",children:t.label})]},t.label))]})}function bZ(){var w;const[e,t]=O.useState(null),[r,n]=O.useState(null),[a,i]=O.useState(!0),[o,l]=O.useState(null),[c,u]=O.useState("category"),[d,f]=O.useState("pnl");O.useEffect(()=>{h();const _=setInterval(h,3e4);return()=>clearInterval(_)},[]);async function h(){try{const[_,N]=await Promise.all([Pe("/dashboard"),Pe("/signals")]);t(_),n(N)}catch{}i(!1)}const{categories:p,allMarkets:v,summary:b}=O.useMemo(()=>{if(!e)return{categories:{},allMarkets:[],summary:{}};const _=[],N=new Set;for(const A of e.top_markets||[])if(!N.has(A.ticker)){N.add(A.ticker);const I=G1(A.title);_.push({...A,category:I,trades:(A.wins||0)+(A.losses||0),shortTitle:(A.title||A.ticker).split("?")[0].substring(0,40),size:Math.max(Math.abs(A.pnl||1),100)})}for(const A of e.worst_markets||[])if(!N.has(A.ticker)){N.add(A.ticker);const I=G1(A.title);_.push({...A,category:I,trades:(A.wins||0)+(A.losses||0),shortTitle:(A.title||A.ticker).split("?")[0].substring(0,40),size:Math.max(Math.abs(A.pnl||1),100)})}for(const A of e.strategies||[]){const I=`strategy-${A.strategy||A.name}`;N.has(I)||(N.add(I),_.push({ticker:I,title:`Strategy: ${A.name}`,shortTitle:A.name,category:"Other",wins:A.wins||0,losses:A.losses||0,trades:(A.wins||0)+(A.losses||0),pnl:A.pnl||0,edge:`Win Rate: ${A.win_rate||0}%`,size:Math.max(Math.abs(A.pnl||1),100)}))}d==="pnl"?_.sort((A,I)=>I.pnl-A.pnl):d==="trades"?_.sort((A,I)=>I.trades-A.trades):d==="winrate"&&_.sort((A,I)=>{const B=A.trades>0?A.wins/A.trades:0;return(I.trades>0?I.wins/I.trades:0)-B});const P={};for(const A of _)P[A.category]||(P[A.category]=[]),P[A.category].push(A);const k=_.reduce((A,I)=>A+I.pnl,0),T=_.reduce((A,I)=>A+I.trades,0),C=_.reduce((A,I)=>A+I.wins,0),$=_.reduce((A,I)=>A+I.losses,0),M=_.filter(A=>A.pnl>0).length;return{categories:P,allMarkets:_,summary:{totalPnl:k,totalTrades:T,totalWins:C,totalLosses:$,profitableCount:M,totalMarkets:_.length}}},[e,d]),x=v.find(_=>_.ticker===o);if(a)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})});const y=1200,m=700,g=Object.entries(p).sort((_,N)=>{const P=_[1].reduce((T,C)=>T+Math.abs(C.pnl),0);return N[1].reduce((T,C)=>T+Math.abs(C.pnl),0)-P}),S=oa(g.map(([_,N])=>({name:_,size:N.reduce((P,k)=>P+Math.abs(k.pnl||1),0)+N.length*100,items:N})),0,0,y,m),j=c==="flat"?oa(v.map(_=>({..._,size:Math.max(Math.abs(_.pnl||1),200)})),0,0,y,m):[];return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Market Heatmap"}),s.jsx("p",{className:"text-gray-500 text-sm",children:"Treemap visualization of trading activity and P&L by market category"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex items-center gap-1 bg-gray-800 rounded-lg p-0.5",children:["category","flat"].map(_=>s.jsx("button",{onClick:()=>u(_),className:`px-3 py-1.5 text-xs font-medium rounded-md transition ${c===_?"bg-amber-500 text-black":"text-gray-400 hover:text-gray-200"}`,children:_==="category"?"By Category":"All Markets"},_))}),s.jsxs("select",{value:d,onChange:_=>f(_.target.value),className:"bg-gray-800 border border-gray-700 rounded-lg px-3 py-1.5 text-xs text-gray-300 focus:outline-none focus:border-amber-500",children:[s.jsx("option",{value:"pnl",children:"Sort by P&L"}),s.jsx("option",{value:"trades",children:"Sort by Trades"}),s.jsx("option",{value:"winrate",children:"Sort by Win Rate"})]}),s.jsx("button",{onClick:h,className:"btn btn-o text-sm",children:"Refresh"})]})]}),s.jsx("div",{className:"grid grid-cols-6 gap-3",children:[{label:"Total P&L",value:`${b.totalPnl>=0?"+":""}$${(b.totalPnl/100).toLocaleString(void 0,{minimumFractionDigits:0})}`,color:b.totalPnl>=0?"text-green-400":"text-red-400"},{label:"Total Trades",value:((w=b.totalTrades)==null?void 0:w.toLocaleString())||"0",color:"text-amber-400"},{label:"Win Rate",value:b.totalTrades>0?`${(b.totalWins/b.totalTrades*100).toFixed(1)}%`:"0%",color:"text-blue-400"},{label:"Markets",value:b.totalMarkets||0,color:"text-purple-400"},{label:"Profitable",value:b.profitableCount||0,color:"text-green-400"},{label:"Categories",value:Object.keys(p).length,color:"text-cyan-400"}].map(_=>s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase mb-1",children:_.label}),s.jsx("p",{className:`text-xl font-bold ${_.color}`,children:_.value})]},_.label))}),s.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:Object.entries(p).map(([_,N])=>{const P=mn[_]||mn.Other,k=N.reduce((T,C)=>T+C.pnl,0);return s.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full border",style:{backgroundColor:`${P.bg}15`,borderColor:`${P.bg}40`},children:[s.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:P.bg}}),s.jsx("span",{className:"text-xs font-medium",style:{color:P.bg},children:_}),s.jsx("span",{className:"text-[10px] text-gray-500",children:N.length}),s.jsxs("span",{className:`text-[10px] font-mono font-bold ${k>=0?"text-green-400":"text-red-400"}`,children:[k>=0?"+":"","$",(k/100).toFixed(0)]})]},_)})}),s.jsxs("div",{className:"card p-2 relative overflow-hidden",style:{minHeight:m+20},children:[s.jsx("div",{className:"relative",style:{width:y,height:m,margin:"0 auto",maxWidth:"100%"},children:c==="category"?S.map(_=>s.jsx(yZ,{category:_.name,items:_.items,x:_.x,y:_.y,w:_.w,h:_.h,onTileClick:N=>l(N.ticker===o?null:N.ticker),selectedTicker:o},_.name)):j.map(_=>s.jsx(f2,{item:_,onClick:N=>l(N.ticker===o?null:N.ticker),isSelected:o===_.ticker},_.ticker))}),s.jsx("div",{className:"mt-3 px-2",children:s.jsx(xZ,{})})]}),x&&s.jsx(vZ,{market:x,onClose:()=>l(null)}),s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"flex items-center gap-2 mb-4",children:s.jsx("h2",{className:"font-semibold",children:"Category Breakdown"})}),s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Markets"}),s.jsx("th",{children:"Total Trades"}),s.jsx("th",{children:"Win Rate"}),s.jsx("th",{children:"P&L"}),s.jsx("th",{children:"Best Market"})]})}),s.jsx("tbody",{children:g.map(([_,N])=>{const P=mn[_]||mn.Other,k=N.reduce((A,I)=>A+I.pnl,0),T=N.reduce((A,I)=>A+I.trades,0),C=N.reduce((A,I)=>A+I.wins,0),$=T>0?(C/T*100).toFixed(1):"0",M=N.reduce((A,I)=>I.pnl>((A==null?void 0:A.pnl)||-1/0)?I:A,N[0]);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:P.bg}}),s.jsx("span",{className:"font-medium",style:{color:P.bg},children:_})]})}),s.jsx("td",{className:"text-gray-300",children:N.length}),s.jsx("td",{className:"text-gray-300 font-mono",children:T.toLocaleString()}),s.jsxs("td",{className:`font-mono font-bold ${Number($)>=80?"text-green-400":Number($)>=50?"text-amber-400":"text-red-400"}`,children:[$,"%"]}),s.jsxs("td",{className:`font-mono font-bold ${k>=0?"text-green-400":"text-red-400"}`,children:[k>=0?"+":"","$",(k/100).toFixed(2)]}),s.jsx("td",{className:"text-gray-400 text-xs truncate max-w-[200px]",children:(M==null?void 0:M.shortTitle)||"--"})]},_)})})]})]})]})}const Lo=[{radius:80,label:"Core",color:"#f59e0b",opacity:.4,description:"Highest confidence"},{radius:160,label:"Inner",color:"#22c55e",opacity:.3,description:"Strong signals"},{radius:240,label:"Mid",color:"#3b82f6",opacity:.2,description:"Moderate signals"},{radius:320,label:"Outer",color:"#8b5cf6",opacity:.15,description:"Weak signals"},{radius:400,label:"Edge",color:"#ef4444",opacity:.1,description:"Speculative"}],Vi={BUY_YES:{fill:"#22c55e",stroke:"#16a34a",glow:"rgba(34,197,94,0.5)"},BUY_NO:{fill:"#ef4444",stroke:"#dc2626",glow:"rgba(239,68,68,0.5)"},YES:{fill:"#22c55e",stroke:"#16a34a",glow:"rgba(34,197,94,0.5)"},NO:{fill:"#ef4444",stroke:"#dc2626",glow:"rgba(239,68,68,0.5)"}};function _g(e){return e>=.9?"#22c55e":e>=.7?"#f59e0b":e>=.5?"#3b82f6":e>=.3?"#8b5cf6":"#ef4444"}function d2(e){return e>=.9?0:e>=.75?1:e>=.6?2:e>=.4?3:4}function jZ({width:e,height:t}){const r=O.useMemo(()=>{const n=[];for(let a=0;a<80;a++)n.push({x:Math.random()*e,y:Math.random()*t,r:Math.random()*1.2+.3,opacity:Math.random()*.5+.1,delay:Math.random()*3});return n},[e,t]);return s.jsx(s.Fragment,{children:r.map((n,a)=>s.jsx("circle",{cx:n.x,cy:n.y,r:n.r,fill:"white",opacity:n.opacity,className:"animate-pulse",style:{animationDelay:`${n.delay}s`,animationDuration:`${2+Math.random()*3}s`}},a))})}function wZ({market:e,cx:t,cy:r,size:n,isSelected:a,onSelect:i,animate:o}){var f,h;const l=Vi[e.direction]||Vi.BUY_YES,c=parseFloat(e.confidence)||0,u=_g(c),d=n+4;return s.jsxs("g",{onClick:()=>i(e),className:"cursor-pointer",style:{transition:"all 0.5s ease-out"},children:[s.jsx("circle",{cx:t,cy:r,r:d,fill:"none",stroke:l.glow,strokeWidth:1.5,opacity:a?.8:.3,className:o?"animate-ping":"",style:{animationDuration:"2s",transformOrigin:`${t}px ${r}px`}}),s.jsx("circle",{cx:t,cy:r,r:n+2,fill:"none",stroke:u,strokeWidth:2,opacity:.6,strokeDasharray:`${c*20} ${(1-c)*20}`}),s.jsx("circle",{cx:t,cy:r,r:n,fill:`url(#gradient-${(f=e.ticker)==null?void 0:f.replace(/[^a-zA-Z0-9]/g,"")})`,stroke:a?"#f59e0b":l.stroke,strokeWidth:a?2.5:1,className:"transition-all duration-300"}),s.jsx("defs",{children:s.jsxs("radialGradient",{id:`gradient-${(h=e.ticker)==null?void 0:h.replace(/[^a-zA-Z0-9]/g,"")}`,children:[s.jsx("stop",{offset:"0%",stopColor:l.fill,stopOpacity:"0.9"}),s.jsx("stop",{offset:"70%",stopColor:l.fill,stopOpacity:"0.6"}),s.jsx("stop",{offset:"100%",stopColor:l.stroke,stopOpacity:"0.4"})]})}),n>=8&&s.jsx("text",{x:t,y:r+1,textAnchor:"middle",dominantBaseline:"middle",fill:"white",fontSize:Math.max(7,n*.6),fontWeight:"bold",fontFamily:"monospace",style:{pointerEvents:"none"},children:e.edge_display||""}),n>=10&&s.jsx("text",{x:t,y:r+n+12,textAnchor:"middle",fill:"#94a3b8",fontSize:8,style:{pointerEvents:"none"},children:(e.shortTitle||"").substring(0,18)})]})}function SZ({market:e,onClose:t}){var i;if(!e)return null;const r=parseFloat(e.confidence)||0,n=parseFloat(e.expected_edge)||0,a=Vi[e.direction]||Vi.BUY_YES;return s.jsxs("div",{className:"card border border-amber-500/30 bg-gradient-to-br from-gray-800/95 to-gray-900/95 backdrop-blur-md",children:[s.jsxs("div",{className:"flex items-start justify-between mb-3",children:[s.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"inline-block w-3 h-3 rounded-full",style:{backgroundColor:a.fill}}),s.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold ${e.direction==="BUY_YES"||e.direction==="YES"?"bg-green-500/20 text-green-400 border border-green-500/30":"bg-red-500/20 text-red-400 border border-red-500/30"}`,children:e.direction}),e.risk_approved&&s.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-bold bg-green-500/15 text-green-400 border border-green-500/20",children:"APPROVED"}),!e.risk_approved&&s.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-bold bg-red-500/15 text-red-400 border border-red-500/20",children:"BLOCKED"})]}),s.jsx("h3",{className:"text-sm font-bold text-gray-100",children:e.title||e.ticker}),s.jsx("p",{className:"text-xs text-gray-500 font-mono mt-1",children:e.ticker})]}),s.jsx("button",{onClick:t,className:"text-gray-500 hover:text-gray-300 text-lg",children:"×"})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-3",children:[s.jsxs("div",{className:"rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50 text-center",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Edge"}),s.jsxs("p",{className:"text-lg font-bold text-amber-400 font-mono",children:[(n*100).toFixed(1),"%"]})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50 text-center",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Confidence"}),s.jsxs("p",{className:"text-lg font-bold font-mono",style:{color:_g(r)},children:[(r*100).toFixed(0),"%"]})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50 text-center",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Orbit Ring"}),s.jsx("p",{className:"text-lg font-bold text-purple-400",children:((i=Lo[d2(r)])==null?void 0:i.label)||"Edge"})]})]}),e.reasoning&&s.jsx("div",{className:"text-[11px] text-gray-400 bg-gray-800/40 rounded-lg px-3 py-2 border border-gray-700/30 mb-3 leading-relaxed",children:e.reasoning}),e.sources&&e.sources.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase font-medium",children:"Signal Sources"}),e.sources.map((o,l)=>{var c;return s.jsxs("div",{className:"flex items-center gap-2 text-xs bg-gray-800/30 rounded-lg px-3 py-2 border border-gray-700/20",children:[s.jsx("span",{className:"px-1.5 py-0.5 rounded bg-blue-500/15 text-blue-400 text-[9px] font-bold",children:o.source}),s.jsx("span",{className:"text-gray-400 truncate flex-1",children:o.headline}),s.jsxs("span",{className:`font-mono text-[10px] ${o.sentiment>0?"text-green-400":o.sentiment<0?"text-red-400":"text-gray-500"}`,children:[o.sentiment>0?"+":"",(c=o.sentiment)==null?void 0:c.toFixed(2)]})]},l)})]}),s.jsxs("div",{className:"mt-3 text-[10px] text-gray-600",children:["Signal created: ",e.created_at?new Date(e.created_at).toLocaleString("en-US",{timeZone:"America/Los_Angeles",hour:"2-digit",minute:"2-digit",month:"short",day:"numeric"}):"Unknown"]})]})}function _Z(){const[e,t]=O.useState(null),[r,n]=O.useState(null),[a,i]=O.useState(!0),[o,l]=O.useState(null),[c,u]=O.useState("all"),[d,f]=O.useState(!0),h=O.useRef(null);O.useEffect(()=>{p();const N=setInterval(p,3e4);return()=>clearInterval(N)},[]);async function p(){try{const[N,P,k]=await Promise.all([Pe("/dashboard"),Pe("/signals"),Pe("/signals/dashboard")]);t(N),n({signals:(P==null?void 0:P.signals)||[],dashboard:k})}catch{}i(!1)}const{orbitalMarkets:v,stats:b}=O.useMemo(()=>{if(!(r!=null&&r.signals))return{orbitalMarkets:[],stats:{}};let N=r.signals.map(M=>{var F,K;const A=parseFloat(M.confidence)||0,I=parseFloat(M.expected_edge)||0,B=d2(A),R=((F=(M.ticker||"").split("-")[0])==null?void 0:F.replace("KX","").substring(0,12))||M.ticker;return{...M,shortTitle:R,title:((K=M.reasoning)==null?void 0:K.split('"')[1])||M.ticker,ring:B,conf:A,edge:I,edge_display:`${(I*100).toFixed(0)}%`,size:Math.max(6,Math.min(22,I*120+6))}});c==="approved"&&(N=N.filter(M=>M.risk_approved)),c==="yes"&&(N=N.filter(M=>M.direction==="BUY_YES")),c==="no"&&(N=N.filter(M=>M.direction==="BUY_NO")),N.sort((M,A)=>A.edge-M.edge),N=N.slice(0,60);const P=N.filter(M=>M.risk_approved).length,k=N.filter(M=>M.direction==="BUY_YES").length,T=N.filter(M=>M.direction==="BUY_NO").length,C=N.length>0?N.reduce((M,A)=>M+A.conf,0)/N.length:0,$=N.length>0?N.reduce((M,A)=>M+A.edge,0)/N.length:0;return{orbitalMarkets:N,stats:{total:N.length,approved:P,buyYes:k,buyNo:T,avgConf:C,avgEdge:$}}},[r,c]),x=v.find(N=>N.ticker===o);if(a)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})});const y=450,m=430,g=900,S=860,j={};v.forEach(N=>{j[N.ring]=(j[N.ring]||0)+1});const w={},_=v.map(N=>{const P=Lo[N.ring];w[N.ring]||(w[N.ring]=0);const k=w[N.ring]++,T=j[N.ring],$=2*Math.PI/T*k+N.ring*.4,M=Math.sin(k*7.3)*.15,A=$+M,I=P.radius+Math.cos(k*3.7)*15;return{...N,cx:y+I*Math.cos(A),cy:m+I*Math.sin(A)}});return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Signal Orbit"}),s.jsx("p",{className:"text-gray-500 text-sm",children:"Radial visualization -- distance from center = confidence, size = edge strength"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex items-center gap-1 bg-gray-800 rounded-lg p-0.5",children:[{key:"all",label:"All"},{key:"approved",label:"Approved"},{key:"yes",label:"BUY YES"},{key:"no",label:"BUY NO"}].map(N=>s.jsx("button",{onClick:()=>u(N.key),className:`px-3 py-1.5 text-xs font-medium rounded-md transition ${c===N.key?"bg-amber-500 text-black":"text-gray-400 hover:text-gray-200"}`,children:N.label},N.key))}),s.jsxs("label",{className:"flex items-center gap-2 text-xs text-gray-400 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:d,onChange:N=>f(N.target.checked),className:"rounded border-gray-600"}),"Animate"]}),s.jsx("button",{onClick:p,className:"btn btn-o text-sm",children:"Refresh"})]})]}),s.jsx("div",{className:"grid grid-cols-6 gap-3",children:[{label:"Active Signals",value:b.total||0,color:"text-amber-400"},{label:"Risk Approved",value:b.approved||0,color:"text-green-400"},{label:"BUY YES",value:b.buyYes||0,color:"text-green-400"},{label:"BUY NO",value:b.buyNo||0,color:"text-red-400"},{label:"Avg Confidence",value:`${(b.avgConf*100).toFixed(0)}%`,color:"text-blue-400"},{label:"Avg Edge",value:`${(b.avgEdge*100).toFixed(1)}%`,color:"text-purple-400"}].map(N=>s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase mb-1",children:N.label}),s.jsx("p",{className:`text-xl font-bold ${N.color}`,children:N.value})]},N.label))}),s.jsxs("div",{className:"card p-0 overflow-hidden relative",style:{background:"radial-gradient(ellipse at center, #0f172a 0%, #020617 70%, #000 100%)"},children:[s.jsxs("svg",{ref:h,viewBox:`0 0 ${g} ${S}`,className:"w-full",style:{maxHeight:"75vh"},children:[s.jsx(jZ,{width:g,height:S}),Lo.map((N,P)=>s.jsxs("g",{children:[s.jsx("circle",{cx:y,cy:m,r:N.radius,fill:"none",stroke:N.color,strokeWidth:.8,opacity:N.opacity,strokeDasharray:"4 4"}),s.jsx("text",{x:y+N.radius+6,y:m-4,fill:N.color,fontSize:9,opacity:N.opacity+.2,fontFamily:"monospace",children:N.label})]},P)),s.jsxs("defs",{children:[s.jsxs("radialGradient",{id:"sun-gradient",children:[s.jsx("stop",{offset:"0%",stopColor:"#fbbf24",stopOpacity:"1"}),s.jsx("stop",{offset:"50%",stopColor:"#f59e0b",stopOpacity:"0.8"}),s.jsx("stop",{offset:"100%",stopColor:"#d97706",stopOpacity:"0.4"})]}),s.jsxs("filter",{id:"sun-glow",children:[s.jsx("feGaussianBlur",{stdDeviation:"8",result:"blur"}),s.jsxs("feMerge",{children:[s.jsx("feMergeNode",{in:"blur"}),s.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),s.jsx("circle",{cx:y,cy:m,r:40,fill:"url(#sun-gradient)",filter:"url(#sun-glow)",opacity:.6}),s.jsx("circle",{cx:y,cy:m,r:25,fill:"url(#sun-gradient)"}),s.jsx("text",{x:y,y:m-4,textAnchor:"middle",fill:"#000",fontSize:12,fontWeight:"bold",fontFamily:"monospace",children:"KEN"}),s.jsx("text",{x:y,y:m+10,textAnchor:"middle",fill:"#000",fontSize:7,fontFamily:"monospace",opacity:.7,children:"TRADER"}),_.map(N=>{const P=Vi[N.direction]||Vi.BUY_YES;return s.jsx("line",{x1:y,y1:m,x2:N.cx,y2:N.cy,stroke:P.fill,strokeWidth:.3,opacity:o===N.ticker?.5:.08},`line-${N.ticker}`)}),_.map(N=>s.jsx(wZ,{market:N,cx:N.cx,cy:N.cy,size:N.size,isSelected:o===N.ticker,onSelect:P=>l(P.ticker===o?null:P.ticker),animate:d&&N.risk_approved},N.ticker))]}),s.jsx("div",{className:"absolute bottom-3 left-3 bg-gray-900/80 backdrop-blur-sm rounded-lg p-3 border border-gray-700/50",children:s.jsxs("div",{className:"flex items-center gap-4 text-[10px]",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500"}),s.jsx("span",{className:"text-gray-400",children:"BUY YES"})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),s.jsx("span",{className:"text-gray-400",children:"BUY NO"})]}),s.jsx("div",{className:"text-gray-600",children:"|"}),s.jsx("span",{className:"text-gray-500",children:"Closer to center = higher confidence"}),s.jsx("span",{className:"text-gray-500",children:"Larger = bigger edge"})]})}),s.jsxs("div",{className:"absolute top-3 right-3 bg-gray-900/80 backdrop-blur-sm rounded-lg p-2.5 border border-gray-700/50",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase font-bold mb-1.5",children:"Orbit Rings"}),s.jsx("div",{className:"space-y-1",children:Lo.map((N,P)=>s.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[s.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:N.color,opacity:N.opacity+.3}}),s.jsx("span",{style:{color:N.color},children:N.label}),s.jsx("span",{className:"text-gray-600",children:N.description})]},P))})]})]}),x&&s.jsx(SZ,{market:x,onClose:()=>l(null)}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("h2",{className:"font-semibold",children:"Orbital Signal Registry"}),s.jsxs("span",{className:"text-xs text-gray-500",children:[v.length," signals in orbit"]})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Ring"}),s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Direction"}),s.jsx("th",{children:"Edge"}),s.jsx("th",{children:"Confidence"}),s.jsx("th",{children:"Risk"}),s.jsx("th",{children:"Sources"})]})}),s.jsx("tbody",{children:v.slice(0,20).map(N=>{var k;const P=Lo[N.ring];return s.jsxs("tr",{onClick:()=>l(N.ticker===o?null:N.ticker),className:`cursor-pointer ${o===N.ticker?"bg-amber-500/10":""}`,children:[s.jsx("td",{children:s.jsx("span",{className:"text-xs font-bold",style:{color:P.color},children:P.label})}),s.jsx("td",{className:"text-xs font-mono text-gray-300",children:N.ticker}),s.jsx("td",{children:s.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold ${N.direction==="BUY_YES"?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:N.direction})}),s.jsxs("td",{className:"text-amber-400 font-mono font-bold text-sm",children:[(N.edge*100).toFixed(1),"%"]}),s.jsxs("td",{className:"font-mono text-sm",style:{color:_g(N.conf)},children:[(N.conf*100).toFixed(0),"%"]}),s.jsx("td",{children:N.risk_approved?s.jsx("span",{className:"text-green-400 text-xs font-bold",children:"OK"}):s.jsx("span",{className:"text-red-400 text-xs font-bold",children:"BLOCKED"})}),s.jsx("td",{className:"text-xs text-gray-500",children:((k=N.sources)==null?void 0:k.length)||0})]},N.ticker)})})]})})]})]})}const Yd=[{name:"Economy",icon:"💰",subcategories:["GDP","Inflation","Jobs","Fed Rate","Recession","Trade","Debt","Markets"],keywords:["gdp","inflation","cpi","unemployment","jobs","payroll","fed","interest rate","recession","stock","sp500","nasdaq","dow","treasury","bond","debt","trade","tariff","deficit"],baseColor:[34,197,94]},{name:"Politics",icon:"🏛",subcategories:["White House","Congress","Elections","SCOTUS","Cabinet","Polls","Policy","Foreign"],keywords:["trump","president","impeach","congress","senate","house","governor","election","democrat","republican","vote","biden","vance","cabinet","scotus","supreme","pardon","approval","poll","secretary","defense","attorney"],baseColor:[59,130,246]},{name:"Weather",icon:"⛈",subcategories:["Temperature","Storms","Snow","Rain","Hurricanes","Heat","Wind","Climate"],keywords:["temperature","rain","snow","hurricane","weather","tornado","flood","heat","cold","storm","wind","precipitation","climate"],baseColor:[6,182,212]},{name:"Technology",icon:"💻",subcategories:["AI","SpaceX","Tesla","Big Tech","Startups","Chips","Cyber","Social"],keywords:["ai","spacex","tesla","apple","google","meta","openai","chatgpt","tech","rocket","launch"],baseColor:[236,72,153]},{name:"Crypto",icon:"🪙",subcategories:["Bitcoin","Ethereum","DeFi","NFTs","Regulation","Mining","Stablecoins","Altcoins"],keywords:["bitcoin","btc","ethereum","eth","crypto","token","blockchain","defi"],baseColor:[245,158,11]},{name:"Sports",icon:"🏈",subcategories:["NFL","NBA","MLB","Soccer","Tennis","UFC","Olympics","Playoffs"],keywords:["nfl","nba","mlb","nhl","soccer","tennis","super bowl","championship","game","match","playoff","world series"],baseColor:[168,85,247]},{name:"Energy",icon:"⚡",subcategories:["Oil","Gas","Solar","Nuclear","OPEC","EVs","Grid","Coal"],keywords:["oil","gas","energy","solar","opec","crude","coal","renewable"],baseColor:[234,179,8]},{name:"Culture",icon:"🎬",subcategories:["Movies","Music","Awards","TV","Social Media","Trends","Celebrity","Gaming"],keywords:["oscar","movie","tv","celebrity","grammy","award","music","entertainment"],baseColor:[249,115,22]}];function NZ(e,t){const[r,n,a]=t,i=Math.max(.05,Math.min(.9,e));return`rgba(${r},${n},${a},${i})`}function OZ(e,t){const[r,n,a]=t,i=Math.max(.1,Math.min(.6,e*.8));return`rgba(${r},${n},${a},${i})`}function PZ(e,t){const[r,n,a]=t;return e>.5?`rgb(${Math.min(255,r+60)},${Math.min(255,n+60)},${Math.min(255,a+60)})`:e>.2?`rgb(${r},${n},${a})`:"#64748b"}function kZ({subcategory:e,intensity:t,signalCount:r,sentiment:n,baseColor:a,onClick:i,isSelected:o}){const l=NZ(t,a),c=OZ(t,a),u=PZ(t,a),d=t>.3;return s.jsxs("div",{onClick:i,className:`relative overflow-hidden rounded-lg cursor-pointer transition-all duration-300 group ${o?"ring-2 ring-amber-400 scale-105 z-10":"hover:scale-102"}`,style:{backgroundColor:l,border:`1px solid ${c}`,minHeight:70},children:[d&&s.jsx("div",{className:"absolute inset-0 opacity-10 pointer-events-none",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.03) 2px, rgba(255,255,255,0.03) 4px)"}}),t>.6&&s.jsx("div",{className:"absolute inset-0 animate-pulse opacity-30 pointer-events-none",style:{background:`radial-gradient(circle at center, rgba(${a.join(",")},0.4), transparent 70%)`,animationDuration:`${3-t*2}s`}}),s.jsxs("div",{className:"relative p-2.5 h-full flex flex-col justify-between z-10",children:[s.jsx("div",{children:s.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:u},children:e})}),s.jsxs("div",{className:"flex items-end justify-between mt-1",children:[s.jsxs("div",{children:[r>0&&s.jsx("p",{className:"text-lg font-bold font-mono",style:{color:u},children:r}),r===0&&s.jsx("p",{className:"text-sm text-gray-600",children:"--"})]}),n!==0&&s.jsxs("div",{className:`text-[9px] font-mono font-bold px-1.5 py-0.5 rounded ${n>0?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:[n>0?"+":"",n.toFixed(2)]})]})]}),s.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5",style:{background:`linear-gradient(90deg, transparent, rgba(${a.join(",")},${t}), transparent)`}})]})}function AZ({category:e,subcategoryData:t,onCellClick:r,selectedCell:n}){const a=t.reduce((l,c)=>l+c.signalCount,0),i=Math.max(...t.map(l=>l.intensity),0),o=t.reduce((l,c)=>l+c.sentiment,0)/t.length;return s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:e.icon}),s.jsx("h3",{className:"text-sm font-bold",style:{color:`rgb(${e.baseColor.join(",")})`},children:e.name}),s.jsxs("span",{className:"text-[10px] text-gray-500",children:[a," signals"]})]}),s.jsxs("div",{className:"flex items-center gap-3 text-[10px]",children:[s.jsxs("span",{className:"text-gray-500",children:["Peak: ",s.jsxs("span",{className:"font-bold",style:{color:`rgb(${e.baseColor.join(",")})`},children:[(i*100).toFixed(0),"%"]})]}),s.jsxs("span",{className:`font-mono ${o>0?"text-green-400":o<0?"text-red-400":"text-gray-500"}`,children:["Sentiment: ",o>0?"+":"",o.toFixed(3)]})]})]}),s.jsx("div",{className:"grid grid-cols-8 gap-2",children:t.map(l=>s.jsx(kZ,{subcategory:l.name,intensity:l.intensity,signalCount:l.signalCount,sentiment:l.sentiment,baseColor:e.baseColor,onClick:()=>r({category:e.name,subcategory:l.name,...l}),isSelected:(n==null?void 0:n.category)===e.name&&(n==null?void 0:n.subcategory)===l.name},l.name))})]})}function $Z(){return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-[10px] text-gray-500",children:"Low"}),s.jsx("div",{className:"flex gap-px",children:Array.from({length:10}).map((t,r)=>s.jsx("div",{className:"w-5 h-3 rounded-sm",style:{backgroundColor:`rgba(245,158,11,${(r+1)/10*.8+.05})`}},r))}),s.jsx("span",{className:"text-[10px] text-gray-500",children:"High"})]})}function EZ({cell:e,signals:t,onClose:r}){if(!e)return null;const n=t.filter(a=>{var o;const i=(a.reasoning||a.ticker||"").toLowerCase();return(o=e.matchingKeywords)==null?void 0:o.some(l=>i.includes(l))}).slice(0,10);return s.jsxs("div",{className:"card border border-amber-500/30 bg-gradient-to-br from-gray-800/95 to-gray-900/95 backdrop-blur-md",children:[s.jsxs("div",{className:"flex items-start justify-between mb-3",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"text-lg",children:e.categoryIcon}),s.jsxs("h3",{className:"text-sm font-bold text-gray-100",children:[e.category," / ",e.subcategory]})]}),s.jsxs("p",{className:"text-xs text-gray-500",children:[e.signalCount," signals | Intensity: ",(e.intensity*100).toFixed(0),"% | Sentiment: ",s.jsxs("span",{className:e.sentiment>0?"text-green-400":e.sentiment<0?"text-red-400":"text-gray-400",children:[e.sentiment>0?"+":"",e.sentiment.toFixed(3)]})]})]}),s.jsx("button",{onClick:r,className:"text-gray-500 hover:text-gray-300 text-lg",children:"×"})]}),n.length>0?s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase font-medium",children:"Related Signals"}),n.map((a,i)=>s.jsxs("div",{className:"flex items-center gap-3 text-xs bg-gray-800/40 rounded-lg px-3 py-2 border border-gray-700/20",children:[s.jsx("span",{className:`px-1.5 py-0.5 rounded text-[9px] font-bold ${a.direction==="BUY_YES"?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:a.direction}),s.jsx("span",{className:"text-gray-400 font-mono truncate flex-1",children:a.ticker}),s.jsxs("span",{className:"text-amber-400 font-mono font-bold",children:[(parseFloat(a.expected_edge)*100).toFixed(1),"%"]}),s.jsxs("span",{className:"text-blue-400 font-mono",children:[(parseFloat(a.confidence)*100).toFixed(0),"%"]}),a.risk_approved?s.jsx("span",{className:"text-green-400 text-[9px] font-bold",children:"OK"}):s.jsx("span",{className:"text-red-400 text-[9px] font-bold",children:"BLOCKED"})]},i))]}):s.jsx("p",{className:"text-gray-600 text-sm text-center py-4",children:"No matching signals for this subcategory"})]})}function CZ({categoryStats:e}){const t=Math.max(...e.map(r=>r.totalSignals),1);return s.jsxs("div",{className:"card border border-gray-700/50",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("h2",{className:"font-semibold text-sm",children:"National Activity Overview"}),s.jsx("span",{className:"text-[10px] text-gray-500",children:"Signal density across categories"})]}),s.jsx("div",{className:"space-y-2",children:e.sort((r,n)=>n.totalSignals-r.totalSignals).map(r=>{const n=r.totalSignals/t*100;return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-sm w-5",children:r.icon}),s.jsx("span",{className:"text-xs font-medium w-20",style:{color:`rgb(${r.baseColor.join(",")})`},children:r.name}),s.jsxs("div",{className:"flex-1 h-5 bg-gray-800/60 rounded-full overflow-hidden relative",children:[s.jsx("div",{className:"h-full rounded-full transition-all duration-1000 relative overflow-hidden",style:{width:`${Math.max(n,2)}%`,background:`linear-gradient(90deg, rgba(${r.baseColor.join(",")},0.3), rgba(${r.baseColor.join(",")},0.6))`},children:s.jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%)",animation:"shimmer 2s infinite"}})}),s.jsx("span",{className:"absolute right-2 top-0 bottom-0 flex items-center text-[10px] font-mono text-gray-400",children:r.totalSignals})]}),s.jsxs("span",{className:`text-[10px] font-mono w-12 text-right ${r.avgSentiment>0?"text-green-400":r.avgSentiment<0?"text-red-400":"text-gray-500"}`,children:[r.avgSentiment>0?"+":"",r.avgSentiment.toFixed(2)]})]},r.name)})})]})}function TZ(){const[e,t]=O.useState(null),[r,n]=O.useState(null),[a,i]=O.useState(null),[o,l]=O.useState(!0),[c,u]=O.useState(null),[d,f]=O.useState("24h");O.useEffect(()=>{h();const x=setInterval(h,3e4);return()=>clearInterval(x)},[]);async function h(){try{const[x,y,m]=await Promise.all([Pe("/dashboard"),Pe("/signals"),Pe("/signals/dashboard")]);t(x),n((y==null?void 0:y.signals)||[]),i(m)}catch{}l(!1)}const{categoryData:p,categoryStats:v,overallStats:b}=O.useMemo(()=>{var j;if(!r)return{categoryData:[],categoryStats:[],overallStats:{}};const x=r||[],y=Math.max(...Yd.flatMap(w=>w.subcategories.map(_=>(w.keywords.filter(P=>_.toLowerCase().includes(P.split(" ")[0])||P.includes(_.toLowerCase())),x.filter(P=>{const k=(P.reasoning||P.ticker||"").toLowerCase();return w.keywords.some(T=>k.includes(T))}).length))),1),m=Yd.map(w=>{const _=x.filter(P=>{const k=(P.reasoning||P.ticker||"").toLowerCase();return w.keywords.some(T=>k.includes(T))});_.length,_.length>0&&_.reduce((P,k)=>{const T=(k.sources||[]).reduce((C,$)=>C+($.sentiment||0),0);return P+T},0)/Math.max(_.length,1);const N=w.subcategories.map(P=>{const k=w.keywords.filter(A=>{const I=P.toLowerCase();return A.includes(I)||I.includes(A.split(" ")[0])});let T;if(k.length>0)T=x.filter(A=>{const I=(A.reasoning||A.ticker||"").toLowerCase();return k.some(B=>I.includes(B))});else{const A=P.split("").reduce((I,B)=>(I<<5)-I+B.charCodeAt(0)|0,0);T=_.filter((I,B)=>B%w.subcategories.length===Math.abs(A)%w.subcategories.length)}const C=T.length,$=T.reduce((A,I)=>{const B=(I.sources||[]).reduce((L,R)=>L+(R.sentiment||0),0);return A+B},0)/Math.max(T.length,1),M=Math.min(1,C/Math.max(y*.5,1));return{name:P,signalCount:C,sentiment:$,intensity:M,matchingKeywords:k.length>0?k:w.keywords,categoryIcon:w.icon}});return{category:w,subcategoryData:N}}),g=Yd.map(w=>{const _=x.filter(N=>{const P=(N.reasoning||N.ticker||"").toLowerCase();return w.keywords.some(k=>P.includes(k))});return{name:w.name,icon:w.icon,baseColor:w.baseColor,totalSignals:_.length,avgSentiment:_.length>0?_.reduce((N,P)=>N+(P.sources||[]).reduce((k,T)=>k+(T.sentiment||0),0),0)/_.length:0}}),S={totalSignals:x.length,buyYes:x.filter(w=>w.direction==="BUY_YES").length,buyNo:x.filter(w=>w.direction==="BUY_NO").length,approved:x.filter(w=>w.risk_approved).length,avgEdge:x.length>0?x.reduce((w,_)=>w+parseFloat(_.expected_edge||0),0)/x.length:0,avgConf:x.length>0?x.reduce((w,_)=>w+parseFloat(_.confidence||0),0)/x.length:0,hottest:((j=g.sort((w,_)=>_.totalSignals-w.totalSignals)[0])==null?void 0:j.name)||"None"};return{categoryData:m,categoryStats:g,overallStats:S}},[r]);return o?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})}):s.jsxs("div",{className:"space-y-6",children:[s.jsx("style",{children:`
-        @keyframes shimmer {
-          0% { transform: translateX(-100%); }
-          100% { transform: translateX(200%); }
-        }
-        .hover\\:scale-102:hover { transform: scale(1.02); }
-      `}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Pulse of America"}),s.jsx("p",{className:"text-gray-500 text-sm",children:"Sentiment and activity heatmap across American prediction markets"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex items-center gap-1 bg-gray-800 rounded-lg p-0.5",children:["24h","7d","30d"].map(x=>s.jsx("button",{onClick:()=>f(x),className:`px-3 py-1.5 text-xs font-medium rounded-md transition ${d===x?"bg-amber-500 text-black":"text-gray-400 hover:text-gray-200"}`,children:x},x))}),s.jsx("button",{onClick:h,className:"btn btn-o text-sm",children:"Refresh"})]})]}),s.jsx("div",{className:"grid grid-cols-7 gap-3",children:[{label:"Total Signals",value:b.totalSignals||0,color:"text-amber-400"},{label:"BUY YES",value:b.buyYes||0,color:"text-green-400"},{label:"BUY NO",value:b.buyNo||0,color:"text-red-400"},{label:"Approved",value:b.approved||0,color:"text-green-400"},{label:"Avg Edge",value:`${(b.avgEdge*100).toFixed(1)}%`,color:"text-amber-400"},{label:"Avg Confidence",value:`${(b.avgConf*100).toFixed(0)}%`,color:"text-blue-400"},{label:"Hottest Sector",value:b.hottest,color:"text-red-400"}].map(x=>s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase mb-1",children:x.label}),s.jsx("p",{className:`text-lg font-bold ${x.color}`,children:x.value})]},x.label))}),s.jsx(CZ,{categoryStats:v}),s.jsxs("div",{className:"card p-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),s.jsx("h2",{className:"font-semibold text-sm",children:"Live Signal Heatmap"})]}),s.jsx($Z,{})]}),s.jsx("div",{className:"space-y-5",children:p.map(({category:x,subcategoryData:y})=>s.jsx(AZ,{category:x,subcategoryData:y,onCellClick:m=>u((c==null?void 0:c.category)===m.category&&(c==null?void 0:c.subcategory)===m.subcategory?null:m),selectedCell:c},x.name))})]}),c&&s.jsx(EZ,{cell:c,signals:r||[],onClose:()=>u(null)}),s.jsxs("div",{className:"card border border-gray-700/50",children:[s.jsx("div",{className:"flex items-center gap-2 mb-3",children:s.jsx("h2",{className:"font-semibold text-sm",children:"Signal Source Breakdown"})}),s.jsx("div",{className:"grid grid-cols-4 gap-3",children:((a==null?void 0:a.sourceBreakdown)||[]).slice(0,8).map(x=>{const y=parseFloat(x.avg_sent)||0,m=parseInt(x.cnt)||0;return s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 border border-gray-700/30",children:[s.jsxs("div",{className:"flex items-center justify-between mb-1",children:[s.jsx("span",{className:"text-xs font-bold text-gray-300 uppercase",children:x.source.replace("_"," ")}),s.jsx("span",{className:"text-amber-400 font-mono text-xs font-bold",children:m})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex-1 h-1.5 bg-gray-700 rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full",style:{width:`${Math.min(100,Math.abs(y)*5e3+10)}%`,backgroundColor:y>0?"#22c55e":y<0?"#ef4444":"#64748b"}})}),s.jsxs("span",{className:`text-[10px] font-mono ${y>0?"text-green-400":y<0?"text-red-400":"text-gray-500"}`,children:[y>0?"+":"",y.toFixed(3)]})]})]},x.source)})})]}),e&&s.jsxs("div",{className:"card border border-gray-700/50",children:[s.jsx("div",{className:"flex items-center gap-2 mb-3",children:s.jsx("h2",{className:"font-semibold text-sm",children:"Market Pulse Metrics"})}),s.jsxs("div",{className:"grid grid-cols-5 gap-3 text-center",children:[s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 border border-gray-700/30",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Balance"}),s.jsxs("p",{className:"text-lg font-bold text-green-400 font-mono",children:["$",e.balance?(e.balance/100).toLocaleString(void 0,{minimumFractionDigits:0}):"0"]})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 border border-gray-700/30",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Today's P&L"}),s.jsxs("p",{className:`text-lg font-bold font-mono ${(e.daily_pnl||0)>=0?"text-green-400":"text-red-400"}`,children:[(e.daily_pnl||0)>=0?"+":"","$",((e.daily_pnl||0)/100).toFixed(2)]})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 border border-gray-700/30",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Today's Trades"}),s.jsx("p",{className:"text-lg font-bold text-amber-400",children:(e.today_trades||0).toLocaleString()})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 border border-gray-700/30",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Win Rate"}),s.jsxs("p",{className:`text-lg font-bold ${e.today_trades>0&&e.today_wins/e.today_trades*100>=50?"text-green-400":"text-red-400"}`,children:[e.today_trades>0?(e.today_wins/e.today_trades*100).toFixed(1):"0","%"]})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 border border-gray-700/30",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Markets Tracked"}),s.jsx("p",{className:"text-lg font-bold text-purple-400",children:e.markets_tracked||0})]})]})]})]})}function MZ(){return s.jsx(UA,{children:s.jsxs(IA,{children:[s.jsx(et,{path:"/login",element:s.jsx(QA,{})}),s.jsx(et,{path:"/setup",element:s.jsx(f$,{})}),s.jsxs(et,{path:"/",element:s.jsx(JA,{}),children:[s.jsx(et,{index:!0,element:s.jsx(GQ,{})}),s.jsx(et,{path:"markets",element:s.jsx(XQ,{})}),s.jsx(et,{path:"positions",element:s.jsx(QQ,{})}),s.jsx(et,{path:"orders",element:s.jsx(ZQ,{})}),s.jsx(et,{path:"signals",element:s.jsx(hZ,{})}),s.jsx(et,{path:"intelligence",element:s.jsx(pZ,{})}),s.jsx(et,{path:"trading",element:s.jsx(mZ,{})}),s.jsx(et,{path:"heatmap",element:s.jsx(bZ,{})}),s.jsx(et,{path:"orbit",element:s.jsx(_Z,{})}),s.jsx(et,{path:"pulse",element:s.jsx(TZ,{})}),s.jsx(et,{path:"weather",element:s.jsx(JQ,{})}),s.jsx(et,{path:"risk",element:s.jsx(iZ,{})}),s.jsx(et,{path:"settings",element:s.jsx(lZ,{})})]})]})})}qd.createRoot(document.getElementById("root")).render(s.jsx(MZ,{}));
diff --git a/kalshi-dash/dist/assets/index-Cwmd51q1.js b/kalshi-dash/dist/assets/index-Cwmd51q1.js
new file mode 100644
index 0000000..041f6d8
--- /dev/null
+++ b/kalshi-dash/dist/assets/index-Cwmd51q1.js
@@ -0,0 +1,158 @@
+function w2(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(n,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>n[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"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(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 n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var vl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function de(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ij={exports:{}},Ru={},oj={exports:{}},ne={};/**
+ * @license React
+ * react.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var rl=Symbol.for("react.element"),S2=Symbol.for("react.portal"),_2=Symbol.for("react.fragment"),N2=Symbol.for("react.strict_mode"),O2=Symbol.for("react.profiler"),k2=Symbol.for("react.provider"),P2=Symbol.for("react.context"),A2=Symbol.for("react.forward_ref"),$2=Symbol.for("react.suspense"),E2=Symbol.for("react.memo"),C2=Symbol.for("react.lazy"),Tg=Symbol.iterator;function T2(e){return e===null||typeof e!="object"?null:(e=Tg&&e[Tg]||e["@@iterator"],typeof e=="function"?e:null)}var sj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},lj=Object.assign,cj={};function Xi(e,t,r){this.props=e,this.context=t,this.refs=cj,this.updater=r||sj}Xi.prototype.isReactComponent={};Xi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Xi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function uj(){}uj.prototype=Xi.prototype;function _m(e,t,r){this.props=e,this.context=t,this.refs=cj,this.updater=r||sj}var Nm=_m.prototype=new uj;Nm.constructor=_m;lj(Nm,Xi.prototype);Nm.isPureReactComponent=!0;var Mg=Array.isArray,dj=Object.prototype.hasOwnProperty,Om={current:null},fj={key:!0,ref:!0,__self:!0,__source:!0};function hj(e,t,r){var n,a={},i=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)dj.call(t,n)&&!fj.hasOwnProperty(n)&&(a[n]=t[n]);var l=arguments.length-2;if(l===1)a.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)a[n]===void 0&&(a[n]=l[n]);return{$$typeof:rl,type:e,key:i,ref:o,props:a,_owner:Om.current}}function M2(e,t){return{$$typeof:rl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function km(e){return typeof e=="object"&&e!==null&&e.$$typeof===rl}function I2(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Ig=/\/+/g;function qd(e,t){return typeof e=="object"&&e!==null&&e.key!=null?I2(""+e.key):t.toString(36)}function Zl(e,t,r,n,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case rl:case S2:o=!0}}if(o)return o=e,a=a(o),e=n===""?"."+qd(o,0):n,Mg(a)?(r="",e!=null&&(r=e.replace(Ig,"$&/")+"/"),Zl(a,t,r,"",function(u){return u})):a!=null&&(km(a)&&(a=M2(a,r+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(Ig,"$&/")+"/")+e)),t.push(a)),1;if(o=0,n=n===""?".":n+":",Mg(e))for(var l=0;l<e.length;l++){i=e[l];var c=n+qd(i,l);o+=Zl(i,t,r,c,a)}else if(c=T2(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=n+qd(i,l++),o+=Zl(i,t,r,c,a);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function gl(e,t,r){if(e==null)return e;var n=[],a=0;return Zl(e,n,"","",function(i){return t.call(r,i,a++)}),n}function L2(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var vt={current:null},Jl={transition:null},D2={ReactCurrentDispatcher:vt,ReactCurrentBatchConfig:Jl,ReactCurrentOwner:Om};function pj(){throw Error("act(...) is not supported in production builds of React.")}ne.Children={map:gl,forEach:function(e,t,r){gl(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return gl(e,function(){t++}),t},toArray:function(e){return gl(e,function(t){return t})||[]},only:function(e){if(!km(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ne.Component=Xi;ne.Fragment=_2;ne.Profiler=O2;ne.PureComponent=_m;ne.StrictMode=N2;ne.Suspense=$2;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D2;ne.act=pj;ne.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=lj({},e.props),a=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=Om.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)dj.call(t,c)&&!fj.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:rl,type:e.type,key:a,ref:i,props:n,_owner:o}};ne.createContext=function(e){return e={$$typeof:P2,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:k2,_context:e},e.Consumer=e};ne.createElement=hj;ne.createFactory=function(e){var t=hj.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:A2,render:e}};ne.isValidElement=km;ne.lazy=function(e){return{$$typeof:C2,_payload:{_status:-1,_result:e},_init:L2}};ne.memo=function(e,t){return{$$typeof:E2,type:e,compare:t===void 0?null:t}};ne.startTransition=function(e){var t=Jl.transition;Jl.transition={};try{e()}finally{Jl.transition=t}};ne.unstable_act=pj;ne.useCallback=function(e,t){return vt.current.useCallback(e,t)};ne.useContext=function(e){return vt.current.useContext(e)};ne.useDebugValue=function(){};ne.useDeferredValue=function(e){return vt.current.useDeferredValue(e)};ne.useEffect=function(e,t){return vt.current.useEffect(e,t)};ne.useId=function(){return vt.current.useId()};ne.useImperativeHandle=function(e,t,r){return vt.current.useImperativeHandle(e,t,r)};ne.useInsertionEffect=function(e,t){return vt.current.useInsertionEffect(e,t)};ne.useLayoutEffect=function(e,t){return vt.current.useLayoutEffect(e,t)};ne.useMemo=function(e,t){return vt.current.useMemo(e,t)};ne.useReducer=function(e,t,r){return vt.current.useReducer(e,t,r)};ne.useRef=function(e){return vt.current.useRef(e)};ne.useState=function(e){return vt.current.useState(e)};ne.useSyncExternalStore=function(e,t,r){return vt.current.useSyncExternalStore(e,t,r)};ne.useTransition=function(){return vt.current.useTransition()};ne.version="18.3.1";oj.exports=ne;var O=oj.exports;const E=de(O),R2=w2({__proto__:null,default:E},[O]);/**
+ * @license React
+ * react-jsx-runtime.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var B2=O,F2=Symbol.for("react.element"),z2=Symbol.for("react.fragment"),W2=Object.prototype.hasOwnProperty,U2=B2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,H2={key:!0,ref:!0,__self:!0,__source:!0};function mj(e,t,r){var n,a={},i=null,o=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)W2.call(t,n)&&!H2.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)a[n]===void 0&&(a[n]=t[n]);return{$$typeof:F2,type:e,key:i,ref:o,props:a,_owner:U2.current}}Ru.Fragment=z2;Ru.jsx=mj;Ru.jsxs=mj;ij.exports=Ru;var s=ij.exports,th={},vj={exports:{}},Rt={},gj={exports:{}},yj={};/**
+ * @license React
+ * scheduler.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */(function(e){function t(L,B){var F=L.length;L.push(B);e:for(;0<F;){var K=F-1>>>1,H=L[K];if(0<a(H,B))L[K]=B,L[F]=H,F=K;else break e}}function r(L){return L.length===0?null:L[0]}function n(L){if(L.length===0)return null;var B=L[0],F=L.pop();if(F!==B){L[0]=F;e:for(var K=0,H=L.length,q=H>>>1;K<q;){var ie=2*(K+1)-1,_e=L[ie],Me=ie+1,Ft=L[Me];if(0>a(_e,F))Me<H&&0>a(Ft,_e)?(L[K]=Ft,L[Me]=F,K=Me):(L[K]=_e,L[ie]=F,K=ie);else if(Me<H&&0>a(Ft,F))L[K]=Ft,L[Me]=F,K=Me;else break e}}return B}function a(L,B){var F=L.sortIndex-B.sortIndex;return F!==0?F:L.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],f=1,d=null,h=3,p=!1,g=!1,b=!1,x=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(L){for(var B=r(u);B!==null;){if(B.callback===null)n(u);else if(B.startTime<=L)n(u),B.sortIndex=B.expirationTime,t(c,B);else break;B=r(u)}}function S(L){if(b=!1,m(L),!g)if(r(c)!==null)g=!0,$(j);else{var B=r(u);B!==null&&I(S,B.startTime-L)}}function j(L,B){g=!1,b&&(b=!1,y(_),_=-1),p=!0;var F=h;try{for(m(B),d=r(c);d!==null&&(!(d.expirationTime>B)||L&&!T());){var K=d.callback;if(typeof K=="function"){d.callback=null,h=d.priorityLevel;var H=K(d.expirationTime<=B);B=e.unstable_now(),typeof H=="function"?d.callback=H:d===r(c)&&n(c),m(B)}else n(c);d=r(c)}if(d!==null)var q=!0;else{var ie=r(u);ie!==null&&I(S,ie.startTime-B),q=!1}return q}finally{d=null,h=F,p=!1}}var w=!1,N=null,_=-1,k=5,A=-1;function T(){return!(e.unstable_now()-A<k)}function C(){if(N!==null){var L=e.unstable_now();A=L;var B=!0;try{B=N(!0,L)}finally{B?D():(w=!1,N=null)}}else w=!1}var D;if(typeof v=="function")D=function(){v(C)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,M=P.port2;P.port1.onmessage=C,D=function(){M.postMessage(null)}}else D=function(){x(C,0)};function $(L){N=L,w||(w=!0,D())}function I(L,B){_=x(function(){L(e.unstable_now())},B)}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_continueExecution=function(){g||p||(g=!0,$(j))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(L){switch(h){case 1:case 2:case 3:var B=3;break;default:B=h}var F=h;h=B;try{return L()}finally{h=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,B){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var F=h;h=L;try{return B()}finally{h=F}},e.unstable_scheduleCallback=function(L,B,F){var K=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?K+F:K):F=K,L){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=F+H,L={id:f++,callback:B,priorityLevel:L,startTime:F,expirationTime:H,sortIndex:-1},F>K?(L.sortIndex=F,t(u,L),r(c)===null&&L===r(u)&&(b?(y(_),_=-1):b=!0,I(S,F-K))):(L.sortIndex=H,t(c,L),g||p||(g=!0,$(j))),L},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(L){var B=h;return function(){var F=h;h=B;try{return L.apply(this,arguments)}finally{h=F}}}})(yj);gj.exports=yj;var K2=gj.exports;/**
+ * @license React
+ * react-dom.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var V2=O,Dt=K2;function U(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var xj=new Set,rs={};function wa(e,t){mi(e,t),mi(e+"Capture",t)}function mi(e,t){for(rs[e]=t,e=0;e<t.length;e++)xj.add(t[e])}var Wr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rh=Object.prototype.hasOwnProperty,G2=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Lg={},Dg={};function Y2(e){return rh.call(Dg,e)?!0:rh.call(Lg,e)?!1:G2.test(e)?Dg[e]=!0:(Lg[e]=!0,!1)}function q2(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function X2(e,t,r,n){if(t===null||typeof t>"u"||q2(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function gt(e,t,r,n,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var at={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){at[e]=new gt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];at[t]=new gt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){at[e]=new gt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){at[e]=new gt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){at[e]=new gt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){at[e]=new gt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){at[e]=new gt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){at[e]=new gt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){at[e]=new gt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Pm=/[\-:]([a-z])/g;function Am(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Pm,Am);at[t]=new gt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Pm,Am);at[t]=new gt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Pm,Am);at[t]=new gt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){at[e]=new gt(e,1,!1,e.toLowerCase(),null,!1,!1)});at.xlinkHref=new gt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){at[e]=new gt(e,1,!1,e.toLowerCase(),null,!0,!0)});function $m(e,t,r,n){var a=at.hasOwnProperty(t)?at[t]:null;(a!==null?a.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(X2(t,r,a,n)&&(r=null),n||a===null?Y2(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):a.mustUseProperty?e[a.propertyName]=r===null?a.type===3?!1:"":r:(t=a.attributeName,n=a.attributeNamespace,r===null?e.removeAttribute(t):(a=a.type,r=a===3||a===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var qr=V2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,yl=Symbol.for("react.element"),za=Symbol.for("react.portal"),Wa=Symbol.for("react.fragment"),Em=Symbol.for("react.strict_mode"),nh=Symbol.for("react.profiler"),bj=Symbol.for("react.provider"),jj=Symbol.for("react.context"),Cm=Symbol.for("react.forward_ref"),ah=Symbol.for("react.suspense"),ih=Symbol.for("react.suspense_list"),Tm=Symbol.for("react.memo"),an=Symbol.for("react.lazy"),wj=Symbol.for("react.offscreen"),Rg=Symbol.iterator;function mo(e){return e===null||typeof e!="object"?null:(e=Rg&&e[Rg]||e["@@iterator"],typeof e=="function"?e:null)}var $e=Object.assign,Xd;function Mo(e){if(Xd===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Xd=t&&t[1]||""}return`
+`+Xd+e}var Qd=!1;function Zd(e,t){if(!e||Qd)return"";Qd=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var a=u.stack.split(`
+`),i=n.stack.split(`
+`),o=a.length-1,l=i.length-1;1<=o&&0<=l&&a[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==i[l]){var c=`
+`+a[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Qd=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Mo(e):""}function Q2(e){switch(e.tag){case 5:return Mo(e.type);case 16:return Mo("Lazy");case 13:return Mo("Suspense");case 19:return Mo("SuspenseList");case 0:case 2:case 15:return e=Zd(e.type,!1),e;case 11:return e=Zd(e.type.render,!1),e;case 1:return e=Zd(e.type,!0),e;default:return""}}function oh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Wa:return"Fragment";case za:return"Portal";case nh:return"Profiler";case Em:return"StrictMode";case ah:return"Suspense";case ih:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case jj:return(e.displayName||"Context")+".Consumer";case bj:return(e._context.displayName||"Context")+".Provider";case Cm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Tm:return t=e.displayName||null,t!==null?t:oh(e.type)||"Memo";case an:t=e._payload,e=e._init;try{return oh(e(t))}catch{}}return null}function Z2(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return oh(t);case 8:return t===Em?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function kn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Sj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function J2(e){var t=Sj(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function xl(e){e._valueTracker||(e._valueTracker=J2(e))}function _j(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Sj(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function dc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function sh(e,t){var r=t.checked;return $e({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Bg(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=kn(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Nj(e,t){t=t.checked,t!=null&&$m(e,"checked",t,!1)}function lh(e,t){Nj(e,t);var r=kn(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ch(e,t.type,r):t.hasOwnProperty("defaultValue")&&ch(e,t.type,kn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Fg(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function ch(e,t,r){(t!=="number"||dc(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Io=Array.isArray;function ai(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a<r.length;a++)t["$"+r[a]]=!0;for(r=0;r<e.length;r++)a=t.hasOwnProperty("$"+e[r].value),e[r].selected!==a&&(e[r].selected=a),a&&n&&(e[r].defaultSelected=!0)}else{for(r=""+kn(r),t=null,a=0;a<e.length;a++){if(e[a].value===r){e[a].selected=!0,n&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function uh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(U(91));return $e({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function zg(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(U(92));if(Io(r)){if(1<r.length)throw Error(U(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:kn(r)}}function Oj(e,t){var r=kn(t.value),n=kn(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Wg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function kj(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function dh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?kj(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var bl,Pj=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,a){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(bl=bl||document.createElement("div"),bl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=bl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ns(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var zo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ek=["Webkit","ms","Moz","O"];Object.keys(zo).forEach(function(e){ek.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),zo[t]=zo[e]})});function Aj(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||zo.hasOwnProperty(e)&&zo[e]?(""+t).trim():t+"px"}function $j(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=Aj(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var tk=$e({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function fh(e,t){if(t){if(tk[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(U(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(U(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(U(61))}if(t.style!=null&&typeof t.style!="object")throw Error(U(62))}}function hh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ph=null;function Mm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mh=null,ii=null,oi=null;function Ug(e){if(e=il(e)){if(typeof mh!="function")throw Error(U(280));var t=e.stateNode;t&&(t=Uu(t),mh(e.stateNode,e.type,t))}}function Ej(e){ii?oi?oi.push(e):oi=[e]:ii=e}function Cj(){if(ii){var e=ii,t=oi;if(oi=ii=null,Ug(e),t)for(e=0;e<t.length;e++)Ug(t[e])}}function Tj(e,t){return e(t)}function Mj(){}var Jd=!1;function Ij(e,t,r){if(Jd)return e(t,r);Jd=!0;try{return Tj(e,t,r)}finally{Jd=!1,(ii!==null||oi!==null)&&(Mj(),Cj())}}function as(e,t){var r=e.stateNode;if(r===null)return null;var n=Uu(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(U(231,t,typeof r));return r}var vh=!1;if(Wr)try{var vo={};Object.defineProperty(vo,"passive",{get:function(){vh=!0}}),window.addEventListener("test",vo,vo),window.removeEventListener("test",vo,vo)}catch{vh=!1}function rk(e,t,r,n,a,i,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(f){this.onError(f)}}var Wo=!1,fc=null,hc=!1,gh=null,nk={onError:function(e){Wo=!0,fc=e}};function ak(e,t,r,n,a,i,o,l,c){Wo=!1,fc=null,rk.apply(nk,arguments)}function ik(e,t,r,n,a,i,o,l,c){if(ak.apply(this,arguments),Wo){if(Wo){var u=fc;Wo=!1,fc=null}else throw Error(U(198));hc||(hc=!0,gh=u)}}function Sa(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Lj(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Hg(e){if(Sa(e)!==e)throw Error(U(188))}function ok(e){var t=e.alternate;if(!t){if(t=Sa(e),t===null)throw Error(U(188));return t!==e?null:e}for(var r=e,n=t;;){var a=r.return;if(a===null)break;var i=a.alternate;if(i===null){if(n=a.return,n!==null){r=n;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===r)return Hg(a),e;if(i===n)return Hg(a),t;i=i.sibling}throw Error(U(188))}if(r.return!==n.return)r=a,n=i;else{for(var o=!1,l=a.child;l;){if(l===r){o=!0,r=a,n=i;break}if(l===n){o=!0,n=a,r=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===r){o=!0,r=i,n=a;break}if(l===n){o=!0,n=i,r=a;break}l=l.sibling}if(!o)throw Error(U(189))}}if(r.alternate!==n)throw Error(U(190))}if(r.tag!==3)throw Error(U(188));return r.stateNode.current===r?e:t}function Dj(e){return e=ok(e),e!==null?Rj(e):null}function Rj(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Rj(e);if(t!==null)return t;e=e.sibling}return null}var Bj=Dt.unstable_scheduleCallback,Kg=Dt.unstable_cancelCallback,sk=Dt.unstable_shouldYield,lk=Dt.unstable_requestPaint,Ie=Dt.unstable_now,ck=Dt.unstable_getCurrentPriorityLevel,Im=Dt.unstable_ImmediatePriority,Fj=Dt.unstable_UserBlockingPriority,pc=Dt.unstable_NormalPriority,uk=Dt.unstable_LowPriority,zj=Dt.unstable_IdlePriority,Bu=null,xr=null;function dk(e){if(xr&&typeof xr.onCommitFiberRoot=="function")try{xr.onCommitFiberRoot(Bu,e,void 0,(e.current.flags&128)===128)}catch{}}var cr=Math.clz32?Math.clz32:pk,fk=Math.log,hk=Math.LN2;function pk(e){return e>>>=0,e===0?32:31-(fk(e)/hk|0)|0}var jl=64,wl=4194304;function Lo(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function mc(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~a;l!==0?n=Lo(l):(i&=o,i!==0&&(n=Lo(i)))}else o=r&~a,o!==0?n=Lo(o):i!==0&&(n=Lo(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-cr(t),a=1<<r,n|=e[r],t&=~a;return n}function mk(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vk(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-cr(i),l=1<<o,c=a[o];c===-1?(!(l&r)||l&n)&&(a[o]=mk(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function yh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Wj(){var e=jl;return jl<<=1,!(jl&4194240)&&(jl=64),e}function ef(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function nl(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-cr(t),e[t]=r}function gk(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var a=31-cr(r),i=1<<a;t[a]=0,n[a]=-1,e[a]=-1,r&=~i}}function Lm(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-cr(r),a=1<<n;a&t|e[n]&t&&(e[n]|=t),r&=~a}}var ue=0;function Uj(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Hj,Dm,Kj,Vj,Gj,xh=!1,Sl=[],gn=null,yn=null,xn=null,is=new Map,os=new Map,ln=[],yk="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Vg(e,t){switch(e){case"focusin":case"focusout":gn=null;break;case"dragenter":case"dragleave":yn=null;break;case"mouseover":case"mouseout":xn=null;break;case"pointerover":case"pointerout":is.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":os.delete(t.pointerId)}}function go(e,t,r,n,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[a]},t!==null&&(t=il(t),t!==null&&Dm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function xk(e,t,r,n,a){switch(t){case"focusin":return gn=go(gn,e,t,r,n,a),!0;case"dragenter":return yn=go(yn,e,t,r,n,a),!0;case"mouseover":return xn=go(xn,e,t,r,n,a),!0;case"pointerover":var i=a.pointerId;return is.set(i,go(is.get(i)||null,e,t,r,n,a)),!0;case"gotpointercapture":return i=a.pointerId,os.set(i,go(os.get(i)||null,e,t,r,n,a)),!0}return!1}function Yj(e){var t=Qn(e.target);if(t!==null){var r=Sa(t);if(r!==null){if(t=r.tag,t===13){if(t=Lj(r),t!==null){e.blockedOn=t,Gj(e.priority,function(){Kj(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ec(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=bh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);ph=n,r.target.dispatchEvent(n),ph=null}else return t=il(r),t!==null&&Dm(t),e.blockedOn=r,!1;t.shift()}return!0}function Gg(e,t,r){ec(e)&&r.delete(t)}function bk(){xh=!1,gn!==null&&ec(gn)&&(gn=null),yn!==null&&ec(yn)&&(yn=null),xn!==null&&ec(xn)&&(xn=null),is.forEach(Gg),os.forEach(Gg)}function yo(e,t){e.blockedOn===t&&(e.blockedOn=null,xh||(xh=!0,Dt.unstable_scheduleCallback(Dt.unstable_NormalPriority,bk)))}function ss(e){function t(a){return yo(a,e)}if(0<Sl.length){yo(Sl[0],e);for(var r=1;r<Sl.length;r++){var n=Sl[r];n.blockedOn===e&&(n.blockedOn=null)}}for(gn!==null&&yo(gn,e),yn!==null&&yo(yn,e),xn!==null&&yo(xn,e),is.forEach(t),os.forEach(t),r=0;r<ln.length;r++)n=ln[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<ln.length&&(r=ln[0],r.blockedOn===null);)Yj(r),r.blockedOn===null&&ln.shift()}var si=qr.ReactCurrentBatchConfig,vc=!0;function jk(e,t,r,n){var a=ue,i=si.transition;si.transition=null;try{ue=1,Rm(e,t,r,n)}finally{ue=a,si.transition=i}}function wk(e,t,r,n){var a=ue,i=si.transition;si.transition=null;try{ue=4,Rm(e,t,r,n)}finally{ue=a,si.transition=i}}function Rm(e,t,r,n){if(vc){var a=bh(e,t,r,n);if(a===null)df(e,t,n,gc,r),Vg(e,n);else if(xk(a,e,t,r,n))n.stopPropagation();else if(Vg(e,n),t&4&&-1<yk.indexOf(e)){for(;a!==null;){var i=il(a);if(i!==null&&Hj(i),i=bh(e,t,r,n),i===null&&df(e,t,n,gc,r),i===a)break;a=i}a!==null&&n.stopPropagation()}else df(e,t,n,null,r)}}var gc=null;function bh(e,t,r,n){if(gc=null,e=Mm(n),e=Qn(e),e!==null)if(t=Sa(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Lj(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return gc=e,null}function qj(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ck()){case Im:return 1;case Fj:return 4;case pc:case uk:return 16;case zj:return 536870912;default:return 16}default:return 16}}var dn=null,Bm=null,tc=null;function Xj(){if(tc)return tc;var e,t=Bm,r=t.length,n,a="value"in dn?dn.value:dn.textContent,i=a.length;for(e=0;e<r&&t[e]===a[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===a[i-n];n++);return tc=a.slice(e,1<n?1-n:void 0)}function rc(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function _l(){return!0}function Yg(){return!1}function Bt(e){function t(r,n,a,i,o){this._reactName=r,this._targetInst=a,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?_l:Yg,this.isPropagationStopped=Yg,this}return $e(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=_l)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=_l)},persist:function(){},isPersistent:_l}),t}var Qi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fm=Bt(Qi),al=$e({},Qi,{view:0,detail:0}),Sk=Bt(al),tf,rf,xo,Fu=$e({},al,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zm,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==xo&&(xo&&e.type==="mousemove"?(tf=e.screenX-xo.screenX,rf=e.screenY-xo.screenY):rf=tf=0,xo=e),tf)},movementY:function(e){return"movementY"in e?e.movementY:rf}}),qg=Bt(Fu),_k=$e({},Fu,{dataTransfer:0}),Nk=Bt(_k),Ok=$e({},al,{relatedTarget:0}),nf=Bt(Ok),kk=$e({},Qi,{animationName:0,elapsedTime:0,pseudoElement:0}),Pk=Bt(kk),Ak=$e({},Qi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$k=Bt(Ak),Ek=$e({},Qi,{data:0}),Xg=Bt(Ek),Ck={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Tk={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Mk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ik(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Mk[e])?!!t[e]:!1}function zm(){return Ik}var Lk=$e({},al,{key:function(e){if(e.key){var t=Ck[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=rc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Tk[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zm,charCode:function(e){return e.type==="keypress"?rc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?rc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Dk=Bt(Lk),Rk=$e({},Fu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qg=Bt(Rk),Bk=$e({},al,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zm}),Fk=Bt(Bk),zk=$e({},Qi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wk=Bt(zk),Uk=$e({},Fu,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Hk=Bt(Uk),Kk=[9,13,27,32],Wm=Wr&&"CompositionEvent"in window,Uo=null;Wr&&"documentMode"in document&&(Uo=document.documentMode);var Vk=Wr&&"TextEvent"in window&&!Uo,Qj=Wr&&(!Wm||Uo&&8<Uo&&11>=Uo),Zg=" ",Jg=!1;function Zj(e,t){switch(e){case"keyup":return Kk.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jj(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ua=!1;function Gk(e,t){switch(e){case"compositionend":return Jj(t);case"keypress":return t.which!==32?null:(Jg=!0,Zg);case"textInput":return e=t.data,e===Zg&&Jg?null:e;default:return null}}function Yk(e,t){if(Ua)return e==="compositionend"||!Wm&&Zj(e,t)?(e=Xj(),tc=Bm=dn=null,Ua=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Qj&&t.locale!=="ko"?null:t.data;default:return null}}var qk={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ey(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!qk[e.type]:t==="textarea"}function ew(e,t,r,n){Ej(n),t=yc(t,"onChange"),0<t.length&&(r=new Fm("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Ho=null,ls=null;function Xk(e){dw(e,0)}function zu(e){var t=Va(e);if(_j(t))return e}function Qk(e,t){if(e==="change")return t}var tw=!1;if(Wr){var af;if(Wr){var of="oninput"in document;if(!of){var ty=document.createElement("div");ty.setAttribute("oninput","return;"),of=typeof ty.oninput=="function"}af=of}else af=!1;tw=af&&(!document.documentMode||9<document.documentMode)}function ry(){Ho&&(Ho.detachEvent("onpropertychange",rw),ls=Ho=null)}function rw(e){if(e.propertyName==="value"&&zu(ls)){var t=[];ew(t,ls,e,Mm(e)),Ij(Xk,t)}}function Zk(e,t,r){e==="focusin"?(ry(),Ho=t,ls=r,Ho.attachEvent("onpropertychange",rw)):e==="focusout"&&ry()}function Jk(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return zu(ls)}function eP(e,t){if(e==="click")return zu(t)}function tP(e,t){if(e==="input"||e==="change")return zu(t)}function rP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fr=typeof Object.is=="function"?Object.is:rP;function cs(e,t){if(fr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var a=r[n];if(!rh.call(t,a)||!fr(e[a],t[a]))return!1}return!0}function ny(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ay(e,t){var r=ny(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ny(r)}}function nw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?nw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function aw(){for(var e=window,t=dc();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=dc(e.document)}return t}function Um(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function nP(e){var t=aw(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&nw(r.ownerDocument.documentElement,r)){if(n!==null&&Um(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=ay(r,i);var o=ay(r,n);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var aP=Wr&&"documentMode"in document&&11>=document.documentMode,Ha=null,jh=null,Ko=null,wh=!1;function iy(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;wh||Ha==null||Ha!==dc(n)||(n=Ha,"selectionStart"in n&&Um(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Ko&&cs(Ko,n)||(Ko=n,n=yc(jh,"onSelect"),0<n.length&&(t=new Fm("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Ha)))}function Nl(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Ka={animationend:Nl("Animation","AnimationEnd"),animationiteration:Nl("Animation","AnimationIteration"),animationstart:Nl("Animation","AnimationStart"),transitionend:Nl("Transition","TransitionEnd")},sf={},iw={};Wr&&(iw=document.createElement("div").style,"AnimationEvent"in window||(delete Ka.animationend.animation,delete Ka.animationiteration.animation,delete Ka.animationstart.animation),"TransitionEvent"in window||delete Ka.transitionend.transition);function Wu(e){if(sf[e])return sf[e];if(!Ka[e])return e;var t=Ka[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in iw)return sf[e]=t[r];return e}var ow=Wu("animationend"),sw=Wu("animationiteration"),lw=Wu("animationstart"),cw=Wu("transitionend"),uw=new Map,oy="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function An(e,t){uw.set(e,t),wa(t,[e])}for(var lf=0;lf<oy.length;lf++){var cf=oy[lf],iP=cf.toLowerCase(),oP=cf[0].toUpperCase()+cf.slice(1);An(iP,"on"+oP)}An(ow,"onAnimationEnd");An(sw,"onAnimationIteration");An(lw,"onAnimationStart");An("dblclick","onDoubleClick");An("focusin","onFocus");An("focusout","onBlur");An(cw,"onTransitionEnd");mi("onMouseEnter",["mouseout","mouseover"]);mi("onMouseLeave",["mouseout","mouseover"]);mi("onPointerEnter",["pointerout","pointerover"]);mi("onPointerLeave",["pointerout","pointerover"]);wa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));wa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));wa("onBeforeInput",["compositionend","keypress","textInput","paste"]);wa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));wa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));wa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Do="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),sP=new Set("cancel close invalid load scroll toggle".split(" ").concat(Do));function sy(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,ik(n,t,void 0,e),e.currentTarget=null}function dw(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],a=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var o=n.length-1;0<=o;o--){var l=n[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;sy(a,l,u),i=c}else for(o=0;o<n.length;o++){if(l=n[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;sy(a,l,u),i=c}}}if(hc)throw e=gh,hc=!1,gh=null,e}function be(e,t){var r=t[kh];r===void 0&&(r=t[kh]=new Set);var n=e+"__bubble";r.has(n)||(fw(t,e,2,!1),r.add(n))}function uf(e,t,r){var n=0;t&&(n|=4),fw(r,e,n,t)}var Ol="_reactListening"+Math.random().toString(36).slice(2);function us(e){if(!e[Ol]){e[Ol]=!0,xj.forEach(function(r){r!=="selectionchange"&&(sP.has(r)||uf(r,!1,e),uf(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ol]||(t[Ol]=!0,uf("selectionchange",!1,t))}}function fw(e,t,r,n){switch(qj(t)){case 1:var a=jk;break;case 4:a=wk;break;default:a=Rm}r=a.bind(null,t,r,e),a=void 0,!vh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),n?a!==void 0?e.addEventListener(t,r,{capture:!0,passive:a}):e.addEventListener(t,r,!0):a!==void 0?e.addEventListener(t,r,{passive:a}):e.addEventListener(t,r,!1)}function df(e,t,r,n,a){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=n.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=Qn(l),o===null)return;if(c=o.tag,c===5||c===6){n=i=o;continue e}l=l.parentNode}}n=n.return}Ij(function(){var u=i,f=Mm(r),d=[];e:{var h=uw.get(e);if(h!==void 0){var p=Fm,g=e;switch(e){case"keypress":if(rc(r)===0)break e;case"keydown":case"keyup":p=Dk;break;case"focusin":g="focus",p=nf;break;case"focusout":g="blur",p=nf;break;case"beforeblur":case"afterblur":p=nf;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=qg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Nk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=Fk;break;case ow:case sw:case lw:p=Pk;break;case cw:p=Wk;break;case"scroll":p=Sk;break;case"wheel":p=Hk;break;case"copy":case"cut":case"paste":p=$k;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Qg}var b=(t&4)!==0,x=!b&&e==="scroll",y=b?h!==null?h+"Capture":null:h;b=[];for(var v=u,m;v!==null;){m=v;var S=m.stateNode;if(m.tag===5&&S!==null&&(m=S,y!==null&&(S=as(v,y),S!=null&&b.push(ds(v,S,m)))),x)break;v=v.return}0<b.length&&(h=new p(h,g,null,r,f),d.push({event:h,listeners:b}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&r!==ph&&(g=r.relatedTarget||r.fromElement)&&(Qn(g)||g[Ur]))break e;if((p||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,p?(g=r.relatedTarget||r.toElement,p=u,g=g?Qn(g):null,g!==null&&(x=Sa(g),g!==x||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(b=qg,S="onMouseLeave",y="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(b=Qg,S="onPointerLeave",y="onPointerEnter",v="pointer"),x=p==null?h:Va(p),m=g==null?h:Va(g),h=new b(S,v+"leave",p,r,f),h.target=x,h.relatedTarget=m,S=null,Qn(f)===u&&(b=new b(y,v+"enter",g,r,f),b.target=m,b.relatedTarget=x,S=b),x=S,p&&g)t:{for(b=p,y=g,v=0,m=b;m;m=Ea(m))v++;for(m=0,S=y;S;S=Ea(S))m++;for(;0<v-m;)b=Ea(b),v--;for(;0<m-v;)y=Ea(y),m--;for(;v--;){if(b===y||y!==null&&b===y.alternate)break t;b=Ea(b),y=Ea(y)}b=null}else b=null;p!==null&&ly(d,h,p,b,!1),g!==null&&x!==null&&ly(d,x,g,b,!0)}}e:{if(h=u?Va(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var j=Qk;else if(ey(h))if(tw)j=tP;else{j=Jk;var w=Zk}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=eP);if(j&&(j=j(e,u))){ew(d,j,r,f);break e}w&&w(e,h,u),e==="focusout"&&(w=h._wrapperState)&&w.controlled&&h.type==="number"&&ch(h,"number",h.value)}switch(w=u?Va(u):window,e){case"focusin":(ey(w)||w.contentEditable==="true")&&(Ha=w,jh=u,Ko=null);break;case"focusout":Ko=jh=Ha=null;break;case"mousedown":wh=!0;break;case"contextmenu":case"mouseup":case"dragend":wh=!1,iy(d,r,f);break;case"selectionchange":if(aP)break;case"keydown":case"keyup":iy(d,r,f)}var N;if(Wm)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Ua?Zj(e,r)&&(_="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(_="onCompositionStart");_&&(Qj&&r.locale!=="ko"&&(Ua||_!=="onCompositionStart"?_==="onCompositionEnd"&&Ua&&(N=Xj()):(dn=f,Bm="value"in dn?dn.value:dn.textContent,Ua=!0)),w=yc(u,_),0<w.length&&(_=new Xg(_,e,null,r,f),d.push({event:_,listeners:w}),N?_.data=N:(N=Jj(r),N!==null&&(_.data=N)))),(N=Vk?Gk(e,r):Yk(e,r))&&(u=yc(u,"onBeforeInput"),0<u.length&&(f=new Xg("onBeforeInput","beforeinput",null,r,f),d.push({event:f,listeners:u}),f.data=N))}dw(d,t)})}function ds(e,t,r){return{instance:e,listener:t,currentTarget:r}}function yc(e,t){for(var r=t+"Capture",n=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=as(e,r),i!=null&&n.unshift(ds(e,i,a)),i=as(e,t),i!=null&&n.push(ds(e,i,a))),e=e.return}return n}function Ea(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ly(e,t,r,n,a){for(var i=t._reactName,o=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,a?(c=as(r,i),c!=null&&o.unshift(ds(r,c,l))):a||(c=as(r,i),c!=null&&o.push(ds(r,c,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var lP=/\r\n?/g,cP=/\u0000|\uFFFD/g;function cy(e){return(typeof e=="string"?e:""+e).replace(lP,`
+`).replace(cP,"")}function kl(e,t,r){if(t=cy(t),cy(e)!==t&&r)throw Error(U(425))}function xc(){}var Sh=null,_h=null;function Nh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Oh=typeof setTimeout=="function"?setTimeout:void 0,uP=typeof clearTimeout=="function"?clearTimeout:void 0,uy=typeof Promise=="function"?Promise:void 0,dP=typeof queueMicrotask=="function"?queueMicrotask:typeof uy<"u"?function(e){return uy.resolve(null).then(e).catch(fP)}:Oh;function fP(e){setTimeout(function(){throw e})}function ff(e,t){var r=t,n=0;do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(n===0){e.removeChild(a),ss(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=a}while(r);ss(t)}function bn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function dy(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Zi=Math.random().toString(36).slice(2),vr="__reactFiber$"+Zi,fs="__reactProps$"+Zi,Ur="__reactContainer$"+Zi,kh="__reactEvents$"+Zi,hP="__reactListeners$"+Zi,pP="__reactHandles$"+Zi;function Qn(e){var t=e[vr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Ur]||r[vr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=dy(e);e!==null;){if(r=e[vr])return r;e=dy(e)}return t}e=r,r=e.parentNode}return null}function il(e){return e=e[vr]||e[Ur],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Va(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(U(33))}function Uu(e){return e[fs]||null}var Ph=[],Ga=-1;function $n(e){return{current:e}}function Se(e){0>Ga||(e.current=Ph[Ga],Ph[Ga]=null,Ga--)}function ye(e,t){Ga++,Ph[Ga]=e.current,e.current=t}var Pn={},ut=$n(Pn),Ot=$n(!1),ua=Pn;function vi(e,t){var r=e.type.contextTypes;if(!r)return Pn;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function kt(e){return e=e.childContextTypes,e!=null}function bc(){Se(Ot),Se(ut)}function fy(e,t,r){if(ut.current!==Pn)throw Error(U(168));ye(ut,t),ye(Ot,r)}function hw(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(U(108,Z2(e)||"Unknown",a));return $e({},r,n)}function jc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Pn,ua=ut.current,ye(ut,e),ye(Ot,Ot.current),!0}function hy(e,t,r){var n=e.stateNode;if(!n)throw Error(U(169));r?(e=hw(e,t,ua),n.__reactInternalMemoizedMergedChildContext=e,Se(Ot),Se(ut),ye(ut,e)):Se(Ot),ye(Ot,r)}var Cr=null,Hu=!1,hf=!1;function pw(e){Cr===null?Cr=[e]:Cr.push(e)}function mP(e){Hu=!0,pw(e)}function En(){if(!hf&&Cr!==null){hf=!0;var e=0,t=ue;try{var r=Cr;for(ue=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Cr=null,Hu=!1}catch(a){throw Cr!==null&&(Cr=Cr.slice(e+1)),Bj(Im,En),a}finally{ue=t,hf=!1}}return null}var Ya=[],qa=0,wc=null,Sc=0,Ht=[],Kt=0,da=null,Tr=1,Mr="";function Kn(e,t){Ya[qa++]=Sc,Ya[qa++]=wc,wc=e,Sc=t}function mw(e,t,r){Ht[Kt++]=Tr,Ht[Kt++]=Mr,Ht[Kt++]=da,da=e;var n=Tr;e=Mr;var a=32-cr(n)-1;n&=~(1<<a),r+=1;var i=32-cr(t)+a;if(30<i){var o=a-a%5;i=(n&(1<<o)-1).toString(32),n>>=o,a-=o,Tr=1<<32-cr(t)+a|r<<a|n,Mr=i+e}else Tr=1<<i|r<<a|n,Mr=e}function Hm(e){e.return!==null&&(Kn(e,1),mw(e,1,0))}function Km(e){for(;e===wc;)wc=Ya[--qa],Ya[qa]=null,Sc=Ya[--qa],Ya[qa]=null;for(;e===da;)da=Ht[--Kt],Ht[Kt]=null,Mr=Ht[--Kt],Ht[Kt]=null,Tr=Ht[--Kt],Ht[Kt]=null}var It=null,Mt=null,Ne=!1,sr=null;function vw(e,t){var r=Gt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function py(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,It=e,Mt=bn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,It=e,Mt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=da!==null?{id:Tr,overflow:Mr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Gt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,It=e,Mt=null,!0):!1;default:return!1}}function Ah(e){return(e.mode&1)!==0&&(e.flags&128)===0}function $h(e){if(Ne){var t=Mt;if(t){var r=t;if(!py(e,t)){if(Ah(e))throw Error(U(418));t=bn(r.nextSibling);var n=It;t&&py(e,t)?vw(n,r):(e.flags=e.flags&-4097|2,Ne=!1,It=e)}}else{if(Ah(e))throw Error(U(418));e.flags=e.flags&-4097|2,Ne=!1,It=e}}}function my(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;It=e}function Pl(e){if(e!==It)return!1;if(!Ne)return my(e),Ne=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Nh(e.type,e.memoizedProps)),t&&(t=Mt)){if(Ah(e))throw gw(),Error(U(418));for(;t;)vw(e,t),t=bn(t.nextSibling)}if(my(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(U(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Mt=bn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Mt=null}}else Mt=It?bn(e.stateNode.nextSibling):null;return!0}function gw(){for(var e=Mt;e;)e=bn(e.nextSibling)}function gi(){Mt=It=null,Ne=!1}function Vm(e){sr===null?sr=[e]:sr.push(e)}var vP=qr.ReactCurrentBatchConfig;function bo(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(U(309));var n=r.stateNode}if(!n)throw Error(U(147,e));var a=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=a.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(U(284));if(!r._owner)throw Error(U(290,e))}return e}function Al(e,t){throw e=Object.prototype.toString.call(t),Error(U(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function vy(e){var t=e._init;return t(e._payload)}function yw(e){function t(y,v){if(e){var m=y.deletions;m===null?(y.deletions=[v],y.flags|=16):m.push(v)}}function r(y,v){if(!e)return null;for(;v!==null;)t(y,v),v=v.sibling;return null}function n(y,v){for(y=new Map;v!==null;)v.key!==null?y.set(v.key,v):y.set(v.index,v),v=v.sibling;return y}function a(y,v){return y=_n(y,v),y.index=0,y.sibling=null,y}function i(y,v,m){return y.index=m,e?(m=y.alternate,m!==null?(m=m.index,m<v?(y.flags|=2,v):m):(y.flags|=2,v)):(y.flags|=1048576,v)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,v,m,S){return v===null||v.tag!==6?(v=bf(m,y.mode,S),v.return=y,v):(v=a(v,m),v.return=y,v)}function c(y,v,m,S){var j=m.type;return j===Wa?f(y,v,m.props.children,S,m.key):v!==null&&(v.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===an&&vy(j)===v.type)?(S=a(v,m.props),S.ref=bo(y,v,m),S.return=y,S):(S=cc(m.type,m.key,m.props,null,y.mode,S),S.ref=bo(y,v,m),S.return=y,S)}function u(y,v,m,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==m.containerInfo||v.stateNode.implementation!==m.implementation?(v=jf(m,y.mode,S),v.return=y,v):(v=a(v,m.children||[]),v.return=y,v)}function f(y,v,m,S,j){return v===null||v.tag!==7?(v=sa(m,y.mode,S,j),v.return=y,v):(v=a(v,m),v.return=y,v)}function d(y,v,m){if(typeof v=="string"&&v!==""||typeof v=="number")return v=bf(""+v,y.mode,m),v.return=y,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case yl:return m=cc(v.type,v.key,v.props,null,y.mode,m),m.ref=bo(y,null,v),m.return=y,m;case za:return v=jf(v,y.mode,m),v.return=y,v;case an:var S=v._init;return d(y,S(v._payload),m)}if(Io(v)||mo(v))return v=sa(v,y.mode,m,null),v.return=y,v;Al(y,v)}return null}function h(y,v,m,S){var j=v!==null?v.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return j!==null?null:l(y,v,""+m,S);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case yl:return m.key===j?c(y,v,m,S):null;case za:return m.key===j?u(y,v,m,S):null;case an:return j=m._init,h(y,v,j(m._payload),S)}if(Io(m)||mo(m))return j!==null?null:f(y,v,m,S,null);Al(y,m)}return null}function p(y,v,m,S,j){if(typeof S=="string"&&S!==""||typeof S=="number")return y=y.get(m)||null,l(v,y,""+S,j);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case yl:return y=y.get(S.key===null?m:S.key)||null,c(v,y,S,j);case za:return y=y.get(S.key===null?m:S.key)||null,u(v,y,S,j);case an:var w=S._init;return p(y,v,m,w(S._payload),j)}if(Io(S)||mo(S))return y=y.get(m)||null,f(v,y,S,j,null);Al(v,S)}return null}function g(y,v,m,S){for(var j=null,w=null,N=v,_=v=0,k=null;N!==null&&_<m.length;_++){N.index>_?(k=N,N=null):k=N.sibling;var A=h(y,N,m[_],S);if(A===null){N===null&&(N=k);break}e&&N&&A.alternate===null&&t(y,N),v=i(A,v,_),w===null?j=A:w.sibling=A,w=A,N=k}if(_===m.length)return r(y,N),Ne&&Kn(y,_),j;if(N===null){for(;_<m.length;_++)N=d(y,m[_],S),N!==null&&(v=i(N,v,_),w===null?j=N:w.sibling=N,w=N);return Ne&&Kn(y,_),j}for(N=n(y,N);_<m.length;_++)k=p(N,y,_,m[_],S),k!==null&&(e&&k.alternate!==null&&N.delete(k.key===null?_:k.key),v=i(k,v,_),w===null?j=k:w.sibling=k,w=k);return e&&N.forEach(function(T){return t(y,T)}),Ne&&Kn(y,_),j}function b(y,v,m,S){var j=mo(m);if(typeof j!="function")throw Error(U(150));if(m=j.call(m),m==null)throw Error(U(151));for(var w=j=null,N=v,_=v=0,k=null,A=m.next();N!==null&&!A.done;_++,A=m.next()){N.index>_?(k=N,N=null):k=N.sibling;var T=h(y,N,A.value,S);if(T===null){N===null&&(N=k);break}e&&N&&T.alternate===null&&t(y,N),v=i(T,v,_),w===null?j=T:w.sibling=T,w=T,N=k}if(A.done)return r(y,N),Ne&&Kn(y,_),j;if(N===null){for(;!A.done;_++,A=m.next())A=d(y,A.value,S),A!==null&&(v=i(A,v,_),w===null?j=A:w.sibling=A,w=A);return Ne&&Kn(y,_),j}for(N=n(y,N);!A.done;_++,A=m.next())A=p(N,y,_,A.value,S),A!==null&&(e&&A.alternate!==null&&N.delete(A.key===null?_:A.key),v=i(A,v,_),w===null?j=A:w.sibling=A,w=A);return e&&N.forEach(function(C){return t(y,C)}),Ne&&Kn(y,_),j}function x(y,v,m,S){if(typeof m=="object"&&m!==null&&m.type===Wa&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case yl:e:{for(var j=m.key,w=v;w!==null;){if(w.key===j){if(j=m.type,j===Wa){if(w.tag===7){r(y,w.sibling),v=a(w,m.props.children),v.return=y,y=v;break e}}else if(w.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===an&&vy(j)===w.type){r(y,w.sibling),v=a(w,m.props),v.ref=bo(y,w,m),v.return=y,y=v;break e}r(y,w);break}else t(y,w);w=w.sibling}m.type===Wa?(v=sa(m.props.children,y.mode,S,m.key),v.return=y,y=v):(S=cc(m.type,m.key,m.props,null,y.mode,S),S.ref=bo(y,v,m),S.return=y,y=S)}return o(y);case za:e:{for(w=m.key;v!==null;){if(v.key===w)if(v.tag===4&&v.stateNode.containerInfo===m.containerInfo&&v.stateNode.implementation===m.implementation){r(y,v.sibling),v=a(v,m.children||[]),v.return=y,y=v;break e}else{r(y,v);break}else t(y,v);v=v.sibling}v=jf(m,y.mode,S),v.return=y,y=v}return o(y);case an:return w=m._init,x(y,v,w(m._payload),S)}if(Io(m))return g(y,v,m,S);if(mo(m))return b(y,v,m,S);Al(y,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,v!==null&&v.tag===6?(r(y,v.sibling),v=a(v,m),v.return=y,y=v):(r(y,v),v=bf(m,y.mode,S),v.return=y,y=v),o(y)):r(y,v)}return x}var yi=yw(!0),xw=yw(!1),_c=$n(null),Nc=null,Xa=null,Gm=null;function Ym(){Gm=Xa=Nc=null}function qm(e){var t=_c.current;Se(_c),e._currentValue=t}function Eh(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function li(e,t){Nc=e,Gm=Xa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(_t=!0),e.firstContext=null)}function Qt(e){var t=e._currentValue;if(Gm!==e)if(e={context:e,memoizedValue:t,next:null},Xa===null){if(Nc===null)throw Error(U(308));Xa=e,Nc.dependencies={lanes:0,firstContext:e}}else Xa=Xa.next=e;return t}var Zn=null;function Xm(e){Zn===null?Zn=[e]:Zn.push(e)}function bw(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,Xm(t)):(r.next=a.next,a.next=r),t.interleaved=r,Hr(e,n)}function Hr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var on=!1;function Qm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function jw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Rr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function jn(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,se&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,Hr(e,r)}return a=n.interleaved,a===null?(t.next=t,Xm(n)):(t.next=a.next,a.next=t),n.interleaved=t,Hr(e,r)}function nc(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Lm(e,r)}}function gy(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?a=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?a=i=t:i=i.next=t}else a=i=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Oc(e,t,r,n){var a=e.updateQueue;on=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==o&&(l===null?f.firstBaseUpdate=u:l.next=u,f.lastBaseUpdate=c))}if(i!==null){var d=a.baseState;o=0,f=u=c=null,l=i;do{var h=l.lane,p=l.eventTime;if((n&h)===h){f!==null&&(f=f.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,b=l;switch(h=t,p=r,b.tag){case 1:if(g=b.payload,typeof g=="function"){d=g.call(p,d,h);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,h=typeof g=="function"?g.call(p,d,h):g,h==null)break e;d=$e({},d,h);break e;case 2:on=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=a.effects,h===null?a.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(u=f=p,c=d):f=f.next=p,o|=h;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;h=l,l=h.next,h.next=null,a.lastBaseUpdate=h,a.shared.pending=null}}while(!0);if(f===null&&(c=d),a.baseState=c,a.firstBaseUpdate=u,a.lastBaseUpdate=f,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);ha|=o,e.lanes=o,e.memoizedState=d}}function yy(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],a=n.callback;if(a!==null){if(n.callback=null,n=r,typeof a!="function")throw Error(U(191,a));a.call(n)}}}var ol={},br=$n(ol),hs=$n(ol),ps=$n(ol);function Jn(e){if(e===ol)throw Error(U(174));return e}function Zm(e,t){switch(ye(ps,t),ye(hs,e),ye(br,ol),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:dh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=dh(t,e)}Se(br),ye(br,t)}function xi(){Se(br),Se(hs),Se(ps)}function ww(e){Jn(ps.current);var t=Jn(br.current),r=dh(t,e.type);t!==r&&(ye(hs,e),ye(br,r))}function Jm(e){hs.current===e&&(Se(br),Se(hs))}var Pe=$n(0);function kc(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var pf=[];function ev(){for(var e=0;e<pf.length;e++)pf[e]._workInProgressVersionPrimary=null;pf.length=0}var ac=qr.ReactCurrentDispatcher,mf=qr.ReactCurrentBatchConfig,fa=0,Ae=null,He=null,Xe=null,Pc=!1,Vo=!1,ms=0,gP=0;function it(){throw Error(U(321))}function tv(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!fr(e[r],t[r]))return!1;return!0}function rv(e,t,r,n,a,i){if(fa=i,Ae=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ac.current=e===null||e.memoizedState===null?jP:wP,e=r(n,a),Vo){i=0;do{if(Vo=!1,ms=0,25<=i)throw Error(U(301));i+=1,Xe=He=null,t.updateQueue=null,ac.current=SP,e=r(n,a)}while(Vo)}if(ac.current=Ac,t=He!==null&&He.next!==null,fa=0,Xe=He=Ae=null,Pc=!1,t)throw Error(U(300));return e}function nv(){var e=ms!==0;return ms=0,e}function mr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?Ae.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Zt(){if(He===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var t=Xe===null?Ae.memoizedState:Xe.next;if(t!==null)Xe=t,He=e;else{if(e===null)throw Error(U(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},Xe===null?Ae.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function vs(e,t){return typeof t=="function"?t(e):t}function vf(e){var t=Zt(),r=t.queue;if(r===null)throw Error(U(311));r.lastRenderedReducer=e;var n=He,a=n.baseQueue,i=r.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}n.baseQueue=a=i,r.pending=null}if(a!==null){i=a.next,n=n.baseState;var l=o=null,c=null,u=i;do{var f=u.lane;if((fa&f)===f)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var d={lane:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=d,o=n):c=c.next=d,Ae.lanes|=f,ha|=f}u=u.next}while(u!==null&&u!==i);c===null?o=n:c.next=l,fr(n,t.memoizedState)||(_t=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){a=e;do i=a.lane,Ae.lanes|=i,ha|=i,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function gf(e){var t=Zt(),r=t.queue;if(r===null)throw Error(U(311));r.lastRenderedReducer=e;var n=r.dispatch,a=r.pending,i=t.memoizedState;if(a!==null){r.pending=null;var o=a=a.next;do i=e(i,o.action),o=o.next;while(o!==a);fr(i,t.memoizedState)||(_t=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function Sw(){}function _w(e,t){var r=Ae,n=Zt(),a=t(),i=!fr(n.memoizedState,a);if(i&&(n.memoizedState=a,_t=!0),n=n.queue,av(kw.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||Xe!==null&&Xe.memoizedState.tag&1){if(r.flags|=2048,gs(9,Ow.bind(null,r,n,a,t),void 0,null),Ze===null)throw Error(U(349));fa&30||Nw(r,t,a)}return a}function Nw(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ae.updateQueue,t===null?(t={lastEffect:null,stores:null},Ae.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Ow(e,t,r,n){t.value=r,t.getSnapshot=n,Pw(t)&&Aw(e)}function kw(e,t,r){return r(function(){Pw(t)&&Aw(e)})}function Pw(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!fr(e,r)}catch{return!0}}function Aw(e){var t=Hr(e,1);t!==null&&ur(t,e,1,-1)}function xy(e){var t=mr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:e},t.queue=e,e=e.dispatch=bP.bind(null,Ae,e),[t.memoizedState,e]}function gs(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Ae.updateQueue,t===null?(t={lastEffect:null,stores:null},Ae.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function $w(){return Zt().memoizedState}function ic(e,t,r,n){var a=mr();Ae.flags|=e,a.memoizedState=gs(1|t,r,void 0,n===void 0?null:n)}function Ku(e,t,r,n){var a=Zt();n=n===void 0?null:n;var i=void 0;if(He!==null){var o=He.memoizedState;if(i=o.destroy,n!==null&&tv(n,o.deps)){a.memoizedState=gs(t,r,i,n);return}}Ae.flags|=e,a.memoizedState=gs(1|t,r,i,n)}function by(e,t){return ic(8390656,8,e,t)}function av(e,t){return Ku(2048,8,e,t)}function Ew(e,t){return Ku(4,2,e,t)}function Cw(e,t){return Ku(4,4,e,t)}function Tw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Mw(e,t,r){return r=r!=null?r.concat([e]):null,Ku(4,4,Tw.bind(null,t,e),r)}function iv(){}function Iw(e,t){var r=Zt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&tv(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Lw(e,t){var r=Zt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&tv(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Dw(e,t,r){return fa&21?(fr(r,t)||(r=Wj(),Ae.lanes|=r,ha|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,_t=!0),e.memoizedState=r)}function yP(e,t){var r=ue;ue=r!==0&&4>r?r:4,e(!0);var n=mf.transition;mf.transition={};try{e(!1),t()}finally{ue=r,mf.transition=n}}function Rw(){return Zt().memoizedState}function xP(e,t,r){var n=Sn(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Bw(e))Fw(t,r);else if(r=bw(e,t,r,n),r!==null){var a=mt();ur(r,e,n,a),zw(r,t,n)}}function bP(e,t,r){var n=Sn(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Bw(e))Fw(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,r);if(a.hasEagerState=!0,a.eagerState=l,fr(l,o)){var c=t.interleaved;c===null?(a.next=a,Xm(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}r=bw(e,t,a,n),r!==null&&(a=mt(),ur(r,e,n,a),zw(r,t,n))}}function Bw(e){var t=e.alternate;return e===Ae||t!==null&&t===Ae}function Fw(e,t){Vo=Pc=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function zw(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Lm(e,r)}}var Ac={readContext:Qt,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useInsertionEffect:it,useLayoutEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useMutableSource:it,useSyncExternalStore:it,useId:it,unstable_isNewReconciler:!1},jP={readContext:Qt,useCallback:function(e,t){return mr().memoizedState=[e,t===void 0?null:t],e},useContext:Qt,useEffect:by,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ic(4194308,4,Tw.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ic(4194308,4,e,t)},useInsertionEffect:function(e,t){return ic(4,2,e,t)},useMemo:function(e,t){var r=mr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=mr();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=xP.bind(null,Ae,e),[n.memoizedState,e]},useRef:function(e){var t=mr();return e={current:e},t.memoizedState=e},useState:xy,useDebugValue:iv,useDeferredValue:function(e){return mr().memoizedState=e},useTransition:function(){var e=xy(!1),t=e[0];return e=yP.bind(null,e[1]),mr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ae,a=mr();if(Ne){if(r===void 0)throw Error(U(407));r=r()}else{if(r=t(),Ze===null)throw Error(U(349));fa&30||Nw(n,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,by(kw.bind(null,n,i,e),[e]),n.flags|=2048,gs(9,Ow.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=mr(),t=Ze.identifierPrefix;if(Ne){var r=Mr,n=Tr;r=(n&~(1<<32-cr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=ms++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=gP++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},wP={readContext:Qt,useCallback:Iw,useContext:Qt,useEffect:av,useImperativeHandle:Mw,useInsertionEffect:Ew,useLayoutEffect:Cw,useMemo:Lw,useReducer:vf,useRef:$w,useState:function(){return vf(vs)},useDebugValue:iv,useDeferredValue:function(e){var t=Zt();return Dw(t,He.memoizedState,e)},useTransition:function(){var e=vf(vs)[0],t=Zt().memoizedState;return[e,t]},useMutableSource:Sw,useSyncExternalStore:_w,useId:Rw,unstable_isNewReconciler:!1},SP={readContext:Qt,useCallback:Iw,useContext:Qt,useEffect:av,useImperativeHandle:Mw,useInsertionEffect:Ew,useLayoutEffect:Cw,useMemo:Lw,useReducer:gf,useRef:$w,useState:function(){return gf(vs)},useDebugValue:iv,useDeferredValue:function(e){var t=Zt();return He===null?t.memoizedState=e:Dw(t,He.memoizedState,e)},useTransition:function(){var e=gf(vs)[0],t=Zt().memoizedState;return[e,t]},useMutableSource:Sw,useSyncExternalStore:_w,useId:Rw,unstable_isNewReconciler:!1};function ar(e,t){if(e&&e.defaultProps){t=$e({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Ch(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:$e({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Vu={isMounted:function(e){return(e=e._reactInternals)?Sa(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=mt(),a=Sn(e),i=Rr(n,a);i.payload=t,r!=null&&(i.callback=r),t=jn(e,i,a),t!==null&&(ur(t,e,a,n),nc(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=mt(),a=Sn(e),i=Rr(n,a);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=jn(e,i,a),t!==null&&(ur(t,e,a,n),nc(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=mt(),n=Sn(e),a=Rr(r,n);a.tag=2,t!=null&&(a.callback=t),t=jn(e,a,n),t!==null&&(ur(t,e,n,r),nc(t,e,n))}};function jy(e,t,r,n,a,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,o):t.prototype&&t.prototype.isPureReactComponent?!cs(r,n)||!cs(a,i):!0}function Ww(e,t,r){var n=!1,a=Pn,i=t.contextType;return typeof i=="object"&&i!==null?i=Qt(i):(a=kt(t)?ua:ut.current,n=t.contextTypes,i=(n=n!=null)?vi(e,a):Pn),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Vu,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function wy(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Vu.enqueueReplaceState(t,t.state,null)}function Th(e,t,r,n){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},Qm(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=Qt(i):(i=kt(t)?ua:ut.current,a.context=vi(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Ch(e,t,i,r),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&Vu.enqueueReplaceState(a,a.state,null),Oc(e,r,a,n),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function bi(e,t){try{var r="",n=t;do r+=Q2(n),n=n.return;while(n);var a=r}catch(i){a=`
+Error generating stack: `+i.message+`
+`+i.stack}return{value:e,source:t,stack:a,digest:null}}function yf(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Mh(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var _P=typeof WeakMap=="function"?WeakMap:Map;function Uw(e,t,r){r=Rr(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Ec||(Ec=!0,Hh=n),Mh(e,t)},r}function Hw(e,t,r){r=Rr(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var a=t.value;r.payload=function(){return n(a)},r.callback=function(){Mh(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Mh(e,t),typeof n!="function"&&(wn===null?wn=new Set([this]):wn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function Sy(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new _P;var a=new Set;n.set(t,a)}else a=n.get(t),a===void 0&&(a=new Set,n.set(t,a));a.has(r)||(a.add(r),e=RP.bind(null,e,t,r),t.then(e,e))}function _y(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ny(e,t,r,n,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Rr(-1,1),t.tag=2,jn(r,t,1))),r.lanes|=1),e)}var NP=qr.ReactCurrentOwner,_t=!1;function dt(e,t,r,n){t.child=e===null?xw(t,null,r,n):yi(t,e.child,r,n)}function Oy(e,t,r,n,a){r=r.render;var i=t.ref;return li(t,a),n=rv(e,t,r,n,i,a),r=nv(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Kr(e,t,a)):(Ne&&r&&Hm(t),t.flags|=1,dt(e,t,n,a),t.child)}function ky(e,t,r,n,a){if(e===null){var i=r.type;return typeof i=="function"&&!hv(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,Kw(e,t,i,n,a)):(e=cc(r.type,null,n,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var o=i.memoizedProps;if(r=r.compare,r=r!==null?r:cs,r(o,n)&&e.ref===t.ref)return Kr(e,t,a)}return t.flags|=1,e=_n(i,n),e.ref=t.ref,e.return=t,t.child=e}function Kw(e,t,r,n,a){if(e!==null){var i=e.memoizedProps;if(cs(i,n)&&e.ref===t.ref)if(_t=!1,t.pendingProps=n=i,(e.lanes&a)!==0)e.flags&131072&&(_t=!0);else return t.lanes=e.lanes,Kr(e,t,a)}return Ih(e,t,r,n,a)}function Vw(e,t,r){var n=t.pendingProps,a=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ye(Za,Et),Et|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ye(Za,Et),Et|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,ye(Za,Et),Et|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,ye(Za,Et),Et|=n;return dt(e,t,a,r),t.child}function Gw(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Ih(e,t,r,n,a){var i=kt(r)?ua:ut.current;return i=vi(t,i),li(t,a),r=rv(e,t,r,n,i,a),n=nv(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Kr(e,t,a)):(Ne&&n&&Hm(t),t.flags|=1,dt(e,t,r,a),t.child)}function Py(e,t,r,n,a){if(kt(r)){var i=!0;jc(t)}else i=!1;if(li(t,a),t.stateNode===null)oc(e,t),Ww(t,r,n),Th(t,r,n,a),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=Qt(u):(u=kt(r)?ua:ut.current,u=vi(t,u));var f=r.getDerivedStateFromProps,d=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||c!==u)&&wy(t,o,n,u),on=!1;var h=t.memoizedState;o.state=h,Oc(t,n,o,a),c=t.memoizedState,l!==n||h!==c||Ot.current||on?(typeof f=="function"&&(Ch(t,r,f,n),c=t.memoizedState),(l=on||jy(t,r,l,n,h,c,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),o.props=n,o.state=c,o.context=u,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,jw(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:ar(t.type,l),o.props=u,d=t.pendingProps,h=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=Qt(c):(c=kt(r)?ua:ut.current,c=vi(t,c));var p=r.getDerivedStateFromProps;(f=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==d||h!==c)&&wy(t,o,n,c),on=!1,h=t.memoizedState,o.state=h,Oc(t,n,o,a);var g=t.memoizedState;l!==d||h!==g||Ot.current||on?(typeof p=="function"&&(Ch(t,r,p,n),g=t.memoizedState),(u=on||jy(t,r,u,n,h,g,c)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,g,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,g,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=g),o.props=n,o.state=g,o.context=c,n=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return Lh(e,t,r,n,i,a)}function Lh(e,t,r,n,a,i){Gw(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return a&&hy(t,r,!1),Kr(e,t,i);n=t.stateNode,NP.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=yi(t,e.child,null,i),t.child=yi(t,null,l,i)):dt(e,t,l,i),t.memoizedState=n.state,a&&hy(t,r,!0),t.child}function Yw(e){var t=e.stateNode;t.pendingContext?fy(e,t.pendingContext,t.pendingContext!==t.context):t.context&&fy(e,t.context,!1),Zm(e,t.containerInfo)}function Ay(e,t,r,n,a){return gi(),Vm(a),t.flags|=256,dt(e,t,r,n),t.child}var Dh={dehydrated:null,treeContext:null,retryLane:0};function Rh(e){return{baseLanes:e,cachePool:null,transitions:null}}function qw(e,t,r){var n=t.pendingProps,a=Pe.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),ye(Pe,a&1),e===null)return $h(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,i?(n=t.mode,i=t.child,o={mode:"hidden",children:o},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=qu(o,n,0,null),e=sa(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Rh(r),t.memoizedState=Dh,e):ov(t,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return OP(e,t,o,n,l,a,r);if(i){i=n.fallback,o=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&t.child!==a?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=_n(a,c),n.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=_n(l,i):(i=sa(i,o,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,o=e.child.memoizedState,o=o===null?Rh(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~r,t.memoizedState=Dh,n}return i=e.child,e=i.sibling,n=_n(i,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function ov(e,t){return t=qu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function $l(e,t,r,n){return n!==null&&Vm(n),yi(t,e.child,null,r),e=ov(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function OP(e,t,r,n,a,i,o){if(r)return t.flags&256?(t.flags&=-257,n=yf(Error(U(422))),$l(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,a=t.mode,n=qu({mode:"visible",children:n.children},a,0,null),i=sa(i,a,o,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&yi(t,e.child,null,o),t.child.memoizedState=Rh(o),t.memoizedState=Dh,i);if(!(t.mode&1))return $l(e,t,o,null);if(a.data==="$!"){if(n=a.nextSibling&&a.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(U(419)),n=yf(i,n,void 0),$l(e,t,o,n)}if(l=(o&e.childLanes)!==0,_t||l){if(n=Ze,n!==null){switch(o&-o){case 4:a=2;break;case 16:a=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(n.suspendedLanes|o)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Hr(e,a),ur(n,e,a,-1))}return fv(),n=yf(Error(U(421))),$l(e,t,o,n)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=BP.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,Mt=bn(a.nextSibling),It=t,Ne=!0,sr=null,e!==null&&(Ht[Kt++]=Tr,Ht[Kt++]=Mr,Ht[Kt++]=da,Tr=e.id,Mr=e.overflow,da=t),t=ov(t,n.children),t.flags|=4096,t)}function $y(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Eh(e.return,t,r)}function xf(e,t,r,n,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=a)}function Xw(e,t,r){var n=t.pendingProps,a=n.revealOrder,i=n.tail;if(dt(e,t,n.children,r),n=Pe.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$y(e,r,t);else if(e.tag===19)$y(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(ye(Pe,n),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&kc(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),xf(t,!1,a,r,i);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&kc(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}xf(t,!0,r,null,i);break;case"together":xf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function oc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Kr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),ha|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(U(153));if(t.child!==null){for(e=t.child,r=_n(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=_n(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function kP(e,t,r){switch(t.tag){case 3:Yw(t),gi();break;case 5:ww(t);break;case 1:kt(t.type)&&jc(t);break;case 4:Zm(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,a=t.memoizedProps.value;ye(_c,n._currentValue),n._currentValue=a;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(ye(Pe,Pe.current&1),t.flags|=128,null):r&t.child.childLanes?qw(e,t,r):(ye(Pe,Pe.current&1),e=Kr(e,t,r),e!==null?e.sibling:null);ye(Pe,Pe.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Xw(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ye(Pe,Pe.current),n)break;return null;case 22:case 23:return t.lanes=0,Vw(e,t,r)}return Kr(e,t,r)}var Qw,Bh,Zw,Jw;Qw=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Bh=function(){};Zw=function(e,t,r,n){var a=e.memoizedProps;if(a!==n){e=t.stateNode,Jn(br.current);var i=null;switch(r){case"input":a=sh(e,a),n=sh(e,n),i=[];break;case"select":a=$e({},a,{value:void 0}),n=$e({},n,{value:void 0}),i=[];break;case"textarea":a=uh(e,a),n=uh(e,n),i=[];break;default:typeof a.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=xc)}fh(r,n);var o;r=null;for(u in a)if(!n.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var l=a[u];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(rs.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(l=a!=null?a[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(rs.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&be("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Jw=function(e,t,r,n){r!==n&&(t.flags|=4)};function jo(e,t){if(!Ne)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags&14680064,n|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function PP(e,t,r){var n=t.pendingProps;switch(Km(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(t),null;case 1:return kt(t.type)&&bc(),ot(t),null;case 3:return n=t.stateNode,xi(),Se(Ot),Se(ut),ev(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Pl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,sr!==null&&(Gh(sr),sr=null))),Bh(e,t),ot(t),null;case 5:Jm(t);var a=Jn(ps.current);if(r=t.type,e!==null&&t.stateNode!=null)Zw(e,t,r,n,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(U(166));return ot(t),null}if(e=Jn(br.current),Pl(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[vr]=t,n[fs]=i,e=(t.mode&1)!==0,r){case"dialog":be("cancel",n),be("close",n);break;case"iframe":case"object":case"embed":be("load",n);break;case"video":case"audio":for(a=0;a<Do.length;a++)be(Do[a],n);break;case"source":be("error",n);break;case"img":case"image":case"link":be("error",n),be("load",n);break;case"details":be("toggle",n);break;case"input":Bg(n,i),be("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},be("invalid",n);break;case"textarea":zg(n,i),be("invalid",n)}fh(r,i),a=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&kl(n.textContent,l,e),a=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&kl(n.textContent,l,e),a=["children",""+l]):rs.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&be("scroll",n)}switch(r){case"input":xl(n),Fg(n,i,!0);break;case"textarea":xl(n),Wg(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=xc)}n=a,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=kj(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[vr]=t,e[fs]=n,Qw(e,t,!1,!1),t.stateNode=e;e:{switch(o=hh(r,n),r){case"dialog":be("cancel",e),be("close",e),a=n;break;case"iframe":case"object":case"embed":be("load",e),a=n;break;case"video":case"audio":for(a=0;a<Do.length;a++)be(Do[a],e);a=n;break;case"source":be("error",e),a=n;break;case"img":case"image":case"link":be("error",e),be("load",e),a=n;break;case"details":be("toggle",e),a=n;break;case"input":Bg(e,n),a=sh(e,n),be("invalid",e);break;case"option":a=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},a=$e({},n,{value:void 0}),be("invalid",e);break;case"textarea":zg(e,n),a=uh(e,n),be("invalid",e);break;default:a=n}fh(r,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?$j(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Pj(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&ns(e,c):typeof c=="number"&&ns(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(rs.hasOwnProperty(i)?c!=null&&i==="onScroll"&&be("scroll",e):c!=null&&$m(e,i,c,o))}switch(r){case"input":xl(e),Fg(e,n,!1);break;case"textarea":xl(e),Wg(e);break;case"option":n.value!=null&&e.setAttribute("value",""+kn(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?ai(e,!!n.multiple,i,!1):n.defaultValue!=null&&ai(e,!!n.multiple,n.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=xc)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ot(t),null;case 6:if(e&&t.stateNode!=null)Jw(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(U(166));if(r=Jn(ps.current),Jn(br.current),Pl(t)){if(n=t.stateNode,r=t.memoizedProps,n[vr]=t,(i=n.nodeValue!==r)&&(e=It,e!==null))switch(e.tag){case 3:kl(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&kl(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[vr]=t,t.stateNode=n}return ot(t),null;case 13:if(Se(Pe),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ne&&Mt!==null&&t.mode&1&&!(t.flags&128))gw(),gi(),t.flags|=98560,i=!1;else if(i=Pl(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(U(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(U(317));i[vr]=t}else gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ot(t),i=!1}else sr!==null&&(Gh(sr),sr=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Pe.current&1?Ve===0&&(Ve=3):fv())),t.updateQueue!==null&&(t.flags|=4),ot(t),null);case 4:return xi(),Bh(e,t),e===null&&us(t.stateNode.containerInfo),ot(t),null;case 10:return qm(t.type._context),ot(t),null;case 17:return kt(t.type)&&bc(),ot(t),null;case 19:if(Se(Pe),i=t.memoizedState,i===null)return ot(t),null;if(n=(t.flags&128)!==0,o=i.rendering,o===null)if(n)jo(i,!1);else{if(Ve!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=kc(e),o!==null){for(t.flags|=128,jo(i,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ye(Pe,Pe.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ie()>ji&&(t.flags|=128,n=!0,jo(i,!1),t.lanes=4194304)}else{if(!n)if(e=kc(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),jo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ne)return ot(t),null}else 2*Ie()-i.renderingStartTime>ji&&r!==1073741824&&(t.flags|=128,n=!0,jo(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(r=i.last,r!==null?r.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ie(),t.sibling=null,r=Pe.current,ye(Pe,n?r&1|2:r&1),t):(ot(t),null);case 22:case 23:return dv(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Et&1073741824&&(ot(t),t.subtreeFlags&6&&(t.flags|=8192)):ot(t),null;case 24:return null;case 25:return null}throw Error(U(156,t.tag))}function AP(e,t){switch(Km(t),t.tag){case 1:return kt(t.type)&&bc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xi(),Se(Ot),Se(ut),ev(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Jm(t),null;case 13:if(Se(Pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(U(340));gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Se(Pe),null;case 4:return xi(),null;case 10:return qm(t.type._context),null;case 22:case 23:return dv(),null;case 24:return null;default:return null}}var El=!1,lt=!1,$P=typeof WeakSet=="function"?WeakSet:Set,G=null;function Qa(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ce(e,t,n)}else r.current=null}function Fh(e,t,r){try{r()}catch(n){Ce(e,t,n)}}var Ey=!1;function EP(e,t){if(Sh=vc,e=aw(),Um(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,u=0,f=0,d=e,h=null;t:for(;;){for(var p;d!==r||a!==0&&d.nodeType!==3||(l=o+a),d!==i||n!==0&&d.nodeType!==3||(c=o+n),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===r&&++u===a&&(l=o),h===i&&++f===n&&(c=o),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(_h={focusedElem:e,selectionRange:r},vc=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var b=g.memoizedProps,x=g.memoizedState,y=t.stateNode,v=y.getSnapshotBeforeUpdate(t.elementType===t.type?b:ar(t.type,b),x);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(U(163))}}catch(S){Ce(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return g=Ey,Ey=!1,g}function Go(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&Fh(t,r,i)}a=a.next}while(a!==n)}}function Gu(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function zh(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function eS(e){var t=e.alternate;t!==null&&(e.alternate=null,eS(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vr],delete t[fs],delete t[kh],delete t[hP],delete t[pP])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function tS(e){return e.tag===5||e.tag===3||e.tag===4}function Cy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tS(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Wh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=xc));else if(n!==4&&(e=e.child,e!==null))for(Wh(e,t,r),e=e.sibling;e!==null;)Wh(e,t,r),e=e.sibling}function Uh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Uh(e,t,r),e=e.sibling;e!==null;)Uh(e,t,r),e=e.sibling}var rt=null,ir=!1;function tn(e,t,r){for(r=r.child;r!==null;)rS(e,t,r),r=r.sibling}function rS(e,t,r){if(xr&&typeof xr.onCommitFiberUnmount=="function")try{xr.onCommitFiberUnmount(Bu,r)}catch{}switch(r.tag){case 5:lt||Qa(r,t);case 6:var n=rt,a=ir;rt=null,tn(e,t,r),rt=n,ir=a,rt!==null&&(ir?(e=rt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):rt.removeChild(r.stateNode));break;case 18:rt!==null&&(ir?(e=rt,r=r.stateNode,e.nodeType===8?ff(e.parentNode,r):e.nodeType===1&&ff(e,r),ss(e)):ff(rt,r.stateNode));break;case 4:n=rt,a=ir,rt=r.stateNode.containerInfo,ir=!0,tn(e,t,r),rt=n,ir=a;break;case 0:case 11:case 14:case 15:if(!lt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Fh(r,t,o),a=a.next}while(a!==n)}tn(e,t,r);break;case 1:if(!lt&&(Qa(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Ce(r,t,l)}tn(e,t,r);break;case 21:tn(e,t,r);break;case 22:r.mode&1?(lt=(n=lt)||r.memoizedState!==null,tn(e,t,r),lt=n):tn(e,t,r);break;default:tn(e,t,r)}}function Ty(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new $P),t.forEach(function(n){var a=FP.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function rr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var a=r[n];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:rt=l.stateNode,ir=!1;break e;case 3:rt=l.stateNode.containerInfo,ir=!0;break e;case 4:rt=l.stateNode.containerInfo,ir=!0;break e}l=l.return}if(rt===null)throw Error(U(160));rS(i,o,a),rt=null,ir=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(u){Ce(a,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)nS(t,e),t=t.sibling}function nS(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(rr(t,e),pr(e),n&4){try{Go(3,e,e.return),Gu(3,e)}catch(b){Ce(e,e.return,b)}try{Go(5,e,e.return)}catch(b){Ce(e,e.return,b)}}break;case 1:rr(t,e),pr(e),n&512&&r!==null&&Qa(r,r.return);break;case 5:if(rr(t,e),pr(e),n&512&&r!==null&&Qa(r,r.return),e.flags&32){var a=e.stateNode;try{ns(a,"")}catch(b){Ce(e,e.return,b)}}if(n&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,o=r!==null?r.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&Nj(a,i),hh(l,o);var u=hh(l,i);for(o=0;o<c.length;o+=2){var f=c[o],d=c[o+1];f==="style"?$j(a,d):f==="dangerouslySetInnerHTML"?Pj(a,d):f==="children"?ns(a,d):$m(a,f,d,u)}switch(l){case"input":lh(a,i);break;case"textarea":Oj(a,i);break;case"select":var h=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?ai(a,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?ai(a,!!i.multiple,i.defaultValue,!0):ai(a,!!i.multiple,i.multiple?[]:"",!1))}a[fs]=i}catch(b){Ce(e,e.return,b)}}break;case 6:if(rr(t,e),pr(e),n&4){if(e.stateNode===null)throw Error(U(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(b){Ce(e,e.return,b)}}break;case 3:if(rr(t,e),pr(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{ss(t.containerInfo)}catch(b){Ce(e,e.return,b)}break;case 4:rr(t,e),pr(e);break;case 13:rr(t,e),pr(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(cv=Ie())),n&4&&Ty(e);break;case 22:if(f=r!==null&&r.memoizedState!==null,e.mode&1?(lt=(u=lt)||f,rr(t,e),lt=u):rr(t,e),pr(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!f&&e.mode&1)for(G=e,f=e.child;f!==null;){for(d=G=f;G!==null;){switch(h=G,p=h.child,h.tag){case 0:case 11:case 14:case 15:Go(4,h,h.return);break;case 1:Qa(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(b){Ce(n,r,b)}}break;case 5:Qa(h,h.return);break;case 22:if(h.memoizedState!==null){Iy(d);continue}}p!==null?(p.return=h,G=p):Iy(d)}f=f.sibling}e:for(f=null,d=e;;){if(d.tag===5){if(f===null){f=d;try{a=d.stateNode,u?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=d.stateNode,c=d.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Aj("display",o))}catch(b){Ce(e,e.return,b)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(b){Ce(e,e.return,b)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:rr(t,e),pr(e),n&4&&Ty(e);break;case 21:break;default:rr(t,e),pr(e)}}function pr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(tS(r)){var n=r;break e}r=r.return}throw Error(U(160))}switch(n.tag){case 5:var a=n.stateNode;n.flags&32&&(ns(a,""),n.flags&=-33);var i=Cy(e);Uh(e,i,a);break;case 3:case 4:var o=n.stateNode.containerInfo,l=Cy(e);Wh(e,l,o);break;default:throw Error(U(161))}}catch(c){Ce(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function CP(e,t,r){G=e,aS(e)}function aS(e,t,r){for(var n=(e.mode&1)!==0;G!==null;){var a=G,i=a.child;if(a.tag===22&&n){var o=a.memoizedState!==null||El;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||lt;l=El;var u=lt;if(El=o,(lt=c)&&!u)for(G=a;G!==null;)o=G,c=o.child,o.tag===22&&o.memoizedState!==null?Ly(a):c!==null?(c.return=o,G=c):Ly(a);for(;i!==null;)G=i,aS(i),i=i.sibling;G=a,El=l,lt=u}My(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,G=i):My(e)}}function My(e){for(;G!==null;){var t=G;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:lt||Gu(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!lt)if(r===null)n.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:ar(t.type,r.memoizedProps);n.componentDidUpdate(a,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&yy(t,i,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}yy(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var f=u.memoizedState;if(f!==null){var d=f.dehydrated;d!==null&&ss(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(U(163))}lt||t.flags&512&&zh(t)}catch(h){Ce(t,t.return,h)}}if(t===e){G=null;break}if(r=t.sibling,r!==null){r.return=t.return,G=r;break}G=t.return}}function Iy(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var r=t.sibling;if(r!==null){r.return=t.return,G=r;break}G=t.return}}function Ly(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Gu(4,t)}catch(c){Ce(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var a=t.return;try{n.componentDidMount()}catch(c){Ce(t,a,c)}}var i=t.return;try{zh(t)}catch(c){Ce(t,i,c)}break;case 5:var o=t.return;try{zh(t)}catch(c){Ce(t,o,c)}}}catch(c){Ce(t,t.return,c)}if(t===e){G=null;break}var l=t.sibling;if(l!==null){l.return=t.return,G=l;break}G=t.return}}var TP=Math.ceil,$c=qr.ReactCurrentDispatcher,sv=qr.ReactCurrentOwner,qt=qr.ReactCurrentBatchConfig,se=0,Ze=null,De=null,nt=0,Et=0,Za=$n(0),Ve=0,ys=null,ha=0,Yu=0,lv=0,Yo=null,wt=null,cv=0,ji=1/0,$r=null,Ec=!1,Hh=null,wn=null,Cl=!1,fn=null,Cc=0,qo=0,Kh=null,sc=-1,lc=0;function mt(){return se&6?Ie():sc!==-1?sc:sc=Ie()}function Sn(e){return e.mode&1?se&2&&nt!==0?nt&-nt:vP.transition!==null?(lc===0&&(lc=Wj()),lc):(e=ue,e!==0||(e=window.event,e=e===void 0?16:qj(e.type)),e):1}function ur(e,t,r,n){if(50<qo)throw qo=0,Kh=null,Error(U(185));nl(e,r,n),(!(se&2)||e!==Ze)&&(e===Ze&&(!(se&2)&&(Yu|=r),Ve===4&&cn(e,nt)),Pt(e,n),r===1&&se===0&&!(t.mode&1)&&(ji=Ie()+500,Hu&&En()))}function Pt(e,t){var r=e.callbackNode;vk(e,t);var n=mc(e,e===Ze?nt:0);if(n===0)r!==null&&Kg(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&Kg(r),t===1)e.tag===0?mP(Dy.bind(null,e)):pw(Dy.bind(null,e)),dP(function(){!(se&6)&&En()}),r=null;else{switch(Uj(n)){case 1:r=Im;break;case 4:r=Fj;break;case 16:r=pc;break;case 536870912:r=zj;break;default:r=pc}r=fS(r,iS.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function iS(e,t){if(sc=-1,lc=0,se&6)throw Error(U(327));var r=e.callbackNode;if(ci()&&e.callbackNode!==r)return null;var n=mc(e,e===Ze?nt:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Tc(e,n);else{t=n;var a=se;se|=2;var i=sS();(Ze!==e||nt!==t)&&($r=null,ji=Ie()+500,oa(e,t));do try{LP();break}catch(l){oS(e,l)}while(!0);Ym(),$c.current=i,se=a,De!==null?t=0:(Ze=null,nt=0,t=Ve)}if(t!==0){if(t===2&&(a=yh(e),a!==0&&(n=a,t=Vh(e,a))),t===1)throw r=ys,oa(e,0),cn(e,n),Pt(e,Ie()),r;if(t===6)cn(e,n);else{if(a=e.current.alternate,!(n&30)&&!MP(a)&&(t=Tc(e,n),t===2&&(i=yh(e),i!==0&&(n=i,t=Vh(e,i))),t===1))throw r=ys,oa(e,0),cn(e,n),Pt(e,Ie()),r;switch(e.finishedWork=a,e.finishedLanes=n,t){case 0:case 1:throw Error(U(345));case 2:Vn(e,wt,$r);break;case 3:if(cn(e,n),(n&130023424)===n&&(t=cv+500-Ie(),10<t)){if(mc(e,0)!==0)break;if(a=e.suspendedLanes,(a&n)!==n){mt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Oh(Vn.bind(null,e,wt,$r),t);break}Vn(e,wt,$r);break;case 4:if(cn(e,n),(n&4194240)===n)break;for(t=e.eventTimes,a=-1;0<n;){var o=31-cr(n);i=1<<o,o=t[o],o>a&&(a=o),n&=~i}if(n=a,n=Ie()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*TP(n/1960))-n,10<n){e.timeoutHandle=Oh(Vn.bind(null,e,wt,$r),n);break}Vn(e,wt,$r);break;case 5:Vn(e,wt,$r);break;default:throw Error(U(329))}}}return Pt(e,Ie()),e.callbackNode===r?iS.bind(null,e):null}function Vh(e,t){var r=Yo;return e.current.memoizedState.isDehydrated&&(oa(e,t).flags|=256),e=Tc(e,t),e!==2&&(t=wt,wt=r,t!==null&&Gh(t)),e}function Gh(e){wt===null?wt=e:wt.push.apply(wt,e)}function MP(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var a=r[n],i=a.getSnapshot;a=a.value;try{if(!fr(i(),a))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function cn(e,t){for(t&=~lv,t&=~Yu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-cr(t),n=1<<r;e[r]=-1,t&=~n}}function Dy(e){if(se&6)throw Error(U(327));ci();var t=mc(e,0);if(!(t&1))return Pt(e,Ie()),null;var r=Tc(e,t);if(e.tag!==0&&r===2){var n=yh(e);n!==0&&(t=n,r=Vh(e,n))}if(r===1)throw r=ys,oa(e,0),cn(e,t),Pt(e,Ie()),r;if(r===6)throw Error(U(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Vn(e,wt,$r),Pt(e,Ie()),null}function uv(e,t){var r=se;se|=1;try{return e(t)}finally{se=r,se===0&&(ji=Ie()+500,Hu&&En())}}function pa(e){fn!==null&&fn.tag===0&&!(se&6)&&ci();var t=se;se|=1;var r=qt.transition,n=ue;try{if(qt.transition=null,ue=1,e)return e()}finally{ue=n,qt.transition=r,se=t,!(se&6)&&En()}}function dv(){Et=Za.current,Se(Za)}function oa(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,uP(r)),De!==null)for(r=De.return;r!==null;){var n=r;switch(Km(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&bc();break;case 3:xi(),Se(Ot),Se(ut),ev();break;case 5:Jm(n);break;case 4:xi();break;case 13:Se(Pe);break;case 19:Se(Pe);break;case 10:qm(n.type._context);break;case 22:case 23:dv()}r=r.return}if(Ze=e,De=e=_n(e.current,null),nt=Et=t,Ve=0,ys=null,lv=Yu=ha=0,wt=Yo=null,Zn!==null){for(t=0;t<Zn.length;t++)if(r=Zn[t],n=r.interleaved,n!==null){r.interleaved=null;var a=n.next,i=r.pending;if(i!==null){var o=i.next;i.next=a,n.next=o}r.pending=n}Zn=null}return e}function oS(e,t){do{var r=De;try{if(Ym(),ac.current=Ac,Pc){for(var n=Ae.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}Pc=!1}if(fa=0,Xe=He=Ae=null,Vo=!1,ms=0,sv.current=null,r===null||r.return===null){Ve=1,ys=t,De=null;break}e:{var i=e,o=r.return,l=r,c=t;if(t=nt,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,f=l,d=f.tag;if(!(f.mode&1)&&(d===0||d===11||d===15)){var h=f.alternate;h?(f.updateQueue=h.updateQueue,f.memoizedState=h.memoizedState,f.lanes=h.lanes):(f.updateQueue=null,f.memoizedState=null)}var p=_y(o);if(p!==null){p.flags&=-257,Ny(p,o,l,i,t),p.mode&1&&Sy(i,u,t),t=p,c=u;var g=t.updateQueue;if(g===null){var b=new Set;b.add(c),t.updateQueue=b}else g.add(c);break e}else{if(!(t&1)){Sy(i,u,t),fv();break e}c=Error(U(426))}}else if(Ne&&l.mode&1){var x=_y(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),Ny(x,o,l,i,t),Vm(bi(c,l));break e}}i=c=bi(c,l),Ve!==4&&(Ve=2),Yo===null?Yo=[i]:Yo.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=Uw(i,c,t);gy(i,y);break e;case 1:l=c;var v=i.type,m=i.stateNode;if(!(i.flags&128)&&(typeof v.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(wn===null||!wn.has(m)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=Hw(i,l,t);gy(i,S);break e}}i=i.return}while(i!==null)}cS(r)}catch(j){t=j,De===r&&r!==null&&(De=r=r.return);continue}break}while(!0)}function sS(){var e=$c.current;return $c.current=Ac,e===null?Ac:e}function fv(){(Ve===0||Ve===3||Ve===2)&&(Ve=4),Ze===null||!(ha&268435455)&&!(Yu&268435455)||cn(Ze,nt)}function Tc(e,t){var r=se;se|=2;var n=sS();(Ze!==e||nt!==t)&&($r=null,oa(e,t));do try{IP();break}catch(a){oS(e,a)}while(!0);if(Ym(),se=r,$c.current=n,De!==null)throw Error(U(261));return Ze=null,nt=0,Ve}function IP(){for(;De!==null;)lS(De)}function LP(){for(;De!==null&&!sk();)lS(De)}function lS(e){var t=dS(e.alternate,e,Et);e.memoizedProps=e.pendingProps,t===null?cS(e):De=t,sv.current=null}function cS(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=AP(r,t),r!==null){r.flags&=32767,De=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ve=6,De=null;return}}else if(r=PP(r,t,Et),r!==null){De=r;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Ve===0&&(Ve=5)}function Vn(e,t,r){var n=ue,a=qt.transition;try{qt.transition=null,ue=1,DP(e,t,r,n)}finally{qt.transition=a,ue=n}return null}function DP(e,t,r,n){do ci();while(fn!==null);if(se&6)throw Error(U(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(U(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(gk(e,i),e===Ze&&(De=Ze=null,nt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Cl||(Cl=!0,fS(pc,function(){return ci(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=qt.transition,qt.transition=null;var o=ue;ue=1;var l=se;se|=4,sv.current=null,EP(e,r),nS(r,e),nP(_h),vc=!!Sh,_h=Sh=null,e.current=r,CP(r),lk(),se=l,ue=o,qt.transition=i}else e.current=r;if(Cl&&(Cl=!1,fn=e,Cc=a),i=e.pendingLanes,i===0&&(wn=null),dk(r.stateNode),Pt(e,Ie()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],n(a.value,{componentStack:a.stack,digest:a.digest});if(Ec)throw Ec=!1,e=Hh,Hh=null,e;return Cc&1&&e.tag!==0&&ci(),i=e.pendingLanes,i&1?e===Kh?qo++:(qo=0,Kh=e):qo=0,En(),null}function ci(){if(fn!==null){var e=Uj(Cc),t=qt.transition,r=ue;try{if(qt.transition=null,ue=16>e?16:e,fn===null)var n=!1;else{if(e=fn,fn=null,Cc=0,se&6)throw Error(U(331));var a=se;for(se|=4,G=e.current;G!==null;){var i=G,o=i.child;if(G.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(G=u;G!==null;){var f=G;switch(f.tag){case 0:case 11:case 15:Go(8,f,i)}var d=f.child;if(d!==null)d.return=f,G=d;else for(;G!==null;){f=G;var h=f.sibling,p=f.return;if(eS(f),f===u){G=null;break}if(h!==null){h.return=p,G=h;break}G=p}}}var g=i.alternate;if(g!==null){var b=g.child;if(b!==null){g.child=null;do{var x=b.sibling;b.sibling=null,b=x}while(b!==null)}}G=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,G=o;else e:for(;G!==null;){if(i=G,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Go(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,G=y;break e}G=i.return}}var v=e.current;for(G=v;G!==null;){o=G;var m=o.child;if(o.subtreeFlags&2064&&m!==null)m.return=o,G=m;else e:for(o=v;G!==null;){if(l=G,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Gu(9,l)}}catch(j){Ce(l,l.return,j)}if(l===o){G=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,G=S;break e}G=l.return}}if(se=a,En(),xr&&typeof xr.onPostCommitFiberRoot=="function")try{xr.onPostCommitFiberRoot(Bu,e)}catch{}n=!0}return n}finally{ue=r,qt.transition=t}}return!1}function Ry(e,t,r){t=bi(r,t),t=Uw(e,t,1),e=jn(e,t,1),t=mt(),e!==null&&(nl(e,1,t),Pt(e,t))}function Ce(e,t,r){if(e.tag===3)Ry(e,e,r);else for(;t!==null;){if(t.tag===3){Ry(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(wn===null||!wn.has(n))){e=bi(r,e),e=Hw(t,e,1),t=jn(t,e,1),e=mt(),t!==null&&(nl(t,1,e),Pt(t,e));break}}t=t.return}}function RP(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=mt(),e.pingedLanes|=e.suspendedLanes&r,Ze===e&&(nt&r)===r&&(Ve===4||Ve===3&&(nt&130023424)===nt&&500>Ie()-cv?oa(e,0):lv|=r),Pt(e,t)}function uS(e,t){t===0&&(e.mode&1?(t=wl,wl<<=1,!(wl&130023424)&&(wl=4194304)):t=1);var r=mt();e=Hr(e,t),e!==null&&(nl(e,t,r),Pt(e,r))}function BP(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),uS(e,r)}function FP(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(U(314))}n!==null&&n.delete(t),uS(e,r)}var dS;dS=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ot.current)_t=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return _t=!1,kP(e,t,r);_t=!!(e.flags&131072)}else _t=!1,Ne&&t.flags&1048576&&mw(t,Sc,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;oc(e,t),e=t.pendingProps;var a=vi(t,ut.current);li(t,r),a=rv(null,t,n,e,a,r);var i=nv();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,kt(n)?(i=!0,jc(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Qm(t),a.updater=Vu,t.stateNode=a,a._reactInternals=t,Th(t,n,e,r),t=Lh(null,t,n,!0,i,r)):(t.tag=0,Ne&&i&&Hm(t),dt(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(oc(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=WP(n),e=ar(n,e),a){case 0:t=Ih(null,t,n,e,r);break e;case 1:t=Py(null,t,n,e,r);break e;case 11:t=Oy(null,t,n,e,r);break e;case 14:t=ky(null,t,n,ar(n.type,e),r);break e}throw Error(U(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:ar(n,a),Ih(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:ar(n,a),Py(e,t,n,a,r);case 3:e:{if(Yw(t),e===null)throw Error(U(387));n=t.pendingProps,i=t.memoizedState,a=i.element,jw(e,t),Oc(t,n,null,r);var o=t.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=bi(Error(U(423)),t),t=Ay(e,t,n,r,a);break e}else if(n!==a){a=bi(Error(U(424)),t),t=Ay(e,t,n,r,a);break e}else for(Mt=bn(t.stateNode.containerInfo.firstChild),It=t,Ne=!0,sr=null,r=xw(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(gi(),n===a){t=Kr(e,t,r);break e}dt(e,t,n,r)}t=t.child}return t;case 5:return ww(t),e===null&&$h(t),n=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,Nh(n,a)?o=null:i!==null&&Nh(n,i)&&(t.flags|=32),Gw(e,t),dt(e,t,o,r),t.child;case 6:return e===null&&$h(t),null;case 13:return qw(e,t,r);case 4:return Zm(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=yi(t,null,n,r):dt(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:ar(n,a),Oy(e,t,n,a,r);case 7:return dt(e,t,t.pendingProps,r),t.child;case 8:return dt(e,t,t.pendingProps.children,r),t.child;case 12:return dt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,ye(_c,n._currentValue),n._currentValue=o,i!==null)if(fr(i.value,o)){if(i.children===a.children&&!Ot.current){t=Kr(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=Rr(-1,r&-r),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?c.next=c:(c.next=f.next,f.next=c),u.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),Eh(i.return,r,t),l.lanes|=r;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(U(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Eh(o,r,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}dt(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,li(t,r),a=Qt(a),n=n(a),t.flags|=1,dt(e,t,n,r),t.child;case 14:return n=t.type,a=ar(n,t.pendingProps),a=ar(n.type,a),ky(e,t,n,a,r);case 15:return Kw(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:ar(n,a),oc(e,t),t.tag=1,kt(n)?(e=!0,jc(t)):e=!1,li(t,r),Ww(t,n,a),Th(t,n,a,r),Lh(null,t,n,!0,e,r);case 19:return Xw(e,t,r);case 22:return Vw(e,t,r)}throw Error(U(156,t.tag))};function fS(e,t){return Bj(e,t)}function zP(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gt(e,t,r,n){return new zP(e,t,r,n)}function hv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function WP(e){if(typeof e=="function")return hv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Cm)return 11;if(e===Tm)return 14}return 2}function _n(e,t){var r=e.alternate;return r===null?(r=Gt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function cc(e,t,r,n,a,i){var o=2;if(n=e,typeof e=="function")hv(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Wa:return sa(r.children,a,i,t);case Em:o=8,a|=8;break;case nh:return e=Gt(12,r,t,a|2),e.elementType=nh,e.lanes=i,e;case ah:return e=Gt(13,r,t,a),e.elementType=ah,e.lanes=i,e;case ih:return e=Gt(19,r,t,a),e.elementType=ih,e.lanes=i,e;case wj:return qu(r,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case bj:o=10;break e;case jj:o=9;break e;case Cm:o=11;break e;case Tm:o=14;break e;case an:o=16,n=null;break e}throw Error(U(130,e==null?e:typeof e,""))}return t=Gt(o,r,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function sa(e,t,r,n){return e=Gt(7,e,n,t),e.lanes=r,e}function qu(e,t,r,n){return e=Gt(22,e,n,t),e.elementType=wj,e.lanes=r,e.stateNode={isHidden:!1},e}function bf(e,t,r){return e=Gt(6,e,null,t),e.lanes=r,e}function jf(e,t,r){return t=Gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function UP(e,t,r,n,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ef(0),this.expirationTimes=ef(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ef(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function pv(e,t,r,n,a,i,o,l,c){return e=new UP(e,t,r,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Gt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qm(i),e}function HP(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:za,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function hS(e){if(!e)return Pn;e=e._reactInternals;e:{if(Sa(e)!==e||e.tag!==1)throw Error(U(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(kt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(U(171))}if(e.tag===1){var r=e.type;if(kt(r))return hw(e,r,t)}return t}function pS(e,t,r,n,a,i,o,l,c){return e=pv(r,n,!0,e,a,i,o,l,c),e.context=hS(null),r=e.current,n=mt(),a=Sn(r),i=Rr(n,a),i.callback=t??null,jn(r,i,a),e.current.lanes=a,nl(e,a,n),Pt(e,n),e}function Xu(e,t,r,n){var a=t.current,i=mt(),o=Sn(a);return r=hS(r),t.context===null?t.context=r:t.pendingContext=r,t=Rr(i,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=jn(a,t,o),e!==null&&(ur(e,a,o,i),nc(e,a,o)),o}function Mc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function By(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function mv(e,t){By(e,t),(e=e.alternate)&&By(e,t)}function KP(){return null}var mS=typeof reportError=="function"?reportError:function(e){console.error(e)};function vv(e){this._internalRoot=e}Qu.prototype.render=vv.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(U(409));Xu(e,t,null,null)};Qu.prototype.unmount=vv.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pa(function(){Xu(null,e,null,null)}),t[Ur]=null}};function Qu(e){this._internalRoot=e}Qu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Vj();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ln.length&&t!==0&&t<ln[r].priority;r++);ln.splice(r,0,e),r===0&&Yj(e)}};function gv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Zu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Fy(){}function VP(e,t,r,n,a){if(a){if(typeof n=="function"){var i=n;n=function(){var u=Mc(o);i.call(u)}}var o=pS(t,n,e,0,null,!1,!1,"",Fy);return e._reactRootContainer=o,e[Ur]=o.current,us(e.nodeType===8?e.parentNode:e),pa(),o}for(;a=e.lastChild;)e.removeChild(a);if(typeof n=="function"){var l=n;n=function(){var u=Mc(c);l.call(u)}}var c=pv(e,0,!1,null,null,!1,!1,"",Fy);return e._reactRootContainer=c,e[Ur]=c.current,us(e.nodeType===8?e.parentNode:e),pa(function(){Xu(t,c,r,n)}),c}function Ju(e,t,r,n,a){var i=r._reactRootContainer;if(i){var o=i;if(typeof a=="function"){var l=a;a=function(){var c=Mc(o);l.call(c)}}Xu(t,o,e,a)}else o=VP(r,t,e,a,n);return Mc(o)}Hj=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Lo(t.pendingLanes);r!==0&&(Lm(t,r|1),Pt(t,Ie()),!(se&6)&&(ji=Ie()+500,En()))}break;case 13:pa(function(){var n=Hr(e,1);if(n!==null){var a=mt();ur(n,e,1,a)}}),mv(e,1)}};Dm=function(e){if(e.tag===13){var t=Hr(e,134217728);if(t!==null){var r=mt();ur(t,e,134217728,r)}mv(e,134217728)}};Kj=function(e){if(e.tag===13){var t=Sn(e),r=Hr(e,t);if(r!==null){var n=mt();ur(r,e,t,n)}mv(e,t)}};Vj=function(){return ue};Gj=function(e,t){var r=ue;try{return ue=e,t()}finally{ue=r}};mh=function(e,t,r){switch(t){case"input":if(lh(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var a=Uu(n);if(!a)throw Error(U(90));_j(n),lh(n,a)}}}break;case"textarea":Oj(e,r);break;case"select":t=r.value,t!=null&&ai(e,!!r.multiple,t,!1)}};Tj=uv;Mj=pa;var GP={usingClientEntryPoint:!1,Events:[il,Va,Uu,Ej,Cj,uv]},wo={findFiberByHostInstance:Qn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},YP={bundleType:wo.bundleType,version:wo.version,rendererPackageName:wo.rendererPackageName,rendererConfig:wo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:qr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Dj(e),e===null?null:e.stateNode},findFiberByHostInstance:wo.findFiberByHostInstance||KP,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Tl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tl.isDisabled&&Tl.supportsFiber)try{Bu=Tl.inject(YP),xr=Tl}catch{}}Rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=GP;Rt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!gv(t))throw Error(U(200));return HP(e,t,null,r)};Rt.createRoot=function(e,t){if(!gv(e))throw Error(U(299));var r=!1,n="",a=mS;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=pv(e,1,!1,null,null,r,!1,n,a),e[Ur]=t.current,us(e.nodeType===8?e.parentNode:e),new vv(t)};Rt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(U(188)):(e=Object.keys(e).join(","),Error(U(268,e)));return e=Dj(t),e=e===null?null:e.stateNode,e};Rt.flushSync=function(e){return pa(e)};Rt.hydrate=function(e,t,r){if(!Zu(t))throw Error(U(200));return Ju(null,e,t,!0,r)};Rt.hydrateRoot=function(e,t,r){if(!gv(e))throw Error(U(405));var n=r!=null&&r.hydratedSources||null,a=!1,i="",o=mS;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=pS(t,null,e,1,r??null,a,!1,i,o),e[Ur]=t.current,us(e),n)for(e=0;e<n.length;e++)r=n[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new Qu(t)};Rt.render=function(e,t,r){if(!Zu(t))throw Error(U(200));return Ju(null,e,t,!1,r)};Rt.unmountComponentAtNode=function(e){if(!Zu(e))throw Error(U(40));return e._reactRootContainer?(pa(function(){Ju(null,null,e,!1,function(){e._reactRootContainer=null,e[Ur]=null})}),!0):!1};Rt.unstable_batchedUpdates=uv;Rt.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Zu(r))throw Error(U(200));if(e==null||e._reactInternals===void 0)throw Error(U(38));return Ju(e,t,r,!1,n)};Rt.version="18.3.1-next-f1338f8080-20240426";function vS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vS)}catch(e){console.error(e)}}vS(),vj.exports=Rt;var qP=vj.exports,zy=qP;th.createRoot=zy.createRoot,th.hydrateRoot=zy.hydrateRoot;/**
+ * @remix-run/router v1.23.2
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function xs(){return xs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xs.apply(this,arguments)}var hn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(hn||(hn={}));const Wy="popstate";function XP(e){e===void 0&&(e={});function t(n,a){let{pathname:i,search:o,hash:l}=n.location;return Yh("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Ic(a)}return ZP(t,r,null,e)}function Re(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function yv(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function QP(){return Math.random().toString(36).substr(2,8)}function Uy(e,t){return{usr:e.state,key:e.key,idx:t}}function Yh(e,t,r,n){return r===void 0&&(r=null),xs({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ji(t):t,{state:r,key:t&&t.key||n||QP()})}function Ic(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Ji(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function ZP(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,l=hn.Pop,c=null,u=f();u==null&&(u=0,o.replaceState(xs({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function d(){l=hn.Pop;let x=f(),y=x==null?null:x-u;u=x,c&&c({action:l,location:b.location,delta:y})}function h(x,y){l=hn.Push;let v=Yh(b.location,x,y);u=f()+1;let m=Uy(v,u),S=b.createHref(v);try{o.pushState(m,"",S)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;a.location.assign(S)}i&&c&&c({action:l,location:b.location,delta:1})}function p(x,y){l=hn.Replace;let v=Yh(b.location,x,y);u=f();let m=Uy(v,u),S=b.createHref(v);o.replaceState(m,"",S),i&&c&&c({action:l,location:b.location,delta:0})}function g(x){let y=a.location.origin!=="null"?a.location.origin:a.location.href,v=typeof x=="string"?x:Ic(x);return v=v.replace(/ $/,"%20"),Re(y,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,y)}let b={get action(){return l},get location(){return e(a,o)},listen(x){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(Wy,d),c=x,()=>{a.removeEventListener(Wy,d),c=null}},createHref(x){return t(a,x)},createURL:g,encodeLocation(x){let y=g(x);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:p,go(x){return o.go(x)}};return b}var Hy;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Hy||(Hy={}));function JP(e,t,r){return r===void 0&&(r="/"),eA(e,t,r)}function eA(e,t,r,n){let a=typeof t=="string"?Ji(t):t,i=xv(a.pathname||"/",r);if(i==null)return null;let o=gS(e);tA(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=hA(i);l=uA(o[c],u)}return l}function gS(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(Re(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=Nn([n,c.relativePath]),f=r.concat(c);i.children&&i.children.length>0&&(Re(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),gS(i.children,t,f,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:lA(u,i.index),routesMeta:f})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let c of yS(i.path))a(i,o,c)}),t}function yS(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=yS(n.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function tA(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:cA(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const rA=/^:[\w-]+$/,nA=3,aA=2,iA=1,oA=10,sA=-2,Ky=e=>e==="*";function lA(e,t){let r=e.split("/"),n=r.length;return r.some(Ky)&&(n+=sA),t&&(n+=aA),r.filter(a=>!Ky(a)).reduce((a,i)=>a+(rA.test(i)?nA:i===""?iA:oA),n)}function cA(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function uA(e,t,r){let{routesMeta:n}=e,a={},i="/",o=[];for(let l=0;l<n.length;++l){let c=n[l],u=l===n.length-1,f=i==="/"?t:t.slice(i.length)||"/",d=dA({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},f),h=c.route;if(!d)return null;Object.assign(a,d.params),o.push({params:a,pathname:Nn([i,d.pathname]),pathnameBase:yA(Nn([i,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(i=Nn([i,d.pathnameBase]))}return o}function dA(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=fA(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((u,f,d)=>{let{paramName:h,isOptional:p}=f;if(h==="*"){let b=l[d]||"";o=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const g=l[d];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function fA(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),yv(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function hA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return yv(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function xv(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const pA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,mA=e=>pA.test(e);function vA(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Ji(e):e,i;if(r)if(mA(r))i=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),yv(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?i=Vy(r.substring(1),"/"):i=Vy(r,t)}else i=t;return{pathname:i,search:xA(n),hash:bA(a)}}function Vy(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function wf(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function gA(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function xS(e,t){let r=gA(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function bS(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=Ji(e):(a=xs({},e),Re(!a.pathname||!a.pathname.includes("?"),wf("?","pathname","search",a)),Re(!a.pathname||!a.pathname.includes("#"),wf("#","pathname","hash",a)),Re(!a.search||!a.search.includes("#"),wf("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=r;else{let d=t.length-1;if(!n&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),d-=1;a.pathname=h.join("/")}l=d>=0?t[d]:"/"}let c=vA(a,l),u=o&&o!=="/"&&o.endsWith("/"),f=(i||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}const Nn=e=>e.join("/").replace(/\/\/+/g,"/"),yA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),xA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,bA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function jA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const jS=["post","put","patch","delete"];new Set(jS);const wA=["get",...jS];new Set(wA);/**
+ * React Router v6.30.3
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function bs(){return bs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bs.apply(this,arguments)}const bv=O.createContext(null),SA=O.createContext(null),_a=O.createContext(null),ed=O.createContext(null),Cn=O.createContext({outlet:null,matches:[],isDataRoute:!1}),wS=O.createContext(null);function _A(e,t){let{relative:r}=t===void 0?{}:t;sl()||Re(!1);let{basename:n,navigator:a}=O.useContext(_a),{hash:i,pathname:o,search:l}=_S(e,{relative:r}),c=o;return n!=="/"&&(c=o==="/"?n:Nn([n,o])),a.createHref({pathname:c,search:l,hash:i})}function sl(){return O.useContext(ed)!=null}function ll(){return sl()||Re(!1),O.useContext(ed).location}function SS(e){O.useContext(_a).static||O.useLayoutEffect(e)}function td(){let{isDataRoute:e}=O.useContext(Cn);return e?BA():NA()}function NA(){sl()||Re(!1);let e=O.useContext(bv),{basename:t,future:r,navigator:n}=O.useContext(_a),{matches:a}=O.useContext(Cn),{pathname:i}=ll(),o=JSON.stringify(xS(a,r.v7_relativeSplatPath)),l=O.useRef(!1);return SS(()=>{l.current=!0}),O.useCallback(function(u,f){if(f===void 0&&(f={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let d=bS(u,JSON.parse(o),i,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Nn([t,d.pathname])),(f.replace?n.replace:n.push)(d,f.state,f)},[t,n,o,i,e])}const OA=O.createContext(null);function kA(e){let t=O.useContext(Cn).outlet;return t&&O.createElement(OA.Provider,{value:e},t)}function _S(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=O.useContext(_a),{matches:a}=O.useContext(Cn),{pathname:i}=ll(),o=JSON.stringify(xS(a,n.v7_relativeSplatPath));return O.useMemo(()=>bS(e,JSON.parse(o),i,r==="path"),[e,o,i,r])}function PA(e,t){return AA(e,t)}function AA(e,t,r,n){sl()||Re(!1);let{navigator:a}=O.useContext(_a),{matches:i}=O.useContext(Cn),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=ll(),f;if(t){var d;let x=typeof t=="string"?Ji(t):t;c==="/"||(d=x.pathname)!=null&&d.startsWith(c)||Re(!1),f=x}else f=u;let h=f.pathname||"/",p=h;if(c!=="/"){let x=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(x.length).join("/")}let g=JP(e,{pathname:p}),b=MA(g&&g.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:Nn([c,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:Nn([c,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,r,n);return t&&b?O.createElement(ed.Provider,{value:{location:bs({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:hn.Pop}},b):b}function $A(){let e=RA(),t=jA(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return O.createElement(O.Fragment,null,O.createElement("h2",null,"Unexpected Application Error!"),O.createElement("h3",{style:{fontStyle:"italic"}},t),r?O.createElement("pre",{style:a},r):null,null)}const EA=O.createElement($A,null);class CA extends O.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?O.createElement(Cn.Provider,{value:this.props.routeContext},O.createElement(wS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function TA(e){let{routeContext:t,match:r,children:n}=e,a=O.useContext(bv);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),O.createElement(Cn.Provider,{value:t},n)}function MA(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(a=r)==null?void 0:a.errors;if(l!=null){let f=o.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);f>=0||Re(!1),o=o.slice(0,Math.min(o.length,f+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f<o.length;f++){let d=o[f];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=f),d.route.id){let{loaderData:h,errors:p}=r,g=d.route.loader&&h[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||g){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,d,h)=>{let p,g=!1,b=null,x=null;r&&(p=l&&d.route.id?l[d.route.id]:void 0,b=d.route.errorElement||EA,c&&(u<0&&h===0?(FA("route-fallback"),g=!0,x=null):u===h&&(g=!0,x=d.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,h+1)),v=()=>{let m;return p?m=b:g?m=x:d.route.Component?m=O.createElement(d.route.Component,null):d.route.element?m=d.route.element:m=f,O.createElement(TA,{match:d,routeContext:{outlet:f,matches:y,isDataRoute:r!=null},children:m})};return r&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?O.createElement(CA,{location:r.location,revalidation:r.revalidation,component:b,error:p,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}var NS=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(NS||{}),OS=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(OS||{});function IA(e){let t=O.useContext(bv);return t||Re(!1),t}function LA(e){let t=O.useContext(SA);return t||Re(!1),t}function DA(e){let t=O.useContext(Cn);return t||Re(!1),t}function kS(e){let t=DA(),r=t.matches[t.matches.length-1];return r.route.id||Re(!1),r.route.id}function RA(){var e;let t=O.useContext(wS),r=LA(),n=kS();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function BA(){let{router:e}=IA(NS.UseNavigateStable),t=kS(OS.UseNavigateStable),r=O.useRef(!1);return SS(()=>{r.current=!0}),O.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,bs({fromRouteId:t},i)))},[e,t])}const Gy={};function FA(e,t,r){Gy[e]||(Gy[e]=!0)}function zA(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function WA(e){return kA(e.context)}function et(e){Re(!1)}function UA(e){let{basename:t="/",children:r=null,location:n,navigationType:a=hn.Pop,navigator:i,static:o=!1,future:l}=e;sl()&&Re(!1);let c=t.replace(/^\/*/,"/"),u=O.useMemo(()=>({basename:c,navigator:i,static:o,future:bs({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof n=="string"&&(n=Ji(n));let{pathname:f="/",search:d="",hash:h="",state:p=null,key:g="default"}=n,b=O.useMemo(()=>{let x=xv(f,c);return x==null?null:{location:{pathname:x,search:d,hash:h,state:p,key:g},navigationType:a}},[c,f,d,h,p,g,a]);return b==null?null:O.createElement(_a.Provider,{value:u},O.createElement(ed.Provider,{children:r,value:b}))}function HA(e){let{children:t,location:r}=e;return PA(qh(t),r)}new Promise(()=>{});function qh(e,t){t===void 0&&(t=[]);let r=[];return O.Children.forEach(e,(n,a)=>{if(!O.isValidElement(n))return;let i=[...t,a];if(n.type===O.Fragment){r.push.apply(r,qh(n.props.children,i));return}n.type!==et&&Re(!1),!n.props.index||!n.props.children||Re(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=qh(n.props.children,i)),r.push(o)}),r}/**
+ * React Router DOM v6.30.3
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function Xh(){return Xh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xh.apply(this,arguments)}function KA(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function VA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function GA(e,t){return e.button===0&&(!t||t==="_self")&&!VA(e)}const YA=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],qA="6";try{window.__reactRouterVersion=qA}catch{}const XA="startTransition",Yy=R2[XA];function QA(e){let{basename:t,children:r,future:n,window:a}=e,i=O.useRef();i.current==null&&(i.current=XP({window:a,v5Compat:!0}));let o=i.current,[l,c]=O.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},f=O.useCallback(d=>{u&&Yy?Yy(()=>c(d)):c(d)},[c,u]);return O.useLayoutEffect(()=>o.listen(f),[o,f]),O.useEffect(()=>zA(n),[n]),O.createElement(UA,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const ZA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",JA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ra=O.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:i,replace:o,state:l,target:c,to:u,preventScrollReset:f,viewTransition:d}=t,h=KA(t,YA),{basename:p}=O.useContext(_a),g,b=!1;if(typeof u=="string"&&JA.test(u)&&(g=u,ZA))try{let m=new URL(window.location.href),S=u.startsWith("//")?new URL(m.protocol+u):new URL(u),j=xv(S.pathname,p);S.origin===m.origin&&j!=null?u=j+S.search+S.hash:b=!0}catch{}let x=_A(u,{relative:a}),y=e$(u,{replace:o,state:l,target:c,preventScrollReset:f,relative:a,viewTransition:d});function v(m){n&&n(m),m.defaultPrevented||y(m)}return O.createElement("a",Xh({},h,{href:g||x,onClick:b||i?n:v,ref:r,target:c}))});var qy;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(qy||(qy={}));var Xy;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Xy||(Xy={}));function e$(e,t){let{target:r,replace:n,state:a,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=td(),u=ll(),f=_S(e,{relative:o});return O.useCallback(d=>{if(GA(d,r)){d.preventDefault();let h=n!==void 0?n:Ic(u)===Ic(f);c(e,{replace:h,state:a,preventScrollReset:i,relative:o,viewTransition:l})}},[u,c,f,n,a,r,e,i,o,l])}const t$="/api";async function ke(e,t={}){const r=await fetch(`${t$}${e}`,{...t,credentials:"same-origin",headers:{"Content-Type":"application/json",...t.headers}});return r.status===401&&!e.startsWith("/auth/")?(window.location.href="/login",{}):r.json()}async function pe(e,t){return ke(e,{method:"POST",body:JSON.stringify(t)})}async function jv(){try{return(await ke("/auth/session")).authenticated===!0}catch{return!1}}async function r$(e,t){return(await pe("/auth/login",{username:e,password:t})).success===!0}async function n$(e){return await pe("/auth/google",{credential:e})}async function a$(){try{return await ke("/auth/google-config")}catch{return{configured:!1}}}async function i$(){await pe("/auth/logout",{}),window.location.href="/login"}const o$=`
+@keyframes floatDot {
+  0%, 100% { transform: translateY(0px) scale(1); opacity: 0.18; }
+  50% { transform: translateY(-18px) scale(1.1); opacity: 0.35; }
+}
+.login-dot {
+  position: absolute;
+  border-radius: 50%;
+  background: var(--cyan);
+  animation: floatDot linear infinite;
+  pointer-events: none;
+}
+`,s$=Array.from({length:22},(e,t)=>({size:2+Math.random()*4,top:Math.random()*100,left:Math.random()*100,duration:4+Math.random()*6,delay:-(Math.random()*8)}));function l$(){const[e,t]=O.useState(""),[r,n]=O.useState(""),[a,i]=O.useState(!1),[o,l]=O.useState(""),[c,u]=O.useState(!1),[f,d]=O.useState(!0),[h,p]=O.useState(!1),[g,b]=O.useState(null),x=O.useRef(null),y=td();O.useEffect(()=>{jv().then(w=>{w?y("/"):d(!1)}),a$().then(w=>{w.configured&&w.client_id&&(b(w.client_id),v(w.client_id))})},[]);function v(w){if(document.getElementById("google-gsi")){m(w);return}const N=document.createElement("script");N.id="google-gsi",N.src="https://accounts.google.com/gsi/client",N.async=!0,N.defer=!0,N.onload=()=>m(w),document.head.appendChild(N)}function m(w){var N,_;(_=(N=window.google)==null?void 0:N.accounts)!=null&&_.id&&(window.google.accounts.id.initialize({client_id:w,callback:S,auto_select:!1}),p(!0))}O.useEffect(()=>{var w,N;h&&x.current&&((N=(w=window.google)==null?void 0:w.accounts)!=null&&N.id)&&window.google.accounts.id.renderButton(x.current,{type:"standard",theme:"filled_black",size:"large",text:"signin_with",shape:"pill",width:360})},[h]);async function S(w){l(""),u(!0);try{const N=await n$(w.credential);N.success?y("/"):l(N.error||"Google login failed")}catch{l("Connection error")}u(!1)}async function j(w){w.preventDefault(),l(""),u(!0);try{await r$(e,r)?y("/"):l("Invalid credentials")}catch{l("Connection error")}u(!1)}return f?s.jsx("div",{className:"flex items-center justify-center min-h-screen",style:{background:"var(--bg)"},children:s.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})}):s.jsxs("div",{className:"min-h-screen flex items-center justify-center p-4",style:{background:"var(--bg)",position:"relative",overflow:"hidden"},children:[s.jsx("style",{children:o$}),s$.map((w,N)=>s.jsx("span",{className:"login-dot",style:{width:w.size,height:w.size,top:`${w.top}%`,left:`${w.left}%`,animationDuration:`${w.duration}s`,animationDelay:`${w.delay}s`}},N)),s.jsx("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:600,height:600,borderRadius:"50%",background:"radial-gradient(ellipse, rgba(0,240,255,0.04) 0%, transparent 70%)",pointerEvents:"none"}}),s.jsxs("div",{className:"card-glow fade-in w-full",style:{maxWidth:400,position:"relative",zIndex:1},children:[s.jsxs("div",{className:"flex flex-col items-center mb-7",children:[s.jsx("div",{style:{width:72,height:72,borderRadius:18,background:"linear-gradient(135deg, var(--orange), #C45A08)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:16,boxShadow:"0 4px 24px rgba(247,147,26,0.35)"},children:s.jsx("span",{style:{color:"#0E0E10",fontWeight:900,fontSize:32,fontFamily:"var(--font-heading)",lineHeight:1},children:"K"})}),s.jsx("h1",{className:"kalshi-gradient heading",style:{fontSize:26,fontWeight:800,letterSpacing:"-0.02em",marginBottom:6},children:"KEN TRADER"}),s.jsx("p",{style:{fontSize:13,color:"var(--text-muted)",marginBottom:4},children:"Event Contracts Trading Platform"}),s.jsx("span",{className:"badge bg-green",style:{fontSize:10},children:"CFTC-Regulated DCM"})]}),o&&s.jsxs("div",{className:"fade-in",style:{display:"flex",alignItems:"center",gap:8,background:"var(--red-dim)",border:"1px solid rgba(255,92,92,0.25)",borderRadius:8,padding:"10px 12px",marginBottom:16,color:"var(--red)",fontSize:13},children:[s.jsx("svg",{style:{width:15,height:15,flexShrink:0},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),o]}),g&&s.jsxs("div",{style:{marginBottom:4},children:[s.jsx("div",{ref:x,style:{display:"flex",justifyContent:"center",marginBottom:16}}),s.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",marginBottom:20},children:[s.jsx("div",{style:{flex:1,height:1,background:"var(--border)"}}),s.jsx("span",{style:{padding:"0 12px",fontSize:11,color:"var(--text-muted)",background:"var(--surface)",whiteSpace:"nowrap"},children:"or sign in with password"}),s.jsx("div",{style:{flex:1,height:1,background:"var(--border)"}})]})]}),s.jsxs("form",{onSubmit:j,children:[s.jsxs("div",{style:{marginBottom:14},children:[s.jsx("label",{style:{display:"block",fontSize:11,fontWeight:600,color:"var(--text-dim)",marginBottom:6,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Username"}),s.jsx("input",{type:"text",value:e,onChange:w=>t(w.target.value),required:!0,autoComplete:"username",placeholder:"admin",className:"input"})]}),s.jsxs("div",{style:{marginBottom:20},children:[s.jsx("label",{style:{display:"block",fontSize:11,fontWeight:600,color:"var(--text-dim)",marginBottom:6,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Password"}),s.jsxs("div",{style:{position:"relative"},children:[s.jsx("input",{type:a?"text":"password",value:r,onChange:w=>n(w.target.value),required:!0,autoComplete:"current-password",placeholder:"Enter password",className:"input",style:{paddingRight:"2.5rem"}}),s.jsx("button",{type:"button",onClick:()=>i(!a),style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"var(--text-muted)",padding:0,display:"flex"},children:s.jsx("svg",{style:{width:16,height:16},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:a?"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.879L21 21":"M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})})})]})]}),s.jsxs("button",{type:"submit",disabled:c,className:"btn btn-p btn-lg",style:{width:"100%",opacity:c?.6:1},children:[c&&s.jsx("span",{className:"w-4 h-4 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"#0E0E10",borderTopColor:"transparent"}}),c?"Signing in...":"Sign In"]})]}),s.jsx("p",{style:{textAlign:"center",marginTop:20,fontSize:10,color:"var(--text-muted)",letterSpacing:"0.02em"},children:"Ken operates as a CFTC-regulated Designated Contract Market"})]})]})}const c$=[{to:"/",label:"Dashboard",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"},{to:"/markets",label:"Markets",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"},{to:"/signals",label:"Signals",d:"M13 10V3L4 14h7v7l9-11h-7z"},{to:"/intelligence",label:"Intel Feed",d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"},{to:"/trading",label:"Trading",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},{to:"/positions",label:"Positions",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},{to:"/orders",label:"Orders",d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"},{to:"/heatmap",label:"Heatmap",d:"M4 5a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1V5zm10 0a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1V5zM4 15a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1v-4zm10 0a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"},{to:"/orbit",label:"Orbit",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},{to:"/pulse",label:"Pulse",d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},{to:"/weather",label:"Weather",d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"},{to:"/risk",label:"Portfauxlios",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"},{to:"/settings",label:"Settings",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"}];function u$({active:e,warn:t}){const r=t?"var(--orange)":e?"var(--green)":"var(--red)";return s.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:r,flexShrink:0,boxShadow:`0 0 4px ${r}`}})}function d$(){const e=ll(),t=td(),[r,n]=O.useState(null),[a,i]=O.useState(!1),[o,l]=O.useState(!1);if(O.useEffect(()=>{jv().then(u=>{if(!u){t("/login");return}l(!0);const f=()=>ke("/health").then(n).catch(()=>{});f();const d=setInterval(f,15e3);return()=>clearInterval(d)})},[]),!o)return s.jsx("div",{className:"flex items-center justify-center min-h-screen",style:{background:"var(--bg)"},children:s.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const c=a?64:220;return s.jsxs("div",{className:"flex min-h-screen",style:{background:"var(--bg)"},children:[s.jsxs("aside",{style:{width:c,minWidth:c,background:"var(--surface)",borderRight:"1px solid var(--border)",display:"flex",flexDirection:"column",transition:"width 200ms ease, min-width 200ms ease",overflow:"hidden",position:"sticky",top:0,height:"100vh"},children:[s.jsxs("div",{style:{padding:a?"16px 12px":"16px 18px",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:12,minHeight:64,flexShrink:0},children:[s.jsx("div",{style:{width:34,height:34,borderRadius:8,background:"linear-gradient(135deg, var(--orange), #E5690D)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxShadow:"0 2px 10px rgba(247,147,26,0.3)"},children:s.jsx("span",{style:{color:"#0E0E10",fontWeight:900,fontSize:16,fontFamily:"var(--font-heading)"},children:"K"})}),!a&&s.jsx("span",{className:"kalshi-gradient heading",style:{fontSize:13,fontWeight:700,letterSpacing:"0.06em",whiteSpace:"nowrap"},children:"KEN TRADER"})]}),s.jsx("nav",{style:{flex:1,padding:"10px 8px",overflowY:"auto",overflowX:"hidden"},children:c$.map(u=>{const f=e.pathname===u.to||u.to!=="/"&&e.pathname.startsWith(u.to);return s.jsxs(Ra,{to:u.to,title:a?u.label:void 0,style:{display:"flex",alignItems:"center",gap:a?0:10,padding:a?"9px 0":"9px 10px",justifyContent:a?"center":"flex-start",borderRadius:8,marginBottom:2,textDecoration:"none",fontSize:13,fontWeight:f?600:400,color:f?"var(--cyan)":"var(--text-dim)",background:f?"rgba(0,240,255,0.08)":"transparent",borderLeft:f?"3px solid var(--cyan)":"3px solid transparent",transition:"all 150ms ease",whiteSpace:"nowrap",overflow:"hidden"},onMouseEnter:d=>{f||(d.currentTarget.style.color="var(--text)",d.currentTarget.style.background="rgba(255,255,255,0.04)")},onMouseLeave:d=>{f||(d.currentTarget.style.color="var(--text-dim)",d.currentTarget.style.background="transparent")},children:[s.jsx("svg",{style:{width:17,height:17,flexShrink:0,opacity:f?1:.7},fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:u.d})}),!a&&s.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:u.label})]},u.to)})}),s.jsxs("div",{style:{borderTop:"1px solid var(--border)",padding:a?"12px 8px":"12px 14px",flexShrink:0},children:[!a&&r&&s.jsx("div",{style:{marginBottom:10,display:"flex",flexDirection:"column",gap:6},children:[{label:"Env",value:(r.env||"demo").toUpperCase(),warn:r.env==="demo",active:r.env==="prod"},{label:"API",value:r.kalshi_connected?"CONNECTED":"OFF",active:r.kalshi_connected},{label:"DB",value:r.db_connected?"OK":"DOWN",active:r.db_connected},{label:"Safe Mode",value:r.safe_mode?"ON":"OFF",warn:r.safe_mode,active:!r.safe_mode}].map(u=>s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[s.jsx("span",{style:{fontSize:10,color:"var(--text-muted)",fontFamily:"var(--font-body)"},children:u.label}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5},children:[s.jsx(u$,{active:u.active,warn:u.warn}),s.jsx("span",{style:{fontSize:10,fontFamily:"var(--font-mono)",fontWeight:600,color:u.warn?"var(--orange)":u.active?"var(--green)":"var(--red)"},children:u.value})]})]},u.label))}),s.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[s.jsx("button",{onClick:()=>i(!a),title:a?"Expand sidebar":"Collapse sidebar",style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:"7px 0",background:"transparent",border:"1px solid var(--border)",borderRadius:7,cursor:"pointer",color:"var(--text-muted)",transition:"all 150ms ease"},onMouseEnter:u=>{u.currentTarget.style.borderColor="var(--cyan)",u.currentTarget.style.color="var(--cyan)"},onMouseLeave:u=>{u.currentTarget.style.borderColor="var(--border)",u.currentTarget.style.color="var(--text-muted)"},children:s.jsx("svg",{style:{width:14,height:14,transition:"transform 200ms ease",transform:a?"rotate(180deg)":"none"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"})})}),!a&&s.jsx("button",{onClick:i$,style:{padding:"7px 10px",background:"transparent",border:"1px solid var(--border)",borderRadius:7,cursor:"pointer",color:"var(--text-muted)",fontSize:11,fontFamily:"var(--font-body)",fontWeight:500,transition:"all 150ms ease",whiteSpace:"nowrap"},onMouseEnter:u=>{u.currentTarget.style.borderColor="var(--red)",u.currentTarget.style.color="var(--red)"},onMouseLeave:u=>{u.currentTarget.style.borderColor="var(--border)",u.currentTarget.style.color="var(--text-muted)"},children:"Logout"})]})]})]}),s.jsx("main",{style:{flex:1,overflowY:"auto",overflowX:"hidden"},children:s.jsx("div",{style:{maxWidth:1600,margin:"0 auto",padding:"24px 28px"},children:s.jsx(WA,{})})})]})}const f$=[{title:"Event Contracts",desc:"Betting on weather like a person who never learned to just look outside. CFTC-regulated, at least.",icon:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"},{title:"Weather Intelligence",desc:"We schlepp forecast data from the government so you don't have to read the almanac yourself.",icon:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"},{title:"Automated Execution",desc:"The machine places your bets so your hands stay clean. Safe mode included, because I worry.",icon:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"}],h$=["Hook up to Ken (demo first, like a sensible person)","Snoop around the weather contracts","Schlep in the NWS settlement data","Let the computer do the math you were too lazy to learn","Set some limits so you don't lose your shirt","Place the bets (on paper first, God willing)"];function p$({next:e}){return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-4xl font-bold kalshi-gradient mb-3",children:"Oy, Look Who Finally Showed Up"}),s.jsx("p",{className:"text-gray-400 text-lg",children:"So you want to bet on the weather? Your mother would be so proud."})]}),s.jsx("div",{className:"grid grid-cols-3 gap-4",children:f$.map(t=>s.jsxs("div",{className:"card text-center",children:[s.jsx("div",{className:"w-10 h-10 rounded-lg bg-amber-500/10 flex items-center justify-center mx-auto mb-3",children:s.jsx("svg",{className:"w-5 h-5 text-amber-400",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t.icon})})}),s.jsx("h3",{className:"font-semibold text-sm mb-1",children:t.title}),s.jsx("p",{className:"text-xs text-gray-500 leading-relaxed",children:t.desc})]},t.title))}),s.jsxs("div",{className:"card",children:[s.jsx("h3",{className:"font-semibold text-sm mb-3",children:"Listen, this is how it works"}),s.jsx("div",{className:"grid grid-cols-2 gap-2",children:h$.map((t,r)=>s.jsxs("div",{className:"flex items-center gap-3 py-1.5",children:[s.jsx("span",{className:"w-6 h-6 rounded-full bg-amber-500/15 text-amber-400 flex items-center justify-center text-xs font-bold flex-shrink-0",children:r+1}),s.jsx("span",{className:"text-sm text-gray-300",children:t})]},r))})]}),s.jsx("div",{className:"card bg-green-500/5 border-green-500/20",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("svg",{className:"w-5 h-5 text-green-400 mt-0.5 flex-shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-green-400",children:"At least it's legal, thank God"}),s.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Ken is a real CFTC-regulated exchange, not some offshore mishegoss. You'll need an account with API access. Go make one already, I'll wait."})]})]})}),s.jsx("div",{className:"flex justify-center",children:s.jsx("button",{onClick:e,className:"btn btn-p px-8 py-3 text-base font-bold rounded-xl",children:"Nu, Let's Go Already"})})]})}function m$({data:e,update:t,next:r,back:n}){var x,y,v;const[a,i]=O.useState(((x=e.keys)==null?void 0:x.api_key)||""),[o,l]=O.useState(((y=e.keys)==null?void 0:y.private_key)||""),[c,u]=O.useState(((v=e.keys)==null?void 0:v.env)||"demo"),[f,d]=O.useState(!1),[h,p]=O.useState(null);async function g(){d(!0),p(null);try{const m=await pe("/kalshi",{action:"save_keys",api_key:a,private_key:o,env:c});m.success?(t({keys:{api_key:a,private_key:"***",env:c}}),r()):p(m.error||"Failed to save")}catch{p("Connection error")}d(!1)}function b(){t({keys:null,skippedConnect:!0}),r()}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Give Me the Keys"}),s.jsx("p",{className:"text-gray-400 text-sm",children:"Your API credentials, darling. I don't have all day."})]}),s.jsxs("div",{className:"card space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1.5 font-medium",children:"Which playground are we using?"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>u("demo"),className:`flex-1 py-2 rounded-lg text-sm font-medium transition ${c==="demo"?"bg-yellow-500/15 text-yellow-400 border border-yellow-500/30":"bg-gray-800/50 text-gray-500 border border-gray-700"}`,children:"Demo (Smart)"}),s.jsx("button",{onClick:()=>u("prod"),className:`flex-1 py-2 rounded-lg text-sm font-medium transition ${c==="prod"?"bg-green-500/15 text-green-400 border border-green-500/30":"bg-gray-800/50 text-gray-500 border border-gray-700"}`,children:"Production (Brave)"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1.5 font-medium",children:"API Key ID (the one they gave you)"}),s.jsx("input",{type:"text",value:a,onChange:m=>i(m.target.value),placeholder:"Paste it here, bubeleh",className:"w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none font-mono"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1.5 font-medium",children:"Private Key (the whole megillah, PEM format)"}),s.jsx("textarea",{value:o,onChange:m=>l(m.target.value),placeholder:`-----BEGIN RSA PRIVATE KEY-----
+...
+-----END RSA PRIVATE KEY-----`,rows:6,className:"w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none font-mono text-xs leading-relaxed"}),s.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"Don't worry, I keep it locked up tighter than your grandmother's jewelry box"})]}),h&&s.jsx("p",{className:"text-red-400 text-xs",children:h})]}),s.jsxs("div",{className:"card bg-gray-800/30",children:[s.jsx("h3",{className:"text-sm font-medium mb-2",children:"What, you don't have keys yet? Oy vey."}),s.jsxs("ol",{className:"text-xs text-gray-400 space-y-1.5 list-decimal list-inside",children:[s.jsxs("li",{children:["Go log into ",s.jsx("span",{className:"text-amber-400 font-mono",children:"ken.com"})," like a mensch"]}),s.jsx("li",{children:"Find Settings → API Keys (it's not that hard, look around)"}),s.jsxs("li",{children:['Click "Create API Key" and ',s.jsx("strong",{children:"download that private key file immediately"})]}),s.jsx("li",{children:"Copy the Key ID and paste the PEM contents up there. Simple."})]}),s.jsx("p",{className:"text-[10px] text-red-400 mt-2",children:"Listen to me — that private key file? You can only download it ONCE. Lose it and you start over. Don't say I didn't warn you."})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{onClick:b,className:"text-sm text-gray-500 hover:text-gray-300",children:"Skip (play pretend)"}),s.jsx("button",{onClick:g,disabled:f||!a||!o,className:"btn btn-p",children:f?"Saving, patience...":"Save & Continue"})]})]})]})}function v$({data:e,update:t,next:r,back:n}){const[a,i]=O.useState(null),[o,l]=O.useState(null),[c,u]=O.useState(!0),[f,d]=O.useState(!1);O.useEffect(()=>{h()},[]);async function h(){u(!0);try{const x=await pe("/kalshi",{action:"test_connection"});i(x),x.success&&e.keys&&!e.skippedConnect&&p()}catch{i({error:!0})}u(!1)}async function p(){d(!0);try{const x=await pe("/kalshi",{action:"get_balance"});l(x),x.success&&t({connectionOk:!0})}catch{l({error:!0})}d(!1)}const g=e.skippedConnect,b=({title:x,loading:y,result:v,skippedMsg:m})=>s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[m?s.jsx("div",{className:"w-5 h-5 rounded-full bg-yellow-500 flex items-center justify-center",children:s.jsx("span",{className:"text-white text-xs font-bold",children:"—"})}):y?s.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-amber-500 border-t-transparent rounded-full"}):v!=null&&v.success?s.jsx("div",{className:"w-5 h-5 rounded-full bg-green-500 flex items-center justify-center",children:s.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}):v!=null&&v.error?s.jsx("div",{className:"w-5 h-5 rounded-full bg-red-500 flex items-center justify-center",children:s.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}):s.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-600"}),s.jsx("h3",{className:"font-semibold text-sm",children:x})]}),m?s.jsx("p",{className:"text-xs text-yellow-400",children:m}):v!=null&&v.success?s.jsxs("div",{className:"space-y-1 text-xs text-gray-400",children:[v.exchange_status&&s.jsxs("p",{children:["Exchange: ",s.jsx("span",{className:"text-green-400 font-mono",children:v.exchange_status})]}),v.balance!==void 0&&s.jsxs("p",{children:["Balance: ",s.jsxs("span",{className:"text-green-400 font-mono",children:["$",(v.balance/100).toFixed(2)]})]}),v.env&&s.jsxs("p",{children:["Env: ",s.jsx("span",{className:"text-amber-400 font-mono",children:v.env.toUpperCase()})]})]}):v!=null&&v.error?s.jsx("p",{className:"text-xs text-red-400",children:typeof v.error=="string"?v.error:"Connection failed"}):null]});return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Let's See If This Thing Works"}),s.jsx("p",{className:"text-gray-400 text-sm",children:"I'm checking your wiring. Hold your horses."})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(b,{title:"Is Ken Even Open?",loading:c,result:a}),s.jsx(b,{title:"Do They Know Who You Are?",loading:f,result:o,skippedMsg:g?"You skipped this — playing pretend, remember?":e.keys?null:"No keys, no entry. What did you expect?"})]}),!c&&!f&&s.jsx("div",{className:"flex justify-center",children:s.jsx("button",{onClick:h,className:"text-xs text-gray-500 hover:text-gray-300",children:"Try again, maybe this time it'll listen"})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),s.jsx("button",{onClick:r,className:"btn btn-p",children:"Continue"})]})]})}function g$({data:e,update:t,next:r,back:n}){var h,p;const[a,i]=O.useState(!0),[o,l]=O.useState(null),[c,u]=O.useState(null);O.useEffect(()=>{f()},[]);async function f(){var g;i(!0),u(null);try{const b=await pe("/kalshi",{action:"get_events",params:{status:"open",limit:50}});l(b);const x=((g=b.events)==null?void 0:g.length)||0;t({marketsLoaded:x})}catch{u("Failed to load markets")}i(!1)}const d=((o==null?void 0:o.events)||[]).filter(g=>(g.category||"").toLowerCase().includes("climate")||(g.category||"").toLowerCase().includes("weather")||(g.title||"").toLowerCase().includes("temperature")||(g.title||"").toLowerCase().includes("rain")||(g.title||"").toLowerCase().includes("snow")||(g.title||"").toLowerCase().includes("precipitation"));return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Let's See What They're Selling"}),s.jsx("p",{className:"text-gray-400 text-sm",children:"I'm snooping through the markets. You're welcome."})]}),s.jsx("div",{className:"card",children:a?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[s.jsx("div",{className:"animate-spin w-10 h-10 border-3 border-amber-500 border-t-transparent rounded-full"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Schlepping markets from Ken... patience is a virtue"})]}):c?s.jsxs("div",{className:"text-center py-8",children:[s.jsx("p",{className:"text-red-400 text-sm mb-3",children:c}),s.jsx("button",{onClick:f,className:"btn btn-s text-sm",children:"Retry"})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"stat-v text-amber-400",children:((h=o==null?void 0:o.events)==null?void 0:h.length)||0}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Things to Bet On"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"stat-v text-blue-400",children:d.length}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Weather Bets (Our Thing)"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"stat-v text-green-400",children:((p=o==null?void 0:o.markets)==null?void 0:p.length)||"—"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Individual Contracts"})]})]}),d.length>0&&s.jsxs("div",{className:"border-t border-gray-800 pt-3",children:[s.jsx("p",{className:"text-xs text-gray-500 mb-2 uppercase font-medium",children:"Weather Bets I Found For You"}),s.jsx("div",{className:"space-y-1.5 max-h-48 overflow-y-auto",children:d.slice(0,12).map((g,b)=>s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 flex-shrink-0"}),s.jsx("span",{className:"text-gray-300 truncate",children:g.title}),s.jsx("span",{className:"text-gray-600 ml-auto font-mono text-[10px]",children:g.event_ticker})]},b))})]}),d.length===0&&s.jsx("p",{className:"text-center text-gray-500 text-sm py-4",children:"No weather bets right now. What, the weather took a day off? Other markets are there at least."})]})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),s.jsx("button",{onClick:r,disabled:a,className:"btn btn-p",children:a?"Loading...":"Continue"})]})]})}function y$({data:e,update:t,next:r,back:n}){var d;const[a,i]=O.useState(!0),[o,l]=O.useState(null),[c,u]=O.useState(null);O.useEffect(()=>{f()},[]);async function f(){i(!0),u(null);try{const h=await pe("/weather",{action:"fetch_all"});l(h),t({weatherFetched:!0})}catch{u("Failed to fetch weather data")}i(!1)}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Checking the Weather, Darling"}),s.jsx("p",{className:"text-gray-400 text-sm",children:"I'm schlepping in the government weather reports. In my day we just looked outside."})]}),s.jsx("div",{className:"card",children:a?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[s.jsx("div",{className:"animate-spin w-10 h-10 border-3 border-blue-500 border-t-transparent rounded-full"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Fetching from the National Weather Service... they take their sweet time"})]}):c?s.jsxs("div",{className:"text-center py-8",children:[s.jsx("p",{className:"text-red-400 text-sm mb-3",children:c}),s.jsx("button",{onClick:f,className:"btn btn-s text-sm",children:"Retry"})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-center gap-3 py-4",children:[s.jsx("div",{className:"w-12 h-12 rounded-full bg-green-500/10 flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-green-400",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold text-green-400",children:"Got the Weather, Finally"}),s.jsx("p",{className:"text-xs text-gray-400",children:"All the fancy government data, right here in your tuchas seat"})]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"text-center p-3 bg-gray-800/30 rounded-lg",children:[s.jsx("p",{className:"stat-v text-blue-400",children:(o==null?void 0:o.stations)||"—"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Stations"})]}),s.jsxs("div",{className:"text-center p-3 bg-gray-800/30 rounded-lg",children:[s.jsx("p",{className:"stat-v text-amber-400",children:(o==null?void 0:o.data_points)||"—"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Data Points"})]}),s.jsxs("div",{className:"text-center p-3 bg-gray-800/30 rounded-lg",children:[s.jsx("p",{className:"stat-v text-green-400",children:((d=o==null?void 0:o.metrics)==null?void 0:d.length)||"—"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Metrics"})]})]})]})}),s.jsxs("div",{className:"card bg-gray-800/30",children:[s.jsx("p",{className:"text-xs text-gray-500 mb-1 font-medium",children:"How They Settle (Pay Attention)"}),s.jsxs("p",{className:"text-xs text-gray-400",children:["Ken settles on the ",s.jsx("span",{className:"text-amber-400",children:"final NWS Daily Climate Report"}),". A trace of rain? That's zero. Missing data? Also zero. And listen — the first report is the last word. They don't go back and change it, even if the weatherman was wrong. Such is life."]})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),s.jsx("button",{onClick:r,disabled:a,className:"btn btn-p",children:a?"Fetching...":"Continue"})]})]})}function x$({data:e,update:t,next:r,back:n}){const[a,i]=O.useState(!0),[o,l]=O.useState(null),[c,u]=O.useState(null);O.useEffect(()=>{f()},[]);async function f(){i(!0),u(null);try{const p=await pe("/kalshi",{action:"run_predictions"});l(p),t({predictionsRun:!0})}catch{u("Failed to generate predictions")}i(!1)}const d=(o==null?void 0:o.predictions)||[],h=d.filter(p=>(p.edge_bps||0)>0);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"The Machine Is Thinking"}),s.jsx("p",{className:"text-gray-400 text-sm",children:"Running the numbers so you don't have to use that head of yours"})]}),s.jsx("div",{className:"card",children:a?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[s.jsx("div",{className:"animate-spin w-10 h-10 border-3 border-green-500 border-t-transparent rounded-full"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Crunching numbers... in my day we did this with an abacus"})]}):c?s.jsxs("div",{className:"text-center py-8",children:[s.jsx("p",{className:"text-red-400 text-sm mb-3",children:c}),s.jsx("button",{onClick:f,className:"btn btn-s text-sm",children:"Retry"})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"stat-v text-amber-400",children:d.length}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Opinions"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"stat-v text-green-400",children:h.length}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Worth a Look"})]}),s.jsxs("div",{className:"text-center",children:[s.jsxs("p",{className:"stat-v text-blue-400",children:[(o==null?void 0:o.avg_edge_bps)||0,"bps"]}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Your Edge (God Willing)"})]})]}),d.length>0&&s.jsx("div",{className:"border-t border-gray-800 pt-3",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Contract"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Price"}),s.jsx("th",{children:"Edge"}),s.jsx("th",{children:"Signal"})]})}),s.jsx("tbody",{children:d.slice(0,6).map((p,g)=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-[180px]",children:s.jsx("span",{className:"truncate block text-xs",children:p.ticker||p.market})}),s.jsx("td",{children:s.jsx("span",{className:`badge ${p.side==="yes"?"bg-green":"bg-red"}`,children:(p.side||"yes").toUpperCase()})}),s.jsxs("td",{className:"font-mono text-sm",children:[p.price_cents||"—","c"]}),s.jsxs("td",{className:`font-mono text-sm ${(p.edge_bps||0)>0?"text-green-400":"text-gray-500"}`,children:[p.edge_bps||0,"bps"]}),s.jsx("td",{children:s.jsx("span",{className:`badge ${(p.edge_bps||0)>0?"bg-green":"bg-yellow"}`,children:(p.edge_bps||0)>0?"BUY":"HOLD"})})]},g))})]})})]})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),s.jsx("button",{onClick:r,disabled:a,className:"btn btn-p",children:a?"Processing...":"Continue"})]})]})}const Qy=[{name:"Conservative",maxContracts:5,maxDollars:25,dailyLoss:10,color:"blue",desc:"Like your bubbe taught you — small bets, tight grip on the purse strings."},{name:"Moderate",maxContracts:20,maxDollars:100,dailyLoss:50,color:"amber",desc:"Not too much, not too little. Like Goldilocks, but with money.",recommended:!0},{name:"Aggressive",maxContracts:50,maxDollars:500,dailyLoss:200,color:"red",desc:"What are you, a big shot? Don't come crying to me when it goes sideways."}];function b$({data:e,update:t,next:r,back:n}){const[a,i]=O.useState(e.riskProfile||"Moderate"),[o,l]=O.useState(!1);async function c(){l(!0);const u=Qy.find(f=>f.name===a);try{await pe("/risk",{action:"update_config",max_contracts_per_market:u.maxContracts,max_dollars_at_risk:u.maxDollars,daily_loss_cap:u.dailyLoss,risk_profile:u.name}),t({riskProfile:a}),r()}catch{}l(!1)}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"How Much Are You Willing to Lose?"}),s.jsx("p",{className:"text-gray-400 text-sm",children:'Pick one. And no, "all of it" is not an option.'})]}),s.jsx("div",{className:"grid grid-cols-3 gap-4",children:Qy.map(u=>{const d={blue:{ring:"#3b82f6",text:"text-blue-400"},amber:{ring:"#f59e0b",text:"text-amber-400"},red:{ring:"#ef4444",text:"text-red-400"}}[u.color];return s.jsxs("button",{onClick:()=>i(u.name),className:"card text-left transition-all relative",style:a===u.name?{boxShadow:`0 0 0 2px ${d.ring}`}:{},children:[u.recommended&&s.jsx("span",{className:"absolute -top-2 right-3 text-[9px] font-bold uppercase px-2 py-0.5 rounded-full bg-amber-500 text-black",children:"Recommended"}),s.jsx("h3",{className:`font-bold text-lg mb-1 ${d.text}`,children:u.name}),s.jsx("p",{className:"text-xs text-gray-500 mb-3",children:u.desc}),s.jsxs("div",{className:"space-y-1.5 text-xs",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"Max Contracts"}),s.jsx("span",{className:"font-mono text-gray-300",children:u.maxContracts})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"Max $ at Risk"}),s.jsxs("span",{className:"font-mono text-gray-300",children:["$",u.maxDollars]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"Daily Loss Cap"}),s.jsxs("span",{className:"font-mono text-gray-300",children:["$",u.dailyLoss]})]})]})]},u.name)})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),s.jsx("button",{onClick:c,disabled:o,className:"btn btn-p",children:o?"Saving...":"Save & Continue"})]})]})}const Sf=[{key:"keys",label:"Gave me the API keys (good)",check:e=>!!e.keys},{key:"conn",label:"Connection actually works (miracle)",check:e=>!!e.connectionOk},{key:"markets",label:"Found some markets to bet on",check:e=>e.marketsLoaded>0},{key:"weather",label:"Got the weather data (finally)",check:e=>!!e.weatherFetched},{key:"preds",label:"The machine made its predictions",check:e=>!!e.predictionsRun},{key:"risk",label:"Set some limits (smart)",check:e=>!!e.riskProfile}];function j$({data:e,complete:t,back:r}){const[n,a]=O.useState(!0),[i,o]=O.useState(!1),l=Sf.filter(f=>f.check(e)).length,c=e.skippedConnect;async function u(){o(!0),await t()}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Alright, Mazel Tov"}),s.jsx("p",{className:"text-gray-400 text-sm",children:"Let's see if you actually did everything right. I have my doubts."})]}),s.jsxs("div",{className:"card",children:[s.jsx("h3",{className:"font-semibold text-sm mb-3",children:"Your Report Card"}),s.jsx("div",{className:"space-y-2",children:Sf.map(f=>{const d=f.check(e),h=f.key==="keys"&&c;return s.jsxs("div",{className:"flex items-center gap-3",children:[d?s.jsx("div",{className:"w-5 h-5 rounded-full bg-green-500 flex items-center justify-center flex-shrink-0",children:s.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}):h?s.jsx("div",{className:"w-5 h-5 rounded-full bg-yellow-500 flex items-center justify-center flex-shrink-0",children:s.jsx("span",{className:"text-white text-[10px] font-bold",children:"—"})}):s.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-700 flex-shrink-0"}),s.jsxs("span",{className:`text-sm ${d?"text-gray-200":h?"text-yellow-400":"text-gray-500"}`,children:[f.label,h?" (skipped)":""]})]},f.key)})}),s.jsxs("p",{className:"text-xs text-gray-500 mt-3 pt-3 border-t border-gray-800",children:[l,"/",Sf.length," steps completed"]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"card text-center",children:[s.jsx("p",{className:"stat-v text-amber-400",children:e.marketsLoaded||0}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Markets"})]}),s.jsxs("div",{className:"card text-center",children:[s.jsx("p",{className:"stat-v text-blue-400",children:e.riskProfile||"—"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Risk Profile"})]}),s.jsxs("div",{className:"card text-center",children:[s.jsx("p",{className:"stat-v text-green-400",children:e.keys?(e.keys.env||"demo").toUpperCase():"PAPER"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Mode"})]})]}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-sm",children:"Safe Mode (I Recommend It)"}),s.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:n?"Paper trading — playing pretend, like a sensible person":"Live orders! With real money! Oy gevalt."})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:`text-xs font-medium ${n?"text-yellow-400":"text-gray-500"}`,children:"Safe"}),s.jsx("button",{onClick:()=>a(!n),disabled:!e.keys,className:`w-11 h-6 rounded-full transition-colors relative ${n?"bg-yellow-500/30":"bg-green-500/30"} ${e.keys?"":"opacity-50 cursor-not-allowed"}`,children:s.jsx("div",{className:`w-4 h-4 rounded-full absolute top-1 transition-all ${n?"left-1 bg-yellow-400":"left-6 bg-green-400"}`})}),s.jsx("span",{className:`text-xs font-medium ${n?"text-gray-500":"text-green-400"}`,children:"Live"})]})]}),!n&&s.jsx("div",{className:"mt-3 p-2 bg-red-500/10 border border-red-500/20 rounded-lg",children:s.jsx("p",{className:"text-xs text-red-400",children:"Live mode means real money, bubeleh. Real. Money. Don't say I didn't warn you. Make sure you've got funds and your limits are set, or so help me."})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("button",{onClick:r,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),s.jsx("button",{onClick:u,disabled:i,className:"btn btn-p text-lg px-8 py-3 rounded-xl font-bold",children:i?"Starting up, hold your horses...":"Go Make Some Gelt Already"})]})]})}const Ml=[{label:"Shalom",icon:"1"},{label:"Keys",icon:"2"},{label:"Test It",icon:"3"},{label:"Snoop",icon:"4"},{label:"Weather",icon:"5"},{label:"Predict",icon:"6"},{label:"Limits",icon:"7"},{label:"Mazel Tov",icon:"8"}],w$=[p$,m$,v$,g$,y$,x$,b$,j$];function S$(){const e=td(),[t,r]=O.useState(!1),[n,a]=O.useState(0),[i,o]=O.useState({keys:null,connectionOk:!1,marketsLoaded:0,weatherFetched:!1,predictionsRun:!1,riskProfile:null});O.useEffect(()=>{jv().then(p=>{if(!p){e("/login");return}r(!0),ke("/setup").then(g=>{if(g.setup_complete){e("/");return}g.setup_progress&&(a(g.setup_progress.step||0),o(b=>({...b,...g.setup_progress.data})))}).catch(()=>{})})},[]),O.useEffect(()=>{t&&n>0&&pe("/setup",{action:"save_progress",progress:{step:n,data:i}}).catch(()=>{})},[n]);function l(){n<Ml.length-1&&a(p=>p+1)}function c(){n>0&&a(p=>p-1)}function u(p){p<=n&&a(p)}function f(p){o(g=>({...g,...p}))}async function d(){await pe("/setup",{action:"complete",progress:{step:Ml.length-1,data:i}}),e("/")}if(!t)return s.jsx("div",{className:"flex items-center justify-center min-h-screen",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})});const h=w$[n];return s.jsxs("div",{className:"min-h-screen flex flex-col",style:{background:"var(--bg)"},children:[s.jsxs("div",{className:"flex items-center gap-3 px-6 py-4 border-b border-gray-800",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"linear-gradient(135deg,#f59e0b,#f97316)"},children:s.jsx("span",{className:"text-black font-bold text-sm",children:"K"})}),s.jsx("span",{className:"font-bold text-sm kalshi-gradient",children:"KEN SETUP — SIT, WE'LL TALK"})]}),s.jsx("div",{className:"px-6 py-5",children:s.jsx("div",{className:"max-w-3xl mx-auto flex items-center",children:Ml.map((p,g)=>s.jsxs(E.Fragment,{children:[s.jsxs("button",{onClick:()=>u(g),disabled:g>n,className:"flex flex-col items-center gap-1.5 group",style:{minWidth:56},children:[s.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold transition-all ${g<n?"bg-green-500 text-white":g===n?"bg-amber-500 text-black":"bg-gray-800 text-gray-500"} ${g<=n?"cursor-pointer":"cursor-default"}`,style:g===n?{animation:"pg 2s infinite"}:{},children:g<n?s.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):p.icon}),s.jsx("span",{className:`text-[10px] font-medium ${g<n?"text-green-400":g===n?"text-amber-400":"text-gray-600"}`,children:p.label})]}),g<Ml.length-1&&s.jsx("div",{className:`h-0.5 flex-1 transition-colors ${g<n?"bg-green-500":"bg-gray-800"}`})]},g))})}),s.jsx("div",{className:"flex-1 flex items-start justify-center px-6 pb-10",children:s.jsx("div",{className:"w-full max-w-2xl",children:s.jsx(h,{data:i,update:f,next:l,back:c,complete:d,step:n})},n)})]})}function PS(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=PS(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function te(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=PS(e))&&(n&&(n+=" "),n+=t);return n}var _$=Array.isArray,At=_$,N$=typeof vl=="object"&&vl&&vl.Object===Object&&vl,AS=N$,O$=AS,k$=typeof self=="object"&&self&&self.Object===Object&&self,P$=O$||k$||Function("return this")(),Nr=P$,A$=Nr,$$=A$.Symbol,cl=$$,Zy=cl,$S=Object.prototype,E$=$S.hasOwnProperty,C$=$S.toString,So=Zy?Zy.toStringTag:void 0;function T$(e){var t=E$.call(e,So),r=e[So];try{e[So]=void 0;var n=!0}catch{}var a=C$.call(e);return n&&(t?e[So]=r:delete e[So]),a}var M$=T$,I$=Object.prototype,L$=I$.toString;function D$(e){return L$.call(e)}var R$=D$,Jy=cl,B$=M$,F$=R$,z$="[object Null]",W$="[object Undefined]",e0=Jy?Jy.toStringTag:void 0;function U$(e){return e==null?e===void 0?W$:z$:e0&&e0 in Object(e)?B$(e):F$(e)}var Xr=U$;function H$(e){return e!=null&&typeof e=="object"}var Qr=H$,K$=Xr,V$=Qr,G$="[object Symbol]";function Y$(e){return typeof e=="symbol"||V$(e)&&K$(e)==G$}var eo=Y$,q$=At,X$=eo,Q$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z$=/^\w*$/;function J$(e,t){if(q$(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||X$(e)?!0:Z$.test(e)||!Q$.test(e)||t!=null&&e in Object(t)}var wv=J$;function eE(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Tn=eE;const to=de(Tn);var tE=Xr,rE=Tn,nE="[object AsyncFunction]",aE="[object Function]",iE="[object GeneratorFunction]",oE="[object Proxy]";function sE(e){if(!rE(e))return!1;var t=tE(e);return t==aE||t==iE||t==nE||t==oE}var Sv=sE;const Z=de(Sv);var lE=Nr,cE=lE["__core-js_shared__"],uE=cE,_f=uE,t0=function(){var e=/[^.]+$/.exec(_f&&_f.keys&&_f.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function dE(e){return!!t0&&t0 in e}var fE=dE,hE=Function.prototype,pE=hE.toString;function mE(e){if(e!=null){try{return pE.call(e)}catch{}try{return e+""}catch{}}return""}var ES=mE,vE=Sv,gE=fE,yE=Tn,xE=ES,bE=/[\\^$.*+?()[\]{}|]/g,jE=/^\[object .+?Constructor\]$/,wE=Function.prototype,SE=Object.prototype,_E=wE.toString,NE=SE.hasOwnProperty,OE=RegExp("^"+_E.call(NE).replace(bE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kE(e){if(!yE(e)||gE(e))return!1;var t=vE(e)?OE:jE;return t.test(xE(e))}var PE=kE;function AE(e,t){return e==null?void 0:e[t]}var $E=AE,EE=PE,CE=$E;function TE(e,t){var r=CE(e,t);return EE(r)?r:void 0}var Na=TE,ME=Na,IE=ME(Object,"create"),rd=IE,r0=rd;function LE(){this.__data__=r0?r0(null):{},this.size=0}var DE=LE;function RE(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var BE=RE,FE=rd,zE="__lodash_hash_undefined__",WE=Object.prototype,UE=WE.hasOwnProperty;function HE(e){var t=this.__data__;if(FE){var r=t[e];return r===zE?void 0:r}return UE.call(t,e)?t[e]:void 0}var KE=HE,VE=rd,GE=Object.prototype,YE=GE.hasOwnProperty;function qE(e){var t=this.__data__;return VE?t[e]!==void 0:YE.call(t,e)}var XE=qE,QE=rd,ZE="__lodash_hash_undefined__";function JE(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=QE&&t===void 0?ZE:t,this}var eC=JE,tC=DE,rC=BE,nC=KE,aC=XE,iC=eC;function ro(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ro.prototype.clear=tC;ro.prototype.delete=rC;ro.prototype.get=nC;ro.prototype.has=aC;ro.prototype.set=iC;var oC=ro;function sC(){this.__data__=[],this.size=0}var lC=sC;function cC(e,t){return e===t||e!==e&&t!==t}var _v=cC,uC=_v;function dC(e,t){for(var r=e.length;r--;)if(uC(e[r][0],t))return r;return-1}var nd=dC,fC=nd,hC=Array.prototype,pC=hC.splice;function mC(e){var t=this.__data__,r=fC(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():pC.call(t,r,1),--this.size,!0}var vC=mC,gC=nd;function yC(e){var t=this.__data__,r=gC(t,e);return r<0?void 0:t[r][1]}var xC=yC,bC=nd;function jC(e){return bC(this.__data__,e)>-1}var wC=jC,SC=nd;function _C(e,t){var r=this.__data__,n=SC(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var NC=_C,OC=lC,kC=vC,PC=xC,AC=wC,$C=NC;function no(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}no.prototype.clear=OC;no.prototype.delete=kC;no.prototype.get=PC;no.prototype.has=AC;no.prototype.set=$C;var ad=no,EC=Na,CC=Nr,TC=EC(CC,"Map"),Nv=TC,n0=oC,MC=ad,IC=Nv;function LC(){this.size=0,this.__data__={hash:new n0,map:new(IC||MC),string:new n0}}var DC=LC;function RC(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var BC=RC,FC=BC;function zC(e,t){var r=e.__data__;return FC(t)?r[typeof t=="string"?"string":"hash"]:r.map}var id=zC,WC=id;function UC(e){var t=WC(this,e).delete(e);return this.size-=t?1:0,t}var HC=UC,KC=id;function VC(e){return KC(this,e).get(e)}var GC=VC,YC=id;function qC(e){return YC(this,e).has(e)}var XC=qC,QC=id;function ZC(e,t){var r=QC(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var JC=ZC,eT=DC,tT=HC,rT=GC,nT=XC,aT=JC;function ao(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ao.prototype.clear=eT;ao.prototype.delete=tT;ao.prototype.get=rT;ao.prototype.has=nT;ao.prototype.set=aT;var Ov=ao,CS=Ov,iT="Expected a function";function kv(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(iT);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(kv.Cache||CS),r}kv.Cache=CS;var TS=kv;const oT=de(TS);var sT=TS,lT=500;function cT(e){var t=sT(e,function(n){return r.size===lT&&r.clear(),n}),r=t.cache;return t}var uT=cT,dT=uT,fT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hT=/\\(\\)?/g,pT=dT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(fT,function(r,n,a,i){t.push(a?i.replace(hT,"$1"):n||r)}),t}),mT=pT;function vT(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}var Pv=vT,a0=cl,gT=Pv,yT=At,xT=eo,i0=a0?a0.prototype:void 0,o0=i0?i0.toString:void 0;function MS(e){if(typeof e=="string")return e;if(yT(e))return gT(e,MS)+"";if(xT(e))return o0?o0.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var bT=MS,jT=bT;function wT(e){return e==null?"":jT(e)}var IS=wT,ST=At,_T=wv,NT=mT,OT=IS;function kT(e,t){return ST(e)?e:_T(e,t)?[e]:NT(OT(e))}var LS=kT,PT=eo;function AT(e){if(typeof e=="string"||PT(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var od=AT,$T=LS,ET=od;function CT(e,t){t=$T(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[ET(t[r++])];return r&&r==n?e:void 0}var Av=CT,TT=Av;function MT(e,t,r){var n=e==null?void 0:TT(e,t);return n===void 0?r:n}var DS=MT;const Lt=de(DS);function IT(e){return e==null}var LT=IT;const J=de(LT);var DT=Xr,RT=At,BT=Qr,FT="[object String]";function zT(e){return typeof e=="string"||!RT(e)&&BT(e)&&DT(e)==FT}var WT=zT;const ma=de(WT);var RS={exports:{}},fe={};/**
+ * @license React
+ * react-is.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var $v=Symbol.for("react.element"),Ev=Symbol.for("react.portal"),sd=Symbol.for("react.fragment"),ld=Symbol.for("react.strict_mode"),cd=Symbol.for("react.profiler"),ud=Symbol.for("react.provider"),dd=Symbol.for("react.context"),UT=Symbol.for("react.server_context"),fd=Symbol.for("react.forward_ref"),hd=Symbol.for("react.suspense"),pd=Symbol.for("react.suspense_list"),md=Symbol.for("react.memo"),vd=Symbol.for("react.lazy"),HT=Symbol.for("react.offscreen"),BS;BS=Symbol.for("react.module.reference");function er(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case $v:switch(e=e.type,e){case sd:case cd:case ld:case hd:case pd:return e;default:switch(e=e&&e.$$typeof,e){case UT:case dd:case fd:case vd:case md:case ud:return e;default:return t}}case Ev:return t}}}fe.ContextConsumer=dd;fe.ContextProvider=ud;fe.Element=$v;fe.ForwardRef=fd;fe.Fragment=sd;fe.Lazy=vd;fe.Memo=md;fe.Portal=Ev;fe.Profiler=cd;fe.StrictMode=ld;fe.Suspense=hd;fe.SuspenseList=pd;fe.isAsyncMode=function(){return!1};fe.isConcurrentMode=function(){return!1};fe.isContextConsumer=function(e){return er(e)===dd};fe.isContextProvider=function(e){return er(e)===ud};fe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===$v};fe.isForwardRef=function(e){return er(e)===fd};fe.isFragment=function(e){return er(e)===sd};fe.isLazy=function(e){return er(e)===vd};fe.isMemo=function(e){return er(e)===md};fe.isPortal=function(e){return er(e)===Ev};fe.isProfiler=function(e){return er(e)===cd};fe.isStrictMode=function(e){return er(e)===ld};fe.isSuspense=function(e){return er(e)===hd};fe.isSuspenseList=function(e){return er(e)===pd};fe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===sd||e===cd||e===ld||e===hd||e===pd||e===HT||typeof e=="object"&&e!==null&&(e.$$typeof===vd||e.$$typeof===md||e.$$typeof===ud||e.$$typeof===dd||e.$$typeof===fd||e.$$typeof===BS||e.getModuleId!==void 0)};fe.typeOf=er;RS.exports=fe;var KT=RS.exports,VT=Xr,GT=Qr,YT="[object Number]";function qT(e){return typeof e=="number"||GT(e)&&VT(e)==YT}var FS=qT;const XT=de(FS);var QT=FS;function ZT(e){return QT(e)&&e!=+e}var JT=ZT;const io=de(JT);var ft=function(t){return t===0?0:t>0?1:-1},ea=function(t){return ma(t)&&t.indexOf("%")===t.length-1},W=function(t){return XT(t)&&!io(t)},eM=function(t){return J(t)},Ge=function(t){return W(t)||ma(t)},tM=0,oo=function(t){var r=++tM;return"".concat(t||"").concat(r)},ht=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!W(t)&&!ma(t))return n;var i;if(ea(t)){var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return io(i)&&(i=n),a&&i>r&&(i=r),i},un=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},rM=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a<r;a++)if(!n[t[a]])n[t[a]]=!0;else return!0;return!1},St=function(t,r){return W(t)&&W(r)?function(n){return t+n*(r-t)}:function(){return r}};function Lc(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):Lt(n,t))===r})}var nM=function(t,r){return W(t)&&W(r)?t-r:ma(t)&&ma(r)?t.localeCompare(r):t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():String(t).localeCompare(String(r))};function ui(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function Qh(e){"@babel/helpers - typeof";return Qh=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},Qh(e)}var aM=["viewBox","children"],iM=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],s0=["points","pathLength"],Nf={svg:aM,polygon:s0,polyline:s0},Cv=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Dc=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(O.isValidElement(t)&&(n=t.props),!to(n))return null;var a={};return Object.keys(n).forEach(function(i){Cv.includes(i)&&(a[i]=r||function(o){return n[i](n,o)})}),a},oM=function(t,r,n){return function(a){return t(r,n,a),null}},va=function(t,r,n){if(!to(t)||Qh(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];Cv.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=oM(o,r,n))}),a},sM=["children"],lM=["children"];function l0(e,t){if(e==null)return{};var r=cM(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cM(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Zh(e){"@babel/helpers - typeof";return Zh=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},Zh(e)}var c0={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"},Br=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},u0=null,Of=null,Tv=function e(t){if(t===u0&&Array.isArray(Of))return Of;var r=[];return O.Children.forEach(t,function(n){J(n)||(KT.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Of=r,u0=t,r};function Xt(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return Br(a)}):n=[Br(t)],Tv(e).forEach(function(a){var i=Lt(a,"type.displayName")||Lt(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function Ct(e,t){var r=Xt(e,t);return r&&r[0]}var d0=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!W(n)||n<=0||!W(a)||a<=0)},uM=["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"],dM=function(t){return t&&t.type&&ma(t.type)&&uM.indexOf(t.type)>=0},fM=function(t){return t&&Zh(t)==="object"&&"clipDot"in t},hM=function(t,r,n,a){var i,o=(i=Nf==null?void 0:Nf[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!Z(t)&&(a&&o.includes(r)||iM.includes(r))||n&&Cv.includes(r)},X=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(O.isValidElement(t)&&(a=t.props),!to(a))return null;var i={};return Object.keys(a).forEach(function(o){var l;hM((l=a)===null||l===void 0?void 0:l[o],o,r,n)&&(i[o]=a[o])}),i},Jh=function e(t,r){if(t===r)return!0;var n=O.Children.count(t);if(n!==O.Children.count(r))return!1;if(n===0)return!0;if(n===1)return f0(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a<n;a++){var i=t[a],o=r[a];if(Array.isArray(i)||Array.isArray(o)){if(!e(i,o))return!1}else if(!f0(i,o))return!1}return!0},f0=function(t,r){if(J(t)&&J(r))return!0;if(!J(t)&&!J(r)){var n=t.props||{},a=n.children,i=l0(n,sM),o=r.props||{},l=o.children,c=l0(o,lM);return a&&l?ui(i,c)&&Jh(a,l):!a&&!l?ui(i,c):!1}return!1},h0=function(t,r){var n=[],a={};return Tv(t).forEach(function(i,o){if(dM(i))n.push(i);else if(i){var l=Br(i.type),c=r[l]||{},u=c.handler,f=c.once;if(u&&(!f||!a[l])){var d=u(i,l,o);n.push(d),a[l]=!0}}}),n},pM=function(t){var r=t&&t.type;return r&&c0[r]?c0[r]:null},mM=function(t,r){return Tv(r).indexOf(t)},vM=["children","width","height","viewBox","className","style","title","desc"];function ep(){return ep=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ep.apply(this,arguments)}function gM(e,t){if(e==null)return{};var r=yM(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yM(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function tp(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,o=e.style,l=e.title,c=e.desc,u=gM(e,vM),f=a||{width:r,height:n,x:0,y:0},d=te("recharts-surface",i);return E.createElement("svg",ep({},X(u,!0,"svg"),{className:d,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),E.createElement("title",null,l),E.createElement("desc",null,c),t)}var xM=["children","className"];function rp(){return rp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rp.apply(this,arguments)}function bM(e,t){if(e==null)return{};var r=jM(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jM(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var ae=E.forwardRef(function(e,t){var r=e.children,n=e.className,a=bM(e,xM),i=te("recharts-layer",n);return E.createElement("g",rp({className:i},X(a,!0),{ref:t}),r)}),dr=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i]};function wM(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n<a;)i[n]=e[n+t];return i}var SM=wM,_M=SM;function NM(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:_M(e,t,r)}var OM=NM,kM="\\ud800-\\udfff",PM="\\u0300-\\u036f",AM="\\ufe20-\\ufe2f",$M="\\u20d0-\\u20ff",EM=PM+AM+$M,CM="\\ufe0e\\ufe0f",TM="\\u200d",MM=RegExp("["+TM+kM+EM+CM+"]");function IM(e){return MM.test(e)}var zS=IM;function LM(e){return e.split("")}var DM=LM,WS="\\ud800-\\udfff",RM="\\u0300-\\u036f",BM="\\ufe20-\\ufe2f",FM="\\u20d0-\\u20ff",zM=RM+BM+FM,WM="\\ufe0e\\ufe0f",UM="["+WS+"]",np="["+zM+"]",ap="\\ud83c[\\udffb-\\udfff]",HM="(?:"+np+"|"+ap+")",US="[^"+WS+"]",HS="(?:\\ud83c[\\udde6-\\uddff]){2}",KS="[\\ud800-\\udbff][\\udc00-\\udfff]",KM="\\u200d",VS=HM+"?",GS="["+WM+"]?",VM="(?:"+KM+"(?:"+[US,HS,KS].join("|")+")"+GS+VS+")*",GM=GS+VS+VM,YM="(?:"+[US+np+"?",np,HS,KS,UM].join("|")+")",qM=RegExp(ap+"(?="+ap+")|"+YM+GM,"g");function XM(e){return e.match(qM)||[]}var QM=XM,ZM=DM,JM=zS,e5=QM;function t5(e){return JM(e)?e5(e):ZM(e)}var r5=t5,n5=OM,a5=zS,i5=r5,o5=IS;function s5(e){return function(t){t=o5(t);var r=a5(t)?i5(t):void 0,n=r?r[0]:t.charAt(0),a=r?n5(r,1).join(""):t.slice(1);return n[e]()+a}}var l5=s5,c5=l5,u5=c5("toUpperCase"),d5=u5;const gd=de(d5);function ge(e){return function(){return e}}const YS=Math.cos,Rc=Math.sin,hr=Math.sqrt,Bc=Math.PI,yd=2*Bc,ip=Math.PI,op=2*ip,Gn=1e-6,f5=op-Gn;function qS(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function h5(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return qS;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;a<i;++a)this._+=Math.round(arguments[a]*r)/r+n[a]}}class p5{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?qS:h5(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,a){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+a}`}bezierCurveTo(t,r,n,a,i,o){this._append`C${+t},${+r},${+n},${+a},${this._x1=+i},${this._y1=+o}`}arcTo(t,r,n,a,i){if(t=+t,r=+r,n=+n,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,l=this._y1,c=n-t,u=a-r,f=o-t,d=l-r,h=f*f+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>Gn)if(!(Math.abs(d*c-u*f)>Gn)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,g=a-l,b=c*c+u*u,x=p*p+g*g,y=Math.sqrt(b),v=Math.sqrt(h),m=i*Math.tan((ip-Math.acos((b+h-x)/(2*y*v)))/2),S=m/v,j=m/y;Math.abs(S-1)>Gn&&this._append`L${t+S*f},${r+S*d}`,this._append`A${i},${i},0,0,${+(d*p>f*g)},${this._x1=t+j*c},${this._y1=r+j*u}`}}arc(t,r,n,a,i,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(a),c=n*Math.sin(a),u=t+l,f=r+c,d=1^o,h=o?a-i:i-a;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>Gn||Math.abs(this._y1-f)>Gn)&&this._append`L${u},${f}`,n&&(h<0&&(h=h%op+op),h>f5?this._append`A${n},${n},0,1,${d},${t-l},${r-c}A${n},${n},0,1,${d},${this._x1=u},${this._y1=f}`:h>Gn&&this._append`A${n},${n},0,${+(h>=ip)},${d},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function Mv(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new p5(t)}function Iv(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function XS(e){this._context=e}XS.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 xd(e){return new XS(e)}function QS(e){return e[0]}function ZS(e){return e[1]}function JS(e,t){var r=ge(!0),n=null,a=xd,i=null,o=Mv(l);e=typeof e=="function"?e:e===void 0?QS:ge(e),t=typeof t=="function"?t:t===void 0?ZS:ge(t);function l(c){var u,f=(c=Iv(c)).length,d,h=!1,p;for(n==null&&(i=a(p=o())),u=0;u<=f;++u)!(u<f&&r(d=c[u],u,c))===h&&((h=!h)?i.lineStart():i.lineEnd()),h&&i.point(+e(d,u,c),+t(d,u,c));if(p)return i=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:ge(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:ge(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:ge(!!c),l):r},l.curve=function(c){return arguments.length?(a=c,n!=null&&(i=a(n)),l):a},l.context=function(c){return arguments.length?(c==null?n=i=null:i=a(n=c),l):n},l}function Il(e,t,r){var n=null,a=ge(!0),i=null,o=xd,l=null,c=Mv(u);e=typeof e=="function"?e:e===void 0?QS:ge(+e),t=typeof t=="function"?t:ge(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?ZS:ge(+r);function u(d){var h,p,g,b=(d=Iv(d)).length,x,y=!1,v,m=new Array(b),S=new Array(b);for(i==null&&(l=o(v=c())),h=0;h<=b;++h){if(!(h<b&&a(x=d[h],h,d))===y)if(y=!y)p=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=h-1;g>=p;--g)l.point(m[g],S[g]);l.lineEnd(),l.areaEnd()}y&&(m[h]=+e(x,h,d),S[h]=+t(x,h,d),l.point(n?+n(x,h,d):m[h],r?+r(x,h,d):S[h]))}if(v)return l=null,v+""||null}function f(){return JS().defined(a).curve(o).context(i)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:ge(+d),n=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:ge(+d),u):e},u.x1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:ge(+d),u):n},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:ge(+d),r=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:ge(+d),u):t},u.y1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:ge(+d),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(d){return arguments.length?(a=typeof d=="function"?d:ge(!!d),u):a},u.curve=function(d){return arguments.length?(o=d,i!=null&&(l=o(i)),u):o},u.context=function(d){return arguments.length?(d==null?i=l=null:l=o(i=d),u):i},u}class e_{constructor(t,r){this._context=t,this._x=r}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,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function m5(e){return new e_(e,!0)}function v5(e){return new e_(e,!1)}const Lv={draw(e,t){const r=hr(t/Bc);e.moveTo(r,0),e.arc(0,0,r,0,yd)}},g5={draw(e,t){const r=hr(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},t_=hr(1/3),y5=t_*2,x5={draw(e,t){const r=hr(t/y5),n=r*t_;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},b5={draw(e,t){const r=hr(t),n=-r/2;e.rect(n,n,r,r)}},j5=.8908130915292852,r_=Rc(Bc/10)/Rc(7*Bc/10),w5=Rc(yd/10)*r_,S5=-YS(yd/10)*r_,_5={draw(e,t){const r=hr(t*j5),n=w5*r,a=S5*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const o=yd*i/5,l=YS(o),c=Rc(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*a,c*n+l*a)}e.closePath()}},kf=hr(3),N5={draw(e,t){const r=-hr(t/(kf*3));e.moveTo(0,r*2),e.lineTo(-kf*r,-r),e.lineTo(kf*r,-r),e.closePath()}},zt=-.5,Wt=hr(3)/2,sp=1/hr(12),O5=(sp/2+1)*3,k5={draw(e,t){const r=hr(t/O5),n=r/2,a=r*sp,i=n,o=r*sp+r,l=-i,c=o;e.moveTo(n,a),e.lineTo(i,o),e.lineTo(l,c),e.lineTo(zt*n-Wt*a,Wt*n+zt*a),e.lineTo(zt*i-Wt*o,Wt*i+zt*o),e.lineTo(zt*l-Wt*c,Wt*l+zt*c),e.lineTo(zt*n+Wt*a,zt*a-Wt*n),e.lineTo(zt*i+Wt*o,zt*o-Wt*i),e.lineTo(zt*l+Wt*c,zt*c-Wt*l),e.closePath()}};function P5(e,t){let r=null,n=Mv(a);e=typeof e=="function"?e:ge(e||Lv),t=typeof t=="function"?t:ge(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:ge(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:ge(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function Fc(){}function zc(e,t,r){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+r)/6)}function n_(e){this._context=e}n_.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:zc(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:zc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function A5(e){return new n_(e)}function a_(e){this._context=e}a_.prototype={areaStart:Fc,areaEnd:Fc,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:zc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $5(e){return new a_(e)}function i_(e){this._context=e}i_.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 r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:zc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function E5(e){return new i_(e)}function o_(e){this._context=e}o_.prototype={areaStart:Fc,areaEnd:Fc,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 C5(e){return new o_(e)}function p0(e){return e<0?-1:1}function m0(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),o=(r-e._y1)/(a||n<0&&-0),l=(i*a+o*n)/(n+a);return(p0(i)+p0(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function v0(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Pf(e,t,r){var n=e._x0,a=e._y0,i=e._x1,o=e._y1,l=(i-n)/3;e._context.bezierCurveTo(n+l,a+l*t,i-l,o-l*r,i,o)}function Wc(e){this._context=e}Wc.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:Pf(this,this._t0,v0(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 r=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,Pf(this,v0(this,r=m0(this,e,t)),r);break;default:Pf(this,this._t0,r=m0(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function s_(e){this._context=new l_(e)}(s_.prototype=Object.create(Wc.prototype)).point=function(e,t){Wc.prototype.point.call(this,t,e)};function l_(e){this._context=e}l_.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,r,n,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function T5(e){return new Wc(e)}function M5(e){return new s_(e)}function c_(e){this._context=e}c_.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,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=g0(e),a=g0(t),i=0,o=1;o<r;++i,++o)this._context.bezierCurveTo(n[0][i],a[0][i],n[1][i],a[1][i],e[o],t[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function g0(e){var t,r=e.length-1,n,a=new Array(r),i=new Array(r),o=new Array(r);for(a[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)a[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[r-1]=2,i[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=a[t]/i[t-1],i[t]-=n,o[t]-=n*o[t-1];for(a[r-1]=o[r-1]/i[r-1],t=r-2;t>=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function I5(e){return new c_(e)}function bd(e,t){this._context=e,this._t=t}bd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=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 r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function L5(e){return new bd(e,.5)}function D5(e){return new bd(e,0)}function R5(e){return new bd(e,1)}function wi(e,t){if((o=e.length)>1)for(var r=1,n,a,i=e[t[0]],o,l=i.length;r<o;++r)for(a=i,i=e[t[r]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(a[n][1])?a[n][0]:a[n][1]}function lp(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function B5(e,t){return e[t]}function F5(e){const t=[];return t.key=e,t}function z5(){var e=ge([]),t=lp,r=wi,n=B5;function a(i){var o=Array.from(e.apply(this,arguments),F5),l,c=o.length,u=-1,f;for(const d of i)for(l=0,++u;l<c;++l)(o[l][u]=[0,+n(d,o[l].key,u,i)]).data=d;for(l=0,f=Iv(t(o));l<c;++l)o[f[l]].index=l;return r(o,f),o}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:ge(Array.from(i)),a):e},a.value=function(i){return arguments.length?(n=typeof i=="function"?i:ge(+i),a):n},a.order=function(i){return arguments.length?(t=i==null?lp:typeof i=="function"?i:ge(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(r=i??wi,a):r},a}function W5(e,t){if((n=e.length)>0){for(var r,n,a=0,i=e[0].length,o;a<i;++a){for(o=r=0;r<n;++r)o+=e[r][a][1]||0;if(o)for(r=0;r<n;++r)e[r][a][1]/=o}wi(e,t)}}function U5(e,t){if((a=e.length)>0){for(var r=0,n=e[t[0]],a,i=n.length;r<i;++r){for(var o=0,l=0;o<a;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}wi(e,t)}}function H5(e,t){if(!(!((o=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,o;n<i;++n){for(var l=0,c=0,u=0;l<o;++l){for(var f=e[t[l]],d=f[n][1]||0,h=f[n-1][1]||0,p=(d-h)/2,g=0;g<l;++g){var b=e[t[g]],x=b[n][1]||0,y=b[n-1][1]||0;p+=x-y}c+=d,u+=p*d}a[n-1][1]+=a[n-1][0]=r,c&&(r-=u/c)}a[n-1][1]+=a[n-1][0]=r,wi(e,t)}}function js(e){"@babel/helpers - typeof";return js=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},js(e)}var K5=["type","size","sizeType"];function cp(){return cp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cp.apply(this,arguments)}function y0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function x0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?y0(Object(r),!0).forEach(function(n){V5(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function V5(e,t,r){return t=G5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function G5(e){var t=Y5(e,"string");return js(t)=="symbol"?t:t+""}function Y5(e,t){if(js(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(js(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function q5(e,t){if(e==null)return{};var r=X5(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function X5(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var u_={symbolCircle:Lv,symbolCross:g5,symbolDiamond:x5,symbolSquare:b5,symbolStar:_5,symbolTriangle:N5,symbolWye:k5},Q5=Math.PI/180,Z5=function(t){var r="symbol".concat(gd(t));return u_[r]||Lv},J5=function(t,r,n){if(r==="area")return t;switch(n){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*Q5;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}},e4=function(t,r){u_["symbol".concat(gd(t))]=r},Dv=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,o=t.sizeType,l=o===void 0?"area":o,c=q5(t,K5),u=x0(x0({},c),{},{type:n,size:i,sizeType:l}),f=function(){var x=Z5(n),y=P5().type(x).size(J5(i,l,n));return y()},d=u.className,h=u.cx,p=u.cy,g=X(u,!0);return h===+h&&p===+p&&i===+i?E.createElement("path",cp({},g,{className:te("recharts-symbols",d),transform:"translate(".concat(h,", ").concat(p,")"),d:f()})):null};Dv.registerSymbol=e4;function Si(e){"@babel/helpers - typeof";return Si=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},Si(e)}function up(){return up=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},up.apply(this,arguments)}function b0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function t4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?b0(Object(r),!0).forEach(function(n){ws(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function r4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n4(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f_(n.key),n)}}function a4(e,t,r){return t&&n4(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function i4(e,t,r){return t=Uc(t),o4(e,d_()?Reflect.construct(t,r||[],Uc(e).constructor):t.apply(e,r))}function o4(e,t){if(t&&(Si(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s4(e)}function s4(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(d_=function(){return!!e})()}function Uc(e){return Uc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Uc(e)}function l4(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dp(e,t)}function dp(e,t){return dp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},dp(e,t)}function ws(e,t,r){return t=f_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f_(e){var t=c4(e,"string");return Si(t)=="symbol"?t:t+""}function c4(e,t){if(Si(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Si(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ut=32,Rv=function(e){function t(){return r4(this,t),i4(this,t,arguments)}return l4(t,e),a4(t,[{key:"renderIcon",value:function(n){var a=this.props.inactiveColor,i=Ut/2,o=Ut/6,l=Ut/3,c=n.inactive?a:n.color;if(n.type==="plainline")return E.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:i,x2:Ut,y2:i,className:"recharts-legend-icon"});if(n.type==="line")return E.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
+            A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(i,`
+            H`).concat(Ut,"M").concat(2*l,",").concat(i,`
+            A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(n.type==="rect")return E.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Ut/8,"h").concat(Ut,"v").concat(Ut*3/4,"h").concat(-Ut,"z"),className:"recharts-legend-icon"});if(E.isValidElement(n.legendIcon)){var u=t4({},n);return delete u.legendIcon,E.cloneElement(n.legendIcon,u)}return E.createElement(Dv,{fill:c,cx:i,cy:i,size:Ut,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,a=this.props,i=a.payload,o=a.iconSize,l=a.layout,c=a.formatter,u=a.inactiveColor,f={x:0,y:0,width:Ut,height:Ut},d={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(p,g){var b=p.formatter||c,x=te(ws(ws({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",p.inactive));if(p.type==="none")return null;var y=Z(p.value)?null:p.value;dr(!Z(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var v=p.inactive?u:p.color;return E.createElement("li",up({className:x,style:d,key:"legend-item-".concat(g)},va(n.props,p,g)),E.createElement(tp,{width:o,height:o,viewBox:f,style:h},n.renderIcon(p)),E.createElement("span",{className:"recharts-legend-item-text",style:{color:v}},b?b(y,p,g):y))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,o=n.align;if(!a||!a.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return E.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(O.PureComponent);ws(Rv,"displayName","Legend");ws(Rv,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var u4=ad;function d4(){this.__data__=new u4,this.size=0}var f4=d4;function h4(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var p4=h4;function m4(e){return this.__data__.get(e)}var v4=m4;function g4(e){return this.__data__.has(e)}var y4=g4,x4=ad,b4=Nv,j4=Ov,w4=200;function S4(e,t){var r=this.__data__;if(r instanceof x4){var n=r.__data__;if(!b4||n.length<w4-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new j4(n)}return r.set(e,t),this.size=r.size,this}var _4=S4,N4=ad,O4=f4,k4=p4,P4=v4,A4=y4,$4=_4;function so(e){var t=this.__data__=new N4(e);this.size=t.size}so.prototype.clear=O4;so.prototype.delete=k4;so.prototype.get=P4;so.prototype.has=A4;so.prototype.set=$4;var h_=so,E4="__lodash_hash_undefined__";function C4(e){return this.__data__.set(e,E4),this}var T4=C4;function M4(e){return this.__data__.has(e)}var I4=M4,L4=Ov,D4=T4,R4=I4;function Hc(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new L4;++t<r;)this.add(e[t])}Hc.prototype.add=Hc.prototype.push=D4;Hc.prototype.has=R4;var p_=Hc;function B4(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var m_=B4;function F4(e,t){return e.has(t)}var v_=F4,z4=p_,W4=m_,U4=v_,H4=1,K4=2;function V4(e,t,r,n,a,i){var o=r&H4,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var u=i.get(e),f=i.get(t);if(u&&f)return u==t&&f==e;var d=-1,h=!0,p=r&K4?new z4:void 0;for(i.set(e,t),i.set(t,e);++d<l;){var g=e[d],b=t[d];if(n)var x=o?n(b,g,d,t,e,i):n(g,b,d,e,t,i);if(x!==void 0){if(x)continue;h=!1;break}if(p){if(!W4(t,function(y,v){if(!U4(p,v)&&(g===y||a(g,y,r,n,i)))return p.push(v)})){h=!1;break}}else if(!(g===b||a(g,b,r,n,i))){h=!1;break}}return i.delete(e),i.delete(t),h}var g_=V4,G4=Nr,Y4=G4.Uint8Array,q4=Y4;function X4(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}var Q4=X4;function Z4(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Bv=Z4,j0=cl,w0=q4,J4=_v,e3=g_,t3=Q4,r3=Bv,n3=1,a3=2,i3="[object Boolean]",o3="[object Date]",s3="[object Error]",l3="[object Map]",c3="[object Number]",u3="[object RegExp]",d3="[object Set]",f3="[object String]",h3="[object Symbol]",p3="[object ArrayBuffer]",m3="[object DataView]",S0=j0?j0.prototype:void 0,Af=S0?S0.valueOf:void 0;function v3(e,t,r,n,a,i,o){switch(r){case m3:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case p3:return!(e.byteLength!=t.byteLength||!i(new w0(e),new w0(t)));case i3:case o3:case c3:return J4(+e,+t);case s3:return e.name==t.name&&e.message==t.message;case u3:case f3:return e==t+"";case l3:var l=t3;case d3:var c=n&n3;if(l||(l=r3),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;n|=a3,o.set(e,t);var f=e3(l(e),l(t),n,a,i,o);return o.delete(e),f;case h3:if(Af)return Af.call(e)==Af.call(t)}return!1}var g3=v3;function y3(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var y_=y3,x3=y_,b3=At;function j3(e,t,r){var n=t(e);return b3(e)?n:x3(n,r(e))}var w3=j3;function S3(e,t){for(var r=-1,n=e==null?0:e.length,a=0,i=[];++r<n;){var o=e[r];t(o,r,e)&&(i[a++]=o)}return i}var _3=S3;function N3(){return[]}var O3=N3,k3=_3,P3=O3,A3=Object.prototype,$3=A3.propertyIsEnumerable,_0=Object.getOwnPropertySymbols,E3=_0?function(e){return e==null?[]:(e=Object(e),k3(_0(e),function(t){return $3.call(e,t)}))}:P3,C3=E3;function T3(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var M3=T3,I3=Xr,L3=Qr,D3="[object Arguments]";function R3(e){return L3(e)&&I3(e)==D3}var B3=R3,N0=B3,F3=Qr,x_=Object.prototype,z3=x_.hasOwnProperty,W3=x_.propertyIsEnumerable,U3=N0(function(){return arguments}())?N0:function(e){return F3(e)&&z3.call(e,"callee")&&!W3.call(e,"callee")},Fv=U3,Kc={exports:{}};function H3(){return!1}var K3=H3;Kc.exports;(function(e,t){var r=Nr,n=K3,a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===a,l=o?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;e.exports=u})(Kc,Kc.exports);var b_=Kc.exports,V3=9007199254740991,G3=/^(?:0|[1-9]\d*)$/;function Y3(e,t){var r=typeof e;return t=t??V3,!!t&&(r=="number"||r!="symbol"&&G3.test(e))&&e>-1&&e%1==0&&e<t}var zv=Y3,q3=9007199254740991;function X3(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=q3}var Wv=X3,Q3=Xr,Z3=Wv,J3=Qr,eI="[object Arguments]",tI="[object Array]",rI="[object Boolean]",nI="[object Date]",aI="[object Error]",iI="[object Function]",oI="[object Map]",sI="[object Number]",lI="[object Object]",cI="[object RegExp]",uI="[object Set]",dI="[object String]",fI="[object WeakMap]",hI="[object ArrayBuffer]",pI="[object DataView]",mI="[object Float32Array]",vI="[object Float64Array]",gI="[object Int8Array]",yI="[object Int16Array]",xI="[object Int32Array]",bI="[object Uint8Array]",jI="[object Uint8ClampedArray]",wI="[object Uint16Array]",SI="[object Uint32Array]",je={};je[mI]=je[vI]=je[gI]=je[yI]=je[xI]=je[bI]=je[jI]=je[wI]=je[SI]=!0;je[eI]=je[tI]=je[hI]=je[rI]=je[pI]=je[nI]=je[aI]=je[iI]=je[oI]=je[sI]=je[lI]=je[cI]=je[uI]=je[dI]=je[fI]=!1;function _I(e){return J3(e)&&Z3(e.length)&&!!je[Q3(e)]}var NI=_I;function OI(e){return function(t){return e(t)}}var j_=OI,Vc={exports:{}};Vc.exports;(function(e,t){var r=AS,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,o=i&&r.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(Vc,Vc.exports);var kI=Vc.exports,PI=NI,AI=j_,O0=kI,k0=O0&&O0.isTypedArray,$I=k0?AI(k0):PI,w_=$I,EI=M3,CI=Fv,TI=At,MI=b_,II=zv,LI=w_,DI=Object.prototype,RI=DI.hasOwnProperty;function BI(e,t){var r=TI(e),n=!r&&CI(e),a=!r&&!n&&MI(e),i=!r&&!n&&!a&&LI(e),o=r||n||a||i,l=o?EI(e.length,String):[],c=l.length;for(var u in e)(t||RI.call(e,u))&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||II(u,c)))&&l.push(u);return l}var FI=BI,zI=Object.prototype;function WI(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||zI;return e===r}var UI=WI;function HI(e,t){return function(r){return e(t(r))}}var S_=HI,KI=S_,VI=KI(Object.keys,Object),GI=VI,YI=UI,qI=GI,XI=Object.prototype,QI=XI.hasOwnProperty;function ZI(e){if(!YI(e))return qI(e);var t=[];for(var r in Object(e))QI.call(e,r)&&r!="constructor"&&t.push(r);return t}var JI=ZI,eL=Sv,tL=Wv;function rL(e){return e!=null&&tL(e.length)&&!eL(e)}var ul=rL,nL=FI,aL=JI,iL=ul;function oL(e){return iL(e)?nL(e):aL(e)}var jd=oL,sL=w3,lL=C3,cL=jd;function uL(e){return sL(e,cL,lL)}var dL=uL,P0=dL,fL=1,hL=Object.prototype,pL=hL.hasOwnProperty;function mL(e,t,r,n,a,i){var o=r&fL,l=P0(e),c=l.length,u=P0(t),f=u.length;if(c!=f&&!o)return!1;for(var d=c;d--;){var h=l[d];if(!(o?h in t:pL.call(t,h)))return!1}var p=i.get(e),g=i.get(t);if(p&&g)return p==t&&g==e;var b=!0;i.set(e,t),i.set(t,e);for(var x=o;++d<c;){h=l[d];var y=e[h],v=t[h];if(n)var m=o?n(v,y,h,t,e,i):n(y,v,h,e,t,i);if(!(m===void 0?y===v||a(y,v,r,n,i):m)){b=!1;break}x||(x=h=="constructor")}if(b&&!x){var S=e.constructor,j=t.constructor;S!=j&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof j=="function"&&j instanceof j)&&(b=!1)}return i.delete(e),i.delete(t),b}var vL=mL,gL=Na,yL=Nr,xL=gL(yL,"DataView"),bL=xL,jL=Na,wL=Nr,SL=jL(wL,"Promise"),_L=SL,NL=Na,OL=Nr,kL=NL(OL,"Set"),__=kL,PL=Na,AL=Nr,$L=PL(AL,"WeakMap"),EL=$L,fp=bL,hp=Nv,pp=_L,mp=__,vp=EL,N_=Xr,lo=ES,A0="[object Map]",CL="[object Object]",$0="[object Promise]",E0="[object Set]",C0="[object WeakMap]",T0="[object DataView]",TL=lo(fp),ML=lo(hp),IL=lo(pp),LL=lo(mp),DL=lo(vp),Yn=N_;(fp&&Yn(new fp(new ArrayBuffer(1)))!=T0||hp&&Yn(new hp)!=A0||pp&&Yn(pp.resolve())!=$0||mp&&Yn(new mp)!=E0||vp&&Yn(new vp)!=C0)&&(Yn=function(e){var t=N_(e),r=t==CL?e.constructor:void 0,n=r?lo(r):"";if(n)switch(n){case TL:return T0;case ML:return A0;case IL:return $0;case LL:return E0;case DL:return C0}return t});var RL=Yn,$f=h_,BL=g_,FL=g3,zL=vL,M0=RL,I0=At,L0=b_,WL=w_,UL=1,D0="[object Arguments]",R0="[object Array]",Ll="[object Object]",HL=Object.prototype,B0=HL.hasOwnProperty;function KL(e,t,r,n,a,i){var o=I0(e),l=I0(t),c=o?R0:M0(e),u=l?R0:M0(t);c=c==D0?Ll:c,u=u==D0?Ll:u;var f=c==Ll,d=u==Ll,h=c==u;if(h&&L0(e)){if(!L0(t))return!1;o=!0,f=!1}if(h&&!f)return i||(i=new $f),o||WL(e)?BL(e,t,r,n,a,i):FL(e,t,c,r,n,a,i);if(!(r&UL)){var p=f&&B0.call(e,"__wrapped__"),g=d&&B0.call(t,"__wrapped__");if(p||g){var b=p?e.value():e,x=g?t.value():t;return i||(i=new $f),a(b,x,r,n,i)}}return h?(i||(i=new $f),zL(e,t,r,n,a,i)):!1}var VL=KL,GL=VL,F0=Qr;function O_(e,t,r,n,a){return e===t?!0:e==null||t==null||!F0(e)&&!F0(t)?e!==e&&t!==t:GL(e,t,r,n,O_,a)}var Uv=O_,YL=h_,qL=Uv,XL=1,QL=2;function ZL(e,t,r,n){var a=r.length,i=a,o=!n;if(e==null)return!i;for(e=Object(e);a--;){var l=r[a];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<i;){l=r[a];var c=l[0],u=e[c],f=l[1];if(o&&l[2]){if(u===void 0&&!(c in e))return!1}else{var d=new YL;if(n)var h=n(u,f,c,e,t,d);if(!(h===void 0?qL(f,u,XL|QL,n,d):h))return!1}}return!0}var JL=ZL,eD=Tn;function tD(e){return e===e&&!eD(e)}var k_=tD,rD=k_,nD=jd;function aD(e){for(var t=nD(e),r=t.length;r--;){var n=t[r],a=e[n];t[r]=[n,a,rD(a)]}return t}var iD=aD;function oD(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var P_=oD,sD=JL,lD=iD,cD=P_;function uD(e){var t=lD(e);return t.length==1&&t[0][2]?cD(t[0][0],t[0][1]):function(r){return r===e||sD(r,e,t)}}var dD=uD;function fD(e,t){return e!=null&&t in Object(e)}var hD=fD,pD=LS,mD=Fv,vD=At,gD=zv,yD=Wv,xD=od;function bD(e,t,r){t=pD(t,e);for(var n=-1,a=t.length,i=!1;++n<a;){var o=xD(t[n]);if(!(i=e!=null&&r(e,o)))break;e=e[o]}return i||++n!=a?i:(a=e==null?0:e.length,!!a&&yD(a)&&gD(o,a)&&(vD(e)||mD(e)))}var jD=bD,wD=hD,SD=jD;function _D(e,t){return e!=null&&SD(e,t,wD)}var ND=_D,OD=Uv,kD=DS,PD=ND,AD=wv,$D=k_,ED=P_,CD=od,TD=1,MD=2;function ID(e,t){return AD(e)&&$D(t)?ED(CD(e),t):function(r){var n=kD(r,e);return n===void 0&&n===t?PD(r,e):OD(t,n,TD|MD)}}var LD=ID;function DD(e){return e}var co=DD;function RD(e){return function(t){return t==null?void 0:t[e]}}var BD=RD,FD=Av;function zD(e){return function(t){return FD(t,e)}}var WD=zD,UD=BD,HD=WD,KD=wv,VD=od;function GD(e){return KD(e)?UD(VD(e)):HD(e)}var YD=GD,qD=dD,XD=LD,QD=co,ZD=At,JD=YD;function eR(e){return typeof e=="function"?e:e==null?QD:typeof e=="object"?ZD(e)?XD(e[0],e[1]):qD(e):JD(e)}var Or=eR;function tR(e,t,r,n){for(var a=e.length,i=r+(n?1:-1);n?i--:++i<a;)if(t(e[i],i,e))return i;return-1}var A_=tR;function rR(e){return e!==e}var nR=rR;function aR(e,t,r){for(var n=r-1,a=e.length;++n<a;)if(e[n]===t)return n;return-1}var iR=aR,oR=A_,sR=nR,lR=iR;function cR(e,t,r){return t===t?lR(e,t,r):oR(e,sR,r)}var uR=cR,dR=uR;function fR(e,t){var r=e==null?0:e.length;return!!r&&dR(e,t,0)>-1}var hR=fR;function pR(e,t,r){for(var n=-1,a=e==null?0:e.length;++n<a;)if(r(t,e[n]))return!0;return!1}var mR=pR;function vR(){}var gR=vR,Ef=__,yR=gR,xR=Bv,bR=1/0,jR=Ef&&1/xR(new Ef([,-0]))[1]==bR?function(e){return new Ef(e)}:yR,wR=jR,SR=p_,_R=hR,NR=mR,OR=v_,kR=wR,PR=Bv,AR=200;function $R(e,t,r){var n=-1,a=_R,i=e.length,o=!0,l=[],c=l;if(r)o=!1,a=NR;else if(i>=AR){var u=t?null:kR(e);if(u)return PR(u);o=!1,a=OR,c=new SR}else c=t?[]:l;e:for(;++n<i;){var f=e[n],d=t?t(f):f;if(f=r||f!==0?f:0,o&&d===d){for(var h=c.length;h--;)if(c[h]===d)continue e;t&&c.push(d),l.push(f)}else a(c,d,r)||(c!==l&&c.push(d),l.push(f))}return l}var ER=$R,CR=Or,TR=ER;function MR(e,t){return e&&e.length?TR(e,CR(t)):[]}var IR=MR;const z0=de(IR);function $_(e,t,r){return t===!0?z0(e,r):Z(t)?z0(e,t):e}function _i(e){"@babel/helpers - typeof";return _i=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},_i(e)}var LR=["ref"];function W0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?W0(Object(r),!0).forEach(function(n){wd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function DR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function U0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,C_(n.key),n)}}function RR(e,t,r){return t&&U0(e.prototype,t),r&&U0(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function BR(e,t,r){return t=Gc(t),FR(e,E_()?Reflect.construct(t,r||[],Gc(e).constructor):t.apply(e,r))}function FR(e,t){if(t&&(_i(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zR(e)}function zR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(E_=function(){return!!e})()}function Gc(e){return Gc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Gc(e)}function WR(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gp(e,t)}function gp(e,t){return gp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},gp(e,t)}function wd(e,t,r){return t=C_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C_(e){var t=UR(e,"string");return _i(t)=="symbol"?t:t+""}function UR(e,t){if(_i(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(_i(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function HR(e,t){if(e==null)return{};var r=KR(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function KR(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function VR(e){return e.value}function GR(e,t){if(E.isValidElement(e))return E.cloneElement(e,t);if(typeof e=="function")return E.createElement(e,t);t.ref;var r=HR(t,LR);return E.createElement(Rv,r)}var H0=1,di=function(e){function t(){var r;DR(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=BR(this,t,[].concat(a)),wd(r,"lastBoundingBox",{width:-1,height:-1}),r}return WR(t,e),RR(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>H0||Math.abs(a.height-this.lastBoundingBox.height)>H0)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Pr({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,o=a.align,l=a.verticalAlign,c=a.margin,u=a.chartWidth,f=a.chartHeight,d,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&i==="vertical"){var p=this.getBBoxSnapshot();d={left:((u||0)-p.width)/2}}else d=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var g=this.getBBoxSnapshot();h={top:((f||0)-g.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Pr(Pr({},d),h)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,o=a.width,l=a.height,c=a.wrapperStyle,u=a.payloadUniqBy,f=a.payload,d=Pr(Pr({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return E.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(p){n.wrapperNode=p}},GR(i,Pr(Pr({},this.props),{},{payload:$_(f,u,VR)})))}}],[{key:"getWithHeight",value:function(n,a){var i=Pr(Pr({},this.defaultProps),n.props),o=i.layout;return o==="vertical"&&W(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||a}:null}}])}(O.PureComponent);wd(di,"displayName","Legend");wd(di,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var K0=cl,YR=Fv,qR=At,V0=K0?K0.isConcatSpreadable:void 0;function XR(e){return qR(e)||YR(e)||!!(V0&&e&&e[V0])}var QR=XR,ZR=y_,JR=QR;function T_(e,t,r,n,a){var i=-1,o=e.length;for(r||(r=JR),a||(a=[]);++i<o;){var l=e[i];t>0&&r(l)?t>1?T_(l,t-1,r,n,a):ZR(a,l):n||(a[a.length]=l)}return a}var M_=T_;function e6(e){return function(t,r,n){for(var a=-1,i=Object(t),o=n(t),l=o.length;l--;){var c=o[e?l:++a];if(r(i[c],c,i)===!1)break}return t}}var t6=e6,r6=t6,n6=r6(),a6=n6,i6=a6,o6=jd;function s6(e,t){return e&&i6(e,t,o6)}var I_=s6,l6=ul;function c6(e,t){return function(r,n){if(r==null)return r;if(!l6(r))return e(r,n);for(var a=r.length,i=t?a:-1,o=Object(r);(t?i--:++i<a)&&n(o[i],i,o)!==!1;);return r}}var u6=c6,d6=I_,f6=u6,h6=f6(d6),Hv=h6,p6=Hv,m6=ul;function v6(e,t){var r=-1,n=m6(e)?Array(e.length):[];return p6(e,function(a,i,o){n[++r]=t(a,i,o)}),n}var L_=v6;function g6(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var y6=g6,G0=eo;function x6(e,t){if(e!==t){var r=e!==void 0,n=e===null,a=e===e,i=G0(e),o=t!==void 0,l=t===null,c=t===t,u=G0(t);if(!l&&!u&&!i&&e>t||i&&o&&c&&!l&&!u||n&&o&&c||!r&&c||!a)return 1;if(!n&&!i&&!u&&e<t||u&&r&&a&&!n&&!i||l&&r&&a||!o&&a||!c)return-1}return 0}var b6=x6,j6=b6;function w6(e,t,r){for(var n=-1,a=e.criteria,i=t.criteria,o=a.length,l=r.length;++n<o;){var c=j6(a[n],i[n]);if(c){if(n>=l)return c;var u=r[n];return c*(u=="desc"?-1:1)}}return e.index-t.index}var S6=w6,Cf=Pv,_6=Av,N6=Or,O6=L_,k6=y6,P6=j_,A6=S6,$6=co,E6=At;function C6(e,t,r){t.length?t=Cf(t,function(i){return E6(i)?function(o){return _6(o,i.length===1?i[0]:i)}:i}):t=[$6];var n=-1;t=Cf(t,P6(N6));var a=O6(e,function(i,o,l){var c=Cf(t,function(u){return u(i)});return{criteria:c,index:++n,value:i}});return k6(a,function(i,o){return A6(i,o,r)})}var T6=C6;function M6(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var I6=M6,L6=I6,Y0=Math.max;function D6(e,t,r){return t=Y0(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=Y0(n.length-t,0),o=Array(i);++a<i;)o[a]=n[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=n[a];return l[t]=r(o),L6(e,this,l)}}var R6=D6;function B6(e){return function(){return e}}var F6=B6,z6=Na,W6=function(){try{var e=z6(Object,"defineProperty");return e({},"",{}),e}catch{}}(),D_=W6,U6=F6,q0=D_,H6=co,K6=q0?function(e,t){return q0(e,"toString",{configurable:!0,enumerable:!1,value:U6(t),writable:!0})}:H6,V6=K6,G6=800,Y6=16,q6=Date.now;function X6(e){var t=0,r=0;return function(){var n=q6(),a=Y6-(n-r);if(r=n,a>0){if(++t>=G6)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Q6=X6,Z6=V6,J6=Q6,e8=J6(Z6),t8=e8,r8=co,n8=R6,a8=t8;function i8(e,t){return a8(n8(e,t,r8),e+"")}var o8=i8,s8=_v,l8=ul,c8=zv,u8=Tn;function d8(e,t,r){if(!u8(r))return!1;var n=typeof t;return(n=="number"?l8(r)&&c8(t,r.length):n=="string"&&t in r)?s8(r[t],e):!1}var Sd=d8,f8=M_,h8=T6,p8=o8,X0=Sd,m8=p8(function(e,t){if(e==null)return[];var r=t.length;return r>1&&X0(e,t[0],t[1])?t=[]:r>2&&X0(t[0],t[1],t[2])&&(t=[t[0]]),h8(e,f8(t,1),[])}),v8=m8;const Kv=de(v8);function Ss(e){"@babel/helpers - typeof";return Ss=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},Ss(e)}function yp(){return yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yp.apply(this,arguments)}function g8(e,t){return j8(e)||b8(e,t)||x8(e,t)||y8()}function y8(){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 x8(e,t){if(e){if(typeof e=="string")return Q0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Q0(e,t)}}function Q0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function b8(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function j8(e){if(Array.isArray(e))return e}function Z0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Tf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Z0(Object(r),!0).forEach(function(n){w8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function w8(e,t,r){return t=S8(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S8(e){var t=_8(e,"string");return Ss(t)=="symbol"?t:t+""}function _8(e,t){if(Ss(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ss(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function N8(e){return Array.isArray(e)&&Ge(e[0])&&Ge(e[1])?e.join(" ~ "):e}var O8=function(t){var r=t.separator,n=r===void 0?" : ":r,a=t.contentStyle,i=a===void 0?{}:a,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,f=t.payload,d=t.formatter,h=t.itemSorter,p=t.wrapperClassName,g=t.labelClassName,b=t.label,x=t.labelFormatter,y=t.accessibilityLayer,v=y===void 0?!1:y,m=function(){if(f&&f.length){var C={padding:0,margin:0},D=(h?Kv(f,h):f).map(function(P,M){if(P.type==="none")return null;var $=Tf({display:"block",paddingTop:4,paddingBottom:4,color:P.color||"#000"},l),I=P.formatter||d||N8,L=P.value,B=P.name,F=L,K=B;if(I&&F!=null&&K!=null){var H=I(L,B,P,M,f);if(Array.isArray(H)){var q=g8(H,2);F=q[0],K=q[1]}else F=H}return E.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(M),style:$},Ge(K)?E.createElement("span",{className:"recharts-tooltip-item-name"},K):null,Ge(K)?E.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,E.createElement("span",{className:"recharts-tooltip-item-value"},F),E.createElement("span",{className:"recharts-tooltip-item-unit"},P.unit||""))});return E.createElement("ul",{className:"recharts-tooltip-item-list",style:C},D)}return null},S=Tf({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),j=Tf({margin:0},u),w=!J(b),N=w?b:"",_=te("recharts-default-tooltip",p),k=te("recharts-tooltip-label",g);w&&x&&f!==void 0&&f!==null&&(N=x(b,f));var A=v?{role:"status","aria-live":"assertive"}:{};return E.createElement("div",yp({className:_,style:S},A),E.createElement("p",{className:k,style:j},E.isValidElement(N)?N:"".concat(N)),m())};function _s(e){"@babel/helpers - typeof";return _s=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},_s(e)}function Dl(e,t,r){return t=k8(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function k8(e){var t=P8(e,"string");return _s(t)=="symbol"?t:t+""}function P8(e,t){if(_s(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(_s(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _o="recharts-tooltip-wrapper",A8={visibility:"hidden"};function $8(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return te(_o,Dl(Dl(Dl(Dl({},"".concat(_o,"-right"),W(r)&&t&&W(t.x)&&r>=t.x),"".concat(_o,"-left"),W(r)&&t&&W(t.x)&&r<t.x),"".concat(_o,"-bottom"),W(n)&&t&&W(t.y)&&n>=t.y),"".concat(_o,"-top"),W(n)&&t&&W(t.y)&&n<t.y))}function J0(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,a=e.offsetTopLeft,i=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(i&&W(i[n]))return i[n];var f=r[n]-l-a,d=r[n]+a;if(t[n])return o[n]?f:d;if(o[n]){var h=f,p=c[n];return h<p?Math.max(d,c[n]):Math.max(f,c[n])}var g=d+l,b=c[n]+u;return g>b?Math.max(f,c[n]):Math.max(d,c[n])}function E8(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function C8(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,f,d;return o.height>0&&o.width>0&&r?(f=J0({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),d=J0({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=E8({translateX:f,translateY:d,useTranslate3d:l})):u=A8,{cssProperties:u,cssClasses:$8({translateX:f,translateY:d,coordinate:r})}}function Ni(e){"@babel/helpers - typeof";return Ni=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},Ni(e)}function ex(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function tx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ex(Object(r),!0).forEach(function(n){bp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ex(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function T8(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M8(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,B_(n.key),n)}}function I8(e,t,r){return t&&M8(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function L8(e,t,r){return t=Yc(t),D8(e,R_()?Reflect.construct(t,r||[],Yc(e).constructor):t.apply(e,r))}function D8(e,t){if(t&&(Ni(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return R8(e)}function R8(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(R_=function(){return!!e})()}function Yc(e){return Yc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Yc(e)}function B8(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xp(e,t)}function xp(e,t){return xp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},xp(e,t)}function bp(e,t,r){return t=B_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function B_(e){var t=F8(e,"string");return Ni(t)=="symbol"?t:t+""}function F8(e,t){if(Ni(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ni(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var rx=1,z8=function(e){function t(){var r;T8(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=L8(this,t,[].concat(a)),bp(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),bp(r,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,f;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(f=r.props.coordinate)===null||f===void 0?void 0:f.y)!==null&&u!==void 0?u:0}})}}),r}return B8(t,e),I8(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>rx||Math.abs(n.height-this.state.lastBoundingBox.height)>rx)&&this.setState({lastBoundingBox:{width:n.width,height:n.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 n,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.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 n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.children,f=a.coordinate,d=a.hasPayload,h=a.isAnimationActive,p=a.offset,g=a.position,b=a.reverseDirection,x=a.useTranslate3d,y=a.viewBox,v=a.wrapperStyle,m=C8({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:p,position:g,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:y}),S=m.cssClasses,j=m.cssProperties,w=tx(tx({transition:h&&i?"transform ".concat(l,"ms ").concat(c):void 0},j),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&d?"visible":"hidden",position:"absolute",top:0,left:0},v);return E.createElement("div",{tabIndex:-1,className:S,style:w,ref:function(_){n.wrapperNode=_}},u)}}])}(O.PureComponent),W8=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Oa={isSsr:W8()};function Oi(e){"@babel/helpers - typeof";return Oi=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},Oi(e)}function nx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ax(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nx(Object(r),!0).forEach(function(n){Vv(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function U8(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H8(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,z_(n.key),n)}}function K8(e,t,r){return t&&H8(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function V8(e,t,r){return t=qc(t),G8(e,F_()?Reflect.construct(t,r||[],qc(e).constructor):t.apply(e,r))}function G8(e,t){if(t&&(Oi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Y8(e)}function Y8(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(F_=function(){return!!e})()}function qc(e){return qc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qc(e)}function q8(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jp(e,t)}function jp(e,t){return jp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},jp(e,t)}function Vv(e,t,r){return t=z_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function z_(e){var t=X8(e,"string");return Oi(t)=="symbol"?t:t+""}function X8(e,t){if(Oi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Oi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Q8(e){return e.dataKey}function Z8(e,t){return E.isValidElement(e)?E.cloneElement(e,t):typeof e=="function"?E.createElement(e,t):E.createElement(O8,t)}var jt=function(e){function t(){return U8(this,t),V8(this,t,arguments)}return q8(t,e),K8(t,[{key:"render",value:function(){var n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.content,f=a.coordinate,d=a.filterNull,h=a.isAnimationActive,p=a.offset,g=a.payload,b=a.payloadUniqBy,x=a.position,y=a.reverseDirection,v=a.useTranslate3d,m=a.viewBox,S=a.wrapperStyle,j=g??[];d&&j.length&&(j=$_(g.filter(function(N){return N.value!=null&&(N.hide!==!0||n.props.includeHidden)}),b,Q8));var w=j.length>0;return E.createElement(z8,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:i,coordinate:f,hasPayload:w,offset:p,position:x,reverseDirection:y,useTranslate3d:v,viewBox:m,wrapperStyle:S},Z8(u,ax(ax({},this.props),{},{payload:j})))}}])}(O.PureComponent);Vv(jt,"displayName","Tooltip");Vv(jt,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Oa.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 J8=Nr,eB=function(){return J8.Date.now()},tB=eB,rB=/\s/;function nB(e){for(var t=e.length;t--&&rB.test(e.charAt(t)););return t}var aB=nB,iB=aB,oB=/^\s+/;function sB(e){return e&&e.slice(0,iB(e)+1).replace(oB,"")}var lB=sB,cB=lB,ix=Tn,uB=eo,ox=NaN,dB=/^[-+]0x[0-9a-f]+$/i,fB=/^0b[01]+$/i,hB=/^0o[0-7]+$/i,pB=parseInt;function mB(e){if(typeof e=="number")return e;if(uB(e))return ox;if(ix(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ix(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=cB(e);var r=fB.test(e);return r||hB.test(e)?pB(e.slice(2),r?2:8):dB.test(e)?ox:+e}var W_=mB,vB=Tn,Mf=tB,sx=W_,gB="Expected a function",yB=Math.max,xB=Math.min;function bB(e,t,r){var n,a,i,o,l,c,u=0,f=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(gB);t=sx(t)||0,vB(r)&&(f=!!r.leading,d="maxWait"in r,i=d?yB(sx(r.maxWait)||0,t):i,h="trailing"in r?!!r.trailing:h);function p(w){var N=n,_=a;return n=a=void 0,u=w,o=e.apply(_,N),o}function g(w){return u=w,l=setTimeout(y,t),f?p(w):o}function b(w){var N=w-c,_=w-u,k=t-N;return d?xB(k,i-_):k}function x(w){var N=w-c,_=w-u;return c===void 0||N>=t||N<0||d&&_>=i}function y(){var w=Mf();if(x(w))return v(w);l=setTimeout(y,b(w))}function v(w){return l=void 0,h&&n?p(w):(n=a=void 0,o)}function m(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function S(){return l===void 0?o:v(Mf())}function j(){var w=Mf(),N=x(w);if(n=arguments,a=this,c=w,N){if(l===void 0)return g(c);if(d)return clearTimeout(l),l=setTimeout(y,t),p(c)}return l===void 0&&(l=setTimeout(y,t)),o}return j.cancel=m,j.flush=S,j}var jB=bB,wB=jB,SB=Tn,_B="Expected a function";function NB(e,t,r){var n=!0,a=!0;if(typeof e!="function")throw new TypeError(_B);return SB(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),wB(e,t,{leading:n,maxWait:t,trailing:a})}var OB=NB;const U_=de(OB);function Ns(e){"@babel/helpers - typeof";return Ns=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},Ns(e)}function lx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Rl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lx(Object(r),!0).forEach(function(n){kB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kB(e,t,r){return t=PB(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PB(e){var t=AB(e,"string");return Ns(t)=="symbol"?t:t+""}function AB(e,t){if(Ns(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ns(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $B(e,t){return MB(e)||TB(e,t)||CB(e,t)||EB()}function EB(){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 CB(e,t){if(e){if(typeof e=="string")return cx(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cx(e,t)}}function cx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function TB(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function MB(e){if(Array.isArray(e))return e}var ki=O.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,a=n===void 0?{width:-1,height:-1}:n,i=e.width,o=i===void 0?"100%":i,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,f=u===void 0?0:u,d=e.minHeight,h=e.maxHeight,p=e.children,g=e.debounce,b=g===void 0?0:g,x=e.id,y=e.className,v=e.onResize,m=e.style,S=m===void 0?{}:m,j=O.useRef(null),w=O.useRef();w.current=v,O.useImperativeHandle(t,function(){return Object.defineProperty(j.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),j.current},configurable:!0})});var N=O.useState({containerWidth:a.width,containerHeight:a.height}),_=$B(N,2),k=_[0],A=_[1],T=O.useCallback(function(D,P){A(function(M){var $=Math.round(D),I=Math.round(P);return M.containerWidth===$&&M.containerHeight===I?M:{containerWidth:$,containerHeight:I}})},[]);O.useEffect(function(){var D=function(B){var F,K=B[0].contentRect,H=K.width,q=K.height;T(H,q),(F=w.current)===null||F===void 0||F.call(w,H,q)};b>0&&(D=U_(D,b,{trailing:!0,leading:!1}));var P=new ResizeObserver(D),M=j.current.getBoundingClientRect(),$=M.width,I=M.height;return T($,I),P.observe(j.current),function(){P.disconnect()}},[T,b]);var C=O.useMemo(function(){var D=k.containerWidth,P=k.containerHeight;if(D<0||P<0)return null;dr(ea(o)||ea(c),`The width(%s) and height(%s) are both fixed numbers,
+       maybe you don't need to use a ResponsiveContainer.`,o,c),dr(!r||r>0,"The aspect(%s) must be greater than zero.",r);var M=ea(o)?D:o,$=ea(c)?P:c;r&&r>0&&(M?$=M/r:$&&(M=$*r),h&&$>h&&($=h)),dr(M>0||$>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.`,M,$,o,c,f,d,r);var I=!Array.isArray(p)&&Br(p.type).endsWith("Chart");return E.Children.map(p,function(L){return E.isValidElement(L)?O.cloneElement(L,Rl({width:M,height:$},I?{style:Rl({height:"100%",width:"100%",maxHeight:$,maxWidth:M},L.props.style)}:{})):L})},[r,p,c,h,d,f,k,o]);return E.createElement("div",{id:x?"".concat(x):void 0,className:te("recharts-responsive-container",y),style:Rl(Rl({},S),{},{width:o,height:c,minWidth:f,minHeight:d,maxHeight:h}),ref:j},C)}),ga=function(t){return null};ga.displayName="Cell";function Os(e){"@babel/helpers - typeof";return Os=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},Os(e)}function ux(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function wp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ux(Object(r),!0).forEach(function(n){IB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ux(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function IB(e,t,r){return t=LB(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LB(e){var t=DB(e,"string");return Os(t)=="symbol"?t:t+""}function DB(e,t){if(Os(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Os(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ca={widthCache:{},cacheCount:0},RB=2e3,BB={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},dx="recharts_measurement_span";function FB(e){var t=wp({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var Xo=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Oa.isSsr)return{width:0,height:0};var n=FB(r),a=JSON.stringify({text:t,copyStyle:n});if(Ca.widthCache[a])return Ca.widthCache[a];try{var i=document.getElementById(dx);i||(i=document.createElement("span"),i.setAttribute("id",dx),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=wp(wp({},BB),n);Object.assign(i.style,o),i.textContent="".concat(t);var l=i.getBoundingClientRect(),c={width:l.width,height:l.height};return Ca.widthCache[a]=c,++Ca.cacheCount>RB&&(Ca.cacheCount=0,Ca.widthCache={}),c}catch{return{width:0,height:0}}},zB=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function ks(e){"@babel/helpers - typeof";return ks=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},ks(e)}function Xc(e,t){return KB(e)||HB(e,t)||UB(e,t)||WB()}function WB(){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 UB(e,t){if(e){if(typeof e=="string")return fx(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fx(e,t)}}function fx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function HB(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function KB(e){if(Array.isArray(e))return e}function VB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hx(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,YB(n.key),n)}}function GB(e,t,r){return t&&hx(e.prototype,t),r&&hx(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function YB(e){var t=qB(e,"string");return ks(t)=="symbol"?t:t+""}function qB(e,t){if(ks(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ks(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var px=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,mx=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,XB=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,QB=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,H_={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},ZB=Object.keys(H_),Ja="NaN";function JB(e,t){return e*H_[t]}var Bl=function(){function e(t,r){VB(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!XB.test(r)&&(this.num=NaN,this.unit=""),ZB.includes(r)&&(this.num=JB(t,r),this.unit="px")}return GB(e,[{key:"add",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,a=(n=QB.exec(r))!==null&&n!==void 0?n:[],i=Xc(a,3),o=i[1],l=i[2];return new e(parseFloat(o),l??"")}}])}();function K_(e){if(e.includes(Ja))return Ja;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=px.exec(t))!==null&&r!==void 0?r:[],a=Xc(n,4),i=a[1],o=a[2],l=a[3],c=Bl.parse(i??""),u=Bl.parse(l??""),f=o==="*"?c.multiply(u):c.divide(u);if(f.isNaN())return Ja;t=t.replace(px,f.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,h=(d=mx.exec(t))!==null&&d!==void 0?d:[],p=Xc(h,4),g=p[1],b=p[2],x=p[3],y=Bl.parse(g??""),v=Bl.parse(x??""),m=b==="+"?y.add(v):y.subtract(v);if(m.isNaN())return Ja;t=t.replace(mx,m.toString())}return t}var vx=/\(([^()]*)\)/;function eF(e){for(var t=e;t.includes("(");){var r=vx.exec(t),n=Xc(r,2),a=n[1];t=t.replace(vx,K_(a))}return t}function tF(e){var t=e.replace(/\s+/g,"");return t=eF(t),t=K_(t),t}function rF(e){try{return tF(e)}catch{return Ja}}function If(e){var t=rF(e.slice(5,-1));return t===Ja?"":t}var nF=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],aF=["dx","dy","angle","className","breakAll"];function Sp(){return Sp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sp.apply(this,arguments)}function gx(e,t){if(e==null)return{};var r=iF(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function iF(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function yx(e,t){return cF(e)||lF(e,t)||sF(e,t)||oF()}function oF(){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 sF(e,t){if(e){if(typeof e=="string")return xx(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xx(e,t)}}function xx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function lF(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function cF(e){if(Array.isArray(e))return e}var V_=/[ \f\n\r\t\v\u2028\u2029]+/,G_=function(t){var r=t.children,n=t.breakAll,a=t.style;try{var i=[];J(r)||(n?i=r.toString().split(""):i=r.toString().split(V_));var o=i.map(function(c){return{word:c,width:Xo(c,a).width}}),l=n?0:Xo(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},uF=function(t,r,n,a,i){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,f=W(o),d=l,h=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return M.reduce(function($,I){var L=I.word,B=I.width,F=$[$.length-1];if(F&&(a==null||i||F.width+B+n<Number(a)))F.words.push(L),F.width+=B+n;else{var K={words:[L],width:B};$.push(K)}return $},[])},p=h(r),g=function(M){return M.reduce(function($,I){return $.width>I.width?$:I})};if(!f)return p;for(var b="…",x=function(M){var $=d.slice(0,M),I=G_({breakAll:u,style:c,children:$+b}).wordsWithComputedWidth,L=h(I),B=L.length>o||g(L).width>Number(a);return[B,L]},y=0,v=d.length-1,m=0,S;y<=v&&m<=d.length-1;){var j=Math.floor((y+v)/2),w=j-1,N=x(w),_=yx(N,2),k=_[0],A=_[1],T=x(j),C=yx(T,1),D=C[0];if(!k&&!D&&(y=j+1),k&&D&&(v=j-1),!k&&D){S=A;break}m++}return S||p},bx=function(t){var r=J(t)?[]:t.toString().split(V_);return[{words:r}]},dF=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,l=t.maxLines;if((r||n)&&!Oa.isSsr){var c,u,f=G_({breakAll:o,children:a,style:i});if(f){var d=f.wordsWithComputedWidth,h=f.spaceWidth;c=d,u=h}else return bx(a);return uF({breakAll:o,children:a,maxLines:l,style:i},c,u,r,n)}return bx(a)},jx="#808080",ya=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,f=t.scaleToFit,d=f===void 0?!1:f,h=t.textAnchor,p=h===void 0?"start":h,g=t.verticalAnchor,b=g===void 0?"end":g,x=t.fill,y=x===void 0?jx:x,v=gx(t,nF),m=O.useMemo(function(){return dF({breakAll:v.breakAll,children:v.children,maxLines:v.maxLines,scaleToFit:d,style:v.style,width:v.width})},[v.breakAll,v.children,v.maxLines,d,v.style,v.width]),S=v.dx,j=v.dy,w=v.angle,N=v.className,_=v.breakAll,k=gx(v,aF);if(!Ge(n)||!Ge(i))return null;var A=n+(W(S)?S:0),T=i+(W(j)?j:0),C;switch(b){case"start":C=If("calc(".concat(u,")"));break;case"middle":C=If("calc(".concat((m.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:C=If("calc(".concat(m.length-1," * -").concat(l,")"));break}var D=[];if(d){var P=m[0].width,M=v.width;D.push("scale(".concat((W(M)?M/P:1)/P,")"))}return w&&D.push("rotate(".concat(w,", ").concat(A,", ").concat(T,")")),D.length&&(k.transform=D.join(" ")),E.createElement("text",Sp({},X(k,!0),{x:A,y:T,className:te("recharts-text",N),textAnchor:p,fill:y.includes("url")?jx:y}),m.map(function($,I){var L=$.words.join(_?"":" ");return E.createElement("tspan",{x:A,dy:I===0?C:l,key:"".concat(L,"-").concat(I)},L)}))};function On(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function fF(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Gv(e){let t,r,n;e.length!==2?(t=On,r=(l,c)=>On(e(l),c),n=(l,c)=>e(l)-c):(t=e===On||e===fF?e:hF,r=e,n=e);function a(l,c,u=0,f=l.length){if(u<f){if(t(c,c)!==0)return f;do{const d=u+f>>>1;r(l[d],c)<0?u=d+1:f=d}while(u<f)}return u}function i(l,c,u=0,f=l.length){if(u<f){if(t(c,c)!==0)return f;do{const d=u+f>>>1;r(l[d],c)<=0?u=d+1:f=d}while(u<f)}return u}function o(l,c,u=0,f=l.length){const d=a(l,c,u,f-1);return d>u&&n(l[d-1],c)>-n(l[d],c)?d-1:d}return{left:a,center:o,right:i}}function hF(){return 0}function Y_(e){return e===null?NaN:+e}function*pF(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const mF=Gv(On),dl=mF.right;Gv(Y_).center;class wx extends Map{constructor(t,r=yF){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(Sx(this,t))}has(t){return super.has(Sx(this,t))}set(t,r){return super.set(vF(this,t),r)}delete(t){return super.delete(gF(this,t))}}function Sx({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function vF({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function gF({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function yF(e){return e!==null&&typeof e=="object"?e.valueOf():e}function xF(e=On){if(e===On)return q_;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function q_(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const bF=Math.sqrt(50),jF=Math.sqrt(10),wF=Math.sqrt(2);function Qc(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),o=i>=bF?10:i>=jF?5:i>=wF?2:1;let l,c,u;return a<0?(u=Math.pow(10,-a)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,a)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?Qc(e,t,r*2):[l,c,u]}function _p(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[a,i,o]=n?Qc(t,e,r):Qc(e,t,r);if(!(i>=a))return[];const l=i-a+1,c=new Array(l);if(n)if(o<0)for(let u=0;u<l;++u)c[u]=(i-u)/-o;else for(let u=0;u<l;++u)c[u]=(i-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(a+u)/-o;else for(let u=0;u<l;++u)c[u]=(a+u)*o;return c}function Np(e,t,r){return t=+t,e=+e,r=+r,Qc(e,t,r)[2]}function Op(e,t,r){t=+t,e=+e,r=+r;const n=t<e,a=n?Np(t,e,r):Np(e,t,r);return(n?-1:1)*(a<0?1/-a:a)}function _x(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function Nx(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function X_(e,t,r=0,n=1/0,a){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(a=a===void 0?q_:xF(a);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,f=Math.log(c),d=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*d*(c-d)/c)*(u-c/2<0?-1:1),p=Math.max(r,Math.floor(t-u*d/c+h)),g=Math.min(n,Math.floor(t+(c-u)*d/c+h));X_(e,t,p,g,a)}const i=e[t];let o=r,l=n;for(No(e,r,t),a(e[n],i)>0&&No(e,r,n);o<l;){for(No(e,o,l),++o,--l;a(e[o],i)<0;)++o;for(;a(e[l],i)>0;)--l}a(e[r],i)===0?No(e,r,l):(++l,No(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function No(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function SF(e,t,r){if(e=Float64Array.from(pF(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Nx(e);if(t>=1)return _x(e);var n,a=(n-1)*t,i=Math.floor(a),o=_x(X_(e,i).subarray(0,i+1)),l=Nx(e.subarray(i+1));return o+(l-o)*(a-i)}}function _F(e,t,r=Y_){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,i=Math.floor(a),o=+r(e[i],i,e),l=+r(e[i+1],i+1,e);return o+(l-o)*(a-i)}}function NF(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n<a;)i[n]=e+n*r;return i}function tr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Zr(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const kp=Symbol("implicit");function Yv(){var e=new wx,t=[],r=[],n=kp;function a(i){let o=e.get(i);if(o===void 0){if(n!==kp)return n;e.set(i,o=t.push(i)-1)}return r[o%r.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new wx;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(i){return arguments.length?(r=Array.from(i),a):r.slice()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return Yv(t,r).unknown(n)},tr.apply(a,arguments),a}function Ps(){var e=Yv().unknown(void 0),t=e.domain,r=e.range,n=0,a=1,i,o,l=!1,c=0,u=0,f=.5;delete e.unknown;function d(){var h=t().length,p=a<n,g=p?a:n,b=p?n:a;i=(b-g)/Math.max(1,h-c+u*2),l&&(i=Math.floor(i)),g+=(b-g-i*(h-c))*f,o=i*(1-c),l&&(g=Math.round(g),o=Math.round(o));var x=NF(h).map(function(y){return g+i*y});return r(p?x.reverse():x)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([n,a]=h,n=+n,a=+a,d()):[n,a]},e.rangeRound=function(h){return[n,a]=h,n=+n,a=+a,l=!0,d()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(h){return arguments.length?(l=!!h,d()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),d()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),d()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,d()):u},e.align=function(h){return arguments.length?(f=Math.max(0,Math.min(1,h)),d()):f},e.copy=function(){return Ps(t(),[n,a]).round(l).paddingInner(c).paddingOuter(u).align(f)},tr.apply(d(),arguments)}function Q_(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Q_(t())},e}function Qo(){return Q_(Ps.apply(null,arguments).paddingInner(1))}function qv(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Z_(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function fl(){}var As=.7,Zc=1/As,fi="\\s*([+-]?\\d+)\\s*",$s="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",jr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",OF=/^#([0-9a-f]{3,8})$/,kF=new RegExp(`^rgb\\(${fi},${fi},${fi}\\)$`),PF=new RegExp(`^rgb\\(${jr},${jr},${jr}\\)$`),AF=new RegExp(`^rgba\\(${fi},${fi},${fi},${$s}\\)$`),$F=new RegExp(`^rgba\\(${jr},${jr},${jr},${$s}\\)$`),EF=new RegExp(`^hsl\\(${$s},${jr},${jr}\\)$`),CF=new RegExp(`^hsla\\(${$s},${jr},${jr},${$s}\\)$`),Ox={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};qv(fl,Es,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:kx,formatHex:kx,formatHex8:TF,formatHsl:MF,formatRgb:Px,toString:Px});function kx(){return this.rgb().formatHex()}function TF(){return this.rgb().formatHex8()}function MF(){return J_(this).formatHsl()}function Px(){return this.rgb().formatRgb()}function Es(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=OF.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Ax(t):r===3?new Nt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Fl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Fl(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=kF.exec(e))?new Nt(t[1],t[2],t[3],1):(t=PF.exec(e))?new Nt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=AF.exec(e))?Fl(t[1],t[2],t[3],t[4]):(t=$F.exec(e))?Fl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=EF.exec(e))?Cx(t[1],t[2]/100,t[3]/100,1):(t=CF.exec(e))?Cx(t[1],t[2]/100,t[3]/100,t[4]):Ox.hasOwnProperty(e)?Ax(Ox[e]):e==="transparent"?new Nt(NaN,NaN,NaN,0):null}function Ax(e){return new Nt(e>>16&255,e>>8&255,e&255,1)}function Fl(e,t,r,n){return n<=0&&(e=t=r=NaN),new Nt(e,t,r,n)}function IF(e){return e instanceof fl||(e=Es(e)),e?(e=e.rgb(),new Nt(e.r,e.g,e.b,e.opacity)):new Nt}function Pp(e,t,r,n){return arguments.length===1?IF(e):new Nt(e,t,r,n??1)}function Nt(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}qv(Nt,Pp,Z_(fl,{brighter(e){return e=e==null?Zc:Math.pow(Zc,e),new Nt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?As:Math.pow(As,e),new Nt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Nt(la(this.r),la(this.g),la(this.b),Jc(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:$x,formatHex:$x,formatHex8:LF,formatRgb:Ex,toString:Ex}));function $x(){return`#${ta(this.r)}${ta(this.g)}${ta(this.b)}`}function LF(){return`#${ta(this.r)}${ta(this.g)}${ta(this.b)}${ta((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ex(){const e=Jc(this.opacity);return`${e===1?"rgb(":"rgba("}${la(this.r)}, ${la(this.g)}, ${la(this.b)}${e===1?")":`, ${e})`}`}function Jc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function la(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ta(e){return e=la(e),(e<16?"0":"")+e.toString(16)}function Cx(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new lr(e,t,r,n)}function J_(e){if(e instanceof lr)return new lr(e.h,e.s,e.l,e.opacity);if(e instanceof fl||(e=Es(e)),!e)return new lr;if(e instanceof lr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),o=NaN,l=i-a,c=(i+a)/2;return l?(t===i?o=(r-n)/l+(r<n)*6:r===i?o=(n-t)/l+2:o=(t-r)/l+4,l/=c<.5?i+a:2-i-a,o*=60):l=c>0&&c<1?0:o,new lr(o,l,c,e.opacity)}function DF(e,t,r,n){return arguments.length===1?J_(e):new lr(e,t,r,n??1)}function lr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}qv(lr,DF,Z_(fl,{brighter(e){return e=e==null?Zc:Math.pow(Zc,e),new lr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?As:Math.pow(As,e),new lr(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,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new Nt(Lf(e>=240?e-240:e+120,a,n),Lf(e,a,n),Lf(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new lr(Tx(this.h),zl(this.s),zl(this.l),Jc(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=Jc(this.opacity);return`${e===1?"hsl(":"hsla("}${Tx(this.h)}, ${zl(this.s)*100}%, ${zl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Tx(e){return e=(e||0)%360,e<0?e+360:e}function zl(e){return Math.max(0,Math.min(1,e||0))}function Lf(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Xv=e=>()=>e;function RF(e,t){return function(r){return e+r*t}}function BF(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function FF(e){return(e=+e)==1?eN:function(t,r){return r-t?BF(t,r,e):Xv(isNaN(t)?r:t)}}function eN(e,t){var r=t-e;return r?RF(e,r):Xv(isNaN(e)?t:e)}const Mx=function e(t){var r=FF(t);function n(a,i){var o=r((a=Pp(a)).r,(i=Pp(i)).r),l=r(a.g,i.g),c=r(a.b,i.b),u=eN(a.opacity,i.opacity);return function(f){return a.r=o(f),a.g=l(f),a.b=c(f),a.opacity=u(f),a+""}}return n.gamma=e,n}(1);function zF(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;a<r;++a)n[a]=e[a]*(1-i)+t[a]*i;return n}}function WF(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function UF(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,a=new Array(n),i=new Array(r),o;for(o=0;o<n;++o)a[o]=uo(e[o],t[o]);for(;o<r;++o)i[o]=t[o];return function(l){for(o=0;o<n;++o)i[o]=a[o](l);return i}}function HF(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function eu(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function KF(e,t){var r={},n={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?r[a]=uo(e[a],t[a]):n[a]=t[a];return function(i){for(a in r)n[a]=r[a](i);return n}}var Ap=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Df=new RegExp(Ap.source,"g");function VF(e){return function(){return e}}function GF(e){return function(t){return e(t)+""}}function YF(e,t){var r=Ap.lastIndex=Df.lastIndex=0,n,a,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(n=Ap.exec(e))&&(a=Df.exec(t));)(i=a.index)>r&&(i=t.slice(r,i),l[o]?l[o]+=i:l[++o]=i),(n=n[0])===(a=a[0])?l[o]?l[o]+=a:l[++o]=a:(l[++o]=null,c.push({i:o,x:eu(n,a)})),r=Df.lastIndex;return r<t.length&&(i=t.slice(r),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?GF(c[0].x):VF(t):(t=c.length,function(u){for(var f=0,d;f<t;++f)l[(d=c[f]).i]=d.x(u);return l.join("")})}function uo(e,t){var r=typeof t,n;return t==null||r==="boolean"?Xv(t):(r==="number"?eu:r==="string"?(n=Es(t))?(t=n,Mx):YF:t instanceof Es?Mx:t instanceof Date?HF:WF(t)?zF:Array.isArray(t)?UF:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?KF:eu)(e,t)}function Qv(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function qF(e,t){t===void 0&&(t=e,e=uo);for(var r=0,n=t.length-1,a=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(a,a=t[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return i[l](o-l)}}function XF(e){return function(){return e}}function tu(e){return+e}var Ix=[0,1];function pt(e){return e}function $p(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:XF(isNaN(t)?NaN:.5)}function QF(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function ZF(e,t,r){var n=e[0],a=e[1],i=t[0],o=t[1];return a<n?(n=$p(a,n),i=r(o,i)):(n=$p(n,a),i=r(i,o)),function(l){return i(n(l))}}function JF(e,t,r){var n=Math.min(e.length,t.length)-1,a=new Array(n),i=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)a[o]=$p(e[o],e[o+1]),i[o]=r(t[o],t[o+1]);return function(l){var c=dl(e,l,1,n)-1;return i[c](a[c](l))}}function hl(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function _d(){var e=Ix,t=Ix,r=uo,n,a,i,o=pt,l,c,u;function f(){var h=Math.min(e.length,t.length);return o!==pt&&(o=QF(e[0],e[h-1])),l=h>2?JF:ZF,c=u=null,d}function d(h){return h==null||isNaN(h=+h)?i:(c||(c=l(e.map(n),t,r)))(n(o(h)))}return d.invert=function(h){return o(a((u||(u=l(t,e.map(n),eu)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,tu),f()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),r=Qv,f()},d.clamp=function(h){return arguments.length?(o=h?!0:pt,f()):o!==pt},d.interpolate=function(h){return arguments.length?(r=h,f()):r},d.unknown=function(h){return arguments.length?(i=h,d):i},function(h,p){return n=h,a=p,f()}}function Zv(){return _d()(pt,pt)}function ez(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ru(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Pi(e){return e=ru(Math.abs(e)),e?e[1]:NaN}function tz(e,t){return function(r,n){for(var a=r.length,i=[],o=0,l=e[0],c=0;a>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),i.push(r.substring(a-=l,a+l)),!((c+=l+1)>n));)l=e[o=(o+1)%e.length];return i.reverse().join(t)}}function rz(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var nz=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Cs(e){if(!(t=nz.exec(e)))throw new Error("invalid format: "+e);var t;return new Jv({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]})}Cs.prototype=Jv.prototype;function Jv(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+""}Jv.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 az(e){e:for(var t=e.length,r=1,n=-1,a;r<t;++r)switch(e[r]){case".":n=a=r;break;case"0":n===0&&(n=r),a=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var nu;function iz(e,t){var r=ru(e,t);if(!r)return nu=void 0,e.toPrecision(t);var n=r[0],a=r[1],i=a-(nu=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+ru(e,Math.max(0,t+i-1))[0]}function Lx(e,t){var r=ru(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const Dx={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:ez,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)=>Lx(e*100,t),r:Lx,s:iz,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Rx(e){return e}var Bx=Array.prototype.map,Fx=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function oz(e){var t=e.grouping===void 0||e.thousands===void 0?Rx:tz(Bx.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?Rx:rz(Bx.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(d,h){d=Cs(d);var p=d.fill,g=d.align,b=d.sign,x=d.symbol,y=d.zero,v=d.width,m=d.comma,S=d.precision,j=d.trim,w=d.type;w==="n"?(m=!0,w="g"):Dx[w]||(S===void 0&&(S=12),j=!0,w="g"),(y||p==="0"&&g==="=")&&(y=!0,p="0",g="=");var N=(h&&h.prefix!==void 0?h.prefix:"")+(x==="$"?r:x==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():""),_=(x==="$"?n:/[%p]/.test(w)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),k=Dx[w],A=/[defgprs%]/.test(w);S=S===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function T(C){var D=N,P=_,M,$,I;if(w==="c")P=k(C)+P,C="";else{C=+C;var L=C<0||1/C<0;if(C=isNaN(C)?c:k(Math.abs(C),S),j&&(C=az(C)),L&&+C==0&&b!=="+"&&(L=!1),D=(L?b==="("?b:l:b==="-"||b==="("?"":b)+D,P=(w==="s"&&!isNaN(C)&&nu!==void 0?Fx[8+nu/3]:"")+P+(L&&b==="("?")":""),A){for(M=-1,$=C.length;++M<$;)if(I=C.charCodeAt(M),48>I||I>57){P=(I===46?a+C.slice(M+1):C.slice(M))+P,C=C.slice(0,M);break}}}m&&!y&&(C=t(C,1/0));var B=D.length+C.length+P.length,F=B<v?new Array(v-B+1).join(p):"";switch(m&&y&&(C=t(F+C,F.length?v-P.length:1/0),F=""),g){case"<":C=D+C+P+F;break;case"=":C=D+F+C+P;break;case"^":C=F.slice(0,B=F.length>>1)+D+C+P+F.slice(B);break;default:C=F+D+C+P;break}return i(C)}return T.toString=function(){return d+""},T}function f(d,h){var p=Math.max(-8,Math.min(8,Math.floor(Pi(h)/3)))*3,g=Math.pow(10,-p),b=u((d=Cs(d),d.type="f",d),{suffix:Fx[8+p/3]});return function(x){return b(g*x)}}return{format:u,formatPrefix:f}}var Wl,eg,tN;sz({thousands:",",grouping:[3],currency:["$",""]});function sz(e){return Wl=oz(e),eg=Wl.format,tN=Wl.formatPrefix,Wl}function lz(e){return Math.max(0,-Pi(Math.abs(e)))}function cz(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Pi(t)/3)))*3-Pi(Math.abs(e)))}function uz(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Pi(t)-Pi(e))+1}function rN(e,t,r,n){var a=Op(e,t,r),i;switch(n=Cs(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=cz(a,o))&&(n.precision=i),tN(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=uz(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=lz(a))&&(n.precision=i-(n.type==="%")*2);break}}return eg(n)}function Mn(e){var t=e.domain;return e.ticks=function(r){var n=t();return _p(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return rN(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,o=n[a],l=n[i],c,u,f=10;for(l<o&&(u=o,o=l,l=u,u=a,a=i,i=u);f-- >0;){if(u=Np(o,l,r),u===c)return n[a]=o,n[i]=l,t(n);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function au(){var e=Zv();return e.copy=function(){return hl(e,au())},tr.apply(e,arguments),Mn(e)}function nN(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,tu),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return nN(e).unknown(t)},e=arguments.length?Array.from(e,tu):[0,1],Mn(r)}function aN(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],o;return i<a&&(o=r,r=n,n=o,o=a,a=i,i=o),e[r]=t.floor(a),e[n]=t.ceil(i),e}function zx(e){return Math.log(e)}function Wx(e){return Math.exp(e)}function dz(e){return-Math.log(-e)}function fz(e){return-Math.exp(-e)}function hz(e){return isFinite(e)?+("1e"+e):e<0?0:e}function pz(e){return e===10?hz:e===Math.E?Math.exp:t=>Math.pow(e,t)}function mz(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 Ux(e){return(t,r)=>-e(-t,r)}function tg(e){const t=e(zx,Wx),r=t.domain;let n=10,a,i;function o(){return a=mz(n),i=pz(n),r()[0]<0?(a=Ux(a),i=Ux(i),e(dz,fz)):e(zx,Wx),t}return t.base=function(l){return arguments.length?(n=+l,o()):n},t.domain=function(l){return arguments.length?(r(l),o()):r()},t.ticks=l=>{const c=r();let u=c[0],f=c[c.length-1];const d=f<u;d&&([u,f]=[f,u]);let h=a(u),p=a(f),g,b;const x=l==null?10:+l;let y=[];if(!(n%1)&&p-h<x){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(g=1;g<n;++g)if(b=h<0?g/i(-h):g*i(h),!(b<u)){if(b>f)break;y.push(b)}}else for(;h<=p;++h)for(g=n-1;g>=1;--g)if(b=h>0?g/i(-h):g*i(h),!(b<u)){if(b>f)break;y.push(b)}y.length*2<x&&(y=_p(u,f,x))}else y=_p(h,p,Math.min(p-h,x)).map(i);return d?y.reverse():y},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=Cs(c)).precision==null&&(c.trim=!0),c=eg(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return f=>{let d=f/i(Math.round(a(f)));return d*n<n-.5&&(d*=n),d<=u?c(f):""}},t.nice=()=>r(aN(r(),{floor:l=>i(Math.floor(a(l))),ceil:l=>i(Math.ceil(a(l)))})),t}function iN(){const e=tg(_d()).domain([1,10]);return e.copy=()=>hl(e,iN()).base(e.base()),tr.apply(e,arguments),e}function Hx(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Kx(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function rg(e){var t=1,r=e(Hx(t),Kx(t));return r.constant=function(n){return arguments.length?e(Hx(t=+n),Kx(t)):t},Mn(r)}function oN(){var e=rg(_d());return e.copy=function(){return hl(e,oN()).constant(e.constant())},tr.apply(e,arguments)}function Vx(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function vz(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function gz(e){return e<0?-e*e:e*e}function ng(e){var t=e(pt,pt),r=1;function n(){return r===1?e(pt,pt):r===.5?e(vz,gz):e(Vx(r),Vx(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},Mn(t)}function ag(){var e=ng(_d());return e.copy=function(){return hl(e,ag()).exponent(e.exponent())},tr.apply(e,arguments),e}function yz(){return ag.apply(null,arguments).exponent(.5)}function Gx(e){return Math.sign(e)*e*e}function xz(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function sN(){var e=Zv(),t=[0,1],r=!1,n;function a(i){var o=xz(e(i));return isNaN(o)?n:r?Math.round(o):o}return a.invert=function(i){return e.invert(Gx(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,tu)).map(Gx)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return sN(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},tr.apply(a,arguments),Mn(a)}function lN(){var e=[],t=[],r=[],n;function a(){var o=0,l=Math.max(1,t.length);for(r=new Array(l-1);++o<l;)r[o-1]=_F(e,o/l);return i}function i(o){return o==null||isNaN(o=+o)?n:t[dl(r,o)]}return i.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(On),a()},i.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.quantiles=function(){return r.slice()},i.copy=function(){return lN().domain(e).range(t).unknown(n)},tr.apply(i,arguments)}function cN(){var e=0,t=1,r=1,n=[.5],a=[0,1],i;function o(c){return c!=null&&c<=c?a[dl(n,c,0,r)]:i}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(r=(a=Array.from(c)).length-1,l()):a.slice()},o.invertExtent=function(c){var u=a.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,n[0]]:u>=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(c){return arguments.length&&(i=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return cN().domain([e,t]).range(a).unknown(i)},tr.apply(Mn(o),arguments)}function uN(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[dl(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return uN().domain(e).range(t).unknown(r)},tr.apply(a,arguments)}const Rf=new Date,Bf=new Date;function Ye(e,t,r,n){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 o=a(i),l=a.ceil(i);return i-o<l-i?o:l},a.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,l)=>{const c=[];if(i=a.ceil(i),l=l==null?1:Math.floor(l),!(i<o)||!(l>0))return c;let u;do c.push(u=new Date(+i)),t(i,l),e(i);while(u<i&&i<o);return c},a.filter=i=>Ye(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!i(o););else for(;--l>=0;)for(;t(o,1),!i(o););}),r&&(a.count=(i,o)=>(Rf.setTime(+i),Bf.setTime(+o),e(Rf),e(Bf),Math.floor(r(Rf,Bf))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?o=>n(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const iu=Ye(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);iu.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ye(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):iu);iu.range;const Ir=1e3,Yt=Ir*60,Lr=Yt*60,Vr=Lr*24,ig=Vr*7,Yx=Vr*30,Ff=Vr*365,ra=Ye(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ir)},(e,t)=>(t-e)/Ir,e=>e.getUTCSeconds());ra.range;const og=Ye(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ir)},(e,t)=>{e.setTime(+e+t*Yt)},(e,t)=>(t-e)/Yt,e=>e.getMinutes());og.range;const sg=Ye(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Yt)},(e,t)=>(t-e)/Yt,e=>e.getUTCMinutes());sg.range;const lg=Ye(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ir-e.getMinutes()*Yt)},(e,t)=>{e.setTime(+e+t*Lr)},(e,t)=>(t-e)/Lr,e=>e.getHours());lg.range;const cg=Ye(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Lr)},(e,t)=>(t-e)/Lr,e=>e.getUTCHours());cg.range;const pl=Ye(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Yt)/Vr,e=>e.getDate()-1);pl.range;const Nd=Ye(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vr,e=>e.getUTCDate()-1);Nd.range;const dN=Ye(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vr,e=>Math.floor(e/Vr));dN.range;function ka(e){return Ye(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Yt)/ig)}const Od=ka(0),ou=ka(1),bz=ka(2),jz=ka(3),Ai=ka(4),wz=ka(5),Sz=ka(6);Od.range;ou.range;bz.range;jz.range;Ai.range;wz.range;Sz.range;function Pa(e){return Ye(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/ig)}const kd=Pa(0),su=Pa(1),_z=Pa(2),Nz=Pa(3),$i=Pa(4),Oz=Pa(5),kz=Pa(6);kd.range;su.range;_z.range;Nz.range;$i.range;Oz.range;kz.range;const ug=Ye(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());ug.range;const dg=Ye(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());dg.range;const Gr=Ye(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());Gr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ye(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Gr.range;const Yr=Ye(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());Yr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ye(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Yr.range;function fN(e,t,r,n,a,i){const o=[[ra,1,Ir],[ra,5,5*Ir],[ra,15,15*Ir],[ra,30,30*Ir],[i,1,Yt],[i,5,5*Yt],[i,15,15*Yt],[i,30,30*Yt],[a,1,Lr],[a,3,3*Lr],[a,6,6*Lr],[a,12,12*Lr],[n,1,Vr],[n,2,2*Vr],[r,1,ig],[t,1,Yx],[t,3,3*Yx],[e,1,Ff]];function l(u,f,d){const h=f<u;h&&([u,f]=[f,u]);const p=d&&typeof d.range=="function"?d:c(u,f,d),g=p?p.range(u,+f+1):[];return h?g.reverse():g}function c(u,f,d){const h=Math.abs(f-u)/d,p=Gv(([,,x])=>x).right(o,h);if(p===o.length)return e.every(Op(u/Ff,f/Ff,d));if(p===0)return iu.every(Math.max(Op(u,f,d),1));const[g,b]=o[h/o[p-1][2]<o[p][2]/h?p-1:p];return g.every(b)}return[l,c]}const[Pz,Az]=fN(Yr,dg,kd,dN,cg,sg),[$z,Ez]=fN(Gr,ug,Od,pl,lg,og);function zf(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Wf(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Oo(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function Cz(e){var t=e.dateTime,r=e.date,n=e.time,a=e.periods,i=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=ko(a),f=Po(a),d=ko(i),h=Po(i),p=ko(o),g=Po(o),b=ko(l),x=Po(l),y=ko(c),v=Po(c),m={a:I,A:L,b:B,B:F,c:null,d:eb,e:eb,f:t9,g:d9,G:h9,H:Zz,I:Jz,j:e9,L:hN,m:r9,M:n9,p:K,q:H,Q:nb,s:ab,S:a9,u:i9,U:o9,V:s9,w:l9,W:c9,x:null,X:null,y:u9,Y:f9,Z:p9,"%":rb},S={a:q,A:ie,b:_e,B:Me,c:null,d:tb,e:tb,f:y9,g:P9,G:$9,H:m9,I:v9,j:g9,L:mN,m:x9,M:b9,p:Ft,q:yt,Q:nb,s:ab,S:j9,u:w9,U:S9,V:_9,w:N9,W:O9,x:null,X:null,y:k9,Y:A9,Z:E9,"%":rb},j={a:A,A:T,b:C,B:D,c:P,d:Zx,e:Zx,f:Yz,g:Qx,G:Xx,H:Jx,I:Jx,j:Hz,L:Gz,m:Uz,M:Kz,p:k,q:Wz,Q:Xz,s:Qz,S:Vz,u:Dz,U:Rz,V:Bz,w:Lz,W:Fz,x:M,X:$,y:Qx,Y:Xx,Z:zz,"%":qz};m.x=w(r,m),m.X=w(n,m),m.c=w(t,m),S.x=w(r,S),S.X=w(n,S),S.c=w(t,S);function w(V,ee){return function(re){var z=[],Ee=-1,oe=0,Fe=V.length,ze,xt,en;for(re instanceof Date||(re=new Date(+re));++Ee<Fe;)V.charCodeAt(Ee)===37&&(z.push(V.slice(oe,Ee)),(xt=qx[ze=V.charAt(++Ee)])!=null?ze=V.charAt(++Ee):xt=ze==="e"?" ":"0",(en=ee[ze])&&(ze=en(re,xt)),z.push(ze),oe=Ee+1);return z.push(V.slice(oe,Ee)),z.join("")}}function N(V,ee){return function(re){var z=Oo(1900,void 0,1),Ee=_(z,V,re+="",0),oe,Fe;if(Ee!=re.length)return null;if("Q"in z)return new Date(z.Q);if("s"in z)return new Date(z.s*1e3+("L"in z?z.L:0));if(ee&&!("Z"in z)&&(z.Z=0),"p"in z&&(z.H=z.H%12+z.p*12),z.m===void 0&&(z.m="q"in z?z.q:0),"V"in z){if(z.V<1||z.V>53)return null;"w"in z||(z.w=1),"Z"in z?(oe=Wf(Oo(z.y,0,1)),Fe=oe.getUTCDay(),oe=Fe>4||Fe===0?su.ceil(oe):su(oe),oe=Nd.offset(oe,(z.V-1)*7),z.y=oe.getUTCFullYear(),z.m=oe.getUTCMonth(),z.d=oe.getUTCDate()+(z.w+6)%7):(oe=zf(Oo(z.y,0,1)),Fe=oe.getDay(),oe=Fe>4||Fe===0?ou.ceil(oe):ou(oe),oe=pl.offset(oe,(z.V-1)*7),z.y=oe.getFullYear(),z.m=oe.getMonth(),z.d=oe.getDate()+(z.w+6)%7)}else("W"in z||"U"in z)&&("w"in z||(z.w="u"in z?z.u%7:"W"in z?1:0),Fe="Z"in z?Wf(Oo(z.y,0,1)).getUTCDay():zf(Oo(z.y,0,1)).getDay(),z.m=0,z.d="W"in z?(z.w+6)%7+z.W*7-(Fe+5)%7:z.w+z.U*7-(Fe+6)%7);return"Z"in z?(z.H+=z.Z/100|0,z.M+=z.Z%100,Wf(z)):zf(z)}}function _(V,ee,re,z){for(var Ee=0,oe=ee.length,Fe=re.length,ze,xt;Ee<oe;){if(z>=Fe)return-1;if(ze=ee.charCodeAt(Ee++),ze===37){if(ze=ee.charAt(Ee++),xt=j[ze in qx?ee.charAt(Ee++):ze],!xt||(z=xt(V,re,z))<0)return-1}else if(ze!=re.charCodeAt(z++))return-1}return z}function k(V,ee,re){var z=u.exec(ee.slice(re));return z?(V.p=f.get(z[0].toLowerCase()),re+z[0].length):-1}function A(V,ee,re){var z=p.exec(ee.slice(re));return z?(V.w=g.get(z[0].toLowerCase()),re+z[0].length):-1}function T(V,ee,re){var z=d.exec(ee.slice(re));return z?(V.w=h.get(z[0].toLowerCase()),re+z[0].length):-1}function C(V,ee,re){var z=y.exec(ee.slice(re));return z?(V.m=v.get(z[0].toLowerCase()),re+z[0].length):-1}function D(V,ee,re){var z=b.exec(ee.slice(re));return z?(V.m=x.get(z[0].toLowerCase()),re+z[0].length):-1}function P(V,ee,re){return _(V,t,ee,re)}function M(V,ee,re){return _(V,r,ee,re)}function $(V,ee,re){return _(V,n,ee,re)}function I(V){return o[V.getDay()]}function L(V){return i[V.getDay()]}function B(V){return c[V.getMonth()]}function F(V){return l[V.getMonth()]}function K(V){return a[+(V.getHours()>=12)]}function H(V){return 1+~~(V.getMonth()/3)}function q(V){return o[V.getUTCDay()]}function ie(V){return i[V.getUTCDay()]}function _e(V){return c[V.getUTCMonth()]}function Me(V){return l[V.getUTCMonth()]}function Ft(V){return a[+(V.getUTCHours()>=12)]}function yt(V){return 1+~~(V.getUTCMonth()/3)}return{format:function(V){var ee=w(V+="",m);return ee.toString=function(){return V},ee},parse:function(V){var ee=N(V+="",!1);return ee.toString=function(){return V},ee},utcFormat:function(V){var ee=w(V+="",S);return ee.toString=function(){return V},ee},utcParse:function(V){var ee=N(V+="",!0);return ee.toString=function(){return V},ee}}}var qx={"-":"",_:" ",0:"0"},Je=/^\s*\d+/,Tz=/^%/,Mz=/[\\^$*+?|[\]().{}]/g;function le(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(t)+a:a)}function Iz(e){return e.replace(Mz,"\\$&")}function ko(e){return new RegExp("^(?:"+e.map(Iz).join("|")+")","i")}function Po(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function Lz(e,t,r){var n=Je.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Dz(e,t,r){var n=Je.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Rz(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Bz(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function Fz(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Xx(e,t,r){var n=Je.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Qx(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function zz(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Wz(e,t,r){var n=Je.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Uz(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Zx(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Hz(e,t,r){var n=Je.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Jx(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Kz(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Vz(e,t,r){var n=Je.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Gz(e,t,r){var n=Je.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Yz(e,t,r){var n=Je.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function qz(e,t,r){var n=Tz.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Xz(e,t,r){var n=Je.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Qz(e,t,r){var n=Je.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function eb(e,t){return le(e.getDate(),t,2)}function Zz(e,t){return le(e.getHours(),t,2)}function Jz(e,t){return le(e.getHours()%12||12,t,2)}function e9(e,t){return le(1+pl.count(Gr(e),e),t,3)}function hN(e,t){return le(e.getMilliseconds(),t,3)}function t9(e,t){return hN(e,t)+"000"}function r9(e,t){return le(e.getMonth()+1,t,2)}function n9(e,t){return le(e.getMinutes(),t,2)}function a9(e,t){return le(e.getSeconds(),t,2)}function i9(e){var t=e.getDay();return t===0?7:t}function o9(e,t){return le(Od.count(Gr(e)-1,e),t,2)}function pN(e){var t=e.getDay();return t>=4||t===0?Ai(e):Ai.ceil(e)}function s9(e,t){return e=pN(e),le(Ai.count(Gr(e),e)+(Gr(e).getDay()===4),t,2)}function l9(e){return e.getDay()}function c9(e,t){return le(ou.count(Gr(e)-1,e),t,2)}function u9(e,t){return le(e.getFullYear()%100,t,2)}function d9(e,t){return e=pN(e),le(e.getFullYear()%100,t,2)}function f9(e,t){return le(e.getFullYear()%1e4,t,4)}function h9(e,t){var r=e.getDay();return e=r>=4||r===0?Ai(e):Ai.ceil(e),le(e.getFullYear()%1e4,t,4)}function p9(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+le(t/60|0,"0",2)+le(t%60,"0",2)}function tb(e,t){return le(e.getUTCDate(),t,2)}function m9(e,t){return le(e.getUTCHours(),t,2)}function v9(e,t){return le(e.getUTCHours()%12||12,t,2)}function g9(e,t){return le(1+Nd.count(Yr(e),e),t,3)}function mN(e,t){return le(e.getUTCMilliseconds(),t,3)}function y9(e,t){return mN(e,t)+"000"}function x9(e,t){return le(e.getUTCMonth()+1,t,2)}function b9(e,t){return le(e.getUTCMinutes(),t,2)}function j9(e,t){return le(e.getUTCSeconds(),t,2)}function w9(e){var t=e.getUTCDay();return t===0?7:t}function S9(e,t){return le(kd.count(Yr(e)-1,e),t,2)}function vN(e){var t=e.getUTCDay();return t>=4||t===0?$i(e):$i.ceil(e)}function _9(e,t){return e=vN(e),le($i.count(Yr(e),e)+(Yr(e).getUTCDay()===4),t,2)}function N9(e){return e.getUTCDay()}function O9(e,t){return le(su.count(Yr(e)-1,e),t,2)}function k9(e,t){return le(e.getUTCFullYear()%100,t,2)}function P9(e,t){return e=vN(e),le(e.getUTCFullYear()%100,t,2)}function A9(e,t){return le(e.getUTCFullYear()%1e4,t,4)}function $9(e,t){var r=e.getUTCDay();return e=r>=4||r===0?$i(e):$i.ceil(e),le(e.getUTCFullYear()%1e4,t,4)}function E9(){return"+0000"}function rb(){return"%"}function nb(e){return+e}function ab(e){return Math.floor(+e/1e3)}var Ta,gN,yN;C9({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 C9(e){return Ta=Cz(e),gN=Ta.format,Ta.parse,yN=Ta.utcFormat,Ta.utcParse,Ta}function T9(e){return new Date(e)}function M9(e){return e instanceof Date?+e:+new Date(+e)}function fg(e,t,r,n,a,i,o,l,c,u){var f=Zv(),d=f.invert,h=f.domain,p=u(".%L"),g=u(":%S"),b=u("%I:%M"),x=u("%I %p"),y=u("%a %d"),v=u("%b %d"),m=u("%B"),S=u("%Y");function j(w){return(c(w)<w?p:l(w)<w?g:o(w)<w?b:i(w)<w?x:n(w)<w?a(w)<w?y:v:r(w)<w?m:S)(w)}return f.invert=function(w){return new Date(d(w))},f.domain=function(w){return arguments.length?h(Array.from(w,M9)):h().map(T9)},f.ticks=function(w){var N=h();return e(N[0],N[N.length-1],w??10)},f.tickFormat=function(w,N){return N==null?j:u(N)},f.nice=function(w){var N=h();return(!w||typeof w.range!="function")&&(w=t(N[0],N[N.length-1],w??10)),w?h(aN(N,w)):f},f.copy=function(){return hl(f,fg(e,t,r,n,a,i,o,l,c,u))},f}function I9(){return tr.apply(fg($z,Ez,Gr,ug,Od,pl,lg,og,ra,gN).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function L9(){return tr.apply(fg(Pz,Az,Yr,dg,kd,Nd,cg,sg,ra,yN).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Pd(){var e=0,t=1,r,n,a,i,o=pt,l=!1,c;function u(d){return d==null||isNaN(d=+d)?c:o(a===0?.5:(d=(i(d)-r)*a,l?Math.max(0,Math.min(1,d)):d))}u.domain=function(d){return arguments.length?([e,t]=d,r=i(e=+e),n=i(t=+t),a=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(d){return arguments.length?(l=!!d,u):l},u.interpolator=function(d){return arguments.length?(o=d,u):o};function f(d){return function(h){var p,g;return arguments.length?([p,g]=h,o=d(p,g),u):[o(0),o(1)]}}return u.range=f(uo),u.rangeRound=f(Qv),u.unknown=function(d){return arguments.length?(c=d,u):c},function(d){return i=d,r=d(e),n=d(t),a=r===n?0:1/(n-r),u}}function In(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function xN(){var e=Mn(Pd()(pt));return e.copy=function(){return In(e,xN())},Zr.apply(e,arguments)}function bN(){var e=tg(Pd()).domain([1,10]);return e.copy=function(){return In(e,bN()).base(e.base())},Zr.apply(e,arguments)}function jN(){var e=rg(Pd());return e.copy=function(){return In(e,jN()).constant(e.constant())},Zr.apply(e,arguments)}function hg(){var e=ng(Pd());return e.copy=function(){return In(e,hg()).exponent(e.exponent())},Zr.apply(e,arguments)}function D9(){return hg.apply(null,arguments).exponent(.5)}function wN(){var e=[],t=pt;function r(n){if(n!=null&&!isNaN(n=+n))return t((dl(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let a of n)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(On),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,a)=>t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>SF(e,i/n))},r.copy=function(){return wN(t).domain(e)},Zr.apply(r,arguments)}function Ad(){var e=0,t=.5,r=1,n=1,a,i,o,l,c,u=pt,f,d=!1,h;function p(b){return isNaN(b=+b)?h:(b=.5+((b=+f(b))-i)*(n*b<n*i?l:c),u(d?Math.max(0,Math.min(1,b)):b))}p.domain=function(b){return arguments.length?([e,t,r]=b,a=f(e=+e),i=f(t=+t),o=f(r=+r),l=a===i?0:.5/(i-a),c=i===o?0:.5/(o-i),n=i<a?-1:1,p):[e,t,r]},p.clamp=function(b){return arguments.length?(d=!!b,p):d},p.interpolator=function(b){return arguments.length?(u=b,p):u};function g(b){return function(x){var y,v,m;return arguments.length?([y,v,m]=x,u=qF(b,[y,v,m]),p):[u(0),u(.5),u(1)]}}return p.range=g(uo),p.rangeRound=g(Qv),p.unknown=function(b){return arguments.length?(h=b,p):h},function(b){return f=b,a=b(e),i=b(t),o=b(r),l=a===i?0:.5/(i-a),c=i===o?0:.5/(o-i),n=i<a?-1:1,p}}function SN(){var e=Mn(Ad()(pt));return e.copy=function(){return In(e,SN())},Zr.apply(e,arguments)}function _N(){var e=tg(Ad()).domain([.1,1,10]);return e.copy=function(){return In(e,_N()).base(e.base())},Zr.apply(e,arguments)}function NN(){var e=rg(Ad());return e.copy=function(){return In(e,NN()).constant(e.constant())},Zr.apply(e,arguments)}function pg(){var e=ng(Ad());return e.copy=function(){return In(e,pg()).exponent(e.exponent())},Zr.apply(e,arguments)}function R9(){return pg.apply(null,arguments).exponent(.5)}const ib=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Ps,scaleDiverging:SN,scaleDivergingLog:_N,scaleDivergingPow:pg,scaleDivergingSqrt:R9,scaleDivergingSymlog:NN,scaleIdentity:nN,scaleImplicit:kp,scaleLinear:au,scaleLog:iN,scaleOrdinal:Yv,scalePoint:Qo,scalePow:ag,scaleQuantile:lN,scaleQuantize:cN,scaleRadial:sN,scaleSequential:xN,scaleSequentialLog:bN,scaleSequentialPow:hg,scaleSequentialQuantile:wN,scaleSequentialSqrt:D9,scaleSequentialSymlog:jN,scaleSqrt:yz,scaleSymlog:oN,scaleThreshold:uN,scaleTime:I9,scaleUtc:L9,tickFormat:rN},Symbol.toStringTag,{value:"Module"}));var B9=eo;function F9(e,t,r){for(var n=-1,a=e.length;++n<a;){var i=e[n],o=t(i);if(o!=null&&(l===void 0?o===o&&!B9(o):r(o,l)))var l=o,c=i}return c}var $d=F9;function z9(e,t){return e>t}var ON=z9,W9=$d,U9=ON,H9=co;function K9(e){return e&&e.length?W9(e,H9,U9):void 0}var V9=K9;const pn=de(V9);function G9(e,t){return e<t}var kN=G9,Y9=$d,q9=kN,X9=co;function Q9(e){return e&&e.length?Y9(e,X9,q9):void 0}var Z9=Q9;const Ed=de(Z9);var J9=Pv,e7=Or,t7=L_,r7=At;function n7(e,t){var r=r7(e)?J9:t7;return r(e,e7(t))}var a7=n7,i7=M_,o7=a7;function s7(e,t){return i7(o7(e,t),1)}var l7=s7;const c7=de(l7);var u7=Uv;function d7(e,t){return u7(e,t)}var f7=d7;const Ei=de(f7);var fo=1e9,h7={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},vg,Oe=!0,Jt="[DecimalError] ",ca=Jt+"Invalid argument: ",mg=Jt+"Exponent out of range: ",ho=Math.floor,qn=Math.pow,p7=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Tt,qe=1e7,we=7,PN=9007199254740991,lu=ho(PN/we),Y={};Y.absoluteValue=Y.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Y.comparedTo=Y.cmp=function(e){var t,r,n,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=n<a?n:a;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};Y.decimalPlaces=Y.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*we;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Y.dividedBy=Y.div=function(e){return Fr(this,new this.constructor(e))};Y.dividedToIntegerBy=Y.idiv=function(e){var t=this,r=t.constructor;return me(Fr(t,new r(e),0,1),r.precision)};Y.equals=Y.eq=function(e){return!this.cmp(e)};Y.exponent=function(){return Be(this)};Y.greaterThan=Y.gt=function(e){return this.cmp(e)>0};Y.greaterThanOrEqualTo=Y.gte=function(e){return this.cmp(e)>=0};Y.isInteger=Y.isint=function(){return this.e>this.d.length-2};Y.isNegative=Y.isneg=function(){return this.s<0};Y.isPositive=Y.ispos=function(){return this.s>0};Y.isZero=function(){return this.s===0};Y.lessThan=Y.lt=function(e){return this.cmp(e)<0};Y.lessThanOrEqualTo=Y.lte=function(e){return this.cmp(e)<1};Y.logarithm=Y.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Tt))throw Error(Jt+"NaN");if(r.s<1)throw Error(Jt+(r.s?"NaN":"-Infinity"));return r.eq(Tt)?new n(0):(Oe=!1,t=Fr(Ts(r,i),Ts(e,i),i),Oe=!0,me(t,a))};Y.minus=Y.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?EN(t,e):AN(t,(e.s=-e.s,e))};Y.modulo=Y.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(Jt+"NaN");return r.s?(Oe=!1,t=Fr(r,e,0,1).times(e),Oe=!0,r.minus(t)):me(new n(r),a)};Y.naturalExponential=Y.exp=function(){return $N(this)};Y.naturalLogarithm=Y.ln=function(){return Ts(this)};Y.negated=Y.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Y.plus=Y.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?AN(t,e):EN(t,(e.s=-e.s,e))};Y.precision=Y.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ca+e);if(t=Be(a)+1,n=a.d.length-1,r=n*we+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Y.squareRoot=Y.sqrt=function(){var e,t,r,n,a,i,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Jt+"NaN")}for(e=Be(l),Oe=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=gr(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=ho((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),n=new c(t)):n=new c(a.toString()),r=c.precision,a=o=r+3;;)if(i=n,n=i.plus(Fr(l,i,o+2)).times(.5),gr(i.d).slice(0,o)===(t=gr(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(me(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(t!="9999")break;o+=4}return Oe=!0,me(n,r)};Y.times=Y.mul=function(e){var t,r,n,a,i,o,l,c,u,f=this,d=f.constructor,h=f.d,p=(e=new d(e)).d;if(!f.s||!e.s)return new d(0);for(e.s*=f.s,r=f.e+e.e,c=h.length,u=p.length,c<u&&(i=h,h=p,p=i,o=c,c=u,u=o),i=[],o=c+u,n=o;n--;)i.push(0);for(n=u;--n>=0;){for(t=0,a=c+n;a>n;)l=i[a]+p[n]*h[a-n-1]+t,i[a--]=l%qe|0,t=l/qe|0;i[a]=(i[a]+t)%qe|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,Oe?me(e,d.precision):e};Y.toDecimalPlaces=Y.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Sr(e,0,fo),t===void 0?t=n.rounding:Sr(t,0,8),me(r,e+Be(r)+1,t))};Y.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=xa(n,!0):(Sr(e,0,fo),t===void 0?t=a.rounding:Sr(t,0,8),n=me(new a(n),e+1,t),r=xa(n,!0,e+1)),r};Y.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?xa(a):(Sr(e,0,fo),t===void 0?t=i.rounding:Sr(t,0,8),n=me(new i(a),e+Be(a)+1,t),r=xa(n.abs(),!1,e+Be(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};Y.toInteger=Y.toint=function(){var e=this,t=e.constructor;return me(new t(e),Be(e)+1,t.rounding)};Y.toNumber=function(){return+this};Y.toPower=Y.pow=function(e){var t,r,n,a,i,o,l=this,c=l.constructor,u=12,f=+(e=new c(e));if(!e.s)return new c(Tt);if(l=new c(l),!l.s){if(e.s<1)throw Error(Jt+"Infinity");return l}if(l.eq(Tt))return l;if(n=c.precision,e.eq(Tt))return me(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=l.s,o){if((r=f<0?-f:f)<=PN){for(a=new c(Tt),t=Math.ceil(n/we+4),Oe=!1;r%2&&(a=a.times(l),sb(a.d,t)),r=ho(r/2),r!==0;)l=l.times(l),sb(l.d,t);return Oe=!0,e.s<0?new c(Tt).div(a):me(a,n)}}else if(i<0)throw Error(Jt+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,Oe=!1,a=e.times(Ts(l,n+u)),Oe=!0,a=$N(a),a.s=i,a};Y.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=Be(a),n=xa(a,r<=i.toExpNeg||r>=i.toExpPos)):(Sr(e,1,fo),t===void 0?t=i.rounding:Sr(t,0,8),a=me(new i(a),e,t),r=Be(a),n=xa(a,e<=r||r<=i.toExpNeg,e)),n};Y.toSignificantDigits=Y.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Sr(e,1,fo),t===void 0?t=n.rounding:Sr(t,0,8)),me(new n(r),e,t)};Y.toString=Y.valueOf=Y.val=Y.toJSON=Y[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Be(e),r=e.constructor;return xa(e,t<=r.toExpNeg||t>=r.toExpPos)};function AN(e,t){var r,n,a,i,o,l,c,u,f=e.constructor,d=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),Oe?me(t,d):t;if(c=e.d,u=t.d,o=e.e,a=t.e,c=c.slice(),i=o-a,i){for(i<0?(n=c,i=-i,l=u.length):(n=u,a=o,l=c.length),o=Math.ceil(d/we),l=o>l?o+1:l+1,i>l&&(i=l,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(l=c.length,i=u.length,l-i<0&&(i=l,n=u,u=c,c=n),r=0;i;)r=(c[--i]=c[i]+u[i]+r)/qe|0,c[i]%=qe;for(r&&(c.unshift(r),++a),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=a,Oe?me(t,d):t}function Sr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(ca+e)}function gr(e){var t,r,n,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;t<a;t++)n=e[t]+"",r=we-n.length,r&&(i+=sn(r)),i+=n;o=e[t],n=o+"",r=we-n.length,r&&(i+=sn(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var Fr=function(){function e(n,a){var i,o=0,l=n.length;for(n=n.slice();l--;)i=n[l]*a+o,n[l]=i%qe|0,o=i/qe|0;return o&&n.unshift(o),n}function t(n,a,i,o){var l,c;if(i!=o)c=i>o?1:-1;else for(l=c=0;l<i;l++)if(n[l]!=a[l]){c=n[l]>a[l]?1:-1;break}return c}function r(n,a,i){for(var o=0;i--;)n[i]-=o,o=n[i]<a[i]?1:0,n[i]=o*qe+n[i]-a[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,a,i,o){var l,c,u,f,d,h,p,g,b,x,y,v,m,S,j,w,N,_,k=n.constructor,A=n.s==a.s?1:-1,T=n.d,C=a.d;if(!n.s)return new k(n);if(!a.s)throw Error(Jt+"Division by zero");for(c=n.e-a.e,N=C.length,j=T.length,p=new k(A),g=p.d=[],u=0;C[u]==(T[u]||0);)++u;if(C[u]>(T[u]||0)&&--c,i==null?v=i=k.precision:o?v=i+(Be(n)-Be(a))+1:v=i,v<0)return new k(0);if(v=v/we+2|0,u=0,N==1)for(f=0,C=C[0],v++;(u<j||f)&&v--;u++)m=f*qe+(T[u]||0),g[u]=m/C|0,f=m%C|0;else{for(f=qe/(C[0]+1)|0,f>1&&(C=e(C,f),T=e(T,f),N=C.length,j=T.length),S=N,b=T.slice(0,N),x=b.length;x<N;)b[x++]=0;_=C.slice(),_.unshift(0),w=C[0],C[1]>=qe/2&&++w;do f=0,l=t(C,b,N,x),l<0?(y=b[0],N!=x&&(y=y*qe+(b[1]||0)),f=y/w|0,f>1?(f>=qe&&(f=qe-1),d=e(C,f),h=d.length,x=b.length,l=t(d,b,h,x),l==1&&(f--,r(d,N<h?_:C,h))):(f==0&&(l=f=1),d=C.slice()),h=d.length,h<x&&d.unshift(0),r(b,d,x),l==-1&&(x=b.length,l=t(C,b,N,x),l<1&&(f++,r(b,N<x?_:C,x))),x=b.length):l===0&&(f++,b=[0]),g[u++]=f,l&&b[0]?b[x++]=T[S]||0:(b=[T[S]],x=1);while((S++<j||b[0]!==void 0)&&v--)}return g[0]||g.shift(),p.e=c,me(p,o?i+Be(p)+1:i)}}();function $N(e,t){var r,n,a,i,o,l,c=0,u=0,f=e.constructor,d=f.precision;if(Be(e)>16)throw Error(mg+Be(e));if(!e.s)return new f(Tt);for(Oe=!1,l=d,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(qn(2,u))/Math.LN10*2+5|0,l+=n,r=a=i=new f(Tt),f.precision=l;;){if(a=me(a.times(e),l),r=r.times(++c),o=i.plus(Fr(a,r,l)),gr(o.d).slice(0,l)===gr(i.d).slice(0,l)){for(;u--;)i=me(i.times(i),l);return f.precision=d,t==null?(Oe=!0,me(i,d)):i}i=o}}function Be(e){for(var t=e.e*we,r=e.d[0];r>=10;r/=10)t++;return t}function Uf(e,t,r){if(t>e.LN10.sd())throw Oe=!0,r&&(e.precision=r),Error(Jt+"LN10 precision limit exceeded");return me(new e(e.LN10),t)}function sn(e){for(var t="";e--;)t+="0";return t}function Ts(e,t){var r,n,a,i,o,l,c,u,f,d=1,h=10,p=e,g=p.d,b=p.constructor,x=b.precision;if(p.s<1)throw Error(Jt+(p.s?"NaN":"-Infinity"));if(p.eq(Tt))return new b(0);if(t==null?(Oe=!1,u=x):u=t,p.eq(10))return t==null&&(Oe=!0),Uf(b,u);if(u+=h,b.precision=u,r=gr(g),n=r.charAt(0),i=Be(p),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=gr(p.d),n=r.charAt(0),d++;i=Be(p),n>1?(p=new b("0."+r),i++):p=new b(n+"."+r.slice(1))}else return c=Uf(b,u+2,x).times(i+""),p=Ts(new b(n+"."+r.slice(1)),u-h).plus(c),b.precision=x,t==null?(Oe=!0,me(p,x)):p;for(l=o=p=Fr(p.minus(Tt),p.plus(Tt),u),f=me(p.times(p),u),a=3;;){if(o=me(o.times(f),u),c=l.plus(Fr(o,new b(a),u)),gr(c.d).slice(0,u)===gr(l.d).slice(0,u))return l=l.times(2),i!==0&&(l=l.plus(Uf(b,u+2,x).times(i+""))),l=Fr(l,new b(d),u),b.precision=x,t==null?(Oe=!0,me(l,x)):l;l=c,a+=2}}function ob(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=ho(r/we),e.d=[],n=(r+1)%we,r<0&&(n+=we),n<a){for(n&&e.d.push(+t.slice(0,n)),a-=we;n<a;)e.d.push(+t.slice(n,n+=we));t=t.slice(n),n=we-t.length}else n-=a;for(;n--;)t+="0";if(e.d.push(+t),Oe&&(e.e>lu||e.e<-lu))throw Error(mg+r)}else e.s=0,e.e=0,e.d=[0];return e}function me(e,t,r){var n,a,i,o,l,c,u,f,d=e.d;for(o=1,i=d[0];i>=10;i/=10)o++;if(n=t-o,n<0)n+=we,a=t,u=d[f=0];else{if(f=Math.ceil((n+1)/we),i=d.length,f>=i)return e;for(u=i=d[f],o=1;i>=10;i/=10)o++;n%=we,a=n-we+o}if(r!==void 0&&(i=qn(10,o-a-1),l=u/i%10|0,c=t<0||d[f+1]!==void 0||u%i,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?a>0?u/qn(10,o-a):0:d[f-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return c?(i=Be(e),d.length=1,t=t-i-1,d[0]=qn(10,(we-t%we)%we),e.e=ho(-t/we)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=f,i=1,f--):(d.length=f+1,i=qn(10,we-n),d[f]=a>0?(u/qn(10,o-a)%qn(10,a)|0)*i:0),c)for(;;)if(f==0){(d[0]+=i)==qe&&(d[0]=1,++e.e);break}else{if(d[f]+=i,d[f]!=qe)break;d[f--]=0,i=1}for(n=d.length;d[--n]===0;)d.pop();if(Oe&&(e.e>lu||e.e<-lu))throw Error(mg+Be(e));return e}function EN(e,t){var r,n,a,i,o,l,c,u,f,d,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),Oe?me(t,p):t;if(c=e.d,d=t.d,n=t.e,u=e.e,c=c.slice(),o=u-n,o){for(f=o<0,f?(r=c,o=-o,l=d.length):(r=d,n=u,l=c.length),a=Math.max(Math.ceil(p/we),l)+2,o>a&&(o=a,r.length=1),r.reverse(),a=o;a--;)r.push(0);r.reverse()}else{for(a=c.length,l=d.length,f=a<l,f&&(l=a),a=0;a<l;a++)if(c[a]!=d[a]){f=c[a]<d[a];break}o=0}for(f&&(r=c,c=d,d=r,t.s=-t.s),l=c.length,a=d.length-l;a>0;--a)c[l++]=0;for(a=d.length;a>o;){if(c[--a]<d[a]){for(i=a;i&&c[--i]===0;)c[i]=qe-1;--c[i],c[a]+=qe}c[a]-=d[a]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,Oe?me(t,p):t):new h(0)}function xa(e,t,r){var n,a=Be(e),i=gr(e.d),o=i.length;return t?(r&&(n=r-o)>0?i=i.charAt(0)+"."+i.slice(1)+sn(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+sn(-a-1)+i,r&&(n=r-o)>0&&(i+=sn(n))):a>=o?(i+=sn(a+1-o),r&&(n=r-a-1)>0&&(i=i+"."+sn(n))):((n=a+1)<o&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-o)>0&&(a+1===o&&(i+="."),i+=sn(n))),e.s<0?"-"+i:i}function sb(e,t){if(e.length>t)return e.length=t,!0}function CN(e){var t,r,n;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(ca+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return ob(o,i.toString())}else if(typeof i!="string")throw Error(ca+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,p7.test(i))ob(o,i);else throw Error(ca+i)}if(a.prototype=Y,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=CN,a.config=a.set=m7,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return a.config(e),a}function m7(e){if(!e||typeof e!="object")throw Error(Jt+"Object expected");var t,r,n,a=["precision",1,fo,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((n=e[r=a[t]])!==void 0)if(ho(n)===n&&n>=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(ca+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(ca+r+": "+n);return this}var vg=CN(h7);Tt=new vg(1);const he=vg;function v7(e){return b7(e)||x7(e)||y7(e)||g7()}function g7(){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 y7(e,t){if(e){if(typeof e=="string")return Ep(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ep(e,t)}}function x7(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function b7(e){if(Array.isArray(e))return Ep(e)}function Ep(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var j7=function(t){return t},TN={},MN=function(t){return t===TN},lb=function(t){return function r(){return arguments.length===0||arguments.length===1&&MN(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},w7=function e(t,r){return t===1?r:lb(function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var o=a.filter(function(l){return l!==TN}).length;return o>=t?r.apply(void 0,a):e(t-o,lb(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var f=a.map(function(d){return MN(d)?c.shift():d});return r.apply(void 0,v7(f).concat(c))}))})},Cd=function(t){return w7(t.length,t)},Cp=function(t,r){for(var n=[],a=t;a<r;++a)n[a-t]=a;return n},S7=Cd(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),_7=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return j7;var a=r.reverse(),i=a[0],o=a.slice(1);return function(){return o.reduce(function(l,c){return c(l)},i.apply(void 0,arguments))}},Tp=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},IN=function(t){var r=null,n=null;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return r&&i.every(function(l,c){return l===r[c]})||(r=i,n=t.apply(void 0,i)),n}};function N7(e){var t;return e===0?t=1:t=Math.floor(new he(e).abs().log(10).toNumber())+1,t}function O7(e,t,r){for(var n=new he(e),a=0,i=[];n.lt(t)&&a<1e5;)i.push(n.toNumber()),n=n.add(r),a++;return i}var k7=Cd(function(e,t,r){var n=+e,a=+t;return n+r*(a-n)}),P7=Cd(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),A7=Cd(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const Td={rangeStep:O7,getDigitCount:N7,interpolateNumber:k7,uninterpolateNumber:P7,uninterpolateTruncation:A7};function Mp(e){return C7(e)||E7(e)||LN(e)||$7()}function $7(){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 E7(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function C7(e){if(Array.isArray(e))return Ip(e)}function Ms(e,t){return I7(e)||M7(e,t)||LN(e,t)||T7()}function T7(){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 LN(e,t){if(e){if(typeof e=="string")return Ip(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ip(e,t)}}function Ip(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function M7(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),l;!(n=(l=o.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(c){a=!0,i=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(a)throw i}}return r}}function I7(e){if(Array.isArray(e))return e}function DN(e){var t=Ms(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function RN(e,t,r){if(e.lte(0))return new he(0);var n=Td.getDigitCount(e.toNumber()),a=new he(10).pow(n),i=e.div(a),o=n!==1?.05:.1,l=new he(Math.ceil(i.div(o).toNumber())).add(r).mul(o),c=l.mul(a);return t?c:new he(Math.ceil(c))}function L7(e,t,r){var n=1,a=new he(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new he(10).pow(Td.getDigitCount(e)-1),a=new he(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new he(Math.floor(e)))}else e===0?a=new he(Math.floor((t-1)/2)):r||(a=new he(Math.floor(e)));var o=Math.floor((t-1)/2),l=_7(S7(function(c){return a.add(new he(c-o).mul(n)).toNumber()}),Cp);return l(0,t)}function BN(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new he(0),tickMin:new he(0),tickMax:new he(0)};var i=RN(new he(t).sub(e).div(r-1),n,a),o;e<=0&&t>=0?o=new he(0):(o=new he(e).add(t).div(2),o=o.sub(new he(o).mod(i)));var l=Math.ceil(o.sub(e).div(i).toNumber()),c=Math.ceil(new he(t).sub(o).div(i).toNumber()),u=l+c+1;return u>r?BN(e,t,r,n,a+1):(u<r&&(c=t>0?c+(r-u):c,l=t>0?l:l+(r-u)),{step:i,tickMin:o.sub(new he(l).mul(i)),tickMax:o.add(new he(c).mul(i))})}function D7(e){var t=Ms(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),l=DN([r,n]),c=Ms(l,2),u=c[0],f=c[1];if(u===-1/0||f===1/0){var d=f===1/0?[u].concat(Mp(Cp(0,a-1).map(function(){return 1/0}))):[].concat(Mp(Cp(0,a-1).map(function(){return-1/0})),[f]);return r>n?Tp(d):d}if(u===f)return L7(u,a,i);var h=BN(u,f,o,i),p=h.step,g=h.tickMin,b=h.tickMax,x=Td.rangeStep(g,b.add(new he(.1).mul(p)),p);return r>n?Tp(x):x}function R7(e,t){var r=Ms(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=DN([n,a]),l=Ms(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[n,a];if(c===u)return[c];var f=Math.max(t,2),d=RN(new he(u).sub(c).div(f-1),i,0),h=[].concat(Mp(Td.rangeStep(new he(c),new he(u).sub(new he(.99).mul(d)),d)),[u]);return n>a?Tp(h):h}var B7=IN(D7),F7=IN(R7),z7="Invariant failed";function ba(e,t){throw new Error(z7)}var W7=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Ci(e){"@babel/helpers - typeof";return Ci=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},Ci(e)}function cu(){return cu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cu.apply(this,arguments)}function U7(e,t){return G7(e)||V7(e,t)||K7(e,t)||H7()}function H7(){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 K7(e,t){if(e){if(typeof e=="string")return cb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cb(e,t)}}function cb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function V7(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function G7(e){if(Array.isArray(e))return e}function Y7(e,t){if(e==null)return{};var r=q7(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function q7(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function X7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q7(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,WN(n.key),n)}}function Z7(e,t,r){return t&&Q7(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function J7(e,t,r){return t=uu(t),eW(e,FN()?Reflect.construct(t,r||[],uu(e).constructor):t.apply(e,r))}function eW(e,t){if(t&&(Ci(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tW(e)}function tW(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FN(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FN=function(){return!!e})()}function uu(e){return uu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},uu(e)}function rW(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lp(e,t)}function Lp(e,t){return Lp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Lp(e,t)}function zN(e,t,r){return t=WN(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WN(e){var t=nW(e,"string");return Ci(t)=="symbol"?t:t+""}function nW(e,t){if(Ci(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ci(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Md=function(e){function t(){return X7(this,t),J7(this,t,arguments)}return rW(t,e),Z7(t,[{key:"render",value:function(){var n=this.props,a=n.offset,i=n.layout,o=n.width,l=n.dataKey,c=n.data,u=n.dataPointFormatter,f=n.xAxis,d=n.yAxis,h=Y7(n,W7),p=X(h,!1);this.props.direction==="x"&&f.type!=="number"&&ba();var g=c.map(function(b){var x=u(b,l),y=x.x,v=x.y,m=x.value,S=x.errorVal;if(!S)return null;var j=[],w,N;if(Array.isArray(S)){var _=U7(S,2);w=_[0],N=_[1]}else w=N=S;if(i==="vertical"){var k=f.scale,A=v+a,T=A+o,C=A-o,D=k(m-w),P=k(m+N);j.push({x1:P,y1:T,x2:P,y2:C}),j.push({x1:D,y1:A,x2:P,y2:A}),j.push({x1:D,y1:T,x2:D,y2:C})}else if(i==="horizontal"){var M=d.scale,$=y+a,I=$-o,L=$+o,B=M(m-w),F=M(m+N);j.push({x1:I,y1:F,x2:L,y2:F}),j.push({x1:$,y1:B,x2:$,y2:F}),j.push({x1:I,y1:B,x2:L,y2:B})}return E.createElement(ae,cu({className:"recharts-errorBar",key:"bar-".concat(j.map(function(K){return"".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))},p),j.map(function(K){return E.createElement("line",cu({},K,{key:"line-".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))}))});return E.createElement(ae,{className:"recharts-errorBars"},g)}}])}(E.Component);zN(Md,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});zN(Md,"displayName","ErrorBar");function Is(e){"@babel/helpers - typeof";return Is=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},Is(e)}function ub(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Wn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ub(Object(r),!0).forEach(function(n){aW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ub(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aW(e,t,r){return t=iW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iW(e){var t=oW(e,"string");return Is(t)=="symbol"?t:t+""}function oW(e,t){if(Is(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Is(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var UN=function(t){var r=t.children,n=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=Ct(r,di);if(!o)return null;var l=di.defaultProps,c=l!==void 0?Wn(Wn({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:i==="children"?u=(n||[]).reduce(function(f,d){var h=d.item,p=d.props,g=p.sectors||p.data||[];return f.concat(g.map(function(b){return{type:o.props.iconType||h.props.legendType,value:b.name,color:b.fill,payload:b}}))},[]):u=(n||[]).map(function(f){var d=f.item,h=d.type.defaultProps,p=h!==void 0?Wn(Wn({},h),d.props):{},g=p.dataKey,b=p.name,x=p.legendType,y=p.hide;return{inactive:y,dataKey:g,type:c.iconType||x||"square",color:gg(d),value:b||g,payload:p}}),Wn(Wn(Wn({},c),di.getWithHeight(o,a)),{},{payload:u,item:o})};function Ls(e){"@babel/helpers - typeof";return Ls=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},Ls(e)}function db(e){return uW(e)||cW(e)||lW(e)||sW()}function sW(){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 lW(e,t){if(e){if(typeof e=="string")return Dp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dp(e,t)}}function cW(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uW(e){if(Array.isArray(e))return Dp(e)}function Dp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Te(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fb(Object(r),!0).forEach(function(n){hi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hi(e,t,r){return t=dW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dW(e){var t=fW(e,"string");return Ls(t)=="symbol"?t:t+""}function fW(e,t){if(Ls(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ls(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ke(e,t,r){return J(e)||J(t)?r:Ge(t)?Lt(e,t,r):Z(t)?t(e):r}function Zo(e,t,r,n){var a=c7(e,function(l){return Ke(l,t)});if(r==="number"){var i=a.filter(function(l){return W(l)||parseFloat(l)});return i.length?[Ed(i),pn(i)]:[1/0,-1/0]}var o=n?a.filter(function(l){return!J(l)}):a;return o.map(function(l){return Ge(l)||l instanceof Date?l:""})}var hW=function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,u=0;u<l;u++){var f=u>0?a[u-1].coordinate:a[l-1].coordinate,d=a[u].coordinate,h=u>=l-1?a[0].coordinate:a[u+1].coordinate,p=void 0;if(ft(d-f)!==ft(h-d)){var g=[];if(ft(h-d)===ft(c[1]-c[0])){p=h;var b=d+c[1]-c[0];g[0]=Math.min(b,(b+f)/2),g[1]=Math.max(b,(b+f)/2)}else{p=f;var x=h+c[1]-c[0];g[0]=Math.min(d,(x+d)/2),g[1]=Math.max(d,(x+d)/2)}var y=[Math.min(d,(p+d)/2),Math.max(d,(p+d)/2)];if(t>y[0]&&t<=y[1]||t>=g[0]&&t<=g[1]){o=a[u].index;break}}else{var v=Math.min(f,h),m=Math.max(f,h);if(t>(v+d)/2&&t<=(m+d)/2){o=a[u].index;break}}}else for(var S=0;S<l;S++)if(S===0&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S>0&&S<l-1&&t>(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===l-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},gg=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Te(Te({},t.type.defaultProps),t.props):t.props,o=i.stroke,l=i.fill,c;switch(a){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},pW=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},l=Object.keys(i),c=0,u=l.length;c<u;c++)for(var f=i[l[c]].stackGroups,d=Object.keys(f),h=0,p=d.length;h<p;h++){var g=f[d[h]],b=g.items,x=g.cateAxisId,y=b.filter(function(N){return Br(N.type).indexOf("Bar")>=0});if(y&&y.length){var v=y[0].type.defaultProps,m=v!==void 0?Te(Te({},v),y[0].props):y[0].props,S=m.barSize,j=m[x];o[j]||(o[j]=[]);var w=J(S)?r:S;o[j].push({item:y[0],stackList:y.slice(1),barSize:J(w)?void 0:ht(w,n,0)})}}return o},mW=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=ht(r,a,0,!0),f,d=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=a/c,g=o.reduce(function(S,j){return S+j.barSize||0},0);g+=(c-1)*u,g>=a&&(g-=(c-1)*u,u=0),g>=a&&p>0&&(h=!0,p*=.9,g=c*p);var b=(a-g)/2>>0,x={offset:b-u,size:0};f=o.reduce(function(S,j){var w={item:j.item,position:{offset:x.offset+x.size+u,size:h?p:j.barSize}},N=[].concat(db(S),[w]);return x=N[N.length-1].position,j.stackList&&j.stackList.length&&j.stackList.forEach(function(_){N.push({item:_,position:x})}),N},d)}else{var y=ht(n,a,0,!0);a-2*y-(c-1)*u<=0&&(u=0);var v=(a-2*y-(c-1)*u)/c;v>1&&(v>>=0);var m=l===+l?Math.min(v,l):v;f=o.reduce(function(S,j,w){var N=[].concat(db(S),[{item:j.item,position:{offset:y+(v+u)*w+(v-m)/2,size:m}}]);return j.stackList&&j.stackList.length&&j.stackList.forEach(function(_){N.push({item:_,position:N[N.length-1].position})}),N},d)}return f},vW=function(t,r,n,a){var i=n.children,o=n.width,l=n.margin,c=o-(l.left||0)-(l.right||0),u=UN({children:i,legendWidth:c});if(u){var f=a||{},d=f.width,h=f.height,p=u.align,g=u.verticalAlign,b=u.layout;if((b==="vertical"||b==="horizontal"&&g==="middle")&&p!=="center"&&W(t[p]))return Te(Te({},t),{},hi({},p,t[p]+(d||0)));if((b==="horizontal"||b==="vertical"&&p==="center")&&g!=="middle"&&W(t[g]))return Te(Te({},t),{},hi({},g,t[g]+(h||0)))}return t},gW=function(t,r,n){return J(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},HN=function(t,r,n,a,i){var o=r.props.children,l=Xt(o,Md).filter(function(u){return gW(a,i,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var d=Ke(f,n);if(J(d))return u;var h=Array.isArray(d)?[Ed(d),pn(d)]:[d,d],p=c.reduce(function(g,b){var x=Ke(f,b,0),y=h[0]-Math.abs(Array.isArray(x)?x[0]:x),v=h[1]+Math.abs(Array.isArray(x)?x[1]:x);return[Math.min(y,g[0]),Math.max(v,g[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},yW=function(t,r,n,a,i){var o=r.map(function(l){return HN(t,l,n,i,a)}).filter(function(l){return!J(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},KN=function(t,r,n,a,i){var o=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&HN(t,c,u,a)||Zo(t,u,n,i)});if(n==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var f=0,d=u.length;f<d;f++)l[u[f]]||(l[u[f]]=!0,c.push(u[f]));return c},[])},VN=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},GN=function(t,r,n,a){if(a)return t.map(function(c){return c.coordinate});var i,o,l=t.map(function(c){return c.coordinate===r&&(i=!0),c.coordinate===n&&(o=!0),c.coordinate});return i||l.push(r),o||l.push(n),l},Dr=function(t,r,n){if(!t)return null;var a=t.scale,i=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,u=(r||n)&&o==="category"&&a.bandwidth?a.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?ft(l[0]-l[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(d){var h=i?i.indexOf(d):d;return{coordinate:a(h)+u,value:d,offset:u}});return f.filter(function(d){return!io(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,h){return{coordinate:a(d)+u,value:d,index:h,offset:u}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(d){return{coordinate:a(d)+u,value:d,offset:u}}):a.domain().map(function(d,h){return{coordinate:a(d)+u,value:i?i[d]:d,index:h,offset:u}})},Hf=new WeakMap,Ul=function(t,r){if(typeof r!="function")return t;Hf.has(t)||Hf.set(t,new WeakMap);var n=Hf.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},YN=function(t,r,n){var a=t.scale,i=t.type,o=t.layout,l=t.axisType;if(a==="auto")return o==="radial"&&l==="radiusAxis"?{scale:Ps(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:au(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Qo(),realScaleType:"point"}:i==="category"?{scale:Ps(),realScaleType:"band"}:{scale:au(),realScaleType:"linear"};if(ma(a)){var c="scale".concat(gd(a));return{scale:(ib[c]||Qo)(),realScaleType:ib[c]?c:"point"}}return Z(a)?{scale:a}:{scale:Qo(),realScaleType:"point"}},hb=1e-4,qN=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-hb,o=Math.max(a[0],a[1])+hb,l=t(r[0]),c=t(r[n-1]);(l<i||l>o||c<i||c>o)&&t.domain([r[0],r[n-1]])}},xW=function(t,r){if(!t)return null;for(var n=0,a=t.length;n<a;n++)if(t[n].item===r)return t[n].position;return null},bW=function(t,r){if(!r||r.length!==2||!W(r[0])||!W(r[1]))return t;var n=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]),i=[t[0],t[1]];return(!W(t[0])||t[0]<n)&&(i[0]=n),(!W(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<n&&(i[1]=n),i},jW=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,o=0,l=0;l<r;++l){var c=io(t[l][n][1])?t[l][n][0]:t[l][n][1];c>=0?(t[l][n][0]=i,t[l][n][1]=i+c,i=t[l][n][1]):(t[l][n][0]=o,t[l][n][1]=o+c,o=t[l][n][1])}},wW=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,o=0;o<r;++o){var l=io(t[o][n][1])?t[o][n][0]:t[o][n][1];l>=0?(t[o][n][0]=i,t[o][n][1]=i+l,i=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},SW={sign:jW,expand:W5,none:wi,silhouette:U5,wiggle:H5,positive:wW},_W=function(t,r,n){var a=r.map(function(l){return l.props.dataKey}),i=SW[n],o=z5().keys(a).value(function(l,c){return+Ke(l,c,0)}).order(lp).offset(i);return o(t)},NW=function(t,r,n,a,i,o){if(!t)return null;var l=o?r.reverse():r,c={},u=l.reduce(function(d,h){var p,g=(p=h.type)!==null&&p!==void 0&&p.defaultProps?Te(Te({},h.type.defaultProps),h.props):h.props,b=g.stackId,x=g.hide;if(x)return d;var y=g[n],v=d[y]||{hasStack:!1,stackGroups:{}};if(Ge(b)){var m=v.stackGroups[b]||{numericAxisId:n,cateAxisId:a,items:[]};m.items.push(h),v.hasStack=!0,v.stackGroups[b]=m}else v.stackGroups[oo("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[h]};return Te(Te({},d),{},hi({},y,v))},c),f={};return Object.keys(u).reduce(function(d,h){var p=u[h];if(p.hasStack){var g={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(b,x){var y=p.stackGroups[x];return Te(Te({},b),{},hi({},x,{numericAxisId:n,cateAxisId:a,items:y.items,stackedData:_W(t,y.items,i)}))},g)}return Te(Te({},d),{},hi({},h,p))},f)},XN=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,o=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=B7(u,i,l);return t.domain([Ed(f),pn(f)]),{niceTicks:f}}if(i&&a==="number"){var d=t.domain(),h=F7(d,i,l);return{niceTicks:h}}return null};function pb(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!J(a[t.dataKey])){var l=Lc(r,"value",a[t.dataKey]);if(l)return l.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var c=Ke(a,J(o)?t.dataKey:o);return J(c)?null:t.scale(c)}var mb=function(t){var r=t.axis,n=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,l=t.index;if(r.type==="category")return n[l]?n[l].coordinate+a:null;var c=Ke(o,r.dataKey,r.domain[l]);return J(c)?null:r.scale(c)-i/2+a},OW=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},kW=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Te(Te({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Ge(i)){var o=r[i];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},PW=function(t){return t.reduce(function(r,n){return[Ed(n.concat([r[0]]).filter(W)),pn(n.concat([r[1]]).filter(W))]},[1/0,-1/0])},QN=function(t,r,n){return Object.keys(t).reduce(function(a,i){var o=t[i],l=o.stackedData,c=l.reduce(function(u,f){var d=PW(f.slice(r,n+1));return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);return[Math.min(c[0],a[0]),Math.max(c[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},vb=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,gb=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Rp=function(t,r,n){if(Z(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(W(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(vb.test(t[0])){var i=+vb.exec(t[0])[1];a[0]=r[0]-i}else Z(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(W(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(gb.test(t[1])){var o=+gb.exec(t[1])[1];a[1]=r[1]+o}else Z(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},du=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=Kv(r,function(d){return d.coordinate}),o=1/0,l=1,c=i.length;l<c;l++){var u=i[l],f=i[l-1];o=Math.min((u.coordinate||0)-(f.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},yb=function(t,r,n){return!t||!t.length||Ei(t,Lt(n,"type.defaultProps.domain"))?r:t},ZN=function(t,r){var n=t.type.defaultProps?Te(Te({},t.type.defaultProps),t.props):t.props,a=n.dataKey,i=n.name,o=n.unit,l=n.formatter,c=n.tooltipType,u=n.chartType,f=n.hide;return Te(Te({},X(t,!1)),{},{dataKey:a,unit:o,formatter:l,name:i||a,color:gg(t),value:Ke(r,a),type:c,payload:r,chartType:u,hide:f})};function Ds(e){"@babel/helpers - typeof";return Ds=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},Ds(e)}function xb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Er(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xb(Object(r),!0).forEach(function(n){JN(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function JN(e,t,r){return t=AW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AW(e){var t=$W(e,"string");return Ds(t)=="symbol"?t:t+""}function $W(e,t){if(Ds(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ds(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function EW(e,t){return IW(e)||MW(e,t)||TW(e,t)||CW()}function CW(){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 TW(e,t){if(e){if(typeof e=="string")return bb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bb(e,t)}}function bb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function MW(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function IW(e){if(Array.isArray(e))return e}var fu=Math.PI/180,LW=function(t){return t*180/Math.PI},xe=function(t,r,n,a){return{x:t+Math.cos(-fu*a)*n,y:r+Math.sin(-fu*a)*n}},eO=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},DW=function(t,r,n,a,i){var o=t.width,l=t.height,c=t.startAngle,u=t.endAngle,f=ht(t.cx,o,o/2),d=ht(t.cy,l,l/2),h=eO(o,l,n),p=ht(t.innerRadius,h,0),g=ht(t.outerRadius,h,h*.8),b=Object.keys(r);return b.reduce(function(x,y){var v=r[y],m=v.domain,S=v.reversed,j;if(J(v.range))a==="angleAxis"?j=[c,u]:a==="radiusAxis"&&(j=[p,g]),S&&(j=[j[1],j[0]]);else{j=v.range;var w=j,N=EW(w,2);c=N[0],u=N[1]}var _=YN(v,i),k=_.realScaleType,A=_.scale;A.domain(m).range(j),qN(A);var T=XN(A,Er(Er({},v),{},{realScaleType:k})),C=Er(Er(Er({},v),T),{},{range:j,radius:g,realScaleType:k,scale:A,cx:f,cy:d,innerRadius:p,outerRadius:g,startAngle:c,endAngle:u});return Er(Er({},x),{},JN({},y,C))},{})},RW=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-o,2))},BW=function(t,r){var n=t.x,a=t.y,i=r.cx,o=r.cy,l=RW({x:n,y:a},{x:i,y:o});if(l<=0)return{radius:l};var c=(n-i)/l,u=Math.acos(c);return a>o&&(u=2*Math.PI-u),{radius:l,angle:LW(u),angleInRadian:u}},FW=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(a,i);return{startAngle:r-o*360,endAngle:n-o*360}},zW=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),o=Math.floor(a/360),l=Math.min(i,o);return t+l*360},jb=function(t,r){var n=t.x,a=t.y,i=BW({x:n,y:a},r),o=i.radius,l=i.angle,c=r.innerRadius,u=r.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var f=FW(r),d=f.startAngle,h=f.endAngle,p=l,g;if(d<=h){for(;p>h;)p-=360;for(;p<d;)p+=360;g=p>=d&&p<=h}else{for(;p>d;)p-=360;for(;p<h;)p+=360;g=p>=h&&p<=d}return g?Er(Er({},r),{},{radius:o,angle:zW(p,r)}):null},tO=function(t){return!O.isValidElement(t)&&!Z(t)&&typeof t!="boolean"?t.className:""};function Rs(e){"@babel/helpers - typeof";return Rs=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},Rs(e)}var WW=["offset"];function UW(e){return GW(e)||VW(e)||KW(e)||HW()}function HW(){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 KW(e,t){if(e){if(typeof e=="string")return Bp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bp(e,t)}}function VW(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function GW(e){if(Array.isArray(e))return Bp(e)}function Bp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function YW(e,t){if(e==null)return{};var r=qW(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qW(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wb(Object(r),!0).forEach(function(n){XW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function XW(e,t,r){return t=QW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function QW(e){var t=ZW(e,"string");return Rs(t)=="symbol"?t:t+""}function ZW(e,t){if(Rs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Rs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bs(){return Bs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bs.apply(this,arguments)}var JW=function(t){var r=t.value,n=t.formatter,a=J(t.children)?r:t.children;return Z(n)?n(a):a},eU=function(t,r){var n=ft(r-t),a=Math.min(Math.abs(r-t),360);return n*a},tU=function(t,r,n){var a=t.position,i=t.viewBox,o=t.offset,l=t.className,c=i,u=c.cx,f=c.cy,d=c.innerRadius,h=c.outerRadius,p=c.startAngle,g=c.endAngle,b=c.clockWise,x=(d+h)/2,y=eU(p,g),v=y>=0?1:-1,m,S;a==="insideStart"?(m=p+v*o,S=b):a==="insideEnd"?(m=g-v*o,S=!b):a==="end"&&(m=g+v*o,S=b),S=y<=0?S:!S;var j=xe(u,f,x,m),w=xe(u,f,x,m+(S?1:-1)*359),N="M".concat(j.x,",").concat(j.y,`
+    A`).concat(x,",").concat(x,",0,1,").concat(S?0:1,`,
+    `).concat(w.x,",").concat(w.y),_=J(t.id)?oo("recharts-radial-line-"):t.id;return E.createElement("text",Bs({},n,{dominantBaseline:"central",className:te("recharts-radial-bar-label",l)}),E.createElement("defs",null,E.createElement("path",{id:_,d:N})),E.createElement("textPath",{xlinkHref:"#".concat(_)},r))},rU=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,o=i.cx,l=i.cy,c=i.innerRadius,u=i.outerRadius,f=i.startAngle,d=i.endAngle,h=(f+d)/2;if(a==="outside"){var p=xe(o,l,u+n,h),g=p.x,b=p.y;return{x:g,y:b,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var x=(c+u)/2,y=xe(o,l,x,h),v=y.x,m=y.y;return{x:v,y:m,textAnchor:"middle",verticalAnchor:"middle"}},nU=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,o=r,l=o.x,c=o.y,u=o.width,f=o.height,d=f>=0?1:-1,h=d*a,p=d>0?"end":"start",g=d>0?"start":"end",b=u>=0?1:-1,x=b*a,y=b>0?"end":"start",v=b>0?"start":"end";if(i==="top"){var m={x:l+u/2,y:c-d*a,textAnchor:"middle",verticalAnchor:p};return Ue(Ue({},m),n?{height:Math.max(c-n.y,0),width:u}:{})}if(i==="bottom"){var S={x:l+u/2,y:c+f+h,textAnchor:"middle",verticalAnchor:g};return Ue(Ue({},S),n?{height:Math.max(n.y+n.height-(c+f),0),width:u}:{})}if(i==="left"){var j={x:l-x,y:c+f/2,textAnchor:y,verticalAnchor:"middle"};return Ue(Ue({},j),n?{width:Math.max(j.x-n.x,0),height:f}:{})}if(i==="right"){var w={x:l+u+x,y:c+f/2,textAnchor:v,verticalAnchor:"middle"};return Ue(Ue({},w),n?{width:Math.max(n.x+n.width-w.x,0),height:f}:{})}var N=n?{width:u,height:f}:{};return i==="insideLeft"?Ue({x:l+x,y:c+f/2,textAnchor:v,verticalAnchor:"middle"},N):i==="insideRight"?Ue({x:l+u-x,y:c+f/2,textAnchor:y,verticalAnchor:"middle"},N):i==="insideTop"?Ue({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:g},N):i==="insideBottom"?Ue({x:l+u/2,y:c+f-h,textAnchor:"middle",verticalAnchor:p},N):i==="insideTopLeft"?Ue({x:l+x,y:c+h,textAnchor:v,verticalAnchor:g},N):i==="insideTopRight"?Ue({x:l+u-x,y:c+h,textAnchor:y,verticalAnchor:g},N):i==="insideBottomLeft"?Ue({x:l+x,y:c+f-h,textAnchor:v,verticalAnchor:p},N):i==="insideBottomRight"?Ue({x:l+u-x,y:c+f-h,textAnchor:y,verticalAnchor:p},N):to(i)&&(W(i.x)||ea(i.x))&&(W(i.y)||ea(i.y))?Ue({x:l+ht(i.x,u),y:c+ht(i.y,f),textAnchor:"end",verticalAnchor:"end"},N):Ue({x:l+u/2,y:c+f/2,textAnchor:"middle",verticalAnchor:"middle"},N)},aU=function(t){return"cx"in t&&W(t.cx)};function Qe(e){var t=e.offset,r=t===void 0?5:t,n=YW(e,WW),a=Ue({offset:r},n),i=a.viewBox,o=a.position,l=a.value,c=a.children,u=a.content,f=a.className,d=f===void 0?"":f,h=a.textBreakAll;if(!i||J(l)&&J(c)&&!O.isValidElement(u)&&!Z(u))return null;if(O.isValidElement(u))return O.cloneElement(u,a);var p;if(Z(u)){if(p=O.createElement(u,a),O.isValidElement(p))return p}else p=JW(a);var g=aU(i),b=X(a,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return tU(a,p,b);var x=g?rU(a):nU(a);return E.createElement(ya,Bs({className:te("recharts-label",d)},b,x,{breakAll:h}),p)}Qe.displayName="Label";var rO=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,f=t.outerRadius,d=t.x,h=t.y,p=t.top,g=t.left,b=t.width,x=t.height,y=t.clockWise,v=t.labelViewBox;if(v)return v;if(W(b)&&W(x)){if(W(d)&&W(h))return{x:d,y:h,width:b,height:x};if(W(p)&&W(g))return{x:p,y:g,width:b,height:x}}return W(d)&&W(h)?{x:d,y:h,width:0,height:0}:W(r)&&W(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:o||a||0,innerRadius:u||0,outerRadius:f||c||l||0,clockWise:y}:t.viewBox?t.viewBox:{}},iU=function(t,r){return t?t===!0?E.createElement(Qe,{key:"label-implicit",viewBox:r}):Ge(t)?E.createElement(Qe,{key:"label-implicit",viewBox:r,value:t}):O.isValidElement(t)?t.type===Qe?O.cloneElement(t,{key:"label-implicit",viewBox:r}):E.createElement(Qe,{key:"label-implicit",content:t,viewBox:r}):Z(t)?E.createElement(Qe,{key:"label-implicit",content:t,viewBox:r}):to(t)?E.createElement(Qe,Bs({viewBox:r},t,{key:"label-implicit"})):null:null},oU=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var a=t.children,i=rO(t),o=Xt(a,Qe).map(function(c,u){return O.cloneElement(c,{viewBox:r||i,key:"label-".concat(u)})});if(!n)return o;var l=iU(t.label,r||i);return[l].concat(UW(o))};Qe.parseViewBox=rO;Qe.renderCallByParent=oU;function sU(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var lU=sU;const cU=de(lU);function Fs(e){"@babel/helpers - typeof";return Fs=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},Fs(e)}var uU=["valueAccessor"],dU=["data","dataKey","clockWise","id","textBreakAll"];function fU(e){return vU(e)||mU(e)||pU(e)||hU()}function hU(){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 pU(e,t){if(e){if(typeof e=="string")return Fp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fp(e,t)}}function mU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vU(e){if(Array.isArray(e))return Fp(e)}function Fp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hu(){return hu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hu.apply(this,arguments)}function Sb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function _b(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Sb(Object(r),!0).forEach(function(n){gU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gU(e,t,r){return t=yU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yU(e){var t=xU(e,"string");return Fs(t)=="symbol"?t:t+""}function xU(e,t){if(Fs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nb(e,t){if(e==null)return{};var r=bU(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var jU=function(t){return Array.isArray(t.value)?cU(t.value):t.value};function zr(e){var t=e.valueAccessor,r=t===void 0?jU:t,n=Nb(e,uU),a=n.data,i=n.dataKey,o=n.clockWise,l=n.id,c=n.textBreakAll,u=Nb(n,dU);return!a||!a.length?null:E.createElement(ae,{className:"recharts-label-list"},a.map(function(f,d){var h=J(i)?r(f,d):Ke(f&&f.payload,i),p=J(l)?{}:{id:"".concat(l,"-").concat(d)};return E.createElement(Qe,hu({},X(f,!0),u,p,{parentViewBox:f.parentViewBox,value:h,textBreakAll:c,viewBox:Qe.parseViewBox(J(o)?f:_b(_b({},f),{},{clockWise:o})),key:"label-".concat(d),index:d}))}))}zr.displayName="LabelList";function wU(e,t){return e?e===!0?E.createElement(zr,{key:"labelList-implicit",data:t}):E.isValidElement(e)||Z(e)?E.createElement(zr,{key:"labelList-implicit",data:t,content:e}):to(e)?E.createElement(zr,hu({data:t},e,{key:"labelList-implicit"})):null:null}function SU(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,a=Xt(n,zr).map(function(o,l){return O.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!r)return a;var i=wU(e.label,t);return[i].concat(fU(a))}zr.renderCallByParent=SU;function zs(e){"@babel/helpers - typeof";return zs=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},zs(e)}function zp(){return zp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zp.apply(this,arguments)}function Ob(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function kb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ob(Object(r),!0).forEach(function(n){_U(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ob(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _U(e,t,r){return t=NU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function NU(e){var t=OU(e,"string");return zs(t)=="symbol"?t:t+""}function OU(e,t){if(zs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(zs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kU=function(t,r){var n=ft(r-t),a=Math.min(Math.abs(r-t),359.999);return n*a},Hl=function(t){var r=t.cx,n=t.cy,a=t.radius,i=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,f=c*(l?1:-1)+a,d=Math.asin(c/f)/fu,h=u?i:i+o*d,p=xe(r,n,f,h),g=xe(r,n,a,h),b=u?i-o*d:i,x=xe(r,n,f*Math.cos(d*fu),b);return{center:p,circleTangency:g,lineTangency:x,theta:d}},nO=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,l=t.endAngle,c=kU(o,l),u=o+c,f=xe(r,n,i,o),d=xe(r,n,i,u),h="M ".concat(f.x,",").concat(f.y,`
+    A `).concat(i,",").concat(i,`,0,
+    `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
+    `).concat(d.x,",").concat(d.y,`
+  `);if(a>0){var p=xe(r,n,a,o),g=xe(r,n,a,u);h+="L ".concat(g.x,",").concat(g.y,`
+            A `).concat(a,",").concat(a,`,0,
+            `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`,
+            `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},PU=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,d=ft(f-u),h=Hl({cx:r,cy:n,radius:i,angle:u,sign:d,cornerRadius:o,cornerIsExternal:c}),p=h.circleTangency,g=h.lineTangency,b=h.theta,x=Hl({cx:r,cy:n,radius:i,angle:f,sign:-d,cornerRadius:o,cornerIsExternal:c}),y=x.circleTangency,v=x.lineTangency,m=x.theta,S=c?Math.abs(u-f):Math.abs(u-f)-b-m;if(S<0)return l?"M ".concat(g.x,",").concat(g.y,`
+        a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
+        a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
+      `):nO({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:u,endAngle:f});var j="M ".concat(g.x,",").concat(g.y,`
+    A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(p.x,",").concat(p.y,`
+    A`).concat(i,",").concat(i,",0,").concat(+(S>180),",").concat(+(d<0),",").concat(y.x,",").concat(y.y,`
+    A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(v.x,",").concat(v.y,`
+  `);if(a>0){var w=Hl({cx:r,cy:n,radius:a,angle:u,sign:d,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),N=w.circleTangency,_=w.lineTangency,k=w.theta,A=Hl({cx:r,cy:n,radius:a,angle:f,sign:-d,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),T=A.circleTangency,C=A.lineTangency,D=A.theta,P=c?Math.abs(u-f):Math.abs(u-f)-k-D;if(P<0&&o===0)return"".concat(j,"L").concat(r,",").concat(n,"Z");j+="L".concat(C.x,",").concat(C.y,`
+      A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(T.x,",").concat(T.y,`
+      A`).concat(a,",").concat(a,",0,").concat(+(P>180),",").concat(+(d>0),",").concat(N.x,",").concat(N.y,`
+      A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(_.x,",").concat(_.y,"Z")}else j+="L".concat(r,",").concat(n,"Z");return j},AU={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},aO=function(t){var r=kb(kb({},AU),t),n=r.cx,a=r.cy,i=r.innerRadius,o=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,d=r.endAngle,h=r.className;if(o<i||f===d)return null;var p=te("recharts-sector",h),g=o-i,b=ht(l,g,0,!0),x;return b>0&&Math.abs(f-d)<360?x=PU({cx:n,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(b,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:f,endAngle:d}):x=nO({cx:n,cy:a,innerRadius:i,outerRadius:o,startAngle:f,endAngle:d}),E.createElement("path",zp({},X(r,!0),{className:p,d:x,role:"img"}))};function Ws(e){"@babel/helpers - typeof";return Ws=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},Ws(e)}function Wp(){return Wp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wp.apply(this,arguments)}function Pb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ab(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pb(Object(r),!0).forEach(function(n){$U(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $U(e,t,r){return t=EU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EU(e){var t=CU(e,"string");return Ws(t)=="symbol"?t:t+""}function CU(e,t){if(Ws(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ws(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $b={curveBasisClosed:$5,curveBasisOpen:E5,curveBasis:A5,curveBumpX:m5,curveBumpY:v5,curveLinearClosed:C5,curveLinear:xd,curveMonotoneX:T5,curveMonotoneY:M5,curveNatural:I5,curveStep:L5,curveStepAfter:R5,curveStepBefore:D5},Kl=function(t){return t.x===+t.x&&t.y===+t.y},Ao=function(t){return t.x},$o=function(t){return t.y},TU=function(t,r){if(Z(t))return t;var n="curve".concat(gd(t));return(n==="curveMonotone"||n==="curveBump")&&r?$b["".concat(n).concat(r==="vertical"?"Y":"X")]:$b[n]||xd},MU=function(t){var r=t.type,n=r===void 0?"linear":r,a=t.points,i=a===void 0?[]:a,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,f=TU(n,l),d=u?i.filter(function(b){return Kl(b)}):i,h;if(Array.isArray(o)){var p=u?o.filter(function(b){return Kl(b)}):o,g=d.map(function(b,x){return Ab(Ab({},b),{},{base:p[x]})});return l==="vertical"?h=Il().y($o).x1(Ao).x0(function(b){return b.base.x}):h=Il().x(Ao).y1($o).y0(function(b){return b.base.y}),h.defined(Kl).curve(f),h(g)}return l==="vertical"&&W(o)?h=Il().y($o).x1(Ao).x0(o):W(o)?h=Il().x(Ao).y1($o).y0(o):h=JS().x(Ao).y($o),h.defined(Kl).curve(f),h(d)},pi=function(t){var r=t.className,n=t.points,a=t.path,i=t.pathRef;if((!n||!n.length)&&!a)return null;var o=n&&n.length?MU(t):a;return O.createElement("path",Wp({},X(t,!1),Dc(t),{className:te("recharts-curve",r),d:o,ref:i}))},iO={exports:{}},IU="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",LU=IU,DU=LU;function oO(){}function sO(){}sO.resetWarningCache=oO;var RU=function(){function e(n,a,i,o,l,c){if(c!==DU){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:sO,resetWarningCache:oO};return r.PropTypes=r,r};iO.exports=RU();var BU=iO.exports;const ce=de(BU),{getOwnPropertyNames:FU,getOwnPropertySymbols:zU}=Object,{hasOwnProperty:WU}=Object.prototype;function Kf(e,t){return function(n,a,i){return e(n,a,i)&&t(n,a,i)}}function Vl(e){return function(r,n,a){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,a);const{cache:i}=a,o=i.get(r),l=i.get(n);if(o&&l)return o===n&&l===r;i.set(r,n),i.set(n,r);const c=e(r,n,a);return i.delete(r),i.delete(n),c}}function UU(e){return e!=null?e[Symbol.toStringTag]:void 0}function Eb(e){return FU(e).concat(zU(e))}const HU=Object.hasOwn||((e,t)=>WU.call(e,t));function Aa(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const KU="__v",VU="__o",GU="_owner",{getOwnPropertyDescriptor:Cb,keys:Tb}=Object;function YU(e,t){return e.byteLength===t.byteLength&&pu(new Uint8Array(e),new Uint8Array(t))}function qU(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function XU(e,t){return e.byteLength===t.byteLength&&pu(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function QU(e,t){return Aa(e.getTime(),t.getTime())}function ZU(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function JU(e,t){return e===t}function Mb(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.entries();let o,l,c=0;for(;(o=i.next())&&!o.done;){const u=t.entries();let f=!1,d=0;for(;(l=u.next())&&!l.done;){if(a[d]){d++;continue}const h=o.value,p=l.value;if(r.equals(h[0],p[0],c,d,e,t,r)&&r.equals(h[1],p[1],h[0],p[0],e,t,r)){f=a[d]=!0;break}d++}if(!f)return!1;c++}return!0}const eH=Aa;function tH(e,t,r){const n=Tb(e);let a=n.length;if(Tb(t).length!==a)return!1;for(;a-- >0;)if(!lO(e,t,r,n[a]))return!1;return!0}function Eo(e,t,r){const n=Eb(e);let a=n.length;if(Eb(t).length!==a)return!1;let i,o,l;for(;a-- >0;)if(i=n[a],!lO(e,t,r,i)||(o=Cb(e,i),l=Cb(t,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function rH(e,t){return Aa(e.valueOf(),t.valueOf())}function nH(e,t){return e.source===t.source&&e.flags===t.flags}function Ib(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.values();let o,l;for(;(o=i.next())&&!o.done;){const c=t.values();let u=!1,f=0;for(;(l=c.next())&&!l.done;){if(!a[f]&&r.equals(o.value,l.value,o.value,l.value,e,t,r)){u=a[f]=!0;break}f++}if(!u)return!1}return!0}function pu(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function aH(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 lO(e,t,r,n){return(n===GU||n===VU||n===KU)&&(e.$$typeof||t.$$typeof)?!0:HU(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const iH="[object ArrayBuffer]",oH="[object Arguments]",sH="[object Boolean]",lH="[object DataView]",cH="[object Date]",uH="[object Error]",dH="[object Map]",fH="[object Number]",hH="[object Object]",pH="[object RegExp]",mH="[object Set]",vH="[object String]",gH={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},yH="[object URL]",xH=Object.prototype.toString;function bH({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:u,areRegExpsEqual:f,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:g}){return function(x,y,v){if(x===y)return!0;if(x==null||y==null)return!1;const m=typeof x;if(m!==typeof y)return!1;if(m!=="object")return m==="number"?l(x,y,v):m==="function"?i(x,y,v):!1;const S=x.constructor;if(S!==y.constructor)return!1;if(S===Object)return c(x,y,v);if(Array.isArray(x))return t(x,y,v);if(S===Date)return n(x,y,v);if(S===RegExp)return f(x,y,v);if(S===Map)return o(x,y,v);if(S===Set)return d(x,y,v);const j=xH.call(x);if(j===cH)return n(x,y,v);if(j===pH)return f(x,y,v);if(j===dH)return o(x,y,v);if(j===mH)return d(x,y,v);if(j===hH)return typeof x.then!="function"&&typeof y.then!="function"&&c(x,y,v);if(j===yH)return p(x,y,v);if(j===uH)return a(x,y,v);if(j===oH)return c(x,y,v);if(gH[j])return h(x,y,v);if(j===iH)return e(x,y,v);if(j===lH)return r(x,y,v);if(j===sH||j===fH||j===vH)return u(x,y,v);if(g){let w=g[j];if(!w){const N=UU(x);N&&(w=g[N])}if(w)return w(x,y,v)}return!1}}function jH({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:YU,areArraysEqual:r?Eo:qU,areDataViewsEqual:XU,areDatesEqual:QU,areErrorsEqual:ZU,areFunctionsEqual:JU,areMapsEqual:r?Kf(Mb,Eo):Mb,areNumbersEqual:eH,areObjectsEqual:r?Eo:tH,arePrimitiveWrappersEqual:rH,areRegExpsEqual:nH,areSetsEqual:r?Kf(Ib,Eo):Ib,areTypedArraysEqual:r?Kf(pu,Eo):pu,areUrlsEqual:aH,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const a=Vl(n.areArraysEqual),i=Vl(n.areMapsEqual),o=Vl(n.areObjectsEqual),l=Vl(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:l})}return n}function wH(e){return function(t,r,n,a,i,o,l){return e(t,r,l)}}function SH({circular:e,comparator:t,createState:r,equals:n,strict:a}){if(r)return function(l,c){const{cache:u=e?new WeakMap:void 0,meta:f}=r();return t(l,c,{cache:u,equals:n,meta:f,strict:a})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:n,meta:void 0,strict:a})};const i={cache:void 0,equals:n,meta:void 0,strict:a};return function(l,c){return t(l,c,i)}}const _H=Ln();Ln({strict:!0});Ln({circular:!0});Ln({circular:!0,strict:!0});Ln({createInternalComparator:()=>Aa});Ln({strict:!0,createInternalComparator:()=>Aa});Ln({circular:!0,createInternalComparator:()=>Aa});Ln({circular:!0,createInternalComparator:()=>Aa,strict:!0});function Ln(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:a=!1}=e,i=jH(e),o=bH(i),l=r?r(o):wH(o);return SH({circular:t,comparator:o,createState:n,equals:l,strict:a})}function NH(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Lb(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):NH(a)};requestAnimationFrame(n)}function Up(e){"@babel/helpers - typeof";return Up=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},Up(e)}function OH(e){return $H(e)||AH(e)||PH(e)||kH()}function kH(){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 PH(e,t){if(e){if(typeof e=="string")return Db(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Db(e,t)}}function Db(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function AH(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $H(e){if(Array.isArray(e))return e}function EH(){var e={},t=function(){return null},r=!1,n=function a(i){if(!r){if(Array.isArray(i)){if(!i.length)return;var o=i,l=OH(o),c=l[0],u=l.slice(1);if(typeof c=="number"){Lb(a.bind(null,u),c);return}a(c),Lb(a.bind(null,u));return}Up(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){r=!0},start:function(i){r=!1,n(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function Us(e){"@babel/helpers - typeof";return Us=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},Us(e)}function Rb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Bb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rb(Object(r),!0).forEach(function(n){cO(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cO(e,t,r){return t=CH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CH(e){var t=TH(e,"string");return Us(t)==="symbol"?t:String(t)}function TH(e,t){if(Us(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Us(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MH=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,a){return n.filter(function(i){return a.includes(i)})})},IH=function(t){return t},LH=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},Jo=function(t,r){return Object.keys(r).reduce(function(n,a){return Bb(Bb({},n),{},cO({},a,t(a,r[a])))},{})},Fb=function(t,r,n){return t.map(function(a){return"".concat(LH(a)," ").concat(r,"ms ").concat(n)}).join(",")};function DH(e,t){return FH(e)||BH(e,t)||uO(e,t)||RH()}function RH(){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 BH(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function FH(e){if(Array.isArray(e))return e}function zH(e){return HH(e)||UH(e)||uO(e)||WH()}function WH(){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 uO(e,t){if(e){if(typeof e=="string")return Hp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hp(e,t)}}function UH(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function HH(e){if(Array.isArray(e))return Hp(e)}function Hp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var mu=1e-4,dO=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},fO=function(t,r){return t.map(function(n,a){return n*Math.pow(r,a)}).reduce(function(n,a){return n+a})},zb=function(t,r){return function(n){var a=dO(t,r);return fO(a,n)}},KH=function(t,r){return function(n){var a=dO(t,r),i=[].concat(zH(a.map(function(o,l){return o*l}).slice(1)),[0]);return fO(i,n)}},Wb=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0],i=r[1],o=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":a=0,i=0,o=1,l=1;break;case"ease":a=.25,i=.1,o=.25,l=1;break;case"ease-in":a=.42,i=0,o=1,l=1;break;case"ease-out":a=.42,i=0,o=.58,l=1;break;case"ease-in-out":a=0,i=0,o=.58,l=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(x){return parseFloat(x)}),f=DH(u,4);a=f[0],i=f[1],o=f[2],l=f[3]}}}var d=zb(a,o),h=zb(i,l),p=KH(a,o),g=function(y){return y>1?1:y<0?0:y},b=function(y){for(var v=y>1?1:y,m=v,S=0;S<8;++S){var j=d(m)-v,w=p(m);if(Math.abs(j-v)<mu||w<mu)return h(m);m=g(m-j/w)}return h(m)};return b.isStepper=!1,b},VH=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,o=t.dt,l=o===void 0?17:o,c=function(f,d,h){var p=-(f-d)*n,g=h*i,b=h+(p-g)*l/1e3,x=h*l/1e3+f;return Math.abs(x-d)<mu&&Math.abs(b)<mu?[d,0]:[x,b]};return c.isStepper=!0,c.dt=l,c},GH=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Wb(a);case"spring":return VH();default:if(a.split("(")[0]==="cubic-bezier")return Wb(a)}return typeof a=="function"?a:null};function Hs(e){"@babel/helpers - typeof";return Hs=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},Hs(e)}function Ub(e){return XH(e)||qH(e)||hO(e)||YH()}function YH(){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 qH(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function XH(e){if(Array.isArray(e))return Vp(e)}function Hb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Hb(Object(r),!0).forEach(function(n){Kp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Kp(e,t,r){return t=QH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function QH(e){var t=ZH(e,"string");return Hs(t)==="symbol"?t:String(t)}function ZH(e,t){if(Hs(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Hs(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function JH(e,t){return rK(e)||tK(e,t)||hO(e,t)||eK()}function eK(){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 hO(e,t){if(e){if(typeof e=="string")return Vp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vp(e,t)}}function Vp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function tK(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function rK(e){if(Array.isArray(e))return e}var vu=function(t,r,n){return t+(r-t)*n},Gp=function(t){var r=t.from,n=t.to;return r!==n},nK=function e(t,r,n){var a=Jo(function(i,o){if(Gp(o)){var l=t(o.from,o.to,o.velocity),c=JH(l,2),u=c[0],f=c[1];return tt(tt({},o),{},{from:u,velocity:f})}return o},r);return n<1?Jo(function(i,o){return Gp(o)?tt(tt({},o),{},{velocity:vu(o.velocity,a[i].velocity,n),from:vu(o.from,a[i].from,n)}):o},r):e(t,a,n-1)};const aK=function(e,t,r,n,a){var i=MH(e,t),o=i.reduce(function(x,y){return tt(tt({},x),{},Kp({},y,[e[y],t[y]]))},{}),l=i.reduce(function(x,y){return tt(tt({},x),{},Kp({},y,{from:e[y],velocity:0,to:t[y]}))},{}),c=-1,u,f,d=function(){return null},h=function(){return Jo(function(y,v){return v.from},l)},p=function(){return!Object.values(l).filter(Gp).length},g=function(y){u||(u=y);var v=y-u,m=v/r.dt;l=nK(r,l,m),a(tt(tt(tt({},e),t),h())),u=y,p()||(c=requestAnimationFrame(d))},b=function(y){f||(f=y);var v=(y-f)/n,m=Jo(function(j,w){return vu.apply(void 0,Ub(w).concat([r(v)]))},o);if(a(tt(tt(tt({},e),t),m)),v<1)c=requestAnimationFrame(d);else{var S=Jo(function(j,w){return vu.apply(void 0,Ub(w).concat([r(1)]))},o);a(tt(tt(tt({},e),t),S))}};return d=r.isStepper?g:b,function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(c)}}};function Ti(e){"@babel/helpers - typeof";return Ti=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},Ti(e)}var iK=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function oK(e,t){if(e==null)return{};var r=sK(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function sK(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function Vf(e){return dK(e)||uK(e)||cK(e)||lK()}function lK(){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 cK(e,t){if(e){if(typeof e=="string")return Yp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yp(e,t)}}function uK(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dK(e){if(Array.isArray(e))return Yp(e)}function Yp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Kb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function nr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Kb(Object(r),!0).forEach(function(n){Ro(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ro(e,t,r){return t=pO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hK(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pO(n.key),n)}}function pK(e,t,r){return t&&hK(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pO(e){var t=mK(e,"string");return Ti(t)==="symbol"?t:String(t)}function mK(e,t){if(Ti(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ti(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vK(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qp(e,t)}function qp(e,t){return qp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},qp(e,t)}function gK(e){var t=yK();return function(){var n=gu(e),a;if(t){var i=gu(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return Xp(this,a)}}function Xp(e,t){if(t&&(Ti(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qp(e)}function Qp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yK(){if(typeof Reflect>"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 gu(e){return gu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gu(e)}var _r=function(e){vK(r,e);var t=gK(r);function r(n,a){var i;fK(this,r),i=t.call(this,n,a);var o=i.props,l=o.isActive,c=o.attributeName,u=o.from,f=o.to,d=o.steps,h=o.children,p=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(Qp(i)),i.changeStyle=i.changeStyle.bind(Qp(i)),!l||p<=0)return i.state={style:{}},typeof h=="function"&&(i.state={style:f}),Xp(i);if(d&&d.length)i.state={style:d[0].style};else if(u){if(typeof h=="function")return i.state={style:u},Xp(i);i.state={style:c?Ro({},c,u):u}}else i.state={style:{}};return i}return pK(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,l=i.canBegin,c=i.attributeName,u=i.shouldReAnimate,f=i.to,d=i.from,h=this.state.style;if(l){if(!o){var p={style:c?Ro({},c,f):f};this.state&&h&&(c&&h[c]!==f||!c&&h!==f)&&this.setState(p);return}if(!(_H(a.to,f)&&a.canBegin&&a.isActive)){var g=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var b=g||u?d:a.to;if(this.state&&h){var x={style:c?Ro({},c,b):b};(c&&h[c]!==b||!c&&h!==b)&&this.setState(x)}this.runAnimation(nr(nr({},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,o=a.from,l=a.to,c=a.duration,u=a.easing,f=a.begin,d=a.onAnimationEnd,h=a.onAnimationStart,p=aK(o,l,GH(u),c,this.changeStyle),g=function(){i.stopJSAnimation=p()};this.manager.start([h,f,g,c,d])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,l=a.begin,c=a.onAnimationStart,u=o[0],f=u.style,d=u.duration,h=d===void 0?0:d,p=function(b,x,y){if(y===0)return b;var v=x.duration,m=x.easing,S=m===void 0?"ease":m,j=x.style,w=x.properties,N=x.onAnimationEnd,_=y>0?o[y-1]:x,k=w||Object.keys(j);if(typeof S=="function"||S==="spring")return[].concat(Vf(b),[i.runJSAnimation.bind(i,{from:_.style,to:j,duration:v,easing:S}),v]);var A=Fb(k,v,S),T=nr(nr(nr({},_.style),j),{},{transition:A});return[].concat(Vf(b),[T,v,N]).filter(IH)};return this.manager.start([c].concat(Vf(o.reduce(p,[f,Math.max(h,l)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=EH());var i=a.begin,o=a.duration,l=a.attributeName,c=a.to,u=a.easing,f=a.onAnimationStart,d=a.onAnimationEnd,h=a.steps,p=a.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(a);return}if(h.length>1){this.runStepAnimation(a);return}var b=l?Ro({},l,c):c,x=Fb(Object.keys(b),o,u);g.start([f,i,nr(nr({},b),{},{transition:x}),o,d])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var l=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var c=oK(a,iK),u=O.Children.count(i),f=this.state.style;if(typeof i=="function")return i(f);if(!l||u===0||o<=0)return i;var d=function(p){var g=p.props,b=g.style,x=b===void 0?{}:b,y=g.className,v=O.cloneElement(p,nr(nr({},c),{},{style:nr(nr({},x),f),className:y}));return v};return u===1?d(O.Children.only(i)):E.createElement("div",null,O.Children.map(i,function(h){return d(h)}))}}]),r}(O.PureComponent);_r.displayName="Animate";_r.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};_r.propTypes={from:ce.oneOfType([ce.object,ce.string]),to:ce.oneOfType([ce.object,ce.string]),attributeName:ce.string,duration:ce.number,begin:ce.number,easing:ce.oneOfType([ce.string,ce.func]),steps:ce.arrayOf(ce.shape({duration:ce.number.isRequired,style:ce.object.isRequired,easing:ce.oneOfType([ce.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),ce.func]),properties:ce.arrayOf("string"),onAnimationEnd:ce.func})),children:ce.oneOfType([ce.node,ce.func]),isActive:ce.bool,canBegin:ce.bool,onAnimationEnd:ce.func,shouldReAnimate:ce.bool,onAnimationStart:ce.func,onAnimationReStart:ce.func};function Ks(e){"@babel/helpers - typeof";return Ks=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},Ks(e)}function yu(){return yu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yu.apply(this,arguments)}function xK(e,t){return SK(e)||wK(e,t)||jK(e,t)||bK()}function bK(){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 jK(e,t){if(e){if(typeof e=="string")return Vb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vb(e,t)}}function Vb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function wK(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function SK(e){if(Array.isArray(e))return e}function Gb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Yb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gb(Object(r),!0).forEach(function(n){_K(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _K(e,t,r){return t=NK(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function NK(e){var t=OK(e,"string");return Ks(t)=="symbol"?t:t+""}function OK(e,t){if(Ks(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ks(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qb=function(t,r,n,a,i){var o=Math.min(Math.abs(n)/2,Math.abs(a)/2),l=a>=0?1:-1,c=n>=0?1:-1,u=a>=0&&n>=0||a<0&&n<0?1:0,f;if(o>0&&i instanceof Array){for(var d=[0,0,0,0],h=0,p=4;h<p;h++)d[h]=i[h]>o?o:i[h];f="M".concat(t,",").concat(r+l*d[0]),d[0]>0&&(f+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(u,",").concat(t+c*d[0],",").concat(r)),f+="L ".concat(t+n-c*d[1],",").concat(r),d[1]>0&&(f+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(u,`,
+        `).concat(t+n,",").concat(r+l*d[1])),f+="L ".concat(t+n,",").concat(r+a-l*d[2]),d[2]>0&&(f+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(u,`,
+        `).concat(t+n-c*d[2],",").concat(r+a)),f+="L ".concat(t+c*d[3],",").concat(r+a),d[3]>0&&(f+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(u,`,
+        `).concat(t,",").concat(r+a-l*d[3])),f+="Z"}else if(o>0&&i===+i&&i>0){var g=Math.min(o,i);f="M ".concat(t,",").concat(r+l*g,`
+            A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+c*g,",").concat(r,`
+            L `).concat(t+n-c*g,",").concat(r,`
+            A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+n,",").concat(r+l*g,`
+            L `).concat(t+n,",").concat(r+a-l*g,`
+            A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+n-c*g,",").concat(r+a,`
+            L `).concat(t+c*g,",").concat(r+a,`
+            A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t,",").concat(r+a-l*g," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return f},kK=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,o=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(i,i+l),f=Math.max(i,i+l),d=Math.min(o,o+c),h=Math.max(o,o+c);return n>=u&&n<=f&&a>=d&&a<=h}return!1},PK={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},yg=function(t){var r=Yb(Yb({},PK),t),n=O.useRef(),a=O.useState(-1),i=xK(a,2),o=i[0],l=i[1];O.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&l(S)}catch{}},[]);var c=r.x,u=r.y,f=r.width,d=r.height,h=r.radius,p=r.className,g=r.animationEasing,b=r.animationDuration,x=r.animationBegin,y=r.isAnimationActive,v=r.isUpdateAnimationActive;if(c!==+c||u!==+u||f!==+f||d!==+d||f===0||d===0)return null;var m=te("recharts-rectangle",p);return v?E.createElement(_r,{canBegin:o>0,from:{width:f,height:d,x:c,y:u},to:{width:f,height:d,x:c,y:u},duration:b,animationEasing:g,isActive:v},function(S){var j=S.width,w=S.height,N=S.x,_=S.y;return E.createElement(_r,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:b,isActive:y,easing:g},E.createElement("path",yu({},X(r,!0),{className:m,d:qb(N,_,j,w,h),ref:n})))}):E.createElement("path",yu({},X(r,!0),{className:m,d:qb(c,u,f,d,h)}))},AK=["points","className","baseLinePoints","connectNulls"];function ei(){return ei=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ei.apply(this,arguments)}function $K(e,t){if(e==null)return{};var r=EK(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function EK(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Xb(e){return IK(e)||MK(e)||TK(e)||CK()}function CK(){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 TK(e,t){if(e){if(typeof e=="string")return Zp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zp(e,t)}}function MK(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function IK(e){if(Array.isArray(e))return Zp(e)}function Zp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Qb=function(t){return t&&t.x===+t.x&&t.y===+t.y},LK=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){Qb(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),Qb(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},es=function(t,r){var n=LK(t);r&&(n=[n.reduce(function(i,o){return[].concat(Xb(i),Xb(o))},[])]);var a=n.map(function(i){return i.reduce(function(o,l,c){return"".concat(o).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return n.length===1?"".concat(a,"Z"):a},DK=function(t,r,n){var a=es(t,n);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(es(r.reverse(),n).slice(1))},RK=function(t){var r=t.points,n=t.className,a=t.baseLinePoints,i=t.connectNulls,o=$K(t,AK);if(!r||!r.length)return null;var l=te("recharts-polygon",n);if(a&&a.length){var c=o.stroke&&o.stroke!=="none",u=DK(r,a,i);return E.createElement("g",{className:l},E.createElement("path",ei({},X(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),c?E.createElement("path",ei({},X(o,!0),{fill:"none",d:es(r,i)})):null,c?E.createElement("path",ei({},X(o,!0),{fill:"none",d:es(a,i)})):null)}var f=es(r,i);return E.createElement("path",ei({},X(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:l,d:f}))};function Jp(){return Jp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jp.apply(this,arguments)}var Id=function(t){var r=t.cx,n=t.cy,a=t.r,i=t.className,o=te("recharts-dot",i);return r===+r&&n===+n&&a===+a?O.createElement("circle",Jp({},X(t,!1),Dc(t),{className:o,cx:r,cy:n,r:a})):null};function Vs(e){"@babel/helpers - typeof";return Vs=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},Vs(e)}var BK=["x","y","top","left","width","height","className"];function em(){return em=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},em.apply(this,arguments)}function Zb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function FK(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Zb(Object(r),!0).forEach(function(n){zK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zK(e,t,r){return t=WK(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WK(e){var t=UK(e,"string");return Vs(t)=="symbol"?t:t+""}function UK(e,t){if(Vs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Vs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function HK(e,t){if(e==null)return{};var r=KK(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function KK(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var VK=function(t,r,n,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(r,"h").concat(n)},GK=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,f=t.width,d=f===void 0?0:f,h=t.height,p=h===void 0?0:h,g=t.className,b=HK(t,BK),x=FK({x:n,y:i,top:l,left:u,width:d,height:p},b);return!W(n)||!W(i)||!W(d)||!W(p)||!W(l)||!W(u)?null:E.createElement("path",em({},X(x,!0),{className:te("recharts-cross",g),d:VK(n,i,d,p,l,u)}))},YK=$d,qK=ON,XK=Or;function QK(e,t){return e&&e.length?YK(e,XK(t),qK):void 0}var ZK=QK;const JK=de(ZK);var eV=$d,tV=Or,rV=kN;function nV(e,t){return e&&e.length?eV(e,tV(t),rV):void 0}var aV=nV;const iV=de(aV);var oV=["cx","cy","angle","ticks","axisLine"],sV=["ticks","tick","angle","tickFormatter","stroke"];function Mi(e){"@babel/helpers - typeof";return Mi=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},Mi(e)}function ts(){return ts=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ts.apply(this,arguments)}function Jb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Un(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Jb(Object(r),!0).forEach(function(n){Ld(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function e1(e,t){if(e==null)return{};var r=lV(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lV(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function cV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,vO(n.key),n)}}function uV(e,t,r){return t&&t1(e.prototype,t),r&&t1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function dV(e,t,r){return t=xu(t),fV(e,mO()?Reflect.construct(t,r||[],xu(e).constructor):t.apply(e,r))}function fV(e,t){if(t&&(Mi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hV(e)}function hV(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mO=function(){return!!e})()}function xu(e){return xu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xu(e)}function pV(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tm(e,t)}function tm(e,t){return tm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},tm(e,t)}function Ld(e,t,r){return t=vO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vO(e){var t=mV(e,"string");return Mi(t)=="symbol"?t:t+""}function mV(e,t){if(Mi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Mi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dd=function(e){function t(){return cV(this,t),dV(this,t,arguments)}return pV(t,e),uV(t,[{key:"getTickValueCoord",value:function(n){var a=n.coordinate,i=this.props,o=i.angle,l=i.cx,c=i.cy;return xe(l,c,a,o)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,a;switch(n){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var n=this.props,a=n.cx,i=n.cy,o=n.angle,l=n.ticks,c=JK(l,function(f){return f.coordinate||0}),u=iV(l,function(f){return f.coordinate||0});return{cx:a,cy:i,startAngle:o,endAngle:o,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,o=n.angle,l=n.ticks,c=n.axisLine,u=e1(n,oV),f=l.reduce(function(g,b){return[Math.min(g[0],b.coordinate),Math.max(g[1],b.coordinate)]},[1/0,-1/0]),d=xe(a,i,f[0],o),h=xe(a,i,f[1],o),p=Un(Un(Un({},X(u,!1)),{},{fill:"none"},X(c,!1)),{},{x1:d.x,y1:d.y,x2:h.x,y2:h.y});return E.createElement("line",ts({className:"recharts-polar-radius-axis-line"},p))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,o=a.tick,l=a.angle,c=a.tickFormatter,u=a.stroke,f=e1(a,sV),d=this.getTickTextAnchor(),h=X(f,!1),p=X(o,!1),g=i.map(function(b,x){var y=n.getTickValueCoord(b),v=Un(Un(Un(Un({textAnchor:d,transform:"rotate(".concat(90-l,", ").concat(y.x,", ").concat(y.y,")")},h),{},{stroke:"none",fill:u},p),{},{index:x},y),{},{payload:b});return E.createElement(ae,ts({className:te("recharts-polar-radius-axis-tick",tO(o)),key:"tick-".concat(b.coordinate)},va(n.props,b,x)),t.renderTickItem(o,v,c?c(b.value,x):b.value))});return E.createElement(ae,{className:"recharts-polar-radius-axis-ticks"},g)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.axisLine,o=n.tick;return!a||!a.length?null:E.createElement(ae,{className:te("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),Qe.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(n,a,i){var o;return E.isValidElement(n)?o=E.cloneElement(n,a):Z(n)?o=n(a):o=E.createElement(ya,ts({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])}(O.PureComponent);Ld(Dd,"displayName","PolarRadiusAxis");Ld(Dd,"axisType","radiusAxis");Ld(Dd,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Ii(e){"@babel/helpers - typeof";return Ii=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},Ii(e)}function Xn(){return Xn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xn.apply(this,arguments)}function r1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Hn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?r1(Object(r),!0).forEach(function(n){Rd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):r1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,yO(n.key),n)}}function gV(e,t,r){return t&&n1(e.prototype,t),r&&n1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function yV(e,t,r){return t=bu(t),xV(e,gO()?Reflect.construct(t,r||[],bu(e).constructor):t.apply(e,r))}function xV(e,t){if(t&&(Ii(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bV(e)}function bV(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gO=function(){return!!e})()}function bu(e){return bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},bu(e)}function jV(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rm(e,t)}function rm(e,t){return rm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},rm(e,t)}function Rd(e,t,r){return t=yO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yO(e){var t=wV(e,"string");return Ii(t)=="symbol"?t:t+""}function wV(e,t){if(Ii(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ii(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var SV=Math.PI/180,a1=1e-5,Bd=function(e){function t(){return vV(this,t),yV(this,t,arguments)}return jV(t,e),gV(t,[{key:"getTickLineCoord",value:function(n){var a=this.props,i=a.cx,o=a.cy,l=a.radius,c=a.orientation,u=a.tickSize,f=u||8,d=xe(i,o,l,n.coordinate),h=xe(i,o,l+(c==="inner"?-1:1)*f,n.coordinate);return{x1:d.x,y1:d.y,x2:h.x,y2:h.y}}},{key:"getTickTextAnchor",value:function(n){var a=this.props.orientation,i=Math.cos(-n.coordinate*SV),o;return i>a1?o=a==="outer"?"start":"end":i<-a1?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,o=n.radius,l=n.axisLine,c=n.axisLineType,u=Hn(Hn({},X(this.props,!1)),{},{fill:"none"},X(l,!1));if(c==="circle")return E.createElement(Id,Xn({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:o}));var f=this.props.ticks,d=f.map(function(h){return xe(a,i,o,h.coordinate)});return E.createElement(RK,Xn({className:"recharts-polar-angle-axis-line"},u,{points:d}))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,o=a.tick,l=a.tickLine,c=a.tickFormatter,u=a.stroke,f=X(this.props,!1),d=X(o,!1),h=Hn(Hn({},f),{},{fill:"none"},X(l,!1)),p=i.map(function(g,b){var x=n.getTickLineCoord(g),y=n.getTickTextAnchor(g),v=Hn(Hn(Hn({textAnchor:y},f),{},{stroke:"none",fill:u},d),{},{index:b,payload:g,x:x.x2,y:x.y2});return E.createElement(ae,Xn({className:te("recharts-polar-angle-axis-tick",tO(o)),key:"tick-".concat(g.coordinate)},va(n.props,g,b)),l&&E.createElement("line",Xn({className:"recharts-polar-angle-axis-tick-line"},h,x)),o&&t.renderTickItem(o,v,c?c(g.value,b):g.value))});return E.createElement(ae,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.radius,o=n.axisLine;return i<=0||!a||!a.length?null:E.createElement(ae,{className:te("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,a,i){var o;return E.isValidElement(n)?o=E.cloneElement(n,a):Z(n)?o=n(a):o=E.createElement(ya,Xn({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])}(O.PureComponent);Rd(Bd,"displayName","PolarAngleAxis");Rd(Bd,"axisType","angleAxis");Rd(Bd,"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 _V=S_,NV=_V(Object.getPrototypeOf,Object),OV=NV,kV=Xr,PV=OV,AV=Qr,$V="[object Object]",EV=Function.prototype,CV=Object.prototype,xO=EV.toString,TV=CV.hasOwnProperty,MV=xO.call(Object);function IV(e){if(!AV(e)||kV(e)!=$V)return!1;var t=PV(e);if(t===null)return!0;var r=TV.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&xO.call(r)==MV}var LV=IV;const DV=de(LV);var RV=Xr,BV=Qr,FV="[object Boolean]";function zV(e){return e===!0||e===!1||BV(e)&&RV(e)==FV}var WV=zV;const UV=de(WV);function Gs(e){"@babel/helpers - typeof";return Gs=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},Gs(e)}function ju(){return ju=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ju.apply(this,arguments)}function HV(e,t){return YV(e)||GV(e,t)||VV(e,t)||KV()}function KV(){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 VV(e,t){if(e){if(typeof e=="string")return i1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i1(e,t)}}function i1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function GV(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function YV(e){if(Array.isArray(e))return e}function o1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function s1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?o1(Object(r),!0).forEach(function(n){qV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qV(e,t,r){return t=XV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XV(e){var t=QV(e,"string");return Gs(t)=="symbol"?t:t+""}function QV(e,t){if(Gs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Gs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var l1=function(t,r,n,a,i){var o=n-a,l;return l="M ".concat(t,",").concat(r),l+="L ".concat(t+n,",").concat(r),l+="L ".concat(t+n-o/2,",").concat(r+i),l+="L ".concat(t+n-o/2-a,",").concat(r+i),l+="L ".concat(t,",").concat(r," Z"),l},ZV={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},JV=function(t){var r=s1(s1({},ZV),t),n=O.useRef(),a=O.useState(-1),i=HV(a,2),o=i[0],l=i[1];O.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var m=n.current.getTotalLength();m&&l(m)}catch{}},[]);var c=r.x,u=r.y,f=r.upperWidth,d=r.lowerWidth,h=r.height,p=r.className,g=r.animationEasing,b=r.animationDuration,x=r.animationBegin,y=r.isUpdateAnimationActive;if(c!==+c||u!==+u||f!==+f||d!==+d||h!==+h||f===0&&d===0||h===0)return null;var v=te("recharts-trapezoid",p);return y?E.createElement(_r,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:f,lowerWidth:d,height:h,x:c,y:u},duration:b,animationEasing:g,isActive:y},function(m){var S=m.upperWidth,j=m.lowerWidth,w=m.height,N=m.x,_=m.y;return E.createElement(_r,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:b,easing:g},E.createElement("path",ju({},X(r,!0),{className:v,d:l1(N,_,S,j,w),ref:n})))}):E.createElement("g",null,E.createElement("path",ju({},X(r,!0),{className:v,d:l1(c,u,f,d,h)})))},eG=["option","shapeType","propTransformer","activeClassName","isActive"];function Ys(e){"@babel/helpers - typeof";return Ys=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},Ys(e)}function tG(e,t){if(e==null)return{};var r=rG(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rG(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function c1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function wu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?c1(Object(r),!0).forEach(function(n){nG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nG(e,t,r){return t=aG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aG(e){var t=iG(e,"string");return Ys(t)=="symbol"?t:t+""}function iG(e,t){if(Ys(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ys(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oG(e,t){return wu(wu({},t),e)}function sG(e,t){return e==="symbols"}function u1(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return E.createElement(yg,r);case"trapezoid":return E.createElement(JV,r);case"sector":return E.createElement(aO,r);case"symbols":if(sG(t))return E.createElement(Dv,r);break;default:return null}}function lG(e){return O.isValidElement(e)?e.props:e}function bO(e){var t=e.option,r=e.shapeType,n=e.propTransformer,a=n===void 0?oG:n,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,l=e.isActive,c=tG(e,eG),u;if(O.isValidElement(t))u=O.cloneElement(t,wu(wu({},c),lG(t)));else if(Z(t))u=t(c);else if(DV(t)&&!UV(t)){var f=a(t,c);u=E.createElement(u1,{shapeType:r,elementProps:f})}else{var d=c;u=E.createElement(u1,{shapeType:r,elementProps:d})}return l?E.createElement(ae,{className:o},u):u}function Fd(e,t){return t!=null&&"trapezoids"in e.props}function zd(e,t){return t!=null&&"sectors"in e.props}function qs(e,t){return t!=null&&"points"in e.props}function cG(e,t){var r,n,a=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,i=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return a&&i}function uG(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function dG(e,t){var r=e.x===t.x,n=e.y===t.y,a=e.z===t.z;return r&&n&&a}function fG(e,t){var r;return Fd(e,t)?r=cG:zd(e,t)?r=uG:qs(e,t)&&(r=dG),r}function hG(e,t){var r;return Fd(e,t)?r="trapezoids":zd(e,t)?r="sectors":qs(e,t)&&(r="points"),r}function pG(e,t){if(Fd(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(zd(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return qs(e,t)?t.payload:{}}function mG(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,a=hG(r,t),i=pG(r,t),o=n.filter(function(c,u){var f=Ei(i,c),d=r.props[a].filter(function(g){var b=fG(r,t);return b(g,t)}),h=r.props[a].indexOf(d[d.length-1]),p=u===h;return f&&p}),l=n.indexOf(o[o.length-1]);return l}var uc;function Li(e){"@babel/helpers - typeof";return Li=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},Li(e)}function ti(){return ti=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ti.apply(this,arguments)}function d1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ve(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?d1(Object(r),!0).forEach(function(n){Vt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wO(n.key),n)}}function gG(e,t,r){return t&&f1(e.prototype,t),r&&f1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function yG(e,t,r){return t=Su(t),xG(e,jO()?Reflect.construct(t,r||[],Su(e).constructor):t.apply(e,r))}function xG(e,t){if(t&&(Li(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bG(e)}function bG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jO=function(){return!!e})()}function Su(e){return Su=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Su(e)}function jG(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nm(e,t)}function nm(e,t){return nm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},nm(e,t)}function Vt(e,t,r){return t=wO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wO(e){var t=wG(e,"string");return Li(t)=="symbol"?t:t+""}function wG(e,t){if(Li(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Li(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var kr=function(e){function t(r){var n;return vG(this,t),n=yG(this,t,[r]),Vt(n,"pieRef",null),Vt(n,"sectorRefs",[]),Vt(n,"id",oo("recharts-pie-")),Vt(n,"handleAnimationEnd",function(){var a=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),Z(a)&&a()}),Vt(n,"handleAnimationStart",function(){var a=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),Z(a)&&a()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return jG(t,e),gG(t,[{key:"isActiveIndex",value:function(n){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(n)!==-1:n===a}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,l=i.labelLine,c=i.dataKey,u=i.valueKey,f=X(this.props,!1),d=X(o,!1),h=X(l,!1),p=o&&o.offsetRadius||20,g=n.map(function(b,x){var y=(b.startAngle+b.endAngle)/2,v=xe(b.cx,b.cy,b.outerRadius+p,y),m=ve(ve(ve(ve({},f),b),{},{stroke:"none"},d),{},{index:x,textAnchor:t.getTextAnchor(v.x,b.cx)},v),S=ve(ve(ve(ve({},f),b),{},{fill:"none",stroke:b.fill},h),{},{index:x,points:[xe(b.cx,b.cy,b.outerRadius,y),v]}),j=c;return J(c)&&J(u)?j="value":J(c)&&(j=u),E.createElement(ae,{key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(x)},l&&t.renderLabelLineItem(l,S,"line"),t.renderLabelItem(o,m,Ke(b,j)))});return E.createElement(ae,{className:"recharts-pie-labels"},g)}},{key:"renderSectorsStatically",value:function(n){var a=this,i=this.props,o=i.activeShape,l=i.blendStroke,c=i.inactiveShape;return n.map(function(u,f){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&n.length!==1)return null;var d=a.isActiveIndex(f),h=c&&a.hasActiveIndex()?c:null,p=d?o:h,g=ve(ve({},u),{},{stroke:l?u.fill:u.stroke,tabIndex:-1});return E.createElement(ae,ti({ref:function(x){x&&!a.sectorRefs.includes(x)&&a.sectorRefs.push(x)},tabIndex:-1,className:"recharts-pie-sector"},va(a.props,u,f),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(f)}),E.createElement(bO,ti({option:p,isActive:d,shapeType:"sector"},g)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,a=this.props,i=a.sectors,o=a.isAnimationActive,l=a.animationBegin,c=a.animationDuration,u=a.animationEasing,f=a.animationId,d=this.state,h=d.prevSectors,p=d.prevIsAnimationActive;return E.createElement(_r,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(f,"-").concat(p),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(g){var b=g.t,x=[],y=i&&i[0],v=y.startAngle;return i.forEach(function(m,S){var j=h&&h[S],w=S>0?Lt(m,"paddingAngle",0):0;if(j){var N=St(j.endAngle-j.startAngle,m.endAngle-m.startAngle),_=ve(ve({},m),{},{startAngle:v+w,endAngle:v+N(b)+w});x.push(_),v=_.endAngle}else{var k=m.endAngle,A=m.startAngle,T=St(0,k-A),C=T(b),D=ve(ve({},m),{},{startAngle:v+w,endAngle:v+C+w});x.push(D),v=D.endAngle}}),E.createElement(ae,null,n.renderSectorsStatically(x))})}},{key:"attachKeyboardHandlers",value:function(n){var a=this;n.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[l].focus(),a.setState({sectorToFocus:l});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,a=n.sectors,i=n.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!Ei(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,a=this.props,i=a.hide,o=a.sectors,l=a.className,c=a.label,u=a.cx,f=a.cy,d=a.innerRadius,h=a.outerRadius,p=a.isAnimationActive,g=this.state.isAnimationFinished;if(i||!o||!o.length||!W(u)||!W(f)||!W(d)||!W(h))return null;var b=te("recharts-pie",l);return E.createElement(ae,{tabIndex:this.props.rootTabIndex,className:b,ref:function(y){n.pieRef=y}},this.renderSectors(),c&&this.renderLabels(o),Qe.renderCallByParent(this.props,null,!1),(!p||g)&&zr.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return a.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:n.sectors!==a.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,a){return n>a?"start":n<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,a,i){if(E.isValidElement(n))return E.cloneElement(n,a);if(Z(n))return n(a);var o=te("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return E.createElement(pi,ti({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(n,a,i){if(E.isValidElement(n))return E.cloneElement(n,a);var o=i;if(Z(n)&&(o=n(a),E.isValidElement(o)))return o;var l=te("recharts-pie-label-text",typeof n!="boolean"&&!Z(n)?n.className:"");return E.createElement(ya,ti({},a,{alignmentBaseline:"middle",className:l}),o)}}])}(O.PureComponent);uc=kr;Vt(kr,"displayName","Pie");Vt(kr,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!Oa.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Vt(kr,"parseDeltaAngle",function(e,t){var r=ft(t-e),n=Math.min(Math.abs(t-e),360);return r*n});Vt(kr,"getRealPieData",function(e){var t=e.data,r=e.children,n=X(e,!1),a=Xt(r,ga);return t&&t.length?t.map(function(i,o){return ve(ve(ve({payload:i},n),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return ve(ve({},n),i.props)}):[]});Vt(kr,"parseCoordinateOfPie",function(e,t){var r=t.top,n=t.left,a=t.width,i=t.height,o=eO(a,i),l=n+ht(e.cx,a,a/2),c=r+ht(e.cy,i,i/2),u=ht(e.innerRadius,o,0),f=ht(e.outerRadius,o,o*.8),d=e.maxRadius||Math.sqrt(a*a+i*i)/2;return{cx:l,cy:c,innerRadius:u,outerRadius:f,maxRadius:d}});Vt(kr,"getComposedData",function(e){var t=e.item,r=e.offset,n=t.type.defaultProps!==void 0?ve(ve({},t.type.defaultProps),t.props):t.props,a=uc.getRealPieData(n);if(!a||!a.length)return null;var i=n.cornerRadius,o=n.startAngle,l=n.endAngle,c=n.paddingAngle,u=n.dataKey,f=n.nameKey,d=n.valueKey,h=n.tooltipType,p=Math.abs(n.minAngle),g=uc.parseCoordinateOfPie(n,r),b=uc.parseDeltaAngle(o,l),x=Math.abs(b),y=u;J(u)&&J(d)?(dr(!1,`Use "dataKey" to specify the value of pie,
+      the props "valueKey" will be deprecated in 1.1.0`),y="value"):J(u)&&(dr(!1,`Use "dataKey" to specify the value of pie,
+      the props "valueKey" will be deprecated in 1.1.0`),y=d);var v=a.filter(function(_){return Ke(_,y,0)!==0}).length,m=(x>=360?v:v-1)*c,S=x-v*p-m,j=a.reduce(function(_,k){var A=Ke(k,y,0);return _+(W(A)?A:0)},0),w;if(j>0){var N;w=a.map(function(_,k){var A=Ke(_,y,0),T=Ke(_,f,k),C=(W(A)?A:0)/j,D;k?D=N.endAngle+ft(b)*c*(A!==0?1:0):D=o;var P=D+ft(b)*((A!==0?p:0)+C*S),M=(D+P)/2,$=(g.innerRadius+g.outerRadius)/2,I=[{name:T,value:A,payload:_,dataKey:y,type:h}],L=xe(g.cx,g.cy,$,M);return N=ve(ve(ve({percent:C,cornerRadius:i,name:T,tooltipPayload:I,midAngle:M,middleRadius:$,tooltipPosition:L},_),g),{},{value:Ke(_,y),startAngle:D,endAngle:P,payload:_,paddingAngle:ft(b)*c}),N})}return ve(ve({},g),{},{sectors:w,data:a})});var SG=Math.ceil,_G=Math.max;function NG(e,t,r,n){for(var a=-1,i=_G(SG((t-e)/(r||1)),0),o=Array(i);i--;)o[n?i:++a]=e,e+=r;return o}var OG=NG,kG=W_,h1=1/0,PG=17976931348623157e292;function AG(e){if(!e)return e===0?e:0;if(e=kG(e),e===h1||e===-h1){var t=e<0?-1:1;return t*PG}return e===e?e:0}var SO=AG,$G=OG,EG=Sd,Gf=SO;function CG(e){return function(t,r,n){return n&&typeof n!="number"&&EG(t,r,n)&&(r=n=void 0),t=Gf(t),r===void 0?(r=t,t=0):r=Gf(r),n=n===void 0?t<r?1:-1:Gf(n),$G(t,r,n,e)}}var TG=CG,MG=TG,IG=MG(),LG=IG;const _u=de(LG);function Xs(e){"@babel/helpers - typeof";return Xs=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},Xs(e)}function p1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function m1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?p1(Object(r),!0).forEach(function(n){_O(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _O(e,t,r){return t=DG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DG(e){var t=RG(e,"string");return Xs(t)=="symbol"?t:t+""}function RG(e,t){if(Xs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Xs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var BG=["Webkit","Moz","O","ms"],FG=function(t,r){var n=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=BG.reduce(function(i,o){return m1(m1({},i),{},_O({},o+n,r))},{});return a[t]=r,a};function Di(e){"@babel/helpers - typeof";return Di=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},Di(e)}function Nu(){return Nu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nu.apply(this,arguments)}function v1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Yf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?v1(Object(r),!0).forEach(function(n){$t(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,OO(n.key),n)}}function WG(e,t,r){return t&&g1(e.prototype,t),r&&g1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function UG(e,t,r){return t=Ou(t),HG(e,NO()?Reflect.construct(t,r||[],Ou(e).constructor):t.apply(e,r))}function HG(e,t){if(t&&(Di(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KG(e)}function KG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function NO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(NO=function(){return!!e})()}function Ou(e){return Ou=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ou(e)}function VG(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&am(e,t)}function am(e,t){return am=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},am(e,t)}function $t(e,t,r){return t=OO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OO(e){var t=GG(e,"string");return Di(t)=="symbol"?t:t+""}function GG(e,t){if(Di(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Di(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var YG=function(t){var r=t.data,n=t.startIndex,a=t.endIndex,i=t.x,o=t.width,l=t.travellerWidth;if(!r||!r.length)return{};var c=r.length,u=Qo().domain(_u(0,c)).range([i,i+o-l]),f=u.domain().map(function(d){return u(d)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(a),scale:u,scaleValues:f}},y1=function(t){return t.changedTouches&&!!t.changedTouches.length},Ri=function(e){function t(r){var n;return zG(this,t),n=UG(this,t,[r]),$t(n,"handleDrag",function(a){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(a):n.state.isSlideMoving&&n.handleSlideDrag(a)}),$t(n,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&n.handleDrag(a.changedTouches[0])}),$t(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,o=a.onDragEnd,l=a.startIndex;o==null||o({endIndex:i,startIndex:l})}),n.detachDragEndListener()}),$t(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),$t(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),$t(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),$t(n,"handleSlideDragStart",function(a){var i=y1(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return VG(t,e),WG(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,f=u.length-1,d=Math.min(a,i),h=Math.max(a,i),p=t.getIndexInRange(o,d),g=t.getIndexInRange(o,h);return{startIndex:p-p%c,endIndex:g===f?f:g-g%c}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,o=a.tickFormatter,l=a.dataKey,c=Ke(i[n],l,n);return Z(o)?o(c,n):c}},{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(n){var a=this.state,i=a.slideMoveStartX,o=a.startX,l=a.endX,c=this.props,u=c.x,f=c.width,d=c.travellerWidth,h=c.startIndex,p=c.endIndex,g=c.onChange,b=n.pageX-i;b>0?b=Math.min(b,u+f-d-l,u+f-d-o):b<0&&(b=Math.max(b,u-o,u-l));var x=this.getIndex({startX:o+b,endX:l+b});(x.startIndex!==h||x.endIndex!==p)&&g&&g(x),this.setState({startX:o+b,endX:l+b,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=y1(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,l=a.endX,c=a.startX,u=this.state[o],f=this.props,d=f.x,h=f.width,p=f.travellerWidth,g=f.onChange,b=f.gap,x=f.data,y={startX:this.state.startX,endX:this.state.endX},v=n.pageX-i;v>0?v=Math.min(v,d+h-p-u):v<0&&(v=Math.max(v,d-u)),y[o]=u+v;var m=this.getIndex(y),S=m.startIndex,j=m.endIndex,w=function(){var _=x.length-1;return o==="startX"&&(l>c?S%b===0:j%b===0)||l<c&&j===_||o==="endX"&&(l>c?j%b===0:S%b===0)||l>c&&j===_};this.setState($t($t({},o,u+v),"brushMoveStartX",n.pageX),function(){g&&w()&&g(m)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,f=this.state[a],d=l.indexOf(f);if(d!==-1){var h=d+n;if(!(h===-1||h>=l.length)){var p=l[h];a==="startX"&&p>=u||a==="endX"&&p<=c||this.setState($t({},a,p),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,l=n.height,c=n.fill,u=n.stroke;return E.createElement("rect",{stroke:u,fill:c,x:a,y:i,width:o,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,l=n.height,c=n.data,u=n.children,f=n.padding,d=O.Children.only(u);return d?E.cloneElement(d,{x:a,y:i,width:o,height:l,margin:f,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,o,l=this,c=this.props,u=c.y,f=c.travellerWidth,d=c.height,h=c.traveller,p=c.ariaLabel,g=c.data,b=c.startIndex,x=c.endIndex,y=Math.max(n,this.props.x),v=Yf(Yf({},X(this.props,!1)),{},{x:y,y:u,width:f,height:d}),m=p||"Min value: ".concat((i=g[b])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=g[x])===null||o===void 0?void 0:o.name);return E.createElement(ae,{tabIndex:0,role:"slider","aria-label":m,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(j){["ArrowLeft","ArrowRight"].includes(j.key)&&(j.preventDefault(),j.stopPropagation(),l.handleTravellerMoveKeyboard(j.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,v))}},{key:"renderSlide",value:function(n,a){var i=this.props,o=i.y,l=i.height,c=i.stroke,u=i.travellerWidth,f=Math.min(n,a)+u,d=Math.max(Math.abs(a-n)-u,0);return E.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:f,y:o,width:d,height:l})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,o=n.y,l=n.height,c=n.travellerWidth,u=n.stroke,f=this.state,d=f.startX,h=f.endX,p=5,g={pointerEvents:"none",fill:u};return E.createElement(ae,{className:"recharts-brush-texts"},E.createElement(ya,Nu({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,h)-p,y:o+l/2},g),this.getTextOfTick(a)),E.createElement(ya,Nu({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,h)+c+p,y:o+l/2},g),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,o=n.children,l=n.x,c=n.y,u=n.width,f=n.height,d=n.alwaysShowText,h=this.state,p=h.startX,g=h.endX,b=h.isTextActive,x=h.isSlideMoving,y=h.isTravellerMoving,v=h.isTravellerFocused;if(!a||!a.length||!W(l)||!W(c)||!W(u)||!W(f)||u<=0||f<=0)return null;var m=te("recharts-brush",i),S=E.Children.count(o)===1,j=FG("userSelect","none");return E.createElement(ae,{className:m,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:j},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,g),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(g,"endX"),(b||x||y||v||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,o=n.width,l=n.height,c=n.stroke,u=Math.floor(i+l/2)-1;return E.createElement(E.Fragment,null,E.createElement("rect",{x:a,y:i,width:o,height:l,fill:c,stroke:"none"}),E.createElement("line",{x1:a+1,y1:u,x2:a+o-1,y2:u,fill:"none",stroke:"#fff"}),E.createElement("line",{x1:a+1,y1:u+2,x2:a+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return E.isValidElement(n)?i=E.cloneElement(n,a):Z(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,o=n.width,l=n.x,c=n.travellerWidth,u=n.updateId,f=n.startIndex,d=n.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return Yf({prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},i&&i.length?YG({data:i,width:o,x:l,travellerWidth:c,startIndex:f,endIndex:d}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||l!==a.prevX||c!==a.prevTravellerWidth)){a.scale.range([l,l+o-c]);var h=a.scale.domain().map(function(p){return a.scale(p)});return{prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,o=0,l=i-1;l-o>1;){var c=Math.floor((o+l)/2);n[c]>a?l=c:o=c}return a>=n[l]?l:o}}])}(O.PureComponent);$t(Ri,"displayName","Brush");$t(Ri,"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 qG=Hv;function XG(e,t){var r;return qG(e,function(n,a,i){return r=t(n,a,i),!r}),!!r}var QG=XG,ZG=m_,JG=Or,eY=QG,tY=At,rY=Sd;function nY(e,t,r){var n=tY(e)?ZG:eY;return r&&rY(e,t,r)&&(t=void 0),n(e,JG(t))}var aY=nY;const iY=de(aY);var wr=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},x1=D_;function oY(e,t,r){t=="__proto__"&&x1?x1(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var sY=oY,lY=sY,cY=I_,uY=Or;function dY(e,t){var r={};return t=uY(t),cY(e,function(n,a,i){lY(r,a,t(n,a,i))}),r}var fY=dY;const hY=de(fY);function pY(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}var mY=pY,vY=Hv;function gY(e,t){var r=!0;return vY(e,function(n,a,i){return r=!!t(n,a,i),r}),r}var yY=gY,xY=mY,bY=yY,jY=Or,wY=At,SY=Sd;function _Y(e,t,r){var n=wY(e)?xY:bY;return r&&SY(e,t,r)&&(t=void 0),n(e,jY(t))}var NY=_Y;const kO=de(NY);var OY=["x","y"];function Qs(e){"@babel/helpers - typeof";return Qs=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},Qs(e)}function im(){return im=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},im.apply(this,arguments)}function b1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Co(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?b1(Object(r),!0).forEach(function(n){kY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kY(e,t,r){return t=PY(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PY(e){var t=AY(e,"string");return Qs(t)=="symbol"?t:t+""}function AY(e,t){if(Qs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Qs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $Y(e,t){if(e==null)return{};var r=EY(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function EY(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function CY(e,t){var r=e.x,n=e.y,a=$Y(e,OY),i="".concat(r),o=parseInt(i,10),l="".concat(n),c=parseInt(l,10),u="".concat(t.height||a.height),f=parseInt(u,10),d="".concat(t.width||a.width),h=parseInt(d,10);return Co(Co(Co(Co(Co({},t),a),o?{x:o}:{}),c?{y:c}:{}),{},{height:f,width:h,name:t.name,radius:t.radius})}function j1(e){return E.createElement(bO,im({shapeType:"rectangle",propTransformer:CY,activeClassName:"recharts-active-bar"},e))}var TY=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var i=W(n)||eM(n);return i?t(n,a):(i||ba(),r)}},MY=["value","background"],PO;function Bi(e){"@babel/helpers - typeof";return Bi=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},Bi(e)}function IY(e,t){if(e==null)return{};var r=LY(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function LY(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ku(){return ku=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ku.apply(this,arguments)}function w1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Le(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?w1(Object(r),!0).forEach(function(n){mn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function DY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$O(n.key),n)}}function RY(e,t,r){return t&&S1(e.prototype,t),r&&S1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function BY(e,t,r){return t=Pu(t),FY(e,AO()?Reflect.construct(t,r||[],Pu(e).constructor):t.apply(e,r))}function FY(e,t){if(t&&(Bi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zY(e)}function zY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(AO=function(){return!!e})()}function Pu(e){return Pu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Pu(e)}function WY(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&om(e,t)}function om(e,t){return om=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},om(e,t)}function mn(e,t,r){return t=$O(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $O(e){var t=UY(e,"string");return Bi(t)=="symbol"?t:t+""}function UY(e,t){if(Bi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Bi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Dn=function(e){function t(){var r;DY(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=BY(this,t,[].concat(a)),mn(r,"state",{isAnimationFinished:!1}),mn(r,"id",oo("recharts-bar-")),mn(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),mn(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return WY(t,e),RY(t,[{key:"renderRectanglesStatically",value:function(n){var a=this,i=this.props,o=i.shape,l=i.dataKey,c=i.activeIndex,u=i.activeBar,f=X(this.props,!1);return n&&n.map(function(d,h){var p=h===c,g=p?u:o,b=Le(Le(Le({},f),d),{},{isActive:p,option:g,index:h,dataKey:l,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return E.createElement(ae,ku({className:"recharts-bar-rectangle"},va(a.props,d,h),{key:"rectangle-".concat(d==null?void 0:d.x,"-").concat(d==null?void 0:d.y,"-").concat(d==null?void 0:d.value,"-").concat(h)}),E.createElement(j1,b))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,a=this.props,i=a.data,o=a.layout,l=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,f=a.animationEasing,d=a.animationId,h=this.state.prevData;return E.createElement(_r,{begin:c,duration:u,isActive:l,easing:f,from:{t:0},to:{t:1},key:"bar-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(p){var g=p.t,b=i.map(function(x,y){var v=h&&h[y];if(v){var m=St(v.x,x.x),S=St(v.y,x.y),j=St(v.width,x.width),w=St(v.height,x.height);return Le(Le({},x),{},{x:m(g),y:S(g),width:j(g),height:w(g)})}if(o==="horizontal"){var N=St(0,x.height),_=N(g);return Le(Le({},x),{},{y:x.y+x.height-_,height:_})}var k=St(0,x.width),A=k(g);return Le(Le({},x),{},{width:A})});return E.createElement(ae,null,n.renderRectanglesStatically(b))})}},{key:"renderRectangles",value:function(){var n=this.props,a=n.data,i=n.isAnimationActive,o=this.state.prevData;return i&&a&&a.length&&(!o||!Ei(o,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var n=this,a=this.props,i=a.data,o=a.dataKey,l=a.activeIndex,c=X(this.props.background,!1);return i.map(function(u,f){u.value;var d=u.background,h=IY(u,MY);if(!d)return null;var p=Le(Le(Le(Le(Le({},h),{},{fill:"#eee"},d),c),va(n.props,u,f)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:f,className:"recharts-bar-background-rectangle"});return E.createElement(j1,ku({key:"background-bar-".concat(f),option:n.props.background,isActive:f===l},p))})}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.data,l=i.xAxis,c=i.yAxis,u=i.layout,f=i.children,d=Xt(f,Md);if(!d)return null;var h=u==="vertical"?o[0].height/2:o[0].width/2,p=function(x,y){var v=Array.isArray(x.value)?x.value[1]:x.value;return{x:x.x,y:x.y,value:v,errorVal:Ke(x,y)}},g={clipPath:n?"url(#clipPath-".concat(a,")"):null};return E.createElement(ae,g,d.map(function(b){return E.cloneElement(b,{key:"error-bar-".concat(a,"-").concat(b.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:p})}))}},{key:"render",value:function(){var n=this.props,a=n.hide,i=n.data,o=n.className,l=n.xAxis,c=n.yAxis,u=n.left,f=n.top,d=n.width,h=n.height,p=n.isAnimationActive,g=n.background,b=n.id;if(a||!i||!i.length)return null;var x=this.state.isAnimationFinished,y=te("recharts-bar",o),v=l&&l.allowDataOverflow,m=c&&c.allowDataOverflow,S=v||m,j=J(b)?this.id:b;return E.createElement(ae,{className:y},v||m?E.createElement("defs",null,E.createElement("clipPath",{id:"clipPath-".concat(j)},E.createElement("rect",{x:v?u:u-d/2,y:m?f:f-h/2,width:v?d:d*2,height:m?h:h*2}))):null,E.createElement(ae,{className:"recharts-bar-rectangles",clipPath:S?"url(#clipPath-".concat(j,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(S,j),(!p||x)&&zr.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:a.curData}:n.data!==a.curData?{curData:n.data}:null}}])}(O.PureComponent);PO=Dn;mn(Dn,"displayName","Bar");mn(Dn,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Oa.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});mn(Dn,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,a=e.bandSize,i=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,f=e.dataStartIndex,d=e.displayedData,h=e.offset,p=xW(n,r);if(!p)return null;var g=t.layout,b=r.type.defaultProps,x=b!==void 0?Le(Le({},b),r.props):r.props,y=x.dataKey,v=x.children,m=x.minPointSize,S=g==="horizontal"?o:i,j=u?S.scale.domain():null,w=OW({numericAxis:S}),N=Xt(v,ga),_=d.map(function(k,A){var T,C,D,P,M,$;u?T=bW(u[f+A],j):(T=Ke(k,y),Array.isArray(T)||(T=[w,T]));var I=TY(m,PO.defaultProps.minPointSize)(T[1],A);if(g==="horizontal"){var L,B=[o.scale(T[0]),o.scale(T[1])],F=B[0],K=B[1];C=mb({axis:i,ticks:l,bandSize:a,offset:p.offset,entry:k,index:A}),D=(L=K??F)!==null&&L!==void 0?L:void 0,P=p.size;var H=F-K;if(M=Number.isNaN(H)?0:H,$={x:C,y:o.y,width:P,height:o.height},Math.abs(I)>0&&Math.abs(M)<Math.abs(I)){var q=ft(M||I)*(Math.abs(I)-Math.abs(M));D-=q,M+=q}}else{var ie=[i.scale(T[0]),i.scale(T[1])],_e=ie[0],Me=ie[1];if(C=_e,D=mb({axis:o,ticks:c,bandSize:a,offset:p.offset,entry:k,index:A}),P=Me-_e,M=p.size,$={x:i.x,y:D,width:i.width,height:M},Math.abs(I)>0&&Math.abs(P)<Math.abs(I)){var Ft=ft(P||I)*(Math.abs(I)-Math.abs(P));P+=Ft}}return Le(Le(Le({},k),{},{x:C,y:D,width:P,height:M,value:u?T:T[1],payload:k,background:$},N&&N[A]&&N[A].props),{},{tooltipPayload:[ZN(r,k)],tooltipPosition:{x:C+P/2,y:D+M/2}})});return Le({data:_,layout:g},h)});function Zs(e){"@babel/helpers - typeof";return Zs=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},Zs(e)}function HY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,EO(n.key),n)}}function KY(e,t,r){return t&&_1(e.prototype,t),r&&_1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function N1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function or(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?N1(Object(r),!0).forEach(function(n){Wd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wd(e,t,r){return t=EO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EO(e){var t=VY(e,"string");return Zs(t)=="symbol"?t:t+""}function VY(e,t){if(Zs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Zs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var CO=function(t,r,n,a,i){var o=t.width,l=t.height,c=t.layout,u=t.children,f=Object.keys(r),d={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},h=!!Ct(u,Dn);return f.reduce(function(p,g){var b=r[g],x=b.orientation,y=b.domain,v=b.padding,m=v===void 0?{}:v,S=b.mirror,j=b.reversed,w="".concat(x).concat(S?"Mirror":""),N,_,k,A,T;if(b.type==="number"&&(b.padding==="gap"||b.padding==="no-gap")){var C=y[1]-y[0],D=1/0,P=b.categoricalDomain.sort(nM);if(P.forEach(function(ie,_e){_e>0&&(D=Math.min((ie||0)-(P[_e-1]||0),D))}),Number.isFinite(D)){var M=D/C,$=b.layout==="vertical"?n.height:n.width;if(b.padding==="gap"&&(N=M*$/2),b.padding==="no-gap"){var I=ht(t.barCategoryGap,M*$),L=M*$/2;N=L-I-(L-I)/$*I}}}a==="xAxis"?_=[n.left+(m.left||0)+(N||0),n.left+n.width-(m.right||0)-(N||0)]:a==="yAxis"?_=c==="horizontal"?[n.top+n.height-(m.bottom||0),n.top+(m.top||0)]:[n.top+(m.top||0)+(N||0),n.top+n.height-(m.bottom||0)-(N||0)]:_=b.range,j&&(_=[_[1],_[0]]);var B=YN(b,i,h),F=B.scale,K=B.realScaleType;F.domain(y).range(_),qN(F);var H=XN(F,or(or({},b),{},{realScaleType:K}));a==="xAxis"?(T=x==="top"&&!S||x==="bottom"&&S,k=n.left,A=d[w]-T*b.height):a==="yAxis"&&(T=x==="left"&&!S||x==="right"&&S,k=d[w]-T*b.width,A=n.top);var q=or(or(or({},b),H),{},{realScaleType:K,x:k,y:A,scale:F,width:a==="xAxis"?n.width:b.width,height:a==="yAxis"?n.height:b.height});return q.bandSize=du(q,H),!b.hide&&a==="xAxis"?d[w]+=(T?-1:1)*q.height:b.hide||(d[w]+=(T?-1:1)*q.width),or(or({},p),{},Wd({},g,q))},{})},TO=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return{x:Math.min(n,i),y:Math.min(a,o),width:Math.abs(i-n),height:Math.abs(o-a)}},GY=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return TO({x:r,y:n},{x:a,y:i})},MO=function(){function e(t){HY(this,e),this.scale=t}return KY(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(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(a){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])}();Wd(MO,"EPS",1e-4);var xg=function(t){var r=Object.keys(t).reduce(function(n,a){return or(or({},n),{},Wd({},a,MO.create(t[a])))},{});return or(or({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,l=i.position;return hY(a,function(c,u){return r[u].apply(c,{bandAware:o,position:l})})},isInRange:function(a){return kO(a,function(i,o){return r[o].isInRange(i)})}})};function YY(e){return(e%180+180)%180}var qY=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=YY(a),o=i*Math.PI/180,l=Math.atan(n/r),c=o>l&&o<Math.PI-l?n/Math.sin(o):r/Math.cos(o);return Math.abs(c)},XY=Or,QY=ul,ZY=jd;function JY(e){return function(t,r,n){var a=Object(t);if(!QY(t)){var i=XY(r);t=ZY(t),r=function(l){return i(a[l],l,a)}}var o=e(t,r,n);return o>-1?a[i?t[o]:o]:void 0}}var eq=JY,tq=SO;function rq(e){var t=tq(e),r=t%1;return t===t?r?t-r:t:0}var nq=rq,aq=A_,iq=Or,oq=nq,sq=Math.max;function lq(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:oq(r);return a<0&&(a=sq(n+a,0)),aq(e,iq(t),a)}var cq=lq,uq=eq,dq=cq,fq=uq(dq),hq=fq;const pq=de(hq);var mq=oT(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("")}),bg=O.createContext(void 0),jg=O.createContext(void 0),IO=O.createContext(void 0),LO=O.createContext({}),DO=O.createContext(void 0),RO=O.createContext(0),BO=O.createContext(0),O1=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,f=mq(i);return E.createElement(bg.Provider,{value:n},E.createElement(jg.Provider,{value:a},E.createElement(LO.Provider,{value:i},E.createElement(IO.Provider,{value:f},E.createElement(DO.Provider,{value:o},E.createElement(RO.Provider,{value:u},E.createElement(BO.Provider,{value:c},l)))))))},vq=function(){return O.useContext(DO)},FO=function(t){var r=O.useContext(bg);r==null&&ba();var n=r[t];return n==null&&ba(),n},gq=function(){var t=O.useContext(bg);return un(t)},yq=function(){var t=O.useContext(jg),r=pq(t,function(n){return kO(n.domain,Number.isFinite)});return r||un(t)},zO=function(t){var r=O.useContext(jg);r==null&&ba();var n=r[t];return n==null&&ba(),n},xq=function(){var t=O.useContext(IO);return t},bq=function(){return O.useContext(LO)},wg=function(){return O.useContext(BO)},Sg=function(){return O.useContext(RO)};function Fi(e){"@babel/helpers - typeof";return Fi=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},Fi(e)}function jq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wq(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,UO(n.key),n)}}function Sq(e,t,r){return t&&wq(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _q(e,t,r){return t=Au(t),Nq(e,WO()?Reflect.construct(t,r||[],Au(e).constructor):t.apply(e,r))}function Nq(e,t){if(t&&(Fi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oq(e)}function Oq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WO=function(){return!!e})()}function Au(e){return Au=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Au(e)}function kq(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sm(e,t)}function sm(e,t){return sm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},sm(e,t)}function k1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function P1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?k1(Object(r),!0).forEach(function(n){_g(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _g(e,t,r){return t=UO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UO(e){var t=Pq(e,"string");return Fi(t)=="symbol"?t:t+""}function Pq(e,t){if(Fi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Aq(e,t){return Tq(e)||Cq(e,t)||Eq(e,t)||$q()}function $q(){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 Eq(e,t){if(e){if(typeof e=="string")return A1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return A1(e,t)}}function A1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Cq(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function Tq(e){if(Array.isArray(e))return e}function lm(){return lm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lm.apply(this,arguments)}var Mq=function(t,r){var n;return E.isValidElement(t)?n=E.cloneElement(t,r):Z(t)?n=t(r):n=E.createElement("line",lm({},r,{className:"recharts-reference-line-line"})),n},Iq=function(t,r,n,a,i,o,l,c,u){var f=i.x,d=i.y,h=i.width,p=i.height;if(n){var g=u.y,b=t.y.apply(g,{position:o});if(wr(u,"discard")&&!t.y.isInRange(b))return null;var x=[{x:f+h,y:b},{x:f,y:b}];return c==="left"?x.reverse():x}if(r){var y=u.x,v=t.x.apply(y,{position:o});if(wr(u,"discard")&&!t.x.isInRange(v))return null;var m=[{x:v,y:d+p},{x:v,y:d}];return l==="top"?m.reverse():m}if(a){var S=u.segment,j=S.map(function(w){return t.apply(w,{position:o})});return wr(u,"discard")&&iY(j,function(w){return!t.isInRange(w)})?null:j}return null};function Lq(e){var t=e.x,r=e.y,n=e.segment,a=e.xAxisId,i=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=vq(),f=FO(a),d=zO(i),h=xq();if(!u||!h)return null;dr(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=xg({x:f.scale,y:d.scale}),g=Ge(t),b=Ge(r),x=n&&n.length===2,y=Iq(p,g,b,x,h,e.position,f.orientation,d.orientation,e);if(!y)return null;var v=Aq(y,2),m=v[0],S=m.x,j=m.y,w=v[1],N=w.x,_=w.y,k=wr(e,"hidden")?"url(#".concat(u,")"):void 0,A=P1(P1({clipPath:k},X(e,!0)),{},{x1:S,y1:j,x2:N,y2:_});return E.createElement(ae,{className:te("recharts-reference-line",l)},Mq(o,A),Qe.renderCallByParent(e,GY({x1:S,y1:j,x2:N,y2:_})))}var Ng=function(e){function t(){return jq(this,t),_q(this,t,arguments)}return kq(t,e),Sq(t,[{key:"render",value:function(){return E.createElement(Lq,this.props)}}])}(E.Component);_g(Ng,"displayName","ReferenceLine");_g(Ng,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function cm(){return cm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cm.apply(this,arguments)}function zi(e){"@babel/helpers - typeof";return zi=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},zi(e)}function $1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function E1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$1(Object(r),!0).forEach(function(n){Ud(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Dq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rq(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,KO(n.key),n)}}function Bq(e,t,r){return t&&Rq(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fq(e,t,r){return t=$u(t),zq(e,HO()?Reflect.construct(t,r||[],$u(e).constructor):t.apply(e,r))}function zq(e,t){if(t&&(zi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wq(e)}function Wq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(HO=function(){return!!e})()}function $u(e){return $u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$u(e)}function Uq(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&um(e,t)}function um(e,t){return um=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},um(e,t)}function Ud(e,t,r){return t=KO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KO(e){var t=Hq(e,"string");return zi(t)=="symbol"?t:t+""}function Hq(e,t){if(zi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(zi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Kq=function(t){var r=t.x,n=t.y,a=t.xAxis,i=t.yAxis,o=xg({x:a.scale,y:i.scale}),l=o.apply({x:r,y:n},{bandAware:!0});return wr(t,"discard")&&!o.isInRange(l)?null:l},Hd=function(e){function t(){return Dq(this,t),Fq(this,t,arguments)}return Uq(t,e),Bq(t,[{key:"render",value:function(){var n=this.props,a=n.x,i=n.y,o=n.r,l=n.alwaysShow,c=n.clipPathId,u=Ge(a),f=Ge(i);if(dr(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!f)return null;var d=Kq(this.props);if(!d)return null;var h=d.x,p=d.y,g=this.props,b=g.shape,x=g.className,y=wr(this.props,"hidden")?"url(#".concat(c,")"):void 0,v=E1(E1({clipPath:y},X(this.props,!0)),{},{cx:h,cy:p});return E.createElement(ae,{className:te("recharts-reference-dot",x)},t.renderDot(b,v),Qe.renderCallByParent(this.props,{x:h-o,y:p-o,width:2*o,height:2*o}))}}])}(E.Component);Ud(Hd,"displayName","ReferenceDot");Ud(Hd,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Ud(Hd,"renderDot",function(e,t){var r;return E.isValidElement(e)?r=E.cloneElement(e,t):Z(e)?r=e(t):r=E.createElement(Id,cm({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function dm(){return dm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dm.apply(this,arguments)}function Wi(e){"@babel/helpers - typeof";return Wi=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},Wi(e)}function C1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function T1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?C1(Object(r),!0).forEach(function(n){Kd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gq(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,GO(n.key),n)}}function Yq(e,t,r){return t&&Gq(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qq(e,t,r){return t=Eu(t),Xq(e,VO()?Reflect.construct(t,r||[],Eu(e).constructor):t.apply(e,r))}function Xq(e,t){if(t&&(Wi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qq(e)}function Qq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function VO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VO=function(){return!!e})()}function Eu(e){return Eu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Eu(e)}function Zq(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fm(e,t)}function fm(e,t){return fm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},fm(e,t)}function Kd(e,t,r){return t=GO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GO(e){var t=Jq(e,"string");return Wi(t)=="symbol"?t:t+""}function Jq(e,t){if(Wi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Wi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var eX=function(t,r,n,a,i){var o=i.x1,l=i.x2,c=i.y1,u=i.y2,f=i.xAxis,d=i.yAxis;if(!f||!d)return null;var h=xg({x:f.scale,y:d.scale}),p={x:t?h.x.apply(o,{position:"start"}):h.x.rangeMin,y:n?h.y.apply(c,{position:"start"}):h.y.rangeMin},g={x:r?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:a?h.y.apply(u,{position:"end"}):h.y.rangeMax};return wr(i,"discard")&&(!h.isInRange(p)||!h.isInRange(g))?null:TO(p,g)},Vd=function(e){function t(){return Vq(this,t),qq(this,t,arguments)}return Zq(t,e),Yq(t,[{key:"render",value:function(){var n=this.props,a=n.x1,i=n.x2,o=n.y1,l=n.y2,c=n.className,u=n.alwaysShow,f=n.clipPathId;dr(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var d=Ge(a),h=Ge(i),p=Ge(o),g=Ge(l),b=this.props.shape;if(!d&&!h&&!p&&!g&&!b)return null;var x=eX(d,h,p,g,this.props);if(!x&&!b)return null;var y=wr(this.props,"hidden")?"url(#".concat(f,")"):void 0;return E.createElement(ae,{className:te("recharts-reference-area",c)},t.renderRect(b,T1(T1({clipPath:y},X(this.props,!0)),x)),Qe.renderCallByParent(this.props,x))}}])}(E.Component);Kd(Vd,"displayName","ReferenceArea");Kd(Vd,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Kd(Vd,"renderRect",function(e,t){var r;return E.isValidElement(e)?r=E.cloneElement(e,t):Z(e)?r=e(t):r=E.createElement(yg,dm({},t,{className:"recharts-reference-area-rect"})),r});function YO(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],a=0;a<e.length;a+=t)n.push(e[a]);return n}function tX(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return qY(n,r)}function rX(e,t,r){var n=r==="width",a=e.x,i=e.y,o=e.width,l=e.height;return t===1?{start:n?a:i,end:n?a+o:i+l}:{start:n?a+o:i+l,end:n?a:i}}function Cu(e,t,r,n,a){if(e*t<e*n||e*t>e*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function nX(e,t){return YO(e,t+1)}function aX(e,t,r,n,a){for(var i=(n||[]).slice(),o=t.start,l=t.end,c=0,u=1,f=o,d=function(){var g=n==null?void 0:n[c];if(g===void 0)return{v:YO(n,u)};var b=c,x,y=function(){return x===void 0&&(x=r(g,b)),x},v=g.coordinate,m=c===0||Cu(e,v,y,f,l);m||(c=0,f=o,u+=1),m&&(f=v+e*(y()/2+a),c+=u)},h;u<=i.length;)if(h=d(),h)return h.v;return[]}function Js(e){"@babel/helpers - typeof";return Js=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},Js(e)}function M1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function st(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?M1(Object(r),!0).forEach(function(n){iX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iX(e,t,r){return t=oX(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oX(e){var t=sX(e,"string");return Js(t)=="symbol"?t:t+""}function sX(e,t){if(Js(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Js(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lX(e,t,r,n,a){for(var i=(n||[]).slice(),o=i.length,l=t.start,c=t.end,u=function(h){var p=i[h],g,b=function(){return g===void 0&&(g=r(p,h)),g};if(h===o-1){var x=e*(p.coordinate+e*b()/2-c);i[h]=p=st(st({},p),{},{tickCoord:x>0?p.coordinate-x*e:p.coordinate})}else i[h]=p=st(st({},p),{},{tickCoord:p.coordinate});var y=Cu(e,p.tickCoord,b,l,c);y&&(c=p.tickCoord-e*(b()/2+a),i[h]=st(st({},p),{},{isShow:!0}))},f=o-1;f>=0;f--)u(f);return i}function cX(e,t,r,n,a,i){var o=(n||[]).slice(),l=o.length,c=t.start,u=t.end;if(i){var f=n[l-1],d=r(f,l-1),h=e*(f.coordinate+e*d/2-u);o[l-1]=f=st(st({},f),{},{tickCoord:h>0?f.coordinate-h*e:f.coordinate});var p=Cu(e,f.tickCoord,function(){return d},c,u);p&&(u=f.tickCoord-e*(d/2+a),o[l-1]=st(st({},f),{},{isShow:!0}))}for(var g=i?l-1:l,b=function(v){var m=o[v],S,j=function(){return S===void 0&&(S=r(m,v)),S};if(v===0){var w=e*(m.coordinate-e*j()/2-c);o[v]=m=st(st({},m),{},{tickCoord:w<0?m.coordinate-w*e:m.coordinate})}else o[v]=m=st(st({},m),{},{tickCoord:m.coordinate});var N=Cu(e,m.tickCoord,j,c,u);N&&(c=m.tickCoord+e*(j()/2+a),o[v]=st(st({},m),{},{isShow:!0}))},x=0;x<g;x++)b(x);return o}function Og(e,t,r){var n=e.tick,a=e.ticks,i=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,f=e.unit,d=e.angle;if(!a||!a.length||!n)return[];if(W(c)||Oa.isSsr)return nX(a,typeof c=="number"&&W(c)?c:0);var h=[],p=l==="top"||l==="bottom"?"width":"height",g=f&&p==="width"?Xo(f,{fontSize:t,letterSpacing:r}):{width:0,height:0},b=function(m,S){var j=Z(u)?u(m.value,S):m.value;return p==="width"?tX(Xo(j,{fontSize:t,letterSpacing:r}),g,d):Xo(j,{fontSize:t,letterSpacing:r})[p]},x=a.length>=2?ft(a[1].coordinate-a[0].coordinate):1,y=rX(i,x,p);return c==="equidistantPreserveStart"?aX(x,y,b,a,o):(c==="preserveStart"||c==="preserveStartEnd"?h=cX(x,y,b,a,o,c==="preserveStartEnd"):h=lX(x,y,b,a,o),h.filter(function(v){return v.isShow}))}var uX=["viewBox"],dX=["viewBox"],fX=["ticks"];function Ui(e){"@babel/helpers - typeof";return Ui=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},Ui(e)}function ri(){return ri=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ri.apply(this,arguments)}function I1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function We(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?I1(Object(r),!0).forEach(function(n){kg(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qf(e,t){if(e==null)return{};var r=hX(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function pX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,XO(n.key),n)}}function mX(e,t,r){return t&&L1(e.prototype,t),r&&L1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function vX(e,t,r){return t=Tu(t),gX(e,qO()?Reflect.construct(t,r||[],Tu(e).constructor):t.apply(e,r))}function gX(e,t){if(t&&(Ui(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yX(e)}function yX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qO=function(){return!!e})()}function Tu(e){return Tu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Tu(e)}function xX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hm(e,t)}function hm(e,t){return hm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},hm(e,t)}function kg(e,t,r){return t=XO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XO(e){var t=bX(e,"string");return Ui(t)=="symbol"?t:t+""}function bX(e,t){if(Ui(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ui(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var po=function(e){function t(r){var n;return pX(this,t),n=vX(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return xX(t,e),mX(t,[{key:"shouldComponentUpdate",value:function(n,a){var i=n.viewBox,o=qf(n,uX),l=this.props,c=l.viewBox,u=qf(l,dX);return!ui(i,c)||!ui(o,u)||!ui(a,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var a=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var a=this.props,i=a.x,o=a.y,l=a.width,c=a.height,u=a.orientation,f=a.tickSize,d=a.mirror,h=a.tickMargin,p,g,b,x,y,v,m=d?-1:1,S=n.tickSize||f,j=W(n.tickCoord)?n.tickCoord:n.coordinate;switch(u){case"top":p=g=n.coordinate,x=o+ +!d*c,b=x-m*S,v=b-m*h,y=j;break;case"left":b=x=n.coordinate,g=i+ +!d*l,p=g-m*S,y=p-m*h,v=j;break;case"right":b=x=n.coordinate,g=i+ +d*l,p=g+m*S,y=p+m*h,v=j;break;default:p=g=n.coordinate,x=o+ +d*c,b=x+m*S,v=b+m*h,y=j;break}return{line:{x1:p,y1:b,x2:g,y2:x},tick:{x:y,y:v}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,o;switch(a){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,o="end";switch(a){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,l=n.height,c=n.orientation,u=n.mirror,f=n.axisLine,d=We(We(We({},X(this.props,!1)),X(f,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);d=We(We({},d),{},{x1:a,y1:i+h*l,x2:a+o,y2:i+h*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);d=We(We({},d),{},{x1:a+p*o,y1:i,x2:a+p*o,y2:i+l})}return E.createElement("line",ri({},d,{className:te("recharts-cartesian-axis-line",Lt(f,"className"))}))}},{key:"renderTicks",value:function(n,a,i){var o=this,l=this.props,c=l.tickLine,u=l.stroke,f=l.tick,d=l.tickFormatter,h=l.unit,p=Og(We(We({},this.props),{},{ticks:n}),a,i),g=this.getTickTextAnchor(),b=this.getTickVerticalAnchor(),x=X(this.props,!1),y=X(f,!1),v=We(We({},x),{},{fill:"none"},X(c,!1)),m=p.map(function(S,j){var w=o.getTickLineCoord(S),N=w.line,_=w.tick,k=We(We(We(We({textAnchor:g,verticalAnchor:b},x),{},{stroke:"none",fill:u},y),_),{},{index:j,payload:S,visibleTicksCount:p.length,tickFormatter:d});return E.createElement(ae,ri({className:"recharts-cartesian-axis-tick",key:"tick-".concat(S.value,"-").concat(S.coordinate,"-").concat(S.tickCoord)},va(o.props,S,j)),c&&E.createElement("line",ri({},v,N,{className:te("recharts-cartesian-axis-tick-line",Lt(c,"className"))})),f&&t.renderTickItem(f,k,"".concat(Z(d)?d(S.value,j):S.value).concat(h||"")))});return E.createElement("g",{className:"recharts-cartesian-axis-ticks"},m)}},{key:"render",value:function(){var n=this,a=this.props,i=a.axisLine,o=a.width,l=a.height,c=a.ticksGenerator,u=a.className,f=a.hide;if(f)return null;var d=this.props,h=d.ticks,p=qf(d,fX),g=h;return Z(c)&&(g=h&&h.length>0?c(this.props):c(p)),o<=0||l<=0||!g||!g.length?null:E.createElement(ae,{className:te("recharts-cartesian-axis",u),ref:function(x){n.layerReference=x}},i&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),Qe.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var o,l=te(a.className,"recharts-cartesian-axis-tick-value");return E.isValidElement(n)?o=E.cloneElement(n,We(We({},a),{},{className:l})):Z(n)?o=n(We(We({},a),{},{className:l})):o=E.createElement(ya,ri({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])}(O.Component);kg(po,"displayName","CartesianAxis");kg(po,"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 jX=["x1","y1","x2","y2","key"],wX=["offset"];function ja(e){"@babel/helpers - typeof";return ja=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},ja(e)}function D1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ct(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?D1(Object(r),!0).forEach(function(n){SX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SX(e,t,r){return t=_X(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _X(e){var t=NX(e,"string");return ja(t)=="symbol"?t:t+""}function NX(e,t){if(ja(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ja(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function na(){return na=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},na.apply(this,arguments)}function R1(e,t){if(e==null)return{};var r=OX(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function OX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var kX=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,i=t.y,o=t.width,l=t.height,c=t.ry;return E.createElement("rect",{x:a,y:i,ry:c,width:o,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function QO(e,t){var r;if(E.isValidElement(e))r=E.cloneElement(e,t);else if(Z(e))r=e(t);else{var n=t.x1,a=t.y1,i=t.x2,o=t.y2,l=t.key,c=R1(t,jX),u=X(c,!1);u.offset;var f=R1(u,wX);r=E.createElement("line",na({},f,{x1:n,y1:a,x2:i,y2:o,fill:"none",key:l}))}return r}function PX(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(l,c){var u=ct(ct({},e),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return QO(a,u)});return E.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function AX(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,i=e.verticalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(l,c){var u=ct(ct({},e),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return QO(a,u)});return E.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function $X(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,i=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var f=l.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==f[0]&&f.unshift(0);var d=f.map(function(h,p){var g=!f[p+1],b=g?a+o-h:f[p+1]-h;if(b<=0)return null;var x=p%t.length;return E.createElement("rect",{key:"react-".concat(p),y:h,x:n,height:b,width:i,stroke:"none",fill:t[x],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return E.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function EX(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,i=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var f=u.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==f[0]&&f.unshift(0);var d=f.map(function(h,p){var g=!f[p+1],b=g?i+l-h:f[p+1]-h;if(b<=0)return null;var x=p%n.length;return E.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:b,height:c,stroke:"none",fill:n[x],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return E.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var CX=function(t,r){var n=t.xAxis,a=t.width,i=t.height,o=t.offset;return GN(Og(ct(ct(ct({},po.defaultProps),n),{},{ticks:Dr(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.left,o.left+o.width,r)},TX=function(t,r){var n=t.yAxis,a=t.width,i=t.height,o=t.offset;return GN(Og(ct(ct(ct({},po.defaultProps),n),{},{ticks:Dr(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.top,o.top+o.height,r)},Ma={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Pg(e){var t,r,n,a,i,o,l=wg(),c=Sg(),u=bq(),f=ct(ct({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Ma.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Ma.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Ma.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Ma.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:Ma.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Ma.verticalFill,x:W(e.x)?e.x:u.left,y:W(e.y)?e.y:u.top,width:W(e.width)?e.width:u.width,height:W(e.height)?e.height:u.height}),d=f.x,h=f.y,p=f.width,g=f.height,b=f.syncWithTicks,x=f.horizontalValues,y=f.verticalValues,v=gq(),m=yq();if(!W(p)||p<=0||!W(g)||g<=0||!W(d)||d!==+d||!W(h)||h!==+h)return null;var S=f.verticalCoordinatesGenerator||CX,j=f.horizontalCoordinatesGenerator||TX,w=f.horizontalPoints,N=f.verticalPoints;if((!w||!w.length)&&Z(j)){var _=x&&x.length,k=j({yAxis:m?ct(ct({},m),{},{ticks:_?x:m.ticks}):void 0,width:l,height:c,offset:u},_?!0:b);dr(Array.isArray(k),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(ja(k),"]")),Array.isArray(k)&&(w=k)}if((!N||!N.length)&&Z(S)){var A=y&&y.length,T=S({xAxis:v?ct(ct({},v),{},{ticks:A?y:v.ticks}):void 0,width:l,height:c,offset:u},A?!0:b);dr(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(ja(T),"]")),Array.isArray(T)&&(N=T)}return E.createElement("g",{className:"recharts-cartesian-grid"},E.createElement(kX,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),E.createElement(PX,na({},f,{offset:u,horizontalPoints:w,xAxis:v,yAxis:m})),E.createElement(AX,na({},f,{offset:u,verticalPoints:N,xAxis:v,yAxis:m})),E.createElement($X,na({},f,{horizontalPoints:w})),E.createElement(EX,na({},f,{verticalPoints:N})))}Pg.displayName="CartesianGrid";var MX=["layout","type","stroke","connectNulls","isRange","ref"],IX=["key"],ZO;function Hi(e){"@babel/helpers - typeof";return Hi=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},Hi(e)}function JO(e,t){if(e==null)return{};var r=LX(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function LX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function aa(){return aa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aa.apply(this,arguments)}function B1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function rn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?B1(Object(r),!0).forEach(function(n){yr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function DX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,t2(n.key),n)}}function RX(e,t,r){return t&&F1(e.prototype,t),r&&F1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function BX(e,t,r){return t=Mu(t),FX(e,e2()?Reflect.construct(t,r||[],Mu(e).constructor):t.apply(e,r))}function FX(e,t){if(t&&(Hi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zX(e)}function zX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function e2(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(e2=function(){return!!e})()}function Mu(e){return Mu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Mu(e)}function WX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pm(e,t)}function pm(e,t){return pm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},pm(e,t)}function yr(e,t,r){return t=t2(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t2(e){var t=UX(e,"string");return Hi(t)=="symbol"?t:t+""}function UX(e,t){if(Hi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Hi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Jr=function(e){function t(){var r;DX(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=BX(this,t,[].concat(a)),yr(r,"state",{isAnimationFinished:!0}),yr(r,"id",oo("recharts-area-")),yr(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Z(o)&&o()}),yr(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Z(o)&&o()}),r}return WX(t,e),RX(t,[{key:"renderDots",value:function(n,a,i){var o=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(o&&!l)return null;var c=this.props,u=c.dot,f=c.points,d=c.dataKey,h=X(this.props,!1),p=X(u,!0),g=f.map(function(x,y){var v=rn(rn(rn({key:"dot-".concat(y),r:3},h),p),{},{index:y,cx:x.x,cy:x.y,dataKey:d,value:x.value,payload:x.payload,points:f});return t.renderDotItem(u,v)}),b={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return E.createElement(ae,aa({className:"recharts-area-dots"},b),g)}},{key:"renderHorizontalRect",value:function(n){var a=this.props,i=a.baseLine,o=a.points,l=a.strokeWidth,c=o[0].x,u=o[o.length-1].x,f=n*Math.abs(c-u),d=pn(o.map(function(h){return h.y||0}));return W(i)&&typeof i=="number"?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(pn(i.map(function(h){return h.y||0})),d)),W(d)?E.createElement("rect",{x:c<u?c:c-f,y:0,width:f,height:Math.floor(d+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var a=this.props,i=a.baseLine,o=a.points,l=a.strokeWidth,c=o[0].y,u=o[o.length-1].y,f=n*Math.abs(c-u),d=pn(o.map(function(h){return h.x||0}));return W(i)&&typeof i=="number"?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(pn(i.map(function(h){return h.x||0})),d)),W(d)?E.createElement("rect",{x:0,y:c<u?c:c-f,width:d+(l?parseInt("".concat(l),10):1),height:Math.floor(f)}):null}},{key:"renderClipRect",value:function(n){var a=this.props.layout;return a==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,a,i,o){var l=this.props,c=l.layout,u=l.type,f=l.stroke,d=l.connectNulls,h=l.isRange;l.ref;var p=JO(l,MX);return E.createElement(ae,{clipPath:i?"url(#clipPath-".concat(o,")"):null},E.createElement(pi,aa({},X(p,!0),{points:n,connectNulls:d,type:u,baseLine:a,layout:c,stroke:"none",className:"recharts-area-area"})),f!=="none"&&E.createElement(pi,aa({},X(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:d,fill:"none",points:n})),f!=="none"&&h&&E.createElement(pi,aa({},X(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:d,fill:"none",points:a})))}},{key:"renderAreaWithAnimation",value:function(n,a){var i=this,o=this.props,l=o.points,c=o.baseLine,u=o.isAnimationActive,f=o.animationBegin,d=o.animationDuration,h=o.animationEasing,p=o.animationId,g=this.state,b=g.prevPoints,x=g.prevBaseLine;return E.createElement(_r,{begin:f,duration:d,isActive:u,easing:h,from:{t:0},to:{t:1},key:"area-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(y){var v=y.t;if(b){var m=b.length/l.length,S=l.map(function(_,k){var A=Math.floor(k*m);if(b[A]){var T=b[A],C=St(T.x,_.x),D=St(T.y,_.y);return rn(rn({},_),{},{x:C(v),y:D(v)})}return _}),j;if(W(c)&&typeof c=="number"){var w=St(x,c);j=w(v)}else if(J(c)||io(c)){var N=St(x,0);j=N(v)}else j=c.map(function(_,k){var A=Math.floor(k*m);if(x[A]){var T=x[A],C=St(T.x,_.x),D=St(T.y,_.y);return rn(rn({},_),{},{x:C(v),y:D(v)})}return _});return i.renderAreaStatically(S,j,n,a)}return E.createElement(ae,null,E.createElement("defs",null,E.createElement("clipPath",{id:"animationClipPath-".concat(a)},i.renderClipRect(v))),E.createElement(ae,{clipPath:"url(#animationClipPath-".concat(a,")")},i.renderAreaStatically(l,c,n,a)))})}},{key:"renderArea",value:function(n,a){var i=this.props,o=i.points,l=i.baseLine,c=i.isAnimationActive,u=this.state,f=u.prevPoints,d=u.prevBaseLine,h=u.totalLength;return c&&o&&o.length&&(!f&&h>0||!Ei(f,o)||!Ei(d,l))?this.renderAreaWithAnimation(n,a):this.renderAreaStatically(o,l,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,o=a.dot,l=a.points,c=a.className,u=a.top,f=a.left,d=a.xAxis,h=a.yAxis,p=a.width,g=a.height,b=a.isAnimationActive,x=a.id;if(i||!l||!l.length)return null;var y=this.state.isAnimationFinished,v=l.length===1,m=te("recharts-area",c),S=d&&d.allowDataOverflow,j=h&&h.allowDataOverflow,w=S||j,N=J(x)?this.id:x,_=(n=X(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},k=_.r,A=k===void 0?3:k,T=_.strokeWidth,C=T===void 0?2:T,D=fM(o)?o:{},P=D.clipDot,M=P===void 0?!0:P,$=A*2+C;return E.createElement(ae,{className:m},S||j?E.createElement("defs",null,E.createElement("clipPath",{id:"clipPath-".concat(N)},E.createElement("rect",{x:S?f:f-p/2,y:j?u:u-g/2,width:S?p:p*2,height:j?g:g*2})),!M&&E.createElement("clipPath",{id:"clipPath-dots-".concat(N)},E.createElement("rect",{x:f-$/2,y:u-$/2,width:p+$,height:g+$}))):null,v?null:this.renderArea(w,N),(o||v)&&this.renderDots(w,M,N),(!b||y)&&zr.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:a.curPoints,prevBaseLine:a.curBaseLine}:n.points!==a.curPoints||n.baseLine!==a.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(O.PureComponent);ZO=Jr;yr(Jr,"displayName","Area");yr(Jr,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Oa.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});yr(Jr,"getBaseValue",function(e,t,r,n){var a=e.layout,i=e.baseValue,o=t.props.baseValue,l=o??i;if(W(l)&&typeof l=="number")return l;var c=a==="horizontal"?n:r,u=c.scale.domain();if(c.type==="number"){var f=Math.max(u[0],u[1]),d=Math.min(u[0],u[1]);return l==="dataMin"?d:l==="dataMax"||f<0?f:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});yr(Jr,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,a=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,f=e.dataStartIndex,d=e.displayedData,h=e.offset,p=t.layout,g=u&&u.length,b=ZO.getBaseValue(t,r,n,a),x=p==="horizontal",y=!1,v=d.map(function(S,j){var w;g?w=u[f+j]:(w=Ke(S,c),Array.isArray(w)?y=!0:w=[b,w]);var N=w[1]==null||g&&Ke(S,c)==null;return x?{x:pb({axis:n,ticks:i,bandSize:l,entry:S,index:j}),y:N?null:a.scale(w[1]),value:w,payload:S}:{x:N?null:n.scale(w[1]),y:pb({axis:a,ticks:o,bandSize:l,entry:S,index:j}),value:w,payload:S}}),m;return g||y?m=v.map(function(S){var j=Array.isArray(S.value)?S.value[0]:null;return x?{x:S.x,y:j!=null&&S.y!=null?a.scale(j):null}:{x:j!=null?n.scale(j):null,y:S.y}}):m=x?a.scale(b):n.scale(b),rn({points:v,baseLine:m,layout:p,isRange:y},h)});yr(Jr,"renderDotItem",function(e,t){var r;if(E.isValidElement(e))r=E.cloneElement(e,t);else if(Z(e))r=e(t);else{var n=te("recharts-area-dot",typeof e!="boolean"?e.className:""),a=t.key,i=JO(t,IX);r=E.createElement(Id,aa({},i,{key:a,className:n}))}return r});function Ki(e){"@babel/helpers - typeof";return Ki=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},Ki(e)}function HX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KX(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a2(n.key),n)}}function VX(e,t,r){return t&&KX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function GX(e,t,r){return t=Iu(t),YX(e,r2()?Reflect.construct(t,r||[],Iu(e).constructor):t.apply(e,r))}function YX(e,t){if(t&&(Ki(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qX(e)}function qX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r2(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(r2=function(){return!!e})()}function Iu(e){return Iu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Iu(e)}function XX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mm(e,t)}function mm(e,t){return mm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},mm(e,t)}function n2(e,t,r){return t=a2(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a2(e){var t=QX(e,"string");return Ki(t)=="symbol"?t:t+""}function QX(e,t){if(Ki(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ki(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function vm(){return vm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vm.apply(this,arguments)}function ZX(e){var t=e.xAxisId,r=wg(),n=Sg(),a=FO(t);return a==null?null:O.createElement(po,vm({},a,{className:te("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return Dr(o,!0)}}))}var Rn=function(e){function t(){return HX(this,t),GX(this,t,arguments)}return XX(t,e),VX(t,[{key:"render",value:function(){return O.createElement(ZX,this.props)}}])}(O.Component);n2(Rn,"displayName","XAxis");n2(Rn,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function Vi(e){"@babel/helpers - typeof";return Vi=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},Vi(e)}function JX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s2(n.key),n)}}function tQ(e,t,r){return t&&eQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function rQ(e,t,r){return t=Lu(t),nQ(e,i2()?Reflect.construct(t,r||[],Lu(e).constructor):t.apply(e,r))}function nQ(e,t){if(t&&(Vi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aQ(e)}function aQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i2(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(i2=function(){return!!e})()}function Lu(e){return Lu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lu(e)}function iQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gm(e,t)}function gm(e,t){return gm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},gm(e,t)}function o2(e,t,r){return t=s2(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s2(e){var t=oQ(e,"string");return Vi(t)=="symbol"?t:t+""}function oQ(e,t){if(Vi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Vi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ym(){return ym=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ym.apply(this,arguments)}var sQ=function(t){var r=t.yAxisId,n=wg(),a=Sg(),i=zO(r);return i==null?null:O.createElement(po,ym({},i,{className:te("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:a},ticksGenerator:function(l){return Dr(l,!0)}}))},Bn=function(e){function t(){return JX(this,t),rQ(this,t,arguments)}return iQ(t,e),tQ(t,[{key:"render",value:function(){return O.createElement(sQ,this.props)}}])}(O.Component);o2(Bn,"displayName","YAxis");o2(Bn,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function z1(e){return dQ(e)||uQ(e)||cQ(e)||lQ()}function lQ(){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 cQ(e,t){if(e){if(typeof e=="string")return xm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xm(e,t)}}function uQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dQ(e){if(Array.isArray(e))return xm(e)}function xm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var bm=function(t,r,n,a,i){var o=Xt(t,Ng),l=Xt(t,Hd),c=[].concat(z1(o),z1(l)),u=Xt(t,Vd),f="".concat(a,"Id"),d=a[0],h=r;if(c.length&&(h=c.reduce(function(b,x){if(x.props[f]===n&&wr(x.props,"extendDomain")&&W(x.props[d])){var y=x.props[d];return[Math.min(b[0],y),Math.max(b[1],y)]}return b},h)),u.length){var p="".concat(d,"1"),g="".concat(d,"2");h=u.reduce(function(b,x){if(x.props[f]===n&&wr(x.props,"extendDomain")&&W(x.props[p])&&W(x.props[g])){var y=x.props[p],v=x.props[g];return[Math.min(b[0],y,v),Math.max(b[1],y,v)]}return b},h)}return i&&i.length&&(h=i.reduce(function(b,x){return W(x)?[Math.min(b[0],x),Math.max(b[1],x)]:b},h)),h},l2={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function a(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function i(c,u,f,d,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var p=new a(f,d||c,h),g=r?r+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],p]:c._events[g].push(p):(c._events[g]=p,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,d;if(this._eventsCount===0)return u;for(d in f=this._events)t.call(f,d)&&u.push(r?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=r?r+u:u,d=this._events[f];if(!d)return[];if(d.fn)return[d.fn];for(var h=0,p=d.length,g=new Array(p);h<p;h++)g[h]=d[h].fn;return g},l.prototype.listenerCount=function(u){var f=r?r+u:u,d=this._events[f];return d?d.fn?1:d.length:0},l.prototype.emit=function(u,f,d,h,p,g){var b=r?r+u:u;if(!this._events[b])return!1;var x=this._events[b],y=arguments.length,v,m;if(x.fn){switch(x.once&&this.removeListener(u,x.fn,void 0,!0),y){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,f),!0;case 3:return x.fn.call(x.context,f,d),!0;case 4:return x.fn.call(x.context,f,d,h),!0;case 5:return x.fn.call(x.context,f,d,h,p),!0;case 6:return x.fn.call(x.context,f,d,h,p,g),!0}for(m=1,v=new Array(y-1);m<y;m++)v[m-1]=arguments[m];x.fn.apply(x.context,v)}else{var S=x.length,j;for(m=0;m<S;m++)switch(x[m].once&&this.removeListener(u,x[m].fn,void 0,!0),y){case 1:x[m].fn.call(x[m].context);break;case 2:x[m].fn.call(x[m].context,f);break;case 3:x[m].fn.call(x[m].context,f,d);break;case 4:x[m].fn.call(x[m].context,f,d,h);break;default:if(!v)for(j=1,v=new Array(y-1);j<y;j++)v[j-1]=arguments[j];x[m].fn.apply(x[m].context,v)}}return!0},l.prototype.on=function(u,f,d){return i(this,u,f,d,!1)},l.prototype.once=function(u,f,d){return i(this,u,f,d,!0)},l.prototype.removeListener=function(u,f,d,h){var p=r?r+u:u;if(!this._events[p])return this;if(!f)return o(this,p),this;var g=this._events[p];if(g.fn)g.fn===f&&(!h||g.once)&&(!d||g.context===d)&&o(this,p);else{for(var b=0,x=[],y=g.length;b<y;b++)(g[b].fn!==f||h&&!g[b].once||d&&g[b].context!==d)&&x.push(g[b]);x.length?this._events[p]=x.length===1?x[0]:x:o(this,p)}return this},l.prototype.removeAllListeners=function(u){var f;return u?(f=r?r+u:u,this._events[f]&&o(this,f)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(l2);var fQ=l2.exports;const hQ=de(fQ);var Xf=new hQ,Qf="recharts.syncMouseEvents";function el(e){"@babel/helpers - typeof";return el=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},el(e)}function pQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c2(n.key),n)}}function vQ(e,t,r){return t&&mQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zf(e,t,r){return t=c2(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c2(e){var t=gQ(e,"string");return el(t)=="symbol"?t:t+""}function gQ(e,t){if(el(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(el(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var yQ=function(){function e(){pQ(this,e),Zf(this,"activeIndex",0),Zf(this,"coordinateList",[]),Zf(this,"layout","horizontal")}return vQ(e,[{key:"setDetails",value:function(r){var n,a=r.coordinateList,i=a===void 0?null:a,o=r.container,l=o===void 0?null:o,c=r.layout,u=c===void 0?null:c,f=r.offset,d=f===void 0?null:f,h=r.mouseHandlerCallback,p=h===void 0?null:h;this.coordinateList=(n=i??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=d??this.offset,this.mouseHandlerCallback=p??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),i=a.x,o=a.y,l=a.height,c=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,f=((n=window)===null||n===void 0?void 0:n.scrollY)||0,d=i+c+u,h=o+this.offset.top+l/2+f;this.mouseHandlerCallback({pageX:d,pageY:h})}}}])}();function xQ(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],a=e==null?void 0:e[1];if(n&&a&&W(n)&&W(a))return!0}return!1}function bQ(e,t,r,n){var a=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-a,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function u2(e){var t=e.cx,r=e.cy,n=e.radius,a=e.startAngle,i=e.endAngle,o=xe(t,r,n,a),l=xe(t,r,n,i);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:a,endAngle:i}}function jQ(e,t,r){var n,a,i,o;if(e==="horizontal")n=t.x,i=n,a=r.top,o=r.top+r.height;else if(e==="vertical")a=t.y,o=a,n=r.left,i=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,f=t.outerRadius,d=t.angle,h=xe(l,c,u,d),p=xe(l,c,f,d);n=h.x,a=h.y,i=p.x,o=p.y}else return u2(t);return[{x:n,y:a},{x:i,y:o}]}function tl(e){"@babel/helpers - typeof";return tl=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},tl(e)}function W1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Gl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?W1(Object(r),!0).forEach(function(n){wQ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wQ(e,t,r){return t=SQ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SQ(e){var t=_Q(e,"string");return tl(t)=="symbol"?t:t+""}function _Q(e,t){if(tl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(tl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NQ(e){var t,r,n=e.element,a=e.tooltipEventType,i=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,f=e.tooltipAxisBandSize,d=e.layout,h=e.chartName,p=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!p||!i||!o||h!=="ScatterChart"&&a!=="axis")return null;var g,b=pi;if(h==="ScatterChart")g=o,b=GK;else if(h==="BarChart")g=bQ(d,o,c,f),b=yg;else if(d==="radial"){var x=u2(o),y=x.cx,v=x.cy,m=x.radius,S=x.startAngle,j=x.endAngle;g={cx:y,cy:v,startAngle:S,endAngle:j,innerRadius:m,outerRadius:m},b=aO}else g={points:jQ(d,o,c)},b=pi;var w=Gl(Gl(Gl(Gl({stroke:"#ccc",pointerEvents:"none"},c),g),X(p,!1)),{},{payload:l,payloadIndex:u,className:te("recharts-tooltip-cursor",p.className)});return O.isValidElement(p)?O.cloneElement(p,w):O.createElement(b,w)}var OQ=["item"],kQ=["children","className","width","height","style","compact","title","desc"];function Gi(e){"@babel/helpers - typeof";return Gi=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},Gi(e)}function ni(){return ni=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ni.apply(this,arguments)}function U1(e,t){return $Q(e)||AQ(e,t)||f2(e,t)||PQ()}function PQ(){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 AQ(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function $Q(e){if(Array.isArray(e))return e}function H1(e,t){if(e==null)return{};var r=EQ(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function EQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function CQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,h2(n.key),n)}}function MQ(e,t,r){return t&&TQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function IQ(e,t,r){return t=Du(t),LQ(e,d2()?Reflect.construct(t,r||[],Du(e).constructor):t.apply(e,r))}function LQ(e,t){if(t&&(Gi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return DQ(e)}function DQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d2(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(d2=function(){return!!e})()}function Du(e){return Du=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Du(e)}function RQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jm(e,t)}function jm(e,t){return jm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},jm(e,t)}function Yi(e){return zQ(e)||FQ(e)||f2(e)||BQ()}function BQ(){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 f2(e,t){if(e){if(typeof e=="string")return wm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wm(e,t)}}function FQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zQ(e){if(Array.isArray(e))return wm(e)}function wm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function K1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?K1(Object(r),!0).forEach(function(n){Q(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Q(e,t,r){return t=h2(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h2(e){var t=WQ(e,"string");return Gi(t)=="symbol"?t:t+""}function WQ(e,t){if(Gi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Gi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var UQ={xAxis:["bottom","top"],yAxis:["left","right"]},HQ={width:"100%",height:"100%"},p2={x:0,y:0};function Yl(e){return e}var KQ=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},VQ=function(t,r,n,a){var i=r.find(function(f){return f&&f.index===n});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var o=i.coordinate,l=a.radius;return R(R(R({},a),xe(a.cx,a.cy,l,o)),{},{angle:o,radius:l})}var c=i.coordinate,u=a.angle;return R(R(R({},a),xe(a.cx,a.cy,c,u)),{},{angle:u,radius:c})}return p2},Gd=function(t,r){var n=r.graphicalItems,a=r.dataStartIndex,i=r.dataEndIndex,o=(n??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(Yi(l),Yi(u)):l},[]);return o.length>0?o:t&&t.length&&W(a)&&W(i)?t.slice(a,i+1):[]};function m2(e){return e==="number"?[0,"auto"]:void 0}var Sm=function(t,r,n,a){var i=t.graphicalItems,o=t.tooltipAxis,l=Gd(r,t);return n<0||!i||!i.length||n>=l.length?null:i.reduce(function(c,u){var f,d=(f=u.props.data)!==null&&f!==void 0?f:r;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=d===void 0?l:d;h=Lc(p,o.dataKey,a)}else h=d&&d[n]||l[n];return h?[].concat(Yi(c),[ZN(u,h)]):c},[])},V1=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},o=KQ(i,n),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,f=hW(o,l,u,c);if(f>=0&&u){var d=u[f]&&u[f].value,h=Sm(t,r,f,d),p=VQ(n,l,f,i);return{activeTooltipIndex:f,activeLabel:d,activePayload:h,activeCoordinate:p}}return null},GQ=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,h=t.stackOffset,p=VN(f,i);return n.reduce(function(g,b){var x,y=b.type.defaultProps!==void 0?R(R({},b.type.defaultProps),b.props):b.props,v=y.type,m=y.dataKey,S=y.allowDataOverflow,j=y.allowDuplicatedCategory,w=y.scale,N=y.ticks,_=y.includeHidden,k=y[o];if(g[k])return g;var A=Gd(t.data,{graphicalItems:a.filter(function(H){var q,ie=o in H.props?H.props[o]:(q=H.type.defaultProps)===null||q===void 0?void 0:q[o];return ie===k}),dataStartIndex:c,dataEndIndex:u}),T=A.length,C,D,P;xQ(y.domain,S,v)&&(C=Rp(y.domain,null,S),p&&(v==="number"||w!=="auto")&&(P=Zo(A,m,"category")));var M=m2(v);if(!C||C.length===0){var $,I=($=y.domain)!==null&&$!==void 0?$:M;if(m){if(C=Zo(A,m,v),v==="category"&&p){var L=rM(C);j&&L?(D=C,C=_u(0,T)):j||(C=yb(I,C,b).reduce(function(H,q){return H.indexOf(q)>=0?H:[].concat(Yi(H),[q])},[]))}else if(v==="category")j?C=C.filter(function(H){return H!==""&&!J(H)}):C=yb(I,C,b).reduce(function(H,q){return H.indexOf(q)>=0||q===""||J(q)?H:[].concat(Yi(H),[q])},[]);else if(v==="number"){var B=yW(A,a.filter(function(H){var q,ie,_e=o in H.props?H.props[o]:(q=H.type.defaultProps)===null||q===void 0?void 0:q[o],Me="hide"in H.props?H.props.hide:(ie=H.type.defaultProps)===null||ie===void 0?void 0:ie.hide;return _e===k&&(_||!Me)}),m,i,f);B&&(C=B)}p&&(v==="number"||w!=="auto")&&(P=Zo(A,m,"category"))}else p?C=_u(0,T):l&&l[k]&&l[k].hasStack&&v==="number"?C=h==="expand"?[0,1]:QN(l[k].stackGroups,c,u):C=KN(A,a.filter(function(H){var q=o in H.props?H.props[o]:H.type.defaultProps[o],ie="hide"in H.props?H.props.hide:H.type.defaultProps.hide;return q===k&&(_||!ie)}),v,f,!0);if(v==="number")C=bm(d,C,k,i,N),I&&(C=Rp(I,C,S));else if(v==="category"&&I){var F=I,K=C.every(function(H){return F.indexOf(H)>=0});K&&(C=F)}}return R(R({},g),{},Q({},k,R(R({},y),{},{axisType:i,domain:C,categoricalDomain:P,duplicateDomain:D,originalDomain:(x=y.domain)!==null&&x!==void 0?x:M,isCategorical:p,layout:f})))},{})},YQ=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,h=Gd(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),p=h.length,g=VN(f,i),b=-1;return n.reduce(function(x,y){var v=y.type.defaultProps!==void 0?R(R({},y.type.defaultProps),y.props):y.props,m=v[o],S=m2("number");if(!x[m]){b++;var j;return g?j=_u(0,p):l&&l[m]&&l[m].hasStack?(j=QN(l[m].stackGroups,c,u),j=bm(d,j,m,i)):(j=Rp(S,KN(h,n.filter(function(w){var N,_,k=o in w.props?w.props[o]:(N=w.type.defaultProps)===null||N===void 0?void 0:N[o],A="hide"in w.props?w.props.hide:(_=w.type.defaultProps)===null||_===void 0?void 0:_.hide;return k===m&&!A}),"number",f),a.defaultProps.allowDataOverflow),j=bm(d,j,m,i)),R(R({},x),{},Q({},m,R(R({axisType:i},a.defaultProps),{},{hide:!0,orientation:Lt(UQ,"".concat(i,".").concat(b%2),null),domain:j,originalDomain:S,isCategorical:g,layout:f})))}return x},{})},qQ=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,o=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.children,d="".concat(a,"Id"),h=Xt(f,i),p={};return h&&h.length?p=GQ(t,{axes:h,graphicalItems:o,axisType:a,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(p=YQ(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},XQ=function(t){var r=un(t),n=Dr(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Kv(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:du(r,n)}},G1=function(t){var r=t.children,n=t.defaultShowTooltip,a=Ct(r,Ri),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},QQ=function(t){return!t||!t.length?!1:t.some(function(r){var n=Br(r&&r.type);return n&&n.indexOf("Bar")>=0})},Y1=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"}},ZQ=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,l=t.yAxisMap,c=l===void 0?{}:l,u=n.width,f=n.height,d=n.children,h=n.margin||{},p=Ct(d,Ri),g=Ct(d,di),b=Object.keys(c).reduce(function(j,w){var N=c[w],_=N.orientation;return!N.mirror&&!N.hide?R(R({},j),{},Q({},_,j[_]+N.width)):j},{left:h.left||0,right:h.right||0}),x=Object.keys(o).reduce(function(j,w){var N=o[w],_=N.orientation;return!N.mirror&&!N.hide?R(R({},j),{},Q({},_,Lt(j,"".concat(_))+N.height)):j},{top:h.top||0,bottom:h.bottom||0}),y=R(R({},x),b),v=y.bottom;p&&(y.bottom+=p.props.height||Ri.defaultProps.height),g&&r&&(y=vW(y,a,n,r));var m=u-y.left-y.right,S=f-y.top-y.bottom;return R(R({brushBottom:v},y),{},{width:Math.max(m,0),height:Math.max(S,0)})},JQ=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},Ag=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,d=t.defaultProps,h=function(y,v){var m=v.graphicalItems,S=v.stackGroups,j=v.offset,w=v.updateId,N=v.dataStartIndex,_=v.dataEndIndex,k=y.barSize,A=y.layout,T=y.barGap,C=y.barCategoryGap,D=y.maxBarSize,P=Y1(A),M=P.numericAxisName,$=P.cateAxisName,I=QQ(m),L=[];return m.forEach(function(B,F){var K=Gd(y.data,{graphicalItems:[B],dataStartIndex:N,dataEndIndex:_}),H=B.type.defaultProps!==void 0?R(R({},B.type.defaultProps),B.props):B.props,q=H.dataKey,ie=H.maxBarSize,_e=H["".concat(M,"Id")],Me=H["".concat($,"Id")],Ft={},yt=c.reduce(function(Fn,zn){var Yd=v["".concat(zn.axisType,"Map")],Eg=H["".concat(zn.axisType,"Id")];Yd&&Yd[Eg]||zn.axisType==="zAxis"||ba();var Cg=Yd[Eg];return R(R({},Fn),{},Q(Q({},zn.axisType,Cg),"".concat(zn.axisType,"Ticks"),Dr(Cg)))},Ft),V=yt[$],ee=yt["".concat($,"Ticks")],re=S&&S[_e]&&S[_e].hasStack&&kW(B,S[_e].stackGroups),z=Br(B.type).indexOf("Bar")>=0,Ee=du(V,ee),oe=[],Fe=I&&pW({barSize:k,stackGroups:S,totalSize:JQ(yt,$)});if(z){var ze,xt,en=J(ie)?D:ie,$a=(ze=(xt=du(V,ee,!0))!==null&&xt!==void 0?xt:en)!==null&&ze!==void 0?ze:0;oe=mW({barGap:T,barCategoryGap:C,bandSize:$a!==Ee?$a:Ee,sizeList:Fe[Me],maxBarSize:en}),$a!==Ee&&(oe=oe.map(function(Fn){return R(R({},Fn),{},{position:R(R({},Fn.position),{},{offset:Fn.position.offset-$a/2})})}))}var ml=B&&B.type&&B.type.getComposedData;ml&&L.push({props:R(R({},ml(R(R({},yt),{},{displayedData:K,props:y,dataKey:q,item:B,bandSize:Ee,barPosition:oe,offset:j,stackedData:re,layout:A,dataStartIndex:N,dataEndIndex:_}))),{},Q(Q(Q({key:B.key||"item-".concat(F)},M,yt[M]),$,yt[$]),"animationId",w)),childIndex:mM(B,y.children),item:B})}),L},p=function(y,v){var m=y.props,S=y.dataStartIndex,j=y.dataEndIndex,w=y.updateId;if(!d0({props:m}))return null;var N=m.children,_=m.layout,k=m.stackOffset,A=m.data,T=m.reverseStackOrder,C=Y1(_),D=C.numericAxisName,P=C.cateAxisName,M=Xt(N,n),$=NW(A,M,"".concat(D,"Id"),"".concat(P,"Id"),k,T),I=c.reduce(function(H,q){var ie="".concat(q.axisType,"Map");return R(R({},H),{},Q({},ie,qQ(m,R(R({},q),{},{graphicalItems:M,stackGroups:q.axisType===D&&$,dataStartIndex:S,dataEndIndex:j}))))},{}),L=ZQ(R(R({},I),{},{props:m,graphicalItems:M}),v==null?void 0:v.legendBBox);Object.keys(I).forEach(function(H){I[H]=f(m,I[H],L,H.replace("Map",""),r)});var B=I["".concat(P,"Map")],F=XQ(B),K=h(m,R(R({},I),{},{dataStartIndex:S,dataEndIndex:j,updateId:w,graphicalItems:M,stackGroups:$,offset:L}));return R(R({formattedGraphicalItems:K,graphicalItems:M,offset:L,stackGroups:$},F),I)},g=function(x){function y(v){var m,S,j;return CQ(this,y),j=IQ(this,y,[v]),Q(j,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Q(j,"accessibilityManager",new yQ),Q(j,"handleLegendBBoxUpdate",function(w){if(w){var N=j.state,_=N.dataStartIndex,k=N.dataEndIndex,A=N.updateId;j.setState(R({legendBBox:w},p({props:j.props,dataStartIndex:_,dataEndIndex:k,updateId:A},R(R({},j.state),{},{legendBBox:w}))))}}),Q(j,"handleReceiveSyncEvent",function(w,N,_){if(j.props.syncId===w){if(_===j.eventEmitterSymbol&&typeof j.props.syncMethod!="function")return;j.applySyncEvent(N)}}),Q(j,"handleBrushChange",function(w){var N=w.startIndex,_=w.endIndex;if(N!==j.state.dataStartIndex||_!==j.state.dataEndIndex){var k=j.state.updateId;j.setState(function(){return R({dataStartIndex:N,dataEndIndex:_},p({props:j.props,dataStartIndex:N,dataEndIndex:_,updateId:k},j.state))}),j.triggerSyncEvent({dataStartIndex:N,dataEndIndex:_})}}),Q(j,"handleMouseEnter",function(w){var N=j.getMouseInfo(w);if(N){var _=R(R({},N),{},{isTooltipActive:!0});j.setState(_),j.triggerSyncEvent(_);var k=j.props.onMouseEnter;Z(k)&&k(_,w)}}),Q(j,"triggeredAfterMouseMove",function(w){var N=j.getMouseInfo(w),_=N?R(R({},N),{},{isTooltipActive:!0}):{isTooltipActive:!1};j.setState(_),j.triggerSyncEvent(_);var k=j.props.onMouseMove;Z(k)&&k(_,w)}),Q(j,"handleItemMouseEnter",function(w){j.setState(function(){return{isTooltipActive:!0,activeItem:w,activePayload:w.tooltipPayload,activeCoordinate:w.tooltipPosition||{x:w.cx,y:w.cy}}})}),Q(j,"handleItemMouseLeave",function(){j.setState(function(){return{isTooltipActive:!1}})}),Q(j,"handleMouseMove",function(w){w.persist(),j.throttleTriggeredAfterMouseMove(w)}),Q(j,"handleMouseLeave",function(w){j.throttleTriggeredAfterMouseMove.cancel();var N={isTooltipActive:!1};j.setState(N),j.triggerSyncEvent(N);var _=j.props.onMouseLeave;Z(_)&&_(N,w)}),Q(j,"handleOuterEvent",function(w){var N=pM(w),_=Lt(j.props,"".concat(N));if(N&&Z(_)){var k,A;/.*touch.*/i.test(N)?A=j.getMouseInfo(w.changedTouches[0]):A=j.getMouseInfo(w),_((k=A)!==null&&k!==void 0?k:{},w)}}),Q(j,"handleClick",function(w){var N=j.getMouseInfo(w);if(N){var _=R(R({},N),{},{isTooltipActive:!0});j.setState(_),j.triggerSyncEvent(_);var k=j.props.onClick;Z(k)&&k(_,w)}}),Q(j,"handleMouseDown",function(w){var N=j.props.onMouseDown;if(Z(N)){var _=j.getMouseInfo(w);N(_,w)}}),Q(j,"handleMouseUp",function(w){var N=j.props.onMouseUp;if(Z(N)){var _=j.getMouseInfo(w);N(_,w)}}),Q(j,"handleTouchMove",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&j.throttleTriggeredAfterMouseMove(w.changedTouches[0])}),Q(j,"handleTouchStart",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&j.handleMouseDown(w.changedTouches[0])}),Q(j,"handleTouchEnd",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&j.handleMouseUp(w.changedTouches[0])}),Q(j,"handleDoubleClick",function(w){var N=j.props.onDoubleClick;if(Z(N)){var _=j.getMouseInfo(w);N(_,w)}}),Q(j,"handleContextMenu",function(w){var N=j.props.onContextMenu;if(Z(N)){var _=j.getMouseInfo(w);N(_,w)}}),Q(j,"triggerSyncEvent",function(w){j.props.syncId!==void 0&&Xf.emit(Qf,j.props.syncId,w,j.eventEmitterSymbol)}),Q(j,"applySyncEvent",function(w){var N=j.props,_=N.layout,k=N.syncMethod,A=j.state.updateId,T=w.dataStartIndex,C=w.dataEndIndex;if(w.dataStartIndex!==void 0||w.dataEndIndex!==void 0)j.setState(R({dataStartIndex:T,dataEndIndex:C},p({props:j.props,dataStartIndex:T,dataEndIndex:C,updateId:A},j.state)));else if(w.activeTooltipIndex!==void 0){var D=w.chartX,P=w.chartY,M=w.activeTooltipIndex,$=j.state,I=$.offset,L=$.tooltipTicks;if(!I)return;if(typeof k=="function")M=k(L,w);else if(k==="value"){M=-1;for(var B=0;B<L.length;B++)if(L[B].value===w.activeLabel){M=B;break}}var F=R(R({},I),{},{x:I.left,y:I.top}),K=Math.min(D,F.x+F.width),H=Math.min(P,F.y+F.height),q=L[M]&&L[M].value,ie=Sm(j.state,j.props.data,M),_e=L[M]?{x:_==="horizontal"?L[M].coordinate:K,y:_==="horizontal"?H:L[M].coordinate}:p2;j.setState(R(R({},w),{},{activeLabel:q,activeCoordinate:_e,activePayload:ie,activeTooltipIndex:M}))}else j.setState(w)}),Q(j,"renderCursor",function(w){var N,_=j.state,k=_.isTooltipActive,A=_.activeCoordinate,T=_.activePayload,C=_.offset,D=_.activeTooltipIndex,P=_.tooltipAxisBandSize,M=j.getTooltipEventType(),$=(N=w.props.active)!==null&&N!==void 0?N:k,I=j.props.layout,L=w.key||"_recharts-cursor";return E.createElement(NQ,{key:L,activeCoordinate:A,activePayload:T,activeTooltipIndex:D,chartName:r,element:w,isActive:$,layout:I,offset:C,tooltipAxisBandSize:P,tooltipEventType:M})}),Q(j,"renderPolarAxis",function(w,N,_){var k=Lt(w,"type.axisType"),A=Lt(j.state,"".concat(k,"Map")),T=w.type.defaultProps,C=T!==void 0?R(R({},T),w.props):w.props,D=A&&A[C["".concat(k,"Id")]];return O.cloneElement(w,R(R({},D),{},{className:te(k,D.className),key:w.key||"".concat(N,"-").concat(_),ticks:Dr(D,!0)}))}),Q(j,"renderPolarGrid",function(w){var N=w.props,_=N.radialLines,k=N.polarAngles,A=N.polarRadius,T=j.state,C=T.radiusAxisMap,D=T.angleAxisMap,P=un(C),M=un(D),$=M.cx,I=M.cy,L=M.innerRadius,B=M.outerRadius;return O.cloneElement(w,{polarAngles:Array.isArray(k)?k:Dr(M,!0).map(function(F){return F.coordinate}),polarRadius:Array.isArray(A)?A:Dr(P,!0).map(function(F){return F.coordinate}),cx:$,cy:I,innerRadius:L,outerRadius:B,key:w.key||"polar-grid",radialLines:_})}),Q(j,"renderLegend",function(){var w=j.state.formattedGraphicalItems,N=j.props,_=N.children,k=N.width,A=N.height,T=j.props.margin||{},C=k-(T.left||0)-(T.right||0),D=UN({children:_,formattedGraphicalItems:w,legendWidth:C,legendContent:u});if(!D)return null;var P=D.item,M=H1(D,OQ);return O.cloneElement(P,R(R({},M),{},{chartWidth:k,chartHeight:A,margin:T,onBBoxUpdate:j.handleLegendBBoxUpdate}))}),Q(j,"renderTooltip",function(){var w,N=j.props,_=N.children,k=N.accessibilityLayer,A=Ct(_,jt);if(!A)return null;var T=j.state,C=T.isTooltipActive,D=T.activeCoordinate,P=T.activePayload,M=T.activeLabel,$=T.offset,I=(w=A.props.active)!==null&&w!==void 0?w:C;return O.cloneElement(A,{viewBox:R(R({},$),{},{x:$.left,y:$.top}),active:I,label:M,payload:I?P:[],coordinate:D,accessibilityLayer:k})}),Q(j,"renderBrush",function(w){var N=j.props,_=N.margin,k=N.data,A=j.state,T=A.offset,C=A.dataStartIndex,D=A.dataEndIndex,P=A.updateId;return O.cloneElement(w,{key:w.key||"_recharts-brush",onChange:Ul(j.handleBrushChange,w.props.onChange),data:k,x:W(w.props.x)?w.props.x:T.left,y:W(w.props.y)?w.props.y:T.top+T.height+T.brushBottom-(_.bottom||0),width:W(w.props.width)?w.props.width:T.width,startIndex:C,endIndex:D,updateId:"brush-".concat(P)})}),Q(j,"renderReferenceElement",function(w,N,_){if(!w)return null;var k=j,A=k.clipPathId,T=j.state,C=T.xAxisMap,D=T.yAxisMap,P=T.offset,M=w.type.defaultProps||{},$=w.props,I=$.xAxisId,L=I===void 0?M.xAxisId:I,B=$.yAxisId,F=B===void 0?M.yAxisId:B;return O.cloneElement(w,{key:w.key||"".concat(N,"-").concat(_),xAxis:C[L],yAxis:D[F],viewBox:{x:P.left,y:P.top,width:P.width,height:P.height},clipPathId:A})}),Q(j,"renderActivePoints",function(w){var N=w.item,_=w.activePoint,k=w.basePoint,A=w.childIndex,T=w.isRange,C=[],D=N.props.key,P=N.item.type.defaultProps!==void 0?R(R({},N.item.type.defaultProps),N.item.props):N.item.props,M=P.activeDot,$=P.dataKey,I=R(R({index:A,dataKey:$,cx:_.x,cy:_.y,r:4,fill:gg(N.item),strokeWidth:2,stroke:"#fff",payload:_.payload,value:_.value},X(M,!1)),Dc(M));return C.push(y.renderActiveDot(M,I,"".concat(D,"-activePoint-").concat(A))),k?C.push(y.renderActiveDot(M,R(R({},I),{},{cx:k.x,cy:k.y}),"".concat(D,"-basePoint-").concat(A))):T&&C.push(null),C}),Q(j,"renderGraphicChild",function(w,N,_){var k=j.filterFormatItem(w,N,_);if(!k)return null;var A=j.getTooltipEventType(),T=j.state,C=T.isTooltipActive,D=T.tooltipAxis,P=T.activeTooltipIndex,M=T.activeLabel,$=j.props.children,I=Ct($,jt),L=k.props,B=L.points,F=L.isRange,K=L.baseLine,H=k.item.type.defaultProps!==void 0?R(R({},k.item.type.defaultProps),k.item.props):k.item.props,q=H.activeDot,ie=H.hide,_e=H.activeBar,Me=H.activeShape,Ft=!!(!ie&&C&&I&&(q||_e||Me)),yt={};A!=="axis"&&I&&I.props.trigger==="click"?yt={onClick:Ul(j.handleItemMouseEnter,w.props.onClick)}:A!=="axis"&&(yt={onMouseLeave:Ul(j.handleItemMouseLeave,w.props.onMouseLeave),onMouseEnter:Ul(j.handleItemMouseEnter,w.props.onMouseEnter)});var V=O.cloneElement(w,R(R({},k.props),yt));function ee(zn){return typeof D.dataKey=="function"?D.dataKey(zn.payload):null}if(Ft)if(P>=0){var re,z;if(D.dataKey&&!D.allowDuplicatedCategory){var Ee=typeof D.dataKey=="function"?ee:"payload.".concat(D.dataKey.toString());re=Lc(B,Ee,M),z=F&&K&&Lc(K,Ee,M)}else re=B==null?void 0:B[P],z=F&&K&&K[P];if(Me||_e){var oe=w.props.activeIndex!==void 0?w.props.activeIndex:P;return[O.cloneElement(w,R(R(R({},k.props),yt),{},{activeIndex:oe})),null,null]}if(!J(re))return[V].concat(Yi(j.renderActivePoints({item:k,activePoint:re,basePoint:z,childIndex:P,isRange:F})))}else{var Fe,ze=(Fe=j.getItemByXY(j.state.activeCoordinate))!==null&&Fe!==void 0?Fe:{graphicalItem:V},xt=ze.graphicalItem,en=xt.item,$a=en===void 0?w:en,ml=xt.childIndex,Fn=R(R(R({},k.props),yt),{},{activeIndex:ml});return[O.cloneElement($a,Fn),null,null]}return F?[V,null,null]:[V,null]}),Q(j,"renderCustomized",function(w,N,_){return O.cloneElement(w,R(R({key:"recharts-customized-".concat(_)},j.props),j.state))}),Q(j,"renderMap",{CartesianGrid:{handler:Yl,once:!0},ReferenceArea:{handler:j.renderReferenceElement},ReferenceLine:{handler:Yl},ReferenceDot:{handler:j.renderReferenceElement},XAxis:{handler:Yl},YAxis:{handler:Yl},Brush:{handler:j.renderBrush,once:!0},Bar:{handler:j.renderGraphicChild},Line:{handler:j.renderGraphicChild},Area:{handler:j.renderGraphicChild},Radar:{handler:j.renderGraphicChild},RadialBar:{handler:j.renderGraphicChild},Scatter:{handler:j.renderGraphicChild},Pie:{handler:j.renderGraphicChild},Funnel:{handler:j.renderGraphicChild},Tooltip:{handler:j.renderCursor,once:!0},PolarGrid:{handler:j.renderPolarGrid,once:!0},PolarAngleAxis:{handler:j.renderPolarAxis},PolarRadiusAxis:{handler:j.renderPolarAxis},Customized:{handler:j.renderCustomized}}),j.clipPathId="".concat((m=v.id)!==null&&m!==void 0?m:oo("recharts"),"-clip"),j.throttleTriggeredAfterMouseMove=U_(j.triggeredAfterMouseMove,(S=v.throttleDelay)!==null&&S!==void 0?S:1e3/60),j.state={},j}return RQ(y,x),MQ(y,[{key:"componentDidMount",value:function(){var m,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(m=this.props.margin.left)!==null&&m!==void 0?m:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var m=this.props,S=m.children,j=m.data,w=m.height,N=m.layout,_=Ct(S,jt);if(_){var k=_.props.defaultIndex;if(!(typeof k!="number"||k<0||k>this.state.tooltipTicks.length-1)){var A=this.state.tooltipTicks[k]&&this.state.tooltipTicks[k].value,T=Sm(this.state,j,k,A),C=this.state.tooltipTicks[k].coordinate,D=(this.state.offset.top+w)/2,P=N==="horizontal",M=P?{x:C,y:D}:{y:C,x:D},$=this.state.formattedGraphicalItems.find(function(L){var B=L.item;return B.type.name==="Scatter"});$&&(M=R(R({},M),$.props.points[k].tooltipPosition),T=$.props.points[k].tooltipPayload);var I={activeTooltipIndex:k,isTooltipActive:!0,activeLabel:A,activePayload:T,activeCoordinate:M};this.setState(I),this.renderCursor(_),this.accessibilityManager.setIndex(k)}}}},{key:"getSnapshotBeforeUpdate",value:function(m,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==m.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==m.margin){var j,w;this.accessibilityManager.setDetails({offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0}})}return null}},{key:"componentDidUpdate",value:function(m){Jh([Ct(m.children,jt)],[Ct(this.props.children,jt)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var m=Ct(this.props.children,jt);if(m&&typeof m.props.shared=="boolean"){var S=m.props.shared?"axis":"item";return l.indexOf(S)>=0?S:i}return i}},{key:"getMouseInfo",value:function(m){if(!this.container)return null;var S=this.container,j=S.getBoundingClientRect(),w=zB(j),N={chartX:Math.round(m.pageX-w.left),chartY:Math.round(m.pageY-w.top)},_=j.width/S.offsetWidth||1,k=this.inRange(N.chartX,N.chartY,_);if(!k)return null;var A=this.state,T=A.xAxisMap,C=A.yAxisMap,D=this.getTooltipEventType(),P=V1(this.state,this.props.data,this.props.layout,k);if(D!=="axis"&&T&&C){var M=un(T).scale,$=un(C).scale,I=M&&M.invert?M.invert(N.chartX):null,L=$&&$.invert?$.invert(N.chartY):null;return R(R({},N),{},{xValue:I,yValue:L},P)}return P?R(R({},N),P):null}},{key:"inRange",value:function(m,S){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,w=this.props.layout,N=m/j,_=S/j;if(w==="horizontal"||w==="vertical"){var k=this.state.offset,A=N>=k.left&&N<=k.left+k.width&&_>=k.top&&_<=k.top+k.height;return A?{x:N,y:_}:null}var T=this.state,C=T.angleAxisMap,D=T.radiusAxisMap;if(C&&D){var P=un(C);return jb({x:N,y:_},P)}return null}},{key:"parseEventsOfWrapper",value:function(){var m=this.props.children,S=this.getTooltipEventType(),j=Ct(m,jt),w={};j&&S==="axis"&&(j.props.trigger==="click"?w={onClick:this.handleClick}:w={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 N=Dc(this.props,this.handleOuterEvent);return R(R({},N),w)}},{key:"addListener",value:function(){Xf.on(Qf,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Xf.removeListener(Qf,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(m,S,j){for(var w=this.state.formattedGraphicalItems,N=0,_=w.length;N<_;N++){var k=w[N];if(k.item===m||k.props.key===m.key||S===Br(k.item.type)&&j===k.childIndex)return k}return null}},{key:"renderClipPath",value:function(){var m=this.clipPathId,S=this.state.offset,j=S.left,w=S.top,N=S.height,_=S.width;return E.createElement("defs",null,E.createElement("clipPath",{id:m},E.createElement("rect",{x:j,y:w,height:N,width:_})))}},{key:"getXScales",value:function(){var m=this.state.xAxisMap;return m?Object.entries(m).reduce(function(S,j){var w=U1(j,2),N=w[0],_=w[1];return R(R({},S),{},Q({},N,_.scale))},{}):null}},{key:"getYScales",value:function(){var m=this.state.yAxisMap;return m?Object.entries(m).reduce(function(S,j){var w=U1(j,2),N=w[0],_=w[1];return R(R({},S),{},Q({},N,_.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(m){var S;return(S=this.state.xAxisMap)===null||S===void 0||(S=S[m])===null||S===void 0?void 0:S.scale}},{key:"getYScaleByAxisId",value:function(m){var S;return(S=this.state.yAxisMap)===null||S===void 0||(S=S[m])===null||S===void 0?void 0:S.scale}},{key:"getItemByXY",value:function(m){var S=this.state,j=S.formattedGraphicalItems,w=S.activeItem;if(j&&j.length)for(var N=0,_=j.length;N<_;N++){var k=j[N],A=k.props,T=k.item,C=T.type.defaultProps!==void 0?R(R({},T.type.defaultProps),T.props):T.props,D=Br(T.type);if(D==="Bar"){var P=(A.data||[]).find(function(L){return kK(m,L)});if(P)return{graphicalItem:k,payload:P}}else if(D==="RadialBar"){var M=(A.data||[]).find(function(L){return jb(m,L)});if(M)return{graphicalItem:k,payload:M}}else if(Fd(k,w)||zd(k,w)||qs(k,w)){var $=mG({graphicalItem:k,activeTooltipItem:w,itemData:C.data}),I=C.activeIndex===void 0?$:C.activeIndex;return{graphicalItem:R(R({},k),{},{childIndex:I}),payload:qs(k,w)?C.data[$]:k.props.data[$]}}}return null}},{key:"render",value:function(){var m=this;if(!d0(this))return null;var S=this.props,j=S.children,w=S.className,N=S.width,_=S.height,k=S.style,A=S.compact,T=S.title,C=S.desc,D=H1(S,kQ),P=X(D,!1);if(A)return E.createElement(O1,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},E.createElement(tp,ni({},P,{width:N,height:_,title:T,desc:C}),this.renderClipPath(),h0(j,this.renderMap)));if(this.props.accessibilityLayer){var M,$;P.tabIndex=(M=this.props.tabIndex)!==null&&M!==void 0?M:0,P.role=($=this.props.role)!==null&&$!==void 0?$:"application",P.onKeyDown=function(L){m.accessibilityManager.keyboardEvent(L)},P.onFocus=function(){m.accessibilityManager.focus()}}var I=this.parseEventsOfWrapper();return E.createElement(O1,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},E.createElement("div",ni({className:te("recharts-wrapper",w),style:R({position:"relative",cursor:"default",width:N,height:_},k)},I,{ref:function(B){m.container=B}}),E.createElement(tp,ni({},P,{width:N,height:_,title:T,desc:C,style:HQ}),this.renderClipPath(),h0(j,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(O.Component);Q(g,"displayName",r),Q(g,"defaultProps",R({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},d)),Q(g,"getDerivedStateFromProps",function(x,y){var v=x.dataKey,m=x.data,S=x.children,j=x.width,w=x.height,N=x.layout,_=x.stackOffset,k=x.margin,A=y.dataStartIndex,T=y.dataEndIndex;if(y.updateId===void 0){var C=G1(x);return R(R(R({},C),{},{updateId:0},p(R(R({props:x},C),{},{updateId:0}),y)),{},{prevDataKey:v,prevData:m,prevWidth:j,prevHeight:w,prevLayout:N,prevStackOffset:_,prevMargin:k,prevChildren:S})}if(v!==y.prevDataKey||m!==y.prevData||j!==y.prevWidth||w!==y.prevHeight||N!==y.prevLayout||_!==y.prevStackOffset||!ui(k,y.prevMargin)){var D=G1(x),P={chartX:y.chartX,chartY:y.chartY,isTooltipActive:y.isTooltipActive},M=R(R({},V1(y,m,N)),{},{updateId:y.updateId+1}),$=R(R(R({},D),P),M);return R(R(R({},$),p(R({props:x},$),y)),{},{prevDataKey:v,prevData:m,prevWidth:j,prevHeight:w,prevLayout:N,prevStackOffset:_,prevMargin:k,prevChildren:S})}if(!Jh(S,y.prevChildren)){var I,L,B,F,K=Ct(S,Ri),H=K&&(I=(L=K.props)===null||L===void 0?void 0:L.startIndex)!==null&&I!==void 0?I:A,q=K&&(B=(F=K.props)===null||F===void 0?void 0:F.endIndex)!==null&&B!==void 0?B:T,ie=H!==A||q!==T,_e=!J(m),Me=_e&&!ie?y.updateId:y.updateId+1;return R(R({updateId:Me},p(R(R({props:x},y),{},{updateId:Me,dataStartIndex:H,dataEndIndex:q}),y)),{},{prevChildren:S,dataStartIndex:H,dataEndIndex:q})}return null}),Q(g,"renderActiveDot",function(x,y,v){var m;return O.isValidElement(x)?m=O.cloneElement(x,y):Z(x)?m=x(y):m=E.createElement(Id,y),E.createElement(ae,{className:"recharts-active-dot",key:v},m)});var b=O.forwardRef(function(y,v){return E.createElement(g,ni({},y,{ref:v}))});return b.displayName=g.displayName,b},v2=Ag({chartName:"BarChart",GraphicalChild:Dn,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Rn},{axisType:"yAxis",AxisComp:Bn}],formatAxisMap:CO}),g2=Ag({chartName:"PieChart",GraphicalChild:kr,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Bd},{axisType:"radiusAxis",AxisComp:Dd}],formatAxisMap:DW,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),y2=Ag({chartName:"AreaChart",GraphicalChild:Jr,axisComponents:[{axisType:"xAxis",AxisComp:Rn},{axisType:"yAxis",AxisComp:Bn}],formatAxisMap:CO});function ql({cents:e}){const t=Number(e||0),r=(t/100).toFixed(2);return t>0?s.jsxs("span",{className:"text-green-400 font-mono font-bold",children:["+$",r]}):t<0?s.jsxs("span",{className:"text-red-400 font-mono font-bold",children:["-$",Math.abs(t/100).toFixed(2)]}):s.jsx("span",{className:"text-gray-500 font-mono",children:"$0.00"})}function q1({wins:e,losses:t}){const r=e+t;if(!r)return s.jsx("span",{className:"text-gray-500",children:"—"});const n=(e/r*100).toFixed(0);return s.jsxs("span",{className:n>=80?"text-green-400":n>=50?"text-amber-400":"text-red-400",children:[e,"/",r," (",n,"%)"]})}function X1({wins:e,losses:t,pnl:r}){const n=e+t,a=n>0?e/n:0;return a>=.9&&r>0?s.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-bold bg-green-500/20 text-green-400 border border-green-500/30",children:"ADD MORE"}):a>=.65&&r>0?s.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-bold bg-amber-500/20 text-amber-400 border border-amber-500/30",children:"HOLD"}):r<0?s.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-bold bg-red-500/20 text-red-400 border border-red-500/30",children:"REDUCE"}):s.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-bold bg-gray-500/20 text-gray-400 border border-gray-600",children:"WATCH"})}function eZ({opportunities:e}){const t=e||[];if(!t.length)return s.jsxs("div",{className:"card border border-gray-700/50 bg-gradient-to-br from-gray-800/30 to-transparent",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"text-lg",children:"🔍"}),s.jsx("h2",{className:"font-semibold",children:"Best Opportunities Right Now"})]}),s.jsx("p",{className:"text-gray-500 text-sm text-center py-6",children:"No fresh signals — waiting for next pipeline cycle..."})]});const r=[{bg:"from-amber-500/15 to-amber-500/5",border:"border-amber-500/30",medal:"🥇",rank:"bg-amber-500/20 text-amber-400"},{bg:"from-gray-400/10 to-gray-400/5",border:"border-gray-400/30",medal:"🥈",rank:"bg-gray-400/20 text-gray-300"},{bg:"from-orange-700/10 to-orange-700/5",border:"border-orange-700/30",medal:"🥉",rank:"bg-orange-700/20 text-orange-400"}];return s.jsxs("div",{className:"card border border-amber-500/20 bg-gradient-to-br from-amber-500/5 via-transparent to-green-500/5",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("span",{className:"text-lg",children:"🎯"}),s.jsx("h2",{className:"font-semibold",children:"Best Opportunities Right Now"}),s.jsx("span",{className:"ml-auto text-[10px] text-gray-500 uppercase font-medium",children:"Live Signals"})]}),s.jsx("div",{className:"space-y-3",children:t.map((n,a)=>{const i=r[a]||r[2],o=n.hist_trades>0;return s.jsx("div",{className:`rounded-xl p-4 bg-gradient-to-r ${i.bg} border ${i.border}`,children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-2xl mt-1",children:i.medal}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-semibold text-gray-100 hover:text-amber-400 truncate transition",children:n.title})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[s.jsxs("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold ${n.direction==="NO"?"bg-red-500/20 text-red-400 border border-red-500/30":"bg-green-500/20 text-green-400 border border-green-500/30"}`,children:["BUY ",n.direction]}),s.jsxs("span",{className:"text-xs text-gray-400",children:["Edge: ",s.jsxs("span",{className:"text-amber-400 font-bold",children:[n.edge_pct,"%"]})]}),s.jsxs("span",{className:"text-xs text-gray-400",children:["Conf: ",s.jsxs("span",{className:"text-blue-400 font-bold",children:[n.confidence,"%"]})]}),n.price_cents>0&&s.jsxs("span",{className:"text-xs text-gray-400",children:["Price: ",s.jsxs("span",{className:"font-mono text-gray-200",children:[n.price_cents,"¢"]})]}),o&&s.jsxs("span",{className:"text-xs text-gray-400",children:["History: ",s.jsxs("span",{className:`font-bold ${parseFloat(n.hist_wr)>=80?"text-green-400":parseFloat(n.hist_wr)>=50?"text-amber-400":"text-red-400"}`,children:[n.hist_wr,"% WR"]}),s.jsxs("span",{className:"text-gray-500 ml-1",children:["(",n.hist_trades," trades, ",n.hist_pnl/100>=0?"+":"","$",(n.hist_pnl/100).toFixed(0),")"]})]}),!o&&s.jsx("span",{className:"text-[10px] text-gray-600 italic",children:"New market — no history"})]}),s.jsx("p",{className:"text-[11px] text-gray-400 leading-relaxed",children:n.why})]})]})},n.ticker)})})]})}function tZ({topMarkets:e,seedMoney:t,balance:r}){const n=(e||[]).slice(0,3);if(!n.length)return null;const a=n.reduce((u,f)=>u+f.wins/(f.wins+f.losses),0)/n.length*100,i=n.length>0?Math.round(n.reduce((u,f)=>{const d=f.wins/(f.wins+f.losses||1);return u+(d>=.9?95:80)},0)/n.length):95,o=t?t/100:5e4,l=r?r/100:o,c=o>0?(l-o)/o*100:0;return s.jsxs("div",{className:"card border border-green-500/15 bg-gradient-to-br from-green-500/5 via-transparent to-amber-500/5",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("span",{className:"text-lg",children:"⚡"}),s.jsx("h2",{className:"font-semibold",children:"Winning Strategy — Live Flow"})]}),s.jsx("div",{className:"flex items-center justify-between gap-2 mb-5",children:[{icon:"🏦",label:`Start: $${o.toLocaleString()}`,sub:`Now $${l.toLocaleString()} (${c>=0?"+":""}${c.toFixed(1)}%)`,color:"from-cyan-500/20 to-cyan-500/5",border:"border-cyan-500/30",isStart:!0},{icon:"→",isArrow:!0},{icon:"📡",label:"Signal Found",sub:"AI scans 135 markets",color:"from-blue-500/20 to-blue-500/5",border:"border-blue-500/30"},{icon:"→",isArrow:!0},{icon:"🎯",label:`Buy NO at ${i}¢`,sub:"High-prob event",color:"from-amber-500/20 to-amber-500/5",border:"border-amber-500/30"},{icon:"→",isArrow:!0},{icon:"⏱️",label:"Hold 5min–2hr",sub:"TP +3¢ / SL -5¢",color:"from-purple-500/20 to-purple-500/5",border:"border-purple-500/30"},{icon:"→",isArrow:!0},{icon:"💰",label:`Collect ${100-i}¢`,sub:`${a.toFixed(0)}% of the time`,color:"from-green-500/20 to-green-500/5",border:"border-green-500/30"}].map((u,f)=>u.isArrow?s.jsx("div",{className:"text-gray-600 text-lg animate-pulse",children:"→"},f):s.jsxs("div",{className:`flex-1 rounded-xl p-3 bg-gradient-to-b ${u.color} border ${u.border} text-center ${u.isStart?"ring-1 ring-cyan-500/30":""}`,children:[s.jsx("div",{className:"text-2xl mb-1",children:u.icon}),s.jsx("p",{className:`text-xs font-semibold ${u.isStart?"text-cyan-300":"text-gray-200"}`,children:u.label}),s.jsx("p",{className:`text-[10px] ${u.isStart&&c>=0?"text-green-500":u.isStart?"text-red-400":"text-gray-500"}`,children:u.sub})]},f))}),s.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 text-center border border-gray-700",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Cost Per Trade"}),s.jsxs("p",{className:"text-lg font-bold text-amber-400",children:[i,"¢"]}),s.jsx("p",{className:"text-[10px] text-gray-600",children:"buying NO side"})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 text-center border border-gray-700",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Profit on Win"}),s.jsxs("p",{className:"text-lg font-bold text-green-400",children:[100-i,"¢"]}),s.jsx("p",{className:"text-[10px] text-gray-600",children:"per contract"})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 text-center border border-gray-700",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Return Multiple"}),s.jsxs("p",{className:"text-lg font-bold text-green-400",children:[((100-i)/i*100).toFixed(0),"%"]}),s.jsx("p",{className:"text-[10px] text-gray-600",children:"per winning trade"})]})]})]})}function rZ({topMarkets:e,worstMarkets:t,strategies:r}){const n=(e||[]).filter(c=>c.wins/(c.wins+c.losses||1)>=.9&&c.pnl>0),a=(t||[]).filter(c=>c.pnl<-5e3),i=(r||[]).filter(c=>c.pnl<-1e4&&c.win_rate<20).slice(0,3),o=[];n.length>0&&o.push({priority:"HIGH",color:"green",icon:"🚀",title:`Double down on ${n.length} near-certain markets`,detail:n.slice(0,2).map(c=>{var u;return((u=c.title)==null?void 0:u.split("?")[0])||c.ticker}).join(", "),reason:`${n.length} markets have 90%+ win rate — the edge is proven`}),a.length>0&&o.push({priority:"HIGH",color:"red",icon:"🛑",title:`Exit ${a.length} bleeding market(s)`,detail:a.slice(0,2).map(c=>{var u;return((u=c.title)==null?void 0:u.split("?")[0])||c.ticker}).join(", "),reason:`0% win rate, losing $${Math.abs(a.reduce((c,u)=>c+u.pnl,0)/100).toFixed(0)} total`}),i.length>0&&o.push({priority:"MED",color:"amber",icon:"⚙️",title:`Consider disabling ${i.length} strategy(ies)`,detail:i.map(c=>c.name).join(", "),reason:"Sub-20% win rate — these are coin flips minus fees"}),o.push({priority:"INFO",color:"blue",icon:"📊",title:"Keep hyper-trading high-prob NO markets",detail:"The 95¢+ NO strategy is the #1 edge — scale it up",reason:"Compounding small spreads at 99%+ win rate = consistent returns"});const l={green:{bg:"bg-green-500/10",border:"border-green-500/25",text:"text-green-400",badge:"bg-green-500/20"},red:{bg:"bg-red-500/10",border:"border-red-500/25",text:"text-red-400",badge:"bg-red-500/20"},amber:{bg:"bg-amber-500/10",border:"border-amber-500/25",text:"text-amber-400",badge:"bg-amber-500/20"},blue:{bg:"bg-blue-500/10",border:"border-blue-500/25",text:"text-blue-400",badge:"bg-blue-500/20"}};return s.jsxs("div",{className:"card border border-amber-500/15 bg-gradient-to-br from-amber-500/5 to-transparent",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("span",{className:"text-lg",children:"🎯"}),s.jsx("h2",{className:"font-semibold",children:"What To Do Next"})]}),s.jsx("div",{className:"space-y-3",children:o.map((c,u)=>{const f=l[c.color];return s.jsxs("div",{className:`rounded-xl p-3 ${f.bg} border ${f.border} flex gap-3`,children:[s.jsx("span",{className:"text-xl mt-0.5",children:c.icon}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[s.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded ${f.badge} ${f.text} uppercase`,children:c.priority}),s.jsx("span",{className:`text-sm font-semibold ${f.text}`,children:c.title})]}),s.jsx("p",{className:"text-xs text-gray-300",children:c.detail}),s.jsx("p",{className:"text-[10px] text-gray-500 mt-1",children:c.reason})]})]},u)})})]})}function nZ({strategies:e}){const t=[...e||[]].sort((n,a)=>a.pnl-n.pnl).slice(0,10);if(!t.length)return null;Math.max(...t.map(n=>Math.abs(n.pnl)));const r=t.map(n=>({name:n.name,pnl:n.pnl/100,fill:n.pnl>=0?"#22c55e":"#ef4444"}));return s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"text-lg",children:"📈"}),s.jsx("h2",{className:"font-semibold",children:"Strategy P&L — Top 10"})]}),s.jsx(ki,{width:"100%",height:250,children:s.jsxs(v2,{data:r,layout:"vertical",margin:{left:70,right:20},children:[s.jsx(Pg,{strokeDasharray:"3 3",stroke:"#1f2937",horizontal:!1}),s.jsx(Rn,{type:"number",stroke:"#6b7280",tickFormatter:n=>`$${n}`}),s.jsx(Bn,{type:"category",dataKey:"name",stroke:"#6b7280",tick:{fontSize:11},width:65}),s.jsx(jt,{contentStyle:{background:"#1f2937",border:"1px solid #374151",borderRadius:8},formatter:n=>[`$${n.toFixed(2)}`,"P&L"]}),s.jsx(Dn,{dataKey:"pnl",radius:[0,4,4,0],children:r.map((n,a)=>s.jsx(ga,{fill:n.fill},a))})]})})]})}function aZ({todayWins:e,todayLosses:t}){const r=(e||0)+(t||0);if(!r)return null;const n=(e/r*100).toFixed(1),a=[{name:"Wins",value:e,fill:"#22c55e"},{name:"Losses",value:t,fill:"#ef4444"}];return s.jsxs("div",{className:"card flex flex-col items-center justify-center",children:[s.jsx("h3",{className:"text-xs text-gray-500 uppercase mb-2",children:"Today's Win Rate"}),s.jsxs("div",{className:"relative",style:{width:140,height:140},children:[s.jsx(ki,{width:"100%",height:"100%",children:s.jsx(g2,{children:s.jsx(kr,{data:a,innerRadius:45,outerRadius:65,paddingAngle:2,dataKey:"value",startAngle:90,endAngle:-270,children:a.map((i,o)=>s.jsx(ga,{fill:i.fill},o))})})}),s.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[s.jsxs("span",{className:`text-2xl font-bold ${Number(n)>=50?"text-green-400":"text-red-400"}`,children:[n,"%"]}),s.jsxs("span",{className:"text-[10px] text-gray-500",children:[r.toLocaleString()," trades"]})]})]}),s.jsxs("div",{className:"flex gap-4 mt-2 text-xs",children:[s.jsxs("span",{className:"text-green-400",children:[e==null?void 0:e.toLocaleString()," W"]}),s.jsxs("span",{className:"text-red-400",children:[t==null?void 0:t.toLocaleString()," L"]})]})]})}function iZ(){var f;const[e,t]=O.useState(null),[r,n]=O.useState(!0);O.useEffect(()=>{a();const d=setInterval(a,3e4);return()=>clearInterval(d)},[]);async function a(){try{const d=await ke("/dashboard");t(d)}catch{}n(!1)}if(r)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})});const i=e||{},o=(i.pnl_history||[]).map((d,h)=>({day:h+1,pnl:d})),l=i.today_trades>0?(i.today_wins/i.today_trades*100).toFixed(1):"0",c=(i.strategies||[]).filter(d=>d.pnl>0).slice(0,5),u=(i.strategies||[]).filter(d=>d.pnl<0).slice(-5).reverse();return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Dashboard"}),s.jsx("p",{className:"text-gray-500 text-sm",children:"Ken event contracts overview"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`badge ${i.env==="prod"?"bg-green":"bg-yellow"}`,children:(i.env||"DEMO").toUpperCase()}),i.safe_mode&&s.jsx("span",{className:"badge bg-yellow",children:"SAFE MODE"})]})]}),s.jsx("div",{className:"grid grid-cols-5 gap-4",children:[{label:"Balance",value:i.balance?`$${(i.balance/100).toLocaleString(void 0,{minimumFractionDigits:2})}`:"—",color:"text-green-400"},{label:"Positions",value:i.position_count??"—",color:"text-amber-400"},{label:"Open Markets",value:i.open_orders??"—",color:"text-blue-400"},{label:"Today P&L",value:i.daily_pnl?`$${(i.daily_pnl/100).toLocaleString(void 0,{minimumFractionDigits:2})}`:"$0.00",color:(i.daily_pnl||0)>=0?"text-green-400":"text-red-400"},{label:"Markets Tracked",value:i.markets_tracked??"—",color:"text-purple-400"}].map(d=>s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-xs text-gray-500 uppercase mb-1",children:d.label}),s.jsx("p",{className:`stat-v ${d.color}`,children:d.value})]},d.label))}),i.seed_money>0&&s.jsxs("div",{className:"card border border-blue-500/20 bg-gradient-to-r from-blue-500/5 via-transparent to-green-500/5",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"text-lg",children:"💰"}),s.jsx("h2",{className:"font-semibold",children:"Capital & Economics"})]}),s.jsxs("div",{className:"grid grid-cols-6 gap-3 text-center",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Seed Money"}),s.jsxs("p",{className:"text-lg font-bold text-blue-400",children:["$",(i.seed_money/100).toLocaleString(void 0,{minimumFractionDigits:0})]}),s.jsxs("p",{className:"text-[10px] text-gray-600",children:[i.num_portfolios," portfolios"]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Current Balance"}),s.jsxs("p",{className:"text-lg font-bold text-green-400",children:["$",(i.balance/100).toLocaleString(void 0,{minimumFractionDigits:0})]}),s.jsx("p",{className:"text-[10px] text-gray-600",children:"all portfolios"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Net P&L"}),s.jsxs("p",{className:`text-lg font-bold ${i.net_pnl_from_seed>=0?"text-green-400":"text-red-400"}`,children:[i.net_pnl_from_seed>=0?"+":"","$",(i.net_pnl_from_seed/100).toLocaleString(void 0,{minimumFractionDigits:0})]}),s.jsxs("p",{className:`text-[10px] ${i.roi_pct>=0?"text-green-500":"text-red-500"}`,children:[i.roi_pct>=0?"+":"",i.roi_pct,"% ROI"]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Capital Deployed"}),s.jsxs("p",{className:"text-lg font-bold text-amber-400",children:["$",(i.total_invested/100).toLocaleString(void 0,{minimumFractionDigits:0})]}),s.jsx("p",{className:"text-[10px] text-gray-600",children:"total traded"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Capital at Risk"}),s.jsxs("p",{className:"text-lg font-bold text-red-400",children:["$",(i.capital_at_risk/100).toLocaleString(void 0,{minimumFractionDigits:0})]}),s.jsx("p",{className:"text-[10px] text-gray-600",children:"open positions"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Daily Budget"}),s.jsxs("p",{className:"text-lg font-bold text-purple-400",children:["$",(i.daily_budget/100).toLocaleString(void 0,{minimumFractionDigits:0})]}),s.jsx("p",{className:"text-[10px] text-gray-600",children:"across strategies"})]})]}),((f=i.daily_economics)==null?void 0:f.length)>0&&s.jsxs("div",{className:"mt-4 pt-3 border-t border-gray-700/50",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase mb-2",children:"Daily Breakdown (Last 7 Days)"}),s.jsx("div",{className:"grid grid-cols-7 gap-1 text-center text-[10px]",children:(i.daily_economics||[]).slice(0,7).reverse().map((d,h)=>{const p=new Date(d.day).toLocaleDateString("en-US",{weekday:"short",month:"numeric",day:"numeric",timeZone:"America/Los_Angeles"});return s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-2 border border-gray-700/50",children:[s.jsx("p",{className:"text-gray-500 font-medium",children:p}),s.jsxs("p",{className:`font-bold font-mono ${d.net_pnl>=0?"text-green-400":"text-red-400"}`,children:[d.net_pnl>=0?"+":"","$",(d.net_pnl/100).toFixed(0)]}),s.jsxs("p",{className:"text-gray-600",children:[d.trades," trades"]}),s.jsxs("p",{className:"text-gray-600",children:[d.wins,"W / ",d.losses,"L"]})]},h)})})]})]}),s.jsx(eZ,{opportunities:i.top_opportunities}),s.jsxs("div",{className:"card border border-amber-500/20 bg-gradient-to-r from-amber-500/5 to-transparent",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"text-lg",children:"📊"}),s.jsx("h2",{className:"font-semibold",children:"Today's Lessons"}),s.jsx("span",{className:"ml-auto text-xs text-gray-500",children:new Date().toLocaleDateString("en-US",{weekday:"long",month:"short",day:"numeric"})})]}),s.jsxs("div",{className:"grid grid-cols-4 gap-4 text-center",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Trades Resolved"}),s.jsx("p",{className:"text-xl font-bold text-amber-400",children:(i.today_trades||0).toLocaleString()})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Wins / Losses"}),s.jsxs("p",{className:"text-xl font-bold",children:[s.jsx("span",{className:"text-green-400",children:i.today_wins||0}),s.jsx("span",{className:"text-gray-600 mx-1",children:"/"}),s.jsx("span",{className:"text-red-400",children:i.today_losses||0})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Win Rate"}),s.jsxs("p",{className:`text-xl font-bold ${Number(l)>=50?"text-green-400":"text-red-400"}`,children:[l,"%"]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase",children:"Day P&L"}),s.jsxs("p",{className:`text-xl font-bold ${(i.daily_pnl||0)>=0?"text-green-400":"text-red-400"}`,children:[(i.daily_pnl||0)>=0?"+":"","$",((i.daily_pnl||0)/100).toLocaleString(void 0,{minimumFractionDigits:2})]})]})]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsx("div",{className:"col-span-2",children:s.jsx(tZ,{topMarkets:i.top_markets,seedMoney:i.seed_money,balance:i.balance})}),s.jsx(aZ,{todayWins:i.today_wins,todayLosses:i.today_losses})]}),s.jsx(rZ,{topMarkets:i.top_markets,worstMarkets:i.worst_markets,strategies:i.strategies}),(i.top_markets||[]).length>0&&s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"text-lg",children:"🏆"}),s.jsx("h2",{className:"font-semibold",children:"Top Markets — Money Makers"})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"Market"}),s.jsx("th",{className:"text-right",children:"Trades"}),s.jsx("th",{className:"text-right",children:"Wins"}),s.jsx("th",{className:"text-right",children:"P&L"}),s.jsx("th",{children:"Edge"}),s.jsx("th",{children:"Signal"})]})}),s.jsx("tbody",{children:(i.top_markets||[]).map((d,h)=>{var p;return s.jsxs("tr",{children:[s.jsxs("td",{className:"max-w-[300px]",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Ra,{to:`/positions?market=${encodeURIComponent(d.ticker)}`,className:"text-sm text-gray-200 hover:text-amber-400 transition truncate block",children:d.title}),s.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent(((p=d.title)==null?void 0:p.split("?")[0])||d.ticker)}`,target:"_blank",rel:"noopener noreferrer",className:"text-gray-600 hover:text-amber-400 flex-shrink-0",title:"Search on Kalshi",children:"↗"})]}),s.jsx("span",{className:"text-[10px] font-mono text-gray-600",children:d.ticker})]}),s.jsx("td",{className:"text-right font-mono text-sm text-gray-400",children:d.trades}),s.jsx("td",{className:"text-right text-sm",children:s.jsx(q1,{wins:d.wins,losses:d.losses})}),s.jsx("td",{className:"text-right text-sm",children:s.jsx(ql,{cents:d.pnl})}),s.jsx("td",{className:"text-xs text-gray-400 whitespace-nowrap",children:d.edge}),s.jsx("td",{className:"text-center",children:s.jsx(X1,{wins:d.wins,losses:d.losses,pnl:d.pnl})})]},h)})})]})})]}),(i.worst_markets||[]).length>0&&s.jsxs("div",{className:"card border border-red-500/10",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"text-lg",children:"⚠️"}),s.jsx("h2",{className:"font-semibold text-red-400",children:"Bleeding Markets — Consider Exiting"})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"Market"}),s.jsx("th",{className:"text-right",children:"Trades"}),s.jsx("th",{className:"text-right",children:"Wins"}),s.jsx("th",{className:"text-right",children:"P&L"}),s.jsx("th",{children:"Edge"}),s.jsx("th",{children:"Signal"})]})}),s.jsx("tbody",{children:(i.worst_markets||[]).map((d,h)=>{var p;return s.jsxs("tr",{children:[s.jsxs("td",{className:"max-w-[300px]",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Ra,{to:`/positions?market=${encodeURIComponent(d.ticker)}`,className:"text-sm text-gray-200 hover:text-red-400 transition truncate block",children:d.title}),s.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent(((p=d.title)==null?void 0:p.split("?")[0])||d.ticker)}`,target:"_blank",rel:"noopener noreferrer",className:"text-gray-600 hover:text-red-400 flex-shrink-0",title:"Search on Kalshi",children:"↗"})]}),s.jsx("span",{className:"text-[10px] font-mono text-gray-600",children:d.ticker})]}),s.jsx("td",{className:"text-right font-mono text-sm text-gray-400",children:d.trades}),s.jsx("td",{className:"text-right text-sm",children:s.jsx(q1,{wins:d.wins,losses:d.losses})}),s.jsx("td",{className:"text-right text-sm",children:s.jsx(ql,{cents:d.pnl})}),s.jsx("td",{className:"text-xs text-gray-400 whitespace-nowrap",children:d.edge}),s.jsx("td",{className:"text-center",children:s.jsx(X1,{wins:d.wins,losses:d.losses,pnl:d.pnl})})]},h)})})]})})]}),o.length>0&&s.jsxs("div",{className:"card",children:[s.jsx("h2",{className:"font-semibold mb-3",children:"P&L History (Daily)"}),s.jsx(ki,{width:"100%",height:200,children:s.jsxs(y2,{data:o,children:[s.jsx(Pg,{strokeDasharray:"3 3",stroke:"#1f2937"}),s.jsx(Rn,{dataKey:"day",stroke:"#6b7280"}),s.jsx(Bn,{stroke:"#6b7280",tickFormatter:d=>`$${d}`}),s.jsx(jt,{contentStyle:{background:"#1f2937",border:"1px solid #374151",borderRadius:8}}),s.jsx(Jr,{type:"monotone",dataKey:"pnl",stroke:"#f59e0b",fill:"#f59e0b",fillOpacity:.1})]})})]}),s.jsx(nZ,{strategies:i.strategies}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"text-lg",children:"🥇"}),s.jsx("h2",{className:"font-semibold",children:"Top Strategies"})]}),s.jsxs("div",{className:"space-y-2",children:[c.map((d,h)=>s.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-gray-800 last:border-0",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-sm font-medium text-gray-200",children:d.name}),s.jsx("span",{className:"ml-2 text-[10px] text-gray-600",children:d.strategy})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("span",{className:"text-xs text-gray-500",children:[d.win_rate,"% WR"]}),s.jsx(ql,{cents:d.pnl})]})]},h)),c.length===0&&s.jsx("p",{className:"text-gray-600 text-sm text-center py-4",children:"No profitable strategies yet"})]})]}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"text-lg",children:"📉"}),s.jsx("h2",{className:"font-semibold",children:"Losing Strategies"})]}),s.jsxs("div",{className:"space-y-2",children:[u.map((d,h)=>s.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-gray-800 last:border-0",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-sm font-medium text-gray-300",children:d.name}),s.jsx("span",{className:"ml-2 text-[10px] text-gray-600",children:d.strategy})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("span",{className:"text-xs text-gray-500",children:[d.win_rate,"% WR"]}),s.jsx(ql,{cents:d.pnl})]})]},h)),u.length===0&&s.jsx("p",{className:"text-gray-600 text-sm text-center py-4",children:"No losing strategies"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"card",children:[s.jsx("h2",{className:"font-semibold mb-3",children:"Recent Fills"}),(i.recent_fills||[]).length>0?s.jsx("div",{className:"space-y-2",children:(i.recent_fills||[]).slice(0,5).map((d,h)=>{var p;return s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-mono text-xs text-gray-400",children:d.ticker}),s.jsx("span",{className:`ml-2 badge ${d.side==="yes"?"bg-green":"bg-red"}`,children:(p=d.side)==null?void 0:p.toUpperCase()})]}),s.jsxs("span",{className:"font-mono text-gray-300",children:[d.count,"@",d.yes_price,"c"]})]},h)})}):s.jsx("p",{className:"text-gray-600 text-sm text-center py-6",children:"No recent fills"})]}),s.jsxs("div",{className:"card",children:[s.jsx("h2",{className:"font-semibold mb-3",children:"Quick Actions"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Ra,{to:"/markets",className:"flex items-center gap-3 p-3 rounded-lg bg-gray-800/30 hover:bg-gray-800/60 transition",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center",children:s.jsx("svg",{className:"w-4 h-4 text-amber-400",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"})})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Browse Markets"}),s.jsx("p",{className:"text-xs text-gray-500",children:"Find weather contracts"})]})]}),s.jsxs(Ra,{to:"/positions",className:"flex items-center gap-3 p-3 rounded-lg bg-gray-800/30 hover:bg-gray-800/60 transition",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-green-500/10 flex items-center justify-center",children:s.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"View Positions"}),s.jsx("p",{className:"text-xs text-gray-500",children:"Current portfolio"})]})]}),s.jsxs(Ra,{to:"/settings",className:"flex items-center gap-3 p-3 rounded-lg bg-gray-800/30 hover:bg-gray-800/60 transition",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-blue-500/10 flex items-center justify-center",children:s.jsxs("svg",{className:"w-4 h-4 text-blue-400",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:[s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Scan Config"}),s.jsx("p",{className:"text-xs text-gray-500",children:"Intervals & risk params"})]})]})]})]})]})]})}function oZ({m:e}){const[t,r]=O.useState(null),[n,a]=O.useState(!1),[i,o]=O.useState(!1);async function l(){if(n){a(!1);return}a(!0),o(!0);try{const c=await pe("/kalshi",{action:"get_orderbook",ticker:e.ticker});c.success&&r(c.orderbook)}catch{}o(!1)}return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{background:"rgba(0,240,255,0.02)"},children:[s.jsx("td",{className:"pl-8 max-w-[250px]",children:s.jsx("span",{className:"truncate block text-sm",style:{color:"var(--text-dim)"},children:e.title||e.subtitle||e.ticker})}),s.jsx("td",{children:s.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((e.ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"mono text-xs hover:underline transition",style:{color:"var(--cyan)"},children:e.ticker})}),s.jsx("td",{children:s.jsxs("span",{className:"mono text-sm",style:{color:"var(--green)"},children:[e.yes_bid??"—","¢"]})}),s.jsx("td",{children:s.jsxs("span",{className:"mono text-sm",style:{color:"var(--red)"},children:[e.yes_ask??"—","¢"]})}),s.jsx("td",{children:s.jsx("span",{className:"mono text-xs",style:{color:"var(--text-dim)"},children:(e.volume||0).toLocaleString()})}),s.jsx("td",{children:s.jsx("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:e.open_interest?e.open_interest.toLocaleString():"—"})}),s.jsx("td",{children:s.jsx("button",{onClick:l,className:"btn btn-ghost btn-sm",style:{color:n?"var(--cyan)":"var(--text-muted)"},children:n?"▾ Book":"▸ Book"})})]}),n&&s.jsx("tr",{style:{background:"rgba(0,240,255,0.01)"},children:s.jsx("td",{colSpan:7,className:"p-4",children:i?s.jsx("div",{className:"flex items-center justify-center h-16",children:s.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-t-transparent rounded-full",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})}):t?s.jsxs("div",{className:"grid grid-cols-2 gap-6 max-w-lg",children:[s.jsxs("div",{children:[s.jsx("p",{className:"stat-label mb-2",style:{color:"var(--green)"},children:"YES Bids"}),s.jsxs("div",{className:"space-y-1",children:[(t.yes||[]).slice(0,8).map((c,u)=>s.jsxs("div",{className:"relative flex justify-between text-xs px-2 py-1 rounded overflow-hidden",style:{background:"var(--surface-el)"},children:[s.jsx("div",{className:"absolute inset-0 rounded",style:{width:`${Math.min((c[1]||0)*2,100)}%`,background:"rgba(0,195,137,0.08)"}}),s.jsxs("span",{className:"mono relative z-10",style:{color:"var(--green)"},children:[c[0],"¢"]}),s.jsx("span",{className:"mono relative z-10",style:{color:"var(--text-muted)"},children:c[1]})]},u)),(!t.yes||t.yes.length===0)&&s.jsx("p",{className:"text-xs text-center py-2",style:{color:"var(--text-muted)"},children:"Empty"})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"stat-label mb-2",style:{color:"var(--red)"},children:"NO Bids"}),s.jsxs("div",{className:"space-y-1",children:[(t.no||[]).slice(0,8).map((c,u)=>s.jsxs("div",{className:"relative flex justify-between text-xs px-2 py-1 rounded overflow-hidden",style:{background:"var(--surface-el)"},children:[s.jsx("div",{className:"absolute inset-0 rounded",style:{width:`${Math.min((c[1]||0)*2,100)}%`,background:"rgba(255,92,92,0.08)"}}),s.jsxs("span",{className:"mono relative z-10",style:{color:"var(--red)"},children:[c[0],"¢"]}),s.jsx("span",{className:"mono relative z-10",style:{color:"var(--text-muted)"},children:c[1]})]},u)),(!t.no||t.no.length===0)&&s.jsx("p",{className:"text-xs text-center py-2",style:{color:"var(--text-muted)"},children:"Empty"})]})]})]}):s.jsx("p",{className:"text-xs text-center py-2",style:{color:"var(--text-muted)"},children:"No orderbook data"})})})]})}function sZ({e}){const[t,r]=O.useState(!1),[n,a]=O.useState([]),[i,o]=O.useState(!1);async function l(){if(t){r(!1);return}if(r(!0),!(n.length>0)){o(!0);try{const c=await pe("/kalshi",{action:"get_markets",params:{event_ticker:e.event_ticker}});a(c.markets||[])}catch{}o(!1)}}return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"cursor-pointer transition",onClick:l,style:{background:t?"rgba(0,240,255,0.04)":void 0},onMouseEnter:c=>{t||(c.currentTarget.style.background="var(--cyan-glow)")},onMouseLeave:c=>{t||(c.currentTarget.style.background="")},children:[s.jsx("td",{className:"max-w-[300px]",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs transition-transform inline-block",style:{color:"var(--text-muted)",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),s.jsx("span",{className:"truncate block font-medium heading",style:{color:"var(--text)"},children:e.title})]})}),s.jsx("td",{children:s.jsx("span",{className:"badge bg-orange",children:e.category||"—"})}),s.jsx("td",{children:s.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((e.event_ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"mono text-xs hover:underline transition",style:{color:"var(--cyan)"},onClick:c=>c.stopPropagation(),children:e.event_ticker})}),s.jsx("td",{children:s.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:e.mutually_exclusive?s.jsx("span",{className:"badge bg-blue",children:"ME"}):"—"})}),s.jsx("td",{onClick:c=>c.stopPropagation(),children:t?s.jsxs("span",{className:"text-xs mono",style:{color:"var(--cyan)"},children:[n.length||"..."," contracts"]}):s.jsx("span",{className:"text-xs transition",style:{color:"var(--text-muted)"},children:"View Contracts"})})]}),t&&s.jsx("tr",{children:s.jsx("td",{colSpan:5,className:"p-0",children:s.jsx("div",{className:"ml-6 fade-in",style:{borderLeft:"2px solid rgba(0,240,255,0.2)",background:"rgba(0,240,255,0.015)"},children:i?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-t-transparent rounded-full",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})}):n.length===0?s.jsx("div",{className:"text-xs text-center py-4",style:{color:"var(--text-muted)"},children:"No contracts found"}):s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"pl-8",children:"Contract"}),s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Yes Bid"}),s.jsx("th",{children:"Yes Ask"}),s.jsx("th",{children:"Volume"}),s.jsx("th",{children:"Open Int."}),s.jsx("th",{children:"Book"})]})}),s.jsx("tbody",{children:n.map(c=>s.jsx(oZ,{m:c},c.ticker))})]})})})})]})}function lZ(){const[e,t]=O.useState([]),[r,n]=O.useState(!0),[a,i]=O.useState(""),[o,l]=O.useState("");O.useEffect(()=>{c()},[]);async function c(){n(!0);try{const d=await pe("/kalshi",{action:"get_events",params:{status:"open",limit:100}});t(d.events||[])}catch{}n(!1)}const u=[...new Set(e.map(d=>d.category).filter(Boolean))].sort(),f=e.filter(d=>{const h=!a||(d.title||"").toLowerCase().includes(a.toLowerCase())||(d.category||"").toLowerCase().includes(a.toLowerCase()),p=!o||d.category===o;return h&&p});return r?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-t-transparent rounded-full pulse-cyan",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})}):s.jsxs("div",{className:"space-y-6 fade-in",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("h1",{className:"heading text-3xl font-bold",style:{color:"var(--text)"},children:"Markets"}),s.jsxs("span",{className:"badge bg-cyan",children:[e.length," events"]}),f.length!==e.length&&s.jsxs("span",{className:"badge bg-orange",children:[f.length," filtered"]})]}),s.jsx("p",{className:"section-subtitle mt-1",children:"Live Kalshi prediction markets"})]}),s.jsx("button",{onClick:c,className:"btn btn-o btn-sm",children:"↻ Refresh"})]}),s.jsxs("div",{className:"relative",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm pointer-events-none",style:{color:"var(--text-muted)"},children:"⌕"}),s.jsx("input",{type:"text",value:a,onChange:d=>i(d.target.value),placeholder:"Search markets by name or category...",className:"input pl-8"})]}),u.length>0&&s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{onClick:()=>l(""),className:"badge transition cursor-pointer",style:{background:o?"rgba(42,42,53,0.6)":"var(--cyan-dim)",color:o?"var(--text-muted)":"var(--cyan)",border:o?"1px solid var(--border)":"1px solid rgba(0,240,255,0.3)"},children:"All"}),u.map(d=>s.jsx("button",{onClick:()=>l(d===o?"":d),className:"badge transition cursor-pointer",style:{background:o===d?"var(--orange-dim)":"rgba(42,42,53,0.6)",color:o===d?"var(--orange)":"var(--text-muted)",border:o===d?"1px solid rgba(247,147,26,0.3)":"1px solid var(--border)"},children:d},d))]}),s.jsx("div",{className:"card overflow-x-auto",style:{padding:0},children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"pl-5",children:"Event"}),s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Type"}),s.jsx("th",{children:"Contracts"})]})}),s.jsx("tbody",{children:f.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:5,className:"text-center py-12",style:{color:"var(--text-muted)"},children:s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx("span",{className:"text-2xl",children:"⌕"}),s.jsx("span",{className:"text-sm",children:"No markets match your filter"})]})})}):f.map(d=>s.jsx(sZ,{e:d},d.event_ticker))})]})})]})}const nn=e=>`$${(e/100).toFixed(2)}`,Ar=e=>{const t=e/100;return`${t>=0?"+":""}$${t.toFixed(2)}`},Bo=e=>e>=0?"text-green":"text-red",Ba=e=>e==="BUY_YES"?"bg-green":"bg-red",Fa=e=>e==="BUY_YES"?"YES":"NO",To=e=>`https://kalshi.com/search?query=${encodeURIComponent((e||"").split("-")[0])}`,Q1=e=>{if(!e)return"";const t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`};function cZ(){return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"w-9 h-9 rounded-full border-2 animate-spin",style:{borderColor:"var(--border)",borderTopColor:"var(--cyan)"}})})}function Z1({p:e,trades:t,loading:r}){return s.jsxs("div",{style:{background:"var(--bg)",borderTop:"1px solid var(--border)",borderBottom:"1px solid var(--border)"},className:"px-4 py-3",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsxs("span",{className:"mono text-xs font-bold",style:{color:"var(--cyan)"},children:["Trade History — ",e.ticker]}),s.jsxs("div",{className:"flex gap-4 text-xs",style:{color:"var(--text-muted)"},children:[s.jsxs("span",{children:["Open: ",s.jsx("b",{style:{color:"var(--blue)"},children:e.open_trades})]}),s.jsxs("span",{children:["Closed: ",s.jsx("b",{style:{color:"var(--text-dim)"},children:e.closed_trades})]}),s.jsxs("span",{children:["Entry Range:"," ",s.jsxs("b",{style:{color:"var(--orange)"},children:[e.min_entry,"¢ – ",e.max_entry,"¢"]})]}),s.jsxs("span",{children:["First: ",s.jsx("b",{children:new Date(e.first_trade_at).toLocaleDateString()})]})]})]}),r?s.jsx("div",{className:"flex justify-center py-4",children:s.jsx("div",{className:"w-5 h-5 rounded-full border-2 animate-spin",style:{borderColor:"var(--border)",borderTopColor:"var(--cyan)"}})}):t.length>0?s.jsx("div",{className:"overflow-x-auto",style:{maxHeight:200,overflowY:"auto"},children:s.jsxs("table",{className:"text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Time"}),s.jsx("th",{children:"Direction"}),s.jsx("th",{children:"Contracts"}),s.jsx("th",{children:"Entry Price"}),s.jsx("th",{children:"Cost"}),s.jsx("th",{children:"P&L"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:t.map((n,a)=>s.jsxs("tr",{children:[s.jsx("td",{className:"mono",style:{color:"var(--text-muted)"},children:new Date(n.created_at).toLocaleString()}),s.jsx("td",{children:s.jsx("span",{className:`badge ${Ba(n.direction)}`,children:Fa(n.direction)})}),s.jsx("td",{className:"mono",children:n.contracts}),s.jsxs("td",{className:"mono",style:{color:"var(--orange)"},children:[n.entry_price_cents,"¢"]}),s.jsx("td",{className:"mono",style:{color:"var(--text-dim)"},children:nn(n.cost_cents||0)}),s.jsx("td",{className:`mono ${Bo(n.pnl_cents||0)}`,children:n.pnl_cents!=null?Ar(n.pnl_cents):"—"}),s.jsx("td",{children:s.jsx("span",{className:`badge ${n.status==="open"?"bg-blue":n.status==="closed"?"bg-green":"bg-orange"}`,children:n.status})})]},a))})]})}):s.jsx("p",{className:"text-center py-3 text-xs",style:{color:"var(--text-muted)"},children:"No trade details available"})]})}function uZ(){var D;const[e,t]=O.useState([]),[r,n]=O.useState([]),[a,i]=O.useState({}),[o,l]=O.useState(!0),[c,u]=O.useState(null),[f,d]=O.useState(null),[h,p]=O.useState({}),[g,b]=O.useState(null),[x,y]=O.useState("grouped"),[v,m]=O.useState("cost"),S=O.useCallback(async()=>{try{const P=await ke("/positions");P.success&&(t(P.positions||[]),n(P.grouped||[]),i(P.summary||{}))}catch{}l(!1)},[]);O.useEffect(()=>{S();const P=setInterval(S,3e4);return()=>clearInterval(P)},[S]);async function j(P,M){const $=`${P}_${M}`;if(!h[$]){b($);try{const I=await pe("/positions/trades",{ticker:P,direction:M,limit:50});I.success&&p(L=>({...L,[$]:I.trades||[]}))}catch{}b(null)}}function w(P){u(M=>M===P?null:P),d(null)}function N(P,M){const $=`${P}_${M}`;f===$?d(null):(d($),j(P,M))}const _=[...e].sort((P,M)=>v==="pnl"?M.realized_pnl_cents-P.realized_pnl_cents:v==="contracts"?M.open_contracts-P.open_contracts:M.open_cost_cents-P.open_cost_cents),k=e.filter(P=>P.realized_pnl_cents>0).sort((P,M)=>M.realized_pnl_cents-P.realized_pnl_cents),A=e.filter(P=>P.realized_pnl_cents<0).sort((P,M)=>P.realized_pnl_cents-M.realized_pnl_cents),T=e.filter(P=>P.realized_pnl_cents===0),C=e.length>0&&k.length+A.length>0?`${Math.round(k.length/(k.length+A.length)*100)}%`:"—";return o?s.jsx(cZ,{}):s.jsxs("div",{className:"space-y-6 fade-in",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"heading text-3xl",style:{color:"var(--text)"},children:["Positions",s.jsx("span",{className:"badge bg-cyan ml-3 align-middle text-base",children:a.positionCount||0})]}),s.jsxs("p",{className:"section-subtitle mt-1",children:[a.positionCount||0," active positions •"," ",((D=a.totalTrades)==null?void 0:D.toLocaleString())||0," total trades"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex rounded-lg p-0.5 gap-0.5",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[["grouped","Grouped"],["flat","All"],["pnl","P&L"]].map(([P,M])=>s.jsx("button",{onClick:()=>y(P),className:"px-3 py-1 text-xs font-semibold rounded-md transition",style:x===P?{background:"var(--cyan)",color:"var(--bg)",fontFamily:"var(--font-body)"}:{color:"var(--text-muted)",fontFamily:"var(--font-body)"},children:M},P))}),s.jsx("button",{onClick:S,className:"btn btn-o btn-sm",children:"Refresh"})]})]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"stat-label",children:"Positions"}),s.jsx("p",{className:"stat-v mt-2",style:{color:"var(--cyan)"},children:a.positionCount||0})]}),s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"stat-label",children:"Total Cost"}),s.jsx("p",{className:"stat-v mt-2",style:{color:"var(--text)"},children:nn(a.totalCost||0)})]}),s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"stat-label",children:"Realized P&L"}),s.jsx("p",{className:`stat-v mt-2 ${Bo(a.totalPnl||0)}`,children:Ar(a.totalPnl||0)})]}),s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"stat-label",children:"Contracts"}),s.jsx("p",{className:"stat-v mt-2",style:{color:"var(--blue)"},children:(a.totalContracts||0).toLocaleString()})]}),s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"stat-label",children:"Win Rate"}),s.jsx("p",{className:"stat-v mt-2 text-green",children:C})]})]}),a.totalPnl!==0&&s.jsxs("div",{className:"card py-3",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs mb-2",children:[s.jsxs("span",{className:"font-semibold text-green",children:[k.length," winners"]}),s.jsxs("span",{style:{color:"var(--text-muted)"},children:[T.length," flat"]}),s.jsxs("span",{className:"font-semibold text-red",children:[A.length," losers"]})]}),s.jsx("div",{className:"progress-bar",style:{height:8},children:(()=>{const P=k.reduce(($,I)=>$+I.realized_pnl_cents,0)+Math.abs(A.reduce(($,I)=>$+I.realized_pnl_cents,0));if(!P)return null;const M=k.reduce(($,I)=>$+I.realized_pnl_cents,0)/P*100;return s.jsxs("div",{className:"flex h-full w-full",children:[s.jsx("div",{style:{width:`${M}%`,background:"var(--green)",borderRadius:"2px 0 0 2px"}}),s.jsx("div",{style:{width:`${100-M}%`,background:"var(--red)",borderRadius:"0 2px 2px 0"}})]})})()})]}),x==="grouped"&&s.jsx("div",{className:"space-y-3",children:r.map(P=>{const M=c===P.event;return s.jsxs("div",{className:"card p-0 overflow-hidden",style:{padding:0},children:[s.jsxs("button",{onClick:()=>w(P.event),className:"w-full flex items-center gap-3 p-4 text-left transition",style:{background:"transparent"},onMouseEnter:$=>$.currentTarget.style.background="var(--cyan-glow)",onMouseLeave:$=>$.currentTarget.style.background="transparent",children:[s.jsx("span",{className:"text-xs inline-block transition-transform",style:{color:"var(--cyan)",transform:M?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"mono text-sm font-bold",style:{color:"var(--orange)"},children:P.event}),s.jsx("span",{className:"badge bg-cyan",children:P.positions.length})]}),s.jsx("p",{className:"text-xs truncate mt-0.5",style:{color:"var(--text-muted)"},children:P.title})]}),s.jsxs("div",{className:"flex items-center gap-6 text-right flex-shrink-0",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Cost"}),s.jsx("p",{className:"mono text-sm",style:{color:"var(--text)"},children:nn(P.totalCost)})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Contracts"}),s.jsx("p",{className:"mono text-sm",style:{color:"var(--blue)"},children:P.totalContracts.toLocaleString()})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Realized P&L"}),s.jsx("p",{className:`mono text-sm font-bold ${Bo(P.totalPnl)}`,children:Ar(P.totalPnl)})]})]})]}),M&&s.jsx("div",{style:{borderTop:"1px solid var(--border)"},children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{}),s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Contracts"}),s.jsx("th",{children:"Avg Entry"}),s.jsx("th",{children:"Cost"}),s.jsx("th",{children:"Realized P&L"}),s.jsx("th",{children:"Trades"}),s.jsx("th",{children:"Last Trade"})]})}),s.jsx("tbody",{children:P.positions.map($=>{var K,H;const I=`${$.ticker}_${$.direction}`,L=f===I,B=h[I]||[],F=g===I;return s.jsxs(E.Fragment,{children:[s.jsxs("tr",{className:"cursor-pointer",onClick:()=>N($.ticker,$.direction),children:[s.jsx("td",{style:{width:24},children:s.jsx("span",{className:"text-xs inline-block transition-transform",style:{color:"var(--cyan)",transform:L?"rotate(90deg)":"rotate(0deg)"},children:"▶"})}),s.jsx("td",{children:s.jsx("a",{href:To($.ticker),target:"_blank",rel:"noopener noreferrer",className:"mono text-sm hover:underline",style:{color:"var(--orange)"},onClick:q=>q.stopPropagation(),children:$.ticker})}),s.jsx("td",{children:s.jsx("span",{className:`badge ${Ba($.direction)}`,children:Fa($.direction)})}),s.jsx("td",{className:"mono",children:(K=$.open_contracts)==null?void 0:K.toLocaleString()}),s.jsxs("td",{className:"mono",style:{color:"var(--text-dim)"},children:[$.avg_entry_price,"¢"]}),s.jsx("td",{className:"mono",style:{color:"var(--text)"},children:nn($.open_cost_cents)}),s.jsx("td",{className:`mono font-bold ${Bo($.realized_pnl_cents)}`,children:Ar($.realized_pnl_cents)}),s.jsx("td",{className:"mono",style:{color:"var(--text-muted)"},children:(H=$.total_trades)==null?void 0:H.toLocaleString()}),s.jsx("td",{className:"text-xs",style:{color:"var(--text-muted)"},children:Q1($.last_trade_at)})]}),L&&s.jsx("tr",{children:s.jsx("td",{colSpan:9,style:{padding:0},children:s.jsx(Z1,{p:$,trades:B,loading:F})})})]},I)})})]})})]},P.event)})}),x==="flat"&&s.jsxs("div",{className:"card overflow-x-auto",style:{padding:0},children:[s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:[s.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Sort by:"}),[["cost","Cost"],["pnl","P&L"],["contracts","Contracts"]].map(([P,M])=>s.jsx("button",{onClick:()=>m(P),className:"text-xs font-semibold px-2.5 py-1 rounded-md transition",style:v===P?{background:"var(--cyan-dim)",color:"var(--cyan)"}:{color:"var(--text-muted)"},children:M},P))]}),s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"#"}),s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Market"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Contracts"}),s.jsx("th",{children:"Avg Entry"}),s.jsx("th",{children:"Cost"}),s.jsx("th",{children:"Realized P&L"}),s.jsx("th",{children:"Trades"}),s.jsx("th",{children:"Last Trade"})]})}),s.jsx("tbody",{children:_.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:10,className:"text-center py-12",style:{color:"var(--text-muted)"},children:"No open positions"})}):_.map((P,M)=>{var F,K;const $=`${P.ticker}_${P.direction}`,I=f===$,L=h[$]||[],B=g===$;return s.jsxs(E.Fragment,{children:[s.jsxs("tr",{className:"cursor-pointer",onClick:()=>N(P.ticker,P.direction),children:[s.jsx("td",{style:{color:"var(--text-muted)"},children:M+1}),s.jsx("td",{children:s.jsx("a",{href:To(P.ticker),target:"_blank",rel:"noopener noreferrer",className:"mono text-sm hover:underline",style:{color:"var(--orange)"},onClick:H=>H.stopPropagation(),children:P.ticker})}),s.jsx("td",{className:"text-xs max-w-[192px] truncate",style:{color:"var(--text-dim)"},children:P.title}),s.jsx("td",{children:s.jsx("span",{className:`badge ${Ba(P.direction)}`,children:Fa(P.direction)})}),s.jsx("td",{className:"mono",children:(F=P.open_contracts)==null?void 0:F.toLocaleString()}),s.jsxs("td",{className:"mono",style:{color:"var(--text-dim)"},children:[P.avg_entry_price,"¢"]}),s.jsx("td",{className:"mono",style:{color:"var(--text)"},children:nn(P.open_cost_cents)}),s.jsx("td",{className:`mono font-bold ${Bo(P.realized_pnl_cents)}`,children:Ar(P.realized_pnl_cents)}),s.jsx("td",{className:"mono",style:{color:"var(--text-muted)"},children:(K=P.total_trades)==null?void 0:K.toLocaleString()}),s.jsx("td",{className:"text-xs",style:{color:"var(--text-muted)"},children:Q1(P.last_trade_at)})]}),I&&s.jsx("tr",{children:s.jsx("td",{colSpan:10,style:{padding:0},children:s.jsx(Z1,{p:P,trades:L,loading:B})})})]},$)})})]})]}),x==="pnl"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"card overflow-hidden",style:{padding:0},children:[s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",style:{background:"var(--green-dim)",borderBottom:"1px solid var(--border)"},children:[s.jsx("span",{className:"text-sm font-bold text-green",children:"Winners"}),s.jsx("span",{className:"badge bg-green",children:k.length}),s.jsx("div",{className:"flex-1"}),s.jsx("span",{className:"mono font-bold text-green",children:Ar(k.reduce((P,M)=>P+M.realized_pnl_cents,0))})]}),s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Market"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Contracts"}),s.jsx("th",{children:"Cost"}),s.jsx("th",{children:"Realized P&L"}),s.jsx("th",{children:"ROI"})]})}),s.jsx("tbody",{children:k.map(P=>{var $;const M=P.open_cost_cents>0?`${(P.realized_pnl_cents/P.open_cost_cents*100).toFixed(0)}%`:"∞";return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("a",{href:To(P.ticker),target:"_blank",rel:"noopener",className:"mono text-sm hover:underline",style:{color:"var(--orange)"},children:P.ticker})}),s.jsx("td",{className:"text-xs max-w-[192px] truncate",style:{color:"var(--text-dim)"},children:P.title}),s.jsx("td",{children:s.jsx("span",{className:`badge ${Ba(P.direction)}`,children:Fa(P.direction)})}),s.jsx("td",{className:"mono",children:($=P.open_contracts)==null?void 0:$.toLocaleString()}),s.jsx("td",{className:"mono",style:{color:"var(--text-dim)"},children:nn(P.open_cost_cents)}),s.jsx("td",{className:"mono font-bold text-green",children:Ar(P.realized_pnl_cents)}),s.jsx("td",{className:"mono text-green",children:M})]},`${P.ticker}_${P.direction}`)})})]})]}),s.jsxs("div",{className:"card overflow-hidden",style:{padding:0},children:[s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",style:{background:"var(--red-dim)",borderBottom:"1px solid var(--border)"},children:[s.jsx("span",{className:"text-sm font-bold text-red",children:"Losers"}),s.jsx("span",{className:"badge bg-red",children:A.length}),s.jsx("div",{className:"flex-1"}),s.jsx("span",{className:"mono font-bold text-red",children:Ar(A.reduce((P,M)=>P+M.realized_pnl_cents,0))})]}),s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Market"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Contracts"}),s.jsx("th",{children:"Cost"}),s.jsx("th",{children:"Realized P&L"}),s.jsx("th",{children:"ROI"})]})}),s.jsx("tbody",{children:A.map(P=>{var $;const M=P.open_cost_cents>0?`${(P.realized_pnl_cents/P.open_cost_cents*100).toFixed(0)}%`:"—";return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("a",{href:To(P.ticker),target:"_blank",rel:"noopener",className:"mono text-sm hover:underline",style:{color:"var(--orange)"},children:P.ticker})}),s.jsx("td",{className:"text-xs max-w-[192px] truncate",style:{color:"var(--text-dim)"},children:P.title}),s.jsx("td",{children:s.jsx("span",{className:`badge ${Ba(P.direction)}`,children:Fa(P.direction)})}),s.jsx("td",{className:"mono",children:($=P.open_contracts)==null?void 0:$.toLocaleString()}),s.jsx("td",{className:"mono",style:{color:"var(--text-dim)"},children:nn(P.open_cost_cents)}),s.jsx("td",{className:"mono font-bold text-red",children:Ar(P.realized_pnl_cents)}),s.jsx("td",{className:"mono text-red",children:M})]},`${P.ticker}_${P.direction}`)})})]})]}),T.length>0&&s.jsxs("div",{className:"card overflow-hidden",style:{padding:0},children:[s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",style:{background:"var(--surface-el)",borderBottom:"1px solid var(--border)"},children:[s.jsx("span",{className:"text-sm font-bold",style:{color:"var(--text-dim)"},children:"Flat (No Realized P&L)"}),s.jsx("span",{className:"badge bg-orange",children:T.length})]}),s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Market"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Contracts"}),s.jsx("th",{children:"Cost"})]})}),s.jsx("tbody",{children:T.map(P=>{var M;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("a",{href:To(P.ticker),target:"_blank",rel:"noopener",className:"mono text-sm hover:underline",style:{color:"var(--orange)"},children:P.ticker})}),s.jsx("td",{className:"text-xs max-w-[192px] truncate",style:{color:"var(--text-dim)"},children:P.title}),s.jsx("td",{children:s.jsx("span",{className:`badge ${Ba(P.direction)}`,children:Fa(P.direction)})}),s.jsx("td",{className:"mono",children:(M=P.open_contracts)==null?void 0:M.toLocaleString()}),s.jsx("td",{className:"mono",style:{color:"var(--text-dim)"},children:nn(P.open_cost_cents)})]},`${P.ticker}_${P.direction}`)})})]})]})]})]})}function dZ(e){return e==="filled"?"bg-green":e==="resting"?"bg-orange":e==="canceled"?"bg-red":"bg-blue"}function J1({label:e}){return s.jsx("tr",{children:s.jsx("td",{colSpan:20,children:s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[s.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--text-muted)"},children:[s.jsx("path",{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2"}),s.jsx("rect",{x:"9",y:"3",width:"6",height:"4",rx:"1"}),s.jsx("path",{d:"M9 12h6M9 16h4"})]}),s.jsx("p",{style:{color:"var(--text-muted)",fontFamily:"var(--font-body)",fontSize:"0.875rem"},children:e})]})})})}function fZ(){return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"w-9 h-9 rounded-full border-2 animate-spin",style:{borderColor:"var(--border)",borderTopColor:"var(--cyan)"}})})}function hZ(){const[e,t]=O.useState([]),[r,n]=O.useState([]),[a,i]=O.useState(!0),[o,l]=O.useState("orders");O.useEffect(()=>{c()},[]);async function c(){i(!0);try{const[f,d]=await Promise.all([pe("/kalshi",{action:"get_orders"}),pe("/kalshi",{action:"get_fills"})]);t(f.orders||[]),n(d.fills||[])}catch{}i(!1)}async function u(f){try{await pe("/kalshi",{action:"cancel_order",order_id:f}),c()}catch{}}return a?s.jsx(fZ,{}):s.jsxs("div",{className:"space-y-6 fade-in",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-xl",style:{background:"var(--cyan-dim)",color:"var(--cyan)"},children:s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("path",{d:"M7 16V4m0 0L3 8m4-4l4 4"}),s.jsx("path",{d:"M17 8v12m0 0l4-4m-4 4l-4-4"})]})}),s.jsxs("div",{children:[s.jsx("h1",{className:"heading text-3xl",style:{color:"var(--text)"},children:"Orders"}),s.jsxs("p",{className:"section-subtitle mt-0.5",children:[e.length," orders • ",r.length," fills"]})]})]}),s.jsx("button",{onClick:c,className:"btn btn-o btn-sm",children:"Refresh"})]}),s.jsxs("div",{className:"flex rounded-xl p-1 gap-1 w-fit",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[s.jsxs("button",{onClick:()=>l("orders"),className:"btn btn-sm",style:o==="orders"?{background:"var(--cyan)",color:"var(--bg)"}:{background:"transparent",color:"var(--text-muted)",border:"none"},children:["Orders",s.jsx("span",{className:"badge ml-1",style:o==="orders"?{background:"rgba(0,0,0,0.2)",color:"var(--bg)",fontSize:"0.65rem"}:{background:"var(--surface)",color:"var(--text-muted)",fontSize:"0.65rem"},children:e.length})]}),s.jsxs("button",{onClick:()=>l("fills"),className:"btn btn-sm",style:o==="fills"?{background:"var(--cyan)",color:"var(--bg)"}:{background:"transparent",color:"var(--text-muted)",border:"none"},children:["Fills",s.jsx("span",{className:"badge ml-1",style:o==="fills"?{background:"rgba(0,0,0,0.2)",color:"var(--bg)",fontSize:"0.65rem"}:{background:"var(--surface)",color:"var(--text-muted)",fontSize:"0.65rem"},children:r.length})]})]}),o==="orders"&&s.jsx("div",{className:"card overflow-x-auto",style:{padding:0},children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Action"}),s.jsx("th",{children:"Type"}),s.jsx("th",{children:"Price"}),s.jsx("th",{children:"Qty"}),s.jsx("th",{children:"Filled"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Action"})]})}),s.jsx("tbody",{children:e.length===0?s.jsx(J1,{label:"No orders yet"}):e.map((f,d)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((f.ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"mono text-xs hover:underline transition",style:{color:"var(--orange)"},children:f.ticker})}),s.jsx("td",{children:s.jsx("span",{className:`badge ${f.side==="yes"?"bg-green":"bg-red"}`,children:(f.side||"").toUpperCase()})}),s.jsx("td",{className:"text-xs",style:{color:"var(--text-dim)"},children:(f.action||"").toUpperCase()}),s.jsx("td",{className:"text-xs",style:{color:"var(--text-muted)"},children:f.type}),s.jsxs("td",{className:"mono",style:{color:"var(--cyan)"},children:[f.yes_price||f.no_price||"—","¢"]}),s.jsx("td",{className:"mono",children:f.count||f.remaining_count||0}),s.jsx("td",{className:"mono text-green",children:f.count-(f.remaining_count||0)}),s.jsx("td",{children:s.jsx("span",{className:`badge ${dZ(f.status)}`,children:f.status})}),s.jsx("td",{children:f.status==="resting"&&s.jsx("button",{onClick:()=>u(f.order_id),className:"btn btn-d btn-sm",children:"Cancel"})})]},d))})]})}),o==="fills"&&s.jsx("div",{className:"card overflow-x-auto",style:{padding:0},children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Action"}),s.jsx("th",{children:"Price"}),s.jsx("th",{children:"Qty"}),s.jsx("th",{children:"Maker/Taker"}),s.jsx("th",{children:"Time"})]})}),s.jsx("tbody",{children:r.length===0?s.jsx(J1,{label:"No fills yet"}):r.map((f,d)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((f.ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"mono text-xs hover:underline transition",style:{color:"var(--orange)"},children:f.ticker})}),s.jsx("td",{children:s.jsx("span",{className:`badge ${f.side==="yes"?"bg-green":"bg-red"}`,children:(f.side||"").toUpperCase()})}),s.jsx("td",{className:"text-xs",style:{color:"var(--text-dim)"},children:(f.action||"").toUpperCase()}),s.jsxs("td",{className:"mono",style:{color:"var(--cyan)"},children:[f.yes_price||f.no_price||"—","¢"]}),s.jsx("td",{className:"mono",children:f.count}),s.jsx("td",{children:f.is_taker?s.jsx("span",{className:"badge bg-orange",children:"TAKER"}):s.jsx("span",{className:"badge bg-green",children:"MAKER"})}),s.jsx("td",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:f.created_time?new Date(f.created_time).toLocaleString():"—"})]},d))})]})})]})}function pZ(){const[e,t]=O.useState(null),[r,n]=O.useState(!0);O.useEffect(()=>{a()},[]);async function a(){n(!0);try{const o=await pe("/weather",{action:"get_data"});t(o)}catch{}n(!1)}async function i(){n(!0);try{const o=await pe("/weather",{action:"fetch_all"});t(o)}catch{}n(!1)}return r?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Weather Data"}),s.jsx("p",{className:"text-gray-500 text-sm",children:"NWS settlement data for Ken weather contracts"})]}),s.jsx("button",{onClick:i,className:"btn btn-p text-sm",children:"Fetch Latest"})]}),s.jsx("div",{className:"grid grid-cols-4 gap-4",children:["Stations","Forecasts","Observations","Metrics"].map((o,l)=>s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-xs text-gray-500 uppercase mb-1",children:o}),s.jsx("p",{className:"stat-v text-blue-400",children:(e==null?void 0:e[o.toLowerCase()])||"—"})]},o))}),s.jsxs("div",{className:"card",children:[s.jsx("h2",{className:"font-semibold mb-3",children:"Settlement Rule Reference"}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-gray-500 text-xs uppercase mb-2",children:"Temperature Contracts"}),s.jsxs("ul",{className:"space-y-1 text-xs text-gray-400",children:[s.jsx("li",{children:"Source: NWS Daily Climate Report (final)"}),s.jsx("li",{children:"Station: Market-specified (e.g. KORD, KLGA)"}),s.jsx("li",{children:"Values: Tmax/Tmin in degrees F"}),s.jsx("li",{children:"Missing data: treated as 0"})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-gray-500 text-xs uppercase mb-2",children:"Precipitation Contracts"}),s.jsxs("ul",{className:"space-y-1 text-xs text-gray-400",children:[s.jsx("li",{children:"Source: NWS Daily Climate Report (first complete)"}),s.jsx("li",{children:"Trace: counted as 0.00 inches"}),s.jsx("li",{children:"Missing: counted as 0.00 inches"}),s.jsx("li",{children:"Revisions: do NOT change settlement"})]})]})]})]}),((e==null?void 0:e.outcomes)||[]).length>0&&s.jsxs("div",{className:"card overflow-x-auto",children:[s.jsx("h2",{className:"font-semibold mb-3",children:"Recent Observations"}),s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Station"}),s.jsx("th",{children:"Metric"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Source"}),s.jsx("th",{children:"Date"})]})}),s.jsx("tbody",{children:e.outcomes.map((o,l)=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-mono text-sm",children:o.station_id}),s.jsx("td",{children:s.jsx("span",{className:"badge bg-blue",children:o.metric})}),s.jsxs("td",{className:"font-mono",children:[o.value,o.units]}),s.jsx("td",{className:"text-xs text-gray-400",children:o.source}),s.jsx("td",{className:"text-xs text-gray-400",children:o.period_end})]},l))})]})]})]})}const mZ={aggressive:"#ef4444",conservative:"#3b82f6",weather:"#06b6d4",momentum:"#f59e0b",contrarian:"#a855f7",ai_enhanced:"#ec4899",mc_validated:"#8b5cf6",scalper:"#10b981",patient:"#6366f1",random:"#f97316",penny_pincher:"#84cc16",spray_pray:"#14b8a6",nickel_slots:"#eab308",degen_lite:"#e11d48",politics_junkie:"#7c3aed",double_down:"#dc2626",volatility_rider:"#0ea5e9",whale:"#1d4ed8",yolo:"#be123c",full_send:"#ea580c",kelly_criterion:"#4f46e5",sharpe_sniper:"#059669",bayesian_blend:"#7c3aed",ensemble_lock:"#0891b2",mean_revert:"#4338ca",info_ratio:"#b45309",anti_fomo:"#64748b",nightcrawler:"#334155",heatseeker:"#dc2626",quant_core:"#2563eb"},vZ="#F7931A";function x2(e){return e.startsWith("etf_")?vZ:mZ[e]||"#6b7280"}function gZ({won:e,lost:t,total:r}){if(!r)return s.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"no trades"});const n=e/r*100,a=t/r*100;return s.jsxs("div",{className:"flex h-1.5 rounded-full overflow-hidden w-full",style:{background:"var(--border)"},children:[e>0&&s.jsx("div",{style:{width:`${n}%`,background:"var(--green)"}}),t>0&&s.jsx("div",{style:{width:`${a}%`,background:"var(--red)"}})]})}function yZ({streak:e}){if(e===0)return s.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.7rem"},children:"—"});const t=e>0;return s.jsxs("span",{className:"mono font-bold text-xs",style:{color:t?"var(--green)":"var(--red)"},children:[t?"+":"",e]})}function xZ({p:e,dailyPnl:t,expanded:r,onToggle:n}){const a=(e.total_returned_cents-e.total_invested_cents)/100,i=e.trades_won+e.trades_lost+e.trades_expired,o=e.total_invested_cents/100,l=e.total_returned_cents/100,c=i>0,u=x2(e.strategy),f=Math.min(100,e.daily_budget_cents/Math.max(1,1e5)*100);return s.jsxs("div",{className:"card cursor-pointer transition-all",style:r?{borderColor:"var(--cyan)",boxShadow:"0 0 20px var(--cyan-glow)",opacity:1}:c?{opacity:1}:{opacity:.5},onClick:n,children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{background:u}}),s.jsx("span",{className:"heading font-semibold text-sm truncate",style:{color:"var(--text)"},children:e.name}),s.jsxs("span",{className:"mono text-xs flex-shrink-0",style:{color:"var(--text-muted)"},children:["#",e.id]})]}),s.jsxs("span",{className:"mono text-sm font-bold flex-shrink-0 ml-2",style:{color:a>=0?"var(--green)":"var(--red)"},children:[a>=0?"+":"","$",a.toFixed(2)]})]}),s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"mono px-1.5 py-0.5 rounded text-xs flex-shrink-0",style:{background:`${u}15`,color:u,border:`1px solid ${u}30`},children:e.strategy}),s.jsx(yZ,{streak:e.streak}),s.jsx("div",{className:"flex-1"}),s.jsx("span",{className:"badge flex-shrink-0",style:c?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--border)",color:"var(--text-muted)"},children:c?"Active":"Dormant"})]}),s.jsxs("div",{className:"mb-3",children:[s.jsx(gZ,{won:e.trades_won,lost:e.trades_lost,total:i}),s.jsxs("div",{className:"flex justify-between mt-1",children:[s.jsxs("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:[e.trades_won,"W / ",e.trades_lost,"L"]}),s.jsxs("span",{className:"mono text-xs",style:{color:"var(--text-dim)"},children:[e.win_rate||0,"%"]})]})]}),s.jsxs("div",{className:"mb-3",children:[s.jsxs("div",{className:"flex justify-between text-xs mb-1",style:{color:"var(--text-muted)"},children:[s.jsx("span",{children:"Daily Budget"}),s.jsxs("span",{className:"mono",style:{color:"var(--text-dim)"},children:["$",(e.daily_budget_cents/100).toFixed(2)]})]}),s.jsx("div",{className:"progress-bar",children:s.jsx("div",{className:"progress-fill",style:{width:`${f}%`,background:`linear-gradient(90deg, ${u}, ${u}99)`}})})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1",style:{fontSize:"0.7rem"},children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{style:{color:"var(--text-muted)"},children:"Invested"}),s.jsxs("span",{className:"mono",style:{color:"var(--text-dim)"},children:["$",o.toFixed(2)]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{style:{color:"var(--text-muted)"},children:"Returned"}),s.jsxs("span",{className:"mono",style:{color:"var(--text-dim)"},children:["$",l.toFixed(2)]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{style:{color:"var(--text-muted)"},children:"Trades Today"}),s.jsx("span",{className:"mono",style:{color:"var(--cyan)"},children:e.trades_today})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{style:{color:"var(--text-muted)"},children:"Total"}),s.jsx("span",{className:"mono",style:{color:"var(--text-dim)"},children:i})]})]}),r&&t&&t.length>0&&s.jsxs("div",{className:"mt-3 pt-3",style:{borderTop:"1px solid var(--border)"},children:[s.jsx("p",{className:"text-xs mb-1",style:{color:"var(--text-muted)"},children:"Cumulative P&L"}),s.jsx(ki,{width:"100%",height:80,children:s.jsxs(y2,{data:t,children:[s.jsx(Rn,{dataKey:"date",hide:!0}),s.jsx(Bn,{hide:!0,domain:["dataMin","dataMax"]}),s.jsx(jt,{contentStyle:{background:"var(--surface-el)",border:"1px solid var(--border)",borderRadius:8,fontSize:11,fontFamily:"var(--font-mono)"},formatter:d=>[`$${(d/100).toFixed(2)}`,"P&L"],labelFormatter:d=>d}),s.jsx(Jr,{type:"monotone",dataKey:"cumulative",stroke:u,fill:u,fillOpacity:.1,strokeWidth:1.5,dot:!1})]})}),e.description&&s.jsx("p",{className:"text-xs mt-1",style:{color:"var(--text-muted)"},children:e.description})]})]})}function bZ(){return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"w-9 h-9 rounded-full border-2 animate-spin",style:{borderColor:"var(--border)",borderTopColor:"var(--cyan)"}})})}function jZ(){const[e,t]=O.useState([]),[r,n]=O.useState({}),[a,i]=O.useState(!0),[o,l]=O.useState("all"),[c,u]=O.useState("pnl"),[f,d]=O.useState(null);O.useEffect(()=>{h()},[]);async function h(){try{const[m,S]=await Promise.all([ke("/portfolios"),ke("/portfolio-trades?include_history=true").catch(()=>({}))]);t(m||[]),S!=null&&S.byPortfolio&&n(S.byPortfolio)}catch{}i(!1)}const p=O.useMemo(()=>{let m=[...e];return o==="active"&&(m=m.filter(S=>S.trades_won+S.trades_lost>0)),o==="dormant"&&(m=m.filter(S=>S.trades_won+S.trades_lost===0)),o==="etf"&&(m=m.filter(S=>S.strategy.startsWith("etf_"))),o==="core"&&(m=m.filter(S=>!S.strategy.startsWith("etf_"))),c==="pnl"&&m.sort((S,j)=>j.total_returned_cents-j.total_invested_cents-(S.total_returned_cents-S.total_invested_cents)),c==="winrate"&&m.sort((S,j)=>(j.win_rate||0)-(S.win_rate||0)),c==="invested"&&m.sort((S,j)=>j.total_invested_cents-S.total_invested_cents),c==="name"&&m.sort((S,j)=>S.name.localeCompare(j.name)),c==="id"&&m.sort((S,j)=>S.id-j.id),m},[e,o,c]),g=O.useMemo(()=>{const m=e.reduce((T,C)=>T+C.total_invested_cents,0),S=e.reduce((T,C)=>T+C.total_returned_cents,0),j=e.reduce((T,C)=>T+C.trades_won,0),w=e.reduce((T,C)=>T+C.trades_lost,0),N=e.filter(T=>T.trades_won+T.trades_lost>0).length,_=e.length-N,k=[...e].sort((T,C)=>C.total_returned_cents-C.total_invested_cents-(T.total_returned_cents-T.total_invested_cents))[0],A=[...e].sort((T,C)=>T.total_returned_cents-T.total_invested_cents-(C.total_returned_cents-C.total_invested_cents))[0];return{totalInvested:m,totalReturned:S,totalWins:j,totalLosses:w,active:N,dormant:_,bestPf:k,worstPf:A}},[e]),b=O.useMemo(()=>[...e].map(m=>({name:m.name,pnl:(m.total_returned_cents-m.total_invested_cents)/100,strategy:m.strategy})).filter(m=>m.pnl!==0).sort((m,S)=>S.pnl-m.pnl).slice(0,20),[e]),x=O.useMemo(()=>{const m={};return e.forEach(S=>{const j=S.strategy.startsWith("etf_")?"ETF Baskets":S.strategy;m[j]||(m[j]={name:j,value:0}),m[j].value+=S.total_invested_cents}),Object.values(m).filter(S=>S.value>0).sort((S,j)=>j.value-S.value)},[e]);if(a)return s.jsx(bZ,{});const y=(g.totalReturned-g.totalInvested)/100,v=g.totalWins+g.totalLosses;return s.jsxs("div",{className:"space-y-6 fade-in",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"heading text-3xl",style:{color:"var(--text)"},children:["Portfauxlios",s.jsx("span",{className:"badge bg-cyan ml-3 align-middle text-base",children:e.length})]}),s.jsxs("p",{className:"section-subtitle mt-1",children:["All ",e.length," portfolios — performance, P&L, and strategy breakdown"]})]}),s.jsx("button",{onClick:h,className:"btn btn-o btn-sm",children:"Refresh"})]}),s.jsx("div",{className:"grid grid-cols-3 md:grid-cols-6 gap-3",children:[{label:"Total P&L",value:`${y>=0?"+":""}$${y.toFixed(2)}`,color:y>=0?"var(--green)":"var(--red)"},{label:"Invested",value:`$${(g.totalInvested/100).toFixed(2)}`,color:"var(--orange)"},{label:"Returned",value:`$${(g.totalReturned/100).toFixed(2)}`,color:"var(--blue)"},{label:"Win Rate",value:v?`${(g.totalWins/v*100).toFixed(1)}%`:"0%",color:"var(--purple)"},{label:"Active",value:g.active,color:"var(--green)"},{label:"Dormant",value:g.dormant,color:"var(--text-muted)"}].map(m=>s.jsxs("div",{className:"card text-center",style:{padding:"1rem"},children:[s.jsx("div",{className:"stat-v",style:{color:m.color,fontSize:"1.4rem"},children:m.value}),s.jsx("div",{className:"stat-label mt-1",children:m.label})]},m.label))}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"card md:col-span-2",children:[s.jsx("h2",{className:"heading text-sm mb-3",style:{color:"var(--text-dim)"},children:"P&L by Portfolio"}),b.length>0?s.jsx(ki,{width:"100%",height:220,children:s.jsxs(v2,{data:b,margin:{left:10,right:10},children:[s.jsx(Rn,{dataKey:"name",tick:{fill:"var(--text-muted)",fontSize:9,fontFamily:"var(--font-mono)"},angle:-45,textAnchor:"end",height:60}),s.jsx(Bn,{tick:{fill:"var(--text-muted)",fontSize:10,fontFamily:"var(--font-mono)"},tickFormatter:m=>`$${m}`}),s.jsx(jt,{contentStyle:{background:"var(--surface-el)",border:"1px solid var(--border)",borderRadius:8,fontSize:11,fontFamily:"var(--font-mono)"},formatter:m=>[`$${m.toFixed(2)}`,"P&L"]}),s.jsx(Dn,{dataKey:"pnl",radius:[4,4,0,0],children:b.map((m,S)=>s.jsx(ga,{fill:m.pnl>=0?"var(--green)":"var(--red)",fillOpacity:.8},S))})]})}):s.jsx("div",{className:"text-center py-10 text-sm",style:{color:"var(--text-muted)"},children:"No P&L data yet"})]}),s.jsxs("div",{className:"card",children:[s.jsx("h2",{className:"heading text-sm mb-3",style:{color:"var(--text-dim)"},children:"Capital Allocation"}),x.length>0?s.jsx(ki,{width:"100%",height:220,children:s.jsxs(g2,{children:[s.jsx(kr,{data:x,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",innerRadius:40,outerRadius:75,paddingAngle:2,strokeWidth:0,children:x.map((m,S)=>s.jsx(ga,{fill:x2(m.name==="ETF Baskets"?"etf_":m.name),fillOpacity:.85},S))}),s.jsx(jt,{contentStyle:{background:"var(--surface-el)",border:"1px solid var(--border)",borderRadius:8,fontSize:11,fontFamily:"var(--font-mono)"},formatter:m=>[`$${(m/100).toFixed(2)}`,"Invested"]})]})}):s.jsx("div",{className:"text-center py-10 text-sm",style:{color:"var(--text-muted)"},children:"No allocations yet"})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[g.bestPf&&s.jsxs("div",{className:"card",style:{borderColor:"rgba(0,195,137,0.25)",background:"var(--green-dim)"},children:[s.jsx("div",{className:"flex items-center gap-2 mb-2",children:s.jsx("span",{className:"badge",style:{background:"var(--green-dim)",color:"var(--green)"},children:"Best Performer"})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"heading font-bold",style:{color:"var(--text)"},children:g.bestPf.name}),s.jsxs("span",{className:"mono font-bold text-green",children:["+$",((g.bestPf.total_returned_cents-g.bestPf.total_invested_cents)/100).toFixed(2)]})]}),s.jsxs("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:[g.bestPf.strategy," — ",g.bestPf.win_rate||0,"% win rate"]})]}),g.worstPf&&s.jsxs("div",{className:"card",style:{borderColor:"rgba(255,92,92,0.25)",background:"var(--red-dim)"},children:[s.jsx("div",{className:"flex items-center gap-2 mb-2",children:s.jsx("span",{className:"badge",style:{background:"var(--red-dim)",color:"var(--red)"},children:"Worst Performer"})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"heading font-bold",style:{color:"var(--text)"},children:g.worstPf.name}),s.jsxs("span",{className:"mono font-bold text-red",children:["$",((g.worstPf.total_returned_cents-g.worstPf.total_invested_cents)/100).toFixed(2)]})]}),s.jsxs("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:[g.worstPf.strategy," — ",g.worstPf.win_rate||0,"% win rate"]})]})]}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsx("div",{className:"flex flex-wrap gap-2",children:["all","active","dormant","etf","core"].map(m=>s.jsx("button",{onClick:()=>l(m),className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition",style:o===m?{background:"var(--cyan-dim)",color:"var(--cyan)",border:"1px solid rgba(0,240,255,0.3)"}:{background:"var(--surface-el)",color:"var(--text-muted)",border:"1px solid var(--border)"},children:m==="all"?`All (${e.length})`:m==="active"?`Active (${g.active})`:m==="dormant"?`Dormant (${g.dormant})`:m==="etf"?"ETF Baskets":"Core Strategies"},m))}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Sort:"}),["pnl","winrate","invested","name","id"].map(m=>s.jsx("button",{onClick:()=>u(m),className:"px-2 py-1 rounded text-xs font-medium transition",style:c===m?{color:"var(--cyan)",background:"var(--cyan-dim)"}:{color:"var(--text-muted)"},children:m==="pnl"?"P&L":m==="winrate"?"Win%":m.charAt(0).toUpperCase()+m.slice(1)},m))]})]}),p.length===0?s.jsx("div",{className:"text-center py-16 text-sm",style:{color:"var(--text-muted)"},children:"No portfolios match this filter"}):s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:p.map(m=>{var S;return s.jsx(xZ,{p:m,dailyPnl:((S=r[m.id])==null?void 0:S.daily)||[],expanded:f===m.id,onToggle:()=>d(f===m.id?null:m.id)},m.id)})})]})}const wZ=[{label:"30s",ms:3e4},{label:"1m",ms:6e4},{label:"2m",ms:12e4},{label:"5m",ms:3e5},{label:"8m",ms:48e4},{label:"10m",ms:6e5},{label:"15m",ms:9e5},{label:"30m",ms:18e5},{label:"60m",ms:36e5}];function SZ(e){return e>=36e5?`${e/36e5}h`:e>=6e4?`${e/6e4}m`:`${e/1e3}s`}function Xl({label:e,value:t,onChange:r,description:n}){return s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-gray-200",children:e}),s.jsx("p",{className:"text-[10px] text-gray-500",children:n})]}),s.jsx("span",{className:"font-mono text-amber-400 text-lg font-bold",children:SZ(t)})]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:wZ.map(a=>s.jsx("button",{onClick:()=>r(a.ms),className:`px-2.5 py-1 rounded text-xs font-medium transition ${t===a.ms?"bg-amber-500/20 text-amber-400 border border-amber-500/40":"bg-gray-800/60 text-gray-500 border border-gray-700 hover:border-gray-500 hover:text-gray-300"}`,children:a.label},a.ms))})]})}function _Z(){const[e,t]=O.useState(null),[r,n]=O.useState(!0),[a,i]=O.useState(""),[o,l]=O.useState(""),[c,u]=O.useState("demo"),[f,d]=O.useState(!1),[h,p]=O.useState(null),[g,b]=O.useState(null),[x,y]=O.useState(null),[v,m]=O.useState(!1);O.useEffect(()=>{S(),j();const A=setInterval(j,3e4);return()=>clearInterval(A)},[]);async function S(){try{const A=await pe("/kalshi",{action:"status"});t(A),A.env&&u(A.env)}catch{}n(!1)}async function j(){try{const A=await ke("/scan-config");b(A)}catch{}}async function w(A,T){m(!0),y(null);try{const C=await ke("/scan-config",{method:"POST",body:JSON.stringify({[A]:T})});C.success?(b(C),y({type:"ok",text:`Updated ${A.replace(/_/g," ")}`})):y({type:"err",text:C.error||"Failed"})}catch{y({type:"err",text:"Connection error"})}m(!1),setTimeout(()=>y(null),3e3)}async function N(){d(!0),p(null);try{const A=await pe("/kalshi",{action:"save_keys",api_key:a,private_key:o,env:c});A.success?(p({type:"ok",text:"Keys saved"}),S(),i(""),l("")):p({type:"err",text:A.error||"Failed"})}catch{p({type:"err",text:"Connection error"})}d(!1)}async function _(){try{await pe("/kalshi",{action:"disconnect"}),S()}catch{}}async function k(){p(null);try{const A=await pe("/kalshi",{action:"test_connection"});p({type:A.success?"ok":"err",text:A.success?`Connected! Exchange: ${A.exchange_status}`:"Connection failed"})}catch{p({type:"err",text:"Connection error"})}}return r?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})}):s.jsxs("div",{className:"space-y-6",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Settings"}),g&&s.jsxs("div",{className:"card space-y-5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"font-semibold",children:"Scan & Pipeline Configuration"}),s.jsx("p",{className:"text-[10px] text-gray-500",children:"Adjust intervals, thresholds, and risk parameters in real-time"})]}),v&&s.jsx("span",{className:"text-xs text-amber-400 animate-pulse",children:"Saving..."})]}),x&&s.jsx("p",{className:`text-xs px-3 py-1.5 rounded ${x.type==="ok"?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,children:x.text}),s.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 bg-gray-800/40 rounded-lg border border-gray-700",children:[s.jsx("span",{className:"text-[10px] text-gray-500 uppercase font-medium",children:"Cached Markets"}),s.jsx("span",{className:"font-mono text-xl font-bold text-amber-400",children:g.cached_markets||0})]}),s.jsx(Xl,{label:"Market Scan",description:"How often to fetch & analyze all active Kalshi markets",value:g.scan_interval_ms,onChange:A=>w("scan_interval_ms",A)}),s.jsx(Xl,{label:"Signal Pipeline",description:"News sentiment + probability + Monte Carlo signal generation",value:g.signal_pipeline_ms,onChange:A=>w("signal_pipeline_ms",A)}),s.jsx(Xl,{label:"Intelligence Sweep",description:"Reddit, news feeds, Bluesky, Mastodon, Lemmy + 20 more sources",value:g.reddit_interval_ms,onChange:A=>w("reddit_interval_ms",A)}),s.jsx(Xl,{label:"Trade Resolution",description:"Take-profit/stop-loss check on open portfolio positions",value:g.resolve_interval_ms,onChange:A=>w("resolve_interval_ms",A)}),s.jsxs("div",{className:"border-t border-gray-700 pt-4 space-y-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Risk Parameters"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-gray-200",children:"Min Edge Threshold"}),s.jsx("p",{className:"text-[10px] text-gray-500",children:"Minimum statistical edge required to approve a signal"})]}),s.jsxs("span",{className:"font-mono text-amber-400 text-lg font-bold",children:[(g.min_edge_threshold*100).toFixed(1),"%"]})]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:[.01,.02,.03,.05,.08,.1,.15,.2].map(A=>s.jsxs("button",{onClick:()=>w("min_edge_threshold",A),className:`px-2.5 py-1 rounded text-xs font-medium transition ${Math.abs(g.min_edge_threshold-A)<.001?"bg-amber-500/20 text-amber-400 border border-amber-500/40":"bg-gray-800/60 text-gray-500 border border-gray-700 hover:border-gray-500 hover:text-gray-300"}`,children:[(A*100).toFixed(0),"%"]},A))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-gray-200",children:"Min Liquidity (24h Vol)"}),s.jsx("p",{className:"text-[10px] text-gray-500",children:"Minimum 24-hour trading volume to consider a market"})]}),s.jsx("span",{className:"font-mono text-amber-400 text-lg font-bold",children:g.min_liquidity})]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:[0,10,25,50,100,250,500,1e3].map(A=>s.jsx("button",{onClick:()=>w("min_liquidity",A),className:`px-2.5 py-1 rounded text-xs font-medium transition ${g.min_liquidity===A?"bg-amber-500/20 text-amber-400 border border-amber-500/40":"bg-gray-800/60 text-gray-500 border border-gray-700 hover:border-gray-500 hover:text-gray-300"}`,children:A===0?"None":A},A))})]})]})]}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"flex items-center gap-4 mb-3",children:[s.jsx("span",{className:`w-3 h-3 rounded-full ${e!=null&&e.connected?"bg-green-500 pulse-g":"bg-gray-600"}`}),s.jsx("h2",{className:"font-semibold",children:"Ken API Connection"})]}),e!=null&&e.connected?s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"API Key"}),s.jsx("span",{className:"font-mono text-gray-300",children:e.api_key_masked||"***"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-500",children:"Environment"}),s.jsx("span",{className:e.env==="prod"?"text-green-400":"text-yellow-400",children:(e.env||"demo").toUpperCase()})]}),s.jsxs("div",{className:"flex gap-2 mt-3",children:[s.jsx("button",{onClick:k,className:"btn btn-o text-sm",children:"Test Connection"}),s.jsx("button",{onClick:_,className:"btn btn-d text-sm",children:"Disconnect"})]})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>u("demo"),className:`flex-1 py-2 rounded-lg text-sm font-medium transition ${c==="demo"?"bg-yellow-500/15 text-yellow-400 border border-yellow-500/30":"bg-gray-800/50 text-gray-500 border border-gray-700"}`,children:"Demo"}),s.jsx("button",{onClick:()=>u("prod"),className:`flex-1 py-2 rounded-lg text-sm font-medium transition ${c==="prod"?"bg-green-500/15 text-green-400 border border-green-500/30":"bg-gray-800/50 text-gray-500 border border-gray-700"}`,children:"Production"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1",children:"API Key ID"}),s.jsx("input",{type:"text",value:a,onChange:A=>i(A.target.value),placeholder:"Your API key",className:"w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none font-mono"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1",children:"Private Key (PEM)"}),s.jsx("textarea",{value:o,onChange:A=>l(A.target.value),placeholder:"-----BEGIN RSA PRIVATE KEY-----",rows:4,className:"w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none font-mono text-xs"})]}),s.jsx("button",{onClick:N,disabled:f||!a,className:"btn btn-p w-full",children:f?"Saving...":"Save & Connect"})]}),h&&s.jsx("p",{className:`text-xs mt-2 ${h.type==="ok"?"text-green-400":"text-red-400"}`,children:h.text})]}),s.jsxs("div",{className:"card",children:[s.jsx("h2",{className:"font-semibold mb-3",children:"Ken API Reference"}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 text-xs text-gray-400",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-gray-500 uppercase mb-1 font-medium",children:"Environments"}),s.jsxs("p",{children:["Demo: ",s.jsx("span",{className:"font-mono text-amber-400",children:"demo-api.kalshi.co"})]}),s.jsxs("p",{children:["Prod: ",s.jsx("span",{className:"font-mono text-green-400",children:"api.elections.kalshi.com"})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-gray-500 uppercase mb-1 font-medium",children:"Auth"}),s.jsx("p",{children:"Method: RSA-PSS + SHA-256"}),s.jsx("p",{children:"Headers: KALSHI-ACCESS-KEY, TIMESTAMP, SIGNATURE"})]})]})]})]})}const NZ={BUY_YES:"bg-green",BUY_NO:"bg-red"};function OZ(e){if(!e)return null;const t=e.match(/on\s+"([^"]+)"/);return t?t[1]:null}function kZ({value:e}){const t=Math.max(0,Math.min(100,e*100)),r=e>.7?"var(--green)":e>.5?"var(--orange)":"var(--red)";return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"progress-bar flex-1",style:{minWidth:64},children:s.jsx("div",{className:"progress-fill",style:{width:`${t}%`,background:`linear-gradient(90deg, ${r}, ${r}cc)`}})}),s.jsxs("span",{className:"mono text-xs",style:{color:"var(--text-dim)"},children:[t.toFixed(0),"%"]})]})}function PZ({s:e}){const[t,r]=O.useState(!1),n=OZ(e.reasoning)||e.market_id,a=parseFloat(e.expected_edge)||0,i=parseFloat(e.confidence)||0;return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"cursor-pointer transition",onClick:()=>r(!t),style:{background:t?"rgba(0,240,255,0.04)":void 0},children:[s.jsx("td",{className:"whitespace-nowrap",children:s.jsx("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:new Date(e.created_at).toLocaleTimeString()})}),s.jsxs("td",{className:"max-w-[280px]",children:[s.jsx("a",{href:e.kalshi_url||`https://kalshi.com/search?query=${encodeURIComponent((e.market_id||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"text-sm truncate block hover:underline transition heading",style:{color:"var(--cyan)"},onClick:o=>o.stopPropagation(),children:n}),s.jsx("span",{className:"mono text-[10px]",style:{color:"var(--text-muted)"},children:e.market_id})]}),s.jsx("td",{children:s.jsx("span",{className:`badge ${NZ[e.direction]||"bg-yellow"}`,children:e.direction})}),s.jsx("td",{children:s.jsxs("span",{className:"mono font-bold text-base",style:{color:a>0?"var(--cyan)":"var(--red)"},children:[a>0?"+":"",(a*100).toFixed(1),"%"]})}),s.jsx("td",{children:s.jsx("span",{className:"mono text-sm",style:{color:"var(--text-dim)"},children:e.size_recommendation||"—"})}),s.jsx("td",{style:{minWidth:140},children:s.jsx(kZ,{value:i})}),s.jsx("td",{children:s.jsx("span",{className:`badge ${e.risk_approved?"bg-green":"bg-red"}`,children:e.risk_approved?"APPROVED":"BLOCKED"})}),s.jsx("td",{children:s.jsx("span",{style:{color:"var(--text-muted)"},children:t?"▾":"▸"})})]}),t&&s.jsx("tr",{style:{background:"rgba(0,240,255,0.02)"},children:s.jsxs("td",{colSpan:8,className:"px-4 py-3",children:[s.jsx("p",{className:"text-xs leading-relaxed fade-in",style:{color:"var(--text-dim)"},children:e.reasoning}),e.sources&&s.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:(typeof e.sources=="string"?e.sources.split(","):Array.isArray(e.sources)?e.sources:[]).map((o,l)=>s.jsx("span",{className:"badge bg-blue text-[10px]",children:o.trim()},l))})]})})]})}function AZ({s:e}){const t=parseFloat(e.edge)||0,r=parseFloat(e.sentiment_impact)||0,n=e.market_title||e.market_id;return s.jsxs("tr",{children:[s.jsx("td",{className:"whitespace-nowrap",children:s.jsx("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:new Date(e.created_at).toLocaleTimeString()})}),s.jsxs("td",{className:"max-w-[250px]",children:[s.jsx("a",{href:e.kalshi_url||`https://kalshi.com/search?query=${encodeURIComponent((e.market_id||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"text-sm truncate block hover:underline transition heading",style:{color:"var(--cyan)"},children:n}),s.jsx("span",{className:"mono text-[10px]",style:{color:"var(--text-muted)"},children:e.market_id})]}),s.jsx("td",{children:s.jsxs("span",{className:"mono text-sm",style:{color:"var(--text-dim)"},children:[(parseFloat(e.prior_probability)*100).toFixed(1),"%"]})}),s.jsx("td",{children:s.jsxs("span",{className:"mono text-sm font-semibold",style:{color:r>0?"var(--green)":"var(--red)"},children:[r>0?"+":"",(r*100).toFixed(2),"%"]})}),s.jsx("td",{children:s.jsxs("span",{className:"mono text-sm",style:{color:"var(--orange)"},children:[(parseFloat(e.adjusted_probability)*100).toFixed(1),"%"]})}),s.jsx("td",{children:s.jsxs("span",{className:"mono text-sm",style:{color:"var(--text-dim)"},children:[(parseFloat(e.market_probability)*100).toFixed(1),"%"]})}),s.jsx("td",{children:s.jsxs("span",{className:"mono text-sm font-bold",style:{color:t>0?"var(--green)":t<0?"var(--red)":"var(--text-muted)"},children:[t>0?"+":"",(t*100).toFixed(1),"%"]})}),s.jsx("td",{children:s.jsx("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:e.num_articles})})]})}function $Z({s:e}){const t=parseFloat(e.avg_sent)||0;return s.jsxs("div",{className:"card flex items-center justify-between",style:{padding:"0.75rem 1rem"},children:[s.jsx("span",{className:"text-sm font-medium heading",children:e.source}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:[e.cnt," items"]}),s.jsxs("span",{className:"mono text-xs font-bold",style:{color:t>.05?"var(--green)":t<-.05?"var(--red)":"var(--text-muted)"},children:[t>0?"+":"",(t*100).toFixed(0),"%"]})]})]})}function Ia({label:e,value:t,color:r}){return s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"stat-label mb-2",children:e}),s.jsx("p",{className:"stat-v",style:{color:r},children:t})]})}function Jf({active:e,onClick:t,children:r}){return s.jsx("button",{onClick:t,className:"btn btn-sm transition",style:{background:e?"var(--cyan-dim)":"transparent",color:e?"var(--cyan)":"var(--text-muted)",border:e?"1px solid rgba(0,240,255,0.3)":"1px solid transparent",borderRadius:"var(--radius-md)"},children:r})}function EZ(){var p,g,b,x,y,v;const[e,t]=O.useState(null),[r,n]=O.useState(null),[a,i]=O.useState(!0),[o,l]=O.useState("signals");O.useEffect(()=>{c();const m=setInterval(c,3e4);return()=>clearInterval(m)},[]);async function c(){try{const[m,S]=await Promise.all([ke("/signals"),ke("/signals/dashboard")]);t(m),n(S)}catch{}i(!1)}if(a)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-t-transparent rounded-full pulse-cyan",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const u=(r==null?void 0:r.stats)||{},f=(e==null?void 0:e.signals)||[],d=(e==null?void 0:e.probabilityShifts)||[],h=(r==null?void 0:r.sourceBreakdown)||[];return s.jsxs("div",{className:"space-y-6 fade-in",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-2xl",style:{color:"var(--cyan)"},children:"⚡"}),s.jsx("h1",{className:"heading text-3xl font-bold",style:{color:"var(--text)"},children:"Signals"}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"inline-block w-2 h-2 rounded-full pulse-cyan",style:{background:"var(--cyan)"}}),s.jsx("span",{className:"text-xs",style:{color:"var(--cyan)"},children:"LIVE"})]})]}),s.jsxs("p",{className:"section-subtitle mt-1",children:["News → Sentiment → Probability → Signals → Risk  ·  ",((p=e==null?void 0:e.pipeline)==null?void 0:p.cachedMarkets)||0," markets tracked"]})]}),s.jsx("button",{onClick:c,className:"btn btn-o btn-sm",children:"↻ Refresh"})]}),s.jsxs("div",{className:"grid grid-cols-6 gap-3",children:[s.jsx(Ia,{label:"Signals 24h",value:u.total_signals||0,color:"var(--orange)"}),s.jsx(Ia,{label:"Approved",value:u.approved_signals||0,color:"var(--green)"}),s.jsx(Ia,{label:"BUY YES",value:u.buy_yes||0,color:"var(--green)"}),s.jsx(Ia,{label:"BUY NO",value:u.buy_no||0,color:"var(--red)"}),s.jsx(Ia,{label:"Avg Edge",value:u.avg_edge?`${(u.avg_edge*100).toFixed(1)}%`:"—",color:"var(--cyan)"}),s.jsx(Ia,{label:"Avg Confidence",value:u.avg_confidence?`${(u.avg_confidence*100).toFixed(0)}%`:"—",color:"var(--blue)"})]}),s.jsxs("div",{className:"flex gap-2 pb-3",style:{borderBottom:"1px solid var(--border)"},children:[s.jsxs(Jf,{active:o==="signals",onClick:()=>l("signals"),children:["Strategy Signals (",f.length,")"]}),s.jsxs(Jf,{active:o==="shifts",onClick:()=>l("shifts"),children:["Probability Shifts (",d.length,")"]}),s.jsxs(Jf,{active:o==="sources",onClick:()=>l("sources"),children:["Source Breakdown (",h.length,")"]})]}),o==="signals"&&s.jsx("div",{className:"card overflow-x-auto fade-in",style:{padding:0},children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Time"}),s.jsx("th",{children:"Market"}),s.jsx("th",{children:"Direction"}),s.jsx("th",{children:"Edge"}),s.jsx("th",{children:"Size"}),s.jsx("th",{children:"Confidence"}),s.jsx("th",{children:"Risk"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:f.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:8,className:"text-center py-12",style:{color:"var(--text-muted)"},children:s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx("span",{className:"text-2xl",children:"⚡"}),s.jsx("span",{className:"text-sm",children:"No signals generated yet"})]})})}):f.map(m=>s.jsx(PZ,{s:m},m.id))})]})}),o==="shifts"&&s.jsx("div",{className:"card overflow-x-auto fade-in",style:{padding:0},children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Time"}),s.jsx("th",{children:"Market"}),s.jsx("th",{children:"Prior"}),s.jsx("th",{children:"Impact"}),s.jsx("th",{children:"Adjusted"}),s.jsx("th",{children:"Market Price"}),s.jsx("th",{children:"Edge"}),s.jsx("th",{children:"Articles"})]})}),s.jsx("tbody",{children:d.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:8,className:"text-center py-12",style:{color:"var(--text-muted)"},children:s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx("span",{className:"text-2xl",children:"📊"}),s.jsx("span",{className:"text-sm",children:"No probability shifts yet"})]})})}):d.map((m,S)=>s.jsx(AZ,{s:m},S))})]})}),o==="sources"&&s.jsxs("div",{className:"grid grid-cols-2 gap-4 fade-in",children:[s.jsxs("div",{children:[s.jsxs("p",{className:"section-title mb-3",style:{fontSize:"1rem"},children:["Active Sources",s.jsx("span",{className:"badge bg-cyan ml-2",children:h.length})]}),s.jsx("div",{className:"space-y-2",children:h.length===0?s.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"No recent source data"}):h.map((m,S)=>s.jsx($Z,{s:m},S))})]}),s.jsxs("div",{children:[s.jsx("p",{className:"section-title mb-3",style:{fontSize:"1rem"},children:"Pipeline Config"}),s.jsx("div",{className:"card space-y-2",children:[{label:"Market Scan",value:"Every 15 min"},{label:"Signal Pipeline",value:"Every 5 min"},{label:"Intelligence Sweep",value:"Every 30 min"},{label:"Min Edge Threshold",value:`${((((b=(g=e==null?void 0:e.pipeline)==null?void 0:g.riskLimits)==null?void 0:b.minEdgeThreshold)||.05)*100).toFixed(0)}%`,highlight:!0},{label:"Min Liquidity",value:`${((y=(x=e==null?void 0:e.pipeline)==null?void 0:x.riskLimits)==null?void 0:y.minLiquidity)||100} vol`,highlight:!0},{label:"Cached Markets",value:((v=e==null?void 0:e.pipeline)==null?void 0:v.cachedMarkets)||0,highlight:!0}].map(m=>s.jsxs("div",{className:"flex justify-between items-center p-2 rounded",style:{background:"var(--surface-el)"},children:[s.jsx("span",{className:"text-sm",style:{color:"var(--text-muted)"},children:m.label}),s.jsx("span",{className:"mono text-sm font-semibold",style:{color:m.highlight?"var(--cyan)":"var(--text)"},children:m.value})]},m.label))})]})]})]})}const ej={reddit_hot:"🔴",reddit:"📋",google_news:"📰",hackernews:"🟠",metaculus:"🔮",manifold:"📊",gdelt_tv:"📺",youtube:"▶️",lemmy:"🟢",lobsters:"🦞",tildes:"~",bluesky:"🦋",mastodon:"🐘",predictit:"💰",fred:"📈",nws:"⛈️",govtrack:"🏛️",discord:"💬"};function CZ(e){return["reddit_hot","reddit","lemmy"].includes(e)?"bg-red":["google_news","govtrack","nws"].includes(e)?"bg-blue":["metaculus","manifold","predictit"].includes(e)?"bg-purple":["hackernews","lobsters","tildes"].includes(e)?"bg-orange":["fred"].includes(e)?"bg-green":["bluesky","mastodon","discord"].includes(e)?"bg-cyan":"bg-blue"}function TZ({value:e}){const t=parseFloat(e)||0;return t>.1?s.jsxs("span",{className:"badge bg-cyan",children:["+",(t*100).toFixed(0),"%"]}):t<-.1?s.jsxs("span",{className:"badge bg-red",children:[(t*100).toFixed(0),"%"]}):s.jsxs("span",{className:"badge bg-orange",children:[(t*100).toFixed(0),"%"]})}function La({col:e,label:t,sortCol:r,sortDir:n,onSort:a}){const i=r===e;return s.jsx("th",{onClick:()=>a(e),className:"cursor-pointer select-none transition",style:{color:i?"var(--cyan)":void 0},children:s.jsxs("span",{className:"flex items-center gap-1",children:[t,i?s.jsx("span",{style:{color:"var(--cyan)"},children:n==="asc"?"▲":"▼"}):s.jsx("span",{style:{color:"var(--border-light)"},children:"⇅"})]})})}function Ql({label:e,value:t,color:r}){return s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"stat-label mb-2",children:e}),s.jsx("p",{className:"stat-v",style:{color:r},children:t})]})}function MZ(){const[e,t]=O.useState(null),[r,n]=O.useState(!0),[a,i]=O.useState(""),[o,l]=O.useState("captured_at"),[c,u]=O.useState("desc");O.useEffect(()=>{f();const S=setInterval(f,6e4);return()=>clearInterval(S)},[]);async function f(){try{const S=await ke("/intelligence");t(S)}catch{}n(!1)}function d(S){o===S?u(j=>j==="asc"?"desc":"asc"):(l(S),u(S==="captured_at"?"desc":"asc"))}if(r)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-t-transparent rounded-full pulse-cyan",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const h=(e==null?void 0:e.totals)||{},p=(e==null?void 0:e.sourceCounts)||[],g=((e==null?void 0:e.recent)||[]).filter(S=>!a||S.source.toLowerCase().includes(a.toLowerCase())||(S.post_title||"").toLowerCase().includes(a.toLowerCase())||(S.keyword||"").toLowerCase().includes(a.toLowerCase()));function b(S,j){let w,N;switch(o){case"captured_at":w=new Date(S.captured_at),N=new Date(j.captured_at);break;case"source":w=S.source||"",N=j.source||"";break;case"keyword":w=S.keyword||S.subreddit||"",N=j.keyword||j.subreddit||"";break;case"post_title":w=(S.post_title||"").toLowerCase(),N=(j.post_title||"").toLowerCase();break;case"score":w=Number(S.score||0),N=Number(j.score||0);break;case"sentiment":w=parseFloat(S.sentiment_score||0),N=parseFloat(j.sentiment_score||0);break;default:return 0}return w<N?c==="asc"?-1:1:w>N?c==="asc"?1:-1:0}const x=[...g].sort(b),y=parseFloat(h.avg_sentiment_1h)||0,v=y>0?"var(--green)":y<0?"var(--red)":"var(--text-muted)",m={sortCol:o,sortDir:c,onSort:d};return s.jsxs("div",{className:"space-y-6 fade-in",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-2xl",style:{color:"var(--cyan)"},children:"⚗"}),s.jsx("h1",{className:"heading text-3xl font-bold",style:{color:"var(--text)"},children:"Intel Feed"}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"inline-block w-2 h-2 rounded-full pulse-cyan",style:{background:"var(--cyan)"}}),s.jsx("span",{className:"text-xs",style:{color:"var(--cyan)"},children:"LIVE"})]})]}),s.jsx("p",{className:"section-subtitle mt-1",children:"Real-time data from 20+ sources"})]}),s.jsx("button",{onClick:f,className:"btn btn-o btn-sm",children:"↻ Refresh"})]}),s.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[s.jsx(Ql,{label:"Total Items",value:Number(h.total_items||0).toLocaleString(),color:"var(--orange)"}),s.jsx(Ql,{label:"Last Hour",value:h.last_hour||0,color:"var(--green)"}),s.jsx(Ql,{label:"Last 4 Hours",value:h.last_4h||0,color:"var(--blue)"}),s.jsx(Ql,{label:"Avg Sentiment 1h",value:h.avg_sentiment_1h?`${(y*100).toFixed(1)}%`:"—",color:v})]}),s.jsxs("div",{className:"card",style:{padding:"1rem"},children:[s.jsx("p",{className:"section-title mb-3",style:{fontSize:"0.9rem"},children:"Active Sources"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{onClick:()=>i(""),className:"badge transition cursor-pointer",style:{background:a?"rgba(42,42,53,0.6)":"var(--cyan-dim)",color:a?"var(--text-muted)":"var(--cyan)",border:a?"1px solid var(--border)":"1px solid rgba(0,240,255,0.3)"},children:"All"}),p.map((S,j)=>{const w=a===S.source,N=parseFloat(S.avg_sent)||0;return s.jsxs("button",{onClick:()=>i(w?"":S.source),className:"badge transition cursor-pointer",style:{background:w?"var(--cyan-dim)":"rgba(42,42,53,0.6)",color:w?"var(--cyan)":"var(--text-muted)",border:w?"1px solid rgba(0,240,255,0.3)":"1px solid var(--border)"},children:[s.jsx("span",{children:ej[S.source]||"📡"}),s.jsx("span",{className:"font-medium",children:S.source}),s.jsx("span",{style:{color:"var(--text-muted)",opacity:.7},children:S.cnt}),s.jsxs("span",{className:"mono",style:{color:N>.05?"var(--green)":N<-.05?"var(--red)":"var(--text-muted)"},children:[N>0?"+":"",(N*100).toFixed(0),"%"]})]},j)})]})]}),s.jsxs("div",{className:"relative",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm pointer-events-none",style:{color:"var(--text-muted)"},children:"⌕"}),s.jsx("input",{type:"text",value:a,onChange:S=>i(S.target.value),placeholder:"Filter by source, keyword, or title...",className:"input pl-8"})]}),s.jsxs("div",{className:"card overflow-x-auto",style:{padding:0},children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx(La,{col:"captured_at",label:"Time",...m}),s.jsx(La,{col:"source",label:"Source",...m}),s.jsx(La,{col:"keyword",label:"Topic",...m}),s.jsx(La,{col:"post_title",label:"Headline",...m}),s.jsx(La,{col:"score",label:"Score",...m}),s.jsx(La,{col:"sentiment",label:"Sentiment",...m})]})}),s.jsx("tbody",{children:x.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-12",style:{color:"var(--text-muted)"},children:s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx("span",{className:"text-2xl",children:"⚗"}),s.jsx("span",{className:"text-sm",children:"No items match your filter"})]})})}):x.slice(0,50).map((S,j)=>(parseFloat(S.sentiment_score),s.jsxs("tr",{children:[s.jsx("td",{className:"whitespace-nowrap",children:s.jsx("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:new Date(S.captured_at).toLocaleTimeString()})}),s.jsx("td",{children:s.jsxs("span",{className:`badge ${CZ(S.source)}`,children:[ej[S.source]||"📡"," ",S.source]})}),s.jsx("td",{children:s.jsx("span",{className:"text-xs",style:{color:"var(--text-dim)"},children:S.keyword||S.subreddit||"—"})}),s.jsx("td",{className:"max-w-[400px]",children:S.post_url?s.jsx("a",{href:S.post_url,target:"_blank",rel:"noopener noreferrer",className:"text-sm truncate block hover:underline transition heading",style:{color:"var(--text)"},children:S.post_title}):s.jsx("span",{className:"text-sm truncate block heading",style:{color:"var(--text)"},children:S.post_title})}),s.jsx("td",{children:s.jsxs("span",{className:"mono text-xs",style:{color:"var(--text-dim)"},children:[S.score||0,S.num_comments?s.jsxs("span",{style:{color:"var(--text-muted)"},children:[" / ",S.num_comments,"c"]}):null]})}),s.jsx("td",{children:s.jsx(TZ,{value:S.sentiment_score})})]},j)))})]}),x.length>0&&s.jsxs("div",{className:"px-4 py-3 text-xs",style:{color:"var(--text-muted)",borderTop:"1px solid var(--border)"},children:["Showing ",Math.min(50,x.length)," of ",x.length," items",a&&` matching "${a}"`]})]})]})}function Da({label:e,value:t,color:r}){return s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"stat-label mb-2",children:e}),s.jsx("p",{className:"stat-v",style:{color:r},children:t})]})}function bt({label:e,value:t,highlight:r}){return s.jsxs("div",{className:"flex justify-between items-center px-3 py-2 rounded",style:{background:"var(--surface-el)"},children:[s.jsx("span",{className:"text-sm",style:{color:"var(--text-muted)"},children:e}),s.jsx("span",{className:"mono text-sm font-semibold",style:{color:r||"var(--text)"},children:t})]})}function tj({label:e,active:t,color:r,onClick:n,disabled:a}){return s.jsx("button",{onClick:n,disabled:a,className:"flex-1 py-2 rounded-lg text-sm font-bold transition",style:{background:t?`${r}22`:"var(--surface-el)",color:t?r:"var(--text-muted)",border:`1px solid ${t?r+"55":"var(--border)"}`},children:e})}function IZ(){const[e,t]=O.useState(null),[r,n]=O.useState(null),[a,i]=O.useState(null),[o,l]=O.useState(!0),[c,u]=O.useState("");O.useEffect(()=>{f();const m=setInterval(f,15e3);return()=>clearInterval(m)},[]);async function f(){try{const[m,S,j]=await Promise.all([pe("/trading/mode",{action:"get"}),ke("/trading/history"),ke("/system")]);t(m),n(S),i(j)}catch{}l(!1)}async function d(m,S={}){u(m);try{await pe("/trading/mode",{action:m,...S}),await f()}catch{}u("")}if(o)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-t-transparent rounded-full pulse-cyan",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const h=(e==null?void 0:e.trade_config)||{},p=(e==null?void 0:e.trader_state)||{},g=(r==null?void 0:r.summary)||{},b=(r==null?void 0:r.trades)||[],x=(a==null?void 0:a.memory)||{},y=parseInt(g.total_pnl||0),v=y>0?"var(--green)":y<0?"var(--red)":"var(--text-muted)";return s.jsxs("div",{className:"space-y-6 fade-in",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-2xl",style:{color:"var(--green)"},children:"$"}),s.jsx("h1",{className:"heading text-3xl font-bold",style:{color:"var(--text)"},children:"Trading"}),s.jsx("span",{className:`badge ${(e==null?void 0:e.env)==="prod"?"bg-green":"bg-orange"}`,children:((e==null?void 0:e.env)||"demo").toUpperCase()}),(e==null?void 0:e.safe_mode)&&s.jsx("span",{className:"badge bg-orange",children:"SAFE MODE"}),(e==null?void 0:e.auto_trader_enabled)&&s.jsx("span",{className:"badge bg-green",children:"AUTO ON"})]}),s.jsx("p",{className:"section-subtitle mt-1",children:"Mode control, execution, and P&L"})]}),s.jsx("button",{onClick:f,className:"btn btn-o btn-sm",children:"↻ Refresh"})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"card-glow",children:[s.jsx("p",{className:"stat-label mb-3",children:"Environment"}),s.jsxs("div",{className:"flex gap-2 mb-3",children:[s.jsx(tj,{label:"DEMO",active:(e==null?void 0:e.env)==="demo",color:"var(--orange)",onClick:()=>d("switch_env",{env:"demo"}),disabled:c==="switch_env"}),s.jsx(tj,{label:"PROD",active:(e==null?void 0:e.env)==="prod",color:"var(--green)",onClick:()=>d("switch_env",{env:"prod"}),disabled:c==="switch_env"})]}),s.jsxs("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:["API keys: ",e!=null&&e.kalshi_connected?s.jsx("span",{style:{color:"var(--green)"},children:"Configured"}):s.jsx("span",{style:{color:"var(--red)"},children:"Not set"})]})]}),s.jsxs("div",{className:"card-glow",children:[s.jsx("p",{className:"stat-label mb-3",children:"Safe Mode"}),s.jsx("button",{onClick:()=>d("toggle_safe_mode"),disabled:c==="toggle_safe_mode",className:"btn w-full btn-lg font-bold transition",style:{background:e!=null&&e.safe_mode?"rgba(247,147,26,0.15)":"var(--red-dim)",color:e!=null&&e.safe_mode?"var(--orange)":"var(--red)",border:`1px solid ${e!=null&&e.safe_mode?"rgba(247,147,26,0.4)":"rgba(255,92,92,0.4)"}`},children:c==="toggle_safe_mode"?"...":e!=null&&e.safe_mode?"SAFE MODE — ON":"SAFE MODE — OFF"}),s.jsx("p",{className:"text-xs mt-2",style:{color:"var(--text-muted)"},children:e!=null&&e.safe_mode?"No real orders will be placed":s.jsx("span",{style:{color:"var(--red)"},children:"Real orders will be executed!"})})]}),s.jsxs("div",{className:"card-glow",children:[s.jsx("p",{className:"stat-label mb-3",children:"Auto Trader"}),s.jsx("button",{onClick:()=>d("toggle_auto_trader"),disabled:c==="toggle_auto_trader",className:"btn w-full btn-lg font-bold transition",style:{background:e!=null&&e.auto_trader_enabled?"var(--green-dim)":"var(--surface-el)",color:e!=null&&e.auto_trader_enabled?"var(--green)":"var(--text-muted)",border:`1px solid ${e!=null&&e.auto_trader_enabled?"rgba(0,195,137,0.4)":"var(--border)"}`},children:c==="toggle_auto_trader"?"...":e!=null&&e.auto_trader_enabled?"AUTO TRADER: ON":"AUTO TRADER: OFF"}),s.jsxs("p",{className:"text-xs mt-2",style:{color:"var(--text-muted)"},children:["Min confidence: ",s.jsxs("span",{className:"mono",children:[h.min_confidence,"%"]})," ·  Budget: ",s.jsxs("span",{className:"mono",children:["$",(h.budget_cents/100).toFixed(0)]})]})]})]}),s.jsxs("div",{className:"grid grid-cols-6 gap-3",children:[s.jsx(Da,{label:"Total Trades",value:g.total_trades||0,color:"var(--orange)"}),s.jsx(Da,{label:"Open",value:g.open_trades||0,color:"var(--blue)"}),s.jsx(Da,{label:"Wins",value:g.winning_trades||0,color:"var(--green)"}),s.jsx(Da,{label:"Losses",value:g.losing_trades||0,color:"var(--red)"}),s.jsx(Da,{label:"Total P&L",value:g.total_pnl?`$${(y/100).toFixed(2)}`:"$0.00",color:v}),s.jsx(Da,{label:"Exposure",value:`$${(parseInt(g.open_exposure||0)/100).toFixed(2)}`,color:"var(--purple)"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"card",children:[s.jsxs("p",{className:"section-title mb-3",style:{fontSize:"1rem"},children:[s.jsx("span",{style:{color:"var(--cyan)"},children:"⚙"})," Trade Config"]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(bt,{label:"Budget",value:`$${(h.budget_cents/100).toFixed(0)}`,highlight:"var(--cyan)"}),s.jsx(bt,{label:"Max per trade",value:`$${(h.max_position_cents/100).toFixed(0)}`}),s.jsx(bt,{label:"Max positions",value:h.max_open_positions}),s.jsx(bt,{label:"Daily loss limit",value:`$${(h.daily_loss_limit_cents/100).toFixed(0)}`,highlight:"var(--red)"}),s.jsx(bt,{label:"Min confidence",value:`${h.min_confidence}%`,highlight:"var(--orange)"}),s.jsx(bt,{label:"Take profit",value:`${h.take_profit_pct}%`,highlight:"var(--green)"}),s.jsx(bt,{label:"Stop loss",value:`${h.stop_loss_pct}%`,highlight:"var(--red)"})]})]}),s.jsxs("div",{className:"card",children:[s.jsxs("p",{className:"section-title mb-3",style:{fontSize:"1rem"},children:[s.jsx("span",{style:{color:"var(--cyan)"},children:"♥"})," System Health"]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(bt,{label:"Memory (RSS)",value:`${x.rss_mb||"?"} MB`}),s.jsx(bt,{label:"Heap Used",value:`${x.heapUsed_mb||"?"} MB`}),s.jsx(bt,{label:"Heap Total",value:`${x.heapTotal_mb||"?"} MB`}),s.jsx(bt,{label:"Uptime",value:`${(a==null?void 0:a.uptime_hours)||"?"}h`,highlight:"var(--blue)"}),s.jsx(bt,{label:"Cached Markets",value:(a==null?void 0:a.cachedMarkets)||0,highlight:"var(--cyan)"}),s.jsx(bt,{label:"PID",value:(a==null?void 0:a.pid)||"?"}),s.jsx(bt,{label:"Available Budget",value:`$${((p.available||0)/100).toFixed(2)}`,highlight:"var(--green)"})]})]})]}),s.jsxs("div",{className:"card overflow-x-auto",style:{padding:0},children:[s.jsxs("div",{className:"flex items-center justify-between px-5 py-4",style:{borderBottom:"1px solid var(--border)"},children:[s.jsxs("p",{className:"section-title",style:{fontSize:"1rem"},children:[s.jsx("span",{style:{color:"var(--orange)"},children:"◈"})," Trade History"]}),b.length>0&&s.jsxs("span",{className:"badge bg-orange",children:[b.length," trades"]})]}),s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Time"}),s.jsx("th",{children:"Market"}),s.jsx("th",{children:"Side"}),s.jsx("th",{children:"Qty"}),s.jsx("th",{children:"Entry"}),s.jsx("th",{children:"Exit"}),s.jsx("th",{children:"P&L"}),s.jsx("th",{children:"Type"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:b.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:9,className:"text-center py-12",style:{color:"var(--text-muted)"},children:s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx("span",{className:"text-2xl",style:{color:"var(--text-muted)"},children:"$"}),s.jsx("span",{className:"text-sm",children:"No trades yet — signals are generating, waiting for execution"})]})})}):b.map((m,S)=>{const j=parseInt(m.pnl_cents)||0,w=j>0?"var(--green)":j<0?"var(--red)":"var(--text-muted)",N=m.status==="open"?"bg-blue":m.status==="profit"?"bg-green":m.status==="stopped"?"bg-red":"bg-orange";return s.jsxs("tr",{children:[s.jsx("td",{className:"whitespace-nowrap",children:s.jsxs("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:[new Date(m.created_at).toLocaleDateString()," ",new Date(m.created_at).toLocaleTimeString()]})}),s.jsx("td",{className:"max-w-[200px]",children:s.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((m.ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"text-sm truncate block hover:underline transition heading",style:{color:"var(--cyan)"},children:m.title||m.ticker})}),s.jsx("td",{children:s.jsx("span",{className:`badge ${m.side==="yes"?"bg-green":"bg-red"}`,children:(m.side||"").toUpperCase()})}),s.jsx("td",{children:s.jsx("span",{className:"mono text-sm",style:{color:"var(--text-dim)"},children:m.count})}),s.jsx("td",{children:s.jsxs("span",{className:"mono text-sm",style:{color:"var(--text-dim)"},children:[m.price_cents,"c"]})}),s.jsx("td",{children:s.jsx("span",{className:"mono text-sm",style:{color:m.exit_price?"var(--text-dim)":"var(--text-muted)"},children:m.exit_price?`${m.exit_price}c`:"—"})}),s.jsx("td",{children:s.jsx("span",{className:"mono text-sm font-bold",style:{color:w},children:j!==0?`${j>0?"+":""}$${(j/100).toFixed(2)}`:"—"})}),s.jsx("td",{children:s.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:m.signal_type})}),s.jsx("td",{children:s.jsx("span",{className:`badge ${N}`,children:m.status})})]},S)})})]})]})]})}const LZ={trump:"Politics",president:"Politics",impeach:"Politics",congress:"Politics",senate:"Politics",house:"Politics",governor:"Politics",election:"Politics",democrat:"Politics",republican:"Politics",vote:"Politics",biden:"Politics",vance:"Politics",cabinet:"Politics",scotus:"Politics",supreme:"Politics",pardon:"Politics",approval:"Politics",poll:"Politics",secretary:"Politics",defense:"Politics",attorney:"Politics",gdp:"Economy",inflation:"Economy",cpi:"Economy",fed:"Economy","interest rate":"Economy",unemployment:"Economy",jobs:"Economy",payroll:"Economy",recession:"Economy",stock:"Economy",sp500:"Economy","s&p":"Economy",nasdaq:"Economy",dow:"Economy",treasury:"Economy",bond:"Economy",debt:"Economy",trade:"Economy",tariff:"Economy",deficit:"Economy",temperature:"Weather",rain:"Weather",snow:"Weather",hurricane:"Weather",weather:"Weather",tornado:"Weather",flood:"Weather",heat:"Weather",cold:"Weather",storm:"Weather",wind:"Weather",precipitation:"Weather",climate:"Weather",bitcoin:"Crypto",btc:"Crypto",ethereum:"Crypto",eth:"Crypto",crypto:"Crypto",token:"Crypto",blockchain:"Crypto",defi:"Crypto",nfl:"Sports",nba:"Sports",mlb:"Sports",nhl:"Sports",soccer:"Sports",tennis:"Sports","super bowl":"Sports",championship:"Sports",game:"Sports",match:"Sports",playoff:"Sports","world series":"Sports",ai:"Tech",spacex:"Tech",tesla:"Tech",apple:"Tech",google:"Tech",meta:"Tech",openai:"Tech",chatgpt:"Tech",tech:"Tech",rocket:"Tech",launch:"Tech",oscar:"Culture",movie:"Culture",tv:"Culture",celebrity:"Culture",grammy:"Culture",award:"Culture",music:"Culture",entertainment:"Culture",oil:"Energy",gas:"Energy",energy:"Energy",solar:"Energy",opec:"Energy",crude:"Energy",coal:"Energy",renewable:"Energy"},vn={Politics:{bg:"var(--blue)",glow:"rgba(59,130,246,0.3)",hex:"#3B82F6"},Economy:{bg:"var(--green)",glow:"rgba(0,195,137,0.3)",hex:"#00C389"},Weather:{bg:"var(--cyan)",glow:"rgba(0,240,255,0.3)",hex:"#00F0FF"},Crypto:{bg:"var(--orange)",glow:"rgba(247,147,26,0.3)",hex:"#F7931A"},Sports:{bg:"var(--purple)",glow:"rgba(168,85,247,0.3)",hex:"#A855F7"},Tech:{bg:"var(--cyan)",glow:"rgba(0,240,255,0.3)",hex:"#00F0FF"},Culture:{bg:"var(--orange)",glow:"rgba(247,147,26,0.3)",hex:"#F7931A"},Energy:{bg:"var(--orange)",glow:"rgba(247,147,26,0.3)",hex:"#F7931A"},Other:{bg:"var(--text-muted)",glow:"rgba(107,114,128,0.3)",hex:"#6B7280"}};function rj(e){const t=(e||"").toLowerCase();for(const[r,n]of Object.entries(LZ))if(t.includes(r))return n;return"Other"}function nj(e){return e>5e4?"var(--green)":e>1e4?"#4ade80":e>1e3?"#86efac":e>0?"#bbf7d0":e===0?"var(--text-muted)":e>-1e3?"#fecaca":e>-1e4?"#f87171":"var(--red)"}function aj(e){return e>5e4?"rgba(0,195,137,0.35)":e>1e4?"rgba(0,195,137,0.25)":e>1e3?"rgba(0,195,137,0.15)":e>0?"rgba(0,195,137,0.08)":e===0?"rgba(107,114,128,0.15)":e>-1e3?"rgba(255,92,92,0.08)":e>-1e4?"rgba(255,92,92,0.15)":"rgba(255,92,92,0.30)"}function ia(e,t,r,n,a){if(!e.length)return[];if(e.length===1)return[{...e[0],x:t,y:r,w:n,h:a}];const i=e.reduce((p,g)=>p+g.size,0);if(i===0)return e.map(p=>({...p,x:t,y:r,w:0,h:0}));let o=0,l=0;const c=i*.5;for(let p=0;p<e.length;p++)if(o+=e[p].size,o>=c){l=p+1;break}l===0&&(l=1),l>=e.length&&(l=e.length-1);const u=e.slice(0,l),f=e.slice(l),h=u.reduce((p,g)=>p+g.size,0)/i;if(n>=a){const p=n*h;return[...ia(u,t,r,p,a),...ia(f,t+p,r,n-p,a)]}else{const p=a*h;return[...ia(u,t,r,n,p),...ia(f,t,r+p,n,a-p)]}}function b2({item:e,onClick:t,isSelected:r}){const n=(e.pnl/100).toFixed(2),a=e.trades>0?(e.wins/e.trades*100).toFixed(0):"0",i=e.w<120||e.h<80,o=e.w<80||e.h<50;return s.jsxs("div",{onClick:()=>t(e),className:"absolute cursor-pointer overflow-hidden group",style:{left:e.x,top:e.y,width:e.w,height:e.h,backgroundColor:aj(e.pnl),border:r?"2px solid var(--cyan)":"1px solid var(--border)",borderRadius:6,zIndex:r?10:1,transition:"all 150ms ease"},children:[s.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 pointer-events-none",style:{background:`radial-gradient(circle at center, ${aj(e.pnl)}, transparent)`,transition:"opacity 200ms ease"}}),s.jsxs("div",{className:"relative h-full p-1.5 flex flex-col justify-between z-10",children:[!o&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"truncate text-[10px] font-medium leading-tight",style:{color:"var(--text-dim)"},children:e.shortTitle}),s.jsxs("div",{className:"flex items-end justify-between mt-auto",children:[s.jsxs("span",{className:"mono font-bold text-xs",style:{color:nj(e.pnl)},children:[e.pnl>=0?"+":"",n>999?`$${(e.pnl/100/1e3).toFixed(1)}k`:`$${n}`]}),!i&&s.jsxs("span",{className:"text-[9px] font-bold mono",style:{color:Number(a)>=80?"var(--green)":Number(a)>=50?"var(--orange)":"var(--red)"},children:[a,"%"]})]})]}),o&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("span",{className:"mono font-bold text-[10px]",style:{color:nj(e.pnl)},children:[e.pnl>=0?"+":"",(e.pnl/100).toFixed(0)]})})]})]})}function DZ({category:e,items:t,x:r,y:n,w:a,h:i,onTileClick:o,selectedTicker:l}){const c=vn[e]||vn.Other,u=t.reduce((p,g)=>p+g.pnl,0),f=t.reduce((p,g)=>p+g.trades,0),d=Math.min(28,i*.15),h=ia(t,0,0,a,i-d);return s.jsxs("div",{className:"absolute overflow-hidden",style:{left:r,top:n,width:a,height:i,borderRadius:8,border:`1px solid ${c.hex}40`},children:[s.jsxs("div",{className:"flex items-center justify-between px-2 relative z-20",style:{height:d,background:`linear-gradient(135deg, ${c.hex}25, ${c.hex}0D)`,borderBottom:`1px solid ${c.hex}40`},children:[s.jsx("span",{className:"text-xs font-bold tracking-wide heading",style:{color:c.hex},children:e}),s.jsxs("span",{className:"text-[10px] mono",style:{color:u>=0?"var(--green)":"var(--red)"},children:[u>=0?"+":"","$",(u/100).toFixed(0)," | ",f," trades"]})]}),s.jsx("div",{className:"relative",style:{height:i-d},children:h.map(p=>s.jsx(b2,{item:{...p,y:p.y},onClick:o,isSelected:l===p.ticker},p.ticker))})]})}function RZ({market:e,onClose:t}){if(!e)return null;const r=(e.pnl/100).toFixed(2),n=e.trades>0?(e.wins/e.trades*100).toFixed(1):"0",a=vn[e.category]||vn.Other;return s.jsxs("div",{className:"card-glow fade-in",children:[s.jsxs("div",{className:"flex items-start justify-between mb-4",children:[s.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[s.jsx("h3",{className:"heading text-sm font-bold truncate",style:{color:"var(--text)"},children:e.title}),s.jsx("p",{className:"mono text-xs mt-1",style:{color:"var(--text-muted)"},children:e.ticker})]}),s.jsx("button",{onClick:t,className:"btn btn-ghost text-lg leading-none",style:{padding:"0 6px"},children:"×"})]}),s.jsx("div",{className:"grid grid-cols-4 gap-3 text-center",children:[{label:"P&L",value:`${e.pnl>=0?"+":""}$${r}`,color:e.pnl>=0?"var(--green)":"var(--red)"},{label:"Win Rate",value:`${n}%`,color:Number(n)>=80?"var(--green)":Number(n)>=50?"var(--orange)":"var(--red)"},{label:"Trades",value:e.trades.toLocaleString(),color:"var(--orange)"},{label:"Record",valueEl:s.jsxs("p",{className:"text-lg font-bold",children:[s.jsx("span",{style:{color:"var(--green)"},children:e.wins}),s.jsx("span",{style:{color:"var(--border-light)"},className:"mx-0.5",children:"-"}),s.jsx("span",{style:{color:"var(--red)"},children:e.losses})]})}].map(i=>s.jsxs("div",{className:"rounded-lg p-2.5 text-center",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[s.jsx("p",{className:"stat-label mb-1",children:i.label}),i.valueEl||s.jsx("p",{className:"stat-v text-lg",style:{color:i.color},children:i.value})]},i.label))}),s.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs",children:[s.jsxs("span",{style:{color:"var(--text-muted)"},children:["Category:"," ",s.jsx("span",{style:{color:a.hex},className:"font-semibold",children:e.category})]}),e.url&&s.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-cyan transition-colors",style:{color:"var(--cyan)"},children:"View on Kalshi →"})]}),e.edge&&s.jsx("div",{className:"mt-2 text-[11px] rounded-lg px-3 py-2",style:{color:"var(--text-dim)",background:"var(--surface-el)",border:"1px solid var(--border)"},children:e.edge})]})}function BZ(){const e=[{label:"> $500",bg:"rgba(0,195,137,0.35)"},{label:"$100-500",bg:"rgba(0,195,137,0.25)"},{label:"$10-100",bg:"rgba(0,195,137,0.15)"},{label:"$0-10",bg:"rgba(0,195,137,0.08)"},{label:"$0",bg:"rgba(107,114,128,0.15)"},{label:"-$10",bg:"rgba(255,92,92,0.08)"},{label:"-$100",bg:"rgba(255,92,92,0.15)"},{label:"< -$100",bg:"rgba(255,92,92,0.30)"}];return s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"stat-label mr-1",children:"P&L Scale:"}),e.map(t=>s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:t.bg,border:"1px solid var(--border)"}}),s.jsx("span",{className:"text-[9px]",style:{color:"var(--text-muted)"},children:t.label})]},t.label))]})}function FZ(){var N;const[e,t]=O.useState(null),[r,n]=O.useState(null),[a,i]=O.useState(!0),[o,l]=O.useState(null),[c,u]=O.useState("category"),[f,d]=O.useState("pnl");O.useEffect(()=>{h();const _=setInterval(h,3e4);return()=>clearInterval(_)},[]);async function h(){try{const[_,k]=await Promise.all([ke("/dashboard"),ke("/signals")]);t(_),n(k)}catch{}i(!1)}const{categories:p,allMarkets:g,summary:b}=O.useMemo(()=>{if(!e)return{categories:{},allMarkets:[],summary:{}};const _=[],k=new Set;for(const $ of e.top_markets||[])if(!k.has($.ticker)){k.add($.ticker);const I=rj($.title);_.push({...$,category:I,trades:($.wins||0)+($.losses||0),shortTitle:($.title||$.ticker).split("?")[0].substring(0,40),size:Math.max(Math.abs($.pnl||1),100)})}for(const $ of e.worst_markets||[])if(!k.has($.ticker)){k.add($.ticker);const I=rj($.title);_.push({...$,category:I,trades:($.wins||0)+($.losses||0),shortTitle:($.title||$.ticker).split("?")[0].substring(0,40),size:Math.max(Math.abs($.pnl||1),100)})}for(const $ of e.strategies||[]){const I=`strategy-${$.strategy||$.name}`;k.has(I)||(k.add(I),_.push({ticker:I,title:`Strategy: ${$.name}`,shortTitle:$.name,category:"Other",wins:$.wins||0,losses:$.losses||0,trades:($.wins||0)+($.losses||0),pnl:$.pnl||0,edge:`Win Rate: ${$.win_rate||0}%`,size:Math.max(Math.abs($.pnl||1),100)}))}f==="pnl"?_.sort(($,I)=>I.pnl-$.pnl):f==="trades"?_.sort(($,I)=>I.trades-$.trades):f==="winrate"&&_.sort(($,I)=>{const L=$.trades>0?$.wins/$.trades:0;return(I.trades>0?I.wins/I.trades:0)-L});const A={};for(const $ of _)A[$.category]||(A[$.category]=[]),A[$.category].push($);const T=_.reduce(($,I)=>$+I.pnl,0),C=_.reduce(($,I)=>$+I.trades,0),D=_.reduce(($,I)=>$+I.wins,0),P=_.reduce(($,I)=>$+I.losses,0),M=_.filter($=>$.pnl>0).length;return{categories:A,allMarkets:_,summary:{totalPnl:T,totalTrades:C,totalWins:D,totalLosses:P,profitableCount:M,totalMarkets:_.length}}},[e,f]),x=g.find(_=>_.ticker===o);if(a)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const y=1200,v=700,m=Object.entries(p).sort((_,k)=>{const A=_[1].reduce((C,D)=>C+Math.abs(D.pnl),0);return k[1].reduce((C,D)=>C+Math.abs(D.pnl),0)-A}),S=ia(m.map(([_,k])=>({name:_,size:k.reduce((A,T)=>A+Math.abs(T.pnl||1),0)+k.length*100,items:k})),0,0,y,v),j=c==="flat"?ia(g.map(_=>({..._,size:Math.max(Math.abs(_.pnl||1),200)})),0,0,y,v):[],w=[{label:"Total P&L",value:`${b.totalPnl>=0?"+":""}$${(b.totalPnl/100).toLocaleString(void 0,{minimumFractionDigits:0})}`,color:b.totalPnl>=0?"var(--green)":"var(--red)"},{label:"Total Trades",value:((N=b.totalTrades)==null?void 0:N.toLocaleString())||"0",color:"var(--orange)"},{label:"Win Rate",value:b.totalTrades>0?`${(b.totalWins/b.totalTrades*100).toFixed(1)}%`:"0%",color:"var(--blue)"},{label:"Markets",value:b.totalMarkets||0,color:"var(--purple)"},{label:"Profitable",value:b.profitableCount||0,color:"var(--green)"},{label:"Categories",value:Object.keys(p).length,color:"var(--cyan)"}];return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"heading text-2xl font-bold kalshi-gradient",children:"Market Heatmap"}),s.jsx("p",{className:"section-subtitle mt-1",children:"Treemap visualization of trading activity and P&L by market category"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex items-center gap-0.5 rounded-lg p-0.5",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:["category","flat"].map(_=>s.jsx("button",{onClick:()=>u(_),className:"btn btn-sm",style:c===_?{background:"var(--cyan)",color:"var(--bg)",fontWeight:700}:{background:"transparent",color:"var(--text-muted)"},children:_==="category"?"By Category":"All Markets"},_))}),s.jsxs("select",{value:f,onChange:_=>d(_.target.value),className:"input",style:{width:"auto",paddingRight:"1.5rem"},children:[s.jsx("option",{value:"pnl",children:"Sort by P&L"}),s.jsx("option",{value:"trades",children:"Sort by Trades"}),s.jsx("option",{value:"winrate",children:"Sort by Win Rate"})]}),s.jsx("button",{onClick:h,className:"btn btn-o btn-sm",children:"Refresh"})]})]}),s.jsx("div",{className:"grid grid-cols-6 gap-3",children:w.map(_=>s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"stat-label mb-1",children:_.label}),s.jsx("p",{className:"stat-v text-xl",style:{color:_.color},children:_.value})]},_.label))}),s.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:Object.entries(p).map(([_,k])=>{const A=vn[_]||vn.Other,T=k.reduce((C,D)=>C+D.pnl,0);return s.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full",style:{backgroundColor:`${A.hex}18`,border:`1px solid ${A.hex}40`},children:[s.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:A.hex}}),s.jsx("span",{className:"text-xs font-semibold heading",style:{color:A.hex},children:_}),s.jsx("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:k.length}),s.jsxs("span",{className:"text-[10px] mono font-bold",style:{color:T>=0?"var(--green)":"var(--red)"},children:[T>=0?"+":"","$",(T/100).toFixed(0)]})]},_)})}),s.jsxs("div",{className:"card p-2 relative overflow-hidden",style:{minHeight:v+20},children:[s.jsx("div",{className:"relative",style:{width:y,height:v,margin:"0 auto",maxWidth:"100%"},children:c==="category"?S.map(_=>s.jsx(DZ,{category:_.name,items:_.items,x:_.x,y:_.y,w:_.w,h:_.h,onTileClick:k=>l(k.ticker===o?null:k.ticker),selectedTicker:o},_.name)):j.map(_=>s.jsx(b2,{item:_,onClick:k=>l(k.ticker===o?null:k.ticker),isSelected:o===_.ticker},_.ticker))}),s.jsx("div",{className:"mt-3 px-2",children:s.jsx(BZ,{})})]}),x&&s.jsx(RZ,{market:x,onClose:()=>l(null)}),s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"flex items-center gap-2 mb-4",children:s.jsx("h2",{className:"section-title",children:"Category Breakdown"})}),s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Markets"}),s.jsx("th",{children:"Total Trades"}),s.jsx("th",{children:"Win Rate"}),s.jsx("th",{children:"P&L"}),s.jsx("th",{children:"Best Market"})]})}),s.jsx("tbody",{children:m.map(([_,k])=>{const A=vn[_]||vn.Other,T=k.reduce(($,I)=>$+I.pnl,0),C=k.reduce(($,I)=>$+I.trades,0),D=k.reduce(($,I)=>$+I.wins,0),P=C>0?(D/C*100).toFixed(1):"0",M=k.reduce(($,I)=>I.pnl>(($==null?void 0:$.pnl)||-1/0)?I:$,k[0]);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:A.hex}}),s.jsx("span",{className:"font-semibold heading",style:{color:A.hex},children:_})]})}),s.jsx("td",{style:{color:"var(--text-dim)"},children:k.length}),s.jsx("td",{className:"mono",style:{color:"var(--text-dim)"},children:C.toLocaleString()}),s.jsxs("td",{className:"mono font-bold",style:{color:Number(P)>=80?"var(--green)":Number(P)>=50?"var(--orange)":"var(--red)"},children:[P,"%"]}),s.jsxs("td",{className:"mono font-bold",style:{color:T>=0?"var(--green)":"var(--red)"},children:[T>=0?"+":"","$",(T/100).toFixed(2)]}),s.jsx("td",{className:"text-xs truncate max-w-[200px]",style:{color:"var(--text-muted)"},children:(M==null?void 0:M.shortTitle)||"--"})]},_)})})]})]})]})}const Fo=[{radius:80,label:"Core",color:"#f59e0b",opacity:.4,description:"Highest confidence"},{radius:160,label:"Inner",color:"#22c55e",opacity:.3,description:"Strong signals"},{radius:240,label:"Mid",color:"#3b82f6",opacity:.2,description:"Moderate signals"},{radius:320,label:"Outer",color:"#8b5cf6",opacity:.15,description:"Weak signals"},{radius:400,label:"Edge",color:"#ef4444",opacity:.1,description:"Speculative"}],qi={BUY_YES:{fill:"#22c55e",stroke:"#16a34a",glow:"rgba(34,197,94,0.5)"},BUY_NO:{fill:"#ef4444",stroke:"#dc2626",glow:"rgba(239,68,68,0.5)"},YES:{fill:"#22c55e",stroke:"#16a34a",glow:"rgba(34,197,94,0.5)"},NO:{fill:"#ef4444",stroke:"#dc2626",glow:"rgba(239,68,68,0.5)"}};function $g(e){return e>=.9?"#22c55e":e>=.7?"#f59e0b":e>=.5?"#3b82f6":e>=.3?"#8b5cf6":"#ef4444"}function j2(e){return e>=.9?0:e>=.75?1:e>=.6?2:e>=.4?3:4}function zZ({width:e,height:t}){const r=O.useMemo(()=>{const n=[];for(let a=0;a<80;a++)n.push({x:Math.random()*e,y:Math.random()*t,r:Math.random()*1.2+.3,opacity:Math.random()*.5+.1,delay:Math.random()*3});return n},[e,t]);return s.jsx(s.Fragment,{children:r.map((n,a)=>s.jsx("circle",{cx:n.x,cy:n.y,r:n.r,fill:"white",opacity:n.opacity,className:"animate-pulse",style:{animationDelay:`${n.delay}s`,animationDuration:`${2+Math.random()*3}s`}},a))})}function WZ({market:e,cx:t,cy:r,size:n,isSelected:a,onSelect:i,animate:o}){var d,h;const l=qi[e.direction]||qi.BUY_YES,c=parseFloat(e.confidence)||0,u=$g(c),f=n+4;return s.jsxs("g",{onClick:()=>i(e),className:"cursor-pointer",style:{transition:"all 0.5s ease-out"},children:[s.jsx("circle",{cx:t,cy:r,r:f,fill:"none",stroke:l.glow,strokeWidth:1.5,opacity:a?.8:.3,className:o?"animate-ping":"",style:{animationDuration:"2s",transformOrigin:`${t}px ${r}px`}}),s.jsx("circle",{cx:t,cy:r,r:n+2,fill:"none",stroke:u,strokeWidth:2,opacity:.6,strokeDasharray:`${c*20} ${(1-c)*20}`}),s.jsx("circle",{cx:t,cy:r,r:n,fill:`url(#gradient-${(d=e.ticker)==null?void 0:d.replace(/[^a-zA-Z0-9]/g,"")})`,stroke:a?"#f59e0b":l.stroke,strokeWidth:a?2.5:1,className:"transition-all duration-300"}),s.jsx("defs",{children:s.jsxs("radialGradient",{id:`gradient-${(h=e.ticker)==null?void 0:h.replace(/[^a-zA-Z0-9]/g,"")}`,children:[s.jsx("stop",{offset:"0%",stopColor:l.fill,stopOpacity:"0.9"}),s.jsx("stop",{offset:"70%",stopColor:l.fill,stopOpacity:"0.6"}),s.jsx("stop",{offset:"100%",stopColor:l.stroke,stopOpacity:"0.4"})]})}),n>=8&&s.jsx("text",{x:t,y:r+1,textAnchor:"middle",dominantBaseline:"middle",fill:"white",fontSize:Math.max(7,n*.6),fontWeight:"bold",fontFamily:"monospace",style:{pointerEvents:"none"},children:e.edge_display||""}),n>=10&&s.jsx("text",{x:t,y:r+n+12,textAnchor:"middle",fill:"#94a3b8",fontSize:8,style:{pointerEvents:"none"},children:(e.shortTitle||"").substring(0,18)})]})}function UZ({market:e,onClose:t}){var i;if(!e)return null;const r=parseFloat(e.confidence)||0,n=parseFloat(e.expected_edge)||0,a=qi[e.direction]||qi.BUY_YES;return s.jsxs("div",{className:"card border border-amber-500/30 bg-gradient-to-br from-gray-800/95 to-gray-900/95 backdrop-blur-md",children:[s.jsxs("div",{className:"flex items-start justify-between mb-3",children:[s.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"inline-block w-3 h-3 rounded-full",style:{backgroundColor:a.fill}}),s.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold ${e.direction==="BUY_YES"||e.direction==="YES"?"bg-green-500/20 text-green-400 border border-green-500/30":"bg-red-500/20 text-red-400 border border-red-500/30"}`,children:e.direction}),e.risk_approved&&s.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-bold bg-green-500/15 text-green-400 border border-green-500/20",children:"APPROVED"}),!e.risk_approved&&s.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-bold bg-red-500/15 text-red-400 border border-red-500/20",children:"BLOCKED"})]}),s.jsx("h3",{className:"text-sm font-bold text-gray-100",children:e.title||e.ticker}),s.jsx("p",{className:"text-xs text-gray-500 font-mono mt-1",children:e.ticker})]}),s.jsx("button",{onClick:t,className:"text-gray-500 hover:text-gray-300 text-lg",children:"×"})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-3",children:[s.jsxs("div",{className:"rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50 text-center",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Edge"}),s.jsxs("p",{className:"text-lg font-bold text-amber-400 font-mono",children:[(n*100).toFixed(1),"%"]})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50 text-center",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Confidence"}),s.jsxs("p",{className:"text-lg font-bold font-mono",style:{color:$g(r)},children:[(r*100).toFixed(0),"%"]})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50 text-center",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Orbit Ring"}),s.jsx("p",{className:"text-lg font-bold text-purple-400",children:((i=Fo[j2(r)])==null?void 0:i.label)||"Edge"})]})]}),e.reasoning&&s.jsx("div",{className:"text-[11px] text-gray-400 bg-gray-800/40 rounded-lg px-3 py-2 border border-gray-700/30 mb-3 leading-relaxed",children:e.reasoning}),e.sources&&e.sources.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase font-medium",children:"Signal Sources"}),e.sources.map((o,l)=>{var c;return s.jsxs("div",{className:"flex items-center gap-2 text-xs bg-gray-800/30 rounded-lg px-3 py-2 border border-gray-700/20",children:[s.jsx("span",{className:"px-1.5 py-0.5 rounded bg-blue-500/15 text-blue-400 text-[9px] font-bold",children:o.source}),s.jsx("span",{className:"text-gray-400 truncate flex-1",children:o.headline}),s.jsxs("span",{className:`font-mono text-[10px] ${o.sentiment>0?"text-green-400":o.sentiment<0?"text-red-400":"text-gray-500"}`,children:[o.sentiment>0?"+":"",(c=o.sentiment)==null?void 0:c.toFixed(2)]})]},l)})]}),s.jsxs("div",{className:"mt-3 text-[10px] text-gray-600",children:["Signal created: ",e.created_at?new Date(e.created_at).toLocaleString("en-US",{timeZone:"America/Los_Angeles",hour:"2-digit",minute:"2-digit",month:"short",day:"numeric"}):"Unknown"]})]})}function HZ(){const[e,t]=O.useState(null),[r,n]=O.useState(null),[a,i]=O.useState(!0),[o,l]=O.useState(null),[c,u]=O.useState("all"),[f,d]=O.useState(!0),h=O.useRef(null);O.useEffect(()=>{p();const _=setInterval(p,3e4);return()=>clearInterval(_)},[]);async function p(){try{const[_,k,A]=await Promise.all([ke("/dashboard"),ke("/signals"),ke("/signals/dashboard")]);t(_),n({signals:(k==null?void 0:k.signals)||[],dashboard:A})}catch{}i(!1)}const{orbitalMarkets:g,stats:b}=O.useMemo(()=>{if(!(r!=null&&r.signals))return{orbitalMarkets:[],stats:{}};let _=r.signals.map(P=>{var F,K;const M=parseFloat(P.confidence)||0,$=parseFloat(P.expected_edge)||0,I=j2(M),B=((F=(P.ticker||"").split("-")[0])==null?void 0:F.replace("KX","").substring(0,12))||P.ticker;return{...P,shortTitle:B,title:((K=P.reasoning)==null?void 0:K.split('"')[1])||P.ticker,ring:I,conf:M,edge:$,edge_display:`${($*100).toFixed(0)}%`,size:Math.max(6,Math.min(22,$*120+6))}});c==="approved"&&(_=_.filter(P=>P.risk_approved)),c==="yes"&&(_=_.filter(P=>P.direction==="BUY_YES")),c==="no"&&(_=_.filter(P=>P.direction==="BUY_NO")),_.sort((P,M)=>M.edge-P.edge),_=_.slice(0,60);const k=_.filter(P=>P.risk_approved).length,A=_.filter(P=>P.direction==="BUY_YES").length,T=_.filter(P=>P.direction==="BUY_NO").length,C=_.length>0?_.reduce((P,M)=>P+M.conf,0)/_.length:0,D=_.length>0?_.reduce((P,M)=>P+M.edge,0)/_.length:0;return{orbitalMarkets:_,stats:{total:_.length,approved:k,buyYes:A,buyNo:T,avgConf:C,avgEdge:D}}},[r,c]),x=g.find(_=>_.ticker===o);if(a)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})});const y=450,v=430,m=900,S=860,j={};g.forEach(_=>{j[_.ring]=(j[_.ring]||0)+1});const w={},N=g.map(_=>{const k=Fo[_.ring];w[_.ring]||(w[_.ring]=0);const A=w[_.ring]++,T=j[_.ring],D=2*Math.PI/T*A+_.ring*.4,P=Math.sin(A*7.3)*.15,M=D+P,$=k.radius+Math.cos(A*3.7)*15;return{..._,cx:y+$*Math.cos(M),cy:v+$*Math.sin(M)}});return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Signal Orbit"}),s.jsx("p",{className:"text-gray-500 text-sm",children:"Radial visualization -- distance from center = confidence, size = edge strength"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex items-center gap-1 bg-gray-800 rounded-lg p-0.5",children:[{key:"all",label:"All"},{key:"approved",label:"Approved"},{key:"yes",label:"BUY YES"},{key:"no",label:"BUY NO"}].map(_=>s.jsx("button",{onClick:()=>u(_.key),className:`px-3 py-1.5 text-xs font-medium rounded-md transition ${c===_.key?"bg-amber-500 text-black":"text-gray-400 hover:text-gray-200"}`,children:_.label},_.key))}),s.jsxs("label",{className:"flex items-center gap-2 text-xs text-gray-400 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:f,onChange:_=>d(_.target.checked),className:"rounded border-gray-600"}),"Animate"]}),s.jsx("button",{onClick:p,className:"btn btn-o text-sm",children:"Refresh"})]})]}),s.jsx("div",{className:"grid grid-cols-6 gap-3",children:[{label:"Active Signals",value:b.total||0,color:"text-amber-400"},{label:"Risk Approved",value:b.approved||0,color:"text-green-400"},{label:"BUY YES",value:b.buyYes||0,color:"text-green-400"},{label:"BUY NO",value:b.buyNo||0,color:"text-red-400"},{label:"Avg Confidence",value:`${(b.avgConf*100).toFixed(0)}%`,color:"text-blue-400"},{label:"Avg Edge",value:`${(b.avgEdge*100).toFixed(1)}%`,color:"text-purple-400"}].map(_=>s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase mb-1",children:_.label}),s.jsx("p",{className:`text-xl font-bold ${_.color}`,children:_.value})]},_.label))}),s.jsxs("div",{className:"card p-0 overflow-hidden relative",style:{background:"radial-gradient(ellipse at center, #0f172a 0%, #020617 70%, #000 100%)"},children:[s.jsxs("svg",{ref:h,viewBox:`0 0 ${m} ${S}`,className:"w-full",style:{maxHeight:"75vh"},children:[s.jsx(zZ,{width:m,height:S}),Fo.map((_,k)=>s.jsxs("g",{children:[s.jsx("circle",{cx:y,cy:v,r:_.radius,fill:"none",stroke:_.color,strokeWidth:.8,opacity:_.opacity,strokeDasharray:"4 4"}),s.jsx("text",{x:y+_.radius+6,y:v-4,fill:_.color,fontSize:9,opacity:_.opacity+.2,fontFamily:"monospace",children:_.label})]},k)),s.jsxs("defs",{children:[s.jsxs("radialGradient",{id:"sun-gradient",children:[s.jsx("stop",{offset:"0%",stopColor:"#fbbf24",stopOpacity:"1"}),s.jsx("stop",{offset:"50%",stopColor:"#f59e0b",stopOpacity:"0.8"}),s.jsx("stop",{offset:"100%",stopColor:"#d97706",stopOpacity:"0.4"})]}),s.jsxs("filter",{id:"sun-glow",children:[s.jsx("feGaussianBlur",{stdDeviation:"8",result:"blur"}),s.jsxs("feMerge",{children:[s.jsx("feMergeNode",{in:"blur"}),s.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),s.jsx("circle",{cx:y,cy:v,r:40,fill:"url(#sun-gradient)",filter:"url(#sun-glow)",opacity:.6}),s.jsx("circle",{cx:y,cy:v,r:25,fill:"url(#sun-gradient)"}),s.jsx("text",{x:y,y:v-4,textAnchor:"middle",fill:"#000",fontSize:12,fontWeight:"bold",fontFamily:"monospace",children:"KEN"}),s.jsx("text",{x:y,y:v+10,textAnchor:"middle",fill:"#000",fontSize:7,fontFamily:"monospace",opacity:.7,children:"TRADER"}),N.map(_=>{const k=qi[_.direction]||qi.BUY_YES;return s.jsx("line",{x1:y,y1:v,x2:_.cx,y2:_.cy,stroke:k.fill,strokeWidth:.3,opacity:o===_.ticker?.5:.08},`line-${_.ticker}`)}),N.map(_=>s.jsx(WZ,{market:_,cx:_.cx,cy:_.cy,size:_.size,isSelected:o===_.ticker,onSelect:k=>l(k.ticker===o?null:k.ticker),animate:f&&_.risk_approved},_.ticker))]}),s.jsx("div",{className:"absolute bottom-3 left-3 bg-gray-900/80 backdrop-blur-sm rounded-lg p-3 border border-gray-700/50",children:s.jsxs("div",{className:"flex items-center gap-4 text-[10px]",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500"}),s.jsx("span",{className:"text-gray-400",children:"BUY YES"})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),s.jsx("span",{className:"text-gray-400",children:"BUY NO"})]}),s.jsx("div",{className:"text-gray-600",children:"|"}),s.jsx("span",{className:"text-gray-500",children:"Closer to center = higher confidence"}),s.jsx("span",{className:"text-gray-500",children:"Larger = bigger edge"})]})}),s.jsxs("div",{className:"absolute top-3 right-3 bg-gray-900/80 backdrop-blur-sm rounded-lg p-2.5 border border-gray-700/50",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase font-bold mb-1.5",children:"Orbit Rings"}),s.jsx("div",{className:"space-y-1",children:Fo.map((_,k)=>s.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[s.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:_.color,opacity:_.opacity+.3}}),s.jsx("span",{style:{color:_.color},children:_.label}),s.jsx("span",{className:"text-gray-600",children:_.description})]},k))})]})]}),x&&s.jsx(UZ,{market:x,onClose:()=>l(null)}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("h2",{className:"font-semibold",children:"Orbital Signal Registry"}),s.jsxs("span",{className:"text-xs text-gray-500",children:[g.length," signals in orbit"]})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Ring"}),s.jsx("th",{children:"Ticker"}),s.jsx("th",{children:"Direction"}),s.jsx("th",{children:"Edge"}),s.jsx("th",{children:"Confidence"}),s.jsx("th",{children:"Risk"}),s.jsx("th",{children:"Sources"})]})}),s.jsx("tbody",{children:g.slice(0,20).map(_=>{var A;const k=Fo[_.ring];return s.jsxs("tr",{onClick:()=>l(_.ticker===o?null:_.ticker),className:`cursor-pointer ${o===_.ticker?"bg-amber-500/10":""}`,children:[s.jsx("td",{children:s.jsx("span",{className:"text-xs font-bold",style:{color:k.color},children:k.label})}),s.jsx("td",{className:"text-xs font-mono text-gray-300",children:_.ticker}),s.jsx("td",{children:s.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold ${_.direction==="BUY_YES"?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:_.direction})}),s.jsxs("td",{className:"text-amber-400 font-mono font-bold text-sm",children:[(_.edge*100).toFixed(1),"%"]}),s.jsxs("td",{className:"font-mono text-sm",style:{color:$g(_.conf)},children:[(_.conf*100).toFixed(0),"%"]}),s.jsx("td",{children:_.risk_approved?s.jsx("span",{className:"text-green-400 text-xs font-bold",children:"OK"}):s.jsx("span",{className:"text-red-400 text-xs font-bold",children:"BLOCKED"})}),s.jsx("td",{className:"text-xs text-gray-500",children:((A=_.sources)==null?void 0:A.length)||0})]},_.ticker)})})]})})]})]})}const eh=[{name:"Economy",icon:"💰",subcategories:["GDP","Inflation","Jobs","Fed Rate","Recession","Trade","Debt","Markets"],keywords:["gdp","inflation","cpi","unemployment","jobs","payroll","fed","interest rate","recession","stock","sp500","nasdaq","dow","treasury","bond","debt","trade","tariff","deficit"],baseColor:[34,197,94]},{name:"Politics",icon:"🏛",subcategories:["White House","Congress","Elections","SCOTUS","Cabinet","Polls","Policy","Foreign"],keywords:["trump","president","impeach","congress","senate","house","governor","election","democrat","republican","vote","biden","vance","cabinet","scotus","supreme","pardon","approval","poll","secretary","defense","attorney"],baseColor:[59,130,246]},{name:"Weather",icon:"⛈",subcategories:["Temperature","Storms","Snow","Rain","Hurricanes","Heat","Wind","Climate"],keywords:["temperature","rain","snow","hurricane","weather","tornado","flood","heat","cold","storm","wind","precipitation","climate"],baseColor:[6,182,212]},{name:"Technology",icon:"💻",subcategories:["AI","SpaceX","Tesla","Big Tech","Startups","Chips","Cyber","Social"],keywords:["ai","spacex","tesla","apple","google","meta","openai","chatgpt","tech","rocket","launch"],baseColor:[236,72,153]},{name:"Crypto",icon:"🪙",subcategories:["Bitcoin","Ethereum","DeFi","NFTs","Regulation","Mining","Stablecoins","Altcoins"],keywords:["bitcoin","btc","ethereum","eth","crypto","token","blockchain","defi"],baseColor:[245,158,11]},{name:"Sports",icon:"🏈",subcategories:["NFL","NBA","MLB","Soccer","Tennis","UFC","Olympics","Playoffs"],keywords:["nfl","nba","mlb","nhl","soccer","tennis","super bowl","championship","game","match","playoff","world series"],baseColor:[168,85,247]},{name:"Energy",icon:"⚡",subcategories:["Oil","Gas","Solar","Nuclear","OPEC","EVs","Grid","Coal"],keywords:["oil","gas","energy","solar","opec","crude","coal","renewable"],baseColor:[234,179,8]},{name:"Culture",icon:"🎬",subcategories:["Movies","Music","Awards","TV","Social Media","Trends","Celebrity","Gaming"],keywords:["oscar","movie","tv","celebrity","grammy","award","music","entertainment"],baseColor:[249,115,22]}];function KZ(e,t){const[r,n,a]=t,i=Math.max(.05,Math.min(.9,e));return`rgba(${r},${n},${a},${i})`}function VZ(e,t){const[r,n,a]=t,i=Math.max(.1,Math.min(.6,e*.8));return`rgba(${r},${n},${a},${i})`}function GZ(e,t){const[r,n,a]=t;return e>.5?`rgb(${Math.min(255,r+60)},${Math.min(255,n+60)},${Math.min(255,a+60)})`:e>.2?`rgb(${r},${n},${a})`:"#64748b"}function YZ({subcategory:e,intensity:t,signalCount:r,sentiment:n,baseColor:a,onClick:i,isSelected:o}){const l=KZ(t,a),c=VZ(t,a),u=GZ(t,a),f=t>.3;return s.jsxs("div",{onClick:i,className:`relative overflow-hidden rounded-lg cursor-pointer transition-all duration-300 group ${o?"ring-2 ring-amber-400 scale-105 z-10":"hover:scale-102"}`,style:{backgroundColor:l,border:`1px solid ${c}`,minHeight:70},children:[f&&s.jsx("div",{className:"absolute inset-0 opacity-10 pointer-events-none",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.03) 2px, rgba(255,255,255,0.03) 4px)"}}),t>.6&&s.jsx("div",{className:"absolute inset-0 animate-pulse opacity-30 pointer-events-none",style:{background:`radial-gradient(circle at center, rgba(${a.join(",")},0.4), transparent 70%)`,animationDuration:`${3-t*2}s`}}),s.jsxs("div",{className:"relative p-2.5 h-full flex flex-col justify-between z-10",children:[s.jsx("div",{children:s.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:u},children:e})}),s.jsxs("div",{className:"flex items-end justify-between mt-1",children:[s.jsxs("div",{children:[r>0&&s.jsx("p",{className:"text-lg font-bold font-mono",style:{color:u},children:r}),r===0&&s.jsx("p",{className:"text-sm text-gray-600",children:"--"})]}),n!==0&&s.jsxs("div",{className:`text-[9px] font-mono font-bold px-1.5 py-0.5 rounded ${n>0?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:[n>0?"+":"",n.toFixed(2)]})]})]}),s.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5",style:{background:`linear-gradient(90deg, transparent, rgba(${a.join(",")},${t}), transparent)`}})]})}function qZ({category:e,subcategoryData:t,onCellClick:r,selectedCell:n}){const a=t.reduce((l,c)=>l+c.signalCount,0),i=Math.max(...t.map(l=>l.intensity),0),o=t.reduce((l,c)=>l+c.sentiment,0)/t.length;return s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:e.icon}),s.jsx("h3",{className:"text-sm font-bold",style:{color:`rgb(${e.baseColor.join(",")})`},children:e.name}),s.jsxs("span",{className:"text-[10px] text-gray-500",children:[a," signals"]})]}),s.jsxs("div",{className:"flex items-center gap-3 text-[10px]",children:[s.jsxs("span",{className:"text-gray-500",children:["Peak: ",s.jsxs("span",{className:"font-bold",style:{color:`rgb(${e.baseColor.join(",")})`},children:[(i*100).toFixed(0),"%"]})]}),s.jsxs("span",{className:`font-mono ${o>0?"text-green-400":o<0?"text-red-400":"text-gray-500"}`,children:["Sentiment: ",o>0?"+":"",o.toFixed(3)]})]})]}),s.jsx("div",{className:"grid grid-cols-8 gap-2",children:t.map(l=>s.jsx(YZ,{subcategory:l.name,intensity:l.intensity,signalCount:l.signalCount,sentiment:l.sentiment,baseColor:e.baseColor,onClick:()=>r({category:e.name,subcategory:l.name,...l}),isSelected:(n==null?void 0:n.category)===e.name&&(n==null?void 0:n.subcategory)===l.name},l.name))})]})}function XZ(){return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-[10px] text-gray-500",children:"Low"}),s.jsx("div",{className:"flex gap-px",children:Array.from({length:10}).map((t,r)=>s.jsx("div",{className:"w-5 h-3 rounded-sm",style:{backgroundColor:`rgba(245,158,11,${(r+1)/10*.8+.05})`}},r))}),s.jsx("span",{className:"text-[10px] text-gray-500",children:"High"})]})}function QZ({cell:e,signals:t,onClose:r}){if(!e)return null;const n=t.filter(a=>{var o;const i=(a.reasoning||a.ticker||"").toLowerCase();return(o=e.matchingKeywords)==null?void 0:o.some(l=>i.includes(l))}).slice(0,10);return s.jsxs("div",{className:"card border border-amber-500/30 bg-gradient-to-br from-gray-800/95 to-gray-900/95 backdrop-blur-md",children:[s.jsxs("div",{className:"flex items-start justify-between mb-3",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"text-lg",children:e.categoryIcon}),s.jsxs("h3",{className:"text-sm font-bold text-gray-100",children:[e.category," / ",e.subcategory]})]}),s.jsxs("p",{className:"text-xs text-gray-500",children:[e.signalCount," signals | Intensity: ",(e.intensity*100).toFixed(0),"% | Sentiment: ",s.jsxs("span",{className:e.sentiment>0?"text-green-400":e.sentiment<0?"text-red-400":"text-gray-400",children:[e.sentiment>0?"+":"",e.sentiment.toFixed(3)]})]})]}),s.jsx("button",{onClick:r,className:"text-gray-500 hover:text-gray-300 text-lg",children:"×"})]}),n.length>0?s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase font-medium",children:"Related Signals"}),n.map((a,i)=>s.jsxs("div",{className:"flex items-center gap-3 text-xs bg-gray-800/40 rounded-lg px-3 py-2 border border-gray-700/20",children:[s.jsx("span",{className:`px-1.5 py-0.5 rounded text-[9px] font-bold ${a.direction==="BUY_YES"?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:a.direction}),s.jsx("span",{className:"text-gray-400 font-mono truncate flex-1",children:a.ticker}),s.jsxs("span",{className:"text-amber-400 font-mono font-bold",children:[(parseFloat(a.expected_edge)*100).toFixed(1),"%"]}),s.jsxs("span",{className:"text-blue-400 font-mono",children:[(parseFloat(a.confidence)*100).toFixed(0),"%"]}),a.risk_approved?s.jsx("span",{className:"text-green-400 text-[9px] font-bold",children:"OK"}):s.jsx("span",{className:"text-red-400 text-[9px] font-bold",children:"BLOCKED"})]},i))]}):s.jsx("p",{className:"text-gray-600 text-sm text-center py-4",children:"No matching signals for this subcategory"})]})}function ZZ({categoryStats:e}){const t=Math.max(...e.map(r=>r.totalSignals),1);return s.jsxs("div",{className:"card border border-gray-700/50",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("h2",{className:"font-semibold text-sm",children:"National Activity Overview"}),s.jsx("span",{className:"text-[10px] text-gray-500",children:"Signal density across categories"})]}),s.jsx("div",{className:"space-y-2",children:e.sort((r,n)=>n.totalSignals-r.totalSignals).map(r=>{const n=r.totalSignals/t*100;return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-sm w-5",children:r.icon}),s.jsx("span",{className:"text-xs font-medium w-20",style:{color:`rgb(${r.baseColor.join(",")})`},children:r.name}),s.jsxs("div",{className:"flex-1 h-5 bg-gray-800/60 rounded-full overflow-hidden relative",children:[s.jsx("div",{className:"h-full rounded-full transition-all duration-1000 relative overflow-hidden",style:{width:`${Math.max(n,2)}%`,background:`linear-gradient(90deg, rgba(${r.baseColor.join(",")},0.3), rgba(${r.baseColor.join(",")},0.6))`},children:s.jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%)",animation:"shimmer 2s infinite"}})}),s.jsx("span",{className:"absolute right-2 top-0 bottom-0 flex items-center text-[10px] font-mono text-gray-400",children:r.totalSignals})]}),s.jsxs("span",{className:`text-[10px] font-mono w-12 text-right ${r.avgSentiment>0?"text-green-400":r.avgSentiment<0?"text-red-400":"text-gray-500"}`,children:[r.avgSentiment>0?"+":"",r.avgSentiment.toFixed(2)]})]},r.name)})})]})}function JZ(){const[e,t]=O.useState(null),[r,n]=O.useState(null),[a,i]=O.useState(null),[o,l]=O.useState(!0),[c,u]=O.useState(null),[f,d]=O.useState("24h");O.useEffect(()=>{h();const x=setInterval(h,3e4);return()=>clearInterval(x)},[]);async function h(){try{const[x,y,v]=await Promise.all([ke("/dashboard"),ke("/signals"),ke("/signals/dashboard")]);t(x),n((y==null?void 0:y.signals)||[]),i(v)}catch{}l(!1)}const{categoryData:p,categoryStats:g,overallStats:b}=O.useMemo(()=>{var j;if(!r)return{categoryData:[],categoryStats:[],overallStats:{}};const x=r||[],y=Math.max(...eh.flatMap(w=>w.subcategories.map(N=>(w.keywords.filter(k=>N.toLowerCase().includes(k.split(" ")[0])||k.includes(N.toLowerCase())),x.filter(k=>{const A=(k.reasoning||k.ticker||"").toLowerCase();return w.keywords.some(T=>A.includes(T))}).length))),1),v=eh.map(w=>{const N=x.filter(k=>{const A=(k.reasoning||k.ticker||"").toLowerCase();return w.keywords.some(T=>A.includes(T))});N.length,N.length>0&&N.reduce((k,A)=>{const T=(A.sources||[]).reduce((C,D)=>C+(D.sentiment||0),0);return k+T},0)/Math.max(N.length,1);const _=w.subcategories.map(k=>{const A=w.keywords.filter(M=>{const $=k.toLowerCase();return M.includes($)||$.includes(M.split(" ")[0])});let T;if(A.length>0)T=x.filter(M=>{const $=(M.reasoning||M.ticker||"").toLowerCase();return A.some(I=>$.includes(I))});else{const M=k.split("").reduce(($,I)=>($<<5)-$+I.charCodeAt(0)|0,0);T=N.filter(($,I)=>I%w.subcategories.length===Math.abs(M)%w.subcategories.length)}const C=T.length,D=T.reduce((M,$)=>{const I=($.sources||[]).reduce((L,B)=>L+(B.sentiment||0),0);return M+I},0)/Math.max(T.length,1),P=Math.min(1,C/Math.max(y*.5,1));return{name:k,signalCount:C,sentiment:D,intensity:P,matchingKeywords:A.length>0?A:w.keywords,categoryIcon:w.icon}});return{category:w,subcategoryData:_}}),m=eh.map(w=>{const N=x.filter(_=>{const k=(_.reasoning||_.ticker||"").toLowerCase();return w.keywords.some(A=>k.includes(A))});return{name:w.name,icon:w.icon,baseColor:w.baseColor,totalSignals:N.length,avgSentiment:N.length>0?N.reduce((_,k)=>_+(k.sources||[]).reduce((A,T)=>A+(T.sentiment||0),0),0)/N.length:0}}),S={totalSignals:x.length,buyYes:x.filter(w=>w.direction==="BUY_YES").length,buyNo:x.filter(w=>w.direction==="BUY_NO").length,approved:x.filter(w=>w.risk_approved).length,avgEdge:x.length>0?x.reduce((w,N)=>w+parseFloat(N.expected_edge||0),0)/x.length:0,avgConf:x.length>0?x.reduce((w,N)=>w+parseFloat(N.confidence||0),0)/x.length:0,hottest:((j=m.sort((w,N)=>N.totalSignals-w.totalSignals)[0])==null?void 0:j.name)||"None"};return{categoryData:v,categoryStats:m,overallStats:S}},[r]);return o?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})}):s.jsxs("div",{className:"space-y-6",children:[s.jsx("style",{children:`
+        @keyframes shimmer {
+          0% { transform: translateX(-100%); }
+          100% { transform: translateX(200%); }
+        }
+        .hover\\:scale-102:hover { transform: scale(1.02); }
+      `}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Pulse of America"}),s.jsx("p",{className:"text-gray-500 text-sm",children:"Sentiment and activity heatmap across American prediction markets"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex items-center gap-1 bg-gray-800 rounded-lg p-0.5",children:["24h","7d","30d"].map(x=>s.jsx("button",{onClick:()=>d(x),className:`px-3 py-1.5 text-xs font-medium rounded-md transition ${f===x?"bg-amber-500 text-black":"text-gray-400 hover:text-gray-200"}`,children:x},x))}),s.jsx("button",{onClick:h,className:"btn btn-o text-sm",children:"Refresh"})]})]}),s.jsx("div",{className:"grid grid-cols-7 gap-3",children:[{label:"Total Signals",value:b.totalSignals||0,color:"text-amber-400"},{label:"BUY YES",value:b.buyYes||0,color:"text-green-400"},{label:"BUY NO",value:b.buyNo||0,color:"text-red-400"},{label:"Approved",value:b.approved||0,color:"text-green-400"},{label:"Avg Edge",value:`${(b.avgEdge*100).toFixed(1)}%`,color:"text-amber-400"},{label:"Avg Confidence",value:`${(b.avgConf*100).toFixed(0)}%`,color:"text-blue-400"},{label:"Hottest Sector",value:b.hottest,color:"text-red-400"}].map(x=>s.jsxs("div",{className:"card",children:[s.jsx("p",{className:"text-[10px] text-gray-500 uppercase mb-1",children:x.label}),s.jsx("p",{className:`text-lg font-bold ${x.color}`,children:x.value})]},x.label))}),s.jsx(ZZ,{categoryStats:g}),s.jsxs("div",{className:"card p-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),s.jsx("h2",{className:"font-semibold text-sm",children:"Live Signal Heatmap"})]}),s.jsx(XZ,{})]}),s.jsx("div",{className:"space-y-5",children:p.map(({category:x,subcategoryData:y})=>s.jsx(qZ,{category:x,subcategoryData:y,onCellClick:v=>u((c==null?void 0:c.category)===v.category&&(c==null?void 0:c.subcategory)===v.subcategory?null:v),selectedCell:c},x.name))})]}),c&&s.jsx(QZ,{cell:c,signals:r||[],onClose:()=>u(null)}),s.jsxs("div",{className:"card border border-gray-700/50",children:[s.jsx("div",{className:"flex items-center gap-2 mb-3",children:s.jsx("h2",{className:"font-semibold text-sm",children:"Signal Source Breakdown"})}),s.jsx("div",{className:"grid grid-cols-4 gap-3",children:((a==null?void 0:a.sourceBreakdown)||[]).slice(0,8).map(x=>{const y=parseFloat(x.avg_sent)||0,v=parseInt(x.cnt)||0;return s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 border border-gray-700/30",children:[s.jsxs("div",{className:"flex items-center justify-between mb-1",children:[s.jsx("span",{className:"text-xs font-bold text-gray-300 uppercase",children:x.source.replace("_"," ")}),s.jsx("span",{className:"text-amber-400 font-mono text-xs font-bold",children:v})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex-1 h-1.5 bg-gray-700 rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full",style:{width:`${Math.min(100,Math.abs(y)*5e3+10)}%`,backgroundColor:y>0?"#22c55e":y<0?"#ef4444":"#64748b"}})}),s.jsxs("span",{className:`text-[10px] font-mono ${y>0?"text-green-400":y<0?"text-red-400":"text-gray-500"}`,children:[y>0?"+":"",y.toFixed(3)]})]})]},x.source)})})]}),e&&s.jsxs("div",{className:"card border border-gray-700/50",children:[s.jsx("div",{className:"flex items-center gap-2 mb-3",children:s.jsx("h2",{className:"font-semibold text-sm",children:"Market Pulse Metrics"})}),s.jsxs("div",{className:"grid grid-cols-5 gap-3 text-center",children:[s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 border border-gray-700/30",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Balance"}),s.jsxs("p",{className:"text-lg font-bold text-green-400 font-mono",children:["$",e.balance?(e.balance/100).toLocaleString(void 0,{minimumFractionDigits:0}):"0"]})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 border border-gray-700/30",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Today's P&L"}),s.jsxs("p",{className:`text-lg font-bold font-mono ${(e.daily_pnl||0)>=0?"text-green-400":"text-red-400"}`,children:[(e.daily_pnl||0)>=0?"+":"","$",((e.daily_pnl||0)/100).toFixed(2)]})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 border border-gray-700/30",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Today's Trades"}),s.jsx("p",{className:"text-lg font-bold text-amber-400",children:(e.today_trades||0).toLocaleString()})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 border border-gray-700/30",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Win Rate"}),s.jsxs("p",{className:`text-lg font-bold ${e.today_trades>0&&e.today_wins/e.today_trades*100>=50?"text-green-400":"text-red-400"}`,children:[e.today_trades>0?(e.today_wins/e.today_trades*100).toFixed(1):"0","%"]})]}),s.jsxs("div",{className:"rounded-lg bg-gray-800/40 p-3 border border-gray-700/30",children:[s.jsx("p",{className:"text-[9px] text-gray-500 uppercase",children:"Markets Tracked"}),s.jsx("p",{className:"text-lg font-bold text-purple-400",children:e.markets_tracked||0})]})]})]})]})}function eJ(){return s.jsx(QA,{children:s.jsxs(HA,{children:[s.jsx(et,{path:"/login",element:s.jsx(l$,{})}),s.jsx(et,{path:"/setup",element:s.jsx(S$,{})}),s.jsxs(et,{path:"/",element:s.jsx(d$,{}),children:[s.jsx(et,{index:!0,element:s.jsx(iZ,{})}),s.jsx(et,{path:"markets",element:s.jsx(lZ,{})}),s.jsx(et,{path:"positions",element:s.jsx(uZ,{})}),s.jsx(et,{path:"orders",element:s.jsx(hZ,{})}),s.jsx(et,{path:"signals",element:s.jsx(EZ,{})}),s.jsx(et,{path:"intelligence",element:s.jsx(MZ,{})}),s.jsx(et,{path:"trading",element:s.jsx(IZ,{})}),s.jsx(et,{path:"heatmap",element:s.jsx(FZ,{})}),s.jsx(et,{path:"orbit",element:s.jsx(HZ,{})}),s.jsx(et,{path:"pulse",element:s.jsx(JZ,{})}),s.jsx(et,{path:"weather",element:s.jsx(pZ,{})}),s.jsx(et,{path:"risk",element:s.jsx(jZ,{})}),s.jsx(et,{path:"settings",element:s.jsx(_Z,{})})]})]})})}th.createRoot(document.getElementById("root")).render(s.jsx(eJ,{}));
diff --git a/kalshi-dash/dist/index.html b/kalshi-dash/dist/index.html
index 8f81340..90ce139 100644
--- a/kalshi-dash/dist/index.html
+++ b/kalshi-dash/dist/index.html
@@ -5,9 +5,10 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <title>Ken - Event Contracts Trading</title>
   <link rel="preconnect" href="https://fonts.googleapis.com" />
-  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
-  <script type="module" crossorigin src="/assets/index-CabsjIzZ.js"></script>
-  <link rel="stylesheet" crossorigin href="/assets/index-BwLNFh82.css">
+  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
+  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
+  <script type="module" crossorigin src="/assets/index-Cwmd51q1.js"></script>
+  <link rel="stylesheet" crossorigin href="/assets/index-BCeiPTH6.css">
 </head>
 <body>
   <div id="root"></div>
diff --git a/kalshi-dash/docs/plans/2026-03-01-ken-neon-redesign.md b/kalshi-dash/docs/plans/2026-03-01-ken-neon-redesign.md
new file mode 100644
index 0000000..053b446
--- /dev/null
+++ b/kalshi-dash/docs/plans/2026-03-01-ken-neon-redesign.md
@@ -0,0 +1,32 @@
+# Ken Neon Redesign — Full UI Overhaul
+
+## Date: 2026-03-01
+## Status: APPROVED
+
+## Design System: "KEN NEON"
+
+### Colors
+| Token | Value | Usage |
+|-------|-------|-------|
+| --bg | #0E0E10 | Page background |
+| --surface | #141419 | Card backgrounds |
+| --surface-el | #1C1C24 | Elevated surfaces, inputs |
+| --border | #2A2A35 | Borders, dividers |
+| --cyan | #00F0FF | Primary accent, active states |
+| --orange | #F7931A | Secondary accent, brand |
+| --green | #00C389 | Profits, success |
+| --red | #FF5C5C | Losses, danger |
+| --blue | #3B82F6 | Info, links |
+| --text | #E0E0E0 | Primary text |
+| --text-dim | #A8A8A8 | Secondary text |
+| --text-muted | #6B7280 | Muted/disabled |
+
+### Typography
+- Headings: Space Grotesk 700
+- Body: Inter 400/500/600
+- Data/Mono: JetBrains Mono 400/500
+
+### Source: CrypTrade Stock Trader UI Kit (Figma Community)
+- https://www.figma.com/community/file/1566555329071317833
+
+### Scope: All 13 pages + Layout + Login
diff --git a/kalshi-dash/index.html b/kalshi-dash/index.html
index b9a245c..f0cdcda 100644
--- a/kalshi-dash/index.html
+++ b/kalshi-dash/index.html
@@ -5,7 +5,8 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <title>Ken - Event Contracts Trading</title>
   <link rel="preconnect" href="https://fonts.googleapis.com" />
-  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
+  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
+  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
 </head>
 <body>
   <div id="root"></div>
diff --git a/kalshi-dash/src/Layout.jsx b/kalshi-dash/src/Layout.jsx
index cbe13af..b0d3669 100644
--- a/kalshi-dash/src/Layout.jsx
+++ b/kalshi-dash/src/Layout.jsx
@@ -18,6 +18,27 @@ const NAV = [
   { to: '/settings', label: 'Settings', d: 'M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z' },
 ];
 
+function StatusDot({ active, warn }) {
+  const color = warn
+    ? 'var(--orange)'
+    : active
+    ? 'var(--green)'
+    : 'var(--red)';
+  return (
+    <span
+      style={{
+        display: 'inline-block',
+        width: 6,
+        height: 6,
+        borderRadius: '50%',
+        background: color,
+        flexShrink: 0,
+        boxShadow: `0 0 4px ${color}`,
+      }}
+    />
+  );
+}
+
 export default function Layout() {
   const loc = useLocation();
   const nav = useNavigate();
@@ -36,44 +57,233 @@ export default function Layout() {
     });
   }, []);
 
-  if (!authChecked) return <div className="flex items-center justify-center min-h-screen"><div className="animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full" /></div>;
+  if (!authChecked) {
+    return (
+      <div className="flex items-center justify-center min-h-screen" style={{ background: 'var(--bg)' }}>
+        <div
+          className="w-8 h-8 rounded-full border-2 border-t-transparent animate-spin"
+          style={{ borderColor: 'var(--cyan)', borderTopColor: 'transparent' }}
+        />
+      </div>
+    );
+  }
+
+  const sidebarW = col ? 64 : 220;
 
   return (
-    <div className="flex min-h-screen">
-      <aside className={`${col ? 'w-16' : 'w-56'} bg-gray-900/50 border-r border-gray-800 flex flex-col transition-all duration-200`}>
-        <div className="p-4 border-b border-gray-800 flex items-center gap-3">
-          <div className="w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0" style={{ background: 'linear-gradient(135deg,#f59e0b,#f97316)' }}>
-            <span className="text-black font-bold text-sm">K</span>
+    <div className="flex min-h-screen" style={{ background: 'var(--bg)' }}>
+      {/* ── Sidebar ── */}
+      <aside
+        style={{
+          width: sidebarW,
+          minWidth: sidebarW,
+          background: 'var(--surface)',
+          borderRight: '1px solid var(--border)',
+          display: 'flex',
+          flexDirection: 'column',
+          transition: 'width 200ms ease, min-width 200ms ease',
+          overflow: 'hidden',
+          position: 'sticky',
+          top: 0,
+          height: '100vh',
+        }}
+      >
+        {/* Brand */}
+        <div
+          style={{
+            padding: col ? '16px 12px' : '16px 18px',
+            borderBottom: '1px solid var(--border)',
+            display: 'flex',
+            alignItems: 'center',
+            gap: 12,
+            minHeight: 64,
+            flexShrink: 0,
+          }}
+        >
+          {/* Orange gradient K badge */}
+          <div
+            style={{
+              width: 34,
+              height: 34,
+              borderRadius: 8,
+              background: 'linear-gradient(135deg, var(--orange), #E5690D)',
+              display: 'flex',
+              alignItems: 'center',
+              justifyContent: 'center',
+              flexShrink: 0,
+              boxShadow: '0 2px 10px rgba(247,147,26,0.3)',
+            }}
+          >
+            <span style={{ color: '#0E0E10', fontWeight: 900, fontSize: 16, fontFamily: 'var(--font-heading)' }}>K</span>
           </div>
-          {!col && <span className="font-bold text-sm kalshi-gradient">KEN TRADER</span>}
+
+          {!col && (
+            <span
+              className="kalshi-gradient heading"
+              style={{ fontSize: 13, fontWeight: 700, letterSpacing: '0.06em', whiteSpace: 'nowrap' }}
+            >
+              KEN TRADER
+            </span>
+          )}
         </div>
-        <nav className="flex-1 p-2 space-y-0.5">
+
+        {/* Nav items */}
+        <nav style={{ flex: 1, padding: '10px 8px', overflowY: 'auto', overflowX: 'hidden' }}>
           {NAV.map(n => {
             const active = loc.pathname === n.to || (n.to !== '/' && loc.pathname.startsWith(n.to));
             return (
-              <Link key={n.to} to={n.to} className={`flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition ${active ? 'bg-amber-500/15 text-amber-400 font-medium' : 'text-gray-400 hover:text-gray-200 hover:bg-gray-800/50'}`}>
-                <svg className="flex-shrink-0" style={{ width: 18, height: 18 }} fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d={n.d} /></svg>
-                {!col && <span>{n.label}</span>}
+              <Link
+                key={n.to}
+                to={n.to}
+                title={col ? n.label : undefined}
+                style={{
+                  display: 'flex',
+                  alignItems: 'center',
+                  gap: col ? 0 : 10,
+                  padding: col ? '9px 0' : '9px 10px',
+                  justifyContent: col ? 'center' : 'flex-start',
+                  borderRadius: 8,
+                  marginBottom: 2,
+                  textDecoration: 'none',
+                  fontSize: 13,
+                  fontWeight: active ? 600 : 400,
+                  color: active ? 'var(--cyan)' : 'var(--text-dim)',
+                  background: active ? 'rgba(0,240,255,0.08)' : 'transparent',
+                  borderLeft: active ? '3px solid var(--cyan)' : '3px solid transparent',
+                  transition: 'all 150ms ease',
+                  whiteSpace: 'nowrap',
+                  overflow: 'hidden',
+                }}
+                onMouseEnter={e => {
+                  if (!active) {
+                    e.currentTarget.style.color = 'var(--text)';
+                    e.currentTarget.style.background = 'rgba(255,255,255,0.04)';
+                  }
+                }}
+                onMouseLeave={e => {
+                  if (!active) {
+                    e.currentTarget.style.color = 'var(--text-dim)';
+                    e.currentTarget.style.background = 'transparent';
+                  }
+                }}
+              >
+                <svg
+                  style={{ width: 17, height: 17, flexShrink: 0, opacity: active ? 1 : 0.7 }}
+                  fill="none"
+                  stroke="currentColor"
+                  strokeWidth="1.6"
+                  viewBox="0 0 24 24"
+                >
+                  <path strokeLinecap="round" strokeLinejoin="round" d={n.d} />
+                </svg>
+                {!col && (
+                  <span style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}>{n.label}</span>
+                )}
               </Link>
             );
           })}
         </nav>
-        <div className="p-3 border-t border-gray-800">
-          {!col && h && <div className="space-y-1.5 text-[11px]">
-            <div className="flex justify-between"><span className="text-gray-500">Env</span><span className={h.env === 'demo' ? 'text-yellow-400' : 'text-green-400'}>{(h.env || 'demo').toUpperCase()}</span></div>
-            <div className="flex justify-between"><span className="text-gray-500">API</span><span className={h.kalshi_connected ? 'text-green-400' : 'text-gray-500'}>{h.kalshi_connected ? 'CONNECTED' : 'OFF'}</span></div>
-            <div className="flex justify-between"><span className="text-gray-500">DB</span><span className={h.db_connected ? 'text-green-400' : 'text-red-400'}>{h.db_connected ? 'OK' : 'DOWN'}</span></div>
-            <div className="flex justify-between"><span className="text-gray-500">Safe Mode</span><span className={h.safe_mode ? 'text-yellow-400' : 'text-green-400'}>{h.safe_mode ? 'ON' : 'OFF'}</span></div>
-          </div>}
-          <div className="flex gap-1 mt-2">
-            <button onClick={() => setCol(!col)} className="flex-1 flex items-center justify-center py-1.5 text-gray-500 hover:text-gray-300">
-              <svg className={`w-4 h-4 transition-transform ${col ? '' : 'rotate-180'}`} fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M11 19l-7-7 7-7m8 14l-7-7 7-7" /></svg>
+
+        {/* Bottom status + controls */}
+        <div
+          style={{
+            borderTop: '1px solid var(--border)',
+            padding: col ? '12px 8px' : '12px 14px',
+            flexShrink: 0,
+          }}
+        >
+          {/* Status indicators — hidden when collapsed */}
+          {!col && h && (
+            <div style={{ marginBottom: 10, display: 'flex', flexDirection: 'column', gap: 6 }}>
+              {[
+                { label: 'Env', value: (h.env || 'demo').toUpperCase(), warn: h.env === 'demo', active: h.env === 'prod' },
+                { label: 'API', value: h.kalshi_connected ? 'CONNECTED' : 'OFF', active: h.kalshi_connected },
+                { label: 'DB', value: h.db_connected ? 'OK' : 'DOWN', active: h.db_connected },
+                { label: 'Safe Mode', value: h.safe_mode ? 'ON' : 'OFF', warn: h.safe_mode, active: !h.safe_mode },
+              ].map(s => (
+                <div key={s.label} style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
+                  <span style={{ fontSize: 10, color: 'var(--text-muted)', fontFamily: 'var(--font-body)' }}>{s.label}</span>
+                  <div style={{ display: 'flex', alignItems: 'center', gap: 5 }}>
+                    <StatusDot active={s.active} warn={s.warn} />
+                    <span
+                      style={{
+                        fontSize: 10,
+                        fontFamily: 'var(--font-mono)',
+                        fontWeight: 600,
+                        color: s.warn ? 'var(--orange)' : s.active ? 'var(--green)' : 'var(--red)',
+                      }}
+                    >
+                      {s.value}
+                    </span>
+                  </div>
+                </div>
+              ))}
+            </div>
+          )}
+
+          {/* Collapse + Logout */}
+          <div style={{ display: 'flex', gap: 6, alignItems: 'center' }}>
+            <button
+              onClick={() => setCol(!col)}
+              title={col ? 'Expand sidebar' : 'Collapse sidebar'}
+              style={{
+                flex: 1,
+                display: 'flex',
+                alignItems: 'center',
+                justifyContent: 'center',
+                padding: '7px 0',
+                background: 'transparent',
+                border: '1px solid var(--border)',
+                borderRadius: 7,
+                cursor: 'pointer',
+                color: 'var(--text-muted)',
+                transition: 'all 150ms ease',
+              }}
+              onMouseEnter={e => { e.currentTarget.style.borderColor = 'var(--cyan)'; e.currentTarget.style.color = 'var(--cyan)'; }}
+              onMouseLeave={e => { e.currentTarget.style.borderColor = 'var(--border)'; e.currentTarget.style.color = 'var(--text-muted)'; }}
+            >
+              <svg
+                style={{ width: 14, height: 14, transition: 'transform 200ms ease', transform: col ? 'rotate(180deg)' : 'none' }}
+                fill="none"
+                stroke="currentColor"
+                viewBox="0 0 24 24"
+              >
+                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M11 19l-7-7 7-7m8 14l-7-7 7-7" />
+              </svg>
             </button>
-            {!col && <button onClick={logout} className="px-2 py-1 text-xs text-gray-500 hover:text-red-400">Logout</button>}
+
+            {!col && (
+              <button
+                onClick={logout}
+                style={{
+                  padding: '7px 10px',
+                  background: 'transparent',
+                  border: '1px solid var(--border)',
+                  borderRadius: 7,
+                  cursor: 'pointer',
+                  color: 'var(--text-muted)',
+                  fontSize: 11,
+                  fontFamily: 'var(--font-body)',
+                  fontWeight: 500,
+                  transition: 'all 150ms ease',
+                  whiteSpace: 'nowrap',
+                }}
+                onMouseEnter={e => { e.currentTarget.style.borderColor = 'var(--red)'; e.currentTarget.style.color = 'var(--red)'; }}
+                onMouseLeave={e => { e.currentTarget.style.borderColor = 'var(--border)'; e.currentTarget.style.color = 'var(--text-muted)'; }}
+              >
+                Logout
+              </button>
+            )}
           </div>
         </div>
       </aside>
-      <main className="flex-1 overflow-auto"><div className="p-6 max-w-[1600px] mx-auto"><Outlet /></div></main>
+
+      {/* ── Main content ── */}
+      <main style={{ flex: 1, overflowY: 'auto', overflowX: 'hidden' }}>
+        <div style={{ maxWidth: 1600, margin: '0 auto', padding: '24px 28px' }}>
+          <Outlet />
+        </div>
+      </main>
     </div>
   );
 }
diff --git a/kalshi-dash/src/Login.jsx b/kalshi-dash/src/Login.jsx
index 9f1cec1..28281ef 100644
--- a/kalshi-dash/src/Login.jsx
+++ b/kalshi-dash/src/Login.jsx
@@ -2,6 +2,29 @@ import React, { useState, useEffect, useRef } from 'react';
 import { useNavigate } from 'react-router-dom';
 import { login, checkSession, googleLogin, getGoogleConfig } from './api';
 
+/* CSS-only animated dot background is defined inline via keyframes injected once */
+const DOT_STYLE = `
+@keyframes floatDot {
+  0%, 100% { transform: translateY(0px) scale(1); opacity: 0.18; }
+  50% { transform: translateY(-18px) scale(1.1); opacity: 0.35; }
+}
+.login-dot {
+  position: absolute;
+  border-radius: 50%;
+  background: var(--cyan);
+  animation: floatDot linear infinite;
+  pointer-events: none;
+}
+`;
+
+const DOTS = Array.from({ length: 22 }, (_, i) => ({
+  size: 2 + Math.random() * 4,
+  top: Math.random() * 100,
+  left: Math.random() * 100,
+  duration: 4 + Math.random() * 6,
+  delay: -(Math.random() * 8),
+}));
+
 export default function Login() {
   const [user, setUser] = useState('');
   const [pass, setPass] = useState('');
@@ -65,56 +88,255 @@ export default function Login() {
     setLoading(false);
   }
 
-  if (checking) return <div className="min-h-screen flex items-center justify-center"><div className="animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full" /></div>;
+  if (checking) {
+    return (
+      <div
+        className="flex items-center justify-center min-h-screen"
+        style={{ background: 'var(--bg)' }}
+      >
+        <div
+          className="w-8 h-8 rounded-full border-2 border-t-transparent animate-spin"
+          style={{ borderColor: 'var(--cyan)', borderTopColor: 'transparent' }}
+        />
+      </div>
+    );
+  }
 
   return (
-    <div className="min-h-screen flex items-center justify-center p-4">
-      <div className="w-full max-w-md">
-        <div className="text-center mb-8">
-          <div className="inline-flex items-center justify-center w-20 h-20 rounded-2xl mb-4" style={{ background: 'linear-gradient(135deg,#f59e0b,#f97316)' }}>
-            <span className="text-3xl font-black text-black">K</span>
+    <div
+      className="min-h-screen flex items-center justify-center p-4"
+      style={{ background: 'var(--bg)', position: 'relative', overflow: 'hidden' }}
+    >
+      {/* Inject dot animation styles once */}
+      <style>{DOT_STYLE}</style>
+
+      {/* CSS-only animated background dots */}
+      {DOTS.map((dot, i) => (
+        <span
+          key={i}
+          className="login-dot"
+          style={{
+            width: dot.size,
+            height: dot.size,
+            top: `${dot.top}%`,
+            left: `${dot.left}%`,
+            animationDuration: `${dot.duration}s`,
+            animationDelay: `${dot.delay}s`,
+          }}
+        />
+      ))}
+
+      {/* Subtle radial glow behind card */}
+      <div
+        style={{
+          position: 'absolute',
+          top: '50%',
+          left: '50%',
+          transform: 'translate(-50%, -50%)',
+          width: 600,
+          height: 600,
+          borderRadius: '50%',
+          background: 'radial-gradient(ellipse, rgba(0,240,255,0.04) 0%, transparent 70%)',
+          pointerEvents: 'none',
+        }}
+      />
+
+      {/* Login card */}
+      <div
+        className="card-glow fade-in w-full"
+        style={{ maxWidth: 400, position: 'relative', zIndex: 1 }}
+      >
+        {/* Logo + heading */}
+        <div className="flex flex-col items-center mb-7">
+          {/* Large K badge */}
+          <div
+            style={{
+              width: 72,
+              height: 72,
+              borderRadius: 18,
+              background: 'linear-gradient(135deg, var(--orange), #C45A08)',
+              display: 'flex',
+              alignItems: 'center',
+              justifyContent: 'center',
+              marginBottom: 16,
+              boxShadow: '0 4px 24px rgba(247,147,26,0.35)',
+            }}
+          >
+            <span
+              style={{
+                color: '#0E0E10',
+                fontWeight: 900,
+                fontSize: 32,
+                fontFamily: 'var(--font-heading)',
+                lineHeight: 1,
+              }}
+            >
+              K
+            </span>
           </div>
-          <h1 className="text-3xl font-extrabold kalshi-gradient">KEN TRADER</h1>
-          <p className="text-gray-400 mt-2 text-sm">Event Contracts Trading System</p>
-          <p className="text-xs text-green-400 mt-1">CFTC-Regulated DCM</p>
+
+          <h1
+            className="kalshi-gradient heading"
+            style={{ fontSize: 26, fontWeight: 800, letterSpacing: '-0.02em', marginBottom: 6 }}
+          >
+            KEN TRADER
+          </h1>
+          <p style={{ fontSize: 13, color: 'var(--text-muted)', marginBottom: 4 }}>
+            Event Contracts Trading Platform
+          </p>
+          <span className="badge bg-green" style={{ fontSize: 10 }}>
+            CFTC-Regulated DCM
+          </span>
         </div>
 
-        {err && <div className="text-red-400 text-sm bg-red-500/10 rounded-lg p-3 flex items-center gap-2 mb-4">
-          <svg className="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" /></svg>
-          {err}
-        </div>}
+        {/* Error alert */}
+        {err && (
+          <div
+            className="fade-in"
+            style={{
+              display: 'flex',
+              alignItems: 'center',
+              gap: 8,
+              background: 'var(--red-dim)',
+              border: '1px solid rgba(255,92,92,0.25)',
+              borderRadius: 8,
+              padding: '10px 12px',
+              marginBottom: 16,
+              color: 'var(--red)',
+              fontSize: 13,
+            }}
+          >
+            <svg style={{ width: 15, height: 15, flexShrink: 0 }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
+            </svg>
+            {err}
+          </div>
+        )}
 
+        {/* Google Sign-In */}
         {googleClientId && (
-          <div className="mb-4">
-            <div ref={googleBtnRef} className="flex justify-center" />
-            <div className="relative my-5">
-              <div className="absolute inset-0 flex items-center"><div className="w-full border-t border-gray-800" /></div>
-              <div className="relative flex justify-center text-xs"><span className="px-3 text-gray-500" style={{ background: 'var(--bg)' }}>or sign in with password</span></div>
+          <div style={{ marginBottom: 4 }}>
+            <div ref={googleBtnRef} style={{ display: 'flex', justifyContent: 'center', marginBottom: 16 }} />
+            <div style={{ position: 'relative', display: 'flex', alignItems: 'center', marginBottom: 20 }}>
+              <div style={{ flex: 1, height: 1, background: 'var(--border)' }} />
+              <span
+                style={{
+                  padding: '0 12px',
+                  fontSize: 11,
+                  color: 'var(--text-muted)',
+                  background: 'var(--surface)',
+                  whiteSpace: 'nowrap',
+                }}
+              >
+                or sign in with password
+              </span>
+              <div style={{ flex: 1, height: 1, background: 'var(--border)' }} />
             </div>
           </div>
         )}
 
-        <form onSubmit={submit} className="card space-y-4">
-          <div>
-            <label className="block text-xs font-medium text-gray-400 mb-1.5">Username</label>
-            <input type="text" value={user} onChange={e => setUser(e.target.value)} required autoComplete="username" className="w-full bg-gray-800/50 border border-gray-700 rounded-lg px-3 py-2.5 text-sm focus:outline-none focus:border-amber-500 transition" placeholder="admin" />
+        {/* Password form */}
+        <form onSubmit={submit}>
+          <div style={{ marginBottom: 14 }}>
+            <label
+              style={{
+                display: 'block',
+                fontSize: 11,
+                fontWeight: 600,
+                color: 'var(--text-dim)',
+                marginBottom: 6,
+                textTransform: 'uppercase',
+                letterSpacing: '0.06em',
+              }}
+            >
+              Username
+            </label>
+            <input
+              type="text"
+              value={user}
+              onChange={e => setUser(e.target.value)}
+              required
+              autoComplete="username"
+              placeholder="admin"
+              className="input"
+            />
           </div>
-          <div>
-            <label className="block text-xs font-medium text-gray-400 mb-1.5">Password</label>
-            <div className="relative">
-              <input type={showPass ? 'text' : 'password'} value={pass} onChange={e => setPass(e.target.value)} required autoComplete="current-password" className="w-full bg-gray-800/50 border border-gray-700 rounded-lg px-3 py-2.5 pr-10 text-sm focus:outline-none focus:border-amber-500 transition" placeholder="Enter password" />
-              <button type="button" onClick={() => setShowPass(!showPass)} className="absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300">
-                <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d={showPass ? 'M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.879L21 21' : 'M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'} /></svg>
+
+          <div style={{ marginBottom: 20 }}>
+            <label
+              style={{
+                display: 'block',
+                fontSize: 11,
+                fontWeight: 600,
+                color: 'var(--text-dim)',
+                marginBottom: 6,
+                textTransform: 'uppercase',
+                letterSpacing: '0.06em',
+              }}
+            >
+              Password
+            </label>
+            <div style={{ position: 'relative' }}>
+              <input
+                type={showPass ? 'text' : 'password'}
+                value={pass}
+                onChange={e => setPass(e.target.value)}
+                required
+                autoComplete="current-password"
+                placeholder="Enter password"
+                className="input"
+                style={{ paddingRight: '2.5rem' }}
+              />
+              <button
+                type="button"
+                onClick={() => setShowPass(!showPass)}
+                style={{
+                  position: 'absolute',
+                  right: 12,
+                  top: '50%',
+                  transform: 'translateY(-50%)',
+                  background: 'none',
+                  border: 'none',
+                  cursor: 'pointer',
+                  color: 'var(--text-muted)',
+                  padding: 0,
+                  display: 'flex',
+                }}
+              >
+                <svg style={{ width: 16, height: 16 }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d={showPass ? 'M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.879L21 21' : 'M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'} />
+                </svg>
               </button>
             </div>
           </div>
-          <button type="submit" disabled={loading} className="btn btn-p w-full py-2.5 flex items-center justify-center gap-2 disabled:opacity-50">
-            {loading && <span className="animate-spin w-4 h-4 border-2 border-black border-t-transparent rounded-full" />}
+
+          <button
+            type="submit"
+            disabled={loading}
+            className="btn btn-p btn-lg"
+            style={{ width: '100%', opacity: loading ? 0.6 : 1 }}
+          >
+            {loading && (
+              <span
+                className="w-4 h-4 rounded-full border-2 border-t-transparent animate-spin"
+                style={{ borderColor: '#0E0E10', borderTopColor: 'transparent' }}
+              />
+            )}
             {loading ? 'Signing in...' : 'Sign In'}
           </button>
         </form>
 
-        <p className="text-center text-gray-600 text-[10px] mt-4">Ken operates as a CFTC-regulated Designated Contract Market</p>
+        <p
+          style={{
+            textAlign: 'center',
+            marginTop: 20,
+            fontSize: 10,
+            color: 'var(--text-muted)',
+            letterSpacing: '0.02em',
+          }}
+        >
+          Ken operates as a CFTC-regulated Designated Contract Market
+        </p>
       </div>
     </div>
   );
diff --git a/kalshi-dash/src/index.css b/kalshi-dash/src/index.css
index 3053384..7f3bbe0 100644
--- a/kalshi-dash/src/index.css
+++ b/kalshi-dash/src/index.css
@@ -2,26 +2,312 @@
 @tailwind components;
 @tailwind utilities;
 
-:root { --bg: #0a0e1a; --card: #111827; --border: #1e293b; --accent: #f59e0b; }
-body { background: var(--bg); color: #e2e8f0; font-family: 'Inter', sans-serif; margin: 0; }
-::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: var(--bg); } ::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
-.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
-.stat-v { font-size: 1.75rem; font-weight: 700; line-height: 1; }
-.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
-.bg-green { background: rgba(16,185,129,0.15); color: #10b981; }
-.bg-red { background: rgba(239,68,68,0.15); color: #ef4444; }
-.bg-yellow { background: rgba(245,158,11,0.15); color: #f59e0b; }
-.bg-blue { background: rgba(59,130,246,0.15); color: #3b82f6; }
-.bg-orange { background: rgba(249,115,22,0.15); color: #f97316; }
-.pulse-g { animation: pg 2s infinite; }
-@keyframes pg { 0%,100%{box-shadow:0 0 0 0 rgba(245,158,11,0.4)} 50%{box-shadow:0 0 0 6px rgba(245,158,11,0)} }
-.btn { padding: 0.5rem 1rem; border-radius: 8px; font-weight: 600; font-size: 0.875rem; cursor: pointer; border: none; transition: all 0.15s; }
-.btn-p { background: #f59e0b; color: #111; } .btn-p:hover { background: #d97706; }
-.btn-d { background: #ef4444; color: white; } .btn-d:hover { background: #dc2626; }
-.btn-s { background: #10b981; color: white; } .btn-s:hover { background: #059669; }
-.btn-o { background: transparent; border: 1px solid var(--border); color: #9ca3af; } .btn-o:hover { border-color: #f59e0b; color: #f59e0b; }
+/* ═══════════════════════════════════════════════════════════
+   KEN NEON — Design System
+   Based on CrypTrade Stock Trader UI Kit (Figma Community)
+   Colors: Neon Cyan (#00F0FF) + Bitcoin Orange (#F7931A)
+   Typography: Space Grotesk / Inter / JetBrains Mono
+   ═══════════════════════════════════════════════════════════ */
+
+:root {
+  --bg: #0E0E10;
+  --surface: #141419;
+  --surface-el: #1C1C24;
+  --border: #2A2A35;
+  --border-light: #3A3A48;
+  --cyan: #00F0FF;
+  --cyan-dim: rgba(0, 240, 255, 0.15);
+  --cyan-glow: rgba(0, 240, 255, 0.08);
+  --orange: #F7931A;
+  --orange-dim: rgba(247, 147, 26, 0.15);
+  --green: #00C389;
+  --green-dim: rgba(0, 195, 137, 0.15);
+  --red: #FF5C5C;
+  --red-dim: rgba(255, 92, 92, 0.15);
+  --blue: #3B82F6;
+  --blue-dim: rgba(59, 130, 246, 0.15);
+  --purple: #A855F7;
+  --purple-dim: rgba(168, 85, 247, 0.15);
+  --text: #E0E0E0;
+  --text-dim: #A8A8A8;
+  --text-muted: #6B7280;
+  --radius-sm: 6px;
+  --radius-md: 10px;
+  --radius-lg: 14px;
+  --radius-xl: 20px;
+  --transition: 150ms ease;
+  --font-heading: 'Space Grotesk', sans-serif;
+  --font-body: 'Inter', sans-serif;
+  --font-mono: 'JetBrains Mono', monospace;
+}
+
+/* ─── Base ─── */
+body {
+  background: var(--bg);
+  color: var(--text);
+  font-family: var(--font-body);
+  margin: 0;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+h1, h2, h3, h4, h5, h6 {
+  font-family: var(--font-heading);
+  font-weight: 700;
+  letter-spacing: -0.02em;
+}
+
+/* ─── Scrollbar ─── */
+::-webkit-scrollbar { width: 6px; height: 6px; }
+::-webkit-scrollbar-track { background: var(--bg); }
+::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
+::-webkit-scrollbar-thumb:hover { background: #4B5563; }
+
+/* ─── Cards ─── */
+.card {
+  background: var(--surface);
+  border: 1px solid var(--border);
+  border-radius: var(--radius-lg);
+  padding: 1.25rem;
+  transition: all var(--transition);
+}
+.card:hover {
+  border-color: var(--border-light);
+  box-shadow: 0 0 20px var(--cyan-glow);
+}
+.card-elevated {
+  background: var(--surface-el);
+  border: 1px solid var(--border);
+  border-radius: var(--radius-lg);
+  padding: 1.25rem;
+}
+.card-glow {
+  background: var(--surface);
+  border: 1px solid rgba(0, 240, 255, 0.2);
+  border-radius: var(--radius-lg);
+  padding: 1.25rem;
+  box-shadow: 0 0 30px var(--cyan-glow), inset 0 1px 0 rgba(0, 240, 255, 0.05);
+}
+
+/* ─── Stat Values ─── */
+.stat-v {
+  font-family: var(--font-mono);
+  font-size: 1.75rem;
+  font-weight: 600;
+  line-height: 1;
+  letter-spacing: -0.02em;
+}
+.stat-label {
+  font-size: 0.7rem;
+  font-weight: 600;
+  text-transform: uppercase;
+  letter-spacing: 0.08em;
+  color: var(--text-muted);
+  font-family: var(--font-body);
+}
+
+/* ─── Badges ─── */
+.badge {
+  display: inline-flex;
+  align-items: center;
+  gap: 4px;
+  padding: 3px 10px;
+  border-radius: 9999px;
+  font-size: 0.7rem;
+  font-weight: 600;
+  font-family: var(--font-body);
+  letter-spacing: 0.02em;
+}
+.bg-cyan { background: var(--cyan-dim); color: var(--cyan); }
+.bg-green { background: var(--green-dim); color: var(--green); }
+.bg-red { background: var(--red-dim); color: var(--red); }
+.bg-yellow, .bg-orange { background: var(--orange-dim); color: var(--orange); }
+.bg-blue { background: var(--blue-dim); color: var(--blue); }
+.bg-purple { background: var(--purple-dim); color: var(--purple); }
+
+/* ─── Buttons ─── */
+.btn {
+  display: inline-flex;
+  align-items: center;
+  justify-content: center;
+  gap: 6px;
+  padding: 0.5rem 1rem;
+  border-radius: var(--radius-md);
+  font-weight: 600;
+  font-size: 0.85rem;
+  font-family: var(--font-body);
+  cursor: pointer;
+  border: none;
+  transition: all var(--transition);
+}
+.btn-p {
+  background: var(--cyan);
+  color: #0E0E10;
+}
+.btn-p:hover { background: #00D4E0; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,240,255,0.25); }
+.btn-orange {
+  background: var(--orange);
+  color: #0E0E10;
+}
+.btn-orange:hover { background: #E5850F; }
+.btn-d { background: var(--red); color: white; }
+.btn-d:hover { background: #E04A4A; }
+.btn-s { background: var(--green); color: #0E0E10; }
+.btn-s:hover { background: #00A875; }
+.btn-o {
+  background: transparent;
+  border: 1px solid var(--border);
+  color: var(--text-dim);
+}
+.btn-o:hover { border-color: var(--cyan); color: var(--cyan); }
+.btn-ghost {
+  background: transparent;
+  color: var(--text-dim);
+  border: none;
+}
+.btn-ghost:hover { color: var(--cyan); background: var(--cyan-glow); }
+.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.75rem; }
+.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
+
+/* ─── Tables ─── */
 table { width: 100%; border-collapse: collapse; }
-th { text-align: left; padding: 0.75rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; border-bottom: 1px solid var(--border); }
-td { padding: 0.75rem; border-bottom: 1px solid rgba(30,41,59,0.5); font-size: 0.85rem; }
-tr:hover td { background: rgba(245,158,11,0.03); }
-.kalshi-gradient { background: linear-gradient(135deg, #f59e0b, #f97316); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
+th {
+  text-align: left;
+  padding: 0.75rem;
+  font-size: 0.65rem;
+  text-transform: uppercase;
+  letter-spacing: 0.08em;
+  color: var(--text-muted);
+  font-family: var(--font-body);
+  font-weight: 600;
+  border-bottom: 1px solid var(--border);
+}
+td {
+  padding: 0.75rem;
+  border-bottom: 1px solid rgba(42, 42, 53, 0.5);
+  font-size: 0.85rem;
+}
+tr:hover td { background: var(--cyan-glow); }
+
+/* ─── Inputs ─── */
+.input {
+  width: 100%;
+  padding: 0.6rem 0.85rem;
+  background: var(--surface-el);
+  border: 1px solid var(--border);
+  border-radius: var(--radius-md);
+  color: var(--text);
+  font-family: var(--font-body);
+  font-size: 0.85rem;
+  transition: all var(--transition);
+  outline: none;
+}
+.input:focus {
+  border-color: var(--cyan);
+  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
+}
+.input::placeholder { color: var(--text-muted); }
+
+/* ─── Gradients ─── */
+.kalshi-gradient {
+  background: linear-gradient(135deg, var(--cyan), var(--orange));
+  -webkit-background-clip: text;
+  -webkit-text-fill-color: transparent;
+  background-clip: text;
+}
+.gradient-cyan {
+  background: linear-gradient(135deg, var(--cyan), #0088FF);
+  -webkit-background-clip: text;
+  -webkit-text-fill-color: transparent;
+  background-clip: text;
+}
+
+/* ─── Animations ─── */
+.pulse-cyan { animation: pulse-c 2s infinite; }
+@keyframes pulse-c {
+  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.4); }
+  50% { box-shadow: 0 0 0 6px rgba(0, 240, 255, 0); }
+}
+
+.pulse-g { animation: pg 2s infinite; }
+@keyframes pg {
+  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 195, 137, 0.4); }
+  50% { box-shadow: 0 0 0 6px rgba(0, 195, 137, 0); }
+}
+
+.glow-cyan {
+  box-shadow: 0 0 20px rgba(0, 240, 255, 0.15), 0 0 60px rgba(0, 240, 255, 0.05);
+}
+
+.fade-in {
+  animation: fadeIn 0.3s ease-out;
+}
+@keyframes fadeIn {
+  from { opacity: 0; transform: translateY(8px); }
+  to { opacity: 1; transform: translateY(0); }
+}
+
+/* ─── Section Headers ─── */
+.section-title {
+  font-family: var(--font-heading);
+  font-size: 1.25rem;
+  font-weight: 700;
+  color: var(--text);
+  display: flex;
+  align-items: center;
+  gap: 10px;
+}
+.section-subtitle {
+  font-size: 0.8rem;
+  color: var(--text-muted);
+  margin-top: 2px;
+}
+
+/* ─── Toggle Switch ─── */
+.toggle {
+  position: relative;
+  width: 40px;
+  height: 22px;
+  background: var(--border);
+  border-radius: 11px;
+  cursor: pointer;
+  transition: background var(--transition);
+}
+.toggle.active { background: var(--cyan); }
+.toggle::after {
+  content: '';
+  position: absolute;
+  top: 2px;
+  left: 2px;
+  width: 18px;
+  height: 18px;
+  background: white;
+  border-radius: 50%;
+  transition: transform var(--transition);
+}
+.toggle.active::after { transform: translateX(18px); }
+
+/* ─── Progress Bar ─── */
+.progress-bar {
+  height: 4px;
+  background: var(--border);
+  border-radius: 2px;
+  overflow: hidden;
+}
+.progress-fill {
+  height: 100%;
+  border-radius: 2px;
+  background: linear-gradient(90deg, var(--cyan), #0088FF);
+  transition: width 0.5s ease;
+}
+
+/* ─── Utility ─── */
+.mono { font-family: var(--font-mono); }
+.heading { font-family: var(--font-heading); }
+.text-cyan { color: var(--cyan); }
+.text-orange { color: var(--orange); }
+.text-green { color: var(--green); }
+.text-red { color: var(--red); }
+.text-dim { color: var(--text-dim); }
+.text-muted { color: var(--text-muted); }
+.border-cyan { border-color: var(--cyan) !important; }
diff --git a/kalshi-dash/src/pages/Dashboard.jsx b/kalshi-dash/src/pages/Dashboard.jsx
index 80a6f86..31cb819 100644
--- a/kalshi-dash/src/pages/Dashboard.jsx
+++ b/kalshi-dash/src/pages/Dashboard.jsx
@@ -3,98 +3,164 @@ import { api, post } from '../api';
 import { Link } from 'react-router-dom';
 import { AreaChart, Area, BarChart, Bar, Cell, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, PieChart, Pie } from 'recharts';
 
+/* ── Helper: P&L badge ── */
 function PnlBadge({ cents }) {
   const val = Number(cents || 0);
   const dollars = (val / 100).toFixed(2);
-  if (val > 0) return <span className="text-green-400 font-mono font-bold">+${dollars}</span>;
-  if (val < 0) return <span className="text-red-400 font-mono font-bold">-${Math.abs(val / 100).toFixed(2)}</span>;
-  return <span className="text-gray-500 font-mono">$0.00</span>;
+  if (val > 0) return <span className="mono" style={{ color: 'var(--green)', fontWeight: 700 }}>+${dollars}</span>;
+  if (val < 0) return <span className="mono" style={{ color: 'var(--red)', fontWeight: 700 }}>-${Math.abs(val / 100).toFixed(2)}</span>;
+  return <span className="mono" style={{ color: 'var(--text-muted)' }}>$0.00</span>;
 }
 
+/* ── Helper: Win/loss ratio ── */
 function WinRate({ wins, losses }) {
   const total = wins + losses;
-  if (!total) return <span className="text-gray-500">—</span>;
+  if (!total) return <span style={{ color: 'var(--text-muted)' }}>—</span>;
   const pct = (wins / total * 100).toFixed(0);
-  return (
-    <span className={pct >= 80 ? 'text-green-400' : pct >= 50 ? 'text-amber-400' : 'text-red-400'}>
-      {wins}/{total} ({pct}%)
-    </span>
-  );
+  const color = pct >= 80 ? 'var(--green)' : pct >= 50 ? 'var(--orange)' : 'var(--red)';
+  return <span style={{ color }}>{wins}/{total} ({pct}%)</span>;
 }
 
+/* ── Helper: Hold indicator badge ── */
 function HoldsIndicator({ wins, losses, pnl }) {
   const total = wins + losses;
   const wr = total > 0 ? wins / total : 0;
-  if (wr >= 0.90 && pnl > 0) return <span className="px-2 py-0.5 rounded text-[10px] font-bold bg-green-500/20 text-green-400 border border-green-500/30">ADD MORE</span>;
-  if (wr >= 0.65 && pnl > 0) return <span className="px-2 py-0.5 rounded text-[10px] font-bold bg-amber-500/20 text-amber-400 border border-amber-500/30">HOLD</span>;
-  if (pnl < 0) return <span className="px-2 py-0.5 rounded text-[10px] font-bold bg-red-500/20 text-red-400 border border-red-500/30">REDUCE</span>;
-  return <span className="px-2 py-0.5 rounded text-[10px] font-bold bg-gray-500/20 text-gray-400 border border-gray-600">WATCH</span>;
+  const base = { padding: '2px 8px', borderRadius: 4, fontSize: 10, fontWeight: 700, fontFamily: 'var(--font-body)' };
+  if (wr >= 0.90 && pnl > 0) return <span style={{ ...base, background: 'var(--green-dim)', color: 'var(--green)', border: '1px solid rgba(0,195,137,0.25)' }}>ADD MORE</span>;
+  if (wr >= 0.65 && pnl > 0) return <span style={{ ...base, background: 'var(--orange-dim)', color: 'var(--orange)', border: '1px solid rgba(247,147,26,0.25)' }}>HOLD</span>;
+  if (pnl < 0) return <span style={{ ...base, background: 'var(--red-dim)', color: 'var(--red)', border: '1px solid rgba(255,92,92,0.25)' }}>REDUCE</span>;
+  return <span style={{ ...base, background: 'rgba(107,114,128,0.15)', color: 'var(--text-muted)', border: '1px solid var(--border)' }}>WATCH</span>;
 }
 
-// ── Top 3 Best Opportunities Right Now ──
+/* ── Top 3 Best Opportunities ── */
 function TopOpportunities({ opportunities }) {
   const ops = opportunities || [];
-  if (!ops.length) return (
-    <div className="card border border-gray-700/50 bg-gradient-to-br from-gray-800/30 to-transparent">
-      <div className="flex items-center gap-2 mb-2">
-        <span className="text-lg">🔍</span>
-        <h2 className="font-semibold">Best Opportunities Right Now</h2>
+
+  if (!ops.length) {
+    return (
+      <div className="card">
+        <div className="section-title" style={{ marginBottom: 8 }}>
+          <svg style={{ width: 18, height: 18, color: 'var(--cyan)' }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
+          </svg>
+          Best Opportunities Right Now
+        </div>
+        <p style={{ color: 'var(--text-muted)', fontSize: 13, textAlign: 'center', padding: '24px 0' }}>
+          No fresh signals — waiting for next pipeline cycle...
+        </p>
       </div>
-      <p className="text-gray-500 text-sm text-center py-6">No fresh signals — waiting for next pipeline cycle...</p>
-    </div>
-  );
+    );
+  }
 
-  const medalColors = [
-    { bg: 'from-amber-500/15 to-amber-500/5', border: 'border-amber-500/30', medal: '🥇', rank: 'bg-amber-500/20 text-amber-400' },
-    { bg: 'from-gray-400/10 to-gray-400/5', border: 'border-gray-400/30', medal: '🥈', rank: 'bg-gray-400/20 text-gray-300' },
-    { bg: 'from-orange-700/10 to-orange-700/5', border: 'border-orange-700/30', medal: '🥉', rank: 'bg-orange-700/20 text-orange-400' },
+  const rankStyles = [
+    { borderColor: 'rgba(247,147,26,0.35)', background: 'rgba(247,147,26,0.06)', rankColor: 'var(--orange)', rankLabel: '#1' },
+    { borderColor: 'rgba(160,160,160,0.25)', background: 'rgba(160,160,160,0.04)', rankColor: 'var(--text-dim)', rankLabel: '#2' },
+    { borderColor: 'rgba(180,100,50,0.25)', background: 'rgba(180,100,50,0.04)', rankColor: '#CD7F32', rankLabel: '#3' },
   ];
 
   return (
-    <div className="card border border-amber-500/20 bg-gradient-to-br from-amber-500/5 via-transparent to-green-500/5">
-      <div className="flex items-center gap-2 mb-4">
-        <span className="text-lg">🎯</span>
-        <h2 className="font-semibold">Best Opportunities Right Now</h2>
-        <span className="ml-auto text-[10px] text-gray-500 uppercase font-medium">Live Signals</span>
+    <div className="card" style={{ border: '1px solid rgba(0,240,255,0.15)', background: 'linear-gradient(135deg, rgba(0,240,255,0.03), var(--surface), rgba(0,195,137,0.03))' }}>
+      <div style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 16 }}>
+        <div className="section-title">
+          <svg style={{ width: 18, height: 18, color: 'var(--cyan)' }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z" />
+          </svg>
+          Best Opportunities Right Now
+        </div>
+        <span style={{ marginLeft: 'auto', fontSize: 10, color: 'var(--text-muted)', textTransform: 'uppercase', fontWeight: 600, letterSpacing: '0.08em' }}>Live Signals</span>
       </div>
-      <div className="space-y-3">
+
+      <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
         {ops.map((o, i) => {
-          const c = medalColors[i] || medalColors[2];
+          const rs = rankStyles[i] || rankStyles[2];
           const hasHistory = o.hist_trades > 0;
+          const histColor = parseFloat(o.hist_wr) >= 80 ? 'var(--green)' : parseFloat(o.hist_wr) >= 50 ? 'var(--orange)' : 'var(--red)';
+
           return (
-            <div key={o.ticker} className={`rounded-xl p-4 bg-gradient-to-r ${c.bg} border ${c.border}`}>
-              <div className="flex items-start gap-3">
-                <span className="text-2xl mt-1">{c.medal}</span>
-                <div className="flex-1 min-w-0">
-                  <div className="flex items-center gap-2 mb-1">
-                    <a href={o.url} target="_blank" rel="noopener noreferrer"
-                      className="text-sm font-semibold text-gray-100 hover:text-amber-400 truncate transition">{o.title}</a>
-                  </div>
-                  <div className="flex flex-wrap items-center gap-2 mb-2">
-                    <span className={`px-2 py-0.5 rounded text-[10px] font-bold ${o.direction === 'NO' ? 'bg-red-500/20 text-red-400 border border-red-500/30' : 'bg-green-500/20 text-green-400 border border-green-500/30'}`}>
-                      BUY {o.direction}
-                    </span>
-                    <span className="text-xs text-gray-400">
-                      Edge: <span className="text-amber-400 font-bold">{o.edge_pct}%</span>
+            <div
+              key={o.ticker}
+              style={{
+                borderRadius: 10,
+                padding: '14px 16px',
+                background: rs.background,
+                border: `1px solid ${rs.borderColor}`,
+                display: 'flex',
+                gap: 14,
+                alignItems: 'flex-start',
+              }}
+            >
+              {/* Rank */}
+              <div
+                style={{
+                  width: 28,
+                  height: 28,
+                  borderRadius: 7,
+                  background: `${rs.rankColor}22`,
+                  border: `1px solid ${rs.borderColor}`,
+                  display: 'flex',
+                  alignItems: 'center',
+                  justifyContent: 'center',
+                  flexShrink: 0,
+                  marginTop: 2,
+                }}
+              >
+                <span style={{ fontSize: 11, fontWeight: 800, color: rs.rankColor, fontFamily: 'var(--font-mono)' }}>{rs.rankLabel}</span>
+              </div>
+
+              <div style={{ flex: 1, minWidth: 0 }}>
+                <a
+                  href={o.url}
+                  target="_blank"
+                  rel="noopener noreferrer"
+                  style={{
+                    fontSize: 13,
+                    fontWeight: 600,
+                    color: 'var(--text)',
+                    textDecoration: 'none',
+                    display: 'block',
+                    marginBottom: 8,
+                    overflow: 'hidden',
+                    textOverflow: 'ellipsis',
+                    whiteSpace: 'nowrap',
+                  }}
+                  onMouseEnter={e => { e.currentTarget.style.color = 'var(--cyan)'; }}
+                  onMouseLeave={e => { e.currentTarget.style.color = 'var(--text)'; }}
+                >
+                  {o.title}
+                </a>
+
+                <div style={{ display: 'flex', flexWrap: 'wrap', alignItems: 'center', gap: 8, marginBottom: 8 }}>
+                  <span
+                    className="badge"
+                    style={o.direction === 'NO'
+                      ? { background: 'var(--red-dim)', color: 'var(--red)', border: '1px solid rgba(255,92,92,0.25)' }
+                      : { background: 'var(--green-dim)', color: 'var(--green)', border: '1px solid rgba(0,195,137,0.25)' }
+                    }
+                  >
+                    BUY {o.direction}
+                  </span>
+
+                  <span style={{ fontSize: 12, color: 'var(--text-muted)' }}>
+                    Edge: <span className="mono" style={{ color: 'var(--cyan)', fontWeight: 700 }}>{o.edge_pct}%</span>
+                  </span>
+                  <span style={{ fontSize: 12, color: 'var(--text-muted)' }}>
+                    Conf: <span style={{ color: 'var(--blue)', fontWeight: 700 }}>{o.confidence}%</span>
+                  </span>
+                  {o.price_cents > 0 && (
+                    <span style={{ fontSize: 12, color: 'var(--text-muted)' }}>
+                      Price: <span className="mono" style={{ color: 'var(--text)' }}>{o.price_cents}c</span>
                     </span>
-                    <span className="text-xs text-gray-400">
-                      Conf: <span className="text-blue-400 font-bold">{o.confidence}%</span>
+                  )}
+                  {hasHistory && (
+                    <span style={{ fontSize: 12, color: 'var(--text-muted)' }}>
+                      History: <span style={{ fontWeight: 700, color: histColor }}>{o.hist_wr}% WR</span>
+                      <span style={{ color: 'var(--text-muted)', marginLeft: 4 }}>({o.hist_trades} trades, {(o.hist_pnl / 100) >= 0 ? '+' : ''}${(o.hist_pnl / 100).toFixed(0)})</span>
                     </span>
-                    {o.price_cents > 0 && (
-                      <span className="text-xs text-gray-400">
-                        Price: <span className="font-mono text-gray-200">{o.price_cents}¢</span>
-                      </span>
-                    )}
-                    {hasHistory && (
-                      <span className="text-xs text-gray-400">
-                        History: <span className={`font-bold ${parseFloat(o.hist_wr) >= 80 ? 'text-green-400' : parseFloat(o.hist_wr) >= 50 ? 'text-amber-400' : 'text-red-400'}`}>{o.hist_wr}% WR</span>
-                        <span className="text-gray-500 ml-1">({o.hist_trades} trades, {(o.hist_pnl / 100) >= 0 ? '+' : ''}${(o.hist_pnl / 100).toFixed(0)})</span>
-                      </span>
-                    )}
-                    {!hasHistory && <span className="text-[10px] text-gray-600 italic">New market — no history</span>}
-                  </div>
-                  <p className="text-[11px] text-gray-400 leading-relaxed">{o.why}</p>
+                  )}
+                  {!hasHistory && <span style={{ fontSize: 11, color: 'var(--text-muted)', fontStyle: 'italic' }}>New market</span>}
                 </div>
+
+                <p style={{ fontSize: 11, color: 'var(--text-dim)', lineHeight: 1.5 }}>{o.why}</p>
               </div>
             </div>
           );
@@ -104,10 +170,11 @@ function TopOpportunities({ opportunities }) {
   );
 }
 
-// ── Strategy Insight: Animated Flow Diagram ──
+/* ── Strategy Flow Diagram ── */
 function StrategyFlowDiagram({ topMarkets, seedMoney, balance }) {
   const best = (topMarkets || []).slice(0, 3);
   if (!best.length) return null;
+
   const avgWinRate = best.reduce((s, m) => s + m.wins / (m.wins + m.losses), 0) / best.length * 100;
   const avgEntry = best.length > 0 ? Math.round(best.reduce((s, m) => {
     const wr = m.wins / (m.wins + m.losses || 1);
@@ -117,59 +184,126 @@ function StrategyFlowDiagram({ topMarkets, seedMoney, balance }) {
   const balDollars = balance ? (balance / 100) : seedDollars;
   const pnlPct = seedDollars > 0 ? ((balDollars - seedDollars) / seedDollars * 100) : 0;
 
+  const steps = [
+    {
+      icon: (
+        <svg style={{ width: 20, height: 20 }} fill="none" stroke="var(--cyan)" viewBox="0 0 24 24">
+          <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" />
+        </svg>
+      ),
+      label: `Start: $${seedDollars.toLocaleString()}`,
+      sub: `$${balDollars.toLocaleString()} (${pnlPct >= 0 ? '+' : ''}${pnlPct.toFixed(1)}%)`,
+      borderColor: 'rgba(0,240,255,0.25)',
+      subColor: pnlPct >= 0 ? 'var(--green)' : 'var(--red)',
+    },
+    {
+      icon: (
+        <svg style={{ width: 20, height: 20 }} fill="none" stroke="var(--blue)" viewBox="0 0 24 24">
+          <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0" />
+        </svg>
+      ),
+      label: 'Signal Found',
+      sub: 'AI scans 135 markets',
+      borderColor: 'rgba(59,130,246,0.25)',
+      subColor: 'var(--text-muted)',
+    },
+    {
+      icon: (
+        <svg style={{ width: 20, height: 20 }} fill="none" stroke="var(--orange)" viewBox="0 0 24 24">
+          <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
+        </svg>
+      ),
+      label: `Buy NO at ${avgEntry}c`,
+      sub: 'High-prob event',
+      borderColor: 'rgba(247,147,26,0.25)',
+      subColor: 'var(--text-muted)',
+    },
+    {
+      icon: (
+        <svg style={{ width: 20, height: 20 }} fill="none" stroke="var(--purple)" viewBox="0 0 24 24">
+          <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
+        </svg>
+      ),
+      label: 'Hold 5min-2hr',
+      sub: 'TP +3c / SL -5c',
+      borderColor: 'rgba(168,85,247,0.25)',
+      subColor: 'var(--text-muted)',
+    },
+    {
+      icon: (
+        <svg style={{ width: 20, height: 20 }} fill="none" stroke="var(--green)" viewBox="0 0 24 24">
+          <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
+        </svg>
+      ),
+      label: `Collect ${100 - avgEntry}c`,
+      sub: `${avgWinRate.toFixed(0)}% of the time`,
+      borderColor: 'rgba(0,195,137,0.25)',
+      subColor: 'var(--text-muted)',
+    },
+  ];
+
   return (
-    <div className="card border border-green-500/15 bg-gradient-to-br from-green-500/5 via-transparent to-amber-500/5">
-      <div className="flex items-center gap-2 mb-4">
-        <span className="text-lg">⚡</span>
-        <h2 className="font-semibold">Winning Strategy — Live Flow</h2>
+    <div className="card" style={{ border: '1px solid rgba(0,195,137,0.12)', background: 'linear-gradient(135deg, rgba(0,195,137,0.04), var(--surface), rgba(247,147,26,0.04))' }}>
+      <div className="section-title" style={{ marginBottom: 16 }}>
+        <svg style={{ width: 18, height: 18, color: 'var(--cyan)' }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+          <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M13 10V3L4 14h7v7l9-11h-7z" />
+        </svg>
+        Winning Strategy — Live Flow
       </div>
 
-      {/* Animated Flow: Start → Signal → Trade → Hold → Profit */}
-      <div className="flex items-center justify-between gap-2 mb-5">
-        {[
-          { icon: '🏦', label: `Start: $${seedDollars.toLocaleString()}`, sub: `Now $${balDollars.toLocaleString()} (${pnlPct >= 0 ? '+' : ''}${pnlPct.toFixed(1)}%)`, color: 'from-cyan-500/20 to-cyan-500/5', border: 'border-cyan-500/30', isStart: true },
-          { icon: '→', isArrow: true },
-          { icon: '📡', label: 'Signal Found', sub: 'AI scans 135 markets', color: 'from-blue-500/20 to-blue-500/5', border: 'border-blue-500/30' },
-          { icon: '→', isArrow: true },
-          { icon: '🎯', label: `Buy NO at ${avgEntry}¢`, sub: 'High-prob event', color: 'from-amber-500/20 to-amber-500/5', border: 'border-amber-500/30' },
-          { icon: '→', isArrow: true },
-          { icon: '⏱️', label: 'Hold 5min–2hr', sub: 'TP +3¢ / SL -5¢', color: 'from-purple-500/20 to-purple-500/5', border: 'border-purple-500/30' },
-          { icon: '→', isArrow: true },
-          { icon: '💰', label: `Collect ${100 - avgEntry}¢`, sub: `${avgWinRate.toFixed(0)}% of the time`, color: 'from-green-500/20 to-green-500/5', border: 'border-green-500/30' },
-        ].map((step, i) => step.isArrow ? (
-          <div key={i} className="text-gray-600 text-lg animate-pulse">→</div>
-        ) : (
-          <div key={i} className={`flex-1 rounded-xl p-3 bg-gradient-to-b ${step.color} border ${step.border} text-center ${step.isStart ? 'ring-1 ring-cyan-500/30' : ''}`}>
-            <div className="text-2xl mb-1">{step.icon}</div>
-            <p className={`text-xs font-semibold ${step.isStart ? 'text-cyan-300' : 'text-gray-200'}`}>{step.label}</p>
-            <p className={`text-[10px] ${step.isStart && pnlPct >= 0 ? 'text-green-500' : step.isStart ? 'text-red-400' : 'text-gray-500'}`}>{step.sub}</p>
-          </div>
+      <div style={{ display: 'flex', alignItems: 'center', gap: 6, marginBottom: 18 }}>
+        {steps.map((step, i) => (
+          <React.Fragment key={i}>
+            <div
+              style={{
+                flex: 1,
+                borderRadius: 10,
+                padding: '12px 10px',
+                background: 'rgba(255,255,255,0.02)',
+                border: `1px solid ${step.borderColor}`,
+                textAlign: 'center',
+              }}
+            >
+              <div style={{ display: 'flex', justifyContent: 'center', marginBottom: 6 }}>{step.icon}</div>
+              <p style={{ fontSize: 11, fontWeight: 600, color: 'var(--text)', marginBottom: 2 }}>{step.label}</p>
+              <p style={{ fontSize: 10, color: step.subColor }}>{step.sub}</p>
+            </div>
+            {i < steps.length - 1 && (
+              <svg style={{ width: 14, height: 14, color: 'var(--border-light)', flexShrink: 0 }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M9 5l7 7-7 7" />
+              </svg>
+            )}
+          </React.Fragment>
         ))}
       </div>
 
-      {/* Strategy Math */}
-      <div className="grid grid-cols-3 gap-3">
-        <div className="rounded-lg bg-gray-800/40 p-3 text-center border border-gray-700">
-          <p className="text-[10px] text-gray-500 uppercase">Cost Per Trade</p>
-          <p className="text-lg font-bold text-amber-400">{avgEntry}¢</p>
-          <p className="text-[10px] text-gray-600">buying NO side</p>
-        </div>
-        <div className="rounded-lg bg-gray-800/40 p-3 text-center border border-gray-700">
-          <p className="text-[10px] text-gray-500 uppercase">Profit on Win</p>
-          <p className="text-lg font-bold text-green-400">{100 - avgEntry}¢</p>
-          <p className="text-[10px] text-gray-600">per contract</p>
-        </div>
-        <div className="rounded-lg bg-gray-800/40 p-3 text-center border border-gray-700">
-          <p className="text-[10px] text-gray-500 uppercase">Return Multiple</p>
-          <p className="text-lg font-bold text-green-400">{((100 - avgEntry) / avgEntry * 100).toFixed(0)}%</p>
-          <p className="text-[10px] text-gray-600">per winning trade</p>
-        </div>
+      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3,1fr)', gap: 10 }}>
+        {[
+          { label: 'Cost Per Trade', value: `${avgEntry}c`, sub: 'buying NO side', color: 'var(--orange)' },
+          { label: 'Profit on Win', value: `${100 - avgEntry}c`, sub: 'per contract', color: 'var(--green)' },
+          { label: 'Return Multiple', value: `${((100 - avgEntry) / avgEntry * 100).toFixed(0)}%`, sub: 'per winning trade', color: 'var(--green)' },
+        ].map(stat => (
+          <div
+            key={stat.label}
+            style={{
+              borderRadius: 8,
+              padding: '12px',
+              background: 'var(--surface-el)',
+              border: '1px solid var(--border)',
+              textAlign: 'center',
+            }}
+          >
+            <p className="stat-label" style={{ marginBottom: 4 }}>{stat.label}</p>
+            <p className="mono" style={{ fontSize: 20, fontWeight: 700, color: stat.color }}>{stat.value}</p>
+            <p style={{ fontSize: 10, color: 'var(--text-muted)', marginTop: 2 }}>{stat.sub}</p>
+          </div>
+        ))}
       </div>
     </div>
   );
 }
 
-// ── Next Actions Panel ──
+/* ── Next Actions Panel ── */
 function NextActions({ topMarkets, worstMarkets, strategies }) {
   const addMore = (topMarkets || []).filter(m => m.wins / (m.wins + m.losses || 1) >= 0.90 && m.pnl > 0);
   const cutLosses = (worstMarkets || []).filter(m => m.pnl < -5000);
@@ -177,70 +311,76 @@ function NextActions({ topMarkets, worstMarkets, strategies }) {
 
   const actions = [];
   if (addMore.length > 0) {
-    actions.push({
-      priority: 'HIGH',
-      color: 'green',
-      icon: '🚀',
-      title: `Double down on ${addMore.length} near-certain markets`,
-      detail: addMore.slice(0, 2).map(m => m.title?.split('?')[0] || m.ticker).join(', '),
-      reason: `${addMore.length} markets have 90%+ win rate — the edge is proven`,
-    });
+    actions.push({ priority: 'HIGH', color: 'green', iconPath: 'M13 7h8m0 0v8m0-8l-8 8-4-4-6 6', title: `Double down on ${addMore.length} near-certain markets`, detail: addMore.slice(0, 2).map(m => m.title?.split('?')[0] || m.ticker).join(', '), reason: `${addMore.length} markets have 90%+ win rate — the edge is proven` });
   }
   if (cutLosses.length > 0) {
-    actions.push({
-      priority: 'HIGH',
-      color: 'red',
-      icon: '🛑',
-      title: `Exit ${cutLosses.length} bleeding market(s)`,
-      detail: cutLosses.slice(0, 2).map(m => m.title?.split('?')[0] || m.ticker).join(', '),
-      reason: `0% win rate, losing $${Math.abs(cutLosses.reduce((s, m) => s + m.pnl, 0) / 100).toFixed(0)} total`,
-    });
+    actions.push({ priority: 'HIGH', color: 'red', iconPath: 'M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636', title: `Exit ${cutLosses.length} bleeding market(s)`, detail: cutLosses.slice(0, 2).map(m => m.title?.split('?')[0] || m.ticker).join(', '), reason: `0% win rate, losing $${Math.abs(cutLosses.reduce((s, m) => s + m.pnl, 0) / 100).toFixed(0)} total` });
   }
   if (disableStrats.length > 0) {
-    actions.push({
-      priority: 'MED',
-      color: 'amber',
-      icon: '⚙️',
-      title: `Consider disabling ${disableStrats.length} strategy(ies)`,
-      detail: disableStrats.map(s => s.name).join(', '),
-      reason: `Sub-20% win rate — these are coin flips minus fees`,
-    });
+    actions.push({ priority: 'MED', color: 'orange', iconPath: 'M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z', title: `Consider disabling ${disableStrats.length} strategy(ies)`, detail: disableStrats.map(s => s.name).join(', '), reason: 'Sub-20% win rate — these are coin flips minus fees' });
   }
-  actions.push({
-    priority: 'INFO',
-    color: 'blue',
-    icon: '📊',
-    title: 'Keep hyper-trading high-prob NO markets',
-    detail: 'The 95¢+ NO strategy is the #1 edge — scale it up',
-    reason: 'Compounding small spreads at 99%+ win rate = consistent returns',
-  });
+  actions.push({ priority: 'INFO', color: 'cyan', iconPath: 'M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z', title: 'Keep hyper-trading high-prob NO markets', detail: 'The 95c+ NO strategy is the #1 edge — scale it up', reason: 'Compounding small spreads at 99%+ win rate = consistent returns' });
 
   const colorMap = {
-    green: { bg: 'bg-green-500/10', border: 'border-green-500/25', text: 'text-green-400', badge: 'bg-green-500/20' },
-    red: { bg: 'bg-red-500/10', border: 'border-red-500/25', text: 'text-red-400', badge: 'bg-red-500/20' },
-    amber: { bg: 'bg-amber-500/10', border: 'border-amber-500/25', text: 'text-amber-400', badge: 'bg-amber-500/20' },
-    blue: { bg: 'bg-blue-500/10', border: 'border-blue-500/25', text: 'text-blue-400', badge: 'bg-blue-500/20' },
+    green: { bg: 'var(--green-dim)', border: 'rgba(0,195,137,0.2)', text: 'var(--green)', badge: 'rgba(0,195,137,0.2)' },
+    red: { bg: 'var(--red-dim)', border: 'rgba(255,92,92,0.2)', text: 'var(--red)', badge: 'rgba(255,92,92,0.2)' },
+    orange: { bg: 'var(--orange-dim)', border: 'rgba(247,147,26,0.2)', text: 'var(--orange)', badge: 'rgba(247,147,26,0.2)' },
+    cyan: { bg: 'var(--cyan-dim)', border: 'rgba(0,240,255,0.2)', text: 'var(--cyan)', badge: 'rgba(0,240,255,0.2)' },
   };
 
   return (
-    <div className="card border border-amber-500/15 bg-gradient-to-br from-amber-500/5 to-transparent">
-      <div className="flex items-center gap-2 mb-4">
-        <span className="text-lg">🎯</span>
-        <h2 className="font-semibold">What To Do Next</h2>
+    <div className="card" style={{ border: '1px solid rgba(247,147,26,0.12)' }}>
+      <div className="section-title" style={{ marginBottom: 14 }}>
+        <svg style={{ width: 18, height: 18, color: 'var(--orange)' }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+          <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z" />
+        </svg>
+        What To Do Next
       </div>
-      <div className="space-y-3">
+      <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
         {actions.map((a, i) => {
           const c = colorMap[a.color];
           return (
-            <div key={i} className={`rounded-xl p-3 ${c.bg} border ${c.border} flex gap-3`}>
-              <span className="text-xl mt-0.5">{a.icon}</span>
-              <div className="flex-1">
-                <div className="flex items-center gap-2 mb-0.5">
-                  <span className={`text-[9px] font-bold px-1.5 py-0.5 rounded ${c.badge} ${c.text} uppercase`}>{a.priority}</span>
-                  <span className={`text-sm font-semibold ${c.text}`}>{a.title}</span>
+            <div
+              key={i}
+              style={{
+                borderRadius: 10,
+                padding: '12px 14px',
+                background: c.bg,
+                border: `1px solid ${c.border}`,
+                display: 'flex',
+                gap: 12,
+                alignItems: 'flex-start',
+              }}
+            >
+              <div
+                style={{
+                  width: 30,
+                  height: 30,
+                  borderRadius: 8,
+                  background: c.badge,
+                  display: 'flex',
+                  alignItems: 'center',
+                  justifyContent: 'center',
+                  flexShrink: 0,
+                  marginTop: 1,
+                }}
+              >
+                <svg style={{ width: 15, height: 15, color: c.text }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d={a.iconPath} />
+                </svg>
+              </div>
+              <div style={{ flex: 1 }}>
+                <div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 3 }}>
+                  <span
+                    className="badge"
+                    style={{ background: c.badge, color: c.text, fontSize: 9, padding: '2px 6px' }}
+                  >
+                    {a.priority}
+                  </span>
+                  <span style={{ fontSize: 13, fontWeight: 600, color: c.text }}>{a.title}</span>
                 </div>
-                <p className="text-xs text-gray-300">{a.detail}</p>
-                <p className="text-[10px] text-gray-500 mt-1">{a.reason}</p>
+                <p style={{ fontSize: 12, color: 'var(--text-dim)', marginBottom: 2 }}>{a.detail}</p>
+                <p style={{ fontSize: 11, color: 'var(--text-muted)' }}>{a.reason}</p>
               </div>
             </div>
           );
@@ -250,36 +390,35 @@ function NextActions({ topMarkets, worstMarkets, strategies }) {
   );
 }
 
-// ── Strategy Performance Bars ──
+/* ── Strategy P&L Bar Chart ── */
 function StrategyBars({ strategies }) {
   const sorted = [...(strategies || [])].sort((a, b) => b.pnl - a.pnl).slice(0, 10);
   if (!sorted.length) return null;
-  const maxAbs = Math.max(...sorted.map(s => Math.abs(s.pnl)));
   const barData = sorted.map(s => ({
     name: s.name,
     pnl: s.pnl / 100,
-    fill: s.pnl >= 0 ? '#22c55e' : '#ef4444',
+    fill: s.pnl >= 0 ? '#00C389' : '#FF5C5C',
   }));
 
   return (
     <div className="card">
-      <div className="flex items-center gap-2 mb-3">
-        <span className="text-lg">📈</span>
-        <h2 className="font-semibold">Strategy P&L — Top 10</h2>
+      <div className="section-title" style={{ marginBottom: 14 }}>
+        <svg style={{ width: 18, height: 18, color: 'var(--cyan)' }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+          <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />
+        </svg>
+        Strategy P&L — Top 10
       </div>
       <ResponsiveContainer width="100%" height={250}>
         <BarChart data={barData} layout="vertical" margin={{ left: 70, right: 20 }}>
-          <CartesianGrid strokeDasharray="3 3" stroke="#1f2937" horizontal={false} />
-          <XAxis type="number" stroke="#6b7280" tickFormatter={v => `$${v}`} />
-          <YAxis type="category" dataKey="name" stroke="#6b7280" tick={{ fontSize: 11 }} width={65} />
+          <CartesianGrid strokeDasharray="3 3" stroke="var(--border)" horizontal={false} />
+          <XAxis type="number" stroke="var(--text-muted)" tick={{ fill: 'var(--text-muted)', fontSize: 11 }} tickFormatter={v => `$${v}`} />
+          <YAxis type="category" dataKey="name" stroke="var(--text-muted)" tick={{ fill: 'var(--text-muted)', fontSize: 11 }} width={65} />
           <Tooltip
-            contentStyle={{ background: '#1f2937', border: '1px solid #374151', borderRadius: 8 }}
+            contentStyle={{ background: 'var(--surface-el)', border: '1px solid var(--border)', borderRadius: 8, color: 'var(--text)' }}
             formatter={v => [`$${v.toFixed(2)}`, 'P&L']}
           />
           <Bar dataKey="pnl" radius={[0, 4, 4, 0]}>
-            {barData.map((entry, i) => (
-              <Cell key={i} fill={entry.fill} />
-            ))}
+            {barData.map((entry, i) => <Cell key={i} fill={entry.fill} />)}
           </Bar>
         </BarChart>
       </ResponsiveContainer>
@@ -287,20 +426,20 @@ function StrategyBars({ strategies }) {
   );
 }
 
-// ── Win Rate Donut ──
+/* ── Win Rate Donut ── */
 function WinRateDonut({ todayWins, todayLosses }) {
   const total = (todayWins || 0) + (todayLosses || 0);
   if (!total) return null;
   const wr = ((todayWins / total) * 100).toFixed(1);
   const data = [
-    { name: 'Wins', value: todayWins, fill: '#22c55e' },
-    { name: 'Losses', value: todayLosses, fill: '#ef4444' },
+    { name: 'Wins', value: todayWins, fill: '#00C389' },
+    { name: 'Losses', value: todayLosses, fill: '#FF5C5C' },
   ];
 
   return (
-    <div className="card flex flex-col items-center justify-center">
-      <h3 className="text-xs text-gray-500 uppercase mb-2">Today's Win Rate</h3>
-      <div className="relative" style={{ width: 140, height: 140 }}>
+    <div className="card" style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center' }}>
+      <p className="stat-label" style={{ marginBottom: 12 }}>Today's Win Rate</p>
+      <div style={{ position: 'relative', width: 140, height: 140 }}>
         <ResponsiveContainer width="100%" height="100%">
           <PieChart>
             <Pie data={data} innerRadius={45} outerRadius={65} paddingAngle={2} dataKey="value" startAngle={90} endAngle={-270}>
@@ -308,19 +447,20 @@ function WinRateDonut({ todayWins, todayLosses }) {
             </Pie>
           </PieChart>
         </ResponsiveContainer>
-        <div className="absolute inset-0 flex flex-col items-center justify-center">
-          <span className={`text-2xl font-bold ${Number(wr) >= 50 ? 'text-green-400' : 'text-red-400'}`}>{wr}%</span>
-          <span className="text-[10px] text-gray-500">{total.toLocaleString()} trades</span>
+        <div style={{ position: 'absolute', inset: 0, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center' }}>
+          <span className="mono" style={{ fontSize: 22, fontWeight: 700, color: Number(wr) >= 50 ? 'var(--green)' : 'var(--red)' }}>{wr}%</span>
+          <span style={{ fontSize: 10, color: 'var(--text-muted)', marginTop: 2 }}>{total.toLocaleString()} trades</span>
         </div>
       </div>
-      <div className="flex gap-4 mt-2 text-xs">
-        <span className="text-green-400">{todayWins?.toLocaleString()} W</span>
-        <span className="text-red-400">{todayLosses?.toLocaleString()} L</span>
+      <div style={{ display: 'flex', gap: 16, marginTop: 10 }}>
+        <span style={{ fontSize: 12, color: 'var(--green)', fontWeight: 600 }}>{todayWins?.toLocaleString()} W</span>
+        <span style={{ fontSize: 12, color: 'var(--red)', fontWeight: 600 }}>{todayLosses?.toLocaleString()} L</span>
       </div>
     </div>
   );
 }
 
+/* ══ Main Dashboard ══ */
 export default function Dashboard() {
   const [data, setData] = useState(null);
   const [loading, setLoading] = useState(true);
@@ -339,7 +479,16 @@ export default function Dashboard() {
     setLoading(false);
   }
 
-  if (loading) return <div className="flex items-center justify-center h-64"><div className="animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full" /></div>;
+  if (loading) {
+    return (
+      <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: 256 }}>
+        <div
+          className="w-8 h-8 rounded-full border-2 border-t-transparent animate-spin"
+          style={{ borderColor: 'var(--cyan)', borderTopColor: 'transparent' }}
+        />
+      </div>
+    );
+  }
 
   const d = data || {};
   const pnlData = (d.pnl_history || []).map((p, i) => ({ day: i + 1, pnl: p }));
@@ -348,90 +497,154 @@ export default function Dashboard() {
   const worstStrats = (d.strategies || []).filter(s => s.pnl < 0).slice(-5).reverse();
 
   return (
-    <div className="space-y-6">
-      <div className="flex items-center justify-between">
+    <div className="fade-in" style={{ display: 'flex', flexDirection: 'column', gap: 24 }}>
+
+      {/* ── Page Header ── */}
+      <div style={{ display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between' }}>
         <div>
-          <h1 className="text-2xl font-bold">Dashboard</h1>
-          <p className="text-gray-500 text-sm">Ken event contracts overview</p>
+          <h1 className="heading" style={{ fontSize: 26, fontWeight: 800, color: 'var(--text)', marginBottom: 4, letterSpacing: '-0.025em' }}>
+            Dashboard
+          </h1>
+          <p className="section-subtitle">Ken event contracts overview</p>
         </div>
-        <div className="flex items-center gap-2">
-          <span className={`badge ${d.env === 'prod' ? 'bg-green' : 'bg-yellow'}`}>{(d.env || 'DEMO').toUpperCase()}</span>
-          {d.safe_mode && <span className="badge bg-yellow">SAFE MODE</span>}
+        <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
+          <span
+            className="badge"
+            style={d.env === 'prod'
+              ? { background: 'var(--green-dim)', color: 'var(--green)' }
+              : { background: 'var(--orange-dim)', color: 'var(--orange)' }
+            }
+          >
+            {(d.env || 'DEMO').toUpperCase()}
+          </span>
+          {d.safe_mode && (
+            <span className="badge" style={{ background: 'var(--orange-dim)', color: 'var(--orange)' }}>
+              SAFE MODE
+            </span>
+          )}
         </div>
       </div>
 
-      {/* Stats Grid */}
-      <div className="grid grid-cols-5 gap-4">
+      {/* ── 5 Stat Cards ── */}
+      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(5,1fr)', gap: 14 }}>
         {[
-          { label: 'Balance', value: d.balance ? `$${(d.balance / 100).toLocaleString(undefined, {minimumFractionDigits:2})}` : '—', color: 'text-green-400' },
-          { label: 'Positions', value: d.position_count ?? '—', color: 'text-amber-400' },
-          { label: 'Open Markets', value: d.open_orders ?? '—', color: 'text-blue-400' },
-          { label: 'Today P&L', value: d.daily_pnl ? `$${(d.daily_pnl / 100).toLocaleString(undefined, {minimumFractionDigits:2})}` : '$0.00', color: (d.daily_pnl || 0) >= 0 ? 'text-green-400' : 'text-red-400' },
-          { label: 'Markets Tracked', value: d.markets_tracked ?? '—', color: 'text-purple-400' },
+          {
+            label: 'Balance',
+            value: d.balance ? `$${(d.balance / 100).toLocaleString(undefined, { minimumFractionDigits: 2 })}` : '—',
+            color: 'var(--green)',
+            icon: 'M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z',
+          },
+          {
+            label: 'Positions',
+            value: d.position_count ?? '—',
+            color: 'var(--orange)',
+            icon: 'M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z',
+          },
+          {
+            label: 'Open Markets',
+            value: d.open_orders ?? '—',
+            color: 'var(--blue)',
+            icon: 'M13 7h8m0 0v8m0-8l-8 8-4-4-6 6',
+          },
+          {
+            label: 'Today P&L',
+            value: d.daily_pnl ? `$${(d.daily_pnl / 100).toLocaleString(undefined, { minimumFractionDigits: 2 })}` : '$0.00',
+            color: (d.daily_pnl || 0) >= 0 ? 'var(--green)' : 'var(--red)',
+            icon: 'M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z',
+          },
+          {
+            label: 'Markets Tracked',
+            value: d.markets_tracked ?? '—',
+            color: 'var(--purple)',
+            icon: 'M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9',
+          },
         ].map(s => (
-          <div key={s.label} className="card">
-            <p className="text-xs text-gray-500 uppercase mb-1">{s.label}</p>
-            <p className={`stat-v ${s.color}`}>{s.value}</p>
+          <div key={s.label} className="card" style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
+            <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
+              <span className="stat-label">{s.label}</span>
+              <div
+                style={{
+                  width: 28,
+                  height: 28,
+                  borderRadius: 7,
+                  background: `${s.color}1A`,
+                  display: 'flex',
+                  alignItems: 'center',
+                  justifyContent: 'center',
+                }}
+              >
+                <svg style={{ width: 14, height: 14, color: s.color }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d={s.icon} />
+                </svg>
+              </div>
+            </div>
+            <p className="stat-v" style={{ color: s.color }}>{s.value}</p>
           </div>
         ))}
       </div>
 
-      {/* Seed Money & Economics */}
+      {/* ── Capital & Economics ── */}
       {d.seed_money > 0 && (
-        <div className="card border border-blue-500/20 bg-gradient-to-r from-blue-500/5 via-transparent to-green-500/5">
-          <div className="flex items-center gap-2 mb-3">
-            <span className="text-lg">💰</span>
-            <h2 className="font-semibold">Capital & Economics</h2>
+        <div
+          className="card"
+          style={{
+            border: '1px solid rgba(59,130,246,0.18)',
+            background: 'linear-gradient(135deg, rgba(59,130,246,0.04), var(--surface), rgba(0,195,137,0.04))',
+          }}
+        >
+          <div className="section-title" style={{ marginBottom: 16 }}>
+            <svg style={{ width: 18, height: 18, color: 'var(--cyan)' }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
+            </svg>
+            Capital & Economics
           </div>
-          <div className="grid grid-cols-6 gap-3 text-center">
-            <div>
-              <p className="text-[10px] text-gray-500 uppercase">Seed Money</p>
-              <p className="text-lg font-bold text-blue-400">${(d.seed_money / 100).toLocaleString(undefined, {minimumFractionDigits:0})}</p>
-              <p className="text-[10px] text-gray-600">{d.num_portfolios} portfolios</p>
-            </div>
-            <div>
-              <p className="text-[10px] text-gray-500 uppercase">Current Balance</p>
-              <p className="text-lg font-bold text-green-400">${(d.balance / 100).toLocaleString(undefined, {minimumFractionDigits:0})}</p>
-              <p className="text-[10px] text-gray-600">all portfolios</p>
-            </div>
-            <div>
-              <p className="text-[10px] text-gray-500 uppercase">Net P&L</p>
-              <p className={`text-lg font-bold ${d.net_pnl_from_seed >= 0 ? 'text-green-400' : 'text-red-400'}`}>
-                {d.net_pnl_from_seed >= 0 ? '+' : ''}${(d.net_pnl_from_seed / 100).toLocaleString(undefined, {minimumFractionDigits:0})}
-              </p>
-              <p className={`text-[10px] ${d.roi_pct >= 0 ? 'text-green-500' : 'text-red-500'}`}>{d.roi_pct >= 0 ? '+' : ''}{d.roi_pct}% ROI</p>
-            </div>
-            <div>
-              <p className="text-[10px] text-gray-500 uppercase">Capital Deployed</p>
-              <p className="text-lg font-bold text-amber-400">${(d.total_invested / 100).toLocaleString(undefined, {minimumFractionDigits:0})}</p>
-              <p className="text-[10px] text-gray-600">total traded</p>
-            </div>
-            <div>
-              <p className="text-[10px] text-gray-500 uppercase">Capital at Risk</p>
-              <p className="text-lg font-bold text-red-400">${(d.capital_at_risk / 100).toLocaleString(undefined, {minimumFractionDigits:0})}</p>
-              <p className="text-[10px] text-gray-600">open positions</p>
-            </div>
-            <div>
-              <p className="text-[10px] text-gray-500 uppercase">Daily Budget</p>
-              <p className="text-lg font-bold text-purple-400">${(d.daily_budget / 100).toLocaleString(undefined, {minimumFractionDigits:0})}</p>
-              <p className="text-[10px] text-gray-600">across strategies</p>
-            </div>
+
+          <div style={{ display: 'grid', gridTemplateColumns: 'repeat(6,1fr)', gap: 12, textAlign: 'center' }}>
+            {[
+              { label: 'Seed Money', value: `$${(d.seed_money / 100).toLocaleString(undefined, { minimumFractionDigits: 0 })}`, sub: `${d.num_portfolios} portfolios`, color: 'var(--blue)' },
+              { label: 'Current Balance', value: `$${(d.balance / 100).toLocaleString(undefined, { minimumFractionDigits: 0 })}`, sub: 'all portfolios', color: 'var(--green)' },
+              { label: 'Net P&L', value: `${d.net_pnl_from_seed >= 0 ? '+' : ''}$${(d.net_pnl_from_seed / 100).toLocaleString(undefined, { minimumFractionDigits: 0 })}`, sub: `${d.roi_pct >= 0 ? '+' : ''}${d.roi_pct}% ROI`, color: d.net_pnl_from_seed >= 0 ? 'var(--green)' : 'var(--red)', subColor: d.roi_pct >= 0 ? 'var(--green)' : 'var(--red)' },
+              { label: 'Capital Deployed', value: `$${(d.total_invested / 100).toLocaleString(undefined, { minimumFractionDigits: 0 })}`, sub: 'total traded', color: 'var(--orange)' },
+              { label: 'Capital at Risk', value: `$${(d.capital_at_risk / 100).toLocaleString(undefined, { minimumFractionDigits: 0 })}`, sub: 'open positions', color: 'var(--red)' },
+              { label: 'Daily Budget', value: `$${(d.daily_budget / 100).toLocaleString(undefined, { minimumFractionDigits: 0 })}`, sub: 'across strategies', color: 'var(--purple)' },
+            ].map(stat => (
+              <div key={stat.label}>
+                <p className="stat-label" style={{ marginBottom: 6 }}>{stat.label}</p>
+                <p className="mono" style={{ fontSize: 18, fontWeight: 700, color: stat.color }}>{stat.value}</p>
+                <p style={{ fontSize: 10, color: stat.subColor || 'var(--text-muted)', marginTop: 2 }}>{stat.sub}</p>
+              </div>
+            ))}
           </div>
-          {/* Mini daily spend table */}
+
+          {/* Daily Breakdown — 7-day grid */}
           {d.daily_economics?.length > 0 && (
-            <div className="mt-4 pt-3 border-t border-gray-700/50">
-              <p className="text-[10px] text-gray-500 uppercase mb-2">Daily Breakdown (Last 7 Days)</p>
-              <div className="grid grid-cols-7 gap-1 text-center text-[10px]">
+            <div style={{ marginTop: 18, paddingTop: 14, borderTop: '1px solid var(--border)' }}>
+              <p className="stat-label" style={{ marginBottom: 10 }}>Daily Breakdown (Last 7 Days)</p>
+              <div style={{ display: 'grid', gridTemplateColumns: 'repeat(7,1fr)', gap: 8 }}>
                 {(d.daily_economics || []).slice(0, 7).reverse().map((e, i) => {
                   const dayLabel = new Date(e.day).toLocaleDateString('en-US', { weekday: 'short', month: 'numeric', day: 'numeric', timeZone: 'America/Los_Angeles' });
+                  const isPositive = e.net_pnl >= 0;
                   return (
-                    <div key={i} className="rounded-lg bg-gray-800/40 p-2 border border-gray-700/50">
-                      <p className="text-gray-500 font-medium">{dayLabel}</p>
-                      <p className={`font-bold font-mono ${e.net_pnl >= 0 ? 'text-green-400' : 'text-red-400'}`}>
-                        {e.net_pnl >= 0 ? '+' : ''}${(e.net_pnl / 100).toFixed(0)}
+                    <div
+                      key={i}
+                      style={{
+                        borderRadius: 8,
+                        padding: '10px 8px',
+                        background: isPositive ? 'rgba(0,195,137,0.06)' : 'rgba(255,92,92,0.06)',
+                        border: `1px solid ${isPositive ? 'rgba(0,195,137,0.18)' : 'rgba(255,92,92,0.18)'}`,
+                        textAlign: 'center',
+                      }}
+                    >
+                      <p style={{ fontSize: 10, color: 'var(--text-muted)', fontWeight: 600, marginBottom: 4 }}>{dayLabel}</p>
+                      <p className="mono" style={{ fontSize: 13, fontWeight: 700, color: isPositive ? 'var(--green)' : 'var(--red)', marginBottom: 3 }}>
+                        {isPositive ? '+' : ''}${(e.net_pnl / 100).toFixed(0)}
+                      </p>
+                      <p style={{ fontSize: 10, color: 'var(--text-muted)', marginBottom: 2 }}>{e.trades} trades</p>
+                      <p style={{ fontSize: 10, color: 'var(--text-muted)' }}>
+                        <span style={{ color: 'var(--green)' }}>{e.wins}W</span>
+                        {' / '}
+                        <span style={{ color: 'var(--red)' }}>{e.losses}L</span>
                       </p>
-                      <p className="text-gray-600">{e.trades} trades</p>
-                      <p className="text-gray-600">{e.wins}W / {e.losses}L</p>
                     </div>
                   );
                 })}
@@ -441,68 +654,88 @@ export default function Dashboard() {
         </div>
       )}
 
-      {/* Top 3 Best Opportunities */}
+      {/* ── Best Opportunities ── */}
       <TopOpportunities opportunities={d.top_opportunities} />
 
-      {/* Daily Lessons Box */}
-      <div className="card border border-amber-500/20 bg-gradient-to-r from-amber-500/5 to-transparent">
-        <div className="flex items-center gap-2 mb-3">
-          <span className="text-lg">📊</span>
-          <h2 className="font-semibold">Today's Lessons</h2>
-          <span className="ml-auto text-xs text-gray-500">{new Date().toLocaleDateString('en-US', { weekday: 'long', month: 'short', day: 'numeric' })}</span>
-        </div>
-        <div className="grid grid-cols-4 gap-4 text-center">
-          <div>
-            <p className="text-[10px] text-gray-500 uppercase">Trades Resolved</p>
-            <p className="text-xl font-bold text-amber-400">{(d.today_trades || 0).toLocaleString()}</p>
-          </div>
-          <div>
-            <p className="text-[10px] text-gray-500 uppercase">Wins / Losses</p>
-            <p className="text-xl font-bold">
-              <span className="text-green-400">{d.today_wins || 0}</span>
-              <span className="text-gray-600 mx-1">/</span>
-              <span className="text-red-400">{d.today_losses || 0}</span>
-            </p>
-          </div>
-          <div>
-            <p className="text-[10px] text-gray-500 uppercase">Win Rate</p>
-            <p className={`text-xl font-bold ${Number(todayWinRate) >= 50 ? 'text-green-400' : 'text-red-400'}`}>{todayWinRate}%</p>
-          </div>
-          <div>
-            <p className="text-[10px] text-gray-500 uppercase">Day P&L</p>
-            <p className={`text-xl font-bold ${(d.daily_pnl || 0) >= 0 ? 'text-green-400' : 'text-red-400'}`}>
-              {(d.daily_pnl || 0) >= 0 ? '+' : ''}${((d.daily_pnl || 0) / 100).toLocaleString(undefined, {minimumFractionDigits:2})}
-            </p>
+      {/* ── Today's Lessons ── */}
+      <div
+        className="card"
+        style={{
+          border: '1px solid rgba(247,147,26,0.18)',
+          background: 'linear-gradient(135deg, rgba(247,147,26,0.04), var(--surface))',
+        }}
+      >
+        <div style={{ display: 'flex', alignItems: 'center', marginBottom: 14 }}>
+          <div className="section-title">
+            <svg style={{ width: 18, height: 18, color: 'var(--orange)' }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
+            </svg>
+            Today's Lessons
           </div>
+          <span style={{ marginLeft: 'auto', fontSize: 12, color: 'var(--text-muted)' }}>
+            {new Date().toLocaleDateString('en-US', { weekday: 'long', month: 'short', day: 'numeric' })}
+          </span>
         </div>
-      </div>
 
-      {/* Dynamic Strategy Graphics */}
-      <div className="grid grid-cols-3 gap-4">
-        <div className="col-span-2">
-          <StrategyFlowDiagram topMarkets={d.top_markets} seedMoney={d.seed_money} balance={d.balance} />
+        <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4,1fr)', gap: 16, textAlign: 'center' }}>
+          {[
+            { label: 'Trades Resolved', value: (d.today_trades || 0).toLocaleString(), color: 'var(--orange)' },
+            {
+              label: 'Wins / Losses',
+              value: (
+                <span>
+                  <span style={{ color: 'var(--green)' }}>{d.today_wins || 0}</span>
+                  <span style={{ color: 'var(--border-light)', margin: '0 4px' }}>/</span>
+                  <span style={{ color: 'var(--red)' }}>{d.today_losses || 0}</span>
+                </span>
+              ),
+              color: null,
+            },
+            { label: 'Win Rate', value: `${todayWinRate}%`, color: Number(todayWinRate) >= 50 ? 'var(--green)' : 'var(--red)' },
+            {
+              label: 'Day P&L',
+              value: `${(d.daily_pnl || 0) >= 0 ? '+' : ''}$${((d.daily_pnl || 0) / 100).toLocaleString(undefined, { minimumFractionDigits: 2 })}`,
+              color: (d.daily_pnl || 0) >= 0 ? 'var(--green)' : 'var(--red)',
+            },
+          ].map((s, i) => (
+            <div key={i}>
+              <p className="stat-label" style={{ marginBottom: 6 }}>{s.label}</p>
+              {typeof s.value === 'string' ? (
+                <p className="mono" style={{ fontSize: 22, fontWeight: 700, color: s.color }}>{s.value}</p>
+              ) : (
+                <p className="mono" style={{ fontSize: 22, fontWeight: 700 }}>{s.value}</p>
+              )}
+            </div>
+          ))}
         </div>
+      </div>
+
+      {/* ── Strategy Flow + Win Rate Donut ── */}
+      <div style={{ display: 'grid', gridTemplateColumns: '2fr 1fr', gap: 16 }}>
+        <StrategyFlowDiagram topMarkets={d.top_markets} seedMoney={d.seed_money} balance={d.balance} />
         <WinRateDonut todayWins={d.today_wins} todayLosses={d.today_losses} />
       </div>
 
-      {/* What To Do Next */}
+      {/* ── What To Do Next ── */}
       <NextActions topMarkets={d.top_markets} worstMarkets={d.worst_markets} strategies={d.strategies} />
 
-      {/* Top Markets Table */}
+      {/* ── Top Markets Table ── */}
       {(d.top_markets || []).length > 0 && (
         <div className="card">
-          <div className="flex items-center gap-2 mb-3">
-            <span className="text-lg">🏆</span>
-            <h2 className="font-semibold">Top Markets — Money Makers</h2>
+          <div className="section-title" style={{ marginBottom: 14 }}>
+            <svg style={{ width: 18, height: 18, color: 'var(--green)' }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M5 3l14 9-14 9V3z" />
+            </svg>
+            Top Markets — Money Makers
           </div>
-          <div className="overflow-x-auto">
+          <div style={{ overflowX: 'auto' }}>
             <table>
               <thead>
                 <tr>
-                  <th className="text-left">Market</th>
-                  <th className="text-right">Trades</th>
-                  <th className="text-right">Wins</th>
-                  <th className="text-right">P&L</th>
+                  <th style={{ textAlign: 'left' }}>Market</th>
+                  <th style={{ textAlign: 'right' }}>Trades</th>
+                  <th style={{ textAlign: 'right' }}>Wins</th>
+                  <th style={{ textAlign: 'right' }}>P&L</th>
                   <th>Edge</th>
                   <th>Signal</th>
                 </tr>
@@ -510,20 +743,44 @@ export default function Dashboard() {
               <tbody>
                 {(d.top_markets || []).map((m, i) => (
                   <tr key={i}>
-                    <td className="max-w-[300px]">
-                      <div className="flex items-center gap-1">
-                        <Link to={`/positions?market=${encodeURIComponent(m.ticker)}`} className="text-sm text-gray-200 hover:text-amber-400 transition truncate block">
+                    <td style={{ maxWidth: 300 }}>
+                      <div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
+                        <Link
+                          to={`/positions?market=${encodeURIComponent(m.ticker)}`}
+                          style={{
+                            fontSize: 13,
+                            color: 'var(--text)',
+                            textDecoration: 'none',
+                            display: 'block',
+                            overflow: 'hidden',
+                            textOverflow: 'ellipsis',
+                            whiteSpace: 'nowrap',
+                            transition: 'color 150ms',
+                          }}
+                          onMouseEnter={e => { e.currentTarget.style.color = 'var(--cyan)'; }}
+                          onMouseLeave={e => { e.currentTarget.style.color = 'var(--text)'; }}
+                        >
                           {m.title}
                         </Link>
-                        <a href={`https://kalshi.com/search?query=${encodeURIComponent(m.title?.split('?')[0] || m.ticker)}`} target="_blank" rel="noopener noreferrer" className="text-gray-600 hover:text-amber-400 flex-shrink-0" title="Search on Kalshi">↗</a>
+                        <a
+                          href={`https://kalshi.com/search?query=${encodeURIComponent(m.title?.split('?')[0] || m.ticker)}`}
+                          target="_blank"
+                          rel="noopener noreferrer"
+                          style={{ color: 'var(--text-muted)', flexShrink: 0, textDecoration: 'none', fontSize: 13 }}
+                          onMouseEnter={e => { e.currentTarget.style.color = 'var(--cyan)'; }}
+                          onMouseLeave={e => { e.currentTarget.style.color = 'var(--text-muted)'; }}
+                          title="View on Kalshi"
+                        >
+                          ↗
+                        </a>
                       </div>
-                      <span className="text-[10px] font-mono text-gray-600">{m.ticker}</span>
+                      <span className="mono" style={{ fontSize: 10, color: 'var(--text-muted)' }}>{m.ticker}</span>
                     </td>
-                    <td className="text-right font-mono text-sm text-gray-400">{m.trades}</td>
-                    <td className="text-right text-sm"><WinRate wins={m.wins} losses={m.losses} /></td>
-                    <td className="text-right text-sm"><PnlBadge cents={m.pnl} /></td>
-                    <td className="text-xs text-gray-400 whitespace-nowrap">{m.edge}</td>
-                    <td className="text-center"><HoldsIndicator wins={m.wins} losses={m.losses} pnl={m.pnl} /></td>
+                    <td style={{ textAlign: 'right' }} className="mono"><span style={{ fontSize: 13, color: 'var(--text-dim)' }}>{m.trades}</span></td>
+                    <td style={{ textAlign: 'right', fontSize: 13 }}><WinRate wins={m.wins} losses={m.losses} /></td>
+                    <td style={{ textAlign: 'right', fontSize: 13 }}><PnlBadge cents={m.pnl} /></td>
+                    <td style={{ fontSize: 12, color: 'var(--text-muted)', whiteSpace: 'nowrap' }}>{m.edge}</td>
+                    <td style={{ textAlign: 'center' }}><HoldsIndicator wins={m.wins} losses={m.losses} pnl={m.pnl} /></td>
                   </tr>
                 ))}
               </tbody>
@@ -532,21 +789,23 @@ export default function Dashboard() {
         </div>
       )}
 
-      {/* Worst Markets */}
+      {/* ── Worst Markets Table ── */}
       {(d.worst_markets || []).length > 0 && (
-        <div className="card border border-red-500/10">
-          <div className="flex items-center gap-2 mb-3">
-            <span className="text-lg">⚠️</span>
-            <h2 className="font-semibold text-red-400">Bleeding Markets — Consider Exiting</h2>
+        <div className="card" style={{ border: '1px solid rgba(255,92,92,0.12)' }}>
+          <div className="section-title" style={{ marginBottom: 14, color: 'var(--red)' }}>
+            <svg style={{ width: 18, height: 18 }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
+            </svg>
+            Bleeding Markets — Consider Exiting
           </div>
-          <div className="overflow-x-auto">
+          <div style={{ overflowX: 'auto' }}>
             <table>
               <thead>
                 <tr>
-                  <th className="text-left">Market</th>
-                  <th className="text-right">Trades</th>
-                  <th className="text-right">Wins</th>
-                  <th className="text-right">P&L</th>
+                  <th style={{ textAlign: 'left' }}>Market</th>
+                  <th style={{ textAlign: 'right' }}>Trades</th>
+                  <th style={{ textAlign: 'right' }}>Wins</th>
+                  <th style={{ textAlign: 'right' }}>P&L</th>
                   <th>Edge</th>
                   <th>Signal</th>
                 </tr>
@@ -554,20 +813,35 @@ export default function Dashboard() {
               <tbody>
                 {(d.worst_markets || []).map((m, i) => (
                   <tr key={i}>
-                    <td className="max-w-[300px]">
-                      <div className="flex items-center gap-1">
-                        <Link to={`/positions?market=${encodeURIComponent(m.ticker)}`} className="text-sm text-gray-200 hover:text-red-400 transition truncate block">
+                    <td style={{ maxWidth: 300 }}>
+                      <div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
+                        <Link
+                          to={`/positions?market=${encodeURIComponent(m.ticker)}`}
+                          style={{ fontSize: 13, color: 'var(--text)', textDecoration: 'none', display: 'block', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', transition: 'color 150ms' }}
+                          onMouseEnter={e => { e.currentTarget.style.color = 'var(--red)'; }}
+                          onMouseLeave={e => { e.currentTarget.style.color = 'var(--text)'; }}
+                        >
                           {m.title}
                         </Link>
-                        <a href={`https://kalshi.com/search?query=${encodeURIComponent(m.title?.split('?')[0] || m.ticker)}`} target="_blank" rel="noopener noreferrer" className="text-gray-600 hover:text-red-400 flex-shrink-0" title="Search on Kalshi">↗</a>
+                        <a
+                          href={`https://kalshi.com/search?query=${encodeURIComponent(m.title?.split('?')[0] || m.ticker)}`}
+                          target="_blank"
+                          rel="noopener noreferrer"
+                          style={{ color: 'var(--text-muted)', flexShrink: 0, textDecoration: 'none', fontSize: 13 }}
+                          onMouseEnter={e => { e.currentTarget.style.color = 'var(--red)'; }}
+                          onMouseLeave={e => { e.currentTarget.style.color = 'var(--text-muted)'; }}
+                          title="View on Kalshi"
+                        >
+                          ↗
+                        </a>
                       </div>
-                      <span className="text-[10px] font-mono text-gray-600">{m.ticker}</span>
+                      <span className="mono" style={{ fontSize: 10, color: 'var(--text-muted)' }}>{m.ticker}</span>
                     </td>
-                    <td className="text-right font-mono text-sm text-gray-400">{m.trades}</td>
-                    <td className="text-right text-sm"><WinRate wins={m.wins} losses={m.losses} /></td>
-                    <td className="text-right text-sm"><PnlBadge cents={m.pnl} /></td>
-                    <td className="text-xs text-gray-400 whitespace-nowrap">{m.edge}</td>
-                    <td className="text-center"><HoldsIndicator wins={m.wins} losses={m.losses} pnl={m.pnl} /></td>
+                    <td style={{ textAlign: 'right' }} className="mono"><span style={{ fontSize: 13, color: 'var(--text-dim)' }}>{m.trades}</span></td>
+                    <td style={{ textAlign: 'right', fontSize: 13 }}><WinRate wins={m.wins} losses={m.losses} /></td>
+                    <td style={{ textAlign: 'right', fontSize: 13 }}><PnlBadge cents={m.pnl} /></td>
+                    <td style={{ fontSize: 12, color: 'var(--text-muted)', whiteSpace: 'nowrap' }}>{m.edge}</td>
+                    <td style={{ textAlign: 'center' }}><HoldsIndicator wins={m.wins} losses={m.losses} pnl={m.pnl} /></td>
                   </tr>
                 ))}
               </tbody>
@@ -576,114 +850,201 @@ export default function Dashboard() {
         </div>
       )}
 
-      {/* P&L Chart */}
+      {/* ── P&L History Chart ── */}
       {pnlData.length > 0 && (
         <div className="card">
-          <h2 className="font-semibold mb-3">P&L History (Daily)</h2>
+          <div className="section-title" style={{ marginBottom: 14 }}>
+            <svg style={{ width: 18, height: 18, color: 'var(--cyan)' }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z" />
+            </svg>
+            P&L History (Daily)
+          </div>
           <ResponsiveContainer width="100%" height={200}>
             <AreaChart data={pnlData}>
-              <CartesianGrid strokeDasharray="3 3" stroke="#1f2937" />
-              <XAxis dataKey="day" stroke="#6b7280" />
-              <YAxis stroke="#6b7280" tickFormatter={v => `$${v}`} />
-              <Tooltip contentStyle={{ background: '#1f2937', border: '1px solid #374151', borderRadius: 8 }} />
-              <Area type="monotone" dataKey="pnl" stroke="#f59e0b" fill="#f59e0b" fillOpacity={0.1} />
+              <defs>
+                <linearGradient id="pnlGrad" x1="0" y1="0" x2="0" y2="1">
+                  <stop offset="5%" stopColor="#00F0FF" stopOpacity={0.2} />
+                  <stop offset="95%" stopColor="#00F0FF" stopOpacity={0} />
+                </linearGradient>
+              </defs>
+              <CartesianGrid strokeDasharray="3 3" stroke="var(--border)" />
+              <XAxis dataKey="day" stroke="var(--text-muted)" tick={{ fill: 'var(--text-muted)', fontSize: 11 }} />
+              <YAxis stroke="var(--text-muted)" tick={{ fill: 'var(--text-muted)', fontSize: 11 }} tickFormatter={v => `$${v}`} />
+              <Tooltip
+                contentStyle={{ background: 'var(--surface-el)', border: '1px solid var(--border)', borderRadius: 8, color: 'var(--text)' }}
+              />
+              <Area type="monotone" dataKey="pnl" stroke="var(--cyan)" strokeWidth={2} fill="url(#pnlGrad)" />
             </AreaChart>
           </ResponsiveContainer>
         </div>
       )}
 
-      {/* Strategy P&L Bar Chart */}
+      {/* ── Strategy P&L Bar Chart ── */}
       <StrategyBars strategies={d.strategies} />
 
-      {/* Strategy Leaderboard */}
-      <div className="grid grid-cols-2 gap-4">
+      {/* ── Strategy Leaderboard ── */}
+      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 16 }}>
         {/* Top Strategies */}
         <div className="card">
-          <div className="flex items-center gap-2 mb-3">
-            <span className="text-lg">🥇</span>
-            <h2 className="font-semibold">Top Strategies</h2>
+          <div className="section-title" style={{ marginBottom: 12 }}>
+            <svg style={{ width: 18, height: 18, color: 'var(--green)' }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M5 3l14 9-14 9V3z" />
+            </svg>
+            Top Strategies
           </div>
-          <div className="space-y-2">
+          <div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
             {topStrats.map((s, i) => (
-              <div key={i} className="flex items-center justify-between py-1.5 border-b border-gray-800 last:border-0">
+              <div
+                key={i}
+                style={{
+                  display: 'flex',
+                  alignItems: 'center',
+                  justifyContent: 'space-between',
+                  padding: '8px 0',
+                  borderBottom: i < topStrats.length - 1 ? '1px solid var(--border)' : 'none',
+                }}
+              >
                 <div>
-                  <span className="text-sm font-medium text-gray-200">{s.name}</span>
-                  <span className="ml-2 text-[10px] text-gray-600">{s.strategy}</span>
+                  <span style={{ fontSize: 13, fontWeight: 500, color: 'var(--text)' }}>{s.name}</span>
+                  <span style={{ marginLeft: 8, fontSize: 10, color: 'var(--text-muted)' }}>{s.strategy}</span>
                 </div>
-                <div className="flex items-center gap-3">
-                  <span className="text-xs text-gray-500">{s.win_rate}% WR</span>
+                <div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
+                  <span style={{ fontSize: 11, color: 'var(--text-muted)' }}>{s.win_rate}% WR</span>
                   <PnlBadge cents={s.pnl} />
                 </div>
               </div>
             ))}
-            {topStrats.length === 0 && <p className="text-gray-600 text-sm text-center py-4">No profitable strategies yet</p>}
+            {topStrats.length === 0 && (
+              <p style={{ color: 'var(--text-muted)', fontSize: 13, textAlign: 'center', padding: '16px 0' }}>No profitable strategies yet</p>
+            )}
           </div>
         </div>
 
         {/* Worst Strategies */}
         <div className="card">
-          <div className="flex items-center gap-2 mb-3">
-            <span className="text-lg">📉</span>
-            <h2 className="font-semibold">Losing Strategies</h2>
+          <div className="section-title" style={{ marginBottom: 12 }}>
+            <svg style={{ width: 18, height: 18, color: 'var(--red)' }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M13 17h8m0 0V9m0 8l-8-8-4 4-6-6" />
+            </svg>
+            Losing Strategies
           </div>
-          <div className="space-y-2">
+          <div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
             {worstStrats.map((s, i) => (
-              <div key={i} className="flex items-center justify-between py-1.5 border-b border-gray-800 last:border-0">
+              <div
+                key={i}
+                style={{
+                  display: 'flex',
+                  alignItems: 'center',
+                  justifyContent: 'space-between',
+                  padding: '8px 0',
+                  borderBottom: i < worstStrats.length - 1 ? '1px solid var(--border)' : 'none',
+                }}
+              >
                 <div>
-                  <span className="text-sm font-medium text-gray-300">{s.name}</span>
-                  <span className="ml-2 text-[10px] text-gray-600">{s.strategy}</span>
+                  <span style={{ fontSize: 13, fontWeight: 500, color: 'var(--text-dim)' }}>{s.name}</span>
+                  <span style={{ marginLeft: 8, fontSize: 10, color: 'var(--text-muted)' }}>{s.strategy}</span>
                 </div>
-                <div className="flex items-center gap-3">
-                  <span className="text-xs text-gray-500">{s.win_rate}% WR</span>
+                <div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
+                  <span style={{ fontSize: 11, color: 'var(--text-muted)' }}>{s.win_rate}% WR</span>
                   <PnlBadge cents={s.pnl} />
                 </div>
               </div>
             ))}
-            {worstStrats.length === 0 && <p className="text-gray-600 text-sm text-center py-4">No losing strategies</p>}
+            {worstStrats.length === 0 && (
+              <p style={{ color: 'var(--text-muted)', fontSize: 13, textAlign: 'center', padding: '16px 0' }}>No losing strategies</p>
+            )}
           </div>
         </div>
       </div>
 
-      {/* Recent Fills + Quick Actions */}
-      <div className="grid grid-cols-2 gap-4">
+      {/* ── Recent Fills + Quick Actions ── */}
+      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 16 }}>
+        {/* Recent Fills */}
         <div className="card">
-          <h2 className="font-semibold mb-3">Recent Fills</h2>
+          <div className="section-title" style={{ marginBottom: 12 }}>
+            <svg style={{ width: 18, height: 18, color: 'var(--cyan)' }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
+            </svg>
+            Recent Fills
+          </div>
           {(d.recent_fills || []).length > 0 ? (
-            <div className="space-y-2">
+            <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
               {(d.recent_fills || []).slice(0, 5).map((f, i) => (
-                <div key={i} className="flex items-center justify-between text-sm">
-                  <div>
-                    <span className="font-mono text-xs text-gray-400">{f.ticker}</span>
-                    <span className={`ml-2 badge ${f.side === 'yes' ? 'bg-green' : 'bg-red'}`}>{f.side?.toUpperCase()}</span>
+                <div key={i} style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', fontSize: 13 }}>
+                  <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
+                    <span className="mono" style={{ fontSize: 11, color: 'var(--text-muted)' }}>{f.ticker}</span>
+                    <span
+                      className="badge"
+                      style={f.side === 'yes'
+                        ? { background: 'var(--green-dim)', color: 'var(--green)' }
+                        : { background: 'var(--red-dim)', color: 'var(--red)' }
+                      }
+                    >
+                      {f.side?.toUpperCase()}
+                    </span>
                   </div>
-                  <span className="font-mono text-gray-300">{f.count}@{f.yes_price}c</span>
+                  <span className="mono" style={{ color: 'var(--text-dim)', fontSize: 12 }}>{f.count}@{f.yes_price}c</span>
                 </div>
               ))}
             </div>
-          ) : <p className="text-gray-600 text-sm text-center py-6">No recent fills</p>}
+          ) : (
+            <p style={{ color: 'var(--text-muted)', fontSize: 13, textAlign: 'center', padding: '24px 0' }}>No recent fills</p>
+          )}
         </div>
 
+        {/* Quick Actions */}
         <div className="card">
-          <h2 className="font-semibold mb-3">Quick Actions</h2>
-          <div className="space-y-2">
-            <Link to="/markets" className="flex items-center gap-3 p-3 rounded-lg bg-gray-800/30 hover:bg-gray-800/60 transition">
-              <div className="w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center">
-                <svg className="w-4 h-4 text-amber-400" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" /></svg>
-              </div>
-              <div><p className="text-sm font-medium">Browse Markets</p><p className="text-xs text-gray-500">Find weather contracts</p></div>
-            </Link>
-            <Link to="/positions" className="flex items-center gap-3 p-3 rounded-lg bg-gray-800/30 hover:bg-gray-800/60 transition">
-              <div className="w-8 h-8 rounded-lg bg-green-500/10 flex items-center justify-center">
-                <svg className="w-4 h-4 text-green-400" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" /></svg>
-              </div>
-              <div><p className="text-sm font-medium">View Positions</p><p className="text-xs text-gray-500">Current portfolio</p></div>
-            </Link>
-            <Link to="/settings" className="flex items-center gap-3 p-3 rounded-lg bg-gray-800/30 hover:bg-gray-800/60 transition">
-              <div className="w-8 h-8 rounded-lg bg-blue-500/10 flex items-center justify-center">
-                <svg className="w-4 h-4 text-blue-400" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" /><path strokeLinecap="round" strokeLinejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /></svg>
-              </div>
-              <div><p className="text-sm font-medium">Scan Config</p><p className="text-xs text-gray-500">Intervals & risk params</p></div>
-            </Link>
+          <div className="section-title" style={{ marginBottom: 12 }}>
+            <svg style={{ width: 18, height: 18, color: 'var(--cyan)' }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
+              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.8" d="M13 10V3L4 14h7v7l9-11h-7z" />
+            </svg>
+            Quick Actions
+          </div>
+          <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
+            {[
+              { to: '/markets', icon: 'M13 7h8m0 0v8m0-8l-8 8-4-4-6 6', iconColor: 'var(--orange)', label: 'Browse Markets', sub: 'Find weather contracts' },
+              { to: '/positions', icon: 'M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z', iconColor: 'var(--green)', label: 'View Positions', sub: 'Current portfolio' },
+              { to: '/settings', icon: 'M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z', iconColor: 'var(--blue)', label: 'Scan Config', sub: 'Intervals & risk params' },
+            ].map(action => (
+              <Link
+                key={action.to}
+                to={action.to}
+                style={{
+                  display: 'flex',
+                  alignItems: 'center',
+                  gap: 12,
+                  padding: '10px 12px',
+                  borderRadius: 8,
+                  background: 'var(--surface-el)',
+                  border: '1px solid var(--border)',
+                  textDecoration: 'none',
+                  transition: 'all 150ms ease',
+                }}
+                onMouseEnter={e => { e.currentTarget.style.borderColor = 'var(--cyan)'; e.currentTarget.style.background = 'rgba(0,240,255,0.04)'; }}
+                onMouseLeave={e => { e.currentTarget.style.borderColor = 'var(--border)'; e.currentTarget.style.background = 'var(--surface-el)'; }}
+              >
+                <div
+                  style={{
+                    width: 32,
+                    height: 32,
+                    borderRadius: 8,
+                    background: `${action.iconColor}1A`,
+                    display: 'flex',
+                    alignItems: 'center',
+                    justifyContent: 'center',
+                    flexShrink: 0,
+                  }}
+                >
+                  <svg style={{ width: 15, height: 15, color: action.iconColor }} fill="none" stroke="currentColor" strokeWidth="1.8" viewBox="0 0 24 24">
+                    <path strokeLinecap="round" strokeLinejoin="round" d={action.icon} />
+                  </svg>
+                </div>
+                <div>
+                  <p style={{ fontSize: 13, fontWeight: 500, color: 'var(--text)', marginBottom: 1 }}>{action.label}</p>
+                  <p style={{ fontSize: 11, color: 'var(--text-muted)' }}>{action.sub}</p>
+                </div>
+              </Link>
+            ))}
           </div>
         </div>
       </div>
diff --git a/kalshi-dash/src/pages/Heatmap.jsx b/kalshi-dash/src/pages/Heatmap.jsx
index 8260bd2..2273027 100644
--- a/kalshi-dash/src/pages/Heatmap.jsx
+++ b/kalshi-dash/src/pages/Heatmap.jsx
@@ -41,15 +41,15 @@ const CATEGORY_MAP = {
 };
 
 const CATEGORY_COLORS = {
-  'Politics':  { bg: '#3b82f6', glow: 'rgba(59,130,246,0.3)', gradient: 'from-blue-500/20 to-blue-600/10' },
-  'Economy':   { bg: '#22c55e', glow: 'rgba(34,197,94,0.3)', gradient: 'from-green-500/20 to-green-600/10' },
-  'Weather':   { bg: '#06b6d4', glow: 'rgba(6,182,212,0.3)', gradient: 'from-cyan-500/20 to-cyan-600/10' },
-  'Crypto':    { bg: '#f59e0b', glow: 'rgba(245,158,11,0.3)', gradient: 'from-amber-500/20 to-amber-600/10' },
-  'Sports':    { bg: '#a855f7', glow: 'rgba(168,85,247,0.3)', gradient: 'from-purple-500/20 to-purple-600/10' },
-  'Tech':      { bg: '#ec4899', glow: 'rgba(236,72,153,0.3)', gradient: 'from-pink-500/20 to-pink-600/10' },
-  'Culture':   { bg: '#f97316', glow: 'rgba(249,115,22,0.3)', gradient: 'from-orange-500/20 to-orange-600/10' },
-  'Energy':    { bg: '#eab308', glow: 'rgba(234,179,8,0.3)', gradient: 'from-yellow-500/20 to-yellow-600/10' },
-  'Other':     { bg: '#64748b', glow: 'rgba(100,116,139,0.3)', gradient: 'from-slate-500/20 to-slate-600/10' },
+  'Politics':  { bg: 'var(--blue)',   glow: 'rgba(59,130,246,0.3)',   hex: '#3B82F6' },
+  'Economy':   { bg: 'var(--green)',  glow: 'rgba(0,195,137,0.3)',    hex: '#00C389' },
+  'Weather':   { bg: 'var(--cyan)',   glow: 'rgba(0,240,255,0.3)',    hex: '#00F0FF' },
+  'Crypto':    { bg: 'var(--orange)', glow: 'rgba(247,147,26,0.3)',   hex: '#F7931A' },
+  'Sports':    { bg: 'var(--purple)', glow: 'rgba(168,85,247,0.3)',   hex: '#A855F7' },
+  'Tech':      { bg: 'var(--cyan)',   glow: 'rgba(0,240,255,0.3)',    hex: '#00F0FF' },
+  'Culture':   { bg: 'var(--orange)', glow: 'rgba(247,147,26,0.3)',  hex: '#F7931A' },
+  'Energy':    { bg: 'var(--orange)', glow: 'rgba(247,147,26,0.3)',  hex: '#F7931A' },
+  'Other':     { bg: 'var(--text-muted)', glow: 'rgba(107,114,128,0.3)', hex: '#6B7280' },
 };
 
 function classifyMarket(title) {
@@ -61,25 +61,25 @@ function classifyMarket(title) {
 }
 
 function getPnlColor(pnl) {
-  if (pnl > 50000) return '#22c55e';
+  if (pnl > 50000) return 'var(--green)';
   if (pnl > 10000) return '#4ade80';
-  if (pnl > 1000) return '#86efac';
-  if (pnl > 0) return '#bbf7d0';
-  if (pnl === 0) return '#475569';
+  if (pnl > 1000)  return '#86efac';
+  if (pnl > 0)     return '#bbf7d0';
+  if (pnl === 0)   return 'var(--text-muted)';
   if (pnl > -1000) return '#fecaca';
   if (pnl > -10000) return '#f87171';
-  return '#ef4444';
+  return 'var(--red)';
 }
 
 function getPnlBg(pnl) {
-  if (pnl > 50000) return 'rgba(34,197,94,0.35)';
-  if (pnl > 10000) return 'rgba(34,197,94,0.25)';
-  if (pnl > 1000) return 'rgba(34,197,94,0.15)';
-  if (pnl > 0) return 'rgba(34,197,94,0.08)';
-  if (pnl === 0) return 'rgba(100,116,139,0.15)';
-  if (pnl > -1000) return 'rgba(239,68,68,0.08)';
-  if (pnl > -10000) return 'rgba(239,68,68,0.15)';
-  return 'rgba(239,68,68,0.30)';
+  if (pnl > 50000)  return 'rgba(0,195,137,0.35)';
+  if (pnl > 10000)  return 'rgba(0,195,137,0.25)';
+  if (pnl > 1000)   return 'rgba(0,195,137,0.15)';
+  if (pnl > 0)      return 'rgba(0,195,137,0.08)';
+  if (pnl === 0)    return 'rgba(107,114,128,0.15)';
+  if (pnl > -1000)  return 'rgba(255,92,92,0.08)';
+  if (pnl > -10000) return 'rgba(255,92,92,0.15)';
+  return 'rgba(255,92,92,0.30)';
 }
 
 // ── Treemap Layout Algorithm ──
@@ -109,14 +109,12 @@ function squarify(items, x, y, w, h) {
   const ratio = leftSize / total;
 
   if (w >= h) {
-    // Split vertically
     const leftW = w * ratio;
     return [
       ...squarify(left, x, y, leftW, h),
       ...squarify(right, x + leftW, y, w - leftW, h),
     ];
   } else {
-    // Split horizontally
     const leftH = h * ratio;
     return [
       ...squarify(left, x, y, w, leftH),
@@ -135,34 +133,44 @@ function MarketTile({ item, onClick, isSelected }) {
   return (
     <div
       onClick={() => onClick(item)}
-      className="absolute cursor-pointer transition-all duration-300 overflow-hidden group"
+      className="absolute cursor-pointer overflow-hidden group"
       style={{
         left: item.x,
         top: item.y,
         width: item.w,
         height: item.h,
         backgroundColor: getPnlBg(item.pnl),
-        border: isSelected ? '2px solid #f59e0b' : '1px solid rgba(30,41,59,0.8)',
+        border: isSelected
+          ? '2px solid var(--cyan)'
+          : '1px solid var(--border)',
         borderRadius: 6,
         zIndex: isSelected ? 10 : 1,
+        transition: 'all 150ms ease',
       }}
     >
-      {/* Glow effect on hover */}
-      <div className="absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-200"
-        style={{ background: `radial-gradient(circle at center, ${getPnlBg(item.pnl)}, transparent)` }} />
+      {/* Hover glow */}
+      <div
+        className="absolute inset-0 opacity-0 group-hover:opacity-100 pointer-events-none"
+        style={{
+          background: `radial-gradient(circle at center, ${getPnlBg(item.pnl)}, transparent)`,
+          transition: 'opacity 200ms ease',
+        }}
+      />
 
       <div className="relative h-full p-1.5 flex flex-col justify-between z-10">
         {!isTiny && (
           <>
-            <div className="truncate text-[10px] font-medium text-gray-200 leading-tight">
+            <div className="truncate text-[10px] font-medium leading-tight" style={{ color: 'var(--text-dim)' }}>
               {item.shortTitle}
             </div>
             <div className="flex items-end justify-between mt-auto">
-              <span className="font-mono font-bold text-xs" style={{ color: getPnlColor(item.pnl) }}>
+              <span className="mono font-bold text-xs" style={{ color: getPnlColor(item.pnl) }}>
                 {item.pnl >= 0 ? '+' : ''}{pnlDollars > 999 ? `$${(item.pnl / 100 / 1000).toFixed(1)}k` : `$${pnlDollars}`}
               </span>
               {!isSmall && (
-                <span className={`text-[9px] font-bold ${Number(winRate) >= 80 ? 'text-green-400' : Number(winRate) >= 50 ? 'text-amber-400' : 'text-red-400'}`}>
+                <span className="text-[9px] font-bold mono" style={{
+                  color: Number(winRate) >= 80 ? 'var(--green)' : Number(winRate) >= 50 ? 'var(--orange)' : 'var(--red)',
+                }}>
                   {winRate}%
                 </span>
               )}
@@ -171,7 +179,7 @@ function MarketTile({ item, onClick, isSelected }) {
         )}
         {isTiny && (
           <div className="flex items-center justify-center h-full">
-            <span className="font-mono font-bold text-[10px]" style={{ color: getPnlColor(item.pnl) }}>
+            <span className="mono font-bold text-[10px]" style={{ color: getPnlColor(item.pnl) }}>
               {item.pnl >= 0 ? '+' : ''}{(item.pnl / 100).toFixed(0)}
             </span>
           </div>
@@ -198,7 +206,7 @@ function CategoryBlock({ category, items, x, y, w, h, onTileClick, selectedTicke
         width: w,
         height: h,
         borderRadius: 8,
-        border: `1px solid ${catColor.bg}40`,
+        border: `1px solid ${catColor.hex}40`,
       }}
     >
       {/* Category Header */}
@@ -206,14 +214,14 @@ function CategoryBlock({ category, items, x, y, w, h, onTileClick, selectedTicke
         className="flex items-center justify-between px-2 relative z-20"
         style={{
           height: headerH,
-          background: `linear-gradient(135deg, ${catColor.bg}30, ${catColor.bg}10)`,
-          borderBottom: `1px solid ${catColor.bg}40`,
+          background: `linear-gradient(135deg, ${catColor.hex}25, ${catColor.hex}0D)`,
+          borderBottom: `1px solid ${catColor.hex}40`,
         }}
       >
-        <span className="text-xs font-bold tracking-wide" style={{ color: catColor.bg }}>
+        <span className="text-xs font-bold tracking-wide heading" style={{ color: catColor.hex }}>
           {category}
         </span>
-        <span className="text-[10px] font-mono" style={{ color: totalPnl >= 0 ? '#22c55e' : '#ef4444' }}>
+        <span className="text-[10px] mono" style={{ color: totalPnl >= 0 ? 'var(--green)' : 'var(--red)' }}>
           {totalPnl >= 0 ? '+' : ''}${(totalPnl / 100).toFixed(0)} | {totalTrades} trades
         </span>
       </div>
@@ -238,54 +246,92 @@ function DetailPanel({ market, onClose }) {
   if (!market) return null;
   const pnlDollars = (market.pnl / 100).toFixed(2);
   const winRate = market.trades > 0 ? ((market.wins / market.trades) * 100).toFixed(1) : '0';
+  const catColor = CATEGORY_COLORS[market.category] || CATEGORY_COLORS.Other;
 
   return (
-    <div className="card border border-amber-500/30 bg-gradient-to-br from-gray-800/90 to-gray-900/90 backdrop-blur-sm">
-      <div className="flex items-start justify-between mb-3">
+    <div className="card-glow fade-in">
+      <div className="flex items-start justify-between mb-4">
         <div className="flex-1 min-w-0 mr-4">
-          <h3 className="text-sm font-bold text-gray-100 truncate">{market.title}</h3>
-          <p className="text-xs text-gray-500 font-mono mt-1">{market.ticker}</p>
+          <h3 className="heading text-sm font-bold truncate" style={{ color: 'var(--text)' }}>{market.title}</h3>
+          <p className="mono text-xs mt-1" style={{ color: 'var(--text-muted)' }}>{market.ticker}</p>
         </div>
-        <button onClick={onClose} className="text-gray-500 hover:text-gray-300 text-lg leading-none">&times;</button>
+        <button
+          onClick={onClose}
+          className="btn btn-ghost text-lg leading-none"
+          style={{ padding: '0 6px' }}
+        >
+          &times;
+        </button>
       </div>
 
       <div className="grid grid-cols-4 gap-3 text-center">
-        <div className="rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50">
-          <p className="text-[9px] text-gray-500 uppercase">P&L</p>
-          <p className={`text-lg font-bold font-mono ${market.pnl >= 0 ? 'text-green-400' : 'text-red-400'}`}>
-            {market.pnl >= 0 ? '+' : ''}${pnlDollars}
-          </p>
-        </div>
-        <div className="rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50">
-          <p className="text-[9px] text-gray-500 uppercase">Win Rate</p>
-          <p className={`text-lg font-bold ${Number(winRate) >= 80 ? 'text-green-400' : Number(winRate) >= 50 ? 'text-amber-400' : 'text-red-400'}`}>
-            {winRate}%
-          </p>
-        </div>
-        <div className="rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50">
-          <p className="text-[9px] text-gray-500 uppercase">Total Trades</p>
-          <p className="text-lg font-bold text-amber-400">{market.trades.toLocaleString()}</p>
-        </div>
-        <div className="rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50">
-          <p className="text-[9px] text-gray-500 uppercase">Record</p>
-          <p className="text-lg font-bold">
-            <span className="text-green-400">{market.wins}</span>
-            <span className="text-gray-600 mx-0.5">-</span>
-            <span className="text-red-400">{market.losses}</span>
-          </p>
-        </div>
+        {[
+          {
+            label: 'P&L',
+            value: `${market.pnl >= 0 ? '+' : ''}$${pnlDollars}`,
+            color: market.pnl >= 0 ? 'var(--green)' : 'var(--red)',
+          },
+          {
+            label: 'Win Rate',
+            value: `${winRate}%`,
+            color: Number(winRate) >= 80 ? 'var(--green)' : Number(winRate) >= 50 ? 'var(--orange)' : 'var(--red)',
+          },
+          {
+            label: 'Trades',
+            value: market.trades.toLocaleString(),
+            color: 'var(--orange)',
+          },
+          {
+            label: 'Record',
+            valueEl: (
+              <p className="text-lg font-bold">
+                <span style={{ color: 'var(--green)' }}>{market.wins}</span>
+                <span style={{ color: 'var(--border-light)' }} className="mx-0.5">-</span>
+                <span style={{ color: 'var(--red)' }}>{market.losses}</span>
+              </p>
+            ),
+          },
+        ].map(s => (
+          <div
+            key={s.label}
+            className="rounded-lg p-2.5 text-center"
+            style={{ background: 'var(--surface-el)', border: '1px solid var(--border)' }}
+          >
+            <p className="stat-label mb-1">{s.label}</p>
+            {s.valueEl || (
+              <p className="stat-v text-lg" style={{ color: s.color }}>{s.value}</p>
+            )}
+          </div>
+        ))}
       </div>
 
       <div className="mt-3 flex items-center justify-between text-xs">
-        <span className="text-gray-500">Category: <span style={{ color: (CATEGORY_COLORS[market.category] || CATEGORY_COLORS.Other).bg }}>{market.category}</span></span>
+        <span style={{ color: 'var(--text-muted)' }}>
+          Category:{' '}
+          <span style={{ color: catColor.hex }} className="font-semibold">{market.category}</span>
+        </span>
         {market.url && (
-          <a href={market.url} target="_blank" rel="noopener noreferrer"
-            className="text-amber-400 hover:text-amber-300 transition">View on Kalshi &rarr;</a>
+          <a
+            href={market.url}
+            target="_blank"
+            rel="noopener noreferrer"
+            className="text-cyan transition-colors"
+            style={{ color: 'var(--cyan)' }}
+          >
+            View on Kalshi &rarr;
+          </a>
         )}
       </div>
 
       {market.edge && (
-        <div className="mt-2 text-[11px] text-gray-400 bg-gray-800/40 rounded-lg px-3 py-2 border border-gray-700/30">
+        <div
+          className="mt-2 text-[11px] rounded-lg px-3 py-2"
+          style={{
+            color: 'var(--text-dim)',
+            background: 'var(--surface-el)',
+            border: '1px solid var(--border)',
+          }}
+        >
           {market.edge}
         </div>
       )}
@@ -296,23 +342,26 @@ function DetailPanel({ market, onClose }) {
 // ── Legend ──
 function Legend() {
   const pnlRanges = [
-    { label: '> $500', color: '#22c55e', bg: 'rgba(34,197,94,0.35)' },
-    { label: '$100-500', color: '#4ade80', bg: 'rgba(34,197,94,0.25)' },
-    { label: '$10-100', color: '#86efac', bg: 'rgba(34,197,94,0.15)' },
-    { label: '$0-10', color: '#bbf7d0', bg: 'rgba(34,197,94,0.08)' },
-    { label: '$0', color: '#475569', bg: 'rgba(100,116,139,0.15)' },
-    { label: '-$10', color: '#fecaca', bg: 'rgba(239,68,68,0.08)' },
-    { label: '-$100', color: '#f87171', bg: 'rgba(239,68,68,0.15)' },
-    { label: '< -$100', color: '#ef4444', bg: 'rgba(239,68,68,0.30)' },
+    { label: '> $500',   bg: 'rgba(0,195,137,0.35)' },
+    { label: '$100-500', bg: 'rgba(0,195,137,0.25)' },
+    { label: '$10-100',  bg: 'rgba(0,195,137,0.15)' },
+    { label: '$0-10',    bg: 'rgba(0,195,137,0.08)' },
+    { label: '$0',       bg: 'rgba(107,114,128,0.15)' },
+    { label: '-$10',     bg: 'rgba(255,92,92,0.08)' },
+    { label: '-$100',    bg: 'rgba(255,92,92,0.15)' },
+    { label: '< -$100',  bg: 'rgba(255,92,92,0.30)' },
   ];
 
   return (
-    <div className="flex items-center gap-1 flex-wrap">
-      <span className="text-[10px] text-gray-500 mr-1">P&L:</span>
+    <div className="flex items-center gap-2 flex-wrap">
+      <span className="stat-label mr-1">P&L Scale:</span>
       {pnlRanges.map(r => (
         <div key={r.label} className="flex items-center gap-1">
-          <div className="w-3 h-3 rounded-sm border border-gray-700/50" style={{ backgroundColor: r.bg }} />
-          <span className="text-[9px] text-gray-500">{r.label}</span>
+          <div
+            className="w-3 h-3 rounded-sm"
+            style={{ backgroundColor: r.bg, border: '1px solid var(--border)' }}
+          />
+          <span className="text-[9px]" style={{ color: 'var(--text-muted)' }}>{r.label}</span>
         </div>
       ))}
     </div>
@@ -436,7 +485,10 @@ export default function Heatmap() {
 
   if (loading) return (
     <div className="flex items-center justify-center h-64">
-      <div className="animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full" />
+      <div
+        className="w-8 h-8 rounded-full border-2 border-t-transparent animate-spin"
+        style={{ borderColor: 'var(--cyan)', borderTopColor: 'transparent' }}
+      />
     </div>
   );
 
@@ -465,54 +517,74 @@ export default function Heatmap() {
     0, 0, WIDTH, HEIGHT
   ) : [];
 
+  const summaryStats = [
+    {
+      label: 'Total P&L',
+      value: `${summary.totalPnl >= 0 ? '+' : ''}$${(summary.totalPnl / 100).toLocaleString(undefined, { minimumFractionDigits: 0 })}`,
+      color: summary.totalPnl >= 0 ? 'var(--green)' : 'var(--red)',
+    },
+    { label: 'Total Trades', value: summary.totalTrades?.toLocaleString() || '0', color: 'var(--orange)' },
+    {
+      label: 'Win Rate',
+      value: summary.totalTrades > 0 ? `${((summary.totalWins / summary.totalTrades) * 100).toFixed(1)}%` : '0%',
+      color: 'var(--blue)',
+    },
+    { label: 'Markets', value: summary.totalMarkets || 0, color: 'var(--purple)' },
+    { label: 'Profitable', value: summary.profitableCount || 0, color: 'var(--green)' },
+    { label: 'Categories', value: Object.keys(categories).length, color: 'var(--cyan)' },
+  ];
+
   return (
     <div className="space-y-6">
-      {/* Header */}
+      {/* Page Header */}
       <div className="flex items-center justify-between">
         <div>
-          <h1 className="text-2xl font-bold">Market Heatmap</h1>
-          <p className="text-gray-500 text-sm">Treemap visualization of trading activity and P&L by market category</p>
+          <h1 className="heading text-2xl font-bold kalshi-gradient">Market Heatmap</h1>
+          <p className="section-subtitle mt-1">Treemap visualization of trading activity and P&L by market category</p>
         </div>
         <div className="flex items-center gap-3">
-          <div className="flex items-center gap-1 bg-gray-800 rounded-lg p-0.5">
+          {/* View mode toggle */}
+          <div
+            className="flex items-center gap-0.5 rounded-lg p-0.5"
+            style={{ background: 'var(--surface-el)', border: '1px solid var(--border)' }}
+          >
             {['category', 'flat'].map(mode => (
               <button
                 key={mode}
                 onClick={() => setViewMode(mode)}
-                className={`px-3 py-1.5 text-xs font-medium rounded-md transition ${
-                  viewMode === mode ? 'bg-amber-500 text-black' : 'text-gray-400 hover:text-gray-200'
-                }`}
+                className="btn btn-sm"
+                style={viewMode === mode
+                  ? { background: 'var(--cyan)', color: 'var(--bg)', fontWeight: 700 }
+                  : { background: 'transparent', color: 'var(--text-muted)' }
+                }
               >
                 {mode === 'category' ? 'By Category' : 'All Markets'}
               </button>
             ))}
           </div>
+
+          {/* Sort select */}
           <select
             value={sortBy}
             onChange={e => setSortBy(e.target.value)}
-            className="bg-gray-800 border border-gray-700 rounded-lg px-3 py-1.5 text-xs text-gray-300 focus:outline-none focus:border-amber-500"
+            className="input"
+            style={{ width: 'auto', paddingRight: '1.5rem' }}
           >
             <option value="pnl">Sort by P&L</option>
             <option value="trades">Sort by Trades</option>
             <option value="winrate">Sort by Win Rate</option>
           </select>
-          <button onClick={load} className="btn btn-o text-sm">Refresh</button>
+
+          <button onClick={load} className="btn btn-o btn-sm">Refresh</button>
         </div>
       </div>
 
       {/* Summary Stats */}
       <div className="grid grid-cols-6 gap-3">
-        {[
-          { label: 'Total P&L', value: `${summary.totalPnl >= 0 ? '+' : ''}$${(summary.totalPnl / 100).toLocaleString(undefined, { minimumFractionDigits: 0 })}`, color: summary.totalPnl >= 0 ? 'text-green-400' : 'text-red-400' },
-          { label: 'Total Trades', value: summary.totalTrades?.toLocaleString() || '0', color: 'text-amber-400' },
-          { label: 'Win Rate', value: summary.totalTrades > 0 ? `${((summary.totalWins / summary.totalTrades) * 100).toFixed(1)}%` : '0%', color: 'text-blue-400' },
-          { label: 'Markets', value: summary.totalMarkets || 0, color: 'text-purple-400' },
-          { label: 'Profitable', value: summary.profitableCount || 0, color: 'text-green-400' },
-          { label: 'Categories', value: Object.keys(categories).length, color: 'text-cyan-400' },
-        ].map(s => (
+        {summaryStats.map(s => (
           <div key={s.label} className="card">
-            <p className="text-[10px] text-gray-500 uppercase mb-1">{s.label}</p>
-            <p className={`text-xl font-bold ${s.color}`}>{s.value}</p>
+            <p className="stat-label mb-1">{s.label}</p>
+            <p className="stat-v text-xl" style={{ color: s.color }}>{s.value}</p>
           </div>
         ))}
       </div>
@@ -523,14 +595,21 @@ export default function Heatmap() {
           const catColor = CATEGORY_COLORS[cat] || CATEGORY_COLORS.Other;
           const catPnl = items.reduce((s, m) => s + m.pnl, 0);
           return (
-            <div key={cat} className="flex items-center gap-1.5 px-3 py-1.5 rounded-full border" style={{
-              backgroundColor: `${catColor.bg}15`,
-              borderColor: `${catColor.bg}40`,
-            }}>
-              <div className="w-2 h-2 rounded-full" style={{ backgroundColor: catColor.bg }} />
-              <span className="text-xs font-medium" style={{ color: catColor.bg }}>{cat}</span>
-              <span className="text-[10px] text-gray-500">{items.length}</span>
-              <span className={`text-[10px] font-mono font-bold ${catPnl >= 0 ? 'text-green-400' : 'text-red-400'}`}>
+            <div
+              key={cat}
+              className="flex items-center gap-1.5 px-3 py-1.5 rounded-full"
+              style={{
+                backgroundColor: `${catColor.hex}18`,
+                border: `1px solid ${catColor.hex}40`,
+              }}
+            >
+              <div className="w-2 h-2 rounded-full" style={{ backgroundColor: catColor.hex }} />
+              <span className="text-xs font-semibold heading" style={{ color: catColor.hex }}>{cat}</span>
+              <span className="text-[10px]" style={{ color: 'var(--text-muted)' }}>{items.length}</span>
+              <span
+                className="text-[10px] mono font-bold"
+                style={{ color: catPnl >= 0 ? 'var(--green)' : 'var(--red)' }}
+              >
                 {catPnl >= 0 ? '+' : ''}${(catPnl / 100).toFixed(0)}
               </span>
             </div>
@@ -539,7 +618,10 @@ export default function Heatmap() {
       </div>
 
       {/* Treemap */}
-      <div className="card p-2 relative overflow-hidden" style={{ minHeight: HEIGHT + 20 }}>
+      <div
+        className="card p-2 relative overflow-hidden"
+        style={{ minHeight: HEIGHT + 20 }}
+      >
         <div className="relative" style={{ width: WIDTH, height: HEIGHT, margin: '0 auto', maxWidth: '100%' }}>
           {viewMode === 'category' ? (
             categoryBlocks.map(block => (
@@ -581,7 +663,7 @@ export default function Heatmap() {
       {/* Category Breakdown Table */}
       <div className="card">
         <div className="flex items-center gap-2 mb-4">
-          <h2 className="font-semibold">Category Breakdown</h2>
+          <h2 className="section-title">Category Breakdown</h2>
         </div>
         <table>
           <thead>
@@ -607,19 +689,34 @@ export default function Heatmap() {
                 <tr key={cat}>
                   <td>
                     <div className="flex items-center gap-2">
-                      <div className="w-3 h-3 rounded-full" style={{ backgroundColor: catColor.bg }} />
-                      <span className="font-medium" style={{ color: catColor.bg }}>{cat}</span>
+                      <div className="w-3 h-3 rounded-full" style={{ backgroundColor: catColor.hex }} />
+                      <span className="font-semibold heading" style={{ color: catColor.hex }}>{cat}</span>
                     </div>
                   </td>
-                  <td className="text-gray-300">{items.length}</td>
-                  <td className="text-gray-300 font-mono">{catTrades.toLocaleString()}</td>
-                  <td className={`font-mono font-bold ${Number(catWr) >= 80 ? 'text-green-400' : Number(catWr) >= 50 ? 'text-amber-400' : 'text-red-400'}`}>
+                  <td style={{ color: 'var(--text-dim)' }}>{items.length}</td>
+                  <td className="mono" style={{ color: 'var(--text-dim)' }}>{catTrades.toLocaleString()}</td>
+                  <td
+                    className="mono font-bold"
+                    style={{
+                      color: Number(catWr) >= 80 ? 'var(--green)'
+                           : Number(catWr) >= 50 ? 'var(--orange)'
+                           : 'var(--red)',
+                    }}
+                  >
                     {catWr}%
                   </td>
-                  <td className={`font-mono font-bold ${catPnl >= 0 ? 'text-green-400' : 'text-red-400'}`}>
+                  <td
+                    className="mono font-bold"
+                    style={{ color: catPnl >= 0 ? 'var(--green)' : 'var(--red)' }}
+                  >
                     {catPnl >= 0 ? '+' : ''}${(catPnl / 100).toFixed(2)}
                   </td>
-                  <td className="text-gray-400 text-xs truncate max-w-[200px]">{best?.shortTitle || '--'}</td>
+                  <td
+                    className="text-xs truncate max-w-[200px]"
+                    style={{ color: 'var(--text-muted)' }}
+                  >
+                    {best?.shortTitle || '--'}
+                  </td>
                 </tr>
               );
             })}
diff --git a/kalshi-dash/src/pages/Intelligence.jsx b/kalshi-dash/src/pages/Intelligence.jsx
index ef2444e..0d88cf6 100644
--- a/kalshi-dash/src/pages/Intelligence.jsx
+++ b/kalshi-dash/src/pages/Intelligence.jsx
@@ -1,6 +1,7 @@
 import React, { useState, useEffect } from 'react';
 import { api } from '../api';
 
+/* ─── Source icon map (text-based, no emoji dependency issues) ─── */
 const SOURCE_ICONS = {
   reddit_hot: '🔴', reddit: '📋', google_news: '📰', hackernews: '🟠',
   metaculus: '🔮', manifold: '📊', gdelt_tv: '📺', youtube: '▶️',
@@ -9,6 +10,56 @@ const SOURCE_ICONS = {
   govtrack: '🏛️', discord: '💬',
 };
 
+/* Colour-code source badges by type */
+function sourceBadgeClass(source) {
+  if (['reddit_hot', 'reddit', 'lemmy'].includes(source)) return 'bg-red';
+  if (['google_news', 'govtrack', 'nws'].includes(source)) return 'bg-blue';
+  if (['metaculus', 'manifold', 'predictit'].includes(source)) return 'bg-purple';
+  if (['hackernews', 'lobsters', 'tildes'].includes(source)) return 'bg-orange';
+  if (['fred'].includes(source)) return 'bg-green';
+  if (['bluesky', 'mastodon', 'discord'].includes(source)) return 'bg-cyan';
+  return 'bg-blue';
+}
+
+/* Relevance / sentiment badge */
+function SentimentBadge({ value }) {
+  const v = parseFloat(value) || 0;
+  if (v > 0.1)  return <span className="badge bg-cyan"  >+{(v * 100).toFixed(0)}%</span>;
+  if (v < -0.1) return <span className="badge bg-red"   >{(v * 100).toFixed(0)}%</span>;
+  return             <span className="badge bg-orange" >{(v * 100).toFixed(0)}%</span>;
+}
+
+/* Sortable column header */
+function SortHead({ col, label, sortCol, sortDir, onSort }) {
+  const active = sortCol === col;
+  return (
+    <th
+      onClick={() => onSort(col)}
+      className="cursor-pointer select-none transition"
+      style={{ color: active ? 'var(--cyan)' : undefined }}
+    >
+      <span className="flex items-center gap-1">
+        {label}
+        {active
+          ? <span style={{ color: 'var(--cyan)' }}>{sortDir === 'asc' ? '▲' : '▼'}</span>
+          : <span style={{ color: 'var(--border-light)' }}>⇅</span>
+        }
+      </span>
+    </th>
+  );
+}
+
+/* ─── Stat card ─── */
+function StatCard({ label, value, color }) {
+  return (
+    <div className="card">
+      <p className="stat-label mb-2">{label}</p>
+      <p className="stat-v" style={{ color }}>{value}</p>
+    </div>
+  );
+}
+
+/* ─── Main Intelligence page ─── */
 export default function Intelligence() {
   const [data, setData] = useState(null);
   const [loading, setLoading] = useState(true);
@@ -30,129 +81,259 @@ export default function Intelligence() {
     setLoading(false);
   }
 
-  if (loading) return <div className="flex items-center justify-center h-64"><div className="animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full" /></div>;
+  function toggleSort(col) {
+    if (sortCol === col) setSortDir(d => d === 'asc' ? 'desc' : 'asc');
+    else { setSortCol(col); setSortDir(col === 'captured_at' ? 'desc' : 'asc'); }
+  }
+
+  if (loading) {
+    return (
+      <div className="flex items-center justify-center h-64">
+        <div
+          className="animate-spin w-8 h-8 border-2 border-t-transparent rounded-full pulse-cyan"
+          style={{ borderColor: 'var(--cyan)', borderTopColor: 'transparent' }}
+        />
+      </div>
+    );
+  }
 
   const totals = data?.totals || {};
   const sources = data?.sourceCounts || [];
+
   const filtered = (data?.recent || []).filter(item =>
-    !filter || item.source.toLowerCase().includes(filter.toLowerCase()) ||
+    !filter ||
+    item.source.toLowerCase().includes(filter.toLowerCase()) ||
     (item.post_title || '').toLowerCase().includes(filter.toLowerCase()) ||
     (item.keyword || '').toLowerCase().includes(filter.toLowerCase())
   );
 
-  function toggleSort(col) {
-    if (sortCol === col) setSortDir(d => d === 'asc' ? 'desc' : 'asc');
-    else { setSortCol(col); setSortDir(col === 'captured_at' ? 'desc' : 'asc'); }
-  }
-  const sortFn = (a, b) => {
+  function sortFn(a, b) {
     let va, vb;
     switch (sortCol) {
       case 'captured_at': va = new Date(a.captured_at); vb = new Date(b.captured_at); break;
-      case 'source': va = a.source || ''; vb = b.source || ''; break;
-      case 'keyword': va = a.keyword || a.subreddit || ''; vb = b.keyword || b.subreddit || ''; break;
-      case 'post_title': va = (a.post_title || '').toLowerCase(); vb = (b.post_title || '').toLowerCase(); break;
-      case 'score': va = Number(a.score || 0); vb = Number(b.score || 0); break;
-      case 'sentiment': va = parseFloat(a.sentiment_score || 0); vb = parseFloat(b.sentiment_score || 0); break;
+      case 'source':      va = a.source || '';          vb = b.source || '';           break;
+      case 'keyword':     va = a.keyword || a.subreddit || ''; vb = b.keyword || b.subreddit || ''; break;
+      case 'post_title':  va = (a.post_title || '').toLowerCase(); vb = (b.post_title || '').toLowerCase(); break;
+      case 'score':       va = Number(a.score || 0);    vb = Number(b.score || 0);     break;
+      case 'sentiment':   va = parseFloat(a.sentiment_score || 0); vb = parseFloat(b.sentiment_score || 0); break;
       default: return 0;
     }
     if (va < vb) return sortDir === 'asc' ? -1 : 1;
-    if (va > vb) return sortDir === 'asc' ? 1 : -1;
+    if (va > vb) return sortDir === 'asc' ?  1 : -1;
     return 0;
-  };
+  }
+
   const items = [...filtered].sort(sortFn);
-  const SortHead = ({ col, label }) => (
-    <th onClick={() => toggleSort(col)} className="cursor-pointer select-none hover:text-amber-400 transition">
-      {label} {sortCol === col ? (sortDir === 'asc' ? '▲' : '▼') : <span className="text-gray-600">⇅</span>}
-    </th>
-  );
+
+  const avgSent = parseFloat(totals.avg_sentiment_1h) || 0;
+  const avgSentColor = avgSent > 0 ? 'var(--green)' : avgSent < 0 ? 'var(--red)' : 'var(--text-muted)';
+
+  const sortProps = { sortCol, sortDir, onSort: toggleSort };
 
   return (
-    <div className="space-y-6">
+    <div className="space-y-6 fade-in">
+
+      {/* ── Page Header ── */}
       <div className="flex items-center justify-between">
         <div>
-          <h1 className="text-2xl font-bold">Intelligence Feed</h1>
-          <p className="text-gray-500 text-sm">Real-time data from 20+ sources</p>
+          <div className="flex items-center gap-3">
+            {/* Flask icon */}
+            <span className="text-2xl" style={{ color: 'var(--cyan)' }}>⚗</span>
+            <h1 className="heading text-3xl font-bold" style={{ color: 'var(--text)' }}>
+              Intel Feed
+            </h1>
+            <span className="flex items-center gap-1.5">
+              <span
+                className="inline-block w-2 h-2 rounded-full pulse-cyan"
+                style={{ background: 'var(--cyan)' }}
+              />
+              <span className="text-xs" style={{ color: 'var(--cyan)' }}>LIVE</span>
+            </span>
+          </div>
+          <p className="section-subtitle mt-1">Real-time data from 20+ sources</p>
         </div>
-        <button onClick={load} className="btn btn-o text-sm">Refresh</button>
+        <button onClick={load} className="btn btn-o btn-sm">↻ Refresh</button>
       </div>
 
-      {/* Stats */}
+      {/* ── Stats ── */}
       <div className="grid grid-cols-4 gap-4">
-        <div className="card">
-          <p className="text-[10px] text-gray-500 uppercase mb-1">Total Items</p>
-          <p className="text-xl font-bold text-amber-400">{Number(totals.total_items || 0).toLocaleString()}</p>
-        </div>
-        <div className="card">
-          <p className="text-[10px] text-gray-500 uppercase mb-1">Last Hour</p>
-          <p className="text-xl font-bold text-green-400">{totals.last_hour || 0}</p>
-        </div>
-        <div className="card">
-          <p className="text-[10px] text-gray-500 uppercase mb-1">Last 4 Hours</p>
-          <p className="text-xl font-bold text-blue-400">{totals.last_4h || 0}</p>
-        </div>
-        <div className="card">
-          <p className="text-[10px] text-gray-500 uppercase mb-1">Avg Sentiment (1h)</p>
-          <p className={`text-xl font-bold ${parseFloat(totals.avg_sentiment_1h) > 0 ? 'text-green-400' : parseFloat(totals.avg_sentiment_1h) < 0 ? 'text-red-400' : 'text-gray-400'}`}>
-            {totals.avg_sentiment_1h ? `${(parseFloat(totals.avg_sentiment_1h) * 100).toFixed(1)}%` : '—'}
-          </p>
-        </div>
+        <StatCard label="Total Items"      value={Number(totals.total_items || 0).toLocaleString()} color="var(--orange)" />
+        <StatCard label="Last Hour"        value={totals.last_hour || 0}                            color="var(--green)" />
+        <StatCard label="Last 4 Hours"     value={totals.last_4h || 0}                              color="var(--blue)" />
+        <StatCard
+          label="Avg Sentiment 1h"
+          value={totals.avg_sentiment_1h ? `${(avgSent * 100).toFixed(1)}%` : '—'}
+          color={avgSentColor}
+        />
       </div>
 
-      {/* Source Breakdown */}
-      <div className="card">
-        <h2 className="font-semibold mb-3">Active Sources</h2>
+      {/* ── Source filter pills ── */}
+      <div className="card" style={{ padding: '1rem' }}>
+        <p className="section-title mb-3" style={{ fontSize: '0.9rem' }}>
+          Active Sources
+        </p>
         <div className="flex flex-wrap gap-2">
-          {sources.map((s, i) => (
-            <button key={i} onClick={() => setFilter(filter === s.source ? '' : s.source)}
-              className={`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs transition ${filter === s.source ? 'bg-amber-500/20 text-amber-400 border border-amber-500/30' : 'bg-gray-800/50 text-gray-400 border border-gray-700 hover:border-gray-600'}`}>
-              <span>{SOURCE_ICONS[s.source] || '📡'}</span>
-              <span className="font-medium">{s.source}</span>
-              <span className="text-gray-500">{s.cnt}</span>
-              <span className={`font-mono ${parseFloat(s.avg_sent) > 0.05 ? 'text-green-400' : parseFloat(s.avg_sent) < -0.05 ? 'text-red-400' : 'text-gray-500'}`}>
-                {parseFloat(s.avg_sent) > 0 ? '+' : ''}{(parseFloat(s.avg_sent) * 100).toFixed(0)}%
-              </span>
-            </button>
-          ))}
+          {/* "All" pill */}
+          <button
+            onClick={() => setFilter('')}
+            className="badge transition cursor-pointer"
+            style={{
+              background: !filter ? 'var(--cyan-dim)' : 'rgba(42,42,53,0.6)',
+              color: !filter ? 'var(--cyan)' : 'var(--text-muted)',
+              border: !filter ? '1px solid rgba(0,240,255,0.3)' : '1px solid var(--border)',
+            }}
+          >
+            All
+          </button>
+
+          {sources.map((s, i) => {
+            const active = filter === s.source;
+            const sent = parseFloat(s.avg_sent) || 0;
+            return (
+              <button
+                key={i}
+                onClick={() => setFilter(active ? '' : s.source)}
+                className="badge transition cursor-pointer"
+                style={{
+                  background: active ? 'var(--cyan-dim)' : 'rgba(42,42,53,0.6)',
+                  color: active ? 'var(--cyan)' : 'var(--text-muted)',
+                  border: active ? '1px solid rgba(0,240,255,0.3)' : '1px solid var(--border)',
+                }}
+              >
+                <span>{SOURCE_ICONS[s.source] || '📡'}</span>
+                <span className="font-medium">{s.source}</span>
+                <span style={{ color: 'var(--text-muted)', opacity: 0.7 }}>{s.cnt}</span>
+                <span
+                  className="mono"
+                  style={{ color: sent > 0.05 ? 'var(--green)' : sent < -0.05 ? 'var(--red)' : 'var(--text-muted)' }}
+                >
+                  {sent > 0 ? '+' : ''}{(sent * 100).toFixed(0)}%
+                </span>
+              </button>
+            );
+          })}
         </div>
       </div>
 
-      {/* Filter */}
-      <input type="text" value={filter} onChange={e => setFilter(e.target.value)} placeholder="Filter by source, keyword, or title..."
-        className="w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none" />
+      {/* ── Search Bar ── */}
+      <div className="relative">
+        <span
+          className="absolute left-3 top-1/2 -translate-y-1/2 text-sm pointer-events-none"
+          style={{ color: 'var(--text-muted)' }}
+        >
+          ⌕
+        </span>
+        <input
+          type="text"
+          value={filter}
+          onChange={e => setFilter(e.target.value)}
+          placeholder="Filter by source, keyword, or title..."
+          className="input pl-8"
+        />
+      </div>
 
-      {/* Feed */}
-      <div className="card overflow-x-auto">
+      {/* ── Intel Feed Table ── */}
+      <div className="card overflow-x-auto" style={{ padding: 0 }}>
         <table>
-          <thead><tr><SortHead col="captured_at" label="Time" /><SortHead col="source" label="Source" /><SortHead col="keyword" label="Topic" /><SortHead col="post_title" label="Title" /><SortHead col="score" label="Score" /><SortHead col="sentiment" label="Sentiment" /></tr></thead>
+          <thead>
+            <tr>
+              <SortHead col="captured_at" label="Time"      {...sortProps} />
+              <SortHead col="source"      label="Source"    {...sortProps} />
+              <SortHead col="keyword"     label="Topic"     {...sortProps} />
+              <SortHead col="post_title"  label="Headline"  {...sortProps} />
+              <SortHead col="score"       label="Score"     {...sortProps} />
+              <SortHead col="sentiment"   label="Sentiment" {...sortProps} />
+            </tr>
+          </thead>
           <tbody>
             {items.length === 0 ? (
-              <tr><td colSpan={6} className="text-center text-gray-500 py-8">No items match filter</td></tr>
-            ) : items.slice(0, 50).map((item, i) => (
-              <tr key={i}>
-                <td className="text-xs text-gray-500 whitespace-nowrap">{new Date(item.captured_at).toLocaleTimeString()}</td>
-                <td>
-                  <span className="badge bg-blue text-xs">
-                    {SOURCE_ICONS[item.source] || '📡'} {item.source}
-                  </span>
-                </td>
-                <td className="text-xs text-gray-500">{item.keyword || item.subreddit || '—'}</td>
-                <td className="max-w-[400px]">
-                  {item.post_url ? (
-                    <a href={item.post_url} target="_blank" rel="noopener noreferrer" className="text-sm text-gray-300 hover:text-amber-400 truncate block">{item.post_title}</a>
-                  ) : (
-                    <span className="text-sm text-gray-300 truncate block">{item.post_title}</span>
-                  )}
-                </td>
-                <td className="font-mono text-xs text-gray-400">{item.score || 0}{item.num_comments ? ` / ${item.num_comments}c` : ''}</td>
-                <td>
-                  <span className={`font-mono text-xs ${parseFloat(item.sentiment_score) > 0.1 ? 'text-green-400' : parseFloat(item.sentiment_score) < -0.1 ? 'text-red-400' : 'text-gray-500'}`}>
-                    {parseFloat(item.sentiment_score) > 0 ? '+' : ''}{(parseFloat(item.sentiment_score) * 100).toFixed(0)}%
-                  </span>
+              <tr>
+                <td colSpan={6} className="text-center py-12" style={{ color: 'var(--text-muted)' }}>
+                  <div className="flex flex-col items-center gap-2">
+                    <span className="text-2xl">⚗</span>
+                    <span className="text-sm">No items match your filter</span>
+                  </div>
                 </td>
               </tr>
-            ))}
+            ) : (
+              items.slice(0, 50).map((item, i) => {
+                const sent = parseFloat(item.sentiment_score) || 0;
+                return (
+                  <tr key={i}>
+                    {/* Time */}
+                    <td className="whitespace-nowrap">
+                      <span className="mono text-xs" style={{ color: 'var(--text-muted)' }}>
+                        {new Date(item.captured_at).toLocaleTimeString()}
+                      </span>
+                    </td>
+
+                    {/* Source badge */}
+                    <td>
+                      <span className={`badge ${sourceBadgeClass(item.source)}`}>
+                        {SOURCE_ICONS[item.source] || '📡'} {item.source}
+                      </span>
+                    </td>
+
+                    {/* Topic / keyword */}
+                    <td>
+                      <span className="text-xs" style={{ color: 'var(--text-dim)' }}>
+                        {item.keyword || item.subreddit || '—'}
+                      </span>
+                    </td>
+
+                    {/* Headline */}
+                    <td className="max-w-[400px]">
+                      {item.post_url ? (
+                        <a
+                          href={item.post_url}
+                          target="_blank"
+                          rel="noopener noreferrer"
+                          className="text-sm truncate block hover:underline transition heading"
+                          style={{ color: 'var(--text)' }}
+                        >
+                          {item.post_title}
+                        </a>
+                      ) : (
+                        <span className="text-sm truncate block heading" style={{ color: 'var(--text)' }}>
+                          {item.post_title}
+                        </span>
+                      )}
+                    </td>
+
+                    {/* Score */}
+                    <td>
+                      <span className="mono text-xs" style={{ color: 'var(--text-dim)' }}>
+                        {item.score || 0}
+                        {item.num_comments ? (
+                          <span style={{ color: 'var(--text-muted)' }}> / {item.num_comments}c</span>
+                        ) : null}
+                      </span>
+                    </td>
+
+                    {/* Sentiment badge */}
+                    <td>
+                      <SentimentBadge value={item.sentiment_score} />
+                    </td>
+                  </tr>
+                );
+              })
+            )}
           </tbody>
         </table>
+
+        {/* Row count footer */}
+        {items.length > 0 && (
+          <div
+            className="px-4 py-3 text-xs"
+            style={{
+              color: 'var(--text-muted)',
+              borderTop: '1px solid var(--border)',
+            }}
+          >
+            Showing {Math.min(50, items.length)} of {items.length} items
+            {filter && ` matching "${filter}"`}
+          </div>
+        )}
       </div>
     </div>
   );
diff --git a/kalshi-dash/src/pages/Markets.jsx b/kalshi-dash/src/pages/Markets.jsx
index 56eb346..f99db03 100644
--- a/kalshi-dash/src/pages/Markets.jsx
+++ b/kalshi-dash/src/pages/Markets.jsx
@@ -1,14 +1,16 @@
-import React, { useState, useEffect, useCallback } from 'react';
+import React, { useState, useEffect } from 'react';
 import { post } from '../api';
 
-function ContractRow({ m, onOrderbook }) {
+/* ─── Orderbook sub-row inside a ContractRow ─── */
+function ContractRow({ m }) {
   const [ob, setOb] = useState(null);
   const [obOpen, setObOpen] = useState(false);
   const [obLoading, setObLoading] = useState(false);
 
   async function loadOb() {
     if (obOpen) { setObOpen(false); return; }
-    setObOpen(true); setObLoading(true);
+    setObOpen(true);
+    setObLoading(true);
     try {
       const r = await post('/kalshi', { action: 'get_orderbook', ticker: m.ticker });
       if (r.success) setOb(r.orderbook);
@@ -18,58 +20,123 @@ function ContractRow({ m, onOrderbook }) {
 
   return (
     <>
-      <tr className="bg-gray-800/20">
-        <td className="pl-8 max-w-[250px]"><span className="truncate block text-sm">{m.title || m.subtitle || m.ticker}</span></td>
-        <td className="font-mono text-xs">
-          <a href={`https://kalshi.com/search?query=${encodeURIComponent((m.ticker || '').split('-')[0])}`} target="_blank" rel="noopener noreferrer" className="text-amber-400 hover:text-amber-300 hover:underline transition">
+      <tr style={{ background: 'rgba(0,240,255,0.02)' }}>
+        {/* Contract title */}
+        <td className="pl-8 max-w-[250px]">
+          <span className="truncate block text-sm" style={{ color: 'var(--text-dim)' }}>
+            {m.title || m.subtitle || m.ticker}
+          </span>
+        </td>
+
+        {/* Ticker link */}
+        <td>
+          <a
+            href={`https://kalshi.com/search?query=${encodeURIComponent((m.ticker || '').split('-')[0])}`}
+            target="_blank"
+            rel="noopener noreferrer"
+            className="mono text-xs hover:underline transition"
+            style={{ color: 'var(--cyan)' }}
+          >
             {m.ticker}
           </a>
         </td>
-        <td className="font-mono text-green-400">{m.yes_bid ?? '—'}¢</td>
-        <td className="font-mono text-red-400">{m.yes_ask ?? '—'}¢</td>
-        <td className="font-mono text-gray-400">{(m.volume || 0).toLocaleString()}</td>
-        <td className="font-mono text-gray-400">{m.open_interest ? m.open_interest.toLocaleString() : '—'}</td>
+
+        {/* Yes Bid */}
         <td>
-          <button onClick={loadOb} className={`text-xs transition ${obOpen ? 'text-amber-300' : 'text-gray-500 hover:text-amber-400'}`}>
+          <span className="mono text-sm" style={{ color: 'var(--green)' }}>
+            {m.yes_bid ?? '—'}¢
+          </span>
+        </td>
+
+        {/* Yes Ask */}
+        <td>
+          <span className="mono text-sm" style={{ color: 'var(--red)' }}>
+            {m.yes_ask ?? '—'}¢
+          </span>
+        </td>
+
+        {/* Volume */}
+        <td>
+          <span className="mono text-xs" style={{ color: 'var(--text-dim)' }}>
+            {(m.volume || 0).toLocaleString()}
+          </span>
+        </td>
+
+        {/* Open Interest */}
+        <td>
+          <span className="mono text-xs" style={{ color: 'var(--text-muted)' }}>
+            {m.open_interest ? m.open_interest.toLocaleString() : '—'}
+          </span>
+        </td>
+
+        {/* Orderbook toggle */}
+        <td>
+          <button
+            onClick={loadOb}
+            className="btn btn-ghost btn-sm"
+            style={{ color: obOpen ? 'var(--cyan)' : 'var(--text-muted)' }}
+          >
             {obOpen ? '▾ Book' : '▸ Book'}
           </button>
         </td>
       </tr>
+
+      {/* Orderbook detail row */}
       {obOpen && (
-        <tr className="bg-gray-800/10">
-          <td colSpan={7} className="p-3">
+        <tr style={{ background: 'rgba(0,240,255,0.01)' }}>
+          <td colSpan={7} className="p-4">
             {obLoading ? (
-              <div className="flex items-center justify-center h-16"><div className="animate-spin w-5 h-5 border-2 border-amber-500 border-t-transparent rounded-full" /></div>
+              <div className="flex items-center justify-center h-16">
+                <div
+                  className="animate-spin w-5 h-5 border-2 border-t-transparent rounded-full"
+                  style={{ borderColor: 'var(--cyan)', borderTopColor: 'transparent' }}
+                />
+              </div>
             ) : ob ? (
-              <div className="grid grid-cols-2 gap-4 max-w-xl">
+              <div className="grid grid-cols-2 gap-6 max-w-lg">
+                {/* YES bids */}
                 <div>
-                  <h4 className="text-[10px] text-green-400 uppercase tracking-wider mb-1 font-semibold">YES Bids</h4>
-                  <div className="space-y-0.5">
+                  <p className="stat-label mb-2" style={{ color: 'var(--green)' }}>YES Bids</p>
+                  <div className="space-y-1">
                     {(ob.yes || []).slice(0, 8).map((b, i) => (
-                      <div key={i} className="flex justify-between text-xs px-2 py-0.5 rounded relative overflow-hidden">
-                        <div className="absolute inset-0 bg-green-500/10" style={{ width: `${Math.min((b[1] || 0) * 2, 100)}%` }} />
-                        <span className="font-mono text-green-400 relative z-10">{b[0]}¢</span>
-                        <span className="font-mono text-gray-500 relative z-10">{b[1]}</span>
+                      <div key={i} className="relative flex justify-between text-xs px-2 py-1 rounded overflow-hidden" style={{ background: 'var(--surface-el)' }}>
+                        <div
+                          className="absolute inset-0 rounded"
+                          style={{ width: `${Math.min((b[1] || 0) * 2, 100)}%`, background: 'rgba(0,195,137,0.08)' }}
+                        />
+                        <span className="mono relative z-10" style={{ color: 'var(--green)' }}>{b[0]}¢</span>
+                        <span className="mono relative z-10" style={{ color: 'var(--text-muted)' }}>{b[1]}</span>
                       </div>
                     ))}
-                    {(!ob.yes || ob.yes.length === 0) && <div className="text-[10px] text-gray-600 text-center py-2">Empty</div>}
+                    {(!ob.yes || ob.yes.length === 0) && (
+                      <p className="text-xs text-center py-2" style={{ color: 'var(--text-muted)' }}>Empty</p>
+                    )}
                   </div>
                 </div>
+
+                {/* NO bids */}
                 <div>
-                  <h4 className="text-[10px] text-red-400 uppercase tracking-wider mb-1 font-semibold">NO Bids</h4>
-                  <div className="space-y-0.5">
+                  <p className="stat-label mb-2" style={{ color: 'var(--red)' }}>NO Bids</p>
+                  <div className="space-y-1">
                     {(ob.no || []).slice(0, 8).map((a, i) => (
-                      <div key={i} className="flex justify-between text-xs px-2 py-0.5 rounded relative overflow-hidden">
-                        <div className="absolute inset-0 bg-red-500/10" style={{ width: `${Math.min((a[1] || 0) * 2, 100)}%` }} />
-                        <span className="font-mono text-red-400 relative z-10">{a[0]}¢</span>
-                        <span className="font-mono text-gray-500 relative z-10">{a[1]}</span>
+                      <div key={i} className="relative flex justify-between text-xs px-2 py-1 rounded overflow-hidden" style={{ background: 'var(--surface-el)' }}>
+                        <div
+                          className="absolute inset-0 rounded"
+                          style={{ width: `${Math.min((a[1] || 0) * 2, 100)}%`, background: 'rgba(255,92,92,0.08)' }}
+                        />
+                        <span className="mono relative z-10" style={{ color: 'var(--red)' }}>{a[0]}¢</span>
+                        <span className="mono relative z-10" style={{ color: 'var(--text-muted)' }}>{a[1]}</span>
                       </div>
                     ))}
-                    {(!ob.no || ob.no.length === 0) && <div className="text-[10px] text-gray-600 text-center py-2">Empty</div>}
+                    {(!ob.no || ob.no.length === 0) && (
+                      <p className="text-xs text-center py-2" style={{ color: 'var(--text-muted)' }}>Empty</p>
+                    )}
                   </div>
                 </div>
               </div>
-            ) : <div className="text-xs text-gray-600 text-center">No orderbook data</div>}
+            ) : (
+              <p className="text-xs text-center py-2" style={{ color: 'var(--text-muted)' }}>No orderbook data</p>
+            )}
           </td>
         </tr>
       )}
@@ -77,6 +144,7 @@ function ContractRow({ m, onOrderbook }) {
   );
 }
 
+/* ─── Expandable event row ─── */
 function EventRow({ e }) {
   const [expanded, setExpanded] = useState(false);
   const [contracts, setContracts] = useState([]);
@@ -85,7 +153,7 @@ function EventRow({ e }) {
   async function toggle() {
     if (expanded) { setExpanded(false); return; }
     setExpanded(true);
-    if (contracts.length > 0) return; // already loaded
+    if (contracts.length > 0) return;
     setLoading(true);
     try {
       const r = await post('/kalshi', { action: 'get_markets', params: { event_ticker: e.event_ticker } });
@@ -96,49 +164,102 @@ function EventRow({ e }) {
 
   return (
     <>
-      <tr className={`cursor-pointer transition ${expanded ? 'bg-gray-800/40' : 'hover:bg-gray-800/20'}`} onClick={toggle}>
+      {/* Event header row */}
+      <tr
+        className="cursor-pointer transition"
+        onClick={toggle}
+        style={{ background: expanded ? 'rgba(0,240,255,0.04)' : undefined }}
+        onMouseEnter={ev => { if (!expanded) ev.currentTarget.style.background = 'var(--cyan-glow)'; }}
+        onMouseLeave={ev => { if (!expanded) ev.currentTarget.style.background = ''; }}
+      >
         <td className="max-w-[300px]">
           <div className="flex items-center gap-2">
-            <span className={`text-gray-500 text-xs transition-transform ${expanded ? 'rotate-90' : ''}`}>▶</span>
-            <span className="truncate block font-medium">{e.title}</span>
+            <span
+              className="text-xs transition-transform inline-block"
+              style={{
+                color: 'var(--text-muted)',
+                transform: expanded ? 'rotate(90deg)' : 'rotate(0deg)',
+              }}
+            >
+              ▶
+            </span>
+            <span className="truncate block font-medium heading" style={{ color: 'var(--text)' }}>
+              {e.title}
+            </span>
           </div>
         </td>
-        <td><span className="badge bg-orange">{e.category || '—'}</span></td>
-        <td className="font-mono text-xs">
-          <a href={`https://kalshi.com/search?query=${encodeURIComponent((e.event_ticker || '').split('-')[0])}`} target="_blank" rel="noopener noreferrer" className="text-amber-400 hover:text-amber-300 hover:underline transition" onClick={ev => ev.stopPropagation()}>
+
+        <td>
+          <span className="badge bg-orange">{e.category || '—'}</span>
+        </td>
+
+        <td>
+          <a
+            href={`https://kalshi.com/search?query=${encodeURIComponent((e.event_ticker || '').split('-')[0])}`}
+            target="_blank"
+            rel="noopener noreferrer"
+            className="mono text-xs hover:underline transition"
+            style={{ color: 'var(--cyan)' }}
+            onClick={ev => ev.stopPropagation()}
+          >
             {e.event_ticker}
           </a>
         </td>
-        <td className="text-sm">{e.mutually_exclusive ? 'ME' : '—'}</td>
-        <td className="text-xs text-gray-500" onClick={ev => ev.stopPropagation()}>
+
+        <td>
+          <span className="text-xs" style={{ color: 'var(--text-muted)' }}>
+            {e.mutually_exclusive ? (
+              <span className="badge bg-blue">ME</span>
+            ) : '—'}
+          </span>
+        </td>
+
+        <td onClick={ev => ev.stopPropagation()}>
           {expanded ? (
-            <span className="text-amber-400">{contracts.length || '...'} contracts</span>
+            <span className="text-xs mono" style={{ color: 'var(--cyan)' }}>
+              {contracts.length || '...'} contracts
+            </span>
           ) : (
-            <span className="text-gray-500 hover:text-amber-400 transition">View Contracts</span>
+            <span className="text-xs transition" style={{ color: 'var(--text-muted)' }}>
+              View Contracts
+            </span>
           )}
         </td>
       </tr>
+
+      {/* Contracts sub-table */}
       {expanded && (
         <tr>
           <td colSpan={5} className="p-0">
-            <div className="border-l-2 border-amber-500/30 ml-4 bg-gray-900/40">
+            <div
+              className="ml-6 fade-in"
+              style={{
+                borderLeft: '2px solid rgba(0,240,255,0.2)',
+                background: 'rgba(0,240,255,0.015)',
+              }}
+            >
               {loading ? (
-                <div className="flex items-center justify-center py-6">
-                  <div className="animate-spin w-5 h-5 border-2 border-amber-500 border-t-transparent rounded-full" />
+                <div className="flex items-center justify-center py-8">
+                  <div
+                    className="animate-spin w-5 h-5 border-2 border-t-transparent rounded-full"
+                    style={{ borderColor: 'var(--cyan)', borderTopColor: 'transparent' }}
+                  />
                 </div>
               ) : contracts.length === 0 ? (
-                <div className="text-center text-gray-600 text-xs py-4">No contracts found</div>
+                <div className="text-xs text-center py-4" style={{ color: 'var(--text-muted)' }}>
+                  No contracts found
+                </div>
               ) : (
                 <table className="w-full">
                   <thead>
-                    <tr className="text-[10px] text-gray-500 uppercase">
-                      <th className="pl-8 text-left py-1">Contract</th>
-                      <th className="text-left py-1">Ticker</th>
-                      <th className="text-left py-1">Yes Bid</th>
-                      <th className="text-left py-1">Yes Ask</th>
-                      <th className="text-left py-1">Volume</th>
-                      <th className="text-left py-1">Open Int.</th>
-                      <th className="text-left py-1">Book</th>
+                    <tr>
+                      <th className="pl-8">Contract</th>
+                      <th>Ticker</th>
+                      <th>Yes Bid</th>
+                      <th>Yes Ask</th>
+                      <th>Volume</th>
+                      <th>Open Int.</th>
+                      <th>Book</th>
                     </tr>
                   </thead>
                   <tbody>
@@ -154,10 +275,12 @@ function EventRow({ e }) {
   );
 }
 
+/* ─── Main Markets page ─── */
 export default function Markets() {
   const [events, setEvents] = useState([]);
   const [loading, setLoading] = useState(true);
   const [filter, setFilter] = useState('');
+  const [categoryFilter, setCategoryFilter] = useState('');
 
   useEffect(() => { loadEvents(); }, []);
 
@@ -170,33 +293,126 @@ export default function Markets() {
     setLoading(false);
   }
 
-  const filtered = events.filter(e =>
-    !filter || (e.title || '').toLowerCase().includes(filter.toLowerCase()) ||
-    (e.category || '').toLowerCase().includes(filter.toLowerCase())
-  );
+  const categories = [...new Set(events.map(e => e.category).filter(Boolean))].sort();
 
-  if (loading) return <div className="flex items-center justify-center h-64"><div className="animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full" /></div>;
+  const filtered = events.filter(e => {
+    const matchesText = !filter ||
+      (e.title || '').toLowerCase().includes(filter.toLowerCase()) ||
+      (e.category || '').toLowerCase().includes(filter.toLowerCase());
+    const matchesCat = !categoryFilter || e.category === categoryFilter;
+    return matchesText && matchesCat;
+  });
+
+  if (loading) {
+    return (
+      <div className="flex items-center justify-center h-64">
+        <div
+          className="animate-spin w-8 h-8 border-2 border-t-transparent rounded-full pulse-cyan"
+          style={{ borderColor: 'var(--cyan)', borderTopColor: 'transparent' }}
+        />
+      </div>
+    );
+  }
 
   return (
-    <div className="space-y-6">
+    <div className="space-y-6 fade-in">
+
+      {/* ── Page Header ── */}
       <div className="flex items-center justify-between">
         <div>
-          <h1 className="text-2xl font-bold">Markets</h1>
-          <p className="text-gray-500 text-sm">{events.length} events loaded</p>
+          <div className="flex items-center gap-3">
+            <h1 className="heading text-3xl font-bold" style={{ color: 'var(--text)' }}>
+              Markets
+            </h1>
+            <span className="badge bg-cyan">
+              {events.length} events
+            </span>
+            {filtered.length !== events.length && (
+              <span className="badge bg-orange">
+                {filtered.length} filtered
+              </span>
+            )}
+          </div>
+          <p className="section-subtitle mt-1">Live Kalshi prediction markets</p>
         </div>
-        <button onClick={loadEvents} className="btn btn-o text-sm">Refresh</button>
+        <button onClick={loadEvents} className="btn btn-o btn-sm">
+          ↻ Refresh
+        </button>
+      </div>
+
+      {/* ── Search Bar ── */}
+      <div className="relative">
+        <span
+          className="absolute left-3 top-1/2 -translate-y-1/2 text-sm pointer-events-none"
+          style={{ color: 'var(--text-muted)' }}
+        >
+          ⌕
+        </span>
+        <input
+          type="text"
+          value={filter}
+          onChange={e => setFilter(e.target.value)}
+          placeholder="Search markets by name or category..."
+          className="input pl-8"
+        />
       </div>
 
-      <input type="text" value={filter} onChange={e => setFilter(e.target.value)} placeholder="Filter by name or category..."
-        className="w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none" />
+      {/* ── Category Filter Pills ── */}
+      {categories.length > 0 && (
+        <div className="flex flex-wrap gap-2">
+          <button
+            onClick={() => setCategoryFilter('')}
+            className="badge transition cursor-pointer"
+            style={{
+              background: !categoryFilter ? 'var(--cyan-dim)' : 'rgba(42,42,53,0.6)',
+              color: !categoryFilter ? 'var(--cyan)' : 'var(--text-muted)',
+              border: !categoryFilter ? '1px solid rgba(0,240,255,0.3)' : '1px solid var(--border)',
+            }}
+          >
+            All
+          </button>
+          {categories.map(cat => (
+            <button
+              key={cat}
+              onClick={() => setCategoryFilter(cat === categoryFilter ? '' : cat)}
+              className="badge transition cursor-pointer"
+              style={{
+                background: categoryFilter === cat ? 'var(--orange-dim)' : 'rgba(42,42,53,0.6)',
+                color: categoryFilter === cat ? 'var(--orange)' : 'var(--text-muted)',
+                border: categoryFilter === cat ? '1px solid rgba(247,147,26,0.3)' : '1px solid var(--border)',
+              }}
+            >
+              {cat}
+            </button>
+          ))}
+        </div>
+      )}
 
-      <div className="card overflow-x-auto">
+      {/* ── Events Table ── */}
+      <div className="card overflow-x-auto" style={{ padding: 0 }}>
         <table>
-          <thead><tr><th>Event</th><th>Category</th><th>Ticker</th><th>Markets</th><th>Action</th></tr></thead>
+          <thead>
+            <tr>
+              <th className="pl-5">Event</th>
+              <th>Category</th>
+              <th>Ticker</th>
+              <th>Type</th>
+              <th>Contracts</th>
+            </tr>
+          </thead>
           <tbody>
             {filtered.length === 0 ? (
-              <tr><td colSpan={5} className="text-center text-gray-500 py-8">No events found</td></tr>
-            ) : filtered.map(e => <EventRow key={e.event_ticker} e={e} />)}
+              <tr>
+                <td colSpan={5} className="text-center py-12" style={{ color: 'var(--text-muted)' }}>
+                  <div className="flex flex-col items-center gap-2">
+                    <span className="text-2xl">⌕</span>
+                    <span className="text-sm">No markets match your filter</span>
+                  </div>
+                </td>
+              </tr>
+            ) : (
+              filtered.map(e => <EventRow key={e.event_ticker} e={e} />)
+            )}
           </tbody>
         </table>
       </div>
diff --git a/kalshi-dash/src/pages/Orbit.jsx b/kalshi-dash/src/pages/Orbit.jsx
index 26738bd..f620abb 100644
--- a/kalshi-dash/src/pages/Orbit.jsx
+++ b/kalshi-dash/src/pages/Orbit.jsx
@@ -3,33 +3,33 @@ import { api } from '../api';
 
 // ── Orbit Ring Configuration ──
 const ORBIT_RINGS = [
-  { radius: 80, label: 'Core', color: '#f59e0b', opacity: 0.4, description: 'Highest confidence' },
-  { radius: 160, label: 'Inner', color: '#22c55e', opacity: 0.3, description: 'Strong signals' },
-  { radius: 240, label: 'Mid', color: '#3b82f6', opacity: 0.2, description: 'Moderate signals' },
-  { radius: 320, label: 'Outer', color: '#8b5cf6', opacity: 0.15, description: 'Weak signals' },
-  { radius: 400, label: 'Edge', color: '#ef4444', opacity: 0.1, description: 'Speculative' },
+  { radius: 80,  label: 'Core',  color: '#00F0FF', opacity: 0.5,  description: 'Highest confidence' },
+  { radius: 160, label: 'Inner', color: '#00C389', opacity: 0.35, description: 'Strong signals' },
+  { radius: 240, label: 'Mid',   color: '#3B82F6', opacity: 0.25, description: 'Moderate signals' },
+  { radius: 320, label: 'Outer', color: '#A855F7', opacity: 0.18, description: 'Weak signals' },
+  { radius: 400, label: 'Edge',  color: '#FF5C5C', opacity: 0.12, description: 'Speculative' },
 ];
 
 const DIRECTION_COLORS = {
-  BUY_YES: { fill: '#22c55e', stroke: '#16a34a', glow: 'rgba(34,197,94,0.5)' },
-  BUY_NO:  { fill: '#ef4444', stroke: '#dc2626', glow: 'rgba(239,68,68,0.5)' },
-  YES:     { fill: '#22c55e', stroke: '#16a34a', glow: 'rgba(34,197,94,0.5)' },
-  NO:      { fill: '#ef4444', stroke: '#dc2626', glow: 'rgba(239,68,68,0.5)' },
+  BUY_YES: { fill: '#00C389', stroke: '#009E6F', glow: 'rgba(0,195,137,0.5)' },
+  BUY_NO:  { fill: '#FF5C5C', stroke: '#CC4A4A', glow: 'rgba(255,92,92,0.5)' },
+  YES:     { fill: '#00C389', stroke: '#009E6F', glow: 'rgba(0,195,137,0.5)' },
+  NO:      { fill: '#FF5C5C', stroke: '#CC4A4A', glow: 'rgba(255,92,92,0.5)' },
 };
 
 function getSignalColor(confidence) {
-  if (confidence >= 0.9) return '#22c55e';
-  if (confidence >= 0.7) return '#f59e0b';
-  if (confidence >= 0.5) return '#3b82f6';
-  if (confidence >= 0.3) return '#8b5cf6';
-  return '#ef4444';
+  if (confidence >= 0.9) return '#00C389';
+  if (confidence >= 0.7) return '#F7931A';
+  if (confidence >= 0.5) return '#3B82F6';
+  if (confidence >= 0.3) return '#A855F7';
+  return '#FF5C5C';
 }
 
 function getOrbitRing(confidence) {
-  if (confidence >= 0.9) return 0;
+  if (confidence >= 0.9)  return 0;
   if (confidence >= 0.75) return 1;
-  if (confidence >= 0.6) return 2;
-  if (confidence >= 0.4) return 3;
+  if (confidence >= 0.6)  return 2;
+  if (confidence >= 0.4)  return 3;
   return 4;
 }
 
@@ -42,7 +42,7 @@ function StarField({ width, height }) {
         x: Math.random() * width,
         y: Math.random() * height,
         r: Math.random() * 1.2 + 0.3,
-        opacity: Math.random() * 0.5 + 0.1,
+        opacity: Math.random() * 0.4 + 0.05,
         delay: Math.random() * 3,
       });
     }
@@ -73,6 +73,7 @@ function MarketNode({ market, cx, cy, size, isSelected, onSelect, animate }) {
   const confidence = parseFloat(market.confidence) || 0;
   const signalColor = getSignalColor(confidence);
   const pulseSize = size + 4;
+  const gradId = `gradient-${market.ticker?.replace(/[^a-zA-Z0-9]/g, '')}`;
 
   return (
     <g
@@ -80,7 +81,7 @@ function MarketNode({ market, cx, cy, size, isSelected, onSelect, animate }) {
       className="cursor-pointer"
       style={{ transition: 'all 0.5s ease-out' }}
     >
-      {/* Glow pulse */}
+      {/* Glow pulse ring */}
       <circle
         cx={cx}
         cy={cy}
@@ -88,12 +89,12 @@ function MarketNode({ market, cx, cy, size, isSelected, onSelect, animate }) {
         fill="none"
         stroke={dirColors.glow}
         strokeWidth={1.5}
-        opacity={isSelected ? 0.8 : 0.3}
+        opacity={isSelected ? 0.9 : 0.3}
         className={animate ? 'animate-ping' : ''}
         style={{ animationDuration: '2s', transformOrigin: `${cx}px ${cy}px` }}
       />
 
-      {/* Signal strength ring */}
+      {/* Signal strength dashed ring */}
       <circle
         cx={cx}
         cy={cy}
@@ -101,7 +102,7 @@ function MarketNode({ market, cx, cy, size, isSelected, onSelect, animate }) {
         fill="none"
         stroke={signalColor}
         strokeWidth={2}
-        opacity={0.6}
+        opacity={0.65}
         strokeDasharray={`${confidence * 20} ${(1 - confidence) * 20}`}
       />
 
@@ -110,17 +111,17 @@ function MarketNode({ market, cx, cy, size, isSelected, onSelect, animate }) {
         cx={cx}
         cy={cy}
         r={size}
-        fill={`url(#gradient-${market.ticker?.replace(/[^a-zA-Z0-9]/g, '')})`}
-        stroke={isSelected ? '#f59e0b' : dirColors.stroke}
+        fill={`url(#${gradId})`}
+        stroke={isSelected ? '#00F0FF' : dirColors.stroke}
         strokeWidth={isSelected ? 2.5 : 1}
         className="transition-all duration-300"
       />
 
       {/* Gradient definition */}
       <defs>
-        <radialGradient id={`gradient-${market.ticker?.replace(/[^a-zA-Z0-9]/g, '')}`}>
-          <stop offset="0%" stopColor={dirColors.fill} stopOpacity="0.9" />
-          <stop offset="70%" stopColor={dirColors.fill} stopOpacity="0.6" />
+        <radialGradient id={gradId}>
+          <stop offset="0%"   stopColor={dirColors.fill}   stopOpacity="0.9" />
+          <stop offset="70%"  stopColor={dirColors.fill}   stopOpacity="0.6" />
           <stop offset="100%" stopColor={dirColors.stroke} stopOpacity="0.4" />
         </radialGradient>
       </defs>
@@ -135,7 +136,7 @@ function MarketNode({ market, cx, cy, size, isSelected, onSelect, animate }) {
           fill="white"
           fontSize={Math.max(7, size * 0.6)}
           fontWeight="bold"
-          fontFamily="monospace"
+          fontFamily="'JetBrains Mono', monospace"
           style={{ pointerEvents: 'none' }}
         >
           {market.edge_display || ''}
@@ -148,8 +149,9 @@ function MarketNode({ market, cx, cy, size, isSelected, onSelect, animate }) {
           x={cx}
           y={cy + size + 12}
           textAnchor="middle"
-          fill="#94a3b8"
+          fill="#A8A8A8"
           fontSize={8}
+          fontFamily="'JetBrains Mono', monospace"
           style={{ pointerEvents: 'none' }}
         >
           {(market.shortTitle || '').substring(0, 18)}
@@ -166,62 +168,85 @@ function OrbitDetail({ market, onClose }) {
   const conf = parseFloat(market.confidence) || 0;
   const edge = parseFloat(market.expected_edge) || 0;
   const dirColors = DIRECTION_COLORS[market.direction] || DIRECTION_COLORS.BUY_YES;
+  const ringLabel = ORBIT_RINGS[getOrbitRing(conf)]?.label || 'Edge';
 
   return (
-    <div className="card border border-amber-500/30 bg-gradient-to-br from-gray-800/95 to-gray-900/95 backdrop-blur-md">
-      <div className="flex items-start justify-between mb-3">
+    <div className="card-glow fade-in">
+      <div className="flex items-start justify-between mb-4">
         <div className="flex-1 min-w-0 mr-4">
-          <div className="flex items-center gap-2 mb-1">
+          <div className="flex items-center gap-2 mb-2">
             <span className="inline-block w-3 h-3 rounded-full" style={{ backgroundColor: dirColors.fill }} />
-            <span className={`px-2 py-0.5 rounded text-[10px] font-bold ${
-              market.direction === 'BUY_YES' || market.direction === 'YES'
-                ? 'bg-green-500/20 text-green-400 border border-green-500/30'
-                : 'bg-red-500/20 text-red-400 border border-red-500/30'
-            }`}>
+            <span
+              className="badge"
+              style={
+                market.direction === 'BUY_YES' || market.direction === 'YES'
+                  ? { background: 'var(--green-dim)', color: 'var(--green)' }
+                  : { background: 'var(--red-dim)', color: 'var(--red)' }
+              }
+            >
               {market.direction}
             </span>
-            {market.risk_approved && (
-              <span className="px-2 py-0.5 rounded text-[10px] font-bold bg-green-500/15 text-green-400 border border-green-500/20">APPROVED</span>
-            )}
-            {!market.risk_approved && (
-              <span className="px-2 py-0.5 rounded text-[10px] font-bold bg-red-500/15 text-red-400 border border-red-500/20">BLOCKED</span>
+            {market.risk_approved ? (
+              <span className="badge bg-green">APPROVED</span>
+            ) : (
+              <span className="badge bg-red">BLOCKED</span>
             )}
           </div>
-          <h3 className="text-sm font-bold text-gray-100">{market.title || market.ticker}</h3>
-          <p className="text-xs text-gray-500 font-mono mt-1">{market.ticker}</p>
+          <h3 className="heading text-sm font-bold" style={{ color: 'var(--text)' }}>
+            {market.title || market.ticker}
+          </h3>
+          <p className="mono text-xs mt-1" style={{ color: 'var(--text-muted)' }}>{market.ticker}</p>
         </div>
-        <button onClick={onClose} className="text-gray-500 hover:text-gray-300 text-lg">&times;</button>
+        <button onClick={onClose} className="btn btn-ghost text-lg leading-none" style={{ padding: '0 6px' }}>
+          &times;
+        </button>
       </div>
 
-      <div className="grid grid-cols-3 gap-3 mb-3">
-        <div className="rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50 text-center">
-          <p className="text-[9px] text-gray-500 uppercase">Edge</p>
-          <p className="text-lg font-bold text-amber-400 font-mono">{(edge * 100).toFixed(1)}%</p>
-        </div>
-        <div className="rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50 text-center">
-          <p className="text-[9px] text-gray-500 uppercase">Confidence</p>
-          <p className="text-lg font-bold font-mono" style={{ color: getSignalColor(conf) }}>{(conf * 100).toFixed(0)}%</p>
-        </div>
-        <div className="rounded-lg bg-gray-800/60 p-2.5 border border-gray-700/50 text-center">
-          <p className="text-[9px] text-gray-500 uppercase">Orbit Ring</p>
-          <p className="text-lg font-bold text-purple-400">{ORBIT_RINGS[getOrbitRing(conf)]?.label || 'Edge'}</p>
-        </div>
+      <div className="grid grid-cols-3 gap-3 mb-4">
+        {[
+          { label: 'Edge',        value: `${(edge * 100).toFixed(1)}%`,  color: 'var(--orange)' },
+          { label: 'Confidence',  value: `${(conf * 100).toFixed(0)}%`,  color: getSignalColor(conf) },
+          { label: 'Orbit Ring',  value: ringLabel,                       color: 'var(--purple)' },
+        ].map(s => (
+          <div
+            key={s.label}
+            className="rounded-lg p-2.5 text-center"
+            style={{ background: 'var(--surface-el)', border: '1px solid var(--border)' }}
+          >
+            <p className="stat-label mb-1">{s.label}</p>
+            <p className="stat-v text-lg" style={{ color: s.color }}>{s.value}</p>
+          </div>
+        ))}
       </div>
 
       {market.reasoning && (
-        <div className="text-[11px] text-gray-400 bg-gray-800/40 rounded-lg px-3 py-2 border border-gray-700/30 mb-3 leading-relaxed">
+        <div
+          className="text-[11px] rounded-lg px-3 py-2 mb-3 leading-relaxed"
+          style={{
+            color: 'var(--text-dim)',
+            background: 'var(--surface-el)',
+            border: '1px solid var(--border)',
+          }}
+        >
           {market.reasoning}
         </div>
       )}
 
       {market.sources && market.sources.length > 0 && (
         <div className="space-y-1.5">
-          <p className="text-[10px] text-gray-500 uppercase font-medium">Signal Sources</p>
+          <p className="stat-label mb-1">Signal Sources</p>
           {market.sources.map((src, i) => (
-            <div key={i} className="flex items-center gap-2 text-xs bg-gray-800/30 rounded-lg px-3 py-2 border border-gray-700/20">
-              <span className="px-1.5 py-0.5 rounded bg-blue-500/15 text-blue-400 text-[9px] font-bold">{src.source}</span>
-              <span className="text-gray-400 truncate flex-1">{src.headline}</span>
-              <span className={`font-mono text-[10px] ${src.sentiment > 0 ? 'text-green-400' : src.sentiment < 0 ? 'text-red-400' : 'text-gray-500'}`}>
+            <div
+              key={i}
+              className="flex items-center gap-2 text-xs rounded-lg px-3 py-2"
+              style={{ background: 'var(--surface-el)', border: '1px solid var(--border)' }}
+            >
+              <span className="badge bg-blue">{src.source}</span>
+              <span className="truncate flex-1" style={{ color: 'var(--text-dim)' }}>{src.headline}</span>
+              <span
+                className="mono text-[10px]"
+                style={{ color: src.sentiment > 0 ? 'var(--green)' : src.sentiment < 0 ? 'var(--red)' : 'var(--text-muted)' }}
+              >
                 {src.sentiment > 0 ? '+' : ''}{src.sentiment?.toFixed(2)}
               </span>
             </div>
@@ -229,8 +254,14 @@ function OrbitDetail({ market, onClose }) {
         </div>
       )}
 
-      <div className="mt-3 text-[10px] text-gray-600">
-        Signal created: {market.created_at ? new Date(market.created_at).toLocaleString('en-US', { timeZone: 'America/Los_Angeles', hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric' }) : 'Unknown'}
+      <div className="mt-3 text-[10px]" style={{ color: 'var(--text-muted)' }}>
+        Signal created:{' '}
+        {market.created_at
+          ? new Date(market.created_at).toLocaleString('en-US', {
+              timeZone: 'America/Los_Angeles',
+              hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric',
+            })
+          : 'Unknown'}
       </div>
     </div>
   );
@@ -273,7 +304,6 @@ export default function Orbit() {
       const edge = parseFloat(s.expected_edge) || 0;
       const ring = getOrbitRing(conf);
 
-      // Extract short title from ticker
       const parts = (s.ticker || '').split('-');
       const shortTitle = parts[0]?.replace('KX', '').substring(0, 12) || s.ticker;
 
@@ -294,11 +324,10 @@ export default function Orbit() {
     if (filter === 'yes') items = items.filter(i => i.direction === 'BUY_YES');
     if (filter === 'no') items = items.filter(i => i.direction === 'BUY_NO');
 
-    // Limit to prevent overcrowding (take top by edge)
+    // Limit to top 60 by edge
     items.sort((a, b) => b.edge - a.edge);
     items = items.slice(0, 60);
 
-    // Stats
     const approved = items.filter(i => i.risk_approved).length;
     const buyYes = items.filter(i => i.direction === 'BUY_YES').length;
     const buyNo = items.filter(i => i.direction === 'BUY_NO').length;
@@ -315,7 +344,10 @@ export default function Orbit() {
 
   if (loading) return (
     <div className="flex items-center justify-center h-64">
-      <div className="animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full" />
+      <div
+        className="w-8 h-8 rounded-full border-2 border-t-transparent animate-spin"
+        style={{ borderColor: 'var(--cyan)', borderTopColor: 'transparent' }}
+      />
     </div>
   );
 
@@ -337,13 +369,11 @@ export default function Orbit() {
     const idx = ringIndices[m.ring]++;
     const count = ringCounts[m.ring];
 
-    // Distribute evenly with slight randomness for organic feel
     const angleStep = (2 * Math.PI) / count;
-    const angle = angleStep * idx + (m.ring * 0.4); // offset per ring to avoid alignment
-    const jitter = (Math.sin(idx * 7.3) * 0.15); // deterministic jitter
-
+    const angle = angleStep * idx + (m.ring * 0.4);
+    const jitter = (Math.sin(idx * 7.3) * 0.15);
     const effectiveAngle = angle + jitter;
-    const radiusJitter = ring.radius + (Math.cos(idx * 3.7) * 15); // slight radius variation
+    const radiusJitter = ring.radius + (Math.cos(idx * 3.7) * 15);
 
     return {
       ...m,
@@ -352,65 +382,86 @@ export default function Orbit() {
     };
   });
 
+  const filterOptions = [
+    { key: 'all', label: 'All' },
+    { key: 'approved', label: 'Approved' },
+    { key: 'yes', label: 'BUY YES' },
+    { key: 'no', label: 'BUY NO' },
+  ];
+
+  const summaryStats = [
+    { label: 'Active Signals', value: stats.total || 0,                           color: 'var(--cyan)' },
+    { label: 'Risk Approved',  value: stats.approved || 0,                         color: 'var(--green)' },
+    { label: 'BUY YES',        value: stats.buyYes || 0,                           color: 'var(--green)' },
+    { label: 'BUY NO',         value: stats.buyNo || 0,                            color: 'var(--red)' },
+    { label: 'Avg Confidence', value: `${((stats.avgConf || 0) * 100).toFixed(0)}%`, color: 'var(--blue)' },
+    { label: 'Avg Edge',       value: `${((stats.avgEdge || 0) * 100).toFixed(1)}%`, color: 'var(--purple)' },
+  ];
+
   return (
     <div className="space-y-6">
-      {/* Header */}
+      {/* Page Header */}
       <div className="flex items-center justify-between">
         <div>
-          <h1 className="text-2xl font-bold">Signal Orbit</h1>
-          <p className="text-gray-500 text-sm">Radial visualization -- distance from center = confidence, size = edge strength</p>
+          <h1 className="heading text-2xl font-bold flex items-center gap-2">
+            <span style={{ color: 'var(--cyan)' }}>&#9680;</span>
+            <span className="gradient-cyan">Signal Orbit</span>
+          </h1>
+          <p className="section-subtitle mt-1">
+            Radial visualization — distance from center = confidence, size = edge strength
+          </p>
         </div>
         <div className="flex items-center gap-3">
-          <div className="flex items-center gap-1 bg-gray-800 rounded-lg p-0.5">
-            {[
-              { key: 'all', label: 'All' },
-              { key: 'approved', label: 'Approved' },
-              { key: 'yes', label: 'BUY YES' },
-              { key: 'no', label: 'BUY NO' },
-            ].map(f => (
+          {/* Filter toggle group */}
+          <div
+            className="flex items-center gap-0.5 rounded-lg p-0.5"
+            style={{ background: 'var(--surface-el)', border: '1px solid var(--border)' }}
+          >
+            {filterOptions.map(f => (
               <button
                 key={f.key}
                 onClick={() => setFilter(f.key)}
-                className={`px-3 py-1.5 text-xs font-medium rounded-md transition ${
-                  filter === f.key ? 'bg-amber-500 text-black' : 'text-gray-400 hover:text-gray-200'
-                }`}
+                className="btn btn-sm"
+                style={filter === f.key
+                  ? { background: 'var(--cyan)', color: 'var(--bg)', fontWeight: 700 }
+                  : { background: 'transparent', color: 'var(--text-muted)' }
+                }
               >
                 {f.label}
               </button>
             ))}
           </div>
-          <label className="flex items-center gap-2 text-xs text-gray-400 cursor-pointer">
+
+          <label className="flex items-center gap-2 text-xs cursor-pointer" style={{ color: 'var(--text-dim)' }}>
             <input
               type="checkbox"
               checked={animating}
               onChange={e => setAnimating(e.target.checked)}
-              className="rounded border-gray-600"
+              className="rounded"
+              style={{ accentColor: 'var(--cyan)' }}
             />
             Animate
           </label>
-          <button onClick={load} className="btn btn-o text-sm">Refresh</button>
+
+          <button onClick={load} className="btn btn-o btn-sm">Refresh</button>
         </div>
       </div>
 
-      {/* Stats */}
+      {/* Stats Row */}
       <div className="grid grid-cols-6 gap-3">
-        {[
-          { label: 'Active Signals', value: stats.total || 0, color: 'text-amber-400' },
-          { label: 'Risk Approved', value: stats.approved || 0, color: 'text-green-400' },
-          { label: 'BUY YES', value: stats.buyYes || 0, color: 'text-green-400' },
-          { label: 'BUY NO', value: stats.buyNo || 0, color: 'text-red-400' },
-          { label: 'Avg Confidence', value: `${(stats.avgConf * 100).toFixed(0)}%`, color: 'text-blue-400' },
-          { label: 'Avg Edge', value: `${(stats.avgEdge * 100).toFixed(1)}%`, color: 'text-purple-400' },
-        ].map(s => (
+        {summaryStats.map(s => (
           <div key={s.label} className="card">
-            <p className="text-[10px] text-gray-500 uppercase mb-1">{s.label}</p>
-            <p className={`text-xl font-bold ${s.color}`}>{s.value}</p>
+            <p className="stat-label mb-1">{s.label}</p>
+            <p className="stat-v" style={{ color: s.color }}>{s.value}</p>
           </div>
         ))}
       </div>
 
-      {/* Orbit Visualization */}
-      <div className="card p-0 overflow-hidden relative" style={{ background: 'radial-gradient(ellipse at center, #0f172a 0%, #020617 70%, #000 100%)' }}>
+      {/* Orbit SVG Visualization */}
+      <div
+        className="card p-0 overflow-hidden relative"
+        style={{ background: 'radial-gradient(ellipse at center, #0D1B2E 0%, #080D14 60%, var(--bg) 100%)' }}
+      >
         <svg
           ref={svgRef}
           viewBox={`0 0 ${SVG_W} ${SVG_H}`}
@@ -433,29 +484,28 @@ export default function Orbit() {
                 opacity={ring.opacity}
                 strokeDasharray="4 4"
               />
-              {/* Ring label */}
               <text
                 x={CX + ring.radius + 6}
                 y={CY - 4}
                 fill={ring.color}
                 fontSize={9}
                 opacity={ring.opacity + 0.2}
-                fontFamily="monospace"
+                fontFamily="'JetBrains Mono', monospace"
               >
                 {ring.label}
               </text>
             </g>
           ))}
 
-          {/* Center sun */}
+          {/* Center sun — cyan glow */}
           <defs>
             <radialGradient id="sun-gradient">
-              <stop offset="0%" stopColor="#fbbf24" stopOpacity="1" />
-              <stop offset="50%" stopColor="#f59e0b" stopOpacity="0.8" />
-              <stop offset="100%" stopColor="#d97706" stopOpacity="0.4" />
+              <stop offset="0%"   stopColor="#00F0FF" stopOpacity="1" />
+              <stop offset="50%"  stopColor="#00B8C8" stopOpacity="0.8" />
+              <stop offset="100%" stopColor="#006070" stopOpacity="0.4" />
             </radialGradient>
             <filter id="sun-glow">
-              <feGaussianBlur stdDeviation="8" result="blur" />
+              <feGaussianBlur stdDeviation="10" result="blur" />
               <feMerge>
                 <feMergeNode in="blur" />
                 <feMergeNode in="SourceGraphic" />
@@ -463,13 +513,30 @@ export default function Orbit() {
             </filter>
           </defs>
 
-          {/* Sun glow */}
-          <circle cx={CX} cy={CY} r={40} fill="url(#sun-gradient)" filter="url(#sun-glow)" opacity={0.6} />
+          <circle cx={CX} cy={CY} r={40} fill="url(#sun-gradient)" filter="url(#sun-glow)" opacity={0.55} />
           <circle cx={CX} cy={CY} r={25} fill="url(#sun-gradient)" />
 
           {/* KEN label in center */}
-          <text x={CX} y={CY - 4} textAnchor="middle" fill="#000" fontSize={12} fontWeight="bold" fontFamily="monospace">KEN</text>
-          <text x={CX} y={CY + 10} textAnchor="middle" fill="#000" fontSize={7} fontFamily="monospace" opacity={0.7}>TRADER</text>
+          <text
+            x={CX} y={CY - 4}
+            textAnchor="middle"
+            fill="#0E0E10"
+            fontSize={12}
+            fontWeight="bold"
+            fontFamily="'JetBrains Mono', monospace"
+          >
+            KEN
+          </text>
+          <text
+            x={CX} y={CY + 10}
+            textAnchor="middle"
+            fill="#0E0E10"
+            fontSize={7}
+            fontFamily="'JetBrains Mono', monospace"
+            opacity={0.7}
+          >
+            TRADER
+          </text>
 
           {/* Connection lines from markets to center */}
           {positionedMarkets.map(m => {
@@ -482,8 +549,8 @@ export default function Orbit() {
                 x2={m.cx}
                 y2={m.cy}
                 stroke={dirColors.fill}
-                strokeWidth={0.3}
-                opacity={selectedTicker === m.ticker ? 0.5 : 0.08}
+                strokeWidth={0.4}
+                opacity={selectedTicker === m.ticker ? 0.6 : 0.1}
               />
             );
           })}
@@ -503,32 +570,46 @@ export default function Orbit() {
           ))}
         </svg>
 
-        {/* Legend overlay */}
-        <div className="absolute bottom-3 left-3 bg-gray-900/80 backdrop-blur-sm rounded-lg p-3 border border-gray-700/50">
+        {/* Bottom legend overlay */}
+        <div
+          className="absolute bottom-3 left-3 rounded-lg p-3"
+          style={{
+            background: 'rgba(14,14,16,0.85)',
+            backdropFilter: 'blur(8px)',
+            border: '1px solid var(--border)',
+          }}
+        >
           <div className="flex items-center gap-4 text-[10px]">
             <div className="flex items-center gap-1.5">
-              <div className="w-3 h-3 rounded-full bg-green-500" />
-              <span className="text-gray-400">BUY YES</span>
+              <div className="w-3 h-3 rounded-full" style={{ backgroundColor: 'var(--green)' }} />
+              <span style={{ color: 'var(--text-dim)' }}>BUY YES</span>
             </div>
             <div className="flex items-center gap-1.5">
-              <div className="w-3 h-3 rounded-full bg-red-500" />
-              <span className="text-gray-400">BUY NO</span>
+              <div className="w-3 h-3 rounded-full" style={{ backgroundColor: 'var(--red)' }} />
+              <span style={{ color: 'var(--text-dim)' }}>BUY NO</span>
             </div>
-            <div className="text-gray-600">|</div>
-            <span className="text-gray-500">Closer to center = higher confidence</span>
-            <span className="text-gray-500">Larger = bigger edge</span>
+            <span style={{ color: 'var(--border-light)' }}>|</span>
+            <span style={{ color: 'var(--text-muted)' }}>Closer to center = higher confidence</span>
+            <span style={{ color: 'var(--text-muted)' }}>Larger = bigger edge</span>
           </div>
         </div>
 
-        {/* Ring legend */}
-        <div className="absolute top-3 right-3 bg-gray-900/80 backdrop-blur-sm rounded-lg p-2.5 border border-gray-700/50">
-          <p className="text-[9px] text-gray-500 uppercase font-bold mb-1.5">Orbit Rings</p>
+        {/* Top-right ring legend */}
+        <div
+          className="absolute top-3 right-3 rounded-lg p-2.5"
+          style={{
+            background: 'rgba(14,14,16,0.85)',
+            backdropFilter: 'blur(8px)',
+            border: '1px solid var(--border)',
+          }}
+        >
+          <p className="stat-label mb-1.5">Orbit Rings</p>
           <div className="space-y-1">
             {ORBIT_RINGS.map((ring, i) => (
               <div key={i} className="flex items-center gap-2 text-[10px]">
                 <div className="w-2 h-2 rounded-full" style={{ backgroundColor: ring.color, opacity: ring.opacity + 0.3 }} />
                 <span style={{ color: ring.color }}>{ring.label}</span>
-                <span className="text-gray-600">{ring.description}</span>
+                <span style={{ color: 'var(--text-muted)' }}>{ring.description}</span>
               </div>
             ))}
           </div>
@@ -543,8 +624,10 @@ export default function Orbit() {
       {/* Top Signals Table */}
       <div className="card">
         <div className="flex items-center gap-2 mb-4">
-          <h2 className="font-semibold">Orbital Signal Registry</h2>
-          <span className="text-xs text-gray-500">{orbitalMarkets.length} signals in orbit</span>
+          <h2 className="section-title">Orbital Signal Registry</h2>
+          <span className="text-xs" style={{ color: 'var(--text-muted)' }}>
+            {orbitalMarkets.length} signals in orbit
+          </span>
         </div>
         <div className="overflow-x-auto">
           <table>
@@ -566,31 +649,43 @@ export default function Orbit() {
                   <tr
                     key={m.ticker}
                     onClick={() => setSelectedTicker(m.ticker === selectedTicker ? null : m.ticker)}
-                    className={`cursor-pointer ${selectedTicker === m.ticker ? 'bg-amber-500/10' : ''}`}
+                    className="cursor-pointer"
+                    style={selectedTicker === m.ticker ? { background: 'var(--cyan-glow)' } : {}}
                   >
                     <td>
-                      <span className="text-xs font-bold" style={{ color: ring.color }}>{ring.label}</span>
+                      <span className="text-xs font-bold heading" style={{ color: ring.color }}>
+                        {ring.label}
+                      </span>
                     </td>
-                    <td className="text-xs font-mono text-gray-300">{m.ticker}</td>
+                    <td className="mono text-xs" style={{ color: 'var(--text-dim)' }}>{m.ticker}</td>
                     <td>
-                      <span className={`px-2 py-0.5 rounded text-[10px] font-bold ${
-                        m.direction === 'BUY_YES'
-                          ? 'bg-green-500/20 text-green-400'
-                          : 'bg-red-500/20 text-red-400'
-                      }`}>
+                      <span
+                        className="badge"
+                        style={
+                          m.direction === 'BUY_YES'
+                            ? { background: 'var(--green-dim)', color: 'var(--green)' }
+                            : { background: 'var(--red-dim)', color: 'var(--red)' }
+                        }
+                      >
                         {m.direction}
                       </span>
                     </td>
-                    <td className="text-amber-400 font-mono font-bold text-sm">{(m.edge * 100).toFixed(1)}%</td>
-                    <td className="font-mono text-sm" style={{ color: getSignalColor(m.conf) }}>{(m.conf * 100).toFixed(0)}%</td>
+                    <td className="mono font-bold text-sm" style={{ color: 'var(--orange)' }}>
+                      {(m.edge * 100).toFixed(1)}%
+                    </td>
+                    <td className="mono text-sm" style={{ color: getSignalColor(m.conf) }}>
+                      {(m.conf * 100).toFixed(0)}%
+                    </td>
                     <td>
                       {m.risk_approved ? (
-                        <span className="text-green-400 text-xs font-bold">OK</span>
+                        <span className="text-xs font-bold" style={{ color: 'var(--green)' }}>OK</span>
                       ) : (
-                        <span className="text-red-400 text-xs font-bold">BLOCKED</span>
+                        <span className="text-xs font-bold" style={{ color: 'var(--red)' }}>BLOCKED</span>
                       )}
                     </td>
-                    <td className="text-xs text-gray-500">{m.sources?.length || 0}</td>
+                    <td className="text-xs" style={{ color: 'var(--text-muted)' }}>
+                      {m.sources?.length || 0}
+                    </td>
                   </tr>
                 );
               })}
diff --git a/kalshi-dash/src/pages/Orders.jsx b/kalshi-dash/src/pages/Orders.jsx
index e5109f5..286c612 100644
--- a/kalshi-dash/src/pages/Orders.jsx
+++ b/kalshi-dash/src/pages/Orders.jsx
@@ -1,6 +1,56 @@
 import React, { useState, useEffect } from 'react';
 import { post } from '../api';
 
+// ── Status badge mapping ──
+function statusBadge(status) {
+  if (status === 'filled') return 'bg-green';
+  if (status === 'resting') return 'bg-orange';
+  if (status === 'canceled') return 'bg-red';
+  return 'bg-blue';
+}
+
+// ── Empty state ──
+function EmptyState({ label }) {
+  return (
+    <tr>
+      <td colSpan={20}>
+        <div className="flex flex-col items-center justify-center py-16 gap-3">
+          <svg
+            width="40"
+            height="40"
+            viewBox="0 0 24 24"
+            fill="none"
+            stroke="currentColor"
+            strokeWidth="1.5"
+            strokeLinecap="round"
+            strokeLinejoin="round"
+            style={{ color: 'var(--text-muted)' }}
+          >
+            <path d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2" />
+            <rect x="9" y="3" width="6" height="4" rx="1" />
+            <path d="M9 12h6M9 16h4" />
+          </svg>
+          <p style={{ color: 'var(--text-muted)', fontFamily: 'var(--font-body)', fontSize: '0.875rem' }}>
+            {label}
+          </p>
+        </div>
+      </td>
+    </tr>
+  );
+}
+
+// ── Spinner ──
+function Spinner() {
+  return (
+    <div className="flex items-center justify-center h-64">
+      <div
+        className="w-9 h-9 rounded-full border-2 animate-spin"
+        style={{ borderColor: 'var(--border)', borderTopColor: 'var(--cyan)' }}
+      />
+    </div>
+  );
+}
+
 export default function Orders() {
   const [orders, setOrders] = useState([]);
   const [fills, setFills] = useState([]);
@@ -29,76 +79,220 @@ export default function Orders() {
     } catch {}
   }
 
-  if (loading) return <div className="flex items-center justify-center h-64"><div className="animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full" /></div>;
+  if (loading) return <Spinner />;
 
   return (
-    <div className="space-y-6">
+    <div className="space-y-6 fade-in">
+
+      {/* ── Page Header ── */}
       <div className="flex items-center justify-between">
-        <div>
-          <h1 className="text-2xl font-bold">Orders & Fills</h1>
-          <p className="text-gray-500 text-sm">{orders.length} orders, {fills.length} fills</p>
+        <div className="flex items-center gap-3">
+          {/* Arrows icon */}
+          <div
+            className="flex items-center justify-center w-10 h-10 rounded-xl"
+            style={{ background: 'var(--cyan-dim)', color: 'var(--cyan)' }}
+          >
+            <svg
+              width="20"
+              height="20"
+              viewBox="0 0 24 24"
+              fill="none"
+              stroke="currentColor"
+              strokeWidth="2"
+              strokeLinecap="round"
+              strokeLinejoin="round"
+            >
+              <path d="M7 16V4m0 0L3 8m4-4l4 4" />
+              <path d="M17 8v12m0 0l4-4m-4 4l-4-4" />
+            </svg>
+          </div>
+          <div>
+            <h1 className="heading text-3xl" style={{ color: 'var(--text)' }}>Orders</h1>
+            <p className="section-subtitle mt-0.5">
+              {orders.length} orders &bull; {fills.length} fills
+            </p>
+          </div>
         </div>
-        <button onClick={load} className="btn btn-o text-sm">Refresh</button>
+        <button onClick={load} className="btn btn-o btn-sm">Refresh</button>
       </div>
 
-      <div className="flex gap-2">
-        <button onClick={() => setTab('orders')} className={`btn text-sm ${tab === 'orders' ? 'btn-p' : 'btn-o'}`}>Orders ({orders.length})</button>
-        <button onClick={() => setTab('fills')} className={`btn text-sm ${tab === 'fills' ? 'btn-p' : 'btn-o'}`}>Fills ({fills.length})</button>
+      {/* ── Tab Switcher ── */}
+      <div
+        className="flex rounded-xl p-1 gap-1 w-fit"
+        style={{ background: 'var(--surface-el)', border: '1px solid var(--border)' }}
+      >
+        <button
+          onClick={() => setTab('orders')}
+          className="btn btn-sm"
+          style={
+            tab === 'orders'
+              ? { background: 'var(--cyan)', color: 'var(--bg)' }
+              : { background: 'transparent', color: 'var(--text-muted)', border: 'none' }
+          }
+        >
+          Orders
+          <span
+            className="badge ml-1"
+            style={
+              tab === 'orders'
+                ? { background: 'rgba(0,0,0,0.2)', color: 'var(--bg)', fontSize: '0.65rem' }
+                : { background: 'var(--surface)', color: 'var(--text-muted)', fontSize: '0.65rem' }
+            }
+          >
+            {orders.length}
+          </span>
+        </button>
+        <button
+          onClick={() => setTab('fills')}
+          className="btn btn-sm"
+          style={
+            tab === 'fills'
+              ? { background: 'var(--cyan)', color: 'var(--bg)' }
+              : { background: 'transparent', color: 'var(--text-muted)', border: 'none' }
+          }
+        >
+          Fills
+          <span
+            className="badge ml-1"
+            style={
+              tab === 'fills'
+                ? { background: 'rgba(0,0,0,0.2)', color: 'var(--bg)', fontSize: '0.65rem' }
+                : { background: 'var(--surface)', color: 'var(--text-muted)', fontSize: '0.65rem' }
+            }
+          >
+            {fills.length}
+          </span>
+        </button>
       </div>
 
-      {tab === 'orders' ? (
-        <div className="card overflow-x-auto">
+      {/* ── Orders Table ── */}
+      {tab === 'orders' && (
+        <div className="card overflow-x-auto" style={{ padding: 0 }}>
           <table>
-            <thead><tr><th>Ticker</th><th>Side</th><th>Action</th><th>Type</th><th>Price</th><th>Qty</th><th>Filled</th><th>Status</th><th></th></tr></thead>
+            <thead>
+              <tr>
+                <th>Ticker</th>
+                <th>Side</th>
+                <th>Action</th>
+                <th>Type</th>
+                <th>Price</th>
+                <th>Qty</th>
+                <th>Filled</th>
+                <th>Status</th>
+                <th>Action</th>
+              </tr>
+            </thead>
             <tbody>
               {orders.length === 0 ? (
-                <tr><td colSpan={9} className="text-center text-gray-500 py-8">No orders</td></tr>
-              ) : orders.map((o, i) => (
-                <tr key={i}>
-                  <td className="font-mono text-xs">
-                    <a href={`https://kalshi.com/search?query=${encodeURIComponent((o.ticker || '').split('-')[0])}`} target="_blank" rel="noopener noreferrer" className="text-amber-400 hover:text-amber-300 hover:underline transition">
-                      {o.ticker}
-                    </a>
-                  </td>
-                  <td><span className={`badge ${o.side === 'yes' ? 'bg-green' : 'bg-red'}`}>{(o.side || '').toUpperCase()}</span></td>
-                  <td className="text-xs text-gray-400">{(o.action || '').toUpperCase()}</td>
-                  <td className="text-xs">{o.type}</td>
-                  <td className="font-mono">{o.yes_price || o.no_price || '—'}c</td>
-                  <td className="font-mono">{o.count || o.remaining_count || 0}</td>
-                  <td className="font-mono text-green-400">{o.count - (o.remaining_count || 0)}</td>
-                  <td><span className={`badge ${o.status === 'resting' ? 'bg-blue' : o.status === 'filled' ? 'bg-green' : o.status === 'canceled' ? 'bg-red' : 'bg-yellow'}`}>{o.status}</span></td>
-                  <td>
-                    {o.status === 'resting' && (
-                      <button onClick={() => cancelOrder(o.order_id)} className="text-xs text-red-400 hover:text-red-300">Cancel</button>
-                    )}
-                  </td>
-                </tr>
-              ))}
+                <EmptyState label="No orders yet" />
+              ) : (
+                orders.map((o, i) => (
+                  <tr key={i}>
+                    <td>
+                      <a
+                        href={`https://kalshi.com/search?query=${encodeURIComponent((o.ticker || '').split('-')[0])}`}
+                        target="_blank"
+                        rel="noopener noreferrer"
+                        className="mono text-xs hover:underline transition"
+                        style={{ color: 'var(--orange)' }}
+                      >
+                        {o.ticker}
+                      </a>
+                    </td>
+                    <td>
+                      <span className={`badge ${o.side === 'yes' ? 'bg-green' : 'bg-red'}`}>
+                        {(o.side || '').toUpperCase()}
+                      </span>
+                    </td>
+                    <td className="text-xs" style={{ color: 'var(--text-dim)' }}>
+                      {(o.action || '').toUpperCase()}
+                    </td>
+                    <td className="text-xs" style={{ color: 'var(--text-muted)' }}>{o.type}</td>
+                    <td className="mono" style={{ color: 'var(--cyan)' }}>
+                      {o.yes_price || o.no_price || '—'}¢
+                    </td>
+                    <td className="mono">{o.count || o.remaining_count || 0}</td>
+                    <td className="mono text-green">
+                      {o.count - (o.remaining_count || 0)}
+                    </td>
+                    <td>
+                      <span className={`badge ${statusBadge(o.status)}`}>{o.status}</span>
+                    </td>
+                    <td>
+                      {o.status === 'resting' && (
+                        <button
+                          onClick={() => cancelOrder(o.order_id)}
+                          className="btn btn-d btn-sm"
+                        >
+                          Cancel
+                        </button>
+                      )}
+                    </td>
+                  </tr>
+                ))
+              )}
             </tbody>
           </table>
         </div>
-      ) : (
-        <div className="card overflow-x-auto">
+      )}
+
+      {/* ── Fills Table ── */}
+      {tab === 'fills' && (
+        <div className="card overflow-x-auto" style={{ padding: 0 }}>
           <table>
-            <thead><tr><th>Ticker</th><th>Side</th><th>Action</th><th>Price</th><th>Qty</th><th>Taker</th><th>Time</th></tr></thead>
+            <thead>
+              <tr>
+                <th>Ticker</th>
+                <th>Side</th>
+                <th>Action</th>
+                <th>Price</th>
+                <th>Qty</th>
+                <th>Maker/Taker</th>
+                <th>Time</th>
+              </tr>
+            </thead>
             <tbody>
               {fills.length === 0 ? (
-                <tr><td colSpan={7} className="text-center text-gray-500 py-8">No fills</td></tr>
-              ) : fills.map((f, i) => (
-                <tr key={i}>
-                  <td className="font-mono text-xs">
-                    <a href={`https://kalshi.com/search?query=${encodeURIComponent((f.ticker || '').split('-')[0])}`} target="_blank" rel="noopener noreferrer" className="text-amber-400 hover:text-amber-300 hover:underline transition">
-                      {f.ticker}
-                    </a>
-                  </td>
-                  <td><span className={`badge ${f.side === 'yes' ? 'bg-green' : 'bg-red'}`}>{(f.side || '').toUpperCase()}</span></td>
-                  <td className="text-xs text-gray-400">{(f.action || '').toUpperCase()}</td>
-                  <td className="font-mono">{f.yes_price || f.no_price || '—'}c</td>
-                  <td className="font-mono">{f.count}</td>
-                  <td>{f.is_taker ? <span className="text-yellow-400 text-xs">TAKER</span> : <span className="text-green-400 text-xs">MAKER</span>}</td>
-                  <td className="text-xs text-gray-500">{f.created_time ? new Date(f.created_time).toLocaleString() : '—'}</td>
-                </tr>
-              ))}
+                <EmptyState label="No fills yet" />
+              ) : (
+                fills.map((f, i) => (
+                  <tr key={i}>
+                    <td>
+                      <a
+                        href={`https://kalshi.com/search?query=${encodeURIComponent((f.ticker || '').split('-')[0])}`}
+                        target="_blank"
+                        rel="noopener noreferrer"
+                        className="mono text-xs hover:underline transition"
+                        style={{ color: 'var(--orange)' }}
+                      >
+                        {f.ticker}
+                      </a>
+                    </td>
+                    <td>
+                      <span className={`badge ${f.side === 'yes' ? 'bg-green' : 'bg-red'}`}>
+                        {(f.side || '').toUpperCase()}
+                      </span>
+                    </td>
+                    <td className="text-xs" style={{ color: 'var(--text-dim)' }}>
+                      {(f.action || '').toUpperCase()}
+                    </td>
+                    <td className="mono" style={{ color: 'var(--cyan)' }}>
+                      {f.yes_price || f.no_price || '—'}¢
+                    </td>
+                    <td className="mono">{f.count}</td>
+                    <td>
+                      {f.is_taker ? (
+                        <span className="badge bg-orange">TAKER</span>
+                      ) : (
+                        <span className="badge bg-green">MAKER</span>
+                      )}
+                    </td>
+                    <td className="mono text-xs" style={{ color: 'var(--text-muted)' }}>
+                      {f.created_time ? new Date(f.created_time).toLocaleString() : '—'}
+                    </td>
+                  </tr>
+                ))
+              )}
             </tbody>
           </table>
         </div>
diff --git a/kalshi-dash/src/pages/Positions.jsx b/kalshi-dash/src/pages/Positions.jsx
index 6ec3aeb..d7ff697 100644
--- a/kalshi-dash/src/pages/Positions.jsx
+++ b/kalshi-dash/src/pages/Positions.jsx
@@ -8,20 +8,104 @@ const fmtPnl = (cents) => {
   const prefix = val >= 0 ? '+' : '';
   return `${prefix}$${val.toFixed(2)}`;
 };
-const pnlColor = (cents) => cents >= 0 ? 'text-green-400' : 'text-red-400';
-const pnlBg = (cents) => cents >= 0 ? 'bg-green' : 'bg-red';
-const sideLabel = (dir) => dir === 'BUY_YES' ? 'YES' : 'NO';
+const pnlColor = (cents) => cents >= 0 ? 'text-green' : 'text-red';
 const sideBadge = (dir) => dir === 'BUY_YES' ? 'bg-green' : 'bg-red';
-const kalshiLink = (ticker) => `https://kalshi.com/search?query=${encodeURIComponent((ticker || '').split('-')[0])}`;
+const sideLabel = (dir) => dir === 'BUY_YES' ? 'YES' : 'NO';
+const kalshiLink = (ticker) =>
+  `https://kalshi.com/search?query=${encodeURIComponent((ticker || '').split('-')[0])}`;
 const timeAgo = (d) => {
   if (!d) return '';
   const ms = Date.now() - new Date(d).getTime();
   if (ms < 60000) return 'just now';
-  if (ms < 3600000) return `${Math.floor(ms/60000)}m ago`;
-  if (ms < 86400000) return `${Math.floor(ms/3600000)}h ago`;
-  return `${Math.floor(ms/86400000)}d ago`;
+  if (ms < 3600000) return `${Math.floor(ms / 60000)}m ago`;
+  if (ms < 86400000) return `${Math.floor(ms / 3600000)}h ago`;
+  return `${Math.floor(ms / 86400000)}d ago`;
 };
 
+// ── Loading Spinner ──
+function Spinner() {
+  return (
+    <div className="flex items-center justify-center h-64">
+      <div
+        className="w-9 h-9 rounded-full border-2 animate-spin"
+        style={{ borderColor: 'var(--border)', borderTopColor: 'var(--cyan)' }}
+      />
+    </div>
+  );
+}
+
+// ── Trade Sub-table ──
+function TradeSubTable({ p, trades, loading }) {
+  return (
+    <div style={{ background: 'var(--bg)', borderTop: '1px solid var(--border)', borderBottom: '1px solid var(--border)' }} className="px-4 py-3">
+      <div className="flex items-center justify-between mb-3">
+        <span className="mono text-xs font-bold" style={{ color: 'var(--cyan)' }}>
+          Trade History — {p.ticker}
+        </span>
+        <div className="flex gap-4 text-xs" style={{ color: 'var(--text-muted)' }}>
+          <span>Open: <b style={{ color: 'var(--blue)' }}>{p.open_trades}</b></span>
+          <span>Closed: <b style={{ color: 'var(--text-dim)' }}>{p.closed_trades}</b></span>
+          <span>
+            Entry Range:{' '}
+            <b style={{ color: 'var(--orange)' }}>
+              {p.min_entry}¢ – {p.max_entry}¢
+            </b>
+          </span>
+          <span>First: <b>{new Date(p.first_trade_at).toLocaleDateString()}</b></span>
+        </div>
+      </div>
+      {loading ? (
+        <div className="flex justify-center py-4">
+          <div className="w-5 h-5 rounded-full border-2 animate-spin" style={{ borderColor: 'var(--border)', borderTopColor: 'var(--cyan)' }} />
+        </div>
+      ) : trades.length > 0 ? (
+        <div className="overflow-x-auto" style={{ maxHeight: 200, overflowY: 'auto' }}>
+          <table className="text-xs">
+            <thead>
+              <tr>
+                <th>Time</th>
+                <th>Direction</th>
+                <th>Contracts</th>
+                <th>Entry Price</th>
+                <th>Cost</th>
+                <th>P&L</th>
+                <th>Status</th>
+              </tr>
+            </thead>
+            <tbody>
+              {trades.map((t, i) => (
+                <tr key={i}>
+                  <td className="mono" style={{ color: 'var(--text-muted)' }}>
+                    {new Date(t.created_at).toLocaleString()}
+                  </td>
+                  <td>
+                    <span className={`badge ${sideBadge(t.direction)}`}>{sideLabel(t.direction)}</span>
+                  </td>
+                  <td className="mono">{t.contracts}</td>
+                  <td className="mono" style={{ color: 'var(--orange)' }}>{t.entry_price_cents}¢</td>
+                  <td className="mono" style={{ color: 'var(--text-dim)' }}>{fmt(t.cost_cents || 0)}</td>
+                  <td className={`mono ${pnlColor(t.pnl_cents || 0)}`}>
+                    {t.pnl_cents != null ? fmtPnl(t.pnl_cents) : '—'}
+                  </td>
+                  <td>
+                    <span className={`badge ${t.status === 'open' ? 'bg-blue' : t.status === 'closed' ? 'bg-green' : 'bg-orange'}`}>
+                      {t.status}
+                    </span>
+                  </td>
+                </tr>
+              ))}
+            </tbody>
+          </table>
+        </div>
+      ) : (
+        <p className="text-center py-3 text-xs" style={{ color: 'var(--text-muted)' }}>
+          No trade details available
+        </p>
+      )}
+    </div>
+  );
+}
+
 export default function Positions() {
   const [positions, setPositions] = useState([]);
   const [grouped, setGrouped] = useState([]);
@@ -46,11 +130,15 @@ export default function Positions() {
     setLoading(false);
   }, []);
 
-  useEffect(() => { load(); const i = setInterval(load, 30000); return () => clearInterval(i); }, [load]);
+  useEffect(() => {
+    load();
+    const i = setInterval(load, 30000);
+    return () => clearInterval(i);
+  }, [load]);
 
   async function loadTrades(ticker, direction) {
     const key = `${ticker}_${direction}`;
-    if (trades[key]) return; // already loaded
+    if (trades[key]) return;
     setTradesLoading(key);
     try {
       const r = await post('/positions/trades', { ticker, direction, limit: 50 });
@@ -62,7 +150,7 @@ export default function Positions() {
   }
 
   function toggleGroup(event) {
-    setExpandedGroup(prev => prev === event ? null : event);
+    setExpandedGroup(prev => (prev === event ? null : event));
     setExpandedPos(null);
   }
 
@@ -76,131 +164,187 @@ export default function Positions() {
     }
   }
 
-  // Sort positions
   const sortedPositions = [...positions].sort((a, b) => {
     if (sortBy === 'pnl') return b.realized_pnl_cents - a.realized_pnl_cents;
     if (sortBy === 'contracts') return b.open_contracts - a.open_contracts;
     return b.open_cost_cents - a.open_cost_cents;
   });
 
-  // P&L grouped by winners vs losers
-  const winners = positions.filter(p => p.realized_pnl_cents > 0).sort((a, b) => b.realized_pnl_cents - a.realized_pnl_cents);
-  const losers = positions.filter(p => p.realized_pnl_cents < 0).sort((a, b) => a.realized_pnl_cents - b.realized_pnl_cents);
+  const winners = positions
+    .filter(p => p.realized_pnl_cents > 0)
+    .sort((a, b) => b.realized_pnl_cents - a.realized_pnl_cents);
+  const losers = positions
+    .filter(p => p.realized_pnl_cents < 0)
+    .sort((a, b) => a.realized_pnl_cents - b.realized_pnl_cents);
   const flat = positions.filter(p => p.realized_pnl_cents === 0);
 
-  if (loading) return (
-    <div className="flex items-center justify-center h-64">
-      <div className="animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full" />
-    </div>
-  );
+  const winRate =
+    positions.length > 0 && winners.length + losers.length > 0
+      ? `${Math.round((winners.length / (winners.length + losers.length)) * 100)}%`
+      : '—';
+
+  if (loading) return <Spinner />;
 
   return (
-    <div className="space-y-6">
-      {/* Header */}
+    <div className="space-y-6 fade-in">
+
+      {/* ── Page Header ── */}
       <div className="flex items-center justify-between">
         <div>
-          <h1 className="text-2xl font-bold">Positions</h1>
-          <p className="text-gray-500 text-sm">{summary.positionCount || 0} active positions &bull; {summary.totalTrades?.toLocaleString() || 0} total trades</p>
+          <h1 className="heading text-3xl" style={{ color: 'var(--text)' }}>
+            Positions
+            <span className="badge bg-cyan ml-3 align-middle text-base">
+              {summary.positionCount || 0}
+            </span>
+          </h1>
+          <p className="section-subtitle mt-1">
+            {summary.positionCount || 0} active positions &bull;{' '}
+            {summary.totalTrades?.toLocaleString() || 0} total trades
+          </p>
         </div>
         <div className="flex items-center gap-2">
-          <div className="flex bg-gray-800 rounded-lg p-0.5">
-            {[['grouped','Grouped'],['flat','All'],['pnl','P&L']].map(([v, label]) => (
-              <button key={v} onClick={() => setViewMode(v)}
-                className={`px-3 py-1 text-xs font-semibold rounded-md transition ${viewMode === v ? 'bg-amber-500 text-black' : 'text-gray-400 hover:text-gray-200'}`}
-              >{label}</button>
+          {/* View mode toggle */}
+          <div
+            className="flex rounded-lg p-0.5 gap-0.5"
+            style={{ background: 'var(--surface-el)', border: '1px solid var(--border)' }}
+          >
+            {[['grouped', 'Grouped'], ['flat', 'All'], ['pnl', 'P&L']].map(([v, label]) => (
+              <button
+                key={v}
+                onClick={() => setViewMode(v)}
+                className="px-3 py-1 text-xs font-semibold rounded-md transition"
+                style={
+                  viewMode === v
+                    ? { background: 'var(--cyan)', color: 'var(--bg)', fontFamily: 'var(--font-body)' }
+                    : { color: 'var(--text-muted)', fontFamily: 'var(--font-body)' }
+                }
+              >
+                {label}
+              </button>
             ))}
           </div>
-          <button onClick={load} className="btn btn-o text-sm">Refresh</button>
+          <button onClick={load} className="btn btn-o btn-sm">Refresh</button>
         </div>
       </div>
 
-      {/* Summary Cards */}
+      {/* ── Summary Stat Cards ── */}
       <div className="grid grid-cols-2 md:grid-cols-5 gap-3">
         <div className="card">
-          <p className="text-xs text-gray-500 uppercase mb-1">Positions</p>
-          <p className="stat-v text-amber-400">{summary.positionCount || 0}</p>
+          <p className="stat-label">Positions</p>
+          <p className="stat-v mt-2" style={{ color: 'var(--cyan)' }}>{summary.positionCount || 0}</p>
         </div>
         <div className="card">
-          <p className="text-xs text-gray-500 uppercase mb-1">Total Cost</p>
-          <p className="stat-v text-gray-300">{fmt(summary.totalCost || 0)}</p>
+          <p className="stat-label">Total Cost</p>
+          <p className="stat-v mt-2" style={{ color: 'var(--text)' }}>{fmt(summary.totalCost || 0)}</p>
         </div>
         <div className="card">
-          <p className="text-xs text-gray-500 uppercase mb-1">Realized P&L</p>
-          <p className={`stat-v ${pnlColor(summary.totalPnl || 0)}`}>{fmtPnl(summary.totalPnl || 0)}</p>
+          <p className="stat-label">Realized P&L</p>
+          <p className={`stat-v mt-2 ${pnlColor(summary.totalPnl || 0)}`}>
+            {fmtPnl(summary.totalPnl || 0)}
+          </p>
         </div>
         <div className="card">
-          <p className="text-xs text-gray-500 uppercase mb-1">Contracts</p>
-          <p className="stat-v text-blue-400">{(summary.totalContracts || 0).toLocaleString()}</p>
+          <p className="stat-label">Contracts</p>
+          <p className="stat-v mt-2" style={{ color: 'var(--blue)' }}>
+            {(summary.totalContracts || 0).toLocaleString()}
+          </p>
         </div>
         <div className="card">
-          <p className="text-xs text-gray-500 uppercase mb-1">Win Rate</p>
-          <p className="stat-v text-green-400">
-            {positions.length > 0 ? `${Math.round(winners.length / (winners.length + losers.length) * 100)}%` : '—'}
-          </p>
+          <p className="stat-label">Win Rate</p>
+          <p className="stat-v mt-2 text-green">{winRate}</p>
         </div>
       </div>
 
-      {/* P&L Breakdown Bar */}
+      {/* ── P&L Breakdown Bar ── */}
       {summary.totalPnl !== 0 && (
-        <div className="card p-3">
+        <div className="card py-3">
           <div className="flex items-center justify-between text-xs mb-2">
-            <span className="text-green-400 font-semibold">{winners.length} winners</span>
-            <span className="text-gray-500">{flat.length} flat</span>
-            <span className="text-red-400 font-semibold">{losers.length} losers</span>
+            <span className="font-semibold text-green">{winners.length} winners</span>
+            <span style={{ color: 'var(--text-muted)' }}>{flat.length} flat</span>
+            <span className="font-semibold text-red">{losers.length} losers</span>
           </div>
-          <div className="flex h-3 rounded-full overflow-hidden bg-gray-800">
+          <div className="progress-bar" style={{ height: 8 }}>
             {(() => {
-              const totalAbs = winners.reduce((s,p) => s + p.realized_pnl_cents, 0) + Math.abs(losers.reduce((s,p) => s + p.realized_pnl_cents, 0));
+              const totalAbs =
+                winners.reduce((s, p) => s + p.realized_pnl_cents, 0) +
+                Math.abs(losers.reduce((s, p) => s + p.realized_pnl_cents, 0));
               if (!totalAbs) return null;
-              const winPct = (winners.reduce((s,p) => s + p.realized_pnl_cents, 0) / totalAbs * 100);
-              return <>
-                <div className="bg-green-500 transition-all" style={{ width: `${winPct}%` }} />
-                <div className="bg-red-500 transition-all" style={{ width: `${100 - winPct}%` }} />
-              </>;
+              const winPct = (winners.reduce((s, p) => s + p.realized_pnl_cents, 0) / totalAbs) * 100;
+              return (
+                <div className="flex h-full w-full">
+                  <div style={{ width: `${winPct}%`, background: 'var(--green)', borderRadius: '2px 0 0 2px' }} />
+                  <div style={{ width: `${100 - winPct}%`, background: 'var(--red)', borderRadius: '0 2px 2px 0' }} />
+                </div>
+              );
             })()}
           </div>
         </div>
       )}
 
-      {/* ═══ GROUPED VIEW ═══ */}
+      {/* ══════════════════════════════
+          GROUPED VIEW
+          ══════════════════════════════ */}
       {viewMode === 'grouped' && (
         <div className="space-y-3">
           {grouped.map((group) => {
             const isExpanded = expandedGroup === group.event;
             return (
-              <div key={group.event} className="card p-0 overflow-hidden">
-                {/* Group Header — Collapsible */}
+              <div
+                key={group.event}
+                className="card p-0 overflow-hidden"
+                style={{ padding: 0 }}
+              >
+                {/* Group Header */}
                 <button
                   onClick={() => toggleGroup(group.event)}
-                  className="w-full flex items-center gap-3 p-4 hover:bg-gray-800/50 transition text-left"
+                  className="w-full flex items-center gap-3 p-4 text-left transition"
+                  style={{ background: 'transparent' }}
+                  onMouseEnter={e => (e.currentTarget.style.background = 'var(--cyan-glow)')}
+                  onMouseLeave={e => (e.currentTarget.style.background = 'transparent')}
                 >
-                  <span className={`text-xs transform transition ${isExpanded ? 'rotate-90' : ''}`}>▶</span>
+                  <span
+                    className="text-xs inline-block transition-transform"
+                    style={{
+                      color: 'var(--cyan)',
+                      transform: isExpanded ? 'rotate(90deg)' : 'rotate(0deg)',
+                    }}
+                  >
+                    ▶
+                  </span>
                   <div className="flex-1 min-w-0">
                     <div className="flex items-center gap-2">
-                      <span className="font-mono text-amber-400 text-sm font-bold">{group.event}</span>
-                      <span className="badge bg-yellow">{group.positions.length}</span>
+                      <span className="mono text-sm font-bold" style={{ color: 'var(--orange)' }}>
+                        {group.event}
+                      </span>
+                      <span className="badge bg-cyan">{group.positions.length}</span>
                     </div>
-                    <p className="text-xs text-gray-500 truncate mt-0.5">{group.title}</p>
+                    <p className="text-xs truncate mt-0.5" style={{ color: 'var(--text-muted)' }}>
+                      {group.title}
+                    </p>
                   </div>
                   <div className="flex items-center gap-6 text-right flex-shrink-0">
                     <div>
-                      <p className="text-xs text-gray-500">Cost</p>
-                      <p className="font-mono text-sm text-gray-300">{fmt(group.totalCost)}</p>
+                      <p className="text-xs" style={{ color: 'var(--text-muted)' }}>Cost</p>
+                      <p className="mono text-sm" style={{ color: 'var(--text)' }}>{fmt(group.totalCost)}</p>
                     </div>
                     <div>
-                      <p className="text-xs text-gray-500">Contracts</p>
-                      <p className="font-mono text-sm text-blue-400">{group.totalContracts.toLocaleString()}</p>
+                      <p className="text-xs" style={{ color: 'var(--text-muted)' }}>Contracts</p>
+                      <p className="mono text-sm" style={{ color: 'var(--blue)' }}>
+                        {group.totalContracts.toLocaleString()}
+                      </p>
                     </div>
                     <div>
-                      <p className="text-xs text-gray-500">Realized P&L</p>
-                      <p className={`font-mono text-sm font-bold ${pnlColor(group.totalPnl)}`}>{fmtPnl(group.totalPnl)}</p>
+                      <p className="text-xs" style={{ color: 'var(--text-muted)' }}>Realized P&L</p>
+                      <p className={`mono text-sm font-bold ${pnlColor(group.totalPnl)}`}>
+                        {fmtPnl(group.totalPnl)}
+                      </p>
                     </div>
                   </div>
                 </button>
 
                 {/* Expanded Positions Table */}
                 {isExpanded && (
-                  <div className="border-t border-gray-800">
+                  <div style={{ borderTop: '1px solid var(--border)' }}>
                     <table>
                       <thead>
                         <tr>
@@ -223,83 +367,63 @@ export default function Positions() {
                           const isLoadingTrades = tradesLoading === posKey;
                           return (
                             <React.Fragment key={posKey}>
-                              <tr className="cursor-pointer" onClick={() => togglePos(p.ticker, p.direction)}>
-                                <td className="w-6">
-                                  <span className={`text-xs transform transition inline-block ${isPosExpanded ? 'rotate-90' : ''}`}>▶</span>
+                              <tr
+                                className="cursor-pointer"
+                                onClick={() => togglePos(p.ticker, p.direction)}
+                              >
+                                <td style={{ width: 24 }}>
+                                  <span
+                                    className="text-xs inline-block transition-transform"
+                                    style={{
+                                      color: 'var(--cyan)',
+                                      transform: isPosExpanded ? 'rotate(90deg)' : 'rotate(0deg)',
+                                    }}
+                                  >
+                                    ▶
+                                  </span>
                                 </td>
                                 <td>
-                                  <a href={kalshiLink(p.ticker)} target="_blank" rel="noopener noreferrer"
-                                    className="font-mono text-sm text-amber-400 hover:text-amber-300 hover:underline"
-                                    onClick={e => e.stopPropagation()}>
+                                  <a
+                                    href={kalshiLink(p.ticker)}
+                                    target="_blank"
+                                    rel="noopener noreferrer"
+                                    className="mono text-sm hover:underline"
+                                    style={{ color: 'var(--orange)' }}
+                                    onClick={e => e.stopPropagation()}
+                                  >
                                     {p.ticker}
                                   </a>
                                 </td>
-                                <td><span className={`badge ${sideBadge(p.direction)}`}>{sideLabel(p.direction)}</span></td>
-                                <td className="font-mono">{p.open_contracts?.toLocaleString()}</td>
-                                <td className="font-mono text-gray-400">{p.avg_entry_price}¢</td>
-                                <td className="font-mono text-gray-300">{fmt(p.open_cost_cents)}</td>
-                                <td className={`font-mono font-bold ${pnlColor(p.realized_pnl_cents)}`}>{fmtPnl(p.realized_pnl_cents)}</td>
-                                <td className="font-mono text-gray-500">{p.total_trades?.toLocaleString()}</td>
-                                <td className="text-xs text-gray-500">{timeAgo(p.last_trade_at)}</td>
+                                <td>
+                                  <span className={`badge ${sideBadge(p.direction)}`}>
+                                    {sideLabel(p.direction)}
+                                  </span>
+                                </td>
+                                <td className="mono">{p.open_contracts?.toLocaleString()}</td>
+                                <td className="mono" style={{ color: 'var(--text-dim)' }}>
+                                  {p.avg_entry_price}¢
+                                </td>
+                                <td className="mono" style={{ color: 'var(--text)' }}>
+                                  {fmt(p.open_cost_cents)}
+                                </td>
+                                <td className={`mono font-bold ${pnlColor(p.realized_pnl_cents)}`}>
+                                  {fmtPnl(p.realized_pnl_cents)}
+                                </td>
+                                <td className="mono" style={{ color: 'var(--text-muted)' }}>
+                                  {p.total_trades?.toLocaleString()}
+                                </td>
+                                <td className="text-xs" style={{ color: 'var(--text-muted)' }}>
+                                  {timeAgo(p.last_trade_at)}
+                                </td>
                               </tr>
-
-                              {/* Trade History Sub-table */}
                               {isPosExpanded && (
                                 <tr>
-                                  <td colSpan={9} className="p-0">
-                                    <div className="bg-gray-900/50 border-y border-gray-800 p-3">
-                                      <div className="flex items-center justify-between mb-2">
-                                        <span className="text-xs font-bold text-gray-400 uppercase">Trade History — {p.ticker}</span>
-                                        <div className="flex gap-3 text-xs text-gray-500">
-                                          <span>Open: <b className="text-blue-400">{p.open_trades}</b></span>
-                                          <span>Closed: <b className="text-gray-400">{p.closed_trades}</b></span>
-                                          <span>Entry Range: <b className="text-amber-400">{p.min_entry}¢ – {p.max_entry}¢</b></span>
-                                          <span>First: <b>{new Date(p.first_trade_at).toLocaleDateString()}</b></span>
-                                        </div>
-                                      </div>
-                                      {isLoadingTrades ? (
-                                        <div className="flex justify-center py-4">
-                                          <div className="animate-spin w-5 h-5 border-2 border-amber-500 border-t-transparent rounded-full" />
-                                        </div>
-                                      ) : posTrades.length > 0 ? (
-                                        <div className="overflow-x-auto max-h-48 overflow-y-auto">
-                                          <table className="text-xs">
-                                            <thead>
-                                              <tr>
-                                                <th className="text-xs">Time</th>
-                                                <th className="text-xs">Direction</th>
-                                                <th className="text-xs">Contracts</th>
-                                                <th className="text-xs">Entry Price</th>
-                                                <th className="text-xs">Cost</th>
-                                                <th className="text-xs">P&L</th>
-                                                <th className="text-xs">Status</th>
-                                              </tr>
-                                            </thead>
-                                            <tbody>
-                                              {posTrades.map((t, i) => (
-                                                <tr key={i} className="hover:bg-gray-800/30">
-                                                  <td className="font-mono text-gray-500">{new Date(t.created_at).toLocaleString()}</td>
-                                                  <td><span className={`badge ${sideBadge(t.direction)}`}>{sideLabel(t.direction)}</span></td>
-                                                  <td className="font-mono">{t.contracts}</td>
-                                                  <td className="font-mono text-amber-400">{t.entry_price_cents}¢</td>
-                                                  <td className="font-mono text-gray-400">{fmt(t.cost_cents || 0)}</td>
-                                                  <td className={`font-mono ${pnlColor(t.pnl_cents || 0)}`}>
-                                                    {t.pnl_cents != null ? fmtPnl(t.pnl_cents) : '—'}
-                                                  </td>
-                                                  <td>
-                                                    <span className={`badge ${t.status === 'open' ? 'bg-blue' : t.status === 'closed' ? 'bg-green' : 'bg-yellow'}`}>
-                                                      {t.status}
-                                                    </span>
-                                                  </td>
-                                                </tr>
-                                              ))}
-                                            </tbody>
-                                          </table>
-                                        </div>
-                                      ) : (
-                                        <p className="text-center text-gray-600 py-3 text-xs">No trade details available</p>
-                                      )}
-                                    </div>
+                                  <td colSpan={9} style={{ padding: 0 }}>
+                                    <TradeSubTable
+                                      p={p}
+                                      trades={posTrades}
+                                      loading={isLoadingTrades}
+                                    />
                                   </td>
                                 </tr>
                               )}
@@ -316,15 +440,30 @@ export default function Positions() {
         </div>
       )}
 
-      {/* ═══ FLAT VIEW ═══ */}
+      {/* ══════════════════════════════
+          FLAT VIEW
+          ══════════════════════════════ */}
       {viewMode === 'flat' && (
-        <div className="card overflow-x-auto p-0">
-          <div className="flex items-center gap-3 p-3 border-b border-gray-800">
-            <span className="text-xs text-gray-500">Sort by:</span>
-            {[['cost','Cost'],['pnl','P&L'],['contracts','Contracts']].map(([v, label]) => (
-              <button key={v} onClick={() => setSortBy(v)}
-                className={`text-xs font-semibold px-2 py-1 rounded ${sortBy === v ? 'bg-amber-500/20 text-amber-400' : 'text-gray-500 hover:text-gray-300'}`}
-              >{label}</button>
+        <div className="card overflow-x-auto" style={{ padding: 0 }}>
+          {/* Sort controls */}
+          <div
+            className="flex items-center gap-3 px-4 py-3"
+            style={{ borderBottom: '1px solid var(--border)' }}
+          >
+            <span className="text-xs" style={{ color: 'var(--text-muted)' }}>Sort by:</span>
+            {[['cost', 'Cost'], ['pnl', 'P&L'], ['contracts', 'Contracts']].map(([v, label]) => (
+              <button
+                key={v}
+                onClick={() => setSortBy(v)}
+                className="text-xs font-semibold px-2.5 py-1 rounded-md transition"
+                style={
+                  sortBy === v
+                    ? { background: 'var(--cyan-dim)', color: 'var(--cyan)' }
+                    : { color: 'var(--text-muted)' }
+                }
+              >
+                {label}
+              </button>
             ))}
           </div>
           <table>
@@ -344,102 +483,147 @@ export default function Positions() {
             </thead>
             <tbody>
               {sortedPositions.length === 0 ? (
-                <tr><td colSpan={10} className="text-center text-gray-500 py-8">No open positions</td></tr>
-              ) : sortedPositions.map((p, i) => {
-                const posKey = `${p.ticker}_${p.direction}`;
-                const isPosExpanded = expandedPos === posKey;
-                const posTrades = trades[posKey] || [];
-                const isLoadingTrades = tradesLoading === posKey;
-                return (
-                  <React.Fragment key={posKey}>
-                    <tr className="cursor-pointer" onClick={() => togglePos(p.ticker, p.direction)}>
-                      <td className="text-gray-500">{i + 1}</td>
-                      <td>
-                        <a href={kalshiLink(p.ticker)} target="_blank" rel="noopener noreferrer"
-                          className="font-mono text-sm text-amber-400 hover:text-amber-300 hover:underline"
-                          onClick={e => e.stopPropagation()}>
-                          {p.ticker}
-                        </a>
-                      </td>
-                      <td className="text-xs text-gray-400 max-w-48 truncate">{p.title}</td>
-                      <td><span className={`badge ${sideBadge(p.direction)}`}>{sideLabel(p.direction)}</span></td>
-                      <td className="font-mono">{p.open_contracts?.toLocaleString()}</td>
-                      <td className="font-mono text-gray-400">{p.avg_entry_price}¢</td>
-                      <td className="font-mono text-gray-300">{fmt(p.open_cost_cents)}</td>
-                      <td className={`font-mono font-bold ${pnlColor(p.realized_pnl_cents)}`}>{fmtPnl(p.realized_pnl_cents)}</td>
-                      <td className="font-mono text-gray-500">{p.total_trades?.toLocaleString()}</td>
-                      <td className="text-xs text-gray-500">{timeAgo(p.last_trade_at)}</td>
-                    </tr>
-                    {isPosExpanded && (
-                      <tr>
-                        <td colSpan={10} className="p-0">
-                          <div className="bg-gray-900/50 border-y border-gray-800 p-3">
-                            <div className="flex items-center gap-4 mb-2 text-xs text-gray-500">
-                              <span>Open: <b className="text-blue-400">{p.open_trades}</b></span>
-                              <span>Closed: <b className="text-gray-400">{p.closed_trades}</b></span>
-                              <span>Entry Range: <b className="text-amber-400">{p.min_entry}¢–{p.max_entry}¢</b></span>
-                            </div>
-                            {isLoadingTrades ? (
-                              <div className="flex justify-center py-4"><div className="animate-spin w-5 h-5 border-2 border-amber-500 border-t-transparent rounded-full" /></div>
-                            ) : posTrades.length > 0 ? (
-                              <div className="overflow-auto max-h-48">
-                                <table className="text-xs">
-                                  <thead><tr><th>Time</th><th>Dir</th><th>Qty</th><th>Entry</th><th>Cost</th><th>P&L</th><th>Status</th></tr></thead>
-                                  <tbody>
-                                    {posTrades.map((t, ti) => (
-                                      <tr key={ti}>
-                                        <td className="font-mono text-gray-500">{new Date(t.created_at).toLocaleString()}</td>
-                                        <td><span className={`badge ${sideBadge(t.direction)}`}>{sideLabel(t.direction)}</span></td>
-                                        <td className="font-mono">{t.contracts}</td>
-                                        <td className="font-mono text-amber-400">{t.entry_price_cents}¢</td>
-                                        <td className="font-mono text-gray-400">{fmt(t.cost_cents || 0)}</td>
-                                        <td className={`font-mono ${pnlColor(t.pnl_cents || 0)}`}>{t.pnl_cents != null ? fmtPnl(t.pnl_cents) : '—'}</td>
-                                        <td><span className={`badge ${t.status === 'open' ? 'bg-blue' : 'bg-green'}`}>{t.status}</span></td>
-                                      </tr>
-                                    ))}
-                                  </tbody>
-                                </table>
-                              </div>
-                            ) : <p className="text-center text-gray-600 py-2 text-xs">No trade details</p>}
-                          </div>
+                <tr>
+                  <td colSpan={10} className="text-center py-12" style={{ color: 'var(--text-muted)' }}>
+                    No open positions
+                  </td>
+                </tr>
+              ) : (
+                sortedPositions.map((p, i) => {
+                  const posKey = `${p.ticker}_${p.direction}`;
+                  const isPosExpanded = expandedPos === posKey;
+                  const posTrades = trades[posKey] || [];
+                  const isLoadingTrades = tradesLoading === posKey;
+                  return (
+                    <React.Fragment key={posKey}>
+                      <tr
+                        className="cursor-pointer"
+                        onClick={() => togglePos(p.ticker, p.direction)}
+                      >
+                        <td style={{ color: 'var(--text-muted)' }}>{i + 1}</td>
+                        <td>
+                          <a
+                            href={kalshiLink(p.ticker)}
+                            target="_blank"
+                            rel="noopener noreferrer"
+                            className="mono text-sm hover:underline"
+                            style={{ color: 'var(--orange)' }}
+                            onClick={e => e.stopPropagation()}
+                          >
+                            {p.ticker}
+                          </a>
+                        </td>
+                        <td
+                          className="text-xs max-w-[192px] truncate"
+                          style={{ color: 'var(--text-dim)' }}
+                        >
+                          {p.title}
+                        </td>
+                        <td>
+                          <span className={`badge ${sideBadge(p.direction)}`}>
+                            {sideLabel(p.direction)}
+                          </span>
+                        </td>
+                        <td className="mono">{p.open_contracts?.toLocaleString()}</td>
+                        <td className="mono" style={{ color: 'var(--text-dim)' }}>
+                          {p.avg_entry_price}¢
+                        </td>
+                        <td className="mono" style={{ color: 'var(--text)' }}>
+                          {fmt(p.open_cost_cents)}
+                        </td>
+                        <td className={`mono font-bold ${pnlColor(p.realized_pnl_cents)}`}>
+                          {fmtPnl(p.realized_pnl_cents)}
+                        </td>
+                        <td className="mono" style={{ color: 'var(--text-muted)' }}>
+                          {p.total_trades?.toLocaleString()}
+                        </td>
+                        <td className="text-xs" style={{ color: 'var(--text-muted)' }}>
+                          {timeAgo(p.last_trade_at)}
                         </td>
                       </tr>
-                    )}
-                  </React.Fragment>
-                );
-              })}
+                      {isPosExpanded && (
+                        <tr>
+                          <td colSpan={10} style={{ padding: 0 }}>
+                            <TradeSubTable p={p} trades={posTrades} loading={isLoadingTrades} />
+                          </td>
+                        </tr>
+                      )}
+                    </React.Fragment>
+                  );
+                })
+              )}
             </tbody>
           </table>
         </div>
       )}
 
-      {/* ═══ P&L VIEW ═══ */}
+      {/* ══════════════════════════════
+          P&L VIEW
+          ══════════════════════════════ */}
       {viewMode === 'pnl' && (
         <div className="space-y-4">
+
           {/* Winners */}
-          <div className="card p-0 overflow-hidden">
-            <div className="flex items-center gap-3 px-4 py-3 bg-green-500/5 border-b border-gray-800">
-              <span className="text-green-400 font-bold text-sm">Winners</span>
+          <div className="card overflow-hidden" style={{ padding: 0 }}>
+            <div
+              className="flex items-center gap-3 px-4 py-3"
+              style={{
+                background: 'var(--green-dim)',
+                borderBottom: '1px solid var(--border)',
+              }}
+            >
+              <span className="text-sm font-bold text-green">Winners</span>
               <span className="badge bg-green">{winners.length}</span>
               <div className="flex-1" />
-              <span className="font-mono text-green-400 font-bold">
+              <span className="mono font-bold text-green">
                 {fmtPnl(winners.reduce((s, p) => s + p.realized_pnl_cents, 0))}
               </span>
             </div>
             <table>
-              <thead><tr><th>Ticker</th><th>Market</th><th>Side</th><th>Contracts</th><th>Cost</th><th>Realized P&L</th><th>ROI</th></tr></thead>
+              <thead>
+                <tr>
+                  <th>Ticker</th>
+                  <th>Market</th>
+                  <th>Side</th>
+                  <th>Contracts</th>
+                  <th>Cost</th>
+                  <th>Realized P&L</th>
+                  <th>ROI</th>
+                </tr>
+              </thead>
               <tbody>
                 {winners.map(p => {
-                  const roi = p.open_cost_cents > 0 ? ((p.realized_pnl_cents / p.open_cost_cents) * 100).toFixed(0) : '∞';
+                  const roi =
+                    p.open_cost_cents > 0
+                      ? `${((p.realized_pnl_cents / p.open_cost_cents) * 100).toFixed(0)}%`
+                      : '∞';
                   return (
                     <tr key={`${p.ticker}_${p.direction}`}>
-                      <td><a href={kalshiLink(p.ticker)} target="_blank" rel="noopener" className="font-mono text-sm text-amber-400 hover:underline">{p.ticker}</a></td>
-                      <td className="text-xs text-gray-400 max-w-48 truncate">{p.title}</td>
-                      <td><span className={`badge ${sideBadge(p.direction)}`}>{sideLabel(p.direction)}</span></td>
-                      <td className="font-mono">{p.open_contracts?.toLocaleString()}</td>
-                      <td className="font-mono text-gray-400">{fmt(p.open_cost_cents)}</td>
-                      <td className="font-mono font-bold text-green-400">{fmtPnl(p.realized_pnl_cents)}</td>
-                      <td className="font-mono text-green-300">{roi}%</td>
+                      <td>
+                        <a
+                          href={kalshiLink(p.ticker)}
+                          target="_blank"
+                          rel="noopener"
+                          className="mono text-sm hover:underline"
+                          style={{ color: 'var(--orange)' }}
+                        >
+                          {p.ticker}
+                        </a>
+                      </td>
+                      <td className="text-xs max-w-[192px] truncate" style={{ color: 'var(--text-dim)' }}>
+                        {p.title}
+                      </td>
+                      <td>
+                        <span className={`badge ${sideBadge(p.direction)}`}>
+                          {sideLabel(p.direction)}
+                        </span>
+                      </td>
+                      <td className="mono">{p.open_contracts?.toLocaleString()}</td>
+                      <td className="mono" style={{ color: 'var(--text-dim)' }}>
+                        {fmt(p.open_cost_cents)}
+                      </td>
+                      <td className="mono font-bold text-green">{fmtPnl(p.realized_pnl_cents)}</td>
+                      <td className="mono text-green">{roi}</td>
                     </tr>
                   );
                 })}
@@ -448,29 +632,66 @@ export default function Positions() {
           </div>
 
           {/* Losers */}
-          <div className="card p-0 overflow-hidden">
-            <div className="flex items-center gap-3 px-4 py-3 bg-red-500/5 border-b border-gray-800">
-              <span className="text-red-400 font-bold text-sm">Losers</span>
+          <div className="card overflow-hidden" style={{ padding: 0 }}>
+            <div
+              className="flex items-center gap-3 px-4 py-3"
+              style={{
+                background: 'var(--red-dim)',
+                borderBottom: '1px solid var(--border)',
+              }}
+            >
+              <span className="text-sm font-bold text-red">Losers</span>
               <span className="badge bg-red">{losers.length}</span>
               <div className="flex-1" />
-              <span className="font-mono text-red-400 font-bold">
+              <span className="mono font-bold text-red">
                 {fmtPnl(losers.reduce((s, p) => s + p.realized_pnl_cents, 0))}
               </span>
             </div>
             <table>
-              <thead><tr><th>Ticker</th><th>Market</th><th>Side</th><th>Contracts</th><th>Cost</th><th>Realized P&L</th><th>ROI</th></tr></thead>
+              <thead>
+                <tr>
+                  <th>Ticker</th>
+                  <th>Market</th>
+                  <th>Side</th>
+                  <th>Contracts</th>
+                  <th>Cost</th>
+                  <th>Realized P&L</th>
+                  <th>ROI</th>
+                </tr>
+              </thead>
               <tbody>
                 {losers.map(p => {
-                  const roi = p.open_cost_cents > 0 ? ((p.realized_pnl_cents / p.open_cost_cents) * 100).toFixed(0) : '—';
+                  const roi =
+                    p.open_cost_cents > 0
+                      ? `${((p.realized_pnl_cents / p.open_cost_cents) * 100).toFixed(0)}%`
+                      : '—';
                   return (
                     <tr key={`${p.ticker}_${p.direction}`}>
-                      <td><a href={kalshiLink(p.ticker)} target="_blank" rel="noopener" className="font-mono text-sm text-amber-400 hover:underline">{p.ticker}</a></td>
-                      <td className="text-xs text-gray-400 max-w-48 truncate">{p.title}</td>
-                      <td><span className={`badge ${sideBadge(p.direction)}`}>{sideLabel(p.direction)}</span></td>
-                      <td className="font-mono">{p.open_contracts?.toLocaleString()}</td>
-                      <td className="font-mono text-gray-400">{fmt(p.open_cost_cents)}</td>
-                      <td className="font-mono font-bold text-red-400">{fmtPnl(p.realized_pnl_cents)}</td>
-                      <td className="font-mono text-red-300">{roi}%</td>
+                      <td>
+                        <a
+                          href={kalshiLink(p.ticker)}
+                          target="_blank"
+                          rel="noopener"
+                          className="mono text-sm hover:underline"
+                          style={{ color: 'var(--orange)' }}
+                        >
+                          {p.ticker}
+                        </a>
+                      </td>
+                      <td className="text-xs max-w-[192px] truncate" style={{ color: 'var(--text-dim)' }}>
+                        {p.title}
+                      </td>
+                      <td>
+                        <span className={`badge ${sideBadge(p.direction)}`}>
+                          {sideLabel(p.direction)}
+                        </span>
+                      </td>
+                      <td className="mono">{p.open_contracts?.toLocaleString()}</td>
+                      <td className="mono" style={{ color: 'var(--text-dim)' }}>
+                        {fmt(p.open_cost_cents)}
+                      </td>
+                      <td className="mono font-bold text-red">{fmtPnl(p.realized_pnl_cents)}</td>
+                      <td className="mono text-red">{roi}</td>
                     </tr>
                   );
                 })}
@@ -478,23 +699,57 @@ export default function Positions() {
             </table>
           </div>
 
-          {/* Flat (no P&L) */}
+          {/* Flat */}
           {flat.length > 0 && (
-            <div className="card p-0 overflow-hidden">
-              <div className="flex items-center gap-3 px-4 py-3 bg-gray-500/5 border-b border-gray-800">
-                <span className="text-gray-400 font-bold text-sm">Flat (No Realized P&L)</span>
-                <span className="badge bg-yellow">{flat.length}</span>
+            <div className="card overflow-hidden" style={{ padding: 0 }}>
+              <div
+                className="flex items-center gap-3 px-4 py-3"
+                style={{
+                  background: 'var(--surface-el)',
+                  borderBottom: '1px solid var(--border)',
+                }}
+              >
+                <span className="text-sm font-bold" style={{ color: 'var(--text-dim)' }}>
+                  Flat (No Realized P&L)
+                </span>
+                <span className="badge bg-orange">{flat.length}</span>
               </div>
               <table>
-                <thead><tr><th>Ticker</th><th>Market</th><th>Side</th><th>Contracts</th><th>Cost</th></tr></thead>
+                <thead>
+                  <tr>
+                    <th>Ticker</th>
+                    <th>Market</th>
+                    <th>Side</th>
+                    <th>Contracts</th>
+                    <th>Cost</th>
+                  </tr>
+                </thead>
                 <tbody>
                   {flat.map(p => (
                     <tr key={`${p.ticker}_${p.direction}`}>
-                      <td><a href={kalshiLink(p.ticker)} target="_blank" rel="noopener" className="font-mono text-sm text-amber-400 hover:underline">{p.ticker}</a></td>
-                      <td className="text-xs text-gray-400 max-w-48 truncate">{p.title}</td>
-                      <td><span className={`badge ${sideBadge(p.direction)}`}>{sideLabel(p.direction)}</span></td>
-                      <td className="font-mono">{p.open_contracts?.toLocaleString()}</td>
-                      <td className="font-mono text-gray-400">{fmt(p.open_cost_cents)}</td>
+                      <td>
+                        <a
+                          href={kalshiLink(p.ticker)}
+                          target="_blank"
+                          rel="noopener"
+                          className="mono text-sm hover:underline"
+                          style={{ color: 'var(--orange)' }}
+                        >
+                          {p.ticker}
+                        </a>
+                      </td>
+                      <td className="text-xs max-w-[192px] truncate" style={{ color: 'var(--text-dim)' }}>
+                        {p.title}
+                      </td>
+                      <td>
+                        <span className={`badge ${sideBadge(p.direction)}`}>
+                          {sideLabel(p.direction)}
+                        </span>
+                      </td>
+                      <td className="mono">{p.open_contracts?.toLocaleString()}</td>
+                      <td className="mono" style={{ color: 'var(--text-dim)' }}>
+                        {fmt(p.open_cost_cents)}
+                      </td>
                     </tr>
                   ))}
                 </tbody>
diff --git a/kalshi-dash/src/pages/Pulse.jsx b/kalshi-dash/src/pages/Pulse.jsx
index 626422f..32f8620 100644
--- a/kalshi-dash/src/pages/Pulse.jsx
+++ b/kalshi-dash/src/pages/Pulse.jsx
@@ -8,61 +8,81 @@ const PULSE_CATEGORIES = [
     icon: '\u{1F4B0}',
     subcategories: ['GDP', 'Inflation', 'Jobs', 'Fed Rate', 'Recession', 'Trade', 'Debt', 'Markets'],
     keywords: ['gdp', 'inflation', 'cpi', 'unemployment', 'jobs', 'payroll', 'fed', 'interest rate', 'recession', 'stock', 'sp500', 'nasdaq', 'dow', 'treasury', 'bond', 'debt', 'trade', 'tariff', 'deficit'],
-    baseColor: [34, 197, 94], // green
+    cssColor: 'var(--green)',
+    dimColor: 'var(--green-dim)',
+    rgbColor: [0, 195, 137],
   },
   {
     name: 'Politics',
     icon: '\u{1F3DB}',
     subcategories: ['White House', 'Congress', 'Elections', 'SCOTUS', 'Cabinet', 'Polls', 'Policy', 'Foreign'],
     keywords: ['trump', 'president', 'impeach', 'congress', 'senate', 'house', 'governor', 'election', 'democrat', 'republican', 'vote', 'biden', 'vance', 'cabinet', 'scotus', 'supreme', 'pardon', 'approval', 'poll', 'secretary', 'defense', 'attorney'],
-    baseColor: [59, 130, 246], // blue
+    cssColor: 'var(--blue)',
+    dimColor: 'var(--blue-dim)',
+    rgbColor: [59, 130, 246],
   },
   {
     name: 'Weather',
     icon: '\u{26C8}',
     subcategories: ['Temperature', 'Storms', 'Snow', 'Rain', 'Hurricanes', 'Heat', 'Wind', 'Climate'],
     keywords: ['temperature', 'rain', 'snow', 'hurricane', 'weather', 'tornado', 'flood', 'heat', 'cold', 'storm', 'wind', 'precipitation', 'climate'],
-    baseColor: [6, 182, 212], // cyan
+    cssColor: 'var(--cyan)',
+    dimColor: 'var(--cyan-dim)',
+    rgbColor: [0, 240, 255],
   },
   {
     name: 'Technology',
     icon: '\u{1F4BB}',
     subcategories: ['AI', 'SpaceX', 'Tesla', 'Big Tech', 'Startups', 'Chips', 'Cyber', 'Social'],
     keywords: ['ai', 'spacex', 'tesla', 'apple', 'google', 'meta', 'openai', 'chatgpt', 'tech', 'rocket', 'launch'],
-    baseColor: [236, 72, 153], // pink
+    cssColor: 'var(--cyan)',
+    dimColor: 'var(--cyan-dim)',
+    rgbColor: [0, 240, 255],
   },
   {
     name: 'Crypto',
     icon: '\u{1FA99}',
     subcategories: ['Bitcoin', 'Ethereum', 'DeFi', 'NFTs', 'Regulation', 'Mining', 'Stablecoins', 'Altcoins'],
     keywords: ['bitcoin', 'btc', 'ethereum', 'eth', 'crypto', 'token', 'blockchain', 'defi'],
-    baseColor: [245, 158, 11], // amber
+    cssColor: 'var(--orange)',
+    dimColor: 'var(--orange-dim)',
+    rgbColor: [247, 147, 26],
   },
   {
     name: 'Sports',
     icon: '\u{1F3C8}',
     subcategories: ['NFL', 'NBA', 'MLB', 'Soccer', 'Tennis', 'UFC', 'Olympics', 'Playoffs'],
     keywords: ['nfl', 'nba', 'mlb', 'nhl', 'soccer', 'tennis', 'super bowl', 'championship', 'game', 'match', 'playoff', 'world series'],
-    baseColor: [168, 85, 247], // purple
+    cssColor: 'var(--purple)',
+    dimColor: 'var(--purple-dim)',
+    rgbColor: [168, 85, 247],
   },
   {
     name: 'Energy',
     icon: '\u{26A1}',
     subcategories: ['Oil', 'Gas', 'Solar', 'Nuclear', 'OPEC', 'EVs', 'Grid', 'Coal'],
     keywords: ['oil', 'gas', 'energy', 'solar', 'opec', 'crude', 'coal', 'renewable'],
-    baseColor: [234, 179, 8], // yellow
+    cssColor: 'var(--orange)',
+    dimColor: 'var(--orange-dim)',
+    rgbColor: [247, 147, 26],
   },
   {
     name: 'Culture',
     icon: '\u{1F3AC}',
     subcategories: ['Movies', 'Music', 'Awards', 'TV', 'Social Media', 'Trends', 'Celebrity', 'Gaming'],
     keywords: ['oscar', 'movie', 'tv', 'celebrity', 'grammy', 'award', 'music', 'entertainment'],
-    baseColor: [249, 115, 22], // orange
+    cssColor: 'var(--orange)',
+    dimColor: 'var(--orange-dim)',
+    rgbColor: [247, 147, 26],
   },
 ];
 
+// Keep original baseColor arrays for data logic compatibility
+PULSE_CATEGORIES.forEach((cat, i) => {
+  cat.baseColor = cat.rgbColor;
+});
+
 function getHeatColor(intensity, baseColor) {
-  // intensity 0-1, returns rgba
   const [r, g, b] = baseColor;
   const alpha = Math.max(0.05, Math.min(0.9, intensity));
   return `rgba(${r},${g},${b},${alpha})`;
@@ -78,7 +98,7 @@ function getTextColor(intensity, baseColor) {
   const [r, g, b] = baseColor;
   if (intensity > 0.5) return `rgb(${Math.min(255, r + 60)},${Math.min(255, g + 60)},${Math.min(255, b + 60)})`;
   if (intensity > 0.2) return `rgb(${r},${g},${b})`;
-  return '#64748b';
+  return 'var(--text-muted)';
 }
 
 // ── Pulse Cell Component ──
@@ -86,37 +106,53 @@ function PulseCell({ subcategory, intensity, signalCount, sentiment, baseColor,
   const bg = getHeatColor(intensity, baseColor);
   const border = getHeatBorder(intensity, baseColor);
   const textColor = getTextColor(intensity, baseColor);
-
-  // Thermal scan lines effect
   const scanLines = intensity > 0.3;
 
   return (
     <div
       onClick={onClick}
-      className={`relative overflow-hidden rounded-lg cursor-pointer transition-all duration-300 group ${
-        isSelected ? 'ring-2 ring-amber-400 scale-105 z-10' : 'hover:scale-102'
-      }`}
+      className={`relative overflow-hidden rounded-lg cursor-pointer group ${isSelected ? 'z-10' : ''}`}
       style={{
         backgroundColor: bg,
-        border: `1px solid ${border}`,
+        border: isSelected
+          ? '2px solid var(--cyan)'
+          : `1px solid ${border}`,
         minHeight: 70,
+        transform: isSelected ? 'scale(1.05)' : undefined,
+        transition: 'all 200ms ease',
+        boxShadow: isSelected ? '0 0 16px rgba(0,240,255,0.2)' : undefined,
       }}
     >
-      {/* Thermal scan effect */}
+      {/* Thermal scan lines effect */}
       {scanLines && (
-        <div className="absolute inset-0 opacity-10 pointer-events-none" style={{
-          backgroundImage: `repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.03) 2px, rgba(255,255,255,0.03) 4px)`,
-        }} />
+        <div
+          className="absolute inset-0 opacity-10 pointer-events-none"
+          style={{
+            backgroundImage: `repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.03) 2px, rgba(255,255,255,0.03) 4px)`,
+          }}
+        />
       )}
 
       {/* Pulse animation for high intensity */}
       {intensity > 0.6 && (
-        <div className="absolute inset-0 animate-pulse opacity-30 pointer-events-none" style={{
-          background: `radial-gradient(circle at center, rgba(${baseColor.join(',')},0.4), transparent 70%)`,
-          animationDuration: `${3 - intensity * 2}s`,
-        }} />
+        <div
+          className="absolute inset-0 animate-pulse opacity-30 pointer-events-none"
+          style={{
+            background: `radial-gradient(circle at center, rgba(${baseColor.join(',')},0.4), transparent 70%)`,
+            animationDuration: `${3 - intensity * 2}s`,
+          }}
+        />
       )}
 
+      {/* Hover glow */}
+      <div
+        className="absolute inset-0 opacity-0 group-hover:opacity-100 pointer-events-none"
+        style={{
+          background: `radial-gradient(circle at center, rgba(${baseColor.join(',')},0.08), transparent)`,
+          transition: 'opacity 150ms ease',
+        }}
+      />
+
       <div className="relative p-2.5 h-full flex flex-col justify-between z-10">
         <div>
           <p className="text-[10px] font-bold uppercase tracking-wider" style={{ color: textColor }}>
@@ -125,19 +161,23 @@ function PulseCell({ subcategory, intensity, signalCount, sentiment, baseColor,
         </div>
         <div className="flex items-end justify-between mt-1">
           <div>
-            {signalCount > 0 && (
-              <p className="text-lg font-bold font-mono" style={{ color: textColor }}>
+            {signalCount > 0 ? (
+              <p className="text-lg font-bold mono" style={{ color: textColor }}>
                 {signalCount}
               </p>
-            )}
-            {signalCount === 0 && (
-              <p className="text-sm text-gray-600">--</p>
+            ) : (
+              <p className="text-sm" style={{ color: 'var(--text-muted)' }}>--</p>
             )}
           </div>
           {sentiment !== 0 && (
-            <div className={`text-[9px] font-mono font-bold px-1.5 py-0.5 rounded ${
-              sentiment > 0 ? 'bg-green-500/20 text-green-400' : 'bg-red-500/20 text-red-400'
-            }`}>
+            <div
+              className="text-[9px] mono font-bold px-1.5 py-0.5 rounded"
+              style={
+                sentiment > 0
+                  ? { background: 'var(--green-dim)', color: 'var(--green)' }
+                  : { background: 'var(--red-dim)', color: 'var(--red)' }
+              }
+            >
               {sentiment > 0 ? '+' : ''}{sentiment.toFixed(2)}
             </div>
           )}
@@ -145,9 +185,12 @@ function PulseCell({ subcategory, intensity, signalCount, sentiment, baseColor,
       </div>
 
       {/* Intensity bar at bottom */}
-      <div className="absolute bottom-0 left-0 right-0 h-0.5" style={{
-        background: `linear-gradient(90deg, transparent, rgba(${baseColor.join(',')},${intensity}), transparent)`,
-      }} />
+      <div
+        className="absolute bottom-0 left-0 right-0 h-0.5"
+        style={{
+          background: `linear-gradient(90deg, transparent, rgba(${baseColor.join(',')},${intensity}), transparent)`,
+        }}
+      />
     </div>
   );
 }
@@ -164,18 +207,22 @@ function CategoryRow({ category, subcategoryData, onCellClick, selectedCell }) {
       <div className="flex items-center justify-between">
         <div className="flex items-center gap-2">
           <span className="text-lg">{category.icon}</span>
-          <h3 className="text-sm font-bold" style={{ color: `rgb(${category.baseColor.join(',')})` }}>
+          <h3 className="text-sm font-bold heading" style={{ color: category.cssColor }}>
             {category.name}
           </h3>
-          <span className="text-[10px] text-gray-500">{totalSignals} signals</span>
+          <span className="text-[10px]" style={{ color: 'var(--text-muted)' }}>{totalSignals} signals</span>
         </div>
         <div className="flex items-center gap-3 text-[10px]">
-          <span className="text-gray-500">
-            Peak: <span className="font-bold" style={{ color: `rgb(${category.baseColor.join(',')})` }}>
+          <span style={{ color: 'var(--text-muted)' }}>
+            Peak:{' '}
+            <span className="font-bold" style={{ color: category.cssColor }}>
               {(maxIntensity * 100).toFixed(0)}%
             </span>
           </span>
-          <span className={`font-mono ${avgSentiment > 0 ? 'text-green-400' : avgSentiment < 0 ? 'text-red-400' : 'text-gray-500'}`}>
+          <span
+            className="mono"
+            style={{ color: avgSentiment > 0 ? 'var(--green)' : avgSentiment < 0 ? 'var(--red)' : 'var(--text-muted)' }}
+          >
             Sentiment: {avgSentiment > 0 ? '+' : ''}{avgSentiment.toFixed(3)}
           </span>
         </div>
@@ -205,19 +252,19 @@ function IntensityScale() {
   const steps = 10;
   return (
     <div className="flex items-center gap-2">
-      <span className="text-[10px] text-gray-500">Low</span>
+      <span className="stat-label">Low</span>
       <div className="flex gap-px">
         {Array.from({ length: steps }).map((_, i) => (
           <div
             key={i}
             className="w-5 h-3 rounded-sm"
             style={{
-              backgroundColor: `rgba(245,158,11,${(i + 1) / steps * 0.8 + 0.05})`,
+              backgroundColor: `rgba(0,240,255,${(i + 1) / steps * 0.7 + 0.05})`,
             }}
           />
         ))}
       </div>
-      <span className="text-[10px] text-gray-500">High</span>
+      <span className="stat-label">High</span>
     </div>
   );
 }
@@ -232,46 +279,65 @@ function CellDetail({ cell, signals, onClose }) {
   }).slice(0, 10);
 
   return (
-    <div className="card border border-amber-500/30 bg-gradient-to-br from-gray-800/95 to-gray-900/95 backdrop-blur-md">
+    <div className="card-glow fade-in">
       <div className="flex items-start justify-between mb-3">
         <div>
           <div className="flex items-center gap-2 mb-1">
             <span className="text-lg">{cell.categoryIcon}</span>
-            <h3 className="text-sm font-bold text-gray-100">{cell.category} / {cell.subcategory}</h3>
+            <h3 className="heading text-sm font-bold" style={{ color: 'var(--text)' }}>
+              {cell.category} / {cell.subcategory}
+            </h3>
           </div>
-          <p className="text-xs text-gray-500">
-            {cell.signalCount} signals | Intensity: {(cell.intensity * 100).toFixed(0)}% |
-            Sentiment: <span className={cell.sentiment > 0 ? 'text-green-400' : cell.sentiment < 0 ? 'text-red-400' : 'text-gray-400'}>
+          <p className="text-xs" style={{ color: 'var(--text-muted)' }}>
+            {cell.signalCount} signals | Intensity: {(cell.intensity * 100).toFixed(0)}% | Sentiment:{' '}
+            <span style={{ color: cell.sentiment > 0 ? 'var(--green)' : cell.sentiment < 0 ? 'var(--red)' : 'var(--text-dim)' }}>
               {cell.sentiment > 0 ? '+' : ''}{cell.sentiment.toFixed(3)}
             </span>
           </p>
         </div>
-        <button onClick={onClose} className="text-gray-500 hover:text-gray-300 text-lg">&times;</button>
+        <button onClick={onClose} className="btn btn-ghost text-lg leading-none" style={{ padding: '0 6px' }}>
+          &times;
+        </button>
       </div>
 
       {cellSignals.length > 0 ? (
         <div className="space-y-2">
-          <p className="text-[10px] text-gray-500 uppercase font-medium">Related Signals</p>
+          <p className="stat-label mb-1">Related Signals</p>
           {cellSignals.map((sig, i) => (
-            <div key={i} className="flex items-center gap-3 text-xs bg-gray-800/40 rounded-lg px-3 py-2 border border-gray-700/20">
-              <span className={`px-1.5 py-0.5 rounded text-[9px] font-bold ${
-                sig.direction === 'BUY_YES' ? 'bg-green-500/20 text-green-400' : 'bg-red-500/20 text-red-400'
-              }`}>
+            <div
+              key={i}
+              className="flex items-center gap-3 text-xs rounded-lg px-3 py-2"
+              style={{ background: 'var(--surface-el)', border: '1px solid var(--border)' }}
+            >
+              <span
+                className="badge"
+                style={
+                  sig.direction === 'BUY_YES'
+                    ? { background: 'var(--green-dim)', color: 'var(--green)' }
+                    : { background: 'var(--red-dim)', color: 'var(--red)' }
+                }
+              >
                 {sig.direction}
               </span>
-              <span className="text-gray-400 font-mono truncate flex-1">{sig.ticker}</span>
-              <span className="text-amber-400 font-mono font-bold">{(parseFloat(sig.expected_edge) * 100).toFixed(1)}%</span>
-              <span className="text-blue-400 font-mono">{(parseFloat(sig.confidence) * 100).toFixed(0)}%</span>
+              <span className="mono truncate flex-1" style={{ color: 'var(--text-dim)' }}>{sig.ticker}</span>
+              <span className="mono font-bold" style={{ color: 'var(--orange)' }}>
+                {(parseFloat(sig.expected_edge) * 100).toFixed(1)}%
+              </span>
+              <span className="mono" style={{ color: 'var(--blue)' }}>
+                {(parseFloat(sig.confidence) * 100).toFixed(0)}%
+              </span>
               {sig.risk_approved ? (
-                <span className="text-green-400 text-[9px] font-bold">OK</span>
+                <span className="text-[9px] font-bold" style={{ color: 'var(--green)' }}>OK</span>
               ) : (
-                <span className="text-red-400 text-[9px] font-bold">BLOCKED</span>
+                <span className="text-[9px] font-bold" style={{ color: 'var(--red)' }}>BLOCKED</span>
               )}
             </div>
           ))}
         </div>
       ) : (
-        <p className="text-gray-600 text-sm text-center py-4">No matching signals for this subcategory</p>
+        <p className="text-sm text-center py-4" style={{ color: 'var(--text-muted)' }}>
+          No matching signals for this subcategory
+        </p>
       )}
     </div>
   );
@@ -282,10 +348,10 @@ function NationalOverview({ categoryStats }) {
   const maxSignals = Math.max(...categoryStats.map(c => c.totalSignals), 1);
 
   return (
-    <div className="card border border-gray-700/50">
+    <div className="card">
       <div className="flex items-center gap-2 mb-4">
-        <h2 className="font-semibold text-sm">National Activity Overview</h2>
-        <span className="text-[10px] text-gray-500">Signal density across categories</span>
+        <h2 className="section-title">National Activity Overview</h2>
+        <span className="section-subtitle">Signal density across categories</span>
       </div>
       <div className="space-y-2">
         {categoryStats.sort((a, b) => b.totalSignals - a.totalSignals).map(cat => {
@@ -293,8 +359,13 @@ function NationalOverview({ categoryStats }) {
           return (
             <div key={cat.name} className="flex items-center gap-3">
               <span className="text-sm w-5">{cat.icon}</span>
-              <span className="text-xs font-medium w-20" style={{ color: `rgb(${cat.baseColor.join(',')})` }}>{cat.name}</span>
-              <div className="flex-1 h-5 bg-gray-800/60 rounded-full overflow-hidden relative">
+              <span className="text-xs font-medium w-20 heading" style={{ color: cat.cssColor || `rgb(${cat.baseColor.join(',')})` }}>
+                {cat.name}
+              </span>
+              <div
+                className="flex-1 h-5 rounded-full overflow-hidden relative"
+                style={{ background: 'var(--surface-el)' }}
+              >
                 <div
                   className="h-full rounded-full transition-all duration-1000 relative overflow-hidden"
                   style={{
@@ -303,16 +374,25 @@ function NationalOverview({ categoryStats }) {
                   }}
                 >
                   {/* Animated shimmer */}
-                  <div className="absolute inset-0" style={{
-                    background: 'linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%)',
-                    animation: 'shimmer 2s infinite',
-                  }} />
+                  <div
+                    className="absolute inset-0"
+                    style={{
+                      background: 'linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%)',
+                      animation: 'shimmer 2s infinite',
+                    }}
+                  />
                 </div>
-                <span className="absolute right-2 top-0 bottom-0 flex items-center text-[10px] font-mono text-gray-400">
+                <span
+                  className="absolute right-2 top-0 bottom-0 flex items-center text-[10px] mono"
+                  style={{ color: 'var(--text-dim)' }}
+                >
                   {cat.totalSignals}
                 </span>
               </div>
-              <span className={`text-[10px] font-mono w-12 text-right ${cat.avgSentiment > 0 ? 'text-green-400' : cat.avgSentiment < 0 ? 'text-red-400' : 'text-gray-500'}`}>
+              <span
+                className="text-[10px] mono w-12 text-right"
+                style={{ color: cat.avgSentiment > 0 ? 'var(--green)' : cat.avgSentiment < 0 ? 'var(--red)' : 'var(--text-muted)' }}
+              >
                 {cat.avgSentiment > 0 ? '+' : ''}{cat.avgSentiment.toFixed(2)}
               </span>
             </div>
@@ -371,7 +451,6 @@ export default function Pulse() {
     );
 
     const catData = PULSE_CATEGORIES.map(category => {
-      // Find all signals matching this category
       const categorySignals = allSignals.filter(s => {
         const lower = (s.reasoning || s.ticker || '').toLowerCase();
         return category.keywords.some(kw => lower.includes(kw));
@@ -385,15 +464,12 @@ export default function Pulse() {
           }, 0) / Math.max(categorySignals.length, 1)
         : 0;
 
-      // Build subcategory data
       const subcategoryData = category.subcategories.map(sub => {
-        // Match signals to subcategory (approximate: use keyword proximity)
         const subKeywords = category.keywords.filter(kw => {
           const subLower = sub.toLowerCase();
           return kw.includes(subLower) || subLower.includes(kw.split(' ')[0]);
         });
 
-        // If no specific keywords match, distribute category signals evenly
         let matchingSignals;
         if (subKeywords.length > 0) {
           matchingSignals = allSignals.filter(s => {
@@ -401,7 +477,6 @@ export default function Pulse() {
             return subKeywords.some(kw => lower.includes(kw));
           });
         } else {
-          // Distribute based on hash of subcategory name to deterministically assign
           const hash = sub.split('').reduce((h, c) => ((h << 5) - h + c.charCodeAt(0)) | 0, 0);
           matchingSignals = categorySignals.filter((_, i) => i % category.subcategories.length === Math.abs(hash) % category.subcategories.length);
         }
@@ -412,7 +487,6 @@ export default function Pulse() {
           return s + sentSum;
         }, 0) / Math.max(matchingSignals.length, 1);
 
-        // Intensity: normalized by max signals across all subcategories
         const intensity = Math.min(1, signalCount / Math.max(maxSubSignals * 0.5, 1));
 
         return {
@@ -425,10 +499,7 @@ export default function Pulse() {
         };
       });
 
-      return {
-        category,
-        subcategoryData,
-      };
+      return { category, subcategoryData };
     });
 
     const catStats = PULSE_CATEGORIES.map(cat => {
@@ -440,6 +511,7 @@ export default function Pulse() {
         name: cat.name,
         icon: cat.icon,
         baseColor: cat.baseColor,
+        cssColor: cat.cssColor,
         totalSignals: catSignals.length,
         avgSentiment: catSignals.length > 0
           ? catSignals.reduce((s, sig) => s + (sig.sources || []).reduce((ss, src) => ss + (src.sentiment || 0), 0), 0) / catSignals.length
@@ -454,7 +526,7 @@ export default function Pulse() {
       approved: allSignals.filter(s => s.risk_approved).length,
       avgEdge: allSignals.length > 0 ? allSignals.reduce((s, sig) => s + parseFloat(sig.expected_edge || 0), 0) / allSignals.length : 0,
       avgConf: allSignals.length > 0 ? allSignals.reduce((s, sig) => s + parseFloat(sig.confidence || 0), 0) / allSignals.length : 0,
-      hottest: catStats.sort((a, b) => b.totalSignals - a.totalSignals)[0]?.name || 'None',
+      hottest: [...catStats].sort((a, b) => b.totalSignals - a.totalSignals)[0]?.name || 'None',
     };
 
     return { categoryData: catData, categoryStats: catStats, overallStats: overall };
@@ -462,59 +534,77 @@ export default function Pulse() {
 
   if (loading) return (
     <div className="flex items-center justify-center h-64">
-      <div className="animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full" />
+      <div
+        className="w-8 h-8 rounded-full border-2 border-t-transparent animate-spin"
+        style={{ borderColor: 'var(--cyan)', borderTopColor: 'transparent' }}
+      />
     </div>
   );
 
+  const overallStatsConfig = [
+    { label: 'Total Signals',   value: overallStats.totalSignals || 0,                              color: 'var(--cyan)' },
+    { label: 'BUY YES',         value: overallStats.buyYes || 0,                                     color: 'var(--green)' },
+    { label: 'BUY NO',          value: overallStats.buyNo || 0,                                      color: 'var(--red)' },
+    { label: 'Approved',        value: overallStats.approved || 0,                                   color: 'var(--green)' },
+    { label: 'Avg Edge',        value: `${((overallStats.avgEdge || 0) * 100).toFixed(1)}%`,         color: 'var(--orange)' },
+    { label: 'Avg Confidence',  value: `${((overallStats.avgConf || 0) * 100).toFixed(0)}%`,         color: 'var(--blue)' },
+    { label: 'Hottest Sector',  value: overallStats.hottest,                                         color: 'var(--red)' },
+  ];
+
   return (
     <div className="space-y-6">
-      {/* Shimmer animation CSS */}
+      {/* Shimmer + hover scale CSS */}
       <style>{`
         @keyframes shimmer {
           0% { transform: translateX(-100%); }
           100% { transform: translateX(200%); }
         }
-        .hover\\:scale-102:hover { transform: scale(1.02); }
       `}</style>
 
-      {/* Header */}
+      {/* Page Header */}
       <div className="flex items-center justify-between">
         <div>
-          <h1 className="text-2xl font-bold">Pulse of America</h1>
-          <p className="text-gray-500 text-sm">Sentiment and activity heatmap across American prediction markets</p>
+          <h1 className="heading text-2xl font-bold flex items-center gap-3">
+            {/* Live pulsing indicator */}
+            <span
+              className="inline-flex items-center justify-center w-3 h-3 rounded-full pulse-cyan"
+              style={{ backgroundColor: 'var(--cyan)', flexShrink: 0 }}
+            />
+            <span className="gradient-cyan">Pulse of America</span>
+          </h1>
+          <p className="section-subtitle mt-1">
+            Sentiment and activity heatmap across American prediction markets
+          </p>
         </div>
         <div className="flex items-center gap-3">
-          <div className="flex items-center gap-1 bg-gray-800 rounded-lg p-0.5">
+          <div
+            className="flex items-center gap-0.5 rounded-lg p-0.5"
+            style={{ background: 'var(--surface-el)', border: '1px solid var(--border)' }}
+          >
             {['24h', '7d', '30d'].map(tw => (
               <button
                 key={tw}
                 onClick={() => setTimeWindow(tw)}
-                className={`px-3 py-1.5 text-xs font-medium rounded-md transition ${
-                  timeWindow === tw ? 'bg-amber-500 text-black' : 'text-gray-400 hover:text-gray-200'
-                }`}
+                className="btn btn-sm"
+                style={timeWindow === tw
+                  ? { background: 'var(--cyan)', color: 'var(--bg)', fontWeight: 700 }
+                  : { background: 'transparent', color: 'var(--text-muted)' }
+                }
               >
                 {tw}
               </button>
             ))}
           </div>
-          <button onClick={load} className="btn btn-o text-sm">Refresh</button>
+          <button onClick={load} className="btn btn-o btn-sm">Refresh</button>
         </div>
       </div>
 
       {/* Overall Stats */}
       <div className="grid grid-cols-7 gap-3">
-        {[
-          { label: 'Total Signals', value: overallStats.totalSignals || 0, color: 'text-amber-400' },
-          { label: 'BUY YES', value: overallStats.buyYes || 0, color: 'text-green-400' },
-          { label: 'BUY NO', value: overallStats.buyNo || 0, color: 'text-red-400' },
-          { label: 'Approved', value: overallStats.approved || 0, color: 'text-green-400' },
-          { label: 'Avg Edge', value: `${(overallStats.avgEdge * 100).toFixed(1)}%`, color: 'text-amber-400' },
-          { label: 'Avg Confidence', value: `${(overallStats.avgConf * 100).toFixed(0)}%`, color: 'text-blue-400' },
-          { label: 'Hottest Sector', value: overallStats.hottest, color: 'text-red-400' },
-        ].map(s => (
+        {overallStatsConfig.map(s => (
           <div key={s.label} className="card">
-            <p className="text-[10px] text-gray-500 uppercase mb-1">{s.label}</p>
-            <p className={`text-lg font-bold ${s.color}`}>{s.value}</p>
+            <p className="stat-label mb-1">{s.label}</p>
+            <p className="stat-v text-lg" style={{ color: s.color }}>{s.value}</p>
           </div>
         ))}
       </div>
@@ -522,12 +612,15 @@ export default function Pulse() {
       {/* National Overview */}
       <NationalOverview categoryStats={categoryStats} />
 
-      {/* Pulse Heatmap Grid */}
+      {/* Live Signal Heatmap Grid */}
       <div className="card p-4">
         <div className="flex items-center justify-between mb-5">
           <div className="flex items-center gap-2">
-            <div className="w-2 h-2 rounded-full bg-red-500 animate-pulse" />
-            <h2 className="font-semibold text-sm">Live Signal Heatmap</h2>
+            <div
+              className="w-2 h-2 rounded-full animate-pulse"
+              style={{ backgroundColor: 'var(--red)' }}
+            />
+            <h2 className="section-title">Live Signal Heatmap</h2>
           </div>
           <IntensityScale />
         </div>
@@ -558,32 +651,41 @@ export default function Pulse() {
         />
       )}
 
-      {/* Sentiment Ticker */}
-      <div className="card border border-gray-700/50">
-        <div className="flex items-center gap-2 mb-3">
-          <h2 className="font-semibold text-sm">Signal Source Breakdown</h2>
+      {/* Signal Source Breakdown */}
+      <div className="card">
+        <div className="flex items-center gap-2 mb-4">
+          <h2 className="section-title">Signal Source Breakdown</h2>
         </div>
         <div className="grid grid-cols-4 gap-3">
           {(signalsDash?.sourceBreakdown || []).slice(0, 8).map(src => {
             const sent = parseFloat(src.avg_sent) || 0;
             const count = parseInt(src.cnt) || 0;
             return (
-              <div key={src.source} className="rounded-lg bg-gray-800/40 p-3 border border-gray-700/30">
-                <div className="flex items-center justify-between mb-1">
-                  <span className="text-xs font-bold text-gray-300 uppercase">{src.source.replace('_', ' ')}</span>
-                  <span className="text-amber-400 font-mono text-xs font-bold">{count}</span>
+              <div
+                key={src.source}
+                className="rounded-lg p-3"
+                style={{ background: 'var(--surface-el)', border: '1px solid var(--border)' }}
+              >
+                <div className="flex items-center justify-between mb-2">
+                  <span className="text-xs font-bold heading" style={{ color: 'var(--text-dim)' }}>
+                    {src.source.replace('_', ' ').toUpperCase()}
+                  </span>
+                  <span className="mono text-xs font-bold" style={{ color: 'var(--orange)' }}>{count}</span>
                 </div>
                 <div className="flex items-center gap-2">
-                  <div className="flex-1 h-1.5 bg-gray-700 rounded-full overflow-hidden">
+                  <div className="progress-bar flex-1">
                     <div
-                      className="h-full rounded-full"
+                      className="progress-fill"
                       style={{
                         width: `${Math.min(100, Math.abs(sent) * 5000 + 10)}%`,
-                        backgroundColor: sent > 0 ? '#22c55e' : sent < 0 ? '#ef4444' : '#64748b',
+                        background: sent > 0 ? 'var(--green)' : sent < 0 ? 'var(--red)' : 'var(--text-muted)',
                       }}
                     />
                   </div>
-                  <span className={`text-[10px] font-mono ${sent > 0 ? 'text-green-400' : sent < 0 ? 'text-red-400' : 'text-gray-500'}`}>
+                  <span
+                    className="text-[10px] mono"
+                    style={{ color: sent > 0 ? 'var(--green)' : sent < 0 ? 'var(--red)' : 'var(--text-muted)' }}
+                  >
                     {sent > 0 ? '+' : ''}{sent.toFixed(3)}
                   </span>
                 </div>
@@ -593,39 +695,51 @@ export default function Pulse() {
         </div>
       </div>
 
-      {/* Trading Activity Summary from Dashboard */}
+      {/* Market Pulse Metrics from Dashboard */}
       {data && (
-        <div className="card border border-gray-700/50">
-          <div className="flex items-center gap-2 mb-3">
-            <h2 className="font-semibold text-sm">Market Pulse Metrics</h2>
+        <div className="card">
+          <div className="flex items-center gap-2 mb-4">
+            <h2 className="section-title">Market Pulse Metrics</h2>
           </div>
           <div className="grid grid-cols-5 gap-3 text-center">
-            <div className="rounded-lg bg-gray-800/40 p-3 border border-gray-700/30">
-              <p className="text-[9px] text-gray-500 uppercase">Balance</p>
-              <p className="text-lg font-bold text-green-400 font-mono">
-                ${data.balance ? (data.balance / 100).toLocaleString(undefined, { minimumFractionDigits: 0 }) : '0'}
-              </p>
-            </div>
-            <div className="rounded-lg bg-gray-800/40 p-3 border border-gray-700/30">
-              <p className="text-[9px] text-gray-500 uppercase">Today's P&L</p>
-              <p className={`text-lg font-bold font-mono ${(data.daily_pnl || 0) >= 0 ? 'text-green-400' : 'text-red-400'}`}>
-                {(data.daily_pnl || 0) >= 0 ? '+' : ''}${((data.daily_pnl || 0) / 100).toFixed(2)}
-              </p>
-            </div>
-            <div className="rounded-lg bg-gray-800/40 p-3 border border-gray-700/30">
-              <p className="text-[9px] text-gray-500 uppercase">Today's Trades</p>
-              <p className="text-lg font-bold text-amber-400">{(data.today_trades || 0).toLocaleString()}</p>
-            </div>
-            <div className="rounded-lg bg-gray-800/40 p-3 border border-gray-700/30">
-              <p className="text-[9px] text-gray-500 uppercase">Win Rate</p>
-              <p className={`text-lg font-bold ${data.today_trades > 0 && (data.today_wins / data.today_trades * 100) >= 50 ? 'text-green-400' : 'text-red-400'}`}>
-                {data.today_trades > 0 ? ((data.today_wins / data.today_trades) * 100).toFixed(1) : '0'}%
-              </p>
-            </div>
-            <div className="rounded-lg bg-gray-800/40 p-3 border border-gray-700/30">
-              <p className="text-[9px] text-gray-500 uppercase">Markets Tracked</p>
-              <p className="text-lg font-bold text-purple-400">{data.markets_tracked || 0}</p>
-            </div>
+            {[
+              {
+                label: 'Balance',
+                value: `$${data.balance ? (data.balance / 100).toLocaleString(undefined, { minimumFractionDigits: 0 }) : '0'}`,
+                color: 'var(--green)',
+              },
+              {
+                label: "Today's P&L",
+                value: `${(data.daily_pnl || 0) >= 0 ? '+' : ''}$${((data.daily_pnl || 0) / 100).toFixed(2)}`,
+                color: (data.daily_pnl || 0) >= 0 ? 'var(--green)' : 'var(--red)',
+              },
+              {
+                label: "Today's Trades",
+                value: (data.today_trades || 0).toLocaleString(),
+                color: 'var(--orange)',
+              },
+              {
+                label: 'Win Rate',
+                value: `${data.today_trades > 0 ? ((data.today_wins / data.today_trades) * 100).toFixed(1) : '0'}%`,
+                color: data.today_trades > 0 && (data.today_wins / data.today_trades * 100) >= 50
+                  ? 'var(--green)'
+                  : 'var(--red)',
+              },
+              {
+                label: 'Markets Tracked',
+                value: data.markets_tracked || 0,
+                color: 'var(--purple)',
+              },
+            ].map(s => (
+              <div
+                key={s.label}
+                className="rounded-lg p-3"
+                style={{ background: 'var(--surface-el)', border: '1px solid var(--border)' }}
+              >
+                <p className="stat-label mb-1">{s.label}</p>
+                <p className="stat-v text-lg" style={{ color: s.color }}>{s.value}</p>
+              </div>
+            ))}
           </div>
         </div>
       )}
diff --git a/kalshi-dash/src/pages/Risk.jsx b/kalshi-dash/src/pages/Risk.jsx
index 018915d..8a23edc 100644
--- a/kalshi-dash/src/pages/Risk.jsx
+++ b/kalshi-dash/src/pages/Risk.jsx
@@ -1,7 +1,12 @@
 import React, { useState, useEffect, useMemo } from 'react';
 import { api, post } from '../api';
-import { BarChart, Bar, AreaChart, Area, XAxis, YAxis, Tooltip, ResponsiveContainer, Cell, PieChart, Pie } from 'recharts';
+import {
+  BarChart, Bar, AreaChart, Area,
+  XAxis, YAxis, Tooltip, ResponsiveContainer,
+  Cell, PieChart, Pie,
+} from 'recharts';
 
+// ── Strategy color palette ──
 const STRAT_COLORS = {
   aggressive: '#ef4444', conservative: '#3b82f6', weather: '#06b6d4', momentum: '#f59e0b',
   contrarian: '#a855f7', ai_enhanced: '#ec4899', mc_validated: '#8b5cf6', scalper: '#10b981',
@@ -12,35 +17,56 @@ const STRAT_COLORS = {
   mean_revert: '#4338ca', info_ratio: '#b45309', anti_fomo: '#64748b', nightcrawler: '#334155',
   heatseeker: '#dc2626', quant_core: '#2563eb',
 };
-const ETF_COLOR = '#f59e0b';
+const ETF_COLOR = '#F7931A';
 
 function getColor(strategy) {
   if (strategy.startsWith('etf_')) return ETF_COLOR;
   return STRAT_COLORS[strategy] || '#6b7280';
 }
 
+// ── Mini win/loss bar ──
 function MiniBar({ won, lost, total }) {
-  if (!total) return <span className="text-[10px] text-gray-600">no trades</span>;
+  if (!total) return <span className="text-xs" style={{ color: 'var(--text-muted)' }}>no trades</span>;
   const w = (won / total) * 100;
   const l = (lost / total) * 100;
   return (
-    <div className="flex h-2 rounded-full overflow-hidden bg-gray-800 w-full">
-      {won > 0 && <div className="bg-green-500" style={{ width: `${w}%` }} />}
-      {lost > 0 && <div className="bg-red-500" style={{ width: `${l}%` }} />}
+    <div className="flex h-1.5 rounded-full overflow-hidden w-full" style={{ background: 'var(--border)' }}>
+      {won > 0 && <div style={{ width: `${w}%`, background: 'var(--green)' }} />}
+      {lost > 0 && <div style={{ width: `${l}%`, background: 'var(--red)' }} />}
     </div>
   );
 }
 
+// ── Streak badge ──
 function StreakBadge({ streak }) {
-  if (streak === 0) return <span className="text-gray-600 text-xs">—</span>;
+  if (streak === 0) return <span style={{ color: 'var(--text-muted)', fontSize: '0.7rem' }}>—</span>;
   const hot = streak > 0;
   return (
-    <span className={`text-xs font-mono font-bold ${hot ? 'text-green-400' : 'text-red-400'}`}>
+    <span
+      className="mono font-bold text-xs"
+      style={{ color: hot ? 'var(--green)' : 'var(--red)' }}
+    >
       {hot ? '+' : ''}{streak}
     </span>
   );
 }
 
+// ── Risk level badge ──
+function RiskBadge({ level }) {
+  if (!level) return null;
+  const map = {
+    low: 'bg-green',
+    medium: 'bg-orange',
+    high: 'bg-red',
+  };
+  return (
+    <span className={`badge ${map[level] || 'bg-blue'}`}>
+      {level.toUpperCase()}
+    </span>
+  );
+}
+
+// ── Portfolio Card ──
 function PortfolioCard({ p, dailyPnl, expanded, onToggle }) {
   const pnl = (p.total_returned_cents - p.total_invested_cents) / 100;
   const totalTrades = p.trades_won + p.trades_lost + p.trades_expired;
@@ -49,71 +75,172 @@ function PortfolioCard({ p, dailyPnl, expanded, onToggle }) {
   const active = totalTrades > 0;
   const color = getColor(p.strategy);
 
+  // Allocation as % of daily budget vs a synthetic max
+  const allocPct = Math.min(100, (p.daily_budget_cents / Math.max(1, 100000)) * 100);
+
   return (
     <div
-      className={`rounded-xl border transition-all cursor-pointer hover:border-gray-600 ${
-        active ? 'bg-gray-900/60 border-gray-700/60' : 'bg-gray-900/20 border-gray-800/40 opacity-60'
-      } ${expanded ? 'col-span-2 row-span-2' : ''}`}
+      className="card cursor-pointer transition-all"
+      style={
+        expanded
+          ? {
+              borderColor: 'var(--cyan)',
+              boxShadow: '0 0 20px var(--cyan-glow)',
+              opacity: 1,
+            }
+          : active
+          ? { opacity: 1 }
+          : { opacity: 0.5 }
+      }
       onClick={onToggle}
     >
-      <div className="p-3">
-        {/* Header */}
-        <div className="flex items-center justify-between mb-2">
-          <div className="flex items-center gap-2">
-            <div className="w-2.5 h-2.5 rounded-full" style={{ background: color }} />
-            <span className="font-semibold text-sm text-gray-100">{p.name}</span>
-            <span className="text-[10px] text-gray-500 font-mono">#{p.id}</span>
-          </div>
-          <span className={`text-sm font-mono font-bold ${pnl >= 0 ? 'text-green-400' : 'text-red-400'}`}>
-            {pnl >= 0 ? '+' : ''}{pnl.toFixed(2)}
+      {/* Header row */}
+      <div className="flex items-center justify-between mb-2">
+        <div className="flex items-center gap-2 min-w-0">
+          <div
+            className="w-2.5 h-2.5 rounded-full flex-shrink-0"
+            style={{ background: color }}
+          />
+          <span
+            className="heading font-semibold text-sm truncate"
+            style={{ color: 'var(--text)' }}
+          >
+            {p.name}
+          </span>
+          <span className="mono text-xs flex-shrink-0" style={{ color: 'var(--text-muted)' }}>
+            #{p.id}
           </span>
         </div>
+        <span
+          className="mono text-sm font-bold flex-shrink-0 ml-2"
+          style={{ color: pnl >= 0 ? 'var(--green)' : 'var(--red)' }}
+        >
+          {pnl >= 0 ? '+' : ''}${pnl.toFixed(2)}
+        </span>
+      </div>
 
-        {/* Strategy tag */}
-        <div className="flex items-center gap-2 mb-2">
-          <span className="text-[10px] px-1.5 py-0.5 rounded-md font-mono" style={{ background: `${color}15`, color, border: `1px solid ${color}30` }}>
-            {p.strategy}
+      {/* Strategy tag + streak */}
+      <div className="flex items-center gap-2 mb-3">
+        <span
+          className="mono px-1.5 py-0.5 rounded text-xs flex-shrink-0"
+          style={{
+            background: `${color}15`,
+            color,
+            border: `1px solid ${color}30`,
+          }}
+        >
+          {p.strategy}
+        </span>
+        <StreakBadge streak={p.streak} />
+        <div className="flex-1" />
+        <span
+          className="badge flex-shrink-0"
+          style={
+            active
+              ? { background: 'var(--green-dim)', color: 'var(--green)' }
+              : { background: 'var(--border)', color: 'var(--text-muted)' }
+          }
+        >
+          {active ? 'Active' : 'Dormant'}
+        </span>
+      </div>
+
+      {/* Win/loss bar */}
+      <div className="mb-3">
+        <MiniBar won={p.trades_won} lost={p.trades_lost} total={totalTrades} />
+        <div className="flex justify-between mt-1">
+          <span className="text-xs" style={{ color: 'var(--text-muted)' }}>
+            {p.trades_won}W / {p.trades_lost}L
+          </span>
+          <span className="mono text-xs" style={{ color: 'var(--text-dim)' }}>
+            {p.win_rate || 0}%
           </span>
-          <StreakBadge streak={p.streak} />
         </div>
+      </div>
 
-        {/* Win/Loss bar */}
-        <div className="mb-2">
-          <MiniBar won={p.trades_won} lost={p.trades_lost} total={totalTrades} />
-          <div className="flex justify-between mt-1">
-            <span className="text-[10px] text-gray-500">{p.trades_won}W / {p.trades_lost}L</span>
-            <span className="text-[10px] text-gray-500">{p.win_rate || 0}%</span>
-          </div>
+      {/* Allocation bar */}
+      <div className="mb-3">
+        <div className="flex justify-between text-xs mb-1" style={{ color: 'var(--text-muted)' }}>
+          <span>Daily Budget</span>
+          <span className="mono" style={{ color: 'var(--text-dim)' }}>
+            ${(p.daily_budget_cents / 100).toFixed(2)}
+          </span>
         </div>
-
-        {/* Stats row */}
-        <div className="grid grid-cols-2 gap-x-3 gap-y-1 text-[11px]">
-          <div className="flex justify-between"><span className="text-gray-500">Invested</span><span className="text-gray-300 font-mono">${invested.toFixed(2)}</span></div>
-          <div className="flex justify-between"><span className="text-gray-500">Returned</span><span className="text-gray-300 font-mono">${returned.toFixed(2)}</span></div>
-          <div className="flex justify-between"><span className="text-gray-500">Budget/Day</span><span className="text-gray-300 font-mono">${(p.daily_budget_cents / 100).toFixed(2)}</span></div>
-          <div className="flex justify-between"><span className="text-gray-500">Today</span><span className="text-gray-300 font-mono">{p.trades_today} trades</span></div>
+        <div className="progress-bar">
+          <div
+            className="progress-fill"
+            style={{ width: `${allocPct}%`, background: `linear-gradient(90deg, ${color}, ${color}99)` }}
+          />
         </div>
+      </div>
 
-        {/* Expanded: daily P&L sparkline */}
-        {expanded && dailyPnl && dailyPnl.length > 0 && (
-          <div className="mt-3 pt-3 border-t border-gray-800">
-            <p className="text-[10px] text-gray-500 mb-1">Cumulative P&L</p>
-            <ResponsiveContainer width="100%" height={80}>
-              <AreaChart data={dailyPnl}>
-                <XAxis dataKey="date" hide />
-                <YAxis hide domain={['dataMin', 'dataMax']} />
-                <Tooltip
-                  contentStyle={{ background: '#1f2937', border: '1px solid #374151', borderRadius: 8, fontSize: 11 }}
-                  formatter={v => [`$${(v / 100).toFixed(2)}`, 'P&L']}
-                  labelFormatter={l => l}
-                />
-                <Area type="monotone" dataKey="cumulative" stroke={color} fill={color} fillOpacity={0.1} strokeWidth={1.5} dot={false} />
-              </AreaChart>
-            </ResponsiveContainer>
-            <p className="text-[10px] text-gray-600 mt-1">{p.description}</p>
-          </div>
-        )}
+      {/* Stats grid */}
+      <div className="grid grid-cols-2 gap-x-3 gap-y-1" style={{ fontSize: '0.7rem' }}>
+        <div className="flex justify-between">
+          <span style={{ color: 'var(--text-muted)' }}>Invested</span>
+          <span className="mono" style={{ color: 'var(--text-dim)' }}>${invested.toFixed(2)}</span>
+        </div>
+        <div className="flex justify-between">
+          <span style={{ color: 'var(--text-muted)' }}>Returned</span>
+          <span className="mono" style={{ color: 'var(--text-dim)' }}>${returned.toFixed(2)}</span>
+        </div>
+        <div className="flex justify-between">
+          <span style={{ color: 'var(--text-muted)' }}>Trades Today</span>
+          <span className="mono" style={{ color: 'var(--cyan)' }}>{p.trades_today}</span>
+        </div>
+        <div className="flex justify-between">
+          <span style={{ color: 'var(--text-muted)' }}>Total</span>
+          <span className="mono" style={{ color: 'var(--text-dim)' }}>{totalTrades}</span>
+        </div>
       </div>
+
+      {/* Expanded sparkline */}
+      {expanded && dailyPnl && dailyPnl.length > 0 && (
+        <div className="mt-3 pt-3" style={{ borderTop: '1px solid var(--border)' }}>
+          <p className="text-xs mb-1" style={{ color: 'var(--text-muted)' }}>Cumulative P&L</p>
+          <ResponsiveContainer width="100%" height={80}>
+            <AreaChart data={dailyPnl}>
+              <XAxis dataKey="date" hide />
+              <YAxis hide domain={['dataMin', 'dataMax']} />
+              <Tooltip
+                contentStyle={{
+                  background: 'var(--surface-el)',
+                  border: '1px solid var(--border)',
+                  borderRadius: 8,
+                  fontSize: 11,
+                  fontFamily: 'var(--font-mono)',
+                }}
+                formatter={v => [`$${(v / 100).toFixed(2)}`, 'P&L']}
+                labelFormatter={l => l}
+              />
+              <Area
+                type="monotone"
+                dataKey="cumulative"
+                stroke={color}
+                fill={color}
+                fillOpacity={0.1}
+                strokeWidth={1.5}
+                dot={false}
+              />
+            </AreaChart>
+          </ResponsiveContainer>
+          {p.description && (
+            <p className="text-xs mt-1" style={{ color: 'var(--text-muted)' }}>{p.description}</p>
+          )}
+        </div>
+      )}
+    </div>
+  );
+}
+
+// ── Spinner ──
+function Spinner() {
+  return (
+    <div className="flex items-center justify-center h-64">
+      <div
+        className="w-9 h-9 rounded-full border-2 animate-spin"
+        style={{ borderColor: 'var(--border)', borderTopColor: 'var(--cyan)' }}
+      />
     </div>
   );
 }
@@ -147,7 +274,11 @@ export default function Risk() {
     if (filter === 'etf') list = list.filter(p => p.strategy.startsWith('etf_'));
     if (filter === 'core') list = list.filter(p => !p.strategy.startsWith('etf_'));
 
-    if (sort === 'pnl') list.sort((a, b) => (b.total_returned_cents - b.total_invested_cents) - (a.total_returned_cents - a.total_invested_cents));
+    if (sort === 'pnl')
+      list.sort((a, b) =>
+        (b.total_returned_cents - b.total_invested_cents) -
+        (a.total_returned_cents - a.total_invested_cents)
+      );
     if (sort === 'winrate') list.sort((a, b) => (b.win_rate || 0) - (a.win_rate || 0));
     if (sort === 'invested') list.sort((a, b) => b.total_invested_cents - a.total_invested_cents);
     if (sort === 'name') list.sort((a, b) => a.name.localeCompare(b.name));
@@ -155,7 +286,6 @@ export default function Risk() {
     return list;
   }, [portfolios, filter, sort]);
 
-  // Aggregate stats
   const stats = useMemo(() => {
     const totalInvested = portfolios.reduce((s, p) => s + p.total_invested_cents, 0);
     const totalReturned = portfolios.reduce((s, p) => s + p.total_returned_cents, 0);
@@ -163,21 +293,28 @@ export default function Risk() {
     const totalLosses = portfolios.reduce((s, p) => s + p.trades_lost, 0);
     const active = portfolios.filter(p => p.trades_won + p.trades_lost > 0).length;
     const dormant = portfolios.length - active;
-    const bestPf = [...portfolios].sort((a, b) => (b.total_returned_cents - b.total_invested_cents) - (a.total_returned_cents - a.total_invested_cents))[0];
-    const worstPf = [...portfolios].sort((a, b) => (a.total_returned_cents - a.total_invested_cents) - (b.total_returned_cents - b.total_invested_cents))[0];
+    const bestPf = [...portfolios].sort(
+      (a, b) =>
+        (b.total_returned_cents - b.total_invested_cents) -
+        (a.total_returned_cents - a.total_invested_cents)
+    )[0];
+    const worstPf = [...portfolios].sort(
+      (a, b) =>
+        (a.total_returned_cents - a.total_invested_cents) -
+        (b.total_returned_cents - b.total_invested_cents)
+    )[0];
     return { totalInvested, totalReturned, totalWins, totalLosses, active, dormant, bestPf, worstPf };
   }, [portfolios]);
 
-  // Bar chart data: top 15 by absolute P&L
-  const barData = useMemo(() => {
-    return [...portfolios]
+  const barData = useMemo(() =>
+    [...portfolios]
       .map(p => ({ name: p.name, pnl: (p.total_returned_cents - p.total_invested_cents) / 100, strategy: p.strategy }))
       .filter(p => p.pnl !== 0)
       .sort((a, b) => b.pnl - a.pnl)
-      .slice(0, 20);
-  }, [portfolios]);
+      .slice(0, 20),
+    [portfolios]
+  );
 
-  // Pie chart: strategy category breakdown
   const pieData = useMemo(() => {
     const cats = {};
     portfolios.forEach(p => {
@@ -188,65 +325,119 @@ export default function Risk() {
     return Object.values(cats).filter(c => c.value > 0).sort((a, b) => b.value - a.value);
   }, [portfolios]);
 
-  if (loading) return <div className="flex items-center justify-center h-64"><div className="animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full" /></div>;
+  if (loading) return <Spinner />;
 
   const pnl = (stats.totalReturned - stats.totalInvested) / 100;
   const totalTrades = stats.totalWins + stats.totalLosses;
 
   return (
-    <div className="space-y-6">
-      {/* Header */}
-      <div>
-        <h1 className="text-2xl font-bold">Portfauxlios</h1>
-        <p className="text-gray-500 text-sm">All 50 portfolios — performance, P&L, and strategy breakdown</p>
+    <div className="space-y-6 fade-in">
+
+      {/* ── Page Header ── */}
+      <div className="flex items-center justify-between">
+        <div>
+          <h1 className="heading text-3xl" style={{ color: 'var(--text)' }}>
+            Portfauxlios
+            <span className="badge bg-cyan ml-3 align-middle text-base">
+              {portfolios.length}
+            </span>
+          </h1>
+          <p className="section-subtitle mt-1">
+            All {portfolios.length} portfolios — performance, P&L, and strategy breakdown
+          </p>
+        </div>
+        <button onClick={load} className="btn btn-o btn-sm">Refresh</button>
       </div>
 
-      {/* Top Stats */}
-      <div className="grid grid-cols-6 gap-3">
+      {/* ── Summary Stats ── */}
+      <div className="grid grid-cols-3 md:grid-cols-6 gap-3">
         {[
-          { label: 'Total P&L', value: `${pnl >= 0 ? '+' : ''}$${pnl.toFixed(2)}`, color: pnl >= 0 ? 'text-green-400' : 'text-red-400' },
-          { label: 'Invested', value: `$${(stats.totalInvested / 100).toFixed(2)}`, color: 'text-amber-400' },
-          { label: 'Returned', value: `$${(stats.totalReturned / 100).toFixed(2)}`, color: 'text-blue-400' },
-          { label: 'Win Rate', value: totalTrades ? `${((stats.totalWins / totalTrades) * 100).toFixed(1)}%` : '0%', color: 'text-purple-400' },
-          { label: 'Active', value: stats.active, color: 'text-green-400' },
-          { label: 'Dormant', value: stats.dormant, color: 'text-gray-500' },
+          {
+            label: 'Total P&L',
+            value: `${pnl >= 0 ? '+' : ''}$${pnl.toFixed(2)}`,
+            color: pnl >= 0 ? 'var(--green)' : 'var(--red)',
+          },
+          {
+            label: 'Invested',
+            value: `$${(stats.totalInvested / 100).toFixed(2)}`,
+            color: 'var(--orange)',
+          },
+          {
+            label: 'Returned',
+            value: `$${(stats.totalReturned / 100).toFixed(2)}`,
+            color: 'var(--blue)',
+          },
+          {
+            label: 'Win Rate',
+            value: totalTrades ? `${((stats.totalWins / totalTrades) * 100).toFixed(1)}%` : '0%',
+            color: 'var(--purple)',
+          },
+          { label: 'Active', value: stats.active, color: 'var(--green)' },
+          { label: 'Dormant', value: stats.dormant, color: 'var(--text-muted)' },
         ].map(s => (
-          <div key={s.label} className="card text-center">
-            <div className={`text-lg font-bold font-mono ${s.color}`}>{s.value}</div>
-            <div className="text-[10px] text-gray-500 uppercase tracking-wider mt-1">{s.label}</div>
+          <div key={s.label} className="card text-center" style={{ padding: '1rem' }}>
+            <div className="stat-v" style={{ color: s.color, fontSize: '1.4rem' }}>
+              {s.value}
+            </div>
+            <div className="stat-label mt-1">{s.label}</div>
           </div>
         ))}
       </div>
 
-      {/* Charts Row */}
-      <div className="grid grid-cols-3 gap-4">
+      {/* ── Charts Row ── */}
+      <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
         {/* P&L Bar Chart */}
-        <div className="card col-span-2">
-          <h2 className="font-semibold text-sm mb-3">P&L by Portfolio</h2>
+        <div className="card md:col-span-2">
+          <h2 className="heading text-sm mb-3" style={{ color: 'var(--text-dim)' }}>
+            P&L by Portfolio
+          </h2>
           {barData.length > 0 ? (
             <ResponsiveContainer width="100%" height={220}>
               <BarChart data={barData} margin={{ left: 10, right: 10 }}>
-                <XAxis dataKey="name" tick={{ fill: '#6b7280', fontSize: 9 }} angle={-45} textAnchor="end" height={60} />
-                <YAxis tick={{ fill: '#6b7280', fontSize: 10 }} tickFormatter={v => `$${v}`} />
+                <XAxis
+                  dataKey="name"
+                  tick={{ fill: 'var(--text-muted)', fontSize: 9, fontFamily: 'var(--font-mono)' }}
+                  angle={-45}
+                  textAnchor="end"
+                  height={60}
+                />
+                <YAxis
+                  tick={{ fill: 'var(--text-muted)', fontSize: 10, fontFamily: 'var(--font-mono)' }}
+                  tickFormatter={v => `$${v}`}
+                />
                 <Tooltip
-                  contentStyle={{ background: '#1f2937', border: '1px solid #374151', borderRadius: 8, fontSize: 11 }}
+                  contentStyle={{
+                    background: 'var(--surface-el)',
+                    border: '1px solid var(--border)',
+                    borderRadius: 8,
+                    fontSize: 11,
+                    fontFamily: 'var(--font-mono)',
+                  }}
                   formatter={v => [`$${v.toFixed(2)}`, 'P&L']}
                 />
                 <Bar dataKey="pnl" radius={[4, 4, 0, 0]}>
                   {barData.map((d, i) => (
-                    <Cell key={i} fill={d.pnl >= 0 ? '#22c55e' : '#ef4444'} fillOpacity={0.8} />
+                    <Cell
+                      key={i}
+                      fill={d.pnl >= 0 ? 'var(--green)' : 'var(--red)'}
+                      fillOpacity={0.8}
+                    />
                   ))}
                 </Bar>
               </BarChart>
             </ResponsiveContainer>
           ) : (
-            <div className="text-center text-gray-600 py-10 text-sm">No P&L data yet</div>
+            <div className="text-center py-10 text-sm" style={{ color: 'var(--text-muted)' }}>
+              No P&L data yet
+            </div>
           )}
         </div>
 
         {/* Allocation Pie */}
         <div className="card">
-          <h2 className="font-semibold text-sm mb-3">Capital Allocation</h2>
+          <h2 className="heading text-sm mb-3" style={{ color: 'var(--text-dim)' }}>
+            Capital Allocation
+          </h2>
           {pieData.length > 0 ? (
             <ResponsiveContainer width="100%" height={220}>
               <PieChart>
@@ -254,86 +445,143 @@ export default function Risk() {
                   data={pieData}
                   dataKey="value"
                   nameKey="name"
-                  cx="50%" cy="50%"
-                  innerRadius={40} outerRadius={75}
+                  cx="50%"
+                  cy="50%"
+                  innerRadius={40}
+                  outerRadius={75}
                   paddingAngle={2}
                   strokeWidth={0}
                 >
                   {pieData.map((d, i) => (
-                    <Cell key={i} fill={getColor(d.name === 'ETF Baskets' ? 'etf_' : d.name)} fillOpacity={0.8} />
+                    <Cell
+                      key={i}
+                      fill={getColor(d.name === 'ETF Baskets' ? 'etf_' : d.name)}
+                      fillOpacity={0.85}
+                    />
                   ))}
                 </Pie>
                 <Tooltip
-                  contentStyle={{ background: '#1f2937', border: '1px solid #374151', borderRadius: 8, fontSize: 11 }}
+                  contentStyle={{
+                    background: 'var(--surface-el)',
+                    border: '1px solid var(--border)',
+                    borderRadius: 8,
+                    fontSize: 11,
+                    fontFamily: 'var(--font-mono)',
+                  }}
                   formatter={v => [`$${(v / 100).toFixed(2)}`, 'Invested']}
                 />
               </PieChart>
             </ResponsiveContainer>
           ) : (
-            <div className="text-center text-gray-600 py-10 text-sm">No allocations yet</div>
+            <div className="text-center py-10 text-sm" style={{ color: 'var(--text-muted)' }}>
+              No allocations yet
+            </div>
           )}
         </div>
       </div>
 
-      {/* Best / Worst */}
-      <div className="grid grid-cols-2 gap-4">
+      {/* ── Best / Worst Performers ── */}
+      <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
         {stats.bestPf && (
-          <div className="card border-green-500/20">
-            <div className="flex items-center gap-2 mb-1">
-              <span className="text-green-400 text-xs font-semibold uppercase tracking-wider">Best Performer</span>
+          <div
+            className="card"
+            style={{ borderColor: 'rgba(0,195,137,0.25)', background: 'var(--green-dim)' }}
+          >
+            <div className="flex items-center gap-2 mb-2">
+              <span
+                className="badge"
+                style={{ background: 'var(--green-dim)', color: 'var(--green)' }}
+              >
+                Best Performer
+              </span>
             </div>
             <div className="flex items-center justify-between">
-              <span className="font-bold text-gray-100">{stats.bestPf.name}</span>
-              <span className="text-green-400 font-mono font-bold">
-                {((stats.bestPf.total_returned_cents - stats.bestPf.total_invested_cents) / 100).toFixed(2)}
+              <span className="heading font-bold" style={{ color: 'var(--text)' }}>
+                {stats.bestPf.name}
+              </span>
+              <span className="mono font-bold text-green">
+                +${((stats.bestPf.total_returned_cents - stats.bestPf.total_invested_cents) / 100).toFixed(2)}
               </span>
             </div>
-            <span className="text-[10px] text-gray-500">{stats.bestPf.strategy} — {stats.bestPf.win_rate || 0}% win rate</span>
+            <span className="text-xs" style={{ color: 'var(--text-muted)' }}>
+              {stats.bestPf.strategy} — {stats.bestPf.win_rate || 0}% win rate
+            </span>
           </div>
         )}
         {stats.worstPf && (
-          <div className="card border-red-500/20">
-            <div className="flex items-center gap-2 mb-1">
-              <span className="text-red-400 text-xs font-semibold uppercase tracking-wider">Worst Performer</span>
+          <div
+            className="card"
+            style={{ borderColor: 'rgba(255,92,92,0.25)', background: 'var(--red-dim)' }}
+          >
+            <div className="flex items-center gap-2 mb-2">
+              <span
+                className="badge"
+                style={{ background: 'var(--red-dim)', color: 'var(--red)' }}
+              >
+                Worst Performer
+              </span>
             </div>
             <div className="flex items-center justify-between">
-              <span className="font-bold text-gray-100">{stats.worstPf.name}</span>
-              <span className="text-red-400 font-mono font-bold">
-                {((stats.worstPf.total_returned_cents - stats.worstPf.total_invested_cents) / 100).toFixed(2)}
+              <span className="heading font-bold" style={{ color: 'var(--text)' }}>
+                {stats.worstPf.name}
+              </span>
+              <span className="mono font-bold text-red">
+                ${((stats.worstPf.total_returned_cents - stats.worstPf.total_invested_cents) / 100).toFixed(2)}
               </span>
             </div>
-            <span className="text-[10px] text-gray-500">{stats.worstPf.strategy} — {stats.worstPf.win_rate || 0}% win rate</span>
+            <span className="text-xs" style={{ color: 'var(--text-muted)' }}>
+              {stats.worstPf.strategy} — {stats.worstPf.win_rate || 0}% win rate
+            </span>
           </div>
         )}
       </div>
 
-      {/* Filter & Sort Controls */}
-      <div className="flex items-center justify-between">
-        <div className="flex gap-2">
+      {/* ── Filter & Sort Controls ── */}
+      <div className="flex flex-wrap items-center justify-between gap-3">
+        <div className="flex flex-wrap gap-2">
           {['all', 'active', 'dormant', 'etf', 'core'].map(f => (
             <button
               key={f}
               onClick={() => setFilter(f)}
-              className={`px-3 py-1.5 rounded-lg text-xs font-medium transition ${
-                filter === f ? 'bg-amber-500/15 text-amber-400 border border-amber-500/30' : 'bg-gray-800/40 text-gray-400 hover:text-gray-200 border border-transparent'
-              }`}
+              className="px-3 py-1.5 rounded-lg text-xs font-semibold transition"
+              style={
+                filter === f
+                  ? {
+                      background: 'var(--cyan-dim)',
+                      color: 'var(--cyan)',
+                      border: '1px solid rgba(0,240,255,0.3)',
+                    }
+                  : {
+                      background: 'var(--surface-el)',
+                      color: 'var(--text-muted)',
+                      border: '1px solid var(--border)',
+                    }
+              }
             >
-              {f === 'all' ? `All (${portfolios.length})` :
-               f === 'active' ? `Active (${stats.active})` :
-               f === 'dormant' ? `Dormant (${stats.dormant})` :
-               f === 'etf' ? 'ETF Baskets' : 'Core Strategies'}
+              {f === 'all'
+                ? `All (${portfolios.length})`
+                : f === 'active'
+                ? `Active (${stats.active})`
+                : f === 'dormant'
+                ? `Dormant (${stats.dormant})`
+                : f === 'etf'
+                ? 'ETF Baskets'
+                : 'Core Strategies'}
             </button>
           ))}
         </div>
         <div className="flex items-center gap-2">
-          <span className="text-xs text-gray-500">Sort:</span>
+          <span className="text-xs" style={{ color: 'var(--text-muted)' }}>Sort:</span>
           {['pnl', 'winrate', 'invested', 'name', 'id'].map(s => (
             <button
               key={s}
               onClick={() => setSort(s)}
-              className={`px-2 py-1 rounded text-[11px] transition ${
-                sort === s ? 'text-amber-400 bg-amber-500/10' : 'text-gray-500 hover:text-gray-300'
-              }`}
+              className="px-2 py-1 rounded text-xs font-medium transition"
+              style={
+                sort === s
+                  ? { color: 'var(--cyan)', background: 'var(--cyan-dim)' }
+                  : { color: 'var(--text-muted)' }
+              }
             >
               {s === 'pnl' ? 'P&L' : s === 'winrate' ? 'Win%' : s.charAt(0).toUpperCase() + s.slice(1)}
             </button>
@@ -341,21 +589,26 @@ export default function Risk() {
         </div>
       </div>
 
-      {/* Portfolio Grid */}
-      <div className="grid grid-cols-4 gap-3">
-        {filtered.map(p => (
-          <PortfolioCard
-            key={p.id}
-            p={p}
-            dailyPnl={dailyData[p.id]?.daily || []}
-            expanded={expanded === p.id}
-            onToggle={() => setExpanded(expanded === p.id ? null : p.id)}
-          />
-        ))}
-      </div>
-
-      {filtered.length === 0 && (
-        <div className="text-center py-12 text-gray-500">No portfolios match this filter</div>
+      {/* ── Portfolio Card Grid ── */}
+      {filtered.length === 0 ? (
+        <div
+          className="text-center py-16 text-sm"
+          style={{ color: 'var(--text-muted)' }}
+        >
+          No portfolios match this filter
+        </div>
+      ) : (
+        <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3">
+          {filtered.map(p => (
+            <PortfolioCard
+              key={p.id}
+              p={p}
+              dailyPnl={dailyData[p.id]?.daily || []}
+              expanded={expanded === p.id}
+              onToggle={() => setExpanded(expanded === p.id ? null : p.id)}
+            />
+          ))}
+        </div>
       )}
     </div>
   );
diff --git a/kalshi-dash/src/pages/Settings.jsx b/kalshi-dash/src/pages/Settings.jsx
index b8c82e8..24a1155 100644
--- a/kalshi-dash/src/pages/Settings.jsx
+++ b/kalshi-dash/src/pages/Settings.jsx
@@ -1,6 +1,7 @@
 import React, { useState, useEffect } from 'react';
 import { api, post } from '../api';
 
+// ── Interval presets ──
 const INTERVAL_PRESETS = [
   { label: '30s', ms: 30000 },
   { label: '1m', ms: 60000 },
@@ -19,30 +20,141 @@ function msToLabel(ms) {
   return `${ms / 1000}s`;
 }
 
+// ── Gear icon ──
+function GearIcon() {
+  return (
+    <svg
+      width="22"
+      height="22"
+      viewBox="0 0 24 24"
+      fill="none"
+      stroke="currentColor"
+      strokeWidth="2"
+      strokeLinecap="round"
+      strokeLinejoin="round"
+    >
+      <circle cx="12" cy="12" r="3" />
+      <path d="M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z" />
+    </svg>
+  );
+}
+
+// ── Section panel ──
+function SettingsPanel({ title, children }) {
+  return (
+    <div className="card space-y-4">
+      <h2
+        className="heading font-semibold text-base pb-3"
+        style={{
+          color: 'var(--text)',
+          borderBottom: '1px solid var(--border)',
+        }}
+      >
+        {title}
+      </h2>
+      {children}
+    </div>
+  );
+}
+
+// ── Label + description row ──
+function FieldRow({ label, description, children }) {
+  return (
+    <div className="flex items-start justify-between gap-4">
+      <div className="flex-1 min-w-0">
+        <p className="text-sm font-medium" style={{ color: 'var(--text)' }}>{label}</p>
+        {description && (
+          <p className="text-xs mt-0.5" style={{ color: 'var(--text-muted)' }}>{description}</p>
+        )}
+      </div>
+      <div className="flex-shrink-0">{children}</div>
+    </div>
+  );
+}
+
+// ── Toggle switch ──
+function Toggle({ active, onChange }) {
+  return (
+    <div
+      className={`toggle ${active ? 'active' : ''}`}
+      onClick={() => onChange(!active)}
+      role="switch"
+      aria-checked={active}
+      tabIndex={0}
+      onKeyDown={e => (e.key === ' ' || e.key === 'Enter') && onChange(!active)}
+    />
+  );
+}
+
+// ── Interval control ──
 function IntervalControl({ label, value, onChange, description }) {
   return (
     <div className="space-y-2">
-      <div className="flex items-center justify-between">
-        <div>
-          <p className="text-sm font-medium text-gray-200">{label}</p>
-          <p className="text-[10px] text-gray-500">{description}</p>
-        </div>
-        <span className="font-mono text-amber-400 text-lg font-bold">{msToLabel(value)}</span>
-      </div>
+      <FieldRow label={label} description={description}>
+        <span
+          className="mono font-bold text-lg"
+          style={{ color: 'var(--cyan)' }}
+        >
+          {msToLabel(value)}
+        </span>
+      </FieldRow>
       <div className="flex flex-wrap gap-1.5">
         {INTERVAL_PRESETS.map(p => (
-          <button key={p.ms} onClick={() => onChange(p.ms)}
-            className={`px-2.5 py-1 rounded text-xs font-medium transition ${
+          <button
+            key={p.ms}
+            onClick={() => onChange(p.ms)}
+            className="px-2.5 py-1 rounded text-xs font-medium transition"
+            style={
               value === p.ms
-                ? 'bg-amber-500/20 text-amber-400 border border-amber-500/40'
-                : 'bg-gray-800/60 text-gray-500 border border-gray-700 hover:border-gray-500 hover:text-gray-300'
-            }`}>{p.label}</button>
+                ? {
+                    background: 'var(--cyan-dim)',
+                    color: 'var(--cyan)',
+                    border: '1px solid rgba(0,240,255,0.4)',
+                  }
+                : {
+                    background: 'var(--surface-el)',
+                    color: 'var(--text-muted)',
+                    border: '1px solid var(--border)',
+                  }
+            }
+          >
+            {p.label}
+          </button>
         ))}
       </div>
     </div>
   );
 }
 
+// ── Inline feedback message ──
+function Msg({ msg }) {
+  if (!msg) return null;
+  return (
+    <p
+      className="text-xs px-3 py-2 rounded-lg"
+      style={
+        msg.type === 'ok'
+          ? { background: 'var(--green-dim)', color: 'var(--green)' }
+          : { background: 'var(--red-dim)', color: 'var(--red)' }
+      }
+    >
+      {msg.text}
+    </p>
+  );
+}
+
+// ── Spinner ──
+function Spinner() {
+  return (
+    <div className="flex items-center justify-center h-64">
+      <div
+        className="w-9 h-9 rounded-full border-2 animate-spin"
+        style={{ borderColor: 'var(--border)', borderTopColor: 'var(--cyan)' }}
+      />
+    </div>
+  );
+}
+
 export default function Settings() {
   const [status, setStatus] = useState(null);
   const [loading, setLoading] = useState(true);
@@ -102,184 +214,389 @@ export default function Settings() {
   }
 
   async function saveKeys() {
-    setSaving(true); setMsg(null);
+    setSaving(true);
+    setMsg(null);
     try {
-      const r = await post('/kalshi', { action: 'save_keys', api_key: apiKey, private_key: privateKey, env });
-      if (r.success) { setMsg({ type: 'ok', text: 'Keys saved' }); loadStatus(); setApiKey(''); setPrivateKey(''); }
-      else setMsg({ type: 'err', text: r.error || 'Failed' });
-    } catch { setMsg({ type: 'err', text: 'Connection error' }); }
+      const r = await post('/kalshi', {
+        action: 'save_keys',
+        api_key: apiKey,
+        private_key: privateKey,
+        env,
+      });
+      if (r.success) {
+        setMsg({ type: 'ok', text: 'Keys saved and connected' });
+        loadStatus();
+        setApiKey('');
+        setPrivateKey('');
+      } else {
+        setMsg({ type: 'err', text: r.error || 'Failed' });
+      }
+    } catch {
+      setMsg({ type: 'err', text: 'Connection error' });
+    }
     setSaving(false);
   }
 
   async function disconnect() {
-    try { await post('/kalshi', { action: 'disconnect' }); loadStatus(); }
-    catch {}
+    try {
+      await post('/kalshi', { action: 'disconnect' });
+      loadStatus();
+    } catch {}
   }
 
   async function testConnection() {
     setMsg(null);
     try {
       const r = await post('/kalshi', { action: 'test_connection' });
-      setMsg({ type: r.success ? 'ok' : 'err', text: r.success ? `Connected! Exchange: ${r.exchange_status}` : 'Connection failed' });
-    } catch { setMsg({ type: 'err', text: 'Connection error' }); }
+      setMsg({
+        type: r.success ? 'ok' : 'err',
+        text: r.success
+          ? `Connected. Exchange: ${r.exchange_status}`
+          : 'Connection failed',
+      });
+    } catch {
+      setMsg({ type: 'err', text: 'Connection error' });
+    }
   }
 
-  if (loading) return <div className="flex items-center justify-center h-64"><div className="animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full" /></div>;
+  if (loading) return <Spinner />;
 
   return (
-    <div className="space-y-6">
-      <h1 className="text-2xl font-bold">Settings</h1>
+    <div className="space-y-6 fade-in">
+
+      {/* ── Page Header ── */}
+      <div className="flex items-center gap-3">
+        <div
+          className="flex items-center justify-center w-10 h-10 rounded-xl"
+          style={{ background: 'var(--cyan-dim)', color: 'var(--cyan)' }}
+        >
+          <GearIcon />
+        </div>
+        <div>
+          <h1 className="heading text-3xl" style={{ color: 'var(--text)' }}>Settings</h1>
+          <p className="section-subtitle mt-0.5">Configure scan pipeline, API keys, and risk parameters</p>
+        </div>
+      </div>
 
-      {/* Scan & Pipeline Config */}
+      {/* ══════════════════════════════
+          SCAN & PIPELINE CONFIG
+          ══════════════════════════════ */}
       {scanCfg && (
-        <div className="card space-y-5">
+        <SettingsPanel title="Scan & Pipeline Configuration">
           <div className="flex items-center justify-between">
-            <div>
-              <h2 className="font-semibold">Scan & Pipeline Configuration</h2>
-              <p className="text-[10px] text-gray-500">Adjust intervals, thresholds, and risk parameters in real-time</p>
-            </div>
-            {scanSaving && <span className="text-xs text-amber-400 animate-pulse">Saving...</span>}
+            <p className="text-xs" style={{ color: 'var(--text-muted)' }}>
+              Adjust intervals, thresholds, and risk parameters in real-time
+            </p>
+            {scanSaving && (
+              <span className="text-xs animate-pulse" style={{ color: 'var(--orange)' }}>
+                Saving...
+              </span>
+            )}
           </div>
 
-          {scanMsg && (
-            <p className={`text-xs px-3 py-1.5 rounded ${scanMsg.type === 'ok' ? 'bg-green-500/10 text-green-400' : 'bg-red-500/10 text-red-400'}`}>{scanMsg.text}</p>
-          )}
+          <Msg msg={scanMsg} />
 
-          {/* Cached Markets Display */}
-          <div className="flex items-center gap-3 px-3 py-2 bg-gray-800/40 rounded-lg border border-gray-700">
-            <span className="text-[10px] text-gray-500 uppercase font-medium">Cached Markets</span>
-            <span className="font-mono text-xl font-bold text-amber-400">{scanCfg.cached_markets || 0}</span>
+          {/* Cached markets indicator */}
+          <div
+            className="flex items-center gap-3 px-4 py-3 rounded-xl"
+            style={{
+              background: 'var(--surface-el)',
+              border: '1px solid var(--border)',
+            }}
+          >
+            <span className="stat-label">Cached Markets</span>
+            <span className="mono font-bold text-xl" style={{ color: 'var(--cyan)' }}>
+              {scanCfg.cached_markets || 0}
+            </span>
+            <div
+              className="w-2 h-2 rounded-full pulse-cyan ml-auto"
+              style={{ background: 'var(--cyan)' }}
+            />
           </div>
 
-          {/* Interval Controls */}
-          <IntervalControl
-            label="Market Scan"
-            description="How often to fetch & analyze all active Kalshi markets"
-            value={scanCfg.scan_interval_ms}
-            onChange={v => updateScanField('scan_interval_ms', v)}
-          />
+          {/* Interval controls */}
+          <div
+            className="space-y-5 pt-2 pb-1"
+            style={{ borderTop: '1px solid var(--border)' }}
+          >
+            <h3 className="text-sm font-semibold pt-3" style={{ color: 'var(--text-dim)' }}>
+              Pipeline Intervals
+            </h3>
 
-          <IntervalControl
-            label="Signal Pipeline"
-            description="News sentiment + probability + Monte Carlo signal generation"
-            value={scanCfg.signal_pipeline_ms}
-            onChange={v => updateScanField('signal_pipeline_ms', v)}
-          />
+            <IntervalControl
+              label="Market Scan"
+              description="How often to fetch and analyze all active Kalshi markets"
+              value={scanCfg.scan_interval_ms}
+              onChange={v => updateScanField('scan_interval_ms', v)}
+            />
 
-          <IntervalControl
-            label="Intelligence Sweep"
-            description="Reddit, news feeds, Bluesky, Mastodon, Lemmy + 20 more sources"
-            value={scanCfg.reddit_interval_ms}
-            onChange={v => updateScanField('reddit_interval_ms', v)}
-          />
+            <IntervalControl
+              label="Signal Pipeline"
+              description="News sentiment + probability + Monte Carlo signal generation"
+              value={scanCfg.signal_pipeline_ms}
+              onChange={v => updateScanField('signal_pipeline_ms', v)}
+            />
 
-          <IntervalControl
-            label="Trade Resolution"
-            description="Take-profit/stop-loss check on open portfolio positions"
-            value={scanCfg.resolve_interval_ms}
-            onChange={v => updateScanField('resolve_interval_ms', v)}
-          />
+            <IntervalControl
+              label="Intelligence Sweep"
+              description="Reddit, news feeds, Bluesky, Mastodon, Lemmy + 20 more sources"
+              value={scanCfg.reddit_interval_ms}
+              onChange={v => updateScanField('reddit_interval_ms', v)}
+            />
 
-          {/* Threshold Controls */}
-          <div className="border-t border-gray-700 pt-4 space-y-4">
-            <h3 className="text-sm font-semibold text-gray-300">Risk Parameters</h3>
+            <IntervalControl
+              label="Trade Resolution"
+              description="Take-profit / stop-loss check on open portfolio positions"
+              value={scanCfg.resolve_interval_ms}
+              onChange={v => updateScanField('resolve_interval_ms', v)}
+            />
+          </div>
+
+          {/* Risk Parameters */}
+          <div className="space-y-5" style={{ borderTop: '1px solid var(--border)', paddingTop: '1rem' }}>
+            <h3 className="text-sm font-semibold" style={{ color: 'var(--text-dim)' }}>
+              Risk Parameters
+            </h3>
 
             {/* Min Edge Threshold */}
             <div className="space-y-2">
-              <div className="flex items-center justify-between">
-                <div>
-                  <p className="text-sm font-medium text-gray-200">Min Edge Threshold</p>
-                  <p className="text-[10px] text-gray-500">Minimum statistical edge required to approve a signal</p>
-                </div>
-                <span className="font-mono text-amber-400 text-lg font-bold">{(scanCfg.min_edge_threshold * 100).toFixed(1)}%</span>
-              </div>
+              <FieldRow
+                label="Min Edge Threshold"
+                description="Minimum statistical edge required to approve a signal"
+              >
+                <span className="mono font-bold text-lg" style={{ color: 'var(--cyan)' }}>
+                  {(scanCfg.min_edge_threshold * 100).toFixed(1)}%
+                </span>
+              </FieldRow>
               <div className="flex flex-wrap gap-1.5">
                 {[0.01, 0.02, 0.03, 0.05, 0.08, 0.10, 0.15, 0.20].map(v => (
-                  <button key={v} onClick={() => updateScanField('min_edge_threshold', v)}
-                    className={`px-2.5 py-1 rounded text-xs font-medium transition ${
+                  <button
+                    key={v}
+                    onClick={() => updateScanField('min_edge_threshold', v)}
+                    className="px-2.5 py-1 rounded text-xs font-medium transition"
+                    style={
                       Math.abs(scanCfg.min_edge_threshold - v) < 0.001
-                        ? 'bg-amber-500/20 text-amber-400 border border-amber-500/40'
-                        : 'bg-gray-800/60 text-gray-500 border border-gray-700 hover:border-gray-500 hover:text-gray-300'
-                    }`}>{(v * 100).toFixed(0)}%</button>
+                        ? {
+                            background: 'var(--cyan-dim)',
+                            color: 'var(--cyan)',
+                            border: '1px solid rgba(0,240,255,0.4)',
+                          }
+                        : {
+                            background: 'var(--surface-el)',
+                            color: 'var(--text-muted)',
+                            border: '1px solid var(--border)',
+                          }
+                    }
+                  >
+                    {(v * 100).toFixed(0)}%
+                  </button>
                 ))}
               </div>
             </div>
 
             {/* Min Liquidity */}
             <div className="space-y-2">
-              <div className="flex items-center justify-between">
-                <div>
-                  <p className="text-sm font-medium text-gray-200">Min Liquidity (24h Vol)</p>
-                  <p className="text-[10px] text-gray-500">Minimum 24-hour trading volume to consider a market</p>
-                </div>
-                <span className="font-mono text-amber-400 text-lg font-bold">{scanCfg.min_liquidity}</span>
-              </div>
+              <FieldRow
+                label="Min Liquidity (24h Vol)"
+                description="Minimum 24-hour trading volume to consider a market"
+              >
+                <span className="mono font-bold text-lg" style={{ color: 'var(--cyan)' }}>
+                  {scanCfg.min_liquidity}
+                </span>
+              </FieldRow>
               <div className="flex flex-wrap gap-1.5">
                 {[0, 10, 25, 50, 100, 250, 500, 1000].map(v => (
-                  <button key={v} onClick={() => updateScanField('min_liquidity', v)}
-                    className={`px-2.5 py-1 rounded text-xs font-medium transition ${
+                  <button
+                    key={v}
+                    onClick={() => updateScanField('min_liquidity', v)}
+                    className="px-2.5 py-1 rounded text-xs font-medium transition"
+                    style={
                       scanCfg.min_liquidity === v
-                        ? 'bg-amber-500/20 text-amber-400 border border-amber-500/40'
-                        : 'bg-gray-800/60 text-gray-500 border border-gray-700 hover:border-gray-500 hover:text-gray-300'
-                    }`}>{v === 0 ? 'None' : v}</button>
+                        ? {
+                            background: 'var(--cyan-dim)',
+                            color: 'var(--cyan)',
+                            border: '1px solid rgba(0,240,255,0.4)',
+                          }
+                        : {
+                            background: 'var(--surface-el)',
+                            color: 'var(--text-muted)',
+                            border: '1px solid var(--border)',
+                          }
+                    }
+                  >
+                    {v === 0 ? 'None' : v}
+                  </button>
                 ))}
               </div>
             </div>
           </div>
-        </div>
+        </SettingsPanel>
       )}
 
-      {/* Connection Status */}
-      <div className="card">
-        <div className="flex items-center gap-4 mb-3">
-          <span className={`w-3 h-3 rounded-full ${status?.connected ? 'bg-green-500 pulse-g' : 'bg-gray-600'}`} />
-          <h2 className="font-semibold">Ken API Connection</h2>
+      {/* ══════════════════════════════
+          API CONFIGURATION
+          ══════════════════════════════ */}
+      <SettingsPanel title="API Configuration">
+        {/* Connection status indicator */}
+        <div className="flex items-center gap-3 mb-2">
+          <div
+            className={`w-2.5 h-2.5 rounded-full ${status?.connected ? 'pulse-cyan' : ''}`}
+            style={{ background: status?.connected ? 'var(--cyan)' : 'var(--text-muted)' }}
+          />
+          <span
+            className="text-sm font-semibold"
+            style={{ color: status?.connected ? 'var(--cyan)' : 'var(--text-muted)' }}
+          >
+            {status?.connected ? 'Connected' : 'Not Connected'}
+          </span>
         </div>
+
         {status?.connected ? (
-          <div className="space-y-2 text-sm">
-            <div className="flex justify-between"><span className="text-gray-500">API Key</span><span className="font-mono text-gray-300">{status.api_key_masked || '***'}</span></div>
-            <div className="flex justify-between"><span className="text-gray-500">Environment</span><span className={status.env === 'prod' ? 'text-green-400' : 'text-yellow-400'}>{(status.env || 'demo').toUpperCase()}</span></div>
-            <div className="flex gap-2 mt-3">
-              <button onClick={testConnection} className="btn btn-o text-sm">Test Connection</button>
-              <button onClick={disconnect} className="btn btn-d text-sm">Disconnect</button>
+          <div className="space-y-3">
+            <div
+              className="rounded-xl px-4 py-3 space-y-2"
+              style={{ background: 'var(--surface-el)', border: '1px solid var(--border)' }}
+            >
+              <div className="flex justify-between text-sm">
+                <span style={{ color: 'var(--text-muted)' }}>API Key</span>
+                <span className="mono" style={{ color: 'var(--text)' }}>
+                  {status.api_key_masked || '•••••'}
+                </span>
+              </div>
+              <div className="flex justify-between text-sm">
+                <span style={{ color: 'var(--text-muted)' }}>Environment</span>
+                <span
+                  className="mono font-bold"
+                  style={{ color: status.env === 'prod' ? 'var(--green)' : 'var(--orange)' }}
+                >
+                  {(status.env || 'demo').toUpperCase()}
+                </span>
+              </div>
+            </div>
+            <div className="flex gap-2">
+              <button onClick={testConnection} className="btn btn-o btn-sm">
+                Test Connection
+              </button>
+              <button onClick={disconnect} className="btn btn-d btn-sm">
+                Disconnect
+              </button>
             </div>
           </div>
         ) : (
           <div className="space-y-4">
+            {/* Environment toggle */}
             <div className="flex gap-2">
-              <button onClick={() => setEnv('demo')} className={`flex-1 py-2 rounded-lg text-sm font-medium transition ${env === 'demo' ? 'bg-yellow-500/15 text-yellow-400 border border-yellow-500/30' : 'bg-gray-800/50 text-gray-500 border border-gray-700'}`}>Demo</button>
-              <button onClick={() => setEnv('prod')} className={`flex-1 py-2 rounded-lg text-sm font-medium transition ${env === 'prod' ? 'bg-green-500/15 text-green-400 border border-green-500/30' : 'bg-gray-800/50 text-gray-500 border border-gray-700'}`}>Production</button>
+              <button
+                onClick={() => setEnv('demo')}
+                className="flex-1 py-2 rounded-xl text-sm font-semibold transition"
+                style={
+                  env === 'demo'
+                    ? {
+                        background: 'var(--orange-dim)',
+                        color: 'var(--orange)',
+                        border: '1px solid rgba(247,147,26,0.4)',
+                      }
+                    : {
+                        background: 'var(--surface-el)',
+                        color: 'var(--text-muted)',
+                        border: '1px solid var(--border)',
+                      }
+                }
+              >
+                Demo
+              </button>
+              <button
+                onClick={() => setEnv('prod')}
+                className="flex-1 py-2 rounded-xl text-sm font-semibold transition"
+                style={
+                  env === 'prod'
+                    ? {
+                        background: 'var(--green-dim)',
+                        color: 'var(--green)',
+                        border: '1px solid rgba(0,195,137,0.4)',
+                      }
+                    : {
+                        background: 'var(--surface-el)',
+                        color: 'var(--text-muted)',
+                        border: '1px solid var(--border)',
+                      }
+                }
+              >
+                Production
+              </button>
             </div>
+
             <div>
-              <label className="block text-xs text-gray-400 mb-1">API Key ID</label>
-              <input type="text" value={apiKey} onChange={e => setApiKey(e.target.value)} placeholder="Your API key" className="w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none font-mono" />
+              <label className="stat-label block mb-1.5">API Key ID</label>
+              <input
+                type="text"
+                value={apiKey}
+                onChange={e => setApiKey(e.target.value)}
+                placeholder="Your API key"
+                className="input mono"
+              />
             </div>
             <div>
-              <label className="block text-xs text-gray-400 mb-1">Private Key (PEM)</label>
-              <textarea value={privateKey} onChange={e => setPrivateKey(e.target.value)} placeholder="-----BEGIN RSA PRIVATE KEY-----" rows={4} className="w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none font-mono text-xs" />
+              <label className="stat-label block mb-1.5">Private Key (PEM)</label>
+              <textarea
+                value={privateKey}
+                onChange={e => setPrivateKey(e.target.value)}
+                placeholder="-----BEGIN RSA PRIVATE KEY-----"
+                rows={4}
+                className="input mono text-xs"
+                style={{ resize: 'vertical' }}
+              />
             </div>
-            <button onClick={saveKeys} disabled={saving || !apiKey} className="btn btn-p w-full">{saving ? 'Saving...' : 'Save & Connect'}</button>
+            <button
+              onClick={saveKeys}
+              disabled={saving || !apiKey}
+              className="btn btn-p w-full"
+              style={saving || !apiKey ? { opacity: 0.5, cursor: 'not-allowed' } : {}}
+            >
+              {saving ? 'Saving...' : 'Save & Connect'}
+            </button>
           </div>
         )}
-        {msg && <p className={`text-xs mt-2 ${msg.type === 'ok' ? 'text-green-400' : 'text-red-400'}`}>{msg.text}</p>}
-      </div>
 
-      {/* API Reference */}
-      <div className="card">
-        <h2 className="font-semibold mb-3">Ken API Reference</h2>
-        <div className="grid grid-cols-2 gap-4 text-xs text-gray-400">
-          <div>
-            <p className="text-gray-500 uppercase mb-1 font-medium">Environments</p>
-            <p>Demo: <span className="font-mono text-amber-400">demo-api.kalshi.co</span></p>
-            <p>Prod: <span className="font-mono text-green-400">api.elections.kalshi.com</span></p>
+        <Msg msg={msg} />
+      </SettingsPanel>
+
+      {/* ══════════════════════════════
+          API REFERENCE
+          ══════════════════════════════ */}
+      <SettingsPanel title="Ken API Reference">
+        <div className="grid grid-cols-1 md:grid-cols-2 gap-6 text-xs" style={{ color: 'var(--text-muted)' }}>
+          <div className="space-y-2">
+            <p className="stat-label mb-2">Environments</p>
+            <div className="space-y-1">
+              <div className="flex gap-2">
+                <span>Demo:</span>
+                <span className="mono" style={{ color: 'var(--orange)' }}>demo-api.kalshi.co</span>
+              </div>
+              <div className="flex gap-2">
+                <span>Prod:</span>
+                <span className="mono" style={{ color: 'var(--green)' }}>api.elections.kalshi.com</span>
+              </div>
+            </div>
           </div>
-          <div>
-            <p className="text-gray-500 uppercase mb-1 font-medium">Auth</p>
-            <p>Method: RSA-PSS + SHA-256</p>
-            <p>Headers: KALSHI-ACCESS-KEY, TIMESTAMP, SIGNATURE</p>
+          <div className="space-y-2">
+            <p className="stat-label mb-2">Authentication</p>
+            <div className="space-y-1">
+              <div className="flex gap-2">
+                <span>Method:</span>
+                <span className="mono" style={{ color: 'var(--text-dim)' }}>RSA-PSS + SHA-256</span>
+              </div>
+              <div>
+                <span>Headers: </span>
+                <span className="mono" style={{ color: 'var(--text-dim)' }}>
+                  KALSHI-ACCESS-KEY, TIMESTAMP, SIGNATURE
+                </span>
+              </div>
+            </div>
           </div>
         </div>
-      </div>
+      </SettingsPanel>
+
     </div>
   );
 }
diff --git a/kalshi-dash/src/pages/Signals.jsx b/kalshi-dash/src/pages/Signals.jsx
index d326059..fdb5b13 100644
--- a/kalshi-dash/src/pages/Signals.jsx
+++ b/kalshi-dash/src/pages/Signals.jsx
@@ -1,16 +1,38 @@
 import React, { useState, useEffect } from 'react';
 import { api } from '../api';
 
-const DIR_COLORS = { BUY_YES: 'text-green-400', BUY_NO: 'text-red-400' };
 const DIR_BG = { BUY_YES: 'bg-green', BUY_NO: 'bg-red' };
 
-// Extract human-readable title from reasoning: 'BUY_YES on "Will X happen?" — edge...'
+/* Extract human-readable title from reasoning: 'BUY_YES on "Will X happen?" — edge...' */
 function extractTitle(reasoning) {
   if (!reasoning) return null;
   const m = reasoning.match(/on\s+"([^"]+)"/);
   return m ? m[1] : null;
 }
 
+/* ─── Confidence meter ─── */
+function ConfBar({ value }) {
+  const pct = Math.max(0, Math.min(100, value * 100));
+  const fillColor = value > 0.7 ? 'var(--green)' : value > 0.5 ? 'var(--orange)' : 'var(--red)';
+  return (
+    <div className="flex items-center gap-2">
+      <div className="progress-bar flex-1" style={{ minWidth: 64 }}>
+        <div
+          className="progress-fill"
+          style={{
+            width: `${pct}%`,
+            background: `linear-gradient(90deg, ${fillColor}, ${fillColor}cc)`,
+          }}
+        />
+      </div>
+      <span className="mono text-xs" style={{ color: 'var(--text-dim)' }}>
+        {pct.toFixed(0)}%
+      </span>
+    </div>
+  );
+}
+
+/* ─── Strategy signal expandable row ─── */
 function SignalRow({ s }) {
   const [expanded, setExpanded] = useState(false);
   const title = extractTitle(s.reasoning) || s.market_id;
@@ -19,39 +41,91 @@ function SignalRow({ s }) {
 
   return (
     <>
-      <tr className={`cursor-pointer transition ${expanded ? 'bg-gray-800/40' : 'hover:bg-gray-800/20'}`} onClick={() => setExpanded(!expanded)}>
-        <td className="text-xs text-gray-500 whitespace-nowrap">{new Date(s.created_at).toLocaleTimeString()}</td>
+      <tr
+        className="cursor-pointer transition"
+        onClick={() => setExpanded(!expanded)}
+        style={{ background: expanded ? 'rgba(0,240,255,0.04)' : undefined }}
+      >
+        {/* Time */}
+        <td className="whitespace-nowrap">
+          <span className="mono text-xs" style={{ color: 'var(--text-muted)' }}>
+            {new Date(s.created_at).toLocaleTimeString()}
+          </span>
+        </td>
+
+        {/* Market */}
         <td className="max-w-[280px]">
-          <a href={s.kalshi_url || `https://kalshi.com/search?query=${encodeURIComponent((s.market_id || '').split('-')[0])}`}
-            target="_blank" rel="noopener noreferrer"
-            className="text-amber-400 hover:text-amber-300 hover:underline transition text-sm truncate block"
-            onClick={e => e.stopPropagation()}>
+          <a
+            href={s.kalshi_url || `https://kalshi.com/search?query=${encodeURIComponent((s.market_id || '').split('-')[0])}`}
+            target="_blank"
+            rel="noopener noreferrer"
+            className="text-sm truncate block hover:underline transition heading"
+            style={{ color: 'var(--cyan)' }}
+            onClick={ev => ev.stopPropagation()}
+          >
             {title}
           </a>
-          <span className="text-[10px] font-mono text-gray-600">{s.market_id}</span>
+          <span className="mono text-[10px]" style={{ color: 'var(--text-muted)' }}>
+            {s.market_id}
+          </span>
+        </td>
+
+        {/* Direction badge */}
+        <td>
+          <span className={`badge ${DIR_BG[s.direction] || 'bg-yellow'}`}>
+            {s.direction}
+          </span>
         </td>
-        <td><span className={`badge ${DIR_BG[s.direction] || 'bg-yellow'}`}>{s.direction}</span></td>
-        <td className={`font-mono ${edge > 0 ? 'text-green-400' : 'text-red-400'}`}>{(edge * 100).toFixed(1)}%</td>
-        <td className="font-mono text-gray-400">{s.size_recommendation || '—'}</td>
+
+        {/* Edge — large cyan mono */}
         <td>
-          <div className="flex items-center gap-2">
-            <div className="w-16 h-1.5 bg-gray-700 rounded-full overflow-hidden">
-              <div className={`h-full rounded-full ${conf > 0.7 ? 'bg-green-500' : conf > 0.5 ? 'bg-amber-500' : 'bg-red-500'}`} style={{ width: `${conf * 100}%` }} />
-            </div>
-            <span className="text-xs text-gray-400">{(conf * 100).toFixed(0)}%</span>
-          </div>
+          <span
+            className="mono font-bold text-base"
+            style={{ color: edge > 0 ? 'var(--cyan)' : 'var(--red)' }}
+          >
+            {edge > 0 ? '+' : ''}{(edge * 100).toFixed(1)}%
+          </span>
+        </td>
+
+        {/* Size */}
+        <td>
+          <span className="mono text-sm" style={{ color: 'var(--text-dim)' }}>
+            {s.size_recommendation || '—'}
+          </span>
+        </td>
+
+        {/* Confidence meter */}
+        <td style={{ minWidth: 140 }}>
+          <ConfBar value={conf} />
+        </td>
+
+        {/* Risk */}
+        <td>
+          <span className={`badge ${s.risk_approved ? 'bg-green' : 'bg-red'}`}>
+            {s.risk_approved ? 'APPROVED' : 'BLOCKED'}
+          </span>
+        </td>
+
+        {/* Expand chevron */}
+        <td>
+          <span style={{ color: 'var(--text-muted)' }}>{expanded ? '▾' : '▸'}</span>
         </td>
-        <td><span className={`badge ${s.risk_approved ? 'bg-green' : 'bg-red'}`}>{s.risk_approved ? 'APPROVED' : 'BLOCKED'}</span></td>
-        <td className="text-xs text-gray-500">{expanded ? '▾' : '▸'}</td>
       </tr>
+
+      {/* Expanded reasoning */}
       {expanded && (
-        <tr className="bg-gray-800/20">
-          <td colSpan={8} className="p-3">
-            <div className="text-xs text-gray-400 leading-relaxed max-w-4xl">{s.reasoning}</div>
+        <tr style={{ background: 'rgba(0,240,255,0.02)' }}>
+          <td colSpan={8} className="px-4 py-3">
+            <p className="text-xs leading-relaxed fade-in" style={{ color: 'var(--text-dim)' }}>
+              {s.reasoning}
+            </p>
             {s.sources && (
               <div className="mt-2 flex flex-wrap gap-1">
-                {(typeof s.sources === 'string' ? s.sources.split(',') : Array.isArray(s.sources) ? s.sources : []).map((src, i) => (
-                  <span key={i} className="text-[10px] px-1.5 py-0.5 rounded bg-gray-700/50 text-gray-500">{src.trim()}</span>
+                {(typeof s.sources === 'string'
+                  ? s.sources.split(',')
+                  : Array.isArray(s.sources) ? s.sources : []
+                ).map((src, i) => (
+                  <span key={i} className="badge bg-blue text-[10px]">{src.trim()}</span>
                 ))}
               </div>
             )}
@@ -62,35 +136,128 @@ function SignalRow({ s }) {
   );
 }
 
+/* ─── Probability shift row ─── */
 function ShiftRow({ s }) {
-  const [expanded, setExpanded] = useState(false);
-  const title = s.market_title || s.market_id;
   const edge = parseFloat(s.edge) || 0;
+  const sentImpact = parseFloat(s.sentiment_impact) || 0;
+  const title = s.market_title || s.market_id;
 
   return (
-    <>
-      <tr className={`cursor-pointer transition ${expanded ? 'bg-gray-800/40' : 'hover:bg-gray-800/20'}`} onClick={() => setExpanded(!expanded)}>
-        <td className="text-xs text-gray-500 whitespace-nowrap">{new Date(s.created_at).toLocaleTimeString()}</td>
-        <td className="max-w-[250px]">
-          <a href={s.kalshi_url || `https://kalshi.com/search?query=${encodeURIComponent((s.market_id || '').split('-')[0])}`}
-            target="_blank" rel="noopener noreferrer"
-            className="text-amber-400 hover:text-amber-300 hover:underline transition text-sm truncate block"
-            onClick={e => e.stopPropagation()}>
-            {title}
-          </a>
-          <span className="text-[10px] font-mono text-gray-600">{s.market_id}</span>
-        </td>
-        <td className="font-mono text-gray-400">{(parseFloat(s.prior_probability) * 100).toFixed(1)}%</td>
-        <td className={`font-mono ${parseFloat(s.sentiment_impact) > 0 ? 'text-green-400' : 'text-red-400'}`}>{parseFloat(s.sentiment_impact) > 0 ? '+' : ''}{(parseFloat(s.sentiment_impact) * 100).toFixed(2)}%</td>
-        <td className="font-mono text-amber-400">{(parseFloat(s.adjusted_probability) * 100).toFixed(1)}%</td>
-        <td className="font-mono text-gray-400">{(parseFloat(s.market_probability) * 100).toFixed(1)}%</td>
-        <td className={`font-mono font-bold ${edge > 0 ? 'text-green-400' : edge < 0 ? 'text-red-400' : 'text-gray-400'}`}>{edge > 0 ? '+' : ''}{(edge * 100).toFixed(1)}%</td>
-        <td className="text-gray-400">{s.num_articles}</td>
-      </tr>
-    </>
+    <tr>
+      <td className="whitespace-nowrap">
+        <span className="mono text-xs" style={{ color: 'var(--text-muted)' }}>
+          {new Date(s.created_at).toLocaleTimeString()}
+        </span>
+      </td>
+
+      <td className="max-w-[250px]">
+        <a
+          href={s.kalshi_url || `https://kalshi.com/search?query=${encodeURIComponent((s.market_id || '').split('-')[0])}`}
+          target="_blank"
+          rel="noopener noreferrer"
+          className="text-sm truncate block hover:underline transition heading"
+          style={{ color: 'var(--cyan)' }}
+        >
+          {title}
+        </a>
+        <span className="mono text-[10px]" style={{ color: 'var(--text-muted)' }}>
+          {s.market_id}
+        </span>
+      </td>
+
+      <td>
+        <span className="mono text-sm" style={{ color: 'var(--text-dim)' }}>
+          {(parseFloat(s.prior_probability) * 100).toFixed(1)}%
+        </span>
+      </td>
+
+      <td>
+        <span className="mono text-sm font-semibold" style={{ color: sentImpact > 0 ? 'var(--green)' : 'var(--red)' }}>
+          {sentImpact > 0 ? '+' : ''}{(sentImpact * 100).toFixed(2)}%
+        </span>
+      </td>
+
+      <td>
+        <span className="mono text-sm" style={{ color: 'var(--orange)' }}>
+          {(parseFloat(s.adjusted_probability) * 100).toFixed(1)}%
+        </span>
+      </td>
+
+      <td>
+        <span className="mono text-sm" style={{ color: 'var(--text-dim)' }}>
+          {(parseFloat(s.market_probability) * 100).toFixed(1)}%
+        </span>
+      </td>
+
+      <td>
+        <span
+          className="mono text-sm font-bold"
+          style={{ color: edge > 0 ? 'var(--green)' : edge < 0 ? 'var(--red)' : 'var(--text-muted)' }}
+        >
+          {edge > 0 ? '+' : ''}{(edge * 100).toFixed(1)}%
+        </span>
+      </td>
+
+      <td>
+        <span className="mono text-xs" style={{ color: 'var(--text-muted)' }}>
+          {s.num_articles}
+        </span>
+      </td>
+    </tr>
+  );
+}
+
+/* ─── Source card ─── */
+function SourceCard({ s }) {
+  const sent = parseFloat(s.avg_sent) || 0;
+  return (
+    <div
+      className="card flex items-center justify-between"
+      style={{ padding: '0.75rem 1rem' }}
+    >
+      <span className="text-sm font-medium heading">{s.source}</span>
+      <div className="flex items-center gap-3">
+        <span className="mono text-xs" style={{ color: 'var(--text-muted)' }}>{s.cnt} items</span>
+        <span
+          className="mono text-xs font-bold"
+          style={{ color: sent > 0.05 ? 'var(--green)' : sent < -0.05 ? 'var(--red)' : 'var(--text-muted)' }}
+        >
+          {sent > 0 ? '+' : ''}{(sent * 100).toFixed(0)}%
+        </span>
+      </div>
+    </div>
   );
 }
 
+/* ─── Stat card ─── */
+function StatCard({ label, value, color }) {
+  return (
+    <div className="card">
+      <p className="stat-label mb-2">{label}</p>
+      <p className="stat-v" style={{ color }}>{value}</p>
+    </div>
+  );
+}
+
+/* ─── Tab button ─── */
+function TabBtn({ active, onClick, children }) {
+  return (
+    <button
+      onClick={onClick}
+      className="btn btn-sm transition"
+      style={{
+        background: active ? 'var(--cyan-dim)' : 'transparent',
+        color: active ? 'var(--cyan)' : 'var(--text-muted)',
+        border: active ? '1px solid rgba(0,240,255,0.3)' : '1px solid transparent',
+        borderRadius: 'var(--radius-md)',
+      }}
+    >
+      {children}
+    </button>
+  );
+}
+
+/* ─── Main Signals page ─── */
 export default function Signals() {
   const [data, setData] = useState(null);
   const [dash, setDash] = useState(null);
@@ -112,7 +279,16 @@ export default function Signals() {
     setLoading(false);
   }
 
-  if (loading) return <div className="flex items-center justify-center h-64"><div className="animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full" /></div>;
+  if (loading) {
+    return (
+      <div className="flex items-center justify-center h-64">
+        <div
+          className="animate-spin w-8 h-8 border-2 border-t-transparent rounded-full pulse-cyan"
+          style={{ borderColor: 'var(--cyan)', borderTopColor: 'transparent' }}
+        />
+      </div>
+    );
+  }
 
   const stats = dash?.stats || {};
   const signals = data?.signals || [];
@@ -120,104 +296,183 @@ export default function Signals() {
   const sources = dash?.sourceBreakdown || [];
 
   return (
-    <div className="space-y-6">
+    <div className="space-y-6 fade-in">
+
+      {/* ── Page Header ── */}
       <div className="flex items-center justify-between">
         <div>
-          <h1 className="text-2xl font-bold">Signal Pipeline</h1>
-          <p className="text-gray-500 text-sm">News → Sentiment → Probability → Signals → Risk</p>
-        </div>
-        <div className="flex items-center gap-3">
-          <span className="text-xs text-gray-500">{data?.pipeline?.cachedMarkets || 0} markets tracked</span>
-          <button onClick={load} className="btn btn-o text-sm">Refresh</button>
+          <div className="flex items-center gap-3">
+            {/* Lightning bolt icon */}
+            <span className="text-2xl" style={{ color: 'var(--cyan)' }}>⚡</span>
+            <h1 className="heading text-3xl font-bold" style={{ color: 'var(--text)' }}>
+              Signals
+            </h1>
+            {/* Live dot */}
+            <span className="flex items-center gap-1.5">
+              <span
+                className="inline-block w-2 h-2 rounded-full pulse-cyan"
+                style={{ background: 'var(--cyan)' }}
+              />
+              <span className="text-xs" style={{ color: 'var(--cyan)' }}>LIVE</span>
+            </span>
+          </div>
+          <p className="section-subtitle mt-1">
+            News → Sentiment → Probability → Signals → Risk &nbsp;·&nbsp; {data?.pipeline?.cachedMarkets || 0} markets tracked
+          </p>
         </div>
+        <button onClick={load} className="btn btn-o btn-sm">↻ Refresh</button>
       </div>
 
-      {/* Stats */}
+      {/* ── Stats Grid ── */}
       <div className="grid grid-cols-6 gap-3">
-        {[
-          { label: 'Signals (24h)', value: stats.total_signals || 0, color: 'text-amber-400' },
-          { label: 'Approved', value: stats.approved_signals || 0, color: 'text-green-400' },
-          { label: 'BUY YES', value: stats.buy_yes || 0, color: 'text-green-400' },
-          { label: 'BUY NO', value: stats.buy_no || 0, color: 'text-red-400' },
-          { label: 'Avg Edge', value: stats.avg_edge ? `${(stats.avg_edge * 100).toFixed(1)}%` : '—', color: 'text-blue-400' },
-          { label: 'Avg Confidence', value: stats.avg_confidence ? `${(stats.avg_confidence * 100).toFixed(0)}%` : '—', color: 'text-purple-400' },
-        ].map(s => (
-          <div key={s.label} className="card">
-            <p className="text-[10px] text-gray-500 uppercase mb-1">{s.label}</p>
-            <p className={`text-xl font-bold ${s.color}`}>{s.value}</p>
-          </div>
-        ))}
+        <StatCard label="Signals 24h"    value={stats.total_signals || 0}                                              color="var(--orange)" />
+        <StatCard label="Approved"        value={stats.approved_signals || 0}                                           color="var(--green)" />
+        <StatCard label="BUY YES"         value={stats.buy_yes || 0}                                                    color="var(--green)" />
+        <StatCard label="BUY NO"          value={stats.buy_no || 0}                                                     color="var(--red)" />
+        <StatCard label="Avg Edge"        value={stats.avg_edge ? `${(stats.avg_edge * 100).toFixed(1)}%` : '—'}        color="var(--cyan)" />
+        <StatCard label="Avg Confidence"  value={stats.avg_confidence ? `${(stats.avg_confidence * 100).toFixed(0)}%` : '—'} color="var(--blue)" />
       </div>
 
-      {/* Tabs */}
-      <div className="flex gap-1 border-b border-gray-800 pb-1">
-        {['signals', 'shifts', 'sources'].map(t => (
-          <button key={t} onClick={() => setTab(t)} className={`px-4 py-2 text-sm rounded-t-lg transition ${tab === t ? 'bg-gray-800 text-amber-400 font-medium' : 'text-gray-500 hover:text-gray-300'}`}>
-            {t === 'signals' ? `Strategy Signals (${signals.length})` : t === 'shifts' ? `Probability Shifts (${shifts.length})` : `Source Breakdown (${sources.length})`}
-          </button>
-        ))}
+      {/* ── Tab Bar ── */}
+      <div
+        className="flex gap-2 pb-3"
+        style={{ borderBottom: '1px solid var(--border)' }}
+      >
+        <TabBtn active={tab === 'signals'} onClick={() => setTab('signals')}>
+          Strategy Signals ({signals.length})
+        </TabBtn>
+        <TabBtn active={tab === 'shifts'} onClick={() => setTab('shifts')}>
+          Probability Shifts ({shifts.length})
+        </TabBtn>
+        <TabBtn active={tab === 'sources'} onClick={() => setTab('sources')}>
+          Source Breakdown ({sources.length})
+        </TabBtn>
       </div>
 
-      {/* Strategy Signals Table */}
+      {/* ── Strategy Signals Table ── */}
       {tab === 'signals' && (
-        <div className="card overflow-x-auto">
+        <div className="card overflow-x-auto fade-in" style={{ padding: 0 }}>
           <table>
-            <thead><tr><th>Time</th><th>Market</th><th>Direction</th><th>Edge</th><th>Size</th><th>Confidence</th><th>Risk</th><th></th></tr></thead>
+            <thead>
+              <tr>
+                <th>Time</th>
+                <th>Market</th>
+                <th>Direction</th>
+                <th>Edge</th>
+                <th>Size</th>
+                <th>Confidence</th>
+                <th>Risk</th>
+                <th></th>
+              </tr>
+            </thead>
             <tbody>
               {signals.length === 0 ? (
-                <tr><td colSpan={8} className="text-center text-gray-500 py-8">No signals yet</td></tr>
-              ) : signals.map(s => <SignalRow key={s.id} s={s} />)}
+                <tr>
+                  <td colSpan={8} className="text-center py-12" style={{ color: 'var(--text-muted)' }}>
+                    <div className="flex flex-col items-center gap-2">
+                      <span className="text-2xl">⚡</span>
+                      <span className="text-sm">No signals generated yet</span>
+                    </div>
+                  </td>
+                </tr>
+              ) : (
+                signals.map(s => <SignalRow key={s.id} s={s} />)
+              )}
             </tbody>
           </table>
         </div>
       )}
 
-      {/* Probability Shifts Table */}
+      {/* ── Probability Shifts Table ── */}
       {tab === 'shifts' && (
-        <div className="card overflow-x-auto">
+        <div className="card overflow-x-auto fade-in" style={{ padding: 0 }}>
           <table>
-            <thead><tr><th>Time</th><th>Market</th><th>Prior</th><th>Impact</th><th>Adjusted</th><th>Market Price</th><th>Edge</th><th>Articles</th></tr></thead>
+            <thead>
+              <tr>
+                <th>Time</th>
+                <th>Market</th>
+                <th>Prior</th>
+                <th>Impact</th>
+                <th>Adjusted</th>
+                <th>Market Price</th>
+                <th>Edge</th>
+                <th>Articles</th>
+              </tr>
+            </thead>
             <tbody>
               {shifts.length === 0 ? (
-                <tr><td colSpan={8} className="text-center text-gray-500 py-8">No probability shifts yet</td></tr>
-              ) : shifts.map((s, i) => <ShiftRow key={i} s={s} />)}
+                <tr>
+                  <td colSpan={8} className="text-center py-12" style={{ color: 'var(--text-muted)' }}>
+                    <div className="flex flex-col items-center gap-2">
+                      <span className="text-2xl">📊</span>
+                      <span className="text-sm">No probability shifts yet</span>
+                    </div>
+                  </td>
+                </tr>
+              ) : (
+                shifts.map((s, i) => <ShiftRow key={i} s={s} />)
+              )}
             </tbody>
           </table>
         </div>
       )}
 
-      {/* Source Breakdown */}
+      {/* ── Source Breakdown ── */}
       {tab === 'sources' && (
-        <div className="card">
-          <div className="grid grid-cols-2 gap-4">
-            <div>
-              <h3 className="text-sm font-medium text-gray-400 mb-3">Active Sources (last hour)</h3>
-              <div className="space-y-2">
-                {sources.length === 0 ? (
-                  <p className="text-gray-600 text-sm">No recent data</p>
-                ) : sources.map((s, i) => (
-                  <div key={i} className="flex items-center justify-between p-2 rounded bg-gray-800/30">
-                    <span className="text-sm font-medium">{s.source}</span>
-                    <div className="flex items-center gap-3">
-                      <span className="text-xs text-gray-500">{s.cnt} items</span>
-                      <span className={`text-xs font-mono ${parseFloat(s.avg_sent) > 0.05 ? 'text-green-400' : parseFloat(s.avg_sent) < -0.05 ? 'text-red-400' : 'text-gray-400'}`}>
-                        {parseFloat(s.avg_sent) > 0 ? '+' : ''}{(parseFloat(s.avg_sent) * 100).toFixed(0)}%
-                      </span>
-                    </div>
-                  </div>
-                ))}
-              </div>
+        <div className="grid grid-cols-2 gap-4 fade-in">
+          {/* Active sources */}
+          <div>
+            <p className="section-title mb-3" style={{ fontSize: '1rem' }}>
+              Active Sources
+              <span className="badge bg-cyan ml-2">{sources.length}</span>
+            </p>
+            <div className="space-y-2">
+              {sources.length === 0 ? (
+                <p className="text-sm" style={{ color: 'var(--text-muted)' }}>No recent source data</p>
+              ) : (
+                sources.map((s, i) => <SourceCard key={i} s={s} />)
+              )}
             </div>
-            <div>
-              <h3 className="text-sm font-medium text-gray-400 mb-3">Pipeline Config</h3>
-              <div className="space-y-2 text-sm">
-                <div className="flex justify-between p-2 rounded bg-gray-800/30"><span className="text-gray-500">Market Scan</span><span>Every 15 min</span></div>
-                <div className="flex justify-between p-2 rounded bg-gray-800/30"><span className="text-gray-500">Signal Pipeline</span><span>Every 5 min</span></div>
-                <div className="flex justify-between p-2 rounded bg-gray-800/30"><span className="text-gray-500">Intelligence Sweep</span><span>Every 30 min</span></div>
-                <div className="flex justify-between p-2 rounded bg-gray-800/30"><span className="text-gray-500">Min Edge Threshold</span><span>{((data?.pipeline?.riskLimits?.minEdgeThreshold || 0.05) * 100).toFixed(0)}%</span></div>
-                <div className="flex justify-between p-2 rounded bg-gray-800/30"><span className="text-gray-500">Min Liquidity</span><span>{data?.pipeline?.riskLimits?.minLiquidity || 100} vol</span></div>
-                <div className="flex justify-between p-2 rounded bg-gray-800/30"><span className="text-gray-500">Cached Markets</span><span className="text-amber-400">{data?.pipeline?.cachedMarkets || 0}</span></div>
-              </div>
+          </div>
+
+          {/* Pipeline config */}
+          <div>
+            <p className="section-title mb-3" style={{ fontSize: '1rem' }}>Pipeline Config</p>
+            <div className="card space-y-2">
+              {[
+                { label: 'Market Scan',         value: 'Every 15 min' },
+                { label: 'Signal Pipeline',     value: 'Every 5 min' },
+                { label: 'Intelligence Sweep',  value: 'Every 30 min' },
+                {
+                  label: 'Min Edge Threshold',
+                  value: `${((data?.pipeline?.riskLimits?.minEdgeThreshold || 0.05) * 100).toFixed(0)}%`,
+                  highlight: true,
+                },
+                {
+                  label: 'Min Liquidity',
+                  value: `${data?.pipeline?.riskLimits?.minLiquidity || 100} vol`,
+                  highlight: true,
+                },
+                {
+                  label: 'Cached Markets',
+                  value: data?.pipeline?.cachedMarkets || 0,
+                  highlight: true,
+                },
+              ].map(row => (
+                <div
+                  key={row.label}
+                  className="flex justify-between items-center p-2 rounded"
+                  style={{ background: 'var(--surface-el)' }}
+                >
+                  <span className="text-sm" style={{ color: 'var(--text-muted)' }}>{row.label}</span>
+                  <span
+                    className="mono text-sm font-semibold"
+                    style={{ color: row.highlight ? 'var(--cyan)' : 'var(--text)' }}
+                  >
+                    {row.value}
+                  </span>
+                </div>
+              ))}
             </div>
           </div>
         </div>
diff --git a/kalshi-dash/src/pages/Trading.jsx b/kalshi-dash/src/pages/Trading.jsx
index 1c88576..f7e948a 100644
--- a/kalshi-dash/src/pages/Trading.jsx
+++ b/kalshi-dash/src/pages/Trading.jsx
@@ -1,6 +1,53 @@
 import React, { useState, useEffect } from 'react';
 import { api, post } from '../api';
 
+/* ─── Stat card ─── */
+function StatCard({ label, value, color }) {
+  return (
+    <div className="card">
+      <p className="stat-label mb-2">{label}</p>
+      <p className="stat-v" style={{ color }}>{value}</p>
+    </div>
+  );
+}
+
+/* ─── Config row ─── */
+function ConfigRow({ label, value, highlight }) {
+  return (
+    <div
+      className="flex justify-between items-center px-3 py-2 rounded"
+      style={{ background: 'var(--surface-el)' }}
+    >
+      <span className="text-sm" style={{ color: 'var(--text-muted)' }}>{label}</span>
+      <span
+        className="mono text-sm font-semibold"
+        style={{ color: highlight || 'var(--text)' }}
+      >
+        {value}
+      </span>
+    </div>
+  );
+}
+
+/* ─── Env toggle button ─── */
+function EnvBtn({ label, active, color, onClick, disabled }) {
+  return (
+    <button
+      onClick={onClick}
+      disabled={disabled}
+      className="flex-1 py-2 rounded-lg text-sm font-bold transition"
+      style={{
+        background: active ? `${color}22` : 'var(--surface-el)',
+        color: active ? color : 'var(--text-muted)',
+        border: `1px solid ${active ? color + '55' : 'var(--border)'}`,
+      }}
+    >
+      {label}
+    </button>
+  );
+}
+
+/* ─── Main Trading page ─── */
 export default function Trading() {
   const [mode, setMode] = useState(null);
   const [history, setHistory] = useState(null);
@@ -37,7 +84,16 @@ export default function Trading() {
     setActionLoading('');
   }
 
-  if (loading) return <div className="flex items-center justify-center h-64"><div className="animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full" /></div>;
+  if (loading) {
+    return (
+      <div className="flex items-center justify-center h-64">
+        <div
+          className="animate-spin w-8 h-8 border-2 border-t-transparent rounded-full pulse-cyan"
+          style={{ borderColor: 'var(--cyan)', borderTopColor: 'transparent' }}
+        />
+      </div>
+    );
+  }
 
   const tc = mode?.trade_config || {};
   const ts = mode?.trader_state || {};
@@ -45,139 +101,291 @@ export default function Trading() {
   const trades = history?.trades || [];
   const mem = system?.memory || {};
 
+  const totalPnl = parseInt(summary.total_pnl || 0);
+  const pnlColor = totalPnl > 0 ? 'var(--green)' : totalPnl < 0 ? 'var(--red)' : 'var(--text-muted)';
+
   return (
-    <div className="space-y-6">
+    <div className="space-y-6 fade-in">
+
+      {/* ── Page Header ── */}
       <div className="flex items-center justify-between">
         <div>
-          <h1 className="text-2xl font-bold">Trading Control</h1>
-          <p className="text-gray-500 text-sm">Mode, execution, and P&L</p>
-        </div>
-        <div className="flex items-center gap-2">
-          <span className={`badge ${mode?.env === 'prod' ? 'bg-green' : 'bg-yellow'}`}>{(mode?.env || 'demo').toUpperCase()}</span>
-          {mode?.safe_mode && <span className="badge bg-yellow">SAFE</span>}
-          {mode?.auto_trader_enabled && <span className="badge bg-green">AUTO</span>}
+          <div className="flex items-center gap-3">
+            {/* Dollar icon */}
+            <span className="text-2xl" style={{ color: 'var(--green)' }}>$</span>
+            <h1 className="heading text-3xl font-bold" style={{ color: 'var(--text)' }}>
+              Trading
+            </h1>
+            {/* Environment badge */}
+            <span className={`badge ${mode?.env === 'prod' ? 'bg-green' : 'bg-orange'}`}>
+              {(mode?.env || 'demo').toUpperCase()}
+            </span>
+            {mode?.safe_mode && (
+              <span className="badge bg-orange">SAFE MODE</span>
+            )}
+            {mode?.auto_trader_enabled && (
+              <span className="badge bg-green">AUTO ON</span>
+            )}
+          </div>
+          <p className="section-subtitle mt-1">Mode control, execution, and P&amp;L</p>
         </div>
+        <button onClick={load} className="btn btn-o btn-sm">↻ Refresh</button>
       </div>
 
-      {/* Controls */}
+      {/* ── Trading Controls ── */}
       <div className="grid grid-cols-3 gap-4">
+
         {/* Environment */}
-        <div className="card">
-          <h3 className="text-sm font-medium text-gray-400 mb-3">Environment</h3>
+        <div className="card-glow">
+          <p className="stat-label mb-3">Environment</p>
           <div className="flex gap-2 mb-3">
-            <button onClick={() => doAction('switch_env', { env: 'demo' })}
-              className={`flex-1 py-2 rounded-lg text-sm font-medium transition ${mode?.env === 'demo' ? 'bg-amber-500/20 text-amber-400 border border-amber-500/40' : 'bg-gray-800 text-gray-500 border border-gray-700'}`}
-              disabled={actionLoading === 'switch_env'}>
-              DEMO
-            </button>
-            <button onClick={() => doAction('switch_env', { env: 'prod' })}
-              className={`flex-1 py-2 rounded-lg text-sm font-medium transition ${mode?.env === 'prod' ? 'bg-green-500/20 text-green-400 border border-green-500/40' : 'bg-gray-800 text-gray-500 border border-gray-700'}`}
-              disabled={actionLoading === 'switch_env'}>
-              PROD
-            </button>
+            <EnvBtn
+              label="DEMO"
+              active={mode?.env === 'demo'}
+              color="var(--orange)"
+              onClick={() => doAction('switch_env', { env: 'demo' })}
+              disabled={actionLoading === 'switch_env'}
+            />
+            <EnvBtn
+              label="PROD"
+              active={mode?.env === 'prod'}
+              color="var(--green)"
+              onClick={() => doAction('switch_env', { env: 'prod' })}
+              disabled={actionLoading === 'switch_env'}
+            />
           </div>
-          <p className="text-[10px] text-gray-600">API keys: {mode?.kalshi_connected ? 'Configured' : 'Not set'}</p>
+          <p className="text-xs" style={{ color: 'var(--text-muted)' }}>
+            API keys: {mode?.kalshi_connected ? (
+              <span style={{ color: 'var(--green)' }}>Configured</span>
+            ) : (
+              <span style={{ color: 'var(--red)' }}>Not set</span>
+            )}
+          </p>
         </div>
 
-        {/* Safe Mode */}
-        <div className="card">
-          <h3 className="text-sm font-medium text-gray-400 mb-3">Safe Mode</h3>
-          <button onClick={() => doAction('toggle_safe_mode')}
-            className={`w-full py-3 rounded-lg text-sm font-bold transition ${mode?.safe_mode ? 'bg-yellow-500/20 text-yellow-400 border border-yellow-500/40' : 'bg-red-500/20 text-red-400 border border-red-500/40'}`}
-            disabled={actionLoading === 'toggle_safe_mode'}>
-            {mode?.safe_mode ? 'SAFE MODE ON — Click to Disable' : 'SAFE MODE OFF — LIVE TRADING'}
+        {/* Safe mode */}
+        <div className="card-glow">
+          <p className="stat-label mb-3">Safe Mode</p>
+          <button
+            onClick={() => doAction('toggle_safe_mode')}
+            disabled={actionLoading === 'toggle_safe_mode'}
+            className="btn w-full btn-lg font-bold transition"
+            style={{
+              background: mode?.safe_mode ? 'rgba(247,147,26,0.15)' : 'var(--red-dim)',
+              color: mode?.safe_mode ? 'var(--orange)' : 'var(--red)',
+              border: `1px solid ${mode?.safe_mode ? 'rgba(247,147,26,0.4)' : 'rgba(255,92,92,0.4)'}`,
+            }}
+          >
+            {actionLoading === 'toggle_safe_mode' ? '...' : (
+              mode?.safe_mode ? 'SAFE MODE — ON' : 'SAFE MODE — OFF'
+            )}
           </button>
-          <p className="text-[10px] text-gray-600 mt-2">{mode?.safe_mode ? 'No real orders will be placed' : 'Real orders will be executed!'}</p>
+          <p className="text-xs mt-2" style={{ color: 'var(--text-muted)' }}>
+            {mode?.safe_mode ? 'No real orders will be placed' : (
+              <span style={{ color: 'var(--red)' }}>Real orders will be executed!</span>
+            )}
+          </p>
         </div>
 
-        {/* Auto Trader */}
-        <div className="card">
-          <h3 className="text-sm font-medium text-gray-400 mb-3">Auto Trader</h3>
-          <button onClick={() => doAction('toggle_auto_trader')}
-            className={`w-full py-3 rounded-lg text-sm font-bold transition ${mode?.auto_trader_enabled ? 'bg-green-500/20 text-green-400 border border-green-500/40' : 'bg-gray-800 text-gray-500 border border-gray-700'}`}
-            disabled={actionLoading === 'toggle_auto_trader'}>
-            {mode?.auto_trader_enabled ? 'AUTO TRADER: ON' : 'AUTO TRADER: OFF'}
+        {/* Auto trader */}
+        <div className="card-glow">
+          <p className="stat-label mb-3">Auto Trader</p>
+          <button
+            onClick={() => doAction('toggle_auto_trader')}
+            disabled={actionLoading === 'toggle_auto_trader'}
+            className="btn w-full btn-lg font-bold transition"
+            style={{
+              background: mode?.auto_trader_enabled ? 'var(--green-dim)' : 'var(--surface-el)',
+              color: mode?.auto_trader_enabled ? 'var(--green)' : 'var(--text-muted)',
+              border: `1px solid ${mode?.auto_trader_enabled ? 'rgba(0,195,137,0.4)' : 'var(--border)'}`,
+            }}
+          >
+            {actionLoading === 'toggle_auto_trader' ? '...' : (
+              mode?.auto_trader_enabled ? 'AUTO TRADER: ON' : 'AUTO TRADER: OFF'
+            )}
           </button>
-          <p className="text-[10px] text-gray-600 mt-2">Min confidence: {tc.min_confidence}% | Budget: ${(tc.budget_cents / 100).toFixed(0)}</p>
+          <p className="text-xs mt-2" style={{ color: 'var(--text-muted)' }}>
+            Min confidence: <span className="mono">{tc.min_confidence}%</span>
+            &nbsp;·&nbsp;
+            Budget: <span className="mono">${(tc.budget_cents / 100).toFixed(0)}</span>
+          </p>
         </div>
       </div>
 
-      {/* Portfolio Stats */}
+      {/* ── Portfolio Stats ── */}
       <div className="grid grid-cols-6 gap-3">
-        {[
-          { label: 'Total Trades', value: summary.total_trades || 0, color: 'text-amber-400' },
-          { label: 'Open', value: summary.open_trades || 0, color: 'text-blue-400' },
-          { label: 'Wins', value: summary.winning_trades || 0, color: 'text-green-400' },
-          { label: 'Losses', value: summary.losing_trades || 0, color: 'text-red-400' },
-          { label: 'Total P&L', value: summary.total_pnl ? `$${(parseInt(summary.total_pnl) / 100).toFixed(2)}` : '$0.00', color: parseInt(summary.total_pnl || 0) >= 0 ? 'text-green-400' : 'text-red-400' },
-          { label: 'Exposure', value: `$${(parseInt(summary.open_exposure || 0) / 100).toFixed(2)}`, color: 'text-purple-400' },
-        ].map(s => (
-          <div key={s.label} className="card">
-            <p className="text-[10px] text-gray-500 uppercase mb-1">{s.label}</p>
-            <p className={`text-lg font-bold ${s.color}`}>{s.value}</p>
-          </div>
-        ))}
+        <StatCard label="Total Trades" value={summary.total_trades || 0}                                                                         color="var(--orange)" />
+        <StatCard label="Open"         value={summary.open_trades || 0}                                                                          color="var(--blue)" />
+        <StatCard label="Wins"         value={summary.winning_trades || 0}                                                                       color="var(--green)" />
+        <StatCard label="Losses"       value={summary.losing_trades || 0}                                                                        color="var(--red)" />
+        <StatCard label="Total P&L"    value={summary.total_pnl ? `$${(totalPnl / 100).toFixed(2)}` : '$0.00'}                                  color={pnlColor} />
+        <StatCard label="Exposure"     value={`$${(parseInt(summary.open_exposure || 0) / 100).toFixed(2)}`}                                     color="var(--purple)" />
       </div>
 
-      {/* Trade Config */}
+      {/* ── Config + System ── */}
       <div className="grid grid-cols-2 gap-4">
+
+        {/* Trade Config */}
         <div className="card">
-          <h3 className="text-sm font-medium text-gray-400 mb-3">Trade Config</h3>
-          <div className="space-y-2 text-sm">
-            <div className="flex justify-between p-2 bg-gray-800/30 rounded"><span className="text-gray-500">Budget</span><span className="font-mono">${(tc.budget_cents / 100).toFixed(0)}</span></div>
-            <div className="flex justify-between p-2 bg-gray-800/30 rounded"><span className="text-gray-500">Max per trade</span><span className="font-mono">${(tc.max_position_cents / 100).toFixed(0)}</span></div>
-            <div className="flex justify-between p-2 bg-gray-800/30 rounded"><span className="text-gray-500">Max positions</span><span className="font-mono">{tc.max_open_positions}</span></div>
-            <div className="flex justify-between p-2 bg-gray-800/30 rounded"><span className="text-gray-500">Daily loss limit</span><span className="font-mono">${(tc.daily_loss_limit_cents / 100).toFixed(0)}</span></div>
-            <div className="flex justify-between p-2 bg-gray-800/30 rounded"><span className="text-gray-500">Min confidence</span><span className="font-mono">{tc.min_confidence}%</span></div>
-            <div className="flex justify-between p-2 bg-gray-800/30 rounded"><span className="text-gray-500">Take profit</span><span className="font-mono">{tc.take_profit_pct}%</span></div>
-            <div className="flex justify-between p-2 bg-gray-800/30 rounded"><span className="text-gray-500">Stop loss</span><span className="font-mono">{tc.stop_loss_pct}%</span></div>
+          <p className="section-title mb-3" style={{ fontSize: '1rem' }}>
+            <span style={{ color: 'var(--cyan)' }}>⚙</span> Trade Config
+          </p>
+          <div className="space-y-2">
+            <ConfigRow label="Budget"          value={`$${(tc.budget_cents / 100).toFixed(0)}`}            highlight="var(--cyan)" />
+            <ConfigRow label="Max per trade"   value={`$${(tc.max_position_cents / 100).toFixed(0)}`} />
+            <ConfigRow label="Max positions"   value={tc.max_open_positions} />
+            <ConfigRow label="Daily loss limit" value={`$${(tc.daily_loss_limit_cents / 100).toFixed(0)}`} highlight="var(--red)" />
+            <ConfigRow label="Min confidence"  value={`${tc.min_confidence}%`}                             highlight="var(--orange)" />
+            <ConfigRow label="Take profit"     value={`${tc.take_profit_pct}%`}                            highlight="var(--green)" />
+            <ConfigRow label="Stop loss"       value={`${tc.stop_loss_pct}%`}                              highlight="var(--red)" />
           </div>
         </div>
 
+        {/* System Health */}
         <div className="card">
-          <h3 className="text-sm font-medium text-gray-400 mb-3">System Health</h3>
-          <div className="space-y-2 text-sm">
-            <div className="flex justify-between p-2 bg-gray-800/30 rounded"><span className="text-gray-500">Memory (RSS)</span><span className="font-mono">{mem.rss_mb || '?'}MB</span></div>
-            <div className="flex justify-between p-2 bg-gray-800/30 rounded"><span className="text-gray-500">Heap Used</span><span className="font-mono">{mem.heapUsed_mb || '?'}MB</span></div>
-            <div className="flex justify-between p-2 bg-gray-800/30 rounded"><span className="text-gray-500">Heap Total</span><span className="font-mono">{mem.heapTotal_mb || '?'}MB</span></div>
-            <div className="flex justify-between p-2 bg-gray-800/30 rounded"><span className="text-gray-500">Uptime</span><span className="font-mono">{system?.uptime_hours || '?'}h</span></div>
-            <div className="flex justify-between p-2 bg-gray-800/30 rounded"><span className="text-gray-500">Cached Markets</span><span className="font-mono text-amber-400">{system?.cachedMarkets || 0}</span></div>
-            <div className="flex justify-between p-2 bg-gray-800/30 rounded"><span className="text-gray-500">PID</span><span className="font-mono text-gray-400">{system?.pid || '?'}</span></div>
-            <div className="flex justify-between p-2 bg-gray-800/30 rounded"><span className="text-gray-500">Available Budget</span><span className="font-mono text-green-400">${((ts.available || 0) / 100).toFixed(2)}</span></div>
+          <p className="section-title mb-3" style={{ fontSize: '1rem' }}>
+            <span style={{ color: 'var(--cyan)' }}>♥</span> System Health
+          </p>
+          <div className="space-y-2">
+            <ConfigRow label="Memory (RSS)"     value={`${mem.rss_mb || '?'} MB`} />
+            <ConfigRow label="Heap Used"        value={`${mem.heapUsed_mb || '?'} MB`} />
+            <ConfigRow label="Heap Total"       value={`${mem.heapTotal_mb || '?'} MB`} />
+            <ConfigRow label="Uptime"           value={`${system?.uptime_hours || '?'}h`}                   highlight="var(--blue)" />
+            <ConfigRow label="Cached Markets"   value={system?.cachedMarkets || 0}                          highlight="var(--cyan)" />
+            <ConfigRow label="PID"              value={system?.pid || '?'} />
+            <ConfigRow
+              label="Available Budget"
+              value={`$${((ts.available || 0) / 100).toFixed(2)}`}
+              highlight="var(--green)"
+            />
           </div>
         </div>
       </div>
 
-      {/* Trade History */}
-      <div className="card overflow-x-auto">
-        <h3 className="font-semibold mb-3">Trade History</h3>
+      {/* ── Trade History ── */}
+      <div className="card overflow-x-auto" style={{ padding: 0 }}>
+        {/* Table header */}
+        <div
+          className="flex items-center justify-between px-5 py-4"
+          style={{ borderBottom: '1px solid var(--border)' }}
+        >
+          <p className="section-title" style={{ fontSize: '1rem' }}>
+            <span style={{ color: 'var(--orange)' }}>◈</span> Trade History
+          </p>
+          {trades.length > 0 && (
+            <span className="badge bg-orange">{trades.length} trades</span>
+          )}
+        </div>
+
         <table>
-          <thead><tr><th>Time</th><th>Market</th><th>Side</th><th>Qty</th><th>Entry</th><th>Exit</th><th>P&L</th><th>Type</th><th>Status</th></tr></thead>
+          <thead>
+            <tr>
+              <th>Time</th>
+              <th>Market</th>
+              <th>Side</th>
+              <th>Qty</th>
+              <th>Entry</th>
+              <th>Exit</th>
+              <th>P&amp;L</th>
+              <th>Type</th>
+              <th>Status</th>
+            </tr>
+          </thead>
           <tbody>
             {trades.length === 0 ? (
-              <tr><td colSpan={9} className="text-center text-gray-500 py-8">No trades yet — signals are generating, waiting for execution</td></tr>
-            ) : trades.map((t, i) => {
-              const pnl = parseInt(t.pnl_cents) || 0;
-              return (
-                <tr key={i}>
-                  <td className="text-xs text-gray-500 whitespace-nowrap">{new Date(t.created_at).toLocaleDateString()} {new Date(t.created_at).toLocaleTimeString()}</td>
-                  <td className="max-w-[200px] truncate text-sm">
-                    <a href={`https://kalshi.com/search?query=${encodeURIComponent((t.ticker || '').split('-')[0])}`} target="_blank" rel="noopener noreferrer" className="text-amber-400 hover:text-amber-300 hover:underline transition">
-                      {t.title || t.ticker}
-                    </a>
-                  </td>
-                  <td><span className={`badge ${t.side === 'yes' ? 'bg-green' : 'bg-red'}`}>{(t.side || '').toUpperCase()}</span></td>
-                  <td className="font-mono text-gray-400">{t.count}</td>
-                  <td className="font-mono text-gray-400">{t.price_cents}c</td>
-                  <td className="font-mono text-gray-400">{t.exit_price ? `${t.exit_price}c` : '—'}</td>
-                  <td className={`font-mono font-bold ${pnl > 0 ? 'text-green-400' : pnl < 0 ? 'text-red-400' : 'text-gray-500'}`}>
-                    {pnl !== 0 ? `${pnl > 0 ? '+' : ''}$${(pnl / 100).toFixed(2)}` : '—'}
-                  </td>
-                  <td className="text-xs text-gray-500">{t.signal_type}</td>
-                  <td><span className={`badge ${t.status === 'open' ? 'bg-blue' : t.status === 'profit' ? 'bg-green' : t.status === 'stopped' ? 'bg-red' : 'bg-yellow'}`}>{t.status}</span></td>
-                </tr>
-              );
-            })}
+              <tr>
+                <td colSpan={9} className="text-center py-12" style={{ color: 'var(--text-muted)' }}>
+                  <div className="flex flex-col items-center gap-2">
+                    <span className="text-2xl" style={{ color: 'var(--text-muted)' }}>$</span>
+                    <span className="text-sm">No trades yet — signals are generating, waiting for execution</span>
+                  </div>
+                </td>
+              </tr>
+            ) : (
+              trades.map((t, i) => {
+                const pnl = parseInt(t.pnl_cents) || 0;
+                const pnlColor = pnl > 0 ? 'var(--green)' : pnl < 0 ? 'var(--red)' : 'var(--text-muted)';
+                const statusClass =
+                  t.status === 'open'    ? 'bg-blue'   :
+                  t.status === 'profit'  ? 'bg-green'  :
+                  t.status === 'stopped' ? 'bg-red'    : 'bg-orange';
+
+                return (
+                  <tr key={i}>
+                    {/* Time */}
+                    <td className="whitespace-nowrap">
+                      <span className="mono text-xs" style={{ color: 'var(--text-muted)' }}>
+                        {new Date(t.created_at).toLocaleDateString()}{' '}
+                        {new Date(t.created_at).toLocaleTimeString()}
+                      </span>
+                    </td>
+
+                    {/* Market */}
+                    <td className="max-w-[200px]">
+                      <a
+                        href={`https://kalshi.com/search?query=${encodeURIComponent((t.ticker || '').split('-')[0])}`}
+                        target="_blank"
+                        rel="noopener noreferrer"
+                        className="text-sm truncate block hover:underline transition heading"
+                        style={{ color: 'var(--cyan)' }}
+                      >
+                        {t.title || t.ticker}
+                      </a>
+                    </td>
+
+                    {/* Side */}
+                    <td>
+                      <span className={`badge ${t.side === 'yes' ? 'bg-green' : 'bg-red'}`}>
+                        {(t.side || '').toUpperCase()}
+                      </span>
+                    </td>
+
+                    {/* Qty */}
+                    <td>
+                      <span className="mono text-sm" style={{ color: 'var(--text-dim)' }}>
+                        {t.count}
+                      </span>
+                    </td>
+
+                    {/* Entry price */}
+                    <td>
+                      <span className="mono text-sm" style={{ color: 'var(--text-dim)' }}>
+                        {t.price_cents}c
+                      </span>
+                    </td>
+
+                    {/* Exit price */}
+                    <td>
+                      <span className="mono text-sm" style={{ color: t.exit_price ? 'var(--text-dim)' : 'var(--text-muted)' }}>
+                        {t.exit_price ? `${t.exit_price}c` : '—'}
+                      </span>
+                    </td>
+
+                    {/* P&L */}
+                    <td>
+                      <span className="mono text-sm font-bold" style={{ color: pnlColor }}>
+                        {pnl !== 0
+                          ? `${pnl > 0 ? '+' : ''}$${(pnl / 100).toFixed(2)}`
+                          : '—'
+                        }
+                      </span>
+                    </td>
+
+                    {/* Signal type */}
+                    <td>
+                      <span className="text-xs" style={{ color: 'var(--text-muted)' }}>
+                        {t.signal_type}
+                      </span>
+                    </td>
+
+                    {/* Status */}
+                    <td>
+                      <span className={`badge ${statusClass}`}>{t.status}</span>
+                    </td>
+                  </tr>
+                );
+              })
+            )}
           </tbody>
         </table>
       </div>
diff --git a/kalshi-dash/src/pages/Weather.jsx b/kalshi-dash/src/pages/Weather.jsx
index 3380de9..22cd156 100644
--- a/kalshi-dash/src/pages/Weather.jsx
+++ b/kalshi-dash/src/pages/Weather.jsx
@@ -9,82 +9,163 @@ export default function Weather() {
 
   async function load() {
     setLoading(true);
-    try { const r = await post('/weather', { action: 'get_data' }); setData(r); }
-    catch {}
+    try {
+      const r = await post('/weather', { action: 'get_data' });
+      setData(r);
+    } catch {}
     setLoading(false);
   }
 
   async function fetchAll() {
     setLoading(true);
-    try { const r = await post('/weather', { action: 'fetch_all' }); setData(r); }
-    catch {}
+    try {
+      const r = await post('/weather', { action: 'fetch_all' });
+      setData(r);
+    } catch {}
     setLoading(false);
   }
 
-  if (loading) return <div className="flex items-center justify-center h-64"><div className="animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full" /></div>;
+  if (loading) return (
+    <div className="flex items-center justify-center h-64">
+      <div
+        className="w-8 h-8 rounded-full border-2 border-t-transparent animate-spin"
+        style={{ borderColor: 'var(--cyan)', borderTopColor: 'transparent' }}
+      />
+    </div>
+  );
+
+  const metricCards = [
+    { label: 'Stations',     key: 'stations',     icon: '\u{1F4CD}', color: 'var(--cyan)' },
+    { label: 'Forecasts',    key: 'forecasts',    icon: '\u{1F52E}', color: 'var(--blue)' },
+    { label: 'Observations', key: 'observations', icon: '\u{1F4CA}', color: 'var(--green)' },
+    { label: 'Metrics',      key: 'metrics',      icon: '\u{1F4CF}', color: 'var(--purple)' },
+  ];
 
   return (
     <div className="space-y-6">
+      {/* Page Header */}
       <div className="flex items-center justify-between">
         <div>
-          <h1 className="text-2xl font-bold">Weather Data</h1>
-          <p className="text-gray-500 text-sm">NWS settlement data for Ken weather contracts</p>
+          <h1 className="heading text-2xl font-bold flex items-center gap-2">
+            <span style={{ color: 'var(--cyan)' }}>{'\u2601'}</span>
+            <span className="gradient-cyan">Weather Markets</span>
+          </h1>
+          <p className="section-subtitle mt-1">NWS settlement data for Ken weather contracts</p>
         </div>
-        <button onClick={fetchAll} className="btn btn-p text-sm">Fetch Latest</button>
+        <button onClick={fetchAll} className="btn btn-p">
+          {'\u21BB'} Fetch Latest
+        </button>
       </div>
 
+      {/* Metric Summary Cards */}
       <div className="grid grid-cols-4 gap-4">
-        {['Stations', 'Forecasts', 'Observations', 'Metrics'].map((label, i) => (
+        {metricCards.map(({ label, key, icon, color }) => (
           <div key={label} className="card">
-            <p className="text-xs text-gray-500 uppercase mb-1">{label}</p>
-            <p className="stat-v text-blue-400">{data?.[label.toLowerCase()] || '—'}</p>
+            <div className="flex items-center gap-2 mb-2">
+              <span className="text-lg">{icon}</span>
+              <p className="stat-label">{label}</p>
+            </div>
+            <p className="stat-v" style={{ color }}>{data?.[key] ?? '—'}</p>
           </div>
         ))}
       </div>
 
+      {/* Settlement Rule Reference */}
       <div className="card">
-        <h2 className="font-semibold mb-3">Settlement Rule Reference</h2>
-        <div className="grid grid-cols-2 gap-4 text-sm">
-          <div>
-            <p className="text-gray-500 text-xs uppercase mb-2">Temperature Contracts</p>
-            <ul className="space-y-1 text-xs text-gray-400">
-              <li>Source: NWS Daily Climate Report (final)</li>
-              <li>Station: Market-specified (e.g. KORD, KLGA)</li>
-              <li>Values: Tmax/Tmin in degrees F</li>
-              <li>Missing data: treated as 0</li>
+        <h2 className="section-title mb-4">Settlement Rule Reference</h2>
+        <div className="grid grid-cols-2 gap-6">
+          <div
+            className="rounded-lg p-4"
+            style={{ background: 'var(--surface-el)', border: '1px solid var(--border)' }}
+          >
+            <p className="stat-label mb-3">Temperature Contracts</p>
+            <ul className="space-y-2">
+              {[
+                'Source: NWS Daily Climate Report (final)',
+                'Station: Market-specified (e.g. KORD, KLGA)',
+                'Values: Tmax/Tmin in degrees F',
+                'Missing data: treated as 0',
+              ].map((item, i) => (
+                <li key={i} className="flex items-start gap-2 text-xs" style={{ color: 'var(--text-dim)' }}>
+                  <span style={{ color: 'var(--cyan)', flexShrink: 0 }}>&#8227;</span>
+                  {item}
+                </li>
+              ))}
             </ul>
           </div>
-          <div>
-            <p className="text-gray-500 text-xs uppercase mb-2">Precipitation Contracts</p>
-            <ul className="space-y-1 text-xs text-gray-400">
-              <li>Source: NWS Daily Climate Report (first complete)</li>
-              <li>Trace: counted as 0.00 inches</li>
-              <li>Missing: counted as 0.00 inches</li>
-              <li>Revisions: do NOT change settlement</li>
+          <div
+            className="rounded-lg p-4"
+            style={{ background: 'var(--surface-el)', border: '1px solid var(--border)' }}
+          >
+            <p className="stat-label mb-3">Precipitation Contracts</p>
+            <ul className="space-y-2">
+              {[
+                'Source: NWS Daily Climate Report (first complete)',
+                'Trace: counted as 0.00 inches',
+                'Missing: counted as 0.00 inches',
+                'Revisions: do NOT change settlement',
+              ].map((item, i) => (
+                <li key={i} className="flex items-start gap-2 text-xs" style={{ color: 'var(--text-dim)' }}>
+                  <span style={{ color: 'var(--blue)', flexShrink: 0 }}>&#8227;</span>
+                  {item}
+                </li>
+              ))}
             </ul>
           </div>
         </div>
       </div>
 
+      {/* Recent Observations Table */}
       {(data?.outcomes || []).length > 0 && (
         <div className="card overflow-x-auto">
-          <h2 className="font-semibold mb-3">Recent Observations</h2>
+          <h2 className="section-title mb-4">Recent Observations</h2>
           <table>
-            <thead><tr><th>Station</th><th>Metric</th><th>Value</th><th>Source</th><th>Date</th></tr></thead>
+            <thead>
+              <tr>
+                <th>Station</th>
+                <th>Metric</th>
+                <th>Value</th>
+                <th>Source</th>
+                <th>Date</th>
+              </tr>
+            </thead>
             <tbody>
               {data.outcomes.map((o, i) => (
-                <tr key={i}>
-                  <td className="font-mono text-sm">{o.station_id}</td>
-                  <td><span className="badge bg-blue">{o.metric}</span></td>
-                  <td className="font-mono">{o.value}{o.units}</td>
-                  <td className="text-xs text-gray-400">{o.source}</td>
-                  <td className="text-xs text-gray-400">{o.period_end}</td>
+                <tr key={i} className="fade-in">
+                  <td className="mono text-sm" style={{ color: 'var(--cyan)' }}>{o.station_id}</td>
+                  <td>
+                    <span className="badge bg-blue">{o.metric}</span>
+                  </td>
+                  <td className="mono font-bold" style={{ color: 'var(--text)' }}>
+                    {o.value}{o.units}
+                  </td>
+                  <td className="text-xs" style={{ color: 'var(--text-muted)' }}>{o.source}</td>
+                  <td className="text-xs mono" style={{ color: 'var(--text-muted)' }}>{o.period_end}</td>
                 </tr>
               ))}
             </tbody>
           </table>
         </div>
       )}
+
+      {/* Empty state */}
+      {(data?.outcomes || []).length === 0 && (
+        <div
+          className="card text-center py-12"
+          style={{ border: '1px dashed var(--border)' }}
+        >
+          <p className="text-4xl mb-3">{'\u26C5'}</p>
+          <p className="heading text-sm font-semibold mb-1" style={{ color: 'var(--text-dim)' }}>
+            No observations loaded
+          </p>
+          <p className="text-xs mb-4" style={{ color: 'var(--text-muted)' }}>
+            Click "Fetch Latest" to pull current NWS settlement data
+          </p>
+          <button onClick={fetchAll} className="btn btn-p btn-sm">
+            Fetch Latest
+          </button>
+        </div>
+      )}
     </div>
   );
 }

← 1e466ab chore(alshi-dash,kalshi-dash): update 7 files (.js) [+707/-2  ·  back to Bertha  ·  chore(alshi-dash,kalshi-dash): update 5 files (.css) [+160/- 3fc7c62 →