From 1f34f74e5af8c17ff918123dbf9850a2033ae598 Mon Sep 17 00:00:00 2001 From: "Matt Johnson (via Claude)" Date: Fri, 12 Jun 2026 00:10:51 +0000 Subject: [PATCH] feat(satpass): add satellite pass GUI to Environment + Notifications pages - Environment: add satpass adapter to Tracking tab with observers, min_elevation, and norad_ids controls via adapter_config API - Notifications: add satpass family to master toggles - Rebuild dashboard bundle Co-Authored-By: Claude Opus 4.6 --- dashboard-frontend/src/pages/Environment.tsx | 80 ++- .../src/pages/Notifications.tsx | 3 +- .../static/assets/index-BC90GDxp.css | 1 - .../static/assets/index-CB06j1ej.css | 1 + .../dashboard/static/assets/index-D5IfmtDv.js | 475 ------------------ .../dashboard/static/assets/index-D7cLYkH6.js | 475 ++++++++++++++++++ meshai/dashboard/static/index.html | 4 +- 7 files changed, 549 insertions(+), 490 deletions(-) delete mode 100644 meshai/dashboard/static/assets/index-BC90GDxp.css create mode 100644 meshai/dashboard/static/assets/index-CB06j1ej.css delete mode 100644 meshai/dashboard/static/assets/index-D5IfmtDv.js create mode 100644 meshai/dashboard/static/assets/index-D7cLYkH6.js diff --git a/dashboard-frontend/src/pages/Environment.tsx b/dashboard-frontend/src/pages/Environment.tsx index 6c56775..5590c0e 100644 --- a/dashboard-frontend/src/pages/Environment.tsx +++ b/dashboard-frontend/src/pages/Environment.tsx @@ -72,6 +72,13 @@ interface AvalancheConfig { min_danger_level: number } +// Satpass adapter config shape +interface SatpassConfig { + observers: string[] + min_elevation: number + norad_ids: string[] +} + // SWPC adapter config shape interface SwpcConfig { geomag_kp_floor: number @@ -210,7 +217,7 @@ function AdapterPanel({ title, subtitle, enabled, onEnabled, feedSource, onFeedS } // ---------------------------------------------------------------- families -type AdapterKey = 'nws' | 'fires' | 'firms' | 'swpc' | 'ducting' | 'traffic' | 'roads511' | 'wzdx' | 'usgs_quake' | 'usgs' | 'avalanche' +type AdapterKey = 'nws' | 'fires' | 'firms' | 'swpc' | 'ducting' | 'traffic' | 'roads511' | 'wzdx' | 'usgs_quake' | 'usgs' | 'avalanche' | 'satpass' interface AdapterMeta { label: string; subtitle: string; health: string; hasCentral: boolean; nativeOnly: boolean; hasKey: boolean } @@ -226,6 +233,7 @@ const META: Record = { usgs_quake: { label: 'USGS Earthquakes', subtitle: 'Seismic events from the USGS feed', health: 'usgs_quake', hasCentral: true, nativeOnly: false, hasKey: true }, usgs: { label: 'USGS Stream Gauges', subtitle: 'River and stream water levels', health: 'usgs', hasCentral: true, nativeOnly: false, hasKey: true }, avalanche: { label: 'Avalanche Advisories', subtitle: 'Backcountry avalanche danger ratings', health: 'avalanche', hasCentral: true, nativeOnly: false, hasKey: true }, + satpass: { label: 'Satellite Passes', subtitle: 'Observer pass alerts via Central', health: 'satpass', hasCentral: true, nativeOnly: false, hasKey: true }, } const FAMILIES: { key: string; label: string; icon: typeof Cloud; adapters: AdapterKey[] }[] = [ @@ -235,7 +243,7 @@ const FAMILIES: { key: string; label: string; icon: typeof Cloud; adapters: Adap { key: 'rf', label: 'RF Propagation', icon: Radio, adapters: ['swpc', 'ducting'] }, { key: 'roads', label: 'Roads', icon: Car, adapters: ['traffic', 'roads511', 'wzdx'] }, { key: 'geohazards', label: 'Geohazards', icon: Mountain, adapters: ['usgs_quake', 'usgs', 'avalanche'] }, - { key: 'tracking', label: 'Tracking', icon: Satellite, adapters: [] }, + { key: 'tracking', label: 'Tracking', icon: Satellite, adapters: ['satpass'] }, { key: 'mesh', label: 'Mesh Health', icon: Activity, adapters: [] }, ] @@ -301,6 +309,12 @@ export default function Environment() { proton_pfu_floor: 10.0, }) const [swpcOriginal, setSwpcOriginal] = useState("") + const [satpassConfig, setSatpassConfig] = useState({ + observers: [], + min_elevation: 30, + norad_ids: [], + }) + const [satpassOriginal, setSatpassOriginal] = useState("") useEffect(() => { @@ -431,6 +445,21 @@ export default function Environment() { } } catch { /* adapter-config optional */ } + // Load adapter-config for satpass + try { + const satpassRes = await fetch("/api/adapter-config/satpass") + if (satpassRes.ok) { + const satpassData = await satpassRes.json() + const cfg: SatpassConfig = { + observers: satpassData.observers?.value ?? [], + min_elevation: satpassData.min_elevation?.value ?? 30, + norad_ids: satpassData.norad_ids?.value ?? [], + } + setSatpassConfig(cfg) + setSatpassOriginal(JSON.stringify(cfg)) + } + } catch { /* adapter-config optional */ } + } catch (e) { setError(e instanceof Error ? e.message : 'Failed to load config') } finally { @@ -460,7 +489,8 @@ export default function Environment() { const hasNwsChanges = JSON.stringify(nwsConfig) !== nwsOriginal const hasAvalancheChanges = JSON.stringify(avalancheConfig) !== avalancheOriginal const hasSwpcChanges = JSON.stringify(swpcConfig) !== swpcOriginal - const hasChanges = hasEnvChanges || hasWfigsChanges || hasFiresChanges || hasTomtomChanges || hasRoads511Changes || hasWzdxChanges || hasNwsChanges || hasAvalancheChanges || hasSwpcChanges + const hasSatpassChanges = JSON.stringify(satpassConfig) !== satpassOriginal + const hasChanges = hasEnvChanges || hasWfigsChanges || hasFiresChanges || hasTomtomChanges || hasRoads511Changes || hasWzdxChanges || hasNwsChanges || hasAvalancheChanges || hasSwpcChanges || hasSatpassChanges const saveAdapterConfig = async (adapterName: string, key: string, value: unknown) => { @@ -609,6 +639,21 @@ const save = async () => { setSwpcOriginal(JSON.stringify(swpcConfig)) } + // Save satpass adapter config changes + if (hasSatpassChanges) { + const orig = JSON.parse(satpassOriginal) as SatpassConfig + if (JSON.stringify(satpassConfig.observers) !== JSON.stringify(orig.observers)) { + await saveAdapterConfig("satpass", "observers", satpassConfig.observers) + } + if (satpassConfig.min_elevation !== orig.min_elevation) { + await saveAdapterConfig("satpass", "min_elevation", satpassConfig.min_elevation) + } + if (JSON.stringify(satpassConfig.norad_ids) !== JSON.stringify(orig.norad_ids)) { + await saveAdapterConfig("satpass", "norad_ids", satpassConfig.norad_ids) + } + setSatpassOriginal(JSON.stringify(satpassConfig)) + } + setSuccess('Config saved') setTimeout(() => setSuccess(null), 3000) } catch (e) { @@ -628,6 +673,7 @@ const save = async () => { setNwsConfig(JSON.parse(nwsOriginal || JSON.stringify(nwsConfig))) setAvalancheConfig(JSON.parse(avalancheOriginal || JSON.stringify(avalancheConfig))) setSwpcConfig(JSON.parse(swpcOriginal || JSON.stringify(swpcConfig))) + setSatpassConfig(JSON.parse(satpassOriginal || JSON.stringify(satpassConfig))) } const restart = async () => { try { await fetch('/api/restart', { method: 'POST' }); setRestartRequired(false); setSuccess('Restart initiated') } @@ -1034,6 +1080,26 @@ const save = async () => { ))} ) + case 'satpass': return ( +
+
+
+ Pass Filters +
+
+ setSatpassConfig({ ...satpassConfig, min_elevation: v })} + min={0} max={90} helper="Minimum max elevation for a pass to be broadcast" /> +
+
+ setSatpassConfig({ ...satpassConfig, observers: v })} + helper="Observer names to include (empty = all)" /> + setSatpassConfig({ ...satpassConfig, norad_ids: v })} + helper="NORAD catalog IDs to track (empty = all)" /> +
+ ) } } @@ -1110,14 +1176,6 @@ const save = async () => { )} - {/* Tracking placeholder */} - {family === 'tracking' && ( -
- -

No adapters yet. ADS-B / AIS / satellite passes are planned for v0.5.

-
- )} - {/* Mesh Health (no env adapters; central greyed for future migration) */} {family === 'mesh' && (
diff --git a/dashboard-frontend/src/pages/Notifications.tsx b/dashboard-frontend/src/pages/Notifications.tsx index 0c3b462..dbc1fe0 100644 --- a/dashboard-frontend/src/pages/Notifications.tsx +++ b/dashboard-frontend/src/pages/Notifications.tsx @@ -4,7 +4,7 @@ import { Check, X, Eye as EyeIcon, EyeOff, Send, Clock, Zap, Calendar, AlertTriangle, Copy, AlertCircle, Layers, Wifi, WifiOff, Mail, Globe, Radio, MessageSquare, - Activity, Cloud, Flame, Car, Snowflake, Mountain, MapPin + Activity, Cloud, Flame, Car, Snowflake, Mountain, MapPin, Satellite } from 'lucide-react' import ChannelPicker from '@/components/ChannelPicker' import NodePicker from '@/components/NodePicker' @@ -1422,6 +1422,7 @@ const TOGGLE_FAMILY_META: { key: string; label: string; Icon: typeof Activity }[ { key: 'rf_propagation', label: 'RF Propagation', Icon: Radio }, { key: 'roads', label: 'Roads', Icon: Car }, { key: 'avalanche', label: 'Avalanche', Icon: Snowflake }, + { key: 'satpass', label: 'Satellite Passes', Icon: Satellite }, { key: 'seismic', label: 'Seismic', Icon: Mountain }, { key: 'tracking', label: 'Tracking', Icon: MapPin }, ] diff --git a/meshai/dashboard/static/assets/index-BC90GDxp.css b/meshai/dashboard/static/assets/index-BC90GDxp.css deleted file mode 100644 index 766911d..0000000 --- a/meshai/dashboard/static/assets/index-BC90GDxp.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap";@import"https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap";.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}*,: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:Inter,system-ui,-apple-system,sans-serif;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:JetBrains Mono,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}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-0{left:0}.left-0\.5{left:.125rem}.left-1{left:.25rem}.left-3{left:.75rem}.left-4{left:1rem}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-0\.5{top:.125rem}.top-1{top:.25rem}.top-1\/2{top:50%}.top-4{top:1rem}.top-6{top:1.5rem}.top-full{top:100%}.z-0{z-index:0}.z-40{z-index:40}.z-50{z-index:50}.col-span-2{grid-column:span 2 / span 2}.-m-6{margin:-1.5rem}.-my-4{margin-top:-1rem;margin-bottom:-1rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-px{margin-bottom:-1px}.-ml-2{margin-left:-.5rem}.-ml-4{margin-left:-1rem}.-mr-1{margin-right:-.25rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.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-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-0\.5{height:.125rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-20{height:5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-\[40vh\]{height:40vh}.h-\[540px\]{height:540px}.h-\[calc\(100vh-8rem\)\]{height:calc(100vh - 8rem)}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.max-h-\[85vh\]{max-height:85vh}.min-h-\[36px\]{min-height:36px}.w-1{width:.25rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-2{width:.5rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[190px\]{width:190px}.w-\[220px\]{width:220px}.w-\[250px\]{width:250px}.w-\[2px\]{width:2px}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.min-w-\[280px\]{min-width:280px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-\[150px\]{max-width:150px}.max-w-\[200px\]{max-width:200px}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-4{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-5{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-y{resize:vertical}.scroll-mt-6{scroll-margin-top:1.5rem}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,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-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.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-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))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-border>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(30 30 30 / var(--tw-divide-opacity, 1))}.self-start{align-self:flex-start}.self-stretch{align-self:stretch}.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}.break-words{overflow-wrap:break-word}.rounded{border-radius:0}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[\#1e2a3a\]{--tw-border-opacity: 1;border-color:rgb(30 42 58 / var(--tw-border-opacity, 1))}.border-\[\#222\]{--tw-border-opacity: 1;border-color:rgb(34 34 34 / var(--tw-border-opacity, 1))}.border-\[\#2a3a4a\]{--tw-border-opacity: 1;border-color:rgb(42 58 74 / var(--tw-border-opacity, 1))}.border-\[\#333\]{--tw-border-opacity: 1;border-color:rgb(51 51 51 / var(--tw-border-opacity, 1))}.border-\[\#f59e0b\],.border-accent{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-accent-dim\/30{border-color:#d977064d}.border-accent\/30{border-color:#f59e0b4d}.border-amber-500{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-amber-500\/20{border-color:#f59e0b33}.border-amber-500\/30{border-color:#f59e0b4d}.border-border{--tw-border-opacity: 1;border-color:rgb(30 30 30 / var(--tw-border-opacity, 1))}.border-border\/50{border-color:#1e1e1e80}.border-green-500\/20{border-color:#22c55e33}.border-green-500\/30{border-color:#22c55e4d}.border-red-400\/30{border-color:#f871714d}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-500\/20{border-color:#ef444433}.border-red-500\/30{border-color:#ef44444d}.border-sky-400{--tw-border-opacity: 1;border-color:rgb(56 189 248 / var(--tw-border-opacity, 1))}.border-sky-400\/30{border-color:#38bdf84d}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-600{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.border-slate-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-500\/30{border-color:#eab3084d}.border-yellow-700{--tw-border-opacity: 1;border-color:rgb(161 98 7 / var(--tw-border-opacity, 1))}.border-l-accent{--tw-border-opacity: 1;border-left-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.bg-\[\#000000\]{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-\[\#0a0e17\]{--tw-bg-opacity: 1;background-color:rgb(10 14 23 / var(--tw-bg-opacity, 1))}.bg-\[\#0d0d0d\]{--tw-bg-opacity: 1;background-color:rgb(13 13 13 / var(--tw-bg-opacity, 1))}.bg-\[\#0d1219\]{--tw-bg-opacity: 1;background-color:rgb(13 18 25 / var(--tw-bg-opacity, 1))}.bg-\[\#0d1420\]{--tw-bg-opacity: 1;background-color:rgb(13 20 32 / var(--tw-bg-opacity, 1))}.bg-\[\#161616\]{--tw-bg-opacity: 1;background-color:rgb(22 22 22 / var(--tw-bg-opacity, 1))}.bg-\[\#1a1a1a\]{--tw-bg-opacity: 1;background-color:rgb(26 26 26 / var(--tw-bg-opacity, 1))}.bg-\[\#1a2332\]{--tw-bg-opacity: 1;background-color:rgb(26 35 50 / var(--tw-bg-opacity, 1))}.bg-\[\#1e1e1e\]{--tw-bg-opacity: 1;background-color:rgb(30 30 30 / var(--tw-bg-opacity, 1))}.bg-\[\#1e2a3a\]{--tw-bg-opacity: 1;background-color:rgb(30 42 58 / var(--tw-bg-opacity, 1))}.bg-\[\#1e2a3a\]\/50{background-color:#1e2a3a80}.bg-\[\#333\]{--tw-bg-opacity: 1;background-color:rgb(51 51 51 / var(--tw-bg-opacity, 1))}.bg-\[\#f59e0b\]{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-\[\#f59e0b\]\/10{background-color:#f59e0b1a}.bg-\[\#f59e0b\]\/20{background-color:#f59e0b33}.bg-accent{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-accent-dim{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.bg-accent\/10{background-color:#f59e0b1a}.bg-accent\/20{background-color:#f59e0b33}.bg-accent\/5{background-color:#f59e0b0d}.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\/20{background-color:#f59e0b33}.bg-bg{--tw-bg-opacity: 1;background-color:rgb(17 17 17 / var(--tw-bg-opacity, 1))}.bg-bg-card{--tw-bg-opacity: 1;background-color:rgb(13 13 13 / var(--tw-bg-opacity, 1))}.bg-bg-card\/90{background-color:#0d0d0de6}.bg-bg-hover{--tw-bg-opacity: 1;background-color:rgb(22 22 22 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-border{--tw-bg-opacity: 1;background-color:rgb(30 30 30 / var(--tw-bg-opacity, 1))}.bg-cyan-500\/20{background-color:#06b6d433}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / 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\/20{background-color:#22c55e33}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/20{background-color:#ef444433}.bg-red-500\/5{background-color:#ef44440d}.bg-sky-400{--tw-bg-opacity: 1;background-color:rgb(56 189 248 / var(--tw-bg-opacity, 1))}.bg-sky-400\/10{background-color:#38bdf81a}.bg-slate-500{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.bg-slate-500\/20{background-color:#64748b33}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-800\/50{background-color:#1e293b80}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / 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\/10{background-color:#eab3081a}.bg-yellow-500\/20{background-color:#eab30833}.bg-yellow-700{--tw-bg-opacity: 1;background-color:rgb(161 98 7 / var(--tw-bg-opacity, 1))}.bg-yellow-900\/40{background-color:#713f1266}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-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}.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-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-2{padding-left:.5rem}.pl-6{padding-left:1.5rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.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:JetBrains Mono,monospace}.font-sans{font-family:Inter,system-ui,-apple-system,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.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-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.tracking-wide{letter-spacing:.025em}.tracking-widest{letter-spacing:.1em}.text-\[\#555\]{--tw-text-opacity: 1;color:rgb(85 85 85 / var(--tw-text-opacity, 1))}.text-\[\#666\]{--tw-text-opacity: 1;color:rgb(102 102 102 / var(--tw-text-opacity, 1))}.text-\[\#777\]{--tw-text-opacity: 1;color:rgb(119 119 119 / var(--tw-text-opacity, 1))}.text-\[\#e0e0e0\]{--tw-text-opacity: 1;color:rgb(224 224 224 / var(--tw-text-opacity, 1))}.text-\[\#f59e0b\],.text-accent{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-accent-dim{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.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-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / 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-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-sky-400{--tw-text-opacity: 1;color:rgb(56 189 248 / var(--tw-text-opacity, 1))}.text-sky-500{--tw-text-opacity: 1;color:rgb(14 165 233 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-100{--tw-text-opacity: 1;color:rgb(254 249 195 / var(--tw-text-opacity, 1))}.text-yellow-200{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.text-yellow-200\/80{color:#fef08acc}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.text-yellow-300\/80{color:#fde047cc}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.placeholder-slate-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-600::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(71 85 105 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-600::placeholder{--tw-placeholder-opacity: 1;color:rgb(71 85 105 / var(--tw-placeholder-opacity, 1))}.accent-\[\#f59e0b\]{accent-color:#f59e0b}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.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)}.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-300{transition-duration:.3s}.duration-500{transition-duration:.5s}body{background:#111;margin:0;font-family:Inter,system-ui,-apple-system,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#111}::-webkit-scrollbar-thumb{background:#2a2a2a;border-radius:0}::-webkit-scrollbar-thumb:hover{background:#2a2a2a}.font-mono{font-family:JetBrains Mono,monospace}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.animate-pulse-slow{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes slide-in{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}.animate-slide-in{animation:slide-in .3s ease-out}.line-clamp-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.last\:border-0:last-child{border-width:0px}.hover\:border-\[\#2a3a4a\]:hover{--tw-border-opacity: 1;border-color:rgb(42 58 74 / var(--tw-border-opacity, 1))}.hover\:border-accent:hover{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.hover\:bg-\[\#0a0e17\]:hover{--tw-bg-opacity: 1;background-color:rgb(10 14 23 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#1e2a3a\]:hover{--tw-bg-opacity: 1;background-color:rgb(30 42 58 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#1e2a3a\]\/50:hover{background-color:#1e2a3a80}.hover\:bg-\[\#2a3a4a\]:hover{--tw-bg-opacity: 1;background-color:rgb(42 58 74 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#333\]:hover{--tw-bg-opacity: 1;background-color:rgb(51 51 51 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#d97706\]:hover{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#f59e0b\]\/10:hover,.hover\:bg-accent\/10:hover{background-color:#f59e0b1a}.hover\:bg-accent\/80:hover{background-color:#f59e0bcc}.hover\:bg-amber-500\/30:hover{background-color:#f59e0b4d}.hover\:bg-amber-600:hover{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.hover\:bg-bg-hover:hover{--tw-bg-opacity: 1;background-color:rgb(22 22 22 / var(--tw-bg-opacity, 1))}.hover\:bg-red-500\/10:hover{background-color:#ef44441a}.hover\:bg-slate-500\/10:hover{background-color:#64748b1a}.hover\:bg-slate-600:hover{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-700:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.hover\:bg-yellow-600:hover{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity, 1))}.hover\:text-\[\#d97706\]:hover{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.hover\:text-accent:hover{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.hover\:text-blue-800:hover{--tw-text-opacity: 1;color:rgb(30 64 175 / 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\:text-sky-300:hover{--tw-text-opacity: 1;color:rgb(125 211 252 / var(--tw-text-opacity, 1))}.hover\:text-slate-200:hover{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.hover\:text-slate-300:hover{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.focus\:border-\[\#f59e0b\]:focus{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.focus\:border-accent: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\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-slate-700:disabled{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}.group[open] .group-open\: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))}@media (min-width: 640px){.sm\:block{display:block}.sm\:inline-flex{display:inline-flex}}@media (min-width: 768px){.md\:flex{display:flex}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}} diff --git a/meshai/dashboard/static/assets/index-CB06j1ej.css b/meshai/dashboard/static/assets/index-CB06j1ej.css new file mode 100644 index 0000000..fc4078f --- /dev/null +++ b/meshai/dashboard/static/assets/index-CB06j1ej.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap";@import"https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap";.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}*,: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:Inter,system-ui,-apple-system,sans-serif;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:JetBrains Mono,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}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-0{left:0}.left-0\.5{left:.125rem}.left-1{left:.25rem}.left-3{left:.75rem}.left-4{left:1rem}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-0\.5{top:.125rem}.top-1{top:.25rem}.top-1\/2{top:50%}.top-4{top:1rem}.top-6{top:1.5rem}.top-full{top:100%}.z-0{z-index:0}.z-40{z-index:40}.z-50{z-index:50}.col-span-2{grid-column:span 2 / span 2}.-m-6{margin:-1.5rem}.-my-4{margin-top:-1rem;margin-bottom:-1rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-px{margin-bottom:-1px}.-ml-2{margin-left:-.5rem}.-ml-4{margin-left:-1rem}.-mr-1{margin-right:-.25rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.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-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-0\.5{height:.125rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-20{height:5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-\[540px\]{height:540px}.h-\[calc\(100vh-8rem\)\]{height:calc(100vh - 8rem)}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.max-h-\[85vh\]{max-height:85vh}.min-h-\[36px\]{min-height:36px}.w-1{width:.25rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-2{width:.5rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[190px\]{width:190px}.w-\[220px\]{width:220px}.w-\[250px\]{width:250px}.w-\[2px\]{width:2px}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.min-w-\[280px\]{min-width:280px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-\[150px\]{max-width:150px}.max-w-\[200px\]{max-width:200px}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-4{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-5{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-y{resize:vertical}.scroll-mt-6{scroll-margin-top:1.5rem}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,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-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.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-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))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-border>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(30 30 30 / var(--tw-divide-opacity, 1))}.self-start{align-self:flex-start}.self-stretch{align-self:stretch}.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}.break-words{overflow-wrap:break-word}.rounded{border-radius:0}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[\#1e2a3a\]{--tw-border-opacity: 1;border-color:rgb(30 42 58 / var(--tw-border-opacity, 1))}.border-\[\#222\]{--tw-border-opacity: 1;border-color:rgb(34 34 34 / var(--tw-border-opacity, 1))}.border-\[\#2a3a4a\]{--tw-border-opacity: 1;border-color:rgb(42 58 74 / var(--tw-border-opacity, 1))}.border-\[\#333\]{--tw-border-opacity: 1;border-color:rgb(51 51 51 / var(--tw-border-opacity, 1))}.border-\[\#f59e0b\],.border-accent{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-accent-dim\/30{border-color:#d977064d}.border-accent\/30{border-color:#f59e0b4d}.border-amber-500{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-amber-500\/20{border-color:#f59e0b33}.border-amber-500\/30{border-color:#f59e0b4d}.border-border{--tw-border-opacity: 1;border-color:rgb(30 30 30 / var(--tw-border-opacity, 1))}.border-border\/50{border-color:#1e1e1e80}.border-green-500\/20{border-color:#22c55e33}.border-green-500\/30{border-color:#22c55e4d}.border-red-400\/30{border-color:#f871714d}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-500\/20{border-color:#ef444433}.border-red-500\/30{border-color:#ef44444d}.border-sky-400{--tw-border-opacity: 1;border-color:rgb(56 189 248 / var(--tw-border-opacity, 1))}.border-sky-400\/30{border-color:#38bdf84d}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-600{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.border-slate-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-500\/30{border-color:#eab3084d}.border-yellow-700{--tw-border-opacity: 1;border-color:rgb(161 98 7 / var(--tw-border-opacity, 1))}.border-l-accent{--tw-border-opacity: 1;border-left-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.bg-\[\#000000\]{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-\[\#0a0e17\]{--tw-bg-opacity: 1;background-color:rgb(10 14 23 / var(--tw-bg-opacity, 1))}.bg-\[\#0d0d0d\]{--tw-bg-opacity: 1;background-color:rgb(13 13 13 / var(--tw-bg-opacity, 1))}.bg-\[\#0d1219\]{--tw-bg-opacity: 1;background-color:rgb(13 18 25 / var(--tw-bg-opacity, 1))}.bg-\[\#0d1420\]{--tw-bg-opacity: 1;background-color:rgb(13 20 32 / var(--tw-bg-opacity, 1))}.bg-\[\#161616\]{--tw-bg-opacity: 1;background-color:rgb(22 22 22 / var(--tw-bg-opacity, 1))}.bg-\[\#1a1a1a\]{--tw-bg-opacity: 1;background-color:rgb(26 26 26 / var(--tw-bg-opacity, 1))}.bg-\[\#1a2332\]{--tw-bg-opacity: 1;background-color:rgb(26 35 50 / var(--tw-bg-opacity, 1))}.bg-\[\#1e1e1e\]{--tw-bg-opacity: 1;background-color:rgb(30 30 30 / var(--tw-bg-opacity, 1))}.bg-\[\#1e2a3a\]{--tw-bg-opacity: 1;background-color:rgb(30 42 58 / var(--tw-bg-opacity, 1))}.bg-\[\#1e2a3a\]\/50{background-color:#1e2a3a80}.bg-\[\#333\]{--tw-bg-opacity: 1;background-color:rgb(51 51 51 / var(--tw-bg-opacity, 1))}.bg-\[\#f59e0b\]{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-\[\#f59e0b\]\/10{background-color:#f59e0b1a}.bg-\[\#f59e0b\]\/20{background-color:#f59e0b33}.bg-accent{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-accent-dim{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.bg-accent\/10{background-color:#f59e0b1a}.bg-accent\/20{background-color:#f59e0b33}.bg-accent\/5{background-color:#f59e0b0d}.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\/20{background-color:#f59e0b33}.bg-bg{--tw-bg-opacity: 1;background-color:rgb(17 17 17 / var(--tw-bg-opacity, 1))}.bg-bg-card{--tw-bg-opacity: 1;background-color:rgb(13 13 13 / var(--tw-bg-opacity, 1))}.bg-bg-card\/90{background-color:#0d0d0de6}.bg-bg-hover{--tw-bg-opacity: 1;background-color:rgb(22 22 22 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-border{--tw-bg-opacity: 1;background-color:rgb(30 30 30 / var(--tw-bg-opacity, 1))}.bg-cyan-500\/20{background-color:#06b6d433}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / 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\/20{background-color:#22c55e33}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/20{background-color:#ef444433}.bg-red-500\/5{background-color:#ef44440d}.bg-sky-400{--tw-bg-opacity: 1;background-color:rgb(56 189 248 / var(--tw-bg-opacity, 1))}.bg-sky-400\/10{background-color:#38bdf81a}.bg-slate-500{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.bg-slate-500\/20{background-color:#64748b33}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-800\/50{background-color:#1e293b80}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / 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\/10{background-color:#eab3081a}.bg-yellow-500\/20{background-color:#eab30833}.bg-yellow-700{--tw-bg-opacity: 1;background-color:rgb(161 98 7 / var(--tw-bg-opacity, 1))}.bg-yellow-900\/40{background-color:#713f1266}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-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}.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-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-2{padding-left:.5rem}.pl-6{padding-left:1.5rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.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:JetBrains Mono,monospace}.font-sans{font-family:Inter,system-ui,-apple-system,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.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-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.tracking-wide{letter-spacing:.025em}.tracking-widest{letter-spacing:.1em}.text-\[\#555\]{--tw-text-opacity: 1;color:rgb(85 85 85 / var(--tw-text-opacity, 1))}.text-\[\#666\]{--tw-text-opacity: 1;color:rgb(102 102 102 / var(--tw-text-opacity, 1))}.text-\[\#777\]{--tw-text-opacity: 1;color:rgb(119 119 119 / var(--tw-text-opacity, 1))}.text-\[\#e0e0e0\]{--tw-text-opacity: 1;color:rgb(224 224 224 / var(--tw-text-opacity, 1))}.text-\[\#f59e0b\],.text-accent{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-accent-dim{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.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-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / 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-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-sky-400{--tw-text-opacity: 1;color:rgb(56 189 248 / var(--tw-text-opacity, 1))}.text-sky-500{--tw-text-opacity: 1;color:rgb(14 165 233 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-100{--tw-text-opacity: 1;color:rgb(254 249 195 / var(--tw-text-opacity, 1))}.text-yellow-200{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.text-yellow-200\/80{color:#fef08acc}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.text-yellow-300\/80{color:#fde047cc}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.placeholder-slate-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-600::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(71 85 105 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-600::placeholder{--tw-placeholder-opacity: 1;color:rgb(71 85 105 / var(--tw-placeholder-opacity, 1))}.accent-\[\#f59e0b\]{accent-color:#f59e0b}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.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)}.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-300{transition-duration:.3s}.duration-500{transition-duration:.5s}body{background:#111;margin:0;font-family:Inter,system-ui,-apple-system,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#111}::-webkit-scrollbar-thumb{background:#2a2a2a;border-radius:0}::-webkit-scrollbar-thumb:hover{background:#2a2a2a}.font-mono{font-family:JetBrains Mono,monospace}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.animate-pulse-slow{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes slide-in{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}.animate-slide-in{animation:slide-in .3s ease-out}.line-clamp-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.last\:border-0:last-child{border-width:0px}.hover\:border-\[\#2a3a4a\]:hover{--tw-border-opacity: 1;border-color:rgb(42 58 74 / var(--tw-border-opacity, 1))}.hover\:border-accent:hover{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.hover\:bg-\[\#0a0e17\]:hover{--tw-bg-opacity: 1;background-color:rgb(10 14 23 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#1e2a3a\]:hover{--tw-bg-opacity: 1;background-color:rgb(30 42 58 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#1e2a3a\]\/50:hover{background-color:#1e2a3a80}.hover\:bg-\[\#2a3a4a\]:hover{--tw-bg-opacity: 1;background-color:rgb(42 58 74 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#333\]:hover{--tw-bg-opacity: 1;background-color:rgb(51 51 51 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#d97706\]:hover{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#f59e0b\]\/10:hover,.hover\:bg-accent\/10:hover{background-color:#f59e0b1a}.hover\:bg-accent\/80:hover{background-color:#f59e0bcc}.hover\:bg-amber-500\/30:hover{background-color:#f59e0b4d}.hover\:bg-amber-600:hover{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.hover\:bg-bg-hover:hover{--tw-bg-opacity: 1;background-color:rgb(22 22 22 / var(--tw-bg-opacity, 1))}.hover\:bg-red-500\/10:hover{background-color:#ef44441a}.hover\:bg-slate-500\/10:hover{background-color:#64748b1a}.hover\:bg-slate-600:hover{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-700:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.hover\:bg-yellow-600:hover{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity, 1))}.hover\:text-\[\#d97706\]:hover{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.hover\:text-accent:hover{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.hover\:text-blue-800:hover{--tw-text-opacity: 1;color:rgb(30 64 175 / 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\:text-sky-300:hover{--tw-text-opacity: 1;color:rgb(125 211 252 / var(--tw-text-opacity, 1))}.hover\:text-slate-200:hover{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.hover\:text-slate-300:hover{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.focus\:border-\[\#f59e0b\]:focus{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.focus\:border-accent: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\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-slate-700:disabled{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}.group[open] .group-open\: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))}@media (min-width: 640px){.sm\:block{display:block}.sm\:inline-flex{display:inline-flex}}@media (min-width: 768px){.md\:flex{display:flex}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}} diff --git a/meshai/dashboard/static/assets/index-D5IfmtDv.js b/meshai/dashboard/static/assets/index-D5IfmtDv.js deleted file mode 100644 index 7b09958..0000000 --- a/meshai/dashboard/static/assets/index-D5IfmtDv.js +++ /dev/null @@ -1,475 +0,0 @@ -function rU(e,t){for(var r=0;rn[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var nU=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function R2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var E3={exports:{}},Nx={},j3={exports:{}},vt={};/** - * @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 Ap=Symbol.for("react.element"),iU=Symbol.for("react.portal"),aU=Symbol.for("react.fragment"),oU=Symbol.for("react.strict_mode"),sU=Symbol.for("react.profiler"),lU=Symbol.for("react.provider"),uU=Symbol.for("react.context"),cU=Symbol.for("react.forward_ref"),hU=Symbol.for("react.suspense"),fU=Symbol.for("react.memo"),dU=Symbol.for("react.lazy"),yN=Symbol.iterator;function vU(e){return e===null||typeof e!="object"?null:(e=yN&&e[yN]||e["@@iterator"],typeof e=="function"?e:null)}var R3={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O3=Object.assign,z3={};function Kh(e,t,r){this.props=e,this.context=t,this.refs=z3,this.updater=r||R3}Kh.prototype.isReactComponent={};Kh.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")};Kh.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function B3(){}B3.prototype=Kh.prototype;function O2(e,t,r){this.props=e,this.context=t,this.refs=z3,this.updater=r||R3}var z2=O2.prototype=new B3;z2.constructor=O2;O3(z2,Kh.prototype);z2.isPureReactComponent=!0;var xN=Array.isArray,F3=Object.prototype.hasOwnProperty,B2={current:null},V3={key:!0,ref:!0,__self:!0,__source:!0};function G3(e,t,r){var n,i={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)F3.call(t,n)&&!V3.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1>>1,Y=z[$];if(0>>1;$i(se,U))lei(Ee,se)?(z[$]=Ee,z[le]=U,$=le):(z[$]=se,z[ie]=U,$=ie);else if(lei(Ee,U))z[$]=Ee,z[le]=U,$=le;else break e}}return Z}function i(z,Z){var U=z.sortIndex-Z.sortIndex;return U!==0?U:z.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],c=1,h=null,f=3,d=!1,g=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(z){for(var Z=r(u);Z!==null;){if(Z.callback===null)n(u);else if(Z.startTime<=z)n(u),Z.sortIndex=Z.expirationTime,t(l,Z);else break;Z=r(u)}}function S(z){if(m=!1,w(z),!g)if(r(l)!==null)g=!0,W(T);else{var Z=r(u);Z!==null&&V(S,Z.startTime-z)}}function T(z,Z){g=!1,m&&(m=!1,x(P),P=-1),d=!0;var U=f;try{for(w(Z),h=r(l);h!==null&&(!(h.expirationTime>Z)||z&&!D());){var $=h.callback;if(typeof $=="function"){h.callback=null,f=h.priorityLevel;var Y=$(h.expirationTime<=Z);Z=e.unstable_now(),typeof Y=="function"?h.callback=Y:h===r(l)&&n(l),w(Z)}else n(l);h=r(l)}if(h!==null)var te=!0;else{var ie=r(u);ie!==null&&V(S,ie.startTime-Z),te=!1}return te}finally{h=null,f=U,d=!1}}var M=!1,A=null,P=-1,I=5,N=-1;function D(){return!(e.unstable_now()-Nz||125$?(z.sortIndex=U,t(u,z),r(l)===null&&z===r(u)&&(m?(x(P),P=-1):m=!0,V(S,U-$))):(z.sortIndex=Y,t(l,z),g||d||(g=!0,W(T))),z},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(z){var Z=f;return function(){var U=f;f=Z;try{return z.apply(this,arguments)}finally{f=U}}}})($3);Z3.exports=$3;var MU=Z3.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 AU=G,ii=MU;function ve(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),TS=Object.prototype.hasOwnProperty,kU=/^[: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]*$/,bN={},wN={};function LU(e){return TS.call(wN,e)?!0:TS.call(bN,e)?!1:kU.test(e)?wN[e]=!0:(bN[e]=!0,!1)}function NU(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 PU(e,t,r,n){if(t===null||typeof t>"u"||NU(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 Mn(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var qr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){qr[e]=new Mn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];qr[t]=new Mn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){qr[e]=new Mn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){qr[e]=new Mn(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){qr[e]=new Mn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){qr[e]=new Mn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){qr[e]=new Mn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){qr[e]=new Mn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){qr[e]=new Mn(e,5,!1,e.toLowerCase(),null,!1,!1)});var V2=/[\-:]([a-z])/g;function G2(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(V2,G2);qr[t]=new Mn(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(V2,G2);qr[t]=new Mn(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(V2,G2);qr[t]=new Mn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){qr[e]=new Mn(e,1,!1,e.toLowerCase(),null,!1,!1)});qr.xlinkHref=new Mn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){qr[e]=new Mn(e,1,!1,e.toLowerCase(),null,!0,!0)});function W2(e,t,r,n){var i=qr.hasOwnProperty(t)?qr[t]:null;(i!==null?i.type!==0:n||!(2s||i[o]!==a[s]){var l=` -`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{b1=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Od(e):""}function IU(e){switch(e.tag){case 5:return Od(e.type);case 16:return Od("Lazy");case 13:return Od("Suspense");case 19:return Od("SuspenseList");case 0:case 2:case 15:return e=w1(e.type,!1),e;case 11:return e=w1(e.type.render,!1),e;case 1:return e=w1(e.type,!0),e;default:return""}}function LS(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 Yc:return"Fragment";case $c:return"Portal";case MS:return"Profiler";case H2:return"StrictMode";case AS:return"Suspense";case kS:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case q3:return(e.displayName||"Context")+".Consumer";case X3:return(e._context.displayName||"Context")+".Provider";case U2:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z2:return t=e.displayName||null,t!==null?t:LS(e.type)||"Memo";case ps:t=e._payload,e=e._init;try{return LS(e(t))}catch{}}return null}function DU(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 LS(t);case 8:return t===H2?"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 qs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function J3(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function EU(e){var t=J3(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 i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.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 Dg(e){e._valueTracker||(e._valueTracker=EU(e))}function Q3(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=J3(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function $y(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 NS(e,t){var r=t.checked;return Jt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function CN(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=qs(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 ez(e,t){t=t.checked,t!=null&&W2(e,"checked",t,!1)}function PS(e,t){ez(e,t);var r=qs(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")?IS(e,t.type,r):t.hasOwnProperty("defaultValue")&&IS(e,t.type,qs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function TN(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 IS(e,t,r){(t!=="number"||$y(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var zd=Array.isArray;function fh(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Eg.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function kv(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ev={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},jU=["Webkit","ms","Moz","O"];Object.keys(ev).forEach(function(e){jU.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ev[t]=ev[e]})});function iz(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ev.hasOwnProperty(e)&&ev[e]?(""+t).trim():t+"px"}function az(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=iz(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var RU=Jt({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 jS(e,t){if(t){if(RU[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ve(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ve(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ve(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ve(62))}}function RS(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 OS=null;function $2(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zS=null,dh=null,vh=null;function kN(e){if(e=Np(e)){if(typeof zS!="function")throw Error(ve(280));var t=e.stateNode;t&&(t=jx(t),zS(e.stateNode,e.type,t))}}function oz(e){dh?vh?vh.push(e):vh=[e]:dh=e}function sz(){if(dh){var e=dh,t=vh;if(vh=dh=null,kN(e),t)for(e=0;e>>=0,e===0?32:31-($U(e)/YU|0)|0}var jg=64,Rg=4194304;function Bd(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 Ky(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~i;s!==0?n=Bd(s):(a&=o,a!==0&&(n=Bd(a)))}else o=r&~i,o!==0?n=Bd(o):a!==0&&(n=Bd(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function kp(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-na(t),e[t]=r}function JU(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=rv),ON=" ",zN=!1;function Az(e,t){switch(e){case"keyup":return M9.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kz(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xc=!1;function k9(e,t){switch(e){case"compositionend":return kz(t);case"keypress":return t.which!==32?null:(zN=!0,ON);case"textInput":return e=t.data,e===ON&&zN?null:e;default:return null}}function L9(e,t){if(Xc)return e==="compositionend"||!tM&&Az(e,t)?(e=Tz(),vy=J2=ws=null,Xc=!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)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=GN(r)}}function Iz(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Iz(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dz(){for(var e=window,t=$y();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=$y(e.document)}return t}function rM(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 z9(e){var t=Dz(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Iz(r.ownerDocument.documentElement,r)){if(n!==null&&rM(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 i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=WN(r,a);var o=WN(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>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=document.documentMode,qc=null,HS=null,iv=null,US=!1;function HN(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;US||qc==null||qc!==$y(n)||(n=qc,"selectionStart"in n&&rM(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}),iv&&Ev(iv,n)||(iv=n,n=e0(HS,"onSelect"),0Qc||(e.current=KS[Qc],KS[Qc]=null,Qc--)}function zt(e,t){Qc++,KS[Qc]=e.current,e.current=t}var Ks={},vn=ol(Ks),jn=ol(!1),Au=Ks;function Mh(e,t){var r=e.type.contextTypes;if(!r)return Ks;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Rn(e){return e=e.childContextTypes,e!=null}function r0(){Gt(jn),Gt(vn)}function KN(e,t,r){if(vn.current!==Ks)throw Error(ve(168));zt(vn,t),zt(jn,r)}function Gz(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(ve(108,DU(e)||"Unknown",i));return Jt({},r,n)}function n0(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ks,Au=vn.current,zt(vn,e),zt(jn,jn.current),!0}function JN(e,t,r){var n=e.stateNode;if(!n)throw Error(ve(169));r?(e=Gz(e,t,Au),n.__reactInternalMemoizedMergedChildContext=e,Gt(jn),Gt(vn),zt(vn,e)):Gt(jn),zt(jn,r)}var bo=null,Rx=!1,R1=!1;function Wz(e){bo===null?bo=[e]:bo.push(e)}function q9(e){Rx=!0,Wz(e)}function sl(){if(!R1&&bo!==null){R1=!0;var e=0,t=Lt;try{var r=bo;for(Lt=1;e>=o,i-=o,So=1<<32-na(t)+i|r<P?(I=A,A=null):I=A.sibling;var N=f(x,A,w[P],S);if(N===null){A===null&&(A=I);break}e&&A&&N.alternate===null&&t(x,A),_=a(N,_,P),M===null?T=N:M.sibling=N,M=N,A=I}if(P===w.length)return r(x,A),Wt&&Yl(x,P),T;if(A===null){for(;PP?(I=A,A=null):I=A.sibling;var D=f(x,A,N.value,S);if(D===null){A===null&&(A=I);break}e&&A&&D.alternate===null&&t(x,A),_=a(D,_,P),M===null?T=D:M.sibling=D,M=D,A=I}if(N.done)return r(x,A),Wt&&Yl(x,P),T;if(A===null){for(;!N.done;P++,N=w.next())N=h(x,N.value,S),N!==null&&(_=a(N,_,P),M===null?T=N:M.sibling=N,M=N);return Wt&&Yl(x,P),T}for(A=n(x,A);!N.done;P++,N=w.next())N=d(A,x,P,N.value,S),N!==null&&(e&&N.alternate!==null&&A.delete(N.key===null?P:N.key),_=a(N,_,P),M===null?T=N:M.sibling=N,M=N);return e&&A.forEach(function(O){return t(x,O)}),Wt&&Yl(x,P),T}function y(x,_,w,S){if(typeof w=="object"&&w!==null&&w.type===Yc&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ig:e:{for(var T=w.key,M=_;M!==null;){if(M.key===T){if(T=w.type,T===Yc){if(M.tag===7){r(x,M.sibling),_=i(M,w.props.children),_.return=x,x=_;break e}}else if(M.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===ps&&tP(T)===M.type){r(x,M.sibling),_=i(M,w.props),_.ref=td(x,M,w),_.return=x,x=_;break e}r(x,M);break}else t(x,M);M=M.sibling}w.type===Yc?(_=yu(w.props.children,x.mode,S,w.key),_.return=x,x=_):(S=wy(w.type,w.key,w.props,null,x.mode,S),S.ref=td(x,_,w),S.return=x,x=S)}return o(x);case $c:e:{for(M=w.key;_!==null;){if(_.key===M)if(_.tag===4&&_.stateNode.containerInfo===w.containerInfo&&_.stateNode.implementation===w.implementation){r(x,_.sibling),_=i(_,w.children||[]),_.return=x,x=_;break e}else{r(x,_);break}else t(x,_);_=_.sibling}_=H1(w,x.mode,S),_.return=x,x=_}return o(x);case ps:return M=w._init,y(x,_,M(w._payload),S)}if(zd(w))return g(x,_,w,S);if(qf(w))return m(x,_,w,S);Wg(x,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,_!==null&&_.tag===6?(r(x,_.sibling),_=i(_,w),_.return=x,x=_):(r(x,_),_=W1(w,x.mode,S),_.return=x,x=_),o(x)):r(x,_)}return y}var kh=$z(!0),Yz=$z(!1),o0=ol(null),s0=null,rh=null,oM=null;function sM(){oM=rh=s0=null}function lM(e){var t=o0.current;Gt(o0),e._currentValue=t}function eC(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 gh(e,t){s0=e,oM=rh=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(En=!0),e.firstContext=null)}function Pi(e){var t=e._currentValue;if(oM!==e)if(e={context:e,memoizedValue:t,next:null},rh===null){if(s0===null)throw Error(ve(308));rh=e,s0.dependencies={lanes:0,firstContext:e}}else rh=rh.next=e;return t}var lu=null;function uM(e){lu===null?lu=[e]:lu.push(e)}function Xz(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,uM(t)):(r.next=i.next,i.next=r),t.interleaved=r,Bo(e,n)}function Bo(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 gs=!1;function cM(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qz(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 No(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Rs(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,_t&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Bo(e,r)}return i=n.interleaved,i===null?(t.next=t,uM(n)):(t.next=i.next,i.next=t),n.interleaved=t,Bo(e,r)}function gy(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,X2(e,r)}}function rP(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=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};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,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 l0(e,t,r,n){var i=e.updateQueue;gs=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==o&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(a!==null){var h=i.baseState;o=0,c=u=l=null,s=a;do{var f=s.lane,d=s.eventTime;if((n&f)===f){c!==null&&(c=c.next={eventTime:d,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var g=e,m=s;switch(f=t,d=r,m.tag){case 1:if(g=m.payload,typeof g=="function"){h=g.call(d,h,f);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,f=typeof g=="function"?g.call(d,h,f):g,f==null)break e;h=Jt({},h,f);break e;case 2:gs=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else d={eventTime:d,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=d,l=h):c=c.next=d,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Nu|=o,e.lanes=o,e.memoizedState=h}}function nP(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=z1.transition;z1.transition={};try{e(!1),t()}finally{Lt=r,z1.transition=n}}function d4(){return Ii().memoizedState}function eZ(e,t,r){var n=zs(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},v4(e))p4(t,r);else if(r=Xz(e,t,r,n),r!==null){var i=bn();ia(r,e,n,i),g4(r,t,n)}}function tZ(e,t,r){var n=zs(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(v4(e))p4(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,ua(s,o)){var l=t.interleaved;l===null?(i.next=i,uM(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=Xz(e,t,i,n),r!==null&&(i=bn(),ia(r,e,n,i),g4(r,t,n))}}function v4(e){var t=e.alternate;return e===Xt||t!==null&&t===Xt}function p4(e,t){av=c0=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function g4(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,X2(e,r)}}var h0={readContext:Pi,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useInsertionEffect:nn,useLayoutEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useMutableSource:nn,useSyncExternalStore:nn,useId:nn,unstable_isNewReconciler:!1},rZ={readContext:Pi,useCallback:function(e,t){return La().memoizedState=[e,t===void 0?null:t],e},useContext:Pi,useEffect:aP,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,yy(4194308,4,l4.bind(null,t,e),r)},useLayoutEffect:function(e,t){return yy(4194308,4,e,t)},useInsertionEffect:function(e,t){return yy(4,2,e,t)},useMemo:function(e,t){var r=La();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=La();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=eZ.bind(null,Xt,e),[n.memoizedState,e]},useRef:function(e){var t=La();return e={current:e},t.memoizedState=e},useState:iP,useDebugValue:yM,useDeferredValue:function(e){return La().memoizedState=e},useTransition:function(){var e=iP(!1),t=e[0];return e=Q9.bind(null,e[1]),La().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Xt,i=La();if(Wt){if(r===void 0)throw Error(ve(407));r=r()}else{if(r=t(),Vr===null)throw Error(ve(349));Lu&30||e4(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,aP(r4.bind(null,n,a,e),[e]),n.flags|=2048,Gv(9,t4.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=La(),t=Vr.identifierPrefix;if(Wt){var r=Co,n=So;r=(n&~(1<<32-na(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Fv++,0<\/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[Pa]=t,e[Ov]=n,M4(e,t,!1,!1),t.stateNode=e;e:{switch(o=RS(r,n),r){case"dialog":Vt("cancel",e),Vt("close",e),i=n;break;case"iframe":case"object":case"embed":Vt("load",e),i=n;break;case"video":case"audio":for(i=0;iPh&&(t.flags|=128,n=!0,rd(a,!1),t.lanes=4194304)}else{if(!n)if(e=u0(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),rd(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Wt)return an(t),null}else 2*dr()-a.renderingStartTime>Ph&&r!==1073741824&&(t.flags|=128,n=!0,rd(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=dr(),t.sibling=null,r=Yt.current,zt(Yt,n?r&1|2:r&1),t):(an(t),null);case 22:case 23:return CM(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Zn&1073741824&&(an(t),t.subtreeFlags&6&&(t.flags|=8192)):an(t),null;case 24:return null;case 25:return null}throw Error(ve(156,t.tag))}function cZ(e,t){switch(iM(t),t.tag){case 1:return Rn(t.type)&&r0(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Lh(),Gt(jn),Gt(vn),dM(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return fM(t),null;case 13:if(Gt(Yt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ve(340));Ah()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Gt(Yt),null;case 4:return Lh(),null;case 10:return lM(t.type._context),null;case 22:case 23:return CM(),null;case 24:return null;default:return null}}var Ug=!1,cn=!1,hZ=typeof WeakSet=="function"?WeakSet:Set,je=null;function nh(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){tr(e,t,n)}else r.current=null}function uC(e,t,r){try{r()}catch(n){tr(e,t,n)}}var gP=!1;function fZ(e,t){if(ZS=Jy,e=Dz(),rM(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 i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,c=0,h=e,f=null;t:for(;;){for(var d;h!==r||i!==0&&h.nodeType!==3||(s=o+i),h!==a||n!==0&&h.nodeType!==3||(l=o+n),h.nodeType===3&&(o+=h.nodeValue.length),(d=h.firstChild)!==null;)f=h,h=d;for(;;){if(h===e)break t;if(f===r&&++u===i&&(s=o),f===a&&++c===n&&(l=o),(d=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=d}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for($S={focusedElem:e,selectionRange:r},Jy=!1,je=t;je!==null;)if(t=je,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,je=e;else for(;je!==null;){t=je;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 m=g.memoizedProps,y=g.memoizedState,x=t.stateNode,_=x.getSnapshotBeforeUpdate(t.elementType===t.type?m:Ki(t.type,m),y);x.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ve(163))}}catch(S){tr(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,je=e;break}je=t.return}return g=gP,gP=!1,g}function ov(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&uC(t,r,a)}i=i.next}while(i!==n)}}function Bx(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 cC(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 L4(e){var t=e.alternate;t!==null&&(e.alternate=null,L4(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Pa],delete t[Ov],delete t[qS],delete t[Y9],delete t[X9])),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 N4(e){return e.tag===5||e.tag===3||e.tag===4}function mP(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||N4(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 hC(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=t0));else if(n!==4&&(e=e.child,e!==null))for(hC(e,t,r),e=e.sibling;e!==null;)hC(e,t,r),e=e.sibling}function fC(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(fC(e,t,r),e=e.sibling;e!==null;)fC(e,t,r),e=e.sibling}var Ur=null,Qi=!1;function rs(e,t,r){for(r=r.child;r!==null;)P4(e,t,r),r=r.sibling}function P4(e,t,r){if(Fa&&typeof Fa.onCommitFiberUnmount=="function")try{Fa.onCommitFiberUnmount(Px,r)}catch{}switch(r.tag){case 5:cn||nh(r,t);case 6:var n=Ur,i=Qi;Ur=null,rs(e,t,r),Ur=n,Qi=i,Ur!==null&&(Qi?(e=Ur,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ur.removeChild(r.stateNode));break;case 18:Ur!==null&&(Qi?(e=Ur,r=r.stateNode,e.nodeType===8?j1(e.parentNode,r):e.nodeType===1&&j1(e,r),Iv(e)):j1(Ur,r.stateNode));break;case 4:n=Ur,i=Qi,Ur=r.stateNode.containerInfo,Qi=!0,rs(e,t,r),Ur=n,Qi=i;break;case 0:case 11:case 14:case 15:if(!cn&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&uC(r,t,o),i=i.next}while(i!==n)}rs(e,t,r);break;case 1:if(!cn&&(nh(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){tr(r,t,s)}rs(e,t,r);break;case 21:rs(e,t,r);break;case 22:r.mode&1?(cn=(n=cn)||r.memoizedState!==null,rs(e,t,r),cn=n):rs(e,t,r);break;default:rs(e,t,r)}}function yP(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new hZ),t.forEach(function(n){var i=bZ.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Ui(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=dr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*vZ(n/1960))-n,10e?16:e,Ss===null)var n=!1;else{if(e=Ss,Ss=null,v0=0,_t&6)throw Error(ve(331));var i=_t;for(_t|=4,je=e.current;je!==null;){var a=je,o=a.child;if(je.flags&16){var s=a.deletions;if(s!==null){for(var l=0;ldr()-wM?mu(e,0):bM|=r),On(e,t)}function B4(e,t){t===0&&(e.mode&1?(t=Rg,Rg<<=1,!(Rg&130023424)&&(Rg=4194304)):t=1);var r=bn();e=Bo(e,t),e!==null&&(kp(e,t,r),On(e,r))}function _Z(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),B4(e,r)}function bZ(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ve(314))}n!==null&&n.delete(t),B4(e,r)}var F4;F4=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||jn.current)En=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return En=!1,lZ(e,t,r);En=!!(e.flags&131072)}else En=!1,Wt&&t.flags&1048576&&Hz(t,a0,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;xy(e,t),e=t.pendingProps;var i=Mh(t,vn.current);gh(t,r),i=pM(null,t,n,e,i,r);var a=gM();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Rn(n)?(a=!0,n0(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,cM(t),i.updater=zx,t.stateNode=i,i._reactInternals=t,rC(t,n,e,r),t=aC(null,t,n,!0,a,r)):(t.tag=0,Wt&&a&&nM(t),mn(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(xy(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=SZ(n),e=Ki(n,e),i){case 0:t=iC(null,t,n,e,r);break e;case 1:t=dP(null,t,n,e,r);break e;case 11:t=hP(null,t,n,e,r);break e;case 14:t=fP(null,t,n,Ki(n.type,e),r);break e}throw Error(ve(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ki(n,i),iC(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ki(n,i),dP(e,t,n,i,r);case 3:e:{if(S4(t),e===null)throw Error(ve(387));n=t.pendingProps,a=t.memoizedState,i=a.element,qz(e,t),l0(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Nh(Error(ve(423)),t),t=vP(e,t,n,r,i);break e}else if(n!==i){i=Nh(Error(ve(424)),t),t=vP(e,t,n,r,i);break e}else for(Kn=js(t.stateNode.containerInfo.firstChild),ri=t,Wt=!0,ea=null,r=Yz(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ah(),n===i){t=Fo(e,t,r);break e}mn(e,t,n,r)}t=t.child}return t;case 5:return Kz(t),e===null&&QS(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,YS(n,i)?o=null:a!==null&&YS(n,a)&&(t.flags|=32),w4(e,t),mn(e,t,o,r),t.child;case 6:return e===null&&QS(t),null;case 13:return C4(e,t,r);case 4:return hM(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=kh(t,null,n,r):mn(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ki(n,i),hP(e,t,n,i,r);case 7:return mn(e,t,t.pendingProps,r),t.child;case 8:return mn(e,t,t.pendingProps.children,r),t.child;case 12:return mn(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,zt(o0,n._currentValue),n._currentValue=o,a!==null)if(ua(a.value,o)){if(a.children===i.children&&!jn.current){t=Fo(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=No(-1,r&-r),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),eC(a.return,r,t),s.lanes|=r;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(ve(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),eC(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}mn(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,gh(t,r),i=Pi(i),n=n(i),t.flags|=1,mn(e,t,n,r),t.child;case 14:return n=t.type,i=Ki(n,t.pendingProps),i=Ki(n.type,i),fP(e,t,n,i,r);case 15:return _4(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ki(n,i),xy(e,t),t.tag=1,Rn(n)?(e=!0,n0(t)):e=!1,gh(t,r),m4(t,n,i),rC(t,n,i,r),aC(null,t,n,!0,e,r);case 19:return T4(e,t,r);case 22:return b4(e,t,r)}throw Error(ve(156,t.tag))};function V4(e,t){return vz(e,t)}function wZ(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 Mi(e,t,r,n){return new wZ(e,t,r,n)}function MM(e){return e=e.prototype,!(!e||!e.isReactComponent)}function SZ(e){if(typeof e=="function")return MM(e)?1:0;if(e!=null){if(e=e.$$typeof,e===U2)return 11;if(e===Z2)return 14}return 2}function Bs(e,t){var r=e.alternate;return r===null?(r=Mi(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 wy(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")MM(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Yc:return yu(r.children,i,a,t);case H2:o=8,i|=8;break;case MS:return e=Mi(12,r,t,i|2),e.elementType=MS,e.lanes=a,e;case AS:return e=Mi(13,r,t,i),e.elementType=AS,e.lanes=a,e;case kS:return e=Mi(19,r,t,i),e.elementType=kS,e.lanes=a,e;case K3:return Vx(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case X3:o=10;break e;case q3:o=9;break e;case U2:o=11;break e;case Z2:o=14;break e;case ps:o=16,n=null;break e}throw Error(ve(130,e==null?e:typeof e,""))}return t=Mi(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function yu(e,t,r,n){return e=Mi(7,e,n,t),e.lanes=r,e}function Vx(e,t,r,n){return e=Mi(22,e,n,t),e.elementType=K3,e.lanes=r,e.stateNode={isHidden:!1},e}function W1(e,t,r){return e=Mi(6,e,null,t),e.lanes=r,e}function H1(e,t,r){return t=Mi(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function CZ(e,t,r,n,i){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=C1(0),this.expirationTimes=C1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=C1(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function AM(e,t,r,n,i,a,o,s,l){return e=new CZ(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Mi(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},cM(a),e}function TZ(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(U4)}catch(e){console.error(e)}}U4(),U3.exports=ai;var Z4=U3.exports,MP=Z4;CS.createRoot=MP.createRoot,CS.hydrateRoot=MP.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 Hv(){return Hv=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function PM(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function PZ(){return Math.random().toString(36).substr(2,8)}function kP(e,t){return{usr:e.state,key:e.key,idx:t}}function mC(e,t,r,n){return r===void 0&&(r=null),Hv({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ef(t):t,{state:r,key:t&&t.key||n||PZ()})}function m0(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 ef(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 IZ(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=Cs.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(Hv({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function h(){s=Cs.Pop;let y=c(),x=y==null?null:y-u;u=y,l&&l({action:s,location:m.location,delta:x})}function f(y,x){s=Cs.Push;let _=mC(m.location,y,x);u=c()+1;let w=kP(_,u),S=m.createHref(_);try{o.pushState(w,"",S)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;i.location.assign(S)}a&&l&&l({action:s,location:m.location,delta:1})}function d(y,x){s=Cs.Replace;let _=mC(m.location,y,x);u=c();let w=kP(_,u),S=m.createHref(_);o.replaceState(w,"",S),a&&l&&l({action:s,location:m.location,delta:0})}function g(y){let x=i.location.origin!=="null"?i.location.origin:i.location.href,_=typeof y=="string"?y:m0(y);return _=_.replace(/ $/,"%20"),wr(x,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,x)}let m={get action(){return s},get location(){return e(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(AP,h),l=y,()=>{i.removeEventListener(AP,h),l=null}},createHref(y){return t(i,y)},createURL:g,encodeLocation(y){let x=g(y);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:f,replace:d,go(y){return o.go(y)}};return m}var LP;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(LP||(LP={}));function DZ(e,t,r){return r===void 0&&(r="/"),EZ(e,t,r)}function EZ(e,t,r,n){let i=typeof t=="string"?ef(t):t,a=IM(i.pathname||"/",r);if(a==null)return null;let o=$4(e);jZ(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(wr(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Fs([n,l.relativePath]),c=r.concat(l);a.children&&a.children.length>0&&(wr(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),$4(a.children,t,c,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:GZ(u,a.index),routesMeta:c})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of Y4(a.path))i(a,o,l)}),t}function Y4(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=Y4(n.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function jZ(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:WZ(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const RZ=/^:[\w-]+$/,OZ=3,zZ=2,BZ=1,FZ=10,VZ=-2,NP=e=>e==="*";function GZ(e,t){let r=e.split("/"),n=r.length;return r.some(NP)&&(n+=VZ),t&&(n+=zZ),r.filter(i=>!NP(i)).reduce((i,a)=>i+(RZ.test(a)?OZ:a===""?BZ:FZ),n)}function WZ(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function HZ(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:f,isOptional:d}=c;if(f==="*"){let m=s[h]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const g=s[h];return d&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function ZZ(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),PM(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=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function $Z(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return PM(!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 IM(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 YZ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,XZ=e=>YZ.test(e);function qZ(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?ef(e):e,a;if(r)if(XZ(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),PM(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=PP(r.substring(1),"/"):a=PP(r,t)}else a=t;return{pathname:a,search:QZ(n),hash:e$(i)}}function PP(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function U1(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 and the router will parse it for you.'}function KZ(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function X4(e,t){let r=KZ(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function q4(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=ef(e):(i=Hv({},e),wr(!i.pathname||!i.pathname.includes("?"),U1("?","pathname","search",i)),wr(!i.pathname||!i.pathname.includes("#"),U1("#","pathname","hash",i)),wr(!i.search||!i.search.includes("#"),U1("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let h=t.length-1;if(!n&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;i.pathname=f.join("/")}s=h>=0?t[h]:"/"}let l=qZ(i,s),u=o&&o!=="/"&&o.endsWith("/"),c=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Fs=e=>e.join("/").replace(/\/\/+/g,"/"),JZ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),QZ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,e$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function t$(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const K4=["post","put","patch","delete"];new Set(K4);const r$=["get",...K4];new Set(r$);/** - * 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 Uv(){return Uv=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),G.useCallback(function(u,c){if(c===void 0&&(c={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let h=q4(u,JSON.parse(o),a,c.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Fs([t,h.pathname])),(c.replace?n.replace:n.push)(h,c.state,c)},[t,n,o,a,e])}function tB(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=G.useContext($u),{matches:i}=G.useContext(Yu),{pathname:a}=tf(),o=JSON.stringify(X4(i,n.v7_relativeSplatPath));return G.useMemo(()=>q4(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function o$(e,t){return s$(e,t)}function s$(e,t,r,n){Ip()||wr(!1);let{navigator:i}=G.useContext($u),{matches:a}=G.useContext(Yu),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=tf(),c;if(t){var h;let y=typeof t=="string"?ef(t):t;l==="/"||(h=y.pathname)!=null&&h.startsWith(l)||wr(!1),c=y}else c=u;let f=c.pathname||"/",d=f;if(l!=="/"){let y=l.replace(/^\//,"").split("/");d="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let g=DZ(e,{pathname:d}),m=f$(g&&g.map(y=>Object.assign({},y,{params:Object.assign({},s,y.params),pathname:Fs([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Fs([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,r,n);return t&&m?G.createElement(Zx.Provider,{value:{location:Uv({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Cs.Pop}},m):m}function l$(){let e=g$(),t=t$(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return G.createElement(G.Fragment,null,G.createElement("h2",null,"Unexpected Application Error!"),G.createElement("h3",{style:{fontStyle:"italic"}},t),r?G.createElement("pre",{style:i},r):null,null)}const u$=G.createElement(l$,null);class c$ extends G.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?G.createElement(Yu.Provider,{value:this.props.routeContext},G.createElement(J4.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function h$(e){let{routeContext:t,match:r,children:n}=e,i=G.useContext(DM);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),G.createElement(Yu.Provider,{value:t},n)}function f$(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(i=r)==null?void 0:i.errors;if(s!=null){let c=o.findIndex(h=>h.route.id&&(s==null?void 0:s[h.route.id])!==void 0);c>=0||wr(!1),o=o.slice(0,Math.min(o.length,c+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let c=0;c=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,h,f)=>{let d,g=!1,m=null,y=null;r&&(d=s&&h.route.id?s[h.route.id]:void 0,m=h.route.errorElement||u$,l&&(u<0&&f===0?(y$("route-fallback"),g=!0,y=null):u===f&&(g=!0,y=h.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,f+1)),_=()=>{let w;return d?w=m:g?w=y:h.route.Component?w=G.createElement(h.route.Component,null):h.route.element?w=h.route.element:w=c,G.createElement(h$,{match:h,routeContext:{outlet:c,matches:x,isDataRoute:r!=null},children:w})};return r&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?G.createElement(c$,{location:r.location,revalidation:r.revalidation,component:m,error:d,children:_(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):_()},null)}var rB=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(rB||{}),nB=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}(nB||{});function d$(e){let t=G.useContext(DM);return t||wr(!1),t}function v$(e){let t=G.useContext(n$);return t||wr(!1),t}function p$(e){let t=G.useContext(Yu);return t||wr(!1),t}function iB(e){let t=p$(),r=t.matches[t.matches.length-1];return r.route.id||wr(!1),r.route.id}function g$(){var e;let t=G.useContext(J4),r=v$(),n=iB();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function m$(){let{router:e}=d$(rB.UseNavigateStable),t=iB(nB.UseNavigateStable),r=G.useRef(!1);return Q4(()=>{r.current=!0}),G.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Uv({fromRouteId:t},a)))},[e,t])}const IP={};function y$(e,t,r){IP[e]||(IP[e]=!0)}function x$(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function $i(e){wr(!1)}function _$(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Cs.Pop,navigator:a,static:o=!1,future:s}=e;Ip()&&wr(!1);let l=t.replace(/^\/*/,"/"),u=G.useMemo(()=>({basename:l,navigator:a,static:o,future:Uv({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=ef(n));let{pathname:c="/",search:h="",hash:f="",state:d=null,key:g="default"}=n,m=G.useMemo(()=>{let y=IM(c,l);return y==null?null:{location:{pathname:y,search:h,hash:f,state:d,key:g},navigationType:i}},[l,c,h,f,d,g,i]);return m==null?null:G.createElement($u.Provider,{value:u},G.createElement(Zx.Provider,{children:r,value:m}))}function b$(e){let{children:t,location:r}=e;return o$(yC(t),r)}new Promise(()=>{});function yC(e,t){t===void 0&&(t=[]);let r=[];return G.Children.forEach(e,(n,i)=>{if(!G.isValidElement(n))return;let a=[...t,i];if(n.type===G.Fragment){r.push.apply(r,yC(n.props.children,a));return}n.type!==$i&&wr(!1),!n.props.index||!n.props.children||wr(!1);let o={id:n.props.id||a.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=yC(n.props.children,a)),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 xC(){return xC=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function S$(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function C$(e,t){return e.button===0&&(!t||t==="_self")&&!S$(e)}const T$=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],M$="6";try{window.__reactRouterVersion=M$}catch{}const A$="startTransition",DP=xU[A$];function k$(e){let{basename:t,children:r,future:n,window:i}=e,a=G.useRef();a.current==null&&(a.current=NZ({window:i,v5Compat:!0}));let o=a.current,[s,l]=G.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},c=G.useCallback(h=>{u&&DP?DP(()=>l(h)):l(h)},[l,u]);return G.useLayoutEffect(()=>o.listen(c),[o,c]),G.useEffect(()=>x$(n),[n]),G.createElement(_$,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const L$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",N$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,P$=G.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:c,viewTransition:h}=t,f=w$(t,T$),{basename:d}=G.useContext($u),g,m=!1;if(typeof u=="string"&&N$.test(u)&&(g=u,L$))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),T=IM(S.pathname,d);S.origin===w.origin&&T!=null?u=T+S.search+S.hash:m=!0}catch{}let y=i$(u,{relative:i}),x=I$(u,{replace:o,state:s,target:l,preventScrollReset:c,relative:i,viewTransition:h});function _(w){n&&n(w),w.defaultPrevented||x(w)}return G.createElement("a",xC({},f,{href:g||y,onClick:m||a?n:_,ref:r,target:l}))});var EP;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(EP||(EP={}));var jP;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(jP||(jP={}));function I$(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=eB(),u=tf(),c=tB(e,{relative:o});return G.useCallback(h=>{if(C$(h,r)){h.preventDefault();let f=n!==void 0?n:m0(u)===m0(c);l(e,{replace:f,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[u,l,c,n,i,r,e,a,o,s])}/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const D$=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),aB=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var E$={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const j$=G.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:o,...s},l)=>G.createElement("svg",{ref:l,...E$,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:aB("lucide",i),...s},[...o.map(([u,c])=>G.createElement(u,c)),...Array.isArray(a)?a:[a]]));/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Re=(e,t)=>{const r=G.forwardRef(({className:n,...i},a)=>G.createElement(j$,{ref:a,iconNode:t,className:aB(`lucide-${D$(e)}`,n),...i}));return r.displayName=`${e}`,r};/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rf=Re("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Z1=Re("Battery",[["rect",{width:"16",height:"10",x:"2",y:"7",rx:"2",ry:"2",key:"1w10f2"}],["line",{x1:"22",x2:"22",y1:"11",y2:"13",key:"4dh1rd"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const R$=Re("BellRing",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Zv=Re("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const oB=Re("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const O$=Re("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const z$=Re("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const B$=Re("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $x=Re("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Za=Re("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ll=Re("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const F$=Re("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Js=Re("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const V$=Re("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vo=Re("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const EM=Re("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Iu=Re("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const G$=Re("CloudLightning",[["path",{d:"M6 16.326A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 .5 8.973",key:"1cez44"}],["path",{d:"m13 12-3 5h4l-3 5",key:"1t22er"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Du=Re("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const W$=Re("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sB=Re("Construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const H$=Re("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lB=Re("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const U$=Re("Crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uB=Re("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Yx=Re("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ih=Re("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const cB=Re("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const jM=Re("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const RM=Re("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xx=Re("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Z$=Re("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $$=Re("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qx=Re("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hB=Re("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fB=Re("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Dp=Re("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Y$=Re("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nf=Re("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const X$=Re("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const OM=Re("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Kx=Re("Mountain",[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dB=Re("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const af=Re("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Di=Re("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $v=Re("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jx=Re("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const q$=Re("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qx=Re("Satellite",[["path",{d:"M13 7 9 3 5 7l4 4",key:"vyckw6"}],["path",{d:"m17 11 4 4-4 4-4-4",key:"rchckc"}],["path",{d:"m8 12 4 4 6-6-4-4Z",key:"1sshf7"}],["path",{d:"m16 8 3-3",key:"x428zp"}],["path",{d:"M9 21a6 6 0 0 0-6-6",key:"1iajcf"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zM=Re("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e_=Re("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _C=Re("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const K$=Re("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vB=Re("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const BM=Re("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const J$=Re("Snowflake",[["line",{x1:"2",x2:"22",y1:"12",y2:"12",key:"1dnqot"}],["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"m20 16-4-4 4-4",key:"rquw4f"}],["path",{d:"m4 8 4 4-4 4",key:"12s3z9"}],["path",{d:"m16 4-4 4-4-4",key:"1tumq1"}],["path",{d:"m8 20 4-4 4 4",key:"9p200w"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pB=Re("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gB=Re("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ep=Re("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $a=Re("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Q$=Re("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mB=Re("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const t_=Re("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ca=Re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** - * @license lucide-react v0.383.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Dh=Re("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);async function zi(e){const t=await fetch(e);if(!t.ok)throw new Error(`API error: ${t.status} ${t.statusText}`);return t.json()}async function RP(){return zi("/api/status")}async function eY(){return zi("/api/health")}async function tY(){return zi("/api/nodes")}async function rY(){return zi("/api/edges")}async function nY(){return zi("/api/sources")}async function yB(){return zi("/api/alerts/active")}async function OP(e=50,t=0,r,n){const i=new URLSearchParams;return i.set("limit",e.toString()),i.set("offset",t.toString()),r&&r!=="all"&&i.set("type",r),n&&n!=="all"&&i.set("severity",n),zi(`/api/alerts/history?${i.toString()}`)}async function iY(){return zi("/api/subscriptions")}async function xB(){return zi("/api/env/status")}async function _B(){return zi("/api/env/active")}async function aY(){return zi("/api/env/swpc")}async function oY(){return zi("/api/regions")}function FM(){const[e,t]=G.useState(!1),[r,n]=G.useState(null),[i,a]=G.useState(null),[o,s]=G.useState(null),l=G.useRef(null),u=G.useRef(null),c=G.useRef(1e3),h=G.useCallback(()=>{var g;if(((g=l.current)==null?void 0:g.readyState)===WebSocket.OPEN)return;const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/live`;try{const m=new WebSocket(d);l.current=m,m.onopen=()=>{t(!0),c.current=1e3},m.onmessage=x=>{try{const _=JSON.parse(x.data);switch(s(_),_.type){case"health_update":n(_.data);break;case"alert_fired":a(_.data);break}}catch(_){console.error("Failed to parse WebSocket message:",_)}},m.onclose=()=>{t(!1),l.current=null;const x=Math.min(c.current,3e4);u.current=window.setTimeout(()=>{c.current=Math.min(x*2,3e4),h()},x)},m.onerror=()=>{m.close()};const y=setInterval(()=>{m.readyState===WebSocket.OPEN&&m.send("ping")},3e4);m.addEventListener("close",()=>{clearInterval(y)})}catch(m){console.error("Failed to create WebSocket:",m)}},[]);return G.useEffect(()=>(h(),()=>{u.current&&clearTimeout(u.current),l.current&&l.current.close()}),[h]),{connected:e,lastHealth:r,lastAlert:i,lastMessage:o}}const bB=G.createContext(null);function sY(){const e=G.useContext(bB);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}function lY(e){switch(e==null?void 0:e.toLowerCase()){case"critical":case"emergency":return{bg:"bg-red-500/10",border:"border-red-500",icon:Vo,iconColor:"text-red-500"};case"warning":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:$a,iconColor:"text-amber-500"};default:return{bg:"bg-sky-400/10",border:"border-sky-400",icon:qx,iconColor:"text-sky-400"}}}function uY({toast:e,onDismiss:t,onNavigate:r}){const n=lY(e.alert.severity),i=n.icon;return G.useEffect(()=>{const a=setTimeout(t,8e3);return()=>clearTimeout(a)},[t]),v.jsx("div",{className:`${n.bg} border ${n.border} shadow-lg overflow-hidden animate-slide-in cursor-pointer`,onClick:r,role:"alert",children:v.jsxs("div",{className:"flex items-start gap-3 p-4",children:[v.jsx("div",{className:`w-1 self-stretch -ml-4 -my-4 ${n.border.replace("border","bg")}`}),v.jsx(i,{size:18,className:n.iconColor}),v.jsxs("div",{className:"flex-1 min-w-0 pr-2",children:[v.jsx("div",{className:"text-sm font-medium text-slate-200 mb-0.5",children:e.alert.type.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}),v.jsx("div",{className:"text-sm text-slate-300 line-clamp-2",children:e.alert.message})]}),v.jsx("button",{onClick:a=>{a.stopPropagation(),t()},className:"text-slate-400 hover:text-slate-200 transition-colors",children:v.jsx(ca,{size:16})})]})})}function cY({children:e}){const[t,r]=G.useState([]),n=eB(),i=G.useCallback(s=>{const l=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(u=>[...u,{id:l,alert:s}])},[]),a=G.useCallback(s=>{r(l=>l.filter(u=>u.id!==s))},[]),o=G.useCallback(()=>{n("/alerts")},[n]);return v.jsxs(bB.Provider,{value:{addToast:i},children:[e,v.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none",children:t.map(s=>v.jsx("div",{className:"pointer-events-auto",children:v.jsx(uY,{toast:s,onDismiss:()=>a(s.id),onNavigate:o})},s.id))})]})}const r_="meshai.restartRequired.v1";function zP(){try{const e=localStorage.getItem(r_);if(!e)return{required:!1,changedKeys:[],ts:0};const t=JSON.parse(e);return{required:!!t.required,changedKeys:Array.isArray(t.changedKeys)?t.changedKeys:[],ts:Number(t.ts)||0}}catch{return{required:!1,changedKeys:[],ts:0}}}function hY(e){const t={required:!0,changedKeys:[...new Set(e)],ts:Date.now()};localStorage.setItem(r_,JSON.stringify(t)),window.dispatchEvent(new CustomEvent("meshai:restart-required",{detail:t}))}function BP(){localStorage.removeItem(r_),window.dispatchEvent(new CustomEvent("meshai:restart-required",{detail:{required:!1,changedKeys:[],ts:0}}))}function fY(){const[e,t]=G.useState(()=>zP()),[r,n]=G.useState(!1),[i,a]=G.useState(null);G.useEffect(()=>{const l=c=>{const h=c.detail;t(h)},u=c=>{c.key===r_&&t(zP())};return window.addEventListener("meshai:restart-required",l),window.addEventListener("storage",u),()=>{window.removeEventListener("meshai:restart-required",l),window.removeEventListener("storage",u)}},[]);const o=G.useCallback(async()=>{n(!0),a(null);try{const l=await fetch("/api/system/restart",{method:"POST"});if(!l.ok&&l.status!==202){const u=await l.json().catch(()=>({}));throw new Error(u.detail||`HTTP ${l.status}`)}BP()}catch(l){a(String(l)),n(!1)}},[]),s=G.useCallback(()=>{BP()},[]);return e.required?v.jsxs("div",{className:"bg-yellow-900/40 border-b border-yellow-700 text-yellow-100 px-4 py-2 text-sm flex items-center gap-3",children:[v.jsx($a,{className:"w-4 h-4 flex-shrink-0 text-yellow-300"}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("strong",{children:"Container restart required"}),e.changedKeys.length>0&&v.jsxs("span",{className:"text-yellow-300 ml-2",children:["(",e.changedKeys.length," key",e.changedKeys.length===1?"":"s",":"," ",v.jsxs("span",{className:"font-mono text-xs",children:[e.changedKeys.slice(0,3).join(", "),e.changedKeys.length>3?", …":""]}),")"]}),v.jsx("span",{className:"ml-2 text-yellow-300/80",children:"for these changes to take effect. Until then the runtime keeps its boot-time configuration. Restart-required keys include anything under Config → environmental (feed_source, central URL), the LLM backend swap, and the dispatcher cold-start grace window. Other keys take effect on the next handler call."}),i&&v.jsx("div",{className:"text-red-400 text-xs mt-1",children:i})]}),v.jsxs("button",{onClick:o,disabled:r,className:"flex items-center gap-1 px-3 py-1 bg-yellow-700 hover:bg-yellow-600 disabled:opacity-50 rounded text-white text-xs",children:[v.jsx(q$,{className:`w-3 h-3 ${r?"animate-spin":""}`}),r?"Restarting…":"Restart now"]}),v.jsx("button",{onClick:s,className:"text-yellow-300 hover:text-white px-1",title:"Dismiss (you can still restart later)",children:v.jsx(ca,{className:"w-4 h-4"})})]}):null}const wB=[{path:"/",label:"Dashboard",icon:fB},{path:"/mesh",label:"Mesh",icon:Di},{path:"/environment",label:"Environment",icon:Du},{path:"/config",label:"Config",icon:vB},{path:"/alerts",label:"Alerts",icon:Zv},{path:"/notifications",label:"Notifications",icon:R$},{path:"/reference",label:"Reference",icon:oB},{path:"/adapter-config",label:"Adapter Config",icon:BM},{path:"/gauge-sites",label:"Gauge Sites",icon:Yx},{path:"/town-anchors",label:"Town Anchors",icon:nf}];function dY(e){const t=Math.floor(e/86400),r=Math.floor(e%86400/3600),n=Math.floor(e%3600/60);return t>0?`${t}d ${r}h`:r>0?`${r}h ${n}m`:`${n}m`}function vY(e){const t=wB.find(r=>r.path===e);return(t==null?void 0:t.label)||"Dashboard"}function pY({children:e}){var f;const t=tf(),{connected:r,lastAlert:n}=FM(),{addToast:i}=sY(),[a,o]=G.useState(null),[s,l]=G.useState(null);G.useEffect(()=>{if(n){const d=`${n.type}-${n.message}-${n.timestamp}`;d!==s&&(l(d),i(n))}},[n,s,i]);const[u,c]=G.useState(new Date);G.useEffect(()=>{RP().then(o).catch(console.error);const d=setInterval(()=>{RP().then(o).catch(console.error)},3e4);return()=>clearInterval(d)},[]),G.useEffect(()=>{const d=setInterval(()=>c(new Date),1e3);return()=>clearInterval(d)},[]);const h=u.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return v.jsxs("div",{className:"flex h-screen overflow-hidden bg-bg text-white",children:[v.jsxs("aside",{className:"w-[220px] flex-shrink-0 bg-bg-card border-r border-border flex flex-col overflow-y-auto",children:[v.jsxs("div",{className:"bg-[#000000] px-4 py-3 border-b border-border flex flex-col items-center",children:[v.jsx("img",{src:"/meshai-logo.png",alt:"MeshAI",className:"w-[190px] block"}),v.jsxs("div",{className:"font-mono text-[10px] text-[#555] mt-1 self-start",children:["v",(a==null?void 0:a.version)||"..."]})]}),v.jsx("nav",{className:"flex-1 py-4",children:wB.map(d=>{const g=t.pathname===d.path,m=d.icon;return v.jsxs(P$,{to:d.path,className:`flex items-center gap-3 px-5 py-3 text-sm font-sans transition-colors relative ${g?"text-white bg-transparent":"text-[#777] hover:text-white hover:bg-bg-hover"}`,children:[g&&v.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-[2px] bg-[#f59e0b]"}),v.jsx(m,{size:16}),d.label]},d.path)})}),v.jsxs("div",{className:"p-5 border-t border-border",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${a!=null&&a.connected?"bg-green-500":"bg-red-500"}`}),v.jsx("span",{className:"text-xs font-sans text-[#777]",children:a!=null&&a.connected?"Connected":"Disconnected"})]}),v.jsxs("div",{className:"text-xs font-mono text-[#666] truncate",children:[(f=a==null?void 0:a.connection_type)==null?void 0:f.toUpperCase(),": ",a==null?void 0:a.connection_target]}),v.jsxs("div",{className:"text-xs font-sans text-[#666] mt-1",children:["Uptime: ",v.jsx("span",{className:"font-mono",children:a?dY(a.uptime_seconds):"..."})]})]})]}),v.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v.jsxs("header",{className:"h-14 flex-shrink-0 border-b border-border bg-bg-card flex items-center justify-between px-6",children:[v.jsx("h1",{className:"text-lg font-sans font-semibold text-white",children:vY(t.pathname)}),v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${r?"bg-accent animate-pulse-slow":"bg-[#333]"}`}),v.jsx("span",{className:"text-xs font-sans text-[#777]",children:r?"Live":"Offline"})]}),v.jsxs("div",{className:"text-sm font-mono text-[#666]",children:[h," MT"]})]})]}),v.jsxs("main",{className:"flex-1 overflow-y-auto p-6",children:[v.jsx(fY,{}),e]})]})]})}function gY({health:e}){const t=e.score,r=e.tier,n=2*Math.PI*45,i=t/100*n;return v.jsx("div",{className:"flex flex-col items-center",children:v.jsxs("svg",{width:"140",height:"140",viewBox:"0 0 100 100",children:[v.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"#1e1e1e",strokeWidth:"8"}),v.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"#f59e0b",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:n,strokeDashoffset:n-i,transform:"rotate(-90 50 50)",className:"transition-all duration-500"}),v.jsx("text",{x:"50",y:"46",textAnchor:"middle",className:"font-mono font-bold",style:{fontSize:"24px",fill:"#f59e0b"},children:t.toFixed(1)}),v.jsx("text",{x:"50",y:"62",textAnchor:"middle",className:"font-sans",style:{fontSize:"10px",fill:"#444"},children:r})]})})}function id({label:e,value:t}){const r=n=>n>66?"bg-accent":n>33?"bg-accent-dim":"bg-red-500";return v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-24 text-xs font-sans text-[#777] truncate",children:e}),v.jsx("div",{className:"flex-1 h-2 bg-border overflow-hidden",children:v.jsx("div",{className:`h-full ${r(t)} transition-all duration-300`,style:{width:`${t}%`}})}),v.jsx("div",{className:"w-12 text-right text-xs font-mono text-[#e0e0e0]",children:t.toFixed(1)})]})}function mY({alert:e}){const r=(i=>{switch(i.toLowerCase()){case"critical":case"emergency":case"immediate":return{bg:"bg-red-500/5",border:"border-red-500",icon:Vo,iconColor:"text-red-500"};case"warning":case"priority":return{bg:"bg-accent/5",border:"border-accent",icon:$a,iconColor:"text-accent"};case"routine":default:return{bg:"bg-[#161616]",border:"border-[#333]",icon:qx,iconColor:"text-[#777]"}}})(e.severity),n=r.icon;return v.jsxs("div",{className:`p-3 ${r.bg} border-l-2 ${r.border} flex items-start gap-3`,children:[v.jsx(n,{size:16,className:r.iconColor}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"text-sm font-sans font-medium text-white",children:e.message}),v.jsx("div",{className:"text-[10px] font-mono text-[#666] mt-1",children:e.timestamp||"Just now"})]})]})}function yY({source:e}){const t=()=>e.is_loaded?e.last_error?"bg-accent":"bg-green-500":"bg-red-500";return v.jsxs("div",{className:"flex items-center gap-3 p-2 bg-bg-hover",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${t()}`}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"text-sm font-sans font-medium text-white truncate",children:e.name}),v.jsxs("div",{className:"text-[10px] font-sans text-[#666]",children:[e.node_count," nodes · ",e.type]})]})]})}function Yg({icon:e,label:t,value:r,subvalue:n,accent:i}){return v.jsxs("div",{className:"bg-bg-card border border-border p-3",style:i?{borderTopWidth:"2px",borderTopColor:i}:void 0,children:[v.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[v.jsx(e,{size:14,style:{color:i||"#333"}}),v.jsx("span",{className:"text-[9px] font-sans uppercase tracking-widest text-[#666]",children:t})]}),v.jsx("div",{className:"font-mono text-xl",style:{color:i||"#e0e0e0"},children:r}),n&&v.jsx("div",{className:"text-[9px] font-sans mt-1 text-[#666]",children:n})]})}function xY({bandConditions:e}){const t=a=>{switch(a){case"Good":return"bg-green-500";case"Fair":return"bg-accent";case"Poor":return"bg-red-500";default:return"bg-[#333]"}},r=a=>{switch(a){case"Good":return"text-green-500";case"Fair":return"text-accent";case"Poor":return"text-red-500";default:return"text-[#666]"}},n=a=>a?a.includes("Night")?"🌙":"☀️":"";if(!(e!=null&&e.enabled)||!(e!=null&&e.ratings))return v.jsxs("div",{className:"bg-bg-card border border-border p-4 flex flex-col h-full",children:[v.jsxs("h2",{className:"text-[10px] font-sans uppercase tracking-widest text-[#666] mb-3 flex items-center gap-2",children:[v.jsx(Dh,{size:14}),"RF Propagation"]}),v.jsx("div",{className:"flex-1 flex items-center justify-center",children:v.jsx("div",{className:"text-center py-8",children:v.jsx("div",{className:"font-sans text-[#666]",children:"No band conditions data"})})})]});const i=["80-40m","30-20m","17-15m","12-10m"];return v.jsxs("div",{className:"bg-bg-card border border-border p-4 flex flex-col h-full",children:[v.jsxs("h2",{className:"text-[10px] font-sans uppercase tracking-widest text-[#666] mb-3 flex items-center gap-2",children:[v.jsx(Dh,{size:14}),"RF Propagation"]}),v.jsxs("div",{className:"text-center mb-3",children:[v.jsx("span",{className:"text-lg",children:n(e.slot_label)}),v.jsx("span",{className:"text-sm font-sans text-[#777] ml-2",children:e.slot_label})]}),v.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-[#666] mb-2 flex items-center gap-1",children:"📡 Band Conditions"}),v.jsx("div",{className:"space-y-1.5",children:i.map(a=>{var s;const o=(s=e.ratings)==null?void 0:s[a];return v.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 bg-bg-hover",children:[v.jsx("span",{className:"text-sm font-mono text-[#777]",children:a}),v.jsxs("span",{className:"text-sm flex items-center gap-2",children:[v.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${t(o)}`}),v.jsx("span",{className:`font-sans ${r(o)}`,children:o||"—"})]})]},a)})}),v.jsxs("div",{className:"mt-auto pt-3 border-t border-border text-[10px] font-sans text-[#666]",children:[e.source&&v.jsx("span",{children:e.source==="swpc_local"?"SWPC":"HamQSL"}),e.sent_at&&v.jsx("span",{className:"font-mono ml-2",children:new Date(e.sent_at*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}const FP=[{code:"wam",label:"Western North America"},{code:"eam",label:"Eastern North America"},{code:"enp",label:"Eastern North Pacific"},{code:"esp",label:"Eastern South Pacific"},{code:"gca",label:"Gulf-Caribbean"},{code:"nsa",label:"Northern South America"},{code:"csa",label:"Central South America"},{code:"sat",label:"South Atlantic"},{code:"nat",label:"North Atlantic"},{code:"ena",label:"Eastern North Atlantic"},{code:"nwe",label:"Northwestern Europe"},{code:"eur",label:"Europe"},{code:"eeu",label:"Eastern Europe"},{code:"saf",label:"South Africa"},{code:"mde",label:"Middle East"},{code:"nca",label:"North Central Asia"},{code:"ind",label:"Indian Ocean"},{code:"sea",label:"Southeast Asia"},{code:"fea",label:"Far East"},{code:"esi",label:"Eastern Siberia"},{code:"anz",label:"Australia & New Zealand"},{code:"oce",label:"Oceania"},{code:"wnp",label:"Western North Pacific"}];function _Y(){var c;const[e,t]=G.useState("wam"),[r,n]=G.useState(!1),[i,a]=G.useState(!1);G.useEffect(()=>{fetch("/api/adapter-config/dashboard/tropo_region").then(h=>h.ok?h.json():null).then(h=>{h!=null&&h.value&&typeof h.value=="string"&&t(h.value)}).catch(()=>{})},[]);const o=h=>{t(h),n(!1),a(!0),fetch("/api/adapter-config/dashboard/tropo_region",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:h})}).catch(()=>{}).finally(()=>a(!1))},s=new Date().toISOString().slice(0,10).replace(/-/g,""),l=`https://www.dxinfocentre.com/tr_map/fcst/${e}006.png?v${s}`,u=((c=FP.find(h=>h.code===e))==null?void 0:c.label)||e;return v.jsxs("div",{className:"bg-bg-card border border-border p-4 flex flex-col",children:[v.jsxs("div",{className:"flex items-center justify-between mb-3",children:[v.jsxs("h2",{className:"text-[10px] font-sans uppercase tracking-widest text-[#666] flex items-center gap-2",children:[v.jsx(Di,{size:14}),"Tropo Forecast (Hepburn)"]}),v.jsxs("div",{className:"flex items-center gap-2",children:[i&&v.jsx("span",{className:"text-xs font-sans text-[#666]",children:"saving..."}),v.jsx("select",{value:e,onChange:h=>o(h.target.value),className:"text-xs font-sans bg-bg-hover border border-border px-2 py-1 min-h-[36px] text-[#e0e0e0] focus:outline-none focus:border-accent",children:FP.map(h=>v.jsx("option",{value:h.code,children:h.label},h.code))})]})]}),v.jsxs("div",{className:"text-xs font-sans text-[#666] mb-2",children:[u," — 6-day forecast"]}),r?v.jsx("div",{className:"flex items-center justify-center h-48 text-[#666] text-sm font-sans",children:"Failed to load forecast image"}):v.jsx("img",{src:l,alt:`Hepburn tropo forecast — ${u}`,className:"w-full border border-border",onError:()=>n(!0)}),v.jsxs("div",{className:"text-[10px] font-sans text-[#666] mt-2",children:["Source: ",v.jsx("a",{href:"https://www.dxinfocentre.com/tropo.html",target:"_blank",rel:"noopener noreferrer",className:"text-sky-400 hover:text-sky-300",children:"dxinfocentre.com"})]})]})}const bY={nws:{icon:Du,color:"text-sky-400",label:"NWS"},swpc:{icon:pB,color:"text-accent",label:"SWPC"},ducting:{icon:Di,color:"text-sky-500",label:"Tropo"},nifc:{icon:Xx,color:"text-red-500",label:"NIFC"},firms:{icon:Qx,color:"text-red-400",label:"FIRMS"},avalanche:{icon:Kx,color:"text-[#777]",label:"Avy"},usgs:{icon:Yx,color:"text-sky-400",label:"USGS"},traffic:{icon:$x,color:"text-[#777]",label:"Traffic"},roads:{icon:sB,color:"text-accent-dim",label:"511"}},VP={routine:"bg-[#1e1e1e] text-[#777] border-[#222]",priority:"bg-accent/5 text-accent border-accent/30",immediate:"bg-red-500/5 text-red-500 border-red-500/30",info:"bg-sky-400/10 text-sky-400 border-sky-400/30",advisory:"bg-sky-400/10 text-sky-400 border-sky-400/30",moderate:"bg-accent/5 text-accent-dim border-accent-dim/30",watch:"bg-accent/5 text-accent border-accent/30",warning:"bg-accent/5 text-accent border-accent/30",severe:"bg-red-500/5 text-red-500 border-red-500/30",extreme:"bg-red-500/5 text-red-500 border-red-500/30",critical:"bg-red-500/5 text-red-500 border-red-500/30",emergency:"bg-red-500/5 text-red-500 border-red-500/30"};function wY({event:e,isLocal:t}){var h;const r=bY[e.source]||{icon:qx,color:"text-[#777]",label:e.source},n=r.icon,i=VP[(h=e.severity)==null?void 0:h.toLowerCase()]||VP.info,a=f=>{const d=new Date(f*1e3),m=new Date().getTime()-d.getTime(),y=Math.floor(m/6e4);return y<1?"just now":y<60?`${y}m ago`:y<1440?`${Math.floor(y/60)}h ago`:d.toLocaleDateString(void 0,{month:"short",day:"numeric"})},o=e.event_type,s=e.area_desc,l=e.description;let u=e.headline;if(o&&s){const f=s.replace(/ County/g,"").split(";")[0];u=`${o} — ${f}`}else o&&(u=o);const c=l?l.split(". ")[0]:null;return v.jsxs("div",{className:`flex items-start gap-2 py-2 border-b border-border/50 last:border-0 ${t?"border-l-2 border-l-accent pl-2 -ml-2":""}`,children:[v.jsx(n,{size:14,className:`mt-0.5 flex-shrink-0 ${r.color}`}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[v.jsx("span",{className:`px-1.5 py-0.5 text-[10px] font-sans uppercase tracking-wide border ${i}`,children:e.severity||"info"}),t&&v.jsx("span",{className:"px-1.5 py-0.5 text-[10px] font-sans uppercase tracking-wide bg-accent/5 text-accent border border-accent/30",title:"LOCAL: event coordinates fall inside the mesh's monitoring area (per the adapter's bbox config on Environment) — operators in this region are directly affected.",children:"LOCAL"}),v.jsx("span",{className:"text-[10px] font-sans text-[#666]",children:r.label}),v.jsx("span",{className:"text-[10px] font-mono text-[#666] ml-auto",children:a(e.fetched_at)})]}),v.jsx("div",{className:`text-sm font-sans font-medium truncate ${t?"text-white":"text-[#e0e0e0]"}`,children:u}),c&&v.jsx("div",{className:"text-[10px] font-sans text-[#666] truncate mt-0.5",children:c})]})]})}function SY({events:e,envStatus:t,embedded:r}){const n={immediate:0,priority:1,routine:2},i=G.useMemo(()=>{const s=new Set;return e.filter(u=>u.event_id?s.has(u.event_id)?!1:(s.add(u.event_id),!0):!0).sort((u,c)=>{var m,y;const h=u.is_local?1:0,f=c.is_local?1:0;if(h!==f)return f-h;const d=n[((m=u.severity)==null?void 0:m.toLowerCase())||"routine"]??2,g=n[((y=c.severity)==null?void 0:y.toLowerCase())||"routine"]??2;return d!==g?d-g:(c.fetched_at||0)-(u.fetched_at||0)})},[e]),a=G.useMemo(()=>{if(!(t!=null&&t.feeds))return null;const s=t.feeds.length,l=t.feeds.filter(f=>f.is_loaded&&!f.last_error).length,u=t.feeds.filter(f=>f.last_error).map(f=>f.source),c=Math.max(...t.feeds.map(f=>f.last_fetch||0)),h=c?Math.floor(Date.now()/1e3-c):null;return{total:s,active:l,errors:u,secAgo:h}},[t]),o=v.jsxs(v.Fragment,{children:[i.length>0?v.jsx("div",{className:"flex-1 overflow-y-auto max-h-80 pr-1 -mr-1",children:i.map((s,l)=>v.jsx(wY,{event:s,isLocal:s.is_local},s.event_id||l))}):v.jsx("div",{className:"flex-1 flex items-center justify-center",children:v.jsxs("div",{className:"text-center py-8",children:[v.jsx(EM,{size:24,className:"text-green-500 mx-auto mb-2"}),v.jsx("div",{className:"font-sans text-[#777]",children:"No active events"}),v.jsx("div",{className:"text-[10px] font-sans text-[#666]",children:"All clear"})]})}),a&&v.jsxs("div",{className:`text-[10px] font-sans mt-3 pt-3 border-t border-border ${a.errors.length>0?"text-red-500":"text-[#666]"}`,children:[v.jsx("span",{className:"font-mono",children:a.active})," of ",v.jsx("span",{className:"font-mono",children:a.total})," feeds active",a.secAgo!==null&&v.jsxs(v.Fragment,{children:[" · Last update ",v.jsxs("span",{className:"font-mono",children:[a.secAgo,"s"]})," ago"]}),a.errors.length>0&&v.jsxs("span",{className:"text-red-500",children:[" · ",a.errors.join(", "),": error"]})]})]});return r?v.jsx("div",{className:"flex flex-col h-full",children:o}):v.jsxs("div",{className:"bg-bg-card border border-border p-4 flex flex-col h-full",children:[v.jsxs("h2",{className:"text-[10px] font-sans uppercase tracking-widest text-[#666] mb-3 flex items-center gap-2",children:[v.jsx(rf,{size:14}),"Live Event Feed"]}),o]})}function CY(){var S,T,M,A,P,I;const[e,t]=G.useState(null),[r,n]=G.useState([]),[i,a]=G.useState([]),[o,s]=G.useState(null),[l,u]=G.useState([]),[c,h]=G.useState(null),[f,d]=G.useState("alerts"),[g,m]=G.useState(!0),[y,x]=G.useState(null),{lastHealth:_,lastMessage:w}=FM();return G.useEffect(()=>{Promise.all([eY(),nY(),yB(),xB(),_B().catch(()=>[]),aY().catch(()=>null)]).then(([N,D,O,R,F,H])=>{t(N),n(D),a(O),s(R),u(F),h(H),m(!1),document.title="Dashboard — MeshAI"}).catch(N=>{x(N.message),m(!1),document.title="Dashboard — MeshAI"})},[]),G.useEffect(()=>{_&&t(_)},[_]),G.useEffect(()=>{(w==null?void 0:w.type)==="env_update"&&w.event&&u(N=>{const D=w.event,O=N.filter(R=>R.event_id!==D.event_id);return[D,...O].slice(0,100)})},[w]),g?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"font-sans text-[#777]",children:"Loading..."})}):y?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsxs("div",{className:"font-sans text-red-500",children:["Error: ",y]})}):v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[v.jsxs("div",{className:"bg-bg-card border border-border p-4",children:[v.jsx("h2",{className:"text-[10px] font-sans uppercase tracking-widest text-[#666] mb-3",children:"Mesh Health"}),e&&v.jsxs(v.Fragment,{children:[v.jsx(gY,{health:e}),v.jsxs("div",{className:"mt-4 space-y-2",children:[v.jsx(id,{label:"Infrastructure",value:((S=e.pillars)==null?void 0:S.infrastructure)??0}),v.jsx(id,{label:"Utilization",value:((T=e.pillars)==null?void 0:T.utilization)??0}),v.jsx(id,{label:"Coverage",value:((M=e.pillars)==null?void 0:M.coverage)??0}),v.jsx(id,{label:"Behavior",value:((A=e.pillars)==null?void 0:A.behavior)??0}),v.jsx(id,{label:"Power",value:((P=e.pillars)==null?void 0:P.power)??0})]})]})]}),v.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[v.jsxs("div",{className:"bg-bg-card border border-border p-4",children:[v.jsxs("div",{className:"flex items-center gap-4 mb-3 border-b border-border",children:[v.jsx("button",{onClick:()=>d("alerts"),className:`py-2.5 -mb-px text-[10px] font-sans uppercase tracking-widest transition-colors border-b ${f==="alerts"?"border-accent text-white":"border-transparent text-[#777]"}`,children:"Active Alerts"}),v.jsx("button",{onClick:()=>d("feed"),className:`py-2.5 -mb-px text-[10px] font-sans uppercase tracking-widest transition-colors border-b ${f==="feed"?"border-accent text-white":"border-transparent text-[#777]"}`,children:"Event Feed"})]}),f==="alerts"?v.jsx(v.Fragment,{children:i.length>0?v.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:i.map((N,D)=>v.jsx(mY,{alert:N},D))}):(()=>{const N=l.filter(D=>D.severity==="immediate"||D.severity==="priority").sort((D,O)=>{const R={immediate:0,priority:1},F=(R[D.severity]??2)-(R[O.severity]??2);return F!==0?F:(O.fetched_at||0)-(D.fetched_at||0)}).slice(0,5);return N.length>0?v.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:N.map((D,O)=>{const R=D.severity==="immediate"?{bg:"bg-red-500/5",border:"border-red-500",icon:Vo,iconColor:"text-red-500"}:{bg:"bg-accent/5",border:"border-accent",icon:$a,iconColor:"text-accent"},F=R.icon;return v.jsxs("div",{className:`p-3 ${R.bg} border-l-2 ${R.border} flex items-start gap-3`,children:[v.jsx(F,{size:16,className:R.iconColor}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"px-1.5 py-0.5 text-[10px] font-sans uppercase tracking-wide bg-[#1e1e1e] text-[#777] border border-[#222]",children:"ENV"}),v.jsx("span",{className:"text-[10px] font-sans text-[#666]",children:D.severity})]}),v.jsx("div",{className:"text-sm font-sans font-medium text-white mt-1",children:D.headline}),v.jsxs("div",{className:"text-[10px] font-mono text-[#666] mt-1",children:[D.source," · ",new Date(D.fetched_at*1e3).toLocaleTimeString()]})]})]},D.event_id||O)})}):v.jsxs("div",{className:"flex items-center gap-2 text-[#777] py-4",children:[v.jsx(EM,{size:16,className:"text-green-500"}),v.jsx("span",{className:"font-sans",children:"No active alerts"})]})})()}):v.jsx(SY,{events:l,envStatus:o,embedded:!0})]}),v.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[v.jsx(Yg,{icon:Di,label:"Nodes Online",value:(e==null?void 0:e.total_nodes)||0,accent:"#22c55e",subvalue:`${(e==null?void 0:e.unlocated_count)||0} unlocated`}),v.jsx(Yg,{icon:lB,label:"Infrastructure",value:`${(e==null?void 0:e.infra_online)||0}/${(e==null?void 0:e.infra_total)||0}`,accent:"#38bdf8",subvalue:(e==null?void 0:e.infra_online)===(e==null?void 0:e.infra_total)?"All online":"Some offline"}),v.jsx(Yg,{icon:rf,label:"Utilization",value:`${((I=e==null?void 0:e.util_percent)==null?void 0:I.toFixed(1))||0}%`,accent:"#f59e0b",subvalue:`${(e==null?void 0:e.flagged_nodes)||0} flagged`}),v.jsx(Yg,{icon:nf,label:"Regions",value:(e==null?void 0:e.total_regions)||0,accent:"#333333",subvalue:`${(e==null?void 0:e.battery_warnings)||0} battery warnings`})]})]})]}),v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[v.jsxs("div",{className:"bg-bg-card border border-border p-4",children:[v.jsxs("h2",{className:"text-[10px] font-sans uppercase tracking-widest text-[#666] mb-3",children:["Mesh Sources (",v.jsx("span",{className:"font-mono",children:r.length}),")"]}),r.length>0?v.jsx("div",{className:"space-y-1",children:r.map((N,D)=>v.jsx(yY,{source:N},D))}):v.jsx("div",{className:"font-sans text-[#666] py-4",children:"No sources configured"})]}),v.jsx(xY,{bandConditions:c}),v.jsx(_Y,{})]})]})}/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var bC=function(e,t){return bC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},bC(e,t)};function q(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");bC(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var uv=function(){return uv=Object.assign||function(t){for(var r,n=1,i=arguments.length;n0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]"u"&&typeof self<"u"?Je.worker=!0:!Je.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(Je.node=!0,Je.svgSupported=!0):kY(navigator.userAgent,Je);function kY(e,t){var r=t.browser,n=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);n&&(r.firefox=!0,r.version=n[1]),i&&(r.ie=!0,r.version=i[1]),a&&(r.edge=!0,r.version=a[1],r.newEdge=+a[1].split(".")[0]>18),o&&(r.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,t.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11);var s=t.domSupported=typeof document<"u";if(s){var l=document.documentElement.style;t.transform3dSupported=(r.ie&&"transition"in l||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),t.transformSupported=t.transform3dSupported||r.ie&&+r.version>=9}}var VM=12,SB="sans-serif",Go=VM+"px "+SB,LY=20,NY=100,PY="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function IY(e){var t={};if(typeof JSON>"u")return t;for(var r=0;r=0)s=o*r.length;else for(var l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",i[u]+":0",n[1-l]+":auto",i[1-u]+":auto",""].join("!important;"),e.appendChild(o),r.push(o)}return t.clearMarkers=function(){j(r,function(c){c.parentNode&&c.parentNode.removeChild(c)})},r}function rX(e,t,r){for(var n=r?"invTrans":"trans",i=t[n],a=t.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var c=e[u].getBoundingClientRect(),h=2*u,f=c.left,d=c.top;o.push(f,d),l=l&&a&&f===a[h]&&d===a[h+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&i?i:(t.srcCoords=o,t[n]=r?UP(s,o):UP(o,s))}function DB(e){return e.nodeName.toUpperCase()==="CANVAS"}var nX=/([&<>"'])/g,iX={"&":"&","<":"<",">":">",'"':""","'":"'"};function hn(e){return e==null?"":(e+"").replace(nX,function(t,r){return iX[r]})}var aX=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Y1=[],oX=Je.browser.firefox&&+Je.browser.version.split(".")[0]<39;function MC(e,t,r,n){return r=r||{},n?ZP(e,t,r):oX&&t.layerX!=null&&t.layerX!==t.offsetX?(r.zrX=t.layerX,r.zrY=t.layerY):t.offsetX!=null?(r.zrX=t.offsetX,r.zrY=t.offsetY):ZP(e,t,r),r}function ZP(e,t,r){if(Je.domSupported&&e.getBoundingClientRect){var n=t.clientX,i=t.clientY;if(DB(e)){var a=e.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(TC(Y1,e,n,i)){r.zrX=Y1[0],r.zrY=Y1[1];return}}r.zrX=r.zrY=0}function YM(e){return e||window.event}function mi(e,t,r){if(t=YM(t),t.zrX!=null)return t;var n=t.type,i=n&&n.indexOf("touch")>=0;if(i){var o=n!=="touchend"?t.targetTouches[0]:t.changedTouches[0];o&&MC(e,o,t,r)}else{MC(e,t,t,r);var a=sX(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&aX.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function sX(e){var t=e.wheelDelta;if(t)return t;var r=e.deltaX,n=e.deltaY;if(r==null||n==null)return t;var i=Math.abs(n!==0?n:r),a=n>0?-1:n<0?1:r>0?-1:1;return 3*i*a}function AC(e,t,r,n){e.addEventListener(t,r,n)}function lX(e,t,r,n){e.removeEventListener(t,r,n)}var Wo=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function $P(e){return e.which===2||e.which===3}var uX=function(){function e(){this._track=[]}return e.prototype.recognize=function(t,r,n){return this._doTrack(t,r,n),this._recognize(t)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(t,r,n){var i=t.touches;if(i){for(var a={points:[],touches:[],target:r,event:t},o=0,s=i.length;o1&&n&&n.length>1){var a=YP(n)/YP(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=cX(n);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:e[0].target,event:t}}}}};function Pr(){return[1,0,0,1,0,0]}function zp(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function Bp(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function aa(e,t,r){var n=t[0]*r[0]+t[2]*r[1],i=t[1]*r[0]+t[3]*r[1],a=t[0]*r[2]+t[2]*r[3],o=t[1]*r[2]+t[3]*r[3],s=t[0]*r[4]+t[2]*r[5]+t[4],l=t[1]*r[4]+t[3]*r[5]+t[5];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e}function ha(e,t,r){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+r[0],e[5]=t[5]+r[1],e}function Ko(e,t,r,n){n===void 0&&(n=[0,0]);var i=t[0],a=t[2],o=t[4],s=t[1],l=t[3],u=t[5],c=Math.sin(r),h=Math.cos(r);return e[0]=i*h+s*c,e[1]=-i*c+s*h,e[2]=a*h+l*c,e[3]=-a*c+h*l,e[4]=h*(o-n[0])+c*(u-n[1])+n[0],e[5]=h*(u-n[1])-c*(o-n[0])+n[1],e}function l_(e,t,r){var n=r[0],i=r[1];return e[0]=t[0]*n,e[1]=t[1]*i,e[2]=t[2]*n,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*i,e}function ji(e,t){var r=t[0],n=t[2],i=t[4],a=t[1],o=t[3],s=t[5],l=r*o-a*n;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-n*l,e[3]=r*l,e[4]=(n*s-o*i)*l,e[5]=(a*i-r*s)*l,e):null}function EB(e){var t=Pr();return Bp(t,e),t}const hX=Object.freeze(Object.defineProperty({__proto__:null,clone:EB,copy:Bp,create:Pr,identity:zp,invert:ji,mul:aa,rotate:Ko,scale:l_,translate:ha},Symbol.toStringTag,{value:"Module"}));var Ne=function(){function e(t,r){this.x=t||0,this.y=r||0}return e.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(t,r){return this.x=t,this.y=r,this},e.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.scale=function(t){this.x*=t,this.y*=t},e.prototype.scaleAndAdd=function(t,r){this.x+=t.x*r,this.y+=t.y*r},e.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.dot=function(t){return this.x*t.x+this.y*t.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},e.prototype.distance=function(t){var r=this.x-t.x,n=this.y-t.y;return Math.sqrt(r*r+n*n)},e.prototype.distanceSquare=function(t){var r=this.x-t.x,n=this.y-t.y;return r*r+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(t){if(t){var r=this.x,n=this.y;return this.x=t[0]*r+t[2]*n+t[4],this.y=t[1]*r+t[3]*n+t[5],this}},e.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},e.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},e.set=function(t,r,n){t.x=r,t.y=n},e.copy=function(t,r){t.x=r.x,t.y=r.y},e.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.lenSquare=function(t){return t.x*t.x+t.y*t.y},e.dot=function(t,r){return t.x*r.x+t.y*r.y},e.add=function(t,r,n){t.x=r.x+n.x,t.y=r.y+n.y},e.sub=function(t,r,n){t.x=r.x-n.x,t.y=r.y-n.y},e.scale=function(t,r,n){t.x=r.x*n,t.y=r.y*n},e.scaleAndAdd=function(t,r,n,i){t.x=r.x+n.x*i,t.y=r.y+n.y*i},e.lerp=function(t,r,n,i){var a=1-i;t.x=a*r.x+i*n.x,t.y=a*r.y+i*n.y},e}(),cu=Math.min,ah=Math.max,kC=Math.abs,XP=["x","y"],fX=["width","height"],wl=new Ne,Sl=new Ne,Cl=new Ne,Tl=new Ne,Yn=jB(),Vd=Yn.minTv,LC=Yn.maxTv,dv=[0,0],Pe=function(){function e(t,r,n,i){e.set(this,t,r,n,i)}return e.set=function(t,r,n,i,a){return i<0&&(r=r+i,i=-i),a<0&&(n=n+a,a=-a),t.x=r,t.y=n,t.width=i,t.height=a,t},e.prototype.union=function(t){var r=cu(t.x,this.x),n=cu(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=ah(t.x+t.width,this.x+this.width)-r:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=ah(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=r,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(t){var r=this,n=t.width/r.width,i=t.height/r.height,a=Pr();return ha(a,a,[-r.x,-r.y]),l_(a,a,[n,i]),ha(a,a,[t.x,t.y]),a},e.prototype.intersect=function(t,r,n){return e.intersect(this,t,r,n)},e.intersect=function(t,r,n,i){n&&Ne.set(n,0,0);var a=i&&i.outIntersectRect||null,o=i&&i.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!t||!r)return!1;t instanceof e||(t=e.set(dX,t.x,t.y,t.width,t.height)),r instanceof e||(r=e.set(vX,r.x,r.y,r.width,r.height));var s=!!n;Yn.reset(i,s);var l=Yn.touchThreshold,u=t.x+l,c=t.x+t.width-l,h=t.y+l,f=t.y+t.height-l,d=r.x+l,g=r.x+r.width-l,m=r.y+l,y=r.y+r.height-l;if(u>c||h>f||d>g||m>y)return!1;var x=!(c=t.x&&r<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},e.prototype.contain=function(t,r){return e.contain(this,t,r)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(t,r){return t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height,t},e.applyTransform=function(t,r,n){if(!n){t!==r&&e.copy(t,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var i=n[0],a=n[3],o=n[4],s=n[5];t.x=r.x*i+o,t.y=r.y*a+s,t.width=r.width*i,t.height=r.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}wl.x=Cl.x=r.x,wl.y=Tl.y=r.y,Sl.x=Tl.x=r.x+r.width,Sl.y=Cl.y=r.y+r.height,wl.transform(n),Tl.transform(n),Sl.transform(n),Cl.transform(n),t.x=cu(wl.x,Sl.x,Cl.x,Tl.x),t.y=cu(wl.y,Sl.y,Cl.y,Tl.y);var l=ah(wl.x,Sl.x,Cl.x,Tl.x),u=ah(wl.y,Sl.y,Cl.y,Tl.y);t.width=l-t.x,t.height=u-t.y},e}(),dX=new Pe(0,0,0,0),vX=new Pe(0,0,0,0);function qP(e,t,r,n,i,a,o,s){var l=kC(t-r),u=kC(n-e),c=cu(l,u),h=XP[i],f=XP[1-i],d=fX[i];t=u||!Yn.bidirectional)&&(Vd[h]=-u,Vd[f]=0,Yn.useDir&&Yn.calcDirMTV())))}function jB(){var e=0,t=new Ne,r=new Ne,n={minTv:new Ne,maxTv:new Ne,useDir:!1,dirMinTv:new Ne,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,o){n.touchThreshold=0,a&&a.touchThreshold!=null&&(n.touchThreshold=ah(0,a.touchThreshold)),n.negativeSize=!1,o&&(n.minTv.set(1/0,1/0),n.maxTv.set(0,0),n.useDir=!1,a&&a.direction!=null&&(n.useDir=!0,n.dirMinTv.copy(n.minTv),r.copy(n.minTv),e=a.direction,n.bidirectional=a.bidirectional==null||!!a.bidirectional,n.bidirectional||t.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var a=n.minTv,o=n.dirMinTv,s=a.y*a.y+a.x*a.x,l=Math.sin(e),u=Math.cos(e),c=l*a.y+u*a.x;if(i(c)){i(a.x)&&i(a.y)&&o.set(0,0);return}if(r.x=s*u/c,r.y=s*l/c,i(r.x)&&i(r.y)){o.set(0,0);return}(n.bidirectional||t.dot(r)>0)&&r.len()=0;h--){var f=a[h];f!==i&&!f.ignore&&!f.ignoreCoarsePointer&&(!f.parent||!f.parent.ignoreCoarsePointer)&&(q1.copy(f.getBoundingRect()),f.transform&&q1.applyTransform(f.transform),q1.intersect(c)&&s.push(f))}if(s.length)for(var d=4,g=Math.PI/12,m=Math.PI*2,y=0;y4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function xX(e,t,r){if(e[e.rectHover?"rectContain":"contain"](t,r)){for(var n=e,i=void 0,a=!1;n;){if(n.ignoreClip&&(a=!0),!a){var o=n.getClipPath();if(o&&!o.contain(t,r))return!1}n.silent&&(i=!0);var s=n.__hostTarget;n=s?n.ignoreHostSilent?null:s:n.parent}return i?RB:!0}return!1}function KP(e,t,r,n,i){for(var a=e.length-1;a>=0;a--){var o=e[a],s=void 0;if(o!==i&&!o.ignore&&(s=xX(o,r,n))&&(!t.topTarget&&(t.topTarget=o),s!==RB)){t.target=o;break}}}function zB(e,t,r){var n=e.painter;return t<0||t>n.getWidth()||r<0||r>n.getHeight()}var BB=32,od=7;function _X(e){for(var t=0;e>=BB;)t|=e&1,e>>=1;return e+t}function JP(e,t,r,n){var i=t+1;if(i===r)return 1;if(n(e[i++],e[t])<0){for(;i=0;)i++;return i-t}function bX(e,t,r){for(r--;t>>1,i(a,e[l])<0?s=l:o=l+1;var u=n-o;switch(u){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;u>0;)e[o+u]=e[o+u-1],u--}e[o]=a}}function K1(e,t,r,n,i,a){var o=0,s=0,l=1;if(a(e,t[r+i])>0){for(s=n-i;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}else{for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}for(o++;o>>1);a(e,t[r+c])>0?o=c+1:l=c}return l}function J1(e,t,r,n,i,a){var o=0,s=0,l=1;if(a(e,t[r+i])<0){for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}else{for(s=n-i;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}for(o++;o>>1);a(e,t[r+c])<0?l=c:o=c+1}return l}function wX(e,t){var r=od,n,i,a=0,o=[];n=[],i=[];function s(d,g){n[a]=d,i[a]=g,a+=1}function l(){for(;a>1;){var d=a-2;if(d>=1&&i[d-1]<=i[d]+i[d+1]||d>=2&&i[d-2]<=i[d]+i[d-1])i[d-1]i[d+1])break;c(d)}}function u(){for(;a>1;){var d=a-2;d>0&&i[d-1]=od||A>=od);if(P)break;T<0&&(T=0),T+=2}if(r=T,r<1&&(r=1),g===1){for(x=0;x=0;x--)e[M+x]=e[T+x];e[S]=o[w];return}for(var A=r;;){var P=0,I=0,N=!1;do if(t(o[w],e[_])<0){if(e[S--]=e[_--],P++,I=0,--g===0){N=!0;break}}else if(e[S--]=o[w--],I++,P=0,--y===1){N=!0;break}while((P|I)=0;x--)e[M+x]=e[T+x];if(g===0){N=!0;break}}if(e[S--]=o[w--],--y===1){N=!0;break}if(I=y-K1(e[_],o,0,y,y-1,t),I!==0){for(S-=I,w-=I,y-=I,M=S+1,T=w+1,x=0;x=od||I>=od);if(N)break;A<0&&(A=0),A+=2}if(r=A,r<1&&(r=1),y===1){for(S-=g,_-=g,M=S+1,T=_+1,x=g-1;x>=0;x--)e[M+x]=e[T+x];e[S]=o[w]}else{if(y===0)throw new Error;for(T=S-(y-1),x=0;xs&&(l=s),QP(e,r,r+l,r+a,t),a=l}o.pushRun(r,a),o.mergeRuns(),i-=a,r+=a}while(i!==0);o.forceMergeRuns()}}var Xn=1,Gd=2,Wc=4,eI=!1;function Q1(){eI||(eI=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function tI(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var SX=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=tI}return e.prototype.traverse=function(t,r){for(var n=0;n=0&&this._roots.splice(i,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}(),w0;w0=Je.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var vv={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},exponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)))},elasticOut:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/n)+1)},elasticInOut:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?-.5*(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)):r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-vv.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?vv.bounceIn(e*2)*.5:vv.bounceOut(e*2-1)*.5+.5}},qg=Math.pow,Gs=Math.sqrt,S0=1e-8,FB=1e-4,rI=Gs(3),Kg=1/3,Ia=cl(),Si=cl(),xh=cl();function Ms(e){return e>-S0&&eS0||e<-S0}function kr(e,t,r,n,i){var a=1-i;return a*a*(a*e+3*i*t)+i*i*(i*n+3*a*r)}function nI(e,t,r,n,i){var a=1-i;return 3*(((t-e)*a+2*(r-t)*i)*a+(n-r)*i*i)}function C0(e,t,r,n,i,a){var o=n+3*(t-r)-e,s=3*(r-t*2+e),l=3*(t-e),u=e-i,c=s*s-3*o*l,h=s*l-9*o*u,f=l*l-3*s*u,d=0;if(Ms(c)&&Ms(h))if(Ms(s))a[0]=0;else{var g=-l/s;g>=0&&g<=1&&(a[d++]=g)}else{var m=h*h-4*c*f;if(Ms(m)){var y=h/c,g=-s/o+y,x=-y/2;g>=0&&g<=1&&(a[d++]=g),x>=0&&x<=1&&(a[d++]=x)}else if(m>0){var _=Gs(m),w=c*s+1.5*o*(-h+_),S=c*s+1.5*o*(-h-_);w<0?w=-qg(-w,Kg):w=qg(w,Kg),S<0?S=-qg(-S,Kg):S=qg(S,Kg);var g=(-s-(w+S))/(3*o);g>=0&&g<=1&&(a[d++]=g)}else{var T=(2*c*s-3*o*h)/(2*Gs(c*c*c)),M=Math.acos(T)/3,A=Gs(c),P=Math.cos(M),g=(-s-2*A*P)/(3*o),x=(-s+A*(P+rI*Math.sin(M)))/(3*o),I=(-s+A*(P-rI*Math.sin(M)))/(3*o);g>=0&&g<=1&&(a[d++]=g),x>=0&&x<=1&&(a[d++]=x),I>=0&&I<=1&&(a[d++]=I)}}return d}function GB(e,t,r,n,i){var a=6*r-12*t+6*e,o=9*t+3*n-3*e-9*r,s=3*t-3*e,l=0;if(Ms(o)){if(VB(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var c=a*a-4*o*s;if(Ms(c))i[0]=-a/(2*o);else if(c>0){var h=Gs(c),u=(-a+h)/(2*o),f=(-a-h)/(2*o);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function Qs(e,t,r,n,i,a){var o=(t-e)*i+e,s=(r-t)*i+t,l=(n-r)*i+r,u=(s-o)*i+o,c=(l-s)*i+s,h=(c-u)*i+u;a[0]=e,a[1]=o,a[2]=u,a[3]=h,a[4]=h,a[5]=c,a[6]=l,a[7]=n}function WB(e,t,r,n,i,a,o,s,l,u,c){var h,f=.005,d=1/0,g,m,y,x;Ia[0]=l,Ia[1]=u;for(var _=0;_<1;_+=.05)Si[0]=kr(e,r,i,o,_),Si[1]=kr(t,n,a,s,_),y=Vs(Ia,Si),y=0&&y=0&&u<=1&&(i[l++]=u)}}else{var c=o*o-4*a*s;if(Ms(c)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(c>0){var h=Gs(c),u=(-o+h)/(2*a),f=(-o-h)/(2*a);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function HB(e,t,r){var n=e+r-2*t;return n===0?.5:(e-t)/n}function qv(e,t,r,n,i){var a=(t-e)*n+e,o=(r-t)*n+t,s=(o-a)*n+a;i[0]=e,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=r}function UB(e,t,r,n,i,a,o,s,l){var u,c=.005,h=1/0;Ia[0]=o,Ia[1]=s;for(var f=0;f<1;f+=.05){Si[0]=Br(e,r,i,f),Si[1]=Br(t,n,a,f);var d=Vs(Ia,Si);d=0&&d=1?1:C0(0,n,a,1,l,s)&&kr(0,i,o,1,s[0])}}}var kX=function(){function e(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||qt,this.ondestroy=t.ondestroy||qt,this.onrestart=t.onrestart||qt,t.easing&&this.setEasing(t.easing)}return e.prototype.step=function(t,r){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var n=this._life,i=t-this._startTime-this._pausedTime,a=i/n;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=i%n;this._startTime=t-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(t){this.easing=t,this.easingFunc=we(t)?t:vv[t]||XM(t)},e}(),ZB=function(){function e(t){this.value=t}return e}(),LX=function(){function e(){this._len=0}return e.prototype.insert=function(t){var r=new ZB(t);return this.insertEntry(r),r},e.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},e.prototype.remove=function(t){var r=t.prev,n=t.next;r?r.next=n:this.head=n,n?n.prev=r:this.tail=r,t.next=t.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),jh=function(){function e(t){this._list=new LX,this._maxSize=10,this._map={},this._maxSize=t}return e.prototype.put=function(t,r){var n=this._list,i=this._map,a=null;if(i[t]==null){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new ZB(r),s.key=t,n.insertEntry(s),i[t]=s}return a},e.prototype.get=function(t){var r=this._map[t],n=this._list;if(r!=null)return r!==n.tail&&(n.remove(r),n.insertEntry(r)),r.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),iI={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function oa(e){return e=Math.round(e),e<0?0:e>255?255:e}function NX(e){return e=Math.round(e),e<0?0:e>360?360:e}function Kv(e){return e<0?0:e>1?1:e}function Cy(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?oa(parseFloat(t)/100*255):oa(parseInt(t,10))}function Po(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?Kv(parseFloat(t)/100):Kv(parseFloat(t))}function eb(e,t,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?e+(t-e)*r*6:r*2<1?t:r*3<2?e+(t-e)*(2/3-r)*6:e}function As(e,t,r){return e+(t-e)*r}function gi(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}function PC(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var $B=new jh(20),Jg=null;function mc(e,t){Jg&&PC(Jg,t),Jg=$B.put(e,Jg||t.slice())}function fn(e,t){if(e){t=t||[];var r=$B.get(e);if(r)return PC(t,r);e=e+"";var n=e.replace(/ /g,"").toLowerCase();if(n in iI)return PC(t,iI[n]),mc(e,t),t;var i=n.length;if(n.charAt(0)==="#"){if(i===4||i===5){var a=parseInt(n.slice(1,4),16);if(!(a>=0&&a<=4095)){gi(t,0,0,0,1);return}return gi(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(n.slice(4),16)/15:1),mc(e,t),t}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){gi(t,0,0,0,1);return}return gi(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),mc(e,t),t}return}var o=n.indexOf("("),s=n.indexOf(")");if(o!==-1&&s+1===i){var l=n.substr(0,o),u=n.substr(o+1,s-(o+1)).split(","),c=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?gi(t,+u[0],+u[1],+u[2],1):gi(t,0,0,0,1);c=Po(u.pop());case"rgb":if(u.length>=3)return gi(t,Cy(u[0]),Cy(u[1]),Cy(u[2]),u.length===3?c:Po(u[3])),mc(e,t),t;gi(t,0,0,0,1);return;case"hsla":if(u.length!==4){gi(t,0,0,0,1);return}return u[3]=Po(u[3]),IC(u,t),mc(e,t),t;case"hsl":if(u.length!==3){gi(t,0,0,0,1);return}return IC(u,t),mc(e,t),t;default:return}}gi(t,0,0,0,1)}}function IC(e,t){var r=(parseFloat(e[0])%360+360)%360/360,n=Po(e[1]),i=Po(e[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return t=t||[],gi(t,oa(eb(o,a,r+1/3)*255),oa(eb(o,a,r)*255),oa(eb(o,a,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function PX(e){if(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=a-i,s=(a+i)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+i):u=o/(2-a-i);var c=((a-t)/6+o/2)/o,h=((a-r)/6+o/2)/o,f=((a-n)/6+o/2)/o;t===a?l=f-h:r===a?l=1/3+c-f:n===a&&(l=2/3+h-c),l<0&&(l+=1),l>1&&(l-=1)}var d=[l*360,u,s];return e[3]!=null&&d.push(e[3]),d}}function T0(e,t){var r=fn(e);if(r){for(var n=0;n<3;n++)t<0?r[n]=r[n]*(1-t)|0:r[n]=(255-r[n])*t+r[n]|0,r[n]>255?r[n]=255:r[n]<0&&(r[n]=0);return Li(r,r.length===4?"rgba":"rgb")}}function IX(e){var t=fn(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}function pv(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){r=r||[];var n=e*(t.length-1),i=Math.floor(n),a=Math.ceil(n),o=t[i],s=t[a],l=n-i;return r[0]=oa(As(o[0],s[0],l)),r[1]=oa(As(o[1],s[1],l)),r[2]=oa(As(o[2],s[2],l)),r[3]=Kv(As(o[3],s[3],l)),r}}var DX=pv;function qM(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){var n=e*(t.length-1),i=Math.floor(n),a=Math.ceil(n),o=fn(t[i]),s=fn(t[a]),l=n-i,u=Li([oa(As(o[0],s[0],l)),oa(As(o[1],s[1],l)),oa(As(o[2],s[2],l)),Kv(As(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}var EX=qM;function Io(e,t,r,n){var i=fn(e);if(e)return i=PX(i),t!=null&&(i[0]=NX(we(t)?t(i[0]):t)),r!=null&&(i[1]=Po(we(r)?r(i[1]):r)),n!=null&&(i[2]=Po(we(n)?n(i[2]):n)),Li(IC(i),"rgba")}function Jv(e,t){var r=fn(e);if(r&&t!=null)return r[3]=Kv(t),Li(r,"rgba")}function Li(e,t){if(!(!e||!e.length)){var r=e[0]+","+e[1]+","+e[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(r+=","+e[3]),t+"("+r+")"}}function Qv(e,t){var r=fn(e);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*t:0}function jX(){return Li([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var aI=new jh(100);function M0(e){if(he(e)){var t=aI.get(e);return t||(t=T0(e,-.1),aI.put(e,t)),t}else if(jp(e)){var r=Q({},e);return r.colorStops=ae(e.colorStops,function(n){return{offset:n.offset,color:T0(n.color,-.1)}}),r}return e}const RX=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:pv,fastMapToColor:DX,lerp:qM,lift:T0,liftColor:M0,lum:Qv,mapToColor:EX,modifyAlpha:Jv,modifyHSL:Io,parse:fn,parseCssFloat:Po,parseCssInt:Cy,random:jX,stringify:Li,toHex:IX},Symbol.toStringTag,{value:"Module"}));var A0=Math.round;function ep(e){var t;if(!e||e==="transparent")e="none";else if(typeof e=="string"&&e.indexOf("rgba")>-1){var r=fn(e);r&&(e="rgb("+r[0]+","+r[1]+","+r[2]+")",t=r[3])}return{color:e,opacity:t??1}}var oI=1e-4;function ks(e){return e-oI}function Qg(e){return A0(e*1e3)/1e3}function DC(e){return A0(e*1e4)/1e4}function OX(e){return"matrix("+Qg(e[0])+","+Qg(e[1])+","+Qg(e[2])+","+Qg(e[3])+","+DC(e[4])+","+DC(e[5])+")"}var zX={left:"start",right:"end",center:"middle",middle:"middle"};function BX(e,t,r){return r==="top"?e+=t/2:r==="bottom"&&(e-=t/2),e}function FX(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function VX(e){var t=e.style,r=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),r[0],r[1]].join(",")}function YB(e){return e&&!!e.image}function GX(e){return e&&!!e.svgElement}function KM(e){return YB(e)||GX(e)}function XB(e){return e.type==="linear"}function qB(e){return e.type==="radial"}function KB(e){return e&&(e.type==="linear"||e.type==="radial")}function u_(e){return"url(#"+e+")"}function JB(e){var t=e.getGlobalScale(),r=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(r)/Math.log(10)),1)}function QB(e){var t=e.x||0,r=e.y||0,n=(e.rotation||0)*cv,i=be(e.scaleX,1),a=be(e.scaleY,1),o=e.skewX||0,s=e.skewY||0,l=[];return(t||r)&&l.push("translate("+t+"px,"+r+"px)"),n&&l.push("rotate("+n+")"),(i!==1||a!==1)&&l.push("scale("+i+","+a+")"),(o||s)&&l.push("skew("+A0(o*cv)+"deg, "+A0(s*cv)+"deg)"),l.join(" ")}var WX=function(){return Je.hasGlobalWindow&&we(window.btoa)?function(e){return window.btoa(unescape(encodeURIComponent(e)))}:typeof Buffer<"u"?function(e){return Buffer.from(e).toString("base64")}:function(e){return null}}(),EC=Array.prototype.slice;function xo(e,t,r){return(t-e)*r+e}function tb(e,t,r,n){for(var i=t.length,a=0;an?t:e,a=Math.min(r,n),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)n.length=o;else for(var l=a;l=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(t,r,n){this._needsSort=!0;var i=this.keyframes,a=i.length,o=!1,s=lI,l=r;if(Kr(r)){var u=$X(r);s=u,(u===1&&!rt(r[0])||u===2&&!rt(r[0][0]))&&(o=!0)}else if(rt(r)&&!Xr(r))s=tm;else if(he(r))if(!isNaN(+r))s=tm;else{var c=fn(r);c&&(l=c,s=Wd)}else if(jp(r)){var h=Q({},l);h.colorStops=ae(r.colorStops,function(d){return{offset:d.offset,color:fn(d.color)}}),XB(r)?s=jC:qB(r)&&(s=RC),l=h}a===0?this.valType=s:(s!==this.valType||s===lI)&&(o=!0),this.discrete=this.discrete||o;var f={time:t,value:l,rawValue:r,percent:0};return n&&(f.easing=n,f.easingFunc=we(n)?n:vv[n]||XM(n)),i.push(f),f},e.prototype.prepare=function(t,r){var n=this.keyframes;this._needsSort&&n.sort(function(m,y){return m.time-y.time});for(var i=this.valType,a=n.length,o=n[a-1],s=this.discrete,l=rm(i),u=uI(i),c=0;c=0&&!(o[c].percent<=r);c--);c=f(c,s-2)}else{for(c=h;cr);c++);c=f(c-1,s-2)}g=o[c+1],d=o[c]}if(d&&g){this._lastFr=c,this._lastFrP=r;var y=g.percent-d.percent,x=y===0?1:f((r-d.percent)/y,1);g.easingFunc&&(x=g.easingFunc(x));var _=n?this._additiveValue:u?sd:t[l];if((rm(a)||u)&&!_&&(_=this._additiveValue=[]),this.discrete)t[l]=x<1?d.rawValue:g.rawValue;else if(rm(a))a===My?tb(_,d[i],g[i],x):HX(_,d[i],g[i],x);else if(uI(a)){var w=d[i],S=g[i],T=a===jC;t[l]={type:T?"linear":"radial",x:xo(w.x,S.x,x),y:xo(w.y,S.y,x),colorStops:ae(w.colorStops,function(A,P){var I=S.colorStops[P];return{offset:xo(A.offset,I.offset,x),color:Ty(tb([],A.color,I.color,x))}}),global:S.global},T?(t[l].x2=xo(w.x2,S.x2,x),t[l].y2=xo(w.y2,S.y2,x)):t[l].r=xo(w.r,S.r,x)}else if(u)tb(_,d[i],g[i],x),n||(t[l]=Ty(_));else{var M=xo(d[i],g[i],x);n?this._additiveValue=M:t[l]=M}n&&this._addToTarget(t)}}},e.prototype._addToTarget=function(t){var r=this.valType,n=this.propName,i=this._additiveValue;r===tm?t[n]=t[n]+i:r===Wd?(fn(t[n],sd),em(sd,sd,i,1),t[n]=Ty(sd)):r===My?em(t[n],t[n],i,1):r===eF&&sI(t[n],t[n],i,1)},e}(),JM=function(){function e(t,r,n,i){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=r,r&&i){i_("Can' use additive animation on looped animation.");return}this._additiveAnimators=i,this._allowDiscrete=n}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(t){this._target=t},e.prototype.when=function(t,r,n){return this.whenWithKeys(t,r,Qe(r),n)},e.prototype.whenWithKeys=function(t,r,n,i){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,gv(u),i),this._trackKeys.push(s)}l.addKeyframe(t,gv(r[s]),i)}return this._maxTime=Math.max(this._maxTime,t),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var r=t.length,n=0;n0)){this._started=1;for(var r=this,n=[],i=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,t[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},e}();function oh(){return new Date().getTime()}var XX=function(e){q(t,e);function t(r){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,r=r||{},n.stage=r.stage||{},n}return t.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},t.prototype.addAnimator=function(r){r.animation=this;var n=r.getClip();n&&this.addClip(n)},t.prototype.removeClip=function(r){if(r.animation){var n=r.prev,i=r.next;n?n.next=i:this._head=i,i?i.prev=n:this._tail=n,r.next=r.prev=r.animation=null}},t.prototype.removeAnimator=function(r){var n=r.getClip();n&&this.removeClip(n),r.animation=null},t.prototype.update=function(r){for(var n=oh()-this._pausedTime,i=n-this._time,a=this._head;a;){var o=a.next,s=a.step(n,i);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=n,r||(this.trigger("frame",i),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var r=this;this._running=!0;function n(){r._running&&(w0(n),!r._paused&&r.update())}w0(n)},t.prototype.start=function(){this._running||(this._time=oh(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=oh(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=oh()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var r=this._head;r;){var n=r.next;r.prev=r.next=r.animation=null,r=n}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(r,n){n=n||{},this.start();var i=new JM(r,n.loop);return this.addAnimator(i),i},t}(Bi),qX=300,rb=Je.domSupported,nb=function(){var e=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},n=ae(e,function(i){var a=i.replace("mouse","pointer");return r.hasOwnProperty(a)?a:i});return{mouse:e,touch:t,pointer:n}}(),cI={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},hI=!1;function OC(e){var t=e.pointerType;return t==="pen"||t==="touch"}function KX(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function ib(e){e&&(e.zrByTouch=!0)}function JX(e,t){return mi(e.dom,new QX(e,t),!0)}function tF(e,t){for(var r=t,n=!1;r&&r.nodeType!==9&&!(n=r.domBelongToZr||r!==t&&r===e.painterRoot);)r=r.parentNode;return n}var QX=function(){function e(t,r){this.stopPropagation=qt,this.stopImmediatePropagation=qt,this.preventDefault=qt,this.type=r.type,this.target=this.currentTarget=t.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return e}(),Xi={mousedown:function(e){e=mi(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=mi(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=mi(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){e=mi(this.dom,e);var t=e.toElement||e.relatedTarget;tF(this,t)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){hI=!0,e=mi(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){hI||(e=mi(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){e=mi(this.dom,e),ib(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),Xi.mousemove.call(this,e),Xi.mousedown.call(this,e)},touchmove:function(e){e=mi(this.dom,e),ib(e),this.handler.processGesture(e,"change"),Xi.mousemove.call(this,e)},touchend:function(e){e=mi(this.dom,e),ib(e),this.handler.processGesture(e,"end"),Xi.mouseup.call(this,e),+new Date-+this.__lastTouchMomentvI||e<-vI}var Al=[],yc=[],ob=Pr(),sb=Math.abs,ko=function(){function e(){}return e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},e.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},e.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},e.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},e.prototype.needLocalTransform=function(){return Ml(this.rotation)||Ml(this.x)||Ml(this.y)||Ml(this.scaleX-1)||Ml(this.scaleY-1)||Ml(this.skewX)||Ml(this.skewY)},e.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||t)){n&&(dI(n),this.invTransform=null);return}n=n||Pr(),r?this.getLocalTransform(n):dI(n),t&&(r?aa(n,t,n):Bp(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)},e.prototype._resolveGlobalScaleRatio=function(t){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Al);var n=Al[0]<0?-1:1,i=Al[1]<0?-1:1,a=((Al[0]-n)*r+n)/Al[0]||0,o=((Al[1]-i)*r+i)/Al[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||Pr(),ji(this.invTransform,t)},e.prototype.getComputedTransform=function(){for(var t=this,r=[];t;)r.push(t),t=t.parent;for(;t=r.pop();)t.updateTransform();return this.transform},e.prototype.setLocalTransform=function(t){if(t){var r=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),a=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(a),r=Math.sqrt(r),this.skewX=a,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=r,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,r=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||Pr(),aa(yc,t.invTransform,r),r=yc);var n=this.originX,i=this.originY;(n||i)&&(ob[4]=n,ob[5]=i,aa(yc,r,ob),yc[4]-=n,yc[5]-=i,r=yc),this.setLocalTransform(r)}},e.prototype.getGlobalScale=function(t){var r=this.transform;return t=t||[],r?(t[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),t[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(t[0]=-t[0]),r[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},e.prototype.transformCoordToLocal=function(t,r){var n=[t,r],i=this.invTransform;return i&&Kt(n,n,i),n},e.prototype.transformCoordToGlobal=function(t,r){var n=[t,r],i=this.transform;return i&&Kt(n,n,i),n},e.prototype.getLineScale=function(){var t=this.transform;return t&&sb(t[0]-1)>1e-10&&sb(t[3]-1)>1e-10?Math.sqrt(sb(t[0]*t[3]-t[2]*t[1])):1},e.prototype.copyTransform=function(t){L0(this,t)},e.getLocalTransform=function(t,r){r=r||[];var n=t.originX||0,i=t.originY||0,a=t.scaleX,o=t.scaleY,s=t.anchorX,l=t.anchorY,u=t.rotation||0,c=t.x,h=t.y,f=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||s||l){var g=n+s,m=i+l;r[4]=-g*a-f*m*o,r[5]=-m*o-d*g*a}else r[4]=r[5]=0;return r[0]=a,r[3]=o,r[1]=d*a,r[2]=f*o,u&&Ko(r,r,u),r[4]+=n+c,r[5]+=i+h,r},e.initDefaultProps=function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0}(),e}(),Ya=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function L0(e,t){for(var r=0;r=pI)){e=e||Go;for(var t=[],r=+new Date,n=0;n<=127;n++)t[n]=Bn.measureText(String.fromCharCode(n),e).width;var i=+new Date-r;return i>16?lb=pI:i>2&&lb++,t}}var lb=0,pI=5;function nF(e,t){return e.asciiWidthMapTried||(e.asciiWidthMap=iq(e.font),e.asciiWidthMapTried=!0),0<=t&&t<=127?e.asciiWidthMap!=null?e.asciiWidthMap[t]:e.asciiCharWidth:e.stWideCharWidth}function Ha(e,t){var r=e.strWidthCache,n=r.get(t);return n==null&&(n=Bn.measureText(t,e.font).width,r.put(t,n)),n}function gI(e,t,r,n){var i=Ha(Wa(t),e),a=Fp(t),o=Rh(0,i,r),s=xu(0,a,n),l=new Pe(o,s,i,a);return l}function c_(e,t,r,n){var i=((e||"")+"").split(` -`),a=i.length;if(a===1)return gI(i[0],t,r,n);for(var o=new Pe(0,0,0,0),s=0;s=0?parseFloat(e)/100*t:parseFloat(e):e}function N0(e,t,r){var n=t.position||"inside",i=t.distance!=null?t.distance:5,a=r.height,o=r.width,s=a/2,l=r.x,u=r.y,c="left",h="top";if(n instanceof Array)l+=fa(n[0],r.width),u+=fa(n[1],r.height),c=null,h=null;else switch(n){case"left":l-=i,u+=s,c="right",h="middle";break;case"right":l+=i+o,u+=s,h="middle";break;case"top":l+=o/2,u-=i,c="center",h="bottom";break;case"bottom":l+=o/2,u+=a+i,c="center";break;case"inside":l+=o/2,u+=s,c="center",h="middle";break;case"insideLeft":l+=i,u+=s,h="middle";break;case"insideRight":l+=o-i,u+=s,c="right",h="middle";break;case"insideTop":l+=o/2,u+=i,c="center";break;case"insideBottom":l+=o/2,u+=a-i,c="center",h="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=o-i,u+=i,c="right";break;case"insideBottomLeft":l+=i,u+=a-i,h="bottom";break;case"insideBottomRight":l+=o-i,u+=a-i,c="right",h="bottom";break}return e=e||{},e.x=l,e.y=u,e.align=c,e.verticalAlign=h,e}var ub="__zr_normal__",cb=Ya.concat(["ignore"]),aq=Ei(Ya,function(e,t){return e[t]=!0,e},{ignore:!1}),xc={},oq=new Pe(0,0,0,0),im=[],h_=function(){function e(t){this.id=HM(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return e.prototype._init=function(t){this.attr(t)},e.prototype.drift=function(t,r,n){switch(this.draggable){case"horizontal":r=0;break;case"vertical":t=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=r,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(t){var r=this._textContent;if(r&&(!r.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,a=r.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=i?this:null;var u=!1;a.copyTransform(r);var c=n.position!=null,h=n.autoOverflowArea,f=void 0;if((h||c)&&(f=oq,n.layoutRect?f.copy(n.layoutRect):f.copy(this.getBoundingRect()),i||f.applyTransform(this.transform)),c){this.calculateTextPosition?this.calculateTextPosition(xc,n,f):N0(xc,n,f),a.x=xc.x,a.y=xc.y,o=xc.align,s=xc.verticalAlign;var d=n.origin;if(d&&n.rotation!=null){var g=void 0,m=void 0;d==="center"?(g=f.width*.5,m=f.height*.5):(g=fa(d[0],f.width),m=fa(d[1],f.height)),u=!0,a.originX=-a.x+g+(i?0:f.x),a.originY=-a.y+m+(i?0:f.y)}}n.rotation!=null&&(a.rotation=n.rotation);var y=n.offset;y&&(a.x+=y[0],a.y+=y[1],u||(a.originX=-y[0],a.originY=-y[1]));var x=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(h){var _=x.overflowRect=x.overflowRect||new Pe(0,0,0,0);a.getLocalTransform(im),ji(im,im),Pe.copy(_,f),_.applyTransform(im)}else x.overflowRect=null;var w=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,S=void 0,T=void 0,M=void 0;w&&this.canBeInsideText()?(S=n.insideFill,T=n.insideStroke,(S==null||S==="auto")&&(S=this.getInsideTextFill()),(T==null||T==="auto")&&(T=this.getInsideTextStroke(S),M=!0)):(S=n.outsideFill,T=n.outsideStroke,(S==null||S==="auto")&&(S=this.getOutsideFill()),(T==null||T==="auto")&&(T=this.getOutsideStroke(S),M=!0)),S=S||"#000",(S!==x.fill||T!==x.stroke||M!==x.autoStroke||o!==x.align||s!==x.verticalAlign)&&(l=!0,x.fill=S,x.stroke=T,x.autoStroke=M,x.align=o,x.verticalAlign=s,r.setDefaultTextStyle(x)),r.__dirty|=Xn,l&&r.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(t){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?VC:FC},e.prototype.getOutsideStroke=function(t){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&fn(r);n||(n=[255,255,255,1]);for(var i=n[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(a?0:255)*(1-i);return n[3]=1,Li(n,"rgba")},e.prototype.traverse=function(t,r){},e.prototype.attrKV=function(t,r){t==="textConfig"?this.setTextConfig(r):t==="textContent"?this.setTextContent(r):t==="clipPath"?this.setClipPath(r):t==="extra"?(this.extra=this.extra||{},Q(this.extra,r)):this[t]=r},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(t,r){if(typeof t=="string")this.attrKV(t,r);else if(ke(t))for(var n=t,i=Qe(n),a=0;a0},e.prototype.getState=function(t){return this.states[t]},e.prototype.ensureState=function(t){var r=this.states;return r[t]||(r[t]={}),r[t]},e.prototype.clearStates=function(t){this.useState(ub,!1,t)},e.prototype.useState=function(t,r,n,i){var a=t===ub,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(Ve(s,t)>=0&&(r||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(t)),u||(u=this.states&&this.states[t]),!u&&!a){i_("State "+t+" not exists.");return}a||this.saveCurrentToNormalState(u);var c=!!(u&&u.hoverLayer||i);c&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,u,this._normalState,r,!n&&!this.__inHover&&l&&l.duration>0,l);var h=this._textContent,f=this._textGuide;return h&&h.useState(t,r,n,c),f&&f.useState(t,r,n,c),a?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Xn),u}}},e.prototype.useStates=function(t,r,n){if(!t.length)this.clearStates();else{var i=[],a=this.currentStates,o=t.length,s=o===a.length;if(s){for(var l=0;l0,g);var m=this._textContent,y=this._textGuide;m&&m.useStates(t,r,f),y&&y.useStates(t,r,f),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Xn)}},e.prototype.isSilent=function(){for(var t=this;t;){if(t.silent)return!0;var r=t.__hostTarget;t=r?t.ignoreHostSilent?null:r:t.parent}return!1},e.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(r,1),this.useStates(n)}},e.prototype.replaceState=function(t,r,n){var i=this.currentStates.slice(),a=Ve(i,t),o=Ve(i,r)>=0;a>=0?o?i.splice(a,1):i[a]=r:n&&!o&&i.push(r),this.useStates(i)},e.prototype.toggleState=function(t,r){r?this.useState(t,!0):this.removeState(t)},e.prototype._mergeStates=function(t){for(var r={},n,i=0;i=0&&a.splice(o,1)}),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(t){this.markRedraw()},e.prototype.stopAnimation=function(t,r){for(var n=this.animators,i=n.length,a=[],o=0;o0&&r.during&&a[0].during(function(g,m){r.during(m)});for(var f=0;f0||i.force&&!o.length){var P=void 0,I=void 0,N=void 0;if(s){I={},f&&(P={});for(var S=0;S=0&&(i.splice(a,0,r),this._doAdd(r))}return this},t.prototype.replace=function(r,n){var i=Ve(this._children,r);return i>=0&&this.replaceAt(n,i),this},t.prototype.replaceAt=function(r,n){var i=this._children,a=i[n];if(r&&r!==this&&r.parent!==this&&r!==a){i[n]=r,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(r)}return this},t.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var n=this.__zr;n&&n!==r.__zr&&r.addSelfToZr(n),n&&n.refresh()},t.prototype.remove=function(r){var n=this.__zr,i=this._children,a=Ve(i,r);return a<0?this:(i.splice(a,1),r.parent=null,n&&r.removeSelfFromZr(n),n&&n.refresh(),this)},t.prototype.removeAll=function(){for(var r=this._children,n=this.__zr,i=0;i0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},e.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},e.prototype.findHover=function(t,r){if(!this._disposed)return this.handler.findHover(t,r)},e.prototype.on=function(t,r,n){return this._disposed||this.handler.on(t,r,n),this},e.prototype.off=function(t,r){this._disposed||this.handler.off(t,r)},e.prototype.trigger=function(t,r){this._disposed||this.handler.trigger(t,r)},e.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),r=0;r0){if(e<=i)return o;if(e>=a)return s}else{if(e>=i)return o;if(e<=a)return s}else{if(e===i)return o;if(e===a)return s}return(e-i)/l*u+o}var ce=_q;function _q(e,t,r){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%";break}return P0(e,t,r)}function P0(e,t,r){return he(e)?xq(e).match(/%$/)?parseFloat(e)/100*t+(r||0):parseFloat(e):e==null?NaN:+e}function ir(e,t,r){return t==null&&(t=10),t=Math.min(Math.max(0,t),lF),e=(+e).toFixed(t),r?e:+e}function Qn(e){return e.sort(function(t,r){return t-r}),e}function ta(e){if(e=+e,isNaN(e))return 0;if(e>1e-14){for(var t=1,r=0;r<15;r++,t*=10)if(Math.round(e*t)/t===e)return r}return uF(e)}function uF(e){var t=e.toString().toLowerCase(),r=t.indexOf("e"),n=r>0?+t.slice(r+1):0,i=r>0?r:t.length,a=t.indexOf("."),o=a<0?0:i-1-a;return Math.max(0,o-n)}function QM(e,t){var r=Math.log,n=Math.LN10,i=Math.floor(r(e[1]-e[0])/n),a=Math.round(r(ja(t[1]-t[0]))/n),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function bq(e,t,r){if(!e[t])return 0;var n=cF(e,r);return n[t]||0}function cF(e,t){var r=Ei(e,function(d,g){return d+(isNaN(g)?0:g)},0);if(r===0)return[];for(var n=Math.pow(10,t),i=ae(e,function(d){return(isNaN(d)?0:d)/r*n*100}),a=n*100,o=ae(i,function(d){return Math.floor(d)}),s=Ei(o,function(d,g){return d+g},0),l=ae(i,function(d,g){return d-o[g]});su&&(u=l[h],c=h);++o[c],l[c]=0,++s}return ae(o,function(d){return d/n})}function wq(e,t){var r=Math.max(ta(e),ta(t)),n=e+t;return r>lF?n:ir(n,r)}var HC=9007199254740991;function eA(e){var t=Math.PI*2;return(e%t+t)%t}function Oh(e){return e>-mI&&e=10&&t++,t}function tA(e,t){var r=f_(e),n=Math.pow(10,r),i=e/n,a;return t?i<1.5?a=1:i<2.5?a=2:i<4?a=3:i<7?a=5:a=10:i<1?a=1:i<2?a=2:i<3?a=3:i<5?a=5:a=10,e=a*n,r>=-20?+e.toFixed(r<0?-r:0):e}function Ly(e,t){var r=(e.length-1)*t+1,n=Math.floor(r),i=+e[n-1],a=r-n;return a?i+a*(e[n]-i):i}function UC(e){e.sort(function(l,u){return s(l,u,0)?-1:1});for(var t=-1/0,r=1,n=0;n0?t.length:0),this.item=null,this.key=NaN,this},e.prototype.next=function(){return(this._step>0?this._idx=this._end)?(this.item=this._list[this._idx],this.key=this._idx=this._idx+this._step,!0):!1},e}();function db(e){e.option=e.parentModel=e.ecModel=null}var Gq=".",kl="___EC__COMPONENT__CONTAINER___",bF="___EC__EXTENDED_CLASS___";function Ra(e){var t={main:"",sub:""};if(e){var r=e.split(Gq);t.main=r[0]||"",t.sub=r[1]||""}return t}function Wq(e){Jr(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}function Hq(e){return!!(e&&e[bF])}function aA(e,t){e.$constructor=e,e.extend=function(r){var n=this,i;return Uq(n)?i=function(a){q(o,a);function o(){return a.apply(this,arguments)||this}return o}(n):(i=function(){(r.$constructor||n).apply(this,arguments)},UM(i,this)),Q(i.prototype,r),i[bF]=!0,i.extend=this.extend,i.superCall=Yq,i.superApply=Xq,i.superClass=n,i}}function Uq(e){return we(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function wF(e,t){e.extend=t.extend}var Zq=Math.round(Math.random()*10);function $q(e){var t=["__\0is_clz",Zq++].join("_");e.prototype[t]=!0,e.isInstance=function(r){return!!(r&&r[t])}}function Yq(e,t){for(var r=[],n=2;n=0||a&&Ve(a,l)<0)){var u=n.getShallow(l,t);u!=null&&(o[e[s][0]]=u)}}return o}}var qq=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],Kq=Ou(qq),Jq=function(){function e(){}return e.prototype.getAreaStyle=function(t,r){return Kq(this,t,r)},e}(),$C=new jh(50);function Qq(e){if(typeof e=="string"){var t=$C.get(e);return t&&t.image}else return e}function oA(e,t,r,n,i){if(e)if(typeof e=="string"){if(t&&t.__zrImageSrc===e||!r)return t;var a=$C.get(e),o={hostEl:r,cb:n,cbPayload:i};return a?(t=a.image,!v_(t)&&a.pending.push(o)):(t=Bn.loadImage(e,bI,bI),t.__zrImageSrc=e,$C.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e;else return t}function bI(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=s;u++)l-=s;var c=Ha(o,r);return c>l&&(r="",c=0),l=e-c,i.ellipsis=r,i.ellipsisWidth=c,i.contentWidth=l,i.containerWidth=e,i}function TF(e,t,r){var n=r.containerWidth,i=r.contentWidth,a=r.fontMeasureInfo;if(!n){e.textLine="",e.isTruncated=!1;return}var o=Ha(a,t);if(o<=n){e.textLine=t,e.isTruncated=!1;return}for(var s=0;;s++){if(o<=i||s>=r.maxIterations){t+=r.ellipsis;break}var l=s===0?tK(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,l),o=Ha(a,t)}t===""&&(t=r.placeholder),e.textLine=t,e.isTruncated=!0}function tK(e,t,r){for(var n=0,i=0,a=e.length;iy&&d){var w=Math.floor(y/f);g=g||x.length>w,x=x.slice(0,w),_=x.length*f}if(i&&c&&m!=null)for(var S=CF(m,u,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),T={},M=0;Mg&&pb(a,o.substring(g,y),t,d),pb(a,m[2],t,d,m[1]),g=vb.lastIndex}gh){var Z=a.lines.length;O>0?(I.tokens=I.tokens.slice(0,O),A(I,D,N),a.lines=a.lines.slice(0,P+1)):a.lines=a.lines.slice(0,P),a.isTruncated=a.isTruncated||a.lines.length0&&g+n.accumWidth>n.width&&(c=t.split(` -`),u=!0),n.accumWidth=g}else{var m=MF(t,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=m.accumWidth+d,h=m.linesWidths,c=m.lines}}c||(c=t.split(` -`));for(var y=Wa(l),x=0;x=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var sK=Ei(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function lK(e){return oK(e)?!!sK[e]:!0}function MF(e,t,r,n,i){for(var a=[],o=[],s="",l="",u=0,c=0,h=Wa(t),f=0;fr:i+c+g>r){c?(s||l)&&(m?(s||(s=l,l="",u=0,c=u),a.push(s),o.push(c-u),l+=d,u+=g,s="",c=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(c),s=d,c=g)):m?(a.push(l),o.push(u),l=d,u=g):(a.push(d),o.push(g));continue}c+=g,m?(l+=d,u+=g):(l&&(s+=l,l="",u=0),s+=d)}return l&&(s+=l),s&&(a.push(s),o.push(c)),a.length===1&&(c+=i),{accumWidth:c,lines:a,linesWidths:o}}function SI(e,t,r,n,i,a){if(e.baseX=r,e.baseY=n,e.outerWidth=e.outerHeight=null,!!t){var o=t.width*2,s=t.height*2;Pe.set(CI,Rh(r,o,i),xu(n,s,a),o,s),Pe.intersect(t,CI,null,TI);var l=TI.outIntersectRect;e.outerWidth=l.width,e.outerHeight=l.height,e.baseX=Rh(l.x,l.width,i,!0),e.baseY=xu(l.y,l.height,a,!0)}}var CI=new Pe(0,0,0,0),TI={outIntersectRect:{},clamp:!0};function sA(e){return e!=null?e+="":e=""}function uK(e){var t=sA(e.text),r=e.font,n=Ha(Wa(r),t),i=Fp(r);return YC(e,n,i,null)}function YC(e,t,r,n){var i=new Pe(Rh(e.x||0,t,e.textAlign),xu(e.y||0,r,e.textBaseline),t,r),a=n??(AF(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function AF(e){var t=e.stroke;return t!=null&&t!=="none"&&e.lineWidth>0}var XC="__zr_style_"+Math.round(Math.random()*10),_u={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},p_={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};_u[XC]=!0;var MI=["z","z2","invisible"],cK=["invisible"],Ri=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype._init=function(r){for(var n=Qe(r),i=0;i1e-4){s[0]=e-r,s[1]=t-n,l[0]=e+r,l[1]=t+n;return}if(am[0]=xb(i)*r+e,am[1]=yb(i)*n+t,om[0]=xb(a)*r+e,om[1]=yb(a)*n+t,u(s,am,om),c(l,am,om),i=i%Ll,i<0&&(i=i+Ll),a=a%Ll,a<0&&(a=a+Ll),i>a&&!o?a+=Ll:ii&&(sm[0]=xb(d)*r+e,sm[1]=yb(d)*n+t,u(s,sm,s),c(l,sm,l))}var At={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Nl=[],Pl=[],_a=[],ns=[],ba=[],wa=[],_b=Math.min,bb=Math.max,Il=Math.cos,Dl=Math.sin,fo=Math.abs,qC=Math.PI,ds=qC*2,wb=typeof Float32Array<"u",ld=[];function Sb(e){var t=Math.round(e/qC*1e8)/1e8;return t%2*qC}function m_(e,t){var r=Sb(e[0]);r<0&&(r+=ds);var n=r-e[0],i=e[1];i+=n,!t&&i-r>=ds?i=r+ds:t&&r-i>=ds?i=r-ds:!t&&r>i?i=r+(ds-Sb(r-i)):t&&r0&&(this._ux=fo(n/k0/t)||0,this._uy=fo(n/k0/r)||0)},e.prototype.setDPR=function(t){this.dpr=t},e.prototype.setContext=function(t){this._ctx=t},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(t,r){return this._drawPendingPt(),this.addData(At.M,t,r),this._ctx&&this._ctx.moveTo(t,r),this._x0=t,this._y0=r,this._xi=t,this._yi=r,this},e.prototype.lineTo=function(t,r){var n=fo(t-this._xi),i=fo(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData(At.L,t,r),this._ctx&&a&&this._ctx.lineTo(t,r),a)this._xi=t,this._yi=r,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=r,this._pendingPtDist=o)}return this},e.prototype.bezierCurveTo=function(t,r,n,i,a,o){return this._drawPendingPt(),this.addData(At.C,t,r,n,i,a,o),this._ctx&&this._ctx.bezierCurveTo(t,r,n,i,a,o),this._xi=a,this._yi=o,this},e.prototype.quadraticCurveTo=function(t,r,n,i){return this._drawPendingPt(),this.addData(At.Q,t,r,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,r,n,i),this._xi=n,this._yi=i,this},e.prototype.arc=function(t,r,n,i,a,o){this._drawPendingPt(),ld[0]=i,ld[1]=a,m_(ld,o),i=ld[0],a=ld[1];var s=a-i;return this.addData(At.A,t,r,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(t,r,n,i,a,o),this._xi=Il(a)*n+t,this._yi=Dl(a)*n+r,this},e.prototype.arcTo=function(t,r,n,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,r,n,i,a),this},e.prototype.rect=function(t,r,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,r,n,i),this.addData(At.R,t,r,n,i),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(At.Z);var t=this._ctx,r=this._x0,n=this._y0;return t&&t.closePath(),this._xi=r,this._yi=n,this},e.prototype.fill=function(t){t&&t.fill(),this.toStatic()},e.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(t){if(this._saveData){var r=t.length;!(this.data&&this.data.length===r)&&wb&&(this.data=new Float32Array(r));for(var n=0;n0&&o))for(var s=0;sc.length&&(this._expandData(),c=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],r=0;r11&&(this.data=new Float32Array(t)))}},e.prototype.getBoundingRect=function(){_a[0]=_a[1]=ba[0]=ba[1]=Number.MAX_VALUE,ns[0]=ns[1]=wa[0]=wa[1]=-Number.MAX_VALUE;var t=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||fo(w)>i||f===r-1)&&(m=Math.sqrt(_*_+w*w),a=y,o=x);break}case At.C:{var S=t[f++],T=t[f++],y=t[f++],x=t[f++],M=t[f++],A=t[f++];m=CX(a,o,S,T,y,x,M,A,10),a=M,o=A;break}case At.Q:{var S=t[f++],T=t[f++],y=t[f++],x=t[f++];m=MX(a,o,S,T,y,x,10),a=y,o=x;break}case At.A:var P=t[f++],I=t[f++],N=t[f++],D=t[f++],O=t[f++],R=t[f++],F=R+O;f+=1,g&&(s=Il(O)*N+P,l=Dl(O)*D+I),m=bb(N,D)*_b(ds,Math.abs(R)),a=Il(F)*N+P,o=Dl(F)*D+I;break;case At.R:{s=a=t[f++],l=o=t[f++];var H=t[f++],W=t[f++];m=H*2+W*2;break}case At.Z:{var _=s-a,w=l-o;m=Math.sqrt(_*_+w*w),a=s,o=l;break}}m>=0&&(u[h++]=m,c+=m)}return this._pathLen=c,c},e.prototype.rebuildPath=function(t,r){var n=this.data,i=this._ux,a=this._uy,o=this._len,s,l,u,c,h,f,d=r<1,g,m,y=0,x=0,_,w=0,S,T;if(!(d&&(this._pathSegLen||this._calculateLength(),g=this._pathSegLen,m=this._pathLen,_=r*m,!_)))e:for(var M=0;M0&&(t.lineTo(S,T),w=0),A){case At.M:s=u=n[M++],l=c=n[M++],t.moveTo(u,c);break;case At.L:{h=n[M++],f=n[M++];var I=fo(h-u),N=fo(f-c);if(I>i||N>a){if(d){var D=g[x++];if(y+D>_){var O=(_-y)/D;t.lineTo(u*(1-O)+h*O,c*(1-O)+f*O);break e}y+=D}t.lineTo(h,f),u=h,c=f,w=0}else{var R=I*I+N*N;R>w&&(S=h,T=f,w=R)}break}case At.C:{var F=n[M++],H=n[M++],W=n[M++],V=n[M++],z=n[M++],Z=n[M++];if(d){var D=g[x++];if(y+D>_){var O=(_-y)/D;Qs(u,F,W,z,O,Nl),Qs(c,H,V,Z,O,Pl),t.bezierCurveTo(Nl[1],Pl[1],Nl[2],Pl[2],Nl[3],Pl[3]);break e}y+=D}t.bezierCurveTo(F,H,W,V,z,Z),u=z,c=Z;break}case At.Q:{var F=n[M++],H=n[M++],W=n[M++],V=n[M++];if(d){var D=g[x++];if(y+D>_){var O=(_-y)/D;qv(u,F,W,O,Nl),qv(c,H,V,O,Pl),t.quadraticCurveTo(Nl[1],Pl[1],Nl[2],Pl[2]);break e}y+=D}t.quadraticCurveTo(F,H,W,V),u=W,c=V;break}case At.A:var U=n[M++],$=n[M++],Y=n[M++],te=n[M++],ie=n[M++],se=n[M++],le=n[M++],Ee=!n[M++],me=Y>te?Y:te,ye=fo(Y-te)>.001,Me=ie+se,pe=!1;if(d){var D=g[x++];y+D>_&&(Me=ie+se*(_-y)/D,pe=!0),y+=D}if(ye&&t.ellipse?t.ellipse(U,$,Y,te,le,ie,Me,Ee):t.arc(U,$,me,ie,Me,Ee),pe)break e;P&&(s=Il(ie)*Y+U,l=Dl(ie)*te+$),u=Il(Me)*Y+U,c=Dl(Me)*te+$;break;case At.R:s=u=n[M],l=c=n[M+1],h=n[M++],f=n[M++];var Te=n[M++],st=n[M++];if(d){var D=g[x++];if(y+D>_){var ze=_-y;t.moveTo(h,f),t.lineTo(h+_b(ze,Te),f),ze-=Te,ze>0&&t.lineTo(h+Te,f+_b(ze,st)),ze-=st,ze>0&&t.lineTo(h+bb(Te-ze,0),f+st),ze-=Te,ze>0&&t.lineTo(h,f+bb(st-ze,0));break e}y+=D}t.rect(h,f,Te,st);break;case At.Z:if(d){var D=g[x++];if(y+D>_){var O=(_-y)/D;t.lineTo(u*(1-O)+s*O,c*(1-O)+l*O);break e}y+=D}t.closePath(),u=s,c=l}}},e.prototype.clone=function(){var t=new e,r=this.data;return t.data=r.slice?r.slice():Array.prototype.slice.call(r),t._len=this._len,t},e.prototype.canSave=function(){return!!this._saveData},e.CMD=At,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),e}();function ms(e,t,r,n,i,a,o){if(i===0)return!1;var s=i,l=0,u=e;if(o>t+s&&o>n+s||oe+s&&a>r+s||at+h&&c>n+h&&c>a+h&&c>s+h||ce+h&&u>r+h&&u>i+h&&u>o+h||ut+u&&l>n+u&&l>a+u||le+u&&s>r+u&&s>i+u||sr||c+ui&&(i+=ud);var f=Math.atan2(l,s);return f<0&&(f+=ud),f>=n&&f<=i||f+ud>=n&&f+ud<=i}function _o(e,t,r,n,i,a){if(a>t&&a>n||ai?s:0}var is=qa.CMD,El=Math.PI*2,mK=1e-4;function yK(e,t){return Math.abs(e-t)t&&u>n&&u>a&&u>s||u1&&xK(),d=kr(t,n,a,s,xi[0]),f>1&&(g=kr(t,n,a,s,xi[1]))),f===2?yt&&s>n&&s>a||s=0&&u<=1){for(var c=0,h=Br(t,n,a,u),f=0;fr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);yn[0]=-l,yn[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=El-1e-4){n=0,i=El;var c=a?1:-1;return o>=yn[0]+e&&o<=yn[1]+e?c:0}if(n>i){var h=n;n=i,i=h}n<0&&(n+=El,i+=El);for(var f=0,d=0;d<2;d++){var g=yn[d];if(g+e>o){var m=Math.atan2(s,g),c=a?1:-1;m<0&&(m=El+m),(m>=n&&m<=i||m+El>=n&&m+El<=i)&&(m>Math.PI/2&&m1&&(r||(s+=_o(l,u,c,h,n,i))),y&&(l=a[g],u=a[g+1],c=l,h=u),m){case is.M:c=a[g++],h=a[g++],l=c,u=h;break;case is.L:if(r){if(ms(l,u,a[g],a[g+1],t,n,i))return!0}else s+=_o(l,u,a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case is.C:if(r){if(pK(l,u,a[g++],a[g++],a[g++],a[g++],a[g],a[g+1],t,n,i))return!0}else s+=_K(l,u,a[g++],a[g++],a[g++],a[g++],a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case is.Q:if(r){if(kF(l,u,a[g++],a[g++],a[g],a[g+1],t,n,i))return!0}else s+=bK(l,u,a[g++],a[g++],a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case is.A:var x=a[g++],_=a[g++],w=a[g++],S=a[g++],T=a[g++],M=a[g++];g+=1;var A=!!(1-a[g++]);f=Math.cos(T)*w+x,d=Math.sin(T)*S+_,y?(c=f,h=d):s+=_o(l,u,f,d,n,i);var P=(n-x)*S/w+x;if(r){if(gK(x,_,S,T,T+M,A,t,P,i))return!0}else s+=wK(x,_,S,T,T+M,A,P,i);l=Math.cos(T+M)*w+x,u=Math.sin(T+M)*S+_;break;case is.R:c=l=a[g++],h=u=a[g++];var I=a[g++],N=a[g++];if(f=c+I,d=h+N,r){if(ms(c,h,f,h,t,n,i)||ms(f,h,f,d,t,n,i)||ms(f,d,c,d,t,n,i)||ms(c,d,c,h,t,n,i))return!0}else s+=_o(f,h,f,d,n,i),s+=_o(c,d,c,h,n,i);break;case is.Z:if(r){if(ms(l,u,c,h,t,n,i))return!0}else s+=_o(l,u,c,h,n,i);l=c,u=h;break}}return!r&&!yK(u,h)&&(s+=_o(l,u,c,h,n,i)||0),s!==0}function SK(e,t,r){return LF(e,0,!1,t,r)}function CK(e,t,r,n){return LF(e,t,!0,r,n)}var I0=Ae({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},_u),TK={style:Ae({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},p_.style)},Cb=Ya.concat(["invisible","culling","z","z2","zlevel","parent"]),Ke=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.update=function(){var r=this;e.prototype.update.call(this);var n=this.style;if(n.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(l){r.buildPath(l,r.shape)}),i.silent=!0;var a=i.style;for(var o in n)a[o]!==n[o]&&(a[o]=n[o]);a.fill=n.fill?n.decal:null,a.decal=null,a.shadowColor=null,n.strokeFirst&&(a.stroke=null);for(var s=0;s.5?FC:n>.2?nq:VC}else if(r)return VC}return FC},t.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(he(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=Qv(r,0)0))},t.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},t.prototype.getBoundingRect=function(){var r=this._rect,n=this.style,i=!r;if(i){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&Wc)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||i){s.copy(r);var l=n.strokeNoScale?this.getLineScale():1,u=n.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;u=Math.max(u,c??4)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return r},t.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect(),o=this.style;if(r=i[0],n=i[1],a.contain(r,n)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),CK(s,l/u,r,n)))return!0}if(this.hasFill())return SK(s,r,n)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=Wc,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(r){return this.animate("shape",r)},t.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(r,n){r==="shape"?this.setShape(n):e.prototype.attrKV.call(this,r,n)},t.prototype.setShape=function(r,n){var i=this.shape;return i||(i=this.shape={}),typeof r=="string"?i[r]=n:Q(i,r),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&Wc)},t.prototype.createStyle=function(r){return Op(I0,r)},t.prototype._innerSaveToNormal=function(r){e.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=Q({},this.shape))},t.prototype._applyStateObj=function(r,n,i,a,o,s){e.prototype._applyStateObj.call(this,r,n,i,a,o,s);var l=!(n&&a),u;if(n&&n.shape?o?a?u=n.shape:(u=Q({},i.shape),Q(u,n.shape)):(u=Q({},a?this.shape:i.shape),Q(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=Q({},this.shape);for(var c={},h=Qe(u),f=0;fi&&(h=s+l,s*=i/h,l*=i/h),u+c>i&&(h=u+c,u*=i/h,c*=i/h),l+u>a&&(h=l+u,l*=a/h,u*=a/h),s+c>a&&(h=s+c,s*=a/h,c*=a/h),e.moveTo(r+s,n),e.lineTo(r+i-l,n),l!==0&&e.arc(r+i-l,n+l,l,-Math.PI/2,0),e.lineTo(r+i,n+a-u),u!==0&&e.arc(r+i-u,n+a-u,u,0,Math.PI/2),e.lineTo(r+c,n+a),c!==0&&e.arc(r+c,n+a-c,c,Math.PI/2,Math.PI),e.lineTo(r,n+s),s!==0&&e.arc(r+s,n+s,s,Math.PI,Math.PI*1.5)}var sh=Math.round;function y_(e,t,r){if(t){var n=t.x1,i=t.x2,a=t.y1,o=t.y2;e.x1=n,e.x2=i,e.y1=a,e.y2=o;var s=r&&r.lineWidth;return s&&(sh(n*2)===sh(i*2)&&(e.x1=e.x2=ti(n,s,!0)),sh(a*2)===sh(o*2)&&(e.y1=e.y2=ti(a,s,!0))),e}}function NF(e,t,r){if(t){var n=t.x,i=t.y,a=t.width,o=t.height;e.x=n,e.y=i,e.width=a,e.height=o;var s=r&&r.lineWidth;return s&&(e.x=ti(n,s,!0),e.y=ti(i,s,!0),e.width=Math.max(ti(n+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(ti(i+o,s,!1)-e.y,o===0?0:1)),e}}function ti(e,t,r){if(!t)return e;var n=sh(e*2);return(n+sh(t))%2===0?n/2:(n+(r?1:-1))/2}var PK=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),IK={},Ze=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new PK},t.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=NF(IK,n,this.style);i=l.x,a=l.y,o=l.width,s=l.height,l.r=n.r,n=l}else i=n.x,a=n.y,o=n.width,s=n.height;n.r?NK(r,n):r.rect(i,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(Ke);Ze.prototype.type="rect";var PI={fill:"#000"},II=2,Sa={},DK={style:Ae({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},p_.style)},tt=function(e){q(t,e);function t(r){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=PI,n.attr(r),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r0,O=0;O=0&&(F=M[R],F.align==="right");)this._placeToken(F,r,P,x,O,"right",w),I-=F.width,O-=F.width,R--;for(D+=(c-(D-y)-(_-O)-I)/2;N<=R;)F=M[N],this._placeToken(F,r,P,x,D+F.width/2,"center",w),D+=F.width,N++;x+=P}},t.prototype._placeToken=function(r,n,i,a,o,s,l){var u=n.rich[r.styleName]||{};u.text=r.text;var c=r.verticalAlign,h=a+i/2;c==="top"?h=a+r.height/2:c==="bottom"&&(h=a+i-r.height/2);var f=!r.isLineHolder&&Tb(u);f&&this._renderBackground(u,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,h-r.height/2,r.width,r.height);var d=!!u.backgroundColor,g=r.textPadding;g&&(o=zI(o,s,g),h-=r.height/2-g[0]-r.innerHeight/2);var m=this._getOrCreateChild(zh),y=m.createStyle();m.useStyle(y);var x=this._defaultStyle,_=!1,w=0,S=!1,T=OI("fill"in u?u.fill:"fill"in n?n.fill:(_=!0,x.fill)),M=RI("stroke"in u?u.stroke:"stroke"in n?n.stroke:!d&&!l&&(!x.autoStroke||_)?(w=II,S=!0,x.stroke):null),A=u.textShadowBlur>0||n.textShadowBlur>0;y.text=r.text,y.x=o,y.y=h,A&&(y.shadowBlur=u.textShadowBlur||n.textShadowBlur||0,y.shadowColor=u.textShadowColor||n.textShadowColor||"transparent",y.shadowOffsetX=u.textShadowOffsetX||n.textShadowOffsetX||0,y.shadowOffsetY=u.textShadowOffsetY||n.textShadowOffsetY||0),y.textAlign=s,y.textBaseline="middle",y.font=r.font||Go,y.opacity=zn(u.opacity,n.opacity,1),EI(y,u),M&&(y.lineWidth=zn(u.lineWidth,n.lineWidth,w),y.lineDash=be(u.lineDash,n.lineDash),y.lineDashOffset=n.lineDashOffset||0,y.stroke=M),T&&(y.fill=T),m.setBoundingRect(YC(y,r.contentWidth,r.contentHeight,S?0:null))},t.prototype._renderBackground=function(r,n,i,a,o,s){var l=r.backgroundColor,u=r.borderWidth,c=r.borderColor,h=l&&l.image,f=l&&!h,d=r.borderRadius,g=this,m,y;if(f||r.lineHeight||u&&c){m=this._getOrCreateChild(Ze),m.useStyle(m.createStyle()),m.style.fill=null;var x=m.shape;x.x=i,x.y=a,x.width=o,x.height=s,x.r=d,m.dirtyShape()}if(f){var _=m.style;_.fill=l||null,_.fillOpacity=be(r.fillOpacity,1)}else if(h){y=this._getOrCreateChild(Er),y.onload=function(){g.dirtyStyle()};var w=y.style;w.image=l.image,w.x=i,w.y=a,w.width=o,w.height=s}if(u&&c){var _=m.style;_.lineWidth=u,_.stroke=c,_.strokeOpacity=be(r.strokeOpacity,1),_.lineDash=r.borderDash,_.lineDashOffset=r.borderDashOffset||0,m.strokeContainThreshold=0,m.hasFill()&&m.hasStroke()&&(_.strokeFirst=!0,_.lineWidth*=2)}var S=(m||y).style;S.shadowBlur=r.shadowBlur||0,S.shadowColor=r.shadowColor||"transparent",S.shadowOffsetX=r.shadowOffsetX||0,S.shadowOffsetY=r.shadowOffsetY||0,S.opacity=zn(r.opacity,n.opacity,1)},t.makeFont=function(r){var n="";return IF(r)&&(n=[r.fontStyle,r.fontWeight,PF(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Jn(n)||r.textFont||r.font},t}(Ri),EK={left:!0,right:1,center:1},jK={top:1,bottom:1,middle:1},DI=["fontStyle","fontWeight","fontSize","fontFamily"];function PF(e){return typeof e=="string"&&(e.indexOf("px")!==-1||e.indexOf("rem")!==-1||e.indexOf("em")!==-1)?e:isNaN(+e)?VM+"px":e+"px"}function EI(e,t){for(var r=0;r=0,a=!1;if(e instanceof Ke){var o=DF(e),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(_c(s)||_c(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=Q({},n),u=Q({},u),u.fill=s):!_c(u.fill)&&_c(s)?(a=!0,n=Q({},n),u=Q({},u),u.fill=M0(s)):!_c(u.stroke)&&_c(l)&&(a||(n=Q({},n),u=Q({},u)),u.stroke=M0(l)),n.style=u}}if(n&&n.z2==null){a||(n=Q({},n));var c=e.z2EmphasisLift;n.z2=e.z2+(c??uf)}return n}function GK(e,t,r){if(r&&r.z2==null){r=Q({},r);var n=e.z2SelectLift;r.z2=e.z2+(n??OK)}return r}function WK(e,t,r){var n=Ve(e.currentStates,t)>=0,i=e.style.opacity,a=n?null:FK(e,["opacity"],t,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=Q({},r),o=Q({opacity:n?i:a.opacity*.1},o),r.style=o),r}function Mb(e,t){var r=this.states[e];if(this.style){if(e==="emphasis")return VK(this,e,t,r);if(e==="blur")return WK(this,e,r);if(e==="select")return GK(this,e,r)}return r}function zu(e){e.stateProxy=Mb;var t=e.getTextContent(),r=e.getTextGuideLine();t&&(t.stateProxy=Mb),r&&(r.stateProxy=Mb)}function WI(e,t){!FF(e,t)&&!e.__highByOuter&&Jo(e,EF)}function HI(e,t){!FF(e,t)&&!e.__highByOuter&&Jo(e,jF)}function Ho(e,t){e.__highByOuter|=1<<(t||0),Jo(e,EF)}function Uo(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&Jo(e,jF)}function OF(e){Jo(e,hA)}function fA(e){Jo(e,RF)}function zF(e){Jo(e,zK)}function BF(e){Jo(e,BK)}function FF(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function VF(e){var t=e.getModel(),r=[],n=[];t.eachComponent(function(i,a){var o=lA(a),s=i==="series",l=s?e.getViewOfSeriesModel(a):e.getViewOfComponentModel(a);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(u){RF(u)}),s&&r.push(a)),o.isBlured=!1}),j(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(r,!1,t)})}function QC(e,t,r,n){var i=n.getModel();r=r||"coordinateSystem";function a(u,c){for(var h=0;h0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),t.push(s)}})}),t}function Hs(e,t,r){fu(e,!0),Jo(e,zu),tT(e,t,r)}function XK(e){fu(e,!1)}function Dt(e,t,r,n){n?XK(e):Hs(e,t,r)}function tT(e,t,r){var n=De(e);t!=null?(n.focus=t,n.blurScope=r):n.focus&&(n.focus=null)}var ZI=["emphasis","blur","select"],qK={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Sr(e,t,r,n){r=r||"itemStyle";for(var i=0;i1&&(o*=Ab(g),s*=Ab(g));var m=(i===a?-1:1)*Ab((o*o*(s*s)-o*o*(d*d)-s*s*(f*f))/(o*o*(d*d)+s*s*(f*f)))||0,y=m*o*d/s,x=m*-s*f/o,_=(e+r)/2+um(h)*y-lm(h)*x,w=(t+n)/2+lm(h)*y+um(h)*x,S=qI([1,0],[(f-y)/o,(d-x)/s]),T=[(f-y)/o,(d-x)/s],M=[(-1*f-y)/o,(-1*d-x)/s],A=qI(T,M);if(nT(T,M)<=-1&&(A=cd),nT(T,M)>=1&&(A=0),A<0){var P=Math.round(A/cd*1e6)/1e6;A=cd*2+P%2*cd}c.addData(u,_,w,o,s,S,A,h,a)}var rJ=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,nJ=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function iJ(e){var t=new qa;if(!e)return t;var r=0,n=0,i=r,a=n,o,s=qa.CMD,l=e.match(rJ);if(!l)return t;for(var u=0;uF*F+H*H&&(P=N,I=D),{cx:P,cy:I,x0:-c,y0:-h,x1:P*(i/T-1),y1:I*(i/T-1)}}function hJ(e){var t;if(re(e)){var r=e.length;if(!r)return e;r===1?t=[e[0],e[0],0,0]:r===2?t=[e[0],e[0],e[1],e[1]]:r===3?t=e.concat(e[2]):t=e}else t=[e,e,e,e];return t}function fJ(e,t){var r,n=Hd(t.r,0),i=Hd(t.r0||0,0),a=n>0,o=i>0;if(!(!a&&!o)){if(a||(n=i,i=0),i>n){var s=n;n=i,i=s}var l=t.startAngle,u=t.endAngle;if(!(isNaN(l)||isNaN(u))){var c=t.cx,h=t.cy,f=!!t.clockwise,d=JI(u-l),g=d>kb&&d%kb;if(g>Yi&&(d=g),!(n>Yi))e.moveTo(c,h);else if(d>kb-Yi)e.moveTo(c+n*wc(l),h+n*jl(l)),e.arc(c,h,n,l,u,!f),i>Yi&&(e.moveTo(c+i*wc(u),h+i*jl(u)),e.arc(c,h,i,u,l,f));else{var m=void 0,y=void 0,x=void 0,_=void 0,w=void 0,S=void 0,T=void 0,M=void 0,A=void 0,P=void 0,I=void 0,N=void 0,D=void 0,O=void 0,R=void 0,F=void 0,H=n*wc(l),W=n*jl(l),V=i*wc(u),z=i*jl(u),Z=d>Yi;if(Z){var U=t.cornerRadius;U&&(r=hJ(U),m=r[0],y=r[1],x=r[2],_=r[3]);var $=JI(n-i)/2;if(w=Ca($,x),S=Ca($,_),T=Ca($,m),M=Ca($,y),I=A=Hd(w,S),N=P=Hd(T,M),(A>Yi||P>Yi)&&(D=n*wc(u),O=n*jl(u),R=i*wc(l),F=i*jl(l),d<$F)){var Y=cJ(H,W,R,F,D,O,V,z);if(Y){var te=H-Y[0],ie=W-Y[1],se=D-Y[0],le=O-Y[1],Ee=1/jl(uJ((te*se+ie*le)/(yv(te*te+ie*ie)*yv(se*se+le*le)))/2),me=yv(Y[0]*Y[0]+Y[1]*Y[1]);I=Ca(A,(n-me)/(Ee+1)),N=Ca(P,(i-me)/(Ee-1))}}}if(!Z)e.moveTo(c+H,h+W);else if(I>Yi){var ye=Ca(x,I),Me=Ca(_,I),pe=cm(R,F,H,W,n,ye,f),Te=cm(D,O,V,z,n,Me,f);e.moveTo(c+pe.cx+pe.x0,h+pe.cy+pe.y0),I0&&e.arc(c+pe.cx,h+pe.cy,ye,on(pe.y0,pe.x0),on(pe.y1,pe.x1),!f),e.arc(c,h,n,on(pe.cy+pe.y1,pe.cx+pe.x1),on(Te.cy+Te.y1,Te.cx+Te.x1),!f),Me>0&&e.arc(c+Te.cx,h+Te.cy,Me,on(Te.y1,Te.x1),on(Te.y0,Te.x0),!f))}else e.moveTo(c+H,h+W),e.arc(c,h,n,l,u,!f);if(!(i>Yi)||!Z)e.lineTo(c+V,h+z);else if(N>Yi){var ye=Ca(m,N),Me=Ca(y,N),pe=cm(V,z,D,O,i,-Me,f),Te=cm(H,W,R,F,i,-ye,f);e.lineTo(c+pe.cx+pe.x0,h+pe.cy+pe.y0),N0&&e.arc(c+pe.cx,h+pe.cy,Me,on(pe.y0,pe.x0),on(pe.y1,pe.x1),!f),e.arc(c,h,i,on(pe.cy+pe.y1,pe.cx+pe.x1),on(Te.cy+Te.y1,Te.cx+Te.x1),f),ye>0&&e.arc(c+Te.cx,h+Te.cy,ye,on(Te.y1,Te.x1),on(Te.y0,Te.x0),!f))}else e.lineTo(c+V,h+z),e.arc(c,h,i,u,l,f)}e.closePath()}}}var dJ=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return e}(),Qr=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new dJ},t.prototype.buildPath=function(r,n){fJ(r,n)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(Ke);Qr.prototype.type="sector";var vJ=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),cf=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new vJ},t.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.PI*2;r.moveTo(i+n.r,a),r.arc(i,a,n.r,0,o,!1),r.moveTo(i+n.r0,a),r.arc(i,a,n.r0,0,o,!0)},t}(Ke);cf.prototype.type="ring";function pJ(e,t,r,n){var i=[],a=[],o=[],s=[],l,u,c,h;if(n){c=[1/0,1/0],h=[-1/0,-1/0];for(var f=0,d=e.length;f=2){if(n){var a=pJ(i,n,r,t.smoothConstraint);e.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(r?o:o-1);s++){var l=a[s*2],u=a[s*2+1],c=i[(s+1)%o];e.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{e.moveTo(i[0][0],i[0][1]);for(var s=1,h=i.length;sOl[1]){if(a=!1,Or.negativeSize||n)return a;var l=hm(Ol[0]-Rl[1]),u=hm(Rl[0]-Ol[1]);Lb(l,u)>dm.len()&&(l=u||!Or.bidirectional)&&(Ne.scale(fm,s,-u*i),Or.useDir&&Or.calcDirMTV()))}}return a},e.prototype._getProjMinMaxOnAxis=function(t,r,n){for(var i=this._axes[t],a=this._origin,o=r[0].dot(i)+a[t],s=o,l=o,u=1;u0){var h=c.duration,f=c.delay,d=c.easing,g={duration:h,delay:f||0,easing:d,done:a,force:!!a||!!o,setToFinal:!u,scope:e,during:o};s?t.animateFrom(r,g):t.animateTo(r,g)}else t.stopAnimation(),!s&&t.attr(r),o&&o(1),a&&a()}function it(e,t,r,n,i,a){gA("update",e,t,r,n,i,a)}function Nt(e,t,r,n,i,a){gA("enter",e,t,r,n,i,a)}function bh(e){if(!e.__zr)return!0;for(var t=0;tja(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function tD(e){return!e.isGroup}function AJ(e){return e.shape!=null}function Up(e,t,r){if(!e||!t)return;function n(o){var s={};return o.traverse(function(l){tD(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return AJ(o)&&(s.shape=Se(o.shape)),s}var a=n(e);t.traverse(function(o){if(tD(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),it(o,l,r,De(o).dataIndex)}}})}function xA(e,t){return ae(e,function(r){var n=r[0];n=nr(n,t.x),n=ni(n,t.x+t.width);var i=r[1];return i=nr(i,t.y),i=ni(i,t.y+t.height),[n,i]})}function r6(e,t){var r=nr(e.x,t.x),n=ni(e.x+e.width,t.x+t.width),i=nr(e.y,t.y),a=ni(e.y+e.height,t.y+t.height);if(n>=r&&a>=i)return{x:r,y:i,width:n-r,height:a-i}}function df(e,t,r){var n=Q({rectHover:!0},t),i=n.style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},e)return e.indexOf("image://")===0?(i.image=e.slice(8),Ae(i,r),new Er(n)):Bh(e.replace("path://",""),n,r,"center")}function Ud(e,t,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var y=Nb(d,g,c,h)/f;return!(y<0||y>1)}function Nb(e,t,r,n){return e*n-r*t}function kJ(e){return e<=1e-6&&e>=-1e-6}function Bu(e,t,r,n,i){return t==null||(rt(t)?Ot[0]=Ot[1]=Ot[2]=Ot[3]=t:(Ot[0]=t[0],Ot[1]=t[1],Ot[2]=t[2],Ot[3]=t[3]),n&&(Ot[0]=nr(0,Ot[0]),Ot[1]=nr(0,Ot[1]),Ot[2]=nr(0,Ot[2]),Ot[3]=nr(0,Ot[3])),r&&(Ot[0]=-Ot[0],Ot[1]=-Ot[1],Ot[2]=-Ot[2],Ot[3]=-Ot[3]),rD(e,Ot,"x","width",3,1,i&&i[0]||0),rD(e,Ot,"y","height",0,2,i&&i[1]||0)),e}var Ot=[0,0,0,0];function rD(e,t,r,n,i,a,o){var s=t[a]+t[i],l=e[n];e[n]+=s,o=nr(0,ni(o,l)),e[n]=0?-t[i]:t[a]>=0?l+t[a]:ja(s)>1e-8?(l-o)*t[i]/s:0):e[r]-=t[i]}function Qo(e){var t=e.itemTooltipOption,r=e.componentModel,n=e.itemName,i=he(t)?{formatter:t}:t,a=r.mainType,o=r.componentIndex,s={componentType:a,name:n,$vars:["name"]};s[a+"Index"]=o;var l=e.formatterParamsExtra;l&&j(Qe(l),function(c){ge(s,c)||(s[c]=l[c],s.$vars.push(c))});var u=De(e.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:n,option:Ae({content:n,encodeHTMLContent:!0,formatterParams:s},i)}}function aT(e,t){var r;e.isGroup&&(r=t(e)),r||e.traverse(t)}function hl(e,t){if(e)if(re(e))for(var r=0;rt&&(t=o),ot&&(r=t=0),{min:r,max:t}}function w_(e,t,r){a6(e,t,r,-1/0)}function a6(e,t,r,n){if(e.ignoreModelZ)return n;var i=e.getTextContent(),a=e.getTextGuideLine(),o=e.isGroup;if(o)for(var s=e.childrenRef(),l=0;l=0&&s.push(l)}),s}}function fl(e,t){return Ge(Ge({},e,!0),t,!0)}const FJ={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},VJ={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var O0="ZH",SA="EN",wh=SA,Iy={},CA={},h6=Je.domSupported?function(){var e=(document.documentElement.lang||navigator.language||navigator.browserLanguage||wh).toUpperCase();return e.indexOf(O0)>-1?O0:wh}():wh;function TA(e,t){e=e.toUpperCase(),CA[e]=new qe(t),Iy[e]=t}function GJ(e){if(he(e)){var t=Iy[e.toUpperCase()]||{};return e===O0||e===SA?Se(t):Ge(Se(t),Se(Iy[wh]),!1)}else return Ge(Se(e),Se(Iy[wh]),!1)}function sT(e){return CA[e]}function WJ(){return CA[wh]}TA(SA,FJ);TA(O0,VJ);var lT=null;function HJ(e){lT||(lT=e)}function vr(){return lT}var MA=1e3,AA=MA*60,xv=AA*60,Ti=xv*24,sD=Ti*365,UJ={year:/({yyyy}|{yy})/,month:/({MMMM}|{MMM}|{MM}|{M})/,day:/({dd}|{d})/,hour:/({HH}|{H}|{hh}|{h})/,minute:/({mm}|{m})/,second:/({ss}|{s})/,millisecond:/({SSS}|{S})/},Dy={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},ZJ="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",pm="{yyyy}-{MM}-{dd}",lD={year:"{yyyy}",month:"{yyyy}-{MM}",day:pm,hour:pm+" "+Dy.hour,minute:pm+" "+Dy.minute,second:pm+" "+Dy.second,millisecond:ZJ},$n=["year","month","day","hour","minute","second","millisecond"],$J=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function YJ(e){return!he(e)&&!we(e)?XJ(e):e}function XJ(e){e=e||{};var t={},r=!0;return j($n,function(n){r&&(r=e[n]==null)}),j($n,function(n,i){var a=e[n];t[n]={};for(var o=null,s=i;s>=0;s--){var l=$n[s],u=ke(a)&&!re(a)?a[l]:a,c=void 0;re(u)?(c=u.slice(),o=c[0]||""):he(u)?(o=u,c=[o]):(o==null?o=Dy[n]:UJ[l].test(o)||(o=t[l][l][0]+" "+o),c=[o],r&&(c[1]="{primary|"+o+"}")),t[n][l]=c}}),t}function xn(e,t){return e+="","0000".substr(0,t-e.length)+e}function _v(e){switch(e){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return e}}function qJ(e){return e===_v(e)}function KJ(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function Zp(e,t,r,n){var i=to(e),a=i[f6(r)](),o=i[kA(r)]()+1,s=Math.floor((o-1)/3)+1,l=i[LA(r)](),u=i["get"+(r?"UTC":"")+"Day"](),c=i[NA(r)](),h=(c-1)%12+1,f=i[PA(r)](),d=i[IA(r)](),g=i[DA(r)](),m=c>=12?"pm":"am",y=m.toUpperCase(),x=n instanceof qe?n:sT(n||h6)||WJ(),_=x.getModel("time"),w=_.get("month"),S=_.get("monthAbbr"),T=_.get("dayOfWeek"),M=_.get("dayOfWeekAbbr");return(t||"").replace(/{a}/g,m+"").replace(/{A}/g,y+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,xn(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,w[o-1]).replace(/{MMM}/g,S[o-1]).replace(/{MM}/g,xn(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,xn(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,T[u]).replace(/{ee}/g,M[u]).replace(/{e}/g,u+"").replace(/{HH}/g,xn(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,xn(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,xn(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,xn(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,xn(g,3)).replace(/{S}/g,g+"")}function JJ(e,t,r,n,i){var a=null;if(he(r))a=r;else if(we(r)){var o={time:e.time,level:e.time.level},s=vr();s&&s.makeAxisLabelFormatterParamBreak(o,e.break),a=r(e.value,t,o)}else{var l=e.time;if(l){var u=r[l.lowerTimeUnit][l.upperTimeUnit];a=u[Math.min(l.level,u.length-1)]||""}else{var c=uh(e.value,i);a=r[c][c][0]}}return Zp(new Date(e.value),a,i,n)}function uh(e,t){var r=to(e),n=r[kA(t)]()+1,i=r[LA(t)](),a=r[NA(t)](),o=r[PA(t)](),s=r[IA(t)](),l=r[DA(t)](),u=l===0,c=u&&s===0,h=c&&o===0,f=h&&a===0,d=f&&i===1,g=d&&n===1;return g?"year":d?"month":f?"day":h?"hour":c?"minute":u?"second":"millisecond"}function z0(e,t,r){switch(t){case"year":e[d6(r)](0);case"month":e[v6(r)](1);case"day":e[p6(r)](0);case"hour":e[g6(r)](0);case"minute":e[m6(r)](0);case"second":e[y6(r)](0)}return e}function f6(e){return e?"getUTCFullYear":"getFullYear"}function kA(e){return e?"getUTCMonth":"getMonth"}function LA(e){return e?"getUTCDate":"getDate"}function NA(e){return e?"getUTCHours":"getHours"}function PA(e){return e?"getUTCMinutes":"getMinutes"}function IA(e){return e?"getUTCSeconds":"getSeconds"}function DA(e){return e?"getUTCMilliseconds":"getMilliseconds"}function QJ(e){return e?"setUTCFullYear":"setFullYear"}function d6(e){return e?"setUTCMonth":"setMonth"}function v6(e){return e?"setUTCDate":"setDate"}function p6(e){return e?"setUTCHours":"setHours"}function g6(e){return e?"setUTCMinutes":"setMinutes"}function m6(e){return e?"setUTCSeconds":"setSeconds"}function y6(e){return e?"setUTCMilliseconds":"setMilliseconds"}function eQ(e,t,r,n,i,a,o,s){var l=new tt({style:{text:e,font:t,align:r,verticalAlign:n,padding:i,rich:a,overflow:o?"truncate":null,lineHeight:s}});return l.getBoundingRect()}function EA(e){if(!rA(e))return he(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function jA(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,function(r,n){return n.toUpperCase()}),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var gf=Rp;function uT(e,t,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(c){return c&&Jn(c)?c:"-"}function a(c){return!!(c!=null&&!isNaN(c)&&isFinite(c))}var o=t==="time",s=e instanceof Date;if(o||s){var l=o?to(e):e;if(isNaN(+l)){if(s)return"-"}else return Zp(l,n,r)}if(t==="ordinal")return y0(e)?i(e):rt(e)&&a(e)?e+"":"-";var u=Xa(e);return a(u)?EA(u):y0(e)?i(e):typeof e=="boolean"?e+"":"-"}var uD=["a","b","c","d","e","f","g"],Db=function(e,t){return"{"+e+(t??"")+"}"};function RA(e,t,r){re(t)||(t=[t]);var n=t.length;if(!n)return"";for(var i=t[0].$vars||[],a=0;a':'';var o=r.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function rQ(e,t,r){(e==="week"||e==="month"||e==="quarter"||e==="half-year"||e==="year")&&(e=`MM-dd -yyyy`);var n=to(t),i=r?"getUTC":"get",a=n[i+"FullYear"](),o=n[i+"Month"]()+1,s=n[i+"Date"](),l=n[i+"Hours"](),u=n[i+"Minutes"](),c=n[i+"Seconds"](),h=n[i+"Milliseconds"]();return e=e.replace("MM",xn(o,2)).replace("M",o).replace("yyyy",a).replace("yy",xn(a%100+"",2)).replace("dd",xn(s,2)).replace("d",s).replace("hh",xn(l,2)).replace("h",l).replace("mm",xn(u,2)).replace("m",u).replace("ss",xn(c,2)).replace("s",c).replace("SSS",xn(h,3)),e}function nQ(e){return e&&e.charAt(0).toUpperCase()+e.substr(1)}function Vu(e,t){return t=t||"transparent",he(e)?e:ke(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function B0(e,t){if(t==="_blank"||t==="blank"){var r=window.open();r.opener=null,r.location.href=e}else window.open(e,t)}var Ey={},Eb={},mf=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(t,r){this._nonSeriesBoxMasterList=n(Ey),this._normalMasterList=n(Eb);function n(i,a){var o=[];return j(i,function(s,l){var u=s.create(t,r);o=o.concat(u||[])}),o}},e.prototype.update=function(t,r){j(this._normalMasterList,function(n){n.update&&n.update(t,r)})},e.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},e.register=function(t,r){if(t==="matrix"||t==="calendar"){Ey[t]=r;return}Eb[t]=r},e.get=function(t){return Eb[t]||Ey[t]},e}();function iQ(e){return!!Ey[e]}var cT={coord:1,coord2:2};function aQ(e){_6.set(e.fullType,{getCoord2:void 0}).getCoord2=e.getCoord2}var _6=_e();function oQ(e){var t=e.getShallow("coord",!0),r=cT.coord;if(t==null){var n=_6.get(e.type);n&&n.getCoord2&&(r=cT.coord2,t=n.getCoord2(e))}return{coord:t,from:r}}var Da={none:0,dataCoordSys:1,boxCoordSys:2};function b6(e,t){var r=e.getShallow("coordinateSystem"),n=e.getShallow("coordinateSystemUsage",!0),i=Da.none;if(r){var a=e.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=Da.dataCoordSys,a||(i=Da.none)):n==="box"&&(i=Da.boxCoordSys,!a&&!iQ(r)&&(i=Da.none))}return{coordSysType:r,kind:i}}function $p(e){var t=e.targetModel,r=e.coordSysType,n=e.coordSysProvider,i=e.isDefaultDataCoordSys;e.allowNotFound;var a=b6(t),o=a.kind,s=a.coordSysType;if(i&&o!==Da.dataCoordSys&&(o=Da.dataCoordSys,s=r),o===Da.none||s!==r)return!1;var l=n(r,t);return l?(o===Da.dataCoordSys?t.coordinateSystem=l:t.boxCoordinateSystem=l,!0):!1}var w6=function(e,t){var r=t.getReferringComponents(e,Ht).models[0];return r&&r.coordinateSystem},jy=j,S6=["left","right","top","bottom","width","height"],du=[["width","left","right"],["height","top","bottom"]];function OA(e,t,r,n,i){var a=0,o=0;n==null&&(n=1/0),i==null&&(i=1/0);var s=0;t.eachChild(function(l,u){var c=l.getBoundingRect(),h=t.childAt(u+1),f=h&&h.getBoundingRect(),d,g;if(e==="horizontal"){var m=c.width+(f?-f.x+c.x:0);d=a+m,d>n||l.newline?(a=0,d=m,o+=s+r,s=c.height):s=Math.max(s,c.height)}else{var y=c.height+(f?-f.y+c.y:0);g=o+y,g>i||l.newline?(a+=s+r,o=0,g=y,s=c.width):s=Math.max(s,c.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),e==="horizontal"?a=d+r:o=g+r)})}var wu=OA;Fe(OA,"vertical");Fe(OA,"horizontal");function C6(e,t){return{left:e.getShallow("left",t),top:e.getShallow("top",t),right:e.getShallow("right",t),bottom:e.getShallow("bottom",t),width:e.getShallow("width",t),height:e.getShallow("height",t)}}function sQ(e,t){var r=Tr(e,t,{enableLayoutOnlyByCenter:!0}),n=e.getBoxLayoutParams(),i,a;if(r.type===Zd.point)a=r.refPoint,i=It(n,{width:t.getWidth(),height:t.getHeight()});else{var o=e.get("center"),s=re(o)?o:[o,o];i=It(n,r.refContainer),a=r.boxCoordFrom===cT.coord2?r.refPoint:[ce(s[0],i.width)+i.x,ce(s[1],i.height)+i.y]}return{viewRect:i,center:a}}function T6(e,t){var r=sQ(e,t),n=r.viewRect,i=r.center,a=e.get("radius");re(a)||(a=[0,a]);var o=ce(n.width,t.getWidth()),s=ce(n.height,t.getHeight()),l=Math.min(o,s),u=ce(a[0],l/2),c=ce(a[1],l/2);return{cx:i[0],cy:i[1],r0:u,r:c,viewRect:n}}function It(e,t,r){r=gf(r||0);var n=t.width,i=t.height,a=ce(e.left,n),o=ce(e.top,i),s=ce(e.right,n),l=ce(e.bottom,i),u=ce(e.width,n),c=ce(e.height,i),h=r[2]+r[0],f=r[1]+r[3],d=e.aspect;switch(isNaN(u)&&(u=n-s-f-a),isNaN(c)&&(c=i-l-h-o),d!=null&&(isNaN(u)&&isNaN(c)&&(d>n/i?u=n*.8:c=i*.8),isNaN(u)&&(u=d*c),isNaN(c)&&(c=u/d)),isNaN(a)&&(a=n-s-u-f),isNaN(o)&&(o=i-l-c-h),e.left||e.right){case"center":a=n/2-u/2-r[3];break;case"right":a=n-u-f;break}switch(e.top||e.bottom){case"middle":case"center":o=i/2-c/2-r[0];break;case"bottom":o=i-c-h;break}a=a||0,o=o||0,isNaN(u)&&(u=n-f-a-(s||0)),isNaN(c)&&(c=i-h-o-(l||0));var g=new Pe((t.x||0)+a+r[3],(t.y||0)+o+r[0],u,c);return g.margin=r,g}function M6(e,t,r){var n=e.getShallow("preserveAspect",!0);if(!n)return t;var i=t.width/t.height;if(Math.abs(Math.atan(r)-Math.atan(i))<1e-9)return t;var a=e.getShallow("preserveAspectAlign",!0),o=e.getShallow("preserveAspectVerticalAlign",!0),s={width:t.width,height:t.height},l=n==="cover";return i>r&&!l||i=m)return h;for(var y=0;y=0;l--)s=Ge(s,i[l],!0);n.defaultOption=s}return n.defaultOption},t.prototype.getReferringComponents=function(r,n){var i=r+"Index",a=r+"Id";return lf(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},t.prototype.getBoxLayoutParams=function(){return C6(this,!1)},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(r){this.option.zlevel=r},t.protoInitialize=function(){var r=t.prototype;r.type="component",r.id="",r.name="",r.mainType="",r.subType="",r.componentIndex=0}(),t}(qe);wF($e,qe);d_($e);zJ($e);BJ($e,cQ);function cQ(e){var t=[];return j($e.getClassesByMainType(e),function(r){t=t.concat(r.dependencies||r.prototype.dependencies||[])}),t=ae(t,function(r){return Ra(r).main}),e!=="dataset"&&Ve(t,"dataset")<=0&&t.unshift("dataset"),t}var K={color:{},darkColor:{},size:{}},er=K.color={theme:["#5070dd","#b6d634","#505372","#ff994d","#0ca8df","#ffd10a","#fb628b","#785db0","#3fbe95"],neutral00:"#fff",neutral05:"#f4f7fd",neutral10:"#e8ebf0",neutral15:"#dbdee4",neutral20:"#cfd2d7",neutral25:"#c3c5cb",neutral30:"#b7b9be",neutral35:"#aaacb2",neutral40:"#9ea0a5",neutral45:"#929399",neutral50:"#86878c",neutral55:"#797b7f",neutral60:"#6d6e73",neutral65:"#616266",neutral70:"#54555a",neutral75:"#48494d",neutral80:"#3c3c41",neutral85:"#303034",neutral90:"#232328",neutral95:"#17171b",neutral99:"#000",accent05:"#eff1f9",accent10:"#e0e4f2",accent15:"#d0d6ec",accent20:"#c0c9e6",accent25:"#b1bbdf",accent30:"#a1aed9",accent35:"#91a0d3",accent40:"#8292cc",accent45:"#7285c6",accent50:"#6578ba",accent55:"#5c6da9",accent60:"#536298",accent65:"#4a5787",accent70:"#404c76",accent75:"#374165",accent80:"#2e3654",accent85:"#252b43",accent90:"#1b2032",accent95:"#121521",transparent:"rgba(0,0,0,0)",highlight:"rgba(255,231,130,0.8)"};Q(er,{primary:er.neutral80,secondary:er.neutral70,tertiary:er.neutral60,quaternary:er.neutral50,disabled:er.neutral20,border:er.neutral30,borderTint:er.neutral20,borderShade:er.neutral40,background:er.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:er.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:er.neutral70,axisLineTint:er.neutral40,axisTick:er.neutral70,axisTickMinor:er.neutral60,axisLabel:er.neutral70,axisSplitLine:er.neutral15,axisMinorSplitLine:er.neutral05});for(var zl in er)if(er.hasOwnProperty(zl)){var cD=er[zl];zl==="theme"?K.darkColor.theme=er.theme.slice():zl==="highlight"?K.darkColor.highlight="rgba(255,231,130,0.4)":zl.indexOf("accent")===0?K.darkColor[zl]=Io(cD,null,function(e){return e*.5},function(e){return Math.min(1,1.3-e)}):K.darkColor[zl]=Io(cD,null,function(e){return e*.9},function(e){return 1-Math.pow(e,1.5)})}K.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var k6="";typeof navigator<"u"&&(k6=navigator.platform||"");var Sc="rgba(0, 0, 0, 0.2)",L6=K.color.theme[0],hQ=Io(L6,null,null,.9);const fQ={darkMode:"auto",colorBy:"series",color:K.color.theme,gradientColor:[hQ,L6],aria:{decal:{decals:[{color:Sc,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Sc,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Sc,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Sc,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Sc,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Sc,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:k6.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var N6=_e(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),si="original",Wr="arrayRows",li="objectRows",va="keyedColumns",Zs="typedArray",P6="unknown",la="column",Qu="row",Zr={Must:1,Might:2,Not:3},I6=Ye();function dQ(e){I6(e).datasetMap=_e()}function D6(e,t,r){var n={},i=BA(t);if(!i||!e)return n;var a=[],o=[],s=t.ecModel,l=I6(s).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,c,h;e=e.slice(),j(e,function(m,y){var x=ke(m)?m:e[y]={name:m};x.type==="ordinal"&&c==null&&(c=y,h=g(x)),n[x.name]=[]});var f=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});j(e,function(m,y){var x=m.name,_=g(m);if(c==null){var w=f.valueWayDim;d(n[x],w,_),d(o,w,_),f.valueWayDim+=_}else if(c===y)d(n[x],0,_),d(a,0,_);else{var w=f.categoryWayDim;d(n[x],w,_),d(o,w,_),f.categoryWayDim+=_}});function d(m,y,x){for(var _=0;_t)return e[n];return e[r-1]}function R6(e,t,r,n,i,a,o){a=a||e;var s=t(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var c=o==null||!n?r:yQ(n,o);if(c=c||r,!(!c||!c.length)){var h=c[l];return i&&(u[i]=h),s.paletteIdx=(l+1)%c.length,h}}function xQ(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var gm,hd,fD,dD="\0_ec_inner",_Q=1,VA=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(r,n,i,a,o,s){a=a||{},this.option=null,this._theme=new qe(a),this._locale=new qe(o),this._optionManager=s},t.prototype.setOption=function(r,n,i){var a=gD(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},t.prototype.resetOption=function(r,n){return this._resetOption(r,gD(n))},t.prototype._resetOption=function(r,n){var i=!1,a=this._optionManager;if(!r||r==="recreate"){var o=a.mountOption(r==="recreate");!this.option||r==="recreate"?fD(this,o):(this.restoreData(),this._mergeOption(o,n)),i=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var s=a.getTimelineOption(this);s&&(i=!0,this._mergeOption(s,n))}if(!r||r==="recreate"||r==="media"){var l=a.getMediaOption(this);l.length&&j(l,function(u){i=!0,this._mergeOption(u,n)},this)}return i},t.prototype.mergeOption=function(r){this._mergeOption(r,null)},t.prototype._mergeOption=function(r,n){var i=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=_e(),u=n&&n.replaceMergeMainTypeMap;dQ(this),j(r,function(h,f){h!=null&&($e.hasClass(f)?f&&(s.push(f),l.set(f,!0)):i[f]=i[f]==null?Se(h):Ge(i[f],h,!0))}),u&&u.each(function(h,f){$e.hasClass(f)&&!l.get(f)&&(s.push(f),l.set(f,!0))}),$e.topologicalTravel(s,$e.getAllClassMainTypes(),c,this);function c(h){var f=gQ(this,h,Tt(r[h])),d=a.get(h),g=d?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",m=mF(d,f,g);jq(m,h,$e),i[h]=null,a.set(h,null),o.set(h,0);var y=[],x=[],_=0,w;j(m,function(S,T){var M=S.existing,A=S.newOption;if(!A)M&&(M.mergeOption({},this),M.optionUpdated({},!1));else{var P=h==="series",I=$e.getClass(h,S.keyInfo.subType,!P);if(!I)return;if(h==="tooltip"){if(w)return;w=!0}if(M&&M.constructor===I)M.name=S.keyInfo.name,M.mergeOption(A,this),M.optionUpdated(A,!1);else{var N=Q({componentIndex:T},S.keyInfo);M=new I(A,this,this,N),Q(M,N),S.brandNew&&(M.__requireNewView=!0),M.init(A,this,this),M.optionUpdated(null,!0)}}M?(y.push(M.option),x.push(M),_++):(y.push(void 0),x.push(void 0))},this),i[h]=y,a.set(h,x),o.set(h,_),h==="series"&&gm(this)}this._seriesIndices||gm(this)},t.prototype.getOption=function(){var r=Se(this.option);return j(r,function(n,i){if($e.hasClass(i)){for(var a=Tt(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!tp(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[dD],r},t.prototype.setTheme=function(r){this._theme=new qe(r),this._resetOption("recreate",null)},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(r){this._payload=r},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(r,n){var i=this._componentsMap.get(r);if(i){var a=i[n||0];if(a)return a;if(n==null){for(var o=0;o=t:r==="max"?e<=t:e===t}function LQ(e,t){return e.join(",")===t.join(",")}var Zi=j,sp=ke,mD=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function jb(e){var t=e&&e.itemStyle;if(t)for(var r=0,n=mD.length;r0?r[o-1].seriesModel:null)}),zQ(r)}})}function zQ(e){j(e,function(t,r){var n=[],i=[NaN,NaN],a=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,l=t.seriesModel.get("stackStrategy")||"samesign";o.modify(a,function(u,c,h){var f=o.get(t.stackedDimension,h);if(isNaN(f))return i;var d,g;s?g=o.getRawIndex(h):d=o.get(t.stackedByDimension,h);for(var m=NaN,y=r-1;y>=0;y--){var x=e[y];if(s||(g=x.data.rawIndexOf(x.stackedByDimension,d)),g>=0){var _=x.data.getByRawIndex(x.stackResultDimension,g);if(l==="all"||l==="positive"&&_>0||l==="negative"&&_<0||l==="samesign"&&f>=0&&_>0||l==="samesign"&&f<=0&&_<0){f=wq(f,_),m=_;break}}}return n[0]=f,n[1]=m,n})})}var T_=function(){function e(t){this.data=t.data||(t.sourceFormat===va?{}:[]),this.sourceFormat=t.sourceFormat||P6,this.seriesLayoutBy=t.seriesLayoutBy||la,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var r=this.dimensionsDefine=t.dimensionsDefine;if(r)for(var n=0;nm&&(m=w)}d[0]=g,d[1]=m}},i=function(){return this._data?this._data.length/this._dimSize:0};CD=(t={},t[Wr+"_"+la]={pure:!0,appendData:a},t[Wr+"_"+Qu]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[li]={pure:!0,appendData:a},t[va]={pure:!0,appendData:function(o){var s=this._data;j(o,function(l,u){for(var c=s[u]||(s[u]=[]),h=0;h<(l||[]).length;h++)c.push(l[h])})}},t[si]={appendData:a},t[Zs]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},t);function a(o){for(var s=0;s=0&&(m=o.interpolatedValue[y])}return m!=null?m+"":""})}},e.prototype.getRawValue=function(t,r){return Vh(this.getData(r),t)},e.prototype.formatTooltip=function(t,r,n){},e}();function kD(e){var t,r;return ke(e)?e.type&&(r=e):t=e,{text:t,frag:r}}function bv(e){return new ZQ(e)}var ZQ=function(){function e(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return e.prototype.perform=function(t){var r=this._upstream,n=t&&t.skip;if(this._dirty&&r){var i=this.context;i.data=i.outputData=r.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!n&&(a=this._plan(this.context));var o=c(this._modBy),s=this._modDataCount||0,l=c(t&&t.modBy),u=t&&t.modDataCount||0;(o!==l||s!==u)&&(a="reset");function c(_){return!(_>=1)&&(_=1),_}var h;(this._dirty||a==="reset")&&(this._dirty=!1,h=this._doReset(n)),this._modBy=l,this._modDataCount=u;var f=t&&t.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,g=Math.min(f!=null?this._dueIndex+f:1/0,this._dueEnd);if(!n&&(h||d1&&n>0?s:o}};return a;function o(){return t=e?null:lt},gte:function(e,t){return e>=t}},YQ=function(){function e(t,r){if(!rt(r)){var n="";ft(n)}this._opFn=$6[t],this._rvalFloat=Xa(r)}return e.prototype.evaluate=function(t){return rt(t)?this._opFn(t,this._rvalFloat):this._opFn(Xa(t),this._rvalFloat)},e}(),Y6=function(){function e(t,r){var n=t==="desc";this._resultLT=n?1:-1,r==null&&(r=n?"min":"max"),this._incomparable=r==="min"?-1/0:1/0}return e.prototype.evaluate=function(t,r){var n=rt(t)?t:Xa(t),i=rt(r)?r:Xa(r),a=isNaN(n),o=isNaN(i);if(a&&(n=this._incomparable),o&&(i=this._incomparable),a&&o){var s=he(t),l=he(r);s&&(n=l?t:0),l&&(i=s?r:0)}return ni?-this._resultLT:0},e}(),XQ=function(){function e(t,r){this._rval=r,this._isEQ=t,this._rvalTypeof=typeof r,this._rvalFloat=Xa(r)}return e.prototype.evaluate=function(t){var r=t===this._rval;if(!r){var n=typeof t;n!==this._rvalTypeof&&(n==="number"||this._rvalTypeof==="number")&&(r=Xa(t)===this._rvalFloat)}return this._isEQ?r:!r},e}();function qQ(e,t){return e==="eq"||e==="ne"?new XQ(e==="eq",t):ge($6,e)?new YQ(e,t):null}var KQ=function(){function e(){}return e.prototype.getRawData=function(){throw new Error("not supported")},e.prototype.getRawDataItem=function(t){throw new Error("not supported")},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(t){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(t,r){},e.prototype.retrieveValueFromItem=function(t,r){},e.prototype.convertValue=function(t,r){return $s(t,r)},e}();function JQ(e,t){var r=new KQ,n=e.data,i=r.sourceFormat=e.sourceFormat,a=e.startIndex,o="";e.seriesLayoutBy!==la&&ft(o);var s=[],l={},u=e.dimensionsDefine;if(u)j(u,function(m,y){var x=m.name,_={index:y,name:x,displayName:m.displayName};if(s.push(_),x!=null){var w="";ge(l,x)&&ft(w),l[x]=_}});else for(var c=0;c65535?oee:see}function Tc(){return[1/0,-1/0]}function lee(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function PD(e,t,r,n,i){var a=K6[r||"float"];if(i){var o=e[t],s=o&&o.length;if(s!==n){for(var l=new a(n),u=0;uy[1]&&(y[1]=m)}return this._rawCount=this._count=l,{start:s,end:l}},e.prototype._initDataFromProvider=function(t,r,n){for(var i=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=ae(o,function(_){return _.property}),c=0;cx[1]&&(x[1]=y)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=r,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(t,r){if(!(r>=0&&r=0&&r=this._rawCount||t<0)return-1;if(!this._indices)return t;var r=this._indices,n=r[t];if(n!=null&&nt)a=o-1;else return o}return-1},e.prototype.getIndices=function(){var t,r=this._indices;if(r){var n=r.constructor,i=this._count;if(n===Array){t=new n(i);for(var a=0;a=h&&_<=f||isNaN(_))&&(l[u++]=m),m++}g=!0}else if(a===2){for(var y=d[i[0]],w=d[i[1]],S=t[i[1]][0],T=t[i[1]][1],x=0;x=h&&_<=f||isNaN(_))&&(M>=S&&M<=T||isNaN(M))&&(l[u++]=m),m++}g=!0}}if(!g)if(a===1)for(var x=0;x=h&&_<=f||isNaN(_))&&(l[u++]=A)}else for(var x=0;xt[N][1])&&(P=!1)}P&&(l[u++]=r.getRawIndex(x))}return ux[1]&&(x[1]=y)}}}},e.prototype.lttbDownSample=function(t,r){var n=this.clone([t],!0),i=n._chunks,a=i[t],o=this.count(),s=0,l=Math.floor(1/r),u=this.getRawIndex(0),c,h,f,d=new(Cc(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=u;for(var g=1;gc&&(c=h,f=S)}D>0&&Ds&&(m=s-c);for(var y=0;yg&&(g=_,d=c+y)}var w=this.getRawIndex(h),S=this.getRawIndex(d);hc-g&&(l=c-g,s.length=l);for(var m=0;mh[1]&&(h[1]=x),f[d++]=_}return a._count=d,a._indices=f,a._updateGetRawIdx(),a},e.prototype.each=function(t,r){if(this._count)for(var n=t.length,i=this._chunks,a=0,o=this.count();al&&(l=h)}return o=[s,l],this._extent[t]=o,o},e.prototype.getRawDataItem=function(t){var r=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(r);for(var n=[],i=this._chunks,a=0;a=0?this._indices[t]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function t(r,n,i,a){return $s(r[a],this._dimensions[a])}zb={arrayRows:t,objectRows:function(r,n,i,a){return $s(r[n],this._dimensions[a])},keyedColumns:t,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return $s(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),e}(),J6=function(){function e(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(t,r){this._sourceList=t,this._upstreamSignList=r,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var t=this._sourceHost,r=this._getUpstreamSourceManagers(),n=!!r.length,i,a;if(ym(t)){var o=t,s=void 0,l=void 0,u=void 0;if(n){var c=r[0];c.prepareSource(),u=c.getSource(),s=u.data,l=u.sourceFormat,a=[c._getVersionSign()]}else s=o.get("data",!0),l=Sn(s)?Zs:si,a=[];var h=this._getSourceMetaRawOption()||{},f=u&&u.metaRawOption||{},d=be(h.seriesLayoutBy,f.seriesLayoutBy)||null,g=be(h.sourceHeader,f.sourceHeader),m=be(h.dimensions,f.dimensions),y=d!==f.seriesLayoutBy||!!g!=!!f.sourceHeader||m;i=y?[dT(s,{seriesLayoutBy:d,sourceHeader:g,dimensions:m},l)]:[]}else{var x=t;if(n){var _=this._applyTransform(r);i=_.sourceList,a=_.upstreamSignList}else{var w=x.get("source",!0);i=[dT(w,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(i,a)},e.prototype._applyTransform=function(t){var r=this._sourceHost,n=r.get("transform",!0),i=r.get("fromTransformResult",!0);if(i!=null){var a="";t.length!==1&&DD(a)}var o,s=[],l=[];return j(t,function(u){u.prepareSource();var c=u.getSource(i||0),h="";i!=null&&!c&&DD(h),s.push(c),l.push(u._getVersionSign())}),n?o=iee(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[BQ(s[0])]),{sourceList:o,upstreamSignList:l}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),r=0;r1||r>0&&!e.noHeader;return j(e.blocks,function(i){var a=rV(i);a>=t&&(t=a+ +(n&&(!a||pT(i)&&!i.noHeader)))}),t}return 0}function fee(e,t,r,n){var i=t.noHeader,a=vee(rV(t)),o=[],s=t.blocks||[];Jr(!s||re(s)),s=s||[];var l=e.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(ge(u,l)){var c=new Y6(u[l],null);s.sort(function(m,y){return c.evaluate(m.sortParam,y.sortParam)})}else l==="seriesDesc"&&s.reverse()}j(s,function(m,y){var x=t.valueFormatter,_=tV(m)(x?Q(Q({},e),{valueFormatter:x}):e,m,y>0?a.html:0,n);_!=null&&o.push(_)});var h=e.renderMode==="richText"?o.join(a.richText):gT(n,o.join(""),i?r:a.html);if(i)return h;var f=uT(t.header,"ordinal",e.useUTC),d=eV(n,e.renderMode).nameStyle,g=Q6(n);return e.renderMode==="richText"?nV(e,f,d)+a.richText+h:gT(n,'
'+hn(f)+"
"+h,r)}function dee(e,t,r,n){var i=e.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,l=t.name,u=e.useUTC,c=t.valueFormatter||e.valueFormatter||function(S){return S=re(S)?S:[S],ae(S,function(T,M){return uT(T,re(d)?d[M]:d,u)})};if(!(a&&o)){var h=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||K.color.secondary,i),f=a?"":uT(l,"ordinal",u),d=t.valueType,g=o?[]:c(t.value,t.dataIndex),m=!s||!a,y=!s&&a,x=eV(n,i),_=x.nameStyle,w=x.valueStyle;return i==="richText"?(s?"":h)+(a?"":nV(e,f,_))+(o?"":mee(e,g,m,y,w)):gT(n,(s?"":h)+(a?"":pee(f,!s,_))+(o?"":gee(g,m,y,w)),r)}}function ED(e,t,r,n,i,a){if(e){var o=tV(e),s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:t,valueFormatter:e.valueFormatter};return o(s,e,0,a)}}function vee(e){return{html:cee[e],richText:hee[e]}}function gT(e,t,r){var n='
',i="margin: "+r+"px 0 0",a=Q6(e);return'
'+t+n+"
"}function pee(e,t,r){var n=t?"margin-left:2px":"";return''+hn(e)+""}function gee(e,t,r,n){var i=r?"10px":"20px",a=t?"float:right;margin-left:"+i:"";return e=re(e)?e:[e],''+ae(e,function(o){return hn(o)}).join("  ")+""}function nV(e,t,r){return e.markupStyleCreator.wrapRichTextStyle(t,r)}function mee(e,t,r,n,i){var a=[i],o=n?10:20;return r&&a.push({padding:[0,0,0,o],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(re(t)?t.join(" "):t,a)}function iV(e,t){var r=e.getData().getItemVisual(t,"style"),n=r[e.visualDrawType];return Vu(n)}function aV(e,t){var r=e.get("padding");return r??(t==="richText"?[8,10]:10)}var Bb=function(){function e(){this.richTextStyles={},this._nextStyleNameId=fF()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(t,r,n){var i=n==="richText"?this._generateStyleName():null,a=x6({color:r,type:t,renderMode:n,markerId:i});return he(a)?a:(this.richTextStyles[i]=a.style,a.content)},e.prototype.wrapRichTextStyle=function(t,r){var n={};re(r)?j(r,function(a){return Q(n,a)}):Q(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},e}();function oV(e){var t=e.series,r=e.dataIndex,n=e.multipleSeries,i=t.getData(),a=i.mapDimensionsAll("defaultedTooltip"),o=a.length,s=t.getRawValue(r),l=re(s),u=iV(t,r),c,h,f,d;if(o>1||l&&!o){var g=yee(s,t,r,a,u);c=g.inlineValues,h=g.inlineValueTypes,f=g.blocks,d=g.inlineValues[0]}else if(o){var m=i.getDimensionInfo(a[0]);d=c=Vh(i,r,a[0]),h=m.type}else d=c=l?s[0]:s;var y=nA(t),x=y&&t.name||"",_=i.getName(r),w=n?x:_;return gr("section",{header:x,noHeader:n||!y,sortParam:d,blocks:[gr("nameValue",{markerType:"item",markerColor:u,name:w,noName:!Jn(w),value:c,valueType:h,dataIndex:r})].concat(f||[])})}function yee(e,t,r,n,i){var a=t.getData(),o=Ei(e,function(h,f,d){var g=a.getDimensionInfo(d);return h=h||g&&g.tooltip!==!1&&g.displayName!=null},!1),s=[],l=[],u=[];n.length?j(n,function(h){c(Vh(a,r,h),h)}):j(e,c);function c(h,f){var d=a.getDimensionInfo(f);!d||d.otherDims.tooltip===!1||(o?u.push(gr("nameValue",{markerType:"subItem",markerColor:i,name:d.displayName,value:h,valueType:d.type})):(s.push(h),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var as=Ye();function xm(e,t){return e.getName(t)||e.getId(t)}var Ry="__universalTransitionEnabled",bt=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r._selectedDataIndicesMap={},r}return t.prototype.init=function(r,n,i){this.seriesIndex=this.componentIndex,this.dataTask=bv({count:_ee,reset:bee}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=as(this).sourceManager=new J6(this);a.prepareSource();var o=this.getInitialData(r,i);RD(o,this),this.dataTask.context.data=o,as(this).dataBeforeProcessed=o,jD(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(r,n){var i=op(this),a=i?Ju(r):{},o=this.subType;$e.hasClass(o)&&(o+="Series"),Ge(r,n.getTheme().get(this.subType)),Ge(r,this.getDefaultOption()),ju(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&Ka(r,a,i)},t.prototype.mergeOption=function(r,n){r=Ge(this.option,r,!0),this.fillDataTextStyle(r.data);var i=op(this);i&&Ka(this.option,r,i);var a=as(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);RD(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,as(this).dataBeforeProcessed=o,jD(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(r){if(r&&!Sn(r))for(var n=["show"],i=0;i=0&&f<0)&&(h=_,f=x,d=0),x===f&&(c[d++]=m))}),c.length=d,c},t.prototype.formatTooltip=function(r,n,i){return oV({series:this,dataIndex:r,multipleSeries:n})},t.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(Je.node&&!(r&&r.ssr))return!1;var n=this.getShallow("animation");return n&&this.getData().count()>this.getShallow("animationThreshold")&&(n=!1),!!n},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(r,n,i){var a=this.ecModel,o=FA.prototype.getColorFromPalette.call(this,r,n,i);return o||(o=a.getColorFromPalette(r,n,i)),o},t.prototype.coordDimToDataDim=function(r){return this.getRawData().mapDimensionsAll(r)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(r,n){this._innerSelect(this.getData(n),r)},t.prototype.unselect=function(r,n){var i=this.option.selectedMap;if(i){var a=this.option.selectedMode,o=this.getData(n);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&i.push(o)}return i},t.prototype.isSelected=function(r,n){var i=this.option.selectedMap;if(!i)return!1;var a=this.getData(n);return(i==="all"||i[xm(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[Ry])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},t.prototype._innerSelect=function(r,n){var i,a,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){ke(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,c=0;c0&&this._innerSelect(r,n)}},t.registerClass=function(r){return $e.registerClass(r)},t.protoInitialize=function(){var r=t.prototype;r.type="series.__base__",r.seriesIndex=0,r.ignoreStyleOnData=!1,r.hasSymbolVisual=!1,r.defaultSymbol="circle",r.visualStyleAccessPath="itemStyle",r.visualDrawType="fill"}(),t}($e);Qt(bt,M_);Qt(bt,FA);wF(bt,$e);function jD(e){var t=e.name;nA(e)||(e.name=xee(e)||t)}function xee(e){var t=e.getRawData(),r=t.mapDimensionsAll("seriesName"),n=[];return j(r,function(i){var a=t.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function _ee(e){return e.model.getRawData().count()}function bee(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),wee}function wee(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function RD(e,t){j(Eh(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(r){e.wrapMethod(r,Fe(See,t))})}function See(e,t){var r=mT(e);return r&&r.setOutputEnd((t||this).count()),t}function mT(e){var t=(e.ecModel||{}).scheduler,r=t&&t.getPipeline(e.uid);if(r){var n=r.currentTask;if(n){var i=n.agentStubMap;i&&(n=i.get(e.uid))}return n}}var Mt=function(){function e(){this.group=new Ce,this.uid=pf("viewComponent")}return e.prototype.init=function(t,r){},e.prototype.render=function(t,r,n,i){},e.prototype.dispose=function(t,r){},e.prototype.updateView=function(t,r,n,i){},e.prototype.updateLayout=function(t,r,n,i){},e.prototype.updateVisual=function(t,r,n,i){},e.prototype.toggleBlurSeries=function(t,r,n){},e.prototype.eachRendered=function(t){var r=this.group;r&&r.traverse(t)},e}();aA(Mt);d_(Mt);function yf(){var e=Ye();return function(t){var r=e(t),n=t.pipelineContext,i=!!r.large,a=!!r.progressiveRender,o=r.large=!!(n&&n.large),s=r.progressiveRender=!!(n&&n.progressiveRender);return(i!==o||a!==s)&&"reset"}}var sV=Ye(),Cee=yf(),gt=function(){function e(){this.group=new Ce,this.uid=pf("viewChart"),this.renderTask=bv({plan:Tee,reset:Mee}),this.renderTask.context={view:this}}return e.prototype.init=function(t,r){},e.prototype.render=function(t,r,n,i){},e.prototype.highlight=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&zD(a,i,"emphasis")},e.prototype.downplay=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&zD(a,i,"normal")},e.prototype.remove=function(t,r){this.group.removeAll()},e.prototype.dispose=function(t,r){},e.prototype.updateView=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.updateLayout=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.updateVisual=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.eachRendered=function(t){hl(this.group,t)},e.markUpdateMethod=function(t,r){sV(t).updateMethod=r},e.protoInitialize=function(){var t=e.prototype;t.type="chart"}(),e}();function OD(e,t,r){e&&np(e)&&(t==="emphasis"?Ho:Uo)(e,r)}function zD(e,t,r){var n=Ru(e,t),i=t&&t.highlightKey!=null?JK(t.highlightKey):null;n!=null?j(Tt(n),function(a){OD(e.getItemGraphicEl(a),r,i)}):e.eachItemGraphicEl(function(a){OD(a,r,i)})}aA(gt);d_(gt);function Tee(e){return Cee(e.model)}function Mee(e){var t=e.model,r=e.ecModel,n=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&sV(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,r,n,i),Aee[l]}var Aee={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},F0="\0__throttleOriginMethod",BD="\0__throttleRate",FD="\0__throttleType";function k_(e,t,r){var n,i=0,a=0,o=null,s,l,u,c;t=t||0;function h(){a=new Date().getTime(),o=null,e.apply(l,u||[])}var f=function(){for(var d=[],g=0;g=0?h():o=setTimeout(h,-s),i=n};return f.clear=function(){o&&(clearTimeout(o),o=null)},f.debounceNextCall=function(d){c=d},f}function xf(e,t,r,n){var i=e[t];if(i){var a=i[F0]||i,o=i[FD],s=i[BD];if(s!==r||o!==n){if(r==null||!n)return e[t]=a;i=e[t]=k_(a,r,n==="debounce"),i[F0]=a,i[FD]=n,i[BD]=r}return i}}function lp(e,t){var r=e[t];r&&r[F0]&&(r.clear&&r.clear(),e[t]=r[F0])}var VD=Ye(),GD={itemStyle:Ou(c6,!0),lineStyle:Ou(u6,!0)},kee={lineStyle:"stroke",itemStyle:"fill"};function lV(e,t){var r=e.visualStyleMapper||GD[t];return r||(console.warn("Unknown style type '"+t+"'."),GD.itemStyle)}function uV(e,t){var r=e.visualDrawType||kee[t];return r||(console.warn("Unknown style type '"+t+"'."),"fill")}var Lee={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=e.getModel(n),a=lV(e,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=uV(e,n),u=o[l],c=we(u)?u:null,h=o.fill==="auto"||o.stroke==="auto";if(!o[l]||c||h){var f=e.getColorFromPalette(e.name,null,t.getSeriesCount());o[l]||(o[l]=f,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||we(o.fill)?f:o.fill,o.stroke=o.stroke==="auto"||we(o.stroke)?f:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!t.isSeriesFiltered(e)&&c)return r.setVisual("colorFromPalette",!1),{dataEach:function(d,g){var m=e.getDataParams(g),y=Q({},o);y[l]=c(m),d.setItemVisual(g,"style",y)}}}},dd=new qe,Nee={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=lV(e,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){dd.option=l[n];var u=i(dd),c=o.ensureUniqueItemVisual(s,"style");Q(c,u),dd.option.decal&&(o.setItemVisual(s,"decal",dd.option.decal),dd.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},Pee={performRawSeries:!0,overallReset:function(e){var t=_e();e.eachSeries(function(r){var n=r.getColorBy();if(!r.isColorBySeries()){var i=r.type+"-"+n,a=t.get(i);a||(a={},t.set(i,a)),VD(r).scope=a}}),e.eachSeries(function(r){if(!(r.isColorBySeries()||e.isSeriesFiltered(r))){var n=r.getRawData(),i={},a=r.getData(),o=VD(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=uV(r,s);a.each(function(u){var c=a.getRawIndex(u);i[c]=u}),n.each(function(u){var c=i[u],h=a.getItemVisual(c,"colorFromPalette");if(h){var f=a.ensureUniqueItemVisual(c,"style"),d=n.getName(u)||u+"",g=n.count();f[l]=r.getColorFromPalette(d,o,g)}})}})}},_m=Math.PI;function Iee(e,t){t=t||{},Ae(t,{text:"loading",textColor:K.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:K.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var r=new Ce,n=new Ze({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});r.add(n);var i=new tt({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new Ze({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});r.add(a);var o;return t.showSpinner&&(o=new Wp({shape:{startAngle:-_m/2,endAngle:-_m/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:_m*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:_m*3/2}).delay(300).start("circularInOut"),r.add(o)),r.resize=function(){var s=i.getBoundingRect().width,l=t.showSpinner?t.spinnerRadius:0,u=(e.getWidth()-l*2-(t.showSpinner&&s?10:0)-s)/2-(t.showSpinner&&s?0:5+s/2)+(t.showSpinner?0:s/2)+(s?0:l),c=e.getHeight()/2;t.showSpinner&&o.setShape({cx:u,cy:c}),a.setShape({x:u-l,y:c-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},r.resize(),r}var cV=function(){function e(t,r,n,i){this._stageTaskMap=_e(),this.ecInstance=t,this.api=r,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return e.prototype.restoreData=function(t,r){t.restoreData(r),this._stageTaskMap.each(function(n){var i=n.overallTask;i&&i.dirty()})},e.prototype.getPerformArgs=function(t,r){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,a=!r&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex,o=a?n.step:null,s=i&&i.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},e.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},e.prototype.updateStreamModes=function(t,r){var n=this._pipelineMap.get(t.uid),i=t.getData(),a=i.count(),o=n.progressiveEnabled&&r.incrementalPrepareRender&&a>=n.threshold,s=t.get("large")&&a>=t.get("largeThreshold"),l=t.get("progressiveChunkMode")==="mod"?a:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:l,large:s}},e.prototype.restorePipelines=function(t){var r=this,n=r._pipelineMap=_e();t.eachSeries(function(i){var a=i.getProgressive(),o=i.uid;n.set(o,{id:o,head:null,tail:null,threshold:i.getProgressiveThreshold(),progressiveEnabled:a&&!(i.preventIncremental&&i.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),r._pipe(i,i.dataTask)})},e.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,r=this.api.getModel(),n=this.api;j(this._allHandlers,function(i){var a=t.get(i.uid)||t.set(i.uid,{}),o="";Jr(!(i.reset&&i.overallReset),o),i.reset&&this._createSeriesStageTask(i,a,r,n),i.overallReset&&this._createOverallStageTask(i,a,r,n)},this)},e.prototype.prepareView=function(t,r,n,i){var a=t.renderTask,o=a.context;o.model=r,o.ecModel=n,o.api=i,a.__block=!t.incrementalPrepareRender,this._pipe(r,a)},e.prototype.performDataProcessorTasks=function(t,r){this._performStageTasks(this._dataProcessorHandlers,t,r,{block:!0})},e.prototype.performVisualTasks=function(t,r,n){this._performStageTasks(this._visualHandlers,t,r,n)},e.prototype._performStageTasks=function(t,r,n,i){i=i||{};var a=!1,o=this;j(t,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var c=o._stageTaskMap.get(l.uid),h=c.seriesTaskMap,f=c.overallTask;if(f){var d,g=f.agentStubMap;g.each(function(y){s(i,y)&&(y.dirty(),d=!0)}),d&&f.dirty(),o.updatePayload(f,n);var m=o.getPerformArgs(f,i.block);g.each(function(y){y.perform(m)}),f.perform(m)&&(a=!0)}else h&&h.each(function(y,x){s(i,y)&&y.dirty();var _=o.getPerformArgs(y,i.block);_.skip=!l.performRawSeries&&r.isSeriesFiltered(y.context.model),o.updatePayload(y,n),y.perform(_)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},e.prototype.performSeriesTasks=function(t){var r;t.eachSeries(function(n){r=n.dataTask.perform()||r}),this.unfinished=r||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each(function(t){var r=t.tail;do{if(r.__block){t.blockIndex=r.__idxInPipeline;break}r=r.getUpstream()}while(r)})},e.prototype.updatePayload=function(t,r){r!=="remain"&&(t.context.payload=r)},e.prototype._createSeriesStageTask=function(t,r,n,i){var a=this,o=r.seriesTaskMap,s=r.seriesTaskMap=_e(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(c):l?n.eachRawSeriesByType(l,c):u&&u(n,i).each(c);function c(h){var f=h.uid,d=s.set(f,o&&o.get(f)||bv({plan:Oee,reset:zee,count:Fee}));d.context={model:h,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:a},a._pipe(h,d)}},e.prototype._createOverallStageTask=function(t,r,n,i){var a=this,o=r.overallTask=r.overallTask||bv({reset:Dee});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=_e(),u=t.seriesType,c=t.getTargetSeries,h=!0,f=!1,d="";Jr(!t.createOnAllSeries,d),u?n.eachRawSeriesByType(u,g):c?c(n,i).each(g):(h=!1,j(n.getSeries(),g));function g(m){var y=m.uid,x=l.set(y,s&&s.get(y)||(f=!0,bv({reset:Eee,onDirty:Ree})));x.context={model:m,overallProgress:h},x.agent=o,x.__block=h,a._pipe(m,x)}f&&o.dirty()},e.prototype._pipe=function(t,r){var n=t.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=r),i.tail&&i.tail.pipe(r),i.tail=r,r.__idxInPipeline=i.count++,r.__pipeline=i},e.wrapStageHandler=function(t,r){return we(t)&&(t={overallReset:t,seriesType:Vee(t)}),t.uid=pf("stageHandler"),r&&(t.visualType=r),t},e}();function Dee(e){e.overallReset(e.ecModel,e.api,e.payload)}function Eee(e){return e.overallProgress&&jee}function jee(){this.agent.dirty(),this.getDownstream().dirty()}function Ree(){this.agent&&this.agent.dirty()}function Oee(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function zee(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=Tt(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?ae(t,function(r,n){return hV(n)}):Bee}var Bee=hV(0);function hV(e){return function(t,r){var n=r.data,i=r.resetDefines[e];if(i&&i.dataEach)for(var a=t.start;a0&&d===u.length-f.length){var g=u.slice(0,d);g!=="data"&&(r.mainType=g,r[f.toLowerCase()]=l,c=!0)}}s.hasOwnProperty(u)&&(n[u]=l,c=!0),c||(i[u]=l)})}return{cptQuery:r,dataQuery:n,otherQuery:i}},e.prototype.filter=function(t,r){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,a=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=r.cptQuery,u=r.dataQuery;return c(l,o,"mainType")&&c(l,o,"subType")&&c(l,o,"index","componentIndex")&&c(l,o,"name")&&c(l,o,"id")&&c(u,a,"name")&&c(u,a,"dataIndex")&&c(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,r.otherQuery,i,a));function c(h,f,d,g){return h[d]==null||f[g||d]===h[d]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),yT=["symbol","symbolSize","symbolRotate","symbolOffset"],HD=yT.concat(["symbolKeepAspect"]),Hee={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData();if(e.legendIcon&&r.setVisual("legendIcon",e.legendIcon),!e.hasSymbolVisual)return;for(var n={},i={},a=!1,o=0;o=0&&pu(l)?l:.5;var u=e.createRadialGradient(o,s,0,o,s,l);return u}function xT(e,t,r){for(var n=t.type==="radial"?ate(e,t,r):ite(e,t,r),i=t.colorStops,a=0;a0)?null:e==="dashed"?[4*t,2*t]:e==="dotted"?[t]:rt(e)?[e]:re(e)?e:null}function $A(e){var t=e.style,r=t.lineDash&&t.lineWidth>0&&ste(t.lineDash,t.lineWidth),n=t.lineDashOffset;if(r){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(r=ae(r,function(a){return a/i}),n/=i)}return[r,n]}var lte=new qa(!0);function W0(e){var t=e.stroke;return!(t==null||t==="none"||!(e.lineWidth>0))}function UD(e){return typeof e=="string"&&e!=="none"}function H0(e){var t=e.fill;return t!=null&&t!=="none"}function ZD(e,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var r=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=r}else e.fill()}function $D(e,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var r=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=r}else e.stroke()}function _T(e,t,r){var n=oA(t.image,t.__image,r);if(v_(n)){var i=e.createPattern(n,t.repeat||"repeat");if(typeof DOMMatrix=="function"&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*cv),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function ute(e,t,r,n){var i,a=W0(r),o=H0(r),s=r.strokePercent,l=s<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var c=t.path||lte,h=t.__dirty;if(!n){var f=r.fill,d=r.stroke,g=o&&!!f.colorStops,m=a&&!!d.colorStops,y=o&&!!f.image,x=a&&!!d.image,_=void 0,w=void 0,S=void 0,T=void 0,M=void 0;(g||m)&&(M=t.getBoundingRect()),g&&(_=h?xT(e,f,M):t.__canvasFillGradient,t.__canvasFillGradient=_),m&&(w=h?xT(e,d,M):t.__canvasStrokeGradient,t.__canvasStrokeGradient=w),y&&(S=h||!t.__canvasFillPattern?_T(e,f,t):t.__canvasFillPattern,t.__canvasFillPattern=S),x&&(T=h||!t.__canvasStrokePattern?_T(e,d,t):t.__canvasStrokePattern,t.__canvasStrokePattern=T),g?e.fillStyle=_:y&&(S?e.fillStyle=S:o=!1),m?e.strokeStyle=w:x&&(T?e.strokeStyle=T:a=!1)}var A=t.getGlobalScale();c.setScale(A[0],A[1],t.segmentIgnoreThreshold);var P,I;e.setLineDash&&r.lineDash&&(i=$A(t),P=i[0],I=i[1]);var N=!0;(u||h&Wc)&&(c.setDPR(e.dpr),l?c.setContext(null):(c.setContext(e),N=!1),c.reset(),t.buildPath(c,t.shape,n),c.toStatic(),t.pathUpdated()),N&&c.rebuildPath(e,l?s:1),P&&(e.setLineDash(P),e.lineDashOffset=I),n||(r.strokeFirst?(a&&$D(e,r),o&&ZD(e,r)):(o&&ZD(e,r),a&&$D(e,r))),P&&e.setLineDash([])}function cte(e,t,r){var n=t.__image=oA(r.image,t.__image,t,t.onload);if(!(!n||!v_(n))){var i=r.x||0,a=r.y||0,o=t.getWidth(),s=t.getHeight(),l=n.width/n.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=n.width,s=n.height),r.sWidth&&r.sHeight){var u=r.sx||0,c=r.sy||0;e.drawImage(n,u,c,r.sWidth,r.sHeight,i,a,o,s)}else if(r.sx&&r.sy){var u=r.sx,c=r.sy,h=o-u,f=s-c;e.drawImage(n,u,c,h,f,i,a,o,s)}else e.drawImage(n,i,a,o,s)}}function hte(e,t,r){var n,i=r.text;if(i!=null&&(i+=""),i){e.font=r.font||Go,e.textAlign=r.textAlign,e.textBaseline=r.textBaseline;var a=void 0,o=void 0;e.setLineDash&&r.lineDash&&(n=$A(t),a=n[0],o=n[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),r.strokeFirst?(W0(r)&&e.strokeText(i,r.x,r.y),H0(r)&&e.fillText(i,r.x,r.y)):(H0(r)&&e.fillText(i,r.x,r.y),W0(r)&&e.strokeText(i,r.x,r.y)),a&&e.setLineDash([])}}var YD=["shadowBlur","shadowOffsetX","shadowOffsetY"],XD=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function mV(e,t,r,n,i){var a=!1;if(!n&&(r=r||{},t===r))return!1;if(n||t.opacity!==r.opacity){Dn(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?_u.opacity:o}(n||t.blend!==r.blend)&&(a||(Dn(e,i),a=!0),e.globalCompositeOperation=t.blend||_u.blend);for(var s=0;s0&&r.unfinished);r.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(r,n,i){if(!this[xr]){if(this._disposed){this.id;return}var a,o,s;if(ke(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[xr]=!0,Lc(this),!this._model||n){var l=new TQ(this._api),u=this._theme,c=this._model=new VA;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},CT);var h={seriesTransition:s,optionChanged:!0};if(i)this[Rr]={silent:a,updateParams:h},this[xr]=!1,this.getZr().wakeUp();else{try{Wl(this),po.update.call(this,null,h)}catch(f){throw this[Rr]=null,this[xr]=!1,f}this._ssr||this._zr.flush(),this[Rr]=null,this[xr]=!1,Ac.call(this,a),kc.call(this,a)}}},t.prototype.setTheme=function(r,n){if(!this[xr]){if(this._disposed){this.id;return}var i=this._model;if(i){var a=n&&n.silent,o=null;this[Rr]&&(a==null&&(a=this[Rr].silent),o=this[Rr].updateParams,this[Rr]=null),this[xr]=!0,Lc(this);try{this._updateTheme(r),i.setTheme(this._theme),Wl(this),po.update.call(this,{type:"setTheme"},o)}catch(s){throw this[xr]=!1,s}this[xr]=!1,Ac.call(this,a),kc.call(this,a)}}},t.prototype._updateTheme=function(r){he(r)&&(r=RV[r]),r&&(r=Se(r),r&&B6(r,!0),this._theme=r)},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||Je.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(r){return this.renderToCanvas(r)},t.prototype.renderToCanvas=function(r){r=r||{};var n=this._zr.painter;return n.getRenderedCanvas({backgroundColor:r.backgroundColor||this._model.get("backgroundColor"),pixelRatio:r.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(r){r=r||{};var n=this._zr.painter;return n.renderToString({useViewBox:r.useViewBox})},t.prototype.getSvgDataURL=function(){var r=this._zr,n=r.storage.getDisplayList();return j(n,function(i){i.stopAnimation(null,!0)}),r.painter.toDataURL()},t.prototype.getDataURL=function(r){if(this._disposed){this.id;return}r=r||{};var n=r.excludeComponents,i=this._model,a=[],o=this;j(n,function(l){i.eachComponent({mainType:l},function(u){var c=o._componentsMap[u.__viewId];c.group.ignore||(a.push(c),c.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return j(a,function(l){l.group.ignore=!1}),s},t.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var n=r.type==="svg",i=this.group,a=Math.min,o=Math.max,s=1/0;if(Y0[i]){var l=s,u=s,c=-s,h=-s,f=[],d=r&&r.pixelRatio||this.getDevicePixelRatio();j(Su,function(w,S){if(w.group===i){var T=n?w.getZr().painter.getSvgDom().innerHTML:w.renderToCanvas(Se(r)),M=w.getDom().getBoundingClientRect();l=a(M.left,l),u=a(M.top,u),c=o(M.right,c),h=o(M.bottom,h),f.push({dom:T,left:M.left,top:M.top})}}),l*=d,u*=d,c*=d,h*=d;var g=c-l,m=h-u,y=Bn.createCanvas(),x=GC(y,{renderer:n?"svg":"canvas"});if(x.resize({width:g,height:m}),n){var _="";return j(f,function(w){var S=w.left-l,T=w.top-u;_+=''+w.dom+""}),x.painter.getSvgRoot().innerHTML=_,r.connectedBackgroundColor&&x.painter.setBackgroundColor(r.connectedBackgroundColor),x.refreshImmediately(),x.painter.toDataURL()}else return r.connectedBackgroundColor&&x.add(new Ze({shape:{x:0,y:0,width:g,height:m},style:{fill:r.connectedBackgroundColor}})),j(f,function(w){var S=new Er({style:{x:w.left*d-l,y:w.top*d-u,image:w.dom}});x.add(S)}),x.refreshImmediately(),y.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},t.prototype.convertToPixel=function(r,n,i){return Cm(this,"convertToPixel",r,n,i)},t.prototype.convertToLayout=function(r,n,i){return Cm(this,"convertToLayout",r,n,i)},t.prototype.convertFromPixel=function(r,n,i){return Cm(this,"convertFromPixel",r,n,i)},t.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=_h(i,r);return j(o,function(s,l){l.indexOf("Models")>=0&&j(s,function(u){var c=u.coordinateSystem;if(c&&c.containPoint)a=a||!!c.containPoint(n);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint&&(a=a||h.containPoint(n,u))}},this)},this),!!a},t.prototype.getVisual=function(r,n){var i=this._model,a=_h(i,r,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?ZA(s,l,n):Yp(s,n)},t.prototype.getViewOfComponentModel=function(r){return this._componentsMap[r.__viewId]},t.prototype.getViewOfSeriesModel=function(r){return this._chartsMap[r.__viewId]},t.prototype._initEvents=function(){var r=this;j(Ote,function(i){var a=function(o){var s=r.getModel(),l=o.target,u,c=i==="globalout";if(c?u={}:l&&vu(l,function(m){var y=De(m);if(y&&y.dataIndex!=null){var x=y.dataModel||s.getSeriesByIndex(y.seriesIndex);return u=x&&x.getDataParams(y.dataIndex,y.dataType,l)||{},!0}else if(y.eventData)return u=Q({},y.eventData),!0},!0),u){var h=u.componentType,f=u.componentIndex;(h==="markLine"||h==="markPoint"||h==="markArea")&&(h="series",f=u.seriesIndex);var d=h&&f!=null&&s.getComponent(h,f),g=d&&r[d.mainType==="series"?"_chartsMap":"_componentsMap"][d.__viewId];u.event=o,u.type=i,r._$eventProcessor.eventInfo={targetEl:l,packedEvent:u,model:d,view:g},r.trigger(i,u)}};a.zrEventfulCallAtLast=!0,r._zr.on(i,a,r)});var n=this._messageCenter;j(wT,function(i,a){n.on(a,function(o){r.trigger(a,o)})}),Zee(n,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var r=this.getDom();r&&xF(this.getDom(),KA,"");var n=this,i=n._api,a=n._model;j(n._componentsViews,function(o){o.dispose(a,i)}),j(n._chartsViews,function(o){o.dispose(a,i)}),n._zr.dispose(),n._dom=n._model=n._chartsMap=n._componentsMap=n._chartsViews=n._componentsViews=n._scheduler=n._api=n._zr=n._throttledZrFlush=n._theme=n._coordSysMgr=n._messageCenter=null,delete Su[n.id]},t.prototype.resize=function(r){if(!this[xr]){if(this._disposed){this.id;return}this._zr.resize(r);var n=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!n){var i=n.resetOption("media"),a=r&&r.silent;this[Rr]&&(a==null&&(a=this[Rr].silent),i=!0,this[Rr]=null),this[xr]=!0,Lc(this);try{i&&Wl(this),po.update.call(this,{type:"resize",animation:Q({duration:0},r&&r.animation)})}catch(o){throw this[xr]=!1,o}this[xr]=!1,Ac.call(this,a),kc.call(this,a)}}},t.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(ke(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!TT[r]){var i=TT[r](this._api,n),a=this._zr;this._loadingFX=i,a.add(i)}},t.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(r){var n=Q({},r);return n.type=bT[r.type],n},t.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(ke(n)||(n={silent:!!n}),!!Z0[r.type]&&this._model){if(this[xr]){this._pendingActions.push(r);return}var i=n.silent;Ub.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&Je.browser.weChat&&this._throttledZrFlush(),Ac.call(this,i),kc.call(this,i)}},t.prototype.updateLabelLayout=function(){qi.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(r){if(this._disposed){this.id;return}var n=r.seriesIndex,i=this.getModel(),a=i.getSeriesByIndex(n);a.appendData(r),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=function(){Wl=function(h){var f=h._scheduler;f.restorePipelines(h._model),f.prepareStageTasks(),Wb(h,!0),Wb(h,!1),f.plan()},Wb=function(h,f){for(var d=h._model,g=h._scheduler,m=f?h._componentsViews:h._chartsViews,y=f?h._componentsMap:h._chartsMap,x=h._zr,_=h._api,w=0;wf.get("hoverLayerThreshold")&&!Je.node&&!Je.worker&&f.eachSeries(function(y){if(!y.preventUsingHoverLayer){var x=h._chartsMap[y.__viewId];x.__alive&&x.eachRendered(function(_){_.states.emphasis&&(_.states.emphasis.hoverLayer=!0)})}})}function s(h,f){var d=h.get("blendMode")||null;f.eachRendered(function(g){g.isGroup||(g.style.blend=d)})}function l(h,f){if(!h.preventAutoZ){var d=Fu(h);f.eachRendered(function(g){return w_(g,d.z,d.zlevel),!0})}}function u(h,f){f.eachRendered(function(d){if(!bh(d)){var g=d.getTextContent(),m=d.getTextGuideLine();d.stateTransition&&(d.stateTransition=null),g&&g.stateTransition&&(g.stateTransition=null),m&&m.stateTransition&&(m.stateTransition=null),d.hasState()?(d.prevStates=d.currentStates,d.clearStates()):d.prevStates&&(d.prevStates=null)}})}function c(h,f){var d=h.getModel("stateAnimation"),g=h.isAnimationEnabled(),m=d.get("duration"),y=m>0?{duration:m,delay:d.get("delay"),easing:d.get("easing")}:null;f.eachRendered(function(x){if(x.states&&x.states.emphasis){if(bh(x))return;if(x instanceof Ke&&QK(x),x.__dirty){var _=x.prevStates;_&&x.useStates(_)}if(g){x.stateTransition=y;var w=x.getTextContent(),S=x.getTextGuideLine();w&&(w.stateTransition=y),S&&(S.stateTransition=y)}x.__dirty&&a(x)}})}lE=function(h){return new(function(f){q(d,f);function d(){return f!==null&&f.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return h._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(g){for(;g;){var m=g.__ecComponentInfo;if(m!=null)return h._model.getComponent(m.mainType,m.index);g=g.parent}},d.prototype.enterEmphasis=function(g,m){Ho(g,m),di(h)},d.prototype.leaveEmphasis=function(g,m){Uo(g,m),di(h)},d.prototype.enterBlur=function(g){OF(g),di(h)},d.prototype.leaveBlur=function(g){fA(g),di(h)},d.prototype.enterSelect=function(g){zF(g),di(h)},d.prototype.leaveSelect=function(g){BF(g),di(h)},d.prototype.getModel=function(){return h.getModel()},d.prototype.getViewOfComponentModel=function(g){return h.getViewOfComponentModel(g)},d.prototype.getViewOfSeriesModel=function(g){return h.getViewOfSeriesModel(g)},d.prototype.getMainProcessVersion=function(){return h[wm]},d}(O6))(h)},jV=function(h){function f(d,g){for(var m=0;m=0)){cE.push(r);var a=cV.wrapStageHandler(r,i);a.__prio=t,a.__raw=r,e.push(a)}}function nk(e,t){TT[e]=t}function $te(e){CB({createCanvas:e})}function GV(e,t,r){var n=SV("registerMap");n&&n(e,t,r)}function Yte(e){var t=SV("getMap");return t&&t(e)}var WV=nee;dl(XA,Lee);dl(L_,Nee);dl(L_,Pee);dl(XA,Hee);dl(L_,Uee);dl(kV,xte);ek(B6);tk(Mte,OQ);nk("default",Iee);pa({type:bu,event:bu,update:bu},qt);pa({type:Ny,event:Ny,update:Ny},qt);pa({type:D0,event:cA,update:D0,action:qt,refineEvent:ik,publishNonRefinedEvent:!0});pa({type:JC,event:cA,update:JC,action:qt,refineEvent:ik,publishNonRefinedEvent:!0});pa({type:E0,event:cA,update:E0,action:qt,refineEvent:ik,publishNonRefinedEvent:!0});function ik(e,t,r,n){return{eventContent:{selected:YK(r),isFromClick:t.isFromClick||!1}}}QA("default",{});QA("dark",vV);var Xte={},hE=[],qte={registerPreprocessor:ek,registerProcessor:tk,registerPostInit:zV,registerPostUpdate:BV,registerUpdateLifecycle:N_,registerAction:pa,registerCoordinateSystem:FV,registerLayout:VV,registerVisual:dl,registerTransform:WV,registerLoading:nk,registerMap:GV,registerImpl:_te,PRIORITY:LV,ComponentModel:$e,ComponentView:Mt,SeriesModel:bt,ChartView:gt,registerComponentModel:function(e){$e.registerClass(e)},registerComponentView:function(e){Mt.registerClass(e)},registerSeriesModel:function(e){bt.registerClass(e)},registerChartView:function(e){gt.registerClass(e)},registerCustomSeries:function(e,t){TV(e,t)},registerSubTypeDefaulter:function(e,t){$e.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){aF(e,t)}};function He(e){if(re(e)){j(e,function(t){He(t)});return}Ve(hE,e)>=0||(hE.push(e),we(e)&&(e={install:e}),e.install(qte))}function pd(e){return e==null?0:e.length||1}function fE(e){return e}var Zo=function(){function e(t,r,n,i,a,o){this._old=t,this._new=r,this._oldKeyGetter=n||fE,this._newKeyGetter=i||fE,this.context=a,this._diffModeMultiple=o==="multiple"}return e.prototype.add=function(t){return this._add=t,this},e.prototype.update=function(t){return this._update=t,this},e.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},e.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},e.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},e.prototype.remove=function(t){return this._remove=t,this},e.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},e.prototype._executeOneToOne=function(){var t=this._old,r=this._new,n={},i=new Array(t.length),a=new Array(r.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(r,n,a,"_newKeyGetter");for(var o=0;o1){var c=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(c,o)}else u===1?(n[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,n)},e.prototype._executeMultiple=function(){var t=this._old,r=this._new,n={},i={},a=[],o=[];this._initIndexMap(t,n,a,"_oldKeyGetter"),this._initIndexMap(r,i,o,"_newKeyGetter");for(var s=0;s1&&f===1)this._updateManyToOne&&this._updateManyToOne(c,u),i[l]=null;else if(h===1&&f>1)this._updateOneToMany&&this._updateOneToMany(c,u),i[l]=null;else if(h===1&&f===1)this._update&&this._update(c,u),i[l]=null;else if(h>1&&f>1)this._updateManyToMany&&this._updateManyToMany(c,u),i[l]=null;else if(h>1)for(var d=0;d1)for(var s=0;s30}var gd=ke,os=ae,rre=typeof Int32Array>"u"?Array:Int32Array,nre="e\0\0",dE=-1,ire=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],are=["_approximateExtent"],vE,Mm,md,yd,Yb,xd,Xb,dn=function(){function e(t,r){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var n,i=!1;UV(t)?(n=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(i=!0,n=t),n=n||["x","y"];for(var a={},o=[],s={},l=!1,u={},c=0;c=r)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=i.getSource().sourceFormat,l=s===si;if(l&&!i.pure)for(var u=[],c=t;c0},e.prototype.ensureUniqueItemVisual=function(t,r){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var a=i[r];return a==null&&(a=this.getVisual(r),re(a)?a=a.slice():gd(a)&&(a=Q({},a)),i[r]=a),a},e.prototype.setItemVisual=function(t,r,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,gd(r)?Q(i,r):i[r]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(t,r){gd(t)?Q(this._layout,t):this._layout[t]=r},e.prototype.getLayout=function(t){return this._layout[t]},e.prototype.getItemLayout=function(t){return this._itemLayouts[t]},e.prototype.setItemLayout=function(t,r,n){this._itemLayouts[t]=n?Q(this._itemLayouts[t]||{},r):r},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(t,r){var n=this.hostModel&&this.hostModel.seriesIndex;KC(n,this.dataType,t,r),this._graphicEls[t]=r},e.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},e.prototype.eachItemGraphicEl=function(t,r){j(this._graphicEls,function(n,i){n&&t&&t.call(r,n,i)})},e.prototype.cloneShallow=function(t){return t||(t=new e(this._schema?this._schema:os(this.dimensions,this._getDimInfo,this),this.hostModel)),Yb(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(t,r){var n=this[t];we(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var i=n.apply(this,arguments);return r.apply(this,[i].concat(o_(arguments)))})},e.internalField=function(){vE=function(t){var r=t._invertedIndicesMap;j(r,function(n,i){var a=t._dimInfos[i],o=a.ordinalMeta,s=t._store;if(o){n=r[i]=new rre(o.categories.length);for(var l=0;l1&&(l+="__ec__"+c),i[r]=l}}}(),e}();function ore(e,t){return bf(e,t).dimensions}function bf(e,t){GA(e)||(e=WA(e)),t=t||{};var r=t.coordDimensions||[],n=t.dimensionsDefine||e.dimensionsDefine||[],i=_e(),a=[],o=lre(e,r,n,t.dimensionsCount),s=t.canOmitUnusedDimensions&&YV(o),l=n===e.dimensionsDefine,u=l?$V(e):ZV(n),c=t.encodeDefine;!c&&t.encodeDefaulter&&(c=t.encodeDefaulter(e,o));for(var h=_e(c),f=new q6(o),d=0;d0&&(n.name=i+(a-1)),a++,t.set(i,a)}}function lre(e,t,r,n){var i=Math.max(e.dimensionsDetectedCount||1,t.length,r.length,n||0);return j(t,function(a){var o;ke(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function ure(e,t,r){if(r||t.hasKey(e)){for(var n=0;t.hasKey(e+n);)n++;e+=n}return t.set(e,!0),e}var cre=function(){function e(t){this.coordSysDims=[],this.axisMap=_e(),this.categoryAxisMap=_e(),this.coordSysName=t}return e}();function hre(e){var t=e.get("coordinateSystem"),r=new cre(t),n=fre[t];if(n)return n(e,r,r.axisMap,r.categoryAxisMap),r}var fre={cartesian2d:function(e,t,r,n){var i=e.getReferringComponents("xAxis",Ht).models[0],a=e.getReferringComponents("yAxis",Ht).models[0];t.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),Nc(i)&&(n.set("x",i),t.firstCategoryDimIndex=0),Nc(a)&&(n.set("y",a),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,r,n){var i=e.getReferringComponents("singleAxis",Ht).models[0];t.coordSysDims=["single"],r.set("single",i),Nc(i)&&(n.set("single",i),t.firstCategoryDimIndex=0)},polar:function(e,t,r,n){var i=e.getReferringComponents("polar",Ht).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),Nc(a)&&(n.set("radius",a),t.firstCategoryDimIndex=0),Nc(o)&&(n.set("angle",o),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},geo:function(e,t,r,n){t.coordSysDims=["lng","lat"]},parallel:function(e,t,r,n){var i=e.ecModel,a=i.getComponent("parallel",e.get("parallelIndex")),o=t.coordSysDims=a.dimensions.slice();j(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),c=o[l];r.set(c,u),Nc(u)&&(n.set(c,u),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=l))})},matrix:function(e,t,r,n){var i=e.getReferringComponents("matrix",Ht).models[0];t.coordSysDims=["x","y"];var a=i.getDimensionModel("x"),o=i.getDimensionModel("y");r.set("x",a),r.set("y",o),n.set("x",a),n.set("y",o)}};function Nc(e){return e.get("type")==="category"}function XV(e,t,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;dre(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(e&&e.get("stack")),u,c,h,f;if(j(a,function(_,w){he(_)&&(a[w]=_={name:_}),l&&!_.isExtraCoord&&(!n&&!u&&_.ordinalMeta&&(u=_),!c&&_.type!=="ordinal"&&_.type!=="time"&&(!i||i===_.coordDim)&&(c=_))}),c&&!n&&!u&&(n=!0),c){h="__\0ecstackresult_"+e.id,f="__\0ecstackedover_"+e.id,u&&(u.createInvertedIndices=!0);var d=c.coordDim,g=c.type,m=0;j(a,function(_){_.coordDim===d&&m++});var y={name:h,coordDim:d,coordDimIndex:m,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},x={name:f,coordDim:f,coordDimIndex:m+1,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(y.storeDimIndex=s.ensureCalculationDimension(f,g),x.storeDimIndex=s.ensureCalculationDimension(h,g)),o.appendCalculationDimension(y),o.appendCalculationDimension(x)):(a.push(y),a.push(x))}return{stackedDimension:c&&c.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:f,stackResultDimension:h}}function dre(e){return!UV(e.schema)}function $o(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function ak(e,t){return $o(e,t)?e.getCalculationInfo("stackResultDimension"):t}function vre(e,t){var r=e.get("coordinateSystem"),n=mf.get(r),i;return t&&t.coordSysDims&&(i=ae(t.coordSysDims,function(a){var o={name:a},s=t.axisMap.get(a);if(s){var l=s.get("type");o.type=X0(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function pre(e,t,r){var n,i;return r&&j(e,function(a,o){var s=a.coordDim,l=r.categoryAxisMap.get(s);l&&(n==null&&(n=o),a.ordinalMeta=l.getOrdinalMeta(),t&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&n!=null&&(e[n].otherDims.itemName=0),n}function no(e,t,r){r=r||{};var n=t.getSourceManager(),i,a=!1;e?(a=!0,i=WA(e)):(i=n.getSource(),a=i.sourceFormat===si);var o=hre(t),s=vre(t,o),l=r.useEncodeDefaulter,u=we(l)?l:l?Fe(D6,s,t):null,c={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=bf(i,c),f=pre(h.dimensions,r.createInvertedIndices,o),d=a?null:n.getSharedDataStore(h),g=XV(t,{schema:h,store:d}),m=new dn(h,t);m.setCalculationInfo(g);var y=f!=null&&gre(i)?function(x,_,w,S){return S===f?w:this.defaultDimValueGetter(x,_,w,S)}:null;return m.hasItemOption=!1,m.initData(a?i:d,null,y),m}function gre(e){if(e.sourceFormat===si){var t=mre(e.data||[]);return!re(sf(t))}}function mre(e){for(var t=0;ti&&(o=a.interval=i);var s=a.intervalPrecision=hp(o),l=a.niceTickExtent=[ir(Math.ceil(e[0]/o)*o,s),ir(Math.floor(e[1]/o)*o,s)];return xre(l,e),a}function qb(e){var t=Math.pow(10,f_(e)),r=e/t;return r?r===2?r=3:r===3?r=5:r*=2:r=1,ir(r*t)}function hp(e){return ta(e)+2}function pE(e,t,r){e[t]=Math.max(Math.min(e[t],r[1]),r[0])}function xre(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),pE(e,0,t),pE(e,1,t),e[0]>e[1]&&(e[0]=e[1])}function ok(e,t){return e>=t[0]&&e<=t[1]}var _re=function(){function e(){this.normalize=gE,this.scale=mE}return e.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=fe(t.normalize,t),this.scale=fe(t.scale,t)):(this.normalize=gE,this.scale=mE)},e}();function gE(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function mE(e,t){return e*(t[1]-t[0])+t[0]}function AT(e,t,r){var n=Math.log(e);return[Math.log(r?t[0]:Math.max(0,t[0]))/n,Math.log(r?t[1]:Math.max(0,t[1]))/n]}var vl=function(){function e(t){this._calculator=new _re,this._setting=t||{},this._extent=[1/0,-1/0];var r=vr();r&&(this._brkCtx=r.createScaleBreakContext(),this._brkCtx.update(this._extent))}return e.prototype.getSetting=function(t){return this._setting[t]},e.prototype._innerUnionExtent=function(t){var r=this._extent;this._innerSetExtent(t[0]r[1]?t[1]:r[1])},e.prototype.unionExtentFromData=function(t,r){this._innerUnionExtent(t.getApproximateExtent(r))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(t,r){this._innerSetExtent(t,r)},e.prototype._innerSetExtent=function(t,r){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(r)||(n[1]=r),this._brkCtx&&this._brkCtx.update(n)},e.prototype.setBreaksFromOption=function(t){var r=vr();r&&this._innerSetBreak(r.parseAxisBreakOption(t,fe(this.parse,this)))},e.prototype._innerSetBreak=function(t){this._brkCtx&&(this._brkCtx.setBreaks(t),this._calculator.updateMethods(this._brkCtx),this._brkCtx.update(this._extent))},e.prototype._innerGetBreaks=function(){return this._brkCtx?this._brkCtx.breaks:[]},e.prototype.hasBreaks=function(){return this._brkCtx?this._brkCtx.hasBreaks():!1},e.prototype._getExtentSpanWithBreaks=function(){return this._brkCtx&&this._brkCtx.hasBreaks()?this._brkCtx.getExtentSpan():this._extent[1]-this._extent[0]},e.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(t){this._isBlank=t},e}();d_(vl);var bre=0,fp=function(){function e(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++bre,this._onCollect=t.onCollect}return e.createByAxisModel=function(t){var r=t.option,n=r.data,i=n&&ae(n,wre);return new e({categories:i,needCollect:!i,deduplication:r.dedplication!==!1})},e.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},e.prototype.parseAndCollect=function(t){var r,n=this._needCollect;if(!he(t)&&!n)return t;if(n&&!this._deduplication)return r=this.categories.length,this.categories[r]=t,this._onCollect&&this._onCollect(t,r),r;var i=this._getOrCreateMap();return r=i.get(t),r==null&&(n?(r=this.categories.length,this.categories[r]=t,i.set(t,r),this._onCollect&&this._onCollect(t,r)):r=NaN),r},e.prototype._getOrCreateMap=function(){return this._map||(this._map=_e(this.categories))},e}();function wre(e){return ke(e)&&e.value!=null?e.value:e+""}var Wh=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new fp({})),re(i)&&(i=new fp({categories:ae(i,function(a){return ke(a)?a.value:a})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return t.prototype.parse=function(r){return r==null?NaN:he(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},t.prototype.contain=function(r){return ok(r,this._extent)&&r>=0&&r=0&&r=0&&r=r},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type="ordinal",t}(vl);vl.registerClass(Wh);var ss=ir,Yo=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="interval",r._interval=0,r._intervalPrecision=2,r}return t.prototype.parse=function(r){return r==null||r===""?NaN:Number(r)},t.prototype.contain=function(r){return ok(r,this._extent)},t.prototype.normalize=function(r){return this._calculator.normalize(r,this._extent)},t.prototype.scale=function(r){return this._calculator.scale(r,this._extent)},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(r){this._interval=r,this._niceExtent=this._extent.slice(),this._intervalPrecision=hp(r)},t.prototype.getTicks=function(r){r=r||{};var n=this._interval,i=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=vr(),l=[];if(!n)return l;if(r.breakTicks==="only_break"&&s)return s.addBreaksToTicks(l,this._brkCtx.breaks,this._extent),l;var u=1e4;i[0]=0&&(h=ss(h+f*n,o))}if(l.length>0&&h===l[l.length-1].value)break;if(l.length>u)return[]}var d=l.length?l[l.length-1].value:a[1];return i[1]>d&&(r.expandToNicedExtent?l.push({value:ss(d+n,o)}):l.push({value:i[1]})),s&&s.pruneTicksByBreak(r.pruneByBreak,l,this._brkCtx.breaks,function(g){return g.value},this._interval,this._extent),r.breakTicks!=="none"&&s&&s.addBreaksToTicks(l,this._brkCtx.breaks,this._extent),l},t.prototype.getMinorTicks=function(r){for(var n=this.getTicks({expandToNicedExtent:!0}),i=[],a=this.getExtent(),o=1;oa[0]&&g0&&(a=a===null?s:Math.min(a,s))}r[n]=a}}return r}function QV(e){var t=Tre(e),r=[];return j(e,function(n){var i=n.coordinateSystem,a=i.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=t[l],c=Math.abs(o[1]-o[0]),h=a.scale.getExtent(),f=Math.abs(h[1]-h[0]);s=u?c/f*u:c}else{var d=n.getData();s=Math.abs(o[1]-o[0])/d.count()}var g=ce(n.get("barWidth"),s),m=ce(n.get("barMaxWidth"),s),y=ce(n.get("barMinWidth")||(iG(n)?.5:1),s),x=n.get("barGap"),_=n.get("barCategoryGap"),w=n.get("defaultBarGap");r.push({bandWidth:s,barWidth:g,barMaxWidth:m,barMinWidth:y,barGap:x,barCategoryGap:_,defaultBarGap:w,axisKey:sk(a),stackId:KV(n)})}),eG(r)}function eG(e){var t={};j(e,function(n,i){var a=n.axisKey,o=n.bandWidth,s=t[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:n.defaultBarGap||0,stacks:{}},l=s.stacks;t[a]=s;var u=n.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var c=n.barWidth;c&&!l[u].width&&(l[u].width=c,c=Math.min(s.remainedWidth,c),s.remainedWidth-=c);var h=n.barMaxWidth;h&&(l[u].maxWidth=h);var f=n.barMinWidth;f&&(l[u].minWidth=f);var d=n.barGap;d!=null&&(s.gap=d);var g=n.barCategoryGap;g!=null&&(s.categoryGap=g)});var r={};return j(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=Qe(a).length;s=Math.max(35-l*4,15)+"%"}var u=ce(s,o),c=ce(n.gap,1),h=n.remainedWidth,f=n.autoWidthCount,d=(h-u)/(f+(f-1)*c);d=Math.max(d,0),j(a,function(x){var _=x.maxWidth,w=x.minWidth;if(x.width){var S=x.width;_&&(S=Math.min(S,_)),w&&(S=Math.max(S,w)),x.width=S,h-=S+c*S,f--}else{var S=d;_&&_S&&(S=w),S!==d&&(x.width=S,h-=S+c*S,f--)}}),d=(h-u)/(f+(f-1)*c),d=Math.max(d,0);var g=0,m;j(a,function(x,_){x.width||(x.width=d),m=x,g+=x.width*(1+c)}),m&&(g-=m.width*c);var y=-g/2;j(a,function(x,_){r[i][_]=r[i][_]||{bandWidth:o,offset:y,width:x.width},y+=x.width*(1+c)})}),r}function Mre(e,t,r){if(e&&t){var n=e[sk(t)];return n}}function tG(e,t){var r=JV(e,t),n=QV(r);j(r,function(i){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=KV(i),u=n[sk(s)][l],c=u.offset,h=u.width;a.setLayout({bandWidth:u.bandWidth,offset:c,size:h})})}function rG(e){return{seriesType:e,plan:yf(),reset:function(t){if(nG(t)){var r=t.getData(),n=t.coordinateSystem,i=n.getBaseAxis(),a=n.getOtherAxis(i),o=r.getDimensionIndex(r.mapDimension(a.dim)),s=r.getDimensionIndex(r.mapDimension(i.dim)),l=t.get("showBackground",!0),u=r.mapDimension(a.dim),c=r.getCalculationInfo("stackResultDimension"),h=$o(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),d=Are(i,a),g=iG(t),m=t.get("barMinHeight")||0,y=c&&r.getDimensionIndex(c),x=r.getLayout("size"),_=r.getLayout("offset");return{progress:function(w,S){for(var T=w.count,M=g&&Oa(T*3),A=g&&l&&Oa(T*3),P=g&&Oa(T),I=n.master.getRect(),N=f?I.width:I.height,D,O=S.getStore(),R=0;(D=w.next())!=null;){var F=O.get(h?y:o,D),H=O.get(s,D),W=d,V=void 0;h&&(V=+F-O.get(o,D));var z=void 0,Z=void 0,U=void 0,$=void 0;if(f){var Y=n.dataToPoint([F,H]);if(h){var te=n.dataToPoint([V,H]);W=te[0]}z=W,Z=Y[1]+_,U=Y[0]-W,$=x,Math.abs(U)0?r:1:r))}var kre=function(e,t,r,n){for(;r>>1;e[i][1]i&&(this._approxInterval=i);var o=Am.length,s=Math.min(kre(Am,this._approxInterval,0,o),o-1);this._interval=Am[s][1],this._intervalPrecision=hp(this._interval),this._minLevelUnit=Am[Math.max(s-1,0)][0]},t.prototype.parse=function(r){return rt(r)?r:+to(r)},t.prototype.contain=function(r){return ok(r,this._extent)},t.prototype.normalize=function(r){return this._calculator.normalize(r,this._extent)},t.prototype.scale=function(r){return this._calculator.scale(r,this._extent)},t.type="time",t}(Yo),Am=[["second",MA],["minute",AA],["hour",xv],["quarter-day",xv*6],["half-day",xv*12],["day",Ti*1.2],["half-week",Ti*3.5],["week",Ti*7],["month",Ti*31],["quarter",Ti*95],["half-year",sD/2],["year",sD]];function aG(e,t,r,n){return z0(new Date(t),e,n).getTime()===z0(new Date(r),e,n).getTime()}function Lre(e,t){return e/=Ti,e>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function Nre(e){var t=30*Ti;return e/=t,e>6?6:e>3?3:e>2?2:1}function Pre(e){return e/=xv,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function yE(e,t){return e/=t?AA:MA,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function Ire(e){return tA(e,!0)}function Dre(e,t,r){var n=Math.max(0,Ve($n,t)-1);return z0(new Date(e),$n[n],r).getTime()}function Ere(e,t){var r=new Date(0);r[e](1);var n=r.getTime();r[e](1+t);var i=r.getTime()-n;return function(a,o){return Math.max(0,Math.round((o-a)/i))}}function jre(e,t,r,n,i,a){var o=1e4,s=$J,l=0;function u(R,F,H,W,V,z,Z){for(var U=Ere(V,R),$=F,Y=new Date($);$o));)if(Y[V](Y[W]()+R),$=Y.getTime(),a){var te=a.calcNiceTickMultiple($,U);te>0&&(Y[V](Y[W]()+te*R),$=Y.getTime())}Z.push({value:$,notAdd:!0})}function c(R,F,H){var W=[],V=!F.length;if(!aG(_v(R),n[0],n[1],r)){V&&(F=[{value:Dre(n[0],R,r)},{value:n[1]}]);for(var z=0;z=n[0]&&Z<=n[1]&&u($,Z,U,Y,te,ie,W),R==="year"&&H.length>1&&z===0&&H.unshift({value:H[0].value-$})}}for(var z=0;z=n[0]&&S<=n[1]&&d++)}var T=i/t;if(d>T*1.5&&g>T/1.5||(h.push(_),d>T||e===s[m]))break}f=[]}}}for(var M=ot(ae(h,function(R){return ot(R,function(F){return F.value>=n[0]&&F.value<=n[1]&&!F.notAdd})}),function(R){return R.length>0}),A=[],P=M.length-1,m=0;m0;)a*=10;var s=[LT(Ore(n[0]/a)*a),LT(Rre(n[1]/a)*a)];this._interval=a,this._intervalPrecision=hp(a),this._niceExtent=s}},t.prototype.calcNiceExtent=function(r){e.prototype.calcNiceExtent.call(this,r),this._fixMin=r.fixMin,this._fixMax=r.fixMax},t.prototype.contain=function(r){return r=Lm(r)/Lm(this.base),e.prototype.contain.call(this,r)},t.prototype.normalize=function(r){return r=Lm(r)/Lm(this.base),e.prototype.normalize.call(this,r)},t.prototype.scale=function(r){return r=e.prototype.scale.call(this,r),km(this.base,r)},t.prototype.setBreaksFromOption=function(r){var n=vr();if(n){var i=n.logarithmicParseBreaksFromOption(r,this.base,fe(this.parse,this)),a=i.parsedOriginal,o=i.parsedLogged;this._originalScale._innerSetBreak(a),this._innerSetBreak(o)}},t.type="log",t}(Yo);function Nm(e,t){return LT(e,ta(t))}vl.registerClass(oG);var zre=function(){function e(t,r,n){this._prepareParams(t,r,n)}return e.prototype._prepareParams=function(t,r,n){n[1]0&&l>0&&!u&&(s=0),s<0&&l<0&&!c&&(l=0));var f=this._determinedMin,d=this._determinedMax;return f!=null&&(s=f,u=!0),d!=null&&(l=d,c=!0),{min:s,max:l,minFixed:u,maxFixed:c,isBlank:h}},e.prototype.modifyDataMinMax=function(t,r){this[Fre[t]]=r},e.prototype.setDeterminedMinMax=function(t,r){var n=Bre[t];this[n]=r},e.prototype.freeze=function(){this.frozen=!0},e}(),Bre={min:"_determinedMin",max:"_determinedMax"},Fre={min:"_dataMin",max:"_dataMax"};function sG(e,t,r){var n=e.rawExtentInfo;return n||(n=new zre(e,t,r),e.rawExtentInfo=n,n)}function Pm(e,t){return t==null?null:Xr(t)?NaN:e.parse(t)}function lG(e,t){var r=e.type,n=sG(e,t,e.getExtent()).calculate();e.setBlank(n.isBlank);var i=n.min,a=n.max,o=t.ecModel;if(o&&r==="time"){var s=JV("bar",o),l=!1;if(j(s,function(h){l=l||h.getBaseAxis()===t.axis}),l){var u=QV(s),c=Vre(i,a,t,u);i=c.min,a=c.max}}return{extent:[i,a],fixMin:n.minFixed,fixMax:n.maxFixed}}function Vre(e,t,r,n){var i=r.axis.getExtent(),a=Math.abs(i[1]-i[0]),o=Mre(n,r.axis);if(o===void 0)return{min:e,max:t};var s=1/0;j(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;j(o,function(d){l=Math.max(d.offset+d.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=t-e,h=1-(s+l)/a,f=c/h-c;return t+=f*(l/u),e-=f*(s/u),{min:e,max:t}}function Gu(e,t){var r=t,n=lG(e,r),i=n.extent,a=r.get("splitNumber");e instanceof oG&&(e.base=r.get("logBase"));var o=e.type,s=r.get("interval"),l=o==="interval"||o==="time";e.setBreaksFromOption(cG(r)),e.setExtent(i[0],i[1]),e.calcNiceExtent({splitNumber:a,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:l?r.get("minInterval"):null,maxInterval:l?r.get("maxInterval"):null}),s!=null&&e.setInterval&&e.setInterval(s)}function Xp(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new Wh({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new lk({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(vl.getClass(t)||Yo)}}function Gre(e){var t=e.scale.getExtent(),r=t[0],n=t[1];return!(r>0&&n>0||r<0&&n<0)}function wf(e){var t=e.getLabelModel().get("formatter");if(e.type==="time"){var r=YJ(t);return function(i,a){return e.scale.getFormattedLabel(i,a,r)}}else{if(he(t))return function(i){var a=e.scale.getLabel(i),o=t.replace("{value}",a??"");return o};if(we(t)){if(e.type==="category")return function(i,a){return t(q0(e,i),i.value-e.scale.getExtent()[0],null)};var n=vr();return function(i,a){var o=null;return n&&(o=n.makeAxisLabelFormatterParamBreak(o,i.break)),t(q0(e,i),a,o)}}else return function(i){return e.scale.getLabel(i)}}}function q0(e,t){return e.type==="category"?e.scale.getLabel(t):t.value}function uk(e){var t=e.get("interval");return t??"auto"}function uG(e){return e.type==="category"&&uk(e.getLabelModel())===0}function K0(e,t){var r={};return j(e.mapDimensionsAll(t),function(n){r[ak(e,n)]=!0}),Qe(r)}function Wre(e,t,r){t&&j(K0(t,r),function(n){var i=t.getApproximateExtent(n);i[0]e[1]&&(e[1]=i[1])})}function Hh(e){return e==="middle"||e==="center"}function dp(e){return e.getShallow("show")}function cG(e){var t=e.get("breaks",!0);if(t!=null)return!vr()||!Hre(e.axis)?void 0:t}function Hre(e){return(e.dim==="x"||e.dim==="y"||e.dim==="z"||e.dim==="single")&&e.type!=="category"}var Sf=function(){function e(){}return e.prototype.getNeedCrossZero=function(){var t=this.option;return!t.scale},e.prototype.getCoordSysModel=function(){},e}();function Ure(e){return no(null,e)}var Zre={isDimensionStacked:$o,enableDataStack:XV,getStackedDimension:ak};function $re(e,t){var r=t;t instanceof qe||(r=new qe(t));var n=Xp(r);return n.setExtent(e[0],e[1]),Gu(n,r),n}function Yre(e){Qt(e,Sf)}function Xre(e,t){return t=t||{},Ct(e,null,null,t.state!=="normal")}const qre=Object.freeze(Object.defineProperty({__proto__:null,createDimensions:ore,createList:Ure,createScale:$re,createSymbol:sr,createTextStyle:Xre,dataStack:Zre,enableHoverEmphasis:Hs,getECData:De,getLayoutRect:It,mixinAxisModelCommonMethods:Yre},Symbol.toStringTag,{value:"Module"}));var Kre=1e-8;function xE(e,t){return Math.abs(e-t)i&&(n=o,i=l)}if(n)return Qre(n.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},t.prototype.getBoundingRect=function(r){var n=this._rect;if(n&&!r)return n;var i=[1/0,1/0],a=[-1/0,-1/0],o=this.geometries;return j(o,function(s){s.type==="polygon"?_E(s.exterior,i,a,r):j(s.points,function(l){_E(l,i,a,r)})}),isFinite(i[0])&&isFinite(i[1])&&isFinite(a[0])&&isFinite(a[1])||(i[0]=i[1]=a[0]=a[1]=0),n=new Pe(i[0],i[1],a[0]-i[0],a[1]-i[1]),r||(this._rect=n),n},t.prototype.contain=function(r){var n=this.getBoundingRect(),i=this.geometries;if(!n.contain(r[0],r[1]))return!1;e:for(var a=0,o=i.length;a>1^-(s&1),l=l>>1^-(l&1),s+=i,l+=a,i=s,a=l,n.push([s/r,l/r])}return n}function NT(e,t){return e=tne(e),ae(ot(e.features,function(r){return r.geometry&&r.properties&&r.geometry.coordinates.length>0}),function(r){var n=r.properties,i=r.geometry,a=[];switch(i.type){case"Polygon":var o=i.coordinates;a.push(new bE(o[0],o.slice(1)));break;case"MultiPolygon":j(i.coordinates,function(l){l[0]&&a.push(new bE(l[0],l.slice(1)))});break;case"LineString":a.push(new wE([i.coordinates]));break;case"MultiLineString":a.push(new wE(i.coordinates))}var s=new fG(n[t||"name"],a,n.cp);return s.properties=n,s})}const rne=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:HC,asc:Qn,getPercentWithPrecision:bq,getPixelPrecision:QM,getPrecision:ta,getPrecisionSafe:uF,isNumeric:rA,isRadianAroundZero:Oh,linearMap:ht,nice:tA,numericToNumber:Xa,parseDate:to,parsePercent:ce,quantile:Ly,quantity:hF,quantityExponent:f_,reformIntervals:UC,remRadian:eA,round:ir},Symbol.toStringTag,{value:"Module"})),nne=Object.freeze(Object.defineProperty({__proto__:null,format:Zp,parse:to,roundTime:z0},Symbol.toStringTag,{value:"Module"})),ine=Object.freeze(Object.defineProperty({__proto__:null,Arc:Wp,BezierCurve:hf,BoundingRect:Pe,Circle:ro,CompoundPath:Hp,Ellipse:Gp,Group:Ce,Image:Er,IncrementalDisplayable:KF,Line:ar,LinearGradient:qu,Polygon:en,Polyline:Gr,RadialGradient:pA,Rect:Ze,Ring:cf,Sector:Qr,Text:tt,clipPointsByRect:xA,clipRectByRect:r6,createIcon:df,extendPath:e6,extendShape:QF,getShapeClass:ip,getTransform:Us,initProps:Nt,makeImage:mA,makePath:Bh,mergePath:qn,registerShape:Fi,resizePath:yA,updateProps:it},Symbol.toStringTag,{value:"Module"})),ane=Object.freeze(Object.defineProperty({__proto__:null,addCommas:EA,capitalFirst:nQ,encodeHTML:hn,formatTime:rQ,formatTpl:RA,getTextRect:eQ,getTooltipMarker:x6,normalizeCssArray:gf,toCamelCase:jA,truncateText:eK},Symbol.toStringTag,{value:"Module"})),one=Object.freeze(Object.defineProperty({__proto__:null,bind:fe,clone:Se,curry:Fe,defaults:Ae,each:j,extend:Q,filter:ot,indexOf:Ve,inherits:UM,isArray:re,isFunction:we,isObject:ke,isString:he,map:ae,merge:Ge,reduce:Ei},Symbol.toStringTag,{value:"Module"}));var sne=Ye(),wv=Ye(),da={estimate:1,determine:2};function J0(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function vG(e,t){var r=ae(t,function(n){return e.scale.parse(n)});return e.type==="time"&&r.length>0&&(r.sort(),r.unshift(r[0]),r.push(r[r.length-1])),r}function lne(e,t){var r=e.getLabelModel().get("customValues");if(r){var n=wf(e),i=e.scale.getExtent(),a=vG(e,r),o=ot(a,function(s){return s>=i[0]&&s<=i[1]});return{labels:ae(o,function(s){var l={value:s};return{formattedLabel:n(l),rawLabel:e.scale.getLabel(l),tickValue:s,time:void 0,break:void 0}})}}return e.type==="category"?cne(e,t):fne(e)}function une(e,t,r){var n=e.getTickModel().get("customValues");if(n){var i=e.scale.getExtent(),a=vG(e,n);return{ticks:ot(a,function(o){return o>=i[0]&&o<=i[1]})}}return e.type==="category"?hne(e,t):{ticks:ae(e.scale.getTicks(r),function(o){return o.value})}}function cne(e,t){var r=e.getLabelModel(),n=pG(e,r,t);return!r.get("show")||e.scale.isBlank()?{labels:[]}:n}function pG(e,t,r){var n=vne(e),i=uk(t),a=r.kind===da.estimate;if(!a){var o=mG(n,i);if(o)return o}var s,l;we(i)?s=_G(e,i):(l=i==="auto"?pne(e,r):i,s=xG(e,l));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return PT(n,i,u),!0}):PT(n,i,u),u}function hne(e,t){var r=dne(e),n=uk(t),i=mG(r,n);if(i)return i;var a,o;if((!t.get("show")||e.scale.isBlank())&&(a=[]),we(n))a=_G(e,n,!0);else if(n==="auto"){var s=pG(e,e.getLabelModel(),J0(da.determine));o=s.labelCategoryInterval,a=ae(s.labels,function(l){return l.tickValue})}else o=n,a=xG(e,o,!0);return PT(r,n,{ticks:a,tickCategoryInterval:o})}function fne(e){var t=e.scale.getTicks(),r=wf(e);return{labels:ae(t,function(n,i){return{formattedLabel:r(n,i),rawLabel:e.scale.getLabel(n),tickValue:n.value,time:n.time,break:n.break}})}}var dne=gG("axisTick"),vne=gG("axisLabel");function gG(e){return function(r){return wv(r)[e]||(wv(r)[e]={list:[]})}}function mG(e,t){for(var r=0;rc&&(u=Math.max(1,Math.floor(l/c)));for(var h=s[0],f=e.dataToCoord(h+1)-e.dataToCoord(h),d=Math.abs(f*Math.cos(a)),g=Math.abs(f*Math.sin(a)),m=0,y=0;h<=s[1];h+=u){var x=0,_=0,w=c_(i({value:h}),n.font,"center","top");x=w.width*1.3,_=w.height*1.3,m=Math.max(m,x,7),y=Math.max(y,_,7)}var S=m/d,T=y/g;isNaN(S)&&(S=1/0),isNaN(T)&&(T=1/0);var M=Math.max(0,Math.floor(Math.min(S,T)));if(r===da.estimate)return t.out.noPxChangeTryDetermine.push(fe(mne,null,e,M,l)),M;var A=yG(e,M,l);return A??M}function mne(e,t,r){return yG(e,t,r)==null}function yG(e,t,r){var n=sne(e.model),i=e.getExtent(),a=n.lastAutoInterval,o=n.lastTickCount;if(a!=null&&o!=null&&Math.abs(a-t)<=1&&Math.abs(o-r)<=1&&a>t&&n.axisExtent0===i[0]&&n.axisExtent1===i[1])return a;n.lastTickCount=r,n.lastAutoInterval=t,n.axisExtent0=i[0],n.axisExtent1=i[1]}function yne(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}function xG(e,t,r){var n=wf(e),i=e.scale,a=i.getExtent(),o=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=a[0],c=i.count();u!==0&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=uG(e),f=o.get("showMinLabel")||h,d=o.get("showMaxLabel")||h;f&&u!==a[0]&&m(a[0]);for(var g=u;g<=a[1];g+=l)m(g);d&&g-l!==a[1]&&m(a[1]);function m(y){var x={value:y};s.push(r?y:{formattedLabel:n(x),rawLabel:i.getLabel(x),tickValue:y,time:void 0,break:void 0})}return s}function _G(e,t,r){var n=e.scale,i=wf(e),a=[];return j(n.getTicks(),function(o){var s=n.getLabel(o),l=o.value;t(o.value,s)&&a.push(r?l:{formattedLabel:i(o),rawLabel:s,tickValue:l,time:void 0,break:void 0})}),a}var SE=[0,1],Vi=function(){function e(t,r,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=r,this._extent=n||[0,0]}return e.prototype.contain=function(t){var r=this._extent,n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return t>=n&&t<=i},e.prototype.containData=function(t){return this.scale.contain(this.scale.parse(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(t){return QM(t||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(t,r){var n=this._extent;n[0]=t,n[1]=r},e.prototype.dataToCoord=function(t,r){var n=this._extent,i=this.scale;return t=i.normalize(i.parse(t)),this.onBand&&i.type==="ordinal"&&(n=n.slice(),CE(n,i.count())),ht(t,SE,n,r)},e.prototype.coordToData=function(t,r){var n=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(n=n.slice(),CE(n,i.count()));var a=ht(t,n,SE,r);return this.scale.scale(a)},e.prototype.pointToData=function(t,r){},e.prototype.getTicksCoords=function(t){t=t||{};var r=t.tickModel||this.getTickModel(),n=une(this,r,{breakTicks:t.breakTicks,pruneByBreak:t.pruneByBreak}),i=n.ticks,a=ae(i,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return xne(this,a,o,t.clamp),a},e.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var t=this.model.getModel("minorTick"),r=t.get("splitNumber");r>0&&r<100||(r=5);var n=this.scale.getMinorTicks(r),i=ae(n,function(a){return ae(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},e.prototype.getViewLabels=function(t){return t=t||J0(da.determine),lne(this,t).labels},e.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},e.prototype.getTickModel=function(){return this.model.getModel("axisTick")},e.prototype.getBandWidth=function(){var t=this._extent,r=this.scale.getExtent(),n=r[1]-r[0]+(this.onBand?1:0);n===0&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},e.prototype.calculateCategoryInterval=function(t){return t=t||J0(da.determine),gne(this,t)},e}();function CE(e,t){var r=e[1]-e[0],n=t,i=r/n/2;e[0]+=i,e[1]-=i}function xne(e,t,r,n){var i=t.length;if(!e.onBand||r||!i)return;var a=e.getExtent(),o,s;if(i===1)t[0].coord=a[0],t[0].onBand=!0,o=t[1]={coord:a[1],tickValue:t[0].tickValue,onBand:!0};else{var l=t[i-1].tickValue-t[0].tickValue,u=(t[i-1].coord-t[0].coord)/l;j(t,function(d){d.coord-=u/2,d.onBand=!0});var c=e.scale.getExtent();s=1+c[1]-t[i-1].tickValue,o={coord:t[i-1].coord+u*s,tickValue:c[1]+1,onBand:!0},t.push(o)}var h=a[0]>a[1];f(t[0].coord,a[0])&&(n?t[0].coord=a[0]:t.shift()),n&&f(a[0],t[0].coord)&&t.unshift({coord:a[0],onBand:!0}),f(a[1],o.coord)&&(n?o.coord=a[1]:t.pop()),n&&f(o.coord,a[1])&&t.push({coord:a[1],onBand:!0});function f(d,g){return d=ir(d),g=ir(g),h?d>g:di&&(i+=_d);var d=Math.atan2(s,o);if(d<0&&(d+=_d),d>=n&&d<=i||d+_d>=n&&d+_d<=i)return l[0]=c,l[1]=h,u-r;var g=r*Math.cos(n)+e,m=r*Math.sin(n)+t,y=r*Math.cos(i)+e,x=r*Math.sin(i)+t,_=(g-o)*(g-o)+(m-s)*(m-s),w=(y-o)*(y-o)+(x-s)*(x-s);return _0){t=t/180*Math.PI,ra.fromArray(e[0]),kt.fromArray(e[1]),rr.fromArray(e[2]),Ne.sub(za,ra,kt),Ne.sub(Ea,rr,kt);var r=za.len(),n=Ea.len();if(!(r<.001||n<.001)){za.scale(1/r),Ea.scale(1/n);var i=za.dot(Ea),a=Math.cos(t);if(a1&&Ne.copy(_n,rr),_n.toArray(e[1])}}}}function Lne(e,t,r){if(r<=180&&r>0){r=r/180*Math.PI,ra.fromArray(e[0]),kt.fromArray(e[1]),rr.fromArray(e[2]),Ne.sub(za,kt,ra),Ne.sub(Ea,rr,kt);var n=za.len(),i=Ea.len();if(!(n<.001||i<.001)){za.scale(1/n),Ea.scale(1/i);var a=za.dot(t),o=Math.cos(r);if(a=l)Ne.copy(_n,rr);else{_n.scaleAndAdd(Ea,s/Math.tan(Math.PI/2-c));var h=rr.x!==kt.x?(_n.x-kt.x)/(rr.x-kt.x):(_n.y-kt.y)/(rr.y-kt.y);if(isNaN(h))return;h<0?Ne.copy(_n,kt):h>1&&Ne.copy(_n,rr)}_n.toArray(e[1])}}}}function Qb(e,t,r,n){var i=r==="normal",a=i?e:e.ensureState(r);a.ignore=t;var o=n.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=n.getModel("lineStyle").getLineStyle();i?e.useStyle(s):a.style=s}function Nne(e,t){var r=t.smooth,n=t.points;if(n)if(e.moveTo(n[0][0],n[0][1]),r>0&&n.length>=3){var i=To(n[0],n[1]),a=To(n[1],n[2]);if(!i||!a){e.lineTo(n[1][0],n[1][1]),e.lineTo(n[2][0],n[2][1]);return}var o=Math.min(i,a)*r,s=fv([],n[1],n[0],o/i),l=fv([],n[1],n[2],o/a),u=fv([],s,l,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),e.bezierCurveTo(l[0],l[1],l[0],l[1],n[2][0],n[2][1])}else for(var c=1;c0){S(N*I,0,a);var D=N+A;D<0&&T(-D*I,1)}else T(-A*I,1)}}function S(A,P,I){A!==0&&(c=!0);for(var N=P;N0)for(var D=0;D0;D--){var H=I[D-1]*F;S(-H,D,a)}}}function M(A){var P=A<0?-1:1;A=Math.abs(A);for(var I=Math.ceil(A/(a-1)),N=0;N0?S(I,0,N+1):S(-I,a-N-1,a),A-=I,A<=0)return}return c}function Dne(e){for(var t=0;t=0&&n.attr(a.oldLayoutSelect),Ve(f,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),it(n,u,r,l)}else if(n.attr(u),!vf(n).valueAnimation){var h=be(n.style.opacity,1);n.style.opacity=0,Nt(n,{style:{opacity:h}},r,l)}if(a.oldLayout=u,n.states.select){var d=a.oldLayoutSelect={};Im(d,u,Dm),Im(d,n.states.select,Dm)}if(n.states.emphasis){var g=a.oldLayoutEmphasis={};Im(g,u,Dm),Im(g,n.states.emphasis,Dm)}l6(n,l,c,r,r)}if(i&&!i.ignore&&!i.invisible){var a=Rne(i),o=a.oldLayout,m={points:i.shape.points};o?(i.attr({shape:o}),it(i,{shape:m},r)):(i.setShape(m),i.style.strokePercent=0,Nt(i,{style:{strokePercent:1}},r)),a.oldLayout=m}},e}(),rw=Ye();function zne(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){var i=rw(r).labelManager;i||(i=rw(r).labelManager=new One),i.clearLabels()}),e.registerUpdateLifecycle("series:layoutlabels",function(t,r,n){var i=rw(r).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var nw=Math.sin,iw=Math.cos,AG=Math.PI,Ul=Math.PI*2,Bne=180/AG,kG=function(){function e(){}return e.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},e.prototype.moveTo=function(t,r){this._add("M",t,r)},e.prototype.lineTo=function(t,r){this._add("L",t,r)},e.prototype.bezierCurveTo=function(t,r,n,i,a,o){this._add("C",t,r,n,i,a,o)},e.prototype.quadraticCurveTo=function(t,r,n,i){this._add("Q",t,r,n,i)},e.prototype.arc=function(t,r,n,i,a,o){this.ellipse(t,r,n,n,0,i,a,o)},e.prototype.ellipse=function(t,r,n,i,a,o,s,l){var u=s-o,c=!l,h=Math.abs(u),f=ks(h-Ul)||(c?u>=Ul:-u>=Ul),d=u>0?u%Ul:u%Ul+Ul,g=!1;f?g=!0:ks(h)?g=!1:g=d>=AG==!!c;var m=t+n*iw(o),y=r+i*nw(o);this._start&&this._add("M",m,y);var x=Math.round(a*Bne);if(f){var _=1/this._p,w=(c?1:-1)*(Ul-_);this._add("A",n,i,x,1,+c,t+n*iw(o+w),r+i*nw(o+w)),_>.01&&this._add("A",n,i,x,0,+c,m,y)}else{var S=t+n*iw(s),T=r+i*nw(s);this._add("A",n,i,x,+g,+c,S,T)}},e.prototype.rect=function(t,r,n,i){this._add("M",t,r),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},e.prototype.closePath=function(){this._d.length>0&&this._add("Z")},e.prototype._add=function(t,r,n,i,a,o,s,l,u){for(var c=[],h=this._p,f=1;f"}function Yne(e){return""}function dk(e,t){t=t||{};var r=t.newline?` -`:"";function n(i){var a=i.children,o=i.tag,s=i.attrs,l=i.text;return $ne(o,s)+(o!=="style"?hn(l):l||"")+(a?""+r+ae(a,function(u){return n(u)}).join(r)+r:"")+Yne(o)}return n(e)}function Xne(e,t,r){r=r||{};var n=r.newline?` -`:"",i=" {"+n,a=n+"}",o=ae(Qe(e),function(l){return l+i+ae(Qe(e[l]),function(u){return u+":"+e[l][u]+";"}).join(n)+a}).join(n),s=ae(Qe(t),function(l){return"@keyframes "+l+i+ae(Qe(t[l]),function(u){return u+i+ae(Qe(t[l][u]),function(c){var h=t[l][u][c];return c==="d"&&(h='path("'+h+'")'),c+":"+h+";"}).join(n)+a}).join(n)+a}).join(n);return!o&&!s?"":[""].join(n)}function RT(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function NE(e,t,r,n){return Nr("svg","root",{width:e,height:t,xmlns:LG,"xmlns:xlink":NG,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+e+" "+t:!1},r)}var qne=0;function IG(){return qne++}var PE={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},ql="transform-origin";function Kne(e,t,r){var n=Q({},e.shape);Q(n,t),e.buildPath(r,n);var i=new kG;return i.reset(JB(e)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function Jne(e,t){var r=t.originX,n=t.originY;(r||n)&&(e[ql]=r+"px "+n+"px")}var Qne={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function DG(e,t){var r=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[r]=e,r}function eie(e,t,r){var n=e.shape.paths,i={},a,o;if(j(n,function(l){var u=RT(r.zrId);u.animation=!0,I_(l,{},u,!0);var c=u.cssAnims,h=u.cssNodes,f=Qe(c),d=f.length;if(d){o=f[d-1];var g=c[o];for(var m in g){var y=g[m];i[m]=i[m]||{d:""},i[m].d+=y.d||""}for(var x in h){var _=h[x].animation;_.indexOf(o)>=0&&(a=_)}}}),!!a){t.d=!1;var s=DG(i,r);return a.replace(o,s)}}function IE(e){return he(e)?PE[e]?"cubic-bezier("+PE[e]+")":XM(e)?e:"":""}function I_(e,t,r,n){var i=e.animators,a=i.length,o=[];if(e instanceof Hp){var s=eie(e,t,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Ee=DG(A,r);return Ee+" "+_[0]+" both"}}for(var y in l){var s=m(l[y]);s&&o.push(s)}if(o.length){var x=r.zrId+"-cls-"+IG();r.cssNodes["."+x]={animation:o.join(",")},t.class=x}}function tie(e,t,r){if(!e.ignore)if(e.isSilent()){var n={"pointer-events":"none"};DE(n,t,r)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,l=e.currentStates.indexOf("select")>=0&&s||o;l&&(a=M0(l))}var u=i.lineWidth;if(u){var c=!i.strokeNoScale&&e.transform?e.transform[0]:1;u=u/c}var n={cursor:"pointer"};a&&(n.fill=a),i.stroke&&(n.stroke=i.stroke),u&&(n["stroke-width"]=u),DE(n,t,r)}}function DE(e,t,r,n){var i=JSON.stringify(e),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+IG(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=e),t.class=t.class?t.class+" "+a:a}var vp=Math.round;function EG(e){return e&&he(e.src)}function jG(e){return e&&we(e.toDataURL)}function vk(e,t,r,n){Hne(function(i,a){var o=i==="fill"||i==="stroke";o&&KB(a)?OG(t,e,i,n):o&&KM(a)?zG(r,e,i,n):e[i]=a,o&&n.ssr&&a==="none"&&(e["pointer-events"]="visible")},t,r,!1),lie(r,e,n)}function pk(e,t){var r=oF(t);r&&(r.each(function(n,i){n!=null&&(e[(LE+i).toLowerCase()]=n+"")}),t.isSilent()&&(e[LE+"silent"]="true"))}function EE(e){return ks(e[0]-1)&&ks(e[1])&&ks(e[2])&&ks(e[3]-1)}function rie(e){return ks(e[4])&&ks(e[5])}function gk(e,t,r){if(t&&!(rie(t)&&EE(t))){var n=1e4;e.transform=EE(t)?"translate("+vp(t[4]*n)/n+" "+vp(t[5]*n)/n+")":OX(t)}}function jE(e,t,r){for(var n=e.points,i=[],a=0;a"u"){var y="Image width/height must been given explictly in svg-ssr renderer.";Jr(f,y),Jr(d,y)}else if(f==null||d==null){var x=function(N,D){if(N){var O=N.elm,R=f||D.width,F=d||D.height;N.tag==="pattern"&&(u?(F=1,R/=a.width):c&&(R=1,F/=a.height)),N.attrs.width=R,N.attrs.height=F,O&&(O.setAttribute("width",R),O.setAttribute("height",F))}},_=oA(g,null,e,function(N){l||x(M,N),x(h,N)});_&&_.width&&_.height&&(f=f||_.width,d=d||_.height)}h=Nr("image","img",{href:g,width:f,height:d}),o.width=f,o.height=d}else i.svgElement&&(h=Se(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(h){var w,S;l?w=S=1:u?(S=1,w=o.width/a.width):c?(w=1,S=o.height/a.height):o.patternUnits="userSpaceOnUse",w!=null&&!isNaN(w)&&(o.width=w),S!=null&&!isNaN(S)&&(o.height=S);var T=QB(i);T&&(o.patternTransform=T);var M=Nr("pattern","",o,[h]),A=dk(M),P=n.patternCache,I=P[A];I||(I=n.zrId+"-p"+n.patternIdx++,P[A]=I,o.id=I,M=n.defs[I]=Nr("pattern",I,o,[h])),t[r]=u_(I)}}function uie(e,t,r){var n=r.clipPathCache,i=r.defs,a=n[e.id];if(!a){a=r.zrId+"-c"+r.clipPathIdx++;var o={id:a};n[e.id]=a,i[a]=Nr("clipPath",a,o,[RG(e,r)])}t["clip-path"]=u_(a)}function zE(e){return document.createTextNode(e)}function nu(e,t,r){e.insertBefore(t,r)}function BE(e,t){e.removeChild(t)}function FE(e,t){e.appendChild(t)}function BG(e){return e.parentNode}function FG(e){return e.nextSibling}function aw(e,t){e.textContent=t}var VE=58,cie=120,hie=Nr("","");function OT(e){return e===void 0}function Na(e){return e!==void 0}function fie(e,t,r){for(var n={},i=t;i<=r;++i){var a=e[i].key;a!==void 0&&(n[a]=i)}return n}function Yd(e,t){var r=e.key===t.key,n=e.tag===t.tag;return n&&r}function pp(e){var t,r=e.children,n=e.tag;if(Na(n)){var i=e.elm=PG(n);if(mk(hie,e),re(r))for(t=0;ta?(g=r[l+1]==null?null:r[l+1].elm,VG(e,g,r,i,l)):nx(e,t,n,a))}function Hc(e,t){var r=t.elm=e.elm,n=e.children,i=t.children;e!==t&&(mk(e,t),OT(t.text)?Na(n)&&Na(i)?n!==i&&die(r,n,i):Na(i)?(Na(e.text)&&aw(r,""),VG(r,null,i,0,i.length-1)):Na(n)?nx(r,n,0,n.length-1):Na(e.text)&&aw(r,""):e.text!==t.text&&(Na(n)&&nx(r,n,0,n.length-1),aw(r,t.text)))}function vie(e,t){if(Yd(e,t))Hc(e,t);else{var r=e.elm,n=BG(r);pp(t),n!==null&&(nu(n,t.elm,FG(r)),nx(n,[e],0,0))}return t}var pie=0,gie=function(){function e(t,r,n){if(this.type="svg",this.refreshHover=GE(),this.configLayer=GE(),this.storage=r,this._opts=n=Q({},n),this.root=t,this._id="zr"+pie++,this._oldVNode=NE(n.width,n.height),t&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=PG("svg");mk(null,this._oldVNode),i.appendChild(a),t.appendChild(i)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",vie(this._oldVNode,t),this._oldVNode=t}},e.prototype.renderOneToVNode=function(t){return OE(t,RT(this._id))},e.prototype.renderToVNode=function(t){t=t||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=RT(this._id);a.animation=t.animation,a.willUpdate=t.willUpdate,a.compress=t.compress,a.emphasis=t.emphasis,a.ssr=this._opts.ssr;var o=[],s=this._bgVNode=mie(n,i,this._backgroundColor,a);s&&o.push(s);var l=t.compress?null:this._mainVNode=Nr("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=ae(Qe(a.defs),function(f){return a.defs[f]});if(u.length&&o.push(Nr("defs","defs",{},u)),t.animation){var c=Xne(a.cssNodes,a.cssAnims,{newline:!0});if(c){var h=Nr("style","stl",{},[],c);o.push(h)}}return NE(n,i,o,t.useViewBox)},e.prototype.renderToString=function(t){return t=t||{},dk(this.renderToVNode({animation:be(t.cssAnimation,!0),emphasis:be(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:be(t.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(t){this._backgroundColor=t},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(t,r,n){for(var i=t.length,a=[],o=0,s,l,u=0,c=0;c=0&&!(f&&l&&f[m]===l[m]);m--);for(var y=g-1;y>m;y--)o--,s=a[o-1];for(var x=m+1;x=s)}}for(var h=this.__startIndex;h15)break}}F.prevElClipPaths&&x.restore()};if(_)if(_.length===0)P=y.__endIndex;else for(var N=d.dpr,D=0;D<_.length;++D){var O=_[D];x.save(),x.beginPath(),x.rect(O.x*N,O.y*N,O.width*N,O.height*N),x.clip(),I(O),x.restore()}else x.save(),I(),x.restore();y.__drawIndex=P,y.__drawIndex0&&t>i[0]){for(l=0;lt);l++);s=n[i[l]]}if(i.splice(l+1,0,t),n[t]=r,!r.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(r.dom,u.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.painter||(r.painter=this)}},e.prototype.eachLayer=function(t,r){for(var n=this._zlevelList,i=0;i0?Em:0),this._needsManuallyCompositing),c.__builtin__||i_("ZLevel "+u+" has been used by unkown layer "+c.id),c!==a&&(c.__used=!0,c.__startIndex!==l&&(c.__dirty=!0),c.__startIndex=l,c.incremental?c.__drawIndex=-1:c.__drawIndex=l,r(l),a=c),i.__dirty&Xn&&!i.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(h,f){!h.__used&&h.getElementCount()>0&&(h.__dirty=!0,h.__startIndex=h.__endIndex=h.__drawIndex=0),h.__dirty&&h.__drawIndex<0&&(h.__drawIndex=h.__startIndex)})},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(t){t.clear()},e.prototype.setBackgroundColor=function(t){this._backgroundColor=t,j(this._layers,function(r){r.setUnpainted()})},e.prototype.configLayer=function(t,r){if(r){var n=this._layerConfig;n[t]?Ge(n[t],r,!0):n[t]=r;for(var i=0;i-1&&(u.style.stroke=u.style.fill,u.style.fill=K.color.neutral00,u.style.lineWidth=2),n},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:6,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},t}(bt);function Uh(e,t){var r=e.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=Vh(e,t,r[0]);return i!=null?i+"":null}else if(n){for(var a=[],o=0;o=0&&n.push(t[a])}return n.join(" ")}var qp=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;return o.updateData(r,n,i,a),o}return t.prototype._createSymbol=function(r,n,i,a,o,s){this.removeAll();var l=sr(r,-1,-1,2,2,null,s);l.attr({z2:be(o,100),culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),l.drift=Tie,this._symbolType=r,this.add(l)},t.prototype.stopSymbolAnimation=function(r){this.childAt(0).stopAnimation(null,r)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){Ho(this.childAt(0))},t.prototype.downplay=function(){Uo(this.childAt(0))},t.prototype.setZ=function(r,n){var i=this.childAt(0);i.zlevel=r,i.z=n},t.prototype.setDraggable=function(r,n){var i=this.childAt(0);i.draggable=r,i.cursor=!n&&r?"move":i.cursor},t.prototype.updateData=function(r,n,i,a){this.silent=!1;var o=r.getItemVisual(n,"symbol")||"circle",s=r.hostModel,l=t.getSymbolSize(r,n),u=t.getSymbolZ2(r,n),c=o!==this._symbolType,h=a&&a.disableAnimation;if(c){var f=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,r,n,l,u,f)}else{var d=this.childAt(0);d.silent=!1;var g={scaleX:l[0]/2,scaleY:l[1]/2};h?d.attr(g):it(d,g,s,n),Oi(d)}if(this._updateCommon(r,n,l,i,a),c){var d=this.childAt(0);if(!h){var g={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}};d.scaleX=d.scaleY=0,d.style.opacity=0,Nt(d,g,s,n)}}h&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(r,n,i,a,o){var s=this.childAt(0),l=r.hostModel,u,c,h,f,d,g,m,y,x;if(a&&(u=a.emphasisItemStyle,c=a.blurItemStyle,h=a.selectItemStyle,f=a.focus,d=a.blurScope,m=a.labelStatesModels,y=a.hoverScale,x=a.cursorStyle,g=a.emphasisDisabled),!a||r.hasItemOption){var _=a&&a.itemModel?a.itemModel:r.getItemModel(n),w=_.getModel("emphasis");u=w.getModel("itemStyle").getItemStyle(),h=_.getModel(["select","itemStyle"]).getItemStyle(),c=_.getModel(["blur","itemStyle"]).getItemStyle(),f=w.get("focus"),d=w.get("blurScope"),g=w.get("disabled"),m=Cr(_),y=w.getShallow("scale"),x=_.getShallow("cursor")}var S=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(S||0)*Math.PI/180||0);var T=ec(r.getItemVisual(n,"symbolOffset"),i);T&&(s.x=T[0],s.y=T[1]),x&&s.attr("cursor",x);var M=r.getItemVisual(n,"style"),A=M.fill;if(s instanceof Er){var P=s.style;s.useStyle(Q({image:P.image,x:P.x,y:P.y,width:P.width,height:P.height},M))}else s.__isEmptyBrush?s.useStyle(Q({},M)):s.useStyle(M),s.style.decal=null,s.setColor(A,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var I=r.getItemVisual(n,"liftZ"),N=this._z2;I!=null?N==null&&(this._z2=s.z2,s.z2+=I):N!=null&&(s.z2=N,this._z2=null);var D=o&&o.useNameLabel;Dr(s,m,{labelFetcher:l,labelDataIndex:n,defaultText:O,inheritColor:A,defaultOpacity:M.opacity});function O(H){return D?r.getName(H):Uh(r,H)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var R=s.ensureState("emphasis");R.style=u,s.ensureState("select").style=h,s.ensureState("blur").style=c;var F=y==null||y===!0?Math.max(1.1,3/this._sizeY):isFinite(y)&&y>0?+y:1;R.scaleX=this._sizeX*F,R.scaleY=this._sizeY*F,this.setSymbolScale(1),Dt(this,f,d,g)},t.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},t.prototype.fadeOut=function(r,n,i){var a=this.childAt(0),o=De(this).dataIndex,s=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&el(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();el(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},t.getSymbolSize=function(r,n){return _f(r.getItemVisual(n,"symbolSize"))},t.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},t}(Ce);function Tie(e,t){this.parent.drift(e,t)}function sw(e,t,r,n){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(n.isIgnore&&n.isIgnore(r))&&!(n.clipShape&&!n.clipShape.contain(t[0],t[1]))&&e.getItemVisual(r,"symbol")!=="none"}function UE(e){return e!=null&&!ke(e)&&(e={isIgnore:e}),e||{}}function ZE(e){var t=e.hostModel,r=t.getModel("emphasis");return{emphasisItemStyle:r.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:r.get("focus"),blurScope:r.get("blurScope"),emphasisDisabled:r.get("disabled"),hoverScale:r.get("scale"),labelStatesModels:Cr(t),cursorStyle:t.get("cursor")}}var Kp=function(){function e(t){this.group=new Ce,this._SymbolCtor=t||qp}return e.prototype.updateData=function(t,r){this._progressiveEls=null,r=UE(r);var n=this.group,i=t.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=ZE(t),u={disableAnimation:s},c=r.getSymbolPoint||function(h){return t.getItemLayout(h)};a||n.removeAll(),t.diff(a).add(function(h){var f=c(h);if(sw(t,f,h,r)){var d=new o(t,h,l,u);d.setPosition(f),t.setItemGraphicEl(h,d),n.add(d)}}).update(function(h,f){var d=a.getItemGraphicEl(f),g=c(h);if(!sw(t,g,h,r)){n.remove(d);return}var m=t.getItemVisual(h,"symbol")||"circle",y=d&&d.getSymbolType&&d.getSymbolType();if(!d||y&&y!==m)n.remove(d),d=new o(t,h,l,u),d.setPosition(g);else{d.updateData(t,h,l,u);var x={x:g[0],y:g[1]};s?d.attr(x):it(d,x,i)}n.add(d),t.setItemGraphicEl(h,d)}).remove(function(h){var f=a.getItemGraphicEl(h);f&&f.fadeOut(function(){n.remove(f)},i)}).execute(),this._getSymbolPoint=c,this._data=t},e.prototype.updateLayout=function(){var t=this,r=this._data;r&&r.eachItemGraphicEl(function(n,i){var a=t._getSymbolPoint(i);n.setPosition(a),n.markRedraw()})},e.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=ZE(t),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r,n){this._progressiveEls=[],n=UE(n);function i(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=t.start;a0?r=n[0]:n[1]<0&&(r=n[1]),r}function HG(e,t,r,n){var i=NaN;e.stacked&&(i=r.get(r.getCalculationInfo("stackedOverDimension"),n)),isNaN(i)&&(i=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=r.get(e.baseDim,n),o[1-a]=i,t.dataToPoint(o)}function Aie(e,t){var r=[];return t.diff(e).add(function(n){r.push({cmd:"+",idx:n})}).update(function(n,i){r.push({cmd:"=",idx:i,idx1:n})}).remove(function(n){r.push({cmd:"-",idx:n})}).execute(),r}function kie(e,t,r,n,i,a,o,s){for(var l=Aie(e,t),u=[],c=[],h=[],f=[],d=[],g=[],m=[],y=WG(i,t,o),x=e.getLayout("points")||[],_=t.getLayout("points")||[],w=0;w=i||m<0)break;if(Cu(x,_)){if(l){m+=a;continue}break}if(m===r)e[a>0?"moveTo":"lineTo"](x,_),h=x,f=_;else{var w=x-u,S=_-c;if(w*w+S*S<.5){m+=a;continue}if(o>0){for(var T=m+a,M=t[T*2],A=t[T*2+1];M===x&&A===_&&y=n||Cu(M,A))d=x,g=_;else{N=M-u,D=A-c;var F=x-u,H=M-x,W=_-c,V=A-_,z=void 0,Z=void 0;if(s==="x"){z=Math.abs(F),Z=Math.abs(H);var U=N>0?1:-1;d=x-U*z*o,g=_,O=x+U*Z*o,R=_}else if(s==="y"){z=Math.abs(W),Z=Math.abs(V);var $=D>0?1:-1;d=x,g=_-$*z*o,O=x,R=_+$*Z*o}else z=Math.sqrt(F*F+W*W),Z=Math.sqrt(H*H+V*V),I=Z/(Z+z),d=x-N*o*(1-I),g=_-D*o*(1-I),O=x+N*o*I,R=_+D*o*I,O=ls(O,us(M,x)),R=ls(R,us(A,_)),O=us(O,ls(M,x)),R=us(R,ls(A,_)),N=O-x,D=R-_,d=x-N*z/Z,g=_-D*z/Z,d=ls(d,us(u,x)),g=ls(g,us(c,_)),d=us(d,ls(u,x)),g=us(g,ls(c,_)),N=x-d,D=_-g,O=x+N*Z/z,R=_+D*Z/z}e.bezierCurveTo(h,f,d,g,x,_),h=O,f=R}else e.lineTo(x,_)}u=x,c=_,m+=a}return y}var UG=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),Lie=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="ec-polyline",n}return t.prototype.getDefaultStyle=function(){return{stroke:K.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new UG},t.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&Cu(i[o*2-2],i[o*2-1]);o--);for(;a=0){var S=u?(g-l)*w+l:(d-s)*w+s;return u?[r,S]:[S,r]}s=d,l=g;break;case o.C:d=a[h++],g=a[h++],m=a[h++],y=a[h++],x=a[h++],_=a[h++];var T=u?C0(s,d,m,x,r,c):C0(l,g,y,_,r,c);if(T>0)for(var M=0;M=0){var S=u?kr(l,g,y,_,A):kr(s,d,m,x,A);return u?[r,S]:[S,r]}}s=x,l=_;break}}},t}(Ke),Nie=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(UG),ZG=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="ec-polygon",n}return t.prototype.getDefaultShape=function(){return new Nie},t.prototype.buildPath=function(r,n){var i=n.points,a=n.stackedOnPoints,o=0,s=i.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;s>0&&Cu(i[s*2-2],i[s*2-1]);s--);for(;ot){a?r.push(o(a,l,t)):i&&r.push(o(i,l,0),o(i,l,t));break}else i&&(r.push(o(i,l,0)),i=null),r.push(l),a=l}return r}function Die(e,t,r){var n=e.getVisual("visualMeta");if(!(!n||!n.length||!e.count())&&t.type==="cartesian2d"){for(var i,a,o=n.length-1;o>=0;o--){var s=e.getDimensionInfo(n[o].dimension);if(i=s&&s.coordDim,i==="x"||i==="y"){a=n[o];break}}if(a){var l=t.getAxis(i),u=ae(a.stops,function(w){return{coord:l.toGlobalCoord(l.dataToCoord(w.value)),color:w.color}}),c=u.length,h=a.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),h.reverse());var f=Iie(u,i==="x"?r.getWidth():r.getHeight()),d=f.length;if(!d&&c)return u[0].coord<0?h[1]?h[1]:u[c-1].color:h[0]?h[0]:u[0].color;var g=10,m=f[0].coord-g,y=f[d-1].coord+g,x=y-m;if(x<.001)return"transparent";j(f,function(w){w.offset=(w.coord-m)/x}),f.push({offset:d?f[d-1].offset:.5,color:h[1]||"transparent"}),f.unshift({offset:d?f[0].offset:.5,color:h[0]||"transparent"});var _=new qu(0,0,0,0,f,!0);return _[i]=m,_[i+"2"]=y,_}}}function Eie(e,t,r){var n=e.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&jie(a,t))){var o=t.mapDimension(a.dim),s={};return j(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function jie(e,t){var r=e.getExtent(),n=Math.abs(r[1]-r[0])/e.scale.count();isNaN(n)&&(n=0);for(var i=t.count(),a=Math.max(1,Math.round(i/5)),o=0;on)return!1;return!0}function Rie(e,t){return isNaN(e)||isNaN(t)}function Oie(e){for(var t=e.length/2;t>0&&Rie(e[t*2-2],e[t*2-1]);t--);return t-1}function KE(e,t){return[e[t*2],e[t*2+1]]}function zie(e,t,r){for(var n=e.length/2,i=r==="x"?0:1,a,o,s=0,l=-1,u=0;u=t||a>=t&&o<=t){l=u;break}s=u,a=o}return{range:[s,l],t:(t-a)/(o-a)}}function XG(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var Z=g.getState("emphasis").style;Z.lineWidth=+g.style.lineWidth+1}De(g).seriesIndex=r.seriesIndex,Dt(g,W,V,z);var U=qE(r.get("smooth")),$=r.get("smoothMonotone");if(g.setShape({smooth:U,smoothMonotone:$,connectNulls:A}),m){var Y=s.getCalculationInfo("stackedOnSeries"),te=0;m.useStyle(Ae(u.getAreaStyle(),{fill:O,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),Y&&(te=qE(Y.get("smooth"))),m.setShape({smooth:U,stackedOnSmooth:te,smoothMonotone:$,connectNulls:A}),Sr(m,r,"areaStyle"),De(m).seriesIndex=r.seriesIndex,Dt(m,W,V,z)}var ie=this._changePolyState;s.eachItemGraphicEl(function(se){se&&(se.onHoverStateChange=ie)}),this._polyline.onHoverStateChange=ie,this._data=s,this._coordSys=a,this._stackedOnPoints=T,this._points=c,this._step=N,this._valueOrigin=w,r.get("triggerLineEvent")&&(this.packEventData(r,g),m&&this.packEventData(r,m))},t.prototype.packEventData=function(r,n){De(n).eventData={componentType:"series",componentSubType:"line",componentIndex:r.componentIndex,seriesIndex:r.seriesIndex,seriesName:r.name,seriesType:"line"}},t.prototype.highlight=function(r,n,i,a){var o=r.getData(),s=Ru(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var c=l[s*2],h=l[s*2+1];if(isNaN(c)||isNaN(h)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,h))return;var f=r.get("zlevel")||0,d=r.get("z")||0;u=new qp(o,s),u.x=c,u.y=h,u.setZ(f,d);var g=u.getSymbolPath().getTextContent();g&&(g.zlevel=f,g.z=d,g.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else gt.prototype.highlight.call(this,r,n,i,a)},t.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=Ru(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else gt.prototype.downplay.call(this,r,n,i,a)},t.prototype._changePolyState=function(r){var n=this._polygon;j0(this._polyline,r),n&&j0(n,r)},t.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new Lie({shape:{points:r},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(n),this._polyline=n,n},t.prototype._newPolygon=function(r,n){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new ZG({shape:{points:r,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},t.prototype._initSymbolLabelAnimation=function(r,n,i){var a,o,s=n.getBaseAxis(),l=s.inverse;n.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):n.type==="polar"&&(a=s.dim==="angle",o=!0);var u=r.hostModel,c=u.get("animationDuration");we(c)&&(c=c(null));var h=u.get("animationDelay")||0,f=we(h)?h(null):h;r.eachItemGraphicEl(function(d,g){var m=d;if(m){var y=[d.x,d.y],x=void 0,_=void 0,w=void 0;if(i)if(o){var S=i,T=n.pointToCoord(y);a?(x=S.startAngle,_=S.endAngle,w=-T[1]/180*Math.PI):(x=S.r0,_=S.r,w=T[0])}else{var M=i;a?(x=M.x,_=M.x+M.width,w=d.x):(x=M.y+M.height,_=M.y,w=d.y)}var A=_===x?0:(w-x)/(_-x);l&&(A=1-A);var P=we(h)?h(g):c*A+f,I=m.getSymbolPath(),N=I.getTextContent();m.attr({scaleX:0,scaleY:0}),m.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:P}),N&&N.animateFrom({style:{opacity:0}},{duration:300,delay:P}),I.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(XG(r)){var o=r.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new tt({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var c=Oie(l);c>=0&&(Dr(s,Cr(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:c,defaultText:function(h,f,d){return d!=null?GG(o,d):Uh(o,h)},enableTextSetter:!0},Bie(a,n)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(r,n,i,a,o,s,l){var u=this._endLabel,c=this._polyline;if(u){r<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var h=i.getLayout("points"),f=i.hostModel,d=f.get("connectNulls"),g=s.get("precision"),m=s.get("distance")||0,y=l.getBaseAxis(),x=y.isHorizontal(),_=y.inverse,w=n.shape,S=_?x?w.x:w.y+w.height:x?w.x+w.width:w.y,T=(x?m:0)*(_?-1:1),M=(x?0:-m)*(_?-1:1),A=x?"x":"y",P=zie(h,S,A),I=P.range,N=I[1]-I[0],D=void 0;if(N>=1){if(N>1&&!d){var O=KE(h,I[0]);u.attr({x:O[0]+T,y:O[1]+M}),o&&(D=f.getRawValue(I[0]))}else{var O=c.getPointOn(S,A);O&&u.attr({x:O[0]+T,y:O[1]+M});var R=f.getRawValue(I[0]),F=f.getRawValue(I[1]);o&&(D=_F(i,g,R,F,P.t))}a.lastFrameIndex=I[0]}else{var H=r===1||a.lastFrameIndex>0?I[0]:0,O=KE(h,H);o&&(D=f.getRawValue(H)),u.attr({x:O[0]+T,y:O[1]+M})}if(o){var W=vf(u);typeof W.setLabelText=="function"&&W.setLabelText(D)}}},t.prototype._doUpdateAnimation=function(r,n,i,a,o,s,l){var u=this._polyline,c=this._polygon,h=r.hostModel,f=kie(this._data,r,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),d=f.current,g=f.stackedOnCurrent,m=f.next,y=f.stackedOnNext;if(o&&(g=cs(f.stackedOnCurrent,f.current,i,o,l),d=cs(f.current,null,i,o,l),y=cs(f.stackedOnNext,f.next,i,o,l),m=cs(f.next,null,i,o,l)),XE(d,m)>3e3||c&&XE(g,y)>3e3){u.stopAnimation(),u.setShape({points:m}),c&&(c.stopAnimation(),c.setShape({points:m,stackedOnPoints:y}));return}u.shape.__points=f.current,u.shape.points=d;var x={shape:{points:m}};f.current!==d&&(x.shape.__points=f.next),u.stopAnimation(),it(u,x,h),c&&(c.setShape({points:d,stackedOnPoints:g}),c.stopAnimation(),it(c,{shape:{stackedOnPoints:y}},h),u.shape.points!==c.shape.points&&(c.shape.points=u.shape.points));for(var _=[],w=f.status,S=0;St&&(t=e[r]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,r=0;r10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),c=l.getExtent(),h=n.getDevicePixelRatio(),f=Math.abs(c[1]-c[0])*(h||1),d=Math.round(s/f);if(isFinite(d)&&d>1){a==="lttb"?t.setData(i.lttbDownSample(i.mapDimension(u.dim),1/d)):a==="minmax"&&t.setData(i.minmaxDownSample(i.mapDimension(u.dim),1/d));var g=void 0;he(a)?g=Vie[a]:we(a)&&(g=a),g&&t.setData(i.downSample(i.mapDimension(u.dim),1/d,g,Gie))}}}}}function Wie(e){e.registerChartView(Fie),e.registerSeriesModel(Cie),e.registerLayout(Qp("line",!0)),e.registerVisual({seriesType:"line",reset:function(t){var r=t.getData(),n=t.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=r.getVisual("style").fill),r.setVisual("legendLineStyle",n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,qG("line"))}var gp=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(r,n){return no(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(r,n,i){var a=this.coordinateSystem;if(a&&a.clampData){var o=a.clampData(r),s=a.dataToPoint(o);if(i)j(a.getAxes(),function(f,d){if(f.type==="category"&&n!=null){var g=f.getTicksCoords(),m=f.getTickModel().get("alignWithLabel"),y=o[d],x=n[d]==="x1"||n[d]==="y1";if(x&&!m&&(y+=1),g.length<2)return;if(g.length===2){s[d]=f.toGlobalCoord(f.getExtent()[x?1:0]);return}for(var _=void 0,w=void 0,S=1,T=0;Ty){w=(M+_)/2;break}T===1&&(S=A-g[0].tickValue)}w==null&&(_?_&&(w=g[g.length-1].coord):w=g[0].coord),s[d]=f.toGlobalCoord(w)}});else{var l=this.getData(),u=l.getLayout("offset"),c=l.getLayout("size"),h=a.getBaseAxis().isHorizontal()?0:1;s[h]+=u+c/2}return s}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",defaultBarGap:"10%"},t}(bt);bt.registerClass(gp);var Hie=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(){return no(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},t.prototype.getProgressiveThreshold=function(){var r=this.get("progressiveThreshold"),n=this.get("largeThreshold");return n>r&&(r=n),r},t.prototype.brushSelector=function(r,n,i){return i.rect(n.getItemLayout(r))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=fl(gp.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:K.color.primary,borderWidth:2}},realtimeSort:!1}),t}(gp),Uie=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e}(),ix=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="sausage",n}return t.prototype.getDefaultShape=function(){return new Uie},t.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.max(n.r0||0,0),s=Math.max(n.r,0),l=(s-o)*.5,u=o+l,c=n.startAngle,h=n.endAngle,f=n.clockwise,d=Math.PI*2,g=f?h-cMath.PI/2&&cs)return!0;s=h}return!1},t.prototype._isOrderDifferentInView=function(r,n){for(var i=n.scale,a=i.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],i.getOrdinalMeta().categories.length-1);o<=s;++o)if(r.ordinalNumbers[o]!==i.getRawOrdinalNumber(o))return!0},t.prototype._updateSortWithinSameData=function(r,n,i,a){if(this._isOrderChangedWithinSameData(r,n,i)){var o=this._dataSort(r,i,n);this._isOrderDifferentInView(o,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:o}))}},t.prototype._dispatchInitSort=function(r,n,i){var a=n.baseAxis,o=this._dataSort(r,a,function(s){return r.get(r.mapDimension(n.otherAxis.dim),s)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},t.prototype.remove=function(r,n){this._clear(this._model),this._removeOnRenderedListener(n)},t.prototype.dispose=function(r,n){this._removeOnRenderedListener(n)},t.prototype._removeOnRenderedListener=function(r){this._onRendered&&(r.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(r){var n=this.group,i=this._data;r&&r.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl(function(a){Do(a,r,De(a).dataIndex)})):n.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t}(gt),JE={cartesian2d:function(e,t){var r=t.width<0?-1:1,n=t.height<0?-1:1;r<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,a=e.y+e.height,o=uw(t.x,e.x),s=cw(t.x+t.width,i),l=uw(t.y,e.y),u=cw(t.y+t.height,a),c=si?s:o,t.y=h&&l>a?u:l,t.width=c?0:s-o,t.height=h?0:u-l,r<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height),c||h},polar:function(e,t){var r=t.r0<=t.r?1:-1;if(r<0){var n=t.r;t.r=t.r0,t.r0=n}var i=cw(t.r,e.r),a=uw(t.r0,e.r0);t.r=i,t.r0=a;var o=i-a<0;if(r<0){var n=t.r;t.r=t.r0,t.r0=n}return o}},QE={cartesian2d:function(e,t,r,n,i,a,o,s,l){var u=new Ze({shape:Q({},n),z2:1});if(u.__dataIndex=r,u.name="item",a){var c=u.shape,h=i?"height":"width";c[h]=0}return u},polar:function(e,t,r,n,i,a,o,s,l){var u=!i&&l?ix:Qr,c=new u({shape:n,z2:1});c.name="item";var h=KG(i);if(c.calculateTextPosition=Zie(h,{isRoundCap:u===ix}),a){var f=c.shape,d=i?"r":"endAngle",g={};f[d]=i?n.r0:n.startAngle,g[d]=n[d],(s?it:Nt)(c,{shape:g},a)}return c}};function qie(e,t){var r=e.get("realtimeSort",!0),n=t.getBaseAxis();if(r&&n.type==="category"&&t.type==="cartesian2d")return{baseAxis:n,otherAxis:t.getOtherAxis(n)}}function ej(e,t,r,n,i,a,o,s){var l,u;a?(u={x:n.x,width:n.width},l={y:n.y,height:n.height}):(u={y:n.y,height:n.height},l={x:n.x,width:n.width}),s||(o?it:Nt)(r,{shape:l},t,i,null);var c=t?e.baseAxis.model:null;(o?it:Nt)(r,{shape:u},c,i)}function tj(e,t){for(var r=0;r0?1:-1,o=n.height>0?1:-1;return{x:n.x+a*i/2,y:n.y+o*i/2,width:n.width-a*i,height:n.height-o*i}},polar:function(e,t,r){var n=e.getItemLayout(t);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function Qie(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function KG(e){return function(t){var r=t?"Arc":"Angle";return function(n){switch(n){case"start":case"insideStart":case"end":case"insideEnd":return n+r;default:return n}}}(e)}function nj(e,t,r,n,i,a,o,s){var l=t.getItemVisual(r,"style");if(s){if(!a.get("roundCap")){var c=e.shape,h=Ba(n.getModel("itemStyle"),c,!0);Q(c,h),e.setShape(c)}}else{var u=n.get(["itemStyle","borderRadius"])||0;e.setShape("r",u)}e.useStyle(l);var f=n.getShallow("cursor");f&&e.attr("cursor",f);var d=s?o?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":o?i.height>=0?"bottom":"top":i.width>=0?"right":"left",g=Cr(n);Dr(e,g,{labelFetcher:a,labelDataIndex:r,defaultText:Uh(a.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var m=e.getTextContent();if(s&&m){var y=n.get(["label","position"]);e.textConfig.inside=y==="middle"?!0:null,$ie(e,y==="outside"?d:y,KG(o),n.get(["label","rotate"]))}s6(m,g,a.getRawValue(r),function(_){return GG(t,_)});var x=n.getModel(["emphasis"]);Dt(e,x.get("focus"),x.get("blurScope"),x.get("disabled")),Sr(e,n),Qie(i)&&(e.style.fill="none",e.style.stroke="none",j(e.states,function(_){_.style&&(_.style.fill=_.style.stroke="none")}))}function eae(e,t){var r=e.get(["itemStyle","borderColor"]);if(!r||r==="none")return 0;var n=e.get(["itemStyle","borderWidth"])||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(n,i,a)}var tae=function(){function e(){}return e}(),ij=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="largeBar",n}return t.prototype.getDefaultShape=function(){return new tae},t.prototype.buildPath=function(r,n){for(var i=n.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,c=0;c=0?r:null},30,!1);function rae(e,t,r){for(var n=e.baseDimIdx,i=1-n,a=e.shape.points,o=e.largeDataIndices,s=[],l=[],u=e.barWidth,c=0,h=a.length/3;c=s[0]&&t<=s[0]+l[0]&&r>=s[1]&&r<=s[1]+l[1])return o[c]}return-1}function JG(e,t,r){if(tl(r,"cartesian2d")){var n=t,i=r.getArea();return{x:e?n.x:i.x,y:e?i.y:n.y,width:e?n.width:i.width,height:e?i.height:n.height}}else{var i=r.getArea(),a=t;return{cx:i.cx,cy:i.cy,r0:e?i.r0:a.r0,r:e?i.r:a.r,startAngle:e?a.startAngle:0,endAngle:e?a.endAngle:Math.PI*2}}}function nae(e,t,r){var n=e.type==="polar"?Qr:Ze;return new n({shape:JG(t,r,e),silent:!0,z2:0})}function iae(e){e.registerChartView(Xie),e.registerSeriesModel(Hie),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Fe(tG,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,rG("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,qG("bar")),e.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(t,r){var n=t.componentType||"series";r.eachComponent({mainType:n,query:t},function(i){t.sortInfo&&i.axis.setCategorySortInfo(t.sortInfo)})})}var sj=Math.PI*2,zm=Math.PI/180;function aae(e,t,r){t.eachSeriesByType(e,function(n){var i=n.getData(),a=i.mapDimension("value"),o=T6(n,r),s=o.cx,l=o.cy,u=o.r,c=o.r0,h=o.viewRect,f=-n.get("startAngle")*zm,d=n.get("endAngle"),g=n.get("padAngle")*zm;d=d==="auto"?f-sj:-d*zm;var m=n.get("minAngle")*zm,y=m+g,x=0;i.each(a,function(V){!isNaN(V)&&x++});var _=i.getSum(a),w=Math.PI/(_||x)*2,S=n.get("clockwise"),T=n.get("roseType"),M=n.get("stillShowZeroSum"),A=i.getDataExtent(a);A[0]=0;var P=S?1:-1,I=[f,d],N=P*g/2;m_(I,!S),f=I[0],d=I[1];var D=QG(n);D.startAngle=f,D.endAngle=d,D.clockwise=S,D.cx=s,D.cy=l,D.r=u,D.r0=c;var O=Math.abs(d-f),R=O,F=0,H=f;if(i.setLayout({viewRect:h,r:u}),i.each(a,function(V,z){var Z;if(isNaN(V)){i.setItemLayout(z,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:S,cx:s,cy:l,r0:c,r:T?NaN:u});return}T!=="area"?Z=_===0&&M?w:V*w:Z=O/x,ZZ?($=H+P*Z/2,Y=$):($=H+N,Y=U-N),i.setItemLayout(z,{angle:Z,startAngle:$,endAngle:Y,clockwise:S,cx:s,cy:l,r0:c,r:T?ht(V,A,[c,u]):u}),H=U}),Rr?x:y,T=Math.abs(w.label.y-r);if(T>=S.maxY){var M=w.label.x-t-w.len2*i,A=n+w.len,P=Math.abs(M)e.unconstrainedWidth?null:f:null;n.setStyle("width",d)}tW(a,n)}}}function tW(e,t){uj.rect=e,TG(uj,t,lae)}var lae={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},uj={};function hw(e){return e.position==="center"}function uae(e){var t=e.getData(),r=[],n,i,a=!1,o=(e.get("minShowLabelAngle")||0)*oae,s=t.getLayout("viewRect"),l=t.getLayout("r"),u=s.width,c=s.x,h=s.y,f=s.height;function d(M){M.ignore=!0}function g(M){if(!M.ignore)return!0;for(var A in M.states)if(M.states[A].ignore===!1)return!0;return!1}t.each(function(M){var A=t.getItemGraphicEl(M),P=A.shape,I=A.getTextContent(),N=A.getTextGuideLine(),D=t.getItemModel(M),O=D.getModel("label"),R=O.get("position")||D.get(["emphasis","label","position"]),F=O.get("distanceToLabelLine"),H=O.get("alignTo"),W=ce(O.get("edgeDistance"),u),V=O.get("bleedMargin");V==null&&(V=Math.min(u,f)>200?10:2);var z=D.getModel("labelLine"),Z=z.get("length");Z=ce(Z,u);var U=z.get("length2");if(U=ce(U,u),Math.abs(P.endAngle-P.startAngle)0?"right":"left":Y>0?"left":"right"}var et=Math.PI,lt=0,Et=O.get("rotate");if(rt(Et))lt=Et*(et/180);else if(R==="center")lt=0;else if(Et==="radial"||Et===!0){var lr=Y<0?-$+et:-$;lt=lr}else if(Et==="tangential"&&R!=="outside"&&R!=="outer"){var Mr=Math.atan2(Y,te);Mr<0&&(Mr=et*2+Mr);var Gn=te>0;Gn&&(Mr=et+Mr),lt=Mr-et}if(a=!!lt,I.x=ie,I.y=se,I.rotation=lt,I.setStyle({verticalAlign:"middle"}),me){I.setStyle({align:Ee});var io=I.states.select;io&&(io.x+=I.x,io.y+=I.y)}else{var Wn=new Pe(0,0,0,0);tW(Wn,I),r.push({label:I,labelLine:N,position:R,len:Z,len2:U,minTurnAngle:z.get("minTurnAngle"),maxSurfaceAngle:z.get("maxSurfaceAngle"),surfaceNormal:new Ne(Y,te),linePoints:le,textAlign:Ee,labelDistance:F,labelAlignTo:H,edgeDistance:W,bleedMargin:V,rect:Wn,unconstrainedWidth:Wn.width,labelStyleWidth:I.style.width})}A.setTextConfig({inside:me})}}),!a&&e.get("avoidLabelOverlap")&&sae(r,n,i,l,u,f,c,h);for(var m=0;m0){for(var c=o.getItemLayout(0),h=1;isNaN(c&&c.startAngle)&&h=a.r0}},t.type="pie",t}(gt);function Tf(e,t,r){t=re(t)&&{coordDimensions:t}||Q({encodeDefine:e.getEncode()},t);var n=e.getSource(),i=bf(n,t).dimensions,a=new dn(i,e);return a.initData(n,r),a}var Mf=function(){function e(t,r){this._getDataWithEncodedVisual=t,this._getRawData=r}return e.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},e.prototype.containName=function(t){var r=this._getRawData();return r.indexOfName(t)>=0},e.prototype.indexOfName=function(t){var r=this._getDataWithEncodedVisual();return r.indexOfName(t)},e.prototype.getItemVisual=function(t,r){var n=this._getDataWithEncodedVisual();return n.getItemVisual(t,r)},e}(),fae=Ye(),rW=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(r){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new Mf(fe(this.getData,this),fe(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return Tf(this,{coordDimensions:["value"],encodeDefaulter:Fe(zA,this)})},t.prototype.getDataParams=function(r){var n=this.getData(),i=fae(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=cF(o,n.hostModel.get("percentPrecision"))}var s=e.prototype.getDataParams.call(this,r);return s.percent=a[r]||0,s.$vars.push("percent"),s},t.prototype._defaultLabelLine=function(r){ju(r,"labelLine",["show"]);var n=r.labelLine,i=r.emphasis.labelLine;n.show=n.show&&r.label.show,i.show=i.show&&r.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"50%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,coordinateSystemUsage:"box",left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:30,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(bt);aQ({fullType:rW.type,getCoord2:function(e){return e.getShallow("center")}});function dae(e){return{seriesType:e,reset:function(t,r){var n=t.getData();n.filterSelf(function(i){var a=n.mapDimension("value"),o=n.get(a,i);return!(rt(o)&&!isNaN(o)&&o<0)})}}}function vae(e){e.registerChartView(hae),e.registerSeriesModel(rW),gV("pie",e.registerAction),e.registerLayout(Fe(aae,"pie")),e.registerProcessor(Cf("pie")),e.registerProcessor(dae("pie"))}var pae=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.hasSymbolVisual=!0,r}return t.prototype.getInitialData=function(r,n){return no(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){var r=this.option.progressive;return r??(this.option.large?5e3:this.get("progressive"))},t.prototype.getProgressiveThreshold=function(){var r=this.option.progressiveThreshold;return r??(this.option.large?1e4:this.get("progressiveThreshold"))},t.prototype.brushSelector=function(r,n,i){return i.point(n.getItemLayout(r))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},t.type="series.scatter",t.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:K.color.primary}},universalTransition:{divideShape:"clone"}},t}(bt),nW=4,gae=function(){function e(){}return e}(),mae=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n._off=0,n.hoverDataIdx=-1,n}return t.prototype.getDefaultShape=function(){return new gae},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.buildPath=function(r,n){var i=n.points,a=n.size,o=this.symbolProxy,s=o.shape,l=r.getContext?r.getContext():r,u=l&&a[0]=0;u--){var c=u*2,h=a[c]-s/2,f=a[c+1]-l/2;if(r>=h&&n>=f&&r<=h+s&&n<=f+l)return u}return-1},t.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect();if(r=i[0],n=i[1],a.contain(r,n)){var o=this.hoverDataIdx=this.findDataIndex(r,n);return o>=0}return this.hoverDataIdx=-1,!1},t.prototype.getBoundingRect=function(){var r=this._rect;if(!r){for(var n=this.shape,i=n.points,a=n.size,o=a[0],s=a[1],l=1/0,u=1/0,c=-1/0,h=-1/0,f=0;f=0&&(u.dataIndex=h+(t.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),xae=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=r.getData(),o=this._updateSymbolDraw(a,r);o.updateData(a,{clipShape:this._getClipShape(r)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),o=this._updateSymbolDraw(a,r);o.incrementalPrepareUpdate(a),this._finished=!1},t.prototype.incrementalRender=function(r,n,i){this._symbolDraw.incrementalUpdate(r,n.getData(),{clipShape:this._getClipShape(n)}),this._finished=r.end===n.getData().count()},t.prototype.updateTransform=function(r,n,i){var a=r.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=Qp("").reset(r,n,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},t.prototype.eachRendered=function(r){this._symbolDraw&&this._symbolDraw.eachRendered(r)},t.prototype._getClipShape=function(r){if(r.get("clip",!0)){var n=r.coordinateSystem;return n&&n.getArea&&n.getArea(.1)}},t.prototype._updateSymbolDraw=function(r,n){var i=this._symbolDraw,a=n.pipelineContext,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new yae:new Kp,this._isLargeDraw=o,this.group.removeAll()),this.group.add(i.group),i},t.prototype.remove=function(r,n){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type="scatter",t}(gt),iW={left:0,right:0,top:0,bottom:0},ax=["25%","25%"],_ae=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(r,n){var i=Ju(r.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&Ka(r.outerBounds,i)},t.prototype.mergeOption=function(r,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&Ka(this.option.outerBounds,r.outerBounds)},t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"15%",top:65,right:"10%",bottom:80,containLabel:!1,outerBoundsMode:"auto",outerBounds:iW,outerBoundsContain:"all",outerBoundsClampWidth:ax[0],outerBoundsClampHeight:ax[1],backgroundColor:K.color.transparent,borderWidth:1,borderColor:K.color.neutral30},t}($e),BT=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Ht).models[0]},t.type="cartesian2dAxis",t}($e);Qt(BT,Sf);var aW={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:K.color.axisLine,width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15],breakLine:!0},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12,color:K.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:K.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[K.color.backgroundTint,K.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:K.color.neutral00,borderColor:K.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},bae=Ge({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},aW),yk=Ge({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:K.color.axisMinorSplitLine,width:1}}},aW),wae=Ge({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},yk),Sae=Ae({logBase:10},yk);const oW={category:bae,value:yk,time:wae,log:Sae};var Cae={value:1,category:1,time:1,log:1},FT=null;function Tae(e){FT||(FT=e)}function eg(){return FT}function Zh(e,t,r,n){j(Cae,function(i,a){var o=Ge(Ge({},oW[a],!0),n,!0),s=function(l){q(u,l);function u(){var c=l!==null&&l.apply(this,arguments)||this;return c.type=t+"Axis."+a,c}return u.prototype.mergeDefaultAndTheme=function(c,h){var f=op(this),d=f?Ju(c):{},g=h.getTheme();Ge(c,g.get(a+"Axis")),Ge(c,this.getDefaultOption()),c.type=cj(c),f&&Ka(c,d,f)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=fp.createByAxisModel(this))},u.prototype.getCategories=function(c){var h=this.option;if(h.type==="category")return c?h.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.prototype.updateAxisBreaks=function(c){var h=eg();return h?h.updateModelAxisBreak(this,c):{breaks:[]}},u.type=t+"Axis."+a,u.defaultOption=o,u}(r);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+"Axis",cj)}function cj(e){return e.type||(e.data?"category":"value")}var Mae=function(){function e(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return e.prototype.getAxis=function(t){return this._axes[t]},e.prototype.getAxes=function(){return ae(this._dimList,function(t){return this._axes[t]},this)},e.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),ot(this.getAxes(),function(r){return r.scale.type===t})},e.prototype.addAxis=function(t){var r=t.dim;this._axes[r]=t,this._dimList.push(r)},e}(),VT=["x","y"];function hj(e){return(e.type==="interval"||e.type==="time")&&!e.hasBreaks()}var Aae=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=VT,r}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!hj(r)||!hj(n))){var i=r.getExtent(),a=n.getExtent(),o=this.dataToPoint([i[0],a[0]]),s=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var c=(s[0]-o[0])/l,h=(s[1]-o[1])/u,f=o[0]-i[0]*c,d=o[1]-a[0]*h,g=this._transform=[c,0,0,h,f,d];this._invTransform=ji([],g)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(r){var n=this.getAxis("x"),i=this.getAxis("y");return n.contain(n.toLocalCoord(r[0]))&&i.contain(i.toLocalCoord(r[1]))},t.prototype.containData=function(r){return this.getAxis("x").containData(r[0])&&this.getAxis("y").containData(r[1])},t.prototype.containZone=function(r,n){var i=this.dataToPoint(r),a=this.dataToPoint(n),o=this.getArea(),s=new Pe(i[0],i[1],a[0]-i[0],a[1]-i[1]);return o.intersect(s)},t.prototype.dataToPoint=function(r,n,i){i=i||[];var a=r[0],o=r[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return Kt(i,r,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return i[0]=s.toGlobalCoord(s.dataToCoord(a,n)),i[1]=l.toGlobalCoord(l.dataToCoord(o,n)),i},t.prototype.clampData=function(r,n){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,o=i.getExtent(),s=a.getExtent(),l=i.parse(r[0]),u=a.parse(r[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),n[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),n},t.prototype.pointToData=function(r,n,i){if(i=i||[],this._invTransform)return Kt(i,r,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(r[0]),n),i[1]=o.coordToData(o.toLocalCoord(r[1]),n),i},t.prototype.getOtherAxis=function(r){return this.getAxis(r.dim==="x"?"y":"x")},t.prototype.getArea=function(r){r=r||0;var n=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),a=Math.min(n[0],n[1])-r,o=Math.min(i[0],i[1])-r,s=Math.max(n[0],n[1])-a+r,l=Math.max(i[0],i[1])-o+r;return new Pe(a,o,s,l)},t}(Mae),sW=function(e){q(t,e);function t(r,n,i,a,o){var s=e.call(this,r,n,i)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return t.prototype.isHorizontal=function(){var r=this.position;return r==="top"||r==="bottom"},t.prototype.getGlobalExtent=function(r){var n=this.getExtent();return n[0]=this.toGlobalCoord(n[0]),n[1]=this.toGlobalCoord(n[1]),r&&n[0]>n[1]&&n.reverse(),n},t.prototype.pointToData=function(r,n){return this.coordToData(this.toLocalCoord(r[this.dim==="x"?0:1]),n)},t.prototype.setCategorySortInfo=function(r){if(this.type!=="category")return!1;this.model.option.categorySortInfo=r,this.scale.setSortInfo(r)},t}(Vi),D_="expandAxisBreak",lW="collapseAxisBreak",uW="toggleAxisBreak",xk="axisbreakchanged",kae={type:D_,event:xk,update:"update",refineEvent:_k},Lae={type:lW,event:xk,update:"update",refineEvent:_k},Nae={type:uW,event:xk,update:"update",refineEvent:_k};function _k(e,t,r,n){var i=[];return j(e,function(a){i=i.concat(a.eventBreaks)}),{eventContent:{breaks:i}}}function Pae(e){e.registerAction(kae,t),e.registerAction(Lae,t),e.registerAction(Nae,t);function t(r,n){var i=[],a=_h(n,r);function o(s,l){j(a[s],function(u){var c=u.updateAxisBreaks(r);j(c.breaks,function(h){var f;i.push(Ae((f={},f[l]=u.componentIndex,f),h))})})}return o("xAxisModels","xAxisIndex"),o("yAxisModels","yAxisIndex"),o("singleAxisModels","singleAxisIndex"),{eventBreaks:i}}}var Ls=Math.PI,Iae=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],Dae=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],$h=Ye(),cW=Ye(),hW=function(){function e(t){this.recordMap={},this.resolveAxisNameOverlap=t}return e.prototype.ensureRecord=function(t){var r=t.axis.dim,n=t.componentIndex,i=this.recordMap,a=i[r]||(i[r]=[]);return a[n]||(a[n]={ready:{}})},e}();function Eae(e,t,r,n){var i=r.axis,a=t.ensureRecord(r),o=[],s,l=bk(e.axisName)&&Hh(e.nameLocation);j(n,function(g){var m=Ja(g);if(!(!m||m.label.ignore)){o.push(m);var y=a.transGroup;l&&(y.transform?ji(bd,y.transform):zp(bd),m.transform&&aa(bd,bd,m.transform),Pe.copy(Bm,m.localRect),Bm.applyTransform(bd),s?s.union(Bm):Pe.copy(s=new Pe(0,0,0,0),Bm))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",c=a.transGroup[u];if(o.sort(function(g,m){return Math.abs(g.label[u]-c)-Math.abs(m.label[u]-c)}),l&&s){var h=i.getExtent(),f=Math.min(h[0],h[1]),d=Math.max(h[0],h[1])-f;s.union(new Pe(f,0,d,1))}a.stOccupiedRect=s,a.labelInfoList=o}var bd=Pr(),Bm=new Pe(0,0,0,0),fW=function(e,t,r,n,i,a){if(Hh(e.nameLocation)){var o=a.stOccupiedRect;o&&dW(Ine({},o,a.transGroup.transform),n,i)}else vW(a.labelInfoList,a.dirVec,n,i)};function dW(e,t,r){var n=new Ne;P_(e,t,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&IT(t,n)}function vW(e,t,r,n){for(var i=Ne.dot(n,t)>=0,a=0,o=e.length;a0?"top":"bottom",a="center"):Oh(i-Ls)?(o=n>0?"bottom":"top",a="center"):(o="middle",i>0&&i0?"right":"left":a=n>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:o}},e.makeAxisEventDataBase=function(t){var r={componentType:t.mainType,componentIndex:t.componentIndex};return r[t.mainType+"Index"]=t.componentIndex,r},e.isLabelSilent=function(t){var r=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||r&&r.show)},e}(),jae=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],Rae={axisLine:function(e,t,r,n,i,a,o){var s=n.get(["axisLine","show"]);if(s==="auto"&&(s=!0,e.raw.axisLineAutoShow!=null&&(s=!!e.raw.axisLineAutoShow)),!!s){var l=n.axis.getExtent(),u=a.transform,c=[l[0],0],h=[l[1],0],f=c[0]>h[0];u&&(Kt(c,c,u),Kt(h,h,u));var d=Q({lineCap:"round"},n.getModel(["axisLine","lineStyle"]).getLineStyle()),g={strokeContainThreshold:e.raw.strokeContainThreshold||5,silent:!0,z2:1,style:d};if(n.get(["axisLine","breakLine"])&&n.axis.scale.hasBreaks())eg().buildAxisBreakLine(n,i,a,g);else{var m=new ar(Q({shape:{x1:c[0],y1:c[1],x2:h[0],y2:h[1]}},g));Fh(m.shape,m.style.lineWidth),m.anid="line",i.add(m)}var y=n.get(["axisLine","symbol"]);if(y!=null){var x=n.get(["axisLine","symbolSize"]);he(y)&&(y=[y,y]),(he(x)||rt(x))&&(x=[x,x]);var _=ec(n.get(["axisLine","symbolOffset"])||0,x),w=x[0],S=x[1];j([{rotate:e.rotation+Math.PI/2,offset:_[0],r:0},{rotate:e.rotation-Math.PI/2,offset:_[1],r:Math.sqrt((c[0]-h[0])*(c[0]-h[0])+(c[1]-h[1])*(c[1]-h[1]))}],function(T,M){if(y[M]!=="none"&&y[M]!=null){var A=sr(y[M],-w/2,-S/2,w,S,d.stroke,!0),P=T.r+T.offset,I=f?h:c;A.attr({rotation:T.rotate,x:I[0]+P*Math.cos(e.rotation),y:I[1]-P*Math.sin(e.rotation),silent:!0,z2:11}),i.add(A)}})}}},axisTickLabelEstimate:function(e,t,r,n,i,a,o,s){var l=dj(t,i,s);l&&fj(e,t,r,n,i,a,o,da.estimate)},axisTickLabelDetermine:function(e,t,r,n,i,a,o,s){var l=dj(t,i,s);l&&fj(e,t,r,n,i,a,o,da.determine);var u=Fae(e,i,a,n);Bae(e,t.labelLayoutList,u),Vae(e,i,a,n,e.tickDirection)},axisName:function(e,t,r,n,i,a,o,s){var l=r.ensureRecord(n);t.nameEl&&(i.remove(t.nameEl),t.nameEl=l.nameLayout=l.nameLocation=null);var u=e.axisName;if(bk(u)){var c=e.nameLocation,h=e.nameDirection,f=n.getModel("nameTextStyle"),d=n.get("nameGap")||0,g=n.axis.getExtent(),m=n.axis.inverse?-1:1,y=new Ne(0,0),x=new Ne(0,0);c==="start"?(y.x=g[0]-m*d,x.x=-m):c==="end"?(y.x=g[1]+m*d,x.x=m):(y.x=(g[0]+g[1])/2,y.y=e.labelOffset+h*d,x.y=h);var _=Pr();x.transform(Ko(_,_,e.rotation));var w=n.get("nameRotate");w!=null&&(w=w*Ls/180);var S,T;Hh(c)?S=wn.innerTextLayout(e.rotation,w??e.rotation,h):(S=Oae(e.rotation,c,w||0,g),T=e.raw.axisNameAvailableWidth,T!=null&&(T=Math.abs(T/Math.sin(S.rotation)),!isFinite(T)&&(T=null)));var M=f.getFont(),A=n.get("nameTruncate",!0)||{},P=A.ellipsis,I=Fr(e.raw.nameTruncateMaxWidth,A.maxWidth,T),N=s.nameMarginLevel||0,D=new tt({x:y.x,y:y.y,rotation:S.rotation,silent:wn.isLabelSilent(n),style:Ct(f,{text:u,font:M,overflow:"truncate",width:I,ellipsis:P,fill:f.getTextColor()||n.get(["axisLine","lineStyle","color"]),align:f.get("align")||S.textAlign,verticalAlign:f.get("verticalAlign")||S.textVerticalAlign}),z2:1});if(Qo({el:D,componentModel:n,itemName:u}),D.__fullText=u,D.anid="name",n.get("triggerEvent")){var O=wn.makeAxisEventDataBase(n);O.targetType="axisName",O.name=u,De(D).eventData=O}a.add(D),D.updateTransform(),t.nameEl=D;var R=l.nameLayout=Ja({label:D,priority:D.z2,defaultAttr:{ignore:D.ignore},marginDefault:Hh(c)?Iae[N]:Dae[N]});if(l.nameLocation=c,i.add(D),D.decomposeTransform(),e.shouldNameMoveOverlap&&R){var F=r.ensureRecord(n);r.resolveAxisNameOverlap(e,r,n,R,x,F)}}}};function fj(e,t,r,n,i,a,o,s){gW(t)||Gae(e,t,i,s,n,o);var l=t.labelLayoutList;Wae(e,n,l,a),Zae(n,e.rotation,l);var u=e.optionHideOverlap;zae(n,l,u),u&&MG(ot(l,function(c){return c&&!c.label.ignore})),Eae(e,r,n,l)}function Oae(e,t,r,n){var i=eA(r-e),a,o,s=n[0]>n[1],l=t==="start"&&!s||t!=="start"&&s;return Oh(i-Ls/2)?(o=l?"bottom":"top",a="center"):Oh(i-Ls*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",iLs/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function zae(e,t,r){if(uG(e.axis))return;function n(s,l,u){var c=Ja(t[l]),h=Ja(t[u]);if(!(!c||!h)){if(s===!1||c.suggestIgnore){Xd(c.label);return}if(h.suggestIgnore){Xd(h.label);return}var f=.1;if(!r){var d=[0,0,0,0];c=DT({marginForce:d},c),h=DT({marginForce:d},h)}P_(c,h,null,{touchThreshold:f})&&Xd(s?h.label:c.label)}}var i=e.get(["axisLabel","showMinLabel"]),a=e.get(["axisLabel","showMaxLabel"]),o=t.length;n(i,0,1),n(a,o-1,o-2)}function Bae(e,t,r){e.showMinorTicks||j(t,function(n){if(n&&n.label.ignore)for(var i=0;iu[0]&&isFinite(g)&&isFinite(u[0]);)d=qb(d),g=u[1]-d*o;else{var y=e.getTicks().length-1;y>o&&(d=qb(d));var x=d*o;m=Math.ceil(u[1]/d)*d,g=ir(m-x),g<0&&u[0]>=0?(g=0,m=ir(x)):m>0&&u[1]<=0&&(m=0,g=-ir(x))}var _=(i[0].value-a[0].value)/s,w=(i[o].value-a[o].value)/s;n.setExtent.call(e,g+d*_,m+d*w),n.setInterval.call(e,d),(_||w)&&n.setNiceExtent.call(e,g+d,m-d)}var pj=[[3,1],[0,2]],qae=function(){function e(t,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=VT,this._initCartesian(t,r,n),this.model=t}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(t,r){var n=this._axesMap;this._updateScale(t,this.model);function i(o){var s,l=Qe(o),u=l.length;if(u){for(var c=[],h=u-1;h>=0;h--){var f=+l[h],d=o[f],g=d.model,m=d.scale;MT(m)&&g.get("alignTicks")&&g.get("interval")==null?c.push(d):(Gu(m,g),MT(m)&&(s=d))}c.length&&(s||(s=c.pop(),Gu(s.scale,s.model)),j(c,function(y){mW(y.scale,y.model,s.scale)}))}}i(n.x),i(n.y);var a={};j(n.x,function(o){gj(n,"y",o,a)}),j(n.y,function(o){gj(n,"x",o,a)}),this.resize(this.model,r)},e.prototype.resize=function(t,r,n){var i=Tr(t,r),a=this._rect=It(t.getBoxLayoutParams(),i.refContainer),o=this._axesMap,s=this._coordsList,l=t.get("containLabel");if(WT(o,a),!n){var u=Qae(a,s,o,l,r),c=void 0;if(l)HT?(HT(this._axesList,a),WT(o,a)):c=xj(a.clone(),"axisLabel",null,a,o,u,i);else{var h=eoe(t,a,i),f=h.outerBoundsRect,d=h.parsedOuterBoundsContain,g=h.outerBoundsClamp;f&&(c=xj(f,d,g,a,o,u,i))}yW(a,o,da.determine,null,c,i)}j(this._coordsList,function(m){m.calcAffineTransform()})},e.prototype.getAxis=function(t,r){var n=this._axesMap[t];if(n!=null)return n[r||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(t,r){if(t!=null&&r!=null){var n="x"+t+"y"+r;return this._coordsMap[n]}ke(t)&&(r=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,a=this._coordsList;i0})==null;return Bu(n,s,!0,!0,r),WT(i,n),l;function u(f){j(i[Oe[f]],function(d){if(dp(d.model)){var g=a.ensureRecord(d.model),m=g.labelInfoList;if(m)for(var y=0;y0&&!Xr(d)&&d>1e-4&&(f/=d),f}}function Qae(e,t,r,n,i){var a=new hW(toe);return j(r,function(o){return j(o,function(s){if(dp(s.model)){var l=!n;s.axisBuilder=Yae(e,t,s.model,i,a,l)}})}),a}function yW(e,t,r,n,i,a){var o=r===da.determine;j(t,function(u){return j(u,function(c){dp(c.model)&&(Xae(c.axisBuilder,e,c.model),c.axisBuilder.build(o?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var s={x:0,y:0};l(0),l(1);function l(u){s[Oe[1-u]]=e[pr[u]]<=a.refContainer[pr[u]]*.5?0:1-u===1?2:1}j(t,function(u,c){return j(u,function(h){dp(h.model)&&((n==="all"||o)&&h.axisBuilder.build({axisName:!0},{nameMarginLevel:s[c]}),o&&h.axisBuilder.build({axisLine:!0}))})})}function eoe(e,t,r){var n,i=e.get("outerBoundsMode",!0);i==="same"?n=t.clone():(i==null||i==="auto")&&(n=It(e.get("outerBounds",!0)||iW,r.refContainer));var a=e.get("outerBoundsContain",!0),o;a==null||a==="auto"||Ve(["all","axisLabel"],a)<0?o="all":o=a;var s=[P0(be(e.get("outerBoundsClampWidth",!0),ax[0]),t.width),P0(be(e.get("outerBoundsClampHeight",!0),ax[1]),t.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var toe=function(e,t,r,n,i,a){var o=r.axis.dim==="x"?"y":"x";fW(e,t,r,n,i,a),Hh(e.nameLocation)||j(t.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&vW(s.labelInfoList,s.dirVec,n,i)})};function roe(e,t){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return noe(r,e,t),r.seriesInvolved&&aoe(r,e),r}function noe(e,t,r){var n=t.getComponent("tooltip"),i=t.getComponent("axisPointer"),a=i.get("link",!0)||[],o=[];j(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=mp(s.model),u=e.coordSysAxesInfo[l]={};e.coordSysMap[l]=s;var c=s.model,h=c.getModel("tooltip",n);if(j(s.getAxes(),Fe(m,!1,null)),s.getTooltipAxes&&n&&h.get("show")){var f=h.get("trigger")==="axis",d=h.get(["axisPointer","type"])==="cross",g=s.getTooltipAxes(h.get(["axisPointer","axis"]));(f||d)&&j(g.baseAxes,Fe(m,d?"cross":!0,f)),d&&j(g.otherAxes,Fe(m,"cross",!1))}function m(y,x,_){var w=_.model.getModel("axisPointer",i),S=w.get("show");if(!(!S||S==="auto"&&!y&&!UT(w))){x==null&&(x=w.get("triggerTooltip")),w=y?ioe(_,h,i,t,y,x):w;var T=w.get("snap"),M=w.get("triggerEmphasis"),A=mp(_.model),P=x||T||_.type==="category",I=e.axesInfo[A]={key:A,axis:_,coordSys:s,axisPointerModel:w,triggerTooltip:x,triggerEmphasis:M,involveSeries:P,snap:T,useHandle:UT(w),seriesModels:[],linkGroup:null};u[A]=I,e.seriesInvolved=e.seriesInvolved||P;var N=ooe(a,_);if(N!=null){var D=o[N]||(o[N]={axesInfo:{}});D.axesInfo[A]=I,D.mapper=a[N].mapper,I.linkGroup=D}}}})}function ioe(e,t,r,n,i,a){var o=t.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};j(s,function(f){l[f]=Se(o.get(f))}),l.snap=e.type!=="category"&&!!a,o.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),i==="cross"){var c=o.get(["label","show"]);if(u.show=c??!0,!a){var h=l.lineStyle=o.get("crossStyle");h&&Ae(u,h.textStyle)}}return e.model.getModel("axisPointer",new qe(l,r,n))}function aoe(e,t){t.eachSeries(function(r){var n=r.coordinateSystem,i=r.get(["tooltip","trigger"],!0),a=r.get(["tooltip","show"],!0);!n||!n.model||i==="none"||i===!1||i==="item"||a===!1||r.get(["axisPointer","show"],!0)===!1||j(e.coordSysAxesInfo[mp(n.model)],function(o){var s=o.axis;n.getAxis(s.dim)===s&&(o.seriesModels.push(r),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=r.getData().count())})})}function ooe(e,t){for(var r=t.model,n=t.dim,i=0;i=0||e===t}function soe(e){var t=wk(e);if(t){var r=t.axisPointerModel,n=t.axis.scale,i=r.option,a=r.get("status"),o=r.get("value");o!=null&&(o=n.parse(o));var s=UT(r);a==null&&(i.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o0;return o&&s}var voe=Ye();function wj(e,t,r,n){if(e instanceof sW){var i=e.scale.type;if(i!=="category"&&i!=="ordinal")return r}var a=e.model,o=a.get("jitter"),s=a.get("jitterOverlap"),l=a.get("jitterMargin")||0,u=e.scale.type==="ordinal"?e.getBandWidth():null;return o>0?s?CW(r,o,u,n):poe(e,t,r,n,o,l):r}function CW(e,t,r,n){if(r===null)return e+(Math.random()-.5)*t;var i=r-n*2,a=Math.min(Math.max(0,t),i);return e+(Math.random()-.5)*a}function poe(e,t,r,n,i,a){var o=voe(e);o.items||(o.items=[]);var s=o.items,l=Sj(s,t,r,n,i,a,1),u=Sj(s,t,r,n,i,a,-1),c=Math.abs(l-r)i/2||h&&f>h/2-n?CW(r,i,h,n):(s.push({fixedCoord:t,floatCoord:c,r:n}),c)}function Sj(e,t,r,n,i,a,o){for(var s=r,l=0;li/2)return Number.MAX_VALUE;if(o===1&&g>s||o===-1&&g0&&!g.min?g.min=0:g.min!=null&&g.min<0&&!g.max&&(g.max=0);var m=l;g.color!=null&&(m=Ae({color:g.color},l));var y=Ge(Se(g),{boundaryGap:r,splitNumber:n,scale:i,axisLine:a,axisTick:o,axisLabel:s,name:g.text,showName:u,nameLocation:"end",nameGap:h,nameTextStyle:m,triggerEvent:f},!1);if(he(c)){var x=y.name;y.name=c.replace("{value}",x??"")}else we(c)&&(y.name=c(y.name,y));var _=new qe(y,null,this.ecModel);return Qt(_,Sf.prototype),_.mainType="radar",_.componentIndex=this.componentIndex,_},this);this._indicatorModels=d},t.prototype.getIndicatorModels=function(){return this._indicatorModels},t.type="radar",t.defaultOption={z:0,center:["50%","50%"],radius:"50%",startAngle:90,axisName:{show:!0,color:K.color.axisLabel},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:Ge({lineStyle:{color:K.color.neutral20}},wd.axisLine),axisLabel:Fm(wd.axisLabel,!1),axisTick:Fm(wd.axisTick,!1),splitLine:Fm(wd.splitLine,!0),splitArea:Fm(wd.splitArea,!0),indicator:[]},t}($e),Coe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=this.group;a.removeAll(),this._buildAxes(r,i),this._buildSplitLineAndArea(r)},t.prototype._buildAxes=function(r,n){var i=r.coordinateSystem,a=i.getIndicatorAxes(),o=ae(a,function(s){var l=s.model.get("showName")?s.name:"",u=new wn(s.model,n,{axisName:l,position:[i.cx,i.cy],rotation:s.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return u});j(o,function(s){s.build(),this.group.add(s.group)},this)},t.prototype._buildSplitLineAndArea=function(r){var n=r.coordinateSystem,i=n.getIndicatorAxes();if(!i.length)return;var a=r.get("shape"),o=r.getModel("splitLine"),s=r.getModel("splitArea"),l=o.getModel("lineStyle"),u=s.getModel("areaStyle"),c=o.get("show"),h=s.get("show"),f=l.get("color"),d=u.get("color"),g=re(f)?f:[f],m=re(d)?d:[d],y=[],x=[];function _(H,W,V){var z=V%W.length;return H[z]=H[z]||[],z}if(a==="circle")for(var w=i[0].getTicksCoords(),S=n.cx,T=n.cy,M=0;M3?1.4:o>1?1.2:1.1,c=a>0?u:1/u;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",r,{scale:c,originX:s,originY:l,isAvailableBehavior:null})}if(i){var h=Math.abs(a),f=(a>0?1:-1)*(h>3?.4:h>1?.15:.05);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:f,originX:s,originY:l,isAvailableBehavior:null})}}}},t.prototype._pinchHandler=function(r){if(!(Mj(this._zr,"globalPan")||Sd(r))){var n=r.pinchScale>1?1.1:1/1.1;this._checkTriggerMoveZoom(this,"zoom",null,r,{scale:n,originX:r.pinchX,originY:r.pinchY,isAvailableBehavior:null})}},t.prototype._checkTriggerMoveZoom=function(r,n,i,a,o){r._checkPointer(a,o.originX,o.originY)&&(Wo(a.event),a.__ecRoamConsumed=!0,Aj(r,n,i,a,o))},t}(Bi);function Sd(e){return e.__ecRoamConsumed}var Ioe=Ye();function E_(e){var t=Ioe(e);return t.roam=t.roam||{},t.uniform=t.uniform||{},t}function Cd(e,t,r,n){for(var i=E_(e),a=i.roam,o=a[t]=a[t]||[],s=0;s=4&&(c={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(c&&s!=null&&l!=null&&(h=NW(c,{x:0,y:0,width:s,height:l}),!r.ignoreViewBox)){var d=i;i=new Ce,i.add(d),d.scaleX=d.scaleY=h.scale,d.x=h.x,d.y=h.y}return!r.ignoreRootClip&&s!=null&&l!=null&&i.setClipPath(new Ze({shape:{x:0,y:0,width:s,height:l}})),{root:i,width:s,height:l,viewBoxRect:c,viewBoxTransform:h,named:a}},e.prototype._parseNode=function(t,r,n,i,a,o){var s=t.nodeName.toLowerCase(),l,u=i;if(s==="defs"&&(a=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")l=r;else{if(!a){var c=vw[s];if(c&&ge(vw,s)){l=c.call(this,t,r);var h=t.getAttribute("name");if(h){var f={name:h,namedFrom:null,svgNodeTagLower:s,el:l};n.push(f),s==="g"&&(u=f)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:l});r.add(l)}}var d=Pj[s];if(d&&ge(Pj,s)){var g=d.call(this,t),m=t.getAttribute("id");m&&(this._defs[m]=g)}}if(l&&l.isGroup)for(var y=t.firstChild;y;)y.nodeType===1?this._parseNode(y,l,n,u,a,o):y.nodeType===3&&o&&this._parseText(y,l),y=y.nextSibling},e.prototype._parseText=function(t,r){var n=new zh({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});vi(r,n),Un(t,n,this._defsUsePending,!1,!1),Roe(n,r);var i=n.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,n.scaleX*=a/9,n.scaleY*=a/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var s=n.getBoundingRect();return this._textX+=s.width,r.add(n),n},e.internalField=function(){vw={g:function(t,r){var n=new Ce;return vi(r,n),Un(t,n,this._defsUsePending,!1,!1),n},rect:function(t,r){var n=new Ze;return vi(r,n),Un(t,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(t.getAttribute("x")||"0"),y:parseFloat(t.getAttribute("y")||"0"),width:parseFloat(t.getAttribute("width")||"0"),height:parseFloat(t.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(t,r){var n=new ro;return vi(r,n),Un(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),n.silent=!0,n},line:function(t,r){var n=new ar;return vi(r,n),Un(t,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(t.getAttribute("x1")||"0"),y1:parseFloat(t.getAttribute("y1")||"0"),x2:parseFloat(t.getAttribute("x2")||"0"),y2:parseFloat(t.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(t,r){var n=new Gp;return vi(r,n),Un(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),rx:parseFloat(t.getAttribute("rx")||"0"),ry:parseFloat(t.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(t,r){var n=t.getAttribute("points"),i;n&&(i=Ej(n));var a=new en({shape:{points:i||[]},silent:!0});return vi(r,a),Un(t,a,this._defsUsePending,!1,!1),a},polyline:function(t,r){var n=t.getAttribute("points"),i;n&&(i=Ej(n));var a=new Gr({shape:{points:i||[]},silent:!0});return vi(r,a),Un(t,a,this._defsUsePending,!1,!1),a},image:function(t,r){var n=new Er;return vi(r,n),Un(t,n,this._defsUsePending,!1,!1),n.setStyle({image:t.getAttribute("xlink:href")||t.getAttribute("href"),x:+t.getAttribute("x"),y:+t.getAttribute("y"),width:+t.getAttribute("width"),height:+t.getAttribute("height")}),n.silent=!0,n},text:function(t,r){var n=t.getAttribute("x")||"0",i=t.getAttribute("y")||"0",a=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(o);var s=new Ce;return vi(r,s),Un(t,s,this._defsUsePending,!1,!0),s},tspan:function(t,r){var n=t.getAttribute("x"),i=t.getAttribute("y");n!=null&&(this._textX=parseFloat(n)),i!=null&&(this._textY=parseFloat(i));var a=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0",s=new Ce;return vi(r,s),Un(t,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(o),s},path:function(t,r){var n=t.getAttribute("d")||"",i=ZF(n);return vi(r,i),Un(t,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),e}(),Pj={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||"0",10),r=parseInt(e.getAttribute("y1")||"0",10),n=parseInt(e.getAttribute("x2")||"10",10),i=parseInt(e.getAttribute("y2")||"0",10),a=new qu(t,r,n,i);return Ij(e,a),Dj(e,a),a},radialgradient:function(e){var t=parseInt(e.getAttribute("cx")||"0",10),r=parseInt(e.getAttribute("cy")||"0",10),n=parseInt(e.getAttribute("r")||"0",10),i=new pA(t,r,n);return Ij(e,i),Dj(e,i),i}};function Ij(e,t){var r=e.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(t.global=!0)}function Dj(e,t){for(var r=e.firstChild;r;){if(r.nodeType===1&&r.nodeName.toLocaleLowerCase()==="stop"){var n=r.getAttribute("offset"),i=void 0;n&&n.indexOf("%")>0?i=parseInt(n,10)/100:n?i=parseFloat(n):i=0;var a={};LW(r,a,a);var o=a.stopColor||r.getAttribute("stop-color")||"#000000",s=a.stopOpacity||r.getAttribute("stop-opacity");if(s){var l=fn(o),u=l&&l[3];u&&(l[3]*=Po(s),o=Li(l,"rgba"))}t.colorStops.push({offset:i,color:o})}r=r.nextSibling}}function vi(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),Ae(t.__inheritedStyle,e.__inheritedStyle))}function Ej(e){for(var t=R_(e),r=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=R_(o);switch(i=i||Pr(),s){case"translate":ha(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":l_(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Ko(i,i,-parseFloat(l[0])*pw,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*pw);aa(i,[1,0,u,1,0,0],i);break;case"skewY":var c=Math.tan(parseFloat(l[0])*pw);aa(i,[1,c,0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5]);break}}t.setLocalTransform(i)}}var Rj=/([^\s:;]+)\s*:\s*([^:;]+)/g;function LW(e,t,r){var n=e.getAttribute("style");if(n){Rj.lastIndex=0;for(var i;(i=Rj.exec(n))!=null;){var a=i[1],o=ge(sx,a)?sx[a]:null;o&&(t[o]=i[2]);var s=ge(lx,a)?lx[a]:null;s&&(r[s]=i[2])}}}function Goe(e,t,r){for(var n=0;n0,_={api:n,geo:l,mapOrGeoModel:t,data:s,isVisualEncodedByVisualMap:x,isGeo:o,transformInfoRaw:f};l.resourceType==="geoJSON"?this._buildGeoJSON(_):l.resourceType==="geoSVG"&&this._buildSVG(_),this._updateController(t,y,r,n),this._updateMapSelectHandler(t,u,n,i)},e.prototype._buildGeoJSON=function(t){var r=this._regionsGroupByName=_e(),n=_e(),i=this._regionsGroup,a=t.transformInfoRaw,o=t.mapOrGeoModel,s=t.data,l=t.geo.projection,u=l&&l.stream;function c(d,g){return g&&(d=g(d)),d&&[d[0]*a.scaleX+a.x,d[1]*a.scaleY+a.y]}function h(d){for(var g=[],m=!u&&l&&l.project,y=0;y=0)&&(f=i);var d=o?{normal:{align:"center",verticalAlign:"middle"}}:null;Dr(t,Cr(n),{labelFetcher:f,labelDataIndex:h,defaultText:r},d);var g=t.getTextContent();if(g&&(PW(g).ignore=g.ignore,t.textConfig&&o)){var m=t.getBoundingRect().clone();t.textConfig.layoutRect=m,t.textConfig.position=[(o[0]-m.x)/m.width*100+"%",(o[1]-m.y)/m.height*100+"%"]}t.disableLabelAnimation=!0}else t.removeTextContent(),t.removeTextConfig(),t.disableLabelAnimation=null}function Vj(e,t,r,n,i,a){e.data?e.data.setItemGraphicEl(a,t):De(t).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:r,region:n&&n.option||{}}}function Gj(e,t,r,n,i){e.data||Qo({el:t,componentModel:i,itemName:r,itemTooltipOption:n.get("tooltip")})}function Wj(e,t,r,n,i){t.highDownSilentOnTouch=!!i.get("selectedMode");var a=n.getModel("emphasis"),o=a.get("focus");return Dt(t,o,a.get("blurScope"),a.get("disabled")),e.isGeo&&KK(t,i,r),o}function Hj(e,t,r){var n=[],i;function a(){i=[]}function o(){i.length&&(n.push(i),i=[])}var s=t({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(l,u){isFinite(l)&&isFinite(u)&&i.push([l,u])},sphere:function(){}});return!r&&s.polygonStart(),j(e,function(l){s.lineStart();for(var u=0;u-1&&(i.style.stroke=i.style.fill,i.style.fill=K.color.neutral00,i.style.lineWidth=2),i},t.type="series.map",t.dependencies=["geo"],t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:K.color.tertiary},itemStyle:{borderWidth:.5,borderColor:K.color.border,areaColor:K.color.background},emphasis:{label:{show:!0,color:K.color.primary},itemStyle:{areaColor:K.color.highlight}},select:{label:{show:!0,color:K.color.primary},itemStyle:{color:K.color.highlight}},nameProperty:"name"},t}(bt);function lse(e,t){var r={};return j(e,function(n){n.each(n.mapDimension("value"),function(i,a){var o="ec-"+n.getName(a);r[o]=r[o]||[],isNaN(i)||r[o].push(i)})}),e[0].map(e[0].mapDimension("value"),function(n,i){for(var a="ec-"+e[0].getName(i),o=0,s=1/0,l=-1/0,u=r[a].length,c=0;c1?(w.width=_,w.height=_/m):(w.height=_,w.width=_*m),w.y=x[1]-w.height/2,w.x=x[0]-w.width/2;else{var S=e.getBoxLayoutParams();S.aspect=m,w=It(S,g),w=M6(e,w,m)}this.setViewRect(w.x,w.y,w.width,w.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function fse(e,t){j(t.get("geoCoord"),function(r,n){e.addGeoCoord(n,r)})}var dse=function(){function e(){this.dimensions=DW}return e.prototype.create=function(t,r){var n=[];function i(o){return{nameProperty:o.get("nameProperty"),aspectScale:o.get("aspectScale"),projection:o.get("projection")}}t.eachComponent("geo",function(o,s){var l=o.get("map"),u=new YT(l+s,l,Q({nameMap:o.get("nameMap"),api:r,ecModel:t},i(o)));u.zoomLimit=o.get("scaleLimit"),n.push(u),o.coordinateSystem=u,u.model=o,u.resize=Yj,u.resize(o,r)}),t.eachSeries(function(o){$p({targetModel:o,coordSysType:"geo",coordSysProvider:function(){var s=o.subType==="map"?o.getHostGeoModel():o.getReferringComponents("geo",Ht).models[0];return s&&s.coordinateSystem},allowNotFound:!0})});var a={};return t.eachSeriesByType("map",function(o){if(!o.getHostGeoModel()){var s=o.getMapType();a[s]=a[s]||[],a[s].push(o)}}),j(a,function(o,s){var l=ae(o,function(c){return c.get("nameMap")}),u=new YT(s,s,Q({nameMap:a_(l),api:r,ecModel:t},i(o[0])));u.zoomLimit=Fr.apply(null,ae(o,function(c){return c.get("scaleLimit")})),n.push(u),u.resize=Yj,u.resize(o[0],r),j(o,function(c){c.coordinateSystem=u,fse(u,c)})}),n},e.prototype.getFilledRegions=function(t,r,n,i){for(var a=(t||[]).slice(),o=_e(),s=0;s=0;o--){var s=i[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},r.push(s)}}function xse(e,t){var r=e.isExpand?e.children:[],n=e.parentNode.children,i=e.hierNode.i?n[e.hierNode.i-1]:null;if(r.length){bse(e);var a=(r[0].hierNode.prelim+r[r.length-1].hierNode.prelim)/2;i?(e.hierNode.prelim=i.hierNode.prelim+t(e,i),e.hierNode.modifier=e.hierNode.prelim-a):e.hierNode.prelim=a}else i&&(e.hierNode.prelim=i.hierNode.prelim+t(e,i));e.parentNode.hierNode.defaultAncestor=wse(e,i,e.parentNode.hierNode.defaultAncestor||n[0],t)}function _se(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function Xj(e){return arguments.length?e:Tse}function qd(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function bse(e){for(var t=e.children,r=t.length,n=0,i=0;--r>=0;){var a=t[r];a.hierNode.prelim+=n,a.hierNode.modifier+=n,i+=a.hierNode.change,n+=a.hierNode.shift+i}}function wse(e,t,r,n){if(t){for(var i=e,a=e,o=a.parentNode.children[0],s=t,l=i.hierNode.modifier,u=a.hierNode.modifier,c=o.hierNode.modifier,h=s.hierNode.modifier;s=gw(s),a=mw(a),s&&a;){i=gw(i),o=mw(o),i.hierNode.ancestor=e;var f=s.hierNode.prelim+h-a.hierNode.prelim-u+n(s,a);f>0&&(Cse(Sse(s,e,r),e,f),u+=f,l+=f),h+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,c+=o.hierNode.modifier}s&&!gw(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=h-l),a&&!mw(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,r=e)}return r}function gw(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function mw(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function Sse(e,t,r){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:r}function Cse(e,t,r){var n=r/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=n,t.hierNode.shift+=r,t.hierNode.modifier+=r,t.hierNode.prelim+=r,e.hierNode.change+=n}function Tse(e,t){return e.parentNode===t.parentNode?1:2}var Mse=function(){function e(){this.parentPoint=[],this.childPoints=[]}return e}(),Ase=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultStyle=function(){return{stroke:K.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new Mse},t.prototype.buildPath=function(r,n){var i=n.childPoints,a=i.length,o=n.parentPoint,s=i[0],l=i[a-1];if(a===1){r.moveTo(o[0],o[1]),r.lineTo(s[0],s[1]);return}var u=n.orient,c=u==="TB"||u==="BT"?0:1,h=1-c,f=ce(n.forkPosition,1),d=[];d[c]=o[c],d[h]=o[h]+(l[h]-o[h])*f,r.moveTo(o[0],o[1]),r.lineTo(d[0],d[1]),r.moveTo(s[0],s[1]),d[c]=s[c],r.lineTo(d[0],d[1]),d[c]=l[c],r.lineTo(d[0],d[1]),r.lineTo(l[0],l[1]);for(var g=1;g_.x,T||(S=S-Math.PI));var A=T?"left":"right",P=s.getModel("label"),I=P.get("rotate"),N=I*(Math.PI/180),D=y.getTextContent();D&&(y.setTextConfig({position:P.get("position")||A,rotation:I==null?-S:N,origin:"center"}),D.setStyle("verticalAlign","middle"))}var O=s.get(["emphasis","focus"]),R=O==="relative"?Eh(o.getAncestorsIndices(),o.getDescendantIndices()):O==="ancestor"?o.getAncestorsIndices():O==="descendant"?o.getDescendantIndices():null;R&&(De(r).focus=R),Lse(i,o,c,r,g,d,m,n),r.__edge&&(r.onHoverStateChange=function(F){if(F!=="blur"){var H=o.parentNode&&e.getItemGraphicEl(o.parentNode.dataIndex);H&&H.hoverState===Vp||j0(r.__edge,F)}})}function Lse(e,t,r,n,i,a,o,s){var l=t.getModel(),u=e.get("edgeShape"),c=e.get("layout"),h=e.getOrient(),f=e.get(["lineStyle","curveness"]),d=e.get("edgeForkPosition"),g=l.getModel("lineStyle").getLineStyle(),m=n.__edge;if(u==="curve")t.parentNode&&t.parentNode!==r&&(m||(m=n.__edge=new hf({shape:XT(c,h,f,i,i)})),it(m,{shape:XT(c,h,f,a,o)},e));else if(u==="polyline"&&c==="orthogonal"&&t!==r&&t.children&&t.children.length!==0&&t.isExpand===!0){for(var y=t.children,x=[],_=0;_r&&(r=i.height)}this.height=r+1},e.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var r=0,n=this.children,i=n.length;r=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,r)},e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},e.prototype.getModel=function(t){if(!(this.dataIndex<0)){var r=this.hostTree,n=r.data.getItemModel(this.dataIndex);return n.getModel(t)}},e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(t,r){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,r)},e.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},e.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,r=0;r=0){var n=r.getData().tree.root,i=e.targetNode;if(he(i)&&(i=n.getNodeById(i)),i&&n.contains(i))return{node:i};var a=e.targetNodeId;if(a!=null&&(i=n.getNodeById(a)))return{node:i}}}function BW(e){for(var t=[];e;)e=e.parentNode,e&&t.push(e);return t.reverse()}function Nk(e,t){var r=BW(e);return Ve(r,t)>=0}function O_(e,t){for(var r=[];e;){var n=e.dataIndex;r.push({name:e.name,dataIndex:n,value:t.getRawValue(n)}),e=e.parentNode}return r.reverse(),r}var zse=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.hasSymbolVisual=!0,r.ignoreStyleOnData=!0,r}return t.prototype.getInitialData=function(r){var n={name:r.name,children:r.data},i=r.leaves||{},a=new qe(i,this,this.ecModel),o=Lk.createTree(n,this,s);function s(h){h.wrapMethod("getItemModel",function(f,d){var g=o.getNodeByDataIndex(d);return g&&g.children.length&&g.isExpand||(f.parentModel=a),f})}var l=0;o.eachNode("preorder",function(h){h.depth>l&&(l=h.depth)});var u=r.expandAndCollapse,c=u&&r.initialTreeDepth>=0?r.initialTreeDepth:l;return o.root.eachNode("preorder",function(h){var f=h.hostTree.data.getRawDataItem(h.dataIndex);h.isExpand=f&&f.collapsed!=null?!f.collapsed:h.depth<=c}),o.data},t.prototype.getOrient=function(){var r=this.get("orient");return r==="horizontal"?r="LR":r==="vertical"&&(r="TB"),r},t.prototype.setZoom=function(r){this.option.zoom=r},t.prototype.setCenter=function(r){this.option.center=r},t.prototype.formatTooltip=function(r,n,i){for(var a=this.getData().tree,o=a.root.children[0],s=a.getNodeByDataIndex(r),l=s.getValue(),u=s.name;s&&s!==o;)u=s.parentNode.name+"."+u,s=s.parentNode;return gr("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},t.prototype.getDataParams=function(r){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treeAncestors=O_(i,this),n.collapsed=!i.isExpand,n},t.type="series.tree",t.layoutMode="box",t.defaultOption={z:2,coordinateSystemUsage:"box",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,roamTrigger:"global",nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:K.color.borderTint,width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t}(bt);function Bse(e,t,r){for(var n=[e],i=[],a;a=n.pop();)if(i.push(a),a.isExpand){var o=a.children;if(o.length)for(var s=0;s=0;a--)r.push(i[a])}}function Fse(e,t){e.eachSeriesByType("tree",function(r){Vse(r,t)})}function Vse(e,t){var r=Tr(e,t).refContainer,n=It(e.getBoxLayoutParams(),r);e.layoutInfo=n;var i=e.get("layout"),a=0,o=0,s=null;i==="radial"?(a=2*Math.PI,o=Math.min(n.height,n.width)/2,s=Xj(function(S,T){return(S.parentNode===T.parentNode?1:2)/S.depth})):(a=n.width,o=n.height,s=Xj());var l=e.getData().tree.root,u=l.children[0];if(u){yse(l),Bse(u,xse,s),l.hierNode.modifier=-u.hierNode.prelim,Ad(u,_se);var c=u,h=u,f=u;Ad(u,function(S){var T=S.getLayout().x;Th.getLayout().x&&(h=S),S.depth>f.depth&&(f=S)});var d=c===h?1:s(c,h)/2,g=d-c.getLayout().x,m=0,y=0,x=0,_=0;if(i==="radial")m=a/(h.getLayout().x+d+g),y=o/(f.depth-1||1),Ad(u,function(S){x=(S.getLayout().x+g)*m,_=(S.depth-1)*y;var T=qd(x,_);S.setLayout({x:T.x,y:T.y,rawX:x,rawY:_},!0)});else{var w=e.getOrient();w==="RL"||w==="LR"?(y=o/(h.getLayout().x+d+g),m=a/(f.depth-1||1),Ad(u,function(S){_=(S.getLayout().x+g)*y,x=w==="LR"?(S.depth-1)*m:a-(S.depth-1)*m,S.setLayout({x,y:_},!0)})):(w==="TB"||w==="BT")&&(m=a/(h.getLayout().x+d+g),y=o/(f.depth-1||1),Ad(u,function(S){x=(S.getLayout().x+g)*m,_=w==="TB"?(S.depth-1)*y:o-(S.depth-1)*y,S.setLayout({x,y:_},!0)}))}}}function Gse(e){e.eachSeriesByType("tree",function(t){var r=t.getData(),n=r.tree;n.eachNode(function(i){var a=i.getModel(),o=a.getModel("itemStyle").getItemStyle(),s=r.ensureUniqueItemVisual(i.dataIndex,"style");Q(s,o)})})}function Wse(e){e.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(t,r){r.eachComponent({mainType:"series",subType:"tree",query:t},function(n){var i=t.dataIndex,a=n.getData().tree,o=a.getNodeByDataIndex(i);o.isExpand=!o.isExpand})}),e.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(t,r,n){r.eachComponent({mainType:"series",subType:"tree",query:t},function(i){var a=i.coordinateSystem,o=j_(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}function Hse(e){e.registerChartView(kse),e.registerSeriesModel(zse),e.registerLayout(Fse),e.registerVisual(Gse),Wse(e)}var eR=["treemapZoomToNode","treemapRender","treemapMove"];function Use(e){for(var t=0;t1;)a=a.parentNode;var o=fT(e.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var Zse=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.preventUsingHoverLayer=!0,r}return t.prototype.getInitialData=function(r,n){var i={name:r.name,children:r.data};VW(i);var a=r.levels||[],o=this.designatedVisualItemStyle={},s=new qe({itemStyle:o},this,n);a=r.levels=$se(a,n);var l=ae(a||[],function(h){return new qe(h,s,n)},this),u=Lk.createTree(i,this,c);function c(h){h.wrapMethod("getItemModel",function(f,d){var g=u.getNodeByDataIndex(d),m=g?l[g.depth]:null;return f.parentModel=m||s,f})}return u.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(r,n,i){var a=this.getData(),o=this.getRawValue(r),s=a.getName(r);return gr("nameValue",{name:s,value:o})},t.prototype.getDataParams=function(r){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treeAncestors=O_(i,this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(r){this.layoutInfo=this.layoutInfo||{},Q(this.layoutInfo,r)},t.prototype.mapIdToIndex=function(r){var n=this._idIndexMap;n||(n=this._idIndexMap=_e(),this._idIndexMapCount=0);var i=n.get(r);return i==null&&n.set(r,i=this._idIndexMapCount++),i},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(r){r?this._viewRoot=r:r=this._viewRoot;var n=this.getRawData().tree.root;(!r||r!==n&&!n.contains(r))&&(this._viewRoot=n)},t.prototype.enableAriaDecal=function(){FW(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,coordinateSystemUsage:"box",left:K.size.l,top:K.size.xxxl,right:K.size.l,bottom:K.size.xxxl,sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.32*.32,scaleLimit:{max:5,min:.2},roam:!0,roamTrigger:"global",nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",bottom:K.size.m,emptyItemWidth:25,itemStyle:{color:K.color.backgroundShade,textStyle:{color:K.color.secondary}},emphasis:{itemStyle:{color:K.color.background}}},label:{show:!0,distance:0,padding:5,position:"inside",color:K.color.neutral00,overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:K.color.neutral00,borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},t}(bt);function VW(e){var t=0;j(e.children,function(n){VW(n);var i=n.value;re(i)&&(i=i[0]),t+=i});var r=e.value;re(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),re(e.value)?e.value[0]=r:e.value=r}function $se(e,t){var r=Tt(t.get("color")),n=Tt(t.get(["aria","decal","decals"]));if(r){e=e||[];var i,a;j(e,function(s){var l=new qe(s),u=l.get("color"),c=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(i=!0),(l.get(["itemStyle","decal"])||c&&c!=="none")&&(a=!0)});var o=e[0]||(e[0]={});return i||(o.color=r.slice()),!a&&n&&(o.decal=n.slice()),e}}var Yse=8,tR=8,yw=5,Xse=function(){function e(t){this.group=new Ce,t.add(this.group)}return e.prototype.render=function(t,r,n,i){var a=t.getModel("breadcrumb"),o=this.group;if(o.removeAll(),!(!a.get("show")||!n)){var s=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=s.getModel("textStyle"),c=l.getModel(["itemStyle","textStyle"]),h=Tr(t,r).refContainer,f={left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},d={emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]},g=It(f,h);this._prepare(n,d,u),this._renderContent(t,d,g,s,l,u,c,i),C_(o,f,h)}},e.prototype._prepare=function(t,r,n){for(var i=t;i;i=i.parentNode){var a=br(i.getModel().get("name"),""),o=n.getTextRect(a),s=Math.max(o.width+Yse*2,r.emptyItemWidth);r.totalWidth+=s+tR,r.renderList.push({node:i,text:a,width:s})}},e.prototype._renderContent=function(t,r,n,i,a,o,s,l){for(var u=0,c=r.emptyItemWidth,h=t.get(["breadcrumb","height"]),f=r.totalWidth,d=r.renderList,g=a.getModel("itemStyle").getItemStyle(),m=d.length-1;m>=0;m--){var y=d[m],x=y.node,_=y.width,w=y.text;f>n.width&&(f-=_-c,_=c,w=null);var S=new en({shape:{points:qse(u,0,_,h,m===d.length-1,m===0)},style:Ae(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new tt({style:Ct(o,{text:w})}),textConfig:{position:"inside"},z2:uf*1e4,onclick:Fe(l,x)});S.disableLabelAnimation=!0,S.getTextContent().ensureState("emphasis").style=Ct(s,{text:w}),S.ensureState("emphasis").style=g,Dt(S,a.get("focus"),a.get("blurScope"),a.get("disabled")),this.group.add(S),Kse(S,t,x),u+=_+tR}},e.prototype.remove=function(){this.group.removeAll()},e}();function qse(e,t,r,n,i,a){var o=[[i?e:e-yw,t],[e+r,t],[e+r,t+n],[i?e:e-yw,t+n]];return!a&&o.splice(2,0,[e+r+yw,t+n/2]),!i&&o.push([e,t+n/2]),o}function Kse(e,t,r){De(e).eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:r&&r.dataIndex,name:r&&r.name},treePathInfo:r&&O_(r,t)}}var Jse=function(){function e(){this._storage=[],this._elExistsMap={}}return e.prototype.add=function(t,r,n,i,a){return this._elExistsMap[t.id]?!1:(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:r,duration:n,delay:i,easing:a}),!0)},e.prototype.finished=function(t){return this._finishedCallback=t,this},e.prototype.start=function(){for(var t=this,r=this._storage.length,n=function(){r--,r<=0&&(t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},i=0,a=this._storage.length;inR||Math.abs(r.dy)>nR)){var n=this.seriesModel.getData().tree.root;if(!n)return;var i=n.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+r.dx,y:i.y+r.dy,width:i.width,height:i.height}})}},t.prototype._onZoom=function(r){var n=r.originX,i=r.originY,a=r.scale;if(this._state!=="animating"){var o=this.seriesModel.getData().tree.root;if(!o)return;var s=o.getLayout();if(!s)return;var l=new Pe(s.x,s.y,s.width,s.height),u=null,c=this._controllerHost;u=c.zoomLimit;var h=c.zoom=c.zoom||1;if(h*=a,u){var f=u.min||0,d=u.max||1/0;h=Math.max(Math.min(d,h),f)}var g=h/c.zoom;c.zoom=h;var m=this.seriesModel.layoutInfo;n-=m.x,i-=m.y;var y=Pr();ha(y,y,[-n,-i]),l_(y,y,[g,g]),ha(y,y,[n,i]),l.applyTransform(y),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:l.x,y:l.y,width:l.width,height:l.height}})}},t.prototype._initEvents=function(r){var n=this;r.on("click",function(i){if(n._state==="ready"){var a=n.seriesModel.get("nodeClick",!0);if(a){var o=n.findTarget(i.offsetX,i.offsetY);if(o){var s=o.node;if(s.getLayout().isLeafRoot)n._rootToNode(o);else if(a==="zoomToNode")n._zoomToNode(o);else if(a==="link"){var l=s.hostTree.data.getItemModel(s.dataIndex),u=l.get("link",!0),c=l.get("target",!0)||"blank";u&&B0(u,c)}}}}},this)},t.prototype._renderBreadcrumb=function(r,n,i){var a=this;i||(i=r.get("leafDepth",!0)!=null?{node:r.getViewRoot()}:this.findTarget(n.getWidth()/2,n.getHeight()/2),i||(i={node:r.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new Xse(this.group))).render(r,n,i.node,function(o){a._state!=="animating"&&(Nk(r.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=kd(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(r){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:r.node})},t.prototype._rootToNode=function(r){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:r.node})},t.prototype.findTarget=function(r,n){var i,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(o){var s=this._storage.background[o.getRawIndex()];if(s){var l=s.transformCoordToLocal(r,n),u=s.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)i={node:o,offsetX:l[0],offsetY:l[1]};else return!1}},this),i},t.type="treemap",t}(gt);function kd(){return{nodeGroup:[],background:[],content:[]}}function ile(e,t,r,n,i,a,o,s,l,u){if(!o)return;var c=o.getLayout(),h=e.getData(),f=o.getModel();if(h.setItemGraphicEl(o.dataIndex,null),!c||!c.isInView)return;var d=c.width,g=c.height,m=c.borderWidth,y=c.invisible,x=o.getRawIndex(),_=s&&s.getRawIndex(),w=o.viewChildren,S=c.upperHeight,T=w&&w.length,M=f.getModel("itemStyle"),A=f.getModel(["emphasis","itemStyle"]),P=f.getModel(["blur","itemStyle"]),I=f.getModel(["select","itemStyle"]),N=M.get("borderRadius")||0,D=se("nodeGroup",qT);if(!D)return;if(l.add(D),D.x=c.x||0,D.y=c.y||0,D.markRedraw(),ux(D).nodeWidth=d,ux(D).nodeHeight=g,c.isAboveViewRoot)return D;var O=se("background",rR,u,tle);O&&U(D,O,T&&c.upperLabelHeight);var R=f.getModel("emphasis"),F=R.get("focus"),H=R.get("blurScope"),W=R.get("disabled"),V=F==="ancestor"?o.getAncestorsIndices():F==="descendant"?o.getDescendantIndices():F;if(T)np(D)&&fu(D,!1),O&&(fu(O,!W),h.setItemGraphicEl(o.dataIndex,O),tT(O,V,H));else{var z=se("content",rR,u,rle);z&&$(D,z),O.disableMorphing=!0,O&&np(O)&&fu(O,!1),fu(D,!W),h.setItemGraphicEl(o.dataIndex,D);var Z=f.getShallow("cursor");Z&&z.attr("cursor",Z),tT(D,V,H)}return D;function U(me,ye,Me){var pe=De(ye);if(pe.dataIndex=o.dataIndex,pe.seriesIndex=e.seriesIndex,ye.setShape({x:0,y:0,width:d,height:g,r:N}),y)Y(ye);else{ye.invisible=!1;var Te=o.getVisual("style"),st=Te.stroke,ze=oR(M);ze.fill=st;var et=Jl(A);et.fill=A.get("borderColor");var lt=Jl(P);lt.fill=P.get("borderColor");var Et=Jl(I);if(Et.fill=I.get("borderColor"),Me){var lr=d-2*m;te(ye,st,Te.opacity,{x:m,y:0,width:lr,height:S})}else ye.removeTextContent();ye.setStyle(ze),ye.ensureState("emphasis").style=et,ye.ensureState("blur").style=lt,ye.ensureState("select").style=Et,zu(ye)}me.add(ye)}function $(me,ye){var Me=De(ye);Me.dataIndex=o.dataIndex,Me.seriesIndex=e.seriesIndex;var pe=Math.max(d-2*m,0),Te=Math.max(g-2*m,0);if(ye.culling=!0,ye.setShape({x:m,y:m,width:pe,height:Te,r:N}),y)Y(ye);else{ye.invisible=!1;var st=o.getVisual("style"),ze=st.fill,et=oR(M);et.fill=ze,et.decal=st.decal;var lt=Jl(A),Et=Jl(P),lr=Jl(I);te(ye,ze,st.opacity,null),ye.setStyle(et),ye.ensureState("emphasis").style=lt,ye.ensureState("blur").style=Et,ye.ensureState("select").style=lr,zu(ye)}me.add(ye)}function Y(me){!me.invisible&&a.push(me)}function te(me,ye,Me,pe){var Te=f.getModel(pe?aR:iR),st=br(f.get("name"),null),ze=Te.getShallow("show");Dr(me,Cr(f,pe?aR:iR),{defaultText:ze?st:null,inheritColor:ye,defaultOpacity:Me,labelFetcher:e,labelDataIndex:o.dataIndex});var et=me.getTextContent();if(et){var lt=et.style,Et=Rp(lt.padding||0);pe&&(me.setTextConfig({layoutRect:pe}),et.disableLabelLayout=!0),et.beforeUpdate=function(){var Mr=Math.max((pe?pe.width:me.shape.width)-Et[1]-Et[3],0),Gn=Math.max((pe?pe.height:me.shape.height)-Et[0]-Et[2],0);(lt.width!==Mr||lt.height!==Gn)&&et.setStyle({width:Mr,height:Gn})},lt.truncateMinChar=2,lt.lineOverflow="truncate",ie(lt,pe,c);var lr=et.getState("emphasis");ie(lr?lr.style:null,pe,c)}}function ie(me,ye,Me){var pe=me?me.text:null;if(!ye&&Me.isLeafRoot&&pe!=null){var Te=e.get("drillDownIcon",!0);me.text=Te?Te+" "+pe:pe}}function se(me,ye,Me,pe){var Te=_!=null&&r[me][_],st=i[me];return Te?(r[me][_]=null,le(st,Te)):y||(Te=new ye,Te instanceof Ri&&(Te.z2=ale(Me,pe)),Ee(st,Te)),t[me][x]=Te}function le(me,ye){var Me=me[x]={};ye instanceof qT?(Me.oldX=ye.x,Me.oldY=ye.y):Me.oldShape=Q({},ye.shape)}function Ee(me,ye){var Me=me[x]={},pe=o.parentNode,Te=ye instanceof Ce;if(pe&&(!n||n.direction==="drillDown")){var st=0,ze=0,et=i.background[pe.getRawIndex()];!n&&et&&et.oldShape&&(st=et.oldShape.width,ze=et.oldShape.height),Te?(Me.oldX=0,Me.oldY=ze):Me.oldShape={x:st,y:ze,width:0,height:0}}Me.fadein=!Te}}function ale(e,t){return e*ele+t}var xp=j,ole=ke,cx=-1,Ir=function(){function e(t){var r=t.mappingMethod,n=t.type,i=this.option=Se(t);this.type=n,this.mappingMethod=r,this._normalizeData=ule[r];var a=e.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(xw(i),sle(i)):r==="category"?i.categories?lle(i):xw(i,!0):(Jr(r!=="linear"||i.dataExtent),xw(i))}return e.prototype.mapValueToVisual=function(t){var r=this._normalizeData(t);return this._normalizedToVisual(r,t)},e.prototype.getNormalizer=function(){return fe(this._normalizeData,this)},e.listVisualTypes=function(){return Qe(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(t,r,n){ke(t)?j(t,r,n):r.call(n,t)},e.mapVisual=function(t,r,n){var i,a=re(t)?[]:ke(t)?{}:(i=!0,null);return e.eachVisual(t,function(o,s){var l=r.call(n,o,s);i?a=l:a[s]=l}),a},e.retrieveVisuals=function(t){var r={},n;return t&&xp(e.visualHandlers,function(i,a){t.hasOwnProperty(a)&&(r[a]=t[a],n=!0)}),n?r:null},e.prepareVisualTypes=function(t){if(re(t))t=t.slice();else if(ole(t)){var r=[];xp(t,function(n,i){r.push(i)}),t=r}else return[];return t.sort(function(n,i){return i==="color"&&n!=="color"&&n.indexOf("color")===0?1:-1}),t},e.dependsOn=function(t,r){return r==="color"?!!(t&&t.indexOf(r)===0):t===r},e.findPieceIndex=function(t,r,n){for(var i,a=1/0,o=0,s=r.length;o=0;a--)n[a]==null&&(delete r[t[a]],t.pop())}function xw(e,t){var r=e.visual,n=[];ke(r)?xp(r,function(a){n.push(a)}):r!=null&&n.push(r);var i={color:1,symbol:1};!t&&n.length===1&&!i.hasOwnProperty(e.type)&&(n[1]=n[0]),GW(e,n)}function Gm(e){return{applyVisual:function(t,r,n){var i=this.mapValueToVisual(t);n("color",e(r("color"),i))},_normalizedToVisual:KT([0,1])}}function sR(e){var t=this.option.visual;return t[Math.round(ht(e,[0,1],[0,t.length-1],!0))]||{}}function Ld(e){return function(t,r,n){n(e,this.mapValueToVisual(t))}}function Kd(e){var t=this.option.visual;return t[this.option.loop&&e!==cx?e%t.length:e]}function Ql(){return this.option.visual[0]}function KT(e){return{linear:function(t){return ht(t,e,this.option.visual,!0)},category:Kd,piecewise:function(t,r){var n=JT.call(this,r);return n==null&&(n=ht(t,e,this.option.visual,!0)),n},fixed:Ql}}function JT(e){var t=this.option,r=t.pieceList;if(t.hasSpecialVisual){var n=Ir.findPieceIndex(e,r),i=r[n];if(i&&i.visual)return i.visual[this.type]}}function GW(e,t){return e.visual=t,e.type==="color"&&(e.parsedVisual=ae(t,function(r){var n=fn(r);return n||[0,0,0,1]})),t}var ule={linear:function(e){return ht(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,r=Ir.findPieceIndex(e,t,!0);if(r!=null)return ht(r,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return t??cx},fixed:qt};function Wm(e,t,r){return e?t<=r:t=r.length||m===r[m.depth]){var x=ple(i,l,m,y,g,n);HW(m,x,r,n)}})}}}function fle(e,t,r){var n=Q({},t),i=r.designatedVisualItemStyle;return j(["color","colorAlpha","colorSaturation"],function(a){i[a]=t[a];var o=e.get(a);i[a]=null,o!=null&&(n[a]=o)}),n}function lR(e){var t=_w(e,"color");if(t){var r=_w(e,"colorAlpha"),n=_w(e,"colorSaturation");return n&&(t=Io(t,null,null,n)),r&&(t=Jv(t,r)),t}}function dle(e,t){return t!=null?Io(t,null,null,e):null}function _w(e,t){var r=e[t];if(r!=null&&r!=="none")return r}function vle(e,t,r,n,i,a){if(!(!a||!a.length)){var o=bw(t,"color")||i.color!=null&&i.color!=="none"&&(bw(t,"colorAlpha")||bw(t,"colorSaturation"));if(o){var s=t.get("visualMin"),l=t.get("visualMax"),u=r.dataExtent.slice();s!=null&&su[1]&&(u[1]=l);var c=t.get("colorMappingBy"),h={type:o.name,dataExtent:u,visual:o.range};h.type==="color"&&(c==="index"||c==="id")?(h.mappingMethod="category",h.loop=!0):h.mappingMethod="linear";var f=new Ir(h);return WW(f).drColorMappingBy=c,f}}}function bw(e,t){var r=e.get(t);return re(r)&&r.length?{name:t,range:r}:null}function ple(e,t,r,n,i,a){var o=Q({},t);if(i){var s=i.type,l=s==="color"&&WW(i).drColorMappingBy,u=l==="index"?n:l==="id"?a.mapIdToIndex(r.getId()):r.getValue(e.get("visualDimension"));o[s]=i.mapValueToVisual(u)}return o}var _p=Math.max,hx=Math.min,uR=Fr,Pk=j,UW=["itemStyle","borderWidth"],gle=["itemStyle","gapWidth"],mle=["upperLabel","show"],yle=["upperLabel","height"];const xle={seriesType:"treemap",reset:function(e,t,r,n){var i=e.option,a=Tr(e,r).refContainer,o=It(e.getBoxLayoutParams(),a),s=i.size||[],l=ce(uR(o.width,s[0]),a.width),u=ce(uR(o.height,s[1]),a.height),c=n&&n.type,h=["treemapZoomToNode","treemapRootToNode"],f=yp(n,h,e),d=c==="treemapRender"||c==="treemapMove"?n.rootRect:null,g=e.getViewRoot(),m=BW(g);if(c!=="treemapMove"){var y=c==="treemapZoomToNode"?Tle(e,f,g,l,u):d?[d.width,d.height]:[l,u],x=i.sort;x&&x!=="asc"&&x!=="desc"&&(x="desc");var _={squareRatio:i.squareRatio,sort:x,leafDepth:i.leafDepth};g.hostTree.clearLayouts();var w={x:0,y:0,width:y[0],height:y[1],area:y[0]*y[1]};g.setLayout(w),ZW(g,_,!1,0),w=g.getLayout(),Pk(m,function(T,M){var A=(m[M+1]||g).getValue();T.setLayout(Q({dataExtent:[A,A],borderWidth:0,upperHeight:0},w))})}var S=e.getData().tree.root;S.setLayout(Mle(o,d,f),!0),e.setLayoutInfo(o),$W(S,new Pe(-o.x,-o.y,r.getWidth(),r.getHeight()),m,g,0)}};function ZW(e,t,r,n){var i,a;if(!e.isRemoved()){var o=e.getLayout();i=o.width,a=o.height;var s=e.getModel(),l=s.get(UW),u=s.get(gle)/2,c=YW(s),h=Math.max(l,c),f=l-u,d=h-u;e.setLayout({borderWidth:l,upperHeight:h,upperLabelHeight:c},!0),i=_p(i-2*f,0),a=_p(a-f-d,0);var g=i*a,m=_le(e,s,g,t,r,n);if(m.length){var y={x:f,y:d,width:i,height:a},x=hx(i,a),_=1/0,w=[];w.area=0;for(var S=0,T=m.length;S=0;l--){var u=i[n==="asc"?o-l-1:l].getValue();u/r*ts[1]&&(s[1]=u)})),{sum:n,dataExtent:s}}function Cle(e,t,r){for(var n=0,i=1/0,a=0,o=void 0,s=e.length;an&&(n=o));var l=e.area*e.area,u=t*t*r;return l?_p(u*n/l,l/(u*i)):1/0}function cR(e,t,r,n,i){var a=t===r.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=r[s[a]],c=t?e.area/t:0;(i||c>r[l[o]])&&(c=r[l[o]]);for(var h=0,f=e.length;hHC&&(u=HC),a=s}un&&(n=t);var a=n%2?n+2:n+3;i=[];for(var o=0;o0&&(T[0]=-T[0],T[1]=-T[1]);var A=S[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var P=-Math.atan2(S[1],S[0]);h[0].8?"left":f[0]<-.8?"right":"center",m=f[1]>.8?"top":f[1]<-.8?"bottom":"middle";break;case"start":a.x=-f[0]*x+c[0],a.y=-f[1]*_+c[1],g=f[0]>.8?"right":f[0]<-.8?"left":"center",m=f[1]>.8?"bottom":f[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=x*A+c[0],a.y=c[1]+I,g=S[0]<0?"right":"left",a.originX=-x*A,a.originY=-I;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=M[0],a.y=M[1]+I,g="center",a.originY=-I;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-x*A+h[0],a.y=h[1]+I,g=S[0]>=0?"right":"left",a.originX=x*A,a.originY=-I;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||m,align:a.__align||g})}},t}(Ce),Rk=function(){function e(t){this.group=new Ce,this._LineCtor=t||jk}return e.prototype.updateData=function(t){var r=this;this._progressiveEls=null;var n=this,i=n.group,a=n._lineData;n._lineData=t,a||i.removeAll();var o=gR(t);t.diff(a).add(function(s){r._doAdd(t,s,o)}).update(function(s,l){r._doUpdate(a,t,l,s,o)}).remove(function(s){i.remove(a.getItemGraphicEl(s))}).execute()},e.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl(function(r,n){r.updateLayout(t,n)},this)},e.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=gR(t),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r){this._progressiveEls=[];function n(s){!s.isGroup&&!Wle(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var i=t.start;i0}function gR(e){var t=e.hostModel,r=t.getModel("emphasis");return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:r.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:r.get("disabled"),blurScope:r.get("blurScope"),focus:r.get("focus"),labelStatesModels:Cr(t)}}function mR(e){return isNaN(e[0])||isNaN(e[1])}function Mw(e){return e&&!mR(e[0])&&!mR(e[1])}var Aw=[],kw=[],Lw=[],Dc=Br,Nw=Vs,yR=Math.abs;function xR(e,t,r){for(var n=e[0],i=e[1],a=e[2],o=1/0,s,l=r*r,u=.1,c=.1;c<=.9;c+=.1){Aw[0]=Dc(n[0],i[0],a[0],c),Aw[1]=Dc(n[1],i[1],a[1],c);var h=yR(Nw(Aw,t)-l);h=0?s=s+u:s=s-u:g>=0?s=s-u:s=s+u}return s}function Pw(e,t){var r=[],n=qv,i=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge(function(s,l){var u=s.getLayout(),c=s.getVisual("fromSymbol"),h=s.getVisual("toSymbol");u.__original||(u.__original=[Ga(u[0]),Ga(u[1])],u[2]&&u.__original.push(Ga(u[2])));var f=u.__original;if(u[2]!=null){if(ln(i[0],f[0]),ln(i[1],f[2]),ln(i[2],f[1]),c&&c!=="none"){var d=Qd(s.node1),g=xR(i,f[0],d*t);n(i[0][0],i[1][0],i[2][0],g,r),i[0][0]=r[3],i[1][0]=r[4],n(i[0][1],i[1][1],i[2][1],g,r),i[0][1]=r[3],i[1][1]=r[4]}if(h&&h!=="none"){var d=Qd(s.node2),g=xR(i,f[1],d*t);n(i[0][0],i[1][0],i[2][0],g,r),i[1][0]=r[1],i[2][0]=r[2],n(i[0][1],i[1][1],i[2][1],g,r),i[1][1]=r[1],i[2][1]=r[2]}ln(u[0],i[0]),ln(u[1],i[2]),ln(u[2],i[1])}else{if(ln(a[0],f[0]),ln(a[1],f[1]),Ts(o,a[1],a[0]),Xu(o,o),c&&c!=="none"){var d=Qd(s.node1);x0(a[0],a[0],o,d*t)}if(h&&h!=="none"){var d=Qd(s.node2);x0(a[1],a[1],o,-d*t)}ln(u[0],a[0]),ln(u[1],a[1])}})}var tH=Ye();function Hle(e){if(e)return tH(e).bridge}function _R(e,t){e&&(tH(e).bridge=t)}function bR(e){return e.type==="view"}var Ule=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){var i=new Kp,a=new Rk,o=this.group,s=new Ce;this._controller=new rc(n.getZr()),this._controllerHost={target:s},s.add(i.group),s.add(a.group),o.add(s),this._symbolDraw=i,this._lineDraw=a,this._mainGroup=s,this._firstRender=!0},t.prototype.render=function(r,n,i){var a=this,o=r.coordinateSystem,s=!1;this._model=r,this._api=i,this._active=!0;var l=this._getThumbnailInfo();l&&l.bridge.reset(i);var u=this._symbolDraw,c=this._lineDraw;if(bR(o)){var h={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?this._mainGroup.attr(h):it(this._mainGroup,h,r)}Pw(r.getGraph(),Jd(r));var f=r.getData();u.updateData(f);var d=r.getEdgeData();c.updateData(d),this._updateNodeAndLinkScale(),this._updateController(null,r,i),clearTimeout(this._layoutTimeout);var g=r.forceLayout,m=r.get(["force","layoutAnimation"]);g&&(s=!0,this._startForceLayoutIteration(g,i,m));var y=r.get("layout");f.graph.eachNode(function(S){var T=S.dataIndex,M=S.getGraphicEl(),A=S.getModel();if(M){M.off("drag").off("dragend");var P=A.get("draggable");P&&M.on("drag",function(N){switch(y){case"force":g.warmUp(),!a._layouting&&a._startForceLayoutIteration(g,i,m),g.setFixed(T),f.setItemLayout(T,[M.x,M.y]);break;case"circular":f.setItemLayout(T,[M.x,M.y]),S.setLayout({fixed:!0},!0),Ek(r,"symbolSize",S,[N.offsetX,N.offsetY]),a.updateLayout(r);break;case"none":default:f.setItemLayout(T,[M.x,M.y]),Dk(r.getGraph(),r),a.updateLayout(r);break}}).on("dragend",function(){g&&g.setUnfixed(T)}),M.setDraggable(P,!!A.get("cursor"));var I=A.get(["emphasis","focus"]);I==="adjacency"&&(De(M).focus=S.getAdjacentDataIndices())}}),f.graph.eachEdge(function(S){var T=S.getGraphicEl(),M=S.getModel().get(["emphasis","focus"]);T&&M==="adjacency"&&(De(T).focus={edge:[S.dataIndex],node:[S.node1.dataIndex,S.node2.dataIndex]})});var x=r.get("layout")==="circular"&&r.get(["circular","rotateLabel"]),_=f.getLayout("cx"),w=f.getLayout("cy");f.graph.eachNode(function(S){JW(S,x,_,w)}),this._firstRender=!1,s||this._renderThumbnail(r,i,this._symbolDraw,this._lineDraw)},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._startForceLayoutIteration=function(r,n,i){var a=this,o=!1;(function s(){r.step(function(l){a.updateLayout(a._model),(l||!o)&&(o=!0,a._renderThumbnail(a._model,n,a._symbolDraw,a._lineDraw)),(a._layouting=!l)&&(i?a._layoutTimeout=setTimeout(s,16):s())})})()},t.prototype._updateController=function(r,n,i){var a=this._controller,o=this._controllerHost,s=n.coordinateSystem;if(!bR(s)){a.disable();return}a.enable(n.get("roam"),{api:i,zInfo:{component:n},triggerInfo:{roamTrigger:n.get("roamTrigger"),isInSelf:function(l,u,c){return s.containPoint([u,c])},isInClip:function(l,u,c){return!r||r.contain(u,c)}}}),o.zoomLimit=n.get("scaleLimit"),o.zoom=s.getZoom(),a.off("pan").off("zoom").on("pan",function(l){i.dispatchAction({seriesId:n.id,type:"graphRoam",dx:l.dx,dy:l.dy})}).on("zoom",function(l){i.dispatchAction({seriesId:n.id,type:"graphRoam",zoom:l.scale,originX:l.originX,originY:l.originY})})},t.prototype.updateViewOnPan=function(r,n,i){this._active&&(Ck(this._controllerHost,i.dx,i.dy),this._updateThumbnailWindow())},t.prototype.updateViewOnZoom=function(r,n,i){this._active&&(Tk(this._controllerHost,i.zoom,i.originX,i.originY),this._updateNodeAndLinkScale(),Pw(r.getGraph(),Jd(r)),this._lineDraw.updateLayout(),n.updateLabelLayout(),this._updateThumbnailWindow())},t.prototype._updateNodeAndLinkScale=function(){var r=this._model,n=r.getData(),i=Jd(r);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},t.prototype.updateLayout=function(r){this._active&&(Pw(r.getGraph(),Jd(r)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},t.prototype.remove=function(){this._active=!1,clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove(),this._controller&&this._controller.disable()},t.prototype._getThumbnailInfo=function(){var r=this._model,n=r.coordinateSystem;if(n.type==="view"){var i=Hle(r);if(i)return{bridge:i,coordSys:n}}},t.prototype._updateThumbnailWindow=function(){var r=this._getThumbnailInfo();r&&r.bridge.updateWindow(r.coordSys.transform,this._api)},t.prototype._renderThumbnail=function(r,n,i,a){var o=this._getThumbnailInfo();if(o){var s=new Ce,l=i.group.children(),u=a.group.children(),c=new Ce,h=new Ce;s.add(h),s.add(c);for(var f=0;f=0&&t.call(r,n[a],a)},e.prototype.eachEdge=function(t,r){for(var n=this.edges,i=n.length,a=0;a=0&&n[a].node1.dataIndex>=0&&n[a].node2.dataIndex>=0&&t.call(r,n[a],a)},e.prototype.breadthFirstTraverse=function(t,r,n,i){if(r instanceof eu||(r=this._nodesMap[Ec(r)]),!!r){for(var a=n==="out"?"outEdges":n==="in"?"inEdges":"edges",o=0;o=0&&l.node2.dataIndex>=0});for(var a=0,o=i.length;a=0&&!t.hasKey(g)&&(t.set(g,!0),o.push(d.node1))}for(l=0;l=0&&!t.hasKey(w)&&(t.set(w,!0),s.push(_.node2))}}}return{edge:t.keys(),node:r.keys()}},e}(),rH=function(){function e(t,r,n){this.dataIndex=-1,this.node1=t,this.node2=r,this.dataIndex=n??-1}return e.prototype.getModel=function(t){if(!(this.dataIndex<0)){var r=this.hostGraph,n=r.edgeData.getItemModel(this.dataIndex);return n.getModel(t)}},e.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},e.prototype.getTrajectoryDataIndices=function(){var t=_e(),r=_e();t.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],a=0;a=0&&!t.hasKey(h)&&(t.set(h,!0),n.push(c.node1))}for(a=0;a=0&&!t.hasKey(m)&&(t.set(m,!0),i.push(g.node2))}return{edge:t.keys(),node:r.keys()}},e}();function nH(e,t){return{getValue:function(r){var n=this[e][t];return n.getStore().get(n.getDimensionIndex(r||"value"),this.dataIndex)},setVisual:function(r,n){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,r,n)},getVisual:function(r){return this[e][t].getItemVisual(this.dataIndex,r)},setLayout:function(r,n){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,r,n)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}Qt(eu,nH("hostGraph","data"));Qt(rH,nH("hostGraph","edgeData"));function Ok(e,t,r,n,i){for(var a=new Zle(n),o=0;o "+f)),u++)}var d=r.get("coordinateSystem"),g;if(d==="cartesian2d"||d==="polar"||d==="matrix")g=no(e,r);else{var m=mf.get(d),y=m?m.dimensions||[]:[];Ve(y,"value")<0&&y.concat(["value"]);var x=bf(e,{coordDimensions:y,encodeDefine:r.getEncode()}).dimensions;g=new dn(x,r),g.initData(e)}var _=new dn(["value"],r);return _.initData(l,s),i&&i(g,_),OW({mainData:g,struct:a,structAttr:"graph",datas:{node:g,edge:_},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var $le=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.hasSymbolVisual=!0,r}return t.prototype.init=function(r){e.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}this.legendVisualProvider=new Mf(i,i),this.fillDataTextStyle(r.edges||r.links),this._updateCategoriesData()},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(r.edges||r.links),this._updateCategoriesData()},t.prototype.mergeDefaultAndTheme=function(r){e.prototype.mergeDefaultAndTheme.apply(this,arguments),ju(r,"edgeLabel",["show"])},t.prototype.getInitialData=function(r,n){var i=r.edges||r.links||[],a=r.data||r.nodes||[],o=this;if(a&&i){Dle(this);var s=Ok(a,i,this,!0,l);return j(s.edges,function(u){Ele(u.node1,u.node2,this,u.dataIndex)},this),s.data}function l(u,c){u.wrapMethod("getItemModel",function(g){var m=o._categoriesModels,y=g.getShallow("category"),x=m[y];return x&&(x.parentModel=g.parentModel,g.parentModel=x),g});var h=qe.prototype.getModel;function f(g,m){var y=h.call(this,g,m);return y.resolveParentPath=d,y}c.wrapMethod("getItemModel",function(g){return g.resolveParentPath=d,g.getModel=f,g});function d(g){if(g&&(g[0]==="label"||g[1]==="label")){var m=g.slice();return g[0]==="label"?m[0]="edgeLabel":g[1]==="label"&&(m[1]="edgeLabel"),m}return g}}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.getCategoriesData=function(){return this._categoriesData},t.prototype.formatTooltip=function(r,n,i){if(i==="edge"){var a=this.getData(),o=this.getDataParams(r,i),s=a.graph.getEdgeByIndex(r),l=a.getName(s.node1.dataIndex),u=a.getName(s.node2.dataIndex),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),gr("nameValue",{name:c.join(" > "),value:o.value,noValue:o.value==null})}var h=oV({series:this,dataIndex:r,multipleSeries:n});return h},t.prototype._updateCategoriesData=function(){var r=ae(this.option.categories||[],function(i){return i.value!=null?i:Q({value:0},i)}),n=new dn(["value"],this);n.initData(r),this._categoriesData=n,this._categoriesModels=n.mapArray(function(i){return n.getItemModel(i)})},t.prototype.setZoom=function(r){this.option.zoom=r},t.prototype.setCenter=function(r){this.option.center=r},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},t.type="series.graph",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:K.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:K.color.primary}}},t}(bt);function Yle(e){e.registerChartView(Ule),e.registerSeriesModel($le),e.registerProcessor(kle),e.registerVisual(Lle),e.registerVisual(Nle),e.registerLayout(jle),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,Ole),e.registerLayout(Ble),e.registerCoordinateSystem("graphView",{dimensions:nc.dimensions,create:Vle}),e.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},qt),e.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},qt),e.registerAction({type:"graphRoam",event:"graphRoam",update:"none"},function(t,r,n){r.eachComponent({mainType:"series",query:t},function(i){var a=n.getViewOfSeriesModel(i);a&&(t.dx!=null&&t.dy!=null&&a.updateViewOnPan(i,n,t),t.zoom!=null&&t.originX!=null&&t.originY!=null&&a.updateViewOnZoom(i,n,t));var o=i.coordinateSystem,s=j_(o,t,i.get("scaleLimit"));i.setCenter&&i.setCenter(s.center),i.setZoom&&i.setZoom(s.zoom)})})}var wR=function(e){q(t,e);function t(r,n,i){var a=e.call(this)||this;De(a).dataType="node",a.z2=2;var o=new tt;return a.setTextContent(o),a.updateData(r,n,i,!0),a}return t.prototype.updateData=function(r,n,i,a){var o=this,s=r.graph.getNodeByIndex(n),l=r.hostModel,u=s.getModel(),c=u.getModel("emphasis"),h=r.getItemLayout(n),f=Q(Ba(u.getModel("itemStyle"),h,!0),h),d=this;if(isNaN(f.startAngle)){d.setShape(f);return}a?d.setShape(f):it(d,{shape:f},l,n);var g=Q(Ba(u.getModel("itemStyle"),h,!0),h);o.setShape(g),o.useStyle(r.getItemVisual(n,"style")),Sr(o,u),this._updateLabel(l,u,s),r.setItemGraphicEl(n,d),Sr(d,u,"itemStyle");var m=c.get("focus");Dt(this,m==="adjacency"?s.getAdjacentDataIndices():m,c.get("blurScope"),c.get("disabled"))},t.prototype._updateLabel=function(r,n,i){var a=this.getTextContent(),o=i.getLayout(),s=(o.startAngle+o.endAngle)/2,l=Math.cos(s),u=Math.sin(s),c=n.getModel("label");a.ignore=!c.get("show");var h=Cr(n),f=i.getVisual("style");Dr(a,h,{labelFetcher:{getFormattedLabel:function(_,w,S,T,M,A){return r.getFormattedLabel(_,w,"node",T,zn(M,h.normal&&h.normal.get("formatter"),n.get("name")),A)}},labelDataIndex:i.dataIndex,defaultText:i.dataIndex+"",inheritColor:f.fill,defaultOpacity:f.opacity,defaultOutsidePosition:"startArc"});var d=c.get("position")||"outside",g=c.get("distance")||0,m;d==="outside"?m=o.r+g:m=(o.r+o.r0)/2,this.textConfig={inside:d!=="outside"};var y=d!=="outside"?c.get("align")||"center":l>0?"left":"right",x=d!=="outside"?c.get("verticalAlign")||"middle":u>0?"top":"bottom";a.attr({x:l*m+o.cx,y:u*m+o.cy,rotation:0,style:{align:y,verticalAlign:x}})},t}(Qr),Xle=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;return De(o).dataType="edge",o.updateData(r,n,i,a,!0),o}return t.prototype.buildPath=function(r,n){r.moveTo(n.s1[0],n.s1[1]);var i=.7,a=n.clockwise;r.arc(n.cx,n.cy,n.r,n.sStartAngle,n.sEndAngle,!a),r.bezierCurveTo((n.cx-n.s2[0])*i+n.s2[0],(n.cy-n.s2[1])*i+n.s2[1],(n.cx-n.t1[0])*i+n.t1[0],(n.cy-n.t1[1])*i+n.t1[1],n.t1[0],n.t1[1]),r.arc(n.cx,n.cy,n.r,n.tStartAngle,n.tEndAngle,!a),r.bezierCurveTo((n.cx-n.t2[0])*i+n.t2[0],(n.cy-n.t2[1])*i+n.t2[1],(n.cx-n.s1[0])*i+n.s1[0],(n.cy-n.s1[1])*i+n.s1[1],n.s1[0],n.s1[1]),r.closePath()},t.prototype.updateData=function(r,n,i,a,o){var s=r.hostModel,l=n.graph.getEdgeByIndex(i),u=l.getLayout(),c=l.node1.getModel(),h=n.getItemModel(l.dataIndex),f=h.getModel("lineStyle"),d=h.getModel("emphasis"),g=d.get("focus"),m=Q(Ba(c.getModel("itemStyle"),u,!0),u),y=this;if(isNaN(m.sStartAngle)||isNaN(m.tStartAngle)){y.setShape(m);return}o?(y.setShape(m),SR(y,l,r,f)):(Oi(y),SR(y,l,r,f),it(y,{shape:m},s,i)),Dt(this,g==="adjacency"?l.getAdjacentDataIndices():g,d.get("blurScope"),d.get("disabled")),Sr(y,h,"lineStyle"),n.setItemGraphicEl(l.dataIndex,y)},t}(Ke);function SR(e,t,r,n){var i=t.node1,a=t.node2,o=e.style;e.setStyle(n.getLineStyle());var s=n.get("color");switch(s){case"source":o.fill=r.getItemVisual(i.dataIndex,"style").fill,o.decal=i.getVisual("style").decal;break;case"target":o.fill=r.getItemVisual(a.dataIndex,"style").fill,o.decal=a.getVisual("style").decal;break;case"gradient":var l=r.getItemVisual(i.dataIndex,"style").fill,u=r.getItemVisual(a.dataIndex,"style").fill;if(he(l)&&he(u)){var c=e.shape,h=(c.s1[0]+c.s2[0])/2,f=(c.s1[1]+c.s2[1])/2,d=(c.t1[0]+c.t2[0])/2,g=(c.t1[1]+c.t2[1])/2;o.fill=new qu(h,f,d,g,[{offset:0,color:l},{offset:1,color:u}],!0)}break}}var qle=Math.PI/180,Kle=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){},t.prototype.render=function(r,n,i){var a=r.getData(),o=this._data,s=this.group,l=-r.get("startAngle")*qle;if(a.diff(o).add(function(c){var h=a.getItemLayout(c);if(h){var f=new wR(a,c,l);De(f).dataIndex=c,s.add(f)}}).update(function(c,h){var f=o.getItemGraphicEl(h),d=a.getItemLayout(c);if(!d){f&&Do(f,r,h);return}f?f.updateData(a,c,l):f=new wR(a,c,l),s.add(f)}).remove(function(c){var h=o.getItemGraphicEl(c);h&&Do(h,r,c)}).execute(),!o){var u=r.get("center");this.group.scaleX=.01,this.group.scaleY=.01,this.group.originX=ce(u[0],i.getWidth()),this.group.originY=ce(u[1],i.getHeight()),Nt(this.group,{scaleX:1,scaleY:1},r)}this._data=a,this.renderEdges(r,l)},t.prototype.renderEdges=function(r,n){var i=r.getData(),a=r.getEdgeData(),o=this._edgeData,s=this.group;a.diff(o).add(function(l){var u=new Xle(i,a,l,n);De(u).dataIndex=l,s.add(u)}).update(function(l,u){var c=o.getItemGraphicEl(u);c.updateData(i,a,l,n),s.add(c)}).remove(function(l){var u=o.getItemGraphicEl(l);u&&Do(u,r,l)}).execute(),this._edgeData=a},t.prototype.dispose=function(){},t.type="chord",t}(gt),Jle=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r){e.prototype.init.apply(this,arguments),this.fillDataTextStyle(r.edges||r.links),this.legendVisualProvider=new Mf(fe(this.getData,this),fe(this.getRawData,this))},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(r.edges||r.links)},t.prototype.getInitialData=function(r,n){var i=r.edges||r.links||[],a=r.data||r.nodes||[];if(a&&i){var o=Ok(a,i,this,!0,s);return o.data}function s(l,u){var c=qe.prototype.getModel;function h(d,g){var m=c.call(this,d,g);return m.resolveParentPath=f,m}u.wrapMethod("getItemModel",function(d){return d.resolveParentPath=f,d.getModel=h,d});function f(d){if(d&&(d[0]==="label"||d[1]==="label")){var g=d.slice();return d[0]==="label"?g[0]="edgeLabel":d[1]==="label"&&(g[1]="edgeLabel"),g}return d}}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(r,n,i){var a=this.getDataParams(r,i);if(i==="edge"){var o=this.getData(),s=o.graph.getEdgeByIndex(r),l=o.getName(s.node1.dataIndex),u=o.getName(s.node2.dataIndex),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),gr("nameValue",{name:c.join(" > "),value:a.value,noValue:a.value==null})}return gr("nameValue",{name:a.name,value:a.value,noValue:a.value==null})},t.prototype.getDataParams=function(r,n){var i=e.prototype.getDataParams.call(this,r,n);if(n==="node"){var a=this.getData(),o=this.getGraph().getNodeByIndex(r);if(i.name==null&&(i.name=a.getName(r)),i.value==null){var s=o.getLayout().value;i.value=s}}return i},t.type="series.chord",t.defaultOption={z:2,coordinateSystem:"none",legendHoverLink:!0,colorBy:"data",left:0,top:0,right:0,bottom:0,width:null,height:null,center:["50%","50%"],radius:["70%","80%"],clockwise:!0,startAngle:90,endAngle:"auto",minAngle:0,padAngle:3,itemStyle:{borderRadius:[0,0,5,5]},lineStyle:{width:0,color:"source",opacity:.2},label:{show:!0,position:"outside",distance:5},emphasis:{focus:"adjacency",lineStyle:{opacity:.5}}},t}(bt),Iw=Math.PI/180;function Qle(e,t){e.eachSeriesByType("chord",function(r){eue(r,t)})}function eue(e,t){var r=e.getData(),n=r.graph,i=e.getEdgeData(),a=i.count();if(a){var o=T6(e,t),s=o.cx,l=o.cy,u=o.r,c=o.r0,h=Math.max((e.get("padAngle")||0)*Iw,0),f=Math.max((e.get("minAngle")||0)*Iw,0),d=-e.get("startAngle")*Iw,g=d+Math.PI*2,m=e.get("clockwise"),y=m?1:-1,x=[d,g];m_(x,!m);var _=x[0],w=x[1],S=w-_,T=r.getSum("value")===0&&i.getSum("value")===0,M=[],A=0;n.eachEdge(function(z){var Z=T?1:z.getValue("value");T&&(Z>0||f)&&(A+=2);var U=z.node1.dataIndex,$=z.node2.dataIndex;M[U]=(M[U]||0)+Z,M[$]=(M[$]||0)+Z});var P=0;if(n.eachNode(function(z){var Z=z.getValue("value");isNaN(Z)||(M[z.dataIndex]=Math.max(Z,M[z.dataIndex]||0)),!T&&(M[z.dataIndex]>0||f)&&A++,P+=M[z.dataIndex]||0}),!(A===0||P===0)){h*A>=Math.abs(S)&&(h=Math.max(0,(Math.abs(S)-f*A)/A)),(h+f)*A>=Math.abs(S)&&(f=(Math.abs(S)-h*A)/A);var I=(S-h*A*y)/P,N=0,D=0,O=0;n.eachNode(function(z){var Z=M[z.dataIndex]||0,U=I*(P?Z:1)*y;Math.abs(U)D){var F=N/D;n.eachNode(function(z){var Z=z.getLayout().angle;Math.abs(Z)>=f?z.setLayout({angle:Z*F,ratio:F},!0):z.setLayout({angle:f,ratio:f===0?1:Z/f},!0)})}else n.eachNode(function(z){if(!R){var Z=z.getLayout().angle,U=Math.min(Z/O,1),$=U*N;Z-$f&&f>0){var U=R?1:Math.min(Z/O,1),$=Z-f,Y=Math.min($,Math.min(H,N*U));H-=Y,z.setLayout({angle:Z-Y,ratio:(Z-Y)/Z},!0)}else f>0&&z.setLayout({angle:f,ratio:Z===0?1:f/Z},!0)}});var W=_,V=[];n.eachNode(function(z){var Z=Math.max(z.getLayout().angle,f);z.setLayout({cx:s,cy:l,r0:c,r:u,startAngle:W,endAngle:W+Z*y,clockwise:m},!0),V[z.dataIndex]=W,W+=(Z+h)*y}),n.eachEdge(function(z){var Z=T?1:z.getValue("value"),U=I*(P?Z:1)*y,$=z.node1.dataIndex,Y=V[$]||0,te=Math.abs((z.node1.getLayout().ratio||1)*U),ie=Y+te*y,se=[s+c*Math.cos(Y),l+c*Math.sin(Y)],le=[s+c*Math.cos(ie),l+c*Math.sin(ie)],Ee=z.node2.dataIndex,me=V[Ee]||0,ye=Math.abs((z.node2.getLayout().ratio||1)*U),Me=me+ye*y,pe=[s+c*Math.cos(me),l+c*Math.sin(me)],Te=[s+c*Math.cos(Me),l+c*Math.sin(Me)];z.setLayout({s1:se,s2:le,sStartAngle:Y,sEndAngle:ie,t1:pe,t2:Te,tStartAngle:me,tEndAngle:Me,cx:s,cy:l,r:c,value:Z,clockwise:m}),V[$]=ie,V[Ee]=Me})}}}function tue(e){e.registerChartView(Kle),e.registerSeriesModel(Jle),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,Qle),e.registerProcessor(Cf("chord"))}var rue=function(){function e(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return e}(),nue=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="pointer",n}return t.prototype.getDefaultShape=function(){return new rue},t.prototype.buildPath=function(r,n){var i=Math.cos,a=Math.sin,o=n.r,s=n.width,l=n.angle,u=n.x-i(l)*s*(s>=o/3?1:2),c=n.y-a(l)*s*(s>=o/3?1:2);l=n.angle-Math.PI/2,r.moveTo(u,c),r.lineTo(n.x+i(l)*s,n.y+a(l)*s),r.lineTo(n.x+i(n.angle)*o,n.y+a(n.angle)*o),r.lineTo(n.x-i(l)*s,n.y-a(l)*s),r.lineTo(u,c)},t}(Ke);function iue(e,t){var r=e.get("center"),n=t.getWidth(),i=t.getHeight(),a=Math.min(n,i),o=ce(r[0],t.getWidth()),s=ce(r[1],t.getHeight()),l=ce(e.get("radius"),a/2);return{cx:o,cy:s,r:l}}function Um(e,t){var r=e==null?"":e+"";return t&&(he(t)?r=t.replace("{value}",r):we(t)&&(r=t(e))),r}var aue=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){this.group.removeAll();var a=r.get(["axisLine","lineStyle","color"]),o=iue(r,i);this._renderMain(r,n,i,a,o),this._data=r.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(r,n,i,a,o){var s=this.group,l=r.get("clockwise"),u=-r.get("startAngle")/180*Math.PI,c=-r.get("endAngle")/180*Math.PI,h=r.getModel("axisLine"),f=h.get("roundCap"),d=f?ix:Qr,g=h.get("show"),m=h.getModel("lineStyle"),y=m.get("width"),x=[u,c];m_(x,!l),u=x[0],c=x[1];for(var _=c-u,w=u,S=[],T=0;g&&T=I&&(N===0?0:a[N-1][0])Math.PI/2&&(ie+=Math.PI)):te==="tangential"?ie=-P-Math.PI/2:rt(te)&&(ie=te*Math.PI/180),ie===0?h.add(new tt({style:Ct(w,{text:Z,x:$,y:Y,verticalAlign:H<-.8?"top":H>.8?"bottom":"middle",align:F<-.4?"left":F>.4?"right":"center"},{inheritColor:U}),silent:!0})):h.add(new tt({style:Ct(w,{text:Z,x:$,y:Y,verticalAlign:"middle",align:"center"},{inheritColor:U}),silent:!0,originX:$,originY:Y,rotation:ie}))}if(_.get("show")&&W!==S){var V=_.get("distance");V=V?V+c:c;for(var se=0;se<=T;se++){F=Math.cos(P),H=Math.sin(P);var le=new ar({shape:{x1:F*(g-V)+f,y1:H*(g-V)+d,x2:F*(g-A-V)+f,y2:H*(g-A-V)+d},silent:!0,style:O});O.stroke==="auto"&&le.setStyle({stroke:a((W+se/T)/S)}),h.add(le),P+=N}P-=N}else P+=I}},t.prototype._renderPointer=function(r,n,i,a,o,s,l,u,c){var h=this.group,f=this._data,d=this._progressEls,g=[],m=r.get(["pointer","show"]),y=r.getModel("progress"),x=y.get("show"),_=r.getData(),w=_.mapDimension("value"),S=+r.get("min"),T=+r.get("max"),M=[S,T],A=[s,l];function P(N,D){var O=_.getItemModel(N),R=O.getModel("pointer"),F=ce(R.get("width"),o.r),H=ce(R.get("length"),o.r),W=r.get(["pointer","icon"]),V=R.get("offsetCenter"),z=ce(V[0],o.r),Z=ce(V[1],o.r),U=R.get("keepAspect"),$;return W?$=sr(W,z-F/2,Z-H,F,H,null,U):$=new nue({shape:{angle:-Math.PI/2,width:F,r:H,x:z,y:Z}}),$.rotation=-(D+Math.PI/2),$.x=o.cx,$.y=o.cy,$}function I(N,D){var O=y.get("roundCap"),R=O?ix:Qr,F=y.get("overlap"),H=F?y.get("width"):c/_.count(),W=F?o.r-H:o.r-(N+1)*H,V=F?o.r:o.r-N*H,z=new R({shape:{startAngle:s,endAngle:D,cx:o.cx,cy:o.cy,clockwise:u,r0:W,r:V}});return F&&(z.z2=ht(_.get(w,N),[S,T],[100,0],!0)),z}(x||m)&&(_.diff(f).add(function(N){var D=_.get(w,N);if(m){var O=P(N,s);Nt(O,{rotation:-((isNaN(+D)?A[0]:ht(D,M,A,!0))+Math.PI/2)},r),h.add(O),_.setItemGraphicEl(N,O)}if(x){var R=I(N,s),F=y.get("clip");Nt(R,{shape:{endAngle:ht(D,M,A,F)}},r),h.add(R),KC(r.seriesIndex,_.dataType,N,R),g[N]=R}}).update(function(N,D){var O=_.get(w,N);if(m){var R=f.getItemGraphicEl(D),F=R?R.rotation:s,H=P(N,F);H.rotation=F,it(H,{rotation:-((isNaN(+O)?A[0]:ht(O,M,A,!0))+Math.PI/2)},r),h.add(H),_.setItemGraphicEl(N,H)}if(x){var W=d[D],V=W?W.shape.endAngle:s,z=I(N,V),Z=y.get("clip");it(z,{shape:{endAngle:ht(O,M,A,Z)}},r),h.add(z),KC(r.seriesIndex,_.dataType,N,z),g[N]=z}}).execute(),_.each(function(N){var D=_.getItemModel(N),O=D.getModel("emphasis"),R=O.get("focus"),F=O.get("blurScope"),H=O.get("disabled");if(m){var W=_.getItemGraphicEl(N),V=_.getItemVisual(N,"style"),z=V.fill;if(W instanceof Er){var Z=W.style;W.useStyle(Q({image:Z.image,x:Z.x,y:Z.y,width:Z.width,height:Z.height},V))}else W.useStyle(V),W.type!=="pointer"&&W.setColor(z);W.setStyle(D.getModel(["pointer","itemStyle"]).getItemStyle()),W.style.fill==="auto"&&W.setStyle("fill",a(ht(_.get(w,N),M,[0,1],!0))),W.z2EmphasisLift=0,Sr(W,D),Dt(W,R,F,H)}if(x){var U=g[N];U.useStyle(_.getItemVisual(N,"style")),U.setStyle(D.getModel(["progress","itemStyle"]).getItemStyle()),U.z2EmphasisLift=0,Sr(U,D),Dt(U,R,F,H)}}),this._progressEls=g)},t.prototype._renderAnchor=function(r,n){var i=r.getModel("anchor"),a=i.get("show");if(a){var o=i.get("size"),s=i.get("icon"),l=i.get("offsetCenter"),u=i.get("keepAspect"),c=sr(s,n.cx-o/2+ce(l[0],n.r),n.cy-o/2+ce(l[1],n.r),o,o,null,u);c.z2=i.get("showAbove")?1:0,c.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(c)}},t.prototype._renderTitleAndDetail=function(r,n,i,a,o){var s=this,l=r.getData(),u=l.mapDimension("value"),c=+r.get("min"),h=+r.get("max"),f=new Ce,d=[],g=[],m=r.isAnimationEnabled(),y=r.get(["pointer","showAbove"]);l.diff(this._data).add(function(x){d[x]=new tt({silent:!0}),g[x]=new tt({silent:!0})}).update(function(x,_){d[x]=s._titleEls[_],g[x]=s._detailEls[_]}).execute(),l.each(function(x){var _=l.getItemModel(x),w=l.get(u,x),S=new Ce,T=a(ht(w,[c,h],[0,1],!0)),M=_.getModel("title");if(M.get("show")){var A=M.get("offsetCenter"),P=o.cx+ce(A[0],o.r),I=o.cy+ce(A[1],o.r),N=d[x];N.attr({z2:y?0:2,style:Ct(M,{x:P,y:I,text:l.getName(x),align:"center",verticalAlign:"middle"},{inheritColor:T})}),S.add(N)}var D=_.getModel("detail");if(D.get("show")){var O=D.get("offsetCenter"),R=o.cx+ce(O[0],o.r),F=o.cy+ce(O[1],o.r),H=ce(D.get("width"),o.r),W=ce(D.get("height"),o.r),V=r.get(["progress","show"])?l.getItemVisual(x,"style").fill:T,N=g[x],z=D.get("formatter");N.attr({z2:y?0:2,style:Ct(D,{x:R,y:F,text:Um(w,z),width:isNaN(H)?null:H,height:isNaN(W)?null:W,align:"center",verticalAlign:"middle"},{inheritColor:V})}),s6(N,{normal:D},w,function(U){return Um(U,z)}),m&&l6(N,x,l,r,{getFormattedLabel:function(U,$,Y,te,ie,se){return Um(se?se.interpolatedValue:w,z)}}),S.add(N)}f.add(S)}),this.group.add(f),this._titleEls=d,this._detailEls=g},t.type="gauge",t}(gt),oue=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.visualStyleAccessPath="itemStyle",r}return t.prototype.getInitialData=function(r,n){return Tf(this,["value"])},t.type="series.gauge",t.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,K.color.neutral10]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:K.color.axisTick,width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:K.color.axisTickMinor,width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:K.color.axisLabel,fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:K.color.neutral00,borderWidth:0,borderColor:K.color.theme[0]}},title:{show:!0,offsetCenter:[0,"20%"],color:K.color.secondary,fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:K.color.transparent,borderWidth:0,borderColor:K.color.neutral40,width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:K.color.primary,fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t}(bt);function sue(e){e.registerChartView(aue),e.registerSeriesModel(oue)}var lue=["itemStyle","opacity"],uue=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=i,o=new Gr,s=new tt;return a.setTextContent(s),i.setTextGuideLine(o),i.updateData(r,n,!0),i}return t.prototype.updateData=function(r,n,i){var a=this,o=r.hostModel,s=r.getItemModel(n),l=r.getItemLayout(n),u=s.getModel("emphasis"),c=s.get(lue);c=c??1,i||Oi(a),a.useStyle(r.getItemVisual(n,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,Nt(a,{style:{opacity:c}},o,n)):it(a,{style:{opacity:c},shape:{points:l.points}},o,n),Sr(a,s),this._updateLabel(r,n),Dt(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},t.prototype._updateLabel=function(r,n){var i=this,a=this.getTextGuideLine(),o=i.getTextContent(),s=r.hostModel,l=r.getItemModel(n),u=r.getItemLayout(n),c=u.label,h=r.getItemVisual(n,"style"),f=h.fill;Dr(o,Cr(l),{labelFetcher:r.hostModel,labelDataIndex:n,defaultOpacity:h.opacity,defaultText:r.getName(n)},{normal:{align:c.textAlign,verticalAlign:c.verticalAlign}});var d=l.getModel("label"),g=d.get("color"),m=g==="inherit"?f:null;i.setTextConfig({local:!0,inside:!!c.inside,insideStroke:m,outsideFill:m});var y=c.linePoints;a.setShape({points:y}),i.textGuideLineConfig={anchor:y?new Ne(y[0][0],y[0][1]):null},it(o,{style:{x:c.x,y:c.y}},s,n),o.attr({rotation:c.rotation,originX:c.x,originY:c.y,z2:10}),ck(i,hk(l),{stroke:f})},t}(en),cue=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.ignoreLabelLineUpdate=!0,r}return t.prototype.render=function(r,n,i){var a=r.getData(),o=this._data,s=this.group;a.diff(o).add(function(l){var u=new uue(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var c=o.getItemGraphicEl(u);c.updateData(a,l),s.add(c),a.setItemGraphicEl(l,c)}).remove(function(l){var u=o.getItemGraphicEl(l);Do(u,r,l)}).execute(),this._data=a},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type="funnel",t}(gt),hue=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new Mf(fe(this.getData,this),fe(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.getInitialData=function(r,n){return Tf(this,{coordDimensions:["value"],encodeDefaulter:Fe(zA,this)})},t.prototype._defaultLabelLine=function(r){ju(r,"labelLine",["show"]);var n=r.labelLine,i=r.emphasis.labelLine;n.show=n.show&&r.label.show,i.show=i.show&&r.emphasis.label.show},t.prototype.getDataParams=function(r){var n=this.getData(),i=e.prototype.getDataParams.call(this,r),a=n.mapDimension("value"),o=n.getSum(a);return i.percent=o?+(n.get(a,r)/o*100).toFixed(2):0,i.$vars.push("percent"),i},t.type="series.funnel",t.defaultOption={coordinateSystemUsage:"box",z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:65,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:K.color.neutral00,borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:K.color.primary}}},t}(bt);function fue(e,t){for(var r=e.mapDimension("value"),n=e.mapArray(r,function(l){return l}),i=[],a=t==="ascending",o=0,s=e.count();okue)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);i.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!(this._mouseDownPoint||!Ew(this,"mousemove"))){var t=this._model,r=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),n=r.behavior;n==="jump"&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand(n==="none"?null:{axisExpandWindow:r.axisExpandWindow,animation:n==="jump"?null:{duration:0}})}}};function Ew(e,t){var r=e._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===t}var Pue=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(){e.prototype.init.apply(this,arguments),this.mergeOption({})},t.prototype.mergeOption=function(r){var n=this.option;r&&Ge(n,r,!0),this._initDimensions()},t.prototype.contains=function(r,n){var i=r.get("parallelIndex");return i!=null&&n.getComponent("parallel",i)===this},t.prototype.setAxisExpand=function(r){j(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(n){r.hasOwnProperty(n)&&(this.option[n]=r[n])},this)},t.prototype._initDimensions=function(){var r=this.dimensions=[],n=this.parallelAxisIndex=[],i=ot(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);j(i,function(a){r.push("dim"+a.get("dim")),n.push(a.componentIndex)})},t.type="parallel",t.dependencies=["parallelAxis"],t.layoutMode="box",t.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},t}($e),Iue=function(e){q(t,e);function t(r,n,i,a,o){var s=e.call(this,r,n,i)||this;return s.type=a||"value",s.axisIndex=o,s}return t.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},t}(Vi);function rl(e,t,r,n,i,a){e=e||0;var o=r[1]-r[0];if(i!=null&&(i=jc(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(t[1]-t[0]);s=jc(s,[0,o]),i=a=jc(s,[i,a]),n=0}t[0]=jc(t[0],r),t[1]=jc(t[1],r);var l=jw(t,n);t[n]+=e;var u=i||0,c=r.slice();l.sign<0?c[0]+=u:c[1]-=u,t[n]=jc(t[n],c);var h;return h=jw(t,n),i!=null&&(h.sign!==l.sign||h.spana&&(t[1-n]=t[n]+h.sign*a),t}function jw(e,t){var r=e[t]-e[1-t];return{span:Math.abs(r),sign:r>0?-1:r<0?1:t?-1:1}}function jc(e,t){return Math.min(t[1]!=null?t[1]:1/0,Math.max(t[0]!=null?t[0]:-1/0,e))}var Rw=j,aH=Math.min,oH=Math.max,MR=Math.floor,Due=Math.ceil,AR=ir,Eue=Math.PI,jue=function(){function e(t,r,n){this.type="parallel",this._axesMap=_e(),this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,r,n)}return e.prototype._init=function(t,r,n){var i=t.dimensions,a=t.parallelAxisIndex;Rw(i,function(o,s){var l=a[s],u=r.getComponent("parallelAxis",l),c=this._axesMap.set(o,new Iue(o,Xp(u),[0,0],u.get("type"),l)),h=c.type==="category";c.onBand=h&&u.get("boundaryGap"),c.inverse=u.get("inverse"),u.axis=c,c.model=u,c.coordinateSystem=u.coordinateSystem=this},this)},e.prototype.update=function(t,r){this._updateAxesFromSeries(this._model,t)},e.prototype.containPoint=function(t){var r=this._makeLayoutInfo(),n=r.axisBase,i=r.layoutBase,a=r.pixelDimIndex,o=t[1-a],s=t[a];return o>=n&&o<=n+r.axisLength&&s>=i&&s<=i+r.layoutLength},e.prototype.getModel=function(){return this._model},e.prototype._updateAxesFromSeries=function(t,r){r.eachSeries(function(n){if(t.contains(n,r)){var i=n.getData();Rw(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(i,i.mapDimension(a)),Gu(o.scale,o.model)},this)}},this)},e.prototype.resize=function(t,r){var n=Tr(t,r).refContainer;this._rect=It(t.getBoxLayoutParams(),n),this._layoutAxes()},e.prototype.getRect=function(){return this._rect},e.prototype._makeLayoutInfo=function(){var t=this._model,r=this._rect,n=["x","y"],i=["width","height"],a=t.get("layout"),o=a==="horizontal"?0:1,s=r[i[o]],l=[0,s],u=this.dimensions.length,c=Zm(t.get("axisExpandWidth"),l),h=Zm(t.get("axisExpandCount")||0,[0,u]),f=t.get("axisExpandable")&&u>3&&u>h&&h>1&&c>0&&s>0,d=t.get("axisExpandWindow"),g;if(d)g=Zm(d[1]-d[0],l),d[1]=d[0]+g;else{g=Zm(c*(h-1),l);var m=t.get("axisExpandCenter")||MR(u/2);d=[c*m-g/2],d[1]=d[0]+g}var y=(s-g)/(u-h);y<3&&(y=0);var x=[MR(AR(d[0]/c,1))+1,Due(AR(d[1]/c,1))-1],_=y/c*d[0];return{layout:a,pixelDimIndex:o,layoutBase:r[n[o]],layoutLength:s,axisBase:r[n[1-o]],axisLength:r[i[1-o]],axisExpandable:f,axisExpandWidth:c,axisCollapseWidth:y,axisExpandWindow:d,axisCount:u,winInnerIndices:x,axisExpandWindow0Pos:_}},e.prototype._layoutAxes=function(){var t=this._rect,r=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;r.each(function(o){var s=[0,i.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),Rw(n,function(o,s){var l=(i.axisExpandable?Oue:Rue)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},c={horizontal:Eue/2,vertical:0},h=[u[a].x+t.x,u[a].y+t.y],f=c[a],d=Pr();Ko(d,d,f),ha(d,d,h),this._axesLayout[o]={position:h,rotation:f,transform:d,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},e.prototype.getAxis=function(t){return this._axesMap.get(t)},e.prototype.dataToPoint=function(t,r){return this.axisCoordToPoint(this._axesMap.get(r).dataToCoord(t),r)},e.prototype.eachActiveState=function(t,r,n,i){n==null&&(n=0),i==null&&(i=t.count());var a=this._axesMap,o=this.dimensions,s=[],l=[];j(o,function(y){s.push(t.mapDimension(y)),l.push(a.get(y).model)});for(var u=this.hasAxisBrushed(),c=n;ca*(1-h[0])?(u="jump",l=s-a*(1-h[2])):(l=s-a*h[1])>=0&&(l=s-a*(1-h[1]))<=0&&(l=0),l*=r.axisExpandWidth/c,l?rl(l,i,o,"all"):u="none";else{var d=i[1]-i[0],g=o[1]*s/d;i=[oH(0,g-d/2)],i[1]=aH(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:u}},e}();function Zm(e,t){return aH(oH(e,t[0]),t[1])}function Rue(e,t){var r=t.layoutLength/(t.axisCount-1);return{position:r*e,axisNameAvailableWidth:r,axisLabelShow:!0}}function Oue(e,t){var r=t.layoutLength,n=t.axisExpandWidth,i=t.axisCount,a=t.axisCollapseWidth,o=t.winInnerIndices,s,l=a,u=!1,c;return e=0;i--)Qn(n[i])},t.prototype.getActiveState=function(r){var n=this.activeIntervals;if(!n.length)return"normal";if(r==null||isNaN(+r))return"inactive";if(n.length===1){var i=n[0];if(i[0]<=r&&r<=i[1])return"active"}else for(var a=0,o=n.length;aGue}function fH(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function dH(e,t,r,n){var i=new Ce;return i.add(new Ze({name:"main",style:Gk(r),silent:!0,draggable:!0,cursor:"move",drift:Fe(NR,e,t,i,["n","s","w","e"]),ondragend:Fe(Hu,t,{isEnd:!0})})),j(n,function(a){i.add(new Ze({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Fe(NR,e,t,i,a),ondragend:Fe(Hu,t,{isEnd:!0})}))}),i}function vH(e,t,r,n){var i=n.brushStyle.lineWidth||0,a=Yh(i,Wue),o=r[0][0],s=r[1][0],l=o-i/2,u=s-i/2,c=r[0][1],h=r[1][1],f=c-a+i/2,d=h-a+i/2,g=c-o,m=h-s,y=g+i,x=m+i;mo(e,t,"main",o,s,g,m),n.transformable&&(mo(e,t,"w",l,u,a,x),mo(e,t,"e",f,u,a,x),mo(e,t,"n",l,u,y,a),mo(e,t,"s",l,d,y,a),mo(e,t,"nw",l,u,a,a),mo(e,t,"ne",f,u,a,a),mo(e,t,"sw",l,d,a,a),mo(e,t,"se",f,d,a,a))}function i2(e,t){var r=t.__brushOption,n=r.transformable,i=t.childAt(0);i.useStyle(Gk(r)),i.attr({silent:!n,cursor:n?"move":"default"}),j([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=t.childOfName(a.join("")),s=a.length===1?a2(e,a[0]):Xue(e,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?Uue[s]+"-resize":null})})}function mo(e,t,r,n,i,a,o){var s=t.childOfName(r);s&&s.setShape(Kue(Wk(e,t,[[n,i],[n+a,i+o]])))}function Gk(e){return Ae({strokeNoScale:!0},e.brushStyle)}function pH(e,t,r,n){var i=[wp(e,r),wp(t,n)],a=[Yh(e,r),Yh(t,n)];return[[i[0],a[0]],[i[1],a[1]]]}function Yue(e){return Us(e.group)}function a2(e,t){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=b_(r[t],Yue(e));return n[i]}function Xue(e,t){var r=[a2(e,t[0]),a2(e,t[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function NR(e,t,r,n,i,a){var o=r.__brushOption,s=e.toRectRange(o.range),l=gH(t,i,a);j(n,function(u){var c=Hue[u];s[c[0]][c[1]]+=l[c[0]]}),o.range=e.fromRectRange(pH(s[0][0],s[1][0],s[0][1],s[1][1])),Bk(t,r),Hu(t,{isEnd:!1})}function que(e,t,r,n){var i=t.__brushOption.range,a=gH(e,r,n);j(i,function(o){o[0]+=a[0],o[1]+=a[1]}),Bk(e,t),Hu(e,{isEnd:!1})}function gH(e,t,r){var n=e.group,i=n.transformCoordToLocal(t,r),a=n.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function Wk(e,t,r){var n=hH(e,t);return n&&n!==Wu?n.clipPath(r,e._transform):Se(r)}function Kue(e){var t=wp(e[0][0],e[1][0]),r=wp(e[0][1],e[1][1]),n=Yh(e[0][0],e[1][0]),i=Yh(e[0][1],e[1][1]);return{x:t,y:r,width:n-t,height:i-r}}function Jue(e,t,r){if(!(!e._brushType||ece(e,t.offsetX,t.offsetY))){var n=e._zr,i=e._covers,a=Vk(e,t,r);if(!e._dragging)for(var o=0;on.getWidth()||r<0||r>n.getHeight()}var B_={lineX:DR(0),lineY:DR(1),rect:{createCover:function(e,t){function r(n){return n}return dH({toRectRange:r,fromRectRange:r},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=fH(e);return pH(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,r,n){vH(e,t,r,n)},updateCommon:i2,contain:s2},polygon:{createCover:function(e,t){var r=new Ce;return r.add(new Gr({name:"main",style:Gk(t),silent:!0})),r},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new en({name:"main",draggable:!0,drift:Fe(que,e,t),ondragend:Fe(Hu,e,{isEnd:!0})}))},updateCoverShape:function(e,t,r,n){t.childAt(0).setShape({points:Wk(e,t,r)})},updateCommon:i2,contain:s2}};function DR(e){return{createCover:function(t,r){return dH({toRectRange:function(n){var i=[n,[0,100]];return e&&i.reverse(),i},fromRectRange:function(n){return n[e]}},t,r,[[["w"],["e"]],[["n"],["s"]]][e])},getCreatingRange:function(t){var r=fH(t),n=wp(r[0][e],r[1][e]),i=Yh(r[0][e],r[1][e]);return[n,i]},updateCoverShape:function(t,r,n,i){var a,o=hH(t,r);if(o!==Wu&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(e);else{var s=t._zr;a=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[n,a];e&&l.reverse(),vH(t,r,l,i)},updateCommon:i2,contain:s2}}function yH(e){return e=Hk(e),function(t){return xA(t,e)}}function xH(e,t){return e=Hk(e),function(r){var n=t??r,i=n?e.width:e.height,a=n?e.x:e.y;return[a,a+(i||0)]}}function _H(e,t,r){var n=Hk(e);return function(i,a){return n.contain(a[0],a[1])&&!TW(i,t,r)}}function Hk(e){return Pe.create(e)}var tce=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){e.prototype.init.apply(this,arguments),(this._brushController=new zk(n.getZr())).on("brush",fe(this._onBrush,this))},t.prototype.render=function(r,n,i,a){if(!rce(r,n,a)){this.axisModel=r,this.api=i,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Ce,this.group.add(this._axisGroup),!!r.get("show")){var s=ice(r,n),l=s.coordinateSystem,u=r.getAreaSelectStyle(),c=u.width,h=r.axis.dim,f=l.getAxisLayout(h),d=Q({strokeContainThreshold:c},f),g=new wn(r,i,d);g.build(),this._axisGroup.add(g.group),this._refreshBrushController(d,u,r,s,c,i),Up(o,this._axisGroup,r)}}},t.prototype._refreshBrushController=function(r,n,i,a,o,s){var l=i.axis.getExtent(),u=l[1]-l[0],c=Math.min(30,Math.abs(u)*.1),h=Pe.create({x:l[0],y:-o/2,width:u,height:o});h.x-=c,h.width+=2*c,this._brushController.mount({enableGlobalPan:!0,rotation:r.rotation,x:r.position[0],y:r.position[1]}).setPanels([{panelId:"pl",clipPath:yH(h),isTargetByCursor:_H(h,s,a),getLinearBrushOtherExtent:xH(h,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(nce(i))},t.prototype._onBrush=function(r){var n=r.areas,i=this.axisModel,a=i.axis,o=ae(n,function(s){return[a.coordToData(s.range[0],!0),a.coordToData(s.range[1],!0)]});(!i.option.realtime===r.isEnd||r.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:o})},t.prototype.dispose=function(){this._brushController.dispose()},t.type="parallelAxis",t}(Mt);function rce(e,t,r){return r&&r.type==="axisAreaSelect"&&t.findComponents({mainType:"parallelAxis",query:r})[0]===e}function nce(e){var t=e.axis;return ae(e.activeIntervals,function(r){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(r[0],!0),t.dataToCoord(r[1],!0)]}})}function ice(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}var ace={type:"axisAreaSelect",event:"axisAreaSelected"};function oce(e){e.registerAction(ace,function(t,r){r.eachComponent({mainType:"parallelAxis",query:t},function(n){n.axis.model.setActiveIntervals(t.intervals)})}),e.registerAction("parallelAxisExpand",function(t,r){r.eachComponent({mainType:"parallel",query:t},function(n){n.setAxisExpand(t)})})}var sce={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function bH(e){e.registerComponentView(Lue),e.registerComponentModel(Pue),e.registerCoordinateSystem("parallel",Bue),e.registerPreprocessor(Tue),e.registerComponentModel(r2),e.registerComponentView(tce),Zh(e,"parallel",r2,sce),oce(e)}function lce(e){He(bH),e.registerChartView(mue),e.registerSeriesModel(_ue),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,Cue)}var uce=function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return e}(),cce=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new uce},t.prototype.buildPath=function(r,n){var i=n.extent;r.moveTo(n.x1,n.y1),r.bezierCurveTo(n.cpx1,n.cpy1,n.cpx2,n.cpy2,n.x2,n.y2),n.orient==="vertical"?(r.lineTo(n.x2+i,n.y2),r.bezierCurveTo(n.cpx2+i,n.cpy2,n.cpx1+i,n.cpy1,n.x1+i,n.y1)):(r.lineTo(n.x2,n.y2+i),r.bezierCurveTo(n.cpx2,n.cpy2+i,n.cpx1,n.cpy1+i,n.x1,n.y1+i)),r.closePath()},t.prototype.highlight=function(){Ho(this)},t.prototype.downplay=function(){Uo(this)},t}(Ke),hce=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._mainGroup=new Ce,r._focusAdjacencyDisabled=!1,r}return t.prototype.init=function(r,n){this._controller=new rc(n.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},t.prototype.render=function(r,n,i){var a=this,o=r.getGraph(),s=this._mainGroup,l=r.layoutInfo,u=l.width,c=l.height,h=r.getData(),f=r.getData("edge"),d=r.get("orient");this._model=r,s.removeAll(),s.x=l.x,s.y=l.y,this._updateViewCoordSys(r,i),MW(r,i,s,this._controller,this._controllerHost,null),o.eachEdge(function(g){var m=new cce,y=De(m);y.dataIndex=g.dataIndex,y.seriesIndex=r.seriesIndex,y.dataType="edge";var x=g.getModel(),_=x.getModel("lineStyle"),w=_.get("curveness"),S=g.node1.getLayout(),T=g.node1.getModel(),M=T.get("localX"),A=T.get("localY"),P=g.node2.getLayout(),I=g.node2.getModel(),N=I.get("localX"),D=I.get("localY"),O=g.getLayout(),R,F,H,W,V,z,Z,U;m.shape.extent=Math.max(1,O.dy),m.shape.orient=d,d==="vertical"?(R=(M!=null?M*u:S.x)+O.sy,F=(A!=null?A*c:S.y)+S.dy,H=(N!=null?N*u:P.x)+O.ty,W=D!=null?D*c:P.y,V=R,z=F*(1-w)+W*w,Z=H,U=F*w+W*(1-w)):(R=(M!=null?M*u:S.x)+S.dx,F=(A!=null?A*c:S.y)+O.sy,H=N!=null?N*u:P.x,W=(D!=null?D*c:P.y)+O.ty,V=R*(1-w)+H*w,z=F,Z=R*w+H*(1-w),U=W),m.setShape({x1:R,y1:F,x2:H,y2:W,cpx1:V,cpy1:z,cpx2:Z,cpy2:U}),m.useStyle(_.getItemStyle()),ER(m.style,d,g);var $=""+x.get("value"),Y=Cr(x,"edgeLabel");Dr(m,Y,{labelFetcher:{getFormattedLabel:function(se,le,Ee,me,ye,Me){return r.getFormattedLabel(se,le,"edge",me,zn(ye,Y.normal&&Y.normal.get("formatter"),$),Me)}},labelDataIndex:g.dataIndex,defaultText:$}),m.setTextConfig({position:"inside"});var te=x.getModel("emphasis");Sr(m,x,"lineStyle",function(se){var le=se.getItemStyle();return ER(le,d,g),le}),s.add(m),f.setItemGraphicEl(g.dataIndex,m);var ie=te.get("focus");Dt(m,ie==="adjacency"?g.getAdjacentDataIndices():ie==="trajectory"?g.getTrajectoryDataIndices():ie,te.get("blurScope"),te.get("disabled"))}),o.eachNode(function(g){var m=g.getLayout(),y=g.getModel(),x=y.get("localX"),_=y.get("localY"),w=y.getModel("emphasis"),S=y.get(["itemStyle","borderRadius"])||0,T=new Ze({shape:{x:x!=null?x*u:m.x,y:_!=null?_*c:m.y,width:m.dx,height:m.dy,r:S},style:y.getModel("itemStyle").getItemStyle(),z2:10});Dr(T,Cr(y),{labelFetcher:{getFormattedLabel:function(A,P){return r.getFormattedLabel(A,P,"node")}},labelDataIndex:g.dataIndex,defaultText:g.id}),T.disableLabelAnimation=!0,T.setStyle("fill",g.getVisual("color")),T.setStyle("decal",g.getVisual("style").decal),Sr(T,y),s.add(T),h.setItemGraphicEl(g.dataIndex,T),De(T).dataType="node";var M=w.get("focus");Dt(T,M==="adjacency"?g.getAdjacentDataIndices():M==="trajectory"?g.getTrajectoryDataIndices():M,w.get("blurScope"),w.get("disabled"))}),h.eachItemGraphicEl(function(g,m){var y=h.getItemModel(m);y.get("draggable")&&(g.drift=function(x,_){a._focusAdjacencyDisabled=!0,this.shape.x+=x,this.shape.y+=_,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:r.id,dataIndex:h.getRawIndex(m),localX:this.shape.x/u,localY:this.shape.y/c})},g.ondragend=function(){a._focusAdjacencyDisabled=!1},g.draggable=!0,g.cursor="move")}),!this._data&&r.isAnimationEnabled()&&s.setClipPath(fce(s.getBoundingRect(),r,function(){s.removeClipPath()})),this._data=r.getData()},t.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._updateViewCoordSys=function(r,n){var i=r.layoutInfo,a=i.width,o=i.height,s=r.coordinateSystem=new nc(null,{api:n,ecModel:r.ecModel});s.zoomLimit=r.get("scaleLimit"),s.setBoundingRect(0,0,a,o),s.setCenter(r.get("center")),s.setZoom(r.get("zoom")),this._controllerHost.target.attr({x:s.x,y:s.y,scaleX:s.scaleX,scaleY:s.scaleY})},t.type="sankey",t}(gt);function ER(e,t,r){switch(e.fill){case"source":e.fill=r.node1.getVisual("color"),e.decal=r.node1.getVisual("style").decal;break;case"target":e.fill=r.node2.getVisual("color"),e.decal=r.node2.getVisual("style").decal;break;case"gradient":var n=r.node1.getVisual("color"),i=r.node2.getVisual("color");he(n)&&he(i)&&(e.fill=new qu(0,0,+(t==="horizontal"),+(t==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function fce(e,t,r){var n=new Ze({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Nt(n,{shape:{width:e.width+20}},t,r),n}var dce=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(r,n){var i=r.edges||r.links||[],a=r.data||r.nodes||[],o=r.levels||[];this.levelModels=[];for(var s=this.levelModels,l=0;l=0&&(s[o[l].depth]=new qe(o[l],this,n));var u=Ok(a,i,this,!0,c);return u.data;function c(h,f){h.wrapMethod("getItemModel",function(d,g){var m=d.parentModel,y=m.getData().getItemLayout(g);if(y){var x=y.depth,_=m.levelModels[x];_&&(d.parentModel=_)}return d}),f.wrapMethod("getItemModel",function(d,g){var m=d.parentModel,y=m.getGraph().getEdgeByIndex(g),x=y.node1.getLayout();if(x){var _=x.depth,w=m.levelModels[_];w&&(d.parentModel=w)}return d})}},t.prototype.setNodePosition=function(r,n){var i=this.option.data||this.option.nodes,a=i[r];a.localX=n[0],a.localY=n[1]},t.prototype.setCenter=function(r){this.option.center=r},t.prototype.setZoom=function(r){this.option.zoom=r},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(r,n,i){function a(d){return isNaN(d)||d==null}if(i==="edge"){var o=this.getDataParams(r,i),s=o.data,l=o.value,u=s.source+" -- "+s.target;return gr("nameValue",{name:u,value:l,noValue:a(l)})}else{var c=this.getGraph().getNodeByIndex(r),h=c.getLayout().value,f=this.getDataParams(r,i).data.name;return gr("nameValue",{name:f!=null?f+"":null,value:h,noValue:a(h)})}},t.prototype.optionUpdated=function(){},t.prototype.getDataParams=function(r,n){var i=e.prototype.getDataParams.call(this,r,n);if(i.value==null&&n==="node"){var a=this.getGraph().getNodeByIndex(r),o=a.getLayout().value;i.value=o}return i},t.type="series.sankey",t.layoutMode="box",t.defaultOption={z:2,coordinateSystemUsage:"box",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,roam:!1,roamTrigger:"global",center:null,zoom:1,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:K.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:K.color.primary}},animationEasing:"linear",animationDuration:1e3},t}(bt);function vce(e,t){e.eachSeriesByType("sankey",function(r){var n=r.get("nodeWidth"),i=r.get("nodeGap"),a=Tr(r,t).refContainer,o=It(r.getBoxLayoutParams(),a);r.layoutInfo=o;var s=o.width,l=o.height,u=r.getGraph(),c=u.nodes,h=u.edges;gce(c);var f=ot(c,function(y){return y.getLayout().value===0}),d=f.length!==0?0:r.get("layoutIterations"),g=r.get("orient"),m=r.get("nodeAlign");pce(c,h,n,i,s,l,d,g,m)})}function pce(e,t,r,n,i,a,o,s,l){mce(e,t,r,i,a,s,l),bce(e,t,a,i,n,o,s),Nce(e,s)}function gce(e){j(e,function(t){var r=Ys(t.outEdges,fx),n=Ys(t.inEdges,fx),i=t.getValue()||0,a=Math.max(r,n,i);t.setLayout({value:a},!0)})}function mce(e,t,r,n,i,a,o){for(var s=[],l=[],u=[],c=[],h=0,f=0;f=0;x&&y.depth>d&&(d=y.depth),m.setLayout({depth:x?y.depth:h},!0),a==="vertical"?m.setLayout({dy:r},!0):m.setLayout({dx:r},!0);for(var _=0;_h-1?d:h-1;o&&o!=="left"&&yce(e,o,a,A);var P=a==="vertical"?(i-r)/A:(n-r)/A;_ce(e,P,a)}function wH(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return t.depth!=null&&t.depth>=0}function yce(e,t,r,n){if(t==="right"){for(var i=[],a=e,o=0;a.length;){for(var s=0;s0;a--)l*=.99,Cce(s,l,o),Ow(s,i,r,n,o),Lce(s,l,o),Ow(s,i,r,n,o)}function wce(e,t){var r=[],n=t==="vertical"?"y":"x",i=ZC(e,function(a){return a.getLayout()[n]});return i.keys.sort(function(a,o){return a-o}),j(i.keys,function(a){r.push(i.buckets.get(a))}),r}function Sce(e,t,r,n,i,a){var o=1/0;j(e,function(s){var l=s.length,u=0;j(s,function(h){u+=h.getLayout().value});var c=a==="vertical"?(n-(l-1)*i)/u:(r-(l-1)*i)/u;c0&&(s=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]+l.getLayout()[f]+t;var g=i==="vertical"?n:r;if(u=c-t-g,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),c=s;for(var d=h-2;d>=0;--d)l=o[d],u=l.getLayout()[a]+l.getLayout()[f]+t-c,u>0&&(s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]}})}function Cce(e,t,r){j(e.slice().reverse(),function(n){j(n,function(i){if(i.outEdges.length){var a=Ys(i.outEdges,Tce,r)/Ys(i.outEdges,fx);if(isNaN(a)){var o=i.outEdges.length;a=o?Ys(i.outEdges,Mce,r)/o:0}if(r==="vertical"){var s=i.getLayout().x+(a-nl(i,r))*t;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-nl(i,r))*t;i.setLayout({y:l},!0)}}})})}function Tce(e,t){return nl(e.node2,t)*e.getValue()}function Mce(e,t){return nl(e.node2,t)}function Ace(e,t){return nl(e.node1,t)*e.getValue()}function kce(e,t){return nl(e.node1,t)}function nl(e,t){return t==="vertical"?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function fx(e){return e.getValue()}function Ys(e,t,r){for(var n=0,i=e.length,a=-1;++ao&&(o=l)}),j(n,function(s){var l=new Ir({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:t.get("color")}),u=l.mapValueToVisual(s.getLayout().value),c=s.getModel().get(["itemStyle","color"]);c!=null?(s.setVisual("color",c),s.setVisual("style",{fill:c})):(s.setVisual("color",u),s.setVisual("style",{fill:u}))})}i.length&&j(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function Ice(e){e.registerChartView(hce),e.registerSeriesModel(dce),e.registerLayout(vce),e.registerVisual(Pce),e.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(t,r){r.eachComponent({mainType:"series",subType:"sankey",query:t},function(n){n.setNodePosition(t.dataIndex,[t.localX,t.localY])})}),e.registerAction({type:"sankeyRoam",event:"sankeyRoam",update:"none"},function(t,r,n){r.eachComponent({mainType:"series",subType:"sankey",query:t},function(i){var a=i.coordinateSystem,o=j_(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}var SH=function(){function e(){}return e.prototype._hasEncodeRule=function(t){var r=this.getEncode();return r&&r.get(t)!=null},e.prototype.getInitialData=function(t,r){var n,i=r.getComponent("xAxis",this.get("xAxisIndex")),a=r.getComponent("yAxis",this.get("yAxisIndex")),o=i.get("type"),s=a.get("type"),l;o==="category"?(t.layout="horizontal",n=i.getOrdinalMeta(),l=!this._hasEncodeRule("x")):s==="category"?(t.layout="vertical",n=a.getOrdinalMeta(),l=!this._hasEncodeRule("y")):t.layout=t.layout||"horizontal";var u=["x","y"],c=t.layout==="horizontal"?0:1,h=this._baseAxisDim=u[c],f=u[1-c],d=[i,a],g=d[c].get("type"),m=d[1-c].get("type"),y=t.data;if(y&&l){var x=[];j(y,function(S,T){var M;re(S)?(M=S.slice(),S.unshift(T)):re(S.value)?(M=Q({},S),M.value=M.value.slice(),S.value.unshift(T)):M=S,x.push(M)}),t.data=x}var _=this.defaultValueDimensions,w=[{name:h,type:X0(g),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:f,type:X0(m),dimsDef:_.slice()}];return Tf(this,{coordDimensions:w,dimensionsCount:_.length+1,encodeDefaulter:Fe(D6,w,this)})},e.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},e}(),CH=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],r.visualDrawType="stroke",r}return t.type="series.boxplot",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:K.color.neutral00,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:K.color.shadow}},animationDuration:800},t}(bt);Qt(CH,SH,!0);var Dce=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=r.getData(),o=this.group,s=this._data;this._data||o.removeAll();var l=r.get("layout")==="horizontal"?1:0;a.diff(s).add(function(u){if(a.hasValue(u)){var c=a.getItemLayout(u),h=jR(c,a,u,l,!0);a.setItemGraphicEl(u,h),o.add(h)}}).update(function(u,c){var h=s.getItemGraphicEl(c);if(!a.hasValue(u)){o.remove(h);return}var f=a.getItemLayout(u);h?(Oi(h),TH(f,h,a,u)):h=jR(f,a,u,l),o.add(h),a.setItemGraphicEl(u,h)}).remove(function(u){var c=s.getItemGraphicEl(u);c&&o.remove(c)}).execute(),this._data=a},t.prototype.remove=function(r){var n=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl(function(a){a&&n.remove(a)})},t.type="boxplot",t}(gt),Ece=function(){function e(){}return e}(),jce=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="boxplotBoxPath",n}return t.prototype.getDefaultShape=function(){return new Ece},t.prototype.buildPath=function(r,n){var i=n.points,a=0;for(r.moveTo(i[a][0],i[a][1]),a++;a<4;a++)r.lineTo(i[a][0],i[a][1]);for(r.closePath();am){var S=[x,w];n.push(S)}}}return{boxData:r,outliers:n}}var Gce={type:"echarts:boxplot",transform:function(t){var r=t.upstream;if(r.sourceFormat!==Wr){var n="";ft(n)}var i=Vce(r.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function Wce(e){e.registerSeriesModel(CH),e.registerChartView(Dce),e.registerLayout(Oce),e.registerTransform(Gce)}var Hce=["itemStyle","borderColor"],Uce=["itemStyle","borderColor0"],Zce=["itemStyle","borderColorDoji"],$ce=["itemStyle","color"],Yce=["itemStyle","color0"];function Uk(e,t){return t.get(e>0?$ce:Yce)}function Zk(e,t){return t.get(e===0?Zce:e>0?Hce:Uce)}var Xce={seriesType:"candlestick",plan:yf(),performRawSeries:!0,reset:function(e,t){if(!t.isSeriesFiltered(e)){var r=e.pipelineContext.large;return!r&&{progress:function(n,i){for(var a;(a=n.next())!=null;){var o=i.getItemModel(a),s=i.getItemLayout(a).sign,l=o.getItemStyle();l.fill=Uk(s,o),l.stroke=Zk(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");Q(u,l)}}}}}},qce=["color","borderColor"],Kce=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(r),this._isLargeDraw?this._renderLarge(r):this._renderNormal(r)},t.prototype.incrementalPrepareRender=function(r,n,i){this._clear(),this._updateDrawMode(r)},t.prototype.incrementalRender=function(r,n,i,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(r,n):this._incrementalRenderNormal(r,n)},t.prototype.eachRendered=function(r){hl(this._progressiveEls||this.group,r)},t.prototype._updateDrawMode=function(r){var n=r.pipelineContext.large;(this._isLargeDraw==null||n!==this._isLargeDraw)&&(this._isLargeDraw=n,this._clear())},t.prototype._renderNormal=function(r){var n=r.getData(),i=this._data,a=this.group,o=n.getLayout("isSimpleBox"),s=r.get("clip",!0),l=r.coordinateSystem,u=l.getArea&&l.getArea();this._data||a.removeAll(),n.diff(i).add(function(c){if(n.hasValue(c)){var h=n.getItemLayout(c);if(s&&RR(u,h))return;var f=zw(h,c,!0);Nt(f,{shape:{points:h.ends}},r,c),Bw(f,n,c,o),a.add(f),n.setItemGraphicEl(c,f)}}).update(function(c,h){var f=i.getItemGraphicEl(h);if(!n.hasValue(c)){a.remove(f);return}var d=n.getItemLayout(c);if(s&&RR(u,d)){a.remove(f);return}f?(it(f,{shape:{points:d.ends}},r,c),Oi(f)):f=zw(d),Bw(f,n,c,o),a.add(f),n.setItemGraphicEl(c,f)}).remove(function(c){var h=i.getItemGraphicEl(c);h&&a.remove(h)}).execute(),this._data=n},t.prototype._renderLarge=function(r){this._clear(),OR(r,this.group);var n=r.get("clip",!0)?Jp(r.coordinateSystem,!1,r):null;n?this.group.setClipPath(n):this.group.removeClipPath()},t.prototype._incrementalRenderNormal=function(r,n){for(var i=n.getData(),a=i.getLayout("isSimpleBox"),o;(o=r.next())!=null;){var s=i.getItemLayout(o),l=zw(s);Bw(l,i,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},t.prototype._incrementalRenderLarge=function(r,n){OR(n,this.group,this._progressiveEls,!0)},t.prototype.remove=function(r){this._clear()},t.prototype._clear=function(){this.group.removeAll(),this._data=null},t.type="candlestick",t}(gt),Jce=function(){function e(){}return e}(),Qce=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="normalCandlestickBox",n}return t.prototype.getDefaultShape=function(){return new Jce},t.prototype.buildPath=function(r,n){var i=n.points;this.__simpleBox?(r.moveTo(i[4][0],i[4][1]),r.lineTo(i[6][0],i[6][1])):(r.moveTo(i[0][0],i[0][1]),r.lineTo(i[1][0],i[1][1]),r.lineTo(i[2][0],i[2][1]),r.lineTo(i[3][0],i[3][1]),r.closePath(),r.moveTo(i[4][0],i[4][1]),r.lineTo(i[5][0],i[5][1]),r.moveTo(i[6][0],i[6][1]),r.lineTo(i[7][0],i[7][1]))},t}(Ke);function zw(e,t,r){var n=e.ends;return new Qce({shape:{points:r?ehe(n,e):n},z2:100})}function RR(e,t){for(var r=!0,n=0;nT?D[a]:N[a],ends:F,brushRect:Z(M,A,w)})}function V($,Y){var te=[];return te[i]=Y,te[a]=$,isNaN(Y)||isNaN($)?[NaN,NaN]:t.dataToPoint(te)}function z($,Y,te){var ie=Y.slice(),se=Y.slice();ie[i]=Py(ie[i]+n/2,1,!1),se[i]=Py(se[i]-n/2,1,!0),te?$.push(ie,se):$.push(se,ie)}function Z($,Y,te){var ie=V($,te),se=V(Y,te);return ie[i]-=n/2,se[i]-=n/2,{x:ie[0],y:ie[1],width:n,height:se[1]-ie[1]}}function U($){return $[i]=Py($[i],1),$}}function g(m,y){for(var x=Oa(m.count*4),_=0,w,S=[],T=[],M,A=y.getStore(),P=!!e.get(["itemStyle","borderColorDoji"]);(M=m.next())!=null;){var I=A.get(s,M),N=A.get(u,M),D=A.get(c,M),O=A.get(h,M),R=A.get(f,M);if(isNaN(I)||isNaN(O)||isNaN(R)){x[_++]=NaN,_+=3;continue}x[_++]=zR(A,M,N,D,c,P),S[i]=I,S[a]=O,w=t.dataToPoint(S,null,T),x[_++]=w?w[0]:NaN,x[_++]=w?w[1]:NaN,S[a]=R,w=t.dataToPoint(S,null,T),x[_++]=w?w[1]:NaN}y.setLayout("largePoints",x)}}};function zR(e,t,r,n,i,a){var o;return r>n?o=-1:r0?e.get(i,t-1)<=n?1:-1:1,o}function ihe(e,t){var r=e.getBaseAxis(),n,i=r.type==="category"?r.getBandWidth():(n=r.getExtent(),Math.abs(n[1]-n[0])/t.count()),a=ce(be(e.get("barMaxWidth"),i),i),o=ce(be(e.get("barMinWidth"),1),i),s=e.get("barWidth");return s!=null?ce(s,i):Math.max(Math.min(i/2,a),o)}function ahe(e){e.registerChartView(Kce),e.registerSeriesModel(MH),e.registerPreprocessor(rhe),e.registerVisual(Xce),e.registerLayout(nhe)}function BR(e,t){var r=t.rippleEffectColor||t.color;e.eachChild(function(n){n.attr({z:t.z,zlevel:t.zlevel,style:{stroke:t.brushType==="stroke"?r:null,fill:t.brushType==="fill"?r:null}})})}var ohe=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=new qp(r,n),o=new Ce;return i.add(a),i.add(o),i.updateData(r,n),i}return t.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},t.prototype.startEffectAnimation=function(r){for(var n=r.symbolType,i=r.color,a=r.rippleNumber,o=this.childAt(1),s=0;s0&&(s=this._getLineLength(a)/c*1e3),s!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var f=void 0;we(h)?f=h(i):f=h,a.__t>0&&(f=-s*a.__t),this._animateSymbol(a,s,f,l,u)}this._period=s,this._loop=l,this._roundTrip=u}},t.prototype._animateSymbol=function(r,n,i,a,o){if(n>0){r.__t=0;var s=this,l=r.animate("",a).when(o?n*2:n,{__t:o?2:1}).delay(i).during(function(){s._updateSymbolPosition(r)});a||l.done(function(){s.remove(r)}),l.start()}},t.prototype._getLineLength=function(r){return To(r.__p1,r.__cp1)+To(r.__cp1,r.__p2)},t.prototype._updateAnimationPoints=function(r,n){r.__p1=n[0],r.__p2=n[1],r.__cp1=n[2]||[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]},t.prototype.updateData=function(r,n,i){this.childAt(0).updateData(r,n,i),this._updateEffectSymbol(r,n)},t.prototype._updateSymbolPosition=function(r){var n=r.__p1,i=r.__p2,a=r.__cp1,o=r.__t<1?r.__t:2-r.__t,s=[r.x,r.y],l=s.slice(),u=Br,c=NC;s[0]=u(n[0],a[0],i[0],o),s[1]=u(n[1],a[1],i[1],o);var h=r.__t<1?c(n[0],a[0],i[0],o):c(i[0],a[0],n[0],1-o),f=r.__t<1?c(n[1],a[1],i[1],o):c(i[1],a[1],n[1],1-o);r.rotation=-Math.atan2(f,h)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(r.__lastT!==void 0&&r.__lastT=0&&!(a[l]<=n);l--);l=Math.min(l,o-2)}else{for(l=s;ln);l++);l=Math.min(l-1,o-2)}var c=(n-a[l])/(a[l+1]-a[l]),h=i[l],f=i[l+1];r.x=h[0]*(1-c)+c*f[0],r.y=h[1]*(1-c)+c*f[1];var d=r.__t<1?f[0]-h[0]:h[0]-f[0],g=r.__t<1?f[1]-h[1]:h[1]-f[1];r.rotation=-Math.atan2(g,d)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=n,r.ignore=!1}},t}(AH),hhe=function(){function e(){this.polyline=!1,this.curveness=0,this.segs=[]}return e}(),fhe=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n._off=0,n.hoverDataIdx=-1,n}return t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.getDefaultStyle=function(){return{stroke:K.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new hhe},t.prototype.buildPath=function(r,n){var i=n.segs,a=n.curveness,o;if(n.polyline)for(o=this._off;o0){r.moveTo(i[o++],i[o++]);for(var l=1;l0){var d=(u+h)/2-(c-f)*a,g=(c+f)/2-(h-u)*a;r.quadraticCurveTo(d,g,h,f)}else r.lineTo(h,f)}this.incremental&&(this._off=o,this.notClear=!0)},t.prototype.findDataIndex=function(r,n){var i=this.shape,a=i.segs,o=i.curveness,s=this.style.lineWidth;if(i.polyline)for(var l=0,u=0;u0)for(var h=a[u++],f=a[u++],d=1;d0){var y=(h+g)/2-(f-m)*o,x=(f+m)/2-(g-h)*o;if(kF(h,f,y,x,g,m,s,r,n))return l}else if(ms(h,f,g,m,s,r,n))return l;l++}return-1},t.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect();if(r=i[0],n=i[1],a.contain(r,n)){var o=this.hoverDataIdx=this.findDataIndex(r,n);return o>=0}return this.hoverDataIdx=-1,!1},t.prototype.getBoundingRect=function(){var r=this._rect;if(!r){for(var n=this.shape,i=n.segs,a=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u0&&(o.dataIndex=l+t.__startIndex)})},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),LH={seriesType:"lines",plan:yf(),reset:function(e){var t=e.coordinateSystem;if(t){var r=e.get("polyline"),n=e.pipelineContext.large;return{progress:function(i,a){var o=[];if(n){var s=void 0,l=i.end-i.start;if(r){for(var u=0,c=i.start;c0&&(c||u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)})),o.updateData(a);var h=r.get("clip",!0)&&Jp(r.coordinateSystem,!1,r);h?this.group.setClipPath(h):this.group.removeClipPath(),this._lastZlevel=s,this._finished=!0},t.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),o=this._updateLineDraw(a,r);o.incrementalPrepareUpdate(a),this._clearLayer(i),this._finished=!1},t.prototype.incrementalRender=function(r,n,i){this._lineDraw.incrementalUpdate(r,n.getData()),this._finished=r.end===n.getData().count()},t.prototype.eachRendered=function(r){this._lineDraw&&this._lineDraw.eachRendered(r)},t.prototype.updateTransform=function(r,n,i){var a=r.getData(),o=r.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var s=LH.reset(r,n,i);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),this._lineDraw.updateLayout(),this._clearLayer(i)},t.prototype._updateLineDraw=function(r,n){var i=this._lineDraw,a=this._showEffect(n),o=!!n.get("polyline"),s=n.pipelineContext,l=s.large;return(!i||a!==this._hasEffet||o!==this._isPolyline||l!==this._isLargeDraw)&&(i&&i.remove(),i=this._lineDraw=l?new dhe:new Rk(o?a?che:kH:a?AH:jk),this._hasEffet=a,this._isPolyline=o,this._isLargeDraw=l),this.group.add(i.group),i},t.prototype._showEffect=function(r){return!!r.get(["effect","show"])},t.prototype._clearLayer=function(r){var n=r.getZr(),i=n.painter.getType()==="svg";!i&&this._lastZlevel!=null&&n.painter.getLayer(this._lastZlevel).clear(!0)},t.prototype.remove=function(r,n){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(n)},t.prototype.dispose=function(r,n){this.remove(r,n)},t.type="lines",t}(gt),phe=typeof Uint32Array>"u"?Array:Uint32Array,ghe=typeof Float64Array>"u"?Array:Float64Array;function FR(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=ae(t,function(r){var n=[r[0].coord,r[1].coord],i={coords:n};return r[0].name&&(i.fromName=r[0].name),r[1].name&&(i.toName=r[1].name),a_([i,r[0],r[1]])}))}var mhe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.visualStyleAccessPath="lineStyle",r.visualDrawType="stroke",r}return t.prototype.init=function(r){r.data=r.data||[],FR(r);var n=this._processFlatCoordsArray(r.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(r.data=new Float32Array(n.count)),e.prototype.init.apply(this,arguments)},t.prototype.mergeOption=function(r){if(FR(r),r.data){var n=this._processFlatCoordsArray(r.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(r.data=new Float32Array(n.count))}e.prototype.mergeOption.apply(this,arguments)},t.prototype.appendData=function(r){var n=this._processFlatCoordsArray(r.data);n.flatCoords&&(this._flatCoords?(this._flatCoords=Eh(this._flatCoords,n.flatCoords),this._flatCoordsOffset=Eh(this._flatCoordsOffset,n.flatCoordsOffset)):(this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset),r.data=new Float32Array(n.count)),this.getRawData().appendData(r.data)},t.prototype._getCoordsFromItemModel=function(r){var n=this.getData().getItemModel(r),i=n.option instanceof Array?n.option:n.getShallow("coords");return i},t.prototype.getLineCoordsCount=function(r){return this._flatCoordsOffset?this._flatCoordsOffset[r*2+1]:this._getCoordsFromItemModel(r).length},t.prototype.getLineCoords=function(r,n){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[r*2],a=this._flatCoordsOffset[r*2+1],o=0;o ")})},t.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},t.prototype.getProgressive=function(){var r=this.option.progressive;return r??(this.option.large?1e4:this.get("progressive"))},t.prototype.getProgressiveThreshold=function(){var r=this.option.progressiveThreshold;return r??(this.option.large?2e4:this.get("progressiveThreshold"))},t.prototype.getZLevelKey=function(){var r=this.getModel("effect"),n=r.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:r.get("show")&&n>0?n+"":""},t.type="series.lines",t.dependencies=["grid","polar","geo","calendar"],t.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},t}(bt);function $m(e){return e instanceof Array||(e=[e,e]),e}var yhe={seriesType:"lines",reset:function(e){var t=$m(e.get("symbol")),r=$m(e.get("symbolSize")),n=e.getData();n.setVisual("fromSymbol",t&&t[0]),n.setVisual("toSymbol",t&&t[1]),n.setVisual("fromSymbolSize",r&&r[0]),n.setVisual("toSymbolSize",r&&r[1]);function i(a,o){var s=a.getItemModel(o),l=$m(s.getShallow("symbol",!0)),u=$m(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:n.hasItemOption?i:null}}};function xhe(e){e.registerChartView(vhe),e.registerSeriesModel(mhe),e.registerLayout(LH),e.registerVisual(yhe)}var _he=256,bhe=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=Bn.createCanvas();this.canvas=t}return e.prototype.update=function(t,r,n,i,a,o){var s=this._getBrush(),l=this._getGradient(a,"inRange"),u=this._getGradient(a,"outOfRange"),c=this.pointSize+this.blurSize,h=this.canvas,f=h.getContext("2d"),d=t.length;h.width=r,h.height=n;for(var g=0;g0){var O=o(w)?l:u;w>0&&(w=w*N+P),T[M++]=O[D],T[M++]=O[D+1],T[M++]=O[D+2],T[M++]=O[D+3]*w*256}else M+=4}return f.putImageData(S,0,0),h},e.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=Bn.createCanvas()),r=this.pointSize+this.blurSize,n=r*2;t.width=n,t.height=n;var i=t.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor=K.color.neutral99,i.beginPath(),i.arc(-r,r,this.pointSize,0,Math.PI*2,!0),i.closePath(),i.fill(),t},e.prototype._getGradient=function(t,r){for(var n=this._gradientPixels,i=n[r]||(n[r]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],o=0,s=0;s<256;s++)t[r](s/255,!0,a),i[o++]=a[0],i[o++]=a[1],i[o++]=a[2],i[o++]=a[3];return i},e}();function whe(e,t,r){var n=e[1]-e[0];t=ae(t,function(o){return{interval:[(o.interval[0]-e[0])/n,(o.interval[1]-e[0])/n]}});var i=t.length,a=0;return function(o){var s;for(s=a;s=0;s--){var l=t[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}return s>=0&&s=t[0]&&n<=t[1]}}function VR(e){var t=e.dimensions;return t[0]==="lng"&&t[1]==="lat"}var Che=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a;n.eachComponent("visualMap",function(s){s.eachTargetSeries(function(l){l===r&&(a=s)})}),this._progressiveEls=null,this.group.removeAll();var o=r.coordinateSystem;o.type==="cartesian2d"||o.type==="calendar"||o.type==="matrix"?this._renderOnGridLike(r,i,0,r.getData().count()):VR(o)&&this._renderOnGeo(o,r,a,i)},t.prototype.incrementalPrepareRender=function(r,n,i){this.group.removeAll()},t.prototype.incrementalRender=function(r,n,i,a){var o=n.coordinateSystem;o&&(VR(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnGridLike(n,a,r.start,r.end,!0)))},t.prototype.eachRendered=function(r){hl(this._progressiveEls||this.group,r)},t.prototype._renderOnGridLike=function(r,n,i,a,o){var s=r.coordinateSystem,l=tl(s,"cartesian2d"),u=tl(s,"matrix"),c,h,f,d;if(l){var g=s.getAxis("x"),m=s.getAxis("y");c=g.getBandWidth()+.5,h=m.getBandWidth()+.5,f=g.scale.getExtent(),d=m.scale.getExtent()}for(var y=this.group,x=r.getData(),_=r.getModel(["emphasis","itemStyle"]).getItemStyle(),w=r.getModel(["blur","itemStyle"]).getItemStyle(),S=r.getModel(["select","itemStyle"]).getItemStyle(),T=r.get(["itemStyle","borderRadius"]),M=Cr(r),A=r.getModel("emphasis"),P=A.get("focus"),I=A.get("blurScope"),N=A.get("disabled"),D=l||u?[x.mapDimension("x"),x.mapDimension("y"),x.mapDimension("value")]:[x.mapDimension("time"),x.mapDimension("value")],O=i;Of[1]||Wd[1])continue;var V=s.dataToPoint([H,W]);R=new Ze({shape:{x:V[0]-c/2,y:V[1]-h/2,width:c,height:h},style:F})}else if(u){var z=s.dataToLayout([x.get(D[0],O),x.get(D[1],O)]).rect;if(Xr(z.x))continue;R=new Ze({z2:1,shape:z,style:F})}else{if(isNaN(x.get(D[1],O)))continue;var Z=s.dataToLayout([x.get(D[0],O)]),z=Z.contentRect||Z.rect;if(Xr(z.x)||Xr(z.y))continue;R=new Ze({z2:1,shape:z,style:F})}if(x.hasItemOption){var U=x.getItemModel(O),$=U.getModel("emphasis");_=$.getModel("itemStyle").getItemStyle(),w=U.getModel(["blur","itemStyle"]).getItemStyle(),S=U.getModel(["select","itemStyle"]).getItemStyle(),T=U.get(["itemStyle","borderRadius"]),P=$.get("focus"),I=$.get("blurScope"),N=$.get("disabled"),M=Cr(U)}R.shape.r=T;var Y=r.getRawValue(O),te="-";Y&&Y[2]!=null&&(te=Y[2]+""),Dr(R,M,{labelFetcher:r,labelDataIndex:O,defaultOpacity:F.opacity,defaultText:te}),R.ensureState("emphasis").style=_,R.ensureState("blur").style=w,R.ensureState("select").style=S,Dt(R,P,I,N),R.incremental=o,o&&(R.states.emphasis.hoverLayer=!0),y.add(R),x.setItemGraphicEl(O,R),this._progressiveEls&&this._progressiveEls.push(R)}},t.prototype._renderOnGeo=function(r,n,i,a){var o=i.targetVisuals.inRange,s=i.targetVisuals.outOfRange,l=n.getData(),u=this._hmLayer||this._hmLayer||new bhe;u.blurSize=n.get("blurSize"),u.pointSize=n.get("pointSize"),u.minOpacity=n.get("minOpacity"),u.maxOpacity=n.get("maxOpacity");var c=r.getViewRect().clone(),h=r.getRoamTransform();c.applyTransform(h);var f=Math.max(c.x,0),d=Math.max(c.y,0),g=Math.min(c.width+c.x,a.getWidth()),m=Math.min(c.height+c.y,a.getHeight()),y=g-f,x=m-d,_=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],w=l.mapArray(_,function(A,P,I){var N=r.dataToPoint([A,P]);return N[0]-=f,N[1]-=d,N.push(I),N}),S=i.getExtent(),T=i.type==="visualMap.continuous"?She(S,i.option.range):whe(S,i.getPieceList(),i.option.selected);u.update(w,y,x,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},T);var M=new Er({style:{width:y,height:x,x:f,y:d,image:u.canvas},silent:!0});this.group.add(M)},t.type="heatmap",t}(gt),The=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(r,n){return no(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var r=mf.get(this.get("coordinateSystem"));if(r&&r.dimensions)return r.dimensions[0]==="lng"&&r.dimensions[1]==="lat"},t.type="series.heatmap",t.dependencies=["grid","geo","calendar","matrix"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:K.color.primary}}},t}(bt);function Mhe(e){e.registerChartView(Che),e.registerSeriesModel(The)}var Ahe=["itemStyle","borderWidth"],GR=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],Gw=new ro,khe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=this.group,o=r.getData(),s=this._data,l=r.coordinateSystem,u=l.getBaseAxis(),c=u.isHorizontal(),h=l.master.getRect(),f={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:r,coordSys:l,coordSysExtent:[[h.x,h.x+h.width],[h.y,h.y+h.height]],isHorizontal:c,valueDim:GR[+c],categoryDim:GR[1-+c]};o.diff(s).add(function(g){if(o.hasValue(g)){var m=HR(o,g),y=WR(o,g,m,f),x=UR(o,f,y);o.setItemGraphicEl(g,x),a.add(x),$R(x,f,y)}}).update(function(g,m){var y=s.getItemGraphicEl(m);if(!o.hasValue(g)){a.remove(y);return}var x=HR(o,g),_=WR(o,g,x,f),w=jH(o,_);y&&w!==y.__pictorialShapeStr&&(a.remove(y),o.setItemGraphicEl(g,null),y=null),y?jhe(y,f,_):y=UR(o,f,_,!0),o.setItemGraphicEl(g,y),y.__pictorialSymbolMeta=_,a.add(y),$R(y,f,_)}).remove(function(g){var m=s.getItemGraphicEl(g);m&&ZR(s,g,m.__pictorialSymbolMeta.animationModel,m)}).execute();var d=r.get("clip",!0)?Jp(r.coordinateSystem,!1,r):null;return d?a.setClipPath(d):a.removeClipPath(),this._data=o,this.group},t.prototype.remove=function(r,n){var i=this.group,a=this._data;r.get("animation")?a&&a.eachItemGraphicEl(function(o){ZR(a,De(o).dataIndex,r,o)}):i.removeAll()},t.type="pictorialBar",t}(gt);function WR(e,t,r,n){var i=e.getItemLayout(t),a=r.get("symbolRepeat"),o=r.get("symbolClip"),s=r.get("symbolPosition")||"start",l=r.get("symbolRotate"),u=(l||0)*Math.PI/180||0,c=r.get("symbolPatternSize")||2,h=r.isAnimationEnabled(),f={dataIndex:t,layout:i,itemModel:r,symbolType:e.getItemVisual(t,"symbol")||"circle",style:e.getItemVisual(t,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:r.get("symbolRepeatDirection"),symbolPatternSize:c,rotation:u,animationModel:h?r:null,hoverScale:h&&r.get(["emphasis","scale"]),z2:r.getShallow("z",!0)||0};Lhe(r,a,i,n,f),Nhe(e,t,i,a,o,f.boundingLength,f.pxSign,c,n,f),Phe(r,f.symbolScale,u,n,f);var d=f.symbolSize,g=ec(r.get("symbolOffset"),d);return Ihe(r,d,i,a,o,g,s,f.valueLineWidth,f.boundingLength,f.repeatCutLength,n,f),f}function Lhe(e,t,r,n,i){var a=n.valueDim,o=e.get("symbolBoundingData"),s=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),l=s.toGlobalCoord(s.dataToCoord(0)),u=1-+(r[a.wh]<=0),c;if(re(o)){var h=[Ww(s,o[0])-l,Ww(s,o[1])-l];h[1]=0?1:-1:c>0?1:-1}function Ww(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function Nhe(e,t,r,n,i,a,o,s,l,u){var c=l.valueDim,h=l.categoryDim,f=Math.abs(r[h.wh]),d=e.getItemVisual(t,"symbolSize"),g;re(d)?g=d.slice():d==null?g=["100%","100%"]:g=[d,d],g[h.index]=ce(g[h.index],f),g[c.index]=ce(g[c.index],n?f:Math.abs(a)),u.symbolSize=g;var m=u.symbolScale=[g[0]/s,g[1]/s];m[c.index]*=(l.isHorizontal?-1:1)*o}function Phe(e,t,r,n,i){var a=e.get(Ahe)||0;a&&(Gw.attr({scaleX:t[0],scaleY:t[1],rotation:r}),Gw.updateTransform(),a/=Gw.getLineScale(),a*=t[n.valueDim.index]),i.valueLineWidth=a||0}function Ihe(e,t,r,n,i,a,o,s,l,u,c,h){var f=c.categoryDim,d=c.valueDim,g=h.pxSign,m=Math.max(t[d.index]+s,0),y=m;if(n){var x=Math.abs(l),_=Fr(e.get("symbolMargin"),"15%")+"",w=!1;_.lastIndexOf("!")===_.length-1&&(w=!0,_=_.slice(0,_.length-1));var S=ce(_,t[d.index]),T=Math.max(m+S*2,0),M=w?0:S*2,A=rA(n),P=A?n:YR((x+M)/T),I=x-P*m;S=I/2/(w?P:Math.max(P-1,1)),T=m+S*2,M=w?0:S*2,!A&&n!=="fixed"&&(P=u?YR((Math.abs(u)+M)/T):0),y=P*T-M,h.repeatTimes=P,h.symbolMargin=S}var N=g*(y/2),D=h.pathPosition=[];D[f.index]=r[f.wh]/2,D[d.index]=o==="start"?N:o==="end"?l-N:l/2,a&&(D[0]+=a[0],D[1]+=a[1]);var O=h.bundlePosition=[];O[f.index]=r[f.xy],O[d.index]=r[d.xy];var R=h.barRectShape=Q({},r);R[d.wh]=g*Math.max(Math.abs(r[d.wh]),Math.abs(D[d.index]+N)),R[f.wh]=r[f.wh];var F=h.clipShape={};F[f.xy]=-r[f.xy],F[f.wh]=c.ecSize[f.wh],F[d.xy]=0,F[d.wh]=r[d.wh]}function NH(e){var t=e.symbolPatternSize,r=sr(e.symbolType,-t/2,-t/2,t,t);return r.attr({culling:!0}),r.type!=="image"&&r.setStyle({strokeNoScale:!0}),r}function PH(e,t,r,n){var i=e.__pictorialBundle,a=r.symbolSize,o=r.valueLineWidth,s=r.pathPosition,l=t.valueDim,u=r.repeatTimes||0,c=0,h=a[t.valueDim.index]+o+r.symbolMargin*2;for($k(e,function(m){m.__pictorialAnimationIndex=c,m.__pictorialRepeatTimes=u,c0:x<0)&&(_=u-1-m),y[l.index]=h*(_-u/2+.5)+s[l.index],{x:y[0],y:y[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation}}}function IH(e,t,r,n){var i=e.__pictorialBundle,a=e.__pictorialMainPath;a?Sh(a,null,{x:r.pathPosition[0],y:r.pathPosition[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation},r,n):(a=e.__pictorialMainPath=NH(r),i.add(a),Sh(a,{x:r.pathPosition[0],y:r.pathPosition[1],scaleX:0,scaleY:0,rotation:r.rotation},{scaleX:r.symbolScale[0],scaleY:r.symbolScale[1]},r,n))}function DH(e,t,r){var n=Q({},t.barRectShape),i=e.__pictorialBarRect;i?Sh(i,null,{shape:n},t,r):(i=e.__pictorialBarRect=new Ze({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,e.add(i))}function EH(e,t,r,n){if(r.symbolClip){var i=e.__pictorialClipPath,a=Q({},r.clipShape),o=t.valueDim,s=r.animationModel,l=r.dataIndex;if(i)it(i,{shape:a},s,l);else{a[o.wh]=0,i=new Ze({shape:a}),e.__pictorialBundle.setClipPath(i),e.__pictorialClipPath=i;var u={};u[o.wh]=r.clipShape[o.wh],Ku[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function HR(e,t){var r=e.getItemModel(t);return r.getAnimationDelayParams=Dhe,r.isAnimationEnabled=Ehe,r}function Dhe(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function Ehe(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function UR(e,t,r,n){var i=new Ce,a=new Ce;return i.add(a),i.__pictorialBundle=a,a.x=r.bundlePosition[0],a.y=r.bundlePosition[1],r.symbolRepeat?PH(i,t,r):IH(i,t,r),DH(i,r,n),EH(i,t,r,n),i.__pictorialShapeStr=jH(e,r),i.__pictorialSymbolMeta=r,i}function jhe(e,t,r){var n=r.animationModel,i=r.dataIndex,a=e.__pictorialBundle;it(a,{x:r.bundlePosition[0],y:r.bundlePosition[1]},n,i),r.symbolRepeat?PH(e,t,r,!0):IH(e,t,r,!0),DH(e,r,!0),EH(e,t,r,!0)}function ZR(e,t,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];$k(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),j(a,function(o){el(o,{scaleX:0,scaleY:0},r,t,function(){n.parent&&n.parent.remove(n)})}),e.setItemGraphicEl(t,null)}function jH(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function $k(e,t,r){j(e.__pictorialBundle.children(),function(n){n!==e.__pictorialBarRect&&t.call(r,n)})}function Sh(e,t,r,n,i,a){t&&e.attr(t),n.symbolClip&&!i?r&&e.attr(r):r&&Ku[i?"updateProps":"initProps"](e,r,n.animationModel,n.dataIndex,a)}function $R(e,t,r){var n=r.dataIndex,i=r.itemModel,a=i.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),c=a.get("focus"),h=a.get("blurScope"),f=a.get("scale");$k(e,function(m){if(m instanceof Er){var y=m.style;m.useStyle(Q({image:y.image,x:y.x,y:y.y,width:y.width,height:y.height},r.style))}else m.useStyle(r.style);var x=m.ensureState("emphasis");x.style=o,f&&(x.scaleX=m.scaleX*1.1,x.scaleY=m.scaleY*1.1),m.ensureState("blur").style=s,m.ensureState("select").style=l,u&&(m.cursor=u),m.z2=r.z2});var d=t.valueDim.posDesc[+(r.boundingLength>0)],g=e.__pictorialBarRect;g.ignoreClip=!0,Dr(g,Cr(i),{labelFetcher:t.seriesModel,labelDataIndex:n,defaultText:Uh(t.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:d}),Dt(e,c,h,a.get("disabled"))}function YR(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}var Rhe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.hasSymbolVisual=!0,r.defaultSymbol="roundRect",r}return t.prototype.getInitialData=function(r){return r.stack=null,e.prototype.getInitialData.apply(this,arguments)},t.type="series.pictorialBar",t.dependencies=["grid"],t.defaultOption=fl(gp.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:K.color.primary}}}),t}(gp);function Ohe(e){e.registerChartView(khe),e.registerSeriesModel(Rhe),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Fe(tG,"pictorialBar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,rG("pictorialBar"))}var zhe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._layers=[],r}return t.prototype.render=function(r,n,i){var a=r.getData(),o=this,s=this.group,l=r.getLayerSeries(),u=a.getLayout("layoutInfo"),c=u.rect,h=u.boundaryGap;s.x=0,s.y=c.y+h[0];function f(y){return y.name}var d=new Zo(this._layersSeries||[],l,f,f),g=[];d.add(fe(m,this,"add")).update(fe(m,this,"update")).remove(fe(m,this,"remove")).execute();function m(y,x,_){var w=o._layers;if(y==="remove"){s.remove(w[x]);return}for(var S=[],T=[],M,A=l[x].indices,P=0;Pa&&(a=s),n.push(s)}for(var u=0;ua&&(a=h)}return{y0:i,max:a}}function Whe(e){e.registerChartView(zhe),e.registerSeriesModel(Fhe),e.registerLayout(Vhe),e.registerProcessor(Cf("themeRiver"))}var Hhe=2,Uhe=4,qR=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;o.z2=Hhe,o.textConfig={inside:!0},De(o).seriesIndex=n.seriesIndex;var s=new tt({z2:Uhe,silent:r.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,r,n,i,a),o}return t.prototype.updateData=function(r,n,i,a,o){this.node=n,n.piece=this,i=i||this._seriesModel,a=a||this._ecModel;var s=this;De(s).dataIndex=n.dataIndex;var l=n.getModel(),u=l.getModel("emphasis"),c=n.getLayout(),h=Q({},c);h.label=null;var f=n.getVisual("style");f.lineJoin="bevel";var d=n.getVisual("decal");d&&(f.decal=Gh(d,o));var g=Ba(l.getModel("itemStyle"),h,!0);Q(h,g),j(Cn,function(_){var w=s.ensureState(_),S=l.getModel([_,"itemStyle"]);w.style=S.getItemStyle();var T=Ba(S,h);T&&(w.shape=T)}),r?(s.setShape(h),s.shape.r=c.r0,Nt(s,{shape:{r:c.r}},i,n.dataIndex)):(it(s,{shape:h},i),Oi(s)),s.useStyle(f),this._updateLabel(i);var m=l.getShallow("cursor");m&&s.attr("cursor",m),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var y=u.get("focus"),x=y==="relative"?Eh(n.getAncestorsIndices(),n.getDescendantIndices()):y==="ancestor"?n.getAncestorsIndices():y==="descendant"?n.getDescendantIndices():y;Dt(this,x,u.get("blurScope"),u.get("disabled"))},t.prototype._updateLabel=function(r){var n=this,i=this.node.getModel(),a=i.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.endAngle)/2,u=Math.cos(l),c=Math.sin(l),h=this,f=h.getTextContent(),d=this.node.dataIndex,g=a.get("minAngle")/180*Math.PI,m=a.get("show")&&!(g!=null&&Math.abs(s)F&&!Oh(W-F)&&W0?(o.virtualPiece?o.virtualPiece.updateData(!1,_,r,n,i):(o.virtualPiece=new qR(_,r,n,i),c.add(o.virtualPiece)),w.piece.off("click"),o.virtualPiece.on("click",function(S){o._rootToNode(w.parentNode)})):o.virtualPiece&&(c.remove(o.virtualPiece),o.virtualPiece=null)}},t.prototype._initEvents=function(){var r=this;this.group.off("click"),this.group.on("click",function(n){var i=!1,a=r.seriesModel.getViewRoot();a.eachNode(function(o){if(!i&&o.piece&&o.piece===n.target){var s=o.getModel().get("nodeClick");if(s==="rootToNode")r._rootToNode(o);else if(s==="link"){var l=o.getModel(),u=l.get("link");if(u){var c=l.get("target",!0)||"_blank";B0(u,c)}}i=!0}})})},t.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:l2,from:this.uid,seriesId:this.seriesModel.id,targetNode:r})},t.prototype.containPoint=function(r,n){var i=n.getData(),a=i.getItemLayout(0);if(a){var o=r[0]-a.cx,s=r[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},t.type="sunburst",t}(gt),Xhe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.ignoreStyleOnData=!0,r}return t.prototype.getInitialData=function(r,n){var i={name:r.name,children:r.data};RH(i);var a=this._levelModels=ae(r.levels||[],function(l){return new qe(l,this,n)},this),o=Lk.createTree(i,this,s);function s(l){l.wrapMethod("getItemModel",function(u,c){var h=o.getNodeByDataIndex(c),f=a[h.depth];return f&&(u.parentModel=f),u})}return o.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(r){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treePathInfo=O_(i,this),n},t.prototype.getLevelModel=function(r){return this._levelModels&&this._levelModels[r.depth]},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(r){r?this._viewRoot=r:r=this._viewRoot;var n=this.getRawData().tree.root;(!r||r!==n&&!n.contains(r))&&(this._viewRoot=n)},t.prototype.enableAriaDecal=function(){FW(this)},t.type="series.sunburst",t.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},t}(bt);function RH(e){var t=0;j(e.children,function(n){RH(n);var i=n.value;re(i)&&(i=i[0]),t+=i});var r=e.value;re(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),re(e.value)?e.value[0]=r:e.value=r}var JR=Math.PI/180;function qhe(e,t,r){t.eachSeriesByType(e,function(n){var i=n.get("center"),a=n.get("radius");re(a)||(a=[0,a]),re(i)||(i=[i,i]);var o=r.getWidth(),s=r.getHeight(),l=Math.min(o,s),u=ce(i[0],o),c=ce(i[1],s),h=ce(a[0],l/2),f=ce(a[1],l/2),d=-n.get("startAngle")*JR,g=n.get("minAngle")*JR,m=n.getData().tree.root,y=n.getViewRoot(),x=y.depth,_=n.get("sort");_!=null&&OH(y,_);var w=0;j(y.children,function(W){!isNaN(W.getValue())&&w++});var S=y.getValue(),T=Math.PI/(S||w)*2,M=y.depth>0,A=y.height-(M?-1:1),P=(f-h)/(A||1),I=n.get("clockwise"),N=n.get("stillShowZeroSum"),D=I?1:-1,O=function(W,V){if(W){var z=V;if(W!==m){var Z=W.getValue(),U=S===0&&N?T:Z*T;U1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",t);return n.depth>1&&he(s)&&(s=T0(s,(n.depth-1)/(a-1)*.5)),s}e.eachSeriesByType("sunburst",function(n){var i=n.getData(),a=i.tree;a.eachNode(function(o){var s=o.getModel(),l=s.getModel("itemStyle").getItemStyle();l.fill||(l.fill=r(o,n,a.root.height));var u=i.ensureUniqueItemVisual(o.dataIndex,"style");Q(u,l)})})}function Qhe(e){e.registerChartView(Yhe),e.registerSeriesModel(Xhe),e.registerLayout(Fe(qhe,"sunburst")),e.registerProcessor(Fe(Cf,"sunburst")),e.registerVisual(Jhe),$he(e)}var QR={color:"fill",borderColor:"stroke"},efe={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Eo=Ye(),tfe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},t.prototype.getInitialData=function(r,n){return no(null,this)},t.prototype.getDataParams=function(r,n,i){var a=e.prototype.getDataParams.call(this,r,n);return i&&(a.info=Eo(i).info),a},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},t}(bt);function rfe(e,t){return t=t||[0,0],ae(["x","y"],function(r,n){var i=this.getAxis(r),a=t[n],o=e[n]/2;return i.type==="category"?i.getBandWidth():Math.abs(i.dataToCoord(a-o)-i.dataToCoord(a+o))},this)}function nfe(e){var t=e.master.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(r){return e.dataToPoint(r)},size:fe(rfe,e)}}}function ife(e,t){return t=t||[0,0],ae([0,1],function(r){var n=t[r],i=e[r]/2,a=[],o=[];return a[r]=n-i,o[r]=n+i,a[1-r]=o[1-r]=t[1-r],Math.abs(this.dataToPoint(a)[r]-this.dataToPoint(o)[r])},this)}function afe(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(r){return e.dataToPoint(r)},size:fe(ife,e)}}}function ofe(e,t){var r=this.getAxis(),n=t instanceof Array?t[0]:t,i=(e instanceof Array?e[0]:e)/2;return r.type==="category"?r.getBandWidth():Math.abs(r.dataToCoord(n-i)-r.dataToCoord(n+i))}function sfe(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(r){return e.dataToPoint(r)},size:fe(ofe,e)}}}function lfe(e,t){return t=t||[0,0],ae(["Radius","Angle"],function(r,n){var i="get"+r+"Axis",a=this[i](),o=t[n],s=e[n]/2,l=a.type==="category"?a.getBandWidth():Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return r==="Angle"&&(l=l*Math.PI/180),l},this)}function ufe(e){var t=e.getRadiusAxis(),r=e.getAngleAxis(),n=t.getExtent();return n[0]>n[1]&&n.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:n[1],r0:n[0]},api:{coord:function(i){var a=t.dataToRadius(i[0]),o=r.dataToAngle(i[1]),s=e.coordToPoint([a,o]);return s.push(a,o*Math.PI/180),s},size:fe(lfe,e)}}}function cfe(e){var t=e.getRect(),r=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:r.start,end:r.end,weeks:r.weeks,dayCount:r.allDay}},api:{coord:function(n,i){return e.dataToPoint(n,i)},layout:function(n,i){return e.dataToLayout(n,i)}}}}function hfe(e){var t=e.getRect();return{coordSys:{type:"matrix",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(r,n){return e.dataToPoint(r,n)},layout:function(r,n){return e.dataToLayout(r,n)}}}}function zH(e,t,r,n){return e&&(e.legacy||e.legacy!==!1&&!r&&!n&&t!=="tspan"&&(t==="text"||ge(e,"text")))}function BH(e,t,r){var n=e,i,a,o;if(t==="text")o=n;else{o={},ge(n,"text")&&(o.text=n.text),ge(n,"rich")&&(o.rich=n.rich),ge(n,"textFill")&&(o.fill=n.textFill),ge(n,"textStroke")&&(o.stroke=n.textStroke),ge(n,"fontFamily")&&(o.fontFamily=n.fontFamily),ge(n,"fontSize")&&(o.fontSize=n.fontSize),ge(n,"fontStyle")&&(o.fontStyle=n.fontStyle),ge(n,"fontWeight")&&(o.fontWeight=n.fontWeight),a={type:"text",style:o,silent:!0},i={};var s=ge(n,"textPosition");r?i.position=s?n.textPosition:"inside":s&&(i.position=n.textPosition),ge(n,"textPosition")&&(i.position=n.textPosition),ge(n,"textOffset")&&(i.offset=n.textOffset),ge(n,"textRotation")&&(i.rotation=n.textRotation),ge(n,"textDistance")&&(i.distance=n.textDistance)}return eO(o,e),j(o.rich,function(l){eO(l,l)}),{textConfig:i,textContent:a}}function eO(e,t){t&&(t.font=t.textFont||t.font,ge(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),ge(t,"textAlign")&&(e.align=t.textAlign),ge(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),ge(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),ge(t,"textWidth")&&(e.width=t.textWidth),ge(t,"textHeight")&&(e.height=t.textHeight),ge(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),ge(t,"textPadding")&&(e.padding=t.textPadding),ge(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),ge(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),ge(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),ge(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),ge(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),ge(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),ge(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function tO(e,t,r){var n=e;n.textPosition=n.textPosition||r.position||"inside",r.offset!=null&&(n.textOffset=r.offset),r.rotation!=null&&(n.textRotation=r.rotation),r.distance!=null&&(n.textDistance=r.distance);var i=n.textPosition.indexOf("inside")>=0,a=e.fill||K.color.neutral99;rO(n,t);var o=n.textFill==null;return i?o&&(n.textFill=r.insideFill||K.color.neutral00,!n.textStroke&&r.insideStroke&&(n.textStroke=r.insideStroke),!n.textStroke&&(n.textStroke=a),n.textStrokeWidth==null&&(n.textStrokeWidth=2)):(o&&(n.textFill=e.fill||r.outsideFill||K.color.neutral00),!n.textStroke&&r.outsideStroke&&(n.textStroke=r.outsideStroke)),n.text=t.text,n.rich=t.rich,j(t.rich,function(s){rO(s,s)}),n}function rO(e,t){t&&(ge(t,"fill")&&(e.textFill=t.fill),ge(t,"stroke")&&(e.textStroke=t.fill),ge(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),ge(t,"font")&&(e.font=t.font),ge(t,"fontStyle")&&(e.fontStyle=t.fontStyle),ge(t,"fontWeight")&&(e.fontWeight=t.fontWeight),ge(t,"fontSize")&&(e.fontSize=t.fontSize),ge(t,"fontFamily")&&(e.fontFamily=t.fontFamily),ge(t,"align")&&(e.textAlign=t.align),ge(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),ge(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),ge(t,"width")&&(e.textWidth=t.width),ge(t,"height")&&(e.textHeight=t.height),ge(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),ge(t,"padding")&&(e.textPadding=t.padding),ge(t,"borderColor")&&(e.textBorderColor=t.borderColor),ge(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),ge(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),ge(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),ge(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),ge(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),ge(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),ge(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),ge(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),ge(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),ge(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var FH={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},nO=Qe(FH);Ei(Ya,function(e,t){return e[t]=1,e},{});Ya.join(", ");var dx=["","style","shape","extra"],Xh=Ye();function Yk(e,t,r,n,i){var a=e+"Animation",o=ff(e,n,i)||{},s=Xh(t).userDuring;return o.duration>0&&(o.during=s?fe(gfe,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),Q(o,r[a]),o}function By(e,t,r,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=r.isAnimationEnabled(),l=Xh(e),u=t.style;l.userDuring=t.during;var c={},h={};if(yfe(e,t,h),e.type==="compound")for(var f=e.shape.paths,d=t.shape.paths,g=0;g0&&e.animateFrom(y,x)}else dfe(e,t,i||0,r,c);VH(e,t),u?e.dirty():e.markRedraw()}function VH(e,t){for(var r=Xh(e).leaveToProps,n=0;n0&&e.animateFrom(i,a)}}function vfe(e,t){ge(t,"silent")&&(e.silent=t.silent),ge(t,"ignore")&&(e.ignore=t.ignore),e instanceof Ri&&ge(t,"invisible")&&(e.invisible=t.invisible),e instanceof Ke&&ge(t,"autoBatch")&&(e.autoBatch=t.autoBatch)}var Aa={},pfe={setTransform:function(e,t){return Aa.el[e]=t,this},getTransform:function(e){return Aa.el[e]},setShape:function(e,t){var r=Aa.el,n=r.shape||(r.shape={});return n[e]=t,r.dirtyShape&&r.dirtyShape(),this},getShape:function(e){var t=Aa.el.shape;if(t)return t[e]},setStyle:function(e,t){var r=Aa.el,n=r.style;return n&&(n[e]=t,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(e){var t=Aa.el.style;if(t)return t[e]},setExtra:function(e,t){var r=Aa.el.extra||(Aa.el.extra={});return r[e]=t,this},getExtra:function(e){var t=Aa.el.extra;if(t)return t[e]}};function gfe(){var e=this,t=e.el;if(t){var r=Xh(t).userDuring,n=e.userDuring;if(r!==n){e.el=e.userDuring=null;return}Aa.el=t,n(pfe)}}function iO(e,t,r,n){var i=r[e];if(i){var a=t[e],o;if(a){var s=r.transition,l=i.transition;if(l)if(!o&&(o=n[e]={}),Tu(l))Q(o,a);else for(var u=Tt(l),c=0;c=0){!o&&(o=n[e]={});for(var d=Qe(a),c=0;c=0)){var f=e.getAnimationStyleProps(),d=f?f.style:null;if(d){!a&&(a=n.style={});for(var g=Qe(r),u=0;u=0?t.getStore().get(z,W):void 0}var Z=t.get(V.name,W),U=V&&V.ordinalMeta;return U?U.categories[Z]:Z}function A(H,W){W==null&&(W=c);var V=t.getItemVisual(W,"style"),z=V&&V.fill,Z=V&&V.opacity,U=w(W,Ns).getItemStyle();z!=null&&(U.fill=z),Z!=null&&(U.opacity=Z);var $={inheritColor:he(z)?z:K.color.neutral99},Y=S(W,Ns),te=Ct(Y,null,$,!1,!0);te.text=Y.getShallow("show")?be(e.getFormattedLabel(W,Ns),Uh(t,W)):null;var ie=R0(Y,$,!1);return N(H,U),U=tO(U,te,ie),H&&I(U,H),U.legacy=!0,U}function P(H,W){W==null&&(W=c);var V=w(W,jo).getItemStyle(),z=S(W,jo),Z=Ct(z,null,null,!0,!0);Z.text=z.getShallow("show")?zn(e.getFormattedLabel(W,jo),e.getFormattedLabel(W,Ns),Uh(t,W)):null;var U=R0(z,null,!0);return N(H,V),V=tO(V,Z,U),H&&I(V,H),V.legacy=!0,V}function I(H,W){for(var V in W)ge(W,V)&&(H[V]=W[V])}function N(H,W){H&&(H.textFill&&(W.textFill=H.textFill),H.textPosition&&(W.textPosition=H.textPosition))}function D(H,W){if(W==null&&(W=c),ge(QR,H)){var V=t.getItemVisual(W,"style");return V?V[QR[H]]:null}if(ge(efe,H))return t.getItemVisual(W,H)}function O(H){if(o.type==="cartesian2d"){var W=o.getBaseAxis();return Cre(Ae({axis:W},H))}}function R(){return r.getCurrentSeriesIndices()}function F(H){return wA(H,r)}}function Lfe(e){var t={};return j(e.dimensions,function(r){var n=e.getDimensionInfo(r);if(!n.isExtraCoord){var i=n.coordDim,a=t[i]=t[i]||[];a[n.coordDimIndex]=e.getDimensionIndex(r)}}),t}function Yw(e,t,r,n,i,a,o){if(!n){a.remove(t);return}var s=Qk(e,t,r,n,i,a);return s&&o.setItemGraphicEl(r,s),s&&Dt(s,n.focus,n.blurScope,n.emphasisDisabled),s}function Qk(e,t,r,n,i,a){var o=-1,s=t;t&&UH(t,n,i)&&(o=Ve(a.childrenRef(),t),t=null);var l=!t,u=t;u?u.clearStates():(u=Kk(n),s&&Tfe(s,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),n.tooltipDisabled&&(u.tooltipDisabled=!0),pi.normal.cfg=pi.normal.conOpt=pi.emphasis.cfg=pi.emphasis.conOpt=pi.blur.cfg=pi.blur.conOpt=pi.select.cfg=pi.select.conOpt=null,pi.isLegacy=!1,Pfe(u,r,n,i,l,pi),Nfe(u,r,n,i,l),Jk(e,u,r,n,pi,i,l),ge(n,"info")&&(Eo(u).info=n.info);for(var c=0;c=0?a.replaceAt(u,o):a.add(u),u}function UH(e,t,r){var n=Eo(e),i=t.type,a=t.shape,o=t.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&Rfe(a)&&ZH(a)!==n.customPathData||i==="image"&&ge(o,"image")&&o.image!==n.customImagePath}function Nfe(e,t,r,n,i){var a=r.clipPath;if(a===!1)e&&e.getClipPath()&&e.removeClipPath();else if(a){var o=e.getClipPath();o&&UH(o,a,n)&&(o=null),o||(o=Kk(a),e.setClipPath(o)),Jk(null,o,t,a,null,n,i)}}function Pfe(e,t,r,n,i,a){if(!(e.isGroup||e.type==="compoundPath")){oO(r,null,a),oO(r,jo,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(o!=null||s!=null||u!=null||l!=null){var c=e.getTextContent();if(o===!1)c&&e.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},c?c.clearStates():(c=Kk(o),e.setTextContent(c)),Jk(null,c,t,o,null,n,i);for(var h=o&&o.style,f=0;f=c;d--){var g=t.childAt(d);Dfe(t,g,i)}}}function Dfe(e,t,r){t&&F_(t,Eo(e).option,r)}function Efe(e){new Zo(e.oldChildren,e.newChildren,sO,sO,e).add(lO).update(lO).remove(jfe).execute()}function sO(e,t){var r=e&&e.name;return r??Sfe+t}function lO(e,t){var r=this.context,n=e!=null?r.newChildren[e]:null,i=t!=null?r.oldChildren[t]:null;Qk(r.api,i,r.dataIndex,n,r.seriesModel,r.group)}function jfe(e){var t=this.context,r=t.oldChildren[e];r&&F_(r,Eo(r).option,t.seriesModel)}function ZH(e){return e&&(e.pathData||e.d)}function Rfe(e){return e&&(ge(e,"pathData")||ge(e,"d"))}function Ofe(e){e.registerChartView(Mfe),e.registerSeriesModel(tfe)}var iu=Ye(),uO=Se,Xw=fe,tL=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(t,r,n,i){var a=r.get("value"),o=r.get("status");if(this._axisModel=t,this._axisPointerModel=r,this._api=n,!(!i&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,t,r,n);var c=u.graphicKey;c!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=c;var h=this._moveAnimation=this.determineAnimation(t,r);if(!s)s=this._group=new Ce,this.createPointerEl(s,u,t,r),this.createLabelEl(s,u,t,r),n.getZr().add(s);else{var f=Fe(cO,r,h);this.updatePointerEl(s,u,f),this.updateLabelEl(s,u,f,r)}fO(s,r,!0),this._renderHandle(a)}},e.prototype.remove=function(t){this.clear(t)},e.prototype.dispose=function(t){this.clear(t)},e.prototype.determineAnimation=function(t,r){var n=r.get("animation"),i=t.axis,a=i.type==="category",o=r.get("snap");if(!o&&!a)return!1;if(n==="auto"||n==null){var s=this.animationThreshold;if(a&&i.getBandWidth()>s)return!0;if(o){var l=wk(t).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return n===!0},e.prototype.makeElOption=function(t,r,n,i,a){},e.prototype.createPointerEl=function(t,r,n,i){var a=r.pointer;if(a){var o=iu(t).pointerEl=new Ku[a.type](uO(r.pointer));t.add(o)}},e.prototype.createLabelEl=function(t,r,n,i){if(r.label){var a=iu(t).labelEl=new tt(uO(r.label));t.add(a),hO(a,i)}},e.prototype.updatePointerEl=function(t,r,n){var i=iu(t).pointerEl;i&&r.pointer&&(i.setStyle(r.pointer.style),n(i,{shape:r.pointer.shape}))},e.prototype.updateLabelEl=function(t,r,n,i){var a=iu(t).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),hO(a,i))},e.prototype._renderHandle=function(t){if(!(this._dragging||!this.updateHandleTransform)){var r=this._axisPointerModel,n=this._api.getZr(),i=this._handle,a=r.getModel("handle"),o=r.get("status");if(!a.get("show")||!o||o==="hide"){i&&n.remove(i),this._handle=null;return}var s;this._handle||(s=!0,i=this._handle=df(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Wo(u.event)},onmousedown:Xw(this._onHandleDragMove,this,0,0),drift:Xw(this._onHandleDragMove,this),ondragend:Xw(this._onHandleDragEnd,this)}),n.add(i)),fO(i,r,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");re(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,xf(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},e.prototype._moveHandleToValue=function(t,r){cO(this._axisPointerModel,!r&&this._moveAnimation,this._handle,qw(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(t,r){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(qw(n),[t,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(qw(i)),iu(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){var t=this._handle;if(t){var r=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:r.cursorPoint[0],y:r.cursorPoint[1],tooltipOption:r.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){this._dragging=!1;var t=this._handle;if(t){var r=this._axisPointerModel.get("value");this._moveHandleToValue(r),this._api.dispatchAction({type:"hideTip"})}},e.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var r=t.getZr(),n=this._group,i=this._handle;r&&n&&(this._lastGraphicKey=null,n&&r.remove(n),i&&r.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),lp(this,"_doDispatchAxisPointer")},e.prototype.doClear=function(){},e.prototype.buildLabel=function(t,r,n){return n=n||0,{x:t[n],y:t[1-n],width:r[n],height:r[1-n]}},e}();function cO(e,t,r,n){$H(iu(r).lastProp,n)||(iu(r).lastProp=n,t?it(r,n,e):(r.stopAnimation(),r.attr(n)))}function $H(e,t){if(ke(e)&&ke(t)){var r=!0;return j(t,function(n,i){r=r&&$H(e[i],n)}),!!r}else return e===t}function hO(e,t){e[t.get(["label","show"])?"show":"hide"]()}function qw(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function fO(e,t,r){var n=t.get("z"),i=t.get("zlevel");e&&e.traverse(function(a){a.type!=="group"&&(n!=null&&(a.z=n),i!=null&&(a.zlevel=i),a.silent=r)})}function rL(e){var t=e.get("type"),r=e.getModel(t+"Style"),n;return t==="line"?(n=r.getLineStyle(),n.fill=null):t==="shadow"&&(n=r.getAreaStyle(),n.stroke=null),n}function YH(e,t,r,n,i){var a=r.get("value"),o=XH(a,t.axis,t.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=gf(s.get("padding")||0),u=s.getFont(),c=c_(o,u),h=i.position,f=c.width+l[1]+l[3],d=c.height+l[0]+l[2],g=i.align;g==="right"&&(h[0]-=f),g==="center"&&(h[0]-=f/2);var m=i.verticalAlign;m==="bottom"&&(h[1]-=d),m==="middle"&&(h[1]-=d/2),zfe(h,f,d,n);var y=s.get("backgroundColor");(!y||y==="auto")&&(y=t.get(["axisLine","lineStyle","color"])),e.label={x:h[0],y:h[1],style:Ct(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:y}),z2:10}}function zfe(e,t,r,n){var i=n.getWidth(),a=n.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+r,a)-r,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function XH(e,t,r,n,i){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:i.precision}),o=i.formatter;if(o){var s={value:q0(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};j(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,h=u&&u.getDataParams(c);h&&s.seriesData.push(h)}),he(o)?a=o.replace("{value}",a):we(o)&&(a=o(s))}return a}function nL(e,t,r){var n=Pr();return Ko(n,n,r.rotation),ha(n,n,r.position),sa([e.dataToCoord(t),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function qH(e,t,r,n,i,a){var o=wn.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),YH(t,n,i,a,{position:nL(n.axis,e,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function iL(e,t,r){return r=r||0,{x1:e[r],y1:e[1-r],x2:t[r],y2:t[1-r]}}function KH(e,t,r){return r=r||0,{x:e[r],y:e[1-r],width:t[r],height:t[1-r]}}function dO(e,t,r,n,i,a){return{cx:e,cy:t,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}var Bfe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis,l=s.grid,u=a.get("type"),c=vO(l,s).getOtherAxis(s).getGlobalExtent(),h=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var f=rL(a),d=Ffe[u](s,h,c);d.style=f,r.graphicKey=d.type,r.pointer=d}var g=ox(l.getRect(),i);qH(n,r,g,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=ox(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=nL(n.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(r,n,i,a){var o=i.axis,s=o.grid,l=o.getGlobalExtent(!0),u=vO(s,o).getOtherAxis(o).getGlobalExtent(),c=o.dim==="x"?0:1,h=[r.x,r.y];h[c]+=n[c],h[c]=Math.min(l[1],h[c]),h[c]=Math.max(l[0],h[c]);var f=(u[1]+u[0])/2,d=[f,f];d[c]=h[c];var g=[{verticalAlign:"middle"},{align:"center"}];return{x:h[0],y:h[1],rotation:r.rotation,cursorPoint:d,tooltipOption:g[c]}},t}(tL);function vO(e,t){var r={};return r[t.dim+"AxisIndex"]=t.index,e.getCartesian(r)}var Ffe={line:function(e,t,r){var n=iL([t,r[0]],[t,r[1]],pO(e));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(e,t,r){var n=Math.max(1,e.getBandWidth()),i=r[1]-r[0];return{type:"Rect",shape:KH([t-n/2,r[0]],[n,i],pO(e))}}};function pO(e){return e.dim==="x"?0:1}var Vfe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:K.color.border,width:1,type:"dashed"},shadowStyle:{color:K.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:K.color.neutral00,padding:[5,7,5,7],backgroundColor:K.color.accent60,borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:K.color.accent40,throttle:40}},t}($e),Lo=Ye(),Gfe=j;function JH(e,t,r){if(!Je.node){var n=t.getZr();Lo(n).records||(Lo(n).records={}),Wfe(n,t);var i=Lo(n).records[e]||(Lo(n).records[e]={});i.handler=r}}function Wfe(e,t){if(Lo(e).initialized)return;Lo(e).initialized=!0,r("click",Fe(gO,"click")),r("mousemove",Fe(gO,"mousemove")),r("globalout",Ufe);function r(n,i){e.on(n,function(a){var o=Zfe(t);Gfe(Lo(e).records,function(s){s&&i(s,a,o.dispatchAction)}),Hfe(o.pendings,t)})}}function Hfe(e,t){var r=e.showTip.length,n=e.hideTip.length,i;r?i=e.showTip[r-1]:n&&(i=e.hideTip[n-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}function Ufe(e,t,r){e.handler("leave",null,r)}function gO(e,t,r,n){t.handler(e,r,n)}function Zfe(e){var t={showTip:[],hideTip:[]},r=function(n){var i=t[n.type];i?i.push(n):(n.dispatchAction=r,e.dispatchAction(n))};return{dispatchAction:r,pendings:t}}function h2(e,t){if(!Je.node){var r=t.getZr(),n=(Lo(r).records||{})[e];n&&(Lo(r).records[e]=null)}}var $fe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=n.getComponent("tooltip"),o=r.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";JH("axisPointer",i,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},t.prototype.remove=function(r,n){h2("axisPointer",n)},t.prototype.dispose=function(r,n){h2("axisPointer",n)},t.type="axisPointer",t}(Mt);function QH(e,t){var r=[],n=e.seriesIndex,i;if(n==null||!(i=t.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=Ru(a,e);if(o==null||o<0||re(o))return{point:[]};var s=a.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)r=i.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(e.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u),h=c.dim,f=u.dim,d=h==="x"||h==="radius"?1:0,g=a.mapDimension(f),m=[];m[d]=a.get(g,o),m[1-d]=a.get(a.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(m)||[]}else r=l.dataToPoint(a.getValues(ae(l.dimensions,function(x){return a.mapDimension(x)}),o))||[];else if(s){var y=s.getBoundingRect().clone();y.applyTransform(s.transform),r=[y.x+y.width/2,y.y+y.height/2]}return{point:r,el:s}}var mO=Ye();function Yfe(e,t,r){var n=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||fe(r.dispatchAction,r),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){Fy(i)&&(i=QH({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=Fy(i),u=a.axesInfo,c=s.axesInfo,h=n==="leave"||Fy(i),f={},d={},g={list:[],map:{}},m={showPointer:Fe(qfe,d),showTooltip:Fe(Kfe,g)};j(s.coordSysMap,function(x,_){var w=l||x.containPoint(i);j(s.coordSysAxesInfo[_],function(S,T){var M=S.axis,A=tde(u,S);if(!h&&w&&(!u||A)){var P=A&&A.value;P==null&&!l&&(P=M.pointToData(i)),P!=null&&yO(S,P,m,!1,f)}})});var y={};return j(c,function(x,_){var w=x.linkGroup;w&&!d[_]&&j(w.axesInfo,function(S,T){var M=d[T];if(S!==x&&M){var A=M.value;w.mapper&&(A=x.axis.scale.parse(w.mapper(A,xO(S),xO(x)))),y[x.key]=A}})}),j(y,function(x,_){yO(c[_],x,m,!0,f)}),Jfe(d,c,f),Qfe(g,i,e,o),ede(c,o,r),f}}function yO(e,t,r,n,i){var a=e.axis;if(!(a.scale.isBlank()||!a.containData(t))){if(!e.involveSeries){r.showPointer(e,t);return}var o=Xfe(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&Q(i,s[0]),!n&&e.snap&&a.containData(l)&&l!=null&&(t=l),r.showPointer(e,t,s),r.showTooltip(e,o,l)}}function Xfe(e,t){var r=t.axis,n=r.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return j(t.seriesModels,function(l,u){var c=l.getData().mapDimensionsAll(n),h,f;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(c,e,r);f=d.dataIndices,h=d.nestestValue}else{if(f=l.indicesOfNearest(n,c[0],e,r.type==="category"?.5:null),!f.length)return;h=l.getData().get(c[0],f[0])}if(!(h==null||!isFinite(h))){var g=e-h,m=Math.abs(g);m<=o&&((m=0&&s<0)&&(o=m,s=g,i=h,a.length=0),j(f,function(y){a.push({seriesIndex:l.seriesIndex,dataIndexInside:y,dataIndex:l.getData().getRawIndex(y)})}))}}),{payloadBatch:a,snapToValue:i}}function qfe(e,t,r,n){e[t.key]={value:r,payloadBatch:n}}function Kfe(e,t,r,n){var i=r.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(!(!t.triggerTooltip||!i.length)){var l=t.coordSys.model,u=mp(l),c=e.map[u];c||(c=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(c)),c.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function Jfe(e,t,r){var n=r.axesInfo=[];j(t,function(i,a){var o=i.axisPointerModel.option,s=e[a];s?(!i.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!i.useHandle&&(o.status="hide"),o.status==="show"&&n.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:o.value})})}function Qfe(e,t,r,n){if(Fy(t)||!e.list.length){n({type:"hideTip"});return}var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:r.tooltipOption,position:r.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}function ede(e,t,r){var n=r.getZr(),i="axisPointerLastHighlights",a=mO(n)[i]||{},o=mO(n)[i]={};j(e,function(u,c){var h=u.axisPointerModel.option;h.status==="show"&&u.triggerEmphasis&&j(h.seriesDataIndices,function(f){var d=f.seriesIndex+" | "+f.dataIndex;o[d]=f})});var s=[],l=[];j(a,function(u,c){!o[c]&&l.push(u)}),j(o,function(u,c){!a[c]&&s.push(u)}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function tde(e,t){for(var r=0;r<(e||[]).length;r++){var n=e[r];if(t.axis.dim===n.axisDim&&t.axis.model.componentIndex===n.axisIndex)return n}}function xO(e){var t=e.axis.model,r={},n=r.axisDim=e.axis.dim;return r.axisIndex=r[n+"AxisIndex"]=t.componentIndex,r.axisName=r[n+"AxisName"]=t.name,r.axisId=r[n+"AxisId"]=t.id,r}function Fy(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function tg(e){tc.registerAxisPointerClass("CartesianAxisPointer",Bfe),e.registerComponentModel(Vfe),e.registerComponentView($fe),e.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var r=t.axisPointer.link;r&&!re(r)&&(t.axisPointer.link=[r])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,function(t,r){t.getComponent("axisPointer").coordSysAxesInfo=roe(t,r)}),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},Yfe)}function rde(e){He(SW),He(tg)}var nde=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis;s.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=s.polar,u=l.getOtherAxis(s),c=u.getExtent(),h=s.dataToCoord(n),f=a.get("type");if(f&&f!=="none"){var d=rL(a),g=ade[f](s,l,h,c);g.style=d,r.graphicKey=g.type,r.pointer=g}var m=a.get(["label","margin"]),y=ide(n,i,a,l,m);YH(r,i,a,o,y)},t}(tL);function ide(e,t,r,n,i){var a=t.axis,o=a.dataToCoord(e),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l=n.getRadiusAxis().getExtent(),u,c,h;if(a.dim==="radius"){var f=Pr();Ko(f,f,s),ha(f,f,[n.cx,n.cy]),u=sa([o,-i],f);var d=t.getModel("axisLabel").get("rotate")||0,g=wn.innerTextLayout(s,d*Math.PI/180,-1);c=g.textAlign,h=g.textVerticalAlign}else{var m=l[1];u=n.coordToPoint([m+i,o]);var y=n.cx,x=n.cy;c=Math.abs(u[0]-y)/m<.3?"center":u[0]>y?"left":"right",h=Math.abs(u[1]-x)/m<.3?"middle":u[1]>x?"top":"bottom"}return{position:u,align:c,verticalAlign:h}}var ade={line:function(e,t,r,n){return e.dim==="angle"?{type:"Line",shape:iL(t.coordToPoint([n[0],r]),t.coordToPoint([n[1],r]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r}}},shadow:function(e,t,r,n){var i=Math.max(1,e.getBandWidth()),a=Math.PI/180;return e.dim==="angle"?{type:"Sector",shape:dO(t.cx,t.cy,n[0],n[1],(-r-i/2)*a,(-r+i/2)*a)}:{type:"Sector",shape:dO(t.cx,t.cy,r-i/2,r+i/2,0,Math.PI*2)}}},ode=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.findAxisModel=function(r){var n,i=this.ecModel;return i.eachComponent(r,function(a){a.getCoordSysModel()===this&&(n=a)},this),n},t.type="polar",t.dependencies=["radiusAxis","angleAxis"],t.defaultOption={z:0,center:["50%","50%"],radius:"80%"},t}($e),aL=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",Ht).models[0]},t.type="polarAxis",t}($e);Qt(aL,Sf);var sde=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="angleAxis",t}(aL),lde=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="radiusAxis",t}(aL),oL=function(e){q(t,e);function t(r,n){return e.call(this,"radius",r,n)||this}return t.prototype.pointToData=function(r,n){return this.polar.pointToData(r,n)[this.dim==="radius"?0:1]},t}(Vi);oL.prototype.dataToRadius=Vi.prototype.dataToCoord;oL.prototype.radiusToData=Vi.prototype.coordToData;var ude=Ye(),sL=function(e){q(t,e);function t(r,n){return e.call(this,"angle",r,n||[0,360])||this}return t.prototype.pointToData=function(r,n){return this.polar.pointToData(r,n)[this.dim==="radius"?0:1]},t.prototype.calculateCategoryInterval=function(){var r=this,n=r.getLabelModel(),i=r.scale,a=i.getExtent(),o=i.count();if(a[1]-a[0]<1)return 0;var s=a[0],l=r.dataToCoord(s+1)-r.dataToCoord(s),u=Math.abs(l),c=c_(s==null?"":s+"",n.getFont(),"center","top"),h=Math.max(c.height,7),f=h/u;isNaN(f)&&(f=1/0);var d=Math.max(0,Math.floor(f)),g=ude(r.model),m=g.lastAutoInterval,y=g.lastTickCount;return m!=null&&y!=null&&Math.abs(m-d)<=1&&Math.abs(y-o)<=1&&m>d?d=m:(g.lastTickCount=o,g.lastAutoInterval=d),d},t}(Vi);sL.prototype.dataToAngle=Vi.prototype.dataToCoord;sL.prototype.angleToData=Vi.prototype.coordToData;var e8=["radius","angle"],cde=function(){function e(t){this.dimensions=e8,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new oL,this._angleAxis=new sL,this.axisPointerEnabled=!0,this.name=t||"",this._radiusAxis.polar=this._angleAxis.polar=this}return e.prototype.containPoint=function(t){var r=this.pointToCoord(t);return this._radiusAxis.contain(r[0])&&this._angleAxis.contain(r[1])},e.prototype.containData=function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},e.prototype.getAxis=function(t){var r="_"+t+"Axis";return this[r]},e.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},e.prototype.getAxesByScale=function(t){var r=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===t&&r.push(n),i.scale.type===t&&r.push(i),r},e.prototype.getAngleAxis=function(){return this._angleAxis},e.prototype.getRadiusAxis=function(){return this._radiusAxis},e.prototype.getOtherAxis=function(t){var r=this._angleAxis;return t===r?this._radiusAxis:r},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},e.prototype.getTooltipAxes=function(t){var r=t!=null&&t!=="auto"?this.getAxis(t):this.getBaseAxis();return{baseAxes:[r],otherAxes:[this.getOtherAxis(r)]}},e.prototype.dataToPoint=function(t,r,n){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],r),this._angleAxis.dataToAngle(t[1],r)],n)},e.prototype.pointToData=function(t,r,n){n=n||[];var i=this.pointToCoord(t);return n[0]=this._radiusAxis.radiusToData(i[0],r),n[1]=this._angleAxis.angleToData(i[1],r),n},e.prototype.pointToCoord=function(t){var r=t[0]-this.cx,n=t[1]-this.cy,i=this.getAngleAxis(),a=i.getExtent(),o=Math.min(a[0],a[1]),s=Math.max(a[0],a[1]);i.inverse?o=s-360:s=o+360;var l=Math.sqrt(r*r+n*n);r/=l,n/=l;for(var u=Math.atan2(-n,r)/Math.PI*180,c=us;)u+=c*360;return[l,u]},e.prototype.coordToPoint=function(t,r){r=r||[];var n=t[0],i=t[1]/180*Math.PI;return r[0]=Math.cos(i)*n+this.cx,r[1]=-Math.sin(i)*n+this.cy,r},e.prototype.getArea=function(){var t=this.getAngleAxis(),r=this.getRadiusAxis(),n=r.getExtent().slice();n[0]>n[1]&&n.reverse();var i=t.getExtent(),a=Math.PI/180,o=1e-4;return{cx:this.cx,cy:this.cy,r0:n[0],r:n[1],startAngle:-i[0]*a,endAngle:-i[1]*a,clockwise:t.inverse,contain:function(s,l){var u=s-this.cx,c=l-this.cy,h=u*u+c*c,f=this.r,d=this.r0;return f!==d&&h-o<=f*f&&h+o>=d*d},x:this.cx-n[1],y:this.cy-n[1],width:n[1]*2,height:n[1]*2}},e.prototype.convertToPixel=function(t,r,n){var i=_O(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=_O(r);return i===this?this.pointToData(n):null},e}();function _O(e){var t=e.seriesModel,r=e.polarModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function hde(e,t,r){var n=t.get("center"),i=Tr(t,r).refContainer;e.cx=ce(n[0],i.width)+i.x,e.cy=ce(n[1],i.height)+i.y;var a=e.getRadiusAxis(),o=Math.min(i.width,i.height)/2,s=t.get("radius");s==null?s=[0,"100%"]:re(s)||(s=[0,s]);var l=[ce(s[0],o),ce(s[1],o)];a.inverse?a.setExtent(l[1],l[0]):a.setExtent(l[0],l[1])}function fde(e,t){var r=this,n=r.getAngleAxis(),i=r.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),e.eachSeries(function(s){if(s.coordinateSystem===r){var l=s.getData();j(K0(l,"radius"),function(u){i.scale.unionExtentFromData(l,u)}),j(K0(l,"angle"),function(u){n.scale.unionExtentFromData(l,u)})}}),Gu(n.scale,n.model),Gu(i.scale,i.model),n.type==="category"&&!n.onBand){var a=n.getExtent(),o=360/n.scale.count();n.inverse?a[1]+=o:a[1]-=o,n.setExtent(a[0],a[1])}}function dde(e){return e.mainType==="angleAxis"}function bO(e,t){var r;if(e.type=t.get("type"),e.scale=Xp(t),e.onBand=t.get("boundaryGap")&&e.type==="category",e.inverse=t.get("inverse"),dde(t)){e.inverse=e.inverse!==t.get("clockwise");var n=t.get("startAngle"),i=(r=t.get("endAngle"))!==null&&r!==void 0?r:n+(e.inverse?-360:360);e.setExtent(n,i)}t.axis=e,e.model=t}var vde={dimensions:e8,create:function(e,t){var r=[];return e.eachComponent("polar",function(n,i){var a=new cde(i+"");a.update=fde;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");bO(o,l),bO(s,u),hde(a,n,t),r.push(a),n.coordinateSystem=a,a.model=n}),e.eachSeries(function(n){if(n.get("coordinateSystem")==="polar"){var i=n.getReferringComponents("polar",Ht).models[0];n.coordinateSystem=i.coordinateSystem}}),r}},pde=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function Ym(e,t,r){t[1]>t[0]&&(t=t.slice().reverse());var n=e.coordToPoint([t[0],r]),i=e.coordToPoint([t[1],r]);return{x1:n[0],y1:n[1],x2:i[0],y2:i[1]}}function Xm(e){var t=e.getRadiusAxis();return t.inverse?0:1}function wO(e){var t=e[0],r=e[e.length-1];t&&r&&Math.abs(Math.abs(t.coord-r.coord)-360)<1e-4&&e.pop()}var gde=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.axisPointerClass="PolarAxisPointer",r}return t.prototype.render=function(r,n){if(this.group.removeAll(),!!r.get("show")){var i=r.axis,a=i.polar,o=a.getRadiusAxis().getExtent(),s=i.getTicksCoords({breakTicks:"none"}),l=i.getMinorTicksCoords(),u=ae(i.getViewLabels(),function(c){c=Se(c);var h=i.scale,f=h.type==="ordinal"?h.getRawOrdinalNumber(c.tickValue):c.tickValue;return c.coord=i.dataToCoord(f),c});wO(u),wO(s),j(pde,function(c){r.get([c,"show"])&&(!i.scale.isBlank()||c==="axisLine")&&mde[c](this.group,r,a,s,l,o,u)},this)}},t.type="angleAxis",t}(tc),mde={axisLine:function(e,t,r,n,i,a){var o=t.getModel(["axisLine","lineStyle"]),s=r.getAngleAxis(),l=Math.PI/180,u=s.getExtent(),c=Xm(r),h=c?0:1,f,d=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[h]===0?f=new Ku[d]({shape:{cx:r.cx,cy:r.cy,r:a[c],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):f=new cf({shape:{cx:r.cx,cy:r.cy,r:a[c],r0:a[h]},style:o.getLineStyle(),z2:1,silent:!0}),f.style.fill=null,e.add(f)},axisTick:function(e,t,r,n,i,a){var o=t.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[Xm(r)],u=ae(n,function(c){return new ar({shape:Ym(r,[l,l+s],c.coord)})});e.add(qn(u,{style:Ae(o.getModel("lineStyle").getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])})}))},minorTick:function(e,t,r,n,i,a){if(i.length){for(var o=t.getModel("axisTick"),s=t.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[Xm(r)],c=[],h=0;hx?"left":"right",S=Math.abs(y[1]-_)/m<.3?"middle":y[1]>_?"top":"bottom";if(s&&s[g]){var T=s[g];ke(T)&&T.textStyle&&(d=new qe(T.textStyle,l,l.ecModel))}var M=new tt({silent:wn.isLabelSilent(t),style:Ct(d,{x:y[0],y:y[1],fill:d.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:h.formattedLabel,align:w,verticalAlign:S})});if(e.add(M),Qo({el:M,componentModel:t,itemName:h.formattedLabel,formatterParamsExtra:{isTruncated:function(){return M.isTruncated},value:h.rawLabel,tickIndex:f}}),c){var A=wn.makeAxisEventDataBase(t);A.targetType="axisLabel",A.value=h.rawLabel,De(M).eventData=A}},this)},splitLine:function(e,t,r,n,i,a){var o=t.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],h=0;h=0?"p":"n",H=I;T&&(n[c][R]||(n[c][R]={p:I,n:I}),H=n[c][R][F]);var W=void 0,V=void 0,z=void 0,Z=void 0;if(g.dim==="radius"){var U=g.dataToCoord(O)-I,$=l.dataToCoord(R);Math.abs(U)=Z})}}})}function Sde(e){var t={};j(e,function(n,i){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=r8(o,s),u=s.getExtent(),c=s.type==="category"?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),h=t[l]||{bandWidth:c,remainedWidth:c,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},f=h.stacks;t[l]=h;var d=t8(n);f[d]||h.autoWidthCount++,f[d]=f[d]||{width:0,maxWidth:0};var g=ce(n.get("barWidth"),c),m=ce(n.get("barMaxWidth"),c),y=n.get("barGap"),x=n.get("barCategoryGap");g&&!f[d].width&&(g=Math.min(h.remainedWidth,g),f[d].width=g,h.remainedWidth-=g),m&&(f[d].maxWidth=m),y!=null&&(h.gap=y),x!=null&&(h.categoryGap=x)});var r={};return j(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=ce(n.categoryGap,o),l=ce(n.gap,1),u=n.remainedWidth,c=n.autoWidthCount,h=(u-s)/(c+(c-1)*l);h=Math.max(h,0),j(a,function(m,y){var x=m.maxWidth;x&&x=r.y&&t[1]<=r.y+r.height:n.contain(n.toLocalCoord(t[1]))&&t[0]>=r.y&&t[0]<=r.y+r.height},e.prototype.pointToData=function(t,r,n){n=n||[];var i=this.getAxis();return n[0]=i.coordToData(i.toLocalCoord(t[i.orient==="horizontal"?0:1])),n},e.prototype.dataToPoint=function(t,r,n){var i=this.getAxis(),a=this.getRect();n=n||[];var o=i.orient==="horizontal"?0:1;return t instanceof Array&&(t=t[0]),n[o]=i.toGlobalCoord(i.dataToCoord(+t)),n[1-o]=o===0?a.y+a.height/2:a.x+a.width/2,n},e.prototype.convertToPixel=function(t,r,n){var i=SO(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=SO(r);return i===this?this.pointToData(n):null},e}();function SO(e){var t=e.seriesModel,r=e.singleAxisModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function Dde(e,t){var r=[];return e.eachComponent("singleAxis",function(n,i){var a=new Ide(n,e,t);a.name="single_"+i,a.resize(n,t),n.coordinateSystem=a,r.push(a)}),e.eachSeries(function(n){if(n.get("coordinateSystem")==="singleAxis"){var i=n.getReferringComponents("singleAxis",Ht).models[0];n.coordinateSystem=i&&i.coordinateSystem}}),r}var Ede={create:Dde,dimensions:n8},CO=["x","y"],jde=["width","height"],Rde=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis,l=s.coordinateSystem,u=Kw(l,1-gx(s)),c=l.dataToPoint(n)[0],h=a.get("type");if(h&&h!=="none"){var f=rL(a),d=Ode[h](s,c,u);d.style=f,r.graphicKey=d.type,r.pointer=d}var g=f2(i);qH(n,r,g,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=f2(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=nL(n.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(r,n,i,a){var o=i.axis,s=o.coordinateSystem,l=gx(o),u=Kw(s,l),c=[r.x,r.y];c[l]+=n[l],c[l]=Math.min(u[1],c[l]),c[l]=Math.max(u[0],c[l]);var h=Kw(s,1-l),f=(h[1]+h[0])/2,d=[f,f];return d[l]=c[l],{x:c[0],y:c[1],rotation:r.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}},t}(tL),Ode={line:function(e,t,r){var n=iL([t,r[0]],[t,r[1]],gx(e));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(e,t,r){var n=e.getBandWidth(),i=r[1]-r[0];return{type:"Rect",shape:KH([t-n/2,r[0]],[n,i],gx(e))}}};function gx(e){return e.isHorizontal()?0:1}function Kw(e,t){var r=e.getRect();return[r[CO[t]],r[CO[t]]+r[jde[t]]]}var zde=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="single",t}(Mt);function Bde(e){He(tg),tc.registerAxisPointerClass("SingleAxisPointer",Rde),e.registerComponentView(zde),e.registerComponentView(Lde),e.registerComponentModel(Vy),Zh(e,"single",Vy,Vy.defaultOption),e.registerCoordinateSystem("single",Ede)}var Fde=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n,i){var a=Ju(r);e.prototype.init.apply(this,arguments),TO(r,a)},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),TO(this.option,r)},t.prototype.getCellSize=function(){return this.option.cellSize},t.type="calendar",t.layoutMode="box",t.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:K.color.axisLine,width:1,type:"solid"}},itemStyle:{color:K.color.neutral00,borderWidth:1,borderColor:K.color.neutral10},dayLabel:{show:!0,firstDay:0,position:"start",margin:K.size.s,color:K.color.secondary},monthLabel:{show:!0,position:"start",margin:K.size.s,align:"center",formatter:null,color:K.color.secondary},yearLabel:{show:!0,position:null,margin:K.size.xl,formatter:null,color:K.color.quaternary,fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},t}($e);function TO(e,t){var r=e.cellSize,n;re(r)?n=r:n=e.cellSize=[r,r],n.length===1&&(n[1]=n[0]);var i=ae([0,1],function(a){return lQ(t,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});Ka(e,t,{type:"box",ignoreSize:i})}var Vde=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=this.group;a.removeAll();var o=r.coordinateSystem,s=o.getRangeInfo(),l=o.getOrient(),u=n.getLocaleModel();this._renderDayRect(r,s,a),this._renderLines(r,s,l,a),this._renderYearText(r,s,l,a),this._renderMonthText(r,u,l,a),this._renderWeekText(r,u,s,l,a)},t.prototype._renderDayRect=function(r,n,i){for(var a=r.coordinateSystem,o=r.getModel("itemStyle").getItemStyle(),s=a.getCellWidth(),l=a.getCellHeight(),u=n.start.time;u<=n.end.time;u=a.getNextNDay(u,1).time){var c=a.dataToCalendarLayout([u],!1).tl,h=new Ze({shape:{x:c[0],y:c[1],width:s,height:l},cursor:"default",style:o});i.add(h)}},t.prototype._renderLines=function(r,n,i,a){var o=this,s=r.coordinateSystem,l=r.getModel(["splitLine","lineStyle"]).getLineStyle(),u=r.get(["splitLine","show"]),c=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var h=n.start,f=0;h.time<=n.end.time;f++){g(h.formatedDate),f===0&&(h=s.getDateInfo(n.start.y+"-"+n.start.m));var d=h.date;d.setMonth(d.getMonth()+1),h=s.getDateInfo(d)}g(s.getNextNDay(n.end.time,1).formatedDate);function g(m){o._firstDayOfMonth.push(s.getDateInfo(m)),o._firstDayPoints.push(s.dataToCalendarLayout([m],!1).tl);var y=o._getLinePointsOfOneWeek(r,m,i);o._tlpoints.push(y[0]),o._blpoints.push(y[y.length-1]),u&&o._drawSplitline(y,l,a)}u&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,c,i),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,c,i),l,a)},t.prototype._getEdgesPoints=function(r,n,i){var a=[r[0].slice(),r[r.length-1].slice()],o=i==="horizontal"?0:1;return a[0][o]=a[0][o]-n/2,a[1][o]=a[1][o]+n/2,a},t.prototype._drawSplitline=function(r,n,i){var a=new Gr({z2:20,shape:{points:r},style:n});i.add(a)},t.prototype._getLinePointsOfOneWeek=function(r,n,i){for(var a=r.coordinateSystem,o=a.getDateInfo(n),s=[],l=0;l<7;l++){var u=a.getNextNDay(o.time,l),c=a.dataToCalendarLayout([u.time],!1);s[2*u.day]=c.tl,s[2*u.day+1]=c[i==="horizontal"?"bl":"tr"]}return s},t.prototype._formatterLabel=function(r,n){return he(r)&&r?tQ(r,n):we(r)?r(n):n.nameMap},t.prototype._yearTextPositionControl=function(r,n,i,a,o){var s=n[0],l=n[1],u=["center","bottom"];a==="bottom"?(l+=o,u=["center","top"]):a==="left"?s-=o:a==="right"?(s+=o,u=["center","top"]):l-=o;var c=0;return(a==="left"||a==="right")&&(c=Math.PI/2),{rotation:c,x:s,y:l,style:{align:u[0],verticalAlign:u[1]}}},t.prototype._renderYearText=function(r,n,i,a){var o=r.getModel("yearLabel");if(o.get("show")){var s=o.get("margin"),l=o.get("position");l||(l=i!=="horizontal"?"top":"left");var u=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],c=(u[0][0]+u[1][0])/2,h=(u[0][1]+u[1][1])/2,f=i==="horizontal"?0:1,d={top:[c,u[f][1]],bottom:[c,u[1-f][1]],left:[u[1-f][0],h],right:[u[f][0],h]},g=n.start.y;+n.end.y>+n.start.y&&(g=g+"-"+n.end.y);var m=o.get("formatter"),y={start:n.start.y,end:n.end.y,nameMap:g},x=this._formatterLabel(m,y),_=new tt({z2:30,style:Ct(o,{text:x}),silent:o.get("silent")});_.attr(this._yearTextPositionControl(_,d[l],i,l,s)),a.add(_)}},t.prototype._monthTextPositionControl=function(r,n,i,a,o){var s="left",l="top",u=r[0],c=r[1];return i==="horizontal"?(c=c+o,n&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,n&&(l="middle"),a==="start"&&(s="right")),{x:u,y:c,align:s,verticalAlign:l}},t.prototype._renderMonthText=function(r,n,i,a){var o=r.getModel("monthLabel");if(o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),u=o.get("position"),c=o.get("align"),h=[this._tlpoints,this._blpoints];(!s||he(s))&&(s&&(n=sT(s)||n),s=n.get(["time","monthAbbr"])||[]);var f=u==="start"?0:1,d=i==="horizontal"?0:1;l=u==="start"?-l:l;for(var g=c==="center",m=o.get("silent"),y=0;y=a.start.time&&i.times.end.time&&r.reverse(),r},e.prototype._getRangeInfo=function(t){var r=[this.getDateInfo(t[0]),this.getDateInfo(t[1])],n;r[0].time>r[1].time&&(n=!0,r.reverse());var i=Math.floor(r[1].time/Jw)-Math.floor(r[0].time/Jw)+1,a=new Date(r[0].time),o=a.getDate(),s=r[1].date.getDate();a.setDate(o+i-1);var l=a.getDate();if(l!==s)for(var u=a.getTime()-r[1].time>0?1:-1;(l=a.getDate())!==s&&(a.getTime()-r[1].time)*u>0;)i-=u,a.setDate(l-u);var c=Math.floor((i+r[0].day+6)/7),h=n?-c+1:c-1;return n&&r.reverse(),{range:[r[0].formatedDate,r[1].formatedDate],start:r[0],end:r[1],allDay:i,weeks:c,nthWeek:h,fweek:r[0].day,lweek:r[1].day}},e.prototype._getDateByWeeksAndDay=function(t,r,n){var i=this._getRangeInfo(n);if(t>i.weeks||t===0&&ri.lweek)return null;var a=(t-1)*7-i.fweek+r,o=new Date(i.start.time);return o.setDate(+i.start.d+a),this.getDateInfo(o)},e.create=function(t,r){var n=[];return t.eachComponent("calendar",function(i){var a=new e(i,t,r);n.push(a),i.coordinateSystem=a}),t.eachComponent(function(i,a){$p({targetModel:a,coordSysType:"calendar",coordSysProvider:w6})}),n},e.dimensions=["time","value"],e}();function Qw(e){var t=e.calendarModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}function Wde(e){e.registerComponentModel(Fde),e.registerComponentView(Vde),e.registerCoordinateSystem("calendar",Gde)}var wo={level:1,leaf:2,nonLeaf:3},Ro={none:0,all:1,body:2,corner:3};function d2(e,t,r){var n=t[Oe[r]].getCell(e);return!n&&rt(e)&&e<0&&(n=t[Oe[1-r]].getUnitLayoutInfo(r,Math.round(e))),n}function i8(e){var t=e||[];return t[0]=t[0]||[],t[1]=t[1]||[],t[0][0]=t[0][1]=t[1][0]=t[1][1]=NaN,t}function a8(e,t,r,n,i){MO(e[0],t,i,r,n,0),MO(e[1],t,i,r,n,1)}function MO(e,t,r,n,i,a){e[0]=1/0,e[1]=-1/0;var o=n[a],s=re(o)?o:[o],l=s.length,u=!!r;if(l>=1?(AO(e,t,s,u,i,a,0),l>1&&AO(e,t,s,u,i,a,l-1)):e[0]=e[1]=NaN,u){var c=-i[Oe[1-a]].getLocatorCount(a),h=i[Oe[a]].getLocatorCount(a)-1;r===Ro.body?c=nr(0,c):r===Ro.corner&&(h=ni(-1,h)),h=t[0]&&e[0]<=t[1]}function NO(e,t){e.id.set(t[0][0],t[1][0]),e.span.set(t[0][1]-e.id.x+1,t[1][1]-e.id.y+1)}function Zde(e,t){e[0][0]=t[0][0],e[0][1]=t[0][1],e[1][0]=t[1][0],e[1][1]=t[1][1]}function PO(e,t,r,n){var i=d2(t[n][0],r,n),a=d2(t[n][1],r,n);e[Oe[n]]=e[pr[n]]=NaN,i&&a&&(e[Oe[n]]=i.xy,e[pr[n]]=a.xy+a.wh-i.xy)}function Nd(e,t,r,n){return e[Oe[t]]=r,e[Oe[1-t]]=n,e}function $de(e){return e&&(e.type===wo.leaf||e.type===wo.nonLeaf)?e:null}function mx(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var IO=function(){function e(t,r){this._cells=[],this._levels=[],this.dim=t,this.dimIdx=t==="x"?0:1,this._model=r,this._uniqueValueGen=Yde(t);var n=r.get("data",!0);n!=null&&!re(n)&&(n=[]),n?this._initByDimModelData(n):this._initBySeriesData()}return e.prototype._initByDimModelData=function(t){var r=this,n=r._cells,i=r._levels,a=[],o=0;r._leavesCount=s(t,0,0),l();return;function s(u,c,h){var f=0;return u&&j(u,function(d,g){var m;he(d)?m={value:d}:ke(d)?(m=d,d.value!=null&&!he(d.value)&&(m={value:null})):m={value:null};var y={type:wo.nonLeaf,ordinal:NaN,level:h,firstLeafLocator:c,id:new Ne,span:Nd(new Ne,r.dimIdx,1,1),option:m,xy:NaN,wh:NaN,dim:r,rect:mx()};o++,(a[c]||(a[c]=[])).push(y),i[h]||(i[h]={type:wo.level,xy:NaN,wh:NaN,option:null,id:new Ne,dim:r});var x=s(m.children,c,h+1),_=Math.max(1,x);y.span[Oe[r.dimIdx]]=_,f+=_,c+=_}),f}function l(){for(var u=[];n.length=1,w=r[Oe[n]],S=a.getLocatorCount(n)-1,T=new Ws;for(o.resetLayoutIterator(T,n);T.next();)M(T.item);for(a.resetLayoutIterator(T,n);T.next();)M(T.item);function M(A){Xr(A.wh)&&(A.wh=x),A.xy=w,A.id[Oe[n]]===S&&!_&&(A.wh=r[Oe[n]]+r[pr[n]]-A.xy),w+=A.wh}}function BO(e,t){for(var r=t[Oe[e]].resetCellIterator();r.next();){var n=r.item;yx(n.rect,e,n.id,n.span,t),yx(n.rect,1-e,n.id,n.span,t),n.type===wo.nonLeaf&&(n.xy=n.rect[Oe[e]],n.wh=n.rect[pr[e]])}}function FO(e,t){e.travelExistingCells(function(r){var n=r.span;if(n){var i=r.spanRect,a=r.id;yx(i,0,a,n,t),yx(i,1,a,n,t)}})}function yx(e,t,r,n,i){e[pr[t]]=0;var a=r[Oe[t]],o=a<0?i[Oe[1-t]]:i[Oe[t]],s=o.getUnitLayoutInfo(t,r[Oe[t]]);if(e[Oe[t]]=s.xy,e[pr[t]]=s.wh,n[Oe[t]]>1){var l=o.getUnitLayoutInfo(t,r[Oe[t]]+n[Oe[t]]-1);e[pr[t]]=l.xy+l.wh-s.xy}}function sve(e,t,r){var n=P0(e,r[pr[t]]);return p2(n,r[pr[t]])}function p2(e,t){return Math.max(Math.min(e,be(t,1/0)),0)}function rS(e){var t=e.matrixModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}var $r={inBody:1,inCorner:2,outside:3},Ta={x:null,y:null,point:[]};function VO(e,t,r,n,i){var a=r[Oe[t]],o=r[Oe[1-t]],s=a.getUnitLayoutInfo(t,a.getLocatorCount(t)-1),l=a.getUnitLayoutInfo(t,0),u=o.getUnitLayoutInfo(t,-o.getLocatorCount(t)),c=o.shouldShow()?o.getUnitLayoutInfo(t,-1):null,h=e.point[t]=n[t];if(!l&&!c){e[Oe[t]]=$r.outside;return}if(i===Ro.body){l?(e[Oe[t]]=$r.inBody,h=ni(s.xy+s.wh,nr(l.xy,h)),e.point[t]=h):e[Oe[t]]=$r.outside;return}else if(i===Ro.corner){c?(e[Oe[t]]=$r.inCorner,h=ni(c.xy+c.wh,nr(u.xy,h)),e.point[t]=h):e[Oe[t]]=$r.outside;return}var f=l?l.xy:c?c.xy+c.wh:NaN,d=u?u.xy:f,g=s?s.xy+s.wh:f;if(hg){if(!i){e[Oe[t]]=$r.outside;return}h=g}e.point[t]=h,e[Oe[t]]=f<=h&&h<=g?$r.inBody:d<=h&&h<=f?$r.inCorner:$r.outside}function GO(e,t,r,n){var i=1-r;if(e[Oe[r]]!==$r.outside)for(n[Oe[r]].resetCellIterator(tS);tS.next();){var a=tS.item;if(HO(e.point[r],a.rect,r)&&HO(e.point[i],a.rect,i)){t[r]=a.ordinal,t[i]=a.id[Oe[i]];return}}}function WO(e,t,r,n){if(e[Oe[r]]!==$r.outside){var i=e[Oe[r]]===$r.inCorner?n[Oe[1-r]]:n[Oe[r]];for(i.resetLayoutIterator(ey,r);ey.next();)if(lve(e.point[r],ey.item)){t[r]=ey.item.id[Oe[r]];return}}}function lve(e,t){return t.xy<=e&&e<=t.xy+t.wh}function HO(e,t,r){return t[Oe[r]]<=e&&e<=t[Oe[r]]+t[pr[r]]}function uve(e){e.registerComponentModel(Jde),e.registerComponentView(nve),e.registerCoordinateSystem("matrix",ove)}function cve(e,t){var r=e.existing;if(t.id=e.keyInfo.id,!t.type&&r&&(t.type=r.type),t.parentId==null){var n=t.parentOption;n?t.parentId=n.id:r&&(t.parentId=r.parentId)}t.parentOption=null}function UO(e,t){var r;return j(t,function(n){e[n]!=null&&e[n]!=="auto"&&(r=!0)}),r}function hve(e,t,r){var n=Q({},r),i=e[t],a=r.$action||"merge";a==="merge"?i?(Ge(i,n,!0),Ka(i,n,{ignoreSize:!0}),A6(r,i),ty(r,i),ty(r,i,"shape"),ty(r,i,"style"),ty(r,i,"extra"),r.clipPath=i.clipPath):e[t]=n:a==="replace"?e[t]=n:a==="remove"&&i&&(e[t]=null)}var s8=["transition","enterFrom","leaveTo"],fve=s8.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function ty(e,t,r){if(r&&(!e[r]&&t[r]&&(e[r]={}),e=e[r],t=t[r]),!(!e||!t))for(var n=r?s8:fve,i=0;i=0;c--){var h=i[c],f=br(h.id,null),d=f!=null?o.get(f):null;if(d){var g=d.parent,x=_i(g),_=g===a?{width:s,height:l}:{width:x.width,height:x.height},w={},S=C_(d,h,_,null,{hv:h.hv,boundingMode:h.bounding},w);if(!_i(d).isNew&&S){for(var T=h.transition,M={},A=0;A=0)?M[P]=I:d[P]=I}it(d,M,r,0)}else d.attr(w)}}},t.prototype._clear=function(){var r=this,n=this._elMap;n.each(function(i){Gy(i,_i(i).option,n,r._lastGraphicModel)}),this._elMap=_e()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(Mt);function g2(e){var t=ge(ZO,e)?ZO[e]:ip(e),r=new t({});return _i(r).type=e,r}function $O(e,t,r,n){var i=g2(r);return t.add(i),n.set(e,i),_i(i).id=e,_i(i).isNew=!0,i}function Gy(e,t,r,n){var i=e&&e.parent;i&&(e.type==="group"&&e.traverse(function(a){Gy(a,t,r,n)}),F_(e,t,n),r.removeKey(_i(e).id))}function YO(e,t,r,n){e.isGroup||j([["cursor",Ri.prototype.cursor],["zlevel",n||0],["z",r||0],["z2",0]],function(i){var a=i[0];ge(t,a)?e[a]=be(t[a],i[1]):e[a]==null&&(e[a]=i[1])}),j(Qe(t),function(i){if(i.indexOf("on")===0){var a=t[i];e[i]=we(a)?a:null}}),ge(t,"draggable")&&(e.draggable=t.draggable),t.name!=null&&(e.name=t.name),t.id!=null&&(e.id=t.id)}function gve(e){return e=Q({},e),j(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(S6),function(t){delete e[t]}),e}function mve(e,t,r){var n=De(e).eventData;!e.silent&&!e.ignore&&!n&&(n=De(e).eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name}),n&&(n.info=r.info)}function yve(e){e.registerComponentModel(vve),e.registerComponentView(pve),e.registerPreprocessor(function(t){var r=t.graphic;re(r)?!r[0]||!r[0].elements?t.graphic=[{elements:r}]:t.graphic=[t.graphic[0]]:r&&!r.elements&&(t.graphic=[{elements:[r]}])})}var XO=["x","y","radius","angle","single"],xve=["cartesian2d","polar","singleAxis"];function _ve(e){var t=e.get("coordinateSystem");return Ve(xve,t)>=0}function Ps(e){return e+"Axis"}function bve(e,t){var r=_e(),n=[],i=_e();e.eachComponent({mainType:"dataZoom",query:t},function(c){i.get(c.uid)||s(c)});var a;do a=!1,e.eachComponent("dataZoom",o);while(a);function o(c){!i.get(c.uid)&&l(c)&&(s(c),a=!0)}function s(c){i.set(c.uid,!0),n.push(c),u(c)}function l(c){var h=!1;return c.eachTargetAxis(function(f,d){var g=r.get(f);g&&g[d]&&(h=!0)}),h}function u(c){c.eachTargetAxis(function(h,f){(r.get(h)||r.set(h,[]))[f]=!0})}return n}function l8(e){var t=e.ecModel,r={infoList:[],infoMap:_e()};return e.eachTargetAxis(function(n,i){var a=t.getComponent(Ps(n),i);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=r.infoMap.get(s);l||(l={model:o,axisModels:[]},r.infoList.push(l),r.infoMap.set(s,l)),l.axisModels.push(a)}}}),r}var nS=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},e}(),Sp=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._autoThrottle=!0,r._noTarget=!0,r._rangePropMode=["percent","percent"],r}return t.prototype.init=function(r,n,i){var a=qO(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},t.prototype.mergeOption=function(r){var n=qO(r);Ge(this.option,r,!0),Ge(this.settledOption,n,!0),this._doInit(n)},t.prototype._doInit=function(r){var n=this.option;this._setDefaultThrottle(r),this._updateRangeUse(r);var i=this.settledOption;j([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(n[a[0]]=i[a[0]]=null)},this),this._resetTarget()},t.prototype._resetTarget=function(){var r=this.get("orient",!0),n=this._targetAxisInfoMap=_e(),i=this._fillSpecifiedTargetAxis(n);i?this._orient=r||this._makeAutoOrientByTargetAxis():(this._orient=r||"horizontal",this._fillAutoTargetAxisByOrient(n,this._orient)),this._noTarget=!0,n.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},t.prototype._fillSpecifiedTargetAxis=function(r){var n=!1;return j(XO,function(i){var a=this.getReferringComponents(Ps(i),Bq);if(a.specified){n=!0;var o=new nS;j(a.models,function(s){o.add(s.componentIndex)}),r.set(i,o)}},this),n},t.prototype._fillAutoTargetAxisByOrient=function(r,n){var i=this.ecModel,a=!0;if(a){var o=n==="vertical"?"y":"x",s=i.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=i.findComponents({mainType:"singleAxis",filter:function(c){return c.get("orient",!0)===n}});l(s,"single")}function l(u,c){var h=u[0];if(h){var f=new nS;if(f.add(h.componentIndex),r.set(c,f),a=!1,c==="x"||c==="y"){var d=h.getReferringComponents("grid",Ht).models[0];d&&j(u,function(g){h.componentIndex!==g.componentIndex&&d===g.getReferringComponents("grid",Ht).models[0]&&f.add(g.componentIndex)})}}}a&&j(XO,function(u){if(a){var c=i.findComponents({mainType:Ps(u),filter:function(f){return f.get("type",!0)==="category"}});if(c[0]){var h=new nS;h.add(c[0].componentIndex),r.set(u,h),a=!1}}},this)},t.prototype._makeAutoOrientByTargetAxis=function(){var r;return this.eachTargetAxis(function(n){!r&&(r=n)},this),r==="y"?"vertical":"horizontal"},t.prototype._setDefaultThrottle=function(r){if(r.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var n=this.ecModel.option;this.option.throttle=n.animation&&n.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(r){var n=this._rangePropMode,i=this.get("rangeMode");j([["start","startValue"],["end","endValue"]],function(a,o){var s=r[a[0]]!=null,l=r[a[1]]!=null;s&&!l?n[o]="percent":!s&&l?n[o]="value":i?n[o]=i[o]:s&&(n[o]="percent")})},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var r;return this.eachTargetAxis(function(n,i){r==null&&(r=this.ecModel.getComponent(Ps(n),i))},this),r},t.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(i,a){j(i.indexList,function(o){r.call(n,a,o)})})},t.prototype.getAxisProxy=function(r,n){var i=this.getAxisModel(r,n);if(i)return i.__dzAxisProxy},t.prototype.getAxisModel=function(r,n){var i=this._targetAxisInfoMap.get(r);if(i&&i.indexMap[n])return this.ecModel.getComponent(Ps(r),n)},t.prototype.setRawRange=function(r){var n=this.option,i=this.settledOption;j([["start","startValue"],["end","endValue"]],function(a){(r[a[0]]!=null||r[a[1]]!=null)&&(n[a[0]]=i[a[0]]=r[a[0]],n[a[1]]=i[a[1]]=r[a[1]])},this),this._updateRangeUse(r)},t.prototype.setCalculatedRange=function(r){var n=this.option;j(["start","startValue","end","endValue"],function(i){n[i]=r[i]})},t.prototype.getPercentRange=function(){var r=this.findRepresentativeAxisProxy();if(r)return r.getDataPercentWindow()},t.prototype.getValueRange=function(r,n){if(r==null&&n==null){var i=this.findRepresentativeAxisProxy();if(i)return i.getDataValueWindow()}else return this.getAxisProxy(r,n).getDataValueWindow()},t.prototype.findRepresentativeAxisProxy=function(r){if(r)return r.__dzAxisProxy;for(var n,i=this._targetAxisInfoMap.keys(),a=0;ao[1];if(w&&!S&&!T)return!0;w&&(y=!0),S&&(g=!0),T&&(m=!0)}return y&&g&&m})}else Uc(c,function(d){if(a==="empty")l.setData(u=u.map(d,function(m){return s(m)?m:NaN}));else{var g={};g[d]=o,u.selectRange(g)}});Uc(c,function(d){u.setApproximateExtent(o,d)})}});function s(l){return l>=o[0]&&l<=o[1]}},e.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},r=this._dataZoomModel,n=this._dataExtent;Uc(["min","max"],function(i){var a=r.get(i+"Span"),o=r.get(i+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=ht(n[0]+o,n,[0,100],!0):a!=null&&(o=ht(a,[0,100],n,!0)-n[0]),t[i+"Span"]=a,t[i+"ValueSpan"]=o},this)},e.prototype._setAxisModel=function(){var t=this.getAxisModel(),r=this._percentWindow,n=this._valueWindow;if(r){var i=QM(n,[0,500]);i=Math.min(i,20);var a=t.axis.scale.rawExtentInfo;r[0]!==0&&a.setDeterminedMinMax("min",+n[0].toFixed(i)),r[1]!==100&&a.setDeterminedMinMax("max",+n[1].toFixed(i)),a.freeze()}},e}();function Tve(e,t,r){var n=[1/0,-1/0];Uc(r,function(o){Wre(n,o.getData(),t)});var i=e.getAxisModel(),a=sG(i.axis.scale,i,n).calculate();return[a.min,a.max]}var Mve={getTargetSeries:function(e){function t(i){e.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=e.getComponent(Ps(o),s);i(o,s,l,a)})})}t(function(i,a,o,s){o.__dzAxisProxy=null});var r=[];t(function(i,a,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new Cve(i,a,s,e),r.push(o.__dzAxisProxy))});var n=_e();return j(r,function(i){j(i.getTargetSeriesModels(),function(a){n.set(a.uid,a)})}),n},overallReset:function(e,t){e.eachComponent("dataZoom",function(r){r.eachTargetAxis(function(n,i){r.getAxisProxy(n,i).reset(r)}),r.eachTargetAxis(function(n,i){r.getAxisProxy(n,i).filterData(r,t)})}),e.eachComponent("dataZoom",function(r){var n=r.findRepresentativeAxisProxy();if(n){var i=n.getDataPercentWindow(),a=n.getDataValueWindow();r.setCalculatedRange({start:i[0],end:i[1],startValue:a[0],endValue:a[1]})}})}};function Ave(e){e.registerAction("dataZoom",function(t,r){var n=bve(r,t);j(n,function(i){i.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}var JO=!1;function hL(e){JO||(JO=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,Mve),Ave(e),e.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function kve(e){e.registerComponentModel(wve),e.registerComponentView(Sve),hL(e)}var Ci=function(){function e(){}return e}(),u8={};function Zc(e,t){u8[e]=t}function c8(e){return u8[e]}var Lve=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var r=this.ecModel;j(this.option.feature,function(n,i){var a=c8(i);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(r)),Ge(n,a.defaultOption))})},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:K.color.border,borderRadius:0,borderWidth:0,padding:K.size.m,itemSize:15,itemGap:K.size.s,showTitle:!0,iconStyle:{borderColor:K.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:K.color.accent50}},tooltip:{show:!1,position:"bottom"}},t}($e);function h8(e,t){var r=gf(t.get("padding")),n=t.getItemStyle(["color","opacity"]);n.fill=t.get("backgroundColor");var i=new Ze({shape:{x:e.x-r[3],y:e.y-r[0],width:e.width+r[1]+r[3],height:e.height+r[0]+r[2],r:t.get("borderRadius")},style:n,silent:!0,z2:-1});return i}var Nve=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(r,n,i,a){var o=this.group;if(o.removeAll(),!r.get("show"))return;var s=+r.get("itemSize"),l=r.get("orient")==="vertical",u=r.get("feature")||{},c=this._features||(this._features={}),h=[];j(u,function(_,w){h.push(w)}),new Zo(this._featureNames||[],h).add(f).update(f).remove(Fe(f,null)).execute(),this._featureNames=h;function f(_,w){var S=h[_],T=h[w],M=u[S],A=new qe(M,r,r.ecModel),P;if(a&&a.newTitle!=null&&a.featureName===S&&(M.title=a.newTitle),S&&!T){if(Pve(S))P={onclick:A.option.onclick,featureName:S};else{var I=c8(S);if(!I)return;P=new I}c[S]=P}else if(P=c[T],!P)return;P.uid=pf("toolbox-feature"),P.model=A,P.ecModel=n,P.api=i;var N=P instanceof Ci;if(!S&&T){N&&P.dispose&&P.dispose(n,i);return}if(!A.get("show")||N&&P.unusable){N&&P.remove&&P.remove(n,i);return}d(A,P,S),A.setIconStatus=function(D,O){var R=this.option,F=this.iconPaths;R.iconStatus=R.iconStatus||{},R.iconStatus[D]=O,F[D]&&(O==="emphasis"?Ho:Uo)(F[D])},P instanceof Ci&&P.render&&P.render(A,n,i,a)}function d(_,w,S){var T=_.getModel("iconStyle"),M=_.getModel(["emphasis","iconStyle"]),A=w instanceof Ci&&w.getIcons?w.getIcons():_.get("icon"),P=_.get("title")||{},I,N;he(A)?(I={},I[S]=A):I=A,he(P)?(N={},N[S]=P):N=P;var D=_.iconPaths={};j(I,function(O,R){var F=df(O,{},{x:-s/2,y:-s/2,width:s,height:s});F.setStyle(T.getItemStyle());var H=F.ensureState("emphasis");H.style=M.getItemStyle();var W=new tt({style:{text:N[R],align:M.get("textAlign"),borderRadius:M.get("textBorderRadius"),padding:M.get("textPadding"),fill:null,font:wA({fontStyle:M.get("textFontStyle"),fontFamily:M.get("textFontFamily"),fontSize:M.get("textFontSize"),fontWeight:M.get("textFontWeight")},n)},ignore:!0});F.setTextContent(W),Qo({el:F,componentModel:r,itemName:R,formatterParamsExtra:{title:N[R]}}),F.__title=N[R],F.on("mouseover",function(){var V=M.getItemStyle(),z=l?r.get("right")==null&&r.get("left")!=="right"?"right":"left":r.get("bottom")==null&&r.get("top")!=="bottom"?"bottom":"top";W.setStyle({fill:M.get("textFill")||V.fill||V.stroke||K.color.neutral99,backgroundColor:M.get("textBackgroundColor")}),F.setTextConfig({position:M.get("textPosition")||z}),W.ignore=!r.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){_.get(["iconStatus",R])!=="emphasis"&&i.leaveEmphasis(this),W.hide()}),(_.get(["iconStatus",R])==="emphasis"?Ho:Uo)(F),o.add(F),F.on("click",fe(w.onclick,w,n,i,R)),D[R]=F})}var g=Tr(r,i).refContainer,m=r.getBoxLayoutParams(),y=r.get("padding"),x=It(m,g,y);wu(r.get("orient"),o,r.get("itemGap"),x.width,x.height),C_(o,m,g,y),o.add(h8(o.getBoundingRect(),r)),l||o.eachChild(function(_){var w=_.__title,S=_.ensureState("emphasis"),T=S.textConfig||(S.textConfig={}),M=_.getTextContent(),A=M&&M.ensureState("emphasis");if(A&&!we(A)&&w){var P=A.style||(A.style={}),I=c_(w,tt.makeFont(P)),N=_.x+o.x,D=_.y+o.y+s,O=!1;D+I.height>i.getHeight()&&(T.position="top",O=!0);var R=O?-5-I.height:s+10;N+I.width/2>i.getWidth()?(T.position=["100%",R],P.align="right"):N-I.width/2<0&&(T.position=[0,R],P.align="left")}})},t.prototype.updateView=function(r,n,i,a){j(this._features,function(o){o instanceof Ci&&o.updateView&&o.updateView(o.model,n,i,a)})},t.prototype.remove=function(r,n){j(this._features,function(i){i instanceof Ci&&i.remove&&i.remove(r,n)}),this.group.removeAll()},t.prototype.dispose=function(r,n){j(this._features,function(i){i instanceof Ci&&i.dispose&&i.dispose(r,n)})},t.type="toolbox",t}(Mt);function Pve(e){return e.indexOf("my")===0}var Ive=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(r,n){var i=this.model,a=i.get("name")||r.get("title.0.text")||"echarts",o=n.getZr().painter.getType()==="svg",s=o?"svg":i.get("type",!0)||"png",l=n.getConnectedDataURL({type:s,backgroundColor:i.get("backgroundColor",!0)||r.get("backgroundColor")||K.color.neutral00,connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=Je.browser;if(typeof MouseEvent=="function"&&(u.newEdge||!u.ie&&!u.edge)){var c=document.createElement("a");c.download=a+"."+s,c.target="_blank",c.href=l;var h=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(h)}else if(window.navigator.msSaveOrOpenBlob||o){var f=l.split(","),d=f[0].indexOf("base64")>-1,g=o?decodeURIComponent(f[1]):f[1];d&&(g=window.atob(g));var m=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var y=g.length,x=new Uint8Array(y);y--;)x[y]=g.charCodeAt(y);var _=new Blob([x]);window.navigator.msSaveOrOpenBlob(_,m)}else{var w=document.createElement("iframe");document.body.appendChild(w);var S=w.contentWindow,T=S.document;T.open("image/svg+xml","replace"),T.write(g),T.close(),S.focus(),T.execCommand("SaveAs",!0,m),document.body.removeChild(w)}}else{var M=i.get("lang"),A='',P=window.open();P.document.write(A),P.document.title=a}},t.getDefaultOption=function(r){var n={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:r.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:K.color.neutral00,name:"",excludeComponents:["toolbox"],lang:r.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},t}(Ci),QO="__ec_magicType_stack__",Dve=[["line","bar"],["stack"]],Eve=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getIcons=function(){var r=this.model,n=r.get("icon"),i={};return j(r.get("type"),function(a){n[a]&&(i[a]=n[a])}),i},t.getDefaultOption=function(r){var n={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:r.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return n},t.prototype.onclick=function(r,n,i){var a=this.model,o=a.get(["seriesIndex",i]);if(e5[i]){var s={series:[]},l=function(h){var f=h.subType,d=h.id,g=e5[i](f,d,h,a);g&&(Ae(g,h.option),s.series.push(g));var m=h.coordinateSystem;if(m&&m.type==="cartesian2d"&&(i==="line"||i==="bar")){var y=m.getAxesByScale("ordinal")[0];if(y){var x=y.dim,_=x+"Axis",w=h.getReferringComponents(_,Ht).models[0],S=w.componentIndex;s[_]=s[_]||[];for(var T=0;T<=S;T++)s[_][S]=s[_][S]||{};s[_][S].boundaryGap=i==="bar"}}};j(Dve,function(h){Ve(h,i)>=0&&j(h,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(i,"emphasis"),r.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,c=i;i==="stack"&&(u=Ge({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",i])!=="emphasis"&&(c="tiled")),n.dispatchAction({type:"changeMagicType",currentType:c,newOption:s,newTitle:u,featureName:"magicType"})}},t}(Ci),e5={line:function(e,t,r,n){if(e==="bar")return Ge({id:t,type:"line",data:r.get("data"),stack:r.get("stack"),markPoint:r.get("markPoint"),markLine:r.get("markLine")},n.get(["option","line"])||{},!0)},bar:function(e,t,r,n){if(e==="line")return Ge({id:t,type:"bar",data:r.get("data"),stack:r.get("stack"),markPoint:r.get("markPoint"),markLine:r.get("markLine")},n.get(["option","bar"])||{},!0)},stack:function(e,t,r,n){var i=r.get("stack")===QO;if(e==="line"||e==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),Ge({id:t,stack:i?"":QO},n.get(["option","stack"])||{},!0)}};pa({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)});var V_=new Array(60).join("-"),qh=" ";function jve(e){var t={},r=[],n=[];return e.eachRawSeries(function(i){var a=i.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=o.dim+"_"+o.index;t[s]||(t[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},n.push({axisDim:o.dim,axisIndex:o.index})),t[s].series.push(i)}else r.push(i)}else r.push(i)}),{seriesGroupByCategoryAxis:t,other:r,meta:n}}function Rve(e){var t=[];return j(e,function(r,n){var i=r.categoryAxis,a=r.valueAxis,o=a.dim,s=[" "].concat(ae(r.series,function(d){return d.name})),l=[i.model.getCategories()];j(r.series,function(d){var g=d.getRawData();l.push(d.getRawData().mapArray(g.mapDimension(o),function(m){return m}))});for(var u=[s.join(qh)],c=0;c=0)return!0}var m2=new RegExp("["+qh+"]+","g");function Fve(e){for(var t=e.split(/\n+/g),r=xx(t.shift()).split(m2),n=[],i=ae(r,function(l){return{name:l,data:[]}}),a=0;a=0;a--){var o=r[a];if(o[i])break}if(a<0){var s=e.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(s){var l=s.getPercentRange();r[0][i]={dataZoomId:i,start:l[0],end:l[1]}}}}),r.push(t)}function Zve(e){var t=fL(e),r=t[t.length-1];t.length>1&&t.pop();var n={};return f8(r,function(i,a){for(var o=t.length-1;o>=0;o--)if(i=t[o][a],i){n[a]=i;break}}),n}function $ve(e){d8(e).snapshots=null}function Yve(e){return fL(e).length}function fL(e){var t=d8(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var Xve=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(r,n){$ve(r),n.dispatchAction({type:"restore",from:this.uid})},t.getDefaultOption=function(r){var n={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:r.getLocaleModel().get(["toolbox","restore","title"])};return n},t}(Ci);pa({type:"restore",event:"restore",update:"prepareAndUpdate"},function(e,t){t.resetOption("recreate")});var qve=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],dL=function(){function e(t,r,n){var i=this;this._targetInfoList=[];var a=t5(r,t);j(Kve,function(o,s){(!n||!n.include||Ve(n.include,s)>=0)&&o(a,i._targetInfoList)})}return e.prototype.setOutputRanges=function(t,r){return this.matchOutputRanges(t,r,function(n,i,a){if((n.coordRanges||(n.coordRanges=[])).push(i),!n.coordRange){n.coordRange=i;var o=iS[n.brushType](0,a,i);n.__rangeOffset={offset:a5[n.brushType](o.values,n.range,[1,1]),xyMinMax:o.xyMinMax}}}),t},e.prototype.matchOutputRanges=function(t,r,n){j(t,function(i){var a=this.findTargetInfo(i,r);a&&a!==!0&&j(a.coordSyses,function(o){var s=iS[i.brushType](1,o,i.range,!0);n(i,s.values,o,r)})},this)},e.prototype.setInputRanges=function(t,r){j(t,function(n){var i=this.findTargetInfo(n,r);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=iS[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?a5[n.brushType](a.values,o.offset,Jve(a.xyMinMax,o.xyMinMax)):a.values}},this)},e.prototype.makePanelOpts=function(t,r){return ae(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:r?r(n):null,clipPath:yH(i),isTargetByCursor:_H(i,t,n.coordSysModel),getLinearBrushOtherExtent:xH(i)}})},e.prototype.controlSeries=function(t,r,n){var i=this.findTargetInfo(t,n);return i===!0||i&&Ve(i.coordSyses,r.coordinateSystem)>=0},e.prototype.findTargetInfo=function(t,r){for(var n=this._targetInfoList,i=t5(r,t),a=0;ae[1]&&e.reverse(),e}function t5(e,t){return _h(e,t,{includeMainTypes:qve})}var Kve={grid:function(e,t){var r=e.xAxisModels,n=e.yAxisModels,i=e.gridModels,a=_e(),o={},s={};!r&&!n&&!i||(j(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),j(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),j(i,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,c=[];j(u.getCartesians(),function(h,f){(Ve(r,h.getAxis("x").model)>=0||Ve(n,h.getAxis("y").model)>=0)&&c.push(h)}),t.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:c[0],coordSyses:c,getPanelRect:n5.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(e,t){j(e.geoModels,function(r){var n=r.coordinateSystem;t.push({panelId:"geo--"+r.id,geoModel:r,coordSysModel:r,coordSys:n,coordSyses:[n],getPanelRect:n5.geo})})}},r5=[function(e,t){var r=e.xAxisModel,n=e.yAxisModel,i=e.gridModel;return!i&&r&&(i=r.axis.grid.model),!i&&n&&(i=n.axis.grid.model),i&&i===t.gridModel},function(e,t){var r=e.geoModel;return r&&r===t.geoModel}],n5={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(Us(e)),t}},iS={lineX:Fe(i5,0),lineY:Fe(i5,1),rect:function(e,t,r,n){var i=e?t.pointToData([r[0][0],r[1][0]],n):t.dataToPoint([r[0][0],r[1][0]],n),a=e?t.pointToData([r[0][1],r[1][1]],n):t.dataToPoint([r[0][1],r[1][1]],n),o=[y2([i[0],a[0]]),y2([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(e,t,r,n){var i=[[1/0,-1/0],[1/0,-1/0]],a=ae(r,function(o){var s=e?t.pointToData(o,n):t.dataToPoint(o,n);return i[0][0]=Math.min(i[0][0],s[0]),i[1][0]=Math.min(i[1][0],s[1]),i[0][1]=Math.max(i[0][1],s[0]),i[1][1]=Math.max(i[1][1],s[1]),s});return{values:a,xyMinMax:i}}};function i5(e,t,r,n){var i=r.getAxis(["x","y"][e]),a=y2(ae([0,1],function(s){return t?i.coordToData(i.toLocalCoord(n[s]),!0):i.toGlobalCoord(i.dataToCoord(n[s]))})),o=[];return o[e]=a,o[1-e]=[NaN,NaN],{values:a,xyMinMax:o}}var a5={lineX:Fe(o5,0),lineY:Fe(o5,1),rect:function(e,t,r){return[[e[0][0]-r[0]*t[0][0],e[0][1]-r[0]*t[0][1]],[e[1][0]-r[1]*t[1][0],e[1][1]-r[1]*t[1][1]]]},polygon:function(e,t,r){return ae(e,function(n,i){return[n[0]-r[0]*t[i][0],n[1]-r[1]*t[i][1]]})}};function o5(e,t,r,n){return[t[0]-n[e]*r[0],t[1]-n[e]*r[1]]}function Jve(e,t){var r=s5(e),n=s5(t),i=[r[0]/n[0],r[1]/n[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function s5(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var x2=j,Qve=Eq("toolbox-dataZoom_"),epe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(r,n,i,a){this._brushController||(this._brushController=new zk(i.getZr()),this._brushController.on("brush",fe(this._onBrush,this)).mount()),npe(r,n,this,a,i),rpe(r,n)},t.prototype.onclick=function(r,n,i){tpe[i].call(this)},t.prototype.remove=function(r,n){this._brushController&&this._brushController.unmount()},t.prototype.dispose=function(r,n){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(r){var n=r.areas;if(!r.isEnd||!n.length)return;var i={},a=this.ecModel;this._brushController.updateCovers([]);var o=new dL(vL(this.model),a,{include:["grid"]});o.matchOutputRanges(n,a,function(u,c,h){if(h.type==="cartesian2d"){var f=u.brushType;f==="rect"?(s("x",h,c[0]),s("y",h,c[1])):s({lineX:"x",lineY:"y"}[f],h,c)}}),Uve(a,i),this._dispatchZoomAction(i);function s(u,c,h){var f=c.getAxis(u),d=f.model,g=l(u,d,a),m=g.findRepresentativeAxisProxy(d).getMinMaxSpan();(m.minValueSpan!=null||m.maxValueSpan!=null)&&(h=rl(0,h.slice(),f.scale.getExtent(),0,m.minValueSpan,m.maxValueSpan)),g&&(i[g.id]={dataZoomId:g.id,startValue:h[0],endValue:h[1]})}function l(u,c,h){var f;return h.eachComponent({mainType:"dataZoom",subType:"select"},function(d){var g=d.getAxisModel(u,c.componentIndex);g&&(f=d)}),f}},t.prototype._dispatchZoomAction=function(r){var n=[];x2(r,function(i,a){n.push(Se(i))}),n.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:n})},t.getDefaultOption=function(r){var n={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:r.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:K.color.backgroundTint}};return n},t}(Ci),tpe={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(Zve(this.ecModel))}};function vL(e){var t={xAxisIndex:e.get("xAxisIndex",!0),yAxisIndex:e.get("yAxisIndex",!0),xAxisId:e.get("xAxisId",!0),yAxisId:e.get("yAxisId",!0)};return t.xAxisIndex==null&&t.xAxisId==null&&(t.xAxisIndex="all"),t.yAxisIndex==null&&t.yAxisId==null&&(t.yAxisIndex="all"),t}function rpe(e,t){e.setIconStatus("back",Yve(t)>1?"emphasis":"normal")}function npe(e,t,r,n,i){var a=r._isZoomActive;n&&n.type==="takeGlobalCursor"&&(a=n.key==="dataZoomSelect"?n.dataZoomSelectActive:!1),r._isZoomActive=a,e.setIconStatus("zoom",a?"emphasis":"normal");var o=new dL(vL(e),t,{include:["grid"]}),s=o.makePanelOpts(i,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});r._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:e.getModel("brushStyle").getItemStyle()}:!1)}pQ("dataZoom",function(e){var t=e.getComponent("toolbox",0),r=["feature","dataZoom"];if(!t||t.get(r)==null)return;var n=t.getModel(r),i=[],a=vL(n),o=_h(e,a);x2(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),x2(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,c){var h=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:Qve+u+h};f[c]=h,i.push(f)}return i});function ipe(e){e.registerComponentModel(Lve),e.registerComponentView(Nve),Zc("saveAsImage",Ive),Zc("magicType",Eve),Zc("dataView",Wve),Zc("dataZoom",epe),Zc("restore",Xve),He(kve)}var ape=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,displayTransition:!0,enterable:!1,backgroundColor:K.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:K.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:K.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:K.color.tertiary,fontSize:14}},t}($e);function v8(e){var t=e.get("confine");return t!=null?!!t:e.get("renderMode")==="richText"}function p8(e){if(Je.domSupported){for(var t=document.documentElement.style,r=0,n=e.length;r-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var c=u*Math.PI/180,h=o+i,f=h*Math.abs(Math.cos(c))+h*Math.abs(Math.sin(c)),d=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-h)/2)*100)/100;s+=";"+a+":-"+d+"px";var g=t+" solid "+i+"px;",m=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+g,"border-right:"+g,"background-color:"+n+";"];return'
'}function fpe(e,t,r){var n="cubic-bezier(0.23,1,0.32,1)",i="",a="";return r&&(i=" "+e/2+"s "+n,a="opacity"+i+",visibility"+i),t||(i=" "+e+"s "+n,a+=(a.length?",":"")+(Je.transformSupported?""+pL+i:",left"+i+",top"+i)),lpe+":"+a}function l5(e,t,r){var n=e.toFixed(0)+"px",i=t.toFixed(0)+"px";if(!Je.transformSupported)return r?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=Je.transform3dSupported,o="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return r?"top:0;left:0;"+pL+":"+o+";":[["top",0],["left",0],[g8,o]]}function dpe(e){var t=[],r=e.get("fontSize"),n=e.getTextColor();n&&t.push("color:"+n),t.push("font:"+e.getFont());var i=be(e.get("lineHeight"),Math.round(r*3/2));r&&t.push("line-height:"+i+"px");var a=e.get("textShadowColor"),o=e.get("textShadowBlur")||0,s=e.get("textShadowOffsetX")||0,l=e.get("textShadowOffsetY")||0;return a&&o&&t.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),j(["decoration","align"],function(u){var c=e.get(u);c&&t.push("text-"+u+":"+c)}),t.join(";")}function vpe(e,t,r,n){var i=[],a=e.get("transitionDuration"),o=e.get("backgroundColor"),s=e.get("shadowBlur"),l=e.get("shadowColor"),u=e.get("shadowOffsetX"),c=e.get("shadowOffsetY"),h=e.getModel("textStyle"),f=aV(e,"html"),d=u+"px "+c+"px "+s+"px "+l;return i.push("box-shadow:"+d),t&&a>0&&i.push(fpe(a,r,n)),o&&i.push("background-color:"+o),j(["width","color","radius"],function(g){var m="border-"+g,y=jA(m),x=e.get(y);x!=null&&i.push(m+":"+x+(g==="color"?"":"px"))}),i.push(dpe(h)),f!=null&&i.push("padding:"+gf(f).join("px ")+"px"),i.join(";")+";"}function u5(e,t,r,n,i){var a=t&&t.painter;if(r){var o=a&&a.getViewportRoot();o&&QY(e,o,r,n,i)}else{e[0]=n,e[1]=i;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var ppe=function(){function e(t,r){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,Je.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=t.getZr(),a=r.appendTo,o=a&&(he(a)?document.querySelector(a):Eu(a)?a:we(a)&&a(t.getDom()));u5(this._styleCoord,i,o,t.getWidth()/2,t.getHeight()/2),(o||t.getDom()).appendChild(n),this._api=t,this._container=o;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=i.handler,c=i.painter.getViewportRoot();mi(c,l,!0),u.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return e.prototype.update=function(t){if(!this._container){var r=this._api.getDom(),n=spe(r,"position"),i=r.style;i.position!=="absolute"&&n!=="absolute"&&(i.position="relative")}var a=t.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this._enableDisplayTransition=t.get("displayTransition")&&t.get("transitionDuration")>0,this.el.className=t.get("className")||""},e.prototype.show=function(t,r){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,a=this._styleCoord;n.innerHTML?i.cssText=upe+vpe(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+l5(a[0],a[1],!0)+("border-color:"+Vu(r)+";")+(t.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(t,r,n,i,a){var o=this.el;if(t==null){o.innerHTML="";return}var s="";if(he(a)&&n.get("trigger")==="item"&&!v8(n)&&(s=hpe(n,i,a)),he(t))o.innerHTML=t+s;else if(t){o.innerHTML="",re(t)||(t=[t]);for(var l=0;l=0?this._tryShow(a,o):i==="leave"&&this._hide(o))},this))},t.prototype._keepShow=function(){var r=this._tooltipModel,n=this._ecModel,i=this._api,a=r.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&o.manuallyShowTip(r,n,i,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(r,n,i,a){if(!(a.from===this.uid||Je.node||!i.getDom())){var o=f5(a,i);this._ticket="";var s=a.dataByCoordSys,l=wpe(a,n,i);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var c=mpe;c.x=a.x,c.y=a.y,c.update(),De(c).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:c},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(r,n,i,a))return;var h=QH(a,n),f=h.point[0],d=h.point[1];f!=null&&d!=null&&this._tryShow({offsetX:f,offsetY:d,target:h.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(i.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:i.getZr().findHover(a.x,a.y).target},o))}},t.prototype.manuallyHideTip=function(r,n,i,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(f5(a,i))},t.prototype._manuallyAxisShowTip=function(r,n,i,a){var o=a.seriesIndex,s=a.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=n.getSeriesByIndex(o);if(u){var c=u.getData(),h=Id([c.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},t.prototype._tryShow=function(r,n){var i=r.target,a=this._tooltipModel;if(a){this._lastX=r.offsetX,this._lastY=r.offsetY;var o=r.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,r);else if(i){var s=De(i);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;vu(i,function(c){if(c.tooltipDisabled)return l=u=null,!0;l||u||(De(c).dataIndex!=null?l=c:De(c).tooltipConfig!=null&&(u=c))},!0),l?this._showSeriesItemTooltip(r,l,n):u?this._showComponentItemTooltip(r,u,n):this._hide(n)}else this._lastDataByCoordSys=null,this._hide(n)}},t.prototype._showOrMove=function(r,n){var i=r.get("showDelay");n=fe(n,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(n,i):n()},t.prototype._showAxisTooltip=function(r,n){var i=this._ecModel,a=this._tooltipModel,o=[n.offsetX,n.offsetY],s=Id([n.tooltipOption],a),l=this._renderMode,u=[],c=gr("section",{blocks:[],noHeader:!0}),h=[],f=new Bb;j(r,function(_){j(_.dataByAxis,function(w){var S=i.getComponent(w.axisDim+"Axis",w.axisIndex),T=w.value;if(!(!S||T==null)){var M=XH(T,S.axis,i,w.seriesDataIndices,w.valueLabelOpt),A=gr("section",{header:M,noHeader:!Jn(M),sortBlocks:!0,blocks:[]});c.blocks.push(A),j(w.seriesDataIndices,function(P){var I=i.getSeriesByIndex(P.seriesIndex),N=P.dataIndexInside,D=I.getDataParams(N);if(!(D.dataIndex<0)){D.axisDim=w.axisDim,D.axisIndex=w.axisIndex,D.axisType=w.axisType,D.axisId=w.axisId,D.axisValue=q0(S.axis,{value:T}),D.axisValueLabel=M,D.marker=f.makeTooltipMarker("item",Vu(D.color),l);var O=kD(I.formatTooltip(N,!0,null)),R=O.frag;if(R){var F=Id([I],a).get("valueFormatter");A.blocks.push(F?Q({valueFormatter:F},R):R)}O.text&&h.push(O.text),u.push(D)}})}})}),c.blocks.reverse(),h.reverse();var d=n.position,g=s.get("order"),m=ED(c,f,l,g,i.get("useUTC"),s.get("textStyle"));m&&h.unshift(m);var y=l==="richText"?` - -`:"
",x=h.join(y);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,u)?this._updatePosition(s,d,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,x,u,Math.random()+"",o[0],o[1],d,null,f)})},t.prototype._showSeriesItemTooltip=function(r,n,i){var a=this._ecModel,o=De(n),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,c=o.dataIndex,h=o.dataType,f=u.getData(h),d=this._renderMode,g=r.positionDefault,m=Id([f.getItemModel(c),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,g?{position:g}:null),y=m.get("trigger");if(!(y!=null&&y!=="item")){var x=u.getDataParams(c,h),_=new Bb;x.marker=_.makeTooltipMarker("item",Vu(x.color),d);var w=kD(u.formatTooltip(c,!1,h)),S=m.get("order"),T=m.get("valueFormatter"),M=w.frag,A=M?ED(T?Q({valueFormatter:T},M):M,_,d,S,a.get("useUTC"),m.get("textStyle")):w.text,P="item_"+u.name+"_"+c;this._showOrMove(m,function(){this._showTooltipContent(m,A,x,P,r.offsetX,r.offsetY,r.position,r.target,_)}),i({type:"showTip",dataIndexInside:c,dataIndex:f.getRawIndex(c),seriesIndex:s,from:this.uid})}},t.prototype._showComponentItemTooltip=function(r,n,i){var a=this._renderMode==="html",o=De(n),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(he(l)){var c=l;l={content:c,formatter:c},u=!0}u&&a&&l.content&&(l=Se(l),l.content=hn(l.content));var h=[l],f=this._ecModel.getComponent(o.componentMainType,o.componentIndex);f&&h.push(f),h.push({formatter:l.content});var d=r.positionDefault,g=Id(h,this._tooltipModel,d?{position:d}:null),m=g.get("content"),y=Math.random()+"",x=new Bb;this._showOrMove(g,function(){var _=Se(g.get("formatterParams")||{});this._showTooltipContent(g,m,_,y,r.offsetX,r.offsetY,r.position,n,x)}),i({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(r,n,i,a,o,s,l,u,c){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var h=this._tooltipContent;h.setEnterable(r.get("enterable"));var f=r.get("formatter");l=l||r.get("position");var d=n,g=this._getNearestPoint([o,s],i,r.get("trigger"),r.get("borderColor"),r.get("defaultBorderColor",!0)),m=g.color;if(f)if(he(f)){var y=r.ecModel.get("useUTC"),x=re(i)?i[0]:i,_=x&&x.axisType&&x.axisType.indexOf("time")>=0;d=f,_&&(d=Zp(x.axisValue,d,y)),d=RA(d,i,!0)}else if(we(f)){var w=fe(function(S,T){S===this._ticket&&(h.setContent(T,c,r,m,l),this._updatePosition(r,l,o,s,h,i,u))},this);this._ticket=a,d=f(i,a,w)}else d=f;h.setContent(d,c,r,m,l),h.show(r,m),this._updatePosition(r,l,o,s,h,i,u)}},t.prototype._getNearestPoint=function(r,n,i,a,o){if(i==="axis"||re(n))return{color:a||o};if(!re(n))return{color:a||n.color||n.borderColor}},t.prototype._updatePosition=function(r,n,i,a,o,s,l){var u=this._api.getWidth(),c=this._api.getHeight();n=n||r.get("position");var h=o.getSize(),f=r.get("align"),d=r.get("verticalAlign"),g=l&&l.getBoundingRect().clone();if(l&&g.applyTransform(l.transform),we(n)&&(n=n([i,a],s,o.el,g,{viewSize:[u,c],contentSize:h.slice()})),re(n))i=ce(n[0],u),a=ce(n[1],c);else if(ke(n)){var m=n;m.width=h[0],m.height=h[1];var y=It(m,{width:u,height:c});i=y.x,a=y.y,f=null,d=null}else if(he(n)&&l){var x=bpe(n,g,h,r.get("borderWidth"));i=x[0],a=x[1]}else{var x=xpe(i,a,o,u,c,f?null:20,d?null:20);i=x[0],a=x[1]}if(f&&(i-=d5(f)?h[0]/2:f==="right"?h[0]:0),d&&(a-=d5(d)?h[1]/2:d==="bottom"?h[1]:0),v8(r)){var x=_pe(i,a,o,u,c);i=x[0],a=x[1]}o.moveTo(i,a)},t.prototype._updateContentNotChangedOnAxis=function(r,n){var i=this._lastDataByCoordSys,a=this._cbParamsList,o=!!i&&i.length===r.length;return o&&j(i,function(s,l){var u=s.dataByAxis||[],c=r[l]||{},h=c.dataByAxis||[];o=o&&u.length===h.length,o&&j(u,function(f,d){var g=h[d]||{},m=f.seriesDataIndices||[],y=g.seriesDataIndices||[];o=o&&f.value===g.value&&f.axisType===g.axisType&&f.axisId===g.axisId&&m.length===y.length,o&&j(m,function(x,_){var w=y[_];o=o&&x.seriesIndex===w.seriesIndex&&x.dataIndex===w.dataIndex}),a&&j(f.seriesDataIndices,function(x){var _=x.seriesIndex,w=n[_],S=a[_];w&&S&&S.data!==w.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=n,!!o},t.prototype._hide=function(r){this._lastDataByCoordSys=null,r({type:"hideTip",from:this.uid})},t.prototype.dispose=function(r,n){Je.node||!n.getDom()||(lp(this,"_updatePosition"),this._tooltipContent.dispose(),h2("itemTooltip",n))},t.type="tooltip",t}(Mt);function Id(e,t,r){var n=t.ecModel,i;r?(i=new qe(r,n,n),i=new qe(t.option,i,n)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof qe&&(o=o.get("tooltip",!0)),he(o)&&(o={formatter:o}),o&&(i=new qe(o,i,n)))}return i}function f5(e,t){return e.dispatchAction||fe(t.dispatchAction,t)}function xpe(e,t,r,n,i,a,o){var s=r.getSize(),l=s[0],u=s[1];return a!=null&&(e+l+a+2>n?e-=l+a:e+=a),o!=null&&(t+u+o>i?t-=u+o:t+=o),[e,t]}function _pe(e,t,r,n,i){var a=r.getSize(),o=a[0],s=a[1];return e=Math.min(e+o,n)-o,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function bpe(e,t,r,n){var i=r[0],a=r[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,u=t.width,c=t.height;switch(e){case"inside":s=t.x+u/2-i/2,l=t.y+c/2-a/2;break;case"top":s=t.x+u/2-i/2,l=t.y-a-o;break;case"bottom":s=t.x+u/2-i/2,l=t.y+c+o;break;case"left":s=t.x-i-o,l=t.y+c/2-a/2;break;case"right":s=t.x+u+o,l=t.y+c/2-a/2}return[s,l]}function d5(e){return e==="center"||e==="middle"}function wpe(e,t,r){var n=iA(e).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=lf(t,i,n.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var c=De(u).tooltipConfig;if(c&&c.name===e.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}function Spe(e){He(tg),e.registerComponentModel(ape),e.registerComponentView(ype),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},qt),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},qt)}var Cpe=["rect","polygon","keep","clear"];function Tpe(e,t){var r=Tt(e?e.brush:[]);if(r.length){var n=[];j(r,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(n=n.concat(u))});var i=e&&e.toolbox;re(i)&&(i=i[0]),i||(i={feature:{}},e.toolbox=[i]);var a=i.feature||(i.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,n),Mpe(s),t&&!s.length&&s.push.apply(s,Cpe)}}function Mpe(e){var t={};j(e,function(r){t[r]=1}),e.length=0,j(t,function(r,n){e.push(n)})}var v5=j;function p5(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function _2(e,t,r){var n={};return v5(t,function(a){var o=n[a]=i();v5(e[a],function(s,l){if(Ir.isValidType(l)){var u={type:l,visual:s};r&&r(u,a),o[l]=new Ir(u),l==="opacity"&&(u=Se(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new Ir(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function y8(e,t,r){var n;j(r,function(i){t.hasOwnProperty(i)&&p5(t[i])&&(n=!0)}),n&&j(r,function(i){t.hasOwnProperty(i)&&p5(t[i])?e[i]=Se(t[i]):delete e[i]})}function Ape(e,t,r,n,i,a){var o={};j(e,function(h){var f=Ir.prepareVisualTypes(t[h]);o[h]=f});var s;function l(h){return ZA(r,s,h)}function u(h,f){pV(r,s,h,f)}r.each(c);function c(h,f){s=h;var d=r.getRawDataItem(s);if(!(d&&d.visualMap===!1))for(var g=n.call(i,h),m=t[g],y=o[g],x=0,_=y.length;x<_;x++){var w=y[x];m[w]&&m[w].applyVisual(h,l,u)}}}function kpe(e,t,r,n){var i={};return j(e,function(a){var o=Ir.prepareVisualTypes(t[a]);i[a]=o}),{progress:function(o,s){var l;n!=null&&(l=s.getDimensionIndex(n));function u(T){return ZA(s,h,T)}function c(T,M){pV(s,h,T,M)}for(var h,f=s.getStore();(h=o.next())!=null;){var d=s.getRawDataItem(h);if(!(d&&d.visualMap===!1))for(var g=n!=null?f.get(l,h):h,m=r(g),y=t[m],x=i[m],_=0,w=x.length;_t[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&_5(t)}};function _5(e){return new Pe(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var jpe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){this.ecModel=r,this.api=n,this.model,(this._brushController=new zk(n.getZr())).on("brush",fe(this._onBrush,this)).mount()},t.prototype.render=function(r,n,i,a){this.model=r,this._updateController(r,n,i,a)},t.prototype.updateTransform=function(r,n,i,a){x8(n),this._updateController(r,n,i,a)},t.prototype.updateVisual=function(r,n,i,a){this.updateTransform(r,n,i,a)},t.prototype.updateView=function(r,n,i,a){this._updateController(r,n,i,a)},t.prototype._updateController=function(r,n,i,a){(!a||a.$from!==r.id)&&this._brushController.setPanels(r.brushTargetManager.makePanelOpts(i)).enableBrush(r.brushOption).updateCovers(r.areas.slice())},t.prototype.dispose=function(){this._brushController.dispose()},t.prototype._onBrush=function(r){var n=this.model.id,i=this.model.brushTargetManager.setOutputRanges(r.areas,this.ecModel);(!r.isEnd||r.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:n,areas:Se(i),$from:n}),r.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:n,areas:Se(i),$from:n})},t.type="brush",t}(Mt),Rpe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.areas=[],r.brushOption={},r}return t.prototype.optionUpdated=function(r,n){var i=this.option;!n&&y8(i,r,["inBrush","outOfBrush"]);var a=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:this.option.defaultOutOfBrushColor},a.hasOwnProperty("liftZ")||(a.liftZ=5)},t.prototype.setAreas=function(r){r&&(this.areas=ae(r,function(n){return b5(this.option,n)},this))},t.prototype.setBrushOption=function(r){this.brushOption=b5(this.option,r),this.brushType=this.brushOption.brushType},t.type="brush",t.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],t.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:K.color.backgroundTint,borderColor:K.color.borderTint},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:K.color.disabled},t}($e);function b5(e,t){return Ge({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new qe(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var Ope=["rect","polygon","lineX","lineY","keep","clear"],zpe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(r,n,i){var a,o,s;n.eachComponent({mainType:"brush"},function(l){a=l.brushType,o=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=a,this._brushMode=o,j(r.get("type",!0),function(l){r.setIconStatus(l,(l==="keep"?o==="multiple":l==="clear"?s:l===a)?"emphasis":"normal")})},t.prototype.updateView=function(r,n,i){this.render(r,n,i)},t.prototype.getIcons=function(){var r=this.model,n=r.get("icon",!0),i={};return j(r.get("type",!0),function(a){n[a]&&(i[a]=n[a])}),i},t.prototype.onclick=function(r,n,i){var a=this._brushType,o=this._brushMode;i==="clear"?(n.dispatchAction({type:"axisAreaSelect",intervals:[]}),n.dispatchAction({type:"brush",command:"clear",areas:[]})):n.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:i==="keep"?a:a===i?!1:i,brushMode:i==="keep"?o==="multiple"?"single":"multiple":o}})},t.getDefaultOption=function(r){var n={show:!0,type:Ope.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:r.getLocaleModel().get(["toolbox","brush","title"])};return n},t}(Ci);function Bpe(e){e.registerComponentView(jpe),e.registerComponentModel(Rpe),e.registerPreprocessor(Tpe),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,Npe),e.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(t,r){r.eachComponent({mainType:"brush",query:t},function(n){n.setAreas(t.areas)})}),e.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},qt),e.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},qt),Zc("brush",zpe)}var Fpe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.layoutMode={type:"box",ignoreSize:!0},r}return t.type="title",t.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:"center",top:K.size.m,backgroundColor:K.color.transparent,borderColor:K.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:K.color.primary},subtextStyle:{fontSize:12,color:K.color.quaternary}},t}($e),Vpe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){if(this.group.removeAll(),!!r.get("show")){var a=this.group,o=r.getModel("textStyle"),s=r.getModel("subtextStyle"),l=r.get("textAlign"),u=be(r.get("textBaseline"),r.get("textVerticalAlign")),c=new tt({style:Ct(o,{text:r.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),h=c.getBoundingRect(),f=r.get("subtext"),d=new tt({style:Ct(s,{text:f,fill:s.getTextColor(),y:h.height+r.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),g=r.get("link"),m=r.get("sublink"),y=r.get("triggerEvent",!0);c.silent=!g&&!y,d.silent=!m&&!y,g&&c.on("click",function(){B0(g,"_"+r.get("target"))}),m&&d.on("click",function(){B0(m,"_"+r.get("subtarget"))}),De(c).eventData=De(d).eventData=y?{componentType:"title",componentIndex:r.componentIndex}:null,a.add(c),f&&a.add(d);var x=a.getBoundingRect(),_=r.getBoxLayoutParams();_.width=x.width,_.height=x.height;var w=Tr(r,i),S=It(_,w.refContainer,r.get("padding"));l||(l=r.get("left")||r.get("right"),l==="middle"&&(l="center"),l==="right"?S.x+=S.width:l==="center"&&(S.x+=S.width/2)),u||(u=r.get("top")||r.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?S.y+=S.height:u==="middle"&&(S.y+=S.height/2),u=u||"top"),a.x=S.x,a.y=S.y,a.markRedraw();var T={align:l,verticalAlign:u};c.setStyle(T),d.setStyle(T),x=a.getBoundingRect();var M=S.margin,A=r.getItemStyle(["color","opacity"]);A.fill=r.get("backgroundColor");var P=new Ze({shape:{x:x.x-M[3],y:x.y-M[0],width:x.width+M[1]+M[3],height:x.height+M[0]+M[2],r:r.get("borderRadius")},style:A,subPixelOptimize:!0,silent:!0});a.add(P)}},t.type="title",t}(Mt);function Gpe(e){e.registerComponentModel(Fpe),e.registerComponentView(Vpe)}var w5=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.layoutMode="box",r}return t.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i),this._initData()},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),this._initData()},t.prototype.setCurrentIndex=function(r){r==null&&(r=this.option.currentIndex);var n=this._data.count();this.option.loop?r=(r%n+n)%n:(r>=n&&(r=n-1),r<0&&(r=0)),this.option.currentIndex=r},t.prototype.getCurrentIndex=function(){return this.option.currentIndex},t.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},t.prototype.setPlayState=function(r){this.option.autoPlay=!!r},t.prototype.getPlayState=function(){return!!this.option.autoPlay},t.prototype._initData=function(){var r=this.option,n=r.data||[],i=r.axisType,a=this._names=[],o;i==="category"?(o=[],j(n,function(u,c){var h=br(sf(u),""),f;ke(u)?(f=Se(u),f.value=c):f=c,o.push(f),a.push(h)})):o=n;var s={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new dn([{name:"value",type:s}],this);l.initData(o,a)},t.prototype.getData=function(){return this._data},t.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},t.type="timeline",t.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:K.size.m,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:K.color.secondary},data:[]},t}($e),_8=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="timeline.slider",t.defaultOption=fl(w5.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:K.color.border,borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:K.color.accent10},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:K.color.tertiary},itemStyle:{color:K.color.accent20,borderWidth:0},checkpointStyle:{symbol:"circle",symbolSize:15,color:K.color.accent50,borderColor:K.color.accent50,borderWidth:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0, 0, 0, 0)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10.6699C11.5 9.90014 12.3333 9.41887 13 9.80371L20.5 14.1338C21.1667 14.5187 21.1667 15.4813 20.5 15.8662L13 20.1963C12.3333 20.5811 11.5 20.0999 11.5 19.3301V10.6699Z",stopIcon:"path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10C12.3284 10 13 10.6716 13 11.5V18.5C13 19.3284 12.3284 20 11.5 20C10.6716 20 10 19.3284 10 18.5V11.5C10 10.6716 10.6716 10 11.5 10ZM18.5 10C19.3284 10 20 10.6716 20 11.5V18.5C20 19.3284 19.3284 20 18.5 20C17.6716 20 17 19.3284 17 18.5V11.5C17 10.6716 17.6716 10 18.5 10Z",nextIcon:"path://M0.838834 18.7383C0.253048 18.1525 0.253048 17.2028 0.838834 16.617L7.55635 9.89949L0.838834 3.18198C0.253048 2.59619 0.253048 1.64645 0.838834 1.06066C1.42462 0.474874 2.37437 0.474874 2.96015 1.06066L10.7383 8.83883L10.8412 8.95277C11.2897 9.50267 11.2897 10.2963 10.8412 10.8462L10.7383 10.9602L2.96015 18.7383C2.37437 19.3241 1.42462 19.3241 0.838834 18.7383Z",prevIcon:"path://M10.9602 1.06066C11.5459 1.64645 11.5459 2.59619 10.9602 3.18198L4.24264 9.89949L10.9602 16.617C11.5459 17.2028 11.5459 18.1525 10.9602 18.7383C10.3744 19.3241 9.42462 19.3241 8.83883 18.7383L1.06066 10.9602L0.957771 10.8462C0.509245 10.2963 0.509245 9.50267 0.957771 8.95277L1.06066 8.83883L8.83883 1.06066C9.42462 0.474874 10.3744 0.474874 10.9602 1.06066Z",prevBtnSize:18,nextBtnSize:18,color:K.color.accent50,borderColor:K.color.accent50,borderWidth:0},emphasis:{label:{show:!0,color:K.color.accent60},itemStyle:{color:K.color.accent60,borderColor:K.color.accent60},controlStyle:{color:K.color.accent70,borderColor:K.color.accent70}},progress:{lineStyle:{color:K.color.accent30},itemStyle:{color:K.color.accent40}},data:[]}),t}(w5);Qt(_8,M_.prototype);var Wpe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="timeline",t}(Mt),Hpe=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this,r,n,i)||this;return o.type=a||"value",o}return t.prototype.getLabelModel=function(){return this.model.getModel("label")},t.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},t}(Vi),oS=Math.PI,S5=Ye(),Upe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){this.api=n},t.prototype.render=function(r,n,i){if(this.model=r,this.api=i,this.ecModel=n,this.group.removeAll(),r.get("show",!0)){var a=this._layout(r,i),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,r);r.formatTooltip=function(u){var c=l.scale.getLabel({value:u});return gr("nameValue",{noName:!0,value:c})},j(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,o,l,r)},this),this._renderAxisLabel(a,s,l,r),this._position(a,r)}this._doPlayStop(),this._updateTicksStatus()},t.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},t.prototype.dispose=function(){this._clearTimer()},t.prototype._layout=function(r,n){var i=r.get(["label","position"]),a=r.get("orient"),o=$pe(r,n),s;i==null||i==="auto"?s=a==="horizontal"?o.y+o.height/2=0||s==="+"?"left":"right"},u={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:oS/2},h=a==="vertical"?o.height:o.width,f=r.getModel("controlStyle"),d=f.get("show",!0),g=d?f.get("itemSize"):0,m=d?f.get("itemGap"):0,y=g+m,x=r.get(["label","rotate"])||0;x=x*oS/180;var _,w,S,T=f.get("position",!0),M=d&&f.get("showPlayBtn",!0),A=d&&f.get("showPrevBtn",!0),P=d&&f.get("showNextBtn",!0),I=0,N=h;T==="left"||T==="bottom"?(M&&(_=[0,0],I+=y),A&&(w=[I,0],I+=y),P&&(S=[N-g,0],N-=y)):(M&&(_=[N-g,0],N-=y),A&&(w=[0,0],I+=y),P&&(S=[N-g,0],N-=y));var D=[I,N];return r.get("inverse")&&D.reverse(),{viewRect:o,mainLength:h,orient:a,rotation:c[a],labelRotation:x,labelPosOpt:s,labelAlign:r.get(["label","align"])||l[a],labelBaseline:r.get(["label","verticalAlign"])||r.get(["label","baseline"])||u[a],playPosition:_,prevBtnPosition:w,nextBtnPosition:S,axisExtent:D,controlSize:g,controlGap:m}},t.prototype._position=function(r,n){var i=this._mainGroup,a=this._labelGroup,o=r.viewRect;if(r.orient==="vertical"){var s=Pr(),l=o.x,u=o.y+o.height;ha(s,s,[-l,-u]),Ko(s,s,-oS/2),ha(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var c=_(o),h=_(i.getBoundingRect()),f=_(a.getBoundingRect()),d=[i.x,i.y],g=[a.x,a.y];g[0]=d[0]=c[0][0];var m=r.labelPosOpt;if(m==null||he(m)){var y=m==="+"?0:1;w(d,h,c,1,y),w(g,f,c,1,1-y)}else{var y=m>=0?0:1;w(d,h,c,1,y),g[1]=d[1]+m}i.setPosition(d),a.setPosition(g),i.rotation=a.rotation=r.rotation,x(i),x(a);function x(S){S.originX=c[0][0]-S.x,S.originY=c[1][0]-S.y}function _(S){return[[S.x,S.x+S.width],[S.y,S.y+S.height]]}function w(S,T,M,A,P){S[A]+=M[A][P]-T[A][P]}},t.prototype._createAxis=function(r,n){var i=n.getData(),a=n.get("axisType"),o=Zpe(n,a);o.getTicks=function(){return i.mapArray(["value"],function(u){return{value:u}})};var s=i.getDataExtent("value");o.setExtent(s[0],s[1]),o.calcNiceTicks();var l=new Hpe("value",o,r.axisExtent,a);return l.model=n,l},t.prototype._createGroup=function(r){var n=this[r]=new Ce;return this.group.add(n),n},t.prototype._renderAxisLine=function(r,n,i,a){var o=i.getExtent();if(a.get(["lineStyle","show"])){var s=new ar({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:Q({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(s);var l=this._progressLine=new ar({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:Ae({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});n.add(l)}},t.prototype._renderAxisTick=function(r,n,i,a){var o=this,s=a.getData(),l=i.scale.getTicks();this._tickSymbols=[],j(l,function(u){var c=i.dataToCoord(u.value),h=s.getItemModel(u.value),f=h.getModel("itemStyle"),d=h.getModel(["emphasis","itemStyle"]),g=h.getModel(["progress","itemStyle"]),m={x:c,y:0,onclick:fe(o._changeTimeline,o,u.value)},y=C5(h,f,n,m);y.ensureState("emphasis").style=d.getItemStyle(),y.ensureState("progress").style=g.getItemStyle(),Hs(y);var x=De(y);h.get("tooltip")?(x.dataIndex=u.value,x.dataModel=a):x.dataIndex=x.dataModel=null,o._tickSymbols.push(y)})},t.prototype._renderAxisLabel=function(r,n,i,a){var o=this,s=i.getLabelModel();if(s.get("show")){var l=a.getData(),u=i.getViewLabels();this._tickLabels=[],j(u,function(c){var h=c.tickValue,f=l.getItemModel(h),d=f.getModel("label"),g=f.getModel(["emphasis","label"]),m=f.getModel(["progress","label"]),y=i.dataToCoord(c.tickValue),x=new tt({x:y,y:0,rotation:r.labelRotation-r.rotation,onclick:fe(o._changeTimeline,o,h),silent:!1,style:Ct(d,{text:c.formattedLabel,align:r.labelAlign,verticalAlign:r.labelBaseline})});x.ensureState("emphasis").style=Ct(g),x.ensureState("progress").style=Ct(m),n.add(x),Hs(x),S5(x).dataIndex=h,o._tickLabels.push(x)})}},t.prototype._renderControl=function(r,n,i,a){var o=r.controlSize,s=r.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),c=a.getPlayState(),h=a.get("inverse",!0);f(r.nextBtnPosition,"next",fe(this._changeTimeline,this,h?"-":"+")),f(r.prevBtnPosition,"prev",fe(this._changeTimeline,this,h?"+":"-")),f(r.playPosition,c?"stop":"play",fe(this._handlePlayClick,this,!c),!0);function f(d,g,m,y){if(d){var x=fa(be(a.get(["controlStyle",g+"BtnSize"]),o),o),_=[0,-x/2,x,x],w=Ype(a,g+"Icon",_,{x:d[0],y:d[1],originX:o/2,originY:0,rotation:y?-s:0,rectHover:!0,style:l,onclick:m});w.ensureState("emphasis").style=u,n.add(w),Hs(w)}}},t.prototype._renderCurrentPointer=function(r,n,i,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,c={onCreate:function(h){h.draggable=!0,h.drift=fe(u._handlePointerDrag,u),h.ondragend=fe(u._handlePointerDragend,u),T5(h,u._progressLine,s,i,a,!0)},onUpdate:function(h){T5(h,u._progressLine,s,i,a)}};this._currentPointer=C5(l,l,this._mainGroup,{},this._currentPointer,c)},t.prototype._handlePlayClick=function(r){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:r,from:this.uid})},t.prototype._handlePointerDrag=function(r,n,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},t.prototype._handlePointerDragend=function(r){this._pointerChangeTimeline([r.offsetX,r.offsetY],!0)},t.prototype._pointerChangeTimeline=function(r,n){var i=this._toAxisCoord(r)[0],a=this._axis,o=Qn(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(s[o]=+s[o].toFixed(g)),[s,d]}var ay={min:Fe(iy,"min"),max:Fe(iy,"max"),average:Fe(iy,"average"),median:Fe(iy,"median")};function Cp(e,t){if(t){var r=e.getData(),n=e.coordinateSystem,i=n&&n.dimensions;if(!ege(t)&&!re(t.coord)&&re(i)){var a=b8(t,r,n,e);if(t=Se(t),t.type&&ay[t.type]&&a.baseAxis&&a.valueAxis){var o=Ve(i,a.baseAxis.dim),s=Ve(i,a.valueAxis.dim),l=ay[t.type](r,a.valueAxis.dim,a.baseDataDim,a.valueDataDim,o,s);t.coord=l[0],t.value=l[1]}else t.coord=[t.xAxis!=null?t.xAxis:t.radiusAxis,t.yAxis!=null?t.yAxis:t.angleAxis]}if(t.coord==null||!re(i)){t.coord=[];var u=e.getBaseAxis();if(u&&t.type&&ay[t.type]){var c=n.getOtherAxis(u);c&&(t.value=_x(r,r.mapDimension(c.dim),t.type))}}else for(var h=t.coord,f=0;f<2;f++)ay[h[f]]&&(h[f]=_x(r,r.mapDimension(i[f]),h[f]));return t}}function b8(e,t,r,n){var i={};return e.valueIndex!=null||e.valueDim!=null?(i.valueDataDim=e.valueIndex!=null?t.getDimension(e.valueIndex):e.valueDim,i.valueAxis=r.getAxis(tge(n,i.valueDataDim)),i.baseAxis=r.getOtherAxis(i.valueAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim)):(i.baseAxis=n.getBaseAxis(),i.valueAxis=r.getOtherAxis(i.baseAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim),i.valueDataDim=t.mapDimension(i.valueAxis.dim)),i}function tge(e,t){var r=e.getData().getDimensionInfo(t);return r&&r.coordDim}function Tp(e,t){return e&&e.containData&&t.coord&&!w2(t)?e.containData(t.coord):!0}function rge(e,t,r){return e&&e.containZone&&t.coord&&r.coord&&!w2(t)&&!w2(r)?e.containZone(t.coord,r.coord):!0}function w8(e,t){return e?function(r,n,i,a){var o=a<2?r.coord&&r.coord[a]:r.value;return $s(o,t[a])}:function(r,n,i,a){return $s(r.value,t[a])}}function _x(e,t,r){if(r==="average"){var n=0,i=0;return e.each(t,function(a,o){isNaN(a)||(n+=a,i++)}),n/i}else return r==="median"?e.getMedian(t):e.getDataExtent(t)[r==="max"?1:0]}var sS=Ye(),mL=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(){this.markerGroupMap=_e()},t.prototype.render=function(r,n,i){var a=this,o=this.markerGroupMap;o.each(function(s){sS(s).keep=!1}),n.eachSeries(function(s){var l=Qa.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!sS(s).keep&&a.group.remove(s.group)}),nge(n,o,this.type)},t.prototype.markKeep=function(r){sS(r).keep=!0},t.prototype.toggleBlurSeries=function(r,n){var i=this;j(r,function(a){var o=Qa.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?OF(l):fA(l))})}})},t.type="marker",t}(Mt);function nge(e,t,r){e.eachSeries(function(n){var i=Qa.getMarkerModelFromSeries(n,r),a=t.get(n.id);if(i&&a&&a.group){var o=Fu(i),s=o.z,l=o.zlevel;w_(a.group,s,l)}})}function A5(e,t,r){var n=t.coordinateSystem,i=r.getWidth(),a=r.getHeight(),o=n&&n.getArea&&n.getArea();e.each(function(s){var l=e.getItemModel(s),u=l.get("relativeTo")==="coordinate",c=u?o?o.width:0:i,h=u?o?o.height:0:a,f=u&&o?o.x:0,d=u&&o?o.y:0,g,m=ce(l.get("x"),c)+f,y=ce(l.get("y"),h)+d;if(!isNaN(m)&&!isNaN(y))g=[m,y];else if(t.getMarkerPosition)g=t.getMarkerPosition(e.getValues(e.dimensions,s));else if(n){var x=e.get(n.dimensions[0],s),_=e.get(n.dimensions[1],s);g=n.dataToPoint([x,_])}isNaN(m)||(g[0]=m),isNaN(y)||(g[1]=y),e.setItemLayout(s,g)})}var ige=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=Qa.getMarkerModelFromSeries(a,"markPoint");o&&(A5(o.getData(),a,i),this.markerGroupMap.get(a.id).updateLayout())},this)},t.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new Kp),h=age(o,r,n);n.setData(h),A5(n.getData(),r,a),h.each(function(f){var d=h.getItemModel(f),g=d.getShallow("symbol"),m=d.getShallow("symbolSize"),y=d.getShallow("symbolRotate"),x=d.getShallow("symbolOffset"),_=d.getShallow("symbolKeepAspect");if(we(g)||we(m)||we(y)||we(x)){var w=n.getRawValue(f),S=n.getDataParams(f);we(g)&&(g=g(w,S)),we(m)&&(m=m(w,S)),we(y)&&(y=y(w,S)),we(x)&&(x=x(w,S))}var T=d.getModel("itemStyle").getItemStyle(),M=d.get("z2"),A=Yp(l,"color");T.fill||(T.fill=A),h.setItemVisual(f,{z2:be(M,0),symbol:g,symbolSize:m,symbolRotate:y,symbolOffset:x,symbolKeepAspect:_,style:T})}),c.updateData(h),this.group.add(c.group),h.eachItemGraphicEl(function(f){f.traverse(function(d){De(d).dataModel=n})}),this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markPoint",t}(mL);function age(e,t,r){var n;e?n=ae(e&&e.dimensions,function(s){var l=t.getData().getDimensionInfo(t.getData().mapDimension(s))||{};return Q(Q({},l),{name:s,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new dn(n,r),a=ae(r.get("data"),Fe(Cp,t));e&&(a=ot(a,Fe(Tp,e)));var o=w8(!!e,n);return i.initData(a,null,o),i}function oge(e){e.registerComponentModel(Qpe),e.registerComponentView(ige),e.registerPreprocessor(function(t){gL(t.series,"markPoint")&&(t.markPoint=t.markPoint||{})})}var sge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.createMarkerModelFromSeries=function(r,n,i){return new t(r,n,i)},t.type="markLine",t.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},t}(Qa),oy=Ye(),lge=function(e,t,r,n){var i=e.getData(),a;if(re(n))a=n;else{var o=n.type;if(o==="min"||o==="max"||o==="average"||o==="median"||n.xAxis!=null||n.yAxis!=null){var s=void 0,l=void 0;if(n.yAxis!=null||n.xAxis!=null)s=t.getAxis(n.yAxis!=null?"y":"x"),l=Fr(n.yAxis,n.xAxis);else{var u=b8(n,i,t,e);s=u.valueAxis;var c=ak(i,u.valueDataDim);l=_x(i,c,o)}var h=s.dim==="x"?0:1,f=1-h,d=Se(n),g={coord:[]};d.type=null,d.coord=[],d.coord[f]=-1/0,g.coord[f]=1/0;var m=r.get("precision");m>=0&&rt(l)&&(l=+l.toFixed(Math.min(m,20))),d.coord[h]=g.coord[h]=l,a=[d,g,{type:o,valueIndex:n.valueIndex,value:l}]}else a=[]}var y=[Cp(e,a[0]),Cp(e,a[1]),Q({},a[2])];return y[2].type=y[2].type||null,Ge(y[2],y[0]),Ge(y[2],y[1]),y};function bx(e){return!isNaN(e)&&!isFinite(e)}function k5(e,t,r,n){var i=1-e,a=n.dimensions[e];return bx(t[i])&&bx(r[i])&&t[e]===r[e]&&n.getAxis(a).containData(t[e])}function uge(e,t){if(e.type==="cartesian2d"){var r=t[0].coord,n=t[1].coord;if(r&&n&&(k5(1,r,n,e)||k5(0,r,n,e)))return!0}return Tp(e,t[0])&&Tp(e,t[1])}function lS(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=ce(o.get("x"),i.getWidth()),u=ce(o.get("y"),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition)s=n.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=a.dimensions,h=e.get(c[0],t),f=e.get(c[1],t);s=a.dataToPoint([h,f])}if(tl(a,"cartesian2d")){var d=a.getAxis("x"),g=a.getAxis("y"),c=a.dimensions;bx(e.get(c[0],t))?s[0]=d.toGlobalCoord(d.getExtent()[r?0:1]):bx(e.get(c[1],t))&&(s[1]=g.toGlobalCoord(g.getExtent()[r?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}e.setItemLayout(t,s)}var cge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=Qa.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=oy(o).from,u=oy(o).to;l.each(function(c){lS(l,c,!0,a,i),lS(u,c,!1,a,i)}),s.each(function(c){s.setItemLayout(c,[l.getItemLayout(c),u.getItemLayout(c)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},t.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new Rk);this.group.add(c.group);var h=hge(o,r,n),f=h.from,d=h.to,g=h.line;oy(n).from=f,oy(n).to=d,n.setData(g);var m=n.get("symbol"),y=n.get("symbolSize"),x=n.get("symbolRotate"),_=n.get("symbolOffset");re(m)||(m=[m,m]),re(y)||(y=[y,y]),re(x)||(x=[x,x]),re(_)||(_=[_,_]),h.from.each(function(S){w(f,S,!0),w(d,S,!1)}),g.each(function(S){var T=g.getItemModel(S),M=T.getModel("lineStyle").getLineStyle();g.setItemLayout(S,[f.getItemLayout(S),d.getItemLayout(S)]);var A=T.get("z2");M.stroke==null&&(M.stroke=f.getItemVisual(S,"style").fill),g.setItemVisual(S,{z2:be(A,0),fromSymbolKeepAspect:f.getItemVisual(S,"symbolKeepAspect"),fromSymbolOffset:f.getItemVisual(S,"symbolOffset"),fromSymbolRotate:f.getItemVisual(S,"symbolRotate"),fromSymbolSize:f.getItemVisual(S,"symbolSize"),fromSymbol:f.getItemVisual(S,"symbol"),toSymbolKeepAspect:d.getItemVisual(S,"symbolKeepAspect"),toSymbolOffset:d.getItemVisual(S,"symbolOffset"),toSymbolRotate:d.getItemVisual(S,"symbolRotate"),toSymbolSize:d.getItemVisual(S,"symbolSize"),toSymbol:d.getItemVisual(S,"symbol"),style:M})}),c.updateData(g),h.line.eachItemGraphicEl(function(S){De(S).dataModel=n,S.traverse(function(T){De(T).dataModel=n})});function w(S,T,M){var A=S.getItemModel(T);lS(S,T,M,r,a);var P=A.getModel("itemStyle").getItemStyle();P.fill==null&&(P.fill=Yp(l,"color")),S.setItemVisual(T,{symbolKeepAspect:A.get("symbolKeepAspect"),symbolOffset:be(A.get("symbolOffset",!0),_[M?0:1]),symbolRotate:be(A.get("symbolRotate",!0),x[M?0:1]),symbolSize:be(A.get("symbolSize"),y[M?0:1]),symbol:be(A.get("symbol",!0),m[M?0:1]),style:P})}this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markLine",t}(mL);function hge(e,t,r){var n;e?n=ae(e&&e.dimensions,function(u){var c=t.getData().getDimensionInfo(t.getData().mapDimension(u))||{};return Q(Q({},c),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new dn(n,r),a=new dn(n,r),o=new dn([],r),s=ae(r.get("data"),Fe(lge,t,e,r));e&&(s=ot(s,Fe(uge,e)));var l=w8(!!e,n);return i.initData(ae(s,function(u){return u[0]}),null,l),a.initData(ae(s,function(u){return u[1]}),null,l),o.initData(ae(s,function(u){return u[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function fge(e){e.registerComponentModel(sge),e.registerComponentView(cge),e.registerPreprocessor(function(t){gL(t.series,"markLine")&&(t.markLine=t.markLine||{})})}var dge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.createMarkerModelFromSeries=function(r,n,i){return new t(r,n,i)},t.type="markArea",t.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},t}(Qa),sy=Ye(),vge=function(e,t,r,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=Cp(e,i),s=Cp(e,a),l=o.coord,u=s.coord;l[0]=Fr(l[0],-1/0),l[1]=Fr(l[1],-1/0),u[0]=Fr(u[0],1/0),u[1]=Fr(u[1],1/0);var c=a_([{},o,s]);return c.coord=[o.coord,s.coord],c.x0=o.x,c.y0=o.y,c.x1=s.x,c.y1=s.y,c}};function Sx(e){return!isNaN(e)&&!isFinite(e)}function L5(e,t,r,n){var i=1-e;return Sx(t[i])&&Sx(r[i])}function pge(e,t){var r=t.coord[0],n=t.coord[1],i={coord:r,x:t.x0,y:t.y0},a={coord:n,x:t.x1,y:t.y1};return tl(e,"cartesian2d")?r&&n&&(L5(1,r,n)||L5(0,r,n))?!0:rge(e,i,a):Tp(e,i)||Tp(e,a)}function N5(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=ce(o.get(r[0]),i.getWidth()),u=ce(o.get(r[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition){var c=e.getValues(["x0","y0"],t),h=e.getValues(["x1","y1"],t),f=a.clampData(c),d=a.clampData(h),g=[];r[0]==="x0"?g[0]=f[0]>d[0]?h[0]:c[0]:g[0]=f[0]>d[0]?c[0]:h[0],r[1]==="y0"?g[1]=f[1]>d[1]?h[1]:c[1]:g[1]=f[1]>d[1]?c[1]:h[1],s=n.getMarkerPosition(g,r,!0)}else{var m=e.get(r[0],t),y=e.get(r[1],t),x=[m,y];a.clampData&&a.clampData(x,x),s=a.dataToPoint(x,!0)}if(tl(a,"cartesian2d")){var _=a.getAxis("x"),w=a.getAxis("y"),m=e.get(r[0],t),y=e.get(r[1],t);Sx(m)?s[0]=_.toGlobalCoord(_.getExtent()[r[0]==="x0"?0:1]):Sx(y)&&(s[1]=w.toGlobalCoord(w.getExtent()[r[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var P5=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],gge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=Qa.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=ae(P5,function(h){return N5(s,l,h,a,i)});s.setItemLayout(l,u);var c=s.getItemGraphicEl(l);c.setShape("points",u)})}},this)},t.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,{group:new Ce});this.group.add(c.group),this.markKeep(c);var h=mge(o,r,n);n.setData(h),h.each(function(f){var d=ae(P5,function(N){return N5(h,f,N,r,a)}),g=o.getAxis("x").scale,m=o.getAxis("y").scale,y=g.getExtent(),x=m.getExtent(),_=[g.parse(h.get("x0",f)),g.parse(h.get("x1",f))],w=[m.parse(h.get("y0",f)),m.parse(h.get("y1",f))];Qn(_),Qn(w);var S=!(y[0]>_[1]||y[1]<_[0]||x[0]>w[1]||x[1]=0},t.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",bottom:K.size.m,align:"auto",backgroundColor:K.color.transparent,borderColor:K.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:K.color.disabled,inactiveBorderColor:K.color.disabled,inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:K.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:K.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:K.color.tertiary,borderWidth:1,borderColor:K.color.border},emphasis:{selectorLabel:{show:!0,color:K.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t}($e),zc=Fe,C2=j,ly=Ce,S8=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.newlineDisabled=!1,r}return t.prototype.init=function(){this.group.add(this._contentGroup=new ly),this.group.add(this._selectorGroup=new ly),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(r,n,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),u=r.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,r,n,i,l,s,u);var c=Tr(r,i).refContainer,h=r.getBoxLayoutParams(),f=r.get("padding"),d=It(h,c,f),g=this.layoutInner(r,o,d,a,l,u),m=It(Ae({width:g.width,height:g.height},h),c,f);this.group.x=m.x-g.x,this.group.y=m.y-g.y,this.group.markRedraw(),this.group.add(this._backgroundEl=h8(g,r))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(r,n,i,a,o,s,l){var u=this.getContentGroup(),c=_e(),h=n.get("selectedMode"),f=n.get("triggerEvent"),d=[];i.eachRawSeries(function(g){!g.get("legendHoverLink")&&d.push(g.id)}),C2(n.getData(),function(g,m){var y=this,x=g.get("name");if(!this.newlineDisabled&&(x===""||x===` -`)){var _=new ly;_.newline=!0,u.add(_);return}var w=i.getSeriesByName(x)[0];if(!c.get(x))if(w){var S=w.getData(),T=S.getVisual("legendLineStyle")||{},M=S.getVisual("legendIcon"),A=S.getVisual("style"),P=this._createItem(w,x,m,g,n,r,T,A,M,h,a);P.on("click",zc(I5,x,null,a,d)).on("mouseover",zc(T2,w.name,null,a,d)).on("mouseout",zc(M2,w.name,null,a,d)),i.ssr&&P.eachChild(function(I){var N=De(I);N.seriesIndex=w.seriesIndex,N.dataIndex=m,N.ssrType="legend"}),f&&P.eachChild(function(I){y.packEventData(I,n,w,m,x)}),c.set(x,!0)}else i.eachRawSeries(function(I){var N=this;if(!c.get(x)&&I.legendVisualProvider){var D=I.legendVisualProvider;if(!D.containName(x))return;var O=D.indexOfName(x),R=D.getItemVisual(O,"style"),F=D.getItemVisual(O,"legendIcon"),H=fn(R.fill);H&&H[3]===0&&(H[3]=.2,R=Q(Q({},R),{fill:Li(H,"rgba")}));var W=this._createItem(I,x,m,g,n,r,{},R,F,h,a);W.on("click",zc(I5,null,x,a,d)).on("mouseover",zc(T2,null,x,a,d)).on("mouseout",zc(M2,null,x,a,d)),i.ssr&&W.eachChild(function(V){var z=De(V);z.seriesIndex=I.seriesIndex,z.dataIndex=m,z.ssrType="legend"}),f&&W.eachChild(function(V){N.packEventData(V,n,I,m,x)}),c.set(x,!0)}},this)},this),o&&this._createSelector(o,n,a,s,l)},t.prototype.packEventData=function(r,n,i,a,o){var s={componentType:"legend",componentIndex:n.componentIndex,dataIndex:a,value:o,seriesIndex:i.seriesIndex};De(r).eventData=s},t.prototype._createSelector=function(r,n,i,a,o){var s=this.getSelectorGroup();C2(r,function(u){var c=u.type,h=new tt({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:c==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(h);var f=n.getModel("selectorLabel"),d=n.getModel(["emphasis","selectorLabel"]);Dr(h,{normal:f,emphasis:d},{defaultText:u.title}),Hs(h)})},t.prototype._createItem=function(r,n,i,a,o,s,l,u,c,h,f){var d=r.visualDrawType,g=o.get("itemWidth"),m=o.get("itemHeight"),y=o.isSelected(n),x=a.get("symbolRotate"),_=a.get("symbolKeepAspect"),w=a.get("icon");c=w||c||"roundRect";var S=_ge(c,a,l,u,d,y,f),T=new ly,M=a.getModel("textStyle");if(we(r.getLegendIcon)&&(!w||w==="inherit"))T.add(r.getLegendIcon({itemWidth:g,itemHeight:m,icon:c,iconRotate:x,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:_}));else{var A=w==="inherit"&&r.getData().getVisual("symbol")?x==="inherit"?r.getData().getVisual("symbolRotate"):x:0;T.add(bge({itemWidth:g,itemHeight:m,icon:c,iconRotate:A,itemStyle:S.itemStyle,symbolKeepAspect:_}))}var P=s==="left"?g+5:-5,I=s,N=o.get("formatter"),D=n;he(N)&&N?D=N.replace("{name}",n??""):we(N)&&(D=N(n));var O=y?M.getTextColor():a.get("inactiveColor");T.add(new tt({style:Ct(M,{text:D,x:P,y:m/2,fill:O,align:I,verticalAlign:"middle"},{inheritColor:O})}));var R=new Ze({shape:T.getBoundingRect(),style:{fill:"transparent"}}),F=a.getModel("tooltip");return F.get("show")&&Qo({el:R,componentModel:o,itemName:n,itemTooltipOption:F.option}),T.add(R),T.eachChild(function(H){H.silent=!0}),R.silent=!h,this.getContentGroup().add(T),Hs(T),T.__legendDataIndex=i,T},t.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();wu(r.get("orient"),l,r.get("itemGap"),i.width,i.height);var c=l.getBoundingRect(),h=[-c.x,-c.y];if(u.markRedraw(),l.markRedraw(),o){wu("horizontal",u,r.get("selectorItemGap",!0));var f=u.getBoundingRect(),d=[-f.x,-f.y],g=r.get("selectorButtonGap",!0),m=r.getOrient().index,y=m===0?"width":"height",x=m===0?"height":"width",_=m===0?"y":"x";s==="end"?d[m]+=c[y]+g:h[m]+=f[y]+g,d[1-m]+=c[x]/2-f[x]/2,u.x=d[0],u.y=d[1],l.x=h[0],l.y=h[1];var w={x:0,y:0};return w[y]=c[y]+g+f[y],w[x]=Math.max(c[x],f[x]),w[_]=Math.min(0,f[_]+d[1-m]),w}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(Mt);function _ge(e,t,r,n,i,a,o){function s(y,x){y.lineWidth==="auto"&&(y.lineWidth=x.lineWidth>0?2:0),C2(y,function(_,w){y[w]==="inherit"&&(y[w]=x[w])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),c=e.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?n.decal:Gh(h,o),u.fill==="inherit"&&(u.fill=n[i]),u.stroke==="inherit"&&(u.stroke=n[c]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?n:r).opacity),s(u,n);var f=t.getModel("lineStyle"),d=f.getLineStyle();if(s(d,r),u.fill==="auto"&&(u.fill=n.fill),u.stroke==="auto"&&(u.stroke=n.fill),d.stroke==="auto"&&(d.stroke=n.fill),!a){var g=t.get("inactiveBorderWidth"),m=u[c];u.lineWidth=g==="auto"?n.lineWidth>0&&m?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),d.stroke=f.get("inactiveColor"),d.lineWidth=f.get("inactiveWidth")}return{itemStyle:u,lineStyle:d}}function bge(e){var t=e.icon||"roundRect",r=sr(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return r.setStyle(e.itemStyle),r.rotation=(e.iconRotate||0)*Math.PI/180,r.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf("empty")>-1&&(r.style.stroke=r.style.fill,r.style.fill=K.color.neutral00,r.style.lineWidth=2),r}function I5(e,t,r,n){M2(e,t,r,n),r.dispatchAction({type:"legendToggleSelect",name:e??t}),T2(e,t,r,n)}function C8(e){for(var t=e.getZr().storage.getDisplayList(),r,n=0,i=t.length;ni[o],y=[-d.x,-d.y];n||(y[a]=c[u]);var x=[0,0],_=[-g.x,-g.y],w=be(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(m){var S=r.get("pageButtonPosition",!0);S==="end"?_[a]+=i[o]-g[o]:x[a]+=g[o]+w}_[1-a]+=d[s]/2-g[s]/2,c.setPosition(y),h.setPosition(x),f.setPosition(_);var T={x:0,y:0};if(T[o]=m?i[o]:d[o],T[s]=Math.max(d[s],g[s]),T[l]=Math.min(0,g[l]+_[1-a]),h.__rectSize=i[o],m){var M={x:0,y:0};M[o]=Math.max(i[o]-g[o]-w,0),M[s]=T[s],h.setClipPath(new Ze({shape:M})),h.__rectSize=M[o]}else f.eachChild(function(P){P.attr({invisible:!0,silent:!0})});var A=this._getPageInfo(r);return A.pageIndex!=null&&it(c,{x:A.contentPosition[0],y:A.contentPosition[1]},m?r:null),this._updatePageInfoView(r,A),T},t.prototype._pageGo=function(r,n,i){var a=this._getPageInfo(n)[r];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:n.id})},t.prototype._updatePageInfoView=function(r,n){var i=this._controllerGroup;j(["pagePrev","pageNext"],function(c){var h=c+"DataIndex",f=n[h]!=null,d=i.childOfName(c);d&&(d.setStyle("fill",f?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),d.cursor=f?"pointer":"default")});var a=i.childOfName("pageText"),o=r.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,u=n.pageCount;a&&o&&a.setStyle("text",he(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},t.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,o=r.getOrient().index,s=uS[o],l=cS[o],u=this._findTargetItemIndex(n),c=i.children(),h=c[u],f=c.length,d=f?1:0,g={contentPosition:[i.x,i.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return g;var m=S(h);g.contentPosition[o]=-m.s;for(var y=u+1,x=m,_=m,w=null;y<=f;++y)w=S(c[y]),(!w&&_.e>x.s+a||w&&!T(w,x.s))&&(_.i>x.i?x=_:x=w,x&&(g.pageNextDataIndex==null&&(g.pageNextDataIndex=x.i),++g.pageCount)),_=w;for(var y=u-1,x=m,_=m,w=null;y>=-1;--y)w=S(c[y]),(!w||!T(_,w.s))&&x.i<_.i&&(_=x,g.pagePrevDataIndex==null&&(g.pagePrevDataIndex=x.i),++g.pageCount,++g.pageIndex),x=w;return g;function S(M){if(M){var A=M.getBoundingRect(),P=A[l]+M[l];return{s:P,e:P+A[s],i:M.__legendDataIndex}}}function T(M,A){return M.e>=A&&M.s<=A+a}},t.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,i=this.getContentGroup(),a;return i.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===r&&(n=s)}),n??a},t.type="legend.scroll",t}(S8);function Mge(e){e.registerAction("legendScroll","legendscroll",function(t,r){var n=t.scrollDataIndex;n!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:t},function(i){i.setScrollDataIndex(n)})})}function Age(e){He(T8),e.registerComponentModel(Cge),e.registerComponentView(Tge),Mge(e)}function kge(e){He(T8),He(Age)}var Lge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="dataZoom.inside",t.defaultOption=fl(Sp.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(Sp),yL=Ye();function Nge(e,t,r){yL(e).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(t.uid);i&&(i.getRange=r)})}function Pge(e,t){for(var r=yL(e).coordSysRecordMap,n=r.keys(),i=0;ia[i+n]&&(n=u),o=o&&l.get("preventDefaultMouseMove",!0)}),{controlType:n,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o,api:r,zInfo:{component:t.model},triggerInfo:{roamTrigger:null,isInSelf:t.containsPoint}}}}function Rge(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(t,r){var n=yL(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=_e());i.each(function(a){a.dataZoomInfoMap=null}),t.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=l8(a);j(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,Ige(r,s.model)),c=u.dataZoomInfoMap||(u.dataZoomInfoMap=_e());c.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),i.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){M8(i,a);return}var c=jge(l,a,r);o.enable(c.controlType,c.opt),xf(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var Oge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="dataZoom.inside",r}return t.prototype.render=function(r,n,i){if(e.prototype.render.apply(this,arguments),r.noTarget()){this._clear();return}this.range=r.getPercentRange(),Nge(i,r,{pan:fe(hS.pan,this),zoom:fe(hS.zoom,this),scrollMove:fe(hS.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){Pge(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(cL),hS={zoom:function(e,t,r,n){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=fS[t](null,[n.originX,n.originY],o,r,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/n.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(rl(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:R5(function(e,t,r,n,i,a){var o=fS[n]([a.oldX,a.oldY],[a.newX,a.newY],t,i,r);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:R5(function(e,t,r,n,i,a){var o=fS[n]([0,0],[a.scrollDelta,a.scrollDelta],t,i,r);return o.signal*(e[1]-e[0])*a.scrollDelta})};function R5(e){return function(t,r,n,i){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s){var l=e(o,s,t,r,n,i);if(rl(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var fS={grid:function(e,t,r,n,i){var a=r.axis,o={},s=i.model.coordinateSystem.getRect();return e=e||[0,0],a.dim==="x"?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,r,n,i){var a=r.axis,o={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),r.mainType==="radiusAxis"?(o.pixel=t[0]-e[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,r,n,i){var a=r.axis,o=i.model.coordinateSystem.getRect(),s={};return e=e||[0,0],a.orient==="horizontal"?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function A8(e){hL(e),e.registerComponentModel(Lge),e.registerComponentView(Oge),Rge(e)}var zge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=fl(Sp.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:K.color.accent10,borderRadius:0,backgroundColor:K.color.transparent,dataBackground:{lineStyle:{color:K.color.accent30,width:.5},areaStyle:{color:K.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:K.color.accent40,width:.5},areaStyle:{color:K.color.accent20,opacity:.3}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:K.color.neutral00,borderColor:K.color.accent20},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:K.color.accent40,opacity:.5},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:K.color.tertiary},brushSelect:!0,brushStyle:{color:K.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:K.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}(Sp),jd=Ze,Bge=1,dS=30,Fge=7,Rd="horizontal",O5="vertical",Vge=5,Gge=["line","bar","candlestick","scatter"],Wge={easing:"cubicOut",duration:100,delay:0},Hge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._displayables={},r}return t.prototype.init=function(r,n){this.api=n,this._onBrush=fe(this._onBrush,this),this._onBrushEnd=fe(this._onBrushEnd,this)},t.prototype.render=function(r,n,i,a){if(e.prototype.render.apply(this,arguments),xf(this,"_dispatchZoomAction",r.get("throttle"),"fixRate"),this._orient=r.getOrient(),r.get("show")===!1){this.group.removeAll();return}if(r.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){lp(this,"_dispatchZoomAction");var r=this.api.getZr();r.off("mousemove",this._onBrush),r.off("mouseup",this._onBrushEnd)},t.prototype._buildView=function(){var r=this.group;r.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var n=this._displayables.sliderGroup=new Ce;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),r.add(n),this._positionGroup()},t.prototype._resetLocation=function(){var r=this.dataZoomModel,n=this.api,i=r.get("brushSelect"),a=i?Fge:0,o=Tr(r,n).refContainer,s=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===Rd?{right:o.width-s.x-s.width,top:o.height-dS-l-a,width:s.width,height:dS}:{right:l,top:s.y,width:dS,height:s.height},c=Ju(r.option);j(["right","top","width","height"],function(f){c[f]==="ph"&&(c[f]=u[f])});var h=It(c,o);this._location={x:h.x,y:h.y},this._size=[h.width,h.height],this._orient===O5&&this._size.reverse()},t.prototype._positionGroup=function(){var r=this.group,n=this._location,i=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(i===Rd&&!o?{scaleY:l?1:-1,scaleX:1}:i===Rd&&o?{scaleY:l?1:-1,scaleX:-1}:i===O5&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=r.getBoundingRect([s]);r.x=n.x-u.x,r.y=n.y-u.y,r.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var r=this.dataZoomModel,n=this._size,i=this._displayables.sliderGroup,a=r.get("brushSelect");i.add(new jd({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new jd({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:fe(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),i.add(o)},t.prototype._renderDataShadow=function(){var r=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!r)return;var n=this._size,i=this._shadowSize||[],a=r.series,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():r.otherDim;if(l==null)return;var u=this._shadowPolygonPts,c=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||n[0]!==i[0]||n[1]!==i[1]){var h=o.getDataExtent(r.thisDim),f=o.getDataExtent(l),d=(f[1]-f[0])*.3;f=[f[0]-d,f[1]+d];var g=[0,n[1]],m=[0,n[0]],y=[[n[0],0],[0,0]],x=[],_=m[1]/Math.max(1,o.count()-1),w=n[0]/(h[1]-h[0]),S=r.thisAxis.type==="time",T=-_,M=Math.round(o.count()/n[0]),A;o.each([r.thisDim,l],function(O,R,F){if(M>0&&F%M){S||(T+=_);return}T=S?(+O-h[0])*w:T+_;var H=R==null||isNaN(R)||R==="",W=H?0:ht(R,f,g,!0);H&&!A&&F?(y.push([y[y.length-1][0],0]),x.push([x[x.length-1][0],0])):!H&&A&&(y.push([T,0]),x.push([T,0])),H||(y.push([T,W]),x.push([T,W])),A=H}),u=this._shadowPolygonPts=y,c=this._shadowPolylinePts=x}this._shadowData=o,this._shadowDim=l,this._shadowSize=[n[0],n[1]];var P=this.dataZoomModel;function I(O){var R=P.getModel(O?"selectedDataBackground":"dataBackground"),F=new Ce,H=new en({shape:{points:u},segmentIgnoreThreshold:1,style:R.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),W=new Gr({shape:{points:c},segmentIgnoreThreshold:1,style:R.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return F.add(H),F.add(W),F}for(var N=0;N<3;N++){var D=I(N===1);this._displayables.sliderGroup.add(D),this._displayables.dataShadowSegs.push(D)}},t.prototype._prepareDataShadowInfo=function(){var r=this.dataZoomModel,n=r.get("showDataShadow");if(n!==!1){var i,a=this.ecModel;return r.eachTargetAxis(function(o,s){var l=r.getAxisProxy(o,s).getTargetSeriesModels();j(l,function(u){if(!i&&!(n!==!0&&Ve(Gge,u.get("type"))<0)){var c=a.getComponent(Ps(o),s).axis,h=Uge(o),f,d=u.coordinateSystem;h!=null&&d.getOtherAxis&&(f=d.getOtherAxis(c).inverse),h=u.getData().mapDimension(h);var g=u.getData().mapDimension(o);i={thisAxis:c,series:u,thisDim:g,otherDim:h,otherAxisInverse:f}}},this)},this),i}},t.prototype._renderHandle=function(){var r=this.group,n=this._displayables,i=n.handles=[null,null],a=n.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,c=l.get("borderRadius")||0,h=l.get("brushSelect"),f=n.filler=new jd({silent:h,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(f),o.add(new jd({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:c},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:Bge,fill:K.color.transparent}})),j([0,1],function(w){var S=l.get("handleIcon");!G0[S]&&S.indexOf("path://")<0&&S.indexOf("image://")<0&&(S="path://"+S);var T=sr(S,-1,0,2,2,null,!0);T.attr({cursor:Zge(this._orient),draggable:!0,drift:fe(this._onDragMove,this,w),ondragend:fe(this._onDragEnd,this),onmouseover:fe(this._showDataInfo,this,!0),onmouseout:fe(this._showDataInfo,this,!1),z2:5});var M=T.getBoundingRect(),A=l.get("handleSize");this._handleHeight=ce(A,this._size[1]),this._handleWidth=M.width/M.height*this._handleHeight,T.setStyle(l.getModel("handleStyle").getItemStyle()),T.style.strokeNoScale=!0,T.rectHover=!0,T.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),Hs(T);var P=l.get("handleColor");P!=null&&(T.style.fill=P),o.add(i[w]=T);var I=l.getModel("textStyle"),N=l.get("handleLabel")||{},D=N.show||!1;r.add(a[w]=new tt({silent:!0,invisible:!D,style:Ct(I,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:I.getTextColor(),font:I.getFont()}),z2:10}))},this);var d=f;if(h){var g=ce(l.get("moveHandleSize"),s[1]),m=n.moveHandle=new Ze({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:g}}),y=g*.8,x=n.moveHandleIcon=sr(l.get("moveHandleIcon"),-y/2,-y/2,y,y,K.color.neutral00,!0);x.silent=!0,x.y=s[1]+g/2-.5,m.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var _=Math.min(s[1]/2,Math.max(g,10));d=n.moveZone=new Ze({invisible:!0,shape:{y:s[1]-_,height:g+_}}),d.on("mouseover",function(){u.enterEmphasis(m)}).on("mouseout",function(){u.leaveEmphasis(m)}),o.add(m),o.add(x),o.add(d)}d.attr({draggable:!0,cursor:"default",drift:fe(this._onDragMove,this,"all"),ondragstart:fe(this._showDataInfo,this,!0),ondragend:fe(this._onDragEnd,this),onmouseover:fe(this._showDataInfo,this,!0),onmouseout:fe(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),n=this._getViewExtent();this._handleEnds=[ht(r[0],[0,100],n,!0),ht(r[1],[0,100],n,!0)]},t.prototype._updateInterval=function(r,n){var i=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=i.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];rl(n,a,o,i.get("zoomLock")?"all":r,s.minSpan!=null?ht(s.minSpan,l,o,!0):null,s.maxSpan!=null?ht(s.maxSpan,l,o,!0):null);var u=this._range,c=this._range=Qn([ht(a[0],o,l,!0),ht(a[1],o,l,!0)]);return!u||u[0]!==c[0]||u[1]!==c[1]},t.prototype._updateView=function(r){var n=this._displayables,i=this._handleEnds,a=Qn(i.slice()),o=this._size;j([0,1],function(d){var g=n.handles[d],m=this._handleHeight;g.attr({scaleX:m/2,scaleY:m/2,x:i[d]+(d?-1:1),y:o[1]/2-m/2})},this),n.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};n.moveHandle&&(n.moveHandle.setShape(s),n.moveZone.setShape(s),n.moveZone.getBoundingRect(),n.moveHandleIcon&&n.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=n.dataShadowSegs,u=[0,a[0],a[1],o[0]],c=0;cn[0]||i[1]<0||i[1]>n[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",i[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(r){var n=r.offsetX,i=r.offsetY;this._brushStart=new Ne(n,i),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(r){if(this._brushing){var n=this._displayables.brushRect;if(this._brushing=!1,!!n){n.attr("ignore",!0);var i=n.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(i.width)<5)){var o=this._getViewExtent(),s=[0,100],l=this._handleEnds=[i.x,i.x+i.width],u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();rl(0,l,o,0,u.minSpan!=null?ht(u.minSpan,s,o,!0):null,u.maxSpan!=null?ht(u.maxSpan,s,o,!0):null),this._range=Qn([ht(l[0],o,s,!0),ht(l[1],o,s,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(r){this._brushing&&(Wo(r.event),this._updateBrushRect(r.offsetX,r.offsetY))},t.prototype._updateBrushRect=function(r,n){var i=this._displayables,a=this.dataZoomModel,o=i.brushRect;o||(o=i.brushRect=new jd({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(r,n),c=l.transformCoordToLocal(s.x,s.y),h=this._size;u[0]=Math.max(Math.min(h[0],u[0]),0),o.setShape({x:c[0],y:0,width:u[0]-c[0],height:h[1]})},t.prototype._dispatchZoomAction=function(r){var n=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:r?Wge:null,start:n[0],end:n[1]})},t.prototype._findCoordRect=function(){var r,n=l8(this.dataZoomModel).infoList;if(!r&&n.length){var i=n[0].model.coordinateSystem;r=i.getRect&&i.getRect()}if(!r){var a=this.api.getWidth(),o=this.api.getHeight();r={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return r},t.type="dataZoom.slider",t}(cL);function Uge(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}function Zge(e){return e==="vertical"?"ns-resize":"ew-resize"}function k8(e){e.registerComponentModel(zge),e.registerComponentView(Hge),hL(e)}function $ge(e){He(A8),He(k8)}var L8={get:function(e,t,r){var n=Se((Yge[e]||{})[t]);return r&&re(n)?n[n.length-1]:n}},Yge={color:{active:["#006edd","#e0ffff"],inactive:[K.color.transparent]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},z5=Ir.mapVisual,Xge=Ir.eachVisual,qge=re,B5=j,Kge=Qn,Jge=ht,Cx=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.stateList=["inRange","outOfRange"],r.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],r.layoutMode={type:"box",ignoreSize:!0},r.dataBound=[-1/0,1/0],r.targetVisuals={},r.controllerVisuals={},r}return t.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i)},t.prototype.optionUpdated=function(r,n){var i=this.option;!n&&y8(i,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(r){var n=this.stateList;r=fe(r,this),this.controllerVisuals=_2(this.option.controller,n,r),this.targetVisuals=_2(this.option.target,n,r)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var r=this.option.seriesId,n=this.option.seriesIndex;n==null&&r==null&&(n="all");var i=lf(this.ecModel,"series",{index:n,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return ae(i,function(a){return a.componentIndex})},t.prototype.eachTargetSeries=function(r,n){j(this.getTargetSeriesIndices(),function(i){var a=this.ecModel.getSeriesByIndex(i);a&&r.call(n,a)},this)},t.prototype.isTargetSeries=function(r){var n=!1;return this.eachTargetSeries(function(i){i===r&&(n=!0)}),n},t.prototype.formatValueText=function(r,n,i){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;i=i||["<",">"],re(r)&&(r=r.slice(),u=!0);var c=n?r:u?[h(r[0]),h(r[1])]:h(r);if(he(l))return l.replace("{value}",u?c[0]:c).replace("{value2}",u?c[1]:c);if(we(l))return u?l(r[0],r[1]):l(r);if(u)return r[0]===s[0]?i[0]+" "+c[1]:r[1]===s[1]?i[1]+" "+c[0]:c[0]+" - "+c[1];return c;function h(f){return f===s[0]?"min":f===s[1]?"max":(+f).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var r=this.option,n=Kge([r.min,r.max]);this._dataExtent=n},t.prototype.getDataDimensionIndex=function(r){var n=this.option.dimension;if(n!=null)return r.getDimensionIndex(n);for(var i=r.dimensions,a=i.length-1;a>=0;a--){var o=i[a],s=r.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var r=this.ecModel,n=this.option,i={inRange:n.inRange,outOfRange:n.outOfRange},a=n.target||(n.target={}),o=n.controller||(n.controller={});Ge(a,i),Ge(o,i);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),c.call(this,o);function l(h){qge(n.color)&&!h.inRange&&(h.inRange={color:n.color.slice().reverse()}),h.inRange=h.inRange||{color:r.get("gradientColor")}}function u(h,f,d){var g=h[f],m=h[d];g&&!m&&(m=h[d]={},B5(g,function(y,x){if(Ir.isValidType(x)){var _=L8.get(x,"inactive",s);_!=null&&(m[x]=_,x==="color"&&!m.hasOwnProperty("opacity")&&!m.hasOwnProperty("colorAlpha")&&(m.opacity=[0,0]))}}))}function c(h){var f=(h.inRange||{}).symbol||(h.outOfRange||{}).symbol,d=(h.inRange||{}).symbolSize||(h.outOfRange||{}).symbolSize,g=this.get("inactiveColor"),m=this.getItemSymbol(),y=m||"roundRect";B5(this.stateList,function(x){var _=this.itemSize,w=h[x];w||(w=h[x]={color:s?g:[g]}),w.symbol==null&&(w.symbol=f&&Se(f)||(s?y:[y])),w.symbolSize==null&&(w.symbolSize=d&&Se(d)||(s?_[0]:[_[0],_[0]])),w.symbol=z5(w.symbol,function(M){return M==="none"?y:M});var S=w.symbolSize;if(S!=null){var T=-1/0;Xge(S,function(M){M>T&&(T=M)}),w.symbolSize=z5(S,function(M){return Jge(M,[0,T],[0,_[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(r){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(r){return null},t.prototype.getVisualMeta=function(r){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:K.color.transparent,borderColor:K.color.borderTint,contentColor:K.color.theme[0],inactiveColor:K.color.disabled,borderWidth:0,padding:K.size.m,textGap:10,precision:0,textStyle:{color:K.color.secondary}},t}($e),F5=[20,140],Qge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.optionUpdated=function(r,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(i){i.mappingMethod="linear",i.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var r=this.itemSize;(r[0]==null||isNaN(r[0]))&&(r[0]=F5[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=F5[1])},t.prototype._resetRange=function(){var r=this.getExtent(),n=this.option.range;!n||n.auto?(r.auto=1,this.option.range=r):re(n)&&(n[0]>n[1]&&n.reverse(),n[0]=Math.max(n[0],r[0]),n[1]=Math.min(n[1],r[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),j(this.stateList,function(r){var n=this.option.controller[r].symbolSize;n&&n[0]!==n[1]&&(n[0]=n[1]/3)},this)},t.prototype.setSelected=function(r){this.option.range=r.slice(),this._resetRange()},t.prototype.getSelected=function(){var r=this.getExtent(),n=Qn((this.get("range")||[]).slice());return n[0]>r[1]&&(n[0]=r[1]),n[1]>r[1]&&(n[1]=r[1]),n[0]=i[1]||r<=n[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(r){var n=[];return this.eachTargetSeries(function(i){var a=[],o=i.getData();o.each(this.getDataDimensionIndex(o),function(s,l){r[0]<=s&&s<=r[1]&&a.push(l)},this),n.push({seriesId:i.id,dataIndex:a})},this),n},t.prototype.getVisualMeta=function(r){var n=V5(this,"outOfRange",this.getExtent()),i=V5(this,"inRange",this.option.range.slice()),a=[];function o(d,g){a.push({value:d,color:r(d,g)})}for(var s=0,l=0,u=i.length,c=n.length;lr[1])break;a.push({color:this.getControllerVisual(l,"color",n),offset:s/i})}return a.push({color:this.getControllerVisual(r[1],"color",n),offset:1}),a},t.prototype._createBarPoints=function(r,n){var i=this.visualMapModel.itemSize;return[[i[0]-n[0],r[0]],[i[0],r[0]],[i[0],r[1]],[i[0]-n[1],r[1]]]},t.prototype._createBarGroup=function(r){var n=this._orient,i=this.visualMapModel.get("inverse");return new Ce(n==="horizontal"&&!i?{scaleX:r==="bottom"?1:-1,rotation:Math.PI/2}:n==="horizontal"&&i?{scaleX:r==="bottom"?-1:1,rotation:-Math.PI/2}:n==="vertical"&&!i?{scaleX:r==="left"?1:-1,scaleY:-1}:{scaleX:r==="left"?1:-1})},t.prototype._updateHandle=function(r,n){if(this._useHandle){var i=this._shapes,a=this.visualMapModel,o=i.handleThumbs,s=i.handleLabels,l=a.itemSize,u=a.getExtent(),c=this._applyTransform("left",i.mainGroup);eme([0,1],function(h){var f=o[h];f.setStyle("fill",n.handlesColor[h]),f.y=r[h];var d=ka(r[h],[0,l[1]],u,!0),g=this.getControllerVisual(d,"symbolSize");f.scaleX=f.scaleY=g/l[0],f.x=l[0]-g/2;var m=sa(i.handleLabelPoints[h],Us(f,this.group));if(this._orient==="horizontal"){var y=c==="left"||c==="top"?(l[0]-g)/2:(l[0]-g)/-2;m[1]+=y}s[h].setStyle({x:m[0],y:m[1],text:a.formatValueText(this._dataInterval[h]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",i.mainGroup):"center"})},this)}},t.prototype._showIndicator=function(r,n,i,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],c=this._shapes,h=c.indicator;if(h){h.attr("invisible",!1);var f={convertOpacityToAlpha:!0},d=this.getControllerVisual(r,"color",f),g=this.getControllerVisual(r,"symbolSize"),m=ka(r,s,u,!0),y=l[0]-g/2,x={x:h.x,y:h.y};h.y=m,h.x=y;var _=sa(c.indicatorLabelPoint,Us(h,this.group)),w=c.indicatorLabel;w.attr("invisible",!1);var S=this._applyTransform("left",c.mainGroup),T=this._orient,M=T==="horizontal";w.setStyle({text:(i||"")+o.formatValueText(n),verticalAlign:M?S:"middle",align:M?"center":S});var A={x:y,y:m,style:{fill:d}},P={style:{x:_[0],y:_[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var I={duration:100,easing:"cubicInOut",additive:!0};h.x=x.x,h.y=x.y,h.animateTo(A,I),w.animateTo(P,I)}else h.attr(A),w.attr(P);this._firstShowIndicator=!1;var N=this._shapes.handleLabels;if(N)for(var D=0;Do[1]&&(h[1]=1/0),n&&(h[0]===-1/0?this._showIndicator(c,h[1],"< ",l):h[1]===1/0?this._showIndicator(c,h[0],"> ",l):this._showIndicator(c,c,"≈ ",l));var f=this._hoverLinkDataIndices,d=[];(n||U5(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(h));var g=Oq(f,d);this._dispatchHighDown("downplay",Wy(g[0],i)),this._dispatchHighDown("highlight",Wy(g[1],i))}},t.prototype._hoverLinkFromSeriesMouseOver=function(r){var n;if(vu(r.target,function(l){var u=De(l);if(u.dataIndex!=null)return n=u,!0},!0),!!n){var i=this.ecModel.getSeriesByIndex(n.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(i)){var o=i.getData(n.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),n.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},t.prototype._hideIndicator=function(){var r=this._shapes;r.indicator&&r.indicator.attr("invisible",!0),r.indicatorLabel&&r.indicatorLabel.attr("invisible",!0);var n=this._shapes.handleLabels;if(n)for(var i=0;i=0&&(a.dimension=o,n.push(a))}}),e.getData().setVisual("visualMeta",n)}}];function lme(e,t,r,n){for(var i=t.targetVisuals[n],a=Ir.prepareVisualTypes(i),o={color:Yp(e.getData(),"color")},s=0,l=a.length;s0:t.splitNumber>0)||t.calculable)?"continuous":"piecewise"}),e.registerAction(ame,ome),j(sme,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(ume))}function D8(e){e.registerComponentModel(Qge),e.registerComponentView(nme),I8(e)}var cme=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._pieceList=[],r}return t.prototype.optionUpdated=function(r,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],hme[this._mode].call(this,this._pieceList),this._resetSelected(r,n);var a=this.option.categories;this.resetVisual(function(o,s){i==="categories"?(o.mappingMethod="category",o.categories=Se(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=ae(this._pieceList,function(l){return l=Se(l),s!=="inRange"&&(l.visual=null),l}))})},t.prototype.completeVisualOption=function(){var r=this.option,n={},i=Ir.listVisualTypes(),a=this.isCategory();j(r.pieces,function(s){j(i,function(l){s.hasOwnProperty(l)&&(n[l]=1)})}),j(n,function(s,l){var u=!1;j(this.stateList,function(c){u=u||o(r,c,l)||o(r.target,c,l)},this),!u&&j(this.stateList,function(c){(r[c]||(r[c]={}))[l]=L8.get(l,c==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(r,n){var i=this.option,a=this._pieceList,o=(n?i:r).selected||{};if(i.selected=o,j(a,function(l,u){var c=this.getSelectedMapKey(l);o.hasOwnProperty(c)||(o[c]=!0)},this),i.selectedMode==="single"){var s=!1;j(a,function(l,u){var c=this.getSelectedMapKey(l);o[c]&&(s?o[c]=!1:s=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get("itemSymbol")},t.prototype.getSelectedMapKey=function(r){return this._mode==="categories"?r.value+"":r.index+""},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var r=this.option;return r.pieces&&r.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(r){this.option.selected=Se(r)},t.prototype.getValueState=function(r){var n=Ir.findPieceIndex(r,this._pieceList);return n!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[n])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(r){var n=[],i=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var c=Ir.findPieceIndex(l,i);c===r&&o.push(u)},this),n.push({seriesId:a.id,dataIndex:o})},this),n},t.prototype.getRepresentValue=function(r){var n;if(this.isCategory())n=r.value;else if(r.value!=null)n=r.value;else{var i=r.interval||[];n=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return n},t.prototype.getVisualMeta=function(r){if(this.isCategory())return;var n=[],i=["",""],a=this;function o(c,h){var f=a.getRepresentValue({interval:c});h||(h=a.getValueState(f));var d=r(f,h);c[0]===-1/0?i[0]=d:c[1]===1/0?i[1]=d:n.push({value:c[0],color:d},{value:c[1],color:d})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return j(s,function(c){var h=c.interval;h&&(h[0]>u&&o([u,h[0]],"outOfRange"),o(h.slice()),u=h[1])},this),{stops:n,outerColors:i}},t.type="visualMap.piecewise",t.defaultOption=fl(Cx.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(Cx),hme={splitNumber:function(e){var t=this.option,r=Math.min(t.precision,20),n=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var a=(n[1]-n[0])/i;+a.toFixed(r)!==a&&r<5;)r++;t.precision=r,a=+a.toFixed(r),t.minOpen&&e.push({interval:[-1/0,n[0]],close:[0,0]});for(var o=0,s=n[0];o","≥"][n[0]]];r.text=r.text||this.formatValueText(r.value!=null?r.value:r.interval,!1,i)},this)}};function X5(e,t){var r=e.inverse;(e.orient==="vertical"?!r:r)&&t.reverse()}var fme=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.doRender=function(){var r=this.group;r.removeAll();var n=this.visualMapModel,i=n.get("textGap"),a=n.textStyleModel,o=this._getItemAlign(),s=n.itemSize,l=this._getViewData(),u=l.endsText,c=Fr(n.get("showLabel",!0),!u),h=!n.get("selectedMode");u&&this._renderEndsText(r,u[0],s,c,o),j(l.viewPieceList,function(f){var d=f.piece,g=new Ce;g.onclick=fe(this._onItemClick,this,d),this._enableHoverLink(g,f.indexInModelPieceList);var m=n.getRepresentValue(d);if(this._createItemSymbol(g,m,[0,0,s[0],s[1]],h),c){var y=this.visualMapModel.getValueState(m),x=a.get("align")||o;g.add(new tt({style:Ct(a,{x:x==="right"?-i:s[0]+i,y:s[1]/2,text:d.text,verticalAlign:a.get("verticalAlign")||"middle",align:x,opacity:be(a.get("opacity"),y==="outOfRange"?.5:1)}),silent:h}))}r.add(g)},this),u&&this._renderEndsText(r,u[1],s,c,o),wu(n.get("orient"),r,n.get("itemGap")),this.renderBackground(r),this.positionGroup(r)},t.prototype._enableHoverLink=function(r,n){var i=this;r.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=i.visualMapModel;s.option.hoverLink&&i.api.dispatchAction({type:o,batch:Wy(s.findTargetDataIndices(n),s)})}},t.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return P8(r,this.api,r.itemSize);var i=n.align;return(!i||i==="auto")&&(i="left"),i},t.prototype._renderEndsText=function(r,n,i,a,o){if(n){var s=new Ce,l=this.visualMapModel.textStyleModel;s.add(new tt({style:Ct(l,{x:a?o==="right"?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:a?o:"center",text:n})})),r.add(s)}},t.prototype._getViewData=function(){var r=this.visualMapModel,n=ae(r.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),i=r.get("text"),a=r.get("orient"),o=r.get("inverse");return(a==="horizontal"?o:!o)?n.reverse():i&&(i=i.slice().reverse()),{viewPieceList:n,endsText:i}},t.prototype._createItemSymbol=function(r,n,i,a){var o=sr(this.getControllerVisual(n,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(n,"color"));o.silent=a,r.add(o)},t.prototype._onItemClick=function(r){var n=this.visualMapModel,i=n.option,a=i.selectedMode;if(a){var o=Se(i.selected),s=n.getSelectedMapKey(r);a==="single"||a===!0?(o[s]=!0,j(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},t.type="visualMap.piecewise",t}(N8);function E8(e){e.registerComponentModel(cme),e.registerComponentView(fme),I8(e)}function dme(e){He(D8),He(E8)}var vme=function(){function e(t){this._thumbnailModel=t}return e.prototype.reset=function(t){this._renderVersion=t.getMainProcessVersion()},e.prototype.renderContent=function(t){var r=t.api.getViewOfComponentModel(this._thumbnailModel);r&&(t.group.silent=!0,r.renderContent({group:t.group,targetTrans:t.targetTrans,z2Range:i6(t.group),roamType:t.roamType,viewportRect:t.viewportRect,renderVersion:this._renderVersion}))},e.prototype.updateWindow=function(t,r){var n=r.getViewOfComponentModel(this._thumbnailModel);n&&n.updateWindow({targetTrans:t,renderVersion:this._renderVersion})},e}(),pme=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.preventAutoZ=!0,r}return t.prototype.optionUpdated=function(r,n){this._updateBridge()},t.prototype._updateBridge=function(){var r=this._birdge=this._birdge||new vme(this);if(this._target=null,this.ecModel.eachSeries(function(i){_R(i,null)}),this.shouldShow()){var n=this.getTarget();_R(n.baseMapProvider,r)}},t.prototype.shouldShow=function(){return this.getShallow("show",!0)},t.prototype.getBridge=function(){return this._birdge},t.prototype.getTarget=function(){if(this._target)return this._target;var r=this.getReferringComponents("series",{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];return r?r.subType!=="graph"&&(r=null):r=this.ecModel.queryComponents({mainType:"series",subType:"graph"})[0],this._target={baseMapProvider:r},this._target},t.type="thumbnail",t.layoutMode="box",t.dependencies=["series","geo"],t.defaultOption={show:!0,right:1,bottom:1,height:"25%",width:"25%",itemStyle:{borderColor:K.color.border,borderWidth:2},windowStyle:{borderWidth:1,color:K.color.neutral30,borderColor:K.color.neutral40,opacity:.3},z:10},t}($e),gme=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){if(this._api=i,this._model=r,this._coordSys||(this._coordSys=new nc),!this._isEnabled()){this._clear();return}this._renderVersion=i.getMainProcessVersion();var a=this.group;a.removeAll();var o=r.getModel("itemStyle"),s=o.getItemStyle();s.fill==null&&(s.fill=n.get("backgroundColor")||K.color.neutral00);var l=Tr(r,i).refContainer,u=It(C6(r,!0),l),c=s.lineWidth||0,h=this._contentRect=Bu(u.clone(),c/2,!0,!0),f=new Ce;a.add(f),f.setClipPath(new Ze({shape:h.plain()}));var d=this._targetGroup=new Ce;f.add(d);var g=u.plain();g.r=o.getShallow("borderRadius",!0),a.add(this._bgRect=new Ze({style:s,shape:g,silent:!1,cursor:"grab"}));var m=r.getModel("windowStyle"),y=m.getShallow("borderRadius",!0);f.add(this._windowRect=new Ze({shape:{x:0,y:0,width:0,height:0,r:y},style:m.getItemStyle(),silent:!1,cursor:"grab"})),this._dealRenderContent(),this._dealUpdateWindow(),K5(r,this)},t.prototype.renderContent=function(r){this._bridgeRendered=r,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),K5(this._model,this))},t.prototype._dealRenderContent=function(){var r=this._bridgeRendered;if(!(!r||r.renderVersion!==this._renderVersion)){var n=this._targetGroup,i=this._coordSys,a=this._contentRect;if(n.removeAll(),!!r){var o=r.group,s=o.getBoundingRect();n.add(o),this._bgRect.z2=r.z2Range.min-10,i.setBoundingRect(s.x,s.y,s.width,s.height);var l=It({left:"center",top:"center",aspect:s.width/s.height},a);i.setViewRect(l.x,l.y,l.width,l.height),o.attr(i.getTransformInfo().raw),this._windowRect.z2=r.z2Range.max+10,this._resetRoamController(r.roamType)}}},t.prototype.updateWindow=function(r){var n=this._bridgeRendered;n&&n.renderVersion===r.renderVersion&&(n.targetTrans=r.targetTrans),this._isEnabled()&&this._dealUpdateWindow()},t.prototype._dealUpdateWindow=function(){var r=this._bridgeRendered;if(!(!r||r.renderVersion!==this._renderVersion)){var n=ji([],r.targetTrans),i=aa([],this._coordSys.transform,n);this._transThisToTarget=ji([],i);var a=r.viewportRect;a?a=a.clone():a=new Pe(0,0,this._api.getWidth(),this._api.getHeight()),a.applyTransform(i);var o=this._windowRect,s=o.shape.r;o.setShape(Ae({r:s},a))}},t.prototype._resetRoamController=function(r){var n=this,i=this._api,a=this._roamController;if(a||(a=this._roamController=new rc(i.getZr())),!r||!this._isEnabled()){a.disable();return}a.enable(r,{api:i,zInfo:{component:this._model},triggerInfo:{roamTrigger:null,isInSelf:function(o,s,l){return n._contentRect.contain(s,l)}}}),a.off("pan").off("zoom").on("pan",fe(this._onPan,this)).on("zoom",fe(this._onZoom,this))},t.prototype._onPan=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=Kt([],[r.oldX,r.oldY],n),a=Kt([],[r.oldX-r.dx,r.oldY-r.dy],n);this._api.dispatchAction(q5(this._model.getTarget().baseMapProvider,{dx:a[0]-i[0],dy:a[1]-i[1]}))}},t.prototype._onZoom=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=Kt([],[r.originX,r.originY],n);this._api.dispatchAction(q5(this._model.getTarget().baseMapProvider,{zoom:1/r.scale,originX:i[0],originY:i[1]}))}},t.prototype._isEnabled=function(){var r=this._model;if(!r||!r.shouldShow())return!1;var n=r.getTarget().baseMapProvider;return!!n},t.prototype._clear=function(){this.group.removeAll(),this._bridgeRendered=null,this._roamController&&this._roamController.disable()},t.prototype.remove=function(){this._clear()},t.prototype.dispose=function(){this._clear()},t.type="thumbnail",t}(Mt);function q5(e,t){var r=e.mainType==="series"?e.subType+"Roam":e.mainType+"Roam",n={type:r};return n[e.mainType+"Id"]=e.id,Q(n,t),n}function K5(e,t){var r=Fu(e);w_(t.group,r.z,r.zlevel)}function mme(e){e.registerComponentModel(pme),e.registerComponentView(gme)}var yme={label:{enabled:!0},decal:{show:!1}},J5=Ye(),xme={};function _me(e,t){var r=e.getModel("aria");if(!r.get("enabled"))return;var n=Se(yme);Ge(n.label,e.getLocaleModel().get("aria"),!1),Ge(r.option,n,!1),i(),a();function i(){var u=r.getModel("decal"),c=u.get("show");if(c){var h=_e();e.eachSeries(function(f){if(!f.isColorBySeries()){var d=h.get(f.type);d||(d={},h.set(f.type,d)),J5(f).scope=d}}),e.eachRawSeries(function(f){if(e.isSeriesFiltered(f))return;if(we(f.enableAriaDecal)){f.enableAriaDecal();return}var d=f.getData();if(f.isColorBySeries()){var _=fT(f.ecModel,f.name,xme,e.getSeriesCount()),w=d.getVisual("decal");d.setVisual("decal",S(w,_))}else{var g=f.getRawData(),m={},y=J5(f).scope;d.each(function(T){var M=d.getRawIndex(T);m[M]=T});var x=g.count();g.each(function(T){var M=m[T],A=g.getName(T)||T+"",P=fT(f.ecModel,A,y,x),I=d.getItemVisual(M,"decal");d.setItemVisual(M,"decal",S(I,P))})}function S(T,M){var A=T?Q(Q({},M),T):M;return A.dirty=!0,A}})}}function a(){var u=t.getZr().dom;if(u){var c=e.getLocaleModel().get("aria"),h=r.getModel("label");if(h.option=Ae(h.option,c),!!h.get("enabled")){if(u.setAttribute("role","img"),h.get("description")){u.setAttribute("aria-label",h.get("description"));return}var f=e.getSeriesCount(),d=h.get(["data","maxCount"])||10,g=h.get(["series","maxCount"])||10,m=Math.min(f,g),y;if(!(f<1)){var x=s();if(x){var _=h.get(["general","withTitle"]);y=o(_,{title:x})}else y=h.get(["general","withoutTitle"]);var w=[],S=f>1?h.get(["series","multiple","prefix"]):h.get(["series","single","prefix"]);y+=o(S,{seriesCount:f}),e.eachSeries(function(P,I){if(I1?h.get(["series","multiple",O]):h.get(["series","single",O]),N=o(N,{seriesId:P.seriesIndex,seriesName:P.get("name"),seriesType:l(P.subType)});var R=P.getData();if(R.count()>d){var F=h.get(["data","partialData"]);N+=o(F,{displayCnt:d})}else N+=h.get(["data","allData"]);for(var H=h.get(["data","separator","middle"]),W=h.get(["data","separator","end"]),V=h.get(["data","excludeDimensionId"]),z=[],Z=0;Z":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},Sme=function(){function e(t){var r=this._condVal=he(t)?new RegExp(t):kB(t)?t:null;if(r==null){var n="";ft(n)}}return e.prototype.evaluate=function(t){var r=typeof t;return he(r)?this._condVal.test(t):rt(r)?this._condVal.test(t+""):!1},e}(),Cme=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),Tme=function(){function e(){}return e.prototype.evaluate=function(){for(var t=this.children,r=0;r2&&n.push(i),i=[R,F]}function c(R,F,H,W){hh(R,H)&&hh(F,W)||i.push(R,F,H,W,H,W)}function h(R,F,H,W,V,z){var Z=Math.abs(F-R),U=Math.tan(Z/4)*4/3,$=FP:D2&&n.push(i),n}function k2(e,t,r,n,i,a,o,s,l,u){if(hh(e,r)&&hh(t,n)&&hh(i,o)&&hh(a,s)){l.push(o,s);return}var c=2/u,h=c*c,f=o-e,d=s-t,g=Math.sqrt(f*f+d*d);f/=g,d/=g;var m=r-e,y=n-t,x=i-o,_=a-s,w=m*m+y*y,S=x*x+_*_;if(w=0&&P=0){l.push(o,s);return}var I=[],N=[];Qs(e,r,i,o,.5,I),Qs(t,n,a,s,.5,N),k2(I[0],N[0],I[1],N[1],I[2],N[2],I[3],N[3],l,u),k2(I[4],N[4],I[5],N[5],I[6],N[6],I[7],N[7],l,u)}function Bme(e,t){var r=A2(e),n=[];t=t||1;for(var i=0;i0)for(var u=0;uMath.abs(u),h=R8([l,u],c?0:1,t),f=(c?s:u)/h.length,d=0;di,o=R8([n,i],a?0:1,t),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",h=e[s]/o.length,f=0;f1?null:new Ne(m*l+e,m*u+t)}function Gme(e,t,r){var n=new Ne;Ne.sub(n,r,t),n.normalize();var i=new Ne;Ne.sub(i,e,t);var a=i.dot(n);return a}function Fc(e,t){var r=e[e.length-1];r&&r[0]===t[0]&&r[1]===t[1]||e.push(t)}function Wme(e,t,r){for(var n=e.length,i=[],a=0;ao?(u.x=c.x=s+a/2,u.y=l,c.y=l+o):(u.y=c.y=l+o/2,u.x=s,c.x=s+a),Wme(t,u,c)}function Tx(e,t,r,n){if(r===1)n.push(t);else{var i=Math.floor(r/2),a=e(t);Tx(e,a[0],i,n),Tx(e,a[1],r-i,n)}return n}function Hme(e,t){for(var r=[],n=0;n0;u/=2){var c=0,h=0;(e&u)>0&&(c=1),(t&u)>0&&(h=1),s+=u*u*(3*c^h),h===0&&(c===1&&(e=u-1-e,t=u-1-t),l=e,e=t,t=l)}return s}function kx(e){var t=1/0,r=1/0,n=-1/0,i=-1/0,a=ae(e,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),h=l.y+l.height/2+(u?u[5]:0);return t=Math.min(c,t),r=Math.min(h,r),n=Math.max(c,n),i=Math.max(h,i),[c,h]}),o=ae(a,function(s,l){return{cp:s,z:Qme(s[0],s[1],t,r,n,i),path:e[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function B8(e){return $me(e.path,e.count)}function L2(){return{fromIndividuals:[],toIndividuals:[],count:0}}function eye(e,t,r){var n=[];function i(T){for(var M=0;M=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var rye={clone:function(e){for(var t=[],r=1-Math.pow(1-e.path.style.opacity,1/e.count),n=0;n0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,c;s3(e)&&(u=e,c=t),s3(t)&&(u=t,c=e);function h(x,_,w,S,T){var M=x.many,A=x.one;if(M.length===1&&!T){var P=_?M[0]:A,I=_?A:M[0];if(Mx(P))h({many:[P],one:I},!0,w,S,!0);else{var N=s?Ae({delay:s(w,S)},l):l;_L(P,I,N),a(P,I,P,I,N)}}else for(var D=Ae({dividePath:rye[r],individualDelay:s&&function(V,z,Z,U){return s(V+w,S)}},l),O=_?eye(M,A,D):tye(A,M,D),R=O.fromIndividuals,F=O.toIndividuals,H=R.length,W=0;Wt.length,d=u?l3(c,u):l3(f?t:e,[f?e:t]),g=0,m=0;mF8))for(var a=n.getIndices(),o=0;o0&&M.group.traverse(function(P){P instanceof Ke&&!P.animators.length&&P.animateFrom({style:{opacity:0}},A)})})}function d3(e){var t=e.getModel("universalTransition").get("seriesKey");return t||e.id}function v3(e){return re(e)?e.sort().join(","):e}function ys(e){if(e.hostModel)return e.hostModel.getModel("universalTransition").get("divideShape")}function uye(e,t){var r=_e(),n=_e(),i=_e();return j(e.oldSeries,function(a,o){var s=e.oldDataGroupIds[o],l=e.oldData[o],u=d3(a),c=v3(u);n.set(c,{dataGroupId:s,data:l}),re(u)&&j(u,function(h){i.set(h,{key:c,dataGroupId:s,data:l})})}),j(t.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=d3(a),u=v3(l),c=n.get(u);if(c)r.set(u,{oldSeries:[{dataGroupId:c.dataGroupId,divide:ys(c.data),data:c.data}],newSeries:[{dataGroupId:o,divide:ys(s),data:s}]});else if(re(l)){var h=[];j(l,function(g){var m=n.get(g);m.data&&h.push({dataGroupId:m.dataGroupId,divide:ys(m.data),data:m.data})}),h.length&&r.set(u,{oldSeries:h,newSeries:[{dataGroupId:o,data:s,divide:ys(s)}]})}else{var f=i.get(l);if(f){var d=r.get(f.key);d||(d={oldSeries:[{dataGroupId:f.dataGroupId,data:f.data,divide:ys(f.data)}],newSeries:[]},r.set(f.key,d)),d.newSeries.push({dataGroupId:o,data:s,divide:ys(s)})}}}}),r}function p3(e,t){for(var r=0;r=0&&i.push({dataGroupId:t.oldDataGroupIds[s],data:t.oldData[s],divide:ys(t.oldData[s]),groupIdDim:o.dimension})}),j(Tt(e.to),function(o){var s=p3(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:t.oldDataGroupIds[s],data:l,divide:ys(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&V8(i,a,n)}function hye(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){j(Tt(n.seriesTransition),function(i){j(Tt(i.to),function(a){for(var o=n.updatedSeries,s=0;so.vmin?r+=o.vmin-n+(t-o.vmin)/(o.vmax-o.vmin)*o.gapReal:r+=t-n,n=o.vmax,i=!1;break}r+=o.vmin-n+o.gapReal,n=o.vmax}return i&&(r+=t-n),r},e.prototype.unelapse=function(t){for(var r=g3,n=m3,i=!0,a=0,o=0;ol?a=s.vmin+(t-l)/(u-l)*(s.vmax-s.vmin):a=n+t-r,n=s.vmax,i=!1;break}r=u,n=s.vmax}return i&&(a=n+t-r),a},e}();function dye(){return new fye}var g3=0,m3=0;function vye(e,t){var r=0,n={tpAbs:{span:0,val:0},tpPrct:{span:0,val:0}},i=function(){return{has:!1,span:NaN,inExtFrac:NaN,val:NaN}},a={S:{tpAbs:i(),tpPrct:i()},E:{tpAbs:i(),tpPrct:i()}};j(e.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=bL(s,t);if(u){var c=u.vmin!==s.vmin,h=u.vmax!==s.vmax,f=u.vmax-u.vmin;if(!(c&&h))if(c||h){var d=c?"S":"E";a[d][l.type].has=!0,a[d][l.type].span=f,a[d][l.type].inExtFrac=f/(s.vmax-s.vmin),a[d][l.type].val=l.val}else n[l.type].span+=f,n[l.type].val+=l.val}});var o=r*(0+(t[1]-t[0])+(n.tpAbs.val-n.tpAbs.span)+(a.S.tpAbs.has?(a.S.tpAbs.val-a.S.tpAbs.span)*a.S.tpAbs.inExtFrac:0)+(a.E.tpAbs.has?(a.E.tpAbs.val-a.E.tpAbs.span)*a.E.tpAbs.inExtFrac:0)-n.tpPrct.span-(a.S.tpPrct.has?a.S.tpPrct.span*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.span*a.E.tpPrct.inExtFrac:0))/(1-n.tpPrct.val-(a.S.tpPrct.has?a.S.tpPrct.val*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.val*a.E.tpPrct.inExtFrac:0));j(e.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(s.gapReal=r!==0?Math.max(o,0)*l.val/r:0),l.type==="tpAbs"&&(s.gapReal=l.val),s.gapReal==null&&(s.gapReal=0)})}function pye(e,t,r,n,i,a){e!=="no"&&j(r,function(o){var s=bL(o,a);if(s)for(var l=t.length-1;l>=0;l--){var u=t[l],c=n(u),h=i*3/4;c>s.vmin-h&&ct[0]&&r=0&&o<1-1e-5}j(e,function(o){if(!(!o||o.start==null||o.end==null)&&!o.isExpanded){var s={breakOption:Se(o),vmin:t(o.start),vmax:t(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if(he(o.gap)){var u=Jn(o.gap);if(u.match(/%$/)){var c=parseFloat(u)/100;i(c)||(c=0),s.gapParsed.type="tpPrct",s.gapParsed.val=c,l=!0}}if(!l){var h=t(o.gap);(!isFinite(h)||h<0)&&(h=0),s.gapParsed.type="tpAbs",s.gapParsed.val=h}}if(s.vmin===s.vmax&&(s.gapParsed.type="tpAbs",s.gapParsed.val=0),r&&r.noNegative&&j(["vmin","vmax"],function(d){s[d]<0&&(s[d]=0)}),s.vmin>s.vmax){var f=s.vmax;s.vmax=s.vmin,s.vmin=f}n.push(s)}}),n.sort(function(o,s){return o.vmin-s.vmin});var a=-1/0;return j(n,function(o,s){a>o.vmin&&(n[s]=null),a=o.vmax}),{breaks:n.filter(function(o){return!!o})}}function wL(e,t){return P2(t)===P2(e)}function P2(e){return e.start+"_\0_"+e.end}function mye(e,t,r){var n=[];j(e,function(a,o){var s=t(a);s&&s.type==="vmin"&&n.push([o])}),j(e,function(a,o){var s=t(a);if(s&&s.type==="vmax"){var l=ul(n,function(u){return wL(t(e[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return j(n,function(a){a.length===2&&i.push(r?a:[e[a[0]],e[a[1]]])}),i}function yye(e,t,r,n){var i,a;if(e.break){var o=e.break.parsedBreak,s=ul(r,function(h){return wL(h.breakOption,e.break.parsedBreak.breakOption)}),l=n(Math.pow(t,o.vmin),s.vmin),u=n(Math.pow(t,o.vmax),s.vmax),c={type:o.gapParsed.type,val:o.gapParsed.type==="tpAbs"?ir(Math.pow(t,o.vmin+o.gapParsed.val))-l:o.gapParsed.val};i={type:e.break.type,parsedBreak:{breakOption:o.breakOption,vmin:l,vmax:u,gapParsed:c,gapReal:o.gapReal}},a=s[e.break.type]}return{brkRoundingCriterion:a,vBreak:i}}function xye(e,t,r){var n={noNegative:!0},i=N2(e,r,n),a=N2(e,r,n),o=Math.log(t);return a.breaks=ae(a.breaks,function(s){var l=Math.log(s.vmin)/o,u=Math.log(s.vmax)/o,c={type:s.gapParsed.type,val:s.gapParsed.type==="tpAbs"?Math.log(s.vmin+s.gapParsed.val)/o-l:s.gapParsed.val};return{vmin:l,vmax:u,gapParsed:c,gapReal:s.gapReal,breakOption:s.breakOption}}),{parsedOriginal:i,parsedLogged:a}}var _ye={vmin:"start",vmax:"end"};function bye(e,t){return t&&(e=e||{},e.break={type:_ye[t.type],start:t.parsedBreak.vmin,end:t.parsedBreak.vmax}),e}function wye(){HJ({createScaleBreakContext:dye,pruneTicksByBreak:pye,addBreaksToTicks:gye,parseAxisBreakOption:N2,identifyAxisBreak:wL,serializeAxisBreakIdentifier:P2,retrieveAxisBreakPairs:mye,getTicksLogTransformBreak:yye,logarithmicParseBreaksFromOption:xye,makeAxisLabelFormatterParamBreak:bye})}var y3=Ye();function Sye(e,t){var r=ul(e,function(n){return vr().identifyAxisBreak(n.parsedBreak.breakOption,t.breakOption)});return r||e.push(r={zigzagRandomList:[],parsedBreak:t,shouldRemove:!1}),r}function Cye(e){j(e,function(t){return t.shouldRemove=!0})}function Tye(e){for(var t=e.length-1;t>=0;t--)e[t].shouldRemove&&e.splice(t,1)}function Mye(e,t,r,n,i){var a=r.axis;if(a.scale.isBlank()||!vr())return;var o=vr().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(I){return I.break},!1);if(!o.length)return;var s=r.getModel("breakArea"),l=s.get("zigzagAmplitude"),u=s.get("zigzagMinSpan"),c=s.get("zigzagMaxSpan");u=Math.max(2,u||0),c=Math.max(u,c||0);var h=s.get("expandOnClick"),f=s.get("zigzagZ"),d=s.getModel("itemStyle"),g=d.getItemStyle(),m=g.stroke,y=g.lineWidth,x=g.lineDash,_=g.fill,w=new Ce({ignoreModelZ:!0}),S=a.isHorizontal(),T=y3(t).visualList||(y3(t).visualList=[]);Cye(T);for(var M=function(I){var N=o[I][0].break.parsedBreak,D=[];D[0]=a.toGlobalCoord(a.dataToCoord(N.vmin,!0)),D[1]=a.toGlobalCoord(a.dataToCoord(N.vmax,!0)),D[1]=z;le&&(te=z);var Ee=[],me=[];Ee[W]=D,me[W]=O,!se&&!le&&(Ee[W]+=Y?-l:l,me[W]-=Y?l:-l),Ee[V]=te,me[V]=te,U.push(Ee),$.push(me);var ye=void 0;if(ie_[1]&&_.reverse(),{coordPair:_,brkId:vr().serializeAxisBreakIdentifier(x.breakOption)}});l.sort(function(y,x){return y.coordPair[0]-x.coordPair[0]});for(var u=o[0],c=null,h=0;h=0?l[0].width:l[1].width),f=(h+c.x)/2-u.x,d=Math.min(f,f-c.x),g=Math.max(f,f-c.x),m=g<0?g:d>0?d:0;s=(f-m)/c.x}var y=new Ne,x=new Ne;Ne.scale(y,n,-s),Ne.scale(x,n,1-s),IT(r[0],y),IT(r[1],x)}function Lye(e,t){var r={breaks:[]};return j(t.breaks,function(n){if(n){var i=ul(e.get("breaks",!0),function(s){return vr().identifyAxisBreak(s,n)});if(i){var a=t.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===D_?!0:a===lW?!1:a===uW?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),r}function Nye(){Tae({adjustBreakLabelPair:kye,buildAxisBreakLine:Aye,rectCoordBuildBreakAxis:Mye,updateModelAxisBreak:Lye})}function Pye(e){Pae(e),wye(),Nye()}function Iye(){Jae(Dye)}function Dye(e,t){j(e,function(r){if(!r.model.get(["axisLabel","inside"])){var n=Eye(r);if(n){var i=r.isHorizontal()?"height":"width",a=r.model.get(["axisLabel","margin"]);t[i]-=n[i]+a,r.position==="top"?t.y+=n.height+a:r.position==="left"&&(t.x+=n.width+a)}}})}function Eye(e){var t=e.model,r=e.scale;if(!t.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof Wh?i=r.count():(n=r.getTicks(),i=n.length);var o=e.getLabelModel(),s=wf(e),l,u=1;i>40&&(u=Math.ceil(i/40));for(var c=0;c1&&arguments[1]!==void 0?arguments[1]:60,i=null;return function(){for(var a=this,o=arguments.length,s=new Array(o),l=0;l12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function Kye(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function Jye(e){return e==="ROUTER"||e==="ROUTER_LATE"?30:e==="REPEATER"||e==="TRACKER"?25:e==="CLIENT_MUTE"?7:e==="CLIENT_BASE"?12:15}function Qye({nodes:e,edges:t,selectedNodeId:r,onSelectNode:n}){const i=G.useRef(null),[a,o]=G.useState("connected"),s=G.useMemo(()=>{const y=new Set;return t.forEach(x=>{y.add(x.from_node),y.add(x.to_node)}),y},[t]),l=G.useMemo(()=>{let y=e;return a==="connected"?y=y.filter(x=>s.has(x.node_num)):a==="infra"&&(y=y.filter(x=>b3.includes(x.role))),y},[e,a,s]),u=G.useMemo(()=>new Map(l.map(y=>[y.node_num,y])),[l]),c=G.useMemo(()=>t.filter(y=>u.has(y.from_node)&&u.has(y.to_node)),[t,u]),h=G.useMemo(()=>{const y=new Set;return r!==null&&c.forEach(x=>{x.from_node===r&&y.add(x.to_node),x.to_node===r&&y.add(x.from_node)}),y},[r,c]),f=G.useMemo(()=>{const y=l.map(_=>{const w=Kye(_.latitude),S=_3[w%_3.length],T=b3.includes(_.role),M=_.node_num===r,A=h.has(_.node_num),P=r===null||M||A;return{id:String(_.node_num),name:_.short_name,value:_.node_num,symbolSize:Jye(_.role),itemStyle:{color:T?S:"#111827",borderColor:S,borderWidth:T?0:2,opacity:P?1:.15},label:{show:!0,position:"bottom",distance:5,fontSize:10,fontFamily:"JetBrains Mono, monospace",color:P?"#94a3b8":"#94a3b820"},nodeNum:_.node_num,longName:_.long_name,role:_.role}}),x=c.map(_=>{const w=r===null||_.from_node===r||_.to_node===r;return{source:String(_.from_node),target:String(_.to_node),value:_.snr,lineStyle:{color:qye(_.snr),width:w&&r!==null?2:1,opacity:r===null?.4:w?.6:.04}}});return{nodes:y,links:x}},[l,c,r,h]),d=G.useMemo(()=>({backgroundColor:"#111827",tooltip:{trigger:"item",backgroundColor:"#1e293b",borderColor:"#334155",textStyle:{color:"#e2e8f0",fontFamily:"JetBrains Mono, monospace",fontSize:11},formatter:y=>{if(y.data&&y.data.longName){const x=y.data;return`${x.name}
${x.longName}
Role: ${x.role}`}return""}},series:[{type:"graph",layout:"force",roam:!0,draggable:!0,animation:!1,data:f.nodes,links:f.links,force:{repulsion:200,edgeLength:[80,120],gravity:.1},emphasis:{focus:"adjacency",blurScope:"coordinateSystem",scale:1.1,lineStyle:{width:2}},blur:{itemStyle:{opacity:.15},lineStyle:{opacity:.04}},label:{show:!0,position:"bottom",distance:5,fontSize:10,fontFamily:"JetBrains Mono, monospace"},edgeLabel:{show:!1},edgeSymbol:["none","none"]}]}),[f]),g=G.useCallback(y=>{if(y.data&&"nodeNum"in y.data){const x=y.data.nodeNum;n(r===x?null:x??null)}},[r,n]),m=G.useMemo(()=>({click:g}),[g]);return G.useEffect(()=>{var x;const y=(x=i.current)==null?void 0:x.getEchartsInstance();y&&y.setOption(d,{notMerge:!1,lazyUpdate:!0})},[d]),v.jsxs("div",{className:"relative bg-bg-card border border-border overflow-hidden",children:[v.jsx(Xye,{ref:i,option:d,style:{height:"540px",width:"100%"},onEvents:m,opts:{renderer:"canvas"}}),v.jsxs("div",{className:"absolute top-4 left-4 flex items-center gap-2 bg-bg-card/90 backdrop-blur-sm border border-border rounded px-3 py-2",children:[v.jsx(RM,{size:14,className:"text-slate-500"}),v.jsx("div",{className:"flex gap-1",children:[{key:"connected",label:"Connected"},{key:"infra",label:"Infra"},{key:"all",label:"All"}].map(({key:y,label:x})=>v.jsx("button",{onClick:()=>o(y),className:`px-2 py-1 text-xs rounded transition-colors ${a===y?"bg-accent text-white":"bg-bg-hover text-slate-400 hover:text-slate-200"}`,children:x},y))}),v.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[l.length," nodes • ",c.length," edges"]})]}),v.jsxs("div",{className:"absolute bottom-4 left-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[v.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Edge Quality (SNR)"}),v.jsx("div",{className:"space-y-1",children:[{label:"Excellent (>12)",color:"#22c55e"},{label:"Good (8-12)",color:"#4ade80"},{label:"Fair (5-8)",color:"#f59e0b"},{label:"Marginal (3-5)",color:"#f97316"},{label:"Poor (<3)",color:"#ef4444"}].map(y=>v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-4 h-0.5",style:{backgroundColor:y.color}}),v.jsx("span",{className:"text-xs text-slate-500",children:y.label})]},y.label))})]}),v.jsxs("div",{className:"absolute bottom-4 right-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[v.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Node Type"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-3 h-3 rounded-full bg-sky-400"}),v.jsx("span",{className:"text-xs text-slate-500",children:"Infrastructure"})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-900 border-2 border-sky-400"}),v.jsx("span",{className:"text-xs text-slate-500",children:"Client"})]})]})]})]})}function H8(e,t){const r=G.useRef(t);G.useEffect(function(){t!==r.current&&e.attributionControl!=null&&(r.current!=null&&e.attributionControl.removeAttribution(r.current),t!=null&&e.attributionControl.addAttribution(t)),r.current=t},[e,t])}function e0e(e,t,r){t.center!==r.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==r.radius&&e.setRadius(t.radius)}const t0e=1;function r0e(e){return Object.freeze({__version:t0e,map:e})}function U8(e,t){return Object.freeze({...e,...t})}const Z8=G.createContext(null),$8=Z8.Provider;function U_(){const e=G.useContext(Z8);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function n0e(e){function t(r,n){const{instance:i,context:a}=e(r).current;return G.useImperativeHandle(n,()=>i),r.children==null?null:Ch.createElement($8,{value:a},r.children)}return G.forwardRef(t)}function i0e(e){function t(r,n){const[i,a]=G.useState(!1),{instance:o}=e(r,a).current;G.useImperativeHandle(n,()=>o),G.useEffect(function(){i&&o.update()},[o,i,r.children]);const s=o._contentNode;return s?Z4.createPortal(r.children,s):null}return G.forwardRef(t)}function a0e(e){function t(r,n){const{instance:i}=e(r).current;return G.useImperativeHandle(n,()=>i),null}return G.forwardRef(t)}function ML(e,t){const r=G.useRef();G.useEffect(function(){return t!=null&&e.instance.on(t),r.current=t,function(){r.current!=null&&e.instance.off(r.current),r.current=null}},[e,t])}function Z_(e,t){const r=e.pane??t.pane;return r?{...e,pane:r}:e}function o0e(e,t){return function(n,i){const a=U_(),o=e(Z_(n,a),a);return H8(a.map,n.attribution),ML(o.current,n.eventHandlers),t(o.current,a,n,i),o}}var E2={exports:{}};/* @preserve - * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com - * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */(function(e,t){(function(r,n){n(t)})(nU,function(r){var n="1.9.4";function i(p){var b,C,k,E;for(C=1,k=arguments.length;C"u"||!L||!L.Mixin)){p=w(p)?p:[p];for(var b=0;b0?Math.floor(p):Math.ceil(p)};z.prototype={clone:function(){return new z(this.x,this.y)},add:function(p){return this.clone()._add(U(p))},_add:function(p){return this.x+=p.x,this.y+=p.y,this},subtract:function(p){return this.clone()._subtract(U(p))},_subtract:function(p){return this.x-=p.x,this.y-=p.y,this},divideBy:function(p){return this.clone()._divideBy(p)},_divideBy:function(p){return this.x/=p,this.y/=p,this},multiplyBy:function(p){return this.clone()._multiplyBy(p)},_multiplyBy:function(p){return this.x*=p,this.y*=p,this},scaleBy:function(p){return new z(this.x*p.x,this.y*p.y)},unscaleBy:function(p){return new z(this.x/p.x,this.y/p.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Z(this.x),this.y=Z(this.y),this},distanceTo:function(p){p=U(p);var b=p.x-this.x,C=p.y-this.y;return Math.sqrt(b*b+C*C)},equals:function(p){return p=U(p),p.x===this.x&&p.y===this.y},contains:function(p){return p=U(p),Math.abs(p.x)<=Math.abs(this.x)&&Math.abs(p.y)<=Math.abs(this.y)},toString:function(){return"Point("+f(this.x)+", "+f(this.y)+")"}};function U(p,b,C){return p instanceof z?p:w(p)?new z(p[0],p[1]):p==null?p:typeof p=="object"&&"x"in p&&"y"in p?new z(p.x,p.y):new z(p,b,C)}function $(p,b){if(p)for(var C=b?[p,b]:p,k=0,E=C.length;k=this.min.x&&C.x<=this.max.x&&b.y>=this.min.y&&C.y<=this.max.y},intersects:function(p){p=Y(p);var b=this.min,C=this.max,k=p.min,E=p.max,B=E.x>=b.x&&k.x<=C.x,X=E.y>=b.y&&k.y<=C.y;return B&&X},overlaps:function(p){p=Y(p);var b=this.min,C=this.max,k=p.min,E=p.max,B=E.x>b.x&&k.xb.y&&k.y=b.lat&&E.lat<=C.lat&&k.lng>=b.lng&&E.lng<=C.lng},intersects:function(p){p=ie(p);var b=this._southWest,C=this._northEast,k=p.getSouthWest(),E=p.getNorthEast(),B=E.lat>=b.lat&&k.lat<=C.lat,X=E.lng>=b.lng&&k.lng<=C.lng;return B&&X},overlaps:function(p){p=ie(p);var b=this._southWest,C=this._northEast,k=p.getSouthWest(),E=p.getNorthEast(),B=E.lat>b.lat&&k.latb.lng&&k.lng1,gl=function(){var p=!1;try{var b=Object.defineProperty({},"passive",{get:function(){p=!0}});window.addEventListener("testPassiveEventSupport",h,b),window.removeEventListener("testPassiveEventSupport",h,b)}catch{}return p}(),ee=function(){return!!document.createElement("canvas").getContext}(),xt=!!(document.createElementNS&&et("svg").createSVGRect),pt=!!xt&&function(){var p=document.createElement("div");return p.innerHTML="",(p.firstChild&&p.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),dt=!xt&&function(){try{var p=document.createElement("div");p.innerHTML='';var b=p.firstChild;return b.style.behavior="url(#default#VML)",b&&typeof b.adj=="object"}catch{return!1}}(),ur=navigator.platform.indexOf("Mac")===0,oo=navigator.platform.indexOf("Linux")===0;function rn(p){return navigator.userAgent.toLowerCase().indexOf(p)>=0}var Be={ie:lr,ielt9:Mr,edge:Gn,webkit:Wn,android:io,android23:Af,androidStock:ig,opera:ac,chrome:ag,gecko:jt,safari:$_,phantom:og,opera12:sg,win:Ue,ie3d:lg,webkit3d:kf,gecko3d:ao,any3d:tn,mobile:pl,mobileWebkit:ug,mobileWebkit3d:cg,msPointer:Lf,pointer:Nf,touch:Ut,touchNative:xe,mobileOpera:Hn,mobileGecko:ui,retina:Gi,passiveEvents:gl,canvas:ee,svg:xt,vml:dt,inlineSvg:pt,mac:ur,linux:oo},Pf=Be.msPointer?"MSPointerDown":"pointerdown",If=Be.msPointer?"MSPointerMove":"pointermove",Df=Be.msPointer?"MSPointerUp":"pointerup",Ef=Be.msPointer?"MSPointerCancel":"pointercancel",oc={touchstart:Pf,touchmove:If,touchend:Df,touchcancel:Ef},jf={touchstart:r7,touchmove:dg,touchend:dg,touchcancel:dg},so={},Rf=!1;function hg(p,b,C){return b==="touchstart"&&Ft(),jf[b]?(C=jf[b].bind(this,C),p.addEventListener(oc[b],C,!1),C):(console.warn("wrong event specified:",b),h)}function Of(p,b,C){if(!oc[b]){console.warn("wrong event specified:",b);return}p.removeEventListener(oc[b],C,!1)}function fg(p){so[p.pointerId]=p}function Bt(p){so[p.pointerId]&&(so[p.pointerId]=p)}function wt(p){delete so[p.pointerId]}function Ft(){Rf||(document.addEventListener(Pf,fg,!0),document.addEventListener(If,Bt,!0),document.addEventListener(Df,wt,!0),document.addEventListener(Ef,wt,!0),Rf=!0)}function dg(p,b){if(b.pointerType!==(b.MSPOINTER_TYPE_MOUSE||"mouse")){b.touches=[];for(var C in so)b.touches.push(so[C]);b.changedTouches=[b],p(b)}}function r7(p,b){b.MSPOINTER_TYPE_TOUCH&&b.pointerType===b.MSPOINTER_TYPE_TOUCH&&Hr(b),dg(p,b)}function n7(p){var b={},C,k;for(k in p)C=p[k],b[k]=C&&C.bind?C.bind(p):C;return p=b,b.type="dblclick",b.detail=2,b.isTrusted=!1,b._simulated=!0,b}var i7=200;function a7(p,b){p.addEventListener("dblclick",b);var C=0,k;function E(B){if(B.detail!==1){k=B.detail;return}if(!(B.pointerType==="mouse"||B.sourceCapabilities&&!B.sourceCapabilities.firesTouchEvents)){var X=EL(B);if(!(X.some(function(ne){return ne instanceof HTMLLabelElement&&ne.attributes.for})&&!X.some(function(ne){return ne instanceof HTMLInputElement||ne instanceof HTMLSelectElement}))){var J=Date.now();J-C<=i7?(k++,k===2&&b(n7(B))):k=1,C=J}}}return p.addEventListener("click",E),{dblclick:b,simDblclick:E}}function o7(p,b){p.removeEventListener("dblclick",b.dblclick),p.removeEventListener("click",b.simDblclick)}var Y_=gg(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),zf=gg(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),NL=zf==="webkitTransition"||zf==="OTransition"?zf+"End":"transitionend";function PL(p){return typeof p=="string"?document.getElementById(p):p}function Bf(p,b){var C=p.style[b]||p.currentStyle&&p.currentStyle[b];if((!C||C==="auto")&&document.defaultView){var k=document.defaultView.getComputedStyle(p,null);C=k?k[b]:null}return C==="auto"?null:C}function St(p,b,C){var k=document.createElement(p);return k.className=b||"",C&&C.appendChild(k),k}function Zt(p){var b=p.parentNode;b&&b.removeChild(p)}function vg(p){for(;p.firstChild;)p.removeChild(p.firstChild)}function sc(p){var b=p.parentNode;b&&b.lastChild!==p&&b.appendChild(p)}function lc(p){var b=p.parentNode;b&&b.firstChild!==p&&b.insertBefore(p,b.firstChild)}function X_(p,b){if(p.classList!==void 0)return p.classList.contains(b);var C=pg(p);return C.length>0&&new RegExp("(^|\\s)"+b+"(\\s|$)").test(C)}function at(p,b){if(p.classList!==void 0)for(var C=g(b),k=0,E=C.length;k0?2*window.devicePixelRatio:1;function RL(p){return Be.edge?p.wheelDeltaY/2:p.deltaY&&p.deltaMode===0?-p.deltaY/u7:p.deltaY&&p.deltaMode===1?-p.deltaY*20:p.deltaY&&p.deltaMode===2?-p.deltaY*60:p.deltaX||p.deltaZ?0:p.wheelDelta?(p.wheelDeltaY||p.wheelDelta)/2:p.detail&&Math.abs(p.detail)<32765?-p.detail*20:p.detail?p.detail/-32765*60:0}function s1(p,b){var C=b.relatedTarget;if(!C)return!0;try{for(;C&&C!==p;)C=C.parentNode}catch{return!1}return C!==p}var c7={__proto__:null,on:nt,off:Rt,stopPropagation:xl,disableScrollPropagation:o1,disableClickPropagation:Wf,preventDefault:Hr,stop:_l,getPropagationPath:EL,getMousePosition:jL,getWheelDelta:RL,isExternalTarget:s1,addListener:nt,removeListener:Rt},OL=V.extend({run:function(p,b,C,k){this.stop(),this._el=p,this._inProgress=!0,this._duration=C||.25,this._easeOutPower=1/Math.max(k||.5,.2),this._startPos=yl(p),this._offset=b.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=D(this._animate,this),this._step()},_step:function(p){var b=+new Date-this._startTime,C=this._duration*1e3;bthis.options.maxZoom)?this.setZoom(p):this},panInsideBounds:function(p,b){this._enforcingBounds=!0;var C=this.getCenter(),k=this._limitCenter(C,this._zoom,ie(p));return C.equals(k)||this.panTo(k,b),this._enforcingBounds=!1,this},panInside:function(p,b){b=b||{};var C=U(b.paddingTopLeft||b.padding||[0,0]),k=U(b.paddingBottomRight||b.padding||[0,0]),E=this.project(this.getCenter()),B=this.project(p),X=this.getPixelBounds(),J=Y([X.min.add(C),X.max.subtract(k)]),ne=J.getSize();if(!J.contains(B)){this._enforcingBounds=!0;var ue=B.subtract(J.getCenter()),Ie=J.extend(B).getSize().subtract(ne);E.x+=ue.x<0?-Ie.x:Ie.x,E.y+=ue.y<0?-Ie.y:Ie.y,this.panTo(this.unproject(E),b),this._enforcingBounds=!1}return this},invalidateSize:function(p){if(!this._loaded)return this;p=i({animate:!1,pan:!0},p===!0?{animate:!0}:p);var b=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var C=this.getSize(),k=b.divideBy(2).round(),E=C.divideBy(2).round(),B=k.subtract(E);return!B.x&&!B.y?this:(p.animate&&p.pan?this.panBy(B):(p.pan&&this._rawPanBy(B),this.fire("move"),p.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:b,newSize:C}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(p){if(p=this._locateOptions=i({timeout:1e4,watch:!1},p),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var b=o(this._handleGeolocationResponse,this),C=o(this._handleGeolocationError,this);return p.watch?this._locationWatchId=navigator.geolocation.watchPosition(b,C,p):navigator.geolocation.getCurrentPosition(b,C,p),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(p){if(this._container._leaflet_id){var b=p.code,C=p.message||(b===1?"permission denied":b===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:b,message:"Geolocation error: "+C+"."})}},_handleGeolocationResponse:function(p){if(this._container._leaflet_id){var b=p.coords.latitude,C=p.coords.longitude,k=new se(b,C),E=k.toBounds(p.coords.accuracy*2),B=this._locateOptions;if(B.setView){var X=this.getBoundsZoom(E);this.setView(k,B.maxZoom?Math.min(X,B.maxZoom):X)}var J={latlng:k,bounds:E,timestamp:p.timestamp};for(var ne in p.coords)typeof p.coords[ne]=="number"&&(J[ne]=p.coords[ne]);this.fire("locationfound",J)}},addHandler:function(p,b){if(!b)return this;var C=this[p]=new b(this);return this._handlers.push(C),this.options[p]&&C.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Zt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(O(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var p;for(p in this._layers)this._layers[p].remove();for(p in this._panes)Zt(this._panes[p]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(p,b){var C="leaflet-pane"+(p?" leaflet-"+p.replace("Pane","")+"-pane":""),k=St("div",C,b||this._mapPane);return p&&(this._panes[p]=k),k},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var p=this.getPixelBounds(),b=this.unproject(p.getBottomLeft()),C=this.unproject(p.getTopRight());return new te(b,C)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(p,b,C){p=ie(p),C=U(C||[0,0]);var k=this.getZoom()||0,E=this.getMinZoom(),B=this.getMaxZoom(),X=p.getNorthWest(),J=p.getSouthEast(),ne=this.getSize().subtract(C),ue=Y(this.project(J,k),this.project(X,k)).getSize(),Ie=Be.any3d?this.options.zoomSnap:1,Xe=ne.x/ue.x,ut=ne.y/ue.y,pn=b?Math.max(Xe,ut):Math.min(Xe,ut);return k=this.getScaleZoom(pn,k),Ie&&(k=Math.round(k/(Ie/100))*(Ie/100),k=b?Math.ceil(k/Ie)*Ie:Math.floor(k/Ie)*Ie),Math.max(E,Math.min(B,k))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new z(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(p,b){var C=this._getTopLeftPoint(p,b);return new $(C,C.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(p){return this.options.crs.getProjectedBounds(p===void 0?this.getZoom():p)},getPane:function(p){return typeof p=="string"?this._panes[p]:p},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(p,b){var C=this.options.crs;return b=b===void 0?this._zoom:b,C.scale(p)/C.scale(b)},getScaleZoom:function(p,b){var C=this.options.crs;b=b===void 0?this._zoom:b;var k=C.zoom(p*C.scale(b));return isNaN(k)?1/0:k},project:function(p,b){return b=b===void 0?this._zoom:b,this.options.crs.latLngToPoint(le(p),b)},unproject:function(p,b){return b=b===void 0?this._zoom:b,this.options.crs.pointToLatLng(U(p),b)},layerPointToLatLng:function(p){var b=U(p).add(this.getPixelOrigin());return this.unproject(b)},latLngToLayerPoint:function(p){var b=this.project(le(p))._round();return b._subtract(this.getPixelOrigin())},wrapLatLng:function(p){return this.options.crs.wrapLatLng(le(p))},wrapLatLngBounds:function(p){return this.options.crs.wrapLatLngBounds(ie(p))},distance:function(p,b){return this.options.crs.distance(le(p),le(b))},containerPointToLayerPoint:function(p){return U(p).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(p){return U(p).add(this._getMapPanePos())},containerPointToLatLng:function(p){var b=this.containerPointToLayerPoint(U(p));return this.layerPointToLatLng(b)},latLngToContainerPoint:function(p){return this.layerPointToContainerPoint(this.latLngToLayerPoint(le(p)))},mouseEventToContainerPoint:function(p){return jL(p,this._container)},mouseEventToLayerPoint:function(p){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(p))},mouseEventToLatLng:function(p){return this.layerPointToLatLng(this.mouseEventToLayerPoint(p))},_initContainer:function(p){var b=this._container=PL(p);if(b){if(b._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");nt(b,"scroll",this._onScroll,this),this._containerId=l(b)},_initLayout:function(){var p=this._container;this._fadeAnimated=this.options.fadeAnimation&&Be.any3d,at(p,"leaflet-container"+(Be.touch?" leaflet-touch":"")+(Be.retina?" leaflet-retina":"")+(Be.ielt9?" leaflet-oldie":"")+(Be.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var b=Bf(p,"position");b!=="absolute"&&b!=="relative"&&b!=="fixed"&&b!=="sticky"&&(p.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var p=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),mr(this._mapPane,new z(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(at(p.markerPane,"leaflet-zoom-hide"),at(p.shadowPane,"leaflet-zoom-hide"))},_resetView:function(p,b,C){mr(this._mapPane,new z(0,0));var k=!this._loaded;this._loaded=!0,b=this._limitZoom(b),this.fire("viewprereset");var E=this._zoom!==b;this._moveStart(E,C)._move(p,b)._moveEnd(E),this.fire("viewreset"),k&&this.fire("load")},_moveStart:function(p,b){return p&&this.fire("zoomstart"),b||this.fire("movestart"),this},_move:function(p,b,C,k){b===void 0&&(b=this._zoom);var E=this._zoom!==b;return this._zoom=b,this._lastCenter=p,this._pixelOrigin=this._getNewPixelOrigin(p),k?C&&C.pinch&&this.fire("zoom",C):((E||C&&C.pinch)&&this.fire("zoom",C),this.fire("move",C)),this},_moveEnd:function(p){return p&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return O(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(p){mr(this._mapPane,this._getMapPanePos().subtract(p))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(p){this._targets={},this._targets[l(this._container)]=this;var b=p?Rt:nt;b(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&b(window,"resize",this._onResize,this),Be.any3d&&this.options.transform3DLimit&&(p?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){O(this._resizeRequest),this._resizeRequest=D(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var p=this._getMapPanePos();Math.max(Math.abs(p.x),Math.abs(p.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(p,b){for(var C=[],k,E=b==="mouseout"||b==="mouseover",B=p.target||p.srcElement,X=!1;B;){if(k=this._targets[l(B)],k&&(b==="click"||b==="preclick")&&this._draggableMoved(k)){X=!0;break}if(k&&k.listens(b,!0)&&(E&&!s1(B,p)||(C.push(k),E))||B===this._container)break;B=B.parentNode}return!C.length&&!X&&!E&&this.listens(b,!0)&&(C=[this]),C},_isClickDisabled:function(p){for(;p&&p!==this._container;){if(p._leaflet_disable_click)return!0;p=p.parentNode}},_handleDOMEvent:function(p){var b=p.target||p.srcElement;if(!(!this._loaded||b._leaflet_disable_events||p.type==="click"&&this._isClickDisabled(b))){var C=p.type;C==="mousedown"&&t1(b),this._fireDOMEvent(p,C)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(p,b,C){if(p.type==="click"){var k=i({},p);k.type="preclick",this._fireDOMEvent(k,k.type,C)}var E=this._findEventTargets(p,b);if(C){for(var B=[],X=0;X0?Math.round(p-b)/2:Math.max(0,Math.ceil(p))-Math.max(0,Math.floor(b))},_limitZoom:function(p){var b=this.getMinZoom(),C=this.getMaxZoom(),k=Be.any3d?this.options.zoomSnap:1;return k&&(p=Math.round(p/k)*k),Math.max(b,Math.min(C,p))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){cr(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(p,b){var C=this._getCenterOffset(p)._trunc();return(b&&b.animate)!==!0&&!this.getSize().contains(C)?!1:(this.panBy(C,b),!0)},_createAnimProxy:function(){var p=this._proxy=St("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(p),this.on("zoomanim",function(b){var C=Y_,k=this._proxy.style[C];ml(this._proxy,this.project(b.center,b.zoom),this.getZoomScale(b.zoom,1)),k===this._proxy.style[C]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Zt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var p=this.getCenter(),b=this.getZoom();ml(this._proxy,this.project(p,b),this.getZoomScale(b,1))},_catchTransitionEnd:function(p){this._animatingZoom&&p.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(p,b,C){if(this._animatingZoom)return!0;if(C=C||{},!this._zoomAnimated||C.animate===!1||this._nothingToAnimate()||Math.abs(b-this._zoom)>this.options.zoomAnimationThreshold)return!1;var k=this.getZoomScale(b),E=this._getCenterOffset(p)._divideBy(1-1/k);return C.animate!==!0&&!this.getSize().contains(E)?!1:(D(function(){this._moveStart(!0,C.noMoveStart||!1)._animateZoom(p,b,!0)},this),!0)},_animateZoom:function(p,b,C,k){this._mapPane&&(C&&(this._animatingZoom=!0,this._animateToCenter=p,this._animateToZoom=b,at(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:p,zoom:b,noUpdate:k}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&cr(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function h7(p,b){return new mt(p,b)}var Wi=F.extend({options:{position:"topright"},initialize:function(p){m(this,p)},getPosition:function(){return this.options.position},setPosition:function(p){var b=this._map;return b&&b.removeControl(this),this.options.position=p,b&&b.addControl(this),this},getContainer:function(){return this._container},addTo:function(p){this.remove(),this._map=p;var b=this._container=this.onAdd(p),C=this.getPosition(),k=p._controlCorners[C];return at(b,"leaflet-control"),C.indexOf("bottom")!==-1?k.insertBefore(b,k.firstChild):k.appendChild(b),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Zt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(p){this._map&&p&&p.screenX>0&&p.screenY>0&&this._map.getContainer().focus()}}),Hf=function(p){return new Wi(p)};mt.include({addControl:function(p){return p.addTo(this),this},removeControl:function(p){return p.remove(),this},_initControlPos:function(){var p=this._controlCorners={},b="leaflet-",C=this._controlContainer=St("div",b+"control-container",this._container);function k(E,B){var X=b+E+" "+b+B;p[E+B]=St("div",X,C)}k("top","left"),k("top","right"),k("bottom","left"),k("bottom","right")},_clearControlPos:function(){for(var p in this._controlCorners)Zt(this._controlCorners[p]);Zt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var zL=Wi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(p,b,C,k){return C1,this._baseLayersList.style.display=p?"":"none"),this._separator.style.display=b&&p?"":"none",this},_onLayerChange:function(p){this._handlingClick||this._update();var b=this._getLayer(l(p.target)),C=b.overlay?p.type==="add"?"overlayadd":"overlayremove":p.type==="add"?"baselayerchange":null;C&&this._map.fire(C,b)},_createRadioElement:function(p,b){var C='",k=document.createElement("div");return k.innerHTML=C,k.firstChild},_addItem:function(p){var b=document.createElement("label"),C=this._map.hasLayer(p.layer),k;p.overlay?(k=document.createElement("input"),k.type="checkbox",k.className="leaflet-control-layers-selector",k.defaultChecked=C):k=this._createRadioElement("leaflet-base-layers_"+l(this),C),this._layerControlInputs.push(k),k.layerId=l(p.layer),nt(k,"click",this._onInputClick,this);var E=document.createElement("span");E.innerHTML=" "+p.name;var B=document.createElement("span");b.appendChild(B),B.appendChild(k),B.appendChild(E);var X=p.overlay?this._overlaysList:this._baseLayersList;return X.appendChild(b),this._checkDisabledLayers(),b},_onInputClick:function(){if(!this._preventClick){var p=this._layerControlInputs,b,C,k=[],E=[];this._handlingClick=!0;for(var B=p.length-1;B>=0;B--)b=p[B],C=this._getLayer(b.layerId).layer,b.checked?k.push(C):b.checked||E.push(C);for(B=0;B=0;E--)b=p[E],C=this._getLayer(b.layerId).layer,b.disabled=C.options.minZoom!==void 0&&kC.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var p=this._section;this._preventClick=!0,nt(p,"click",Hr),this.expand();var b=this;setTimeout(function(){Rt(p,"click",Hr),b._preventClick=!1})}}),f7=function(p,b,C){return new zL(p,b,C)},l1=Wi.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(p){var b="leaflet-control-zoom",C=St("div",b+" leaflet-bar"),k=this.options;return this._zoomInButton=this._createButton(k.zoomInText,k.zoomInTitle,b+"-in",C,this._zoomIn),this._zoomOutButton=this._createButton(k.zoomOutText,k.zoomOutTitle,b+"-out",C,this._zoomOut),this._updateDisabled(),p.on("zoomend zoomlevelschange",this._updateDisabled,this),C},onRemove:function(p){p.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(p){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(p.shiftKey?3:1))},_createButton:function(p,b,C,k,E){var B=St("a",C,k);return B.innerHTML=p,B.href="#",B.title=b,B.setAttribute("role","button"),B.setAttribute("aria-label",b),Wf(B),nt(B,"click",_l),nt(B,"click",E,this),nt(B,"click",this._refocusOnMap,this),B},_updateDisabled:function(){var p=this._map,b="leaflet-disabled";cr(this._zoomInButton,b),cr(this._zoomOutButton,b),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||p._zoom===p.getMinZoom())&&(at(this._zoomOutButton,b),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||p._zoom===p.getMaxZoom())&&(at(this._zoomInButton,b),this._zoomInButton.setAttribute("aria-disabled","true"))}});mt.mergeOptions({zoomControl:!0}),mt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new l1,this.addControl(this.zoomControl))});var d7=function(p){return new l1(p)},BL=Wi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(p){var b="leaflet-control-scale",C=St("div",b),k=this.options;return this._addScales(k,b+"-line",C),p.on(k.updateWhenIdle?"moveend":"move",this._update,this),p.whenReady(this._update,this),C},onRemove:function(p){p.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(p,b,C){p.metric&&(this._mScale=St("div",b,C)),p.imperial&&(this._iScale=St("div",b,C))},_update:function(){var p=this._map,b=p.getSize().y/2,C=p.distance(p.containerPointToLatLng([0,b]),p.containerPointToLatLng([this.options.maxWidth,b]));this._updateScales(C)},_updateScales:function(p){this.options.metric&&p&&this._updateMetric(p),this.options.imperial&&p&&this._updateImperial(p)},_updateMetric:function(p){var b=this._getRoundNum(p),C=b<1e3?b+" m":b/1e3+" km";this._updateScale(this._mScale,C,b/p)},_updateImperial:function(p){var b=p*3.2808399,C,k,E;b>5280?(C=b/5280,k=this._getRoundNum(C),this._updateScale(this._iScale,k+" mi",k/C)):(E=this._getRoundNum(b),this._updateScale(this._iScale,E+" ft",E/b))},_updateScale:function(p,b,C){p.style.width=Math.round(this.options.maxWidth*C)+"px",p.innerHTML=b},_getRoundNum:function(p){var b=Math.pow(10,(Math.floor(p)+"").length-1),C=p/b;return C=C>=10?10:C>=5?5:C>=3?3:C>=2?2:1,b*C}}),v7=function(p){return new BL(p)},p7='',u1=Wi.extend({options:{position:"bottomright",prefix:''+(Be.inlineSvg?p7+" ":"")+"Leaflet"},initialize:function(p){m(this,p),this._attributions={}},onAdd:function(p){p.attributionControl=this,this._container=St("div","leaflet-control-attribution"),Wf(this._container);for(var b in p._layers)p._layers[b].getAttribution&&this.addAttribution(p._layers[b].getAttribution());return this._update(),p.on("layeradd",this._addAttribution,this),this._container},onRemove:function(p){p.off("layeradd",this._addAttribution,this)},_addAttribution:function(p){p.layer.getAttribution&&(this.addAttribution(p.layer.getAttribution()),p.layer.once("remove",function(){this.removeAttribution(p.layer.getAttribution())},this))},setPrefix:function(p){return this.options.prefix=p,this._update(),this},addAttribution:function(p){return p?(this._attributions[p]||(this._attributions[p]=0),this._attributions[p]++,this._update(),this):this},removeAttribution:function(p){return p?(this._attributions[p]&&(this._attributions[p]--,this._update()),this):this},_update:function(){if(this._map){var p=[];for(var b in this._attributions)this._attributions[b]&&p.push(b);var C=[];this.options.prefix&&C.push(this.options.prefix),p.length&&C.push(p.join(", ")),this._container.innerHTML=C.join(' ')}}});mt.mergeOptions({attributionControl:!0}),mt.addInitHook(function(){this.options.attributionControl&&new u1().addTo(this)});var g7=function(p){return new u1(p)};Wi.Layers=zL,Wi.Zoom=l1,Wi.Scale=BL,Wi.Attribution=u1,Hf.layers=f7,Hf.zoom=d7,Hf.scale=v7,Hf.attribution=g7;var ma=F.extend({initialize:function(p){this._map=p},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});ma.addTo=function(p,b){return p.addHandler(b,this),this};var m7={Events:W},FL=Be.touch?"touchstart mousedown":"mousedown",es=V.extend({options:{clickTolerance:3},initialize:function(p,b,C,k){m(this,k),this._element=p,this._dragStartTarget=b||p,this._preventOutline=C},enable:function(){this._enabled||(nt(this._dragStartTarget,FL,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(es._dragging===this&&this.finishDrag(!0),Rt(this._dragStartTarget,FL,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(p){if(this._enabled&&(this._moved=!1,!X_(this._element,"leaflet-zoom-anim"))){if(p.touches&&p.touches.length!==1){es._dragging===this&&this.finishDrag();return}if(!(es._dragging||p.shiftKey||p.which!==1&&p.button!==1&&!p.touches)&&(es._dragging=this,this._preventOutline&&t1(this._element),J_(),Ff(),!this._moving)){this.fire("down");var b=p.touches?p.touches[0]:p,C=IL(this._element);this._startPoint=new z(b.clientX,b.clientY),this._startPos=yl(this._element),this._parentScale=r1(C);var k=p.type==="mousedown";nt(document,k?"mousemove":"touchmove",this._onMove,this),nt(document,k?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(p){if(this._enabled){if(p.touches&&p.touches.length>1){this._moved=!0;return}var b=p.touches&&p.touches.length===1?p.touches[0]:p,C=new z(b.clientX,b.clientY)._subtract(this._startPoint);!C.x&&!C.y||Math.abs(C.x)+Math.abs(C.y)B&&(X=J,B=ne);B>C&&(b[X]=1,h1(p,b,C,k,X),h1(p,b,C,X,E))}function b7(p,b){for(var C=[p[0]],k=1,E=0,B=p.length;kb&&(C.push(p[k]),E=k);return Eb.max.x&&(C|=2),p.yb.max.y&&(C|=8),C}function w7(p,b){var C=b.x-p.x,k=b.y-p.y;return C*C+k*k}function Uf(p,b,C,k){var E=b.x,B=b.y,X=C.x-E,J=C.y-B,ne=X*X+J*J,ue;return ne>0&&(ue=((p.x-E)*X+(p.y-B)*J)/ne,ue>1?(E=C.x,B=C.y):ue>0&&(E+=X*ue,B+=J*ue)),X=p.x-E,J=p.y-B,k?X*X+J*J:new z(E,B)}function hi(p){return!w(p[0])||typeof p[0][0]!="object"&&typeof p[0][0]<"u"}function $L(p){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),hi(p)}function YL(p,b){var C,k,E,B,X,J,ne,ue;if(!p||p.length===0)throw new Error("latlngs not passed");hi(p)||(console.warn("latlngs are not flat! Only the first ring will be used"),p=p[0]);var Ie=le([0,0]),Xe=ie(p),ut=Xe.getNorthWest().distanceTo(Xe.getSouthWest())*Xe.getNorthEast().distanceTo(Xe.getNorthWest());ut<1700&&(Ie=c1(p));var pn=p.length,jr=[];for(C=0;Ck){ne=(B-k)/E,ue=[J.x-ne*(J.x-X.x),J.y-ne*(J.y-X.y)];break}var An=b.unproject(U(ue));return le([An.lat+Ie.lat,An.lng+Ie.lng])}var S7={__proto__:null,simplify:WL,pointToSegmentDistance:HL,closestPointOnSegment:x7,clipSegment:ZL,_getEdgeIntersection:xg,_getBitCode:bl,_sqClosestPointOnSegment:Uf,isFlat:hi,_flat:$L,polylineCenter:YL},f1={project:function(p){return new z(p.lng,p.lat)},unproject:function(p){return new se(p.y,p.x)},bounds:new $([-180,-90],[180,90])},d1={R:6378137,R_MINOR:6356752314245179e-9,bounds:new $([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(p){var b=Math.PI/180,C=this.R,k=p.lat*b,E=this.R_MINOR/C,B=Math.sqrt(1-E*E),X=B*Math.sin(k),J=Math.tan(Math.PI/4-k/2)/Math.pow((1-X)/(1+X),B/2);return k=-C*Math.log(Math.max(J,1e-10)),new z(p.lng*b*C,k)},unproject:function(p){for(var b=180/Math.PI,C=this.R,k=this.R_MINOR/C,E=Math.sqrt(1-k*k),B=Math.exp(-p.y/C),X=Math.PI/2-2*Math.atan(B),J=0,ne=.1,ue;J<15&&Math.abs(ne)>1e-7;J++)ue=E*Math.sin(X),ue=Math.pow((1-ue)/(1+ue),E/2),ne=Math.PI/2-2*Math.atan(B*ue)-X,X+=ne;return new se(X*b,p.x*b/C)}},C7={__proto__:null,LonLat:f1,Mercator:d1,SphericalMercator:Me},T7=i({},me,{code:"EPSG:3395",projection:d1,transformation:function(){var p=.5/(Math.PI*d1.R);return Te(p,.5,-p,.5)}()}),XL=i({},me,{code:"EPSG:4326",projection:f1,transformation:Te(1/180,1,-1/180,.5)}),M7=i({},Ee,{projection:f1,transformation:Te(1,0,-1,0),scale:function(p){return Math.pow(2,p)},zoom:function(p){return Math.log(p)/Math.LN2},distance:function(p,b){var C=b.lng-p.lng,k=b.lat-p.lat;return Math.sqrt(C*C+k*k)},infinite:!0});Ee.Earth=me,Ee.EPSG3395=T7,Ee.EPSG3857=st,Ee.EPSG900913=ze,Ee.EPSG4326=XL,Ee.Simple=M7;var Hi=V.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(p){return p.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(p){return p&&p.removeLayer(this),this},getPane:function(p){return this._map.getPane(p?this.options[p]||p:this.options.pane)},addInteractiveTarget:function(p){return this._map._targets[l(p)]=this,this},removeInteractiveTarget:function(p){return delete this._map._targets[l(p)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(p){var b=p.target;if(b.hasLayer(this)){if(this._map=b,this._zoomAnimated=b._zoomAnimated,this.getEvents){var C=this.getEvents();b.on(C,this),this.once("remove",function(){b.off(C,this)},this)}this.onAdd(b),this.fire("add"),b.fire("layeradd",{layer:this})}}});mt.include({addLayer:function(p){if(!p._layerAdd)throw new Error("The provided object is not a Layer.");var b=l(p);return this._layers[b]?this:(this._layers[b]=p,p._mapToAdd=this,p.beforeAdd&&p.beforeAdd(this),this.whenReady(p._layerAdd,p),this)},removeLayer:function(p){var b=l(p);return this._layers[b]?(this._loaded&&p.onRemove(this),delete this._layers[b],this._loaded&&(this.fire("layerremove",{layer:p}),p.fire("remove")),p._map=p._mapToAdd=null,this):this},hasLayer:function(p){return l(p)in this._layers},eachLayer:function(p,b){for(var C in this._layers)p.call(b,this._layers[C]);return this},_addLayers:function(p){p=p?w(p)?p:[p]:[];for(var b=0,C=p.length;bthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&b[0]instanceof se&&b[0].equals(b[C-1])&&b.pop(),b},_setLatLngs:function(p){uo.prototype._setLatLngs.call(this,p),hi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return hi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var p=this._renderer._bounds,b=this.options.weight,C=new z(b,b);if(p=new $(p.min.subtract(C),p.max.add(C)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(p))){if(this.options.noClip){this._parts=this._rings;return}for(var k=0,E=this._rings.length,B;kp.y!=E.y>p.y&&p.x<(E.x-k.x)*(p.y-k.y)/(E.y-k.y)+k.x&&(b=!b);return b||uo.prototype._containsPoint.call(this,p,!0)}});function E7(p,b){return new hc(p,b)}var co=lo.extend({initialize:function(p,b){m(this,b),this._layers={},p&&this.addData(p)},addData:function(p){var b=w(p)?p:p.features,C,k,E;if(b){for(C=0,k=b.length;C0&&E.push(E[0].slice()),E}function fc(p,b){return p.feature?i({},p.feature,{geometry:b}):Tg(b)}function Tg(p){return p.type==="Feature"||p.type==="FeatureCollection"?p:{type:"Feature",properties:{},geometry:p}}var m1={toGeoJSON:function(p){return fc(this,{type:"Point",coordinates:g1(this.getLatLng(),p)})}};_g.include(m1),v1.include(m1),bg.include(m1),uo.include({toGeoJSON:function(p){var b=!hi(this._latlngs),C=Cg(this._latlngs,b?1:0,!1,p);return fc(this,{type:(b?"Multi":"")+"LineString",coordinates:C})}}),hc.include({toGeoJSON:function(p){var b=!hi(this._latlngs),C=b&&!hi(this._latlngs[0]),k=Cg(this._latlngs,C?2:b?1:0,!0,p);return b||(k=[k]),fc(this,{type:(C?"Multi":"")+"Polygon",coordinates:k})}}),uc.include({toMultiPoint:function(p){var b=[];return this.eachLayer(function(C){b.push(C.toGeoJSON(p).geometry.coordinates)}),fc(this,{type:"MultiPoint",coordinates:b})},toGeoJSON:function(p){var b=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(b==="MultiPoint")return this.toMultiPoint(p);var C=b==="GeometryCollection",k=[];return this.eachLayer(function(E){if(E.toGeoJSON){var B=E.toGeoJSON(p);if(C)k.push(B.geometry);else{var X=Tg(B);X.type==="FeatureCollection"?k.push.apply(k,X.features):k.push(X)}}}),C?fc(this,{geometries:k,type:"GeometryCollection"}):{type:"FeatureCollection",features:k}}});function JL(p,b){return new co(p,b)}var j7=JL,Mg=Hi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(p,b,C){this._url=p,this._bounds=ie(b),m(this,C)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(at(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Zt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(p){return this.options.opacity=p,this._image&&this._updateOpacity(),this},setStyle:function(p){return p.opacity&&this.setOpacity(p.opacity),this},bringToFront:function(){return this._map&&sc(this._image),this},bringToBack:function(){return this._map&&lc(this._image),this},setUrl:function(p){return this._url=p,this._image&&(this._image.src=p),this},setBounds:function(p){return this._bounds=ie(p),this._map&&this._reset(),this},getEvents:function(){var p={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(p.zoomanim=this._animateZoom),p},setZIndex:function(p){return this.options.zIndex=p,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var p=this._url.tagName==="IMG",b=this._image=p?this._url:St("img");if(at(b,"leaflet-image-layer"),this._zoomAnimated&&at(b,"leaflet-zoom-animated"),this.options.className&&at(b,this.options.className),b.onselectstart=h,b.onmousemove=h,b.onload=o(this.fire,this,"load"),b.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(b.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),p){this._url=b.src;return}b.src=this._url,b.alt=this.options.alt},_animateZoom:function(p){var b=this._map.getZoomScale(p.zoom),C=this._map._latLngBoundsToNewLayerBounds(this._bounds,p.zoom,p.center).min;ml(this._image,C,b)},_reset:function(){var p=this._image,b=new $(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),C=b.getSize();mr(p,b.min),p.style.width=C.x+"px",p.style.height=C.y+"px"},_updateOpacity:function(){ci(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var p=this.options.errorOverlayUrl;p&&this._url!==p&&(this._url=p,this._image.src=p)},getCenter:function(){return this._bounds.getCenter()}}),R7=function(p,b,C){return new Mg(p,b,C)},QL=Mg.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var p=this._url.tagName==="VIDEO",b=this._image=p?this._url:St("video");if(at(b,"leaflet-image-layer"),this._zoomAnimated&&at(b,"leaflet-zoom-animated"),this.options.className&&at(b,this.options.className),b.onselectstart=h,b.onmousemove=h,b.onloadeddata=o(this.fire,this,"load"),p){for(var C=b.getElementsByTagName("source"),k=[],E=0;E0?k:[b.src];return}w(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(b.style,"objectFit")&&(b.style.objectFit="fill"),b.autoplay=!!this.options.autoplay,b.loop=!!this.options.loop,b.muted=!!this.options.muted,b.playsInline=!!this.options.playsInline;for(var B=0;BE?(b.height=E+"px",at(p,B)):cr(p,B),this._containerWidth=this._container.offsetWidth},_animateZoom:function(p){var b=this._map._latLngToNewLayerPoint(this._latlng,p.zoom,p.center),C=this._getAnchor();mr(this._container,b.add(C))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var p=this._map,b=parseInt(Bf(this._container,"marginBottom"),10)||0,C=this._container.offsetHeight+b,k=this._containerWidth,E=new z(this._containerLeft,-C-this._containerBottom);E._add(yl(this._container));var B=p.layerPointToContainerPoint(E),X=U(this.options.autoPanPadding),J=U(this.options.autoPanPaddingTopLeft||X),ne=U(this.options.autoPanPaddingBottomRight||X),ue=p.getSize(),Ie=0,Xe=0;B.x+k+ne.x>ue.x&&(Ie=B.x+k-ue.x+ne.x),B.x-Ie-J.x<0&&(Ie=B.x-J.x),B.y+C+ne.y>ue.y&&(Xe=B.y+C-ue.y+ne.y),B.y-Xe-J.y<0&&(Xe=B.y-J.y),(Ie||Xe)&&(this.options.keepInView&&(this._autopanning=!0),p.fire("autopanstart").panBy([Ie,Xe]))}},_getAnchor:function(){return U(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),B7=function(p,b){return new Ag(p,b)};mt.mergeOptions({closePopupOnClick:!0}),mt.include({openPopup:function(p,b,C){return this._initOverlay(Ag,p,b,C).openOn(this),this},closePopup:function(p){return p=arguments.length?p:this._popup,p&&p.close(),this}}),Hi.include({bindPopup:function(p,b){return this._popup=this._initOverlay(Ag,this._popup,p,b),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(p){return this._popup&&(this instanceof lo||(this._popup._source=this),this._popup._prepareOpen(p||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(p){return this._popup&&this._popup.setContent(p),this},getPopup:function(){return this._popup},_openPopup:function(p){if(!(!this._popup||!this._map)){_l(p);var b=p.layer||p.target;if(this._popup._source===b&&!(b instanceof ts)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(p.latlng);return}this._popup._source=b,this.openPopup(p.latlng)}},_movePopup:function(p){this._popup.setLatLng(p.latlng)},_onKeyPress:function(p){p.originalEvent.keyCode===13&&this._openPopup(p)}});var kg=ya.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(p){ya.prototype.onAdd.call(this,p),this.setOpacity(this.options.opacity),p.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(p){ya.prototype.onRemove.call(this,p),p.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var p=ya.prototype.getEvents.call(this);return this.options.permanent||(p.preclick=this.close),p},_initLayout:function(){var p="leaflet-tooltip",b=p+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=St("div",b),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(p){var b,C,k=this._map,E=this._container,B=k.latLngToContainerPoint(k.getCenter()),X=k.layerPointToContainerPoint(p),J=this.options.direction,ne=E.offsetWidth,ue=E.offsetHeight,Ie=U(this.options.offset),Xe=this._getAnchor();J==="top"?(b=ne/2,C=ue):J==="bottom"?(b=ne/2,C=0):J==="center"?(b=ne/2,C=ue/2):J==="right"?(b=0,C=ue/2):J==="left"?(b=ne,C=ue/2):X.xthis.options.maxZoom||Ck?this._retainParent(E,B,X,k):!1)},_retainChildren:function(p,b,C,k){for(var E=2*p;E<2*p+2;E++)for(var B=2*b;B<2*b+2;B++){var X=new z(E,B);X.z=C+1;var J=this._tileCoordsToKey(X),ne=this._tiles[J];if(ne&&ne.active){ne.retain=!0;continue}else ne&&ne.loaded&&(ne.retain=!0);C+1this.options.maxZoom||this.options.minZoom!==void 0&&E1){this._setView(p,C);return}for(var Xe=E.min.y;Xe<=E.max.y;Xe++)for(var ut=E.min.x;ut<=E.max.x;ut++){var pn=new z(ut,Xe);if(pn.z=this._tileZoom,!!this._isValidTile(pn)){var jr=this._tiles[this._tileCoordsToKey(pn)];jr?jr.current=!0:X.push(pn)}}if(X.sort(function(An,vc){return An.distanceTo(B)-vc.distanceTo(B)}),X.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var fi=document.createDocumentFragment();for(ut=0;utC.max.x)||!b.wrapLat&&(p.yC.max.y))return!1}if(!this.options.bounds)return!0;var k=this._tileCoordsToBounds(p);return ie(this.options.bounds).overlaps(k)},_keyToBounds:function(p){return this._tileCoordsToBounds(this._keyToTileCoords(p))},_tileCoordsToNwSe:function(p){var b=this._map,C=this.getTileSize(),k=p.scaleBy(C),E=k.add(C),B=b.unproject(k,p.z),X=b.unproject(E,p.z);return[B,X]},_tileCoordsToBounds:function(p){var b=this._tileCoordsToNwSe(p),C=new te(b[0],b[1]);return this.options.noWrap||(C=this._map.wrapLatLngBounds(C)),C},_tileCoordsToKey:function(p){return p.x+":"+p.y+":"+p.z},_keyToTileCoords:function(p){var b=p.split(":"),C=new z(+b[0],+b[1]);return C.z=+b[2],C},_removeTile:function(p){var b=this._tiles[p];b&&(Zt(b.el),delete this._tiles[p],this.fire("tileunload",{tile:b.el,coords:this._keyToTileCoords(p)}))},_initTile:function(p){at(p,"leaflet-tile");var b=this.getTileSize();p.style.width=b.x+"px",p.style.height=b.y+"px",p.onselectstart=h,p.onmousemove=h,Be.ielt9&&this.options.opacity<1&&ci(p,this.options.opacity)},_addTile:function(p,b){var C=this._getTilePos(p),k=this._tileCoordsToKey(p),E=this.createTile(this._wrapCoords(p),o(this._tileReady,this,p));this._initTile(E),this.createTile.length<2&&D(o(this._tileReady,this,p,null,E)),mr(E,C),this._tiles[k]={el:E,coords:p,current:!0},b.appendChild(E),this.fire("tileloadstart",{tile:E,coords:p})},_tileReady:function(p,b,C){b&&this.fire("tileerror",{error:b,tile:C,coords:p});var k=this._tileCoordsToKey(p);C=this._tiles[k],C&&(C.loaded=+new Date,this._map._fadeAnimated?(ci(C.el,0),O(this._fadeFrame),this._fadeFrame=D(this._updateOpacity,this)):(C.active=!0,this._pruneTiles()),b||(at(C.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:C.el,coords:p})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Be.ielt9||!this._map._fadeAnimated?D(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(p){return p.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(p){var b=new z(this._wrapX?c(p.x,this._wrapX):p.x,this._wrapY?c(p.y,this._wrapY):p.y);return b.z=p.z,b},_pxBoundsToTileRange:function(p){var b=this.getTileSize();return new $(p.min.unscaleBy(b).floor(),p.max.unscaleBy(b).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var p in this._tiles)if(!this._tiles[p].loaded)return!1;return!0}});function G7(p){return new $f(p)}var dc=$f.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(p,b){this._url=p,b=m(this,b),b.detectRetina&&Be.retina&&b.maxZoom>0?(b.tileSize=Math.floor(b.tileSize/2),b.zoomReverse?(b.zoomOffset--,b.minZoom=Math.min(b.maxZoom,b.minZoom+1)):(b.zoomOffset++,b.maxZoom=Math.max(b.minZoom,b.maxZoom-1)),b.minZoom=Math.max(0,b.minZoom)):b.zoomReverse?b.minZoom=Math.min(b.maxZoom,b.minZoom):b.maxZoom=Math.max(b.minZoom,b.maxZoom),typeof b.subdomains=="string"&&(b.subdomains=b.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(p,b){return this._url===p&&b===void 0&&(b=!0),this._url=p,b||this.redraw(),this},createTile:function(p,b){var C=document.createElement("img");return nt(C,"load",o(this._tileOnLoad,this,b,C)),nt(C,"error",o(this._tileOnError,this,b,C)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(C.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(C.referrerPolicy=this.options.referrerPolicy),C.alt="",C.src=this.getTileUrl(p),C},getTileUrl:function(p){var b={r:Be.retina?"@2x":"",s:this._getSubdomain(p),x:p.x,y:p.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var C=this._globalTileRange.max.y-p.y;this.options.tms&&(b.y=C),b["-y"]=C}return _(this._url,i(b,this.options))},_tileOnLoad:function(p,b){Be.ielt9?setTimeout(o(p,this,null,b),0):p(null,b)},_tileOnError:function(p,b,C){var k=this.options.errorTileUrl;k&&b.getAttribute("src")!==k&&(b.src=k),p(C,b)},_onTileRemove:function(p){p.tile.onload=null},_getZoomForUrl:function(){var p=this._tileZoom,b=this.options.maxZoom,C=this.options.zoomReverse,k=this.options.zoomOffset;return C&&(p=b-p),p+k},_getSubdomain:function(p){var b=Math.abs(p.x+p.y)%this.options.subdomains.length;return this.options.subdomains[b]},_abortLoading:function(){var p,b;for(p in this._tiles)if(this._tiles[p].coords.z!==this._tileZoom&&(b=this._tiles[p].el,b.onload=h,b.onerror=h,!b.complete)){b.src=T;var C=this._tiles[p].coords;Zt(b),delete this._tiles[p],this.fire("tileabort",{tile:b,coords:C})}},_removeTile:function(p){var b=this._tiles[p];if(b)return b.el.setAttribute("src",T),$f.prototype._removeTile.call(this,p)},_tileReady:function(p,b,C){if(!(!this._map||C&&C.getAttribute("src")===T))return $f.prototype._tileReady.call(this,p,b,C)}});function rN(p,b){return new dc(p,b)}var nN=dc.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(p,b){this._url=p;var C=i({},this.defaultWmsParams);for(var k in b)k in this.options||(C[k]=b[k]);b=m(this,b);var E=b.detectRetina&&Be.retina?2:1,B=this.getTileSize();C.width=B.x*E,C.height=B.y*E,this.wmsParams=C},onAdd:function(p){this._crs=this.options.crs||p.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var b=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[b]=this._crs.code,dc.prototype.onAdd.call(this,p)},getTileUrl:function(p){var b=this._tileCoordsToNwSe(p),C=this._crs,k=Y(C.project(b[0]),C.project(b[1])),E=k.min,B=k.max,X=(this._wmsVersion>=1.3&&this._crs===XL?[E.y,E.x,B.y,B.x]:[E.x,E.y,B.x,B.y]).join(","),J=dc.prototype.getTileUrl.call(this,p);return J+y(this.wmsParams,J,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+X},setParams:function(p,b){return i(this.wmsParams,p),b||this.redraw(),this}});function W7(p,b){return new nN(p,b)}dc.WMS=nN,rN.wms=W7;var ho=Hi.extend({options:{padding:.1},initialize:function(p){m(this,p),l(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),at(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var p={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(p.zoomanim=this._onAnimZoom),p},_onAnimZoom:function(p){this._updateTransform(p.center,p.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(p,b){var C=this._map.getZoomScale(b,this._zoom),k=this._map.getSize().multiplyBy(.5+this.options.padding),E=this._map.project(this._center,b),B=k.multiplyBy(-C).add(E).subtract(this._map._getNewPixelOrigin(p,b));Be.any3d?ml(this._container,B,C):mr(this._container,B)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var p in this._layers)this._layers[p]._reset()},_onZoomEnd:function(){for(var p in this._layers)this._layers[p]._project()},_updatePaths:function(){for(var p in this._layers)this._layers[p]._update()},_update:function(){var p=this.options.padding,b=this._map.getSize(),C=this._map.containerPointToLayerPoint(b.multiplyBy(-p)).round();this._bounds=new $(C,C.add(b.multiplyBy(1+p*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),iN=ho.extend({options:{tolerance:0},getEvents:function(){var p=ho.prototype.getEvents.call(this);return p.viewprereset=this._onViewPreReset,p},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ho.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var p=this._container=document.createElement("canvas");nt(p,"mousemove",this._onMouseMove,this),nt(p,"click dblclick mousedown mouseup contextmenu",this._onClick,this),nt(p,"mouseout",this._handleMouseOut,this),p._leaflet_disable_events=!0,this._ctx=p.getContext("2d")},_destroyContainer:function(){O(this._redrawRequest),delete this._ctx,Zt(this._container),Rt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var p;this._redrawBounds=null;for(var b in this._layers)p=this._layers[b],p._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ho.prototype._update.call(this);var p=this._bounds,b=this._container,C=p.getSize(),k=Be.retina?2:1;mr(b,p.min),b.width=k*C.x,b.height=k*C.y,b.style.width=C.x+"px",b.style.height=C.y+"px",Be.retina&&this._ctx.scale(2,2),this._ctx.translate(-p.min.x,-p.min.y),this.fire("update")}},_reset:function(){ho.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(p){this._updateDashArray(p),this._layers[l(p)]=p;var b=p._order={layer:p,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=b),this._drawLast=b,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(p){this._requestRedraw(p)},_removePath:function(p){var b=p._order,C=b.next,k=b.prev;C?C.prev=k:this._drawLast=k,k?k.next=C:this._drawFirst=C,delete p._order,delete this._layers[l(p)],this._requestRedraw(p)},_updatePath:function(p){this._extendRedrawBounds(p),p._project(),p._update(),this._requestRedraw(p)},_updateStyle:function(p){this._updateDashArray(p),this._requestRedraw(p)},_updateDashArray:function(p){if(typeof p.options.dashArray=="string"){var b=p.options.dashArray.split(/[, ]+/),C=[],k,E;for(E=0;E')}}catch{}return function(p){return document.createElement("<"+p+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),H7={_initContainer:function(){this._container=St("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ho.prototype._update.call(this),this.fire("update"))},_initPath:function(p){var b=p._container=Yf("shape");at(b,"leaflet-vml-shape "+(this.options.className||"")),b.coordsize="1 1",p._path=Yf("path"),b.appendChild(p._path),this._updateStyle(p),this._layers[l(p)]=p},_addPath:function(p){var b=p._container;this._container.appendChild(b),p.options.interactive&&p.addInteractiveTarget(b)},_removePath:function(p){var b=p._container;Zt(b),p.removeInteractiveTarget(b),delete this._layers[l(p)]},_updateStyle:function(p){var b=p._stroke,C=p._fill,k=p.options,E=p._container;E.stroked=!!k.stroke,E.filled=!!k.fill,k.stroke?(b||(b=p._stroke=Yf("stroke")),E.appendChild(b),b.weight=k.weight+"px",b.color=k.color,b.opacity=k.opacity,k.dashArray?b.dashStyle=w(k.dashArray)?k.dashArray.join(" "):k.dashArray.replace(/( *, *)/g," "):b.dashStyle="",b.endcap=k.lineCap.replace("butt","flat"),b.joinstyle=k.lineJoin):b&&(E.removeChild(b),p._stroke=null),k.fill?(C||(C=p._fill=Yf("fill")),E.appendChild(C),C.color=k.fillColor||k.color,C.opacity=k.fillOpacity):C&&(E.removeChild(C),p._fill=null)},_updateCircle:function(p){var b=p._point.round(),C=Math.round(p._radius),k=Math.round(p._radiusY||C);this._setPath(p,p._empty()?"M0 0":"AL "+b.x+","+b.y+" "+C+","+k+" 0,"+65535*360)},_setPath:function(p,b){p._path.v=b},_bringToFront:function(p){sc(p._container)},_bringToBack:function(p){lc(p._container)}},Lg=Be.vml?Yf:et,Xf=ho.extend({_initContainer:function(){this._container=Lg("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Lg("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Zt(this._container),Rt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ho.prototype._update.call(this);var p=this._bounds,b=p.getSize(),C=this._container;(!this._svgSize||!this._svgSize.equals(b))&&(this._svgSize=b,C.setAttribute("width",b.x),C.setAttribute("height",b.y)),mr(C,p.min),C.setAttribute("viewBox",[p.min.x,p.min.y,b.x,b.y].join(" ")),this.fire("update")}},_initPath:function(p){var b=p._path=Lg("path");p.options.className&&at(b,p.options.className),p.options.interactive&&at(b,"leaflet-interactive"),this._updateStyle(p),this._layers[l(p)]=p},_addPath:function(p){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(p._path),p.addInteractiveTarget(p._path)},_removePath:function(p){Zt(p._path),p.removeInteractiveTarget(p._path),delete this._layers[l(p)]},_updatePath:function(p){p._project(),p._update()},_updateStyle:function(p){var b=p._path,C=p.options;b&&(C.stroke?(b.setAttribute("stroke",C.color),b.setAttribute("stroke-opacity",C.opacity),b.setAttribute("stroke-width",C.weight),b.setAttribute("stroke-linecap",C.lineCap),b.setAttribute("stroke-linejoin",C.lineJoin),C.dashArray?b.setAttribute("stroke-dasharray",C.dashArray):b.removeAttribute("stroke-dasharray"),C.dashOffset?b.setAttribute("stroke-dashoffset",C.dashOffset):b.removeAttribute("stroke-dashoffset")):b.setAttribute("stroke","none"),C.fill?(b.setAttribute("fill",C.fillColor||C.color),b.setAttribute("fill-opacity",C.fillOpacity),b.setAttribute("fill-rule",C.fillRule||"evenodd")):b.setAttribute("fill","none"))},_updatePoly:function(p,b){this._setPath(p,lt(p._parts,b))},_updateCircle:function(p){var b=p._point,C=Math.max(Math.round(p._radius),1),k=Math.max(Math.round(p._radiusY),1)||C,E="a"+C+","+k+" 0 1,0 ",B=p._empty()?"M0 0":"M"+(b.x-C)+","+b.y+E+C*2+",0 "+E+-C*2+",0 ";this._setPath(p,B)},_setPath:function(p,b){p._path.setAttribute("d",b)},_bringToFront:function(p){sc(p._path)},_bringToBack:function(p){lc(p._path)}});Be.vml&&Xf.include(H7);function oN(p){return Be.svg||Be.vml?new Xf(p):null}mt.include({getRenderer:function(p){var b=p.options.renderer||this._getPaneRenderer(p.options.pane)||this.options.renderer||this._renderer;return b||(b=this._renderer=this._createRenderer()),this.hasLayer(b)||this.addLayer(b),b},_getPaneRenderer:function(p){if(p==="overlayPane"||p===void 0)return!1;var b=this._paneRenderers[p];return b===void 0&&(b=this._createRenderer({pane:p}),this._paneRenderers[p]=b),b},_createRenderer:function(p){return this.options.preferCanvas&&aN(p)||oN(p)}});var sN=hc.extend({initialize:function(p,b){hc.prototype.initialize.call(this,this._boundsToLatLngs(p),b)},setBounds:function(p){return this.setLatLngs(this._boundsToLatLngs(p))},_boundsToLatLngs:function(p){return p=ie(p),[p.getSouthWest(),p.getNorthWest(),p.getNorthEast(),p.getSouthEast()]}});function U7(p,b){return new sN(p,b)}Xf.create=Lg,Xf.pointsToPath=lt,co.geometryToLayer=wg,co.coordsToLatLng=p1,co.coordsToLatLngs=Sg,co.latLngToCoords=g1,co.latLngsToCoords=Cg,co.getFeature=fc,co.asFeature=Tg,mt.mergeOptions({boxZoom:!0});var lN=ma.extend({initialize:function(p){this._map=p,this._container=p._container,this._pane=p._panes.overlayPane,this._resetStateTimeout=0,p.on("unload",this._destroy,this)},addHooks:function(){nt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Rt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Zt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(p){if(!p.shiftKey||p.which!==1&&p.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Ff(),J_(),this._startPoint=this._map.mouseEventToContainerPoint(p),nt(document,{contextmenu:_l,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(p){this._moved||(this._moved=!0,this._box=St("div","leaflet-zoom-box",this._container),at(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(p);var b=new $(this._point,this._startPoint),C=b.getSize();mr(this._box,b.min),this._box.style.width=C.x+"px",this._box.style.height=C.y+"px"},_finish:function(){this._moved&&(Zt(this._box),cr(this._container,"leaflet-crosshair")),Vf(),Q_(),Rt(document,{contextmenu:_l,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(p){if(!(p.which!==1&&p.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var b=new te(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(b).fire("boxzoomend",{boxZoomBounds:b})}},_onKeyDown:function(p){p.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});mt.addInitHook("addHandler","boxZoom",lN),mt.mergeOptions({doubleClickZoom:!0});var uN=ma.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(p){var b=this._map,C=b.getZoom(),k=b.options.zoomDelta,E=p.originalEvent.shiftKey?C-k:C+k;b.options.doubleClickZoom==="center"?b.setZoom(E):b.setZoomAround(p.containerPoint,E)}});mt.addInitHook("addHandler","doubleClickZoom",uN),mt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var cN=ma.extend({addHooks:function(){if(!this._draggable){var p=this._map;this._draggable=new es(p._mapPane,p._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),p.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),p.on("zoomend",this._onZoomEnd,this),p.whenReady(this._onZoomEnd,this))}at(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){cr(this._map._container,"leaflet-grab"),cr(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var p=this._map;if(p._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var b=ie(this._map.options.maxBounds);this._offsetLimit=Y(this._map.latLngToContainerPoint(b.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(b.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;p.fire("movestart").fire("dragstart"),p.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(p){if(this._map.options.inertia){var b=this._lastTime=+new Date,C=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(C),this._times.push(b),this._prunePositions(b)}this._map.fire("move",p).fire("drag",p)},_prunePositions:function(p){for(;this._positions.length>1&&p-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var p=this._map.getSize().divideBy(2),b=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=b.subtract(p).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(p,b){return p-(p-b)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var p=this._draggable._newPos.subtract(this._draggable._startPos),b=this._offsetLimit;p.xb.max.x&&(p.x=this._viscousLimit(p.x,b.max.x)),p.y>b.max.y&&(p.y=this._viscousLimit(p.y,b.max.y)),this._draggable._newPos=this._draggable._startPos.add(p)}},_onPreDragWrap:function(){var p=this._worldWidth,b=Math.round(p/2),C=this._initialWorldOffset,k=this._draggable._newPos.x,E=(k-b+C)%p+b-C,B=(k+b+C)%p-b-C,X=Math.abs(E+C)0?B:-B))-b;this._delta=0,this._startTime=null,X&&(p.options.scrollWheelZoom==="center"?p.setZoom(b+X):p.setZoomAround(this._lastMousePos,b+X))}});mt.addInitHook("addHandler","scrollWheelZoom",fN);var Z7=600;mt.mergeOptions({tapHold:Be.touchNative&&Be.safari&&Be.mobile,tapTolerance:15});var dN=ma.extend({addHooks:function(){nt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Rt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(p){if(clearTimeout(this._holdTimeout),p.touches.length===1){var b=p.touches[0];this._startPos=this._newPos=new z(b.clientX,b.clientY),this._holdTimeout=setTimeout(o(function(){this._cancel(),this._isTapValid()&&(nt(document,"touchend",Hr),nt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",b))},this),Z7),nt(document,"touchend touchcancel contextmenu",this._cancel,this),nt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function p(){Rt(document,"touchend",Hr),Rt(document,"touchend touchcancel",p)},_cancel:function(){clearTimeout(this._holdTimeout),Rt(document,"touchend touchcancel contextmenu",this._cancel,this),Rt(document,"touchmove",this._onMove,this)},_onMove:function(p){var b=p.touches[0];this._newPos=new z(b.clientX,b.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(p,b){var C=new MouseEvent(p,{bubbles:!0,cancelable:!0,view:window,screenX:b.screenX,screenY:b.screenY,clientX:b.clientX,clientY:b.clientY});C._simulated=!0,b.target.dispatchEvent(C)}});mt.addInitHook("addHandler","tapHold",dN),mt.mergeOptions({touchZoom:Be.touch,bounceAtZoomLimits:!0});var vN=ma.extend({addHooks:function(){at(this._map._container,"leaflet-touch-zoom"),nt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){cr(this._map._container,"leaflet-touch-zoom"),Rt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(p){var b=this._map;if(!(!p.touches||p.touches.length!==2||b._animatingZoom||this._zooming)){var C=b.mouseEventToContainerPoint(p.touches[0]),k=b.mouseEventToContainerPoint(p.touches[1]);this._centerPoint=b.getSize()._divideBy(2),this._startLatLng=b.containerPointToLatLng(this._centerPoint),b.options.touchZoom!=="center"&&(this._pinchStartLatLng=b.containerPointToLatLng(C.add(k)._divideBy(2))),this._startDist=C.distanceTo(k),this._startZoom=b.getZoom(),this._moved=!1,this._zooming=!0,b._stop(),nt(document,"touchmove",this._onTouchMove,this),nt(document,"touchend touchcancel",this._onTouchEnd,this),Hr(p)}},_onTouchMove:function(p){if(!(!p.touches||p.touches.length!==2||!this._zooming)){var b=this._map,C=b.mouseEventToContainerPoint(p.touches[0]),k=b.mouseEventToContainerPoint(p.touches[1]),E=C.distanceTo(k)/this._startDist;if(this._zoom=b.getScaleZoom(E,this._startZoom),!b.options.bounceAtZoomLimits&&(this._zoomb.getMaxZoom()&&E>1)&&(this._zoom=b._limitZoom(this._zoom)),b.options.touchZoom==="center"){if(this._center=this._startLatLng,E===1)return}else{var B=C._add(k)._divideBy(2)._subtract(this._centerPoint);if(E===1&&B.x===0&&B.y===0)return;this._center=b.unproject(b.project(this._pinchStartLatLng,this._zoom).subtract(B),this._zoom)}this._moved||(b._moveStart(!0,!1),this._moved=!0),O(this._animRequest);var X=o(b._move,b,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=D(X,this,!0),Hr(p)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,O(this._animRequest),Rt(document,"touchmove",this._onTouchMove,this),Rt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});mt.addInitHook("addHandler","touchZoom",vN),mt.BoxZoom=lN,mt.DoubleClickZoom=uN,mt.Drag=cN,mt.Keyboard=hN,mt.ScrollWheelZoom=fN,mt.TapHold=dN,mt.TouchZoom=vN,r.Bounds=$,r.Browser=Be,r.CRS=Ee,r.Canvas=iN,r.Circle=v1,r.CircleMarker=bg,r.Class=F,r.Control=Wi,r.DivIcon=tN,r.DivOverlay=ya,r.DomEvent=c7,r.DomUtil=l7,r.Draggable=es,r.Evented=V,r.FeatureGroup=lo,r.GeoJSON=co,r.GridLayer=$f,r.Handler=ma,r.Icon=cc,r.ImageOverlay=Mg,r.LatLng=se,r.LatLngBounds=te,r.Layer=Hi,r.LayerGroup=uc,r.LineUtil=S7,r.Map=mt,r.Marker=_g,r.Mixin=m7,r.Path=ts,r.Point=z,r.PolyUtil=y7,r.Polygon=hc,r.Polyline=uo,r.Popup=Ag,r.PosAnimation=OL,r.Projection=C7,r.Rectangle=sN,r.Renderer=ho,r.SVG=Xf,r.SVGOverlay=eN,r.TileLayer=dc,r.Tooltip=kg,r.Transformation=pe,r.Util=R,r.VideoOverlay=QL,r.bind=o,r.bounds=Y,r.canvas=aN,r.circle=I7,r.circleMarker=P7,r.control=Hf,r.divIcon=V7,r.extend=i,r.featureGroup=k7,r.geoJSON=JL,r.geoJson=j7,r.gridLayer=G7,r.icon=L7,r.imageOverlay=R7,r.latLng=le,r.latLngBounds=ie,r.layerGroup=A7,r.map=h7,r.marker=N7,r.point=U,r.polygon=E7,r.polyline=D7,r.popup=B7,r.rectangle=U7,r.setOptions=m,r.stamp=l,r.svg=oN,r.svgOverlay=z7,r.tileLayer=rN,r.tooltip=F7,r.transformation=Te,r.version=n,r.videoOverlay=O7;var $7=window.L;r.noConflict=function(){return window.L=$7,this},window.L=r})})(E2,E2.exports);var ic=E2.exports;const Y8=R2(ic);function rg(e,t,r){return Object.freeze({instance:e,context:t,container:r})}function AL(e,t){return t==null?function(n,i){const a=G.useRef();return a.current||(a.current=e(n,i)),a}:function(n,i){const a=G.useRef();a.current||(a.current=e(n,i));const o=G.useRef(n),{instance:s}=a.current;return G.useEffect(function(){o.current!==n&&(t(s,n,o.current),o.current=n)},[s,n,i]),a}}function X8(e,t){G.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var a;(a=t.layerContainer)==null||a.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function s0e(e){return function(r){const n=U_(),i=e(Z_(r,n),n);return H8(n.map,r.attribution),ML(i.current,r.eventHandlers),X8(i.current,n),i}}function l0e(e,t){const r=G.useRef();G.useEffect(function(){if(t.pathOptions!==r.current){const i=t.pathOptions??{};e.instance.setStyle(i),r.current=i}},[e,t])}function u0e(e){return function(r){const n=U_(),i=e(Z_(r,n),n);return ML(i.current,r.eventHandlers),X8(i.current,n),l0e(i.current,r),i}}function q8(e,t){const r=AL(e),n=o0e(r,t);return i0e(n)}function K8(e,t){const r=AL(e,t),n=u0e(r);return n0e(n)}function c0e(e,t){const r=AL(e,t),n=s0e(r);return a0e(n)}function h0e(e,t,r){const{opacity:n,zIndex:i}=t;n!=null&&n!==r.opacity&&e.setOpacity(n),i!=null&&i!==r.zIndex&&e.setZIndex(i)}function f0e(){return U_().map}const d0e=K8(function({center:t,children:r,...n},i){const a=new ic.CircleMarker(t,n);return rg(a,U8(i,{overlayContainer:a}))},e0e);function j2(){return j2=Object.assign||function(e){for(var t=1;t(d==null?void 0:d.map)??null,[d]);const m=G.useCallback(x=>{if(x!==null&&d===null){const _=new ic.Map(x,c);r!=null&&u!=null?_.setView(r,u):e!=null&&_.fitBounds(e,t),l!=null&&_.whenReady(l),g(r0e(_))}},[]);G.useEffect(()=>()=>{d==null||d.map.remove()},[d]);const y=d?Ch.createElement($8,{value:d},n):o??null;return Ch.createElement("div",j2({},f,{ref:m}),y)}const p0e=G.forwardRef(v0e),g0e=K8(function({positions:t,...r},n){const i=new ic.Polyline(t,r);return rg(i,U8(n,{overlayContainer:i}))},function(t,r,n){r.positions!==n.positions&&t.setLatLngs(r.positions)}),m0e=q8(function(t,r){const n=new ic.Popup(t,r.overlayContainer);return rg(n,r)},function(t,r,{position:n},i){G.useEffect(function(){const{instance:o}=t;function s(u){u.popup===o&&(o.update(),i(!0))}function l(u){u.popup===o&&i(!1)}return r.map.on({popupopen:s,popupclose:l}),r.overlayContainer==null?(n!=null&&o.setLatLng(n),o.openOn(r.map)):r.overlayContainer.bindPopup(o),function(){var c;r.map.off({popupopen:s,popupclose:l}),(c=r.overlayContainer)==null||c.unbindPopup(),r.map.removeLayer(o)}},[t,r,i,n])}),y0e=c0e(function({url:t,...r},n){const i=new ic.TileLayer(t,Z_(r,n));return rg(i,n)},function(t,r,n){h0e(t,r,n);const{url:i}=r;i!=null&&i!==n.url&&t.setUrl(i)}),x0e=q8(function(t,r){const n=new ic.Tooltip(t,r.overlayContainer);return rg(n,r)},function(t,r,{position:n},i){G.useEffect(function(){const o=r.overlayContainer;if(o==null)return;const{instance:s}=t,l=c=>{c.tooltip===s&&(n!=null&&s.setLatLng(n),s.update(),i(!0))},u=c=>{c.tooltip===s&&i(!1)};return o.on({tooltipopen:l,tooltipclose:u}),o.bindTooltip(s),function(){o.off({tooltipopen:l,tooltipclose:u}),o._map!=null&&o.unbindTooltip()}},[t,r,i,n])}),_0e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",b0e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",w0e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC";delete Y8.Icon.Default.prototype._getIconUrl;Y8.Icon.Default.mergeOptions({iconUrl:_0e,iconRetinaUrl:b0e,shadowUrl:w0e});const w3=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],S0e=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function C0e(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function T0e(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function M0e(e){if(!e)return"Unknown";const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/6e4),a=Math.floor(n/36e5),o=Math.floor(n/864e5);return i<1?"Just now":i<60?`${i}m ago`:a<24?`${a}h ago`:`${o}d ago`}function A0e({bounds:e}){const t=f0e();return G.useEffect(()=>{e&&t.fitBounds(e,{padding:[50,50]})},[t,e]),null}function k0e({node:e}){const t=e.latitude!==null&&e.longitude!==null,r=e.battery_level!==null?e.battery_level>100||e.voltage&&e.voltage>4.1?"USB ⚡":`${e.battery_level.toFixed(0)}%`:"Unknown";return v.jsxs("div",{className:"min-w-[200px]",children:[v.jsx("div",{className:"font-semibold text-slate-800",children:e.short_name}),v.jsx("div",{className:"text-xs text-slate-600 mb-2",children:e.long_name}),v.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[v.jsx("div",{className:"text-slate-500",children:"Role"}),v.jsx("div",{className:"text-slate-700 font-medium",children:e.role}),v.jsx("div",{className:"text-slate-500",children:"Hardware"}),v.jsx("div",{className:"text-slate-700",children:e.hardware||"Unknown"}),v.jsx("div",{className:"text-slate-500",children:"Battery"}),v.jsx("div",{className:"text-slate-700",children:r}),v.jsx("div",{className:"text-slate-500",children:"Last Heard"}),v.jsx("div",{className:"text-slate-700",children:M0e(e.last_heard)})]}),t&&v.jsxs("div",{className:"mt-3 pt-2 border-t border-slate-200 flex gap-2",children:[v.jsxs("a",{href:`https://www.google.com/maps?q=${e.latitude},${e.longitude}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-blue-600 hover:text-blue-800",children:[v.jsx(Ih,{size:10}),"Google Maps"]}),v.jsxs("a",{href:`https://www.openstreetmap.org/?mlat=${e.latitude}&mlon=${e.longitude}&zoom=14`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-blue-600 hover:text-blue-800",children:[v.jsx(Ih,{size:10}),"OSM"]})]})]})}function L0e({nodes:e,edges:t,selectedNodeId:r,onSelectNode:n}){const i=G.useMemo(()=>e.filter(h=>h.latitude!==null&&h.longitude!==null),[e]),a=e.length-i.length,o=G.useMemo(()=>new Map(i.map(h=>[h.node_num,h])),[i]),s=G.useMemo(()=>t.filter(h=>o.has(h.from_node)&&o.has(h.to_node)),[t,o]),l=G.useMemo(()=>{if(i.length===0)return null;const h=i.map(d=>d.latitude),f=i.map(d=>d.longitude);return[[Math.min(...h),Math.min(...f)],[Math.max(...h),Math.max(...f)]]},[i]),u=[43.6,-114.4],c=G.useMemo(()=>{const h=new Set;return r!==null&&t.forEach(f=>{f.from_node===r&&h.add(f.to_node),f.to_node===r&&h.add(f.from_node)}),h},[r,t]);return v.jsxs("div",{className:"relative bg-bg-card border border-border overflow-hidden",children:[v.jsxs(p0e,{center:u,zoom:7,style:{width:"100%",height:"540px"},className:"z-0",children:[v.jsx(y0e,{url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",attribution:'© OpenStreetMap, © CARTO'}),v.jsx(A0e,{bounds:l}),s.map((h,f)=>{const d=o.get(h.from_node),g=o.get(h.to_node),m=r===null||h.from_node===r||h.to_node===r;return v.jsx(g0e,{positions:[[d.latitude,d.longitude],[g.latitude,g.longitude]],color:C0e(h.snr),weight:m&&r!==null?2.5:1.5,opacity:r===null?.3:m?.6:.08},f)}),i.map(h=>{const f=h.node_num===r,d=c.has(h.node_num),g=r===null||f||d,m=S0e.includes(h.role),y=T0e(h.latitude),x=w3[y%w3.length];return v.jsxs(d0e,{center:[h.latitude,h.longitude],radius:m?8:5,fillColor:m?x:"#111827",fillOpacity:g?.9:.2,stroke:!0,color:f?"#ffffff":x,weight:f?3:m?0:2,opacity:g?1:.3,eventHandlers:{click:()=>n(f?null:h.node_num)},children:[v.jsx(x0e,{direction:"top",offset:[0,-8],children:v.jsx("span",{className:"font-mono text-xs",children:h.short_name})}),v.jsx(m0e,{children:v.jsx(k0e,{node:h})})]},h.node_num)})]}),v.jsxs("div",{className:"absolute bottom-4 left-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded px-3 py-2 text-xs text-slate-400 flex items-center gap-2",children:[v.jsx(nf,{size:12}),v.jsxs("span",{children:["Showing ",i.length," of ",e.length," nodes",a>0&&v.jsxs("span",{className:"text-slate-500",children:[" (",a," without coordinates)"]})]})]})]})}const S3=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],N0e=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function C3(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function P0e(e){return e>12?"excellent":e>8?"good":e>5?"fair":e>3?"marginal":"poor"}function I0e(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function D0e(e){return["Northern ID","Central ID","SW Idaho","SC Idaho"][e]||"Unknown"}function E0e(e){if(!e)return"Unknown";const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/6e4),a=Math.floor(n/36e5),o=Math.floor(n/864e5);return i<1?"Just now":i<60?`${i}m ago`:a<24?`${a}h ago`:`${o}d ago`}function j0e(e){if(!e)return"bg-slate-500";const t=new Date(e),n=(new Date().getTime()-t.getTime())/36e5;return n<1?"bg-green-500":n<24?"bg-amber-500":"bg-slate-500"}function R0e({node:e,edges:t,nodes:r,onSelectNode:n}){const i=G.useMemo(()=>{if(!e)return[];const h=new Map(r.map(d=>[d.node_num,d])),f=[];return t.forEach(d=>{if(d.from_node===e.node_num){const g=h.get(d.to_node);g&&f.push({node:g,snr:d.snr,quality:d.quality})}else if(d.to_node===e.node_num){const g=h.get(d.from_node);g&&f.push({node:g,snr:d.snr,quality:d.quality})}}),f.sort((d,g)=>g.snr-d.snr)},[e,t,r]);if(!e)return v.jsxs("div",{className:"w-[250px] flex-shrink-0 bg-bg-card border-l border-border p-4 flex flex-col items-center justify-center h-[540px]",children:[v.jsx("div",{className:"w-12 h-12 rounded-full bg-bg-hover border border-border flex items-center justify-center mb-3",children:v.jsx(Di,{size:24,className:"text-slate-500"})}),v.jsx("p",{className:"text-sm text-slate-500 text-center",children:"Click a node to inspect"})]});const a=N0e.includes(e.role),o=I0e(e.latitude),s=S3[o%S3.length],l=e.latitude!==null&&e.longitude!==null,u=e.battery_level!==null?e.battery_level>100||e.voltage&&e.voltage>4.1?"USB":`${e.battery_level.toFixed(0)}%`:"—",c=e.battery_level!==null&&(e.battery_level>100||e.voltage&&e.voltage>4.1);return v.jsxs("div",{className:"w-[250px] flex-shrink-0 bg-bg-card border-l border-border flex flex-col h-[540px] overflow-hidden",children:[v.jsxs("div",{className:"p-4 border-b border-border",children:[v.jsx("div",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-mono mb-2",style:{backgroundColor:`${s}20`,color:s},children:e.node_id_hex}),v.jsx("div",{className:"font-mono text-lg text-slate-100",children:e.short_name}),v.jsx("div",{className:"text-xs text-slate-500 truncate",children:e.long_name})]}),v.jsxs("div",{className:"p-4 border-b border-border grid grid-cols-2 gap-3",children:[v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Role"}),v.jsx("div",{className:`text-sm font-medium ${a?"text-accent":"text-slate-300"}`,children:e.role})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Region"}),v.jsx("div",{className:"text-sm text-slate-300",children:D0e(o)})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Battery"}),v.jsxs("div",{className:"text-sm text-slate-300 flex items-center gap-1",children:[c&&v.jsx(Dh,{size:12,className:"text-amber-400"}),u]})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Status"}),v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${j0e(e.last_heard)}`}),v.jsx("span",{className:"text-sm text-slate-300",children:E0e(e.last_heard)})]})]}),v.jsxs("div",{className:"col-span-2",children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Hardware"}),v.jsx("div",{className:"text-sm text-slate-300 font-mono truncate",children:e.hardware||"Unknown"})]})]}),l&&v.jsxs("div",{className:"px-4 py-3 border-b border-border flex gap-3",children:[v.jsxs("a",{href:`https://www.google.com/maps?q=${e.latitude},${e.longitude}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-sky-400 hover:text-sky-300",children:[v.jsx(Ih,{size:10}),"Google Maps"]}),v.jsxs("a",{href:`https://www.openstreetmap.org/?mlat=${e.latitude}&mlon=${e.longitude}&zoom=14`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-sky-400 hover:text-sky-300",children:[v.jsx(Ih,{size:10}),"OSM"]})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto",children:[v.jsxs("div",{className:"px-4 py-2 text-xs text-slate-500 font-medium sticky top-0 bg-bg-card border-b border-border",children:["Neighbors (",i.length,")"]}),i.length>0?v.jsx("div",{className:"divide-y divide-border",children:i.map(h=>v.jsxs("button",{onClick:()=>n(h.node.node_num),className:"w-full px-4 py-2 text-left hover:bg-bg-hover transition-colors flex items-center gap-2",style:{borderLeftWidth:3,borderLeftColor:C3(h.snr)},children:[v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"text-sm text-slate-200 font-mono truncate",children:h.node.short_name}),v.jsx("div",{className:"text-xs text-slate-500 truncate",children:h.node.long_name})]}),v.jsxs("div",{className:"text-right flex-shrink-0",children:[v.jsxs("div",{className:"text-xs font-mono",style:{color:C3(h.snr)},children:[h.snr.toFixed(1)," dB"]}),v.jsx("div",{className:"text-xs text-slate-500",children:P0e(h.snr)})]})]},h.node.node_num))}):v.jsx("div",{className:"px-4 py-6 text-center text-sm text-slate-500",children:"No known neighbors"})]})]})}const T3=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function O0e(e){if(!e)return"bg-slate-500";const t=new Date(e),n=(new Date().getTime()-t.getTime())/36e5;return n<1?"bg-green-500":n<24?"bg-amber-500":"bg-slate-500"}function z0e(e){if(!e)return"—";const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/6e4),a=Math.floor(n/36e5),o=Math.floor(n/864e5);return i<1?"Just now":i<60?`${i}m ago`:a<24?`${a}h ago`:`${o}d ago`}function B0e(e){return e.battery_level===null?"—":e.battery_level>100||e.voltage&&e.voltage>4.1?"USB ⚡":`${e.battery_level.toFixed(0)}%`}function M3(e){return e===null?"—":e>46?"Northern":e>44.5?"Central":e>43?"SW Idaho":"SC Idaho"}function F0e({nodes:e,selectedNodeId:t,onSelectNode:r}){const[n,i]=G.useState(""),[a,o]=G.useState("short_name"),[s,l]=G.useState("asc"),[u,c]=G.useState("all"),h=G.useMemo(()=>{let g=[...e];if(u==="infra"?g=g.filter(m=>T3.includes(m.role)):u==="online"&&(g=g.filter(m=>{if(!m.last_heard)return!1;const y=new Date(m.last_heard);return(new Date().getTime()-y.getTime())/36e5<1})),n){const m=n.toLowerCase();g=g.filter(y=>y.short_name.toLowerCase().includes(m)||y.long_name.toLowerCase().includes(m)||y.role.toLowerCase().includes(m)||M3(y.latitude).toLowerCase().includes(m))}return g.sort((m,y)=>{let x="",_="";switch(a){case"short_name":x=m.short_name.toLowerCase(),_=y.short_name.toLowerCase();break;case"role":x=m.role,_=y.role;break;case"battery_level":x=m.battery_level??-1,_=y.battery_level??-1;break;case"last_heard":x=m.last_heard?new Date(m.last_heard).getTime():0,_=y.last_heard?new Date(y.last_heard).getTime():0;break;case"hardware":x=m.hardware.toLowerCase(),_=y.hardware.toLowerCase();break}return x<_?s==="asc"?-1:1:x>_?s==="asc"?1:-1:0}),g},[e,n,a,s,u]),f=g=>{a===g?l(s==="asc"?"desc":"asc"):(o(g),l("asc"))},d=({field:g})=>a!==g?null:s==="asc"?v.jsx(V$,{size:14,className:"inline ml-1"}):v.jsx(ll,{size:14,className:"inline ml-1"});return v.jsxs("div",{className:"bg-bg-card border border-border overflow-hidden",children:[v.jsxs("div",{className:"p-3 border-b border-border flex items-center gap-3",children:[v.jsxs("div",{className:"relative flex-1 max-w-xs",children:[v.jsx(e_,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),v.jsx("input",{type:"text",placeholder:"Search nodes...",value:n,onChange:g=>i(g.target.value),className:"w-full pl-9 pr-3 py-1.5 bg-bg-hover border border-border rounded text-sm text-slate-200 placeholder-slate-500 focus:outline-none focus:border-accent"})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(RM,{size:14,className:"text-slate-500 mr-1"}),["all","infra","online"].map(g=>v.jsx("button",{onClick:()=>c(g),className:`px-2 py-1 text-xs rounded transition-colors ${u===g?"bg-accent text-white":"bg-bg-hover text-slate-400 hover:text-slate-200"}`,children:g==="all"?"All":g==="infra"?"Infra":"Online"},g))]}),v.jsxs("div",{className:"text-xs text-slate-500 ml-auto",children:[h.length," of ",e.length," nodes"]})]}),v.jsxs("div",{className:"overflow-x-auto",children:[v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"bg-bg-hover text-slate-400 text-xs",children:[v.jsx("th",{className:"w-8 px-3 py-2"}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("short_name"),children:["Name ",v.jsx(d,{field:"short_name"})]}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("role"),children:["Role ",v.jsx(d,{field:"role"})]}),v.jsx("th",{className:"px-3 py-2 text-left",children:"Region"}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("battery_level"),children:[v.jsx("span",{title:"Battery percent (4.20V = 100%, 3.60V ~ 30% warning, 3.30V ~ 3% critical). USB ⚡ = USB-powered (>100% or >4.1V); no battery management applies.",children:"Battery"})," ",v.jsx(d,{field:"battery_level"})]}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("last_heard"),children:[v.jsx("span",{title:"Status dot: green = heard in the last hour; amber = within 24h; slate = offline (past the configured threshold). See Reference → Mesh Health for thresholds by node type.",children:"Last Heard"})," ",v.jsx(d,{field:"last_heard"})]}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("hardware"),children:["Hardware ",v.jsx(d,{field:"hardware"})]})]})}),v.jsx("tbody",{className:"divide-y divide-border",children:h.slice(0,100).map(g=>{const m=T3.includes(g.role),y=g.node_num===t;return v.jsxs("tr",{onClick:()=>r(g.node_num),className:`cursor-pointer transition-colors ${y?"bg-accent/10":"hover:bg-bg-hover"}`,children:[v.jsx("td",{className:"px-3 py-2",children:v.jsx("div",{className:`w-2 h-2 rounded-full ${O0e(g.last_heard)}`})}),v.jsxs("td",{className:"px-3 py-2",children:[v.jsx("div",{className:"font-mono text-slate-200",children:g.short_name}),v.jsx("div",{className:"text-xs text-slate-500 truncate max-w-[200px]",children:g.long_name})]}),v.jsx("td",{className:"px-3 py-2",children:v.jsx("span",{className:`inline-block px-1.5 py-0.5 rounded text-xs font-medium ${m?"bg-cyan-500/20 text-accent":"bg-slate-500/20 text-slate-400"}`,children:g.role})}),v.jsx("td",{className:"px-3 py-2 text-slate-400",children:M3(g.latitude)}),v.jsx("td",{className:"px-3 py-2 font-mono text-slate-300",children:B0e(g)}),v.jsx("td",{className:"px-3 py-2 text-slate-400",children:z0e(g.last_heard)}),v.jsx("td",{className:"px-3 py-2 font-mono text-xs text-slate-400 truncate max-w-[150px]",children:g.hardware||"—"})]},g.node_num)})})]}),h.length>100&&v.jsxs("div",{className:"px-3 py-2 text-xs text-slate-500 text-center border-t border-border",children:["Showing first 100 of ",h.length," nodes"]}),h.length===0&&v.jsx("div",{className:"px-3 py-8 text-sm text-slate-500 text-center",children:"No nodes match your filters"})]})]})}function V0e(){const[e,t]=G.useState([]),[r,n]=G.useState([]),[i,a]=G.useState([]),[o,s]=G.useState(null),[l,u]=G.useState("topo"),[c,h]=G.useState(!0),[f,d]=G.useState(null);G.useEffect(()=>{document.title="Mesh — MeshAI",Promise.all([tY(),rY(),oY()]).then(([y,x,_])=>{t(y),n(x),a(_),h(!1)}).catch(y=>{d(y.message),h(!1)})},[]);const g=G.useMemo(()=>e.find(y=>y.node_num===o)||null,[e,o]),m=G.useCallback(y=>{s(y)},[]);return c?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading mesh data..."})}):f?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsxs("div",{className:"text-red-400",children:["Error: ",f]})}):v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"text-sm text-slate-400",children:[e.length," nodes • ",r.length," edges"]}),v.jsxs("div",{className:"flex items-center bg-bg-card border border-border p-1",children:[v.jsxs("button",{onClick:()=>u("topo"),className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${l==="topo"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:[v.jsx(dB,{size:14}),v.jsx("span",{title:"Force-directed graph of nodes + neighbor links. Edge weight reflects SNR; node color reflects status (green = active, amber = stale, slate = offline).",children:"Topology"})]}),v.jsxs("button",{onClick:()=>u("geo"),className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${l==="geo"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:[v.jsx(X$,{size:14}),v.jsx("span",{title:"Nodes plotted by lat/lon on a basemap. Nodes without a reported position are clustered at the top edge.",children:"Geographic"})]})]})]}),v.jsxs("div",{className:"flex gap-0",children:[v.jsx("div",{className:"flex-1 min-w-0",children:l==="topo"?v.jsx(Qye,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:m}):v.jsx(L0e,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:m})}),v.jsx(R0e,{node:g,edges:r,nodes:e,onSelectNode:m})]}),v.jsx(F0e,{nodes:e,selectedNodeId:o,onSelectNode:m})]})}function kL({label:e,value:t,onChange:r,helper:n,info:i,roleFilter:a,valueType:o="short_name"}){const[s,l]=G.useState([]),[u,c]=G.useState(!0),[h,f]=G.useState(""),[d,g]=G.useState(!1);G.useEffect(()=>{fetch("/api/nodes").then(S=>S.json()).then(S=>{l(S),c(!1)}).catch(()=>{l([]),c(!1)})},[]);const m=G.useMemo(()=>{let S=s;if(a&&(S=S.filter(T=>a==="ROUTER"||a==="infrastructure"?T.is_infrastructure||T.role==="ROUTER"||T.role==="ROUTER_CLIENT"||T.role==="REPEATER":T.role===a)),h.trim()){const T=h.toLowerCase();S=S.filter(M=>{var A,P,I,N;return((A=M.short_name)==null?void 0:A.toLowerCase().includes(T))||((P=M.long_name)==null?void 0:P.toLowerCase().includes(T))||((I=M.role)==null?void 0:I.toLowerCase().includes(T))||((N=M.node_id_hex)==null?void 0:N.toLowerCase().includes(T))})}return S.sort((T,M)=>(T.short_name||"").localeCompare(M.short_name||""))},[s,h,a]),y=S=>{switch(o){case"node_num":return String(S.node_num);case"node_id_hex":return S.node_id_hex;default:return S.short_name||String(S.node_num)}},x=S=>{const T=y(S);return t.includes(T)},_=S=>{const T=y(S);t.includes(T)?r(t.filter(M=>M!==T)):r([...t,T])},w=S=>{const T=[S.short_name];return S.long_name&&S.long_name!==S.short_name&&T.push(`— ${S.long_name}`),S.role&&T.push(`(${S.role})`),T.join(" ")};return!u&&s.length===0?v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),v.jsx("input",{type:"text",value:t.join(", "),onChange:S=>r(S.target.value.split(",").map(T=>T.trim()).filter(Boolean)),placeholder:"Enter node IDs separated by commas",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]}):v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),t.length>0&&v.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.map(S=>{const T=s.find(M=>y(M)===S);return v.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-accent/20 text-accent rounded text-sm",children:[T?T.short_name:S,v.jsx("button",{type:"button",onClick:()=>r(t.filter(M=>M!==S)),className:"hover:text-white",children:v.jsx(ca,{size:14})})]},S)})}),v.jsxs("div",{className:"relative",children:[v.jsxs("div",{className:"relative",children:[v.jsx(e_,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),v.jsx("input",{type:"text",value:h,onChange:S=>f(S.target.value),onFocus:()=>g(!0),placeholder:u?"Loading nodes...":"Search nodes...",className:"w-full pl-9 pr-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent"})]}),d&&!u&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>g(!1)}),v.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 z-50 max-h-64 overflow-y-auto bg-[#0a0e17] border border-[#1e2a3a] shadow-xl",children:m.length===0?v.jsx("div",{className:"p-3 text-sm text-slate-500 text-center",children:"No nodes found"}):m.map(S=>v.jsxs("button",{type:"button",onClick:()=>_(S),className:`w-full flex items-center gap-2 px-3 py-2 text-left text-sm hover:bg-[#1e2a3a] ${x(S)?"bg-accent/10":""}`,children:[v.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center ${x(S)?"bg-accent border-accent":"border-slate-600"}`,children:x(S)&&v.jsx(Za,{size:12,className:"text-white"})}),v.jsx("span",{className:"text-slate-200",children:w(S)})]},S.node_num))})]})]}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function LL(e){const[t,r]=G.useState([]),[n,i]=G.useState(!0);G.useEffect(()=>{fetch("/api/channels").then(f=>f.json()).then(f=>{r(f),i(!1)}).catch(()=>{r([]),i(!1)})},[]);const a=f=>{const d=f.role==="PRIMARY"?"Primary":f.role==="SECONDARY"?"Secondary":"";return`${f.index}: ${f.name}${d?` (${d})`:""}`};if(!n&&t.length===0)return e.mode==="single"?v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),v.jsx("input",{type:"number",value:e.value,onChange:f=>e.onChange(Number(f.target.value)),min:e.includeDisabled?-1:0,max:7,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),e.helper&&v.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]}):v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),v.jsx("input",{type:"text",value:e.value.join(", "),onChange:f=>{const d=f.target.value.split(",").map(g=>parseInt(g.trim())).filter(g=>!isNaN(g));e.onChange(d)},placeholder:"Enter channel numbers separated by commas",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),e.helper&&v.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]});if(e.mode==="single"){const{value:f,onChange:d,label:g,helper:m,includeDisabled:y}=e,x=t.filter(_=>_.enabled);return v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:g}),v.jsxs("select",{value:f,onChange:_=>d(Number(_.target.value)),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:[y&&v.jsx("option",{value:-1,children:"Disabled"}),x.map(_=>v.jsx("option",{value:_.index,children:a(_)},_.index))]}),m&&v.jsx("p",{className:"text-xs text-slate-600",children:m})]})}const{value:o,onChange:s,label:l,helper:u}=e,c=t.filter(f=>f.enabled),h=f=>{o.includes(f)?s(o.filter(d=>d!==f)):s([...o,f].sort((d,g)=>d-g))};return v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:l}),v.jsxs("div",{className:"border border-[#1e2a3a] p-2 space-y-1",children:[c.map(f=>v.jsxs("label",{onClick:()=>h(f.index),className:"flex items-center gap-2 p-2 rounded hover:bg-[#0a0e17] cursor-pointer",children:[v.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center ${o.includes(f.index)?"bg-accent border-accent":"border-slate-600"}`,children:o.includes(f.index)&&v.jsx(Za,{size:12,className:"text-white"})}),v.jsx("span",{className:"text-sm text-slate-200",children:a(f)})]},f.index)),c.length===0&&v.jsx("div",{className:"text-sm text-slate-500 p-2",children:"No channels available"})]}),u&&v.jsx("p",{className:"text-xs text-slate-600",children:u})]})}const A3=[{key:"bot",label:"Bot",icon:O$},{key:"connection",label:"Connection",icon:t_},{key:"response",label:"Response",icon:OM},{key:"history",label:"History",icon:uB},{key:"memory",label:"Memory",icon:z$},{key:"context",label:"Context",icon:jM},{key:"commands",label:"Commands",icon:gB},{key:"llm",label:"LLM",icon:lB},{key:"weather",label:"Weather",icon:Du},{key:"meshmonitor",label:"MeshMonitor",icon:Di},{key:"knowledge",label:"Knowledge",icon:oB},{key:"mesh_sources",label:"Mesh Sources",icon:hB},{key:"mesh_intelligence",label:"Intelligence",icon:rf},{key:"dashboard",label:"Dashboard",icon:fB}],Fn={bot:"Identity and behavior settings for the bot on the mesh network.",connection:"How MeshAI connects to your Meshtastic radio.",response:"Controls how quickly and how much the bot responds on the mesh.",history:"Conversation history storage and cleanup.",memory:"Short-term conversation memory management. Controls how the bot maintains context within a conversation.",context:"Passive channel monitoring. The bot listens to mesh channels and uses recent messages as context when responding.",commands:"Mesh commands available via the configured prefix. Toggle individual commands on or off.",llm:"AI model configuration. MeshAI uses an LLM to understand questions and generate responses.",weather:"Weather data for the !weather command. This is separate from NWS environmental alerts.",meshmonitor:"AIDA MeshMonitor integration. An additional data source for mesh network monitoring.",knowledge:"Knowledge base for answering questions from stored documents. Connects to Qdrant vector database or local SQLite.",mesh_sources:"Data sources for mesh network information. MeshAI can pull data from multiple sources simultaneously and merge them into a unified view.",mesh_intelligence:"Advanced mesh analysis: health scoring, region management, and automated alerting. The intelligence engine monitors your mesh and detects problems automatically.",dashboard:"Web dashboard settings. You're looking at it right now."},G0e=[{name:"help",description:"Show available commands and usage"},{name:"health",description:"Mesh network health overview with status dots"},{name:"status",description:"Quick mesh status summary"},{name:"region",description:"List regions or get detailed region breakdown"},{name:"neighbors",description:"Show top infrastructure neighbors with signal quality"},{name:"ping",description:"Test bot responsiveness"},{name:"clear",description:"Clear your conversation history"},{name:"reset",description:"Reset conversation context"},{name:"sub",description:"Subscribe to scheduled reports or alerts"},{name:"unsub",description:"Remove a subscription"},{name:"mysubs",description:"List your active subscriptions"},{name:"alerts",description:"Active NWS weather alerts for mesh area"},{name:"solar",description:"Space weather and HF propagation conditions"},{name:"hf",description:"HF radio propagation (alias for !solar)"},{name:"fire",description:"Active wildfires near the mesh"},{name:"avy",description:"Avalanche advisories for configured zones"},{name:"hotspots",description:"NASA FIRMS satellite fire detections"},{name:"streams",description:"USGS stream gauge readings"},{name:"roads",description:"Road conditions and closures"},{name:"traffic",description:"Traffic flow on monitored corridors"}],W0e=[{value:"US-AL",label:"Alabama"},{value:"US-AK",label:"Alaska"},{value:"US-AZ",label:"Arizona"},{value:"US-AR",label:"Arkansas"},{value:"US-CA",label:"California"},{value:"US-CO",label:"Colorado"},{value:"US-CT",label:"Connecticut"},{value:"US-DE",label:"Delaware"},{value:"US-FL",label:"Florida"},{value:"US-GA",label:"Georgia"},{value:"US-HI",label:"Hawaii"},{value:"US-ID",label:"Idaho"},{value:"US-IL",label:"Illinois"},{value:"US-IN",label:"Indiana"},{value:"US-IA",label:"Iowa"},{value:"US-KS",label:"Kansas"},{value:"US-KY",label:"Kentucky"},{value:"US-LA",label:"Louisiana"},{value:"US-ME",label:"Maine"},{value:"US-MD",label:"Maryland"},{value:"US-MA",label:"Massachusetts"},{value:"US-MI",label:"Michigan"},{value:"US-MN",label:"Minnesota"},{value:"US-MS",label:"Mississippi"},{value:"US-MO",label:"Missouri"},{value:"US-MT",label:"Montana"},{value:"US-NE",label:"Nebraska"},{value:"US-NV",label:"Nevada"},{value:"US-NH",label:"New Hampshire"},{value:"US-NJ",label:"New Jersey"},{value:"US-NM",label:"New Mexico"},{value:"US-NY",label:"New York"},{value:"US-NC",label:"North Carolina"},{value:"US-ND",label:"North Dakota"},{value:"US-OH",label:"Ohio"},{value:"US-OK",label:"Oklahoma"},{value:"US-OR",label:"Oregon"},{value:"US-PA",label:"Pennsylvania"},{value:"US-RI",label:"Rhode Island"},{value:"US-SC",label:"South Carolina"},{value:"US-SD",label:"South Dakota"},{value:"US-TN",label:"Tennessee"},{value:"US-TX",label:"Texas"},{value:"US-UT",label:"Utah"},{value:"US-VT",label:"Vermont"},{value:"US-VA",label:"Virginia"},{value:"US-WA",label:"Washington"},{value:"US-WV",label:"West Virginia"},{value:"US-WI",label:"Wisconsin"},{value:"US-WY",label:"Wyoming"}];function eo({info:e,link:t,linkText:r="Learn more"}){const[n,i]=G.useState(!1),a=G.useRef(null);return G.useEffect(()=>{if(!n)return;function o(l){a.current&&!a.current.contains(l.target)&&i(!1)}const s=setTimeout(()=>document.addEventListener("mousedown",o),0);return()=>{clearTimeout(s),document.removeEventListener("mousedown",o)}},[n]),v.jsxs("div",{className:"relative inline-block",ref:a,children:[v.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),i(!n)},className:"ml-1.5 w-4 h-4 rounded-full bg-slate-700 hover:bg-slate-600 text-slate-400 hover:text-slate-200 inline-flex items-center justify-center text-xs transition-colors",title:"More info",children:"?"}),n&&v.jsxs("div",{className:"absolute left-0 top-6 z-50 w-72 p-3 bg-[#1a2332] border border-[#2a3a4a] shadow-xl text-xs text-slate-300 leading-relaxed",children:[v.jsx("button",{type:"button",onClick:()=>i(!1),className:"absolute top-1 right-1 w-5 h-5 rounded hover:bg-slate-700 text-slate-500 hover:text-slate-300 inline-flex items-center justify-center transition-colors","aria-label":"Close",children:v.jsx(ca,{size:12})}),v.jsx("div",{className:"pr-4",children:e}),t&&v.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"mt-2 flex items-center gap-1 text-accent hover:underline",onClick:o=>o.stopPropagation(),children:[r," ",v.jsx(Ih,{size:10})]})]})]})}function Vn({text:e}){return v.jsx("p",{className:"text-sm text-slate-500 mb-6 pb-4 border-b border-[#1e2a3a]",children:e})}function ct({label:e,value:t,onChange:r,type:n="text",placeholder:i="",helper:a="",info:o="",infoLink:s=""}){const[l,u]=G.useState(!1),c=n==="password";return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&v.jsx(eo,{info:o,link:s})]}),v.jsxs("div",{className:"relative",children:[v.jsx("input",{type:c&&!l?"password":"text",value:t,onChange:h=>r(h.target.value),placeholder:i,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"}),c&&v.jsx("button",{type:"button",onClick:()=>u(!l),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-300",children:l?v.jsx(cB,{size:16}):v.jsx(jM,{size:16})})]}),a&&v.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function We({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s="",infoLink:l=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&v.jsx(eo,{info:s,link:l})]}),v.jsx("input",{type:"number",value:t,onChange:u=>r(Number(u.target.value)),min:n,max:i,step:a,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),o&&v.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function or({label:e,checked:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){return v.jsxs("div",{className:"flex items-center justify-between py-2",children:[v.jsxs("div",{children:[v.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&v.jsx(eo,{info:i,link:a})]}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]}),v.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:v.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function Ln({label:e,value:t,onChange:r,options:n,helper:i="",info:a="",infoLink:o=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&v.jsx(eo,{info:a,link:o})]}),v.jsx("select",{value:t,onChange:s=>r(s.target.value),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:n.map(s=>v.jsx("option",{value:s.value,children:s.label},s.value))}),i&&v.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function H0e({label:e,value:t,onChange:r,rows:n=4,helper:i="",info:a="",infoLink:o=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&v.jsx(eo,{info:a,link:o})]}),v.jsx("textarea",{value:t,onChange:s=>r(s.target.value),rows:n,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent resize-y"}),i&&v.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function ou({label:e,value:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){const[o,s]=G.useState(t.join(", "));G.useEffect(()=>{s(t.join(", "))},[t]);const l=()=>{const u=o.split(",").map(c=>c.trim()).filter(Boolean);r(u)};return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&v.jsx(eo,{info:i,link:a})]}),v.jsx("input",{type:"text",value:o,onChange:u=>s(u.target.value),onBlur:l,placeholder:"item1, item2, item3",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function U0e({label:e,value:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){const[o,s]=G.useState(t.join(", "));G.useEffect(()=>{s(t.join(", "))},[t]);const l=()=>{const u=o.split(",").map(c=>parseInt(c.trim(),10)).filter(c=>!isNaN(c));r(u)};return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&v.jsx(eo,{info:i,link:a})]}),v.jsx("input",{type:"text",value:o,onChange:u=>s(u.target.value),onBlur:l,placeholder:"0, 1, 2",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function sn({label:e,description:t,checked:r,onChange:n,threshold:i,onThresholdChange:a,thresholdLabel:o,thresholdMin:s,thresholdMax:l,thresholdStep:u=1,thresholdSuffix:c=""}){return v.jsxs("div",{className:"border border-[#1e2a3a] p-3 space-y-2",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"flex-1",children:[v.jsx("span",{className:"text-sm text-slate-300",children:e}),v.jsx("p",{className:"text-xs text-slate-600",children:t})]}),v.jsx("button",{type:"button",onClick:()=>n(!r),className:`relative w-11 h-6 rounded-full transition-colors flex-shrink-0 ml-3 ${r?"bg-accent":"bg-[#1e2a3a]"}`,children:v.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${r?"translate-x-5":""}`})})]}),r&&i!==void 0&&a&&v.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-[#1e2a3a]",children:[v.jsxs("span",{className:"text-xs text-slate-500",children:[o||"Threshold",":"]}),v.jsx("input",{type:"number",value:i,onChange:h=>a(Number(h.target.value)),min:s,max:l,step:u,className:"w-20 px-2 py-1 bg-[#0a0e17] border border-[#1e2a3a] rounded text-xs text-slate-200 font-mono"}),c&&v.jsx("span",{className:"text-xs text-slate-500",children:c})]})]})}function Z0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.bot}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"Bot Name",value:e.name,onChange:r=>t({...e,name:r}),helper:"Name the bot responds to on the mesh",info:"When someone sends a message containing this name, the bot will respond. Also used as the sender name in broadcasts. Changing this requires a restart."}),v.jsx(ct,{label:"Owner",value:e.owner,onChange:r=>t({...e,owner:r}),helper:"Your callsign or identifier",info:"Identifies the bot operator. Shown in !help responses and used for admin-level commands."})]}),v.jsx(or,{label:"Respond to DMs",checked:e.respond_to_dms,onChange:r=>t({...e,respond_to_dms:r}),helper:"Reply when someone sends a direct message",info:"When enabled, the bot responds to direct messages from any node. When disabled, the bot only responds to channel messages that mention its name."}),v.jsx(or,{label:"Filter BBS Protocols",checked:e.filter_bbs_protocols,onChange:r=>t({...e,filter_bbs_protocols:r}),helper:"Ignore BBS bulletin board traffic",info:"Filters out automated BBS protocol messages (advBBS, MAIL*, BOARD*) so the bot doesn't try to respond to machine-to-machine traffic."})]})}function $0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.connection}),v.jsx(Ln,{label:"Connection Type",value:e.type,onChange:r=>t({...e,type:r}),options:[{value:"serial",label:"Serial (USB)"},{value:"tcp",label:"TCP (Network)"}],helper:"Serial for USB-connected radios, TCP for network or meshtasticd",info:"Serial: direct USB connection to a Meshtastic radio. TCP: connect over the network to a radio's IP or to meshtasticd running on another machine."}),e.type==="serial"?v.jsx(ct,{label:"Serial Port",value:e.serial_port,onChange:r=>t({...e,serial_port:r}),placeholder:"/dev/ttyUSB0",helper:"Device path for your USB radio",info:"Usually /dev/ttyUSB0 on Linux or /dev/ttyACM0. Check with 'ls /dev/tty*' after plugging in your radio."}):v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"TCP Host",value:e.tcp_host,onChange:r=>t({...e,tcp_host:r}),placeholder:"192.168.1.100",helper:"IP address or hostname of the radio/meshtasticd"}),v.jsx(We,{label:"TCP Port",value:e.tcp_port,onChange:r=>t({...e,tcp_port:r}),min:1,max:65535,helper:"Default 4403 for meshtasticd"})]})]})}function Y0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.response}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Delay Min (sec)",value:e.delay_min,onChange:r=>t({...e,delay_min:r}),min:0,step:.1,helper:"Minimum wait before responding",info:"Adds a random delay between min and max before the bot sends a response. Prevents the bot from appearing to respond instantly, which can feel unnatural on a radio network."}),v.jsx(We,{label:"Delay Max (sec)",value:e.delay_max,onChange:r=>t({...e,delay_max:r}),min:0,step:.1,helper:"Maximum wait before responding",info:"Also prevents collisions with other traffic by staggering transmissions."})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Max Length",value:e.max_length,onChange:r=>t({...e,max_length:r}),min:50,max:500,helper:"Maximum characters per response message",info:"Meshtastic packets have limited size. This caps how long each message chunk can be. The bot will split longer responses into multiple messages up to Max Messages."}),v.jsx(We,{label:"Max Messages",value:e.max_messages,onChange:r=>t({...e,max_messages:r}),min:1,max:10,helper:"Maximum chunks per response",info:"If a response is longer than Max Length, the bot splits it into this many chunks at most. Higher values = more complete answers but more airtime used."})]})]})}function X0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.history}),v.jsx(ct,{label:"Database Path",value:e.database,onChange:r=>t({...e,database:r}),helper:"SQLite file for storing conversation history",info:"Path to the SQLite database file. Created automatically if it doesn't exist. Stores all conversation history for context."}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Max Messages Per User",value:e.max_messages_per_user,onChange:r=>t({...e,max_messages_per_user:r}),min:0,helper:"History limit per user (0 = unlimited)",info:"Limits how many messages are stored per user. Older messages are pruned when the limit is reached. Set to 0 for no limit."}),v.jsx(We,{label:"Conversation Timeout (sec)",value:e.conversation_timeout,onChange:r=>t({...e,conversation_timeout:r}),min:0,helper:"Seconds before context resets",info:"If a user doesn't message for this long, their next message starts a new conversation context. The bot won't remember the previous topic."})]}),v.jsx(or,{label:"Auto Cleanup",checked:e.auto_cleanup,onChange:r=>t({...e,auto_cleanup:r}),helper:"Automatically prune old conversations"}),e.auto_cleanup&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Cleanup Interval (hours)",value:e.cleanup_interval_hours,onChange:r=>t({...e,cleanup_interval_hours:r}),min:1,helper:"Hours between cleanup runs"}),v.jsx(We,{label:"Max Age (days)",value:e.max_age_days,onChange:r=>t({...e,max_age_days:r}),min:1,helper:"Delete conversations older than this"})]})]})}function q0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.memory}),v.jsx(or,{label:"Enable Memory",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Keep conversation context between messages"}),e.enabled&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Window Size",value:e.window_size,onChange:r=>t({...e,window_size:r}),min:1,helper:"Recent message pairs kept in full",info:"The bot keeps this many recent exchanges (user message + bot response pairs) as full text in context. Older messages are summarized to save token space."}),v.jsx(We,{label:"Summarize Threshold",value:e.summarize_threshold,onChange:r=>t({...e,summarize_threshold:r}),min:1,helper:"Messages before older context is summarized",info:"When the conversation exceeds this many messages, older ones outside the window are compressed into a summary by the LLM."})]})]})}function K0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.context}),v.jsx(or,{label:"Enable Passive Context",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Listen to channel traffic for context",info:"When enabled, the bot monitors mesh channels and includes recent messages in its context. This lets the bot reference things other people said on the channel."}),e.enabled&&v.jsxs(v.Fragment,{children:[v.jsx(LL,{label:"Observe Channels",value:e.observe_channels,onChange:r=>t({...e,observe_channels:r}),helper:"Channels to monitor (empty = all)",info:"Meshtastic channels to listen on. Leave empty to monitor all channels.",mode:"multi"}),v.jsx(kL,{label:"Ignore Nodes",value:e.ignore_nodes,onChange:r=>t({...e,ignore_nodes:r}),helper:"Nodes to exclude from context",info:"Messages from these nodes won't be included in passive context. Useful for filtering out noisy automated nodes."}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Max Age (sec)",value:e.max_age,onChange:r=>t({...e,max_age:r}),min:0,helper:"Ignore messages older than this"}),v.jsx(We,{label:"Max Context Items",value:e.max_context_items,onChange:r=>t({...e,max_context_items:r}),min:1,helper:"Maximum recent messages to include"})]})]})]})}function J0e({data:e,onChange:t}){const r=new Set(e.disabled_commands.map(i=>i.toLowerCase())),n=i=>{const a=i.toLowerCase();r.has(a)?t({...e,disabled_commands:e.disabled_commands.filter(o=>o.toLowerCase()!==a)}):t({...e,disabled_commands:[...e.disabled_commands,i]})};return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.commands}),v.jsx(or,{label:"Enable Commands",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Allow !commands on the mesh"}),e.enabled&&v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"Command Prefix",value:e.prefix,onChange:i=>t({...e,prefix:i}),helper:"Character that triggers commands (e.g. ! for !help)",info:"Users type this character followed by the command name. Only single characters recommended."}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Available Commands",v.jsx(eo,{info:"Toggle commands on or off. Disabled commands won't respond when users invoke them."})]}),v.jsx("div",{className:"grid gap-1",children:G0e.map(i=>{const a=!r.has(i.name.toLowerCase());return v.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#0a0e17] border border-[#1e2a3a] rounded hover:border-[#2a3a4a] transition-colors",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsxs("code",{className:"text-accent text-sm",children:["!",i.name]}),v.jsx("span",{className:"text-xs text-slate-500",children:i.description})]}),v.jsx("button",{type:"button",onClick:()=>n(i.name),className:`relative w-9 h-5 rounded-full transition-colors ${a?"bg-accent":"bg-[#1e2a3a]"}`,children:v.jsx("span",{className:`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white transition-transform ${a?"translate-x-4":""}`})})]},i.name)})})]})]})]})}function Q0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.llm}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ln,{label:"Backend",value:e.backend,onChange:r=>t({...e,backend:r}),options:[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"google",label:"Google (Gemini)"}],helper:"LLM provider to use",info:"OpenAI: GPT models (gpt-4o, gpt-4o-mini). Anthropic: Claude models (claude-sonnet-4-20250514). Google: Gemini models. Can also point to compatible APIs like Ollama, LM Studio, or Open WebUI by changing the Base URL."}),v.jsx(ct,{label:"Model",value:e.model,onChange:r=>t({...e,model:r}),placeholder:"gpt-4o-mini",helper:"Specific model name",info:"The specific model to use. Common choices: gpt-4o-mini (fast, cheap), gpt-4o (better, costs more), claude-sonnet-4-20250514 (Anthropic equivalent). For local models via Ollama, use the model name you pulled (e.g. llama3.1)."})]}),v.jsx(ct,{label:"API Key",value:e.api_key,onChange:r=>t({...e,api_key:r}),type:"password",helper:"Supports ${ENV_VAR} syntax",info:"Your API key from the provider. You can also use ${ENV_VAR} syntax to read from an environment variable instead of storing the key in the config file."}),v.jsx(ct,{label:"Base URL",value:e.base_url,onChange:r=>t({...e,base_url:r}),placeholder:"https://api.openai.com/v1",helper:"API endpoint (change for local LLMs)",info:"Default API endpoint for the selected backend. Change this to point to a local LLM server (Ollama at http://localhost:11434/v1, Open WebUI, LM Studio, etc.) or a proxy."}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Timeout (sec)",value:e.timeout,onChange:r=>t({...e,timeout:r}),min:5,max:120,helper:"Maximum seconds to wait for response"}),v.jsx(We,{label:"Max Response Tokens",value:e.max_response_tokens,onChange:r=>t({...e,max_response_tokens:r}),min:100,helper:"Token limit for LLM responses"})]}),v.jsx(or,{label:"Use System Prompt",checked:e.use_system_prompt,onChange:r=>t({...e,use_system_prompt:r}),helper:"Enable custom system instructions"}),e.use_system_prompt&&v.jsx(H0e,{label:"System Prompt",value:e.system_prompt,onChange:r=>t({...e,system_prompt:r}),rows:6,helper:"Instructions that shape the bot's personality",info:"Instructions that shape the bot's personality and behavior. The bot always follows these instructions. MeshAI adds mesh health data and environmental context automatically — you don't need to include those here."}),v.jsx(or,{label:"Web Search",checked:e.web_search,onChange:r=>t({...e,web_search:r}),helper:"Enable web search tool (Open WebUI feature)"}),v.jsx(or,{label:"Google Grounding",checked:e.google_grounding,onChange:r=>t({...e,google_grounding:r}),helper:"Ground responses in web search (Gemini only)"})]})}function exe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.weather}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ln,{label:"Primary Provider",value:e.primary,onChange:r=>t({...e,primary:r}),options:[{value:"openmeteo",label:"Open-Meteo"},{value:"wttr",label:"wttr.in"},{value:"llm",label:"LLM"}],helper:"Main weather data source"}),v.jsx(Ln,{label:"Fallback Provider",value:e.fallback,onChange:r=>t({...e,fallback:r}),options:[{value:"openmeteo",label:"Open-Meteo"},{value:"wttr",label:"wttr.in"},{value:"llm",label:"LLM"},{value:"none",label:"None"}],helper:"Backup if primary fails"})]}),v.jsx(ct,{label:"Default Location",value:e.default_location,onChange:r=>t({...e,default_location:r}),placeholder:"Your city, state",helper:"Location when none specified"})]})}function txe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.meshmonitor}),v.jsx(or,{label:"Enable MeshMonitor",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Connect to AIDA MeshMonitor instance",info:"MeshMonitor by Yeraze provides node data, battery info, telemetry, and auto-responder patterns. MeshAI uses this as a data source and avoids duplicate responses."}),e.enabled&&v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"URL",value:e.url,onChange:r=>t({...e,url:r}),placeholder:"http://192.168.1.100:8080",helper:"MeshMonitor API endpoint",info:"Full URL to your MeshMonitor instance. Usually runs on port 8080."}),v.jsx(or,{label:"Inject Into Prompt",checked:e.inject_into_prompt,onChange:r=>t({...e,inject_into_prompt:r}),helper:"Tell LLM about MeshMonitor commands",info:"Adds MeshMonitor's auto-responder patterns to the LLM context so it knows what commands MeshMonitor handles."}),v.jsx(We,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:r=>t({...e,refresh_interval:r}),min:10,helper:"How often to fetch patterns"}),v.jsx(or,{label:"Polite Mode",checked:e.polite_mode,onChange:r=>t({...e,polite_mode:r}),helper:"Reduce polling frequency",info:"Reduces polling frequency for shared instances to be a good neighbor."})]})]})}function rxe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.knowledge}),v.jsx(or,{label:"Enable Knowledge Base",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Answer questions from stored documents",info:"Uses RAG (Retrieval-Augmented Generation) to answer questions from a knowledge base. Supports Qdrant vector database or local SQLite with FTS5."}),e.enabled&&v.jsxs(v.Fragment,{children:[v.jsx(Ln,{label:"Backend",value:e.backend,onChange:r=>t({...e,backend:r}),options:[{value:"auto",label:"Auto (Qdrant -> SQLite)"},{value:"qdrant",label:"Qdrant"},{value:"sqlite",label:"SQLite"}],helper:"Knowledge storage backend",info:"Auto tries Qdrant first, falls back to SQLite. Qdrant provides hybrid search with dense+sparse embeddings. SQLite uses FTS5 keyword search."}),(e.backend==="qdrant"||e.backend==="auto")&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"Qdrant Host",value:e.qdrant_host,onChange:r=>t({...e,qdrant_host:r}),helper:"Qdrant server hostname",info:"IP or hostname of your Qdrant vector database server."}),v.jsx(We,{label:"Qdrant Port",value:e.qdrant_port,onChange:r=>t({...e,qdrant_port:r}),helper:"Default 6333"})]}),v.jsx(ct,{label:"Collection",value:e.qdrant_collection,onChange:r=>t({...e,qdrant_collection:r}),helper:"Qdrant collection name"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"TEI Host",value:e.tei_host,onChange:r=>t({...e,tei_host:r}),helper:"Text Embeddings Inference host",info:"TEI service for generating dense embeddings. Uses BAAI/bge-m3 model."}),v.jsx(We,{label:"TEI Port",value:e.tei_port,onChange:r=>t({...e,tei_port:r}),helper:"Default 8090"})]}),v.jsx(or,{label:"Use Sparse Embeddings",checked:e.use_sparse,onChange:r=>t({...e,use_sparse:r}),helper:"Enable hybrid search with sparse vectors",info:"Combines dense embeddings with sparse (keyword-based) embeddings using Reciprocal Rank Fusion for better search results."})]}),v.jsx(ct,{label:"SQLite DB Path",value:e.db_path,onChange:r=>t({...e,db_path:r}),helper:"Local knowledge database file"}),v.jsx(We,{label:"Top K Results",value:e.top_k,onChange:r=>t({...e,top_k:r}),min:1,max:20,helper:"Number of documents to retrieve"})]})]})}function nxe({source:e,onChange:t,onDelete:r}){const[n,i]=G.useState(!1),a={meshview:"Web-based mesh monitoring tool. Enter the full URL of a MeshView instance. No API key typically required.",meshmonitor:"AIDA MeshMonitor API. Provides node data and network statistics. Requires API token.",mqtt:"Subscribe directly to a Meshtastic MQTT broker for real-time packet data. This is push-based (instant) vs the polling approach of MeshView/MeshMonitor."};return v.jsxs("div",{className:"border border-[#1e2a3a] overflow-hidden",children:[v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>i(!n),children:[v.jsxs("div",{className:"flex items-center gap-3",children:[n?v.jsx(ll,{size:16}):v.jsx(Js,{size:16}),v.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`}),v.jsx("span",{className:"font-mono text-sm text-slate-200",children:e.name||"Unnamed Source"}),v.jsx("span",{className:"text-xs text-slate-500 bg-[#1e2a3a] px-2 py-0.5 rounded",children:e.type})]}),v.jsx("button",{onClick:o=>{o.stopPropagation(),r()},className:"p-1 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",children:v.jsx(Ep,{size:14})})]}),n&&v.jsxs("div",{className:"p-4 space-y-4 border-t border-[#1e2a3a]",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"Name",value:e.name,onChange:o=>t({...e,name:o}),helper:"Friendly name for this source"}),v.jsx(Ln,{label:"Type",value:e.type,onChange:o=>t({...e,type:o}),options:[{value:"meshview",label:"MeshView"},{value:"meshmonitor",label:"MeshMonitor"},{value:"mqtt",label:"MQTT Broker"}],info:a[e.type]||""})]}),e.type!=="mqtt"&&v.jsx(ct,{label:"URL",value:e.url,onChange:o=>t({...e,url:o}),helper:"Full URL including protocol"}),e.type==="meshmonitor"&&v.jsx(ct,{label:"API Token",value:e.api_token,onChange:o=>t({...e,api_token:o}),type:"password",helper:"Bearer token for authentication"}),e.type==="mqtt"&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"Host",value:e.host||"",onChange:o=>t({...e,host:o}),helper:"MQTT broker hostname"}),v.jsx(We,{label:"Port",value:e.port||1883,onChange:o=>t({...e,port:o}),min:1,max:65535,helper:"1883 plain, 8883 TLS"})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"Username",value:e.username||"",onChange:o=>t({...e,username:o})}),v.jsx(ct,{label:"Password",value:e.password||"",onChange:o=>t({...e,password:o}),type:"password"})]}),v.jsx(ct,{label:"Topic Root",value:e.topic_root||"msh/US",onChange:o=>t({...e,topic_root:o}),helper:"Base topic to subscribe to"}),v.jsx(or,{label:"Use TLS",checked:e.use_tls||!1,onChange:o=>t({...e,use_tls:o}),helper:"Encrypt MQTT connection"})]}),v.jsx(We,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:o=>t({...e,refresh_interval:o}),min:10,helper:"Polling frequency"}),v.jsx(or,{label:"Enabled",checked:e.enabled,onChange:o=>t({...e,enabled:o})}),v.jsx(or,{label:"Polite Mode",checked:e.polite_mode,onChange:o=>t({...e,polite_mode:o}),helper:"Reduce polling for shared instances"})]})]})}function ixe({data:e,onChange:t}){const r=()=>{t([...e,{name:"New Source",type:"meshview",url:"",api_token:"",refresh_interval:30,polite_mode:!1,enabled:!0,host:"",port:1883,username:"",password:"",topic_root:"msh/US",use_tls:!1}])};return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.mesh_sources}),e.map((n,i)=>v.jsx(nxe,{source:n,onChange:a=>{const o=[...e];o[i]=a,t(o)},onDelete:()=>{confirm(`Delete source "${n.name}"?`)&&t(e.filter((a,o)=>o!==i))}},i)),v.jsxs("button",{onClick:r,className:"w-full py-2 border border-dashed border-[#1e2a3a] text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[v.jsx(af,{size:16})," Add Source"]})]})}function axe({data:e,onChange:t}){const[r,n]=G.useState(null);return v.jsxs("div",{className:"space-y-6",children:[v.jsx(Vn,{text:Fn.mesh_intelligence}),v.jsx(or,{label:"Enable Mesh Intelligence",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Activate health scoring and alerting"}),e.enabled&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Locality Radius (miles)",value:e.locality_radius_miles,onChange:i=>t({...e,locality_radius_miles:i}),min:1,step:.5,helper:"Region assignment radius",info:"Nodes within this distance of a region anchor point are assigned to that region."}),v.jsx(We,{label:"Offline Threshold (hours)",value:e.offline_threshold_hours,onChange:i=>t({...e,offline_threshold_hours:i}),min:1,helper:"Time until node marked offline",info:"A node is considered offline after not being heard for this many hours."})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Packet Threshold",value:e.packet_threshold,onChange:i=>t({...e,packet_threshold:i}),min:0,helper:"Min packets per 24h to flag",info:"Minimum packets per 24 hours. Nodes below this are flagged as low activity."}),v.jsx(We,{label:"Battery Warning %",value:e.battery_warning_percent,onChange:i=>t({...e,battery_warning_percent:i}),min:1,max:100,helper:"Global battery warning level"})]}),v.jsx(kL,{label:"Critical Nodes",value:e.critical_nodes,onChange:i=>t({...e,critical_nodes:i}),helper:"Critical infrastructure nodes",info:"Nodes that get priority alerting when they go offline.",roleFilter:"infrastructure"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(LL,{label:"Alert Channel",value:e.alert_channel,onChange:i=>t({...e,alert_channel:i}),helper:"Channel for broadcast alerts",info:"Meshtastic channel for broadcast alerts. Select Disabled to turn off channel broadcasting.",mode:"single",includeDisabled:!0}),v.jsx(We,{label:"Alert Cooldown (min)",value:e.alert_cooldown_minutes,onChange:i=>t({...e,alert_cooldown_minutes:i}),min:1,helper:"Min time between repeat alerts",info:"Minimum minutes between repeated alerts for the same condition. Uses scaling cooldown (12h, 24h, 48h)."})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Regions",v.jsx(eo,{info:"Regions group mesh nodes by geographic area. Each region has an anchor point (lat/lon) and nodes within the region radius are automatically assigned. Regions enable localized reports, alerts, and health scoring."})]}),e.regions.map((i,a)=>v.jsxs("div",{className:"border border-[#1e2a3a] overflow-hidden",children:[v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>n(r===a?null:a),children:[v.jsxs("div",{className:"flex items-center gap-3",children:[r===a?v.jsx(ll,{size:16}):v.jsx(Js,{size:16}),v.jsx("span",{className:"font-medium text-slate-200",children:i.name||"Unnamed Region"}),v.jsx("span",{className:"text-xs text-slate-500",children:i.local_name})]}),v.jsx("button",{onClick:o=>{if(o.stopPropagation(),confirm(`Delete region "${i.name||"Unnamed Region"}"?`)){const s=e.regions.filter((l,u)=>u!==a);t({...e,regions:s})}},className:"p-1 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",children:v.jsx(Ep,{size:14})})]}),r===a&&v.jsxs("div",{className:"p-4 space-y-3 border-t border-[#1e2a3a]",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"Name",value:i.name,onChange:o=>{const s=[...e.regions];s[a]={...i,name:o},t({...e,regions:s})}}),v.jsx(ct,{label:"Local Name",value:i.local_name,onChange:o=>{const s=[...e.regions];s[a]={...i,local_name:o},t({...e,regions:s})}})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Latitude",value:i.lat,onChange:o=>{const s=[...e.regions];s[a]={...i,lat:o},t({...e,regions:s})},step:1e-4}),v.jsx(We,{label:"Longitude",value:i.lon,onChange:o=>{const s=[...e.regions];s[a]={...i,lon:o},t({...e,regions:s})},step:1e-4})]}),v.jsx(ct,{label:"Description",value:i.description,onChange:o=>{const s=[...e.regions];s[a]={...i,description:o},t({...e,regions:s})}}),v.jsx(ou,{label:"Aliases",value:i.aliases,onChange:o=>{const s=[...e.regions];s[a]={...i,aliases:o},t({...e,regions:s})}}),v.jsx(ou,{label:"Cities",value:i.cities,onChange:o=>{const s=[...e.regions];s[a]={...i,cities:o},t({...e,regions:s})}})]})]},a)),v.jsxs("button",{onClick:()=>{const i={name:"",local_name:"",lat:0,lon:0,description:"",aliases:[],cities:[]};t({...e,regions:[...e.regions,i]}),n(e.regions.length)},className:"w-full py-2 border border-dashed border-[#1e2a3a] text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[v.jsx(af,{size:16})," Add Region"]})]}),v.jsxs("div",{className:"space-y-3",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Rules",v.jsx(eo,{info:"Configure which conditions trigger alerts. Each rule can have an optional threshold value."})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Infrastructure"}),v.jsx(sn,{label:"Infra Offline",description:"Alert when an infrastructure node (router/repeater) goes offline",checked:e.alert_rules.infra_offline,onChange:i=>t({...e,alert_rules:{...e.alert_rules,infra_offline:i}})}),v.jsx(sn,{label:"Infra Recovery",description:"Alert when an offline infrastructure node comes back online",checked:e.alert_rules.infra_recovery,onChange:i=>t({...e,alert_rules:{...e.alert_rules,infra_recovery:i}})}),v.jsx(sn,{label:"New Router",description:"Alert when a new router/repeater appears on the mesh",checked:e.alert_rules.new_router,onChange:i=>t({...e,alert_rules:{...e.alert_rules,new_router:i}})}),v.jsx(sn,{label:"Feeder Offline",description:"Alert when a data source (MeshView/MeshMonitor) stops responding",checked:e.alert_rules.feeder_offline,onChange:i=>t({...e,alert_rules:{...e.alert_rules,feeder_offline:i}})}),v.jsx(sn,{label:"Single Gateway",description:"Alert when an infrastructure node has only one connection path",checked:e.alert_rules.infra_single_gateway,onChange:i=>t({...e,alert_rules:{...e.alert_rules,infra_single_gateway:i}})}),v.jsx(sn,{label:"Region Blackout",description:"Alert when all infrastructure in a region goes offline",checked:e.alert_rules.region_total_blackout,onChange:i=>t({...e,alert_rules:{...e.alert_rules,region_total_blackout:i}})})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Power"}),v.jsx(sn,{label:"Battery Warning",description:"Alert when infra node battery drops below warning threshold",checked:e.alert_rules.battery_warning,onChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_warning:i}}),threshold:e.alert_rules.battery_warning_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_warning_threshold:i}}),thresholdLabel:"Below",thresholdMin:10,thresholdMax:90,thresholdSuffix:"%"}),v.jsx(sn,{label:"Battery Critical",description:"Alert at critical battery level",checked:e.alert_rules.battery_critical,onChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_critical:i}}),threshold:e.alert_rules.battery_critical_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_critical_threshold:i}}),thresholdLabel:"Below",thresholdMin:5,thresholdMax:50,thresholdSuffix:"%"}),v.jsx(sn,{label:"Battery Emergency",description:"Alert at emergency battery level",checked:e.alert_rules.battery_emergency,onChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_emergency:i}}),threshold:e.alert_rules.battery_emergency_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_emergency_threshold:i}}),thresholdLabel:"Below",thresholdMin:1,thresholdMax:25,thresholdSuffix:"%"}),v.jsx(sn,{label:"Battery Trend Declining",description:"Alert when battery shows a declining trend over 7 days",checked:e.alert_rules.battery_trend_declining,onChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_trend_declining:i}})}),v.jsx(sn,{label:"Power Source Change",description:"Alert when a node switches between battery and USB power",checked:e.alert_rules.power_source_change,onChange:i=>t({...e,alert_rules:{...e.alert_rules,power_source_change:i}})}),v.jsx(sn,{label:"Solar Not Charging",description:"Alert when a solar-powered node isn't charging during daylight",checked:e.alert_rules.solar_not_charging,onChange:i=>t({...e,alert_rules:{...e.alert_rules,solar_not_charging:i}})})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Utilization"}),v.jsx(sn,{label:"High Utilization",description:"Alert when channel utilization stays high for extended periods",checked:e.alert_rules.sustained_high_util,onChange:i=>t({...e,alert_rules:{...e.alert_rules,sustained_high_util:i}}),threshold:e.alert_rules.high_util_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,high_util_threshold:i}}),thresholdLabel:"Above",thresholdMin:5,thresholdMax:50,thresholdSuffix:`% for ${e.alert_rules.high_util_hours}h`}),v.jsx(sn,{label:"Packet Flood",description:"Alert when a single node sends excessive packets",checked:e.alert_rules.packet_flood,onChange:i=>t({...e,alert_rules:{...e.alert_rules,packet_flood:i}}),threshold:e.alert_rules.packet_flood_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,packet_flood_threshold:i}}),thresholdLabel:"Over",thresholdMin:100,thresholdMax:2e3,thresholdSuffix:"pkts/24h"})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Health Scores"}),v.jsx(sn,{label:"Mesh Score Alert",description:"Alert when overall mesh health score drops below threshold",checked:e.alert_rules.mesh_score_alert,onChange:i=>t({...e,alert_rules:{...e.alert_rules,mesh_score_alert:i}}),threshold:e.alert_rules.mesh_score_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,mesh_score_threshold:i}}),thresholdLabel:"Below",thresholdMin:30,thresholdMax:90,thresholdSuffix:"/100"}),v.jsx(sn,{label:"Region Score Alert",description:"Alert when a region's health score drops below threshold",checked:e.alert_rules.region_score_alert,onChange:i=>t({...e,alert_rules:{...e.alert_rules,region_score_alert:i}}),threshold:e.alert_rules.region_score_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,region_score_threshold:i}}),thresholdLabel:"Below",thresholdMin:30,thresholdMax:90,thresholdSuffix:"/100"})]})]})]})]})}function oxe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.dashboard}),v.jsx(or,{label:"Enable Dashboard",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Run the web dashboard"}),e.enabled&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"Host",value:e.host,onChange:r=>t({...e,host:r}),placeholder:"0.0.0.0",helper:"Network bind address",info:"0.0.0.0 = accessible from any device on the network. 127.0.0.1 = only accessible from this machine."}),v.jsx(We,{label:"Port",value:e.port,onChange:r=>t({...e,port:r}),min:1,max:65535,helper:"Dashboard URL port",info:"Port number for the web dashboard URL. You access the dashboard at http://your-ip:port"})]})]})}function sxe(){var I;const[e,t]=G.useState(null),[r,n]=G.useState(null),[i,a]=G.useState("bot"),[o,s]=G.useState(!0),[l,u]=G.useState(!1),[c,h]=G.useState(null),[f,d]=G.useState(null),[g,m]=G.useState(!1),[y,x]=G.useState(!1),_=G.useCallback(async()=>{try{const N=await fetch("/api/config");if(!N.ok)throw new Error("Failed to fetch config");const D=await N.json();t(D),n(JSON.parse(JSON.stringify(D))),x(!1),h(null)}catch(N){h(N instanceof Error?N.message:"Unknown error")}finally{s(!1)}},[]);G.useEffect(()=>{document.title="Config — MeshAI",_()},[_]),G.useEffect(()=>{e&&r&&x(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);const w=async()=>{if(e){u(!0),h(null),d(null);try{const N=e[i],D=await fetch(`/api/config/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(N)}),O=await D.json();if(!D.ok)throw new Error(O.detail||"Save failed");d(`${i} saved successfully`),n(JSON.parse(JSON.stringify(e))),x(!1),O.restart_required&&(m(!0),hY(Array.isArray(O.changed_keys)?O.changed_keys:[])),setTimeout(()=>d(null),3e3)}catch(N){h(N instanceof Error?N.message:"Save failed")}finally{u(!1)}}},S=()=>{r&&(t(JSON.parse(JSON.stringify(r))),x(!1))},T=async()=>{try{await fetch("/api/restart",{method:"POST"}),m(!1),d("Restart initiated")}catch{h("Restart failed")}},M=(N,D)=>{e&&t({...e,[N]:D})};if(o)return v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading configuration..."})});if(!e)return v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-red-400",children:"Failed to load configuration"})});const A=()=>{switch(i){case"bot":return v.jsx(Z0e,{data:e.bot,onChange:N=>M("bot",N)});case"connection":return v.jsx($0e,{data:e.connection,onChange:N=>M("connection",N)});case"response":return v.jsx(Y0e,{data:e.response,onChange:N=>M("response",N)});case"history":return v.jsx(X0e,{data:e.history,onChange:N=>M("history",N)});case"memory":return v.jsx(q0e,{data:e.memory,onChange:N=>M("memory",N)});case"context":return v.jsx(K0e,{data:e.context,onChange:N=>M("context",N)});case"commands":return v.jsx(J0e,{data:e.commands,onChange:N=>M("commands",N)});case"llm":return v.jsx(Q0e,{data:e.llm,onChange:N=>M("llm",N)});case"weather":return v.jsx(exe,{data:e.weather,onChange:N=>M("weather",N)});case"meshmonitor":return v.jsx(txe,{data:e.meshmonitor,onChange:N=>M("meshmonitor",N)});case"knowledge":return v.jsx(rxe,{data:e.knowledge,onChange:N=>M("knowledge",N)});case"mesh_sources":return v.jsx(ixe,{data:e.mesh_sources,onChange:N=>M("mesh_sources",N)});case"mesh_intelligence":return v.jsx(axe,{data:e.mesh_intelligence,onChange:N=>M("mesh_intelligence",N)});case"dashboard":return v.jsx(oxe,{data:e.dashboard,onChange:N=>M("dashboard",N)});default:return null}},P=((I=A3.find(N=>N.key===i))==null?void 0:I.label)||i;return v.jsxs("div",{className:"flex gap-6 h-[calc(100vh-8rem)]",children:[v.jsx("div",{className:"w-48 flex-shrink-0 space-y-1",children:A3.map(({key:N,label:D,icon:O})=>v.jsxs("button",{onClick:()=>a(N),className:`w-full flex items-center gap-2 px-3 py-2 rounded text-sm transition-colors ${i===N?"bg-accent text-white":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover"}`,children:[v.jsx(O,{size:16}),v.jsx("span",{children:D}),y&&i===N&&v.jsx("span",{className:"ml-auto w-2 h-2 bg-amber-500 rounded-full"})]},N))}),v.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[v.jsxs("div",{className:"flex items-center justify-between mb-6",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(vB,{size:20,className:"text-slate-500"}),v.jsx("h2",{className:"text-lg font-semibold text-slate-200",children:P})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[y&&v.jsxs("button",{onClick:S,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm text-slate-400 hover:text-slate-200 bg-bg-hover rounded transition-colors",children:[v.jsx(Jx,{size:14}),"Discard"]}),v.jsxs("button",{onClick:w,disabled:l||!y,className:"flex items-center gap-1.5 px-4 py-1.5 text-sm bg-accent text-white rounded hover:bg-accent/80 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[l?v.jsx($v,{size:14,className:"animate-spin"}):v.jsx(zM,{size:14}),"Save"]})]})]}),g&&v.jsxs("div",{className:"flex items-center justify-between p-3 mb-4 bg-amber-500/10 border border-amber-500/30",children:[v.jsxs("div",{className:"flex items-center gap-2 text-amber-400",children:[v.jsx($a,{size:16}),v.jsx("span",{className:"text-sm",children:"Restart required for changes to take effect"})]}),v.jsx("button",{onClick:T,className:"px-3 py-1 text-sm bg-amber-500 text-white rounded hover:bg-amber-600 transition-colors",children:"Restart Now"})]}),c&&v.jsxs("div",{className:"flex items-center gap-2 p-3 mb-4 bg-red-500/10 border border-red-500/30 text-red-400",children:[v.jsx(ca,{size:16}),v.jsx("span",{className:"text-sm",children:c})]}),f&&v.jsxs("div",{className:"flex items-center gap-2 p-3 mb-4 bg-green-500/10 border border-green-500/30 text-green-400",children:[v.jsx(Za,{size:16}),v.jsx("span",{className:"text-sm",children:f})]}),v.jsx("div",{className:"flex-1 overflow-y-auto pr-2",children:v.jsx("div",{className:"bg-bg-card border border-border p-6",children:A()})})]})]})}function lxe({feed:e}){const t=e.is_loaded?e.consecutive_errors>0?"bg-amber-500":"bg-green-500":"bg-red-500",r=e.is_loaded?e.consecutive_errors>0?`${e.consecutive_errors} errors`:"Healthy":"Not loaded",n=e.last_fetch?new Date(e.last_fetch*1e3).toLocaleTimeString():"Never";return v.jsxs("div",{className:"bg-bg-hover p-4",children:[v.jsxs("div",{className:"flex items-center justify-between mb-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${t}`}),v.jsx("span",{className:"text-sm font-medium text-white uppercase",children:e.source})]}),v.jsx("span",{className:"text-xs text-[#777]",children:r})]}),v.jsxs("div",{className:"text-xs font-mono text-[#666] space-y-1",children:[v.jsxs("div",{children:["Events: ",e.event_count]}),v.jsxs("div",{children:["Last fetch: ",n]}),e.last_error&&v.jsx("div",{className:"text-accent truncate",children:e.last_error})]})]})}function uxe({event:e}){const t=e.severity.toLowerCase(),r=t==="extreme"||t==="severe"||t==="immediate"?{bg:"bg-red-500/10",border:"border-red-500",Icon:Vo,color:"text-red-500"}:t==="moderate"||t==="warning"||t==="priority"?{bg:"bg-accent/10",border:"border-amber-500",Icon:$a,color:"text-accent"}:{bg:"bg-sky-400/10",border:"border-sky-400",Icon:qx,color:"text-sky-400"},n=r.Icon;return v.jsx("div",{className:`p-3 ${r.bg} border-l-2 ${r.border}`,children:v.jsxs("div",{className:"flex items-start gap-3",children:[v.jsx(n,{size:16,className:r.color}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[v.jsx("span",{className:"text-sm font-medium text-white",children:e.event_type}),v.jsx("span",{className:`text-xs px-1.5 py-0.5 ${r.bg} ${r.color}`,children:e.severity})]}),v.jsx("div",{className:"text-sm font-sans text-[#e0e0e0]",children:e.headline})]})]})})}function J8({value:e,onChange:t,disabled:r,centralDisabled:n}){const i="px-2 py-1 text-xs transition-colors";return v.jsxs("div",{className:`flex border border-border overflow-hidden ${r?"opacity-40":""}`,children:[v.jsx("button",{type:"button",disabled:r,onClick:()=>t("native"),className:`${i} ${e==="native"?"bg-accent text-white":"text-[#777] hover:text-white"}`,children:"native"}),v.jsx("button",{type:"button",disabled:r||n,title:n?"Central not available for this adapter":"",onClick:()=>{n||t("central")},className:`${i} ${n?"text-[#666] cursor-not-allowed":e==="central"?"bg-accent text-white":"text-[#777] hover:text-white"}`,children:"central"})]})}function cxe({title:e,subtitle:t,enabled:r,onEnabled:n,feedSource:i,onFeedSource:a,hasCentral:o,nativeOnly:s,hasKey:l,health:u,events:c,children:h}){const f=s||!o;return v.jsxs("div",{className:"border border-border p-4 space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{children:[v.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:e}),t&&v.jsx("p",{className:"text-xs text-[#666]",children:t})]}),v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("span",{className:"text-[10px] uppercase tracking-wide text-[#666]",children:"source"}),v.jsx(J8,{value:i,onChange:a,disabled:!r,centralDisabled:f})]}),v.jsx(or,{label:"",checked:r,onChange:n})]})]}),!l&&v.jsx("div",{className:"text-xs text-accent bg-accent/10 p-2",children:"API key not configured — contact admin"}),s&&v.jsx("div",{className:"text-[11px] text-[#666]",children:"Central not available for this adapter — native only"}),v.jsx("div",{className:r?"space-y-3":"space-y-3 opacity-40 pointer-events-none select-none",children:h}),(u||c&&c.length>0)&&v.jsxs("div",{className:"pt-2 border-t border-border space-y-3",children:[v.jsx("div",{className:"text-[10px] uppercase tracking-wide text-[#666]",children:"Live status"}),u?v.jsx(lxe,{feed:u}):v.jsx("div",{className:"text-xs text-[#666]",children:"No status reported."}),c&&c.length>0&&v.jsx("div",{className:"space-y-2",children:c.slice(0,5).map((d,g)=>v.jsx(uxe,{event:d},g))})]})]})}const hs={nws:{label:"NWS Weather Alerts",subtitle:"National Weather Service alerts",health:"nws",hasCentral:!0,nativeOnly:!1,hasKey:!0},fires:{label:"NIFC Fire Perimeters",subtitle:"Active wildfires (National Interagency Fire Center)",health:"nifc",hasCentral:!0,nativeOnly:!1,hasKey:!0},firms:{label:"NASA FIRMS Hotspots",subtitle:"Satellite thermal-anomaly detections",health:"firms",hasCentral:!0,nativeOnly:!1,hasKey:!1},swpc:{label:"NOAA Space Weather (SWPC)",subtitle:"Solar indices, geomagnetic storms",health:"swpc",hasCentral:!0,nativeOnly:!1,hasKey:!0},ducting:{label:"Tropospheric Ducting",subtitle:"VHF/UHF extended-range conditions",health:"ducting",hasCentral:!1,nativeOnly:!0,hasKey:!0},traffic:{label:"TomTom Traffic",subtitle:"Traffic flow on monitored corridors",health:"traffic",hasCentral:!0,nativeOnly:!1,hasKey:!0},roads511:{label:"511 Road Conditions",subtitle:"State DOT road events and closures",health:"roads511",hasCentral:!0,nativeOnly:!1,hasKey:!1},wzdx:{label:"WZDx Work Zones",subtitle:"Planned road work and construction events from ITD",health:"roads511",hasCentral:!0,nativeOnly:!1,hasKey:!0},usgs_quake:{label:"USGS Earthquakes",subtitle:"Seismic events from the USGS feed",health:"usgs_quake",hasCentral:!0,nativeOnly:!1,hasKey:!0},usgs:{label:"USGS Stream Gauges",subtitle:"River and stream water levels",health:"usgs",hasCentral:!0,nativeOnly:!1,hasKey:!0},avalanche:{label:"Avalanche Advisories",subtitle:"Backcountry avalanche danger ratings",health:"avalanche",hasCentral:!0,nativeOnly:!1,hasKey:!0}},_S=[{key:"central",label:"Central",icon:K$,adapters:[]},{key:"weather",label:"Weather",icon:Du,adapters:["nws"]},{key:"fire",label:"Fire",icon:Xx,adapters:["fires","firms"]},{key:"rf",label:"RF Propagation",icon:Di,adapters:["swpc","ducting"]},{key:"roads",label:"Roads",icon:$x,adapters:["traffic","roads511","wzdx"]},{key:"geohazards",label:"Geohazards",icon:Kx,adapters:["usgs_quake","usgs","avalanche"]},{key:"tracking",label:"Tracking",icon:Qx,adapters:[]},{key:"mesh",label:"Mesh Health",icon:rf,adapters:[]}];function hxe(){var Lf,Nf;const[e,t]=G.useState(null),[r,n]=G.useState(""),[i,a]=G.useState(null),[o,s]=G.useState([]),[l,u]=G.useState(!0),[c,h]=G.useState(!1),[f,d]=G.useState(null),[g,m]=G.useState(null),[y,x]=G.useState(!1),[_,w]=G.useState("weather"),[S,T]=G.useState("nws"),[M,A]=G.useState({allowed_incident_types:["WF"],freshness_seconds:0,cooldown_seconds:28800,broadcast_on_acres:!0,broadcast_on_contained:!0}),[P,I]=G.useState(""),[N,D]=G.useState({digest_enabled:!0,digest_schedule:["06:00","18:00"],digest_timezone:"America/Boise"}),[O,R]=G.useState(""),[F,H]=G.useState({min_magnitude:4,drop_non_present:!0,drop_zero_magnitude:!0}),[W,V]=G.useState(""),[z,Z]=G.useState({min_severity:"None",enabled_categories:["incident","closure"],enabled_sub_types:["accident","road_closed","closure","lane_closed","vehicle_on_fire","flooding","debris"]}),[U,$]=G.useState(""),[Y,te]=G.useState({broadcast:!1,min_severity:"Minor",sub_types:["road_works","lane_closed","road_closed"]}),[ie,se]=G.useState(""),[le,Ee]=G.useState({broadcast_severities:["Extreme","Severe"],duplicate_allowed_after_seconds:3600}),[me,ye]=G.useState(""),[Me,pe]=G.useState({min_danger_level:3}),[Te,st]=G.useState(""),[ze,et]=G.useState({geomag_kp_floor:7,flare_class_floor:"X1",proton_pfu_floor:10}),[lt,Et]=G.useState("");G.useEffect(()=>{document.title="Environment — MeshAI",(async()=>{var xe,Ut,Hn,ui,Gi,gl,ee,xt,pt,dt,ur,oo,rn,Be,Pf,If,Df,Ef,oc,jf,so,Rf,hg;try{const fg=await(await fetch("/api/config/environmental")).json();t(fg),n(JSON.stringify(fg));try{const Bt=await fetch("/api/adapter-config/wfigs");if(Bt.ok){const wt=await Bt.json(),Ft={allowed_incident_types:((xe=wt.allowed_incident_types)==null?void 0:xe.value)??["WF"],freshness_seconds:((Ut=wt.freshness_seconds)==null?void 0:Ut.value)??0,cooldown_seconds:((Hn=wt.cooldown_seconds)==null?void 0:Hn.value)??28800,broadcast_on_acres:((ui=wt.broadcast_on_acres)==null?void 0:ui.value)??!0,broadcast_on_contained:((Gi=wt.broadcast_on_contained)==null?void 0:Gi.value)??!0};A(Ft),I(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/fires");if(Bt.ok){const wt=await Bt.json(),Ft={digest_enabled:((gl=wt.digest_enabled)==null?void 0:gl.value)??!0,digest_schedule:((ee=wt.digest_schedule)==null?void 0:ee.value)??["06:00","18:00"],digest_timezone:((xt=wt.digest_timezone)==null?void 0:xt.value)??"America/Boise"};D(Ft),R(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/tomtom_incidents");if(Bt.ok){const wt=await Bt.json(),Ft={min_magnitude:((pt=wt.min_magnitude)==null?void 0:pt.value)??4,drop_non_present:((dt=wt.drop_non_present)==null?void 0:dt.value)??!0,drop_zero_magnitude:((ur=wt.drop_zero_magnitude)==null?void 0:ur.value)??!0};H(Ft),V(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/itd_511");if(Bt.ok){const wt=await Bt.json(),Ft={min_severity:((oo=wt.min_severity)==null?void 0:oo.value)??"None",enabled_categories:((rn=wt.enabled_categories)==null?void 0:rn.value)??["incident","closure"],enabled_sub_types:((Be=wt.enabled_sub_types)==null?void 0:Be.value)??["accident","road_closed","closure","lane_closed","vehicle_on_fire","flooding","debris"]};Z(Ft),$(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/wzdx");if(Bt.ok){const wt=await Bt.json(),Ft={broadcast:((Pf=wt.broadcast)==null?void 0:Pf.value)??!1,min_severity:((If=wt.min_severity)==null?void 0:If.value)??"Minor",sub_types:((Df=wt.sub_types)==null?void 0:Df.value)??["road_works","lane_closed","road_closed"]};te(Ft),se(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/nws");if(Bt.ok){const wt=await Bt.json(),Ft={broadcast_severities:((Ef=wt.broadcast_severities)==null?void 0:Ef.value)??["Extreme","Severe"],duplicate_allowed_after_seconds:((oc=wt.duplicate_allowed_after_seconds)==null?void 0:oc.value)??3600};Ee(Ft),ye(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/avalanche");if(Bt.ok){const Ft={min_danger_level:((jf=(await Bt.json()).min_danger_level)==null?void 0:jf.value)??3};pe(Ft),st(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/swpc");if(Bt.ok){const wt=await Bt.json(),Ft={geomag_kp_floor:((so=wt.geomag_kp_floor)==null?void 0:so.value)??7,flare_class_floor:((Rf=wt.flare_class_floor)==null?void 0:Rf.value)??"X1",proton_pfu_floor:((hg=wt.proton_pfu_floor)==null?void 0:hg.value)??10};et(Ft),Et(JSON.stringify(Ft))}}catch{}}catch(Of){d(Of instanceof Error?Of.message:"Failed to load config")}finally{u(!1)}})()},[]),G.useEffect(()=>{const xe=async()=>{try{a(await xB()),s(await _B())}catch{}};xe();const Ut=setInterval(xe,3e4);return()=>clearInterval(Ut)},[]);const lr=e!==null&&JSON.stringify(e)!==r,Mr=JSON.stringify(M)!==P,Gn=JSON.stringify(N)!==O,Wn=JSON.stringify(F)!==W,io=JSON.stringify(z)!==U,Af=JSON.stringify(Y)!==ie,ng=JSON.stringify(le)!==me,ig=JSON.stringify(Me)!==Te,ac=JSON.stringify(ze)!==lt,ag=lr||Mr||Gn||Wn||io||Af||ng||ig||ac,jt=async(xe,Ut,Hn)=>{const ui=await fetch(`/api/adapter-config/${xe}/${Ut}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:Hn})});if(!ui.ok){const Gi=await ui.json().catch(()=>({}));throw new Error(Gi.detail||`Failed to save ${xe}.${Ut}`)}},$_=async()=>{if(e){h(!0),d(null),m(null);try{if(lr){const xe=await fetch("/api/config/environmental",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Ut=await xe.json();if(!xe.ok)throw new Error(Ut.detail||"Save failed");n(JSON.stringify(e)),Ut.restart_required&&x(!0)}if(Mr){const xe=JSON.parse(P);M.freshness_seconds!==xe.freshness_seconds&&await jt("wfigs","freshness_seconds",M.freshness_seconds),JSON.stringify(M.allowed_incident_types)!==JSON.stringify(xe.allowed_incident_types)&&await jt("wfigs","allowed_incident_types",M.allowed_incident_types),M.cooldown_seconds!==xe.cooldown_seconds&&await jt("wfigs","cooldown_seconds",M.cooldown_seconds),M.broadcast_on_acres!==xe.broadcast_on_acres&&await jt("wfigs","broadcast_on_acres",M.broadcast_on_acres),M.broadcast_on_contained!==xe.broadcast_on_contained&&await jt("wfigs","broadcast_on_contained",M.broadcast_on_contained),I(JSON.stringify(M))}if(Gn){const xe=JSON.parse(O);N.digest_enabled!==xe.digest_enabled&&await jt("fires","digest_enabled",N.digest_enabled),JSON.stringify(N.digest_schedule)!==JSON.stringify(xe.digest_schedule)&&await jt("fires","digest_schedule",N.digest_schedule),N.digest_timezone!==xe.digest_timezone&&await jt("fires","digest_timezone",N.digest_timezone),R(JSON.stringify(N))}if(Wn){const xe=JSON.parse(W);F.min_magnitude!==xe.min_magnitude&&await jt("tomtom_incidents","min_magnitude",F.min_magnitude),F.drop_non_present!==xe.drop_non_present&&await jt("tomtom_incidents","drop_non_present",F.drop_non_present),F.drop_zero_magnitude!==xe.drop_zero_magnitude&&await jt("tomtom_incidents","drop_zero_magnitude",F.drop_zero_magnitude),V(JSON.stringify(F))}if(io){const xe=JSON.parse(U);z.min_severity!==xe.min_severity&&await jt("itd_511","min_severity",z.min_severity),JSON.stringify(z.enabled_categories)!==JSON.stringify(xe.enabled_categories)&&await jt("itd_511","enabled_categories",z.enabled_categories),JSON.stringify(z.enabled_sub_types)!==JSON.stringify(xe.enabled_sub_types)&&await jt("itd_511","enabled_sub_types",z.enabled_sub_types),$(JSON.stringify(z))}if(Af){const xe=JSON.parse(ie);Y.broadcast!==xe.broadcast&&await jt("wzdx","broadcast",Y.broadcast),Y.min_severity!==xe.min_severity&&await jt("wzdx","min_severity",Y.min_severity),JSON.stringify(Y.sub_types)!==JSON.stringify(xe.sub_types)&&await jt("wzdx","sub_types",Y.sub_types),se(JSON.stringify(Y))}if(ng){const xe=JSON.parse(me);JSON.stringify(le.broadcast_severities)!==JSON.stringify(xe.broadcast_severities)&&await jt("nws","broadcast_severities",le.broadcast_severities),le.duplicate_allowed_after_seconds!==xe.duplicate_allowed_after_seconds&&await jt("nws","duplicate_allowed_after_seconds",le.duplicate_allowed_after_seconds),ye(JSON.stringify(le))}if(ig){const xe=JSON.parse(Te);Me.min_danger_level!==xe.min_danger_level&&await jt("avalanche","min_danger_level",Me.min_danger_level),st(JSON.stringify(Me))}if(ac){const xe=JSON.parse(lt);ze.geomag_kp_floor!==xe.geomag_kp_floor&&await jt("swpc","geomag_kp_floor",ze.geomag_kp_floor),ze.flare_class_floor!==xe.flare_class_floor&&await jt("swpc","flare_class_floor",ze.flare_class_floor),ze.proton_pfu_floor!==xe.proton_pfu_floor&&await jt("swpc","proton_pfu_floor",ze.proton_pfu_floor),Et(JSON.stringify(ze))}m("Config saved"),setTimeout(()=>m(null),3e3)}catch(xe){d(xe instanceof Error?xe.message:"Save failed")}finally{h(!1)}}},og=()=>{e&&t(JSON.parse(r)),A(JSON.parse(P||JSON.stringify(M))),D(JSON.parse(O||JSON.stringify(N))),H(JSON.parse(W||JSON.stringify(F))),Z(JSON.parse(U||JSON.stringify(z))),te(JSON.parse(ie||JSON.stringify(Y))),Ee(JSON.parse(me||JSON.stringify(le))),pe(JSON.parse(Te||JSON.stringify(Me))),et(JSON.parse(lt||JSON.stringify(ze)))},sg=async()=>{try{await fetch("/api/restart",{method:"POST"}),x(!1),m("Restart initiated")}catch{d("Restart failed")}},Ue=xe=>e&&t({...e,...xe});if(l)return v.jsx("div",{className:"flex items-center justify-center h-64 text-[#777]",children:"Loading environmental config…"});if(!e)return v.jsx("div",{className:"flex items-center justify-center h-64 text-red-400",children:f||"No config"});const lg=xe=>i==null?void 0:i.feeds.find(Ut=>Ut.source===hs[xe].health),kf=xe=>o.filter(Ut=>Ut.source===hs[xe].health),ao=_S.find(xe=>xe.key===_),tn=ao.adapters.length===0?null:S&&ao.adapters.includes(S)?S:ao.adapters[0],pl=xe=>{var Ut,Hn,ui,Gi,gl;switch(xe){case"nws":return v.jsxs(v.Fragment,{children:[v.jsx(ou,{label:"NWS Zones",value:e.nws_zones,onChange:ee=>Ue({nws_zones:ee}),helper:"Zone IDs like IDZ016, IDZ030",infoLink:"https://www.weather.gov/pimar/PubZone"}),e.nws.feed_source!=="central"&&v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"User Agent",value:e.nws.user_agent,onChange:ee=>Ue({nws:{...e.nws,user_agent:ee}}),placeholder:"(MeshAI, you@email.com)",helper:"Format: (app_name, contact_email)"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Tick Seconds",value:e.nws.tick_seconds,onChange:ee=>Ue({nws:{...e.nws,tick_seconds:ee}}),min:30}),v.jsx(Ln,{label:"Min Severity",value:e.nws.severity_min,onChange:ee=>Ue({nws:{...e.nws,severity_min:ee}}),options:[{value:"minor",label:"Minor"},{value:"moderate",label:"Moderate"},{value:"severe",label:"Severe"},{value:"extreme",label:"Extreme"}]})]})]}),e.nws.feed_source==="central"&&v.jsxs("div",{className:"border-t border-border pt-4 mt-4",children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Broadcast Filters"}),v.jsxs("div",{className:"mb-3",children:[v.jsx("div",{className:"text-xs font-sans text-[#777] mb-2",children:"Severities to broadcast"}),v.jsx("div",{className:"flex gap-6",children:["Extreme","Severe","Moderate","Minor"].map(ee=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:le.broadcast_severities.includes(ee),onChange:xt=>{const pt=le.broadcast_severities;Ee({...le,broadcast_severities:xt.target.checked?[...pt,ee]:pt.filter(dt=>dt!==ee)})},className:"w-4 h-4 accent-[#f59e0b]"}),v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:ee})]},ee))})]}),v.jsx(We,{label:"Re-broadcast Cooldown (seconds)",value:le.duplicate_allowed_after_seconds,onChange:ee=>Ee({...le,duplicate_allowed_after_seconds:ee}),min:0,helper:"Minimum seconds before the same alert ID can be re-broadcast"})]})]});case"swpc":return v.jsx("div",{className:"space-y-6",children:v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Broadcast Thresholds"}),v.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[v.jsx(Ln,{label:"Geomag Kp Floor",value:String(ze.geomag_kp_floor),onChange:ee=>et({...ze,geomag_kp_floor:Number(ee)}),options:[{value:"5",label:"5 — G1 Minor"},{value:"6",label:"6 — G2 Moderate"},{value:"7",label:"7 — G3 Strong"},{value:"8",label:"8 — G4 Severe"},{value:"9",label:"9 — G5 Extreme"}],helper:"Kp at or above this triggers geomag broadcast"}),v.jsx(Ln,{label:"Flare Class Floor",value:ze.flare_class_floor,onChange:ee=>et({...ze,flare_class_floor:ee}),options:[{value:"M1",label:"M1 — R1 Minor"},{value:"M5",label:"M5 — R2 Moderate"},{value:"X1",label:"X1 — R3 Strong"},{value:"X10",label:"X10 — R4 Severe"}],helper:"X-ray flare class floor for broadcast"}),v.jsx(Ln,{label:"Proton pfu Floor",value:String(ze.proton_pfu_floor),onChange:ee=>et({...ze,proton_pfu_floor:Number(ee)}),options:[{value:"10",label:"10 — S1 Minor"},{value:"100",label:"100 — S2 Moderate"},{value:"1000",label:"1000 — S3 Strong"},{value:"10000",label:"10000 — S4 Severe"}],helper:"Proton flux (pfu) at ≥10 MeV for broadcast"})]})]})});case"ducting":return v.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[v.jsx(We,{label:"Tick Seconds",value:e.ducting.tick_seconds,onChange:ee=>Ue({ducting:{...e.ducting,tick_seconds:ee}}),min:60}),v.jsx(We,{label:"Latitude",value:e.ducting.latitude,onChange:ee=>Ue({ducting:{...e.ducting,latitude:ee}}),step:.01}),v.jsx(We,{label:"Longitude",value:e.ducting.longitude,onChange:ee=>Ue({ducting:{...e.ducting,longitude:ee}}),step:.01})]});case"fires":return v.jsxs("div",{className:"space-y-6",children:[e.fires.feed_source!=="central"&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Tick Seconds",value:e.fires.tick_seconds,onChange:ee=>Ue({fires:{...e.fires,tick_seconds:ee}}),min:60}),v.jsx(Ln,{label:"State",value:e.fires.state,onChange:ee=>Ue({fires:{...e.fires,state:ee}}),options:W0e})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Incident Types"}),v.jsx("div",{className:"flex gap-6",children:[["WF","Wildfire"],["RX","Prescribed Burn"],["OTHER","Other"]].map(([ee,xt])=>{var pt;return v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:((pt=M.allowed_incident_types)==null?void 0:pt.includes(ee))??ee==="WF",onChange:dt=>{const ur=M.allowed_incident_types??["WF"];A({...M,allowed_incident_types:dt.target.checked?[...ur,ee]:ur.filter(oo=>oo!==ee)})},className:"w-4 h-4 accent-[#f59e0b]"}),v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:xt})]},ee)})})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Broadcast Triggers"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:"Broadcast on acres increase"}),v.jsx("input",{type:"checkbox",checked:M.broadcast_on_acres,onChange:ee=>A({...M,broadcast_on_acres:ee.target.checked}),className:"w-4 h-4 accent-[#f59e0b]"})]}),v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:"Broadcast on containment increase"}),v.jsx("input",{type:"checkbox",checked:M.broadcast_on_contained,onChange:ee=>A({...M,broadcast_on_contained:ee.target.checked}),className:"w-4 h-4 accent-[#f59e0b]"})]})]})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Update Cooldown (hours)",value:Math.round(M.cooldown_seconds/3600),onChange:ee=>A({...M,cooldown_seconds:ee*3600}),min:0,helper:"Minimum hours between updates for the same fire"}),v.jsx(We,{label:"Freshness Window (hours)",value:Math.round(M.freshness_seconds/3600),onChange:ee=>A({...M,freshness_seconds:ee*3600}),min:0,helper:"0 = always broadcast regardless of event age"})]})]});case"avalanche":return v.jsxs("div",{className:"space-y-6",children:[e.avalanche.feed_source!=="central"&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Tick Seconds",value:e.avalanche.tick_seconds,onChange:ee=>Ue({avalanche:{...e.avalanche,tick_seconds:ee}}),min:60}),v.jsx(U0e,{label:"Season Months",value:e.avalanche.season_months,onChange:ee=>Ue({avalanche:{...e.avalanche,season_months:ee}}),helper:"e.g., 12, 1, 2, 3, 4"})]}),v.jsx(ou,{label:"Center IDs",value:e.avalanche.center_ids,onChange:ee=>Ue({avalanche:{...e.avalanche,center_ids:ee}}),helper:"e.g., SNFAC",infoLink:"https://avalanche.org/avalanche-centers/"}),v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Broadcast Settings"}),v.jsx("div",{className:"grid grid-cols-2 gap-4",children:v.jsx(Ln,{label:"Min Danger Level",value:String(Me.min_danger_level),onChange:ee=>pe({...Me,min_danger_level:Number(ee)}),options:[{value:"3",label:"3 — Considerable"},{value:"4",label:"4 — High"},{value:"5",label:"5 — Extreme"}],helper:"Minimum avalanche danger level to broadcast"})})]})]});case"usgs":return v.jsxs(v.Fragment,{children:[v.jsx(We,{label:"Tick Seconds",value:e.usgs.tick_seconds,onChange:ee=>Ue({usgs:{...e.usgs,tick_seconds:ee}}),min:900,helper:"Minimum 15 min (900s). tick_seconds is the native-mode poll interval; ignored when this adapter is set to feed_source=central."}),v.jsx(ou,{label:"Site IDs",value:e.usgs.sites,onChange:ee=>Ue({usgs:{...e.usgs,sites:ee}}),helper:"USGS gauge site numbers",infoLink:"https://waterdata.usgs.gov/nwis"})]});case"usgs_quake":return v.jsxs("div",{className:"space-y-6",children:[e.usgs_quake.feed_source!=="central"&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Tick Seconds",value:e.usgs_quake.tick_seconds,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,tick_seconds:ee}}),min:60}),v.jsx(ct,{label:"Region Tag",value:e.usgs_quake.region,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,region:ee}})})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Magnitude Thresholds"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Global Floor",value:e.usgs_quake.global_mag_floor,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,global_mag_floor:ee}}),step:.1,min:0,helper:"Broadcast anywhere at or above this magnitude"}),v.jsx(We,{label:"Regional Floor",value:e.usgs_quake.regional_mag_floor,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,regional_mag_floor:ee}}),step:.1,min:0,helper:"Reduced floor within regional radius"}),v.jsx(We,{label:"Regional Radius (mi)",value:e.usgs_quake.regional_radius_mi,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,regional_radius_mi:ee}}),min:50,helper:"Radius around region centroid for reduced floor"}),v.jsx(We,{label:"Escalation Floor",value:e.usgs_quake.escalate_mag_floor,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,escalate_mag_floor:ee}}),step:.1,min:0,helper:"Magnitude at which broadcast uses warning emoji"})]})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"PAGER Alert Levels"}),v.jsx("div",{className:"text-xs text-[#666] mb-2",children:"Broadcast at any magnitude when USGS PAGER alert reaches these levels"}),v.jsx("div",{className:"flex gap-6",children:["green","yellow","orange","red"].map(ee=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:(e.usgs_quake.broadcast_pager_alerts??[]).includes(ee),onChange:xt=>{const pt=e.usgs_quake.broadcast_pager_alerts??[];Ue({usgs_quake:{...e.usgs_quake,broadcast_pager_alerts:xt.target.checked?[...pt,ee]:pt.filter(dt=>dt!==ee)}})},className:"w-4 h-4 accent-[#f59e0b]"}),v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0] capitalize",children:ee})]},ee))})]})]});case"traffic":return v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"API Key",value:e.traffic.api_key,onChange:ee=>Ue({traffic:{...e.traffic,api_key:ee}}),type:"password",helper:"developer.tomtom.com"}),v.jsx(We,{label:"Tick Seconds",value:e.traffic.tick_seconds,onChange:ee=>Ue({traffic:{...e.traffic,tick_seconds:ee}}),min:60}),v.jsx("div",{className:"text-xs text-[#666] mt-2",children:"Corridors:"}),(e.traffic.corridors||[]).map((ee,xt)=>v.jsxs("div",{className:"grid grid-cols-4 gap-2 items-end",children:[v.jsx(ct,{label:"Name",value:ee.name,onChange:pt=>{const dt=[...e.traffic.corridors];dt[xt]={...ee,name:pt},Ue({traffic:{...e.traffic,corridors:dt}})}}),v.jsx(We,{label:"Lat",value:ee.lat,onChange:pt=>{const dt=[...e.traffic.corridors];dt[xt]={...ee,lat:pt},Ue({traffic:{...e.traffic,corridors:dt}})},step:.01}),v.jsx(We,{label:"Lon",value:ee.lon,onChange:pt=>{const dt=[...e.traffic.corridors];dt[xt]={...ee,lon:pt},Ue({traffic:{...e.traffic,corridors:dt}})},step:.01}),v.jsx("button",{onClick:()=>Ue({traffic:{...e.traffic,corridors:e.traffic.corridors.filter((pt,dt)=>dt!==xt)}}),className:"px-2 py-2 text-xs text-red-400 hover:text-red-300 border border-red-400/30",children:"Remove"})]},xt)),v.jsx("button",{onClick:()=>Ue({traffic:{...e.traffic,corridors:[...e.traffic.corridors||[],{name:"",lat:0,lon:0}]}}),className:"text-xs text-accent hover:underline",children:"+ Add Corridor"}),v.jsxs("div",{className:"border-t border-border pt-4 mt-4",children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Broadcast Filters"}),v.jsx("div",{className:"grid grid-cols-2 gap-4",children:v.jsxs("div",{children:[v.jsx("label",{className:"text-xs font-sans text-[#777] mb-1 block",children:"Minimum Magnitude"}),v.jsxs("select",{value:F.min_magnitude,onChange:ee=>H({...F,min_magnitude:parseInt(ee.target.value)}),className:"w-full bg-[#0d0d0d] border border-border px-3 py-2 text-sm",children:[v.jsx("option",{value:1,children:"1 — Minor (all)"}),v.jsx("option",{value:2,children:"2 — Moderate (yellow+)"}),v.jsx("option",{value:3,children:"3 — Major (orange+)"}),v.jsx("option",{value:4,children:"4 — Severe (red only)"})]}),v.jsx("p",{className:"text-xs text-[#666] mt-1",children:"Drop TomTom incidents below this severity level"})]})}),v.jsxs("div",{className:"mt-3 space-y-2",children:[v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:"Drop non-present time validity"}),v.jsx("input",{type:"checkbox",checked:F.drop_non_present,onChange:ee=>H({...F,drop_non_present:ee.target.checked}),className:"w-4 h-4 accent-[#f59e0b]"})]}),v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:"Drop zero-magnitude events"}),v.jsx("input",{type:"checkbox",checked:F.drop_zero_magnitude,onChange:ee=>H({...F,drop_zero_magnitude:ee.target.checked}),className:"w-4 h-4 accent-[#f59e0b]"})]})]})]})]});case"roads511":return v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"Base URL",value:e.roads511.base_url,onChange:ee=>Ue({roads511:{...e.roads511,base_url:ee}}),placeholder:"https://511.yourstate.gov/api/v2"}),v.jsx(ct,{label:"API Key",value:e.roads511.api_key,onChange:ee=>Ue({roads511:{...e.roads511,api_key:ee}}),type:"password",helper:"Leave empty if not required"}),v.jsx(We,{label:"Tick Seconds",value:e.roads511.tick_seconds,onChange:ee=>Ue({roads511:{...e.roads511,tick_seconds:ee}}),min:60}),v.jsx(ou,{label:"Endpoints",value:e.roads511.endpoints,onChange:ee=>Ue({roads511:{...e.roads511,endpoints:ee}}),helper:"e.g., /get/event"}),v.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((ee,xt)=>{var pt;return v.jsx(We,{label:ee,value:((pt=e.roads511.bbox)==null?void 0:pt[xt])??0,onChange:dt=>{const ur=[...e.roads511.bbox||[0,0,0,0]];ur[xt]=dt,Ue({roads511:{...e.roads511,bbox:ur}})},step:.01},ee)})}),v.jsxs("div",{className:"border-t border-border pt-4 mt-4",children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Broadcast Filters"}),v.jsx("div",{className:"grid grid-cols-2 gap-4",children:v.jsxs("div",{children:[v.jsx("label",{className:"text-xs font-sans text-[#777] mb-1 block",children:"Minimum Severity"}),v.jsxs("select",{value:z.min_severity,onChange:ee=>Z({...z,min_severity:ee.target.value}),className:"w-full bg-[#0d0d0d] border border-border px-3 py-2 text-sm",children:[v.jsx("option",{value:"None",children:"None (all)"}),v.jsx("option",{value:"Minor",children:"Minor+"}),v.jsx("option",{value:"Major",children:"Major only"})]}),v.jsx("p",{className:"text-xs text-[#666] mt-1",children:"Drop ITD 511 events below this severity"})]})}),v.jsxs("div",{className:"mt-4",children:[v.jsx("div",{className:"text-xs font-sans text-[#777] mb-2",children:"Categories"}),v.jsx("div",{className:"flex gap-6",children:[["incident","Incident"],["closure","Closure"],["special_event","Special Event"]].map(([ee,xt])=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:z.enabled_categories.includes(ee),onChange:pt=>{const dt=z.enabled_categories;Z({...z,enabled_categories:pt.target.checked?[...dt,ee]:dt.filter(ur=>ur!==ee)})},className:"w-4 h-4 accent-[#f59e0b]"}),v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:xt})]},ee))})]}),v.jsxs("div",{className:"mt-4",children:[v.jsx("div",{className:"text-xs font-sans text-[#777] mb-2",children:"Sub-types"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:[["accident","Crash"],["road_closed","Road Closed"],["lane_closed","Lane Closure"],["vehicle_on_fire","Vehicle Fire"],["flooding","Flooding"],["debris","Debris"],["road_works","Road Works"],["disabled_vehicle","Disabled Vehicle"]].map(([ee,xt])=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:z.enabled_sub_types.includes(ee),onChange:pt=>{const dt=z.enabled_sub_types;Z({...z,enabled_sub_types:pt.target.checked?[...dt,ee]:dt.filter(ur=>ur!==ee)})},className:"w-4 h-4 accent-[#f59e0b]"}),v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:xt})]},ee))})]})]})]});case"wzdx":return v.jsxs(v.Fragment,{children:[((Ut=e.wzdx)==null?void 0:Ut.feed_source)!=="central"&&v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"Base URL",value:((Hn=e.wzdx)==null?void 0:Hn.base_url)??"",onChange:ee=>Ue({wzdx:{...e.wzdx,base_url:ee}}),placeholder:"https://511.yourstate.gov/api/v2"}),v.jsx(ct,{label:"API Key",value:((ui=e.wzdx)==null?void 0:ui.api_key)??"",onChange:ee=>Ue({wzdx:{...e.wzdx,api_key:ee}}),type:"password",helper:"Leave empty if not required"}),v.jsx(We,{label:"Tick Seconds",value:((Gi=e.wzdx)==null?void 0:Gi.tick_seconds)??300,onChange:ee=>Ue({wzdx:{...e.wzdx,tick_seconds:ee}}),min:60}),v.jsx(ou,{label:"Endpoints",value:((gl=e.wzdx)==null?void 0:gl.endpoints)??["/get/event"],onChange:ee=>Ue({wzdx:{...e.wzdx,endpoints:ee}}),helper:"e.g., /get/event"}),v.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((ee,xt)=>{var pt,dt;return v.jsx(We,{label:ee,value:((dt=(pt=e.wzdx)==null?void 0:pt.bbox)==null?void 0:dt[xt])??0,onChange:ur=>{var rn;const oo=[...((rn=e.wzdx)==null?void 0:rn.bbox)||[0,0,0,0]];oo[xt]=ur,Ue({wzdx:{...e.wzdx,bbox:oo}})},step:.01},ee)})}),v.jsx("div",{className:"text-xs text-[#666]",children:"Bounding box [W,S,E,N] geographic filter"})]}),v.jsxs("div",{className:"border-t border-border pt-4 mt-4",children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Broadcast Settings"}),v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:"Broadcast work zone events"}),v.jsx("input",{type:"checkbox",checked:Y.broadcast,onChange:ee=>te({...Y,broadcast:ee.target.checked}),className:"w-4 h-4 accent-[#f59e0b]"})]}),Y.broadcast?v.jsxs("div",{className:"space-y-3 mt-3",children:[v.jsxs("div",{children:[v.jsx("label",{className:"text-xs font-sans text-[#777] mb-1 block",children:"Min Severity"}),v.jsxs("select",{value:Y.min_severity,onChange:ee=>te({...Y,min_severity:ee.target.value}),className:"w-full bg-[#0d0d0d] border border-border px-3 py-2 text-sm",children:[v.jsx("option",{value:"None",children:"None (all)"}),v.jsx("option",{value:"Minor",children:"Minor+"}),v.jsx("option",{value:"Major",children:"Major only"})]})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs font-sans text-[#777] mb-2",children:"Sub-types"}),v.jsx("div",{className:"flex gap-6",children:[["road_works","Road Works"],["lane_closed","Lane Closure"],["road_closed","Road Closed"]].map(([ee,xt])=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:Y.sub_types.includes(ee),onChange:pt=>{const dt=Y.sub_types;te({...Y,sub_types:pt.target.checked?[...dt,ee]:dt.filter(ur=>ur!==ee)})},className:"w-4 h-4 accent-[#f59e0b]"}),v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:xt})]},ee))})]})]}):v.jsxs("p",{className:"text-xs text-[#666] mt-2",children:["Work zone events stored for LLM context only ","—"," no mesh broadcasts."]})]})]});case"firms":return v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"MAP Key",value:e.firms.map_key,onChange:ee=>Ue({firms:{...e.firms,map_key:ee}}),type:"password",helper:"firms.modaps.eosdis.nasa.gov/api/area/",infoLink:"https://firms.modaps.eosdis.nasa.gov/api/area/"}),v.jsx(We,{label:"Tick Seconds",value:e.firms.tick_seconds,onChange:ee=>Ue({firms:{...e.firms,tick_seconds:ee}}),min:300}),v.jsx(Ln,{label:"Satellite Source",value:e.firms.source,onChange:ee=>Ue({firms:{...e.firms,source:ee}}),options:[{value:"VIIRS_SNPP_NRT",label:"VIIRS SNPP (NRT)"},{value:"VIIRS_NOAA20_NRT",label:"VIIRS NOAA-20 (NRT)"},{value:"MODIS_NRT",label:"MODIS (NRT)"}]}),v.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[v.jsx(We,{label:"Day Range",value:e.firms.day_range,onChange:ee=>Ue({firms:{...e.firms,day_range:ee}}),min:1,max:10}),v.jsx(Ln,{label:"Min Confidence",value:e.firms.confidence_min,onChange:ee=>Ue({firms:{...e.firms,confidence_min:ee}}),options:[{value:"low",label:"Low"},{value:"nominal",label:"Nominal"},{value:"high",label:"High"}]}),v.jsx(We,{label:"Proximity (km)",value:e.firms.proximity_km,onChange:ee=>Ue({firms:{...e.firms,proximity_km:ee}}),step:.5})]}),v.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((ee,xt)=>{var pt;return v.jsx(We,{label:ee,value:((pt=e.firms.bbox)==null?void 0:pt[xt])??0,onChange:dt=>{const ur=[...e.firms.bbox||[0,0,0,0]];ur[xt]=dt,Ue({firms:{...e.firms,bbox:ur}})},step:.01},ee)})})]})}},ug=e,cg=(xe,Ut)=>{const Hn=e[xe]||{};Ue({[xe]:{...Hn,...Ut}})};return v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("h1",{className:"text-xl font-semibold text-white",children:"Environment"}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(or,{label:"Feeds Enabled",checked:e.enabled,onChange:xe=>Ue({enabled:xe})}),ag&&v.jsxs(v.Fragment,{children:[v.jsxs("button",{onClick:og,className:"flex items-center gap-1 px-3 py-1.5 text-sm text-[#777] hover:text-white border border-border",children:[v.jsx(Jx,{size:14})," Discard"]}),v.jsxs("button",{onClick:$_,disabled:c,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-accent text-white disabled:opacity-50",children:[v.jsx(zM,{size:14})," ",c?"Saving…":"Save"]})]})]})]}),f&&v.jsx("div",{className:"text-sm text-red-400 bg-red-500/10 p-3",children:f}),g&&v.jsx("div",{className:"text-sm text-green-400 bg-green-500/10 p-3",children:g}),y&&v.jsxs("div",{className:"flex items-center justify-between text-sm text-accent bg-accent/10 border border-accent/30 p-3",children:[v.jsxs("span",{className:"flex items-center gap-2",children:[v.jsx($v,{size:14})," A restart is required for some changes to take effect."]}),v.jsx("button",{onClick:sg,className:"px-3 py-1 bg-accent/20 hover:bg-amber-500/30",children:"Restart now"})]}),v.jsx("div",{className:"flex gap-1 border-b border-border overflow-x-auto",children:_S.map(({key:xe,label:Ut,icon:Hn})=>v.jsxs("button",{onClick:()=>{w(xe);const ui=_S.find(Gi=>Gi.key===xe);T(ui.adapters[0]??null)},className:`flex items-center gap-2 px-4 py-2 text-sm whitespace-nowrap border-b-2 -mb-px transition-colors ${_===xe?"border-accent text-accent":"border-transparent text-[#777] hover:text-white"}`,children:[v.jsx(Hn,{size:15})," ",Ut]},xe))}),_==="central"&&e.central&&v.jsxs("div",{className:"border border-border p-4 space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{children:[v.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:"Central Connection"}),v.jsx("p",{className:"text-xs text-[#666]",children:'NATS JetStream source for any adapter set to "central"'})]}),v.jsx(or,{label:"",checked:!!e.central.enabled,onChange:xe=>Ue({central:{...e.central,enabled:xe}})})]}),v.jsxs("div",{className:e.central.enabled?"space-y-3":"space-y-3 opacity-40 pointer-events-none select-none",children:[v.jsx(ct,{label:"URL",value:e.central.url||"",onChange:xe=>Ue({central:{...e.central,url:xe}}),placeholder:"nats://central.echo6.mesh:4222"}),v.jsx(ct,{label:"Durable",value:e.central.durable||"",onChange:xe=>Ue({central:{...e.central,durable:xe}}),placeholder:"meshai-v04"}),v.jsx(ct,{label:"Region",value:e.central.region||"",onChange:xe=>Ue({central:{...e.central,region:xe}}),placeholder:"us.id",helper:"Central v0.9.20 region token (dotted, e.g. 'us.id'). Empty = bare wildcards (all-US firehose). Each adapter is either Central or native, never both — see Reference → OR-not-AND Architecture for why."})]})]}),_==="tracking"&&v.jsxs("div",{className:"flex flex-col items-center justify-center h-[40vh] text-center",children:[v.jsx(Qx,{size:32,className:"text-[#666] mb-4"}),v.jsx("p",{className:"text-[#666] max-w-md",children:"No adapters yet. ADS-B / AIS / satellite passes are planned for v0.5."})]}),_==="mesh"&&v.jsxs("div",{className:"border border-border p-4 space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{children:[v.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:"Mesh Health"}),v.jsx("p",{className:"text-xs text-[#666]",children:"Node/infra telemetry — sourced from the mesh, not an environmental feed."})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("span",{className:"text-[10px] uppercase tracking-wide text-[#666]",children:"source"}),v.jsx(J8,{value:"native",onChange:()=>{},disabled:!1,centralDisabled:!0})]})]}),v.jsx("div",{className:"text-[11px] text-[#666]",children:"Central not available — reserved for a future migration."})]}),ao.adapters.length>0&&tn&&v.jsxs(v.Fragment,{children:[ao.adapters.length>1&&v.jsx("div",{className:"flex gap-1",children:ao.adapters.map(xe=>v.jsx("button",{onClick:()=>T(xe),className:`px-3 py-1.5 text-sm ${tn===xe?"bg-bg-hover text-white":"text-[#777] hover:text-white"}`,children:hs[xe].label},xe))}),v.jsx(cxe,{title:hs[tn].label,subtitle:hs[tn].subtitle,enabled:((Lf=ug[tn])==null?void 0:Lf.enabled)??!1,onEnabled:xe=>cg(tn,{enabled:xe}),feedSource:((Nf=ug[tn])==null?void 0:Nf.feed_source)??"native",onFeedSource:xe=>cg(tn,{feed_source:xe}),hasCentral:hs[tn].hasCentral,nativeOnly:hs[tn].nativeOnly,hasKey:hs[tn].hasKey,health:lg(tn),events:kf(tn),children:pl(tn)})]})]})}const k3={infra_offline:mB,infra_recovery:t_,battery_warning:Z1,battery_critical:Z1,battery_emergency:Z1,hf_blackout:Dh,uhf_ducting:Di,weather_warning:Du,weather_watch:Du,new_router:Di,packet_flood:$a,sustained_high_util:$a,region_blackout:Vo,default:Zv};function fxe(e){return k3[e]||k3.default}function Q8(e){switch(e==null?void 0:e.toLowerCase()){case"immediate":return{bg:"bg-red-500/10",border:"border-red-500",badge:"bg-red-500/20 text-red-400",iconColor:"text-red-500"};case"priority":return{bg:"bg-amber-500/10",border:"border-amber-500",badge:"bg-amber-500/20 text-amber-400",iconColor:"text-amber-500"};case"routine":default:return{bg:"bg-[#f59e0b]/10",border:"border-[#f59e0b]",badge:"bg-[#f59e0b]/20 text-[#f59e0b]",iconColor:"text-[#f59e0b]"}}}function dxe(e){const t=typeof e=="number"?new Date(e*1e3):new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/1e3),a=Math.floor(i/60),o=Math.floor(a/60),s=Math.floor(o/24);return i<60?"Just now":a<60?`${a}m ago`:o<24?`${o}h ago`:`${s}d ago`}function vxe(e){return(typeof e=="number"?new Date(e*1e3):new Date(e)).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}function pxe(e){return e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/3600)}h ${Math.floor(e%3600/60)}m`:`${Math.floor(e/86400)}d`}function gxe({alert:e,onAcknowledge:t}){var i;const r=Q8(e.severity),n=fxe(e.type);return v.jsx("div",{className:`p-4 ${r.bg} border-l-4 ${r.border}`,children:v.jsxs("div",{className:"flex items-start gap-3",children:[v.jsx(n,{size:20,className:r.iconColor}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[v.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${r.badge}`,children:(i=e.severity)==null?void 0:i.toUpperCase()}),v.jsx("span",{className:"text-xs text-slate-500",children:e.type})]}),v.jsx("div",{className:"text-sm text-slate-200",children:e.message}),v.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-slate-500",children:[v.jsxs("span",{className:"flex items-center gap-1",children:[v.jsx(Iu,{size:12}),e.timestamp?dxe(e.timestamp):"Just now"]}),e.scope_value&&v.jsxs("span",{children:[e.scope_type,": ",e.scope_value]})]})]}),v.jsx("button",{onClick:()=>t(e),className:"px-3 py-1 text-xs text-slate-400 hover:text-slate-200 border border-border rounded hover:bg-bg-hover transition-colors",children:"Acknowledge"})]})})}function mxe({history:e,typeFilter:t,severityFilter:r,onTypeFilterChange:n,onSeverityFilterChange:i,page:a,totalPages:o,onPageChange:s}){const l=["all","infra_offline","infra_recovery","battery_warning","battery_critical","hf_blackout","uhf_ducting","weather_warning","new_router","packet_flood"],u=["all","immediate","priority","routine"];return v.jsxs("div",{className:"bg-bg-card border border-border",children:[v.jsxs("div",{className:"p-4 border-b border-border flex items-center gap-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(RM,{size:14,className:"text-slate-400"}),v.jsx("span",{className:"text-sm text-slate-400",children:"Filter:"})]}),v.jsx("select",{value:t,onChange:c=>n(c.target.value),className:"bg-bg border border-border rounded px-3 py-1.5 text-sm text-slate-200 focus:outline-none focus:border-[#f59e0b]",children:l.map(c=>v.jsx("option",{value:c,children:c==="all"?"All Types":c.replace(/_/g," ")},c))}),v.jsx("select",{value:r,onChange:c=>i(c.target.value),className:"bg-bg border border-border rounded px-3 py-1.5 text-sm text-slate-200 focus:outline-none focus:border-[#f59e0b]",children:u.map(c=>v.jsx("option",{value:c,children:c==="all"?"All Severities":c.charAt(0).toUpperCase()+c.slice(1)},c))})]}),v.jsx("div",{className:"overflow-x-auto",children:v.jsxs("table",{className:"w-full",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"border-b border-border",children:[v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Time"}),v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Type"}),v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Severity"}),v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Message"}),v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Duration"})]})}),v.jsx("tbody",{children:e.length>0?e.map((c,h)=>{const f=Q8(c.severity);return v.jsxs("tr",{className:"border-b border-border hover:bg-bg-hover",children:[v.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono whitespace-nowrap",children:vxe(c.timestamp)}),v.jsx("td",{className:"p-4 text-sm text-slate-300",children:c.type.replace(/_/g," ")}),v.jsx("td",{className:"p-4",children:v.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${f.badge}`,children:c.severity})}),v.jsx("td",{className:"p-4 text-sm text-slate-200 max-w-md truncate",children:c.message}),v.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono",children:c.duration?pxe(c.duration):"-"})]},c.id||h)}):v.jsx("tr",{children:v.jsx("td",{colSpan:5,className:"p-8 text-center text-slate-500",children:"No alert history available"})})})]})}),o>1&&v.jsxs("div",{className:"p-4 border-t border-border flex items-center justify-between",children:[v.jsxs("span",{className:"text-sm text-slate-400",children:["Page ",a," of ",o]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("button",{onClick:()=>s(a-1),disabled:a<=1,className:"p-2 text-slate-400 hover:text-slate-200 disabled:opacity-50 disabled:cursor-not-allowed",children:v.jsx(F$,{size:16})}),v.jsx("button",{onClick:()=>s(a+1),disabled:a>=o,className:"p-2 text-slate-400 hover:text-slate-200 disabled:opacity-50 disabled:cursor-not-allowed",children:v.jsx(Js,{size:16})})]})]})]})}function yxe({subscription:e,nodes:t}){const r=o=>{const s=t.find(l=>l.node_id_hex===o||String(l.node_num)===o||l.short_name===o);return s?s.long_name&&s.long_name!==s.short_name?`${s.short_name} (${s.long_name})`:s.short_name:o},n=()=>{if(e.sub_type==="alerts")return"Real-time";const o=e.schedule_time||"0000",s=parseInt(o.slice(0,2)),l=o.slice(2),u=s>=12?"PM":"AM";let h=`${s%12||12}:${l} ${u}`;return e.sub_type==="weekly"&&e.schedule_day&&(h+=` ${e.schedule_day.charAt(0).toUpperCase()}${e.schedule_day.slice(1)}`),h},a=(()=>{switch(e.sub_type){case"alerts":return Zv;case"daily":return Iu;case"weekly":return Iu;default:return Zv}})();return v.jsx("div",{className:"p-4 bg-bg-hover border border-border",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"w-10 h-10 bg-[#f59e0b]/10 flex items-center justify-center",children:v.jsx(a,{size:18,className:"text-[#f59e0b]"})}),v.jsxs("div",{className:"flex-1",children:[v.jsxs("div",{className:"text-sm text-slate-200 font-medium",children:[e.sub_type.charAt(0).toUpperCase()+e.sub_type.slice(1),e.scope_type!=="mesh"&&e.scope_value&&v.jsxs("span",{className:"text-slate-400 font-normal ml-2",children:["(",e.scope_type,": ",e.scope_value,")"]})]}),v.jsxs("div",{className:"text-xs text-slate-500 mt-0.5",children:[n()," • ",r(e.user_id)]})]}),v.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`})]})})}function xxe(){const[e,t]=G.useState([]),[r,n]=G.useState([]),[i,a]=G.useState([]),[o,s]=G.useState([]),[l,u]=G.useState(!0),[c,h]=G.useState(null),[f,d]=G.useState("all"),[g,m]=G.useState("all"),[y,x]=G.useState(1),[_,w]=G.useState(1),S=20,[T,M]=G.useState(new Set),{lastAlert:A}=FM();G.useEffect(()=>{document.title="Alerts — MeshAI"},[]),G.useEffect(()=>{Promise.all([yB().catch(()=>[]),OP(S,0).catch(()=>({items:[],total:0})),iY().catch(()=>[]),fetch("/api/nodes").then(N=>N.json()).catch(()=>[])]).then(([N,D,O,R])=>{t(N),Array.isArray(D)?(n(D),w(1)):(n(D.items||[]),w(Math.ceil((D.total||0)/S))),a(O),s(R),u(!1)}).catch(N=>{h(N.message),u(!1)})},[]),G.useEffect(()=>{A&&t(N=>N.some(O=>O.type===A.type&&O.message===A.message)?N:[A,...N])},[A]),G.useEffect(()=>{const N=(y-1)*S;OP(S,N,f,g).then(D=>{Array.isArray(D)?(n(D),w(1)):(n(D.items||[]),w(Math.ceil((D.total||0)/S)))}).catch(()=>{})},[y,f,g]);const P=G.useCallback(N=>{const D=`${N.type}-${N.message}-${N.timestamp}`;M(O=>new Set([...O,D]))},[]),I=e.filter(N=>{const D=`${N.type}-${N.message}-${N.timestamp}`;return!T.has(D)});return l?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading alerts..."})}):c?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsxs("div",{className:"text-red-400",children:["Error: ",c]})}):v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"bg-bg-card border border-border p-6",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[v.jsx($a,{size:14}),"Active Alerts (",I.length,")"]}),I.length>0?v.jsx("div",{className:"space-y-3",children:I.map((N,D)=>v.jsx(gxe,{alert:N,onAcknowledge:P},`${N.type}-${N.timestamp}-${D}`))}):v.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-8",children:[v.jsx(EM,{size:20,className:"text-green-500"}),v.jsx("span",{children:"No active alerts — all systems nominal"})]})]}),v.jsxs("div",{children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[v.jsx(Iu,{size:14}),"Alert History"]}),v.jsx(mxe,{history:r,typeFilter:f,severityFilter:g,onTypeFilterChange:N=>{d(N),x(1)},onSeverityFilterChange:N=>{m(N),x(1)},page:y,totalPages:_,onPageChange:x})]}),v.jsxs("div",{className:"bg-bg-card border border-border p-6",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[v.jsx(Q$,{size:14}),"Mesh Subscriptions (",i.length,")"]}),i.length>0?v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:i.map(N=>v.jsx(yxe,{subscription:N,nodes:o},N.id))}):v.jsxs("div",{className:"text-slate-500 py-4",children:[v.jsx("p",{children:"No active subscriptions."}),v.jsxs("p",{className:"text-xs mt-2",children:["Manage subscriptions via ",v.jsx("code",{className:"text-[#f59e0b]",children:"!subscribe"})," on mesh. Broadcasts arrive with one of three prefixes — ",v.jsx("strong",{children:"New:"})," (first sight), ",v.jsx("strong",{children:"Update:"})," (material change), or ",v.jsx("strong",{children:"Active:"})," (clock-driven reminder while the event is still live). See ",v.jsx("a",{href:"/reference#broadcast-types",className:"text-[#f59e0b] hover:underline",children:"Broadcast Types"})," and ",v.jsx("a",{href:"/reference#reminders",className:"text-[#f59e0b] hover:underline",children:"Reminder System"})," in Reference."]})]})]})]})}const Hy=[{value:"routine",label:"Routine",description:"Informational, no time pressure (ducting, new node, weather advisory, battery declining)"},{value:"priority",label:"Priority",description:"Needs attention soon (severe weather, fire nearby, node offline, HF blackout)"},{value:"immediate",label:"Immediate",description:"Act now, drop everything (fire at infrastructure, extreme weather, region blackout)"}],L3=[{id:"mesh_health",name:"Mesh Health Monitoring",description:"Infrastructure problems - offline nodes, low battery, channel congestion",rule:{name:"Mesh Health Monitoring",enabled:!0,trigger_type:"condition",categories:["infra_offline","critical_node_down","infra_recovery","battery_warning","battery_critical","battery_emergency","high_utilization","packet_flood","mesh_score_low"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:30,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"weather_fire",name:"Weather & Fire Alerts",description:"Environmental threats - severe weather, nearby wildfires, new ignitions, flooding",rule:{name:"Weather & Fire Alerts",enabled:!0,trigger_type:"condition",categories:["weather_warning","fire_proximity","new_ignition","stream_flood_warning"],min_severity:"priority",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:15,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"rf_conditions",name:"RF Conditions",description:"Propagation changes - solar events, HF blackouts, tropospheric ducting",rule:{name:"RF Conditions",enabled:!0,trigger_type:"condition",categories:["hf_blackout","tropospheric_ducting","geomagnetic_storm"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:60,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"road_traffic",name:"Road & Traffic",description:"Road closures and severe congestion",rule:{name:"Road & Traffic",enabled:!0,trigger_type:"condition",categories:["road_closure","traffic_congestion"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:30,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"everything_critical",name:"Everything Critical",description:"All emergency-level events regardless of type",rule:{name:"Everything Critical",enabled:!0,trigger_type:"condition",categories:[],min_severity:"immediate",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:5,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"morning_briefing",name:"Morning Briefing",description:"Daily health and conditions summary at 7am",rule:{name:"Morning Briefing",enabled:!0,trigger_type:"schedule",categories:[],min_severity:"routine",schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"mesh_health_summary",custom_message:"",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:0,node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}}];function uy(e){if(!e)return"Never";const r=Date.now()/1e3-e;return r<60?"Just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:r<604800?`${Math.floor(r/86400)}d ago`:new Date(e*1e3).toLocaleDateString()}function Ai({info:e}){const[t,r]=G.useState(!1);return v.jsxs("div",{className:"relative inline-block",children:[v.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),r(!t)},className:"ml-1.5 w-4 h-4 rounded-full bg-slate-700 hover:bg-slate-600 text-slate-400 hover:text-slate-200 inline-flex items-center justify-center text-xs transition-colors",title:"More info",children:"?"}),t&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>r(!1)}),v.jsx("div",{className:"absolute left-0 top-6 z-50 w-72 p-3 bg-[#1a2332] border border-[#2a3a4a] shadow-xl text-xs text-slate-300 leading-relaxed",children:e})]})]})}function xs({label:e,value:t,onChange:r,type:n="text",placeholder:i="",helper:a="",info:o=""}){const[s,l]=G.useState(!1),u=n==="password";return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&v.jsx(Ai,{info:o})]}),v.jsxs("div",{className:"relative",children:[v.jsx("input",{type:u&&!s?"password":"text",value:t,onChange:c=>r(c.target.value),placeholder:i,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"}),u&&v.jsx("button",{type:"button",onClick:()=>l(!s),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-300",children:s?v.jsx(cB,{size:16}):v.jsx(jM,{size:16})})]}),a&&v.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function Mp({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&v.jsx(Ai,{info:s})]}),v.jsx("input",{type:"number",value:t,onChange:l=>r(Number(l.target.value)),min:n,max:i,step:a,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),o&&v.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function Lx({label:e,checked:t,onChange:r,helper:n="",info:i=""}){return v.jsxs("div",{className:"flex items-center justify-between py-2",children:[v.jsxs("div",{children:[v.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&v.jsx(Ai,{info:i})]}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]}),v.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:v.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function Mv({label:e,value:t,onChange:r,helper:n="",info:i=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&v.jsx(Ai,{info:i})]}),v.jsx("input",{type:"time",value:t,onChange:a=>r(a.target.value),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent"}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function Uy({label:e,value:t,onChange:r,placeholder:n="Add item...",helper:i="",info:a=""}){const[o,s]=G.useState(""),l=()=>{o.trim()&&!t.includes(o.trim())&&(r([...t,o.trim()]),s(""))},u=c=>{r(t.filter((h,f)=>f!==c))};return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&v.jsx(Ai,{info:a})]}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx("input",{type:"text",value:o,onChange:c=>s(c.target.value),onKeyDown:c=>c.key==="Enter"&&(c.preventDefault(),l()),className:"flex-1 px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent",placeholder:n}),v.jsx("button",{type:"button",onClick:l,className:"px-3 py-2 bg-accent hover:bg-accent/80 rounded text-sm text-white transition-colors",children:v.jsx(af,{size:16})})]}),t.length>0&&v.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:t.map((c,h)=>v.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-[#1e2a3a] rounded text-sm text-slate-300",children:[c,v.jsx("button",{type:"button",onClick:()=>u(h),className:"text-slate-500 hover:text-red-400",children:v.jsx(ca,{size:14})})]},h))}),i&&v.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function e7({value:e,onChange:t}){const[r,n]=G.useState(!1),i=Hy.find(a=>a.value===e)||Hy[0];return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Severity Threshold",v.jsx(Ai,{info:"Only alerts at or above this severity trigger this rule. ROUTINE = informational, PRIORITY = needs attention, IMMEDIATE = act now."})]}),v.jsxs("div",{className:"relative",children:[v.jsxs("button",{type:"button",onClick:()=>n(!r),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-left flex items-center justify-between hover:border-accent transition-colors",children:[v.jsxs("div",{children:[v.jsx("span",{className:"text-slate-200",children:i.label}),v.jsxs("span",{className:"text-slate-500 ml-2",children:["- ",i.description]})]}),v.jsx(ll,{size:16,className:`text-slate-500 transition-transform ${r?"rotate-180":""}`})]}),r&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>n(!1)}),v.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 z-50 bg-[#0a0e17] border border-[#1e2a3a] shadow-xl overflow-hidden",children:Hy.map(a=>v.jsxs("button",{type:"button",onClick:()=>{t(a.value),n(!1)},className:`w-full px-3 py-2.5 text-left text-sm hover:bg-[#1e2a3a] transition-colors ${e===a.value?"bg-accent/10":""}`,children:[v.jsx("div",{className:"font-medium text-slate-200",children:a.label}),v.jsx("div",{className:"text-xs text-slate-500",children:a.description})]},a.value))})]})]}),v.jsx("p",{className:"text-xs text-slate-600",children:'Lower = more notifications. "Warning" recommended for most rules.'})]})}function cy({rule:e}){const[t,r]=G.useState(!1),[n,i]=G.useState(null),a=async()=>{r(!0),i(null);try{let s={type:e.delivery_type};e.delivery_type==="mesh_broadcast"?s.channel_index=e.broadcast_channel:e.delivery_type==="mesh_dm"?s.node_ids=e.node_ids:e.delivery_type==="email"?s={type:"email",smtp_host:e.smtp_host,smtp_port:e.smtp_port,smtp_user:e.smtp_user,smtp_password:e.smtp_password,smtp_tls:e.smtp_tls,from_address:e.from_address,recipients:e.recipients}:e.delivery_type==="webhook"&&(s={type:"webhook",url:e.webhook_url,headers:e.webhook_headers});const u=await(await fetch("/api/notifications/channels/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).json();i(u)}catch(s){i({success:!1,message:"Test failed",error:s instanceof Error?s.message:"Unknown error",details:{}})}finally{r(!1)}};if(!e.delivery_type)return null;const o={mesh_broadcast:v.jsx(Di,{size:14}),mesh_dm:v.jsx(OM,{size:14}),email:v.jsx(Y$,{size:14}),webhook:v.jsx(Z$,{size:14})}[e.delivery_type]||v.jsx(t_,{size:14});return v.jsxs("div",{className:"space-y-2",children:[v.jsx("button",{type:"button",onClick:a,disabled:t,className:"flex items-center gap-2 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",children:t?v.jsxs(v.Fragment,{children:[v.jsx($v,{size:14,className:"animate-spin"}),"Testing..."]}):v.jsxs(v.Fragment,{children:[o,"Test Channel"]})}),n&&v.jsx("div",{className:`p-2 rounded text-xs ${n.success?"bg-green-500/10 border border-green-500/30 text-green-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:v.jsxs("div",{className:"flex items-start gap-2",children:[n.success?v.jsx(Za,{size:14,className:"mt-0.5 flex-shrink-0"}):v.jsx(ca,{size:14,className:"mt-0.5 flex-shrink-0"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium",children:n.message}),n.error&&v.jsx("div",{className:"mt-1 text-red-300",children:n.error})]})]})})]})}function _xe({rule:e,ruleIndex:t,categories:r,regions:n,onChange:i,onDelete:a,onDuplicate:o,onTest:s}){var O,R,F,H,W;const[l,u]=G.useState(!e.name),[c,h]=G.useState(!1),[f,d]=G.useState(null),[g,m]=G.useState(null);G.useEffect(()=>{var V;e.name&&t>=0&&(fetch(`/api/notifications/rules/${t}/stats`).then(z=>z.json()).then(z=>d(z)).catch(()=>{}),(V=e.categories)!=null&&V.length&&fetch("/api/notifications/rules/sources",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({categories:e.categories})}).then(z=>z.json()).then(z=>m(z)).catch(()=>{}))},[e.name,t,e.categories]);const y=[{value:"",label:"(None)",description:"Rule matches but does not deliver"},{value:"mesh_broadcast",label:"Mesh Broadcast",description:"Send to a mesh radio channel"},{value:"mesh_dm",label:"Mesh DM",description:"Direct message to specific nodes"},{value:"email",label:"Email",description:"Send via SMTP"},{value:"webhook",label:"Webhook",description:"POST to any URL"}],x=[{value:"daily",label:"Daily"},{value:"twice_daily",label:"Twice Daily"},{value:"weekly",label:"Weekly"}],_=[{value:"mesh_health_summary",label:"Mesh Health Summary",description:"Current health score, pillar breakdown, problem nodes"},{value:"rf_propagation_report",label:"RF Propagation Report",description:"Solar indices, Kp, ducting conditions"},{value:"alerts_digest",label:"Active Alerts Digest",description:"Summary of all active environmental alerts"},{value:"environmental_conditions",label:"Environmental Conditions",description:"Full conditions: weather, fire, streams, roads"},{value:"custom",label:"Custom Message",description:"Write your own with template tokens"}],w=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],S=V=>{const z=e.categories||[];z.includes(V)?i({...e,categories:z.filter(Z=>Z!==V)}):i({...e,categories:[...z,V]})},T=(V,z)=>{const Z=e.categories||[];if(z==="add"){const U=Array.from(new Set([...Z,...V]));i({...e,categories:U})}else{const U=new Set(V);i({...e,categories:Z.filter($=>!U.has($))})}},M=V=>{const z=e.region_scope||[];z.includes(V)?i({...e,region_scope:z.filter(Z=>Z!==V)}):i({...e,region_scope:[...z,V]})},A=V=>{const z=e.schedule_days||[];z.includes(V)?i({...e,schedule_days:z.filter(Z=>Z!==V)}):i({...e,schedule_days:[...z,V]})},P=async()=>{h(!0),await s(),h(!1)},I=()=>{if(e.trigger_type==="schedule")return"[Scheduled report preview would appear here]";const V=e.categories||[];if(V.length===0&&r.length>0)return r[0].example_message||"Alert notification";const z=r.find(Z=>V.includes(Z.id));return(z==null?void 0:z.example_message)||"Alert notification"},N=()=>{var z,Z,U,$,Y,te,ie,se;const V=[];if(e.trigger_type==="schedule"){const le=((z=x.find(me=>me.value===e.schedule_frequency))==null?void 0:z.label)||e.schedule_frequency,Ee=((Z=_.find(me=>me.value===e.message_type))==null?void 0:Z.label)||e.message_type;V.push(`${le} at ${e.schedule_time||"??:??"}`),V.push(Ee)}else{const le=((U=e.categories)==null?void 0:U.length)||0,Ee=le===0?"All":r.filter(ye=>{var Me;return(Me=e.categories)==null?void 0:Me.includes(ye.id)}).map(ye=>ye.name).slice(0,2).join(", ")+(le>2?` +${le-2}`:""),me=(($=Hy.find(ye=>ye.value===e.min_severity))==null?void 0:$.label)||e.min_severity;V.push(`${Ee} at ${me}+`)}if(!e.delivery_type)V.push("No delivery");else{const le=((Y=y.find(me=>me.value===e.delivery_type))==null?void 0:Y.label)||e.delivery_type;let Ee="";if(e.delivery_type==="mesh_broadcast")Ee=`Ch ${e.broadcast_channel}`;else if(e.delivery_type==="mesh_dm")Ee=`${((te=e.node_ids)==null?void 0:te.length)||0} nodes`;else if(e.delivery_type==="email")Ee=(ie=e.recipients)!=null&&ie.length?e.recipients[0]+(e.recipients.length>1?` +${e.recipients.length-1}`:""):"no recipients";else if(e.delivery_type==="webhook")try{Ee=new URL(e.webhook_url).hostname}catch{Ee=((se=e.webhook_url)==null?void 0:se.slice(0,20))||"no URL"}V.push(`${le}${Ee?` (${Ee})`:""}`)}return V.join(" -> ")},D=()=>{var z;if(!g||!((z=e.categories)!=null&&z.length))return null;const V=new Map;for(const[,Z]of Object.entries(g)){const U=V.get(Z.source);U?(U.events+=Z.active_events,U.enabled=U.enabled&&Z.enabled):V.set(Z.source,{enabled:Z.enabled,events:Z.active_events})}return Array.from(V.entries()).map(([Z,{enabled:U,events:$}])=>v.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs ${U?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,title:U?`${$} active`:"Not enabled",children:[U?v.jsx(t_,{size:10}):v.jsx(mB,{size:10}),Z.toUpperCase(),U&&$>0&&` (${$})`]},Z))};return v.jsxs("div",{className:`border overflow-hidden ${e.enabled?"border-[#1e2a3a]":"border-slate-700 opacity-60"}`,children:[v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>u(!l),children:[v.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[l?v.jsx(ll,{size:16,className:"text-slate-500 flex-shrink-0"}):v.jsx(Js,{size:16,className:"text-slate-500 flex-shrink-0"}),v.jsx("button",{onClick:V=>{V.stopPropagation(),i({...e,enabled:!e.enabled})},className:`w-2 h-2 rounded-full flex-shrink-0 ${e.enabled?"bg-green-500":"bg-slate-500"}`,title:e.enabled?"Enabled":"Disabled"}),e.trigger_type==="schedule"?v.jsx(Iu,{size:14,className:"text-[#f59e0b] flex-shrink-0"}):v.jsx(Dh,{size:14,className:"text-yellow-400 flex-shrink-0"}),v.jsx("span",{className:"font-medium text-slate-200 truncate",title:e.name||void 0,children:e.name||"New Rule"}),!l&&v.jsx("span",{className:`text-xs truncate hidden sm:block ${e.delivery_type?"text-slate-500":"text-amber-400"}`,children:N()})]}),v.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[!l&&(()=>{const V="hidden sm:inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs mr-2";if(!e.enabled)return v.jsx("span",{className:`${V} bg-slate-800 text-slate-500`,children:"Disabled"});if(!f)return null;const z=f.fire_count||0,Z=f.last_fired,U=Date.now()/1e3-7*86400;return z>0&&Z&&Z>=U?v.jsx("span",{className:`${V} bg-green-500/10 text-green-400`,title:`Last fired ${uy(Z)}`,children:"Active"}):z>0&&Z?v.jsx("span",{className:`${V} bg-yellow-500/10 text-yellow-400`,title:`Last fired ${uy(Z)}`,children:"Idle (no recent activity)"}):v.jsx("span",{className:`${V} bg-slate-800 text-slate-400`,children:"No activity yet"})})(),!l&&v.jsx("div",{className:"hidden md:flex items-center gap-1 mr-2",children:D()}),v.jsx("button",{onClick:V=>{V.stopPropagation(),P()},disabled:c||!e.name,className:"p-1.5 text-[#f59e0b] hover:text-[#d97706] hover:bg-[#f59e0b]/10 rounded disabled:opacity-50",title:"Test rule",children:v.jsx(_C,{size:14})}),v.jsx("button",{onClick:V=>{V.stopPropagation(),o()},className:"p-1.5 text-slate-400 hover:text-slate-200 hover:bg-slate-500/10 rounded",title:"Duplicate",children:v.jsx(H$,{size:14})}),v.jsx("button",{onClick:V=>{V.stopPropagation(),a()},className:"p-1.5 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",title:"Delete",children:v.jsx(Ep,{size:14})})]})]}),!l&&e.name&&v.jsxs("div",{className:"px-3 pb-2 pt-0 bg-[#0a0e17] flex items-center gap-2 flex-wrap text-xs",children:[!e.delivery_type&&v.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 bg-amber-500/10 text-amber-400 rounded",children:[v.jsx(Vo,{size:10}),"No delivery method"]}),(f==null?void 0:f.fire_count)!==void 0&&f.fire_count>0&&v.jsxs("span",{className:"text-slate-500",children:["Fired ",f.fire_count,"x"]})]}),l&&v.jsxs("div",{className:"p-4 space-y-6 border-t border-[#1e2a3a]",children:[v.jsx(xs,{label:"Rule Name",value:e.name,onChange:V=>i({...e,name:V}),placeholder:"e.g., Emergency Broadcast, Daily Health Report",helper:"A descriptive name for this rule"}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Trigger Type"}),v.jsxs("div",{className:"flex gap-2",children:[v.jsxs("button",{type:"button",onClick:()=>i({...e,trigger_type:"condition"}),className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 border transition-colors ${e.trigger_type!=="schedule"?"bg-accent/10 border-accent text-accent":"bg-[#0a0e17] border-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:[v.jsx(Dh,{size:16}),v.jsx("span",{children:"Condition"})]}),v.jsxs("button",{type:"button",onClick:()=>i({...e,trigger_type:"schedule"}),className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 border transition-colors ${e.trigger_type==="schedule"?"bg-accent/10 border-accent text-accent":"bg-[#0a0e17] border-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:[v.jsx(Iu,{size:16}),v.jsx("span",{children:"Schedule"})]})]}),v.jsx("p",{className:"text-xs text-slate-600",children:e.trigger_type==="schedule"?"Send reports on a schedule (daily briefings, weekly digests)":"React to alert conditions (fires, outages, weather warnings)"})]}),e.trigger_type!=="schedule"&&v.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] border border-[#1e2a3a]",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[v.jsx($a,{size:14}),"WHEN (Condition)"]}),v.jsx(e7,{value:e.min_severity,onChange:V=>i({...e,min_severity:V})}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Categories",v.jsx(Ai,{info:"Select which types of alerts trigger this rule. Leave all unchecked to match ALL categories. Categories are grouped by family — use the 'All' / 'Clear' buttons in each header to bulk-toggle."})]}),v.jsx("div",{className:"text-xs text-slate-500 mb-2",children:(((O=e.categories)==null?void 0:O.length)||0)===0?"All categories (none selected)":`${(R=e.categories)==null?void 0:R.length} selected`}),v.jsx(bxe,{categories:r,selected:e.categories||[],onToggle:S,onSelectMany:T})]}),g&&Object.keys(g).length>0&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Data Sources"}),v.jsx("div",{className:"flex flex-wrap gap-2",children:D()})]})]}),e.trigger_type==="schedule"&&v.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] border border-[#1e2a3a]",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[v.jsx(B$,{size:14}),"WHEN (Schedule)"]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Frequency"}),v.jsx("select",{value:e.schedule_frequency||"daily",onChange:V=>i({...e,schedule_frequency:V.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:x.map(V=>v.jsx("option",{value:V.value,children:V.label},V.value))})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Mv,{label:"Time",value:e.schedule_time||"07:00",onChange:V=>i({...e,schedule_time:V})}),e.schedule_frequency==="twice_daily"&&v.jsx(Mv,{label:"Second Time",value:e.schedule_time_2||"19:00",onChange:V=>i({...e,schedule_time_2:V})})]}),e.schedule_frequency==="weekly"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Days"}),v.jsx("div",{className:"flex flex-wrap gap-2",children:w.map(V=>{var z;return v.jsx("button",{type:"button",onClick:()=>A(V),className:`px-3 py-1.5 rounded text-sm capitalize transition-colors ${(z=e.schedule_days)!=null&&z.includes(V)?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:V.slice(0,3)},V)})})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Report Type"}),v.jsx("select",{value:e.message_type||"mesh_health_summary",onChange:V=>i({...e,message_type:V.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:_.map(V=>v.jsx("option",{value:V.value,children:V.label},V.value))}),v.jsx("p",{className:"text-xs text-slate-600",children:(F=_.find(V=>V.value===e.message_type))==null?void 0:F.description})]}),e.message_type==="custom"&&v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Custom Message",v.jsx(Ai,{info:"Available tokens: {MESH_SCORE}, {NODE_COUNT}, {NODES_ONLINE}, {ACTIVE_ALERTS}, {KP}, {SFI}, {DATE}, {TIME}"})]}),v.jsx("textarea",{value:e.custom_message||"",onChange:V=>i({...e,custom_message:V.target.value}),rows:4,placeholder:"Good morning! Mesh health: {MESH_SCORE}/100 with {NODE_COUNT} nodes online.",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"})]})]}),v.jsxs("div",{className:"space-y-2 p-4 bg-[#0a0e17] border border-[#1e2a3a]",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[v.jsx(nf,{size:14}),"REGIONS",v.jsx(Ai,{info:"Limit this rule to alerts from specific regions. Empty selection = all regions (backward compatible). Region names come from /api/regions."})]}),v.jsx("div",{className:"text-xs text-slate-500",children:(((H=e.region_scope)==null?void 0:H.length)||0)===0?"All regions (none selected)":`${e.region_scope.length} of ${n.length} selected`}),n.length===0?v.jsx("div",{className:"text-xs text-slate-600 italic",children:"No regions configured."}):v.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(V=>{const z=(e.region_scope||[]).includes(V.name);return v.jsx("button",{type:"button",onClick:()=>M(V.name),className:`px-3 py-1.5 rounded text-sm transition-colors ${z?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,title:V.local_name||V.name,children:V.local_name||V.name},V.name)})})]}),v.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] border border-[#1e2a3a]",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[v.jsx(_C,{size:14}),"SEND VIA"]}),v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Delivery Method",v.jsx(Ai,{info:"Where this notification gets delivered. Select (None) to save the rule without delivery - it will match conditions but won't send until you configure a delivery method."})]}),v.jsx("select",{value:e.delivery_type||"",onChange:V=>i({...e,delivery_type:V.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:y.map(V=>v.jsx("option",{value:V.value,children:V.label},V.value))}),v.jsx("p",{className:"text-xs text-slate-600",children:(W=y.find(V=>V.value===(e.delivery_type||"")))==null?void 0:W.description})]}),!e.delivery_type&&v.jsxs("div",{className:"flex items-start gap-2 p-3 bg-amber-500/10 border border-amber-500/20",children:[v.jsx(Vo,{size:16,className:"text-amber-400 mt-0.5 flex-shrink-0"}),v.jsx("div",{className:"text-sm text-amber-300",children:"Rule will log matches but not deliver until a delivery method is configured."})]}),e.delivery_type==="mesh_broadcast"&&v.jsxs(v.Fragment,{children:[v.jsx(LL,{label:"Broadcast Channel",value:e.broadcast_channel??0,onChange:V=>i({...e,broadcast_channel:V}),helper:"Select the mesh radio channel",mode:"single"}),v.jsx(cy,{rule:e})]}),e.delivery_type==="mesh_dm"&&v.jsxs(v.Fragment,{children:[v.jsx(kL,{label:"Recipient Nodes",value:e.node_ids||[],onChange:V=>i({...e,node_ids:V}),helper:"Nodes that receive direct messages",valueType:"node_id_hex"}),v.jsx(cy,{rule:e})]}),e.delivery_type==="email"&&v.jsxs("div",{className:"space-y-4",children:[v.jsx(Uy,{label:"Recipients",value:e.recipients||[],onChange:V=>i({...e,recipients:V}),placeholder:"email@example.com",helper:"Email addresses to receive alerts"}),v.jsxs("details",{className:"group",children:[v.jsxs("summary",{className:"flex items-center gap-2 cursor-pointer text-sm text-slate-400 hover:text-slate-200",children:[v.jsx(Js,{size:14,className:"group-open:rotate-90 transition-transform"}),"SMTP Configuration"]}),v.jsxs("div",{className:"mt-4 space-y-4 pl-6 border-l border-[#1e2a3a]",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(xs,{label:"SMTP Host",value:e.smtp_host||"",onChange:V=>i({...e,smtp_host:V}),placeholder:"smtp.gmail.com"}),v.jsx(Mp,{label:"SMTP Port",value:e.smtp_port??587,onChange:V=>i({...e,smtp_port:V}),min:1,max:65535})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(xs,{label:"Username",value:e.smtp_user||"",onChange:V=>i({...e,smtp_user:V})}),v.jsx(xs,{label:"Password",value:e.smtp_password||"",onChange:V=>i({...e,smtp_password:V}),type:"password",info:"Gmail users: use an App Password from myaccount.google.com/apppasswords"})]}),v.jsx(Lx,{label:"Use TLS",checked:e.smtp_tls??!0,onChange:V=>i({...e,smtp_tls:V})}),v.jsx(xs,{label:"From Address",value:e.from_address||"",onChange:V=>i({...e,from_address:V}),placeholder:"alerts@yourdomain.com"})]})]}),v.jsx(cy,{rule:e})]}),e.delivery_type==="webhook"&&v.jsxs(v.Fragment,{children:[v.jsx(xs,{label:"Webhook URL",value:e.webhook_url||"",onChange:V=>i({...e,webhook_url:V}),placeholder:"https://discord.com/api/webhooks/...",helper:"POST alert as JSON",info:"Works with Discord webhooks, ntfy.sh, Slack, Home Assistant, Pushover, or any HTTP POST endpoint."}),v.jsx(cy,{rule:e})]})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Mp,{label:"Cooldown (minutes)",value:e.cooldown_minutes??10,onChange:V=>i({...e,cooldown_minutes:V}),min:0,helper:"Min time between repeat sends",info:"Prevents alert spam. Same condition won't re-trigger this rule within this window."})," "]}),f&&v.jsxs("div",{className:"flex items-center gap-4 text-xs text-slate-500",children:[v.jsxs("span",{children:["Last fired: ",uy(f.last_fired)]}),v.jsxs("span",{children:["Last tested: ",uy(f.last_test)]}),v.jsxs("span",{children:["Total fires: ",f.fire_count]})]}),e.trigger_type!=="schedule"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Example Message"}),v.jsx("div",{className:"p-3 bg-[#1e2a3a]/50 border border-[#1e2a3a]",children:v.jsx("p",{className:"text-sm text-slate-300 font-mono",children:I()})}),v.jsx("p",{className:"text-xs text-slate-600",children:"This is an example of what this rule would send."})]})]})]})}const Zy=[{key:"mesh_health",label:"Mesh Health",Icon:rf},{key:"weather",label:"Weather",Icon:Du},{key:"fire",label:"Fire",Icon:Xx},{key:"rf_propagation",label:"RF Propagation",Icon:Di},{key:"roads",label:"Roads",Icon:$x},{key:"avalanche",label:"Avalanche",Icon:J$},{key:"seismic",label:"Seismic",Icon:Kx},{key:"tracking",label:"Tracking",Icon:nf}];function bxe({categories:e,selected:t,onToggle:r,onSelectMany:n}){const i=new Set(Zy.map(f=>f.key)),a=new Map;Zy.forEach(f=>a.set(f.key,[]));const o=[];for(const f of e){const d=f.toggle;d&&i.has(d)?a.get(d).push(f):o.push(f)}const s=new Set;for(const[f,d]of a)d.some(g=>t.includes(g.id))&&s.add(f);o.some(f=>t.includes(f.id))&&s.add("other");const[l,u]=G.useState(s),c=f=>{u(d=>{const g=new Set(d);return g.has(f)?g.delete(f):g.add(f),g})},h=(f,d,g,m)=>{if(!m.length)return null;const y=l.has(f),x=m.map(w=>w.id),_=x.filter(w=>t.includes(w)).length;return v.jsxs("div",{className:"border border-[#1e2a3a] rounded",children:[v.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 bg-[#0d1420]",children:[v.jsxs("button",{type:"button",onClick:()=>c(f),className:"flex items-center gap-2 text-sm text-slate-200 flex-1 min-w-0",children:[y?v.jsx(ll,{size:14,className:"text-slate-500 flex-shrink-0"}):v.jsx(Js,{size:14,className:"text-slate-500 flex-shrink-0"}),g&&v.jsx(g,{size:14,className:"text-slate-400 flex-shrink-0"}),v.jsxs("span",{className:"truncate",children:[d," (",m.length,")"]}),_>0&&v.jsxs("span",{className:"ml-1 text-xs text-accent",children:[_," selected"]})]}),v.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[v.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),n(x,"add")},className:"text-xs px-2 py-0.5 rounded text-slate-400 hover:text-accent hover:bg-accent/10",title:"Select all in family",children:"All"}),v.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),n(x,"remove")},className:"text-xs px-2 py-0.5 rounded text-slate-400 hover:text-red-400 hover:bg-red-500/10",title:"Clear family",children:"Clear"})]})]}),y&&v.jsx("div",{className:"p-1 space-y-1",children:m.map(w=>v.jsxs("label",{onClick:()=>r(w.id),className:"flex items-start gap-2 p-2 rounded hover:bg-[#1e2a3a]/50 cursor-pointer",children:[v.jsx("div",{className:`w-4 h-4 mt-0.5 rounded border flex items-center justify-center flex-shrink-0 ${t.includes(w.id)?"bg-accent border-accent":"border-slate-600"}`,children:t.includes(w.id)&&v.jsx(Za,{size:12,className:"text-white"})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"text-sm text-slate-200",children:w.name}),v.jsx("div",{className:"text-xs text-slate-500",children:w.description})]})]},w.id))})]},f)};return v.jsxs("div",{className:"max-h-96 overflow-y-auto border border-[#1e2a3a] p-2 space-y-2",children:[Zy.map(f=>h(f.key,f.label,f.Icon,a.get(f.key)||[])),h("other","Other",null,o)]})}const N3=["digest","mesh_broadcast","mesh_dm","email","webhook"],wxe=["routine","priority","immediate"];function Sxe({toggles:e,onChange:t}){const[r,n]=G.useState(null),i=(a,o)=>t({...e,[a]:{...e[a]||{},name:a,...o}});return v.jsxs("div",{className:"space-y-3 mb-8",children:[v.jsxs("div",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Master Toggles",v.jsx(Ai,{info:"Per-family notification policy: enable a family, set its severity threshold, choose which channels fire at each severity, and scope to regions (PagerDuty/Grafana-style)."})]}),v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Zy.map(({key:a,label:o,Icon:s})=>{const l=e[a]||{},u=r===a,c=Object.values(l.severity_channels||{}).reduce((f,d)=>f+((d==null?void 0:d.length)||0),0),h=(l.regions||[]).length;return v.jsxs("div",{className:"border border-[#1e2a3a] p-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("button",{type:"button",onClick:()=>n(u?null:a),className:"flex items-center gap-2 text-sm text-slate-200",children:[v.jsx(s,{size:15})," ",o,u?v.jsx(ll,{size:14}):v.jsx(Js,{size:14})]}),v.jsx(Lx,{label:"",checked:!!l.enabled,onChange:f=>i(a,{enabled:f})})]}),!u&&v.jsx("div",{className:"text-xs text-slate-600 mt-1",children:l.enabled?`${h||"all"} region${h===1?"":"s"}, ${c} channel${c===1?"":"s"} at ${l.min_severity||"priority"}+`:"OFF"}),u&&v.jsxs("div",{className:`mt-3 space-y-3 ${l.enabled?"":"opacity-40 pointer-events-none select-none"}`,children:[v.jsx(e7,{value:l.min_severity||"priority",onChange:f=>i(a,{min_severity:f})}),v.jsx("div",{className:"text-xs text-slate-500",children:"Severity → channels"}),v.jsxs("table",{className:"text-xs w-full",children:[v.jsx("thead",{children:v.jsxs("tr",{children:[v.jsx("th",{}),N3.map(f=>v.jsx("th",{className:"text-slate-500 font-normal px-1",children:f.replace("_"," ")},f))]})}),v.jsx("tbody",{children:wxe.map(f=>v.jsxs("tr",{children:[v.jsx("td",{className:"text-slate-400 pr-2",children:f}),N3.map(d=>{var m;const g=(((m=l.severity_channels)==null?void 0:m[f])||[]).includes(d);return v.jsx("td",{className:"text-center",children:v.jsx("input",{type:"checkbox",checked:g,onChange:y=>{const x={...l.severity_channels||{}},_=new Set(x[f]||[]);y.target.checked?_.add(d):_.delete(d),x[f]=Array.from(_),i(a,{severity_channels:x})}})},d)})]},f))})]}),v.jsx(Uy,{label:"Regions (empty = all)",value:l.regions||[],onChange:f=>i(a,{regions:f}),placeholder:"Add region..."})," ",v.jsx("div",{className:"text-xs text-slate-500 pt-1",children:"Channel config"}),v.jsx(Mp,{label:"Broadcast channel",value:l.broadcast_channel??0,onChange:f=>i(a,{broadcast_channel:f})}),v.jsx(Uy,{label:"DM node IDs",value:l.node_ids||[],onChange:f=>i(a,{node_ids:f}),placeholder:"!nodeid"}),v.jsx(Uy,{label:"Email recipients",value:l.recipients||[],onChange:f=>i(a,{recipients:f}),placeholder:"ops@example.com"}),v.jsx(xs,{label:"SMTP host",value:l.smtp_host||"",onChange:f=>i(a,{smtp_host:f}),placeholder:"smtp.example.com"}),v.jsx(Mp,{label:"SMTP port",value:l.smtp_port??587,onChange:f=>i(a,{smtp_port:f})}),v.jsx(xs,{label:"Webhook URL",value:l.webhook_url||"",onChange:f=>i(a,{webhook_url:f}),placeholder:"https://..."})]})]},a)})})]})}function Cxe(){var z,Z,U;const[e,t]=G.useState(null),[r,n]=G.useState(null),[i,a]=G.useState([]),[o,s]=G.useState([]),[l,u]=G.useState(!0),[c,h]=G.useState(!1),[f,d]=G.useState(null),[g,m]=G.useState(null),[y,x]=G.useState(null),[_,w]=G.useState({open:!1,ruleIndex:-1,loading:!1,action:""}),[S,T]=G.useState(!1),[M,A]=G.useState(!1),P=G.useCallback(async()=>{try{const[$,Y,te]=await Promise.all([fetch("/api/config/notifications"),fetch("/api/notifications/categories"),fetch("/api/regions")]);if(!$.ok)throw new Error("Failed to fetch notifications config");const ie=await $.json(),se=await Y.json(),le=te.ok?await te.json():[];t(ie),n(JSON.parse(JSON.stringify(ie))),a(se),s(Array.isArray(le)?le:[]),A(!1),d(null)}catch($){d($ instanceof Error?$.message:"Unknown error")}finally{u(!1)}},[]);G.useEffect(()=>{document.title="Notifications - MeshAI",P()},[P]),G.useEffect(()=>{e&&r&&A(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);const I=async()=>{if(e){h(!0),d(null),m(null);try{const $=await fetch("/api/config/notifications",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Y=await $.json();if(!$.ok)throw new Error(Y.detail||"Save failed");m("Notifications config saved successfully"),n(JSON.parse(JSON.stringify(e))),A(!1),setTimeout(()=>m(null),3e3)}catch($){d($ instanceof Error?$.message:"Save failed")}finally{h(!1)}}},N=()=>{r&&(t(JSON.parse(JSON.stringify(r))),A(!1))},D=()=>({name:"",enabled:!0,trigger_type:"condition",categories:[],min_severity:"routine",schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"19:00",schedule_days:["monday"],message_type:"mesh_health_summary",custom_message:"",delivery_type:"",broadcast_channel:0,node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{},cooldown_minutes:10,region_scope:[]}),O=()=>{e&&t({...e,rules:[...e.rules||[],D()]})},R=$=>{if(!e)return;const Y=L3.find(te=>te.id===$);Y&&(t({...e,rules:[...e.rules||[],{...D(),...Y.rule}]}),T(!1))},F=$=>{if(!e)return;const Y=e.rules[$],te={...JSON.parse(JSON.stringify(Y)),name:`${Y.name} (copy)`},ie=[...e.rules];ie.splice($+1,0,te),t({...e,rules:ie})},H=async $=>{w({open:!0,ruleIndex:$,loading:!0,action:""});try{const te=await(await fetch(`/api/notifications/rules/${$}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"preview"})})).json();x(te),w(ie=>({...ie,loading:!1}))}catch{x({success:!1,message:"Failed to get preview"}),w(Y=>({...Y,loading:!1}))}},W=async $=>{const Y=_.ruleIndex;w(te=>({...te,loading:!0,action:$}));try{const ie=await(await fetch(`/api/notifications/rules/${Y}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:$})})).json();x(ie),w(se=>({...se,loading:!1}))}catch{x({success:!1,message:`Failed to ${$}`}),w(te=>({...te,loading:!1}))}},V=()=>{w({open:!1,ruleIndex:-1,loading:!1,action:""}),x(null)};return l?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading notifications config..."})}):e?v.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[_.open&&v.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:v.jsxs("div",{className:"bg-[#1a2332] border border-[#2a3a4a] shadow-xl max-w-2xl w-full mx-4 max-h-[85vh] overflow-auto",children:[v.jsxs("div",{className:"p-4 border-b border-[#2a3a4a] flex items-center justify-between sticky top-0 bg-[#1a2332]",children:[v.jsx("h3",{className:"text-lg font-semibold",children:"Test Notification Rule"}),v.jsx("button",{onClick:V,className:"text-slate-500 hover:text-slate-300",children:v.jsx(ca,{size:20})})]}),v.jsx("div",{className:"p-4 space-y-4",children:_.loading?v.jsxs("div",{className:"flex items-center justify-center py-8",children:[v.jsx($v,{size:20,className:"animate-spin text-slate-400 mr-2"}),v.jsx("div",{className:"text-slate-400",children:_.action?`${_.action.replace("_"," ").replace("send ","Sending ")}...`:"Loading current data..."})]}):y?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:"Current Data"}),y.live_data_summary&&y.live_data_summary.length>0?v.jsx("div",{className:"p-3 bg-slate-800/50 rounded space-y-1",children:y.live_data_summary.map(($,Y)=>v.jsx("div",{className:`text-sm font-mono ${$.startsWith("[!]")?"text-amber-400":""}`,children:$},Y))}):v.jsx("div",{className:"p-3 bg-slate-800/50 rounded text-sm text-slate-500",children:"No live data available for this rule's categories"})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:"Rule Matching"}),v.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[y.conditions_matched&&y.conditions_matched>0?v.jsxs("span",{className:"px-2 py-1 bg-green-500/20 text-green-400 rounded text-sm",children:[y.conditions_matched," condition",y.conditions_matched!==1?"s":""," match - this rule WOULD fire"]}):v.jsx("span",{className:"px-2 py-1 bg-slate-700 text-slate-400 rounded text-sm",children:"No conditions trigger this rule right now"}),y.conditions_below_threshold&&y.conditions_below_threshold>0&&v.jsxs("span",{className:"px-2 py-1 bg-yellow-500/20 text-yellow-400 rounded text-sm",children:[y.conditions_below_threshold," below threshold"]})]}),y.conditions_below_threshold&&y.conditions_below_threshold>0&&v.jsxs("div",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-sm space-y-2",children:[v.jsx("div",{className:"text-yellow-300",children:y.below_threshold_summary}),y.below_threshold_events&&y.below_threshold_events.length>0&&v.jsx("div",{className:"space-y-1 text-yellow-200/80",children:y.below_threshold_events.slice(0,3).map(($,Y)=>v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-yellow-500/20 rounded",children:$.severity}),v.jsx("span",{children:$.headline})]},Y))}),y.suggestion&&v.jsxs("div",{className:"text-yellow-400 text-xs mt-2",children:["Tip: ",y.suggestion]})]})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:y.is_example?"Example Messages":"Messages That Would Fire"}),(z=y.preview_messages)==null?void 0:z.map(($,Y)=>v.jsx("div",{className:"p-3 bg-slate-800 rounded text-sm font-mono break-words",children:$},Y))]}),y.delivered!==void 0&&y.delivery_result&&v.jsx("div",{className:`p-3 rounded text-sm ${y.delivered?"bg-green-500/10 border border-green-500/30 text-green-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:v.jsxs("div",{className:"flex items-start gap-2",children:[y.delivered?v.jsx(Za,{size:16,className:"mt-0.5"}):v.jsx(ca,{size:16,className:"mt-0.5"}),v.jsxs("div",{children:[v.jsx("div",{children:y.delivery_result}),y.delivery_error&&v.jsx("div",{className:"mt-1 text-red-300",children:y.delivery_error})]})]})}),y.message&&!y.preview_messages&&v.jsx("div",{className:`p-3 rounded text-sm ${y.success?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,children:y.message})]}):null}),v.jsxs("div",{className:"p-4 border-t border-[#2a3a4a] flex justify-between sticky bottom-0 bg-[#1a2332]",children:[v.jsx("button",{onClick:V,className:"px-4 py-2 text-slate-400 hover:text-slate-200",children:"Close"}),y&&!y.delivered&&v.jsx("div",{className:"flex gap-2",children:y.delivery_method?v.jsxs(v.Fragment,{children:[y.live_data_summary&&y.live_data_summary.length>0&&v.jsx("button",{onClick:()=>W("send_status"),disabled:_.loading,className:"px-3 py-2 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",title:"Send current conditions summary",children:"Send Current Conditions"}),v.jsx("button",{onClick:()=>W("send_test"),disabled:_.loading,className:"px-3 py-2 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",title:"Send example alert message",children:"Send Example Alert"}),y.can_send_live&&v.jsx("button",{onClick:()=>W("send_live"),disabled:_.loading,className:"px-3 py-2 bg-accent hover:bg-accent/80 rounded text-sm disabled:opacity-50",title:"Send actual live alert",children:"Send Live Alert"})]}):v.jsx("span",{className:"px-3 py-2 text-amber-400 text-sm",children:"Configure a delivery method to send test messages"})})]})]})}),v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("div",{children:v.jsx("p",{className:"text-sm text-slate-500",children:"Alert delivery and scheduled reports. Rules define what triggers a notification and where it gets sent."})}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("button",{onClick:P,className:"p-2 text-slate-400 hover:text-slate-200 hover:bg-bg-hover rounded transition-colors",title:"Refresh",children:v.jsx($v,{size:18})}),v.jsxs("button",{onClick:N,disabled:!M,className:"flex items-center gap-2 px-3 py-2 text-slate-400 hover:text-slate-200 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[v.jsx(Jx,{size:16}),"Discard"]}),v.jsxs("button",{onClick:I,disabled:c||!M,className:"flex items-center gap-2 px-4 py-2 bg-accent hover:bg-accent/80 disabled:bg-slate-700 disabled:cursor-not-allowed rounded text-white transition-colors",children:[v.jsx(zM,{size:16}),c?"Saving...":"Save"]})]})]}),f&&v.jsx("div",{className:"p-3 text-sm bg-red-500/10 text-red-400 border border-red-500/20",children:f}),g&&v.jsxs("div",{className:"p-3 text-sm bg-green-500/10 text-green-400 border border-green-500/20",children:[v.jsx(Za,{size:14,className:"inline mr-2"}),g]}),v.jsxs("div",{className:"bg-bg-card border border-border p-6 space-y-6",children:[v.jsx(Lx,{label:"Enable Notifications",checked:e.enabled,onChange:$=>t({...e,enabled:$}),helper:"Master switch for all notification delivery",info:"When disabled, no alerts or scheduled messages will be delivered. Alerts still get recorded to history."}),e.enabled&&v.jsxs(v.Fragment,{children:[" ",v.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] border border-[#1e2a3a]",children:[v.jsx("div",{className:"flex items-center gap-2",children:v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Cold-start grace"})}),v.jsx(Mp,{label:"Grace period (seconds)",value:e.cold_start_grace_seconds??60,onChange:$=>t({...e,cold_start_grace_seconds:$}),min:0,max:600,helper:"Suppress broadcasts for this many seconds after the first event arrives",info:"When meshai starts seeing events for the first time, suppress mesh broadcasts for this many seconds to absorb any JetStream backlog. Persistence rows still get written; only broadcasts are suppressed."})]}),v.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] border border-[#1e2a3a]",children:[v.jsx("div",{className:"flex items-center gap-2",children:v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Band Conditions (HF propagation)"})}),v.jsx(Lx,{label:"Enable scheduled band-conditions broadcasts",checked:e.band_conditions_enabled??!0,onChange:$=>t({...e,band_conditions_enabled:$}),helper:"3x/day HF propagation summary (Day/Night ratings per band group). The daily fire digest (twice-daily LLM summary of active fires + the last 24h of growth/spotting) is configured separately under Adapter Config -> fires.digest_*. See Reference -> Fire Tracker (Fusion) and Reference -> Broadcast Types for the New/Update/Active prefix system.",info:"Source priority: (1) recent SWPC readings persisted locally; (2) HamQSL.com fallback; (3) silent skip if both fail. Persistence rows are written either way for an audit trail."}),(e.band_conditions_enabled??!0)&&v.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[v.jsx(Mv,{label:"Slot 1",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[0]||"06:00",onChange:$=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[0]=$,t({...e,band_conditions_schedule:Y})},helper:"Morning (default 06:00 MT)"}),v.jsx(Mv,{label:"Slot 2",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[1]||"14:00",onChange:$=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[1]=$,t({...e,band_conditions_schedule:Y})},helper:"Afternoon (default 14:00 MT)"}),v.jsx(Mv,{label:"Slot 3",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[2]||"22:00",onChange:$=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[2]=$,t({...e,band_conditions_schedule:Y})},helper:"Night (default 22:00 MT)"})]}),v.jsx("p",{className:"text-xs text-slate-600",children:"All times are Mountain Time (America/Boise). DST handled automatically."})]}),e.toggles&&v.jsx(Sxe,{toggles:e.toggles,onChange:$=>t({...e,toggles:$})}),v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Notification Rules",v.jsx(Ai,{info:"Each rule is self-contained: define what triggers it (condition or schedule), where to send it (mesh, email, webhook), and behavior settings."})]}),v.jsxs("span",{className:"text-xs text-slate-500",children:[((Z=e.rules)==null?void 0:Z.length)||0," rule",(((U=e.rules)==null?void 0:U.length)||0)!==1?"s":""]})]}),(e.rules||[]).map(($,Y)=>v.jsx(_xe,{rule:$,ruleIndex:Y,categories:i,regions:o,onChange:te=>{const ie=[...e.rules||[]];ie[Y]=te,t({...e,rules:ie})},onDelete:()=>{confirm(`Delete rule "${$.name||"New Rule"}"?`)&&t({...e,rules:(e.rules||[]).filter((te,ie)=>ie!==Y)})},onDuplicate:()=>F(Y),onTest:()=>H(Y)},Y)),v.jsxs("div",{className:"flex gap-2",children:[v.jsxs("button",{onClick:O,className:"flex-1 py-3 border border-dashed border-[#1e2a3a] text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[v.jsx(af,{size:16})," Add Rule"]}),v.jsxs("div",{className:"relative",children:[v.jsxs("button",{onClick:()=>T(!S),className:"py-3 px-4 border border-dashed border-[#1e2a3a] text-slate-500 hover:text-slate-300 hover:border-accent flex items-center gap-2 transition-colors",children:[v.jsx(hB,{size:16})," Add from Template"]}),S&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>T(!1)}),v.jsxs("div",{className:"absolute right-0 top-full mt-2 z-50 w-80 bg-[#1a2332] border border-[#2a3a4a] shadow-xl overflow-hidden",children:[v.jsx("div",{className:"p-2 border-b border-[#2a3a4a] text-xs text-slate-500 uppercase",children:"Rule Templates"}),L3.map($=>v.jsxs("button",{onClick:()=>R($.id),className:"w-full p-3 text-left hover:bg-[#2a3a4a] transition-colors",children:[v.jsx("div",{className:"font-medium text-slate-200",children:$.name}),v.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:$.description})]},$.id))]})]})]})]})]})]})]})]}):v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-red-400",children:"Failed to load notifications config"})})}const P3=[{id:"stream-gauges",label:"Stream Gauges",icon:Yx},{id:"wildfire",label:"Wildfire",icon:Xx},{id:"firms",label:"Satellite Fire Detection (FIRMS)",icon:Qx},{id:"fire-tracker",label:"Fire Tracker (Fusion)",icon:U$},{id:"weather-alerts",label:"Weather Alerts",icon:G$},{id:"solar",label:"Solar & Geomagnetic",icon:pB},{id:"ducting",label:"Tropospheric Ducting",icon:Di},{id:"avalanche",label:"Avalanche Danger",icon:Kx},{id:"traffic",label:"Traffic Flow",icon:$x},{id:"roads-511",label:"Road Conditions (511)",icon:sB},{id:"mesh-health",label:"Mesh Health",icon:rf},{id:"broadcast-types",label:"Broadcast Types",icon:_C},{id:"reminders",label:"Reminder System",icon:Iu},{id:"notifications",label:"Notifications",icon:Zv},{id:"commands",label:"Commands",icon:gB},{id:"llm-dm",label:"LLM DM Queries",icon:OM},{id:"or-not-and",label:"OR-not-AND Architecture",icon:dB},{id:"adapter-config",label:"Adapter Config & CODE Rule",icon:BM},{id:"curation",label:"Curation: Gauges & Towns",icon:uB},{id:"schema",label:"Schema Migrations",icon:$$},{id:"api",label:"API Reference",icon:W$}];function $t({color:e}){const t={green:"bg-green-500",yellow:"bg-yellow-500",orange:"bg-orange-500",red:"bg-red-500",black:"bg-slate-800 border border-slate-600"};return v.jsx("span",{className:`inline-block w-3 h-3 rounded-full ${t[e]}`})}function yt({headers:e,rows:t}){return v.jsx("div",{className:"overflow-x-auto my-4",children:v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{children:v.jsx("tr",{className:"bg-[#1a2332] border-b border-[#2a3a4a]",children:e.map((r,n)=>v.jsx("th",{className:"px-4 py-2 text-left text-slate-400 font-medium",children:r},n))})}),v.jsx("tbody",{children:t.map((r,n)=>v.jsx("tr",{className:`border-b border-[#1e2a3a] ${n%2===0?"bg-[#0d1219]":"bg-[#0a0e17]"}`,children:r.map((i,a)=>v.jsx("td",{className:"px-4 py-2 text-slate-300",children:i},a))},n))})]})})}function Pt({href:e,children:t}){return v.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-1",children:[t," ",v.jsx(Ih,{size:12})]})}function de({children:e}){return v.jsx("h3",{className:"text-lg font-semibold text-slate-200 mt-6 mb-3",children:e})}function fs({children:e}){return v.jsx("h4",{className:"text-base font-medium text-slate-300 mt-4 mb-2",children:e})}function oe({children:e}){return v.jsx("code",{className:"font-mono text-accent bg-[#1a2332] px-1 rounded",children:e})}function hr({id:e,title:t,children:r}){return v.jsxs("section",{id:e,className:"mb-12 scroll-mt-6",children:[v.jsx("h2",{className:"text-2xl font-bold text-slate-100 mb-4 pb-2 border-b border-[#2a3a4a]",children:t}),v.jsx("div",{className:"text-slate-300 leading-relaxed space-y-4",children:r})]})}function Txe(){const e=tf(),[t,r]=G.useState(""),[n,i]=G.useState("stream-gauges"),a=G.useRef(null);G.useEffect(()=>{const l=e.hash.replace("#","");if(l&&P3.find(u=>u.id===l)){i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth"})}},[e.hash]);const o=P3.filter(l=>l.label.toLowerCase().includes(t.toLowerCase())),s=l=>{i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth"}),window.history.replaceState(null,"",`#${l}`)};return v.jsxs("div",{className:"flex h-full -m-6",children:[v.jsxs("aside",{className:"w-64 flex-shrink-0 bg-bg-card border-r border-border overflow-y-auto",children:[v.jsx("div",{className:"p-4 border-b border-border",children:v.jsxs("div",{className:"relative",children:[v.jsx(e_,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),v.jsx("input",{type:"text",value:t,onChange:l=>r(l.target.value),placeholder:"Search topics...",className:"w-full pl-9 pr-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent placeholder-slate-600"})]})}),v.jsx("nav",{className:"py-2",children:o.map(l=>{const u=l.icon,c=n===l.id;return v.jsxs("button",{onClick:()=>s(l.id),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm text-left transition-colors ${c?"text-accent bg-accent/10 border-l-2 border-accent":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover border-l-2 border-transparent"}`,children:[v.jsx(u,{size:16}),l.label]},l.id)})})]}),v.jsx("div",{ref:a,className:"flex-1 overflow-y-auto p-6",children:v.jsxs("div",{className:"max-w-4xl",children:[v.jsx("p",{className:"text-slate-400 mb-8",children:"Everything you need to understand and configure MeshAI's monitoring and alerting systems."}),v.jsxs(hr,{id:"stream-gauges",title:"Stream Gauges",children:[v.jsx(de,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI watches river and stream levels at gauges you configure. Each gauge reports two things:"}),v.jsxs("p",{children:[v.jsx("strong",{children:"Water Level (Gage Height)"}),` — how high the water is, measured in feet. Important: this is NOT the depth of the river. It's the height above a fixed measuring point that's different at every gauge. A reading of "10 feet" at one gauge means something completely different than "10 feet" at another. You can only compare readings from the SAME gauge over time.`]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Flow (Discharge)"}),` — how much water is moving past the gauge, in cubic feet per second (CFS). Think of it as the river's "throughput." For scale:`]}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"A small creek: 50-200 CFS"}),v.jsx("li",{children:"A mid-size river: 1,000-5,000 CFS"}),v.jsx("li",{children:"A big river in spring runoff: 10,000+ CFS"})]}),v.jsx(de,{children:"When Does It Flood?"}),v.jsxs("p",{children:["Flood levels are set by the ",v.jsx("strong",{children:"National Weather Service"}),', not USGS. NWS looks at each specific gauge location and decides "at what water level does the road flood? At what level do buildings get water?" Those levels are different everywhere.']}),v.jsxs("p",{children:[v.jsx("strong",{children:"Action Stage"})," — water is rising, time to start paying attention. Usually still inside the riverbanks."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Minor Flood"})," — low-lying roads start getting water on them. NWS issues a Flood Advisory."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Moderate Flood"})," — water in buildings near the river. Some people need to evacuate. NWS issues a Flood Warning."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Major Flood"})," — widespread flooding. Many people evacuating. Serious property damage."]}),v.jsx("p",{children:"MeshAI automatically looks up the flood levels for your gauge from NWS when you add a site. Some remote gauges don't have flood levels assigned — for those, you set them manually if you know what water levels cause problems in your area."}),v.jsx(de,{children:"Low Water / Drought"}),v.jsx("p",{children:`There's no official "drought stage" for most gauges. If you need to monitor low water (irrigation, fish habitat), set a manual low-water threshold based on what you know about your local river.`}),v.jsx(de,{children:"Setting It Up"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Find your gauge at ",v.jsx(Pt,{href:"https://waterdata.usgs.gov/nwis",children:"waterdata.usgs.gov/nwis"})]}),v.jsxs("li",{children:["Copy the site number (like ",v.jsx(oe,{children:"13090500"}),")"]}),v.jsx("li",{children:"Add it in Config → Environmental → USGS"}),v.jsx("li",{children:"MeshAI auto-fills the gauge name and flood levels from NWS"})]}),v.jsx("p",{children:"If NWS flood levels don't populate, your gauge may not have them. Set manual thresholds if you know your local conditions."}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://waterdata.usgs.gov/nwis",children:"USGS Water Data"})," — find gauges near you"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://water.noaa.gov",children:"NWS Water Prediction Service"})," — flood forecasts and thresholds"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.usgs.gov/special-topics/water-science-school/science/how-streamflow-measured",children:"Understanding Streamflow"})," — USGS explainer"]})]})]}),v.jsxs(hr,{id:"wildfire",title:"Wildfire",children:[v.jsx(de,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI tracks active wildfire perimeters from the National Interagency Fire Center (NIFC). For each fire, you see the name, size, how much is contained, and how far it is from your mesh nodes."}),v.jsx(de,{children:"Fire Size — How Big Is It?"}),v.jsx(yt,{headers:["Size","What That Means"],rows:[["10 acres","Small fire. Usually handled quickly by initial crews."],["100 acres","Notable fire. Active firefighting effort."],["1,000 acres","Large fire. Major resources being deployed."],["10,000+ acres","Very large fire. Multiple teams, aircraft, heavy equipment."],["100,000+ acres","Mega-fire. These make the national news."]]}),v.jsx("p",{children:"For reference, 1,000 acres is about 1.5 square miles."}),v.jsx(de,{children:"Containment — Is It Under Control?"}),v.jsx("p",{children:"Containment means the percentage of the fire's edge where firefighters have built a control line (a cleared strip to stop the fire from spreading further). It does NOT mean the fire is out inside that line."}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"0-30%"})," — Essentially uncontrolled. The fire goes where it wants."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"50%"})," — Good progress, but half the edge can still grow."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"80%+"})," — Well controlled. Major growth unlikely."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"100%"}),' — The edge is fully controlled. But the fire may STILL be actively burning inside. "100% contained" does NOT mean "out."']})]}),v.jsx(de,{children:"How Far Away Should I Worry?"}),v.jsx(yt,{headers:["Distance","What To Do"],rows:[[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"red"})," Under 5 km (3 miles)"]}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Immediate threat."})," This is evacuation-order range. Embers can fly this far in wind."]})],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"orange"})," 5-15 km (3-10 miles)"]}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Prepare."})," The fire could reach you in hours under bad conditions. Have a plan."]})],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"yellow"})," 15-30 km (10-20 miles)"]}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Watch."})," Smoke is likely. Wind shifts could change things fast."]})],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"green"})," Over 30 km (20 miles)"]}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Awareness."})," Keep an eye on it, but no immediate threat."]})]]}),v.jsx("p",{children:"How fast can a fire travel? In grass with wind: up to 14 mph. In heavy timber: 1-6 mph. A fire 10 miles away could theoretically reach you in 1-2 hours under worst-case conditions, but typical spread is much slower."}),v.jsx(de,{children:"Which Matters More — Size or Distance?"}),v.jsxs("p",{children:[v.jsx("strong",{children:"Distance is the immediate concern."})," A small uncontained fire 10 km away is more dangerous right now than a huge fire 50 km away. But big fires have more energy and can grow fast under wind shifts — keep watching them."]}),v.jsx(de,{children:"Setting It Up"}),v.jsxs("p",{children:["Just configure your state code (like ",v.jsx(oe,{children:"US-ID"})," for Idaho) in Config → Environmental → Fires. MeshAI polls NIFC every 10 minutes for active fires in that state and computes the distance to your mesh nodes automatically."]}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://inciweb.nwcg.gov",children:"InciWeb"})," — detailed incident information"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://data-nifc.opendata.arcgis.com",children:"NIFC Fire Map"})," — raw perimeter data"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.ready.gov/wildfires",children:"Ready.gov Wildfires"})," — preparedness guide"]})]})]}),v.jsxs(hr,{id:"firms",title:"Satellite Fire Detection (FIRMS)",children:[v.jsx(de,{children:"What You're Looking At"}),v.jsx("p",{children:`NASA's VIIRS satellites orbit the Earth and look for heat signatures on the ground. When they see something hot — a fire, a factory, a sunlit building — they flag it as a "hotspot." MeshAI checks these detections for your area.`}),v.jsxs("p",{children:[v.jsx("strong",{children:"Why this matters"}),": satellite hotspots show up ",v.jsx("strong",{children:"hours before"})," official fire perimeters are mapped. If a new fire starts near your mesh, the satellite might see it before anyone on the ground reports it."]}),v.jsx(de,{children:"Confidence — Is It Really a Fire?"}),v.jsx("p",{children:"Each detection gets a confidence rating:"}),v.jsx(yt,{headers:["Confidence","What It Means"],rows:[["High","Almost certainly a real fire. Strong heat signature."],["Nominal","Probably a real fire. Most actual fires get this rating."],["Low","Maybe a fire, maybe not. Could be a hot roof, sun reflecting off water, a factory, or a gas flare. Lots of false alarms."]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Recommendation"}),`: Set the filter to "Nominal + High." If you include "Low" you'll get alerts for every hot parking lot on a summer day.`]}),v.jsx(de,{children:"FRP — How Intense Is It?"}),v.jsx("p",{children:'FRP (Fire Radiative Power) measures the heat output in megawatts. Think of it as "how hot is this thing":'}),v.jsx(yt,{headers:["FRP","What It Probably Is"],rows:[["Under 5 MW","Hot surface, small agricultural burn, gas flare, or warm ground"],["5-50 MW","An actual fire — brush fire, grass fire, typical wildfire"],["50-300 MW","Intense fire — trees fully burning, active fire front"],["Over 300 MW","Extreme fire — major wildfire in full force"]]}),v.jsx("p",{children:"Setting the minimum FRP to 5 MW filters out most industrial and agricultural false alarms."}),v.jsx(de,{children:"New Ignition Detection"}),v.jsxs("p",{children:["MeshAI cross-references satellite hotspots against known NIFC fire perimeters. If a hotspot is NOT near any known fire, it gets flagged as a ",v.jsx("strong",{children:"potential new ignition"})," — maybe a new fire just started. These get elevated priority regardless of confidence level."]}),v.jsx(de,{children:"Timing"}),v.jsxs("p",{children:["Satellite data arrives ",v.jsx("strong",{children:"1-3 hours"})," after the satellite passes overhead. Each location gets observed about ",v.jsx("strong",{children:"6 times per day"}),` across all satellites, so there are multi-hour gaps. This is not real-time — it's "pretty recent."`]}),v.jsx(de,{children:"Getting an API Key"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Go to ",v.jsx(Pt,{href:"https://firms.modaps.eosdis.nasa.gov/api/area/",children:"FIRMS API page"})]}),v.jsx("li",{children:'Click "Get MAP_KEY"'}),v.jsx("li",{children:"Register for a free Earthdata account"}),v.jsx("li",{children:"Your key arrives by email"}),v.jsx("li",{children:"Enter it in Config → Environmental → FIRMS"})]}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://firms.modaps.eosdis.nasa.gov",children:"FIRMS Fire Map"})," — see hotspots on a map"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://earthdata.nasa.gov/data/tools/firms/faq",children:"FIRMS FAQ"})," — how it works"]})]})]}),v.jsxs(hr,{id:"fire-tracker",title:"Fire Tracker (Fusion)",children:[v.jsx("p",{children:"FIRMS hotspots are fast but noisy; WFIGS incidents are accurate but slow. The Fire Tracker fuses both feeds and a per-pixel attribution graph so a single fire's name, declared acreage, real-time perimeter movement, and spotting events all land as separate broadcasts on the mesh."}),v.jsx(de,{children:"What you'll see on the mesh"}),v.jsx("p",{children:"Six fire-family alert categories, in order of when they fire during an incident's lifecycle:"}),v.jsx(yt,{headers:["Category","Severity","Trigger","Example broadcast"],rows:[[v.jsx(oe,{children:"unattributed_hotspot_cluster"}),"Priority","3+ FIRMS pixels within 1 mi over 60 min, no WFIGS match — possible new ignition before NIFC declares it",v.jsx("span",{className:"text-amber-300",children:"🔥 Possible new fire: 3 hotspots within 1 mi @ 42.93,-114.45 (combined 78 MW)"})],[v.jsx(oe,{children:"wildfire_declared"}),"Priority","WFIGS first-sight of a new IRWIN incident — the official 'this is a fire and here is its name' record",v.jsx("span",{className:"text-amber-300",children:"🔥 New: Cache Peak Fire (WF), 3 mi N of Almo: 250 ac, 0% contained"})],[v.jsx(oe,{children:"wildfire_growth"}),"Priority","Per-pass centroid drift >= 0.5 mi (configurable) between consecutive satellite passes — the fire's footprint moved",v.jsx("span",{className:"text-amber-300",children:"🔥 Cache Peak Fire moving NE 1.2 mi/h, ~3 mi from Almo"})],[v.jsx(oe,{children:"wildfire_spotting"}),"Immediate","FIRMS pixel attributed to a tracked fire but >= 1.5 mi (configurable) outside its prior-pass convex-hull perimeter — ember spread",v.jsx("span",{className:"text-amber-300",children:"🔥 Possible spotting 2.1 mi NE of Cache Peak Fire perimeter"})],[v.jsx(oe,{children:"wildfire_incident"}),"Priority","WFIGS acreage or containment increased on a fire already broadcast once (the Update path; the New path uses wildfire_declared)",v.jsx("span",{className:"text-amber-300",children:"🔥 Update: Cache Peak Fire: 1,847 ac, 23% contained"})],[v.jsx(oe,{children:"wildfire_halted"}),"Routine","No FIRMS pixels attributed for 12+ hours (configurable) — fire stalled or out",v.jsx("span",{className:"text-amber-300",children:"🔥 Cache Peak Fire no growth in 14h"})]]}),v.jsx(de,{children:"Daily LLM digest"}),v.jsxs("p",{children:["Twice a day (default 06:00 and 18:00 Mountain Time) the bot runs an LLM summary across every active fire and the last 24 h of growth + spotting events, then broadcasts one terse line to the mesh. Shape:"," ",v.jsx("span",{className:"text-amber-300",children:'"Fires today: Cache Peak 1,847 ac +200 NE; Twin Peaks 320 ac stable; possible new fire 15 mi from Cache Peak."'})," ","Configure the schedule and timezone under ",v.jsx(oe,{children:"fires.digest_*"})," ","keys on the Adapter Config page."]}),v.jsx(de,{children:"How attribution works"}),v.jsxs("p",{children:["When a FIRMS hotspot lands, the bot walks every active fire (those not yet tombstoned) and matches by Haversine distance to that fire's running centroid. If the pixel is within the fire's ",v.jsx(oe,{children:"spread_radius_mi"})," ","(default 5 mi, per-fire override available) the pixel is attributed and appended to that fire's growth history. The centroid then re-computes as the median of the last 24 h of attributed pixels, so single-pixel outliers don't drag the perimeter around."]}),v.jsxs("p",{children:["Pixels that match no fire feed the cluster detector instead: if at least"," ",v.jsx(oe,{children:"cluster_min_pixels"})," (default 3) lie within"," ",v.jsx(oe,{children:"cluster_max_radius_mi"})," (default 1.0) over"," ",v.jsx(oe,{children:"cluster_time_window_minutes"})," (default 60), the bot fires a single ",v.jsx(oe,{children:"unattributed_hotspot_cluster"})," broadcast and marks the member pixels so a fourth arrival doesn't re-fire the same cluster."]}),v.jsx(de,{children:"How movement is computed"}),v.jsxs("p",{children:["Each VIIRS pass groups pixels into a ",v.jsx(oe,{children:"pass_id"})," (satellite + 90-min bucket). When a pixel from a different bucket arrives, the prior pass closes: its convex hull becomes the perimeter, its median centroid becomes the comparison anchor, and the bot computes drift (Haversine to the previous pass's centroid), an 8-way compass bearing, and a wall-clock mi/h speed. If drift ≥ ",v.jsx(oe,{children:"growth_drift_threshold_mi"})," the"," ",v.jsx(oe,{children:"wildfire_growth"})," broadcast fires."]}),v.jsx(de,{children:"How spotting is detected"}),v.jsxs("p",{children:["Once a pass closes its perimeter (a GeoJSON polygon stored on the fire), every subsequent attributed pixel runs a point-in-polygon test. Pixels outside the polygon with a vertex distance ≥"," ",v.jsx(oe,{children:"spotting_distance_threshold_mi"})," (default 1.5) fire the"," ",v.jsx(oe,{children:"wildfire_spotting"})," broadcast at ",v.jsx("em",{children:"immediate"})," severity — spread beyond the existing perimeter is the most actionable fire signal we emit. A per-fire cooldown (",v.jsx(oe,{children:"spotting_cooldown_seconds"}),", default 1 h) prevents an ember burst in the same area from spamming the mesh."]}),v.jsx(de,{children:"Tunable knobs (Adapter Config → fires)"}),v.jsx(yt,{headers:["Key","Default","What it does"],rows:[[v.jsx(oe,{children:"spread_radius_mi_default"}),"5.0 mi","Attribution radius for FIRMS → fire matching. Per-fire override in the fires.spread_radius_mi column."],[v.jsx(oe,{children:"growth_drift_threshold_mi"}),"0.5 mi","Per-pass centroid drift at or above this fires wildfire_growth."],[v.jsx(oe,{children:"halt_passes_threshold"}),"2","Consecutive empty satellite passes before wildfire_halted (documented; the time gate below is the operational rule)."],[v.jsx(oe,{children:"halt_minimum_seconds"}),"43,200 (12 h)","Minimum elapsed seconds since the most recent attributed pixel before wildfire_halted can fire."],[v.jsx(oe,{children:"spotting_distance_threshold_mi"}),"1.5 mi","Distance from prior-pass perimeter that fires wildfire_spotting."],[v.jsx(oe,{children:"spotting_cooldown_seconds"}),"3,600 (1 h)","Minimum seconds between consecutive spotting broadcasts per fire."],[v.jsx(oe,{children:"digest_enabled"}),"true","Master toggle for the twice-daily digest."],[v.jsx(oe,{children:"digest_schedule"}),'["06:00","18:00"]',"Local-time slots for the digest."],[v.jsx(oe,{children:"digest_timezone"}),"America/Boise","IANA tz for digest_schedule."],[v.jsx(oe,{children:"digest_max_chars"}),"200","Hard cap on the digest wire (the LLM is told to fit; the chunker enforces)."]]})]}),v.jsxs(hr,{id:"weather-alerts",title:"Weather Alerts",children:[v.jsx(de,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI watches for NWS (National Weather Service) alerts affecting your area — warnings, watches, and advisories."}),v.jsx(de,{children:"Alert Severity — How Serious Is It?"}),v.jsx(yt,{headers:["Severity","What It Means","Example"],rows:[["Extreme","Life-threatening. The most serious events.","Tornado Emergency, Hurricane Warning, Tsunami Warning"],["Severe","Dangerous. Take protective action.","Tornado Warning, Flash Flood Warning, Blizzard Warning, Red Flag Warning"],["Moderate","Be prepared. Could become dangerous.","Winter Weather Advisory, Wind Advisory, Flood Watch, Heat Advisory"],["Minor","Good to know. Probably won't hurt anyone.","Special Weather Statement, Air Quality Alert"]]}),v.jsx(de,{children:"When Should I Act? (Urgency)"}),v.jsx(yt,{headers:["Urgency","What It Means"],rows:[["Immediate","Do something NOW"],["Expected","Do something within the hour"],["Future","Coming in the next several hours"],["Past","It's over — NWS is clearing the alert"]]}),v.jsx(de,{children:"How Sure Are They? (Certainty)"}),v.jsx(yt,{headers:["Certainty","What It Means"],rows:[["Observed","It's happening right now. Verified."],["Likely","More than 50% chance"],["Possible","Could happen, but less than 50%"],["Unlikely","Probably won't, but mentioned for awareness"]]}),v.jsx(de,{children:"These Are Separate Scales"}),v.jsx("p",{children:'A single alert has all three. A hurricane warning for next week is "Severe + Future + Likely." A tornado spotted on the ground is "Extreme + Immediate + Observed." An air quality advisory is "Minor + Expected + Possible."'}),v.jsx(de,{children:"What Minimum Severity Should I Set?"}),v.jsx(yt,{headers:["Setting","What You Get","What You Miss"],rows:[["Minor","Everything — high volume","Nothing"],[v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Moderate"})," ✓"]}),"Watches, Advisories, and Warnings","Special Weather Statements"],["Severe","Only Warnings — things happening NOW","Watches (which give you hours of advance warning)"],["Extreme","Only the rarest events","Most Tornado and Severe Thunderstorm Warnings"]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Moderate is recommended."})," It catches Watches (advance warning that conditions may worsen) and Advisories (conditions exist but aren't severe) while filtering out the informational stuff."]}),v.jsx(de,{children:"Finding Your NWS Zone"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Go to ",v.jsx(Pt,{href:"https://www.weather.gov",children:"weather.gov"})]}),v.jsx("li",{children:"Enter your location"}),v.jsxs("li",{children:["Find your zone code at ",v.jsx(Pt,{href:"https://www.weather.gov/pimar/PubZone",children:"NWS Zone Map"})]}),v.jsxs("li",{children:["Zone codes look like: ",v.jsx(oe,{children:"IDZ016"}),", ",v.jsx(oe,{children:"UTZ040"}),", etc."]})]}),v.jsx(de,{children:"The User-Agent Field"}),v.jsx("p",{children:"NWS wants to know who's using their API — not for approval, just so they can contact you if something breaks. You make it up:"}),v.jsx("p",{children:v.jsx(oe,{children:"(meshai, you@email.com)"})}),v.jsx("p",{children:"No registration. No waiting. Just type it in."}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://alerts.weather.gov",children:"NWS Active Alerts"})," — see current alerts"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.weather.gov/documentation/services-web-api",children:"NWS API Docs"})," — technical details"]})]})]}),v.jsxs(hr,{id:"solar",title:"Solar & Geomagnetic Conditions",children:[v.jsx(de,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI tracks space weather — solar activity and its effects on Earth's magnetic field. This matters for radio operators because the sun directly controls how well HF radio works, and major solar events can affect all radio communications."}),v.jsx(de,{children:"Solar Flux Index (SFI)"}),v.jsx("p",{children:'Think of SFI as a "how active is the sun" number. Higher = better for HF radio, but also higher risk of solar flares.'}),v.jsx(yt,{headers:["SFI","What It Means for You"],rows:[["Below 70","Quiet sun. Higher HF bands (10m, 15m) are probably dead. Stick to lower bands."],["70-90","Getting better. Some openings on 15m and above, but inconsistent."],["90-120","Good. Most HF bands work. Reliable contacts on 20m and 15m."],["120-170","Great. All HF bands open. 10m works for worldwide contacts."],["Above 170","Excellent. Best HF conditions — but watch for flares."]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Quick rule"}),": SFI above 90 and Kp below 4 = good day for HF radio."]}),v.jsx(de,{children:"Kp Index"}),v.jsx("p",{children:"Kp measures how disturbed Earth's magnetic field is, on a 0-9 scale. Higher = more disturbance = worse for HF radio but better for aurora viewing."}),v.jsx(yt,{headers:["Kp","What It Means for You"],rows:[["0-2","Quiet. Best HF conditions."],["3","Slightly unsettled. You probably won't notice."],["4","Active. Some noise and fading on HF, especially if you're at higher latitudes."],[v.jsx("strong",{children:"5"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Minor storm (G1)."})," HF noticeably degraded. Aurora visible at high latitudes (~60°N)."]})],[v.jsx("strong",{children:"6"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Moderate storm (G2)."})," HF getting rough. Aurora moving south (~55°N)."]})],[v.jsx("strong",{children:"7"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Strong storm (G3)."})," HF unreliable for 1-2 days. Aurora at mid-latitudes."]})],[v.jsx("strong",{children:"8-9"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Severe/Extreme storm."})," HF may black out completely. Aurora visible at very low latitudes. Power grid stress possible."]})]]}),v.jsx(de,{children:"R / S / G Scales"}),v.jsx("p",{children:"NOAA's shorthand for three types of space weather events:"}),v.jsx(fs,{children:"R (Radio Blackouts) — from solar flares:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"R1-R2: Brief HF disruption. You might not notice."}),v.jsx("li",{children:"R3: HF goes out for about an hour on the sunlit side of Earth."}),v.jsx("li",{children:"R4-R5: HF dead for hours. Serious."})]}),v.jsx(fs,{children:"S (Solar Radiation Storms) — from energetic particles:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"Mostly affects polar regions and satellites"}),v.jsx("li",{children:"S3+: Polar HF goes out entirely"})]}),v.jsx(fs,{children:"G (Geomagnetic Storms) — from solar wind disturbances:"}),v.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:v.jsx("li",{children:"Same as the Kp scale: G1 = Kp 5, up to G5 = Kp 9"})}),v.jsx(de,{children:"Bz — The Storm Predictor"}),v.jsx("p",{children:"Bz measures the direction of the solar wind's magnetic field. When it points south (negative values), the solar wind can dump energy into Earth's magnetic field, causing storms."}),v.jsx(yt,{headers:["Bz","What It Means"],rows:[["Positive","All good. Solar wind bouncing off."],["0 to -5","Slight coupling. Nothing dramatic."],["-5 to -10","Things starting to pick up. Storm possible."],["Below -10","Storm likely. Kp will start climbing."],["Below -20","Severe storm probable."]]}),v.jsx("p",{children:"Bz can change fast — minute to minute. What matters is whether it stays negative for hours, not brief dips."}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.swpc.noaa.gov",children:"SWPC Space Weather Dashboard"})," — live data"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.swpc.noaa.gov/noaa-scales-explanation",children:"NOAA Space Weather Scales"})," — what R/S/G mean"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.hamqsl.com/solar.html",children:"HamQSL Solar Page"})," — ham-friendly display"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.swpc.noaa.gov/products/planetary-k-index",children:"Planetary K-Index"})," — live Kp"]})]})]}),v.jsxs(hr,{id:"ducting",title:"Tropospheric Ducting",children:[v.jsx(de,{children:"What You're Looking At"}),v.jsx("p",{children:'Sometimes the atmosphere creates an invisible "pipe" that traps radio signals and carries them much farther than normal. This is called tropospheric ducting. It mostly affects VHF and UHF frequencies.'}),v.jsx("p",{children:"MeshAI watches for these conditions by analyzing weather data (temperature and humidity at different altitudes) over your mesh area."}),v.jsx(de,{children:"How Do I Know If Ducting Is Happening?"}),v.jsx("p",{children:'MeshAI reports a "condition" based on the atmospheric profile:'}),v.jsx(yt,{headers:["Condition","What It Means"],rows:[["Normal","Standard propagation. Nothing unusual."],["Super-refraction","Slightly enhanced range. You might hear a few more distant stations than usual."],["Surface Duct","Radio signals trapped near the ground. You may hear stations hundreds of km away that you've never heard before."],["Elevated Duct",'Same effect but the "pipe" is up in the atmosphere. Affects signals passing through that altitude.']]}),v.jsx(de,{children:"What You'll Actually Notice"}),v.jsx("p",{children:"When ducting happens on your mesh:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"Distant repeaters you've never heard suddenly come in"}),v.jsx("li",{children:"Nodes appear from far outside your normal range"}),v.jsx("li",{children:"You hear FM radio stations from other cities"}),v.jsx("li",{children:"ADS-B flight tracking range gets much longer"}),v.jsx("li",{children:"There might be interference from distant stations on your frequency"})]}),v.jsx(de,{children:"The dM/dz Number"}),v.jsx("p",{children:`The dashboard shows a "dM/dz" value in "M-units/km." You don't need to understand the math — just know:`}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Around 118"})," = normal atmosphere"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Below 79"})," = enhanced propagation starting"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Below 0 (negative)"})," = ducting is happening"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Below -50"})," = strong ducting — classic VHF/UHF DX event"]})]}),v.jsx(de,{children:"When Does Ducting Happen?"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"Under high-pressure weather systems (clear, stable air)"}),v.jsx("li",{children:"When warm air sits on top of cool air (temperature inversion)"}),v.jsx("li",{children:"Most common in late summer and early fall"}),v.jsx("li",{children:"Strongest along coastlines and over water"}),v.jsx("li",{children:"In mountain valleys: cold air pooling in fall/winter can create surface ducts"})]}),v.jsx(de,{children:"Setting It Up"}),v.jsx("p",{children:"Just configure the latitude and longitude of the center of your mesh area in Config → Environmental → Ducting. MeshAI checks the atmospheric conditions there every 3 hours using free weather model data. No API key needed."}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://dxinfocentre.com/tropo.html",children:"Tropo Forecast Maps (Hepburn)"})," — 6-day tropo prediction"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://dxmaps.com",children:"DX Maps"})," — real-time VHF/UHF propagation reports"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://en.wikipedia.org/wiki/Tropospheric_propagation",children:"Wikipedia: Tropospheric Propagation"})," — background"]})]})]}),v.jsxs(hr,{id:"avalanche",title:"Avalanche Danger",children:[v.jsx(de,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI pulls avalanche forecasts from your regional avalanche center during winter months. The danger scale has 5 levels and it's the same across all of North America."}),v.jsx(de,{children:"The Danger Scale"}),v.jsx(yt,{headers:["Level","Name","Color","What To Do"],rows:[["1","Low",v.jsx($t,{color:"green"}),"Generally safe. Normal caution in steep terrain."],["2","Moderate",v.jsx($t,{color:"yellow"}),"Be careful on specific terrain features. Evaluate conditions."],["3","Considerable",v.jsx($t,{color:"orange"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"DANGEROUS."}),` This is where most people die in avalanches — they see "3 out of 5" and think it's fine. It's not. Use extreme caution.`]})],["4","High",v.jsx($t,{color:"red"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Very dangerous."})," Stay off anything steep."]})],["5","Extreme",v.jsx($t,{color:"black"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Don't go out."})," Avalanches are happening on their own."]})]]}),v.jsx(de,{children:"The Most Important Thing to Know"}),v.jsxs("p",{children:[v.jsx("strong",{children:"Level 3 (Considerable) kills more people than any other level."}),' People look at "3 out of 5" and think "middle of the road, probably okay." In reality, the risk roughly doubles at each step up the scale. Level 3 is where dangerous conditions overlap with people thinking they can handle it.']}),v.jsx(de,{children:"Seasonal"}),v.jsx("p",{children:'MeshAI only checks avalanche conditions during winter months (configurable, default December through April). Outside season, it shows "off season" and saves API calls.'}),v.jsx(de,{children:"Finding Your Avalanche Center"}),v.jsxs("p",{children:["Go to ",v.jsx(Pt,{href:"https://avalanche.org/avalanche-centers/",children:"avalanche.org/avalanche-centers/"})," for a map. Common center codes:"]}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"SNFAC"})," — Sawtooth (central Idaho)"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"UAC"})," — Utah"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"NWAC"})," — Cascades/Olympics (WA/OR)"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"CAIC"})," — Colorado"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"SAC"})," — Sierra Nevada (CA)"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GNFAC"})," — Gallatin (SW Montana)"]})]}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://avalanche.org",children:"Avalanche.org"})," — US forecasts"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://avalanche.org/avalanche-encyclopedia/human/resources/north-american-public-avalanche-danger-scale/",children:"Avalanche Danger Scale"})," — full scale explanation"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://kbyg.org",children:"Know Before You Go"})," — avalanche awareness"]})]})]}),v.jsxs(hr,{id:"traffic",title:"Traffic Flow",children:[v.jsx(de,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI monitors traffic speed on road segments you configure, using data from TomTom (real vehicles with navigation apps reporting their speed)."}),v.jsx(de,{children:"Speed Ratio — The Key Number"}),v.jsx("p",{children:'MeshAI compares current speed to "free-flow speed" (what traffic normally does when the road is empty). The ratio tells you how congested it is:'}),v.jsx(yt,{headers:["Ratio","What It Means"],rows:[[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"green"})," Above 85%"]}),"Normal. Traffic flowing fine."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"yellow"})," 65-85%"]}),"Slow. Heavier than usual but moving."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"orange"})," 40-65%"]}),"Congested. Significant delays."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"red"})," Below 40%"]}),"Gridlock. Barely moving."]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Note"}),`: "free-flow speed" is NOT the speed limit. It's what traffic actually does on that road when nobody's in the way. Drivers often exceed speed limits on open highways.`]}),v.jsx(de,{children:"Confidence — Can You Trust the Data?"}),v.jsx("p",{children:"TomTom's confidence score tells you how much of the reading comes from real vehicles right now vs historical averages:"}),v.jsx(yt,{headers:["Confidence","What It Means"],rows:[["Above 0.9","Very reliable — lots of real-time probe data"],["0.7-0.9","Good — mix of real-time and historical"],["Below 0.7",v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Unreliable"})," — mostly guessing from historical patterns. Don't alert on this."]})]]}),v.jsx("p",{children:"Set minimum confidence to 0.7 to avoid false congestion alerts at night or on rural roads where few probe vehicles drive."}),v.jsx(de,{children:"Setting Up Corridors"}),v.jsx("p",{children:'Each "corridor" is a point on a road you want to monitor. To add one:'}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"Go to Google Maps, find the road"}),v.jsx("li",{children:`Right-click the road → "What's here?" → copy the coordinates`}),v.jsx("li",{children:"Add the corridor in Config with a name and those coordinates"}),v.jsx("li",{children:"TomTom finds the nearest road segment automatically"})]}),v.jsx(de,{children:"Getting an API Key"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Sign up at ",v.jsx(Pt,{href:"https://developer.tomtom.com",children:"developer.tomtom.com"})," (free)"]}),v.jsx("li",{children:"Create an app → get your API key"}),v.jsx("li",{children:"Free tier: 2,500 requests/day (plenty for 5-10 corridors)"})]}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://developer.tomtom.com",children:"TomTom Developer Portal"})," — API docs and key signup"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.tomtom.com/traffic-index/",children:"TomTom Traffic Index"})," — city congestion rankings"]})]})]}),v.jsxs(hr,{id:"roads-511",title:"Road Conditions (511)",children:[v.jsx(de,{children:"What You're Looking At"}),v.jsx("p",{children:"511 systems report road closures, construction, weather events, mountain pass conditions, and incidents. Every state runs their own 511 system — there is no national API."}),v.jsx(de,{children:"Setting It Up"}),v.jsx("p",{children:"You need to find YOUR state's 511 developer API. MeshAI does not include a default URL because every state is different. Some states have free public APIs, some require registration, and some don't have developer APIs at all."}),v.jsx("p",{children:"Configure in Config → Environmental → 511:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Base URL"})," — your state's API endpoint"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"API Key"})," — if required by your state"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Endpoints"})," — which data feeds to poll (varies by state)"]})]}),v.jsx(de,{children:"Learn More"}),v.jsx("p",{children:"Check your state's 511 or DOT website for developer information."})]}),v.jsxs(hr,{id:"mesh-health",title:"Mesh Health",children:[v.jsx(de,{children:"Health Score"}),v.jsx("p",{children:"MeshAI computes a 0-100 health score for your mesh network by looking at five areas, each weighted differently:"}),v.jsx(yt,{headers:["Pillar","Weight","What It Measures"],rows:[[v.jsx("strong",{children:"Infrastructure"}),"30%","Are your routers online?"],[v.jsx("strong",{children:"Utilization"}),"25%","Is the radio channel congested?"],[v.jsx("strong",{children:"Coverage"}),"20%","Do nodes have redundant paths to gateways?"],[v.jsx("strong",{children:"Behavior"}),"15%","Are any nodes flooding the channel?"],[v.jsx("strong",{children:"Power"}),"10%","Are battery-powered nodes running low?"]]}),v.jsx("p",{children:"The overall score is the weighted sum:"}),v.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"Score = (Infrastructure × 30%) + (Utilization × 25%) + (Coverage × 20%) + (Behavior × 15%) + (Power × 10%)"}),v.jsx(de,{children:"How Each Pillar Is Calculated"}),v.jsx(fs,{children:"Infrastructure (30%)"}),v.jsx("p",{children:"This is the simplest pillar — what percentage of your infrastructure nodes are currently online?"}),v.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"(routers online ÷ total routers) × 100"}),v.jsxs("p",{children:["Only nodes with the ",v.jsx(oe,{children:"ROUTER"}),", ",v.jsx(oe,{children:"ROUTER_LATE"}),", or ",v.jsx(oe,{children:"ROUTER_CLIENT"})," role count as infrastructure. Regular client nodes going offline doesn't affect this score. If you have 5 routers and 3 are online, infrastructure scores 60."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Special case:"})," If you have no routers at all (all clients), this pillar scores 100. You're not penalized for not having infrastructure — you just don't have any to track."]}),v.jsx(fs,{children:"Utilization (25%)"}),v.jsxs("p",{children:["MeshAI reads the channel utilization that each router reports in its telemetry — this is the firmware's own measurement of how busy the radio channel is. MeshAI uses the ",v.jsx("strong",{children:"highest"})," value from any infrastructure node because the busiest router is the bottleneck for the whole mesh."]}),v.jsx("p",{children:v.jsx("strong",{children:"How it works:"})}),v.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-4",children:[v.jsxs("li",{children:["Collect ",v.jsx(oe,{children:"channel_utilization"})," from all infrastructure nodes that report it"]}),v.jsx("li",{children:"If no infra nodes have telemetry, try all nodes"}),v.jsxs("li",{children:["Use the ",v.jsx("strong",{children:"maximum"})," value for scoring (busiest node = bottleneck)"]}),v.jsx("li",{children:"If no nodes report utilization (older firmware), fall back to packet count estimate"})]}),v.jsxs("p",{className:"mt-4",children:[v.jsx("strong",{children:"Fallback method"})," (when telemetry unavailable): estimates from packet counts using 200ms/packet airtime. This is less accurate — it assumes MediumFast preset and sums packets across all nodes."]}),v.jsx(yt,{headers:["Channel Utilization","Score","What It Means"],rows:[["Under 20%","100","Channel is clear — this is the goal"],["20-25%","75-100","Slight degradation, occasional collisions"],["25-35%","50-75","Severe degradation — firmware throttling active"],["35-45%","25-50","Mesh struggling badly — reliability dropping"],["Over 45%","0-25","Mesh is effectively unusable"]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Special case:"})," If no utilization data is available (no telemetry and no packet data), this pillar scores 100. You're not penalized for missing data."]}),v.jsx(fs,{children:"Coverage (20%)"}),v.jsx("p",{children:'Measures gateway redundancy — how many of your data sources can "see" each node. A node reported by all 3 of your gateways has full coverage. A node only seen by 1 gateway is a single point of failure.'}),v.jsxs("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:["coverage_ratio = average_gateways_per_node ÷ total_sources",v.jsx("br",{}),"single_gw_penalty = (single_gateway_nodes ÷ total_nodes) × 40"]}),v.jsx("p",{children:"If a node is seen by 2 out of 3 sources, its coverage ratio is 0.67. Infrastructure nodes with only single-gateway coverage get an extra penalty — they're critical but have no backup path."}),v.jsx(yt,{headers:["Coverage Ratio","Base Score","After Penalty"],rows:[["100% (all sources)","100","100 minus single-gw penalty"],["70-99%","90","Minus penalties"],["50-69%","70","Minus penalties"],["Under 50%","50 or less","Heavy penalty"]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Special case:"})," With only 1 data source, this pillar can't score well — there's no redundancy to measure. Coverage becomes meaningful when you have 2+ sources (MeshMonitor + MQTT, multiple gateways, etc.)."]}),v.jsx(fs,{children:"Behavior (15%)"}),v.jsx("p",{children:"Counts how many nodes are sending an unusually high number of non-text packets. This catches firmware bugs, stuck transmitters, and misconfigured nodes that are flooding the channel."}),v.jsxs("p",{children:[v.jsx("strong",{children:"What counts as flooding:"})," More than 500 non-text packets in 24 hours. Text messages don't count — the behavior pillar only flags telemetry, position, and routing packet floods."]}),v.jsx(yt,{headers:["Flagged Nodes","Score"],rows:[["0","100"],["1","80"],["2-3","60"],["4-5","40"],["6+","20"]]}),v.jsx("p",{children:"A single misbehaving node only drops the score to 80. It takes multiple problem nodes to seriously hurt the behavior pillar."}),v.jsx(fs,{children:"Power (10%)"}),v.jsx("p",{children:"Measures what fraction of battery-powered nodes are below the warning threshold (default 20%)."}),v.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"100 × (1 − low_battery_nodes ÷ total_battery_nodes)"}),v.jsx("p",{children:"If 2 out of 10 battery nodes are below 20%, power scores 80."}),v.jsxs("p",{children:[v.jsx("strong",{children:"Important:"})," USB-powered nodes are excluded from this calculation. Many nodes report 100% battery even when running on wall power with no battery installed. Only nodes actually running on batteries affect this pillar."]}),v.jsx(de,{children:"Health Tiers"}),v.jsx(yt,{headers:["Score","Tier","What It Means"],rows:[["90-100",v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"green"})," Healthy"]}),"Everything's working well."],["75-89",v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"yellow"})," Slight degradation"]}),"Some issues but the mesh is functional."],["50-74",v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"orange"})," Unhealthy"]}),"Multiple problems. Reliability is affected."],["25-49",v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"red"})," Warning"]}),"Significant issues. The mesh is struggling."],["0-24",v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"black"})," Critical"]}),"Major failures. Barely functional."]]}),v.jsx(de,{children:"Channel Utilization — Is the Radio Channel Full?"}),v.jsx("p",{children:"Meshtastic radios share one LoRa channel. If too many nodes are transmitting too often, they step on each other and messages get lost."}),v.jsx(yt,{headers:["Utilization","What's Happening"],rows:[[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"green"})," Under 25%"]}),"Healthy. The firmware itself starts throttling above 25% to protect the channel — so under 25% is the target."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"yellow"})," 25-40%"]}),"Getting busy. Common on larger meshes. Worth watching."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"orange"})," 40-50%"]}),"Congested. The firmware throttles GPS updates above 40%. Messages are colliding and retrying."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"red"})," Over 50%"]}),"Serious problem. More time is spent retrying than communicating. Mesh reliability drops fast."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"black"})," Over 65%"]}),"Documented failure point on busy LONG_FAST meshes. The mesh becomes unusable."]]}),v.jsx(de,{children:"Packet Flooding"}),v.jsx("p",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-yellow-200",children:v.jsx("strong",{children:'⚠️ "Packet flooding" means a node sending too many RADIO PACKETS. This has nothing to do with water flooding.'})}),v.jsx("p",{children:"A normal Meshtastic node sends a packet every few minutes (announcing itself, reporting telemetry, updating position). If a node starts blasting packets every few seconds, something is wrong — firmware bug, stuck transmitter, or misconfiguration."}),v.jsx(yt,{headers:["Packets per Minute","What It Means"],rows:[["1-5","Normal"],["5-10","Elevated — might be someone chatting a lot"],["10-20","Suspicious — worth investigating"],["Over 30","Something is broken. This node is actively hurting the mesh."]]}),v.jsx(de,{children:"Battery Levels"}),v.jsx("p",{children:"Most Meshtastic radios (T-Beam, RAK4631, Heltec V3) use a single lithium battery cell. The voltage tells you how much charge is left:"}),v.jsx(yt,{headers:["Voltage","Charge","What To Do"],rows:[["4.20V","100%","Full"],["3.80V","~60%","Fine"],[v.jsx("strong",{children:"3.60V"}),v.jsx("strong",{children:"~30%"}),v.jsx(v.Fragment,{children:v.jsx("strong",{children:"⚠️ Warning — charge it soon"})})],[v.jsx("strong",{children:"3.50V"}),v.jsx("strong",{children:"~15%"}),v.jsx(v.Fragment,{children:v.jsx("strong",{children:"🔴 Low — charge it now"})})],[v.jsx("strong",{children:"3.40V"}),v.jsx("strong",{children:"~7%"}),v.jsx(v.Fragment,{children:v.jsx("strong",{children:"⚫ About to die"})})],["3.30V","~3%","Device shutting down"]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"USB-powered nodes"})," report 100% battery even if there's no battery installed. Battery alerts only matter for nodes actually running on battery power."]}),v.jsx(de,{children:"Node Offline Detection"}),v.jsx("p",{children:`MeshAI marks a node as "offline" when it hasn't been heard for a configurable time period. Different node types need different thresholds:`}),v.jsx(yt,{headers:["Node Type","Recommended Threshold","Why"],rows:[["Fixed infrastructure (wall power)",v.jsx("strong",{children:"2 hours"}),"These should always be transmitting. 2 hours of silence means something is wrong."],["Fixed client (wall power)","2-4 hours","Same logic, slightly more lenient."],["Mobile / vehicle","4-8 hours","They go behind mountains, into garages, out of range. Normal."],["Solar-powered","12-24 hours","May shut down at night when solar stops charging."]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Rule of thumb"}),`: set the threshold to about 4× the node's beacon interval. Too tight and nodes will constantly flap "offline/online" from normal gaps. Too loose and real outages go unnoticed.`]})]}),v.jsxs(hr,{id:"broadcast-types",title:"Broadcast Types",children:[v.jsx("p",{children:"Every broadcast the bot sends to the mesh carries a one-word prefix that tells you what kind of update it is. Three types:"}),v.jsx(yt,{headers:["Prefix","What it means","When you see it"],rows:[[v.jsx(oe,{children:"New:"}),"The first time the bot has ever broadcast about this event","Cache Peak Fire's WFIGS first-sight; FIRMS cluster's first 3-pixel detection; first NWS warning for a CAP id"],[v.jsx(oe,{children:"Update:"}),"A material change on something the bot already announced","Cache Peak Fire's acreage grew; ITD 511 work zone's lane status changed; quake event's magnitude was revised"],[v.jsx(oe,{children:"Active:"}),"A clock-driven reminder that an already-announced event is still live","Cache Peak Fire is still burning 8 hours later; an SWPC G3 storm is still in progress"]]}),v.jsx("p",{children:"The bot tracks first-broadcast time and last-broadcast time separately on every event row, so a New: prefix is only emitted once even after a container restart. Update: respects per-adapter cooldowns (WFIGS is 8 h by default; ITD 511 is per-incident). Active: is the reminder system, covered in the next section."})]}),v.jsxs(hr,{id:"reminders",title:"Reminder System",children:[v.jsxs("p",{children:["Some events stay live for days. A wildfire doesn't go out because WFIGS stopped publishing updates; a geomagnetic storm doesn't end because SWPC went quiet on the wire. The reminder system fires a clock-driven"," ",v.jsx(oe,{children:"Active:"}),"-prefixed re-broadcast on a human-scale cadence so an operator who came on shift after the original announcement still sees the event."]}),v.jsx(de,{children:"Cadences"}),v.jsx(yt,{headers:["Adapter","Reminder cadence","Termination"],rows:[[v.jsxs(v.Fragment,{children:[v.jsx(oe,{children:"wfigs"})," (wildfires)"]}),"Every 8 h while the fire is still active","WFIGS publishes a tombstone (incident closed) → fires.tombstoned_at is stamped → reminder loop stops"],[v.jsxs(v.Fragment,{children:[v.jsx(oe,{children:"swpc"})," (space weather)"]}),"Every 8 h while a Kp >= floor / X-class flare / proton-storm event is ongoing","The next SWPC envelope shows the storm has subsided"],[v.jsx(oe,{children:"itd_511_work_zone"}),"Per-zone, configurable in the rule UI","WZDx publishes the zone with end_date in the past"]]}),v.jsx(de,{children:"The tombstone"}),v.jsxs("p",{children:["When a WFIGS update declares an incident closed, the bot stamps"," ",v.jsx(oe,{children:"fires.tombstoned_at"})," with the close time. The reminder scheduler treats ",v.jsx(oe,{children:"tombstoned_at IS NOT NULL"}),` as "stop broadcasting Active: for this fire," and the LLM context layer treats it as "this fire is in the closed-out archive." A subsequent FIRMS pixel inside that fire's spread radius does not re-open it — closure is authoritative from NIFC.`]}),v.jsx(de,{children:"Turning reminders off"}),v.jsxs("p",{children:["Per-adapter on/off lives in ",v.jsx(oe,{children:"adapter_meta.reminder_enabled"})," ","and is exposed on the Adapter Config page. The reminders themselves flow through the same dispatcher gates as everything else, so they still respect cooldowns, the cold-start grace window, and your notification rules."]})]}),v.jsxs(hr,{id:"notifications",title:"Notifications",children:[v.jsx(de,{children:"How It Works"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Something happens"})," — a fire is detected, weather warning issued, node goes offline, etc."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"MeshAI checks your rules"})," — does this event match any of your notification rules? Is it severe enough?"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"If a rule matches"})," — MeshAI sends the notification through whatever delivery method that rule is configured for."]})]}),v.jsx(de,{children:"Building Rules"}),v.jsx("p",{children:"Each rule answers three questions:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"WHEN"})," does it trigger? (which categories, what severity)"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"WHERE"})," does it send? (mesh broadcast, email, webhook, etc.)"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"HOW OFTEN"})," at most? (cooldown period)"]})]}),v.jsx("p",{children:'Use "Add from Template" to start with a pre-built rule and customize it, or build from scratch with "Add Rule."'}),v.jsx(de,{children:"Severity Levels — What Should I Set?"}),v.jsx(yt,{headers:["Level","When It's Used","Notification Volume"],rows:[["Info","Routine stuff (ducting detected, new router appeared)","High — lots of messages"],["Advisory","Worth knowing (weather advisory, slow traffic, battery declining)","Moderate"],["Watch","Pay attention (fire within 50km, weather watch, stream rising)","Low-moderate"],[v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Warning"})," ✓"]}),"Take action (fire within 15km, severe weather, critical battery)","Low — recommended for most rules"],["Emergency","Life safety (extreme weather, fire at infrastructure, total blackout)","Very rare"]]}),v.jsxs("p",{children:[v.jsx("strong",{children:'"Warning" is the sweet spot for most rules.'})," You get alerted when something actually needs your attention without being overwhelmed by every minor event."]}),v.jsx(de,{children:"Webhook — The Swiss Army Knife"}),v.jsx("p",{children:"A webhook sends your alert as an HTTP POST to any URL. This one delivery method works with:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Discord"})," — use a Discord webhook URL"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Slack"})," — use a Slack incoming webhook URL"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"ntfy.sh"})," — POST to ",v.jsx(oe,{children:"https://ntfy.sh/your-topic"})]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Pushover"})," — POST to the Pushover API"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Home Assistant"})," — POST to an automation webhook URL"]}),v.jsx("li",{children:"Anything else that accepts HTTP POST"})]}),v.jsx("p",{children:"MeshAI doesn't need to know what's on the other end. Give it the URL and it works."})]}),v.jsxs(hr,{id:"commands",title:"Commands",children:[v.jsxs("p",{children:["All commands use the ",v.jsx(oe,{children:"!"})," prefix (configurable). Send these as a direct message to MeshAI on your mesh."]}),v.jsx(de,{children:"Basic Commands"}),v.jsx(yt,{headers:["Command","What It Does"],rows:[[v.jsx(oe,{children:"!help"}),"Shows all available commands"],[v.jsx(oe,{children:"!ping"}),"Tests if the bot is alive"],[v.jsx(oe,{children:"!status"}),"Quick mesh summary (nodes online, health score)"],[v.jsx(oe,{children:"!health"}),"Detailed health report with pillar scores"],[v.jsx(oe,{children:"!weather"}),"Current weather for your area"]]}),v.jsx(de,{children:"Environmental Commands"}),v.jsx(yt,{headers:["Command","What It Does"],rows:[[v.jsx(oe,{children:"!alerts"}),"Active NWS weather alerts for your area"],[v.jsxs(v.Fragment,{children:[v.jsx(oe,{children:"!solar"})," (or ",v.jsx(oe,{children:"!hf"}),")"]}),"Current solar indices and RF conditions"],[v.jsx(oe,{children:"!fire"}),"Active wildfires near your mesh"],[v.jsx(oe,{children:"!avy"}),'Avalanche advisory (seasonal — shows "off season" in summer)'],[v.jsxs(v.Fragment,{children:[v.jsx(oe,{children:"!streams"})," (or ",v.jsx(oe,{children:"!gauges"}),")"]}),"Stream gauge readings"],[v.jsxs(v.Fragment,{children:[v.jsx(oe,{children:"!roads"})," (or ",v.jsx(oe,{children:"!traffic"}),")"]}),"Road conditions and traffic flow"],[v.jsx(oe,{children:"!hotspots"}),"Satellite fire detections"]]}),v.jsx(de,{children:"Subscription Commands"}),v.jsx(yt,{headers:["Command","What It Does"],rows:[[v.jsx(oe,{children:"!subscribe"}),"Lists all alert categories you can subscribe to"],[v.jsx(oe,{children:"!subscribe fire_proximity"}),"Subscribe to a specific category"],[v.jsx(oe,{children:"!subscribe all"}),"Subscribe to everything"],[v.jsx(oe,{children:"!unsubscribe fire_proximity"}),"Unsubscribe from a category"],[v.jsx(oe,{children:"!subscriptions"}),"Shows what you're currently subscribed to"]]}),v.jsx(de,{children:"Conversational"}),v.jsxs("p",{children:[`Bang commands are the short, predictable interface. For anything that doesn't map cleanly to a single command — "how's the mesh doing?", "is there any ducting?", "why didn\\'t I hear about anything today?" — you can DM the bot in plain English. The LLM DM path covers the same data the commands cover, plus the dispatcher drop audit, with honest "no data" answers when a feed is quiet. Full catalog under`," ",v.jsx("a",{href:"#llm-dm",className:"text-accent hover:underline",children:"LLM DM Queries"}),"."]})]}),v.jsxs(hr,{id:"llm-dm",title:"LLM DM (Natural-Language Queries)",children:[v.jsxs("p",{children:["Bang commands like ",v.jsx(oe,{children:"!fire"})," are short and predictable — the right tool on a mesh-constrained interface. For anything else, you can DM the bot in plain English and it will answer from the same live environmental data the broadcast pipeline uses. Both paths work; pick whichever fits the question."]}),v.jsx(de,{children:"What it can answer"}),v.jsx("p",{children:"When you DM the bot a question, the env_reporter layer assembles up to seven data blocks and injects them into the LLM's system prompt. Each block maps to one adapter:"}),v.jsx(yt,{headers:["Adapter block","Example question that hits it","What you get back"],rows:[[v.jsx(oe,{children:"build_fires_detail"}),'"are there any fires near me?"',"Active WFIGS-declared fires, acreage, containment, declared_at, county/state"],[v.jsx(oe,{children:"build_alerts_detail"}),'"any weather alerts?"',"Active NWS CAP alerts: type, severity, area, expiry"],[v.jsx(oe,{children:"build_quakes_detail"}),'"any earthquakes nearby?"',"USGS quakes in the last 24h: magnitude, depth, place"],[v.jsx(oe,{children:"build_traffic_detail"}),'"how is traffic on I-84?" / "any road closures?"',"TomTom + ITD 511 active incidents"],[v.jsx(oe,{children:"build_gauges_detail"}),'"what is the snake river level?"',"USGS NWIS latest readings + flood stages"],[v.jsx(oe,{children:"build_swpc_detail"}),'"what are the band conditions?" / "any space weather?"',"Recent SWPC events + band-conditions ratings"],[v.jsx(oe,{children:"build_drop_audit"}),`"why didn't I hear about anything today?"`,"Event log: what envelopes the dispatcher filtered, by adapter + category"]]}),v.jsx(de,{children:"The grounding rule"}),v.jsxs("p",{children:["The bot is told to answer ",v.jsx("em",{children:"only"}),' from the blocks in the system prompt. If a block is empty (no recent quakes, no active NWS alerts), the response is honest about it: "No active weather alerts right now," not a fabricated "144 earthquakes worldwide in the past 24 hours." That clamp closes the failure mode where the LLM defaulted to its training data when local tables were quiet.']}),v.jsx(de,{children:"Excluding an adapter from LLM context"}),v.jsxs("p",{children:["The ",v.jsx(oe,{children:"include_in_llm_context"})," toggle on each adapter's row in Adapter Config decides whether that adapter's ",v.jsx(oe,{children:"build_*"})," ","block lands in the system prompt. Turn an adapter off here if you don't want the bot's natural-language answers to draw on it (e.g. you ingest TomTom for situational awareness but don't want it cited in DM answers). Broadcasts are unaffected — this toggle gates LLM context only."]}),v.jsx(de,{children:"What it can't answer"}),v.jsx("p",{children:`The bot has no general internet access. Questions that need data the env_reporter doesn't carry ("what's the weather forecast tomorrow", "who's the current president") fall back to whatever the configured LLM backend knows from training. The grounding clamp keeps the bot from inventing local data, but it can't keep the LLM from speculating about non-local topics.`})]}),v.jsxs(hr,{id:"or-not-and",title:"OR-not-AND Architecture",children:[v.jsx("p",{children:"Every environmental adapter pulls its data from one of two places:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Central"})," (canonical) — Central polls the upstream feed once on behalf of the whole fleet and re-publishes normalized envelopes over NATS JetStream. MeshAI subscribes. One Central poll, one canonical normalization, many subscribers."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Native"})," — MeshAI polls the upstream feed directly. Stays around for adapters Central doesn't carry yet (currently Tropospheric Ducting and Avalanche Center advisories) and for operators who don't run Central."]})]}),v.jsx(de,{children:"Why mutually exclusive"}),v.jsxs("p",{children:["An adapter is set to ",v.jsx("strong",{children:"either"})," Central ",v.jsx("strong",{children:"or"})," ","native, never both. Running both at the same time is what the codebase calls the ",v.jsx("em",{children:"AND-mode anti-pattern"}),": two independent poll loops on the same upstream feed, duplicate broadcasts, duplicate cursor state, no shared dedup. The Spokane-class leak (cross-state broadcasts that escaped the bbox filter in May 2026) was caused by an inadvertent AND-mode on the traffic adapter; the fix made the gate enforce mutual exclusion at boot and on every config save."]}),v.jsx(de,{children:"The per-adapter source toggle"}),v.jsxs("p",{children:["Set ",v.jsx(oe,{children:"feed_source"})," on each adapter's row in Environment:"]}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"central"})," — disable the native poll loop, subscribe to the matching Central subject pattern."]}),v.jsxs("li",{children:[v.jsx(oe,{children:"native"})," — disable the Central subscription for this adapter, run the native poller."]})]}),v.jsxs("p",{children:["On the GUI, adapters with ",v.jsx("em",{children:"no Central counterpart yet"}),` show their Central button disabled with a "native only" tooltip. That's not an AND state; the adapter is still single-source, just locked to native by upstream availability.`]}),v.jsx(de,{children:"Where this surfaces in tooltips"}),v.jsxs("p",{children:[`You'll see "AND-model anti-pattern" referenced in two places: the USGS-lookup button on Gauge Sites (disabled when the USGS adapter is on Central, because doing a one-off direct USGS poll from the GUI while the runtime is on Central is precisely the AND-mode this rule forbids) and the env_routes 404 response on`," ",v.jsxs(oe,{children:["/api/env/usgs/lookup/","{site_id}"]})," in central-feed mode. Both surfaces refuse to fall back to a direct upstream call; the right answer is to enter values manually or source them from Central."]})]}),v.jsxs(hr,{id:"adapter-config",title:"Adapter Config & the CODE Rule",children:[v.jsx("p",{children:"The Adapter Config page is the single hub for ~50 GUI-editable knobs across the 13 adapters that touch the broadcast pipeline. Changes take effect on the next handler call — no container restart needed for most keys."}),v.jsx(de,{children:"The CONFIG-vs-CODE rule"}),v.jsx("p",{children:"Not everything tunable becomes a GUI row. The codebase splits along one rule:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"CONFIG"})," (lives on this page) — where you send (channels), how often (cadences, schedules), thresholds (magnitude floors, severity gates, distance radii, cooldown durations, freshness windows), curation data (which sites, states, codes), toggles (enabled, include_in_llm_context)."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"CODE"})," (stays in the handlers, not on the GUI) — sentence templates, emoji choices, mapping / translation functions (TomTom icon_map, ITD sub_type_map, Central adapter_map and category_map), rendering logic (anchor priority order, expires-buckets formatting, threshold-state labels), heuristic logic (band_conditions Kp/SFI → Good/Fair/Poor function)."]})]}),v.jsx("p",{children:"If you find yourself wanting to add a wire-string template or an emoji to the GUI, stop — that's CODE. If you want to change a threshold or a curation list, the GUI is the right place."}),v.jsx(de,{children:"Restart-required vs live"}),v.jsx("p",{children:"Most keys take effect on the next handler call (the env_store re-reads from the database). A short list requires a container restart, because they govern startup-only wiring:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Anything under the ",v.jsx(oe,{children:"environmental"})," section on the Config page (feed_source, central URL, etc.). The Spokane-fix gate runs at env_store boot and at CentralConsumer subscribe — both happen only at startup."]}),v.jsx("li",{children:"The LLM backend swap (Google → Anthropic → OpenAI)."}),v.jsx("li",{children:"The dispatcher cold-start grace window."})]}),v.jsx("p",{children:`When you save one of those keys via the GUI, a yellow Restart-Required banner surfaces at the top of the page with a "Restart now" button. Until you click it, the on-disk config and the running config intentionally disagree — that's the OR-not-AND gate refusing to transition mid-flight.`}),v.jsxs(de,{children:["The ",v.jsx(oe,{children:"include_in_llm_context"})," toggle"]}),v.jsxs("p",{children:[`Each adapter's card on Adapter Config carries a per-adapter "LLM context" switch. When off, that adapter's `,v.jsx(oe,{children:"build_*"})," ","env_reporter block is skipped during system-prompt assembly. Broadcasts are unaffected; this toggle is purely about what the LLM sees when you DM it. See the LLM DM section above for the seven adapter blocks this gates."]})]}),v.jsxs(hr,{id:"curation",title:"Curation: Gauge Sites & Town Anchors",children:[v.jsx("p",{children:"Two curation tables drive the broadcast text the bot puts on the mesh. Both are CRUD UIs with per-row enable/disable; both fall through to fallback chains when a row is missing or disabled."}),v.jsx(de,{children:"Gauge Sites"}),v.jsx("p",{children:"Stream gauge thresholds for the USGS NWIS handler. Each row pairs a USGS site_id with a human gauge name, lat/lon, and four NWS-AHPS flood thresholds in feet: Action, Minor, Moderate, Major. The handler compares an incoming gauge reading to those thresholds and emits the right broadcast severity."}),v.jsxs("p",{children:[v.jsx("strong",{children:"USGS lookup button"})," — when you add a new row in native-feed mode, the lookup queries the USGS Site Service plus NWS NWPS to auto-populate name, coordinates, and flood stages. In central-feed mode the button is disabled with a tooltip: a one-off direct USGS poll from the GUI while the runtime is on Central is the AND-mode anti-pattern the architecture forbids. Enter values manually or pull them from Central."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Disabled rows"})," are ignored at dispatch time. The corresponding gauge still ingests into ",v.jsx(oe,{children:"gauge_readings"})," ","(so historical queries still work), it just doesn't broadcast."]}),v.jsx(de,{children:"Town Anchors"}),v.jsxs("p",{children:['Lookup table for the "X mi ',"<","bearing",">"," of ","<","town",">",'" suffix in broadcast text. When a fire or NWS alert renders, the bot walks an anchor chain to figure out where to say it is:']}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsx("li",{children:'Photon nearest-town lookup (the WFIGS path uses this — produces "near Long Creek Summit Home" style anchors)'}),v.jsx("li",{children:"Town Anchors table (your curated list)"}),v.jsx("li",{children:"Landclass label (county / federal-land identifier)"}),v.jsx("li",{children:"County + state fallback"}),v.jsx("li",{children:"Bare lat/lon coords"})]}),v.jsx("p",{children:'Each row carries a name (lowercased on save), state, lat/lon, and an enable flag. The "lowercased on save" rule keeps "Almo" / "ALMO" / "almo" from being three distinct rows. Disabled rows fall through to the next anchor in the chain — the broadcast text still goes out, it just uses a different anchor.'}),v.jsxs("p",{children:["Example broadcast text rendered from a Town Anchors row:"," ",v.jsx("span",{className:"text-amber-300",children:'"🔥 New: Cache Peak Fire (WF), 3 mi N of Almo: 250 ac, 0% contained, @ 42.118,-113.643"'})]})]}),v.jsxs(hr,{id:"schema",title:"Schema Migrations",children:[v.jsxs("p",{children:["MeshAI persists state in a single SQLite database (",v.jsx(oe,{children:"/data/meshai.sqlite"}),") with WAL journaling. Schema migrations live in ",v.jsx(oe,{children:"meshai/persistence/migrations/v*.sql"})," ","and apply automatically on container start. The runner reads the migrations directory, sorts by version, and applies anything past the current ",v.jsx(oe,{children:"schema_meta.version"})," in order. Idempotent re-runs are no-ops."]}),v.jsx(de,{children:"v0.6 + v0.7 additions"}),v.jsx(yt,{headers:["Migration","What it added"],rows:[[v.jsx(oe,{children:"v11"}),"first_broadcast_at + last_broadcast_at split + reminder_enabled per adapter (the schema basis for New / Update / Active)"],[v.jsx(oe,{children:"v12"}),"fires.tombstoned_at (WFIGS closure stamp; terminates the reminder loop)"],[v.jsx(oe,{children:"v13"}),"Fire Tracker Phase 1 — fire_pixels table + spread_radius_mi + current_centroid_lat/lon + last_hotspot_at; firms_pixels attributed_at + cluster_broadcast_at"],[v.jsx(oe,{children:"v14"}),"Fire Tracker Phase 2 — fire_passes table (per-satellite-pass centroid + drift) + last_pass_id + halt_broadcast_at on fires"],[v.jsx(oe,{children:"v15"}),"Fire Tracker Phase 3 — fire_passes.perimeter_geojson (convex hull) + fires.last_spotting_broadcast_at"],[v.jsx(oe,{children:"v16"}),"Fire Tracker Phase 4 — fire_digest_broadcasts table (idempotent twice-daily LLM digest)"]]}),v.jsx(de,{children:"When migrations fail"}),v.jsxs("p",{children:["A migration failure leaves the database at the prior version and raises in the runner. Container logs surface the SQL error;"," ",v.jsx(oe,{children:"schema_meta.version"})," tells you where the last successful migration stopped. Re-running the container after the underlying issue is fixed picks up from there."]})]}),v.jsxs(hr,{id:"api",title:"API Reference",children:[v.jsxs("p",{children:["MeshAI's REST API is available at ",v.jsx(oe,{children:"http://your-host:8080"}),". All endpoints return JSON."]}),v.jsx(de,{children:"System"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/status"})," — version, uptime, node count"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/channels"})," — radio channel list"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"POST /api/restart"})," — restart the bot"]})]}),v.jsx(de,{children:"Mesh Data"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/health"})," — health score and pillars"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/nodes"})," — all nodes with positions and telemetry"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/edges"})," — neighbor links with signal quality"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/regions"})," — region summaries"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/sources"})," — data source health"]})]}),v.jsx(de,{children:"Configuration"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/config"})," — full config"]}),v.jsxs("li",{children:[v.jsxs(oe,{children:["GET /api/config/","{section}"]})," — one section"]}),v.jsxs("li",{children:[v.jsxs(oe,{children:["PUT /api/config/","{section}"]})," — update a section"]})]}),v.jsx(de,{children:"Environmental"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/status"})," — per-feed health"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/active"})," — all active events"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/swpc"})," — solar/geomagnetic data"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/ducting"})," — atmospheric profile"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/fires"})," — wildfire perimeters"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/hotspots"})," — satellite fire detections"]})]}),v.jsx(de,{children:"Alerts"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/alerts/active"})," — current alerts"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/alerts/history"})," — past alerts"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/notifications/categories"})," — available alert categories"]})]}),v.jsx(de,{children:"Real-time"}),v.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:v.jsxs("li",{children:[v.jsx(oe,{children:"ws://your-host:8080/ws/live"})," — WebSocket for live updates"]})})]})]})})]})}const Mxe=1500;function Axe(){const[e,t]=G.useState({}),[r,n]=G.useState({}),[i,a]=G.useState(!0),[o,s]=G.useState(null),[l,u]=G.useState({}),[c,h]=G.useState({}),[f,d]=G.useState({}),g=G.useCallback(async()=>{a(!0),s(null);try{const[S,T]=await Promise.all([fetch("/api/adapter-config"),fetch("/api/adapter-meta")]);if(!S.ok)throw new Error(`GET /adapter-config: ${S.status}`);if(!T.ok)throw new Error(`GET /adapter-meta: ${T.status}`);t(await S.json()),n(await T.json())}catch(S){s(String(S))}finally{a(!1)}},[]);G.useEffect(()=>{g()},[g]);const m=G.useCallback((S,T,M)=>{h(A=>({...A,[S]:T})),M&&d(A=>({...A,[S]:M})),T==="saved"&&setTimeout(()=>{h(A=>A[S]==="saved"?{...A,[S]:"idle"}:A)},Mxe)},[]),y=G.useCallback(async(S,T,M)=>{const A=`${S}.${T}`;m(A,"saving");try{const P=await fetch(`/api/adapter-config/${S}/${T}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:M})});if(!P.ok){const D=(await P.json().catch(()=>({}))).detail||P.statusText;m(A,"error",String(D));return}const I=await P.json();t(N=>({...N,[S]:(N[S]||[]).map(D=>D.key===T?I:D)})),m(A,"saved")}catch(P){m(A,"error",String(P))}},[m]),x=G.useCallback(async(S,T)=>{const M=`${S}.${T}`;m(M,"saving");try{const A=await fetch(`/api/adapter-config/${S}/${T}/reset`,{method:"POST"});if(!A.ok){m(M,"error",`reset failed (${A.status})`);return}const P=await A.json();t(I=>({...I,[S]:(I[S]||[]).map(N=>N.key===T?P:N)})),m(M,"saved")}catch(A){m(M,"error",String(A))}},[m]),_=G.useCallback(async(S,T)=>{const M=`meta:${S}`;m(M,"saving");try{const A=await fetch(`/api/adapter-meta/${S}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(!A.ok){const I=await A.json().catch(()=>({}));m(M,"error",String(I.detail||A.statusText));return}const P=await A.json();n(I=>({...I,[S]:P})),m(M,"saved")}catch(A){m(M,"error",String(A))}},[m]);if(i)return v.jsxs("div",{className:"p-6 flex items-center gap-2 text-[#777]",children:[v.jsx(Dp,{className:"w-5 h-5 animate-spin"})," Loading adapter config…"]});if(o)return v.jsxs("div",{className:"p-6 text-red-400",children:[v.jsx(Vo,{className:"w-5 h-5 inline mr-2"}),"Failed to load: ",o]});const w=Array.from(new Set([...Object.keys(r),...Object.keys(e)])).sort();return v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsxs("div",{className:"flex items-center gap-2 text-white",children:[v.jsx(BM,{className:"w-5 h-5"}),v.jsx("h1",{className:"text-xl font-semibold",children:"Adapter Config"}),v.jsxs("span",{className:"text-xs text-[#666] ml-2",children:[Object.values(e).reduce((S,T)=>S+T.length,0)," settings across ",w.length," adapters"]})]}),v.jsxs("p",{className:"text-xs text-[#777] max-w-3xl",children:["Per-adapter tunables (thresholds, freshness windows, toggles, curation lists). Changes take effect on the next handler call -- no container restart needed. Sentence templates, emoji, and translation maps live in code by design — see the CODE rule under ",v.jsx("a",{href:"/reference#adapter-config",className:"text-accent hover:underline",children:"Adapter Config & the CODE Rule"})," in Reference. The ",v.jsx("strong",{children:"LLM context"})," toggle on each card gates whether that adapter's data lands in the system prompt when you DM the bot; broadcasts are unaffected."]}),w.map(S=>{const T=r[S]||{display_name:S,include_in_llm_context:!0,description:""},M=e[S]||[],A=l[S]??!1,P=`meta:${S}`,I=c[P]||"idle";return v.jsxs("div",{className:"bg-bg-card border border-border",children:[v.jsxs("div",{className:"p-4 flex items-start gap-4",children:[v.jsx("button",{onClick:()=>u(N=>({...N,[S]:!N[S]})),className:"text-[#777] hover:text-white","aria-label":"toggle expand",children:A?v.jsx(ll,{className:"w-5 h-5"}):v.jsx(Js,{className:"w-5 h-5"})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("h2",{className:"text-base font-semibold text-white",children:T.display_name}),v.jsx("code",{className:"text-xs text-[#666]",children:S}),M.length>0&&v.jsxs("span",{className:"text-xs text-[#777] ml-1",children:["(",M.length," settings)"]}),M.length===0&&v.jsx("span",{className:"text-xs text-[#666] ml-1 italic",children:"(meta only)"})]}),T.description&&v.jsx("p",{className:"text-xs text-[#777] mt-1",children:T.description})]}),v.jsxs("label",{className:"flex items-center gap-2 text-xs text-[#e0e0e0] select-none",children:[v.jsx("input",{type:"checkbox",checked:T.include_in_llm_context,onChange:N=>_(S,{include_in_llm_context:N.target.checked}),className:"w-4 h-4 accent-[#f59e0b]"}),"LLM context",v.jsx(t7,{status:I,error:f[P]})]})]}),A&&M.length>0&&v.jsx("div",{className:"border-t border-border divide-y divide-border",children:M.map(N=>v.jsx(kxe,{row:N,status:c[`${S}.${N.key}`]||"idle",error:f[`${S}.${N.key}`],onCommit:D=>y(S,N.key,D),onReset:()=>x(S,N.key)},N.key))})]},S)})]})}function kxe({row:e,status:t,error:r,onCommit:n,onReset:i}){const[a,o]=G.useState(bS(e));G.useEffect(()=>{o(bS(e))},[e.value,e.type]);const s=a!==bS(e),l=JSON.stringify(e.value)===JSON.stringify(e.default),u=()=>{const c=Lxe(a,e.type);c.error||c.changed(e.value)&&n(c.value)};return v.jsxs("div",{className:"px-6 py-3 flex items-start gap-4",children:[v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("code",{className:"text-sm font-mono text-accent",children:e.key}),v.jsxs("span",{className:"text-xs text-[#666]",children:["[",e.type,"]"]}),!l&&v.jsx("span",{className:"text-xs text-accent",children:"edited"})]}),e.description&&v.jsx("p",{className:"text-xs text-[#777] mt-1",children:e.description})]}),v.jsxs("div",{className:"flex items-center gap-2 min-w-[280px] justify-end",children:[e.type==="bool"?v.jsx("input",{type:"checkbox",checked:e.value===!0,onChange:c=>n(c.target.checked),className:"w-5 h-5 accent-[#f59e0b]"}):e.type==="json"?v.jsx("textarea",{className:"w-72 h-20 bg-[#0d0d0d] border border-border px-2 py-1 text-xs font-mono text-white",value:a,onChange:c=>o(c.target.value),onBlur:u}):v.jsx("input",{type:e.type==="int"||e.type==="float"?"number":"text",step:e.type==="float"?"any":"1",className:"w-48 bg-[#0d0d0d] border border-border px-2 py-1 text-sm text-white",value:a,onChange:c=>o(c.target.value),onBlur:u,onKeyDown:c=>{c.key==="Enter"&&c.target.blur()}}),v.jsx(t7,{status:t,error:r,dirty:s}),v.jsx("button",{onClick:i,disabled:l,className:"text-[#777] hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",title:"Reset to default",children:v.jsx(Jx,{className:"w-4 h-4"})})]})]})}function t7({status:e,error:t,dirty:r}){return e==="saving"?v.jsx(Dp,{className:"w-4 h-4 text-accent animate-spin"}):e==="saved"?v.jsx(Za,{className:"w-4 h-4 text-green-500"}):e==="error"?v.jsx("span",{title:t,className:"text-red-400 cursor-help",children:v.jsx(Vo,{className:"w-4 h-4"})}):r?v.jsx("span",{className:"w-2 h-2 bg-accent rounded-full",title:"unsaved"}):v.jsx("span",{className:"w-4 h-4"})}function bS(e){return e.type==="bool"?String(e.value===!0):e.type==="json"?JSON.stringify(e.value,null,2):e.value===null||e.value===void 0?"":String(e.value)}function Lxe(e,t){if(t==="int"){const r=Number(e);return!Number.isFinite(r)||!Number.isInteger(r)?{error:"expected integer",value:null,changed:()=>!1}:{error:null,value:r,changed:n=>n!==r}}if(t==="float"){const r=Number(e);return Number.isFinite(r)?{error:null,value:r,changed:n=>n!==r}:{error:"expected number",value:null,changed:()=>!1}}if(t==="str")return{error:null,value:e,changed:r=>r!==e};if(t==="json")try{const r=JSON.parse(e);return{error:null,value:r,changed:n=>JSON.stringify(n)!==JSON.stringify(r)}}catch{return{error:"invalid JSON",value:null,changed:()=>!1}}return{error:null,value:e,changed:()=>!0}}const wS={site_id:"",gauge_name:"",lat:0,lon:0,action_ft:null,flood_minor_ft:null,flood_moderate_ft:null,flood_major_ft:null,enabled:!0,updated_at:0};function Nxe(){const[e,t]=G.useState([]),[r,n]=G.useState(!0),[i,a]=G.useState(null),[o,s]=G.useState(null),[l,u]=G.useState(wS),[c,h]=G.useState(!1),[f,d]=G.useState("unknown"),g=G.useCallback(async()=>{n(!0),a(null);try{const S=await fetch("/api/gauge-sites");if(!S.ok)throw new Error(`GET: ${S.status}`);t(await S.json())}catch(S){a(String(S))}finally{n(!1)}},[]);G.useEffect(()=>{g()},[g]),G.useEffect(()=>{fetch("/api/config/environmental").then(S=>S.json()).then(S=>{var T;return d(((T=S==null?void 0:S.usgs)==null?void 0:T.feed_source)||"unknown")}).catch(()=>d("unknown"))},[]);const m=S=>{s(S.site_id),u({...S}),h(!1)},y=()=>{h(!0),s(null),u({...wS})},x=()=>{s(null),h(!1),u(wS)},_=async()=>{try{const S=c?"/api/gauge-sites":`/api/gauge-sites/${o}`,M=await fetch(S,{method:c?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!M.ok){const A=await M.json().catch(()=>({}));alert(`save failed: ${A.detail||M.statusText}`);return}x(),g()}catch(S){alert(String(S))}},w=async S=>{if(!confirm(`Delete ${S}?`))return;const T=await fetch(`/api/gauge-sites/${S}`,{method:"DELETE"});if(!T.ok){alert(`delete failed: ${T.status}`);return}g()};return r?v.jsxs("div",{className:"p-6 text-slate-400",children:[v.jsx(Dp,{className:"w-5 h-5 animate-spin inline mr-2"}),"Loading…"]}):i?v.jsxs("div",{className:"p-6 text-red-400",children:["Load failed: ",i]}):v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Yx,{className:"w-5 h-5 text-accent"}),v.jsx("h1",{className:"text-xl font-semibold text-slate-100",children:"Gauge Sites"}),v.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[e.length," sites"]}),v.jsxs("button",{onClick:y,className:"ml-auto flex items-center gap-1 px-3 py-1 bg-[#f59e0b] hover:bg-[#d97706] text-black font-sans font-medium text-sm",children:[v.jsx(af,{className:"w-4 h-4"})," Add site"]})]}),v.jsx("p",{className:"text-xs text-slate-400 max-w-3xl",children:"NWS-AHPS stream gauge thresholds for the USGS NWIS handler. Each row pairs a USGS site_id with a human gauge name, lat/lon, and four flood thresholds (Action / Minor / Moderate / Major, all in feet). Disabled rows still ingest into gauge_readings -- they don't broadcast. The USGS lookup button auto-populates name + coords + thresholds from USGS Site Service + NWS NWPS when this adapter is on native feed_source; Central-feed mode disables it (see Reference → OR-not-AND for why). Changes take effect on the next event."}),c&&v.jsx(I3,{draft:l,setDraft:u,onSave:_,onCancel:x,adding:!0,feedSource:f}),v.jsx("div",{className:"bg-bg-card border border-border overflow-x-auto",children:v.jsxs("table",{className:"w-full text-sm text-slate-200",children:[v.jsx("thead",{className:"bg-[#161616] border-b border-border",children:v.jsxs("tr",{children:[v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-left",children:"Site ID"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-left",children:"Name"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-right",children:"Lat,Lon"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-right",children:"Action"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-right",children:"Minor"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-right",children:"Moderate"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-right",children:"Major"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-center",children:"On"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666]"})]})}),v.jsx("tbody",{className:"divide-y divide-border",children:e.map(S=>o===S.site_id?v.jsx("tr",{className:"bg-bg-card border-b border-border hover:bg-bg-hover",children:v.jsx("td",{colSpan:9,className:"px-3 py-2",children:v.jsx(I3,{draft:l,setDraft:u,onSave:_,onCancel:x,feedSource:f})})},S.site_id):v.jsxs("tr",{className:"hover:bg-bg-hover",children:[v.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:S.site_id}),v.jsx("td",{className:"px-3 py-2",children:S.gauge_name}),v.jsxs("td",{className:"px-3 py-2 text-right text-xs",children:[S.lat.toFixed(3),",",S.lon.toFixed(3)]}),v.jsx("td",{className:"px-3 py-2 text-right",children:S.action_ft??"-"}),v.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_minor_ft??"-"}),v.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_moderate_ft??"-"}),v.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_major_ft??"-"}),v.jsx("td",{className:"px-3 py-2 text-center",children:S.enabled?v.jsx(Za,{className:"w-4 h-4 text-emerald-400 inline"}):v.jsx(ca,{className:"w-4 h-4 text-slate-500 inline"})}),v.jsxs("td",{className:"px-3 py-2 text-right",children:[v.jsx("button",{onClick:()=>m(S),className:"text-accent hover:text-accent text-xs mr-3",children:"Edit"}),v.jsx("button",{onClick:()=>w(S.site_id),className:"text-red-400 hover:text-red-300",children:v.jsx(Ep,{className:"w-4 h-4 inline"})})]})]},S.site_id))})]})})]})}function I3({draft:e,setDraft:t,onSave:r,onCancel:n,adding:i,feedSource:a}){const o=(g,m)=>t({...e,[g]:m}),[s,l]=G.useState(!1),[u,c]=G.useState(null),h=a!=="native"||!e.site_id.trim(),f=a!=="native"?"USGS lookup not available in central-feed mode (would be AND-model anti-pattern). Enter values manually.":e.site_id.trim()?"Auto-populate from USGS / NWS NWPS":"Enter a site_id first",d=async()=>{if(!h){l(!0),c(null);try{const g=e.site_id.replace(/^USGS-/i,""),m=await fetch(`/api/env/usgs/lookup/${encodeURIComponent(g)}`);if(m.status===404){const _=await m.json().catch(()=>({}));c(_.detail||"Lookup unavailable -- enter values manually"),l(!1);return}if(!m.ok){c(`Lookup failed (${m.status})`),l(!1);return}const y=await m.json(),x={...e};y.name&&!x.gauge_name&&(x.gauge_name=y.name),typeof y.lat=="number"&&(x.lat=y.lat),typeof y.lon=="number"&&(x.lon=y.lon),typeof y.action_ft=="number"&&(x.action_ft=y.action_ft),typeof y.flood_minor_ft=="number"&&(x.flood_minor_ft=y.flood_minor_ft),typeof y.flood_moderate_ft=="number"&&(x.flood_moderate_ft=y.flood_moderate_ft),typeof y.flood_major_ft=="number"&&(x.flood_major_ft=y.flood_major_ft),t(x)}catch(g){c(String(g))}finally{l(!1)}}};return v.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 p-3 bg-[#1a1a1a]",children:[v.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Site ID",v.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[v.jsx("input",{className:"flex-1 bg-bg border border-border px-2 py-1 text-slate-100 font-mono text-xs",value:e.site_id,onChange:g=>o("site_id",g.target.value),disabled:!i}),v.jsxs("button",{type:"button",onClick:d,disabled:h||s,title:f,className:"px-2 py-1 bg-bg-hover hover:bg-[#333] disabled:opacity-30 disabled:cursor-not-allowed text-xs text-slate-100 flex items-center gap-1",children:[s?v.jsx(Dp,{className:"w-3 h-3 animate-spin"}):v.jsx(e_,{className:"w-3 h-3"}),"USGS lookup"]})]}),u&&v.jsx("span",{className:"text-amber-400 text-xs mt-1 block",children:u})]}),v.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Gauge name",v.jsx("input",{className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.gauge_name,onChange:g=>o("gauge_name",g.target.value)})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Lat",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.lat,onChange:g=>o("lat",parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Lon",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.lon,onChange:g=>o("lon",parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Action ft",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.action_ft??"",onChange:g=>o("action_ft",g.target.value===""?null:parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Minor flood ft",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.flood_minor_ft??"",onChange:g=>o("flood_minor_ft",g.target.value===""?null:parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Moderate flood ft",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.flood_moderate_ft??"",onChange:g=>o("flood_moderate_ft",g.target.value===""?null:parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Major flood ft",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.flood_major_ft??"",onChange:g=>o("flood_major_ft",g.target.value===""?null:parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-300 col-span-2 flex items-center gap-2 mt-2",children:[v.jsx("input",{type:"checkbox",checked:e.enabled,onChange:g=>o("enabled",g.target.checked),className:"accent-[#f59e0b]"}),"Enabled"]}),v.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-2 mt-2",children:[v.jsx("button",{onClick:n,className:"px-3 py-1 text-slate-300 hover:bg-bg-hover text-sm",children:"Cancel"}),v.jsx("button",{onClick:r,className:"px-3 py-1 bg-[#f59e0b] hover:bg-[#d97706] text-black font-sans font-medium text-sm",children:"Save"})]})]})}const SS={anchor_id:0,name:"",lat:0,lon:0,state:"ID",enabled:!0,updated_at:0};function Pxe(){const[e,t]=G.useState([]),[r,n]=G.useState(!0),[i,a]=G.useState(null),[o,s]=G.useState(null),[l,u]=G.useState(!1),[c,h]=G.useState(SS),f=G.useCallback(async()=>{n(!0),a(null);try{const _=await fetch("/api/town-anchors");if(!_.ok)throw new Error(`GET: ${_.status}`);t(await _.json())}catch(_){a(String(_))}finally{n(!1)}},[]);G.useEffect(()=>{f()},[f]);const d=_=>{s(_.anchor_id),h({..._}),u(!1)},g=()=>{u(!0),s(null),h({...SS})},m=()=>{s(null),u(!1),h(SS)},y=async()=>{const _=l?"/api/town-anchors":`/api/town-anchors/${o}`,S=await fetch(_,{method:l?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!S.ok){const T=await S.json().catch(()=>({}));alert(`save failed: ${T.detail||S.statusText}`);return}m(),f()},x=async _=>{if(!confirm(`Delete anchor ${_}?`))return;const w=await fetch(`/api/town-anchors/${_}`,{method:"DELETE"});if(!w.ok){alert(`delete failed: ${w.status}`);return}f()};return r?v.jsxs("div",{className:"p-6 text-slate-400",children:[v.jsx(Dp,{className:"w-5 h-5 animate-spin inline mr-2"}),"Loading…"]}):i?v.jsxs("div",{className:"p-6 text-red-400",children:["Load failed: ",i]}):v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(nf,{className:"w-5 h-5 text-accent"}),v.jsx("h1",{className:"text-xl font-semibold text-slate-100",children:"Town Anchors"}),v.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[e.length," towns"]}),v.jsxs("button",{onClick:g,className:"ml-auto flex items-center gap-1 px-3 py-1 bg-[#f59e0b] hover:bg-[#d97706] text-black font-sans font-medium text-sm",children:[v.jsx(af,{className:"w-4 h-4"})," Add town"]})]}),v.jsx("p",{className:"text-xs text-slate-400 max-w-3xl",children:`Lookup table for the "X mi of " suffix in the bot's broadcast text. When a fire or NWS alert renders, the bot walks: Photon nearest-town → this table → landclass → county/state → bare coords. Disabled rows fall through to the next anchor in the chain; the broadcast still goes out, it just uses a different anchor. Example: "3 mi N of Almo". See Reference → Curation: Gauges & Towns for the full chain.`}),l&&v.jsx(D3,{draft:c,setDraft:h,onSave:y,onCancel:m,adding:!0}),v.jsx("div",{className:"bg-bg-card border border-border overflow-x-auto",children:v.jsxs("table",{className:"w-full text-sm text-slate-200",children:[v.jsx("thead",{className:"bg-[#161616] border-b border-border",children:v.jsxs("tr",{children:[v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-left",children:"Name"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-right",children:"Lat"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-right",children:"Lon"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-center",children:"State"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-center",children:"On"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666]"})]})}),v.jsx("tbody",{className:"divide-y divide-border",children:e.map(_=>o===_.anchor_id?v.jsx("tr",{className:"bg-bg-card border-b border-border hover:bg-bg-hover",children:v.jsx("td",{colSpan:6,className:"px-3 py-2",children:v.jsx(D3,{draft:c,setDraft:h,onSave:y,onCancel:m})})},_.anchor_id):v.jsxs("tr",{className:"hover:bg-bg-hover",children:[v.jsx("td",{className:"px-3 py-2 capitalize",children:_.name}),v.jsx("td",{className:"px-3 py-2 text-right text-xs",children:_.lat.toFixed(4)}),v.jsx("td",{className:"px-3 py-2 text-right text-xs",children:_.lon.toFixed(4)}),v.jsx("td",{className:"px-3 py-2 text-center text-xs",children:_.state||"-"}),v.jsx("td",{className:"px-3 py-2 text-center",children:_.enabled?v.jsx(Za,{className:"w-4 h-4 text-emerald-400 inline"}):v.jsx(ca,{className:"w-4 h-4 text-slate-500 inline"})}),v.jsxs("td",{className:"px-3 py-2 text-right",children:[v.jsx("button",{onClick:()=>d(_),className:"text-accent hover:text-accent text-xs mr-3",children:"Edit"}),v.jsx("button",{onClick:()=>x(_.anchor_id),className:"text-red-400 hover:text-red-300",children:v.jsx(Ep,{className:"w-4 h-4 inline"})})]})]},_.anchor_id))})]})})]})}function D3({draft:e,setDraft:t,onSave:r,onCancel:n,adding:i}){const a=(o,s)=>t({...e,[o]:s});return v.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 p-3 bg-[#1a1a1a]",children:[v.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Name (lowercased on save)",v.jsx("input",{className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.name,onChange:o=>a("name",o.target.value),disabled:!i})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["State",v.jsx("input",{className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.state??"",onChange:o=>a("state",o.target.value)})]}),v.jsxs("label",{className:"text-xs text-slate-400 flex items-center gap-2",children:[v.jsx("input",{type:"checkbox",checked:e.enabled,onChange:o=>a("enabled",o.target.checked),className:"accent-[#f59e0b] mt-4"}),"Enabled"]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Lat",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.lat,onChange:o=>a("lat",parseFloat(o.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Lon",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.lon,onChange:o=>a("lon",parseFloat(o.target.value))})]}),v.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-2 mt-2",children:[v.jsx("button",{onClick:n,className:"px-3 py-1 text-slate-300 hover:bg-bg-hover text-sm",children:"Cancel"}),v.jsx("button",{onClick:r,className:"px-3 py-1 bg-[#f59e0b] hover:bg-[#d97706] text-black font-sans font-medium text-sm",children:"Save"})]})]})}function Ixe(){return v.jsx(cY,{children:v.jsx(pY,{children:v.jsxs(b$,{children:[v.jsx($i,{path:"/",element:v.jsx(CY,{})}),v.jsx($i,{path:"/mesh",element:v.jsx(V0e,{})}),v.jsx($i,{path:"/environment",element:v.jsx(hxe,{})}),v.jsx($i,{path:"/config",element:v.jsx(sxe,{})}),v.jsx($i,{path:"/alerts",element:v.jsx(xxe,{})}),v.jsx($i,{path:"/notifications",element:v.jsx(Cxe,{})}),v.jsx($i,{path:"/reference",element:v.jsx(Txe,{})}),v.jsx($i,{path:"/adapter-config",element:v.jsx(Axe,{})}),v.jsx($i,{path:"/gauge-sites",element:v.jsx(Nxe,{})}),v.jsx($i,{path:"/town-anchors",element:v.jsx(Pxe,{})})]})})})}CS.createRoot(document.getElementById("root")).render(v.jsx(Ch.StrictMode,{children:v.jsx(k$,{children:v.jsx(Ixe,{})})})); diff --git a/meshai/dashboard/static/assets/index-D7cLYkH6.js b/meshai/dashboard/static/assets/index-D7cLYkH6.js new file mode 100644 index 0000000..a45a384 --- /dev/null +++ b/meshai/dashboard/static/assets/index-D7cLYkH6.js @@ -0,0 +1,475 @@ +function V$(e,t){for(var r=0;rn[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var G$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function JA(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var AB={exports:{}},b1={},LB={exports:{}},yt={};/** + * @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 Vg=Symbol.for("react.element"),H$=Symbol.for("react.portal"),U$=Symbol.for("react.fragment"),W$=Symbol.for("react.strict_mode"),Z$=Symbol.for("react.profiler"),$$=Symbol.for("react.provider"),Y$=Symbol.for("react.context"),X$=Symbol.for("react.forward_ref"),q$=Symbol.for("react.suspense"),K$=Symbol.for("react.memo"),J$=Symbol.for("react.lazy"),JP=Symbol.iterator;function Q$(e){return e===null||typeof e!="object"?null:(e=JP&&e[JP]||e["@@iterator"],typeof e=="function"?e:null)}var kB={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},IB=Object.assign,NB={};function Kf(e,t,r){this.props=e,this.context=t,this.refs=NB,this.updater=r||kB}Kf.prototype.isReactComponent={};Kf.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")};Kf.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function PB(){}PB.prototype=Kf.prototype;function QA(e,t,r){this.props=e,this.context=t,this.refs=NB,this.updater=r||kB}var eL=QA.prototype=new PB;eL.constructor=QA;IB(eL,Kf.prototype);eL.isPureReactComponent=!0;var QP=Array.isArray,DB=Object.prototype.hasOwnProperty,tL={current:null},EB={key:!0,ref:!0,__self:!0,__source:!0};function RB(e,t,r){var n,i={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)DB.call(t,n)&&!EB.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1>>1,X=z[Z];if(0>>1;Zi(oe,W))lei(De,oe)?(z[Z]=De,z[le]=W,Z=le):(z[Z]=oe,z[J]=W,Z=J);else if(lei(De,W))z[Z]=De,z[le]=W,Z=le;else break e}}return $}function i(z,$){var W=z.sortIndex-$.sortIndex;return W!==0?W:z.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],c=1,h=null,f=3,d=!1,g=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(z){for(var $=r(u);$!==null;){if($.callback===null)n(u);else if($.startTime<=z)n(u),$.sortIndex=$.expirationTime,t(l,$);else break;$=r(u)}}function S(z){if(m=!1,w(z),!g)if(r(l)!==null)g=!0,H(T);else{var $=r(u);$!==null&&V(S,$.startTime-z)}}function T(z,$){g=!1,m&&(m=!1,_(N),N=-1),d=!0;var W=f;try{for(w($),h=r(l);h!==null&&(!(h.expirationTime>$)||z&&!D());){var Z=h.callback;if(typeof Z=="function"){h.callback=null,f=h.priorityLevel;var X=Z(h.expirationTime<=$);$=e.unstable_now(),typeof X=="function"?h.callback=X:h===r(l)&&n(l),w($)}else n(l);h=r(l)}if(h!==null)var re=!0;else{var J=r(u);J!==null&&V(S,J.startTime-$),re=!1}return re}finally{h=null,f=W,d=!1}}var M=!1,A=null,N=-1,P=5,I=-1;function D(){return!(e.unstable_now()-Iz||125Z?(z.sortIndex=W,t(u,z),r(l)===null&&z===r(u)&&(m?(_(N),N=-1):m=!0,V(S,W-Z))):(z.sortIndex=X,t(l,z),g||d||(g=!0,H(T))),z},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(z){var $=f;return function(){var W=f;f=$;try{return z.apply(this,arguments)}finally{f=W}}}})(FB);BB.exports=FB;var hY=BB.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 fY=G,hi=hY;function me(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),BT=Object.prototype.hasOwnProperty,dY=/^[: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]*$/,tD={},rD={};function vY(e){return BT.call(rD,e)?!0:BT.call(tD,e)?!1:dY.test(e)?rD[e]=!0:(tD[e]=!0,!1)}function pY(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 gY(e,t,r,n){if(t===null||typeof t>"u"||pY(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 jn(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var rn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){rn[e]=new jn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];rn[t]=new jn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){rn[e]=new jn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){rn[e]=new jn(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){rn[e]=new jn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){rn[e]=new jn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){rn[e]=new jn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){rn[e]=new jn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){rn[e]=new jn(e,5,!1,e.toLowerCase(),null,!1,!1)});var nL=/[\-:]([a-z])/g;function iL(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(nL,iL);rn[t]=new jn(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(nL,iL);rn[t]=new jn(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(nL,iL);rn[t]=new jn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){rn[e]=new jn(e,1,!1,e.toLowerCase(),null,!1,!1)});rn.xlinkHref=new jn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){rn[e]=new jn(e,1,!1,e.toLowerCase(),null,!0,!0)});function aL(e,t,r,n){var i=rn.hasOwnProperty(t)?rn[t]:null;(i!==null?i.type!==0:n||!(2s||i[o]!==a[s]){var l=` +`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{Mw=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Bv(e):""}function mY(e){switch(e.tag){case 5:return Bv(e.type);case 16:return Bv("Lazy");case 13:return Bv("Suspense");case 19:return Bv("SuspenseList");case 0:case 2:case 15:return e=Aw(e.type,!1),e;case 11:return e=Aw(e.type.render,!1),e;case 1:return e=Aw(e.type,!0),e;default:return""}}function HT(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 Bh:return"Fragment";case zh:return"Portal";case FT:return"Profiler";case oL:return"StrictMode";case VT:return"Suspense";case GT:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case HB:return(e.displayName||"Context")+".Consumer";case GB:return(e._context.displayName||"Context")+".Provider";case sL:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case lL:return t=e.displayName||null,t!==null?t:HT(e.type)||"Memo";case zs:t=e._payload,e=e._init;try{return HT(e(t))}catch{}}return null}function yY(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 HT(t);case 8:return t===oL?"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 xl(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function WB(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _Y(e){var t=WB(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 i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.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 ty(e){e._valueTracker||(e._valueTracker=_Y(e))}function ZB(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=WB(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function T_(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 UT(e,t){var r=t.checked;return ir({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function iD(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=xl(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 $B(e,t){t=t.checked,t!=null&&aL(e,"checked",t,!1)}function WT(e,t){$B(e,t);var r=xl(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")?ZT(e,t.type,r):t.hasOwnProperty("defaultValue")&&ZT(e,t.type,xl(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function aD(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 ZT(e,t,r){(t!=="number"||T_(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Fv=Array.isArray;function nf(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=ry.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Np(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var rp={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},xY=["Webkit","ms","Moz","O"];Object.keys(rp).forEach(function(e){xY.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),rp[t]=rp[e]})});function KB(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||rp.hasOwnProperty(e)&&rp[e]?(""+t).trim():t+"px"}function JB(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=KB(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var bY=ir({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 XT(e,t){if(t){if(bY[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(me(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(me(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(me(61))}if(t.style!=null&&typeof t.style!="object")throw Error(me(62))}}function qT(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 KT=null;function uL(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var JT=null,af=null,of=null;function lD(e){if(e=Ug(e)){if(typeof JT!="function")throw Error(me(280));var t=e.stateNode;t&&(t=M1(t),JT(e.stateNode,e.type,t))}}function QB(e){af?of?of.push(e):of=[e]:af=e}function eF(){if(af){var e=af,t=of;if(of=af=null,lD(e),t)for(e=0;e>>=0,e===0?32:31-(PY(e)/DY|0)|0}var ny=64,iy=4194304;function Vv(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 k_(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~i;s!==0?n=Vv(s):(a&=o,a!==0&&(n=Vv(a)))}else o=r&~i,o!==0?n=Vv(o):a!==0&&(n=Vv(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Gg(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ha(t),e[t]=r}function OY(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=ip),mD=" ",yD=!1;function xF(e,t){switch(e){case"keyup":return hX.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bF(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fh=!1;function dX(e,t){switch(e){case"compositionend":return bF(t);case"keypress":return t.which!==32?null:(yD=!0,mD);case"textInput":return e=t.data,e===mD&&yD?null:e;default:return null}}function vX(e,t){if(Fh)return e==="compositionend"||!mL&&xF(e,t)?(e=yF(),V0=vL=Ws=null,Fh=!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)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=wD(r)}}function TF(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?TF(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function MF(){for(var e=window,t=T_();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=T_(e.document)}return t}function yL(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 SX(e){var t=MF(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&TF(r.ownerDocument.documentElement,r)){if(n!==null&&yL(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 i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=SD(r,a);var o=SD(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>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=document.documentMode,Vh=null,i2=null,op=null,a2=!1;function CD(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;a2||Vh==null||Vh!==T_(n)||(n=Vh,"selectionStart"in n&&yL(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}),op&&Op(op,n)||(op=n,n=P_(i2,"onSelect"),0Uh||(e.current=h2[Uh],h2[Uh]=null,Uh--)}function Ut(e,t){Uh++,h2[Uh]=e.current,e.current=t}var bl={},xn=Dl(bl),$n=Dl(!1),tc=bl;function Sf(e,t){var r=e.type.contextTypes;if(!r)return bl;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Yn(e){return e=e.childContextTypes,e!=null}function E_(){Zt($n),Zt(xn)}function ND(e,t,r){if(xn.current!==bl)throw Error(me(168));Ut(xn,t),Ut($n,r)}function RF(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(me(108,yY(e)||"Unknown",i));return ir({},r,n)}function R_(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||bl,tc=xn.current,Ut(xn,e),Ut($n,$n.current),!0}function PD(e,t,r){var n=e.stateNode;if(!n)throw Error(me(169));r?(e=RF(e,t,tc),n.__reactInternalMemoizedMergedChildContext=e,Zt($n),Zt(xn),Ut(xn,e)):Zt($n),Ut($n,r)}var Bo=null,A1=!1,Vw=!1;function jF(e){Bo===null?Bo=[e]:Bo.push(e)}function RX(e){A1=!0,jF(e)}function El(){if(!Vw&&Bo!==null){Vw=!0;var e=0,t=Et;try{var r=Bo;for(Et=1;e>=o,i-=o,Vo=1<<32-ha(t)+i|r<N?(P=A,A=null):P=A.sibling;var I=f(_,A,w[N],S);if(I===null){A===null&&(A=P);break}e&&A&&I.alternate===null&&t(_,A),x=a(I,x,N),M===null?T=I:M.sibling=I,M=I,A=P}if(N===w.length)return r(_,A),qt&&bu(_,N),T;if(A===null){for(;NN?(P=A,A=null):P=A.sibling;var D=f(_,A,I.value,S);if(D===null){A===null&&(A=P);break}e&&A&&D.alternate===null&&t(_,A),x=a(D,x,N),M===null?T=D:M.sibling=D,M=D,A=P}if(I.done)return r(_,A),qt&&bu(_,N),T;if(A===null){for(;!I.done;N++,I=w.next())I=h(_,I.value,S),I!==null&&(x=a(I,x,N),M===null?T=I:M.sibling=I,M=I);return qt&&bu(_,N),T}for(A=n(_,A);!I.done;N++,I=w.next())I=d(A,_,N,I.value,S),I!==null&&(e&&I.alternate!==null&&A.delete(I.key===null?N:I.key),x=a(I,x,N),M===null?T=I:M.sibling=I,M=I);return e&&A.forEach(function(O){return t(_,O)}),qt&&bu(_,N),T}function y(_,x,w,S){if(typeof w=="object"&&w!==null&&w.type===Bh&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case ey:e:{for(var T=w.key,M=x;M!==null;){if(M.key===T){if(T=w.type,T===Bh){if(M.tag===7){r(_,M.sibling),x=i(M,w.props.children),x.return=_,_=x;break e}}else if(M.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===zs&&RD(T)===M.type){r(_,M.sibling),x=i(M,w.props),x.ref=tv(_,M,w),x.return=_,_=x;break e}r(_,M);break}else t(_,M);M=M.sibling}w.type===Bh?(x=Wu(w.props.children,_.mode,S,w.key),x.return=_,_=x):(S=X0(w.type,w.key,w.props,null,_.mode,S),S.ref=tv(_,x,w),S.return=_,_=S)}return o(_);case zh:e:{for(M=w.key;x!==null;){if(x.key===M)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){r(_,x.sibling),x=i(x,w.children||[]),x.return=_,_=x;break e}else{r(_,x);break}else t(_,x);x=x.sibling}x=Xw(w,_.mode,S),x.return=_,_=x}return o(_);case zs:return M=w._init,y(_,x,M(w._payload),S)}if(Fv(w))return g(_,x,w,S);if(qd(w))return m(_,x,w,S);hy(_,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(r(_,x.sibling),x=i(x,w),x.return=_,_=x):(r(_,x),x=Yw(w,_.mode,S),x.return=_,_=x),o(_)):r(_,x)}return y}var Tf=FF(!0),VF=FF(!1),z_=Dl(null),B_=null,$h=null,wL=null;function SL(){wL=$h=B_=null}function CL(e){var t=z_.current;Zt(z_),e._currentValue=t}function v2(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 lf(e,t){B_=e,wL=$h=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Zn=!0),e.firstContext=null)}function Fi(e){var t=e._currentValue;if(wL!==e)if(e={context:e,memoizedValue:t,next:null},$h===null){if(B_===null)throw Error(me(308));$h=e,B_.dependencies={lanes:0,firstContext:e}}else $h=$h.next=e;return t}var Ru=null;function TL(e){Ru===null?Ru=[e]:Ru.push(e)}function GF(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,TL(t)):(r.next=i.next,i.next=r),t.interleaved=r,is(e,n)}function is(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 Bs=!1;function ML(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function HF(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 $o(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function al(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Ct&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,is(e,r)}return i=n.interleaved,i===null?(t.next=t,TL(n)):(t.next=i.next,i.next=t),n.interleaved=t,is(e,r)}function H0(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,hL(e,r)}}function jD(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=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};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,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 F_(e,t,r,n){var i=e.updateQueue;Bs=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==o&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(a!==null){var h=i.baseState;o=0,c=u=l=null,s=a;do{var f=s.lane,d=s.eventTime;if((n&f)===f){c!==null&&(c=c.next={eventTime:d,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var g=e,m=s;switch(f=t,d=r,m.tag){case 1:if(g=m.payload,typeof g=="function"){h=g.call(d,h,f);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,f=typeof g=="function"?g.call(d,h,f):g,f==null)break e;h=ir({},h,f);break e;case 2:Bs=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else d={eventTime:d,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=d,l=h):c=c.next=d,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);ic|=o,e.lanes=o,e.memoizedState=h}}function OD(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Hw.transition;Hw.transition={};try{e(!1),t()}finally{Et=r,Hw.transition=n}}function oV(){return Vi().memoizedState}function BX(e,t,r){var n=sl(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},sV(e))lV(t,r);else if(r=GF(e,t,r,n),r!==null){var i=In();fa(r,e,n,i),uV(r,t,n)}}function FX(e,t,r){var n=sl(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(sV(e))lV(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,ma(s,o)){var l=t.interleaved;l===null?(i.next=i,TL(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=GF(e,t,i,n),r!==null&&(i=In(),fa(r,e,n,i),uV(r,t,n))}}function sV(e){var t=e.alternate;return e===rr||t!==null&&t===rr}function lV(e,t){sp=G_=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function uV(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,hL(e,r)}}var H_={readContext:Fi,useCallback:un,useContext:un,useEffect:un,useImperativeHandle:un,useInsertionEffect:un,useLayoutEffect:un,useMemo:un,useReducer:un,useRef:un,useState:un,useDebugValue:un,useDeferredValue:un,useTransition:un,useMutableSource:un,useSyncExternalStore:un,useId:un,unstable_isNewReconciler:!1},VX={readContext:Fi,useCallback:function(e,t){return za().memoizedState=[e,t===void 0?null:t],e},useContext:Fi,useEffect:BD,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,W0(4194308,4,tV.bind(null,t,e),r)},useLayoutEffect:function(e,t){return W0(4194308,4,e,t)},useInsertionEffect:function(e,t){return W0(4,2,e,t)},useMemo:function(e,t){var r=za();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=za();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=BX.bind(null,rr,e),[n.memoizedState,e]},useRef:function(e){var t=za();return e={current:e},t.memoizedState=e},useState:zD,useDebugValue:EL,useDeferredValue:function(e){return za().memoizedState=e},useTransition:function(){var e=zD(!1),t=e[0];return e=zX.bind(null,e[1]),za().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=rr,i=za();if(qt){if(r===void 0)throw Error(me(407));r=r()}else{if(r=t(),Ur===null)throw Error(me(349));nc&30||$F(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,BD(XF.bind(null,n,a,e),[e]),n.flags|=2048,Wp(9,YF.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=za(),t=Ur.identifierPrefix;if(qt){var r=Go,n=Vo;r=(n&~(1<<32-ha(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Hp++,0<\/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[Fa]=t,e[Fp]=n,_V(e,t,!1,!1),t.stateNode=e;e:{switch(o=qT(r,n),r){case"dialog":Wt("cancel",e),Wt("close",e),i=n;break;case"iframe":case"object":case"embed":Wt("load",e),i=n;break;case"video":case"audio":for(i=0;iLf&&(t.flags|=128,n=!0,rv(a,!1),t.lanes=4194304)}else{if(!n)if(e=V_(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),rv(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!qt)return cn(t),null}else 2*yr()-a.renderingStartTime>Lf&&r!==1073741824&&(t.flags|=128,n=!0,rv(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=yr(),t.sibling=null,r=tr.current,Ut(tr,n?r&1|2:r&1),t):(cn(t),null);case 22:case 23:return FL(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?ti&1073741824&&(cn(t),t.subtreeFlags&6&&(t.flags|=8192)):cn(t),null;case 24:return null;case 25:return null}throw Error(me(156,t.tag))}function XX(e,t){switch(xL(t),t.tag){case 1:return Yn(t.type)&&E_(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Mf(),Zt($n),Zt(xn),kL(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return LL(t),null;case 13:if(Zt(tr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(me(340));Cf()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Zt(tr),null;case 4:return Mf(),null;case 10:return CL(t.type._context),null;case 22:case 23:return FL(),null;case 24:return null;default:return null}}var dy=!1,pn=!1,qX=typeof WeakSet=="function"?WeakSet:Set,je=null;function Yh(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){lr(e,t,n)}else r.current=null}function S2(e,t,r){try{r()}catch(n){lr(e,t,n)}}var qD=!1;function KX(e,t){if(o2=I_,e=MF(),yL(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 i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,c=0,h=e,f=null;t:for(;;){for(var d;h!==r||i!==0&&h.nodeType!==3||(s=o+i),h!==a||n!==0&&h.nodeType!==3||(l=o+n),h.nodeType===3&&(o+=h.nodeValue.length),(d=h.firstChild)!==null;)f=h,h=d;for(;;){if(h===e)break t;if(f===r&&++u===i&&(s=o),f===a&&++c===n&&(l=o),(d=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=d}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(s2={focusedElem:e,selectionRange:r},I_=!1,je=t;je!==null;)if(t=je,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,je=e;else for(;je!==null;){t=je;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 m=g.memoizedProps,y=g.memoizedState,_=t.stateNode,x=_.getSnapshotBeforeUpdate(t.elementType===t.type?m:oa(t.type,m),y);_.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(me(163))}}catch(S){lr(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,je=e;break}je=t.return}return g=qD,qD=!1,g}function lp(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&S2(t,r,a)}i=i.next}while(i!==n)}}function I1(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 C2(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 wV(e){var t=e.alternate;t!==null&&(e.alternate=null,wV(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Fa],delete t[Fp],delete t[c2],delete t[DX],delete t[EX])),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 SV(e){return e.tag===5||e.tag===3||e.tag===4}function KD(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||SV(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 T2(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=D_));else if(n!==4&&(e=e.child,e!==null))for(T2(e,t,r),e=e.sibling;e!==null;)T2(e,t,r),e=e.sibling}function M2(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(M2(e,t,r),e=e.sibling;e!==null;)M2(e,t,r),e=e.sibling}var Xr=null,la=!1;function Ts(e,t,r){for(r=r.child;r!==null;)CV(e,t,r),r=r.sibling}function CV(e,t,r){if(Ya&&typeof Ya.onCommitFiberUnmount=="function")try{Ya.onCommitFiberUnmount(w1,r)}catch{}switch(r.tag){case 5:pn||Yh(r,t);case 6:var n=Xr,i=la;Xr=null,Ts(e,t,r),Xr=n,la=i,Xr!==null&&(la?(e=Xr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Xr.removeChild(r.stateNode));break;case 18:Xr!==null&&(la?(e=Xr,r=r.stateNode,e.nodeType===8?Fw(e.parentNode,r):e.nodeType===1&&Fw(e,r),Rp(e)):Fw(Xr,r.stateNode));break;case 4:n=Xr,i=la,Xr=r.stateNode.containerInfo,la=!0,Ts(e,t,r),Xr=n,la=i;break;case 0:case 11:case 14:case 15:if(!pn&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&S2(r,t,o),i=i.next}while(i!==n)}Ts(e,t,r);break;case 1:if(!pn&&(Yh(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){lr(r,t,s)}Ts(e,t,r);break;case 21:Ts(e,t,r);break;case 22:r.mode&1?(pn=(n=pn)||r.memoizedState!==null,Ts(e,t,r),pn=n):Ts(e,t,r);break;default:Ts(e,t,r)}}function JD(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new qX),t.forEach(function(n){var i=oq.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ta(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=yr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*QX(n/1960))-n,10e?16:e,Zs===null)var n=!1;else{if(e=Zs,Zs=null,Z_=0,Ct&6)throw Error(me(331));var i=Ct;for(Ct|=4,je=e.current;je!==null;){var a=je,o=a.child;if(je.flags&16){var s=a.deletions;if(s!==null){for(var l=0;lyr()-zL?Uu(e,0):OL|=r),Xn(e,t)}function PV(e,t){t===0&&(e.mode&1?(t=iy,iy<<=1,!(iy&130023424)&&(iy=4194304)):t=1);var r=In();e=is(e,t),e!==null&&(Gg(e,t,r),Xn(e,r))}function aq(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),PV(e,r)}function oq(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(me(314))}n!==null&&n.delete(t),PV(e,r)}var DV;DV=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||$n.current)Zn=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Zn=!1,$X(e,t,r);Zn=!!(e.flags&131072)}else Zn=!1,qt&&t.flags&1048576&&OF(t,O_,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Z0(e,t),e=t.pendingProps;var i=Sf(t,xn.current);lf(t,r),i=NL(null,t,n,e,i,r);var a=PL();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yn(n)?(a=!0,R_(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ML(t),i.updater=k1,t.stateNode=i,i._reactInternals=t,g2(t,n,e,r),t=_2(null,t,n,!0,a,r)):(t.tag=0,qt&&a&&_L(t),Tn(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Z0(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=lq(n),e=oa(n,e),i){case 0:t=y2(null,t,n,e,r);break e;case 1:t=$D(null,t,n,e,r);break e;case 11:t=WD(null,t,n,e,r);break e;case 14:t=ZD(null,t,n,oa(n.type,e),r);break e}throw Error(me(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:oa(n,i),y2(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:oa(n,i),$D(e,t,n,i,r);case 3:e:{if(gV(t),e===null)throw Error(me(387));n=t.pendingProps,a=t.memoizedState,i=a.element,HF(e,t),F_(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Af(Error(me(423)),t),t=YD(e,t,n,r,i);break e}else if(n!==i){i=Af(Error(me(424)),t),t=YD(e,t,n,r,i);break e}else for(ai=il(t.stateNode.containerInfo.firstChild),ui=t,qt=!0,ua=null,r=VF(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Cf(),n===i){t=as(e,t,r);break e}Tn(e,t,n,r)}t=t.child}return t;case 5:return UF(t),e===null&&d2(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,l2(n,i)?o=null:a!==null&&l2(n,a)&&(t.flags|=32),pV(e,t),Tn(e,t,o,r),t.child;case 6:return e===null&&d2(t),null;case 13:return mV(e,t,r);case 4:return AL(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Tf(t,null,n,r):Tn(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:oa(n,i),WD(e,t,n,i,r);case 7:return Tn(e,t,t.pendingProps,r),t.child;case 8:return Tn(e,t,t.pendingProps.children,r),t.child;case 12:return Tn(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Ut(z_,n._currentValue),n._currentValue=o,a!==null)if(ma(a.value,o)){if(a.children===i.children&&!$n.current){t=as(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=$o(-1,r&-r),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),v2(a.return,r,t),s.lanes|=r;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(me(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),v2(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Tn(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,lf(t,r),i=Fi(i),n=n(i),t.flags|=1,Tn(e,t,n,r),t.child;case 14:return n=t.type,i=oa(n,t.pendingProps),i=oa(n.type,i),ZD(e,t,n,i,r);case 15:return dV(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:oa(n,i),Z0(e,t),t.tag=1,Yn(n)?(e=!0,R_(t)):e=!1,lf(t,r),cV(t,n,i),g2(t,n,i,r),_2(null,t,n,!0,e,r);case 19:return yV(e,t,r);case 22:return vV(e,t,r)}throw Error(me(156,t.tag))};function EV(e,t){return sF(e,t)}function sq(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 Ei(e,t,r,n){return new sq(e,t,r,n)}function GL(e){return e=e.prototype,!(!e||!e.isReactComponent)}function lq(e){if(typeof e=="function")return GL(e)?1:0;if(e!=null){if(e=e.$$typeof,e===sL)return 11;if(e===lL)return 14}return 2}function ll(e,t){var r=e.alternate;return r===null?(r=Ei(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 X0(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")GL(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Bh:return Wu(r.children,i,a,t);case oL:o=8,i|=8;break;case FT:return e=Ei(12,r,t,i|2),e.elementType=FT,e.lanes=a,e;case VT:return e=Ei(13,r,t,i),e.elementType=VT,e.lanes=a,e;case GT:return e=Ei(19,r,t,i),e.elementType=GT,e.lanes=a,e;case UB:return P1(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case GB:o=10;break e;case HB:o=9;break e;case sL:o=11;break e;case lL:o=14;break e;case zs:o=16,n=null;break e}throw Error(me(130,e==null?e:typeof e,""))}return t=Ei(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Wu(e,t,r,n){return e=Ei(7,e,n,t),e.lanes=r,e}function P1(e,t,r,n){return e=Ei(22,e,n,t),e.elementType=UB,e.lanes=r,e.stateNode={isHidden:!1},e}function Yw(e,t,r){return e=Ei(6,e,null,t),e.lanes=r,e}function Xw(e,t,r){return t=Ei(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function uq(e,t,r,n,i){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=kw(0),this.expirationTimes=kw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kw(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function HL(e,t,r,n,i,a,o,s,l){return e=new uq(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Ei(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},ML(a),e}function cq(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(zV)}catch(e){console.error(e)}}zV(),zB.exports=di;var BV=zB.exports,oE=BV;zT.createRoot=oE.createRoot,zT.hydrateRoot=oE.hydrateRoot;/** + * @remix-run/router v1.23.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 $p(){return $p=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function $L(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function gq(){return Math.random().toString(36).substr(2,8)}function lE(e,t){return{usr:e.state,key:e.key,idx:t}}function N2(e,t,r,n){return r===void 0&&(r=null),$p({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ed(t):t,{state:r,key:t&&t.key||n||gq()})}function X_(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 ed(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 mq(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=$s.Pop,l=null,u=c();u==null&&(u=0,o.replaceState($p({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function h(){s=$s.Pop;let y=c(),_=y==null?null:y-u;u=y,l&&l({action:s,location:m.location,delta:_})}function f(y,_){s=$s.Push;let x=N2(m.location,y,_);u=c()+1;let w=lE(x,u),S=m.createHref(x);try{o.pushState(w,"",S)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;i.location.assign(S)}a&&l&&l({action:s,location:m.location,delta:1})}function d(y,_){s=$s.Replace;let x=N2(m.location,y,_);u=c();let w=lE(x,u),S=m.createHref(x);o.replaceState(w,"",S),a&&l&&l({action:s,location:m.location,delta:0})}function g(y){let _=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof y=="string"?y:X_(y);return x=x.replace(/ $/,"%20"),Tr(_,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,_)}let m={get action(){return s},get location(){return e(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(sE,h),l=y,()=>{i.removeEventListener(sE,h),l=null}},createHref(y){return t(i,y)},createURL:g,encodeLocation(y){let _=g(y);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:f,replace:d,go(y){return o.go(y)}};return m}var uE;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(uE||(uE={}));function yq(e,t,r){return r===void 0&&(r="/"),_q(e,t,r)}function _q(e,t,r,n){let i=typeof t=="string"?ed(t):t,a=YL(i.pathname||"/",r);if(a==null)return null;let o=FV(e);xq(o);let s=null,l=Pq(a);for(let u=0;s==null&&u{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(Tr(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=ul([n,l.relativePath]),c=r.concat(l);a.children&&a.children.length>0&&(Tr(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),FV(a.children,t,c,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:Aq(u,a.index),routesMeta:c})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of VV(a.path))i(a,o,l)}),t}function VV(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=VV(n.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function xq(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Lq(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const bq=/^:[\w-]+$/,wq=3,Sq=2,Cq=1,Tq=10,Mq=-2,cE=e=>e==="*";function Aq(e,t){let r=e.split("/"),n=r.length;return r.some(cE)&&(n+=Mq),t&&(n+=Sq),r.filter(i=>!cE(i)).reduce((i,a)=>i+(bq.test(a)?wq:a===""?Cq:Tq),n)}function Lq(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function kq(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:f,isOptional:d}=c;if(f==="*"){let m=s[h]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const g=s[h];return d&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function Nq(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),$L(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=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function Pq(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return $L(!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 YL(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 Dq=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Eq=e=>Dq.test(e);function Rq(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?ed(e):e,a;if(r)if(Eq(r))a=r;else{if(r.includes("//")){let o=r;r=UV(r),$L(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=hE(r.substring(1),"/"):a=hE(r,t)}else a=t;return{pathname:a,search:zq(n),hash:Bq(i)}}function hE(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function qw(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 and the router will parse it for you.'}function jq(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function GV(e,t){let r=jq(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function HV(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=ed(e):(i=$p({},e),Tr(!i.pathname||!i.pathname.includes("?"),qw("?","pathname","search",i)),Tr(!i.pathname||!i.pathname.includes("#"),qw("#","pathname","hash",i)),Tr(!i.search||!i.search.includes("#"),qw("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let h=t.length-1;if(!n&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;i.pathname=f.join("/")}s=h>=0?t[h]:"/"}let l=Rq(i,s),u=o&&o!=="/"&&o.endsWith("/"),c=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const UV=e=>e.replace(/\/\/+/g,"/"),ul=e=>UV(e.join("/")),Oq=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),zq=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Bq=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Fq(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const WV=["post","put","patch","delete"];new Set(WV);const Vq=["get",...WV];new Set(Vq);/** + * React Router v6.30.4 + * + * 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 Yp(){return Yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),G.useCallback(function(u,c){if(c===void 0&&(c={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let h=HV(u,JSON.parse(o),a,c.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:ul([t,h.pathname])),(c.replace?n.replace:n.push)(h,c.state,c)},[t,n,o,a,e])}function XV(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=G.useContext(Rc),{matches:i}=G.useContext(jc),{pathname:a}=td(),o=JSON.stringify(GV(i,n.v7_relativeSplatPath));return G.useMemo(()=>HV(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function Wq(e,t){return Zq(e,t)}function Zq(e,t,r,n){Zg()||Tr(!1);let{navigator:i}=G.useContext(Rc),{matches:a}=G.useContext(jc),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=td(),c;if(t){var h;let y=typeof t=="string"?ed(t):t;l==="/"||(h=y.pathname)!=null&&h.startsWith(l)||Tr(!1),c=y}else c=u;let f=c.pathname||"/",d=f;if(l!=="/"){let y=l.replace(/^\//,"").split("/");d="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let g=yq(e,{pathname:d}),m=Kq(g&&g.map(y=>Object.assign({},y,{params:Object.assign({},s,y.params),pathname:ul([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:ul([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,r,n);return t&&m?G.createElement(O1.Provider,{value:{location:Yp({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:$s.Pop}},m):m}function $q(){let e=tK(),t=Fq(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return G.createElement(G.Fragment,null,G.createElement("h2",null,"Unexpected Application Error!"),G.createElement("h3",{style:{fontStyle:"italic"}},t),r?G.createElement("pre",{style:i},r):null,null)}const Yq=G.createElement($q,null);class Xq extends G.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?G.createElement(jc.Provider,{value:this.props.routeContext},G.createElement(ZV.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function qq(e){let{routeContext:t,match:r,children:n}=e,i=G.useContext(XL);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),G.createElement(jc.Provider,{value:t},n)}function Kq(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(i=r)==null?void 0:i.errors;if(s!=null){let c=o.findIndex(h=>h.route.id&&(s==null?void 0:s[h.route.id])!==void 0);c>=0||Tr(!1),o=o.slice(0,Math.min(o.length,c+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let c=0;c=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,h,f)=>{let d,g=!1,m=null,y=null;r&&(d=s&&h.route.id?s[h.route.id]:void 0,m=h.route.errorElement||Yq,l&&(u<0&&f===0?(nK("route-fallback"),g=!0,y=null):u===f&&(g=!0,y=h.route.hydrateFallbackElement||null)));let _=t.concat(o.slice(0,f+1)),x=()=>{let w;return d?w=m:g?w=y:h.route.Component?w=G.createElement(h.route.Component,null):h.route.element?w=h.route.element:w=c,G.createElement(qq,{match:h,routeContext:{outlet:c,matches:_,isDataRoute:r!=null},children:w})};return r&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?G.createElement(Xq,{location:r.location,revalidation:r.revalidation,component:m,error:d,children:x(),routeContext:{outlet:null,matches:_,isDataRoute:!0}}):x()},null)}var qV=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(qV||{}),KV=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}(KV||{});function Jq(e){let t=G.useContext(XL);return t||Tr(!1),t}function Qq(e){let t=G.useContext(Gq);return t||Tr(!1),t}function eK(e){let t=G.useContext(jc);return t||Tr(!1),t}function JV(e){let t=eK(),r=t.matches[t.matches.length-1];return r.route.id||Tr(!1),r.route.id}function tK(){var e;let t=G.useContext(ZV),r=Qq(),n=JV();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function rK(){let{router:e}=Jq(qV.UseNavigateStable),t=JV(KV.UseNavigateStable),r=G.useRef(!1);return $V(()=>{r.current=!0}),G.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Yp({fromRouteId:t},a)))},[e,t])}const fE={};function nK(e,t,r){fE[e]||(fE[e]=!0)}function iK(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function na(e){Tr(!1)}function aK(e){let{basename:t="/",children:r=null,location:n,navigationType:i=$s.Pop,navigator:a,static:o=!1,future:s}=e;Zg()&&Tr(!1);let l=t.replace(/^\/*/,"/"),u=G.useMemo(()=>({basename:l,navigator:a,static:o,future:Yp({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=ed(n));let{pathname:c="/",search:h="",hash:f="",state:d=null,key:g="default"}=n,m=G.useMemo(()=>{let y=YL(c,l);return y==null?null:{location:{pathname:y,search:h,hash:f,state:d,key:g},navigationType:i}},[l,c,h,f,d,g,i]);return m==null?null:G.createElement(Rc.Provider,{value:u},G.createElement(O1.Provider,{children:r,value:m}))}function oK(e){let{children:t,location:r}=e;return Wq(P2(t),r)}new Promise(()=>{});function P2(e,t){t===void 0&&(t=[]);let r=[];return G.Children.forEach(e,(n,i)=>{if(!G.isValidElement(n))return;let a=[...t,i];if(n.type===G.Fragment){r.push.apply(r,P2(n.props.children,a));return}n.type!==na&&Tr(!1),!n.props.index||!n.props.children||Tr(!1);let o={id:n.props.id||a.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=P2(n.props.children,a)),r.push(o)}),r}/** + * React Router DOM v6.30.4 + * + * 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 D2(){return D2=Object.assign?Object.assign.bind():function(e){for(var t=1;t{u&&dE?dE(()=>l(h)):l(h)},[l,u]);return G.useLayoutEffect(()=>o.listen(c),[o,c]),G.useEffect(()=>iK(n),[n]),G.createElement(aK,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const vK=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",pK=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gK=G.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:c,viewTransition:h}=t,f=sK(t,cK),{basename:d}=G.useContext(Rc),g,m=!1;if(typeof u=="string"&&pK.test(u)&&(g=u,vK))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),T=YL(S.pathname,d);S.origin===w.origin&&T!=null?u=T+S.search+S.hash:m=!0}catch{}let y=Hq(u,{relative:i}),_=mK(u,{replace:o,state:s,target:l,preventScrollReset:c,relative:i,viewTransition:h});function x(w){n&&n(w),w.defaultPrevented||_(w)}return G.createElement("a",D2({},f,{href:g||y,onClick:m||a?n:x,ref:r,target:l}))});var vE;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(vE||(vE={}));var pE;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(pE||(pE={}));function mK(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=YV(),u=td(),c=XV(e,{relative:o});return G.useCallback(h=>{if(uK(h,r)){h.preventDefault();let f=n!==void 0?n:X_(u)===X_(c);l(e,{replace:f,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[u,l,c,n,i,r,e,a,o,s])}/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yK=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),QV=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var _K={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xK=G.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:o,...s},l)=>G.createElement("svg",{ref:l,..._K,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:QV("lucide",i),...s},[...o.map(([u,c])=>G.createElement(u,c)),...Array.isArray(a)?a:[a]]));/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Oe=(e,t)=>{const r=G.forwardRef(({className:n,...i},a)=>G.createElement(xK,{ref:a,iconNode:t,className:QV(`lucide-${yK(e)}`,n),...i}));return r.displayName=`${e}`,r};/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rd=Oe("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kw=Oe("Battery",[["rect",{width:"16",height:"10",x:"2",y:"7",rx:"2",ry:"2",key:"1w10f2"}],["line",{x1:"22",x2:"22",y1:"11",y2:"13",key:"4dh1rd"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bK=Oe("BellRing",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xp=Oe("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const e6=Oe("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wK=Oe("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const SK=Oe("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const CK=Oe("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const z1=Oe("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ao=Oe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rl=Oe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const TK=Oe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wl=Oe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const MK=Oe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const os=Oe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qL=Oe("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oc=Oe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const AK=Oe("CloudLightning",[["path",{d:"M6 16.326A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 .5 8.973",key:"1cez44"}],["path",{d:"m13 12-3 5h4l-3 5",key:"1t22er"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sc=Oe("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const LK=Oe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const t6=Oe("Construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kK=Oe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const r6=Oe("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const IK=Oe("Crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const n6=Oe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const B1=Oe("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kf=Oe("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const i6=Oe("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const KL=Oe("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const JL=Oe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const F1=Oe("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const NK=Oe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const PK=Oe("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const V1=Oe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const a6=Oe("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const o6=Oe("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $g=Oe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const DK=Oe("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nd=Oe("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const EK=Oe("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const QL=Oe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const G1=Oe("Mountain",[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const s6=Oe("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const id=Oe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gi=Oe("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qp=Oe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const H1=Oe("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const RK=Oe("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const U1=Oe("Satellite",[["path",{d:"M13 7 9 3 5 7l4 4",key:"vyckw6"}],["path",{d:"m17 11 4 4-4 4-4-4",key:"rchckc"}],["path",{d:"m8 12 4 4 6-6-4-4Z",key:"1sshf7"}],["path",{d:"m16 8 3-3",key:"x428zp"}],["path",{d:"M9 21a6 6 0 0 0-6-6",key:"1iajcf"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ek=Oe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const W1=Oe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const E2=Oe("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jK=Oe("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const l6=Oe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tk=Oe("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const OK=Oe("Snowflake",[["line",{x1:"2",x2:"22",y1:"12",y2:"12",key:"1dnqot"}],["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"m20 16-4-4 4-4",key:"rquw4f"}],["path",{d:"m4 8 4 4-4 4",key:"12s3z9"}],["path",{d:"m16 4-4 4-4-4",key:"1tumq1"}],["path",{d:"m8 20 4-4 4 4",key:"9p200w"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const u6=Oe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const c6=Oe("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yg=Oe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oo=Oe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zK=Oe("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const h6=Oe("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Z1=Oe("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ya=Oe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + * @license lucide-react v0.383.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const If=Oe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);async function Yi(e){const t=await fetch(e);if(!t.ok)throw new Error(`API error: ${t.status} ${t.statusText}`);return t.json()}async function gE(){return Yi("/api/status")}async function BK(){return Yi("/api/health")}async function FK(){return Yi("/api/nodes")}async function VK(){return Yi("/api/edges")}async function GK(){return Yi("/api/sources")}async function f6(){return Yi("/api/alerts/active")}async function mE(e=50,t=0,r,n){const i=new URLSearchParams;return i.set("limit",e.toString()),i.set("offset",t.toString()),r&&r!=="all"&&i.set("type",r),n&&n!=="all"&&i.set("severity",n),Yi(`/api/alerts/history?${i.toString()}`)}async function HK(){return Yi("/api/subscriptions")}async function d6(){return Yi("/api/env/status")}async function v6(){return Yi("/api/env/active")}async function UK(){return Yi("/api/env/swpc")}async function WK(){return Yi("/api/regions")}function rk(){const[e,t]=G.useState(!1),[r,n]=G.useState(null),[i,a]=G.useState(null),[o,s]=G.useState(null),l=G.useRef(null),u=G.useRef(null),c=G.useRef(1e3),h=G.useCallback(()=>{var g;if(((g=l.current)==null?void 0:g.readyState)===WebSocket.OPEN)return;const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/live`;try{const m=new WebSocket(d);l.current=m,m.onopen=()=>{t(!0),c.current=1e3},m.onmessage=_=>{try{const x=JSON.parse(_.data);switch(s(x),x.type){case"health_update":n(x.data);break;case"alert_fired":a(x.data);break}}catch(x){console.error("Failed to parse WebSocket message:",x)}},m.onclose=()=>{t(!1),l.current=null;const _=Math.min(c.current,3e4);u.current=window.setTimeout(()=>{c.current=Math.min(_*2,3e4),h()},_)},m.onerror=()=>{m.close()};const y=setInterval(()=>{m.readyState===WebSocket.OPEN&&m.send("ping")},3e4);m.addEventListener("close",()=>{clearInterval(y)})}catch(m){console.error("Failed to create WebSocket:",m)}},[]);return G.useEffect(()=>(h(),()=>{u.current&&clearTimeout(u.current),l.current&&l.current.close()}),[h]),{connected:e,lastHealth:r,lastAlert:i,lastMessage:o}}const p6=G.createContext(null);function ZK(){const e=G.useContext(p6);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}function $K(e){switch(e==null?void 0:e.toLowerCase()){case"critical":case"emergency":return{bg:"bg-red-500/10",border:"border-red-500",icon:os,iconColor:"text-red-500"};case"warning":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:oo,iconColor:"text-amber-500"};default:return{bg:"bg-sky-400/10",border:"border-sky-400",icon:V1,iconColor:"text-sky-400"}}}function YK({toast:e,onDismiss:t,onNavigate:r}){const n=$K(e.alert.severity),i=n.icon;return G.useEffect(()=>{const a=setTimeout(t,8e3);return()=>clearTimeout(a)},[t]),v.jsx("div",{className:`${n.bg} border ${n.border} shadow-lg overflow-hidden animate-slide-in cursor-pointer`,onClick:r,role:"alert",children:v.jsxs("div",{className:"flex items-start gap-3 p-4",children:[v.jsx("div",{className:`w-1 self-stretch -ml-4 -my-4 ${n.border.replace("border","bg")}`}),v.jsx(i,{size:18,className:n.iconColor}),v.jsxs("div",{className:"flex-1 min-w-0 pr-2",children:[v.jsx("div",{className:"text-sm font-medium text-slate-200 mb-0.5",children:e.alert.type.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}),v.jsx("div",{className:"text-sm text-slate-300 line-clamp-2",children:e.alert.message})]}),v.jsx("button",{onClick:a=>{a.stopPropagation(),t()},className:"text-slate-400 hover:text-slate-200 transition-colors",children:v.jsx(ya,{size:16})})]})})}function XK({children:e}){const[t,r]=G.useState([]),n=YV(),i=G.useCallback(s=>{const l=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(u=>[...u,{id:l,alert:s}])},[]),a=G.useCallback(s=>{r(l=>l.filter(u=>u.id!==s))},[]),o=G.useCallback(()=>{n("/alerts")},[n]);return v.jsxs(p6.Provider,{value:{addToast:i},children:[e,v.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none",children:t.map(s=>v.jsx("div",{className:"pointer-events-auto",children:v.jsx(YK,{toast:s,onDismiss:()=>a(s.id),onNavigate:o})},s.id))})]})}const $1="meshai.restartRequired.v1";function yE(){try{const e=localStorage.getItem($1);if(!e)return{required:!1,changedKeys:[],ts:0};const t=JSON.parse(e);return{required:!!t.required,changedKeys:Array.isArray(t.changedKeys)?t.changedKeys:[],ts:Number(t.ts)||0}}catch{return{required:!1,changedKeys:[],ts:0}}}function qK(e){const t={required:!0,changedKeys:[...new Set(e)],ts:Date.now()};localStorage.setItem($1,JSON.stringify(t)),window.dispatchEvent(new CustomEvent("meshai:restart-required",{detail:t}))}function _E(){localStorage.removeItem($1),window.dispatchEvent(new CustomEvent("meshai:restart-required",{detail:{required:!1,changedKeys:[],ts:0}}))}function KK(){const[e,t]=G.useState(()=>yE()),[r,n]=G.useState(!1),[i,a]=G.useState(null);G.useEffect(()=>{const l=c=>{const h=c.detail;t(h)},u=c=>{c.key===$1&&t(yE())};return window.addEventListener("meshai:restart-required",l),window.addEventListener("storage",u),()=>{window.removeEventListener("meshai:restart-required",l),window.removeEventListener("storage",u)}},[]);const o=G.useCallback(async()=>{n(!0),a(null);try{const l=await fetch("/api/system/restart",{method:"POST"});if(!l.ok&&l.status!==202){const u=await l.json().catch(()=>({}));throw new Error(u.detail||`HTTP ${l.status}`)}_E()}catch(l){a(String(l)),n(!1)}},[]),s=G.useCallback(()=>{_E()},[]);return e.required?v.jsxs("div",{className:"bg-yellow-900/40 border-b border-yellow-700 text-yellow-100 px-4 py-2 text-sm flex items-center gap-3",children:[v.jsx(oo,{className:"w-4 h-4 flex-shrink-0 text-yellow-300"}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("strong",{children:"Container restart required"}),e.changedKeys.length>0&&v.jsxs("span",{className:"text-yellow-300 ml-2",children:["(",e.changedKeys.length," key",e.changedKeys.length===1?"":"s",":"," ",v.jsxs("span",{className:"font-mono text-xs",children:[e.changedKeys.slice(0,3).join(", "),e.changedKeys.length>3?", …":""]}),")"]}),v.jsx("span",{className:"ml-2 text-yellow-300/80",children:"for these changes to take effect. Until then the runtime keeps its boot-time configuration. Restart-required keys include anything under Config → environmental (feed_source, central URL), the LLM backend swap, and the dispatcher cold-start grace window. Other keys take effect on the next handler call."}),i&&v.jsx("div",{className:"text-red-400 text-xs mt-1",children:i})]}),v.jsxs("button",{onClick:o,disabled:r,className:"flex items-center gap-1 px-3 py-1 bg-yellow-700 hover:bg-yellow-600 disabled:opacity-50 rounded text-white text-xs",children:[v.jsx(RK,{className:`w-3 h-3 ${r?"animate-spin":""}`}),r?"Restarting…":"Restart now"]}),v.jsx("button",{onClick:s,className:"text-yellow-300 hover:text-white px-1",title:"Dismiss (you can still restart later)",children:v.jsx(ya,{className:"w-4 h-4"})})]}):null}const g6=[{path:"/",label:"Dashboard",icon:o6},{path:"/mesh",label:"Mesh",icon:Gi},{path:"/environment",label:"Environment",icon:sc},{path:"/config",label:"Config",icon:l6},{path:"/alerts",label:"Alerts",icon:Xp},{path:"/notifications",label:"Notifications",icon:bK},{path:"/reference",label:"Reference",icon:e6},{path:"/adapter-config",label:"Adapter Config",icon:tk},{path:"/gauge-sites",label:"Gauge Sites",icon:B1},{path:"/town-anchors",label:"Town Anchors",icon:nd}];function JK(e){const t=Math.floor(e/86400),r=Math.floor(e%86400/3600),n=Math.floor(e%3600/60);return t>0?`${t}d ${r}h`:r>0?`${r}h ${n}m`:`${n}m`}function QK(e){const t=g6.find(r=>r.path===e);return(t==null?void 0:t.label)||"Dashboard"}function eJ({children:e}){var f;const t=td(),{connected:r,lastAlert:n}=rk(),{addToast:i}=ZK(),[a,o]=G.useState(null),[s,l]=G.useState(null);G.useEffect(()=>{if(n){const d=`${n.type}-${n.message}-${n.timestamp}`;d!==s&&(l(d),i(n))}},[n,s,i]);const[u,c]=G.useState(new Date);G.useEffect(()=>{gE().then(o).catch(console.error);const d=setInterval(()=>{gE().then(o).catch(console.error)},3e4);return()=>clearInterval(d)},[]),G.useEffect(()=>{const d=setInterval(()=>c(new Date),1e3);return()=>clearInterval(d)},[]);const h=u.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return v.jsxs("div",{className:"flex h-screen overflow-hidden bg-bg text-white",children:[v.jsxs("aside",{className:"w-[220px] flex-shrink-0 bg-bg-card border-r border-border flex flex-col overflow-y-auto",children:[v.jsxs("div",{className:"bg-[#000000] px-4 py-3 border-b border-border flex flex-col items-center",children:[v.jsx("img",{src:"/meshai-logo.png",alt:"MeshAI",className:"w-[190px] block"}),v.jsxs("div",{className:"font-mono text-[10px] text-[#555] mt-1 self-start",children:["v",(a==null?void 0:a.version)||"..."]})]}),v.jsx("nav",{className:"flex-1 py-4",children:g6.map(d=>{const g=t.pathname===d.path,m=d.icon;return v.jsxs(gK,{to:d.path,className:`flex items-center gap-3 px-5 py-3 text-sm font-sans transition-colors relative ${g?"text-white bg-transparent":"text-[#777] hover:text-white hover:bg-bg-hover"}`,children:[g&&v.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-[2px] bg-[#f59e0b]"}),v.jsx(m,{size:16}),d.label]},d.path)})}),v.jsxs("div",{className:"p-5 border-t border-border",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${a!=null&&a.connected?"bg-green-500":"bg-red-500"}`}),v.jsx("span",{className:"text-xs font-sans text-[#777]",children:a!=null&&a.connected?"Connected":"Disconnected"})]}),v.jsxs("div",{className:"text-xs font-mono text-[#666] truncate",children:[(f=a==null?void 0:a.connection_type)==null?void 0:f.toUpperCase(),": ",a==null?void 0:a.connection_target]}),v.jsxs("div",{className:"text-xs font-sans text-[#666] mt-1",children:["Uptime: ",v.jsx("span",{className:"font-mono",children:a?JK(a.uptime_seconds):"..."})]})]})]}),v.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v.jsxs("header",{className:"h-14 flex-shrink-0 border-b border-border bg-bg-card flex items-center justify-between px-6",children:[v.jsx("h1",{className:"text-lg font-sans font-semibold text-white",children:QK(t.pathname)}),v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${r?"bg-accent animate-pulse-slow":"bg-[#333]"}`}),v.jsx("span",{className:"text-xs font-sans text-[#777]",children:r?"Live":"Offline"})]}),v.jsxs("div",{className:"text-sm font-mono text-[#666]",children:[h," MT"]})]})]}),v.jsxs("main",{className:"flex-1 overflow-y-auto p-6",children:[v.jsx(KK,{}),e]})]})]})}function tJ({health:e}){const t=e.score,r=e.tier,n=2*Math.PI*45,i=t/100*n;return v.jsx("div",{className:"flex flex-col items-center",children:v.jsxs("svg",{width:"140",height:"140",viewBox:"0 0 100 100",children:[v.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"#1e1e1e",strokeWidth:"8"}),v.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"#f59e0b",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:n,strokeDashoffset:n-i,transform:"rotate(-90 50 50)",className:"transition-all duration-500"}),v.jsx("text",{x:"50",y:"46",textAnchor:"middle",className:"font-mono font-bold",style:{fontSize:"24px",fill:"#f59e0b"},children:t.toFixed(1)}),v.jsx("text",{x:"50",y:"62",textAnchor:"middle",className:"font-sans",style:{fontSize:"10px",fill:"#444"},children:r})]})})}function iv({label:e,value:t}){const r=n=>n>66?"bg-accent":n>33?"bg-accent-dim":"bg-red-500";return v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-24 text-xs font-sans text-[#777] truncate",children:e}),v.jsx("div",{className:"flex-1 h-2 bg-border overflow-hidden",children:v.jsx("div",{className:`h-full ${r(t)} transition-all duration-300`,style:{width:`${t}%`}})}),v.jsx("div",{className:"w-12 text-right text-xs font-mono text-[#e0e0e0]",children:t.toFixed(1)})]})}function rJ({alert:e}){const r=(i=>{switch(i.toLowerCase()){case"critical":case"emergency":case"immediate":return{bg:"bg-red-500/5",border:"border-red-500",icon:os,iconColor:"text-red-500"};case"warning":case"priority":return{bg:"bg-accent/5",border:"border-accent",icon:oo,iconColor:"text-accent"};case"routine":default:return{bg:"bg-[#161616]",border:"border-[#333]",icon:V1,iconColor:"text-[#777]"}}})(e.severity),n=r.icon;return v.jsxs("div",{className:`p-3 ${r.bg} border-l-2 ${r.border} flex items-start gap-3`,children:[v.jsx(n,{size:16,className:r.iconColor}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"text-sm font-sans font-medium text-white",children:e.message}),v.jsx("div",{className:"text-[10px] font-mono text-[#666] mt-1",children:e.timestamp||"Just now"})]})]})}function nJ({source:e}){const t=()=>e.is_loaded?e.last_error?"bg-accent":"bg-green-500":"bg-red-500";return v.jsxs("div",{className:"flex items-center gap-3 p-2 bg-bg-hover",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${t()}`}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"text-sm font-sans font-medium text-white truncate",children:e.name}),v.jsxs("div",{className:"text-[10px] font-sans text-[#666]",children:[e.node_count," nodes · ",e.type]})]})]})}function gy({icon:e,label:t,value:r,subvalue:n,accent:i}){return v.jsxs("div",{className:"bg-bg-card border border-border p-3",style:i?{borderTopWidth:"2px",borderTopColor:i}:void 0,children:[v.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[v.jsx(e,{size:14,style:{color:i||"#333"}}),v.jsx("span",{className:"text-[9px] font-sans uppercase tracking-widest text-[#666]",children:t})]}),v.jsx("div",{className:"font-mono text-xl",style:{color:i||"#e0e0e0"},children:r}),n&&v.jsx("div",{className:"text-[9px] font-sans mt-1 text-[#666]",children:n})]})}function iJ({bandConditions:e}){const t=a=>{switch(a){case"Good":return"bg-green-500";case"Fair":return"bg-accent";case"Poor":return"bg-red-500";default:return"bg-[#333]"}},r=a=>{switch(a){case"Good":return"text-green-500";case"Fair":return"text-accent";case"Poor":return"text-red-500";default:return"text-[#666]"}},n=a=>a?a.includes("Night")?"🌙":"☀️":"";if(!(e!=null&&e.enabled)||!(e!=null&&e.ratings))return v.jsxs("div",{className:"bg-bg-card border border-border p-4 flex flex-col h-full",children:[v.jsxs("h2",{className:"text-[10px] font-sans uppercase tracking-widest text-[#666] mb-3 flex items-center gap-2",children:[v.jsx(If,{size:14}),"RF Propagation"]}),v.jsx("div",{className:"flex-1 flex items-center justify-center",children:v.jsx("div",{className:"text-center py-8",children:v.jsx("div",{className:"font-sans text-[#666]",children:"No band conditions data"})})})]});const i=["80-40m","30-20m","17-15m","12-10m"];return v.jsxs("div",{className:"bg-bg-card border border-border p-4 flex flex-col h-full",children:[v.jsxs("h2",{className:"text-[10px] font-sans uppercase tracking-widest text-[#666] mb-3 flex items-center gap-2",children:[v.jsx(If,{size:14}),"RF Propagation"]}),v.jsxs("div",{className:"text-center mb-3",children:[v.jsx("span",{className:"text-lg",children:n(e.slot_label)}),v.jsx("span",{className:"text-sm font-sans text-[#777] ml-2",children:e.slot_label})]}),v.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-[#666] mb-2 flex items-center gap-1",children:"📡 Band Conditions"}),v.jsx("div",{className:"space-y-1.5",children:i.map(a=>{var s;const o=(s=e.ratings)==null?void 0:s[a];return v.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 bg-bg-hover",children:[v.jsx("span",{className:"text-sm font-mono text-[#777]",children:a}),v.jsxs("span",{className:"text-sm flex items-center gap-2",children:[v.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${t(o)}`}),v.jsx("span",{className:`font-sans ${r(o)}`,children:o||"—"})]})]},a)})}),v.jsxs("div",{className:"mt-auto pt-3 border-t border-border text-[10px] font-sans text-[#666]",children:[e.source&&v.jsx("span",{children:e.source==="swpc_local"?"SWPC":"HamQSL"}),e.sent_at&&v.jsx("span",{className:"font-mono ml-2",children:new Date(e.sent_at*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}const xE=[{code:"wam",label:"Western North America"},{code:"eam",label:"Eastern North America"},{code:"enp",label:"Eastern North Pacific"},{code:"esp",label:"Eastern South Pacific"},{code:"gca",label:"Gulf-Caribbean"},{code:"nsa",label:"Northern South America"},{code:"csa",label:"Central South America"},{code:"sat",label:"South Atlantic"},{code:"nat",label:"North Atlantic"},{code:"ena",label:"Eastern North Atlantic"},{code:"nwe",label:"Northwestern Europe"},{code:"eur",label:"Europe"},{code:"eeu",label:"Eastern Europe"},{code:"saf",label:"South Africa"},{code:"mde",label:"Middle East"},{code:"nca",label:"North Central Asia"},{code:"ind",label:"Indian Ocean"},{code:"sea",label:"Southeast Asia"},{code:"fea",label:"Far East"},{code:"esi",label:"Eastern Siberia"},{code:"anz",label:"Australia & New Zealand"},{code:"oce",label:"Oceania"},{code:"wnp",label:"Western North Pacific"}];function aJ(){var c;const[e,t]=G.useState("wam"),[r,n]=G.useState(!1),[i,a]=G.useState(!1);G.useEffect(()=>{fetch("/api/adapter-config/dashboard/tropo_region").then(h=>h.ok?h.json():null).then(h=>{h!=null&&h.value&&typeof h.value=="string"&&t(h.value)}).catch(()=>{})},[]);const o=h=>{t(h),n(!1),a(!0),fetch("/api/adapter-config/dashboard/tropo_region",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:h})}).catch(()=>{}).finally(()=>a(!1))},s=new Date().toISOString().slice(0,10).replace(/-/g,""),l=`https://www.dxinfocentre.com/tr_map/fcst/${e}006.png?v${s}`,u=((c=xE.find(h=>h.code===e))==null?void 0:c.label)||e;return v.jsxs("div",{className:"bg-bg-card border border-border p-4 flex flex-col",children:[v.jsxs("div",{className:"flex items-center justify-between mb-3",children:[v.jsxs("h2",{className:"text-[10px] font-sans uppercase tracking-widest text-[#666] flex items-center gap-2",children:[v.jsx(Gi,{size:14}),"Tropo Forecast (Hepburn)"]}),v.jsxs("div",{className:"flex items-center gap-2",children:[i&&v.jsx("span",{className:"text-xs font-sans text-[#666]",children:"saving..."}),v.jsx("select",{value:e,onChange:h=>o(h.target.value),className:"text-xs font-sans bg-bg-hover border border-border px-2 py-1 min-h-[36px] text-[#e0e0e0] focus:outline-none focus:border-accent",children:xE.map(h=>v.jsx("option",{value:h.code,children:h.label},h.code))})]})]}),v.jsxs("div",{className:"text-xs font-sans text-[#666] mb-2",children:[u," — 6-day forecast"]}),r?v.jsx("div",{className:"flex items-center justify-center h-48 text-[#666] text-sm font-sans",children:"Failed to load forecast image"}):v.jsx("img",{src:l,alt:`Hepburn tropo forecast — ${u}`,className:"w-full border border-border",onError:()=>n(!0)}),v.jsxs("div",{className:"text-[10px] font-sans text-[#666] mt-2",children:["Source: ",v.jsx("a",{href:"https://www.dxinfocentre.com/tropo.html",target:"_blank",rel:"noopener noreferrer",className:"text-sky-400 hover:text-sky-300",children:"dxinfocentre.com"})]})]})}const oJ={nws:{icon:sc,color:"text-sky-400",label:"NWS"},swpc:{icon:u6,color:"text-accent",label:"SWPC"},ducting:{icon:Gi,color:"text-sky-500",label:"Tropo"},nifc:{icon:F1,color:"text-red-500",label:"NIFC"},firms:{icon:U1,color:"text-red-400",label:"FIRMS"},avalanche:{icon:G1,color:"text-[#777]",label:"Avy"},usgs:{icon:B1,color:"text-sky-400",label:"USGS"},traffic:{icon:z1,color:"text-[#777]",label:"Traffic"},roads:{icon:t6,color:"text-accent-dim",label:"511"}},bE={routine:"bg-[#1e1e1e] text-[#777] border-[#222]",priority:"bg-accent/5 text-accent border-accent/30",immediate:"bg-red-500/5 text-red-500 border-red-500/30",info:"bg-sky-400/10 text-sky-400 border-sky-400/30",advisory:"bg-sky-400/10 text-sky-400 border-sky-400/30",moderate:"bg-accent/5 text-accent-dim border-accent-dim/30",watch:"bg-accent/5 text-accent border-accent/30",warning:"bg-accent/5 text-accent border-accent/30",severe:"bg-red-500/5 text-red-500 border-red-500/30",extreme:"bg-red-500/5 text-red-500 border-red-500/30",critical:"bg-red-500/5 text-red-500 border-red-500/30",emergency:"bg-red-500/5 text-red-500 border-red-500/30"};function sJ({event:e,isLocal:t}){var h;const r=oJ[e.source]||{icon:V1,color:"text-[#777]",label:e.source},n=r.icon,i=bE[(h=e.severity)==null?void 0:h.toLowerCase()]||bE.info,a=f=>{const d=new Date(f*1e3),m=new Date().getTime()-d.getTime(),y=Math.floor(m/6e4);return y<1?"just now":y<60?`${y}m ago`:y<1440?`${Math.floor(y/60)}h ago`:d.toLocaleDateString(void 0,{month:"short",day:"numeric"})},o=e.event_type,s=e.area_desc,l=e.description;let u=e.headline;if(o&&s){const f=s.replace(/ County/g,"").split(";")[0];u=`${o} — ${f}`}else o&&(u=o);const c=l?l.split(". ")[0]:null;return v.jsxs("div",{className:`flex items-start gap-2 py-2 border-b border-border/50 last:border-0 ${t?"border-l-2 border-l-accent pl-2 -ml-2":""}`,children:[v.jsx(n,{size:14,className:`mt-0.5 flex-shrink-0 ${r.color}`}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[v.jsx("span",{className:`px-1.5 py-0.5 text-[10px] font-sans uppercase tracking-wide border ${i}`,children:e.severity||"info"}),t&&v.jsx("span",{className:"px-1.5 py-0.5 text-[10px] font-sans uppercase tracking-wide bg-accent/5 text-accent border border-accent/30",title:"LOCAL: event coordinates fall inside the mesh's monitoring area (per the adapter's bbox config on Environment) — operators in this region are directly affected.",children:"LOCAL"}),v.jsx("span",{className:"text-[10px] font-sans text-[#666]",children:r.label}),v.jsx("span",{className:"text-[10px] font-mono text-[#666] ml-auto",children:a(e.fetched_at)})]}),v.jsx("div",{className:`text-sm font-sans font-medium truncate ${t?"text-white":"text-[#e0e0e0]"}`,children:u}),c&&v.jsx("div",{className:"text-[10px] font-sans text-[#666] truncate mt-0.5",children:c})]})]})}function lJ({events:e,envStatus:t,embedded:r}){const n={immediate:0,priority:1,routine:2},i=G.useMemo(()=>{const s=new Set;return e.filter(u=>u.event_id?s.has(u.event_id)?!1:(s.add(u.event_id),!0):!0).sort((u,c)=>{var m,y;const h=u.is_local?1:0,f=c.is_local?1:0;if(h!==f)return f-h;const d=n[((m=u.severity)==null?void 0:m.toLowerCase())||"routine"]??2,g=n[((y=c.severity)==null?void 0:y.toLowerCase())||"routine"]??2;return d!==g?d-g:(c.fetched_at||0)-(u.fetched_at||0)})},[e]),a=G.useMemo(()=>{if(!(t!=null&&t.feeds))return null;const s=t.feeds.length,l=t.feeds.filter(f=>f.is_loaded&&!f.last_error).length,u=t.feeds.filter(f=>f.last_error).map(f=>f.source),c=Math.max(...t.feeds.map(f=>f.last_fetch||0)),h=c?Math.floor(Date.now()/1e3-c):null;return{total:s,active:l,errors:u,secAgo:h}},[t]),o=v.jsxs(v.Fragment,{children:[i.length>0?v.jsx("div",{className:"flex-1 overflow-y-auto max-h-80 pr-1 -mr-1",children:i.map((s,l)=>v.jsx(sJ,{event:s,isLocal:s.is_local},s.event_id||l))}):v.jsx("div",{className:"flex-1 flex items-center justify-center",children:v.jsxs("div",{className:"text-center py-8",children:[v.jsx(qL,{size:24,className:"text-green-500 mx-auto mb-2"}),v.jsx("div",{className:"font-sans text-[#777]",children:"No active events"}),v.jsx("div",{className:"text-[10px] font-sans text-[#666]",children:"All clear"})]})}),a&&v.jsxs("div",{className:`text-[10px] font-sans mt-3 pt-3 border-t border-border ${a.errors.length>0?"text-red-500":"text-[#666]"}`,children:[v.jsx("span",{className:"font-mono",children:a.active})," of ",v.jsx("span",{className:"font-mono",children:a.total})," feeds active",a.secAgo!==null&&v.jsxs(v.Fragment,{children:[" · Last update ",v.jsxs("span",{className:"font-mono",children:[a.secAgo,"s"]})," ago"]}),a.errors.length>0&&v.jsxs("span",{className:"text-red-500",children:[" · ",a.errors.join(", "),": error"]})]})]});return r?v.jsx("div",{className:"flex flex-col h-full",children:o}):v.jsxs("div",{className:"bg-bg-card border border-border p-4 flex flex-col h-full",children:[v.jsxs("h2",{className:"text-[10px] font-sans uppercase tracking-widest text-[#666] mb-3 flex items-center gap-2",children:[v.jsx(rd,{size:14}),"Live Event Feed"]}),o]})}function uJ(){var S,T,M,A,N,P;const[e,t]=G.useState(null),[r,n]=G.useState([]),[i,a]=G.useState([]),[o,s]=G.useState(null),[l,u]=G.useState([]),[c,h]=G.useState(null),[f,d]=G.useState("alerts"),[g,m]=G.useState(!0),[y,_]=G.useState(null),{lastHealth:x,lastMessage:w}=rk();return G.useEffect(()=>{Promise.all([BK(),GK(),f6(),d6(),v6().catch(()=>[]),UK().catch(()=>null)]).then(([I,D,O,j,B,U])=>{t(I),n(D),a(O),s(j),u(B),h(U),m(!1),document.title="Dashboard — MeshAI"}).catch(I=>{_(I.message),m(!1),document.title="Dashboard — MeshAI"})},[]),G.useEffect(()=>{x&&t(x)},[x]),G.useEffect(()=>{(w==null?void 0:w.type)==="env_update"&&w.event&&u(I=>{const D=w.event,O=I.filter(j=>j.event_id!==D.event_id);return[D,...O].slice(0,100)})},[w]),g?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"font-sans text-[#777]",children:"Loading..."})}):y?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsxs("div",{className:"font-sans text-red-500",children:["Error: ",y]})}):v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[v.jsxs("div",{className:"bg-bg-card border border-border p-4",children:[v.jsx("h2",{className:"text-[10px] font-sans uppercase tracking-widest text-[#666] mb-3",children:"Mesh Health"}),e&&v.jsxs(v.Fragment,{children:[v.jsx(tJ,{health:e}),v.jsxs("div",{className:"mt-4 space-y-2",children:[v.jsx(iv,{label:"Infrastructure",value:((S=e.pillars)==null?void 0:S.infrastructure)??0}),v.jsx(iv,{label:"Utilization",value:((T=e.pillars)==null?void 0:T.utilization)??0}),v.jsx(iv,{label:"Coverage",value:((M=e.pillars)==null?void 0:M.coverage)??0}),v.jsx(iv,{label:"Behavior",value:((A=e.pillars)==null?void 0:A.behavior)??0}),v.jsx(iv,{label:"Power",value:((N=e.pillars)==null?void 0:N.power)??0})]})]})]}),v.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[v.jsxs("div",{className:"bg-bg-card border border-border p-4",children:[v.jsxs("div",{className:"flex items-center gap-4 mb-3 border-b border-border",children:[v.jsx("button",{onClick:()=>d("alerts"),className:`py-2.5 -mb-px text-[10px] font-sans uppercase tracking-widest transition-colors border-b ${f==="alerts"?"border-accent text-white":"border-transparent text-[#777]"}`,children:"Active Alerts"}),v.jsx("button",{onClick:()=>d("feed"),className:`py-2.5 -mb-px text-[10px] font-sans uppercase tracking-widest transition-colors border-b ${f==="feed"?"border-accent text-white":"border-transparent text-[#777]"}`,children:"Event Feed"})]}),f==="alerts"?v.jsx(v.Fragment,{children:i.length>0?v.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:i.map((I,D)=>v.jsx(rJ,{alert:I},D))}):(()=>{const I=l.filter(D=>D.severity==="immediate"||D.severity==="priority").sort((D,O)=>{const j={immediate:0,priority:1},B=(j[D.severity]??2)-(j[O.severity]??2);return B!==0?B:(O.fetched_at||0)-(D.fetched_at||0)}).slice(0,5);return I.length>0?v.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:I.map((D,O)=>{const j=D.severity==="immediate"?{bg:"bg-red-500/5",border:"border-red-500",icon:os,iconColor:"text-red-500"}:{bg:"bg-accent/5",border:"border-accent",icon:oo,iconColor:"text-accent"},B=j.icon;return v.jsxs("div",{className:`p-3 ${j.bg} border-l-2 ${j.border} flex items-start gap-3`,children:[v.jsx(B,{size:16,className:j.iconColor}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"px-1.5 py-0.5 text-[10px] font-sans uppercase tracking-wide bg-[#1e1e1e] text-[#777] border border-[#222]",children:"ENV"}),v.jsx("span",{className:"text-[10px] font-sans text-[#666]",children:D.severity})]}),v.jsx("div",{className:"text-sm font-sans font-medium text-white mt-1",children:D.headline}),v.jsxs("div",{className:"text-[10px] font-mono text-[#666] mt-1",children:[D.source," · ",new Date(D.fetched_at*1e3).toLocaleTimeString()]})]})]},D.event_id||O)})}):v.jsxs("div",{className:"flex items-center gap-2 text-[#777] py-4",children:[v.jsx(qL,{size:16,className:"text-green-500"}),v.jsx("span",{className:"font-sans",children:"No active alerts"})]})})()}):v.jsx(lJ,{events:l,envStatus:o,embedded:!0})]}),v.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[v.jsx(gy,{icon:Gi,label:"Nodes Online",value:(e==null?void 0:e.total_nodes)||0,accent:"#22c55e",subvalue:`${(e==null?void 0:e.unlocated_count)||0} unlocated`}),v.jsx(gy,{icon:r6,label:"Infrastructure",value:`${(e==null?void 0:e.infra_online)||0}/${(e==null?void 0:e.infra_total)||0}`,accent:"#38bdf8",subvalue:(e==null?void 0:e.infra_online)===(e==null?void 0:e.infra_total)?"All online":"Some offline"}),v.jsx(gy,{icon:rd,label:"Utilization",value:`${((P=e==null?void 0:e.util_percent)==null?void 0:P.toFixed(1))||0}%`,accent:"#f59e0b",subvalue:`${(e==null?void 0:e.flagged_nodes)||0} flagged`}),v.jsx(gy,{icon:nd,label:"Regions",value:(e==null?void 0:e.total_regions)||0,accent:"#333333",subvalue:`${(e==null?void 0:e.battery_warnings)||0} battery warnings`})]})]})]}),v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[v.jsxs("div",{className:"bg-bg-card border border-border p-4",children:[v.jsxs("h2",{className:"text-[10px] font-sans uppercase tracking-widest text-[#666] mb-3",children:["Mesh Sources (",v.jsx("span",{className:"font-mono",children:r.length}),")"]}),r.length>0?v.jsx("div",{className:"space-y-1",children:r.map((I,D)=>v.jsx(nJ,{source:I},D))}):v.jsx("div",{className:"font-sans text-[#666] py-4",children:"No sources configured"})]}),v.jsx(iJ,{bandConditions:c}),v.jsx(aJ,{})]})]})}/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var R2=function(e,t){return R2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},R2(e,t)};function q(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");R2(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var hp=function(){return hp=Object.assign||function(t){for(var r,n=1,i=arguments.length;n0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]"u"&&typeof self<"u"?et.worker=!0:!et.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(et.node=!0,et.svgSupported=!0):dJ(navigator.userAgent,et);function dJ(e,t){var r=t.browser,n=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);n&&(r.firefox=!0,r.version=n[1]),i&&(r.ie=!0,r.version=i[1]),a&&(r.edge=!0,r.version=a[1],r.newEdge=+a[1].split(".")[0]>18),o&&(r.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,t.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11);var s=t.domSupported=typeof document<"u";if(s){var l=document.documentElement.style;t.transform3dSupported=(r.ie&&"transition"in l||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),t.transformSupported=t.transform3dSupported||r.ie&&+r.version>=9}}var nk=12,m6="sans-serif",ss=nk+"px "+m6,vJ=20,pJ=100,gJ="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function mJ(e){var t={};if(typeof JSON>"u")return t;for(var r=0;r=0)s=o*r.length;else for(var l=0;l=wJ&&(Jw=0),Jw++}function X1(){for(var e=[],t=0;t>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",i[u]+":0",n[1-l]+":auto",i[1-u]+":auto",""].join("!important;"),e.appendChild(o),r.push(o)}return t.clearMarkers=function(){E(r,function(c){c.parentNode&&c.parentNode.removeChild(c)})},r}function VJ(e,t,r){for(var n=r?"invTrans":"trans",i=t[n],a=t.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var c=e[u].getBoundingClientRect(),h=2*u,f=c.left,d=c.top;o.push(f,d),l=l&&a&&f===a[h]&&d===a[h+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&i?i:(t.srcCoords=o,t[n]=r?TE(s,o):TE(o,s))}function L6(e){return e.nodeName.toUpperCase()==="CANVAS"}var GJ=/([&<>"'])/g,HJ={"&":"&","<":"<",">":">",'"':""","'":"'"};function gn(e){return e==null?"":(e+"").replace(GJ,function(t,r){return HJ[r]})}var UJ=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,eS=[],WJ=et.browser.firefox&&+et.browser.version.split(".")[0]<39;function F2(e,t,r,n){return r=r||{},n?ME(e,t,r):WJ&&t.layerX!=null&&t.layerX!==t.offsetX?(r.zrX=t.layerX,r.zrY=t.layerY):t.offsetX!=null?(r.zrX=t.offsetX,r.zrY=t.offsetY):ME(e,t,r),r}function ME(e,t,r){if(et.domSupported&&e.getBoundingClientRect){var n=t.clientX,i=t.clientY;if(L6(e)){var a=e.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(B2(eS,e,n,i)){r.zrX=eS[0],r.zrY=eS[1];return}}r.zrX=r.zrY=0}function ck(e){return e||window.event}function Mi(e,t,r){if(t=ck(t),t.zrX!=null)return t;var n=t.type,i=n&&n.indexOf("touch")>=0;if(i){var o=n!=="touchend"?t.targetTouches[0]:t.changedTouches[0];o&&F2(e,o,t,r)}else{F2(e,t,t,r);var a=ZJ(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&UJ.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function ZJ(e){var t=e.wheelDelta;if(t)return t;var r=e.deltaX,n=e.deltaY;if(r==null||n==null)return t;var i=Math.abs(n!==0?n:r),a=n>0?-1:n<0?1:r>0?-1:1;return 3*i*a}function V2(e,t,r,n){e.addEventListener(t,r,n)}function $J(e,t,r,n){e.removeEventListener(t,r,n)}var ls=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function AE(e){return e.which===2||e.which===3}var YJ=function(){function e(){this._track=[]}return e.prototype.recognize=function(t,r,n){return this._doTrack(t,r,n),this._recognize(t)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(t,r,n){var i=t.touches;if(i){for(var a={points:[],touches:[],target:r,event:t},o=0,s=i.length;o1&&n&&n.length>1){var a=LE(n)/LE(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=XJ(n);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:e[0].target,event:t}}}}};function Ft(){return[1,0,0,1,0,0]}function zc(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function Sl(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function ci(e,t,r){var n=t[0]*r[0]+t[2]*r[1],i=t[1]*r[0]+t[3]*r[1],a=t[0]*r[2]+t[2]*r[3],o=t[1]*r[2]+t[3]*r[3],s=t[0]*r[4]+t[2]*r[5]+t[4],l=t[1]*r[4]+t[3]*r[5]+t[5];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e}function _a(e,t,r){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+r[0],e[5]=t[5]+r[1],e}function _s(e,t,r,n){n===void 0&&(n=[0,0]);var i=t[0],a=t[2],o=t[4],s=t[1],l=t[3],u=t[5],c=Math.sin(r),h=Math.cos(r);return e[0]=i*h+s*c,e[1]=-i*c+s*h,e[2]=a*h+l*c,e[3]=-a*c+h*l,e[4]=h*(o-n[0])+c*(u-n[1])+n[0],e[5]=h*(u-n[1])-c*(o-n[0])+n[1],e}function J1(e,t,r){var n=r[0],i=r[1];return e[0]=t[0]*n,e[1]=t[1]*i,e[2]=t[2]*n,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*i,e}function fi(e,t){var r=t[0],n=t[2],i=t[4],a=t[1],o=t[3],s=t[5],l=r*o-a*n;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-n*l,e[3]=r*l,e[4]=(n*s-o*i)*l,e[5]=(a*i-r*s)*l,e):null}function k6(e){var t=Ft();return Sl(t,e),t}const qJ=Object.freeze(Object.defineProperty({__proto__:null,clone:k6,copy:Sl,create:Ft,identity:zc,invert:fi,mul:ci,rotate:_s,scale:J1,translate:_a},Symbol.toStringTag,{value:"Module"}));var Pe=function(){function e(t,r){this.x=t||0,this.y=r||0}return e.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(t,r){return this.x=t,this.y=r,this},e.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.scale=function(t){this.x*=t,this.y*=t},e.prototype.scaleAndAdd=function(t,r){this.x+=t.x*r,this.y+=t.y*r},e.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.dot=function(t){return this.x*t.x+this.y*t.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},e.prototype.distance=function(t){var r=this.x-t.x,n=this.y-t.y;return Math.sqrt(r*r+n*n)},e.prototype.distanceSquare=function(t){var r=this.x-t.x,n=this.y-t.y;return r*r+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(t){if(t){var r=this.x,n=this.y;return this.x=t[0]*r+t[2]*n+t[4],this.y=t[1]*r+t[3]*n+t[5],this}},e.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},e.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},e.set=function(t,r,n){t.x=r,t.y=n},e.copy=function(t,r){t.x=r.x,t.y=r.y},e.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.lenSquare=function(t){return t.x*t.x+t.y*t.y},e.dot=function(t,r){return t.x*r.x+t.y*r.y},e.add=function(t,r,n){t.x=r.x+n.x,t.y=r.y+n.y},e.sub=function(t,r,n){t.x=r.x-n.x,t.y=r.y-n.y},e.scale=function(t,r,n){t.x=r.x*n,t.y=r.y*n},e.scaleAndAdd=function(t,r,n,i){t.x=r.x+n.x*i,t.y=r.y+n.y*i},e.lerp=function(t,r,n,i){var a=1-i;t.x=a*r.x+i*n.x,t.y=a*r.y+i*n.y},e}(),Ou=Math.min,qh=Math.max,G2=Math.abs,kE=["x","y"],KJ=["width","height"],$l=new Pe,Yl=new Pe,Xl=new Pe,ql=new Pe,ni=P6(),Hv=ni.minTv,H2=ni.maxTv,pp=[0,0],Ae=function(){function e(t,r,n,i){rS(this,t,r,n,i)}return e.set=function(t,r,n,i,a){return i<0&&(r=r+i,i=-i),a<0&&(n=n+a,a=-a),t.x=r,t.y=n,t.width=i,t.height=a,t},e.prototype.union=function(t){var r=Ou(t.x,this.x),n=Ou(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=qh(t.x+t.width,this.x+this.width)-r:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=qh(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=r,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(t){return I6(Ft(),this,t)},e.prototype.intersect=function(t,r,n){return e.intersect(this,t,r,n)},e.intersect=function(t,r,n,i){n&&Pe.set(n,0,0);var a=i&&i.outIntersectRect||null,o=i&&i.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!t||!r)return!1;t instanceof e||(t=rS(QJ,t.x,t.y,t.width,t.height)),r instanceof e||(r=rS(eQ,r.x,r.y,r.width,r.height));var s=!!n;ni.reset(i,s);var l=ni.touchThreshold,u=t.x+l,c=t.x+t.width-l,h=t.y+l,f=t.y+t.height-l,d=r.x+l,g=r.x+r.width-l,m=r.y+l,y=r.y+r.height-l;if(u>c||h>f||d>g||m>y)return!1;var _=!(c=t.x&&r<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},e.prototype.contain=function(t,r){return e.contain(this,t,r)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){Pf(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t?t.x:0,t?t.y:0,t?t.width:0,t?t.height:0)},e.copy=function(t,r){return t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height,t},e.applyTransform=function(t,r,n){if(!n){t!==r&&Pf(t,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var i=n[0],a=n[3],o=n[4],s=n[5];t.x=r.x*i+o,t.y=r.y*a+s,t.width=r.width*i,t.height=r.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}$l.x=Xl.x=r.x,$l.y=ql.y=r.y,Yl.x=ql.x=r.x+r.width,Yl.y=Xl.y=r.y+r.height,$l.transform(n),ql.transform(n),Yl.transform(n),Xl.transform(n),t.x=Ou($l.x,Yl.x,Xl.x,ql.x),t.y=Ou($l.y,Yl.y,Xl.y,ql.y);var l=qh($l.x,Yl.x,Xl.x,ql.x),u=qh($l.y,Yl.y,Xl.y,ql.y);t.width=l-t.x,t.height=u-t.y},e.calculateTransform=function(t,r,n){var i=n.width/r.width,a=n.height/r.height;return t=zc(t||[]),_a(t,t,Yo(nS,-r.x,-r.y)),J1(t,t,Yo(nS,i,a)),_a(t,t,Yo(nS,n.x,n.y)),t},e}(),Q1=Ae.create,rS=Ae.set,Pf=Ae.copy,I6=Ae.calculateTransform,N6=Ae.applyTransform,JJ=Ae.contain,QJ=new Ae(0,0,0,0),eQ=new Ae(0,0,0,0),nS=[];function IE(e,t,r,n,i,a,o,s){var l=G2(t-r),u=G2(n-e),c=Ou(l,u),h=kE[i],f=kE[1-i],d=KJ[i];t=u||!ni.bidirectional)&&(Hv[h]=-u,Hv[f]=0,ni.useDir&&ni.calcDirMTV())))}function P6(){var e=0,t=new Pe,r=new Pe,n={minTv:new Pe,maxTv:new Pe,useDir:!1,dirMinTv:new Pe,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,o){n.touchThreshold=0,a&&a.touchThreshold!=null&&(n.touchThreshold=qh(0,a.touchThreshold)),n.negativeSize=!1,o&&(n.minTv.set(1/0,1/0),n.maxTv.set(0,0),n.useDir=!1,a&&a.direction!=null&&(n.useDir=!0,n.dirMinTv.copy(n.minTv),r.copy(n.minTv),e=a.direction,n.bidirectional=a.bidirectional==null||!!a.bidirectional,n.bidirectional||t.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var a=n.minTv,o=n.dirMinTv,s=a.y*a.y+a.x*a.x,l=Math.sin(e),u=Math.cos(e),c=l*a.y+u*a.x;if(i(c)){i(a.x)&&i(a.y)&&o.set(0,0);return}if(r.x=s*u/c,r.y=s*l/c,i(r.x)&&i(r.y)){o.set(0,0);return}(n.bidirectional||t.dot(r)>0)&&r.len()=0;h--){var f=a[h];f!==i&&!f.ignore&&!f.ignoreCoarsePointer&&(!f.parent||!f.parent.ignoreCoarsePointer)&&(iS.copy(f.getBoundingRect()),f.transform&&iS.applyTransform(f.transform),iS.intersect(c)&&s.push(f))}if(s.length)for(var d=4,g=Math.PI/12,m=Math.PI*2,y=0;y4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function aQ(e,t,r){if(e[e.rectHover?"rectContain":"contain"](t,r)){for(var n=e,i=void 0,a=!1;n;){if(n.ignoreClip&&(a=!0),!a){var o=n.getClipPath();if(o&&!o.contain(t,r))return!1}n.silent&&(i=!0);var s=n.__hostTarget;n=s?n.ignoreHostSilent?null:s:n.parent}return i?D6:!0}return!1}function NE(e,t,r,n,i){for(var a=e.length-1;a>=0;a--){var o=e[a],s=void 0;if(o!==i&&!o.ignore&&(s=aQ(o,r,n))&&(!t.topTarget&&(t.topTarget=o),s!==D6)){t.target=o;break}}}function R6(e,t,r){var n=e.painter;return t<0||t>n.getWidth()||r<0||r>n.getHeight()}var j6=32,ov=7;function oQ(e){for(var t=0;e>=j6;)t|=e&1,e>>=1;return e+t}function PE(e,t,r,n){var i=t+1;if(i===r)return 1;if(n(e[i++],e[t])<0){for(;i=0;)i++;return i-t}function sQ(e,t,r){for(r--;t>>1,i(a,e[l])<0?s=l:o=l+1;var u=n-o;switch(u){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;u>0;)e[o+u]=e[o+u-1],u--}e[o]=a}}function aS(e,t,r,n,i,a){var o=0,s=0,l=1;if(a(e,t[r+i])>0){for(s=n-i;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}else{for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}for(o++;o>>1);a(e,t[r+c])>0?o=c+1:l=c}return l}function oS(e,t,r,n,i,a){var o=0,s=0,l=1;if(a(e,t[r+i])<0){for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}else{for(s=n-i;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}for(o++;o>>1);a(e,t[r+c])<0?l=c:o=c+1}return l}function lQ(e,t){var r=ov,n,i,a=0,o=[];n=[],i=[];function s(d,g){n[a]=d,i[a]=g,a+=1}function l(){for(;a>1;){var d=a-2;if(d>=1&&i[d-1]<=i[d]+i[d+1]||d>=2&&i[d-2]<=i[d]+i[d-1])i[d-1]i[d+1])break;c(d)}}function u(){for(;a>1;){var d=a-2;d>0&&i[d-1]=ov||A>=ov);if(N)break;T<0&&(T=0),T+=2}if(r=T,r<1&&(r=1),g===1){for(_=0;_=0;_--)e[M+_]=e[T+_];e[S]=o[w];return}for(var A=r;;){var N=0,P=0,I=!1;do if(t(o[w],e[x])<0){if(e[S--]=e[x--],N++,P=0,--g===0){I=!0;break}}else if(e[S--]=o[w--],P++,N=0,--y===1){I=!0;break}while((N|P)=0;_--)e[M+_]=e[T+_];if(g===0){I=!0;break}}if(e[S--]=o[w--],--y===1){I=!0;break}if(P=y-aS(e[x],o,0,y,y-1,t),P!==0){for(S-=P,w-=P,y-=P,M=S+1,T=w+1,_=0;_=ov||P>=ov);if(I)break;A<0&&(A=0),A+=2}if(r=A,r<1&&(r=1),y===1){for(S-=g,x-=g,M=S+1,T=x+1,_=g-1;_>=0;_--)e[M+_]=e[T+_];e[S]=o[w]}else{if(y===0)throw new Error;for(T=S-(y-1),_=0;_s&&(l=s),DE(e,r,r+l,r+a,t),a=l}o.pushRun(r,a),o.mergeRuns(),i-=a,r+=a}while(i!==0);o.forceMergeRuns()}}var Un=1,Uv=2,Eh=4,EE=!1;function sS(){EE||(EE=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function RE(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var uQ=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=RE}return e.prototype.traverse=function(t,r){for(var n=0;n=0&&this._roots.splice(i,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}(),ex;ex=et.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var gp={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},exponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)))},elasticOut:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/n)+1)},elasticInOut:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?-.5*(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)):r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-gp.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?gp.bounceIn(e*2)*.5:gp.bounceOut(e*2-1)*.5+.5}},yy=Math.pow,hl=Math.sqrt,tx=1e-8,O6=1e-4,jE=hl(3),_y=1/3,Va=jl(),Pi=jl(),hf=jl();function Xs(e){return e>-tx&&etx||e<-tx}function Nr(e,t,r,n,i){var a=1-i;return a*a*(a*e+3*i*t)+i*i*(i*n+3*a*r)}function OE(e,t,r,n,i){var a=1-i;return 3*(((t-e)*a+2*(r-t)*i)*a+(n-r)*i*i)}function rx(e,t,r,n,i,a){var o=n+3*(t-r)-e,s=3*(r-t*2+e),l=3*(t-e),u=e-i,c=s*s-3*o*l,h=s*l-9*o*u,f=l*l-3*s*u,d=0;if(Xs(c)&&Xs(h))if(Xs(s))a[0]=0;else{var g=-l/s;g>=0&&g<=1&&(a[d++]=g)}else{var m=h*h-4*c*f;if(Xs(m)){var y=h/c,g=-s/o+y,_=-y/2;g>=0&&g<=1&&(a[d++]=g),_>=0&&_<=1&&(a[d++]=_)}else if(m>0){var x=hl(m),w=c*s+1.5*o*(-h+x),S=c*s+1.5*o*(-h-x);w<0?w=-yy(-w,_y):w=yy(w,_y),S<0?S=-yy(-S,_y):S=yy(S,_y);var g=(-s-(w+S))/(3*o);g>=0&&g<=1&&(a[d++]=g)}else{var T=(2*c*s-3*o*h)/(2*hl(c*c*c)),M=Math.acos(T)/3,A=hl(c),N=Math.cos(M),g=(-s-2*A*N)/(3*o),_=(-s+A*(N+jE*Math.sin(M)))/(3*o),P=(-s+A*(N-jE*Math.sin(M)))/(3*o);g>=0&&g<=1&&(a[d++]=g),_>=0&&_<=1&&(a[d++]=_),P>=0&&P<=1&&(a[d++]=P)}}return d}function B6(e,t,r,n,i){var a=6*r-12*t+6*e,o=9*t+3*n-3*e-9*r,s=3*t-3*e,l=0;if(Xs(o)){if(z6(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var c=a*a-4*o*s;if(Xs(c))i[0]=-a/(2*o);else if(c>0){var h=hl(c),u=(-a+h)/(2*o),f=(-a-h)/(2*o);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function Cl(e,t,r,n,i,a){var o=(t-e)*i+e,s=(r-t)*i+t,l=(n-r)*i+r,u=(s-o)*i+o,c=(l-s)*i+s,h=(c-u)*i+u;a[0]=e,a[1]=o,a[2]=u,a[3]=h,a[4]=h,a[5]=c,a[6]=l,a[7]=n}function F6(e,t,r,n,i,a,o,s,l,u,c){var h,f=.005,d=1/0,g,m,y,_;Va[0]=l,Va[1]=u;for(var x=0;x<1;x+=.05)Pi[0]=Nr(e,r,i,o,x),Pi[1]=Nr(t,n,a,s,x),y=cl(Va,Pi),y=0&&y=0&&u<=1&&(i[l++]=u)}}else{var c=o*o-4*a*s;if(Xs(c)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(c>0){var h=hl(c),u=(-o+h)/(2*a),f=(-o-h)/(2*a);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function V6(e,t,r){var n=e+r-2*t;return n===0?.5:(e-t)/n}function Qp(e,t,r,n,i){var a=(t-e)*n+e,o=(r-t)*n+t,s=(o-a)*n+a;i[0]=e,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=r}function G6(e,t,r,n,i,a,o,s,l){var u,c=.005,h=1/0;Va[0]=o,Va[1]=s;for(var f=0;f<1;f+=.05){Pi[0]=Gr(e,r,i,f),Pi[1]=Gr(t,n,a,f);var d=cl(Va,Pi);d=0&&d=1?1:rx(0,n,a,1,l,s)&&Nr(0,i,o,1,s[0])}}}var vQ=function(){function e(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||Yt,this.ondestroy=t.ondestroy||Yt,this.onrestart=t.onrestart||Yt,t.easing&&this.setEasing(t.easing)}return e.prototype.step=function(t,r){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var n=this._life,i=t-this._startTime-this._pausedTime,a=i/n;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=i%n;this._startTime=t-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(t){this.easing=t,this.easingFunc=Ce(t)?t:gp[t]||hk(t)},e}(),H6=function(){function e(t){this.value=t}return e}(),pQ=function(){function e(){this._len=0}return e.prototype.insert=function(t){var r=new H6(t);return this.insertEntry(r),r},e.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},e.prototype.remove=function(t){var r=t.prev,n=t.next;r?r.next=n:this.head=n,n?n.prev=r:this.tail=r,t.next=t.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),Df=function(){function e(t){this._list=new pQ,this._maxSize=10,this._map={},this._maxSize=t}return e.prototype.put=function(t,r){var n=this._list,i=this._map,a=null;if(i[t]==null){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new H6(r),s.key=t,n.insertEntry(s),i[t]=s}return a},e.prototype.get=function(t){var r=this._map[t],n=this._list;if(r!=null)return r!==n.tail&&(n.remove(r),n.insertEntry(r)),r.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),zE={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function da(e){return e=Math.round(e),e<0?0:e>255?255:e}function gQ(e){return e=Math.round(e),e<0?0:e>360?360:e}function eg(e){return e<0?0:e>1?1:e}function K0(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?da(parseFloat(t)/100*255):da(parseInt(t,10))}function Xo(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?eg(parseFloat(t)/100):eg(parseFloat(t))}function lS(e,t,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?e+(t-e)*r*6:r*2<1?t:r*3<2?e+(t-e)*(2/3-r)*6:e}function qs(e,t,r){return e+(t-e)*r}function Ci(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}function W2(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var U6=new Df(20),xy=null;function ch(e,t){xy&&W2(xy,t),xy=U6.put(e,xy||t.slice())}function yn(e,t){if(e){t=t||[];var r=U6.get(e);if(r)return W2(t,r);e=e+"";var n=e.replace(/ /g,"").toLowerCase();if(n in zE)return W2(t,zE[n]),ch(e,t),t;var i=n.length;if(n.charAt(0)==="#"){if(i===4||i===5){var a=parseInt(n.slice(1,4),16);if(!(a>=0&&a<=4095)){Ci(t,0,0,0,1);return}return Ci(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(n.slice(4),16)/15:1),ch(e,t),t}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){Ci(t,0,0,0,1);return}return Ci(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),ch(e,t),t}return}var o=n.indexOf("("),s=n.indexOf(")");if(o!==-1&&s+1===i){var l=n.substr(0,o),u=n.substr(o+1,s-(o+1)).split(","),c=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?Ci(t,+u[0],+u[1],+u[2],1):Ci(t,0,0,0,1);c=Xo(u.pop());case"rgb":if(u.length>=3)return Ci(t,K0(u[0]),K0(u[1]),K0(u[2]),u.length===3?c:Xo(u[3])),ch(e,t),t;Ci(t,0,0,0,1);return;case"hsla":if(u.length!==4){Ci(t,0,0,0,1);return}return u[3]=Xo(u[3]),Z2(u,t),ch(e,t),t;case"hsl":if(u.length!==3){Ci(t,0,0,0,1);return}return Z2(u,t),ch(e,t),t;default:return}}Ci(t,0,0,0,1)}}function Z2(e,t){var r=(parseFloat(e[0])%360+360)%360/360,n=Xo(e[1]),i=Xo(e[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return t=t||[],Ci(t,da(lS(o,a,r+1/3)*255),da(lS(o,a,r)*255),da(lS(o,a,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function mQ(e){if(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=a-i,s=(a+i)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+i):u=o/(2-a-i);var c=((a-t)/6+o/2)/o,h=((a-r)/6+o/2)/o,f=((a-n)/6+o/2)/o;t===a?l=f-h:r===a?l=1/3+c-f:n===a&&(l=2/3+h-c),l<0&&(l+=1),l>1&&(l-=1)}var d=[l*360,u,s];return e[3]!=null&&d.push(e[3]),d}}function nx(e,t){var r=yn(e);if(r){for(var n=0;n<3;n++)t<0?r[n]=r[n]*(1-t)|0:r[n]=(255-r[n])*t+r[n]|0,r[n]>255?r[n]=255:r[n]<0&&(r[n]=0);return Oi(r,r.length===4?"rgba":"rgb")}}function yQ(e){var t=yn(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}function mp(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){r=r||[];var n=e*(t.length-1),i=Math.floor(n),a=Math.ceil(n),o=t[i],s=t[a],l=n-i;return r[0]=da(qs(o[0],s[0],l)),r[1]=da(qs(o[1],s[1],l)),r[2]=da(qs(o[2],s[2],l)),r[3]=eg(qs(o[3],s[3],l)),r}}var _Q=mp;function fk(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){var n=e*(t.length-1),i=Math.floor(n),a=Math.ceil(n),o=yn(t[i]),s=yn(t[a]),l=n-i,u=Oi([da(qs(o[0],s[0],l)),da(qs(o[1],s[1],l)),da(qs(o[2],s[2],l)),eg(qs(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}var xQ=fk;function qo(e,t,r,n){var i=yn(e);if(e)return i=mQ(i),t!=null&&(i[0]=gQ(Ce(t)?t(i[0]):t)),r!=null&&(i[1]=Xo(Ce(r)?r(i[1]):r)),n!=null&&(i[2]=Xo(Ce(n)?n(i[2]):n)),Oi(Z2(i),"rgba")}function tg(e,t){var r=yn(e);if(r&&t!=null)return r[3]=eg(t),Oi(r,"rgba")}function Oi(e,t){if(!(!e||!e.length)){var r=e[0]+","+e[1]+","+e[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(r+=","+e[3]),t+"("+r+")"}}function rg(e,t){var r=yn(e);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*t:0}function bQ(){return Oi([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var BE=new Df(100);function ix(e){if(ue(e)){var t=BE.get(e);return t||(t=nx(e,-.1),BE.put(e,t)),t}else if(Xg(e)){var r=ee({},e);return r.colorStops=ae(e.colorStops,function(n){return{offset:n.offset,color:nx(n.color,-.1)}}),r}return e}const wQ=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:mp,fastMapToColor:_Q,lerp:fk,lift:nx,liftColor:ix,lum:rg,mapToColor:xQ,modifyAlpha:tg,modifyHSL:qo,parse:yn,parseCssFloat:Xo,parseCssInt:K0,random:bQ,stringify:Oi,toHex:yQ},Symbol.toStringTag,{value:"Module"}));var ax=Math.round;function ng(e){var t;if(!e||e==="transparent")e="none";else if(typeof e=="string"&&e.indexOf("rgba")>-1){var r=yn(e);r&&(e="rgb("+r[0]+","+r[1]+","+r[2]+")",t=r[3])}return{color:e,opacity:t??1}}var FE=1e-4;function Ks(e){return e-FE}function by(e){return ax(e*1e3)/1e3}function $2(e){return ax(e*1e4)/1e4}function SQ(e){return"matrix("+by(e[0])+","+by(e[1])+","+by(e[2])+","+by(e[3])+","+$2(e[4])+","+$2(e[5])+")"}var CQ={left:"start",right:"end",center:"middle",middle:"middle"};function TQ(e,t,r){return r==="top"?e+=t/2:r==="bottom"&&(e-=t/2),e}function MQ(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function AQ(e){var t=e.style,r=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),r[0],r[1]].join(",")}function W6(e){return e&&!!e.image}function LQ(e){return e&&!!e.svgElement}function dk(e){return W6(e)||LQ(e)}function Z6(e){return e.type==="linear"}function $6(e){return e.type==="radial"}function Y6(e){return e&&(e.type==="linear"||e.type==="radial")}function eb(e){return"url(#"+e+")"}function X6(e){var t=e.getGlobalScale(),r=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(r)/Math.log(10)),1)}function q6(e){var t=e.x||0,r=e.y||0,n=(e.rotation||0)*fp,i=ye(e.scaleX,1),a=ye(e.scaleY,1),o=e.skewX||0,s=e.skewY||0,l=[];return(t||r)&&l.push("translate("+t+"px,"+r+"px)"),n&&l.push("rotate("+n+")"),(i!==1||a!==1)&&l.push("scale("+i+","+a+")"),(o||s)&&l.push("skew("+ax(o*fp)+"deg, "+ax(s*fp)+"deg)"),l.join(" ")}var kQ=function(){return typeof Buffer<"u"&&typeof Buffer.from=="function"?function(e){return Buffer.from(e).toString("base64")}:typeof btoa=="function"&&typeof unescape=="function"&&typeof encodeURIComponent=="function"?function(e){return btoa(unescape(encodeURIComponent(e)))}:function(e){return null}}(),Y2=Array.prototype.slice;function jo(e,t,r){return(t-e)*r+e}function uS(e,t,r,n){for(var i=t.length,a=0;an?t:e,a=Math.min(r,n),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)n.length=o;else for(var l=a;l=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(t,r,n){this._needsSort=!0;var i=this.keyframes,a=i.length,o=!1,s=GE,l=r;if(nn(r)){var u=DQ(r);s=u,(u===1&&!nt(r[0])||u===2&&!nt(r[0][0]))&&(o=!0)}else if(nt(r)&&!tn(r))s=Sy;else if(ue(r))if(!isNaN(+r))s=Sy;else{var c=yn(r);c&&(l=c,s=Wv)}else if(Xg(r)){var h=ee({},l);h.colorStops=ae(r.colorStops,function(d){return{offset:d.offset,color:yn(d.color)}}),Z6(r)?s=X2:$6(r)&&(s=q2),l=h}a===0?this.valType=s:(s!==this.valType||s===GE)&&(o=!0),this.discrete=this.discrete||o;var f={time:t,value:l,rawValue:r,percent:0};return n&&(f.easing=n,f.easingFunc=Ce(n)?n:gp[n]||hk(n)),i.push(f),f},e.prototype.prepare=function(t,r){var n=this.keyframes;this._needsSort&&n.sort(function(m,y){return m.time-y.time});for(var i=this.valType,a=n.length,o=n[a-1],s=this.discrete,l=Cy(i),u=HE(i),c=0;c=0&&!(o[c].percent<=r);c--);c=f(c,s-2)}else{for(c=h;cr);c++);c=f(c-1,s-2)}g=o[c+1],d=o[c]}if(d&&g){this._lastFr=c,this._lastFrP=r;var y=g.percent-d.percent,_=y===0?1:f((r-d.percent)/y,1);g.easingFunc&&(_=g.easingFunc(_));var x=n?this._additiveValue:u?sv:t[l];if((Cy(a)||u)&&!x&&(x=this._additiveValue=[]),this.discrete)t[l]=_<1?d.rawValue:g.rawValue;else if(Cy(a))a===Q0?uS(x,d[i],g[i],_):IQ(x,d[i],g[i],_);else if(HE(a)){var w=d[i],S=g[i],T=a===X2;t[l]={type:T?"linear":"radial",x:jo(w.x,S.x,_),y:jo(w.y,S.y,_),colorStops:ae(w.colorStops,function(A,N){var P=S.colorStops[N];return{offset:jo(A.offset,P.offset,_),color:J0(uS([],A.color,P.color,_))}}),global:S.global},T?(t[l].x2=jo(w.x2,S.x2,_),t[l].y2=jo(w.y2,S.y2,_)):t[l].r=jo(w.r,S.r,_)}else if(u)uS(x,d[i],g[i],_),n||(t[l]=J0(x));else{var M=jo(d[i],g[i],_);n?this._additiveValue=M:t[l]=M}n&&this._addToTarget(t)}}},e.prototype._addToTarget=function(t){var r=this.valType,n=this.propName,i=this._additiveValue;r===Sy?t[n]=t[n]+i:r===Wv?(yn(t[n],sv),wy(sv,sv,i,1),t[n]=J0(sv)):r===Q0?wy(t[n],t[n],i,1):r===K6&&VE(t[n],t[n],i,1)},e}(),vk=function(){function e(t,r,n,i){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=r,r&&i){X1("Can' use additive animation on looped animation.");return}this._additiveAnimators=i,this._allowDiscrete=n}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(t){this._target=t},e.prototype.when=function(t,r,n){return this.whenWithKeys(t,r,Qe(r),n)},e.prototype.whenWithKeys=function(t,r,n,i){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,yp(u),i),this._trackKeys.push(s)}l.addKeyframe(t,yp(r[s]),i)}return this._maxTime=Math.max(this._maxTime,t),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var r=t.length,n=0;n0)){this._started=1;for(var r=this,n=[],i=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,t[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},e}();function Kh(){return new Date().getTime()}var RQ=function(e){q(t,e);function t(r){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,r=r||{},n.stage=r.stage||{},n}return t.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},t.prototype.addAnimator=function(r){r.animation=this;var n=r.getClip();n&&this.addClip(n)},t.prototype.removeClip=function(r){if(r.animation){var n=r.prev,i=r.next;n?n.next=i:this._head=i,i?i.prev=n:this._tail=n,r.next=r.prev=r.animation=null}},t.prototype.removeAnimator=function(r){var n=r.getClip();n&&this.removeClip(n),r.animation=null},t.prototype.update=function(r){for(var n=Kh()-this._pausedTime,i=n-this._time,a=this._head;a;){var o=a.next,s=a.step(n,i);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=n,r||(this.trigger("frame",i),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var r=this;this._running=!0;function n(){r._running&&(ex(n),!r._paused&&r.update())}ex(n)},t.prototype.start=function(){this._running||(this._time=Kh(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Kh(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Kh()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var r=this._head;r;){var n=r.next;r.prev=r.next=r.animation=null,r=n}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(r,n){n=n||{},this.start();var i=new vk(r,n.loop);return this.addAnimator(i),i},t}(Xi),jQ=300,cS=et.domSupported,hS=function(){var e=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},n=ae(e,function(i){var a=i.replace("mouse","pointer");return r.hasOwnProperty(a)?a:i});return{mouse:e,touch:t,pointer:n}}(),UE={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},WE=!1;function K2(e){var t=e.pointerType;return t==="pen"||t==="touch"}function OQ(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function fS(e){e&&(e.zrByTouch=!0)}function zQ(e,t){return Mi(e.dom,new BQ(e,t),!0)}function J6(e,t){for(var r=t,n=!1;r&&r.nodeType!==9&&!(n=r.domBelongToZr||r!==t&&r===e.painterRoot);)r=r.parentNode;return n}var BQ=function(){function e(t,r){this.stopPropagation=Yt,this.stopImmediatePropagation=Yt,this.preventDefault=Yt,this.type=r.type,this.target=this.currentTarget=t.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return e}(),aa={mousedown:function(e){e=Mi(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=Mi(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=Mi(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){e=Mi(this.dom,e);var t=e.toElement||e.relatedTarget;J6(this,t)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){WE=!0,e=Mi(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){WE||(e=Mi(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){e=Mi(this.dom,e),fS(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),aa.mousemove.call(this,e),aa.mousedown.call(this,e)},touchmove:function(e){e=Mi(this.dom,e),fS(e),this.handler.processGesture(e,"change"),aa.mousemove.call(this,e)},touchend:function(e){e=Mi(this.dom,e),fS(e),this.handler.processGesture(e,"end"),aa.mouseup.call(this,e),+new Date-+this.__lastTouchMomentYE||e<-YE}var Jl=[],hh=[],vS=Ft(),pS=Math.abs,_o=function(){function e(){}return e.prototype.getLocalTransform=function(t){return Tl(this,t)},e.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},e.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},e.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},e.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},e.prototype.needLocalTransform=function(){return Kl(this.rotation)||Kl(this.x)||Kl(this.y)||Kl(this.scaleX-1)||Kl(this.scaleY-1)||Kl(this.skewX)||Kl(this.skewY)},e.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||t)){n&&($E(n),this.invTransform=null);return}n=n||Ft(),r?this.getLocalTransform(n):$E(n),t&&(r?ci(n,t,n):Sl(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n),this.invTransform=this.invTransform||Ft(),fi(this.invTransform,n)},e.prototype._resolveGlobalScaleRatio=function(t){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Jl);var n=Jl[0]<0?-1:1,i=Jl[1]<0?-1:1,a=((Jl[0]-n)*r+n)/Jl[0]||0,o=((Jl[1]-i)*r+i)/Jl[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}},e.prototype.getComputedTransform=function(){for(var t=this,r=[];t;)r.push(t),t=t.parent;for(;t=r.pop();)t.updateTransform();return this.transform},e.prototype.setLocalTransform=function(t){if(t){var r=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),a=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(a),r=Math.sqrt(r),this.skewX=a,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=r,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,r=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||Ft(),ci(hh,t.invTransform,r),r=hh);var n=this.originX,i=this.originY;(n||i)&&(vS[4]=n,vS[5]=i,ci(hh,r,vS),hh[4]-=n,hh[5]-=i,r=hh),this.setLocalTransform(r)}},e.prototype.getGlobalScale=function(t){var r=this.transform;return t=t||[],r?(t[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),t[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(t[0]=-t[0]),r[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},e.prototype.transformCoordToLocal=function(t,r){var n=[t,r],i=this.invTransform;return i&&Xt(n,n,i),n},e.prototype.transformCoordToGlobal=function(t,r){var n=[t,r],i=this.transform;return i&&Xt(n,n,i),n},e.prototype.getLineScale=function(){var t=this.transform;return t&&pS(t[0]-1)>1e-10&&pS(t[3]-1)>1e-10?Math.sqrt(pS(t[0]*t[3]-t[2]*t[1])):1},e.prototype.copyTransform=function(t){so(this,t)},e.getLocalTransform=function(t,r){r=r||[];var n=t.originX||0,i=t.originY||0,a=t.scaleX,o=t.scaleY,s=t.anchorX,l=t.anchorY,u=t.rotation||0,c=t.x,h=t.y,f=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||s||l){var g=n+s,m=i+l;r[4]=-g*a-f*m*o,r[5]=-m*o-d*g*a}else r[4]=r[5]=0;return r[0]=a,r[3]=o,r[1]=d*a,r[2]=f*o,u&&_s(r,r,u),r[4]+=n+c,r[5]+=i+h,r},e.initDefaultProps=function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0}(),e}(),Tl=_o.getLocalTransform;function ff(){return new _o}var us=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function so(e,t){return b6(e,t,us)}function Ka(e){Ty||(Ty=new Df(100)),e=e||ss;var t=Ty.get(e);return t||(t={font:e,strWidthCache:new Df(500),asciiWidthMap:null,asciiWidthMapTried:!1,stWideCharWidth:Er.measureText("国",e).width,asciiCharWidth:Er.measureText("a",e).width},Ty.put(e,t)),t}var Ty;function UQ(e){if(!(gS>=XE)){e=e||ss;for(var t=[],r=+new Date,n=0;n<=127;n++)t[n]=Er.measureText(String.fromCharCode(n),e).width;var i=+new Date-r;return i>16?gS=XE:i>2&&gS++,t}}var gS=0,XE=5;function eG(e,t){return e.asciiWidthMapTried||(e.asciiWidthMap=UQ(e.font),e.asciiWidthMapTried=!0),0<=t&&t<=127?e.asciiWidthMap!=null?e.asciiWidthMap[t]:e.asciiCharWidth:e.stWideCharWidth}function Ja(e,t){var r=e.strWidthCache,n=r.get(t);return n==null&&(n=Er.measureText(t,e.font).width,r.put(t,n)),n}function qE(e,t,r,n){var i=Ja(Ka(t),e),a=Jg(t),o=Ef(0,i,r),s=Zu(0,a,n),l=new Ae(o,s,i,a);return l}function tb(e,t,r,n){var i=((e||"")+"").split(` +`),a=i.length;if(a===1)return qE(i[0],t,r,n);for(var o=new Ae(0,0,0,0),s=0;s=0?parseFloat(e)/100*t:parseFloat(e):e}function sx(e,t,r){var n=t.position||"inside",i=t.distance!=null?t.distance:5,a=r.height,o=r.width,s=a/2,l=r.x,u=r.y,c="left",h="top";if(n instanceof Array)l+=lo(n[0],r.width),u+=lo(n[1],r.height),c=null,h=null;else switch(n){case"left":l-=i,u+=s,c="right",h="middle";break;case"right":l+=i+o,u+=s,h="middle";break;case"top":l+=o/2,u-=i,c="center",h="bottom";break;case"bottom":l+=o/2,u+=a+i,c="center";break;case"inside":l+=o/2,u+=s,c="center",h="middle";break;case"insideLeft":l+=i,u+=s,h="middle";break;case"insideRight":l+=o-i,u+=s,c="right",h="middle";break;case"insideTop":l+=o/2,u+=i,c="center";break;case"insideBottom":l+=o/2,u+=a-i,c="center",h="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=o-i,u+=i,c="right";break;case"insideBottomLeft":l+=i,u+=a-i,h="bottom";break;case"insideBottomRight":l+=o-i,u+=a-i,c="right",h="bottom";break}return e=e||{},e.x=l,e.y=u,e.align=c,e.verticalAlign=h,e}var mS="__zr_normal__",yS=us.concat(["ignore"]),WQ=Hi(us,function(e,t){return e[t]=!0,e},{ignore:!1}),fh={},ZQ=new Ae(0,0,0,0),My=[],t_=0,rb=1,nb=function(){function e(t){this.id=ok(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return e.prototype._init=function(t){this.attr(t)},e.prototype.drift=function(t,r,n){switch(this.draggable){case"horizontal":r=0;break;case"vertical":t=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=r,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(t){var r=this._textContent;if(r&&(!r.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,a=r.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=i?this:null;var u=!1;a.copyTransform(r);var c=n.position!=null,h=n.autoOverflowArea,f=void 0;if((h||c)&&(f=ZQ,n.layoutRect?f.copy(n.layoutRect):f.copy(this.getBoundingRect()),i||f.applyTransform(this.transform)),c){this.calculateTextPosition?this.calculateTextPosition(fh,n,f):sx(fh,n,f),a.x=fh.x,a.y=fh.y,o=fh.align,s=fh.verticalAlign;var d=n.origin;if(d&&n.rotation!=null){var g=void 0,m=void 0;d==="center"?(g=f.width*.5,m=f.height*.5):(g=lo(d[0],f.width),m=lo(d[1],f.height)),u=!0,a.originX=-a.x+g+(i?0:f.x),a.originY=-a.y+m+(i?0:f.y)}}n.rotation!=null&&(a.rotation=n.rotation);var y=n.offset;y&&(a.x+=y[0],a.y+=y[1],u||(a.originX=-y[0],a.originY=-y[1]));var _=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(h){var x=_.overflowRect=_.overflowRect||new Ae(0,0,0,0);a.getLocalTransform(My),fi(My,My),Ae.copy(x,f),x.applyTransform(My)}else _.overflowRect=null;var w=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,S=void 0,T=void 0,M=void 0;w&&this.canBeInsideText()?(S=n.insideFill,T=n.insideStroke,(S==null||S==="auto")&&(S=this.getInsideTextFill()),(T==null||T==="auto")&&(T=this.getInsideTextStroke(S),M=!0)):(S=n.outsideFill,T=n.outsideStroke,(S==null||S==="auto")&&(S=this.getOutsideFill()),(T==null||T==="auto")&&(T=this.getOutsideStroke(S),M=!0)),S=S||"#000",(S!==_.fill||T!==_.stroke||M!==_.autoStroke||o!==_.align||s!==_.verticalAlign)&&(l=!0,_.fill=S,_.stroke=T,_.autoStroke=M,_.align=o,_.verticalAlign=s,r.setDefaultTextStyle(_)),r.__dirty|=Un,l&&r.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(t){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?tM:eM},e.prototype.getOutsideStroke=function(t){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&yn(r);n||(n=[255,255,255,1]);for(var i=n[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(a?0:255)*(1-i);return n[3]=1,Oi(n,"rgba")},e.prototype.traverse=function(t,r){},e.prototype.attrKV=function(t,r){t==="textConfig"?this.setTextConfig(r):t==="textContent"?this.setTextContent(r):t==="clipPath"?this.setClipPath(r):t==="extra"?(this.extra=this.extra||{},ee(this.extra,r)):this[t]=r},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(t,r){if(typeof t=="string")this.attrKV(t,r);else if(Ie(t))for(var n=t,i=Qe(n),a=0;a0},e.prototype.getState=function(t){return this.states[t]},e.prototype.ensureState=function(t){var r=this.states;return r[t]||(r[t]={}),r[t]},e.prototype.clearStates=function(t){this.useState(mS,!1,t)},e.prototype.useState=function(t,r,n,i){var a=t===mS,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(Be(s,t)>=0&&(r||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(t)),u||(u=this.states&&this.states[t]),!u&&!a){X1("State "+t+" not exists.");return}a||this.saveCurrentToNormalState(u);var c=this._textContent,h=KE(this,c,u,i);h&&!this.__inHover&&(this.__inHover=h),this._applyStateObj(t,u,this._normalState,r,QE(this,n,l),l);var f=this._textGuide;return c&&c.useState(t,r,n,!!h),f&&f.useState(t,r,n,!!h),a?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!h&&this.__inHover&&(this.__inHover=t_,this.__dirty&=~Un),u}}},e.prototype.useStates=function(t,r,n){if(!t.length)this.clearStates();else{var i=[],a=this.currentStates,o=t.length,s=o===a.length;if(s){for(var l=0;l=0){var n=this.currentStates.slice();n.splice(r,1),this.useStates(n)}},e.prototype.replaceState=function(t,r,n){var i=this.currentStates.slice(),a=Be(i,t),o=Be(i,r)>=0;a>=0?o?i.splice(a,1):i[a]=r:n&&!o&&i.push(r),this.useStates(i)},e.prototype.toggleState=function(t,r){r?this.useState(t,!0):this.removeState(t)},e.prototype._mergeStates=function(t){for(var r={},n,i=0;i=0&&a.splice(o,1)}),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(t){this.markRedraw()},e.prototype.stopAnimation=function(t,r){for(var n=this.animators,i=n.length,a=[],o=0;o0&&r.during&&a[0].during(function(g,m){r.during(m)});for(var f=0;f0||i.force&&!o.length){var N=void 0,P=void 0,I=void 0;if(s){P={},f&&(N={});for(var S=0;S0}var Me=function(e){q(t,e);function t(r){var n=e.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(r),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(r){return this._children[r]},t.prototype.childOfName=function(r){for(var n=this._children,i=0;i=0&&(i.splice(a,0,r),this._doAdd(r))}return this},t.prototype.replace=function(r,n){var i=Be(this._children,r);return i>=0&&this.replaceAt(n,i),this},t.prototype.replaceAt=function(r,n){var i=this._children,a=i[n];if(r&&r!==this&&r.parent!==this&&r!==a){i[n]=r,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(r)}return this},t.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var n=this.__zr;n&&n!==r.__zr&&r.addSelfToZr(n),n&&n.refresh()},t.prototype.remove=function(r){var n=this.__zr,i=this._children,a=Be(i,r);return a<0?this:(i.splice(a,1),r.parent=null,n&&r.removeSelfFromZr(n),n&&n.refresh(),this)},t.prototype.removeAll=function(){for(var r=this._children,n=this.__zr,i=0;i0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||this._refresh({animUpdate:!1,refresh:!1,refreshHover:!0})},e.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},e.prototype.findHover=function(t,r){if(!this._disposed)return this.handler.findHover(t,r)},e.prototype.on=function(t,r,n){return this._disposed||this.handler.on(t,r,n),this},e.prototype.off=function(t,r){this._disposed||this.handler.off(t,r)},e.prototype.trigger=function(t,r){this._disposed||this.handler.trigger(t,r)},e.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),r=0;r0){if(e<=i)return o;if(e>=a)return s}else{if(e>=i)return o;if(e<=a)return s}else{if(e===i)return o;if(e===a)return s}return(e-i)/l*u+o}var he=lee;function lee(e,t,r){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%";break}return cx(e,t,r)}function cx(e,t,r){return ue(e)?aG(e)?parseFloat(e)/100*t+(r||0):parseFloat(e):e==null?NaN:+e}function uee(e){return ue(e)&&aG(e)}function aG(e){return!!oee(e).match(/%$/)}function at(e,t,r){return isNaN(t)?r?""+e:+e:(t=_t($e(0,t),lx),e=(+e).toFixed(t),r?e:+e)}function cee(e,t,r){return t==null&&(t=10),at(e,t,r)}function Hr(e){return e.sort(function(t,r){return t-r}),e}function Ha(e){if(e=+e,isNaN(e))return 0;if(e>1e-14){for(var t=1,r=0;r<15;r++,t*=10)if(uo(e*t)/t===e)return r}return oG(e)}function oG(e){var t=e.toString().toLowerCase(),r=t.indexOf("e"),n=r>0?+t.slice(r+1):0,i=r>0?r:t.length,a=t.indexOf("."),o=a<0?0:i-1-a;return $e(0,o-n)}function hee(e,t){var r=Ui(uc(e[1]-e[0])/ig),n=uo(uc($t(t[1]-t[0]))/ig),i=_t($e(-r+n,0),lx);return isFinite(i)?i:lx}function pk(e,t,r){var n=$t(e[1]-e[0]);if(!isFinite(n)||n===0)return NaN;var i=uc(2*$t(r||1)*$t(n))/ig,a=uc($t(t))/ig,o=$e(0,Bc(-i+a));return isFinite(o)||(o=NaN),o}function fee(e,t,r){if(!e[t])return 0;var n=sG(e,r);return n[t]||0}function sG(e,t){var r=Hi(e,function(d,g){return d+(isNaN(g)?0:g)},0);if(r===0)return[];for(var n=Fc(10,t),i=ae(e,function(d){return(isNaN(d)?0:d)/r*n*100}),a=n*100,o=ae(i,function(d){return Ui(d)}),s=Hi(o,function(d,g){return d+g},0),l=ae(i,function(d,g){return d-o[g]});su&&(u=l[h],c=h);++o[c],l[c]=0,++s}return ae(o,function(d){return d/n})}function Su(e,t){var r=$e(Ha(e),Ha(t)),n=e+t;return r>lx?n:at(n,r)}var ag=Fc(2,53)-1;function gk(e){var t=ux*2;return(e%t+t)%t}function cc(e){return e>-eR&&e=10&&t++,t}var lG=2;function ab(e,t){var r=ib(e),n=Fc(10,r),i=e/n,a;return t===lG?a=1:t?i<1.5?a=1:i<2.5?a=2:i<4?a=3:i<7?a=5:a=10:i<1?a=1:i<2?a=2:i<3?a=3:i<5?a=5:a=10,e=a*n,at(e,-r)}function n_(e,t){var r=(e.length-1)*t+1,n=Ui(r),i=+e[n-1],a=r-n;return a?i+a*(e[n]-i):i}function iM(e){e.sort(function(l,u){return s(l,u,0)?-1:1});for(var t=-1/0,r=1,n=0;n0?t.length:0),this.item=null,this.key=NaN,this},e.prototype.next=function(){return(this._step>0?this._idx=this._end)?(this.item=this._list[this._idx],this.key=this._idx=this._idx+this._step,!0):!1},e}();function bS(e){e.option=e.parentModel=e.ecModel=null}function Qr(){return[1/0,-1/0]}function oM(e,t){cs(t)&&(te[1]&&(e[1]=t))}function mG(e,t){cs(t)&&te[1]&&(e[1]=t)}function Pee(e,t){dc(t[0],t[1])&&(t[0]e[1]&&(e[1]=t[1]))}function cs(e){return e!=null&&isFinite(e)}function dc(e,t){return cs(e)&&cs(t)&&e<=t}function Dee(e){var t=e[1]-e[0];return isFinite(t)&&t>=0}function i_(e){dc(e[0],e[1])&&e[0]>e[1]&&(e[0]=e[1])}function ld(){var e="__ec_once_"+Eee++;return function(t,r){ge(t,e)||(t[e]=1,r())}}var Eee=_k();function ob(e,t,r){var n=pe(),i=0;E(e,function(a){var o=t(a),s=n.get(o)||0;r&&r(a,s),!s&&!r&&(e[i++]=a),n.set(o,s+1)}),r||(e.length=i)}function Ree(e){return e.value+""}function jee(e){return e+""}function Qa(e,t){return ye(t,!0)?e.seriesIndex+2:0}function _G(e,t,r){var n=e.getData().count();return{progressiveRender:r.progressiveEnabled&&t.incrementalPrepareRender&&n>=r.threshold,large:e.get("large")&&n>=e.get("largeThreshold"),modDataCount:e.get("progressiveChunkMode")==="mod"?e.getData().count():null}}function Lr(e,t){return{seriesType:e,overallReset:t}}function Qg(e){return{overallReset:e}}var Oee=".",Ql="___EC__COMPONENT__CONTAINER___",xG="___EC__EXTENDED_CLASS___";function Ua(e){var t={main:"",sub:""};if(e){var r=e.split(Oee);t.main=r[0]||"",t.sub=r[1]||""}return t}function zee(e){an(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}function Bee(e){return!!(e&&e[xG])}function Sk(e,t){e.$constructor=e,e.extend=function(r){var n=this,i;return Fee(n)?i=function(a){q(o,a);function o(){return a.apply(this,arguments)||this}return o}(n):(i=function(){(r.$constructor||n).apply(this,arguments)},sk(i,this)),ee(i.prototype,r),i[xG]=!0,i.extend=this.extend,i.superCall=Hee,i.superApply=Uee,i.superClass=n,i}}function Fee(e){return Ce(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function bG(e,t){e.extend=t.extend}var Vee=Math.round(Math.random()*10);function Gee(e){var t=["__\0is_clz",Vee++].join("_");e.prototype[t]=!0,e.isInstance=function(r){return!!(r&&r[t])}}function Hee(e,t){for(var r=[],n=2;n=0||a&&Be(a,l)<0)){var u=n.getShallow(l,t);u!=null&&(o[e[s][0]]=u)}}return o}}var Wee=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],Zee=vc(Wee),$ee=function(){function e(){}return e.prototype.getAreaStyle=function(t,r){return Zee(this,t,r)},e}(),sM=new Df(50);function Yee(e){if(typeof e=="string"){var t=sM.get(e);return t&&t.image}else return e}function Ck(e,t,r,n,i){if(e)if(typeof e=="string"){if(t&&t.__zrImageSrc===e||!r)return t;var a=sM.get(e),o={hostEl:r,cb:n,cbPayload:i};return a?(t=a.image,!lb(t)&&a.pending.push(o)):(t=Er.loadImage(e,iR,iR),t.__zrImageSrc=e,sM.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e;else return t}function iR(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=s;u++)l-=s;var c=Ja(o,r);return c>l&&(r="",c=0),l=e-c,i.ellipsis=r,i.ellipsisWidth=c,i.contentWidth=l,i.containerWidth=e,i}function CG(e,t,r){var n=r.containerWidth,i=r.contentWidth,a=r.fontMeasureInfo;if(!n){e.textLine="",e.isTruncated=!1;return}var o=Ja(a,t);if(o<=n){e.textLine=t,e.isTruncated=!1;return}for(var s=0;;s++){if(o<=i||s>=r.maxIterations){t+=r.ellipsis;break}var l=s===0?qee(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,l),o=Ja(a,t)}t===""&&(t=r.placeholder),e.textLine=t,e.isTruncated=!0}function qee(e,t,r){for(var n=0,i=0,a=e.length;iy&&d){var w=Math.floor(y/f);g=g||_.length>w,_=_.slice(0,w),x=_.length*f}if(i&&c&&m!=null)for(var S=SG(m,u,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),T={},M=0;M<_.length;M++)CG(T,_[M],S),_[M]=T.textLine,g=g||T.isTruncated;for(var A=y,N=0,P=Ka(u),M=0;M<_.length;M++)N=Math.max(Ja(P,_[M]),N);m==null&&(m=N);var I=m;return A+=l,I+=s,{lines:_,height:y,outerWidth:I,outerHeight:A,lineHeight:f,calculatedLineHeight:h,contentWidth:N,contentHeight:x,width:m,isTruncated:g}}var Jee=function(){function e(){}return e}(),aR=function(){function e(t){this.tokens=[],t&&(this.tokens=t)}return e}(),Qee=function(){function e(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return e}();function ete(e,t,r,n,i){var a=new Qee,o=Tk(e);if(!o)return a;var s=t.padding,l=s?s[1]+s[3]:0,u=s?s[0]+s[2]:0,c=t.width;c==null&&r!=null&&(c=r-l);var h=t.height;h==null&&n!=null&&(h=n-u);for(var f=t.overflow,d=(f==="break"||f==="breakAll")&&c!=null?{width:c,accumWidth:0,breakAll:f==="breakAll"}:null,g=wS.lastIndex=0,m;(m=wS.exec(o))!=null;){var y=m.index;y>g&&SS(a,o.substring(g,y),t,d),SS(a,m[2],t,d,m[1]),g=wS.lastIndex}gh){var $=a.lines.length;O>0?(P.tokens=P.tokens.slice(0,O),A(P,D,I),a.lines=a.lines.slice(0,N+1)):a.lines=a.lines.slice(0,N),a.isTruncated=a.isTruncated||a.lines.length<$;break e}var W=B.width,Z=W==null||W==="auto";if(typeof W=="string"&&W.charAt(W.length-1)==="%")j.percentWidth=W,_.push(j),j.contentWidth=Ja(Ka(V),j.text);else{if(Z){var X=B.backgroundColor,re=X&&X.image;re&&(re=Yee(re),lb(re)&&(j.width=Math.max(j.width,re.width*z/re.height)))}var J=S&&c!=null?c-D:null;J!=null&&J0&&g+n.accumWidth>n.width&&(c=t.split(` +`),u=!0),n.accumWidth=g}else{var m=TG(t,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=m.accumWidth+d,h=m.linesWidths,c=m.lines}}c||(c=t.split(` +`));for(var y=Ka(l),_=0;_=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var rte=Hi(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function nte(e){return tte(e)?!!rte[e]:!0}function TG(e,t,r,n,i){for(var a=[],o=[],s="",l="",u=0,c=0,h=Ka(t),f=0;fr:i+c+g>r){c?(s||l)&&(m?(s||(s=l,l="",u=0,c=u),a.push(s),o.push(c-u),l+=d,u+=g,s="",c=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(c),s=d,c=g)):m?(a.push(l),o.push(u),l=d,u=g):(a.push(d),o.push(g));continue}c+=g,m?(l+=d,u+=g):(l&&(s+=l,l="",u=0),s+=d)}return l&&(s+=l),s&&(a.push(s),o.push(c)),a.length===1&&(c+=i),{accumWidth:c,lines:a,linesWidths:o}}function oR(e,t,r,n,i,a){if(e.baseX=r,e.baseY=n,e.outerWidth=e.outerHeight=null,!!t){var o=t.width*2,s=t.height*2;Ae.set(sR,Ef(r,o,i),Zu(n,s,a),o,s),Ae.intersect(t,sR,null,lR);var l=lR.outIntersectRect;e.outerWidth=l.width,e.outerHeight=l.height,e.baseX=Ef(l.x,l.width,i,!0),e.baseY=Zu(l.y,l.height,a,!0)}}var sR=new Ae(0,0,0,0),lR={outIntersectRect:{},clamp:!0};function Tk(e){return e!=null?e+="":e=""}function ite(e){var t=Tk(e.text),r=e.font,n=Ja(Ka(r),t),i=Jg(r);return lM(e,n,i,null)}function lM(e,t,r,n){var i=new Ae(Ef(e.x||0,t,e.textAlign),Zu(e.y||0,r,e.textBaseline),t,r),a=n??(MG(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function MG(e){var t=e.stroke;return t!=null&&t!=="none"&&e.lineWidth>0}var uM="__zr_style_"+Math.round(Math.random()*10),$u={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},ub={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};$u[uM]=!0;var uR=["z","z2","invisible"],ate=["invisible"],Zi=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype._init=function(r){for(var n=Qe(r),i=0;i1e-4){s[0]=e-r,s[1]=t-n,l[0]=e+r,l[1]=t+n;return}if(Ay[0]=AS(i)*r+e,Ay[1]=MS(i)*n+t,Ly[0]=AS(a)*r+e,Ly[1]=MS(a)*n+t,u(s,Ay,Ly),c(l,Ay,Ly),i=i%eu,i<0&&(i=i+eu),a=a%eu,a<0&&(a=a+eu),i>a&&!o?a+=eu:ii&&(ky[0]=AS(d)*r+e,ky[1]=MS(d)*n+t,u(s,ky,s),c(l,ky,l))}var Nt={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},tu=[],ru=[],ka=[],Ms=[],Ia=[],Na=[],LS=Math.min,kS=Math.max,nu=Math.cos,iu=Math.sin,Io=Math.abs,cM=Math.PI,js=cM*2,IS=typeof Float32Array<"u",lv=[];function NS(e){var t=Math.round(e/cM*1e8)/1e8;return t%2*cM}function hb(e,t){var r=NS(e[0]);r<0&&(r+=js);var n=r-e[0],i=e[1];i+=n,!t&&i-r>=js?i=r+js:t&&r-i>=js?i=r-js:!t&&r>i?i=r+(js-NS(r-i)):t&&r0&&(this._ux=Io(n/ox/t)||0,this._uy=Io(n/ox/r)||0)},e.prototype.setDPR=function(t){this.dpr=t},e.prototype.setContext=function(t){this._ctx=t},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(t,r){return this._drawPendingPt(),this.addData(Nt.M,t,r),this._ctx&&this._ctx.moveTo(t,r),this._x0=t,this._y0=r,this._xi=t,this._yi=r,this},e.prototype.lineTo=function(t,r){var n=Io(t-this._xi),i=Io(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData(Nt.L,t,r),this._ctx&&a&&this._ctx.lineTo(t,r),a)this._xi=t,this._yi=r,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=r,this._pendingPtDist=o)}return this},e.prototype.bezierCurveTo=function(t,r,n,i,a,o){return this._drawPendingPt(),this.addData(Nt.C,t,r,n,i,a,o),this._ctx&&this._ctx.bezierCurveTo(t,r,n,i,a,o),this._xi=a,this._yi=o,this},e.prototype.quadraticCurveTo=function(t,r,n,i){return this._drawPendingPt(),this.addData(Nt.Q,t,r,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,r,n,i),this._xi=n,this._yi=i,this},e.prototype.arc=function(t,r,n,i,a,o){this._drawPendingPt(),lv[0]=i,lv[1]=a,hb(lv,o),i=lv[0],a=lv[1];var s=a-i;return this.addData(Nt.A,t,r,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(t,r,n,i,a,o),this._xi=nu(a)*n+t,this._yi=iu(a)*n+r,this},e.prototype.arcTo=function(t,r,n,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,r,n,i,a),this},e.prototype.rect=function(t,r,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,r,n,i),this.addData(Nt.R,t,r,n,i),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(Nt.Z);var t=this._ctx,r=this._x0,n=this._y0;return t&&t.closePath(),this._xi=r,this._yi=n,this},e.prototype.fill=function(t){t&&t.fill(),this.toStatic()},e.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(t){if(this._saveData){var r=t.length;!(this.data&&this.data.length===r)&&IS&&(this.data=new Float32Array(r));for(var n=0;n0&&o))for(var s=0;sc.length&&(this._expandData(),c=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],r=0;r11&&(this.data=new Float32Array(t)))}},e.prototype.getBoundingRect=function(){ka[0]=ka[1]=Ia[0]=Ia[1]=Number.MAX_VALUE,Ms[0]=Ms[1]=Na[0]=Na[1]=-Number.MAX_VALUE;var t=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||Io(w)>i||f===r-1)&&(m=Math.sqrt(x*x+w*w),a=y,o=_);break}case Nt.C:{var S=t[f++],T=t[f++],y=t[f++],_=t[f++],M=t[f++],A=t[f++];m=cQ(a,o,S,T,y,_,M,A,10),a=M,o=A;break}case Nt.Q:{var S=t[f++],T=t[f++],y=t[f++],_=t[f++];m=fQ(a,o,S,T,y,_,10),a=y,o=_;break}case Nt.A:var N=t[f++],P=t[f++],I=t[f++],D=t[f++],O=t[f++],j=t[f++],B=j+O;f+=1,g&&(s=nu(O)*I+N,l=iu(O)*D+P),m=kS(I,D)*LS(js,Math.abs(j)),a=nu(B)*I+N,o=iu(B)*D+P;break;case Nt.R:{s=a=t[f++],l=o=t[f++];var U=t[f++],H=t[f++];m=U*2+H*2;break}case Nt.Z:{var x=s-a,w=l-o;m=Math.sqrt(x*x+w*w),a=s,o=l;break}}m>=0&&(u[h++]=m,c+=m)}return this._pathLen=c,c},e.prototype.rebuildPath=function(t,r){var n=this.data,i=this._ux,a=this._uy,o=this._len,s,l,u,c,h,f,d=r<1,g,m,y=0,_=0,x,w=0,S,T;if(!(d&&(this._pathSegLen||this._calculateLength(),g=this._pathSegLen,m=this._pathLen,x=r*m,!x)))e:for(var M=0;M0&&(t.lineTo(S,T),w=0),A){case Nt.M:s=u=n[M++],l=c=n[M++],t.moveTo(u,c);break;case Nt.L:{h=n[M++],f=n[M++];var P=Io(h-u),I=Io(f-c);if(P>i||I>a){if(d){var D=g[_++];if(y+D>x){var O=(x-y)/D;t.lineTo(u*(1-O)+h*O,c*(1-O)+f*O);break e}y+=D}t.lineTo(h,f),u=h,c=f,w=0}else{var j=P*P+I*I;j>w&&(S=h,T=f,w=j)}break}case Nt.C:{var B=n[M++],U=n[M++],H=n[M++],V=n[M++],z=n[M++],$=n[M++];if(d){var D=g[_++];if(y+D>x){var O=(x-y)/D;Cl(u,B,H,z,O,tu),Cl(c,U,V,$,O,ru),t.bezierCurveTo(tu[1],ru[1],tu[2],ru[2],tu[3],ru[3]);break e}y+=D}t.bezierCurveTo(B,U,H,V,z,$),u=z,c=$;break}case Nt.Q:{var B=n[M++],U=n[M++],H=n[M++],V=n[M++];if(d){var D=g[_++];if(y+D>x){var O=(x-y)/D;Qp(u,B,H,O,tu),Qp(c,U,V,O,ru),t.quadraticCurveTo(tu[1],ru[1],tu[2],ru[2]);break e}y+=D}t.quadraticCurveTo(B,U,H,V),u=H,c=V;break}case Nt.A:var W=n[M++],Z=n[M++],X=n[M++],re=n[M++],J=n[M++],oe=n[M++],le=n[M++],De=!n[M++],be=X>re?X:re,ve=Io(X-re)>.001,Ne=J+oe,_e=!1;if(d){var D=g[_++];y+D>x&&(Ne=J+oe*(x-y)/D,_e=!0),y+=D}if(ve&&t.ellipse?t.ellipse(W,Z,X,re,le,J,Ne,De):t.arc(W,Z,be,J,Ne,De),_e)break e;N&&(s=nu(J)*X+W,l=iu(J)*re+Z),u=nu(Ne)*X+W,c=iu(Ne)*re+Z;break;case Nt.R:s=u=n[M],l=c=n[M+1],h=n[M++],f=n[M++];var ke=n[M++],ct=n[M++];if(d){var D=g[_++];if(y+D>x){var Fe=x-y;t.moveTo(h,f),t.lineTo(h+LS(Fe,ke),f),Fe-=ke,Fe>0&&t.lineTo(h+ke,f+LS(Fe,ct)),Fe-=ct,Fe>0&&t.lineTo(h+kS(ke-Fe,0),f+ct),Fe-=ke,Fe>0&&t.lineTo(h,f+kS(ct-Fe,0));break e}y+=D}t.rect(h,f,ke,ct);break;case Nt.Z:if(d){var D=g[_++];if(y+D>x){var O=(x-y)/D;t.lineTo(u*(1-O)+s*O,c*(1-O)+l*O);break e}y+=D}t.closePath(),u=s,c=l}}},e.prototype.clone=function(){var t=new e,r=this.data;return t.data=r.slice?r.slice():Array.prototype.slice.call(r),t._len=this._len,t},e.prototype.canSave=function(){return!!this._saveData},e.CMD=Nt,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),e}();function Fs(e,t,r,n,i,a,o){if(i===0)return!1;var s=i,l=0,u=e;if(o>t+s&&o>n+s||oe+s&&a>r+s||at+h&&c>n+h&&c>a+h&&c>s+h||ce+h&&u>r+h&&u>i+h&&u>o+h||ut+u&&l>n+u&&l>a+u||le+u&&s>r+u&&s>i+u||sr||c+ui&&(i+=uv);var f=Math.atan2(l,s);return f<0&&(f+=uv),f>=n&&f<=i||f+uv>=n&&f+uv<=i}function Oo(e,t,r,n,i,a){if(a>t&&a>n||ai?s:0}var As=ho.CMD,au=Math.PI*2,fte=1e-4;function dte(e,t){return Math.abs(e-t)t&&u>n&&u>a&&u>s||u1&&vte(),d=Nr(t,n,a,s,Li[0]),f>1&&(g=Nr(t,n,a,s,Li[1]))),f===2?yt&&s>n&&s>a||s=0&&u<=1){for(var c=0,h=Gr(t,n,a,u),f=0;fr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);Mn[0]=-l,Mn[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=au-1e-4){n=0,i=au;var c=a?1:-1;return o>=Mn[0]+e&&o<=Mn[1]+e?c:0}if(n>i){var h=n;n=i,i=h}n<0&&(n+=au,i+=au);for(var f=0,d=0;d<2;d++){var g=Mn[d];if(g+e>o){var m=Math.atan2(s,g),c=a?1:-1;m<0&&(m=au+m),(m>=n&&m<=i||m+au>=n&&m+au<=i)&&(m>Math.PI/2&&m1&&(r||(s+=Oo(l,u,c,h,n,i))),y&&(l=a[g],u=a[g+1],c=l,h=u),m){case As.M:c=a[g++],h=a[g++],l=c,u=h;break;case As.L:if(r){if(Fs(l,u,a[g],a[g+1],t,n,i))return!0}else s+=Oo(l,u,a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case As.C:if(r){if(cte(l,u,a[g++],a[g++],a[g++],a[g++],a[g],a[g+1],t,n,i))return!0}else s+=pte(l,u,a[g++],a[g++],a[g++],a[g++],a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case As.Q:if(r){if(AG(l,u,a[g++],a[g++],a[g],a[g+1],t,n,i))return!0}else s+=gte(l,u,a[g++],a[g++],a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case As.A:var _=a[g++],x=a[g++],w=a[g++],S=a[g++],T=a[g++],M=a[g++];g+=1;var A=!!(1-a[g++]);f=Math.cos(T)*w+_,d=Math.sin(T)*S+x,y?(c=f,h=d):s+=Oo(l,u,f,d,n,i);var N=(n-_)*S/w+_;if(r){if(hte(_,x,S,T,T+M,A,t,N,i))return!0}else s+=mte(_,x,S,T,T+M,A,N,i);l=Math.cos(T+M)*w+_,u=Math.sin(T+M)*S+x;break;case As.R:c=l=a[g++],h=u=a[g++];var P=a[g++],I=a[g++];if(f=c+P,d=h+I,r){if(Fs(c,h,f,h,t,n,i)||Fs(f,h,f,d,t,n,i)||Fs(f,d,c,d,t,n,i)||Fs(c,d,c,h,t,n,i))return!0}else s+=Oo(f,h,f,d,n,i),s+=Oo(c,d,c,h,n,i);break;case As.Z:if(r){if(Fs(l,u,c,h,t,n,i))return!0}else s+=Oo(l,u,c,h,n,i);l=c,u=h;break}}return!r&&!dte(u,h)&&(s+=Oo(l,u,c,h,n,i)||0),s!==0}function yte(e,t,r){return LG(e,0,!1,t,r)}function _te(e,t,r,n){return LG(e,t,!0,r,n)}var hx=Le({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},$u),xte={style:Le({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},ub.style)},PS=us.concat(["invisible","culling","z","z2","zlevel","parent"]),Je=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.update=function(){var r=this;e.prototype.update.call(this);var n=this.style;if(n.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(l){r.buildPath(l,r.shape)}),i.silent=!0;var a=i.style;for(var o in n)a[o]!==n[o]&&(a[o]=n[o]);a.fill=n.fill?n.decal:null,a.decal=null,a.shadowColor=null,n.strokeFirst&&(a.stroke=null);for(var s=0;s.5?eM:n>.2?HQ:tM}else if(r)return tM}return eM},t.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(ue(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=rg(r,0)0))},t.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},t.prototype.getBoundingRect=function(){var r=this._rect,n=this.style,i=!r;if(i){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&Eh)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||i){s.copy(r);var l=n.strokeNoScale?this.getLineScale():1,u=n.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;u=Math.max(u,c??4)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return r},t.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect(),o=this.style;if(r=i[0],n=i[1],a.contain(r,n)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),_te(s,l/u,r,n)))return!0}if(this.hasFill())return yte(s,r,n)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=Eh,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(r){return this.animate("shape",r)},t.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(r,n){r==="shape"?this.setShape(n):e.prototype.attrKV.call(this,r,n)},t.prototype.setShape=function(r,n){var i=this.shape;return i||(i=this.shape={}),typeof r=="string"?i[r]=n:ee(i,r),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&Eh)},t.prototype.createStyle=function(r){return Kg(hx,r)},t.prototype._innerSaveToNormal=function(r){e.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=ee({},this.shape))},t.prototype._applyStateObj=function(r,n,i,a,o,s){if(e.prototype._applyStateObj.call(this,r,n,i,a,o,s),this.__inHover!==rb){var l=!(n&&a),u;if(n&&n.shape?o?a?u=n.shape:(u=ee({},i.shape),ee(u,n.shape)):(u=ee({},a?this.shape:i.shape),ee(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=ee({},this.shape);for(var c={},h=Qe(u),f=0;fi&&(h=s+l,s*=i/h,l*=i/h),u+c>i&&(h=u+c,u*=i/h,c*=i/h),l+u>a&&(h=l+u,l*=a/h,u*=a/h),s+c>a&&(h=s+c,s*=a/h,c*=a/h),e.moveTo(r+s,n),e.lineTo(r+i-l,n),l!==0&&e.arc(r+i-l,n+l,l,-Math.PI/2,0),e.lineTo(r+i,n+a-u),u!==0&&e.arc(r+i-u,n+a-u,u,0,Math.PI/2),e.lineTo(r+c,n+a),c!==0&&e.arc(r+c,n+a-c,c,Math.PI/2,Math.PI),e.lineTo(r,n+s),s!==0&&e.arc(r+s,n+s,s,Math.PI,Math.PI*1.5),e.closePath()}var Jh=Math.round;function fb(e,t,r){if(t){var n=t.x1,i=t.x2,a=t.y1,o=t.y2;e.x1=n,e.x2=i,e.y1=a,e.y2=o;var s=r&&r.lineWidth;return s&&(Jh(n*2)===Jh(i*2)&&(e.x1=e.x2=li(n,s,!0)),Jh(a*2)===Jh(o*2)&&(e.y1=e.y2=li(a,s,!0))),e}}function kG(e,t,r){if(t){var n=t.x,i=t.y,a=t.width,o=t.height;e.x=n,e.y=i,e.width=a,e.height=o;var s=r&&r.lineWidth;return s&&(e.x=li(n,s,!0),e.y=li(i,s,!0),e.width=Math.max(li(n+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(li(i+o,s,!1)-e.y,o===0?0:1)),e}}function li(e,t,r){if(!t)return e;var n=Jh(e*2);return(n+Jh(t))%2===0?n/2:(n+(r?1:-1))/2}var Mte=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),Ate={},Ye=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new Mte},t.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=kG(Ate,n,this.style);i=l.x,a=l.y,o=l.width,s=l.height,l.r=n.r,n=l}else i=n.x,a=n.y,o=n.width,s=n.height;n.r?Tte(r,n):r.rect(i,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(Je);Ye.prototype.type="rect";var vR={fill:"#000"},pR=2,Pa={},Lte={style:Le({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},ub.style)},rt=function(e){q(t,e);function t(r){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=vR,n.attr(r),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r0,O=0;O=0&&(B=M[j],B.align==="right");)this._placeToken(B,r,N,_,O,"right",w),P-=B.width,O-=B.width,j--;for(D+=(c-(D-y)-(x-O)-P)/2;I<=j;)B=M[I],this._placeToken(B,r,N,_,D+B.width/2,"center",w),D+=B.width,I++;_+=N}},t.prototype._placeToken=function(r,n,i,a,o,s,l){var u=n.rich[r.styleName]||{};u.text=r.text;var c=r.verticalAlign,h=a+i/2;c==="top"?h=a+r.height/2:c==="bottom"&&(h=a+i-r.height/2);var f=!r.isLineHolder&&DS(u);f&&this._renderBackground(u,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,h-r.height/2,r.width,r.height);var d=!!u.backgroundColor,g=r.textPadding;g&&(o=bR(o,s,g),h-=r.height/2-g[0]-r.innerHeight/2);var m=this._getOrCreateChild(Rf),y=m.createStyle();m.useStyle(y);var _=this._defaultStyle,x=!1,w=0,S=!1,T=xR("fill"in u?u.fill:"fill"in n?n.fill:(x=!0,_.fill)),M=_R("stroke"in u?u.stroke:"stroke"in n?n.stroke:!d&&!l&&(!_.autoStroke||x)?(w=pR,S=!0,_.stroke):null),A=u.textShadowBlur>0||n.textShadowBlur>0;y.text=r.text,y.x=o,y.y=h,A&&(y.shadowBlur=u.textShadowBlur||n.textShadowBlur||0,y.shadowColor=u.textShadowColor||n.textShadowColor||"transparent",y.shadowOffsetX=u.textShadowOffsetX||n.textShadowOffsetX||0,y.shadowOffsetY=u.textShadowOffsetY||n.textShadowOffsetY||0),y.textAlign=s,y.textBaseline="middle",y.font=r.font||ss,y.opacity=qn(u.opacity,n.opacity,1),mR(y,u),M&&(y.lineWidth=qn(u.lineWidth,n.lineWidth,w),y.lineDash=ye(u.lineDash,n.lineDash),y.lineDashOffset=n.lineDashOffset||0,y.stroke=M),T&&(y.fill=T),m.setBoundingRect(lM(y,r.contentWidth,r.contentHeight,S?0:null))},t.prototype._renderBackground=function(r,n,i,a,o,s){var l=r.backgroundColor,u=r.borderWidth,c=r.borderColor,h=l&&l.image,f=l&&!h,d=r.borderRadius,g=this,m,y;if(f||r.lineHeight||u&&c){m=this._getOrCreateChild(Ye),m.useStyle(m.createStyle()),m.style.fill=null;var _=m.shape;_.x=i,_.y=a,_.width=o,_.height=s,_.r=d,m.dirtyShape()}if(f){var x=m.style;x.fill=l||null,x.fillOpacity=ye(r.fillOpacity,1)}else if(h){y=this._getOrCreateChild(Or),y.onload=function(){g.dirtyStyle()};var w=y.style;w.image=l.image,w.x=i,w.y=a,w.width=o,w.height=s}if(u&&c){var x=m.style;x.lineWidth=u,x.stroke=c,x.strokeOpacity=ye(r.strokeOpacity,1),x.lineDash=r.borderDash,x.lineDashOffset=r.borderDashOffset||0,m.strokeContainThreshold=0,m.hasFill()&&m.hasStroke()&&(x.strokeFirst=!0,x.lineWidth*=2)}var S=(m||y).style;S.shadowBlur=r.shadowBlur||0,S.shadowColor=r.shadowColor||"transparent",S.shadowOffsetX=r.shadowOffsetX||0,S.shadowOffsetY=r.shadowOffsetY||0,S.opacity=qn(r.opacity,n.opacity,1)},t.makeFont=function(r){var n="";return NG(r)&&(n=[r.fontStyle,r.fontWeight,IG(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&oi(n)||r.textFont||r.font},t}(Zi),kte={left:!0,right:1,center:1},Ite={top:1,bottom:1,middle:1},gR=["fontStyle","fontWeight","fontSize","fontFamily"];function IG(e){return typeof e=="string"&&(e.indexOf("px")!==-1||e.indexOf("rem")!==-1||e.indexOf("em")!==-1)?e:isNaN(+e)?nk+"px":e+"px"}function mR(e,t){for(var r=0;r=0,a=!1;if(e instanceof Je){var o=OG(e),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(dh(s)||dh(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=ee({},n),u=ee({},u),u.fill=s):!dh(u.fill)&&dh(s)?(a=!0,n=ee({},n),u=ee({},u),u.fill=ix(s)):!dh(u.stroke)&&dh(l)&&(a||(n=ee({},n),u=ee({},u)),u.stroke=ix(l)),n.style=u}}if(n&&n.z2==null){a||(n=ee({},n));var c=e.z2EmphasisLift;n.z2=e.z2+(c??cd)}return n}function zte(e,t,r){if(r&&r.z2==null){r=ee({},r);var n=e.z2SelectLift;r.z2=e.z2+(n??Dte)}return r}function Bte(e,t,r){var n=Be(e.currentStates,t)>=0,i=e.style.opacity,a=n?null:jte(e,["opacity"],t,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=ee({},r),o=ee({opacity:n?i:a.opacity*.1},o),r.style=o),r}function ES(e,t){var r=this.states[e];if(this.style){if(e==="emphasis")return Ote(this,e,t,r);if(e==="blur")return Bte(this,e,r);if(e==="select")return zte(this,e,r)}return r}function pc(e){e.stateProxy=ES;var t=e.getTextContent(),r=e.getTextGuideLine();t&&(t.stateProxy=ES),r&&(r.stateProxy=ES)}function MR(e,t){!UG(e,t)&&!e.__highByOuter&&xs(e,zG)}function AR(e,t){!UG(e,t)&&!e.__highByOuter&&xs(e,BG)}function hs(e,t){e.__highByOuter|=1<<(t||0),xs(e,zG)}function fs(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&xs(e,BG)}function VG(e){xs(e,kk)}function Ik(e){xs(e,FG)}function GG(e){xs(e,Ete)}function HG(e){xs(e,Rte)}function UG(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function WG(e){var t=e.getModel(),r=[],n=[];t.eachComponent(function(i,a){var o=Mk(a),s=jG(e,a),l=i==="series";!l&&n.push(s),o.isBlured&&(s.group.traverse(function(u){FG(u)}),l&&r.push(a)),o.isBlured=!1}),E(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(r,!1,t)})}function dM(e,t,r,n){var i=n.getModel();r=r||"coordinateSystem";function a(u,c){for(var h=0;h0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),t.push(s)}})}),t}function vl(e,t,r){Bu(e,!0),xs(e,pc),pM(e,t,r)}function Wte(e){Bu(e,!1)}function Vt(e,t,r,n){n?Wte(e):vl(e,t,r)}function pM(e,t,r){var n=Re(e);t!=null?(n.focus=t,n.blurScope=r):n.focus&&(n.focus=null)}var kR=["emphasis","blur","select"],Zte={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Mr(e,t,r,n){r=r||"itemStyle";for(var i=0;i1&&(o*=RS(g),s*=RS(g));var m=(i===a?-1:1)*RS((o*o*(s*s)-o*o*(d*d)-s*s*(f*f))/(o*o*(d*d)+s*s*(f*f)))||0,y=m*o*d/s,_=m*-s*f/o,x=(e+r)/2+Ny(h)*y-Iy(h)*_,w=(t+n)/2+Iy(h)*y+Ny(h)*_,S=DR([1,0],[(f-y)/o,(d-_)/s]),T=[(f-y)/o,(d-_)/s],M=[(-1*f-y)/o,(-1*d-_)/s],A=DR(T,M);if(mM(T,M)<=-1&&(A=cv),mM(T,M)>=1&&(A=0),A<0){var N=Math.round(A/cv*1e6)/1e6;A=cv*2+N%2*cv}c.addData(u,x,w,o,s,S,A,h,a)}var Jte=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,Qte=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function ere(e){var t=new ho;if(!e)return t;var r=0,n=0,i=r,a=n,o,s=ho.CMD,l=e.match(Jte);if(!l)return t;for(var u=0;uB*B+U*U&&(N=I,P=D),{cx:N,cy:P,x0:-c,y0:-h,x1:N*(i/T-1),y1:P*(i/T-1)}}function sre(e){var t;if(ne(e)){var r=e.length;if(!r)return e;r===1?t=[e[0],e[0],0,0]:r===2?t=[e[0],e[0],e[1],e[1]]:r===3?t=e.concat(e[2]):t=e}else t=[e,e,e,e];return t}function lre(e,t){var r,n=Zv(t.r,0),i=Zv(t.r0||0,0),a=n>0,o=i>0;if(!(!a&&!o)){if(a||(n=i,i=0),i>n){var s=n;n=i,i=s}var l=t.startAngle,u=t.endAngle;if(!(isNaN(l)||isNaN(u))){var c=t.cx,h=t.cy,f=!!t.clockwise,d=RR(u-l),g=d>jS&&d%jS;if(g>ia&&(d=g),!(n>ia))e.moveTo(c,h);else if(d>jS-ia)e.moveTo(c+n*ph(l),h+n*ou(l)),e.arc(c,h,n,l,u,!f),i>ia&&(e.moveTo(c+i*ph(u),h+i*ou(u)),e.arc(c,h,i,u,l,f));else{var m=void 0,y=void 0,_=void 0,x=void 0,w=void 0,S=void 0,T=void 0,M=void 0,A=void 0,N=void 0,P=void 0,I=void 0,D=void 0,O=void 0,j=void 0,B=void 0,U=n*ph(l),H=n*ou(l),V=i*ph(u),z=i*ou(u),$=d>ia;if($){var W=t.cornerRadius;W&&(r=sre(W),m=r[0],y=r[1],_=r[2],x=r[3]);var Z=RR(n-i)/2;if(w=Da(Z,_),S=Da(Z,x),T=Da(Z,m),M=Da(Z,y),P=A=Zv(w,S),I=N=Zv(T,M),(A>ia||N>ia)&&(D=n*ph(u),O=n*ou(u),j=i*ph(l),B=i*ou(l),dia){var ve=Da(_,P),Ne=Da(x,P),_e=Py(j,B,U,H,n,ve,f),ke=Py(D,O,V,z,n,Ne,f);e.moveTo(c+_e.cx+_e.x0,h+_e.cy+_e.y0),P0&&e.arc(c+_e.cx,h+_e.cy,ve,hn(_e.y0,_e.x0),hn(_e.y1,_e.x1),!f),e.arc(c,h,n,hn(_e.cy+_e.y1,_e.cx+_e.x1),hn(ke.cy+ke.y1,ke.cx+ke.x1),!f),Ne>0&&e.arc(c+ke.cx,h+ke.cy,Ne,hn(ke.y1,ke.x1),hn(ke.y0,ke.x0),!f))}else e.moveTo(c+U,h+H),e.arc(c,h,n,l,u,!f);if(!(i>ia)||!$)e.lineTo(c+V,h+z);else if(I>ia){var ve=Da(m,I),Ne=Da(y,I),_e=Py(V,z,D,O,i,-Ne,f),ke=Py(U,H,j,B,i,-ve,f);e.lineTo(c+_e.cx+_e.x0,h+_e.cy+_e.y0),I0&&e.arc(c+_e.cx,h+_e.cy,Ne,hn(_e.y0,_e.x0),hn(_e.y1,_e.x1),!f),e.arc(c,h,i,hn(_e.cy+_e.y1,_e.cx+_e.x1),hn(ke.cy+ke.y1,ke.cx+ke.x1),f),ve>0&&e.arc(c+ke.cx,h+ke.cy,ve,hn(ke.y1,ke.x1),hn(ke.y0,ke.x0),!f))}else e.lineTo(c+V,h+z),e.arc(c,h,i,u,l,f)}e.closePath()}}}var ure=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return e}(),on=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new ure},t.prototype.buildPath=function(r,n){lre(r,n)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(Je);on.prototype.type="sector";var cre=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),hd=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new cre},t.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.PI*2;r.moveTo(i+n.r,a),r.arc(i,a,n.r,0,o,!1),r.moveTo(i+n.r0,a),r.arc(i,a,n.r0,0,o,!0)},t}(Je);hd.prototype.type="ring";function hre(e,t,r,n){var i=[],a=[],o=[],s=[],l,u,c,h;if(n){c=[1/0,1/0],h=[-1/0,-1/0];for(var f=0,d=e.length;f=2){if(n){var a=hre(i,n,r,t.smoothConstraint);e.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(r?o:o-1);s++){var l=a[s*2],u=a[s*2+1],c=i[(s+1)%o];e.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{e.moveTo(i[0][0],i[0][1]);for(var s=1,h=i.length;slu[1]){if(a=!1,Fr.negativeSize||n)return a;var l=Dy(lu[0]-su[1]),u=Dy(su[0]-lu[1]);OS(l,u)>Ry.len()&&(l=u||!Fr.bidirectional)&&(Pe.scale(Ey,s,-u*i),Fr.useDir&&Fr.calcDirMTV()))}}return a},e.prototype._getProjMinMaxOnAxis=function(t,r,n){for(var i=this._axes[t],a=this._origin,o=r[0].dot(i)+a[t],s=o,l=o,u=1;u0){var h=c.duration,f=c.delay,d=c.easing,g={duration:h,delay:f||0,easing:d,done:a,force:!!a||!!o,setToFinal:!u,scope:e,during:o};s?t.animateFrom(r,g):t.animateTo(r,g)}else t.stopAnimation(),!s&&t.attr(r),o&&o(1),a&&a()}function ot(e,t,r,n,i,a){Ek("update",e,t,r,n,i,a)}function Rt(e,t,r,n,i,a){Ek("enter",e,t,r,n,i,a)}function vf(e){if(!e.__zr)return!0;for(var t=0;t$t(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function zR(e){return!e.isGroup}function Mre(e){return e.shape!=null}function im(e,t,r){if(!e||!t)return;function n(o){var s={};return o.traverse(function(l){zR(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return Mre(o)&&(s.shape=Se(o.shape)),s}var a=n(e);t.traverse(function(o){if(zR(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),ot(o,l,r,Re(o).dataIndex)}}})}function Ok(e,t){return ae(e,function(r){var n=r[0];n=$e(n,t.x),n=_t(n,t.x+t.width);var i=r[1];return i=$e(i,t.y),i=_t(i,t.y+t.height),[n,i]})}function uH(e,t){var r=$e(e.x,t.x),n=_t(e.x+e.width,t.x+t.width),i=$e(e.y,t.y),a=_t(e.y+e.height,t.y+t.height);if(n>=r&&a>=i)return{x:r,y:i,width:n-r,height:a-i}}function pd(e,t,r){var n=ee({rectHover:!0},t),i=n.style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},e)return e.indexOf("image://")===0?(i.image=e.slice(8),Le(i,r),new Or(n)):jf(e.replace("path://",""),n,r,"center")}function $v(e,t,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var y=zS(d,g,c,h)/f;return!(y<0||y>1)}function zS(e,t,r,n){return e*n-r*t}function Are(e){return e<=1e-6&&e>=-1e-6}function gc(e,t,r,n,i){return t==null||(nt(t)?Ht[0]=Ht[1]=Ht[2]=Ht[3]=t:(Ht[0]=t[0],Ht[1]=t[1],Ht[2]=t[2],Ht[3]=t[3]),n&&(Ht[0]=$e(0,Ht[0]),Ht[1]=$e(0,Ht[1]),Ht[2]=$e(0,Ht[2]),Ht[3]=$e(0,Ht[3])),r&&(Ht[0]=-Ht[0],Ht[1]=-Ht[1],Ht[2]=-Ht[2],Ht[3]=-Ht[3]),BR(e,Ht,"x","width",3,1,i&&i[0]||0),BR(e,Ht,"y","height",0,2,i&&i[1]||0)),e}var Ht=[0,0,0,0];function BR(e,t,r,n,i,a,o){var s=t[a]+t[i],l=e[n];e[n]+=s,o=$e(0,_t(o,l)),e[n]=0?-t[i]:t[a]>=0?l+t[a]:$t(s)>1e-8?(l-o)*t[i]/s:0):e[r]-=t[i]}function bs(e){var t=e.itemTooltipOption,r=e.componentModel,n=e.itemName,i=ue(t)?{formatter:t}:t,a=r.mainType,o=r.componentIndex,s={componentType:a,name:n,$vars:["name"]};s[a+"Index"]=o;var l=e.formatterParamsExtra;l&&E(Qe(l),function(c){ge(s,c)||(s[c]=l[c],s.$vars.push(c))});var u=Re(e.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:n,option:Le({content:n,encodeHTMLContent:!0,formatterParams:s},i)}}function _M(e,t){var r;e.isGroup&&(r=t(e)),r||e.traverse(t)}function Ol(e,t){if(e)if(ne(e))for(var r=0;rt&&(t=o),ot&&(r=t=0),{min:r,max:t}}function gb(e,t,r){fH(e,t,r,-1/0)}function fH(e,t,r,n){if(e.ignoreModelZ)return n;var i=e.getTextContent(),a=e.getTextGuideLine(),o=e.isGroup;if(o)for(var s=e.childrenRef(),l=0;l=0&&s.push(l)}),s}}function zl(e,t){return Ge(Ge({},e,!0),t,!0)}const Bre={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},Fre={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var gx="ZH",Gk="EN",pf=Gk,l_={},Hk={},yH=et.domSupported?function(){var e=(document.documentElement.lang||navigator.language||navigator.browserLanguage||pf).toUpperCase();return e.indexOf(gx)>-1?gx:pf}():pf;function Uk(e,t){e=e.toUpperCase(),Hk[e]=new Ke(t),l_[e]=t}function Vre(e){if(ue(e)){var t=l_[e.toUpperCase()]||{};return e===gx||e===Gk?Se(t):Ge(Se(t),Se(l_[pf]),!1)}else return Ge(Se(e),Se(l_[pf]),!1)}function wM(e){return Hk[e]}function Gre(){return Hk[pf]}Uk(Gk,Bre);Uk(gx,Fre);var SM=null;function Hre(e){SM||(SM=e)}function hr(){return SM}function _H(e,t){var r=hr(),n=t.breakOption,i=t.breakParsed;return!i&&r&&(i=r.parseAxisBreakOption(n,e)),i}function mx(e){var t=e.brk;return t?t.breaks:[]}function yx(e){var t=e.brk;return t?t.hasBreaks():!1}var Wk=1e3,Zk=Wk*60,bp=Zk*60,Di=bp*24,UR=Di*365,Ure={year:/({yyyy}|{yy})/,month:/({MMMM}|{MMM}|{MM}|{M})/,day:/({dd}|{d})/,hour:/({HH}|{H}|{hh}|{h})/,minute:/({mm}|{m})/,second:/({ss}|{s})/,millisecond:/({SSS}|{S})/},u_={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},Wre="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",Oy="{yyyy}-{MM}-{dd}",WR={year:"{yyyy}",month:"{yyyy}-{MM}",day:Oy,hour:Oy+" "+u_.hour,minute:Oy+" "+u_.minute,second:Oy+" "+u_.second,millisecond:Wre},ri=["year","month","day","hour","minute","second","millisecond"],Zre=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function $re(e){return!ue(e)&&!Ce(e)?Yre(e):e}function Yre(e){e=e||{};var t={},r=!0;return E(ri,function(n){r&&(r=e[n]==null)}),E(ri,function(n,i){var a=e[n];t[n]={};for(var o=null,s=i;s>=0;s--){var l=ri[s],u=Ie(a)&&!ne(a)?a[l]:a,c=void 0;ne(u)?(c=u.slice(),o=c[0]||""):ue(u)?(o=u,c=[o]):(o==null?o=u_[n]:Ure[l].test(o)||(o=t[l][l][0]+" "+o),c=[o],r&&(c[1]="{primary|"+o+"}")),t[n][l]=c}}),t}function An(e,t){return e+="","0000".substr(0,t-e.length)+e}function wp(e){switch(e){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return e}}function Xre(e){return e===wp(e)}function qre(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function am(e,t,r,n){var i=xo(e),a=i[xH(r)](),o=i[$k(r)]()+1,s=Math.floor((o-1)/3)+1,l=i[Yk(r)](),u=i["get"+(r?"UTC":"")+"Day"](),c=i[Xk(r)](),h=(c-1)%12+1,f=i[qk(r)](),d=i[Kk(r)](),g=i[Jk(r)](),m=c>=12?"pm":"am",y=m.toUpperCase(),_=n instanceof Ke?n:wM(n||yH)||Gre(),x=_.getModel("time"),w=x.get("month"),S=x.get("monthAbbr"),T=x.get("dayOfWeek"),M=x.get("dayOfWeekAbbr");return(t||"").replace(/{a}/g,m+"").replace(/{A}/g,y+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,An(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,w[o-1]).replace(/{MMM}/g,S[o-1]).replace(/{MM}/g,An(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,An(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,T[u]).replace(/{ee}/g,M[u]).replace(/{e}/g,u+"").replace(/{HH}/g,An(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,An(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,An(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,An(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,An(g,3)).replace(/{S}/g,g+"")}function Kre(e,t,r,n,i){var a=null;if(ue(r))a=r;else if(Ce(r)){var o={time:e.time,level:e.time?e.time.level:0},s=hr();s&&s.makeAxisLabelFormatterParamBreak(o,e.break),a=r(e.value,t,o)}else{var l=e.time;if(l){var u=r[l.lowerTimeUnit][l.upperTimeUnit];a=u[Math.min(l.level,u.length-1)]||""}else{var c=gf(e.value,i);a=r[c][c][0]}}return am(new Date(e.value),a,i,n)}function gf(e,t){var r=xo(e),n=r[$k(t)]()+1,i=r[Yk(t)](),a=r[Xk(t)](),o=r[qk(t)](),s=r[Kk(t)](),l=r[Jk(t)](),u=l===0,c=u&&s===0,h=c&&o===0,f=h&&a===0,d=f&&i===1,g=d&&n===1;return g?"year":d?"month":f?"day":h?"hour":c?"minute":u?"second":"millisecond"}function _x(e,t,r){switch(t){case"year":e[bH(r)](0);case"month":e[wH(r)](1);case"day":e[SH(r)](0);case"hour":e[CH(r)](0);case"minute":e[TH(r)](0);case"second":e[MH(r)](0)}return e}function xH(e){return e?"getUTCFullYear":"getFullYear"}function $k(e){return e?"getUTCMonth":"getMonth"}function Yk(e){return e?"getUTCDate":"getDate"}function Xk(e){return e?"getUTCHours":"getHours"}function qk(e){return e?"getUTCMinutes":"getMinutes"}function Kk(e){return e?"getUTCSeconds":"getSeconds"}function Jk(e){return e?"getUTCMilliseconds":"getMilliseconds"}function Jre(e){return e?"setUTCFullYear":"setFullYear"}function bH(e){return e?"setUTCMonth":"setMonth"}function wH(e){return e?"setUTCDate":"setDate"}function SH(e){return e?"setUTCHours":"setHours"}function CH(e){return e?"setUTCMinutes":"setMinutes"}function TH(e){return e?"setUTCSeconds":"setSeconds"}function MH(e){return e?"setUTCMilliseconds":"setMilliseconds"}function Qre(e,t,r,n,i,a,o,s){var l=new rt({style:{text:e,font:t,align:r,verticalAlign:n,padding:i,rich:a,overflow:o?"truncate":null,lineHeight:s}});return l.getBoundingRect()}function Qk(e){if(!yk(e))return ue(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function eI(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,function(r,n){return n.toUpperCase()}),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var md=qg;function CM(e,t,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(c){return c&&oi(c)?c:"-"}function a(c){return Wi(c)}var o=t==="time",s=e instanceof Date;if(o||s){var l=o?xo(e):e;if(isNaN(+l)){if(s)return"-"}else return am(l,n,r)}if(t==="ordinal")return q_(e)?i(e):nt(e)&&a(e)?e+"":"-";var u=co(e);return a(u)?Qk(u):q_(e)?i(e):typeof e=="boolean"?e+"":"-"}var ZR=["a","b","c","d","e","f","g"],VS=function(e,t){return"{"+e+(t??"")+"}"};function tI(e,t,r){ne(t)||(t=[t]);var n=t.length;if(!n)return"";for(var i=t[0].$vars||[],a=0;a':'';var o=r.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function ene(e,t,r){(e==="week"||e==="month"||e==="quarter"||e==="half-year"||e==="year")&&(e=`MM-dd +yyyy`);var n=xo(t),i=r?"getUTC":"get",a=n[i+"FullYear"](),o=n[i+"Month"]()+1,s=n[i+"Date"](),l=n[i+"Hours"](),u=n[i+"Minutes"](),c=n[i+"Seconds"](),h=n[i+"Milliseconds"]();return e=e.replace("MM",An(o,2)).replace("M",o).replace("yyyy",a).replace("yy",An(a%100+"",2)).replace("dd",An(s,2)).replace("d",s).replace("hh",An(l,2)).replace("h",l).replace("mm",An(u,2)).replace("m",u).replace("ss",An(c,2)).replace("s",c).replace("SSS",An(h,3)),e}function tne(e){return e&&e.charAt(0).toUpperCase()+e.substr(1)}function yc(e,t){return t=t||"transparent",ue(e)?e:Ie(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function xx(e,t){if(t==="_blank"||t==="blank"){var r=window.open();r.opener=null,r.location.href=e}else window.open(e,t)}var c_={},GS={},yd=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(t,r){this._nonSeriesBoxMasterList=n(c_),this._normalMasterList=n(GS);function n(i,a){var o=[];return E(i,function(s,l){var u=s.create(t,r);o=o.concat(u||[])}),o}},e.prototype.update=function(t,r){E(this._normalMasterList,function(n){n.update&&n.update(t,r)})},e.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},e.register=function(t,r){if(t==="matrix"||t==="calendar"){c_[t]=r;return}GS[t]=r},e.get=function(t){return GS[t]||c_[t]},e}();function rne(e){return!!c_[e]}var nne=1,kH=2;function ine(e){IH.set(e.fullType,{getCoord2:void 0}).getCoord2=e.getCoord2}var IH=pe();function NH(e){var t=e.getShallow("coord",!0),r=nne;if(t==null){var n=IH.get(e.type);n&&n.getCoord2&&(r=kH,t=n.getCoord2(e))}return{coord:t,from:r}}var mf=0,h_=1,PH=2;function DH(e,t){var r=e.getShallow("coordinateSystem"),n=e.getShallow("coordinateSystemUsage",!0),i=mf;if(r){var a=e.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=h_,a||(i=mf)):n==="box"&&(i=PH,!a&&!rne(r)&&(i=mf))}return{coordSysType:r,kind:i}}function om(e){var t=e.targetModel,r=e.coordSysType,n=e.coordSysProvider,i=e.isDefaultDataCoordSys;e.allowNotFound;var a=DH(t),o=a.kind,s=a.coordSysType;if(i&&o!==h_&&(o=h_,s=r),o===mf||s!==r)return mf;var l=n(r,t);return l?(o===h_?t.coordinateSystem=l:t.boxCoordinateSystem=l,o):mf}var EH=function(e,t){var r=t.getReferringComponents(e,Kt).models[0];return r&&r.coordinateSystem},f_=E,RH=["left","right","top","bottom","width","height"],Fu=[["width","left","right"],["height","top","bottom"]];function rI(e,t,r,n,i){var a=0,o=0;n==null&&(n=1/0),i==null&&(i=1/0);var s=0;t.eachChild(function(l,u){var c=l.getBoundingRect(),h=t.childAt(u+1),f=h&&h.getBoundingRect(),d,g;if(e==="horizontal"){var m=c.width+(f?-f.x+c.x:0);d=a+m,d>n||l.newline?(a=0,d=m,o+=s+r,s=c.height):s=Math.max(s,c.height)}else{var y=c.height+(f?-f.y+c.y:0);g=o+y,g>i||l.newline?(a+=s+r,o=0,g=y,s=c.width):s=Math.max(s,c.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),e==="horizontal"?a=d+r:o=g+r)})}var qu=rI;Ze(rI,"vertical");Ze(rI,"horizontal");function jH(e,t){return{left:e.getShallow("left",t),top:e.getShallow("top",t),right:e.getShallow("right",t),bottom:e.getShallow("bottom",t),width:e.getShallow("width",t),height:e.getShallow("height",t)}}function ane(e,t){var r=kr(e,t,{enableLayoutOnlyByCenter:!0}),n=e.getBoxLayoutParams(),i,a;if(r.type===Xv.point)a=r.refPoint,i=Bt(n,{width:t.getWidth(),height:t.getHeight()});else{var o=e.get("center"),s=ne(o)?o:[o,o];i=Bt(n,r.refContainer),a=r.boxCoordFrom===kH?r.refPoint:[he(s[0],i.width)+i.x,he(s[1],i.height)+i.y]}return{viewRect:i,center:a}}function OH(e,t){var r=ane(e,t),n=r.viewRect,i=r.center,a=e.get("radius");ne(a)||(a=[0,a]);var o=he(n.width,t.getWidth()),s=he(n.height,t.getHeight()),l=Math.min(o,s),u=he(a[0],l/2),c=he(a[1],l/2);return{cx:i[0],cy:i[1],r0:u,r:c,viewRect:n}}function Bt(e,t,r){r=md(r||0);var n=t.width,i=t.height,a=he(e.left,n),o=he(e.top,i),s=he(e.right,n),l=he(e.bottom,i),u=he(e.width,n),c=he(e.height,i),h=r[2]+r[0],f=r[1]+r[3],d=e.aspect;switch(isNaN(u)&&(u=n-s-f-a),isNaN(c)&&(c=i-l-h-o),d!=null&&(isNaN(u)&&isNaN(c)&&(d>n/i?u=n*.8:c=i*.8),isNaN(u)&&(u=d*c),isNaN(c)&&(c=u/d)),isNaN(a)&&(a=n-s-u-f),isNaN(o)&&(o=i-l-c-h),e.left||e.right){case"center":a=n/2-u/2-r[3];break;case"right":a=n-u-f;break}switch(e.top||e.bottom){case"middle":case"center":o=i/2-c/2-r[0];break;case"bottom":o=i-c-h;break}a=a||0,o=o||0,isNaN(u)&&(u=n-f-a-(s||0)),isNaN(c)&&(c=i-h-o-(l||0));var g=new Ae((t.x||0)+a+r[3],(t.y||0)+o+r[0],u,c);return g.margin=r,g}function zH(e,t,r){var n=e.getShallow("preserveAspect",!0);if(!n)return t;var i=t.width/t.height;if(Math.abs(Math.atan(r)-Math.atan(i))<1e-9)return t;var a=e.getShallow("preserveAspectAlign",!0),o=e.getShallow("preserveAspectVerticalAlign",!0),s={width:t.width,height:t.height},l=n==="cover";return i>r&&!l||i=m)return h;for(var y=0;y=0;l--)s=Ge(s,i[l],!0);n.defaultOption=s}return n.defaultOption},t.prototype.getReferringComponents=function(r,n){var i=r+"Index",a=r+"Id";return sd(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},t.prototype.getBoxLayoutParams=function(){return jH(this,!1)},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(r){this.option.zlevel=r},t.protoInitialize=function(){var r=t.prototype;r.type="component",r.id="",r.name="",r.mainType="",r.subType="",r.componentIndex=0}(),t}(Ke);bG(Xe,Ke);sb(Xe);Ore(Xe);zre(Xe,lne);function lne(e){var t=[];return E(Xe.getClassesByMainType(e),function(r){t=t.concat(r.dependencies||r.prototype.dependencies||[])}),t=ae(t,function(r){return Ua(r).main}),e!=="dataset"&&Be(t,"dataset")<=0&&t.unshift("dataset"),t}var K={color:{},darkColor:{},size:{}},sr=K.color={theme:["#5070dd","#b6d634","#505372","#ff994d","#0ca8df","#ffd10a","#fb628b","#785db0","#3fbe95"],neutral00:"#fff",neutral05:"#f4f7fd",neutral10:"#e8ebf0",neutral15:"#dbdee4",neutral20:"#cfd2d7",neutral25:"#c3c5cb",neutral30:"#b7b9be",neutral35:"#aaacb2",neutral40:"#9ea0a5",neutral45:"#929399",neutral50:"#86878c",neutral55:"#797b7f",neutral60:"#6d6e73",neutral65:"#616266",neutral70:"#54555a",neutral75:"#48494d",neutral80:"#3c3c41",neutral85:"#303034",neutral90:"#232328",neutral95:"#17171b",neutral99:"#000",accent05:"#eff1f9",accent10:"#e0e4f2",accent15:"#d0d6ec",accent20:"#c0c9e6",accent25:"#b1bbdf",accent30:"#a1aed9",accent35:"#91a0d3",accent40:"#8292cc",accent45:"#7285c6",accent50:"#6578ba",accent55:"#5c6da9",accent60:"#536298",accent65:"#4a5787",accent70:"#404c76",accent75:"#374165",accent80:"#2e3654",accent85:"#252b43",accent90:"#1b2032",accent95:"#121521",transparent:"rgba(0,0,0,0)",highlight:"rgba(255,231,130,0.8)"};ee(sr,{primary:sr.neutral80,secondary:sr.neutral70,tertiary:sr.neutral60,quaternary:sr.neutral50,disabled:sr.neutral20,border:sr.neutral30,borderTint:sr.neutral20,borderShade:sr.neutral40,background:sr.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:sr.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:sr.neutral70,axisLineTint:sr.neutral40,axisTick:sr.neutral70,axisTickMinor:sr.neutral60,axisLabel:sr.neutral70,axisSplitLine:sr.neutral15,axisMinorSplitLine:sr.neutral05});for(var uu in sr)if(sr.hasOwnProperty(uu)){var $R=sr[uu];uu==="theme"?K.darkColor.theme=sr.theme.slice():uu==="highlight"?K.darkColor.highlight="rgba(255,231,130,0.4)":uu.indexOf("accent")===0?K.darkColor[uu]=qo($R,null,function(e){return e*.5},function(e){return Math.min(1,1.3-e)}):K.darkColor[uu]=qo($R,null,function(e){return e*.9},function(e){return 1-Math.pow(e,1.5)})}K.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var FH="";typeof navigator<"u"&&(FH=navigator.platform||"");var gh="rgba(0, 0, 0, 0.2)",VH=K.color.theme[0],une=qo(VH,null,null,.9);const GH={darkMode:"auto",colorBy:"series",color:K.color.theme,gradientColor:[une,VH],aria:{decal:{decals:[{color:gh,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:gh,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:gh,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:gh,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:gh,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:gh,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:FH.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var qr={Must:1,Might:2,Not:3},HH=He();function cne(e){HH(e).datasetMap=pe()}function UH(e,t,r){var n={},i=iI(t);if(!i||!e)return n;var a=[],o=[],s=t.ecModel,l=HH(s).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,c,h;e=e.slice(),E(e,function(m,y){var _=Ie(m)?m:e[y]={name:m};_.type==="ordinal"&&c==null&&(c=y,h=g(_)),n[_.name]=[]});var f=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});E(e,function(m,y){var _=m.name,x=g(m);if(c==null){var w=f.valueWayDim;d(n[_],w,x),d(o,w,x),f.valueWayDim+=x}else if(c===y)d(n[_],0,x),d(a,0,x);else{var w=f.categoryWayDim;d(n[_],w,x),d(o,w,x),f.categoryWayDim+=x}});function d(m,y,_){for(var x=0;x<_;x++)m.push(y+x)}function g(m){var y=m.dimsDef;return y?y.length:1}return a.length&&(n.itemName=a),o.length&&(n.seriesName=o),n}function nI(e,t,r){var n={},i=iI(e);if(!i)return n;var a=t.sourceFormat,o=t.dimensionsDefine,s;(a===gi||a===ba)&&E(o,function(c,h){(Ie(c)?c.name:c)==="name"&&(s=h)});var l=function(){for(var c={},h={},f=[],d=0,g=Math.min(5,r);dt)return e[n];return e[r-1]}function $H(e,t,r,n,i,a,o){a=a||e;var s=t(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var c=o==null||!n?r:pne(n,o);if(c=c||r,!(!c||!c.length)){var h=c[l];return i&&(u[i]=h),s.paletteIdx=(l+1)%c.length,h}}function gne(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var zy,hv,XR,qR="\0_ec_inner",mne=1,oI=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(r,n,i,a,o,s){a=a||{},this.option=null,this._theme=new Ke(a),this._locale=new Ke(o),this._optionManager=s},t.prototype.setOption=function(r,n,i){var a=QR(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},t.prototype.resetOption=function(r,n){return this._resetOption(r,QR(n))},t.prototype._resetOption=function(r,n){var i=!1,a=this._optionManager;if(!r||r==="recreate"){var o=a.mountOption(r==="recreate");!this.option||r==="recreate"?XR(this,o):(this.restoreData(),this._mergeOption(o,n)),i=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var s=a.getTimelineOption(this);s&&(i=!0,this._mergeOption(s,n))}if(!r||r==="recreate"||r==="media"){var l=a.getMediaOption(this);l.length&&E(l,function(u){i=!0,this._mergeOption(u,n)},this)}return i},t.prototype.mergeOption=function(r){this._mergeOption(r,null)},t.prototype._mergeOption=function(r,n){var i=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=pe(),u=n&&n.replaceMergeMainTypeMap;cne(this),E(r,function(h,f){h!=null&&(Xe.hasClass(f)?f&&(s.push(f),l.set(f,!0)):i[f]=i[f]==null?Se(h):Ge(i[f],h,!0))}),u&&u.each(function(h,f){Xe.hasClass(f)&&!l.get(f)&&(s.push(f),l.set(f,!0))}),Xe.topologicalTravel(s,Xe.getAllClassMainTypes(),c,this);function c(h){var f=dne(this,h,kt(r[h])),d=a.get(h),g=d?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",m=dG(d,f,g);Tee(m,h,Xe),i[h]=null,a.set(h,null),o.set(h,0);var y=[],_=[],x=0,w;E(m,function(S,T){var M=S.existing,A=S.newOption;if(!A)M&&(M.mergeOption({},this),M.optionUpdated({},!1));else{var N=h==="series",P=Xe.getClass(h,S.keyInfo.subType,!N);if(!P)return;if(h==="tooltip"){if(w)return;w=!0}if(M&&M.constructor===P)M.name=S.keyInfo.name,M.mergeOption(A,this),M.optionUpdated(A,!1);else{var I=ee({componentIndex:T},S.keyInfo);M=new P(A,this,this,I),ee(M,I),S.brandNew&&(M.__requireNewView=!0),M.init(A,this,this),M.optionUpdated(null,!0)}}M?(y.push(M.option),_.push(M),x++):(y.push(void 0),_.push(void 0))},this),i[h]=y,a.set(h,_),o.set(h,x),h==="series"&&zy(this)}this._seriesIndices||zy(this)},t.prototype.getOption=function(){var r=Se(this.option);return E(r,function(n,i){if(Xe.hasClass(i)){for(var a=kt(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!og(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[qR],r},t.prototype.setTheme=function(r){this._theme=new Ke(r),this._resetOption("recreate",null)},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(r){this._payload=r},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(r,n){var i=this._componentsMap.get(r);if(i){var a=i[n||0];if(a)return a;if(n==null){for(var o=0;o=t:r==="max"?e<=t:e===t}function Tne(e,t){return e.join(",")===t.join(",")}var ra=E,fg=Ie,ej=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function HS(e){var t=e&&e.itemStyle;if(t)for(var r=0,n=ej.length;r0?r[o-1].seriesModel:null)}),Rne(r)}})}function Rne(e){E(e,function(t,r){var n=[],i=[NaN,NaN],a=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,l=t.seriesModel.get("stackStrategy")||"samesign";o.modify(a,function(u,c,h){var f=o.get(t.stackedDimension,h);if(isNaN(f))return i;var d,g;s?g=o.getRawIndex(h):d=o.get(t.stackedByDimension,h);for(var m=NaN,y=r-1;y>=0;y--){var _=e[y];if(s||(g=_.data.rawIndexOf(_.stackedByDimension,d)),g>=0){var x=_.data.getByRawIndex(_.stackResultDimension,g);if(l==="all"||l==="positive"&&x>0||l==="negative"&&x<0||l==="samesign"&&f>=0&&x>0||l==="samesign"&&f<=0&&x<0){f=Su(f,x),m=x;break}}}return n[0]=f,n[1]=m,n})})}var xb=function(){function e(t){this.data=t.data||(t.sourceFormat===ba?{}:[]),this.sourceFormat=t.sourceFormat||DG,this.seriesLayoutBy=t.seriesLayoutBy||va,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var r=this.dimensionsDefine=t.dimensionsDefine;if(r)for(var n=0;nm&&(m=w)}d[0]=g,d[1]=m}},i=function(){return this._data?this._data.length/this._dimSize:0};sj=(t={},t[Wr+"_"+va]={pure:!0,appendData:a},t[Wr+"_"+Vc]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[gi]={pure:!0,appendData:a},t[ba]={pure:!0,appendData:function(o){var s=this._data;E(o,function(l,u){for(var c=s[u]||(s[u]=[]),h=0;h<(l||[]).length;h++)c.push(l[h])})}},t[pi]={appendData:a},t[dl]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},t);function a(o){for(var s=0;s=0&&(m=o.interpolatedValue[y])}return m!=null?m+"":""})}},e.prototype.getRawValue=function(t,r){return zf(this.getData(r),t)},e.prototype.formatTooltip=function(t,r,n){},e}();function hj(e){var t,r;return Ie(e)?e.type&&(r=e):t=e,{text:t,frag:r}}function Sp(e){return new Hne(e)}var Hne=function(){function e(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return e.prototype.perform=function(t){var r=this._upstream,n=t&&t.skip;if(this._dirty&&r){var i=this.context;i.data=i.outputData=r.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!n&&(a=this._plan(this.context));var o=c(this._modBy),s=this._modDataCount||0,l=c(t&&t.modBy),u=t&&t.modDataCount||0;(o!==l||s!==u)&&(a="reset");function c(x){return!(x>=1)&&(x=1),x}var h;(this._dirty||a==="reset")&&(this._dirty=!1,h=this._doReset(n)),this._modBy=l,this._modDataCount=u;var f=t&&t.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,g=Math.min(f!=null?this._dueIndex+f:1/0,this._dueEnd);if(!n&&(h||d1&&n>0?s:o}};return a;function o(){return t=e?null:lt},gte:function(e,t){return e>=t}},Wne=function(){function e(t,r){if(!nt(r)){var n="";pt(n)}this._opFn=nU[t],this._rvalFloat=co(r)}return e.prototype.evaluate=function(t){return nt(t)?this._opFn(t,this._rvalFloat):this._opFn(co(t),this._rvalFloat)},e}(),iU=function(){function e(t,r){var n=t==="desc";this._resultLT=n?1:-1,r==null&&(r=n?"min":"max"),this._incomparable=r==="min"?-1/0:1/0}return e.prototype.evaluate=function(t,r){var n=nt(t)?t:co(t),i=nt(r)?r:co(r),a=isNaN(n),o=isNaN(i);if(a&&(n=this._incomparable),o&&(i=this._incomparable),a&&o){var s=ue(t),l=ue(r);s&&(n=l?t:0),l&&(i=s?r:0)}return ni?-this._resultLT:0},e}(),Zne=function(){function e(t,r){this._rval=r,this._isEQ=t,this._rvalTypeof=typeof r,this._rvalFloat=co(r)}return e.prototype.evaluate=function(t){var r=t===this._rval;if(!r){var n=typeof t;n!==this._rvalTypeof&&(n==="number"||this._rvalTypeof==="number")&&(r=co(t)===this._rvalFloat)}return this._isEQ?r:!r},e}();function $ne(e,t){return e==="eq"||e==="ne"?new Zne(e==="eq",t):ge(nU,e)?new Wne(e,t):null}function aU(e){var t="",r=-1/0,n=-1/0,i=1/0,a=1/0;return e&&(e.g!=null&&(t+="G"+e.g,r=e.g),e.ge!=null&&(t+="GE"+e.ge,n=e.ge),e.l!=null&&(t+="L"+e.l,i=e.l),e.le!=null&&(t+="LE"+e.le,a=e.le)),{key:t,g:r,ge:n,l:i,le:a}}function oU(e,t){return t>e.g&&t>=e.ge&&t65535?nie:iie}function aie(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function vj(e,t,r,n,i){var a=uU[r||"float"];if(i){var o=e[t],s=o&&o.length;if(s!==n){for(var l=new a(n),u=0;uy[1]&&(y[1]=m)}return this._rawCount=this._count=l,{start:s,end:l}},e.prototype._initDataFromProvider=function(t,r,n){for(var i=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=ae(o,function(x){return x.property}),c=0;c_[1]&&(_[1]=y)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=r,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(t,r){if(!(r>=0&&r=0&&r=this._rawCount||t<0)return-1;if(!this._indices)return t;var r=this._indices,n=r[t];if(n!=null&&nt)a=o-1;else return o}return-1},e.prototype.getIndices=function(){var t,r=this._indices;if(r){var n=r.constructor,i=this._count;if(n===Array){t=new n(i);for(var a=0;a=h&&x<=f||isNaN(x))&&(l[u++]=m),m++}g=!0}else if(a===2){for(var y=d[i[0]],w=d[i[1]],S=t[i[1]][0],T=t[i[1]][1],_=0;_=h&&x<=f||isNaN(x))&&(M>=S&&M<=T||isNaN(M))&&(l[u++]=m),m++}g=!0}}if(!g)if(a===1)for(var _=0;_=h&&x<=f||isNaN(x))&&(l[u++]=A)}else for(var _=0;_t[I][1])&&(N=!1)}N&&(l[u++]=r.getRawIndex(_))}return u_[1]&&(_[1]=y)}}}},e.prototype.lttbDownSample=function(t,r){var n=this.clone([t],!0),i=n._chunks,a=i[t],o=this.count(),s=0,l=Math.floor(1/r),u=this.getRawIndex(0),c,h,f,d=new(mh(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=u;for(var g=1;gc&&(c=h,f=S)}D>0&&Ds&&(m=s-c);for(var y=0;yg&&(g=x,d=c+y)}var w=this.getRawIndex(h),S=this.getRawIndex(d);hc-g&&(l=c-g,s.length=l);for(var m=0;mh[1]&&(h[1]=_),f[d++]=x}return a._count=d,a._indices=f,a._updateGetRawIdx(),a},e.prototype.each=function(t,r){if(this._count)for(var n=t.length,i=this._chunks,a=0,o=this.count();ad&&(d=y))}return l[c]=[f,d]},e.prototype.getRawDataItem=function(t){var r=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(r);for(var n=[],i=this._chunks,a=0;a=0?this._indices[t]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function t(r,n,i,a){return pl(r[a],this._dimensions[a])}ZS={arrayRows:t,objectRows:function(r,n,i,a){return pl(r[n],this._dimensions[a])},keyedColumns:t,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return pl(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),e}(),cU=function(){function e(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(t,r){this._sourceList=t,this._upstreamSignList=r,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var t=this._sourceHost,r=this._getUpstreamSourceManagers(),n=!!r.length,i,a;if(Fy(t)){var o=t,s=void 0,l=void 0,u=void 0;if(n){var c=r[0];c.prepareSource(),u=c.getSource(),s=u.data,l=u.sourceFormat,a=[c._getVersionSign()]}else s=o.get("data",!0),l=Pn(s)?dl:pi,a=[];var h=this._getSourceMetaRawOption()||{},f=u&&u.metaRawOption||{},d=ye(h.seriesLayoutBy,f.seriesLayoutBy)||null,g=ye(h.sourceHeader,f.sourceHeader),m=ye(h.dimensions,f.dimensions),y=d!==f.seriesLayoutBy||!!g!=!!f.sourceHeader||m;i=y?[AM(s,{seriesLayoutBy:d,sourceHeader:g,dimensions:m},l)]:[]}else{var _=t;if(n){var x=this._applyTransform(r);i=x.sourceList,a=x.upstreamSignList}else{var w=_.get("source",!0);i=[AM(w,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(i,a)},e.prototype._applyTransform=function(t){var r=this._sourceHost,n=r.get("transform",!0),i=r.get("fromTransformResult",!0);if(i!=null){var a="";t.length!==1&&gj(a)}var o,s=[],l=[];return E(t,function(u){u.prepareSource();var c=u.getSource(i||0),h="";i!=null&&!c&&gj(h),s.push(c),l.push(u._getVersionSign())}),n?o=tie(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[jne(s[0])]),{sourceList:o,upstreamSignList:l}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),r=0;r1||r>0&&!e.noHeader;return E(e.blocks,function(i){var a=vU(i);a>=t&&(t=a+ +(n&&(!a||kM(i)&&!i.noHeader)))}),t}return 0}function uie(e,t,r,n){var i=t.noHeader,a=hie(vU(t)),o=[],s=t.blocks||[];an(!s||ne(s)),s=s||[];var l=e.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(ge(u,l)){var c=new iU(u[l],null);s.sort(function(m,y){return c.evaluate(m.sortParam,y.sortParam)})}else l==="seriesDesc"&&s.reverse()}E(s,function(m,y){var _=t.valueFormatter,x=dU(m)(_?ee(ee({},e),{valueFormatter:_}):e,m,y>0?a.html:0,n);x!=null&&o.push(x)});var h=e.renderMode==="richText"?o.join(a.richText):IM(n,o.join(""),i?r:a.html);if(i)return h;var f=CM(t.header,"ordinal",e.useUTC),d=fU(n,e.renderMode).nameStyle,g=hU(n);return e.renderMode==="richText"?pU(e,f,d)+a.richText+h:IM(n,'
'+gn(f)+"
"+h,r)}function cie(e,t,r,n){var i=e.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,l=t.name,u=e.useUTC,c=t.valueFormatter||e.valueFormatter||function(S){return S=ne(S)?S:[S],ae(S,function(T,M){return CM(T,ne(d)?d[M]:d,u)})};if(!(a&&o)){var h=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||K.color.secondary,i),f=a?"":CM(l,"ordinal",u),d=t.valueType,g=o?[]:c(t.value,t.rawDataIndex),m=!s||!a,y=!s&&a,_=fU(n,i),x=_.nameStyle,w=_.valueStyle;return i==="richText"?(s?"":h)+(a?"":pU(e,f,x))+(o?"":vie(e,g,m,y,w)):IM(n,(s?"":h)+(a?"":fie(f,!s,x))+(o?"":die(g,m,y,w)),r)}}function mj(e,t,r,n,i,a){if(e){var o=dU(e),s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:t,valueFormatter:e.valueFormatter};return o(s,e,0,a)}}function hie(e){return{html:sie[e],richText:lie[e]}}function IM(e,t,r){var n='
',i="margin: "+r+"px 0 0",a=hU(e);return'
'+t+n+"
"}function fie(e,t,r){var n=t?"margin-left:2px":"";return''+gn(e)+""}function die(e,t,r,n){var i=r?"10px":"20px",a=t?"float:right;margin-left:"+i:"";return e=ne(e)?e:[e],''+ae(e,function(o){return gn(o)}).join("  ")+""}function pU(e,t,r){return e.markupStyleCreator.wrapRichTextStyle(t,r)}function vie(e,t,r,n,i){var a=[i],o=n?10:20;return r&&a.push({padding:[0,0,0,o],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(ne(t)?t.join(" "):t,a)}function gU(e,t){var r=e.getData().getItemVisual(t,"style"),n=r[e.visualDrawType];return yc(n)}function mU(e,t){var r=e.get("padding");return r??(t==="richText"?[8,10]:10)}var $S=function(){function e(){this.richTextStyles={},this._nextStyleNameId=_k()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(t,r,n){var i=n==="richText"?this._generateStyleName():null,a=LH({color:r,type:t,renderMode:n,markerId:i});return ue(a)?a:(this.richTextStyles[i]=a.style,a.content)},e.prototype.wrapRichTextStyle=function(t,r){var n={};ne(r)?E(r,function(a){return ee(n,a)}):ee(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},e}();function yU(e){var t=e.series,r=e.dataIndex,n=e.multipleSeries,i=t.getData(),a=i.mapDimensionsAll("defaultedTooltip"),o=a.length,s=t.getRawValue(r),l=ne(s),u=gU(t,r),c,h,f,d;if(o>1||l&&!o){var g=pie(s,t,r,a,u);c=g.inlineValues,h=g.inlineValueTypes,f=g.blocks,d=g.inlineValues[0]}else if(o){var m=i.getDimensionInfo(a[0]);d=c=zf(i,r,a[0]),h=m.type}else d=c=l?s[0]:s;var y=xk(t),_=y&&t.name||"",x=i.getName(r),w=n?_:x;return _r("section",{header:_,noHeader:n||!y,sortParam:d,blocks:[_r("nameValue",{markerType:"item",markerColor:u,name:w,noName:!oi(w),value:c,valueType:h,rawDataIndex:i.getRawIndex(r)})].concat(f||[])})}function pie(e,t,r,n,i){var a=t.getData(),o=Hi(e,function(h,f,d){var g=a.getDimensionInfo(d);return h=h||g&&g.tooltip!==!1&&g.displayName!=null},!1),s=[],l=[],u=[];n.length?E(n,function(h){c(zf(a,r,h),h)}):E(e,c);function c(h,f){var d=a.getDimensionInfo(f);!d||d.otherDims.tooltip===!1||(o?u.push(_r("nameValue",{markerType:"subItem",markerColor:i,name:d.displayName,value:h,valueType:d.type})):(s.push(h),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var Ls=He();function Vy(e,t){return e.getName(t)||e.getId(t)}var d_="__universalTransitionEnabled",Tt=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r._selectedDataIndicesMap={},r}return t.prototype.init=function(r,n,i){this.seriesIndex=this.componentIndex,this.dataTask=Sp({count:mie,reset:yie}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=Ls(this).sourceManager=new cU(this);a.prepareSource();var o=this.getInitialData(r,i);_j(o,this),this.dataTask.context.data=o,Ls(this).dataBeforeProcessed=o,yj(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(r,n){var i=hg(this),a=i?Wc(r):{},o=this.subType;Xe.hasClass(o)&&(o+="Series"),Ge(r,n.getTheme().get(this.subType)),Ge(r,this.getDefaultOption()),hc(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&vo(r,a,i)},t.prototype.mergeOption=function(r,n){r=Ge(this.option,r,!0),this.fillDataTextStyle(r.data);var i=hg(this);i&&vo(this.option,r,i);var a=Ls(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);_j(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Ls(this).dataBeforeProcessed=o,yj(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(r){if(r&&!Pn(r))for(var n=["show"],i=0;i=0&&f<0)&&(h=T,f=S,d=0),S===f&&(c[d++]=y))}return c.length=d,c},t.prototype.formatTooltip=function(r,n,i){return yU({series:this,dataIndex:r,multipleSeries:n})},t.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(et.node&&!(r&&r.ssr))return!1;var n=this.getShallow("animation");return n&&this.getData().count()>this.getShallow("animationThreshold")&&(n=!1),!!n},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(r,n,i){var a=this.ecModel,o=aI.prototype.getColorFromPalette.call(this,r,n,i);return o||(o=a.getColorFromPalette(r,n,i)),o},t.prototype.coordDimToDataDim=function(r){return this.getRawData().mapDimensionsAll(r)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(r,n){this._innerSelect(this.getData(n),r)},t.prototype.unselect=function(r,n){var i=this.option.selectedMap;if(i){var a=this.option.selectedMode,o=this.getData(n);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&i.push(o)}return i},t.prototype.isSelected=function(r,n){var i=this.option.selectedMap;if(!i)return!1;var a=this.getData(n);return(i==="all"||i[Vy(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[d_])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},t.prototype._innerSelect=function(r,n){var i,a,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){Ie(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,c=0;c0&&this._innerSelect(r,n)}},t.registerClass=function(r){return Xe.registerClass(r)},t.protoInitialize=function(){var r=t.prototype;r.type="series.__base__",r.seriesIndex=0,r.ignoreStyleOnData=!1,r.hasSymbolVisual=!1,r.defaultSymbol="circle",r.visualStyleAccessPath="itemStyle",r.visualDrawType="fill"}(),t}(Xe);vr(Tt,bb);vr(Tt,aI);bG(Tt,Xe);function yj(e){var t=e.name;xk(e)||(e.name=gie(e)||t)}function gie(e){var t=e.getRawData(),r=t.mapDimensionsAll("seriesName"),n=[];return E(r,function(i){var a=t.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function mie(e){return e.model.getRawData().count()}function yie(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),_ie}function _ie(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function _j(e,t){E(Nf(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(r){e.wrapMethod(r,Ze(xie,t))})}function xie(e,t){var r=NM(e);return r&&r.setOutputEnd((t||this).count()),t}function NM(e){var t=(e.ecModel||{}).scheduler,r=t&&t.getPipeline(e.uid);if(r){var n=r.currentTask;if(n){var i=n.agentStubMap;i&&(n=i.get(e.uid))}return n}}var It=function(){function e(){this.group=new Me,this.uid=Uc("viewComponent")}return e.prototype.init=function(t,r){},e.prototype.render=function(t,r,n,i){},e.prototype.dispose=function(t,r){},e.prototype.updateView=function(t,r,n,i){},e.prototype.updateLayout=function(t,r,n,i){},e.prototype.updateVisual=function(t,r,n,i){},e.prototype.toggleBlurSeries=function(t,r,n){},e.prototype.eachRendered=function(t){var r=this.group;r&&r.traverse(t)},e}();Sk(It);sb(It);function Zc(){var e=He();return function(t){var r=e(t),n=t.pipelineContext,i=!!r.large,a=!!r.progressiveRender,o=r.large=!!(n&&n.large),s=r.progressiveRender=!!(n&&n.progressiveRender);return(i!==o||a!==s)&&"reset"}}var _U=He(),bie=Zc(),xt=function(){function e(){this.group=new Me,this.uid=Uc("viewChart"),this.renderTask=Sp({plan:wie,reset:Sie}),this.renderTask.context={view:this}}return e.prototype.init=function(t,r){},e.prototype.render=function(t,r,n,i){},e.prototype.highlight=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&bj(a,i,"emphasis")},e.prototype.downplay=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&bj(a,i,"normal")},e.prototype.remove=function(t,r){this.group.removeAll()},e.prototype.dispose=function(t,r){},e.prototype.updateView=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.updateVisual=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.eachRendered=function(t){Ol(this.group,t)},e.markUpdateMethod=function(t,r){_U(t).updateMethod=r},e.protoInitialize=function(){var t=e.prototype;t.type="chart"}(),e}();function xj(e,t,r){e&&lg(e)&&(t==="emphasis"?hs:fs)(e,r)}function bj(e,t,r){var n=fc(e,t),i=t&&t.highlightKey!=null?Yte(t.highlightKey):null;n!=null?E(kt(n),function(a){xj(e.getItemGraphicEl(a),r,i)}):e.eachItemGraphicEl(function(a){xj(a,r,i)})}Sk(xt);sb(xt);function wie(e){return bie(e.model)}function Sie(e){var t=e.model,r=e.ecModel,n=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&_U(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,r,n,i),Cie[l]}var Cie={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},bx="\0__throttleOriginMethod",wj="\0__throttleRate",Sj="\0__throttleType";function wb(e,t,r){var n,i=0,a=0,o=null,s,l,u,c;t=t||0;function h(){a=new Date().getTime(),o=null,e.apply(l,u||[])}var f=function(){for(var d=[],g=0;g=0?h():o=setTimeout(h,-s),i=n};return f.clear=function(){o&&(clearTimeout(o),o=null)},f.debounceNextCall=function(d){c=d},f}function _d(e,t,r,n){var i=e[t];if(i){var a=i[bx]||i,o=i[Sj],s=i[wj];if(s!==r||o!==n){if(r==null||!n)return e[t]=a;i=e[t]=wb(a,r,n==="debounce"),i[bx]=a,i[Sj]=n,i[wj]=r}return i}}function dg(e,t){var r=e[t];r&&r[bx]&&(r.clear&&r.clear(),e[t]=r[bx])}var Cj=He(),Tj={itemStyle:vc(mH,!0),lineStyle:vc(gH,!0)},Tie={lineStyle:"stroke",itemStyle:"fill"};function xU(e,t){var r=e.visualStyleMapper||Tj[t];return r||(console.warn("Unknown style type '"+t+"'."),Tj.itemStyle)}function bU(e,t){var r=e.visualDrawType||Tie[t];return r||(console.warn("Unknown style type '"+t+"'."),"fill")}var Mie={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=e.getModel(n),a=xU(e,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=bU(e,n),u=o[l],c=Ce(u)?u:null,h=o.fill==="auto"||o.stroke==="auto";if(!o[l]||c||h){var f=e.getColorFromPalette(e.name,null,t.getSeriesCount());o[l]||(o[l]=f,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||Ce(o.fill)?f:o.fill,o.stroke=o.stroke==="auto"||Ce(o.stroke)?f:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!t.isSeriesFiltered(e)&&c)return r.setVisual("colorFromPalette",!1),{dataEach:function(d,g){var m=e.getDataParams(g),y=ee({},o);y[l]=c(m),d.setItemVisual(g,"style",y)}}}},dv=new Ke,Aie={createOnAllSeries:!0,reset:function(e,t){if(!e.ignoreStyleOnData){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=xU(e,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){dv.option=l[n];var u=i(dv),c=o.ensureUniqueItemVisual(s,"style");ee(c,u),dv.option.decal&&(o.setItemVisual(s,"decal",dv.option.decal),dv.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},Lie={performRawSeries:!0,overallReset:function(e){var t=pe();e.eachSeries(function(r){if(!r.isColorBySeries()){var n=r.type+"-"+r.getColorBy();Cj(r).scope=t.get(n)||t.set(n,{})}}),e.eachSeries(function(r){if(!r.isColorBySeries()){var n=r.getRawData(),i={},a=r.getData(),o=Cj(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=bU(r,s);a.each(function(u){var c=a.getRawIndex(u);i[c]=u}),n.each(function(u){var c=i[u],h=a.getItemVisual(c,"colorFromPalette");if(h){var f=a.ensureUniqueItemVisual(c,"style"),d=n.getName(u)||u+"",g=n.count();f[l]=r.getColorFromPalette(d,o,g)}})}})}},Gy=Math.PI;function kie(e,t){t=t||{},Le(t,{text:"loading",textColor:K.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:K.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var r=new Me,n=new Ye({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});r.add(n);var i=new rt({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new Ye({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});r.add(a);var o;return t.showSpinner&&(o=new rm({shape:{startAngle:-Gy/2,endAngle:-Gy/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:Gy*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:Gy*3/2}).delay(300).start("circularInOut"),r.add(o)),r.resize=function(){var s=i.getBoundingRect().width,l=t.showSpinner?t.spinnerRadius:0,u=(e.getWidth()-l*2-(t.showSpinner&&s?10:0)-s)/2-(t.showSpinner&&s?0:5+s/2)+(t.showSpinner?0:s/2)+(s?0:l),c=e.getHeight()/2;t.showSpinner&&o.setShape({cx:u,cy:c}),a.setShape({x:u-l,y:c-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},r.resize(),r}var wU=function(){function e(t,r,n,i){this._stageTaskMap=pe(),this.ecInstance=t,this.api=r,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return e.prototype.restoreData=function(t,r){t.restoreData(r),this._stageTaskMap.each(function(n){var i=n.overallTask;i&&i.dirty()})},e.prototype.getPerformArgs=function(t,r){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,a=!r&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex,o=a?n.step:null,s=i&&i.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},e.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},e.prototype.updateStreamModes=function(t,r){var n=this._pipelineMap.get(t.uid),i=t.__preparePipelineContext?t.__preparePipelineContext(r,n):_G(t,r,n);t.pipelineContext=n.context=i},e.prototype.restorePipelines=function(t,r){var n=this,i=n._pipelineMap=pe();r.eachSeries(function(a){var o=t.painter.type==="canvas"&&a.getProgressive(),s=a.uid;i.set(s,{id:s,head:null,tail:null,threshold:a.getProgressiveThreshold(),progressiveEnabled:o&&!(a.preventIncremental&&a.preventIncremental()),blockIndex:-1,step:Math.round(o||700),count:0}),n._pipe(a,a.dataTask)})},e.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,r=this.api.getModel(),n=this.api;E(this._allHandlers,function(i){var a=t.get(i.uid)||t.set(i.uid,{}),o="";an(!(i.reset&&i.overallReset),o),i.reset&&this._createSeriesStageTask(i,a,r,n),i.overallReset&&this._createOverallStageTask(i,a,r,n)},this)},e.prototype.prepareView=function(t,r,n,i){var a=t.renderTask,o=a.context;o.model=r,o.ecModel=n,o.api=i,a.__block=!t.incrementalPrepareRender,this._pipe(r,a)},e.prototype.performDataProcessorTasks=function(t,r){this._performStageTasks(this._dataProcessorHandlers,t,r,{block:!0})},e.prototype.performVisualTasks=function(t,r,n){this._performStageTasks(this._visualHandlers,t,r,n)},e.prototype._performStageTasks=function(t,r,n,i){i=i||{};var a=!1,o=this;E(t,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var c=o._stageTaskMap.get(l.uid),h=c.seriesTaskMap,f=c.overallTask;if(f){var d,g=f.agentStubMap;g.each(function(y){s(i,y)&&(y.dirty(),d=!0)}),d&&f.dirty(),o.updatePayload(f,n);var m=o.getPerformArgs(f,i.block);g.each(function(y){y.perform(m)}),f.perform(m)&&(a=!0)}else h&&h.each(function(y,_){s(i,y)&&y.dirty();var x=o.getPerformArgs(y,i.block);x.skip=!l.performRawSeries&&r.isSeriesFiltered(y.context.model),o.updatePayload(y,n),y.perform(x)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},e.prototype.performSeriesTasks=function(t){var r;t.eachSeries(function(n){r=n.dataTask.perform()||r}),this.unfinished=r||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each(function(t){var r=t.tail;do{if(r.__block){t.blockIndex=r.__idxInPipeline;break}r=r.getUpstream()}while(r)})},e.prototype.updatePayload=function(t,r){r!=="remain"&&(t.context.payload=r)},e.prototype._createSeriesStageTask=function(t,r,n,i){var a=this,o=r.seriesTaskMap,s=r.seriesTaskMap=pe(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(c):l?n.eachRawSeriesByType(l,c):u&&u(n,i).each(c);function c(h){var f=h.uid,d=s.set(f,o&&o.get(f)||Sp({plan:Eie,reset:Rie,count:Oie}));d.context={model:h,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:a},a._pipe(h,d)}},e.prototype._createOverallStageTask=function(t,r,n,i){var a=this,o=r.overallTask=r.overallTask||Sp({reset:Iie});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=pe(),u=t.seriesType,c=t.getTargetSeries,h=t.dirtyOnOverallProgress,f=!1,d="";an(!t.createOnAllSeries,d),u?n.eachRawSeriesByType(u,g):c?c(n,i).each(g):E(n.getSeries(),g);function g(m){var y=m.uid,_=l.set(y,s&&s.get(y)||(f=!0,Sp({reset:Nie,onDirty:Die})));_.context={model:m,dirtyOnOverallProgress:h},_.agent=o,_.__block=h,a._pipe(m,_)}f&&o.dirty()},e.prototype._pipe=function(t,r){var n=t.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=r),i.tail&&i.tail.pipe(r),i.tail=r,r.__idxInPipeline=i.count++,r.__pipeline=i},e.wrapStageHandler=function(t,r){return Ce(t)&&(t={overallReset:t,seriesType:zie(t)}),t.uid=Uc("stageHandler"),r&&(t.visualType=r),t},e}();function Iie(e){e.overallReset(e.ecModel,e.api,e.payload)}function Nie(e){return e.dirtyOnOverallProgress&&Pie}function Pie(){this.agent.dirty(),this.getDownstream().dirty()}function Die(){this.agent&&this.agent.dirty()}function Eie(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function Rie(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=kt(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?ae(t,function(r,n){return SU(n)}):jie}var jie=SU(0);function SU(e){return function(t,r){var n=r.data,i=r.resetDefines[e];if(i&&i.dataEach)for(var a=t.start;a0&&d===u.length-f.length){var g=u.slice(0,d);g!=="data"&&(r.mainType=g,r[f.toLowerCase()]=l,c=!0)}}s.hasOwnProperty(u)&&(n[u]=l,c=!0),c||(i[u]=l)})}return{cptQuery:r,dataQuery:n,otherQuery:i}},e.prototype.filter=function(t,r){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,a=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=r.cptQuery,u=r.dataQuery;return c(l,o,"mainType")&&c(l,o,"subType")&&c(l,o,"index","componentIndex")&&c(l,o,"name")&&c(l,o,"id")&&c(u,a,"name")&&c(u,a,"dataIndex")&&c(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,r.otherQuery,i,a));function c(h,f,d,g){return h[d]==null||f[g||d]===h[d]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),PM=["symbol","symbolSize","symbolRotate","symbolOffset"],Lj=PM.concat(["symbolKeepAspect"]),Fie={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData();if(e.legendIcon&&r.setVisual("legendIcon",e.legendIcon),!e.hasSymbolVisual)return;for(var n={},i={},a=!1,o=0;o=0&&Gu(l)?l:.5;var u=e.createRadialGradient(o,s,0,o,s,l);return u}function DM(e,t,r){for(var n=t.type==="radial"?aae(e,t,r):iae(e,t,r),i=t.colorStops,a=0;a0)?null:e==="dashed"?[4*t,2*t]:e==="dotted"?[t]:nt(e)?[e]:ne(e)?e:null}function fI(e){var t=e.style,r=t.lineDash&&t.lineWidth>0&&sae(t.lineDash,t.lineWidth),n=t.lineDashOffset;if(r){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(r=ae(r,function(a){return a/i}),n/=i)}return[r,n]}var lae=new ho(!0);function Tx(e){var t=e.stroke;return!(t==null||t==="none"||!(e.lineWidth>0))}function kj(e){return typeof e=="string"&&e!=="none"}function Mx(e){var t=e.fill;return t!=null&&t!=="none"}function Ij(e,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var r=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=r}else e.fill()}function Nj(e,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var r=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=r}else e.stroke()}function EM(e,t,r){var n=Ck(t.image,t.__image,r);if(lb(n)){var i=e.createPattern(n,t.repeat||"repeat");if(typeof DOMMatrix=="function"&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*fp),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function uae(e,t,r,n,i){var a,o=Tx(r),s=Mx(r),l=r.strokePercent,u=l<1,c=!t.path;(!t.silent||u)&&c&&t.createPathProxy();var h=t.path||lae,f=t.__dirty;if(!n){var d=r.fill,g=r.stroke,m=s&&!!d.colorStops,y=o&&!!g.colorStops,_=s&&!!d.image,x=o&&!!g.image,w=void 0,S=void 0,T=void 0,M=void 0,A=void 0;(m||y)&&(A=t.getBoundingRect()),m&&(w=f?DM(e,d,A):t.__canvasFillGradient,t.__canvasFillGradient=w),y&&(S=f?DM(e,g,A):t.__canvasStrokeGradient,t.__canvasStrokeGradient=S),_&&(T=f||!t.__canvasFillPattern?EM(e,d,t):t.__canvasFillPattern,t.__canvasFillPattern=T),x&&(M=f||!t.__canvasStrokePattern?EM(e,g,t):t.__canvasStrokePattern,t.__canvasStrokePattern=M),m?e.fillStyle=w:_&&(T?e.fillStyle=T:s=!1),y?e.strokeStyle=S:x&&(M?e.strokeStyle=M:o=!1)}var N=t.getGlobalScale();h.setScale(N[0],N[1],t.segmentIgnoreThreshold);var P,I;e.setLineDash&&r.lineDash&&(a=fI(t),P=a[0],I=a[1]);var D=!0;(c||f&Eh)&&(h.setDPR(e.dpr),u?h.setContext(null):(h.setContext(e),D=!1),h.reset(),t.buildPath(h,t.shape,n),h.toStatic(),t.pathUpdated()),D&&h.rebuildPath(e,u?l:1),P&&(e.setLineDash(P),e.lineDashOffset=I),n?(i.batchFill=s,i.batchStroke=o):r.strokeFirst?(o&&Nj(e,r),s&&Ij(e,r)):(s&&Ij(e,r),o&&Nj(e,r)),P&&e.setLineDash([])}function cae(e,t,r){var n=t.__image=Ck(r.image,t.__image,t,t.onload);if(!(!n||!lb(n))){var i=r.x||0,a=r.y||0,o=t.getWidth(),s=t.getHeight(),l=n.width/n.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=n.width,s=n.height),r.sWidth&&r.sHeight){var u=r.sx||0,c=r.sy||0;e.drawImage(n,u,c,r.sWidth,r.sHeight,i,a,o,s)}else if(r.sx&&r.sy){var u=r.sx,c=r.sy,h=o-u,f=s-c;e.drawImage(n,u,c,h,f,i,a,o,s)}else e.drawImage(n,i,a,o,s)}}function hae(e,t,r){var n,i=r.text;if(i!=null&&(i+=""),i){e.font=r.font||ss,e.textAlign=r.textAlign,e.textBaseline=r.textBaseline;var a=void 0,o=void 0;e.setLineDash&&r.lineDash&&(n=fI(t),a=n[0],o=n[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),r.strokeFirst?(Tx(r)&&e.strokeText(i,r.x,r.y),Mx(r)&&e.fillText(i,r.x,r.y)):(Mx(r)&&e.fillText(i,r.x,r.y),Tx(r)&&e.strokeText(i,r.x,r.y)),a&&e.setLineDash([])}}var Pj=["shadowBlur","shadowOffsetX","shadowOffsetY"],Dj=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function EU(e,t,r,n,i){var a=!1;if(!n&&(r=r||{},t===r))return!1;if(n||t.opacity!==r.opacity){kn(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?$u.opacity:o}(n||t.blend!==r.blend)&&(a||(kn(e,i),a=!0),e.globalCompositeOperation=t.blend||$u.blend);for(var s=0;s0&&r.unfinished);r.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(r,n,i){if(!this[wr]){if(this._disposed){this.id;return}var a,o,s;if(Ie(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[wr]=!0,bh(this),!this._model||n){var l=new bne(this._api),u=this._theme,c=this._model=new oI;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},zM);var h={seriesTransition:s,optionChanged:!0};if(i)this[Br]={silent:a,updateParams:h},this[wr]=!1,this.getZr().wakeUp();else{try{vu(this),Po.update.call(this,null,h)}catch(f){throw this[Br]=null,this[wr]=!1,f}this._ssr||this._zr.flush(),this[Br]=null,this[wr]=!1,_h.call(this,a),xh.call(this,a)}}},t.prototype.setTheme=function(r,n){if(!this[wr]){if(this._disposed){this.id;return}var i=this._model;if(i){var a=n&&n.silent,o=null;this[Br]&&(a==null&&(a=this[Br].silent),o=this[Br].updateParams,this[Br]=null),this[wr]=!0,bh(this);try{this._updateTheme(r),i.setTheme(this._theme),vu(this),Po.update.call(this,{type:"setTheme"},o)}catch(s){throw this[wr]=!1,s}this[wr]=!1,_h.call(this,a),xh.call(this,a)}}},t.prototype._updateTheme=function(r){ue(r)&&(r=XU[r]),r&&(r=Se(r),r&&XH(r,!0),this._theme=r)},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||et.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(r){return this.renderToCanvas(r)},t.prototype.renderToCanvas=function(r){r=r||{};var n=this._zr.painter;return n.getRenderedCanvas({backgroundColor:r.backgroundColor||this._model.get("backgroundColor"),pixelRatio:r.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(r){r=r||{};var n=this._zr.painter;return n.renderToString({useViewBox:r.useViewBox})},t.prototype.getSvgDataURL=function(){var r=this._zr,n=r.storage.getDisplayList();return E(n,function(i){i.stopAnimation(null,!0)}),r.painter.toDataURL()},t.prototype.getDataURL=function(r){if(this._disposed){this.id;return}r=r||{};var n=r.excludeComponents,i=this._model,a=[],o=this;E(n,function(l){i.eachComponent({mainType:l},function(u){var c=o._componentsMap[u.__viewId];c.group.ignore||(a.push(c),c.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return E(a,function(l){l.group.ignore=!1}),s},t.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var n=r.type==="svg",i=this.group,a=Math.min,o=Math.max,s=1/0;if(Ix[i]){var l=s,u=s,c=-s,h=-s,f=[],d=r&&r.pixelRatio||this.getDevicePixelRatio();E(Ku,function(w,S){if(w.group===i){var T=n?w.getZr().painter.getSvgDom().innerHTML:w.renderToCanvas(Se(r)),M=w.getDom().getBoundingClientRect();l=a(M.left,l),u=a(M.top,u),c=o(M.right,c),h=o(M.bottom,h),f.push({dom:T,left:M.left,top:M.top})}}),l*=d,u*=d,c*=d,h*=d;var g=c-l,m=h-u,y=Er.createCanvas(),_=rM(y,{renderer:n?"svg":"canvas"});if(_.resize({width:g,height:m}),n){var x="";return E(f,function(w){var S=w.left-l,T=w.top-u;x+=''+w.dom+""}),_.painter.getSvgRoot().innerHTML=x,r.connectedBackgroundColor&&_.painter.setBackgroundColor(r.connectedBackgroundColor),_.refreshImmediately(),_.painter.toDataURL()}else return r.connectedBackgroundColor&&_.add(new Ye({shape:{x:0,y:0,width:g,height:m},style:{fill:r.connectedBackgroundColor}})),E(f,function(w){var S=new Or({style:{x:w.left*d-l,y:w.top*d-u,image:w.dom}});_.add(S)}),_.refreshImmediately(),y.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},t.prototype.convertToPixel=function(r,n,i){return Zy(this,"convertToPixel",r,n,i)},t.prototype.convertToLayout=function(r,n,i){return Zy(this,"convertToLayout",r,n,i)},t.prototype.convertFromPixel=function(r,n,i){return Zy(this,"convertFromPixel",r,n,i)},t.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=df(i,r);return E(o,function(s,l){l.indexOf("Models")>=0&&E(s,function(u){var c=u.coordinateSystem;if(c&&c.containPoint)a=a||!!c.containPoint(n);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint&&(a=a||h.containPoint(n,u))}},this)},this),!!a},t.prototype.getVisual=function(r,n){var i=this._model,a=df(i,r,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?hI(s,l,n):sm(s,n)},t.prototype.getViewOfComponentModel=function(r){return this._componentsMap[r.__viewId]},t.prototype.getViewOfSeriesModel=function(r){return this._chartsMap[r.__viewId]},t.prototype._initEvents=function(){var r=this;E(jae,function(i){var a=function(o){var s=r.getModel(),l=o.target,u,c=i==="globalout";if(c?u={}:l&&Vu(l,function(m){var y=Re(m);if(y&&y.dataIndex!=null){var _=y.dataModel||s.getSeriesByIndex(y.seriesIndex);return u=_&&_.getDataParams(y.dataIndex,y.dataType,l)||{},!0}else if(y.eventData)return u=ee({},y.eventData),!0},!0),u){var h=u.componentType,f=u.componentIndex;(h==="markLine"||h==="markPoint"||h==="markArea")&&(h="series",f=u.seriesIndex);var d=h&&f!=null&&s.getComponent(h,f),g=d&&r[d.mainType==="series"?"_chartsMap":"_componentsMap"][d.__viewId];u.event=o,u.type=i,r._$eventProcessor.eventInfo={targetEl:l,packedEvent:u,model:d,view:g},r.trigger(i,u)}};a.zrEventfulCallAtLast=!0,r._zr.on(i,a,r)});var n=this._messageCenter;E(jM,function(i,a){n.on(a,function(o){r.trigger(a,o)})}),Gie(n,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var r=this.getDom();r&&pG(this.getDom(),gI,"");var n=this,i=n._api,a=n._model;E(n._componentsViews,function(o){o.dispose(a,i)}),E(n._chartsViews,function(o){o.dispose(a,i)}),n._zr.dispose(),n._dom=n._model=n._chartsMap=n._componentsMap=n._chartsViews=n._componentsViews=n._scheduler=n._api=n._zr=n._throttledZrFlush=n._theme=n._coordSysMgr=n._messageCenter=null,delete Ku[n.id]},t.prototype.resize=function(r){if(!this[wr]){if(this._disposed){this.id;return}this._zr.resize(r);var n=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!n){var i=n.resetOption("media"),a=r&&r.silent;this[Br]&&(a==null&&(a=this[Br].silent),i=!0,this[Br]=null),this[wr]=!0,bh(this);try{i&&vu(this),Po.update.call(this,{type:"resize",animation:ee({duration:0},r&&r.animation)})}catch(o){throw this[wr]=!1,o}this[wr]=!1,_h.call(this,a),xh.call(this,a)}}},t.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(Ie(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!BM[r]){var i=BM[r](this._api,n),a=this._zr;this._loadingFX=i,a.add(i)}},t.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(r){var n=ee({},r);return n.type=RM[r.type],n},t.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(Ie(n)||(n={silent:!!n}),!!Lx[r.type]&&this._model){if(this[wr]){this._pendingActions.push(r);return}var i=n.silent;QS.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&et.browser.weChat&&this._throttledZrFlush(),_h.call(this,i),xh.call(this,i)}},t.prototype.updateLabelLayout=function(){Ti.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(r){if(this._disposed){this.id;return}var n=r.seriesIndex,i=this.getModel(),a=i.getSeriesByIndex(n);a.appendData(r),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=function(){vu=function(h){Wie(h._model);var f=h._scheduler;f.restorePipelines(h._zr,h._model),f.prepareStageTasks(),KS(h,!0),KS(h,!1),f.plan()},KS=function(h,f){for(var d=h._model,g=h._scheduler,m=f?h._componentsViews:h._chartsViews,y=f?h._componentsMap:h._chartsMap,_=h._zr,x=h._api,w=0;wye(f.get("hoverLayerThreshold"),GH.hoverLayerThreshold)&&!et.node&&!et.worker;(h._usingTHL||y)&&(f.eachSeries(function(_){if(!_.preventUsingHoverLayer){var x=h._chartsMap[_.__viewId];x.__alive&&x.eachRendered(function(w){var S=w.states.emphasis;S&&S.hoverLayer!==vd&&(S.hoverLayer=y?aH:iH)})}}),h._usingTHL=y)}}function s(h,f){var d=h.get("blendMode")||null;f.eachRendered(function(g){g.isGroup||(g.style.blend=d)})}function l(h,f){if(!h.preventAutoZ){var d=mc(h);f.eachRendered(function(g){return gb(g,d.z,d.zlevel),!0})}}function u(h,f){f.eachRendered(function(d){if(!vf(d)){var g=d.getTextContent(),m=d.getTextGuideLine();d.stateTransition&&(d.stateTransition=null),g&&g.stateTransition&&(g.stateTransition=null),m&&m.stateTransition&&(m.stateTransition=null),d.hasState()?(d.prevStates=d.currentStates,d.clearStates()):d.prevStates&&(d.prevStates=null)}})}function c(h,f){var d=h.getModel("stateAnimation"),g=h.isAnimationEnabled(),m=d.get("duration"),y=m>0?{duration:m,delay:d.get("delay"),easing:d.get("easing")}:null;f.eachRendered(function(_){if(_.states&&_.states.emphasis){if(vf(_))return;if(_ instanceof Je&&Xte(_),_.__dirty){var x=_.prevStates;x&&_.useStates(x)}if(g){_.stateTransition=y;var w=_.getTextContent(),S=_.getTextGuideLine();w&&(w.stateTransition=y),S&&(S.stateTransition=y)}_.__dirty&&a(_)}})}$j=function(h){return new(function(f){q(d,f);function d(){return f!==null&&f.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return h._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(g){for(;g;){var m=g.__ecComponentInfo;if(m!=null)return h._model.getComponent(m.mainType,m.index);g=g.parent}},d.prototype.enterEmphasis=function(g,m){hs(g,m),bi(h)},d.prototype.leaveEmphasis=function(g,m){fs(g,m),bi(h)},d.prototype.enterBlur=function(g){VG(g),bi(h)},d.prototype.leaveBlur=function(g){Ik(g),bi(h)},d.prototype.enterSelect=function(g){GG(g),bi(h)},d.prototype.leaveSelect=function(g){HG(g),bi(h)},d.prototype.getModel=function(){return h.getModel()},d.prototype.getViewOfComponentModel=function(g){return h.getViewOfComponentModel(g)},d.prototype.getViewOfSeriesModel=function(g){return h.getViewOfSeriesModel(g)},d.prototype.getECUpdateCycleVersion=function(){return h[Uy]},d.prototype.usingTHL=function(){return h._usingTHL},d}(RG))(h)},YU=function(h){function f(d,g){for(var m=0;m=0)){Xj.push(r);var o=wU.wrapStageHandler(r,i);o.__prio=t,o.__raw=r,e.push(o)}}function wI(e,t){BM[e]=t}function Zae(e){y6({createCanvas:e})}function t8(e,t,r){var n=IU("registerMap");n&&n(e,t,r)}function $ae(e){var t=IU("getMap");return t&&t(e)}var r8=eie;Bl(vI,Mie);Bl(Cb,Aie);Bl(Cb,Lie);Bl(vI,Fie);Bl(Cb,Vie);Bl(VU,_ae);_I(XH);xI(Tae,Dne);wI("default",kie);wa({type:Yu,event:Yu,update:Yu},Yt);wa({type:a_,event:a_,update:a_},Yt);wa({type:fx,event:Lk,update:fx,action:Yt,refineEvent:SI,publishNonRefinedEvent:!0});wa({type:fM,event:Lk,update:fM,action:Yt,refineEvent:SI,publishNonRefinedEvent:!0});wa({type:dx,event:Lk,update:dx,action:Yt,refineEvent:SI,publishNonRefinedEvent:!0});function SI(e,t,r,n){return{eventContent:{selected:Ute(r),isFromClick:t.isFromClick||!1}}}yI("default",{});yI("dark",MU);var Yae={},qj=[],Xae={registerPreprocessor:_I,registerProcessor:xI,registerPostInit:KU,registerPostUpdate:JU,registerUpdateLifecycle:Tb,registerAction:wa,registerCoordinateSystem:QU,registerLayout:e8,registerVisual:Bl,registerTransform:r8,registerLoading:wI,registerMap:t8,registerImpl:Hie,PRIORITY:GU,ComponentModel:Xe,ComponentView:It,SeriesModel:Tt,ChartView:xt,registerComponentModel:function(e){Xe.registerClass(e)},registerComponentView:function(e){It.registerClass(e)},registerSeriesModel:function(e){Tt.registerClass(e)},registerChartView:function(e){xt.registerClass(e)},registerCustomSeries:function(e,t){PU(e,t)},registerSubTypeDefaulter:function(e,t){Xe.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){rG(e,t)}};function We(e){if(ne(e)){E(e,function(t){We(t)});return}Be(qj,e)>=0||(qj.push(e),Ce(e)&&(e={install:e}),e.install(Xae))}function pv(e){return e==null?0:e.length||1}function Kj(e){return e}var ds=function(){function e(t,r,n,i,a,o){this._old=t,this._new=r,this._oldKeyGetter=n||Kj,this._newKeyGetter=i||Kj,this.context=a,this._diffModeMultiple=o==="multiple"}return e.prototype.add=function(t){return this._add=t,this},e.prototype.update=function(t){return this._update=t,this},e.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},e.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},e.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},e.prototype.remove=function(t){return this._remove=t,this},e.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},e.prototype._executeOneToOne=function(){var t=this._old,r=this._new,n={},i=new Array(t.length),a=new Array(r.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(r,n,a,"_newKeyGetter");for(var o=0;o1){var c=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(c,o)}else u===1?(n[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,n)},e.prototype._executeMultiple=function(){var t=this._old,r=this._new,n={},i={},a=[],o=[];this._initIndexMap(t,n,a,"_oldKeyGetter"),this._initIndexMap(r,i,o,"_newKeyGetter");for(var s=0;s1&&f===1)this._updateManyToOne&&this._updateManyToOne(c,u),i[l]=null;else if(h===1&&f>1)this._updateOneToMany&&this._updateOneToMany(c,u),i[l]=null;else if(h===1&&f===1)this._update&&this._update(c,u),i[l]=null;else if(h>1&&f>1)this._updateManyToMany&&this._updateManyToMany(c,u),i[l]=null;else if(h>1)for(var d=0;d1)for(var s=0;s30}var gv=Ie,ks=ae,toe=typeof Int32Array>"u"?Array:Int32Array,roe="e\0\0",Jj=-1,noe=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],ioe=["_approximateExtent"],Qj,Yy,mv,yv,rC,_v,nC,_n=function(){function e(t,r){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var n,i=!1;i8(t)?(n=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(i=!0,n=t),n=n||["x","y"];for(var a={},o=[],s={},l=!1,u={},c=0;c=r)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=i.getSource().sourceFormat,l=s===pi;if(l&&!i.pure)for(var u=[],c=t;c0},e.prototype.ensureUniqueItemVisual=function(t,r){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var a=i[r];return a==null&&(a=this.getVisual(r),ne(a)?a=a.slice():gv(a)&&(a=ee({},a)),i[r]=a),a},e.prototype.setItemVisual=function(t,r,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,gv(r)?ee(i,r):i[r]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(t,r){gv(t)?ee(this._layout,t):this._layout[t]=r},e.prototype.getLayout=function(t){return this._layout[t]},e.prototype.getItemLayout=function(t){return this._itemLayouts[t]},e.prototype.setItemLayout=function(t,r,n){this._itemLayouts[t]=n?ee(this._itemLayouts[t]||{},r):r},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(t,r){var n=this.hostModel&&this.hostModel.seriesIndex;hM(n,this.dataType,t,r),this._graphicEls[t]=r},e.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},e.prototype.eachItemGraphicEl=function(t,r){E(this._graphicEls,function(n,i){n&&t&&t.call(r,n,i)})},e.prototype.cloneShallow=function(t){return t||(t=new e(this._schema?this._schema:ks(this.dimensions,this._getDimInfo,this),this.hostModel)),rC(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(t,r){var n=this[t];Ce(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var i=n.apply(this,arguments);return r.apply(this,[i].concat(K1(arguments)))})},e.internalField=function(){Qj=function(t){var r=t._invertedIndicesMap;E(r,function(n,i){var a=t._dimInfos[i],o=a.ordinalMeta,s=t._store;if(o){n=r[i]=new toe(o.categories.length);for(var l=0;l1&&(l+="__ec__"+c),i[r]=l}}}(),e}();function aoe(e,t){return wd(e,t).dimensions}function wd(e,t){sI(e)||(e=lI(e)),t=t||{};var r=t.coordDimensions||[],n=t.dimensionsDefine||e.dimensionsDefine||[],i=pe(),a=[],o=ooe(e,r,n,t.dimensionsCount),s=t.canOmitUnusedDimensions&&o8(o),l=n===e.dimensionsDefine,u=l?a8(e):CI(n),c=t.encodeDefine;!c&&t.encodeDefaulter&&(c=t.encodeDefaulter(e,o));for(var h=pe(c),f=new lU(o),d=0;d0&&(P.name=P.name+(I-1))}),new n8({source:e,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function ooe(e,t,r,n){var i=Math.max(e.dimensionsDetectedCount||1,t.length,r.length,n||0);return E(t,function(a){var o;Ie(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function soe(e,t,r){if(r||t.hasKey(e)){for(var n=0;t.hasKey(e+n);)n++;e+=n}return t.set(e,!0),e}var loe=function(){function e(t){this.coordSysDims=[],this.axisMap=pe(),this.categoryAxisMap=pe(),this.coordSysName=t}return e}();function uoe(e){var t=e.get("coordinateSystem"),r=new loe(t),n=coe[t];if(n)return n(e,r,r.axisMap,r.categoryAxisMap),r}var coe={cartesian2d:function(e,t,r,n){var i=e.getReferringComponents("xAxis",Kt).models[0],a=e.getReferringComponents("yAxis",Kt).models[0];t.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),wh(i)&&(n.set("x",i),t.firstCategoryDimIndex=0),wh(a)&&(n.set("y",a),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,r,n){var i=e.getReferringComponents("singleAxis",Kt).models[0];t.coordSysDims=["single"],r.set("single",i),wh(i)&&(n.set("single",i),t.firstCategoryDimIndex=0)},polar:function(e,t,r,n){var i=e.getReferringComponents("polar",Kt).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),wh(a)&&(n.set("radius",a),t.firstCategoryDimIndex=0),wh(o)&&(n.set("angle",o),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},geo:function(e,t,r,n){t.coordSysDims=["lng","lat"]},parallel:function(e,t,r,n){var i=e.ecModel,a=i.getComponent("parallel",e.get("parallelIndex")),o=t.coordSysDims=a.dimensions.slice();E(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),c=o[l];r.set(c,u),wh(u)&&(n.set(c,u),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=l))})},matrix:function(e,t,r,n){var i=e.getReferringComponents("matrix",Kt).models[0];t.coordSysDims=["x","y"];var a=i.getDimensionModel("x"),o=i.getDimensionModel("y");r.set("x",a),r.set("y",o),n.set("x",a),n.set("y",o)}};function wh(e){return e.get("type")==="category"}function s8(e,t,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;hoe(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(e&&e.get("stack")),u,c,h,f,d=!0;function g(S){return S.type!=="ordinal"&&S.type!=="time"}if(E(a,function(S,T){ue(S)&&(a[T]=S={name:S}),g(S)||(d=!1)}),E(a,function(S,T){l&&!S.isExtraCoord&&(!n&&!u&&S.ordinalMeta&&(u=S),!c&&g(S)&&(!d||S.coordDim!=="x"&&S.coordDim!=="angle")&&(!i||i===S.coordDim)&&(c=S))}),c&&!n&&!u&&(n=!0),c){h="__\0ecstackresult_"+e.id,f="__\0ecstackedover_"+e.id,u&&(u.createInvertedIndices=!0);var m=c.coordDim,y=c.type,_=0;E(a,function(S){S.coordDim===m&&_++});var x={name:h,coordDim:m,coordDimIndex:_,type:y,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},w={name:f,coordDim:f,coordDimIndex:_+1,type:y,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(x.storeDimIndex=s.ensureCalculationDimension(f,y),w.storeDimIndex=s.ensureCalculationDimension(h,y)),o.appendCalculationDimension(x),o.appendCalculationDimension(w)):(a.push(x),a.push(w))}return{stackedDimension:c&&c.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:f,stackResultDimension:h}}function hoe(e){return!i8(e.schema)}function vs(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function TI(e,t){return vs(e,t)?e.getCalculationInfo("stackResultDimension"):t}function foe(e,t){var r=e.get("coordinateSystem"),n=yd.get(r),i;return t&&t.coordSysDims&&(i=ae(t.coordSysDims,function(a){var o={name:a},s=t.axisMap.get(a);if(s){var l=s.get("type");o.type=Nx(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function doe(e,t,r){var n,i;return r&&E(e,function(a,o){var s=a.coordDim,l=r.categoryAxisMap.get(s);l&&(n==null&&(n=o),a.ordinalMeta=l.getOrdinalMeta(),t&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&n!=null&&(e[n].otherDims.itemName=0),n}function wo(e,t,r){r=r||{};var n=t.getSourceManager(),i,a=!1;e?(a=!0,i=lI(e)):(i=n.getSource(),a=i.sourceFormat===pi);var o=uoe(t),s=foe(t,o),l=r.useEncodeDefaulter,u=Ce(l)?l:l?Ze(UH,s,t):null,c={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=wd(i,c),f=doe(h.dimensions,r.createInvertedIndices,o),d=a?null:n.getSharedDataStore(h),g=s8(t,{schema:h,store:d}),m=new _n(h,t);m.setCalculationInfo(g);var y=f!=null&&voe(i)?function(_,x,w,S){return S===f?w:this.defaultDimValueGetter(_,x,w,S)}:null;return m.hasItemOption=!1,m.initData(a?i:d,null,y),m}function voe(e){if(e.sourceFormat===pi){var t=poe(e.data||[]);return!ne(od(t))}}function poe(e){for(var t=0;t=t[0]&&e<=t[1]},getExtent:function(){return this._extents[Wn].slice()},getExtentUnsafe:function(e){return this._extents[e]},setExtent:function(e,t){eO(this._extents,Wn,e,t)},setExtent2:function(e,t,r){var n=this._extents;n[e]||(n[e]=n[Wn].slice()),eO(n,e,t,r)},freeze:function(){}};function eO(e,t,r,n){dc(r,n)&&(e[t][0]=r,e[t][1]=n)}function c8(e){return Dx(e)||Ff(e)}function Dx(e){return e.type==="interval"}function lm(e){return e.type==="time"}function Ff(e){return e.type==="log"}function bn(e){return e.type==="ordinal"}function boe(e){var t=ib(e),r=Fc(10,t),n=uo(e/r);return n?n===2?n=3:n===3?n=5:n*=2:n=1,at(n*r,-t)}function _c(e){return Ha(e)+2}function Xy(e,t){return uc(e)/uc(t)}function iC(e,t,r){var n=r&&r.lookup;if(n){for(var i=0;i1&&a/o>2&&(i=Math.round(Math.ceil(i/o)*o)),i!==n[0]&&l(n[0],!0,!0);for(var s=i;s<=n[1];s+=o)l(s,!1,s===n[0]||s===n[1]);s-o!==n[1]&&l(n[1],!0,!0);function l(u,c,h){r({value:u,offInterval:c},h)}}var yg=function(e){q(t,e);function t(r){var n=e.call(this)||this;n.type="ordinal",n.parse=t.parse,AI(n,t.decoratedMethods);var i=r.ordinalMeta;i||(i=new pg({})),ne(i)&&(i=new pg({categories:ae(i,function(o){return Ie(o)?o.value:o})})),n._ordinalMeta=i;var a=MI(null,null,r.extent||[0,i.categories.length-1]);return n._mapper=a.mapper,LI(n),n}return t.parse=function(r){return r==null?r=NaN:ue(r)?(r=this._ordinalMeta.getOrdinal(r),r==null&&(r=NaN)):r=uo(r),r},t.prototype.getTicks=function(){var r=[];return f8(this,0,function(n){r.push(n)}),r},t.prototype.getMinorTicks=function(r){},t.prototype.setSortInfo=function(r){if(r==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var n=r.ordinalNumbers,i=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=_t(s,n.length);o=0&&r=0&&r=0&&ro[0]&&mo[1]||!isFinite(m)||!isFinite(o[1]))break}else{if(y>g)break;m=_t(m,o[1]),y===g&&(m=o[1])}if(h.push({value:m}),m=at(m+i,s),u){var _=u.calcNiceTickMultiple(m,d);_>=0&&(m=at(m+_*i,s))}if(h.length>0&&m===h[h.length-1].value)break;if(h.length>f)return[]}var x=h.length?h[h.length-1].value:o[1];return a[1]>x&&h.push({value:r.expandToNicedExtent?at(x+i,s):a[1]}),c&&l.pruneTicksByBreak(r.pruneByBreak,h,u.breaks,function(w){return w.value},n.interval,a),c&&r.breakTicks!=="none"&&l.addBreaksToTicks(h,u.breaks,a),h},t.prototype.getMinorTicks=function(r){return kI(this,r,mx(this),this._cfg.interval)},t.prototype.getLabel=function(r,n){if(r==null)return"";var i=n&&n.precision;i==null?i=Ha(r.value)||0:i==="auto"&&(i=this._cfg.intervalPrecision);var a=at(r.value,i,!0);return Qk(a)},t.type="interval",t}(Sa);Sa.registerClass(gl);var Soe=function(e,t,r,n){for(;r>>1;e[i][1]16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function Toe(e){var t=30*Di;return e/=t,e>6?6:e>3?3:e>2?2:1}function Moe(e){return e/=bp,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function tO(e,t){return e/=t?Zk:Wk,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function Aoe(e){return $e(ab(e,!0),1)}function Loe(e,t,r){var n=Math.max(0,Be(ri,t)-1);return _x(new Date(e),ri[n],r).getTime()}function koe(e,t){var r=new Date(0);r[e](1);var n=r.getTime();r[e](1+t);var i=r.getTime()-n;return function(a,o){return Math.max(0,Math.round((o-a)/i))}}function Ioe(e,t,r,n,i,a){var o=3e3,s=Zre,l=0;function u(H,V,z,$,W,Z,X){for(var re=koe(W,H),J=V,oe=new Date(J);Jo));)if(oe[W](oe[$]()+H),J=oe.getTime(),a){var le=a.calcNiceTickMultiple(J,re);le>0&&(oe[W](oe[$]()+le*H),J=oe.getTime())}X.push({value:J,notAdd:J>n[1]})}function c(H,V,z){var $=[],W=!V.length;if(!v8(wp(H),n[0],n[1],r)){W&&(V=[{value:Loe(n[0],H,r)},{value:n[1]}]);for(var Z=0;Z=n[0]&&X<=n[1]&&u(J,X,re,oe,le,De,$),H==="year"&&z.length>1&&Z===0&&z.unshift({value:z[0].value-J})}}for(var Z=0;Z<$.length;Z++)z.push($[Z])}}for(var h=[],f=[],d=0,g=0,m=0;m=n[0]&&S<=n[1]&&d++)}var T=i/t;if(d>T*1.5&&g>T/1.5||(h.push(x),d>T||e===s[m]))break}f=[]}}}for(var M=gt(ae(h,function(H){return gt(H,function(V){return V.value>=n[0]&&V.value<=n[1]&&!V.notAdd})}),function(H){return H.length>0}),A=M.length-1,N=[],m=0;mn[0])&&N.unshift({value:n[0],time:{level:0,upperTimeUnit:B,lowerTimeUnit:B},notNice:!0}),(!j||j.values&&(a=s);var l=qy.length,u=Math.min(Soe(qy,a,0,l),l-1),c=qy[u][1],h=qy[Math.max(u-1,0)][0];e.setTimeInterval({approxInterval:a,interval:c,minLevelUnit:h})};Sa.registerClass(d8);var Ky=0,Jy=1,Poe=2,p8=function(e){q(t,e);function t(r){var n=e.call(this)||this;n.type="log",n.parse=gl.parse,n.base=r.logBase||10;var i=[],a=[],o=n._lookup={from:i,to:a};i[Ky]=i[Jy]=a[Ky]=a[Jy]=NaN,AI(n,t.mapperMethods);var s=hr(),l=r.breakOption,u={lookup:o};return s&&s.parseAxisBreakOptionInwardTransform(l,n,{noNegative:!0},Poe,u),n.powStub=new gl({breakParsed:u.original}),n.intervalStub=new gl({breakParsed:u.transformed}),LI(n,n.intervalStub),n}return t.prototype.getTicks=function(r){var n=this.base,i=this.powStub,a=hr(),o=this.intervalStub,s=o.getExtent(),l=i.getExtent(),u={lookup:{from:s,to:l}};return ae(o.getTicks(r||{}),function(c){var h=c.value,f=iC(h,n,u),d;if(a){var g=a.getTicksBreakOutwardTransform(this,c,mx(i),this._lookup);g&&(d=g.vBreak,f=g.tickVal)}return{value:f,break:d}},this)},t.prototype.getMinorTicks=function(r){return kI(this,r,mx(this.powStub),this.intervalStub.getConfig().interval)},t.prototype.getLabel=function(r,n){return this.intervalStub.getLabel(r,n)},t.type="log",t.mapperMethods={needTransform:function(){return!0},normalize:function(r){return this.intervalStub.normalize(Xy(r,this.base))},scale:function(r){return iC(this.intervalStub.scale(r),this.base,null)},transformIn:function(r,n){return r=Xy(r,this.base),n&&n.depth===Jo?r:this.intervalStub.transformIn(r,n)},transformOut:function(r,n){var i=n?n.depth:null;return rO.depth=i,nO.lookup=this._lookup,iC(i===Jo?r:this.intervalStub.transformOut(r,rO),this.base,nO)},contain:function(r){return this.powStub.contain(r)},setExtent:function(r,n){this.setExtent2(Wn,r,n)},setExtent2:function(r,n,i){if(!(!dc(n,i)||n<=0||i<=0)){var a=iO,o=iO;if(r===Wn){var s=this._lookup;a=s.to,o=s.from}this.powStub.setExtent2(r,a[Ky]=n,a[Jy]=i);var l=this.base;this.intervalStub.setExtent2(r,o[Ky]=Xy(n,l),o[Jy]=Xy(i,l))}},getFilter:function(){return{g:0}},sanitize:function(r,n){return dc(n[0],n[1])&&Wi(r)&&r<=0&&(r=n[0]),r},getDefaultStartValue:function(){return 1},getExtent:function(){return this.powStub.getExtent()},getExtentUnsafe:function(r,n){return n===null?this.powStub.getExtentUnsafe(r,null):this.intervalStub.getExtentUnsafe(r,n)}},t}(Sa);Sa.registerClass(p8);var rO={},nO={},iO=[],g8={value:1,category:1,time:1,log:1},m8=He();function um(e){var t=e.get("type");return(t==null||!ge(g8,t)&&!Sa.getClass(t))&&(t="value"),t}function Sd(e,t,r){var n=hr(),i;switch(n&&(i=y8(e,t,r)),t){case"category":return new yg({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:Qr()});case"time":return new d8({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC"),breakOption:i});case"log":return new p8({logBase:e.get("logBase"),breakOption:i});case"value":return new gl({breakOption:i});default:return new(Sa.getClass(t)||gl)({})}}function Doe(e,t,r){var n=e.getExtentUnsafe(Wn,null),i=n[0],a=n[1];return dc(i,a)?i===t||a===t?Roe:it?Eoe:VM:VM}var Eoe=1,Roe=2,VM=3;function joe(e){m8(e).noOnMyZero=!0}function Ooe(e){return m8(e).noOnMyZero}function cm(e){var t=e.getLabelModel().get("formatter");if(e.type==="time"){var r=$re(t);return function(i,a){return e.scale.getFormattedLabel(i,a,r)}}else{if(ue(t))return function(i){var a=e.scale.getLabel(i),o=t.replace("{value}",a??"");return o};if(Ce(t)){if(e.type==="category")return function(i,a){return t(Ex(e,i),i.value-e.scale.getExtent()[0],null)};var n=hr();return function(i,a){var o=null;return n&&(o=n.makeAxisLabelFormatterParamBreak(o,i.break)),t(Ex(e,i),a,o)}}else return function(i){return e.scale.getLabel(i)}}}function Ex(e,t){var r=e.scale;return bn(r)?r.getLabel(t):t.value}function II(e){var t=e.get("interval");return t??"auto"}function zoe(e){return e.type==="category"&&II(e.getLabelModel())===0}function Boe(e,t){var r={};return E(e.mapDimensionsAll(t),function(n){r[TI(e,n)]=!0}),Qe(r)}function Vf(e){return e==="middle"||e==="center"}function _g(e){return e.getShallow("show")}function y8(e,t,r){var n=e.get("breaks",!0);if(n!=null)return!hr()||!r||!Foe(t)?void 0:n}function Foe(e){return e!=="category"}function _8(e,t,r,n,i,a){var o=Ff(e),s=o?e.intervalStub:e;if(s.setExtent(n[0],n[1]),o){var l=e.powStub,u={depth:Jo},c=e.transformOut(n[0],u),h=e.transformOut(n[1],u),f=woe(r,n);t[0]&&!f[0]&&(c=i[0]),t[1]&&!f[1]&&(h=i[1]),l.setExtent(c,h)}s.setConfig(a)}function Cd(e,t){return bn(e)?e.getRawOrdinalNumber(t.value):t.value}function hm(e,t){return bn(e)&&!!t.get("boundaryGap")}var Td=function(){function e(){}return e.prototype.needIncludeZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}(),Voe=ld(),Rx="|&",Md=He(),x8=-2,Goe=-1,Hoe=He();function NI(e,t){var r=e.model,n=Md(xd(r.ecModel)).keyed,i=n&&n.get(t);return i&&i.get(r.uid)}function Uoe(e,t){return w8(NI(e,t))}function Woe(e,t){var r=[];return b8(e.model.ecModel,function(n){for(var i=0;i0&&h[1]>0&&!f[0]&&(h[0]=0),h[0]<0&&h[1]<0&&!f[1]&&(h[1]=0));var S=!1;h[0]>h[1]&&(h.reverse(),S=!0);var T=xv(t,r.get("startValue",!0)),M=T!=null;!Wi(T)&&i&&(T=t.getDefaultStartValue?t.getDefaultStartValue():0),Wi(T)&&(M||!x||w)&&(Th[1]&&!f[1]&&(h[1]=T,f[1]=!0));var A=this._i={scale:t,dataMM:c,noZoomEffMM:h,zoomMM:[],fixMM:f,zoomFixMM:[!1,!1],startValue:T,isBlank:_,incl0:w,tggAxInv:S,ctnShp:a};aO(A,h)}return e.prototype.makeNoZoom=function(){return this._i.noZoomEffMM.slice()},e.prototype.makeFinal=function(){var t=this._i,r=t.zoomMM,n=t.noZoomEffMM,i=t.zoomFixMM,a=t.fixMM,o={fixMM:a,zoomFixMM:i,isBlank:t.isBlank,incl0:t.incl0,tggAxInv:t.tggAxInv,ctnShp:t.ctnShp,effMM:n.slice()},s=o.effMM;return r[0]!=null&&(s[0]=r[0],a[0]=i[0]=!0),r[1]!=null&&(s[1]=r[1],a[1]=i[1]=!0),aO(t,s),o},e.prototype.makeRenderInfo=function(){return{startValue:this._i.startValue}},e.prototype.setZoomMM=function(t,r){this._i.zoomMM[t]=r},e}();function aO(e,t){var r=e.scale,n=e.dataMM;r.sanitize&&(t[0]=r.sanitize(t[0],n),t[1]=r.sanitize(t[1],n),i_(t))}function xv(e,t){return t==null?null:tn(t)?NaN:e.parse(t)}function Qoe(e,t){var r;if(bn(e))r=[0,0];else{var n=t.get("boundaryGap");typeof n=="boolean"&&(n=null),r=ne(n)?n:[n,n]}return[oO(r[0]),oO(r[1])]}function oO(e){return lo(typeof e=="boolean"?0:e,1)||0}function M8(e){var t=qoe(e.scale);return t.extent||(t.extent=Qr()),t}function ese(e,t){M8(e).dimIdxInCoord=t.get(e.dim)}function wc(e,t){var r=e.scale,n=e.model,i=e.dim;r.rawExtentInfo||tse(r,e,i,n,t)}function tse(e,t,r,n,i){var a=M8(t),o=a.extent,s=!1;Zoe(t,function(c){if(c.boxCoordinateSystem){var h=NH(c).coord,f=a.dimIdxInCoord;if(f>=0){if(ne(h)){var d=h[f];d!=null&&!ne(d)&&oM(o,e.parse(d))}}}else if(c.coordinateSystem){var g=c.getData();if(g){var m=e.getFilter?e.getFilter():null;E(Boe(g,r),function(y){Pee(o,g.getApproximateExtent(y,m))})}c.__requireStartValue&&c.__requireStartValue(t)&&(s=!0)}});var l=nse(e,t,n),u=new T8(e,n,o,s,l);A8(e,u,i),a.extent=null}function rse(e,t){var r=e.scale;A8(r,new T8(r,e.model,t,!1,!1),Joe)}function A8(e,t,r){e.rawExtentInfo=t,t.from=r}function kb(e,t){EI.set(e,t)}var EI=pe();function L8(e,t,r,n,i){e.rawExtentInfo||rse({scale:e,model:t},i||Qr());var a=e.rawExtentInfo.makeFinal(),o=a.effMM;return e.setExtent(o[0],o[1]),e.setBlank(a.isBlank),n&&a.tggAxInv&&r&&!r.get("legacyMinMaxDontInverseAxis")&&(n.inverse=!n.inverse),a}function nse(e,t,r){var n=hm(e,r),i=r.get("containShape",!0);if(i==null&&!n&&(i=!0),!i)return!1;var a=!1;return S8(t,function(o){a=!!EI.get(o)||a}),a}function ise(e,t,r,n){if(r.ctnShp){var i;if(S8(e,function(s){var l=EI.get(s);if(l){var u=l(e,n);u&&(i=i||[0,0],mG(i,u[0]),yG(i,u[1]),joe(e))}}),!!i){var a=t.getExtent();if(bn(t))e.onBand||t.setExtent2(gg,_t(a[0],a[0]+i[0]),$e(a[1],a[1]+i[1]));else{var o=a.slice();r.zoomFixMM[0]||(o[0]=_t(o[0],t.transformOut(t.transformIn(o[0],null)+i[0],null))),r.zoomFixMM[1]||(o[1]=$e(o[1],t.transformOut(t.transformIn(o[1],null)+i[1],null))),(o[0]a[1])&&t.setExtent2(gg,o[0],o[1])}}}}function sO(e,t){var r=Ff(e),n=r?e.intervalStub:e,i=t.fixMinMax||[],a=r?e.getExtent():null,o=n.getExtent(),s=h8(o,i,t.rawExtentResult);n.setExtent(s[0],s[1]),s=n.getExtent();var l=r?ose(n,t):ase(n,t),u=l.intervalPrecision,c=l.interval,h=t.userInterval;h!=null&&(l.interval=h,l.intervalPrecision=_c(h)),i[0]||(s[0]=at(Ui(s[0]/c)*c,u)),i[1]||(s[1]=at(Bc(s[1]/c)*c,u)),h!=null&&(l.niceExtent=s.slice()),_8(e,i,o,s,a,l)}function ase(e,t){var r=Ab(t.splitNumber,5),n=Mb(e),i=t.minInterval,a=t.maxInterval,o=ab(n/r,!0);i!=null&&oa&&(o=a);var s=_c(o),l=e.getExtent(),u=[at(Bc(l[0]/o)*o,s),at(Ui(l[1]/o)*o,s)];return{interval:o,intervalPrecision:s,niceExtent:u}}function ose(e,t){var r=Ab(t.splitNumber,10),n=e.getExtent(),i=Mb(e),a=$e(mk(i),1),o=r/i*a;o<=.5&&(a*=10);var s=_c(a),l=[at(Bc(n[0]/a)*a,s),at(Ui(n[1]/a)*a,s)];return{intervalPrecision:s,interval:a,niceExtent:l}}function Hf(e){var t=e.scale,r=e.model,n=r.axis,i=r.ecModel;k8(t,r,n,i,null)}function k8(e,t,r,n,i){var a=L8(e,t,n,r,i),o=Dx(e)||lm(e);I8(e,{splitNumber:t.get("splitNumber"),fixMinMax:a.fixMM,userInterval:t.get("interval"),minInterval:o?t.get("minInterval"):null,maxInterval:o?t.get("maxInterval"):null,rawExtentResult:a}),r&&n&&ise(r,e,a,n)}function I8(e,t){sse[e.type](e,t)}var sse={interval:sO,log:sO,time:Noe,ordinal:Yt};function lse(e){return wo(null,e)}var use={isDimensionStacked:vs,enableDataStack:s8,getStackedDimension:TI};function cse(e,t){var r=t;t instanceof Ke||(r=new Ke(t));var n=um(r),i=Sd(r,n,!1);return e[1]i&&(n=o,i=l)}if(n)return gse(n.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},t.prototype.getBoundingRect=function(r){var n=this._rect;if(n&&!r)return n;var i=[1/0,1/0],a=[-1/0,-1/0],o=this.geometries;return E(o,function(s){s.type==="polygon"?uO(s.exterior,i,a,r):E(s.points,function(l){uO(l,i,a,r)})}),isFinite(i[0])&&isFinite(i[1])&&isFinite(a[0])&&isFinite(a[1])||(i[0]=i[1]=a[0]=a[1]=0),n=new Ae(i[0],i[1],a[0]-i[0],a[1]-i[1]),r||(this._rect=n),n},t.prototype.contain=function(r){var n=this.getBoundingRect(),i=this.geometries;if(!n.contain(r[0],r[1]))return!1;e:for(var a=0,o=i.length;a>1^-(s&1),l=l>>1^-(l&1),s+=i,l+=a,i=s,a=l,n.push([s/r,l/r])}return n}function UM(e,t){return e=yse(e),ae(gt(e.features,function(r){return r.geometry&&r.properties&&r.geometry.coordinates.length>0}),function(r){var n=r.properties,i=r.geometry,a=[];switch(i.type){case"Polygon":var o=i.coordinates;a.push(new cO(o[0],o.slice(1)));break;case"MultiPolygon":E(i.coordinates,function(l){l[0]&&a.push(new cO(l[0],l.slice(1)))});break;case"LineString":a.push(new hO([i.coordinates]));break;case"MultiLineString":a.push(new hO(i.coordinates))}var s=new P8(n[t||"name"],a,n.cp);return s.properties=n,s})}const _se=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:ag,asc:Hr,getPercentWithPrecision:fee,getPixelPrecision:hee,getPrecision:Ha,getPrecisionSafe:oG,isNumeric:yk,isRadianAroundZero:cc,linearMap:ut,nice:ab,numericToNumber:co,parseDate:xo,parsePercent:he,quantile:n_,quantity:mk,quantityExponent:ib,reformIntervals:iM,remRadian:gk,round:cee},Symbol.toStringTag,{value:"Module"})),xse=Object.freeze(Object.defineProperty({__proto__:null,format:am,parse:xo,roundTime:_x},Symbol.toStringTag,{value:"Module"})),bse=Object.freeze(Object.defineProperty({__proto__:null,Arc:rm,BezierCurve:fd,BoundingRect:Ae,Circle:bo,CompoundPath:nm,Ellipse:tm,Group:Me,Image:Or,IncrementalDisplayable:rH,Line:cr,LinearGradient:Gc,Polygon:sn,Polyline:Zr,RadialGradient:Dk,Rect:Ye,Ring:hd,Sector:on,Text:rt,clipPointsByRect:Ok,clipRectByRect:uH,createIcon:pd,extendPath:sH,extendShape:oH,getShapeClass:ug,getTransform:Xu,initProps:Rt,makeImage:Rk,makePath:jf,mergePath:ii,registerShape:qi,resizePath:jk,updateProps:ot},Symbol.toStringTag,{value:"Module"})),wse=Object.freeze(Object.defineProperty({__proto__:null,addCommas:Qk,capitalFirst:tne,encodeHTML:gn,formatTime:ene,formatTpl:tI,getTextRect:Qre,getTooltipMarker:LH,normalizeCssArray:md,toCamelCase:eI,truncateText:Xee},Symbol.toStringTag,{value:"Module"})),Sse=Object.freeze(Object.defineProperty({__proto__:null,bind:de,clone:Se,curry:Ze,defaults:Le,each:E,extend:ee,filter:gt,indexOf:Be,inherits:sk,isArray:ne,isFunction:Ce,isObject:Ie,isString:ue,map:ae,merge:Ge,reduce:Hi},Symbol.toStringTag,{value:"Module"}));var Cse=He(),Cp=He(),xa={estimate:1,determine:2};function jx(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function Tse(e,t){var r=e.getLabelModel().get("customValues");if(r){var n=e.scale;return{labels:ae(E8(r,n),function(i,a){return{formattedLabel:cm(e)(i,a),rawLabel:n.getLabel(i),tick:i}})}}return e.type==="category"?Ase(e,t):kse(e)}function Mse(e,t,r){var n=e.scale,i=e.getTickModel().get("customValues");return i?{ticks:E8(i,n)}:e.type==="category"?Lse(e,t):{ticks:n.getTicks(r)}}function E8(e,t){var r=t.getExtent(),n=[];return E(e,function(i){i=t.parse(i),i>=r[0]&&i<=r[1]&&n.push(i)}),ob(n,jee,null),Hr(n),ae(n,function(i){return{value:i}})}function Ase(e,t){var r=e.getLabelModel(),n=R8(e,r,t);return!r.get("show")||e.scale.isBlank()?{labels:[]}:n}function R8(e,t,r){var n=Nse(e),i=II(t),a=r.kind===xa.estimate;if(!a){var o=O8(n,i);if(o)return o}var s,l;Ce(i)?s=Ox(e,i,!1):(l=i==="auto"?Pse(e,r):i,s=Ox(e,l,!1));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return WM(n,i,u),!0}):WM(n,i,u),u}function Lse(e,t){var r=Ise(e),n=II(t),i=O8(r,n);if(i)return i;var a,o;if((!t.get("show")||e.scale.isBlank())&&(a=[]),Ce(n))a=Ox(e,n,!0);else if(n==="auto"){var s=R8(e,e.getLabelModel(),jx(xa.determine));o=s.labelCategoryInterval,a=ae(s.labels,function(l){return l.tick})}else o=n,a=Ox(e,o,!0);return WM(r,n,{ticks:a,tickCategoryInterval:o})}function kse(e){var t=e.scale.getTicks(),r=cm(e);return{labels:ae(t,function(n,i){return{formattedLabel:r(n,i),rawLabel:e.scale.getLabel(n),tick:n}})}}var Ise=j8("axisTick"),Nse=j8("axisLabel");function j8(e){return function(r){return Cp(r)[e]||(Cp(r)[e]={list:[]})}}function O8(e,t){for(var r=0;rc&&(u=Math.max(1,Math.floor(l/c)));for(var h=s[0],f=e.dataToCoord(h+1)-e.dataToCoord(h),d=Math.abs(f*Math.cos(a)),g=Math.abs(f*Math.sin(a)),m=0,y=0;h<=s[1];h+=u){var _=0,x=0,w=tb(i({value:h}),n.font,"center","top");_=w.width*1.3,x=w.height*1.3,m=Math.max(m,_,7),y=Math.max(y,x,7)}var S=m/d,T=y/g;isNaN(S)&&(S=1/0),isNaN(T)&&(T=1/0);var M=Math.max(0,Math.floor(Math.min(S,T)));if(r===xa.estimate)return t.out.noPxChangeTryDetermine.push(de(Ese,null,e,M,l)),M;var A=z8(e,M,l);return A??M}function Ese(e,t,r){return z8(e,t,r)==null}function z8(e,t,r){var n=Cse(e.model),i=e.getExtent(),a=n.lastAutoInterval,o=n.lastTickCount;if(a!=null&&o!=null&&Math.abs(a-t)<=1&&Math.abs(o-r)<=1&&a>t&&n.axisExtent0===i[0]&&n.axisExtent1===i[1])return a;n.lastTickCount=r,n.lastAutoInterval=t,n.axisExtent0=i[0],n.axisExtent1=i[1]}function Rse(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}function Ox(e,t,r){var n=cm(e),i=e.scale,a=[],o=Ce(t);return f8(i,o?0:t,function(s,l){var u=i.getLabel(s);if(o){var c=!!t(s.value,u);if(s.offInterval=!c,!c&&!l)return}a.push(r?s:{formattedLabel:n(s),rawLabel:u,tick:s})}),a}var jse=.8;function ln(e,t){t=t||{};var r={w:NaN,w2:NaN},n=e.scale,i=t.fromStat,a=t.min,o=_oe(n);Wi(o)||(o=NaN);var s=e.getExtent(),l=$t(s[1]-s[0]);return bn(n)?Ose(r,e,o,l):i&&zse(r,e,o,l,i),a!=null&&(r.w=Wi(r.w)?$e(a,r.w):a),r}function Ose(e,t,r,n){var i=t.onBand,a=r+(i?1:0);a===0&&(a=1),e.w=n/a,!i&&r&&n&&(e.w2=e.w*r/n)}function zse(e,t,r,n,i){var a=!1,o=-1/0;E(i.key?[Uoe(t,i.key)]:Woe(t,i.sers||[]),function(s){var l=s.liPosMinGap;l!=null&&(l>0?(l>o&&(o=l),a=!1):l===x8&&(a=!0))}),Wi(r)&&r>0&&Wi(o)?(e.w=n/r*o,e.w2=o):a&&(e.w=n*jse,e.w2=e.w*r/n)}var fO=[0,1],Ki=function(){function e(t,r,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=r,this._extent=n||[0,0]}return e.prototype.contain=function(t){var r=this._extent,n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return t>=n&&t<=i},e.prototype.containData=function(t){return this.scale.contain(this.scale.parse(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(t,r){var n=this._extent;n[0]=t,n[1]=r},e.prototype.dataToCoord=function(t,r){var n=this.scale;return t=n.normalize(n.parse(t)),ut(t,fO,dO(this),r)},e.prototype.coordToData=function(t,r){var n=ut(t,dO(this),fO,r);return this.scale.scale(n)},e.prototype.pointToData=function(t,r){},e.prototype.getTicksCoords=function(t){t=t||{};var r=t.tickModel||this.getTickModel(),n=Mse(this,r,{breakTicks:t.breakTicks,pruneByBreak:t.pruneByBreak}),i=ae(n.ticks,function(s){return{coord:this.dataToCoord(Cd(this.scale,s)),tick:s}},this),a=r.get("alignWithLabel"),o=Bse(this,i,a);return ae(i,function(s){return{coord:s.coord,tickValue:s.tick.value,onBand:o}})},e.prototype.getMinorTicksCoords=function(){if(bn(this.scale))return[];var t=this.model.getModel("minorTick"),r=t.get("splitNumber");r>0&&r<100||(r=5);var n=this.scale.getMinorTicks(r),i=ae(n,function(a){return ae(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},e.prototype.getViewLabels=function(t){return t=t||jx(xa.determine),Tse(this,t).labels},e.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},e.prototype.getTickModel=function(){return this.model.getModel("axisTick")},e.prototype.getBandWidth=function(){return ln(this,{min:1}).w},e.prototype.calculateCategoryInterval=function(t){return t=t||jx(xa.determine),Dse(this,t)},e}();function dO(e){var t=e.getExtent();if(e.onBand){var r=t[1]-t[0],n=r/e.scale.count()/2;t[0]+=n,t[1]-=n}return t}function Bse(e,t,r){var n=t.length;if(!e.onBand||r||!n)return!1;var i=ln(e).w;if(!i)return!1;E(t,function(s){s.coord-=i/2});var a=e.scale.getExtent(),o=t[n-1];return o.tick.offInterval&&t.pop(),t.push({coord:o.coord+i,tick:{value:a[1]+1}}),!0}function Fse(e){var t=Xe.extend(e);return Xe.registerClass(t),t}function Vse(e){var t=It.extend(e);return It.registerClass(t),t}function Gse(e){var t=Tt.extend(e);return Tt.registerClass(t),t}function Hse(e){var t=xt.extend(e);return xt.registerClass(t),t}var bv=Math.PI*2,pu=ho.CMD,Use=["top","right","bottom","left"];function Wse(e,t,r,n,i){var a=r.width,o=r.height;switch(e){case"top":n.set(r.x+a/2,r.y-t),i.set(0,-1);break;case"bottom":n.set(r.x+a/2,r.y+o+t),i.set(0,1);break;case"left":n.set(r.x-t,r.y+o/2),i.set(-1,0);break;case"right":n.set(r.x+a+t,r.y+o/2),i.set(1,0);break}}function Zse(e,t,r,n,i,a,o,s,l){o-=e,s-=t;var u=Math.sqrt(o*o+s*s);o/=u,s/=u;var c=o*r+e,h=s*r+t;if(Math.abs(n-i)%bv<1e-4)return l[0]=c,l[1]=h,u-r;if(a){var f=n;n=si(i),i=si(f)}else n=si(n),i=si(i);n>i&&(i+=bv);var d=Math.atan2(s,o);if(d<0&&(d+=bv),d>=n&&d<=i||d+bv>=n&&d+bv<=i)return l[0]=c,l[1]=h,u-r;var g=r*Math.cos(n)+e,m=r*Math.sin(n)+t,y=r*Math.cos(i)+e,_=r*Math.sin(i)+t,x=(g-o)*(g-o)+(m-s)*(m-s),w=(y-o)*(y-o)+(_-s)*(_-s);return x0){t=t/180*Math.PI,ca.fromArray(e[0]),Dt.fromArray(e[1]),ur.fromArray(e[2]),Pe.sub(Wa,ca,Dt),Pe.sub(Ga,ur,Dt);var r=Wa.len(),n=Ga.len();if(!(r<.001||n<.001)){Wa.scale(1/r),Ga.scale(1/n);var i=Wa.dot(Ga),a=Math.cos(t);if(a1&&Pe.copy(Ln,ur),Ln.toArray(e[1])}}}}function Xse(e,t,r){if(r<=180&&r>0){r=r/180*Math.PI,ca.fromArray(e[0]),Dt.fromArray(e[1]),ur.fromArray(e[2]),Pe.sub(Wa,Dt,ca),Pe.sub(Ga,ur,Dt);var n=Wa.len(),i=Ga.len();if(!(n<.001||i<.001)){Wa.scale(1/n),Ga.scale(1/i);var a=Wa.dot(t),o=Math.cos(r);if(a=l)Pe.copy(Ln,ur);else{Ln.scaleAndAdd(Ga,s/Math.tan(Math.PI/2-c));var h=ur.x!==Dt.x?(Ln.x-Dt.x)/(ur.x-Dt.x):(Ln.y-Dt.y)/(ur.y-Dt.y);if(isNaN(h))return;h<0?Pe.copy(Ln,Dt):h>1&&Pe.copy(Ln,ur)}Ln.toArray(e[1])}}}}function sC(e,t,r,n){var i=r==="normal",a=i?e:e.ensureState(r);a.ignore=t;var o=n.get("smooth");o=o===!0?.3:Math.max(+o,0)||0,a.shape=a.shape||{},a.shape.smooth=o;var s=n.getModel("lineStyle").getLineStyle();i?e.useStyle(s):a.style=s}function qse(e,t){var r=t.smooth,n=t.points;if(n)if(e.moveTo(n[0][0],n[0][1]),r>0&&n.length>=3){var i=Ho(n[0],n[1]),a=Ho(n[1],n[2]);if(!i||!a){e.lineTo(n[1][0],n[1][1]),e.lineTo(n[2][0],n[2][1]);return}var o=Math.min(i,a)*r,s=vp([],n[1],n[0],o/i),l=vp([],n[1],n[2],o/a),u=vp([],s,l,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),e.bezierCurveTo(l[0],l[1],l[0],l[1],n[2][0],n[2][1])}else for(var c=1;c0){S(I*P,0,a);var D=I+A;D<0&&T(-D*P,1)}else T(-A*P,1)}}function S(A,N,P){A!==0&&(c=!0);for(var I=N;I0)for(var D=0;D0;D--){var U=P[D-1]*B;S(-U,D,a)}}}function M(A){var N=A<0?-1:1;A=Math.abs(A);for(var P=Math.ceil(A/(a-1)),I=0;I0?S(P,0,I+1):S(-P,a-I-1,a),A-=P,A<=0)return}return c}function Qse(e){for(var t=0;t=0&&n.attr(a.oldLayoutSelect),Be(f,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),ot(n,u,r,l)}else if(n.attr(u),!gd(n).valueAnimation){var h=ye(n.style.opacity,1);n.style.opacity=0,Rt(n,{style:{opacity:h}},r,l)}if(a.oldLayout=u,n.states.select){var d=a.oldLayoutSelect={};Qy(d,u,e0),Qy(d,n.states.select,e0)}if(n.states.emphasis){var g=a.oldLayoutEmphasis={};Qy(g,u,e0),Qy(g,n.states.emphasis,e0)}pH(n,l,c,r,r)}if(i&&!i.ignore&&!i.invisible){var a=rle(i),o=a.oldLayout,m={points:i.shape.points};o?(i.attr({shape:o}),ot(i,{shape:m},r)):(i.setShape(m),i.style.strokePercent=0,Rt(i,{style:{strokePercent:1}},r)),a.oldLayout=m}},e}(),cC=He();function ile(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){var i=cC(r).labelManager;i||(i=cC(r).labelManager=new nle),i.clearLabels()}),e.registerUpdateLifecycle("series:layoutlabels",function(t,r,n){var i=cC(r).labelManager;E(n.updatedSeries,function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var hC=Math.sin,fC=Math.cos,W8=Math.PI,gu=Math.PI*2,ale=180/W8,Z8=function(){function e(){}return e.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},e.prototype.moveTo=function(t,r){this._add("M",t,r)},e.prototype.lineTo=function(t,r){this._add("L",t,r)},e.prototype.bezierCurveTo=function(t,r,n,i,a,o){this._add("C",t,r,n,i,a,o)},e.prototype.quadraticCurveTo=function(t,r,n,i){this._add("Q",t,r,n,i)},e.prototype.arc=function(t,r,n,i,a,o){this.ellipse(t,r,n,n,0,i,a,o)},e.prototype.ellipse=function(t,r,n,i,a,o,s,l){var u=s-o,c=!l,h=Math.abs(u),f=Ks(h-gu)||(c?u>=gu:-u>=gu),d=u>0?u%gu:u%gu+gu,g=!1;f?g=!0:Ks(h)?g=!1:g=d>=W8==!!c;var m=t+n*fC(o),y=r+i*hC(o);this._start&&this._add("M",m,y);var _=Math.round(a*ale);if(f){var x=1/this._p,w=(c?1:-1)*(gu-x);this._add("A",n,i,_,1,+c,t+n*fC(o+w),r+i*hC(o+w)),x>.01&&this._add("A",n,i,_,0,+c,m,y)}else{var S=t+n*fC(s),T=r+i*hC(s);this._add("A",n,i,_,+g,+c,S,T)}},e.prototype.rect=function(t,r,n,i){this._add("M",t,r),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},e.prototype.closePath=function(){this._d.length>0&&this._add("Z")},e.prototype._add=function(t,r,n,i,a,o,s,l,u){for(var c=[],h=this._p,f=1;f"}function vle(e){return""}function zI(e,t){t=t||{};var r=t.newline?` +`:"";function n(i){var a=i.children,o=i.tag,s=i.attrs,l=i.text;return dle(o,s)+(o!=="style"?gn(l):l||"")+(a?""+r+ae(a,function(u){return n(u)}).join(r)+r:"")+vle(o)}return n(e)}function ple(e,t,r){r=r||{};var n=r.newline?` +`:"",i=" {"+n,a=n+"}",o=ae(Qe(e),function(l){return l+i+ae(Qe(e[l]),function(u){return u+":"+e[l][u]+";"}).join(n)+a}).join(n),s=ae(Qe(t),function(l){return"@keyframes "+l+i+ae(Qe(t[l]),function(u){return u+i+ae(Qe(t[l][u]),function(c){var h=t[l][u][c];return c==="d"&&(h='path("'+h+'")'),c+":"+h+";"}).join(n)+a}).join(n)+a}).join(n);return!o&&!s?"":[""].join(n)}function qM(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function _O(e,t,r,n){return Dr("svg","root",{width:e,height:t,xmlns:$8,"xmlns:xlink":Y8,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+e+" "+t:!1},r)}var gle=0;function q8(){return gle++}var xO={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},Cu="transform-origin";function mle(e,t,r){var n=ee({},e.shape);ee(n,t),e.buildPath(r,n);var i=new Z8;return i.reset(X6(e)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function yle(e,t){var r=t.originX,n=t.originY;(r||n)&&(e[Cu]=r+"px "+n+"px")}var _le={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function K8(e,t){var r=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[r]=e,r}function xle(e,t,r){var n=e.shape.paths,i={},a,o;if(E(n,function(l){var u=qM(r.zrId);u.animation=!0,Nb(l,{},u,!0);var c=u.cssAnims,h=u.cssNodes,f=Qe(c),d=f.length;if(d){o=f[d-1];var g=c[o];for(var m in g){var y=g[m];i[m]=i[m]||{d:""},i[m].d+=y.d||""}for(var _ in h){var x=h[_].animation;x.indexOf(o)>=0&&(a=x)}}}),!!a){t.d=!1;var s=K8(i,r);return a.replace(o,s)}}function bO(e){return ue(e)?xO[e]?"cubic-bezier("+xO[e]+")":hk(e)?e:"":""}function Nb(e,t,r,n){var i=e.animators,a=i.length,o=[];if(e instanceof nm){var s=xle(e,t,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var De=K8(A,r);return De+" "+x[0]+" both"}}for(var y in l){var s=m(l[y]);s&&o.push(s)}if(o.length){var _=r.zrId+"-cls-"+q8();r.cssNodes["."+_]={animation:o.join(",")},t.class=_}}function ble(e,t,r){if(!e.ignore)if(e.isSilent()){var n={"pointer-events":"none"};wO(n,t,r)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,l=e.currentStates.indexOf("select")>=0&&s||o;l&&(a=ix(l))}var u=i.lineWidth;if(u){var c=!i.strokeNoScale&&e.transform?e.transform[0]:1;u=u/c}var n={cursor:"pointer"};a&&(n.fill=a),i.stroke&&(n.stroke=i.stroke),u&&(n["stroke-width"]=u),wO(n,t,r)}}function wO(e,t,r,n){var i=JSON.stringify(e),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+q8(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=e),t.class=t.class?t.class+" "+a:a}var xg=Math.round;function J8(e){return e&&ue(e.src)}function Q8(e){return e&&Ce(e.toDataURL)}function BI(e,t,r,n){cle(function(i,a){var o=i==="fill"||i==="stroke";o&&Y6(a)?tW(t,e,i,n):o&&dk(a)?rW(r,e,i,n):e[i]=a,o&&n.ssr&&a==="none"&&(e["pointer-events"]="visible")},t,r,!1),Lle(r,e,n)}function FI(e,t){var r=nG(t);r&&(r.each(function(n,i){n!=null&&(e[(yO+i).toLowerCase()]=n+"")}),t.isSilent()&&(e[yO+"silent"]="true"))}function SO(e){return Ks(e[0]-1)&&Ks(e[1])&&Ks(e[2])&&Ks(e[3]-1)}function wle(e){return Ks(e[4])&&Ks(e[5])}function VI(e,t,r){if(t&&!(wle(t)&&SO(t))){var n=1e4;e.transform=SO(t)?"translate("+xg(t[4]*n)/n+" "+xg(t[5]*n)/n+")":SQ(t)}}function CO(e,t,r){for(var n=e.points,i=[],a=0;a"u"){var y="Image width/height must been given explictly in svg-ssr renderer.";an(f,y),an(d,y)}else if(f==null||d==null){var _=function(I,D){if(I){var O=I.elm,j=f||D.width,B=d||D.height;I.tag==="pattern"&&(u?(B=1,j/=a.width):c&&(j=1,B/=a.height)),I.attrs.width=j,I.attrs.height=B,O&&(O.setAttribute("width",j),O.setAttribute("height",B))}},x=Ck(g,null,e,function(I){l||_(M,I),_(h,I)});x&&x.width&&x.height&&(f=f||x.width,d=d||x.height)}h=Dr("image","img",{href:g,width:f,height:d}),o.width=f,o.height=d}else i.svgElement&&(h=Se(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(h){var w,S;l?w=S=1:u?(S=1,w=o.width/a.width):c?(w=1,S=o.height/a.height):o.patternUnits="userSpaceOnUse",w!=null&&!isNaN(w)&&(o.width=w),S!=null&&!isNaN(S)&&(o.height=S);var T=q6(i);T&&(o.patternTransform=T);var M=Dr("pattern","",o,[h]),A=zI(M),N=n.patternCache,P=N[A];P||(P=n.zrId+"-p"+n.patternIdx++,N[A]=P,o.id=P,M=n.defs[P]=Dr("pattern",P,o,[h])),t[r]=eb(P)}}function kle(e,t,r){var n=r.clipPathCache,i=r.defs,a=n[e.id];if(!a){a=r.zrId+"-c"+r.clipPathIdx++;var o={id:a};n[e.id]=a,i[a]=Dr("clipPath",a,o,[eW(e,r)])}t["clip-path"]=eb(a)}function AO(e){return document.createTextNode(e)}function Nu(e,t,r){e.insertBefore(t,r)}function LO(e,t){e.removeChild(t)}function kO(e,t){e.appendChild(t)}function nW(e){return e.parentNode}function iW(e){return e.nextSibling}function dC(e,t){e.textContent=t}var IO=58,Ile=120,Nle=Dr("","");function KM(e){return e===void 0}function Ba(e){return e!==void 0}function Ple(e,t,r){for(var n={},i=t;i<=r;++i){var a=e[i].key;a!==void 0&&(n[a]=i)}return n}function Kv(e,t){var r=e.key===t.key,n=e.tag===t.tag;return n&&r}function bg(e){var t,r=e.children,n=e.tag;if(Ba(n)){var i=e.elm=X8(n);if(GI(Nle,e),ne(r))for(t=0;ta?(g=r[l+1]==null?null:r[l+1].elm,aW(e,g,r,i,l)):Gx(e,t,n,a))}function Rh(e,t){var r=t.elm=e.elm,n=e.children,i=t.children;e!==t&&(GI(e,t),KM(t.text)?Ba(n)&&Ba(i)?n!==i&&Dle(r,n,i):Ba(i)?(Ba(e.text)&&dC(r,""),aW(r,null,i,0,i.length-1)):Ba(n)?Gx(r,n,0,n.length-1):Ba(e.text)&&dC(r,""):e.text!==t.text&&(Ba(n)&&Gx(r,n,0,n.length-1),dC(r,t.text)))}function Ele(e,t){if(Kv(e,t))Rh(e,t);else{var r=e.elm,n=nW(r);bg(t),n!==null&&(Nu(n,t.elm,iW(r)),Gx(n,[e],0,0))}return t}var Rle=0,jle=function(){function e(t,r,n){if(this.type="svg",this.configLayer=Ole(),this.storage=r,this._opts=n=ee({},n),this.root=t,this._id="zr"+Rle++,this._oldVNode=_O(n.width,n.height),t&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=X8("svg");GI(null,this._oldVNode),i.appendChild(a),t.appendChild(i)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",Ele(this._oldVNode,t),this._oldVNode=t}},e.prototype.renderOneToVNode=function(t){return MO(t,qM(this._id))},e.prototype.renderToVNode=function(t){t=t||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=qM(this._id);a.animation=t.animation,a.willUpdate=t.willUpdate,a.compress=t.compress,a.emphasis=t.emphasis,a.ssr=this._opts.ssr;var o=[],s=this._bgVNode=zle(n,i,this._backgroundColor,a);s&&o.push(s);var l=t.compress?null:this._mainVNode=Dr("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=ae(Qe(a.defs),function(f){return a.defs[f]});if(u.length&&o.push(Dr("defs","defs",{},u)),t.animation){var c=ple(a.cssNodes,a.cssAnims,{newline:!0});if(c){var h=Dr("style","stl",{},[],c);o.push(h)}}return _O(n,i,o,t.useViewBox)},e.prototype.renderToString=function(t){return t=t||{},zI(this.renderToVNode({animation:ye(t.cssAnimation,!0),emphasis:ye(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:ye(t.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(t){this._backgroundColor=t},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(t,r,n){for(var i=t.length,a=[],o=0,s,l,u=0,c=0;c=0&&!(f&&l&&f[m]===l[m]);m--);for(var y=g-1;y>m;y--)o--,s=a[o-1];for(var _=m+1;_=s)}}for(var h=PO(this),f=h.startIdx;f=0)&&(o=!0)}),!(!o&&!a.__dirty)){var s=n._opts.useDirtyRect&&!vC(a)?a.createRepaintRects(t,r,n._width,n._height):null,l=n._i.layerStack[0],u=!0;if(a.__dirty){u=!1,a.__dirty=!1;var c=a.zlevel===l.zl&&a.zlevel2===l.zl2?n._backgroundColor:null;a.clear(!1,c,s)}t0(a,function(h){var f=n._paintPerCursor(a,h,t,s,u);i=i&&f})}},r0),et.wxa&&fn(this._i,function(a){a&&a.ctx&&a.ctx.draw&&a.ctx.draw()}),i},e.prototype._paintPerCursor=function(t,r,n,i,a){var o=t.ctx;if(i)if(!i.length)r.drawIdx=r.endIdx;else for(var s=this.dpr,l=0;l=r.endIdx},e.prototype._paintPerCursorInRect=function(t,r,n,i,a){for(var o={inHover:!1,allClipped:!1,prevEl:null,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{contentRetained:a}},s=t.ctx,l=vC(t),u=l&&Er.getTime(),c=r.drawIdx,h=r.notClearIdx,f=h>=0?Math.min(h,c):c;f15){f++;break}}}}yf(s,o),r.drawIdx=Math.max(f,c)},e.prototype.getLayer=function(t,r){return this._ensureLayer(t,0,r)},e.prototype._ensureLayer=function(t,r,n){r=r||0;var i=this._singleCanvas;i&&!this._needsManuallyCompositing&&(t=mu,r=0);var a=mC(this._i,t)[r];return a||(a=EO("zr_"+t+"."+r,this,t,r),this._layerConfig[t]&&Ge(a,this._layerConfig[t],!0),(n||i&&t!==mu)&&(a.virtual=!0),this._insertLayer(a,t,r,!1),a.initContext()),a},e.prototype.insertLayer=function(t,r){this._insertLayer(r,t,0,!1)},e.prototype._insertLayer=function(t,r,n,i){var a=this._i,o=a.layers,s=a.layerStack,l=this._domRoot,u=null;if(!(o[r]&&o[r][n])&&Vle(t)){for(var c=s.length,h=0;h0&&(u=mC(a,s[h-1].zl)[s[h-1].zl2]),s.splice(h,0,{zl:r,zl2:n}),mC(a,r)[n]=t,!i&&!t.virtual)if(u){var f=u.dom;f.nextSibling?l.insertBefore(t.dom,f.nextSibling):l.appendChild(t.dom)}else l.firstChild?l.insertBefore(t.dom,l.firstChild):l.appendChild(t.dom);t.painter||(t.painter=this)}},e.prototype.eachLayer=function(t,r){return fn(this._i,function(n,i){t.call(r,n,i)})},e.prototype.eachBuiltinLayer=function(t,r){return fn(this._i,function(n,i){t.call(r,n,i)},Tp)},e.prototype.eachOtherLayer=function(t,r){return fn(this._i,function(n,i){t.call(r,n,i)},JM)},e.prototype.getLayers=function(){var t={};return fn(this._i,function(r,n,i){t[r.id]=r}),t},e.prototype._updateLayerStatus=function(t,r){var n=this;if(n._singleCanvas)for(var i=1;i=0;w--){var S=x.get(_[w]);if(!S.used)y.__dirty=!0,x.removeKey(_[w]),_.splice(w,1);else{var T=S.endIdxNew;(vC(y)?T=0;i--){var a=r[i];if(a.zl===t){var o=n[t][a.zl2];if(o.__builtin__)continue;if(r.splice(i,1),n[t][a.zl2]=void 0,!o.virtual){var s=o.dom.parentNode;s&&s.removeChild(o.dom)}}}},e.prototype.resize=function(t,r){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var i=this._opts,a=this.root;t!=null&&(i.width=t),r!=null&&(i.height=r),t=ef(a,0,i),r=ef(a,1,i),n.style.display="",(this._width!==t||r!==this._height)&&(n.style.width=t+"px",n.style.height=r+"px",fn(this._i,function(o){o.resize(t,r)}),this.refresh({paintAll:!0})),this._width=t,this._height=r}else{if(t==null||r==null)return;this._width=t,this._height=r,this._ensureLayer(mu).resize(t,r)}return this},e.prototype.clearLayer=function(t){E(this._i.layers[t],function(r){r&&!r.__builtin__&&r.clear()})},e.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._i=null},e.prototype.getRenderedCanvas=function(t){if(t=t||{},this._singleCanvas&&!this._compositeManually)return this._i.layers[mu][0].dom;var r=new oW("image",this,t.pixelRatio||this.dpr);r.initContext(),r.clear(!1,t.backgroundColor||this._backgroundColor);var n=r.ctx;if(t.pixelRatio<=this.dpr){this.refresh();var i=r.dom.width,a=r.dom.height;fn(this._i,function(h){h.__builtin__?n.drawImage(h.dom,0,0,i,a):h.renderToCanvas&&(n.save(),h.renderToCanvas(n),n.restore())})}else{for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},s=this.storage.getDisplayList(!0),l=0,u=s.length;l-1&&(u.style.stroke=u.style.fill,u.style.fill=K.color.neutral00,u.style.lineWidth=2),n},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:6,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1,triggerEvent:!1},t}(Tt);function Uf(e,t){var r=e.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=zf(e,t,r[0]);return i!=null?i+"":null}else if(n){for(var a=[],o=0;o=0&&n.push(t[a])}return n.join(" ")}var fm=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;return o.updateData(r,n,i,a),o}return t.prototype._createSymbol=function(r,n,i,a,o,s){this.removeAll();var l=dr(r,-1,-1,2,2,null,s);l.attr({z2:ye(o,100),culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),l.drift=Yle,this._symbolType=r,this.add(l)},t.prototype.stopSymbolAnimation=function(r){this.childAt(0).stopAnimation(null,r)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){hs(this.childAt(0))},t.prototype.downplay=function(){fs(this.childAt(0))},t.prototype.setZ=function(r,n){var i=this.childAt(0);i.zlevel=r,i.z=n},t.prototype.setDraggable=function(r,n){var i=this.childAt(0);i.draggable=r,i.cursor=!n&&r?"move":i.cursor},t.prototype.updateData=function(r,n,i,a){this.silent=!1;var o=r.getItemVisual(n,"symbol")||"circle",s=r.hostModel,l=t.getSymbolSize(r,n),u=t.getSymbolZ2(r,n),c=o!==this._symbolType,h=a&&a.disableAnimation;if(c){var f=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,r,n,l,u,f)}else{var d=this.childAt(0);d.silent=!1;var g={scaleX:l[0]/2,scaleY:l[1]/2};h?d.attr(g):ot(d,g,s,n),$i(d)}if(this._updateCommon(r,n,l,i,a),c){var d=this.childAt(0);if(!h){var g={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}};d.scaleX=d.scaleY=0,d.style.opacity=0,Rt(d,g,s,n)}}h&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(r,n,i,a,o){var s=this.childAt(0),l=r.hostModel,u,c,h,f,d,g,m,y,_;if(a&&(u=a.emphasisItemStyle,c=a.blurItemStyle,h=a.selectItemStyle,f=a.focus,d=a.blurScope,m=a.labelStatesModels,y=a.hoverScale,_=a.cursorStyle,g=a.emphasisDisabled),!a||r.hasItemOption){var x=a&&a.itemModel?a.itemModel:r.getItemModel(n),w=x.getModel("emphasis");u=w.getModel("itemStyle").getItemStyle(),h=x.getModel(["select","itemStyle"]).getItemStyle(),c=x.getModel(["blur","itemStyle"]).getItemStyle(),f=w.get("focus"),d=w.get("blurScope"),g=w.get("disabled"),m=Ar(x),y=w.getShallow("scale"),_=x.getShallow("cursor")}var S=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(S||0)*Math.PI/180||0);var T=$c(r.getItemVisual(n,"symbolOffset"),i);T&&(s.x=T[0],s.y=T[1]),_&&s.attr("cursor",_);var M=r.getItemVisual(n,"style"),A=M.fill;if(s instanceof Or){var N=s.style;s.useStyle(ee({image:N.image,x:N.x,y:N.y,width:N.width,height:N.height},M))}else s.__isEmptyBrush?s.useStyle(ee({},M)):s.useStyle(M),s.style.decal=null,s.setColor(A,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var P=r.getItemVisual(n,"liftZ"),I=this._z2;P!=null?I==null&&(this._z2=s.z2,s.z2+=P):I!=null&&(s.z2=I,this._z2=null);var D=o&&o.useNameLabel;jr(s,m,{labelFetcher:l,labelDataIndex:n,defaultText:O,inheritColor:A,defaultOpacity:M.opacity});function O(U){return D?r.getName(U):Uf(r,U)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var j=s.ensureState("emphasis");j.style=u,s.ensureState("select").style=h,s.ensureState("blur").style=c;var B=y==null||y===!0?Math.max(1.1,3/this._sizeY):isFinite(y)&&y>0?+y:1;j.scaleX=this._sizeX*B,j.scaleY=this._sizeY*B,this.setSymbolScale(1),Vt(this,f,d,g)},t.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},t.prototype.fadeOut=function(r,n,i){var a=this.childAt(0),o=Re(this).dataIndex,s=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&Ml(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();Ml(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},t.getSymbolSize=function(r,n){return bd(r.getItemVisual(n,"symbolSize"))},t.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},t}(Me);function Yle(e,t){this.parent.drift(e,t)}function n0(e,t,r,n){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(n&&n.isIgnore&&n.isIgnore(r))&&!(n&&n.clipShape&&!n.clipShape.contain(t[0],t[1]))&&e.getItemVisual(r,"symbol")!=="none"}function RO(e){return e!=null&&!Ie(e)&&(e={isIgnore:e}),e||{}}function jO(e){var t=e.hostModel,r=t.getModel("emphasis");return{emphasisItemStyle:r.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:r.get("focus"),blurScope:r.get("blurScope"),emphasisDisabled:r.get("disabled"),hoverScale:r.get("scale"),labelStatesModels:Ar(t),cursorStyle:t.get("cursor")}}function OO(e,t,r,n,i,a,o){var s=new e(t,r,n,i);return s.setPosition(a),t.setItemGraphicEl(r,s),o.add(s),s}var dm=function(){function e(t){this.group=new Me,this._SymbolCtor=t||fm}return e.prototype.updateData=function(t,r){this._progressiveEls=null,r=RO(r);var n=this.group,i=t.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=this._seriesScope=jO(t),u={disableAnimation:s},c=r.getSymbolPoint||function(h){return t.getItemLayout(h)};a||n.removeAll(),t.diff(a).add(function(h){var f=c(h);n0(t,f,h,r)&&OO(o,t,h,l,u,f,n)}).update(function(h,f){var d=a.getItemGraphicEl(f),g=c(h);if(!n0(t,g,h,r)){n.remove(d);return}var m=t.getItemVisual(h,"symbol")||"circle",y=d&&d.getSymbolType&&d.getSymbolType();if(!d||y&&y!==m)n.remove(d),d=new o(t,h,l,u),d.setPosition(g);else{d.updateData(t,h,l,u);var _={x:g[0],y:g[1]};s?d.attr(_):ot(d,_,i)}n.add(d),t.setItemGraphicEl(h,d)}).remove(function(h){var f=a.getItemGraphicEl(h);f&&f.fadeOut(function(){n.remove(f)},i)}).execute(),this._getSymbolPoint=c,this._data=t},e.prototype.updateLayout=function(t){var r=this._data;if(r)for(var n=this,i=r.getStore(),a=0,o=i.count();a0?r=n[0]:n[1]<0&&(r=n[1]),r}function hW(e,t,r,n){var i=NaN;e.stacked&&(i=r.get(r.getCalculationInfo("stackedOverDimension"),n)),isNaN(i)&&(i=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=r.get(e.baseDim,n),o[1-a]=i,t.dataToPoint(o)}function zi(e,t){return!isFinite(e)||!isFinite(t)}var qle=typeof Float32Array!==ud?Float32Array:void 0,Kle=typeof Float64Array!==ud?Float64Array:void 0;function Za(e){return HI({ctor:qle},e).arr}function HI(e,t){var r=e.arr,n=e.ctor;if(t>ag&&(t=ag),!r||e.typed&&r.length=i||m<0)break;if(zi(_,x)){if(l){m+=a;continue}break}if(m===r)e[a>0?"moveTo":"lineTo"](_,x),h=_,f=x;else{var w=_-u,S=x-c;if(w*w+S*S<.5){m+=a;continue}if(o>0){for(var T=m+a,M=t[T*2],A=t[T*2+1];M===_&&A===x&&y=n||zi(M,A))d=_,g=x;else{I=M-u,D=A-c;var B=_-u,U=M-_,H=x-c,V=A-x,z=void 0,$=void 0;if(s==="x"){z=Math.abs(B),$=Math.abs(U);var W=I>0?1:-1;d=_-W*z*o,g=x,O=_+W*$*o,j=x}else if(s==="y"){z=Math.abs(H),$=Math.abs(V);var Z=D>0?1:-1;d=_,g=x-Z*z*o,O=_,j=x+Z*$*o}else z=Math.sqrt(B*B+H*H),$=Math.sqrt(U*U+V*V),P=$/($+z),d=_-I*o*(1-P),g=x-D*o*(1-P),O=_+I*o*P,j=x+D*o*P,O=Is(O,Ns(M,_)),j=Is(j,Ns(A,x)),O=Ns(O,Is(M,_)),j=Ns(j,Is(A,x)),I=O-_,D=j-x,d=_-I*z/$,g=x-D*z/$,d=Is(d,Ns(u,_)),g=Is(g,Ns(c,x)),d=Ns(d,Is(u,_)),g=Ns(g,Is(c,x)),I=_-d,D=x-g,O=_+I*$/z,j=x+D*$/z}e.bezierCurveTo(h,f,d,g,_,x),h=O,f=j}else e.lineTo(_,x)}u=_,c=x,m+=a}return y}var fW=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),eue=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="ec-polyline",n}return t.prototype.getDefaultStyle=function(){return{stroke:K.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new fW},t.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&zi(i[o*2-2],i[o*2-1]);o--);for(;a=0){var S=u?(g-l)*w+l:(d-s)*w+s;return u?[r,S]:[S,r]}s=d,l=g;break;case o.C:d=a[h++],g=a[h++],m=a[h++],y=a[h++],_=a[h++],x=a[h++];var T=u?rx(s,d,m,_,r,c):rx(l,g,y,x,r,c);if(T>0)for(var M=0;M=0){var S=u?Nr(l,g,y,x,A):Nr(s,d,m,_,A);return u?[r,S]:[S,r]}}s=_,l=x;break}}},t}(Je),tue=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(fW),dW=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="ec-polygon",n}return t.prototype.getDefaultShape=function(){return new tue},t.prototype.buildPath=function(r,n){var i=n.points,a=n.stackedOnPoints,o=0,s=i.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;s>0&&zi(i[s*2-2],i[s*2-1]);s--);for(;o=0,a=e.fill||K.color.neutral99;VO(n,t);var o=n.textFill==null;return i?o&&(n.textFill=r.insideFill||K.color.neutral00,!n.textStroke&&r.insideStroke&&(n.textStroke=r.insideStroke),!n.textStroke&&(n.textStroke=a),n.textStrokeWidth==null&&(n.textStrokeWidth=2)):(o&&(n.textFill=e.fill||r.outsideFill||K.color.neutral00),!n.textStroke&&r.outsideStroke&&(n.textStroke=r.outsideStroke)),n.text=t.text,n.rich=t.rich,E(t.rich,function(s){VO(s,s)}),n}function VO(e,t){t&&(ge(t,"fill")&&(e.textFill=t.fill),ge(t,"stroke")&&(e.textStroke=t.fill),ge(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),ge(t,"font")&&(e.font=t.font),ge(t,"fontStyle")&&(e.fontStyle=t.fontStyle),ge(t,"fontWeight")&&(e.fontWeight=t.fontWeight),ge(t,"fontSize")&&(e.fontSize=t.fontSize),ge(t,"fontFamily")&&(e.fontFamily=t.fontFamily),ge(t,"align")&&(e.textAlign=t.align),ge(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),ge(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),ge(t,"width")&&(e.textWidth=t.width),ge(t,"height")&&(e.textHeight=t.height),ge(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),ge(t,"padding")&&(e.textPadding=t.padding),ge(t,"borderColor")&&(e.textBorderColor=t.borderColor),ge(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),ge(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),ge(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),ge(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),ge(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),ge(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),ge(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),ge(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),ge(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),ge(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}function GO(e,t){if(e.length===t.length){for(var r=0;rt){a?r.push(o(a,l,t)):i&&r.push(o(i,l,0),o(i,l,t));break}else i&&(r.push(o(i,l,0)),i=null),r.push(l),a=l}return r}function iue(e,t,r){var n=e.getVisual("visualMeta");if(!(!n||!n.length||!e.count())&&t.type==="cartesian2d"){for(var i,a,o=n.length-1;o>=0;o--){var s=e.getDimensionInfo(n[o].dimension);if(i=s&&s.coordDim,i==="x"||i==="y"){a=n[o];break}}if(a){var l=t.getAxis(i),u=ae(a.stops,function(w){return{coord:l.toGlobalCoord(l.dataToCoord(w.value)),color:w.color}}),c=u.length,h=a.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),h.reverse());var f=nue(u,i==="x"?r.getWidth():r.getHeight()),d=f.length;if(!d&&c)return u[0].coord<0?h[1]?h[1]:u[c-1].color:h[0]?h[0]:u[0].color;var g=10,m=f[0].coord-g,y=f[d-1].coord+g,_=y-m;if(_<.001)return"transparent";E(f,function(w){w.offset=(w.coord-m)/_}),f.push({offset:d?f[d-1].offset:.5,color:h[1]||"transparent"}),f.unshift({offset:d?f[0].offset:.5,color:h[0]||"transparent"});var x=new Gc(0,0,0,0,f,!0);return x[i]=m,x[i+"2"]=y,x}}}function aue(e,t,r){var n=e.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&oue(a,t))){var o=t.mapDimension(a.dim),s={};return E(a.getViewLabels(),function(l){l.tick.offInterval||(s[Cd(a.scale,l.tick)]=1)}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function oue(e,t){var r=e.getExtent(),n=Math.abs(r[1]-r[0])/e.scale.count();isNaN(n)&&(n=0);for(var i=t.count(),a=Math.max(1,Math.round(i/5)),o=0;on)return!1;return!0}function sue(e){for(var t=e.length/2;t>0&&zi(e[t*2-2],e[t*2-1]);t--);return t-1}function ZO(e,t){return[e[t*2],e[t*2+1]]}function lue(e,t,r){for(var n=e.length/2,i=r==="x"?0:1,a,o,s=0,l=-1,u=0;u=t||a>=t&&o<=t){l=u;break}s=u,a=o}return{range:[s,l],t:(t-a)/(o-a)}}function _W(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var $=g.getState("emphasis").style;$.lineWidth=+g.style.lineWidth+1}Re(g).seriesIndex=r.seriesIndex,Vt(g,H,V,z);var W=WO(r.get("smooth")),Z=r.get("smoothMonotone");if(g.setShape({smooth:W,smoothMonotone:Z,connectNulls:A}),m){var X=s.getCalculationInfo("stackedOnSeries"),re=0;m.useStyle(Le(u.getAreaStyle(),{fill:O,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),X&&(re=WO(X.get("smooth"))),m.setShape({smooth:W,stackedOnSmooth:re,smoothMonotone:Z,connectNulls:A}),Mr(m,r,"areaStyle"),Re(m).seriesIndex=r.seriesIndex,Vt(m,H,V,z)}var J=this._changePolyState;s.eachItemGraphicEl(function(ve){ve&&(ve.onHoverStateChange=J)}),this._polyline.onHoverStateChange=J,this._data=s,this._coordSys=a,this._stackedOnPoints=T,this._points=c,this._step=I,this._valueOrigin=w;var oe=r.get("triggerEvent"),le=r.get("triggerLineEvent"),De=le===!0||oe===!0||oe==="line",be=le===!0||oe===!0||oe==="area";this.packEventData(r,g,De),m&&this.packEventData(r,m,be)},t.prototype.packEventData=function(r,n,i){Re(n).eventData=i?{componentType:"series",componentSubType:"line",componentIndex:r.componentIndex,seriesIndex:r.seriesIndex,seriesName:r.name,seriesType:"line",selfType:n===this._polygon?"area":"line"}:null},t.prototype.highlight=function(r,n,i,a){var o=r.getData(),s=fc(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var c=l[s*2],h=l[s*2+1];if(zi(c,h)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,h))return;var f=r.get("zlevel")||0,d=r.get("z")||0;u=new fm(o,s),u.x=c,u.y=h,u.setZ(f,d);var g=u.getSymbolPath().getTextContent();g&&(g.zlevel=f,g.z=d,g.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else xt.prototype.highlight.call(this,r,n,i,a)},t.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=fc(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else xt.prototype.downplay.call(this,r,n,i,a)},t.prototype._changePolyState=function(r){var n=this._polygon;vx(this._polyline,r),n&&vx(n,r)},t.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new eue({shape:{points:r},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(n),this._polyline=n,n},t.prototype._newPolygon=function(r,n){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new dW({shape:{points:r,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},t.prototype._initSymbolLabelAnimation=function(r,n,i){var a,o,s=n.getBaseAxis(),l=s.inverse;n.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):n.type==="polar"&&(a=s.dim==="angle",o=!0);var u=r.hostModel,c=u.get("animationDuration");Ce(c)&&(c=c(null));var h=u.get("animationDelay")||0,f=Ce(h)?h(null):h;r.eachItemGraphicEl(function(d,g){var m=d;if(m){var y=[d.x,d.y],_=void 0,x=void 0,w=void 0;if(i)if(o){var S=i,T=n.pointToCoord(y);a?(_=S.startAngle,x=S.endAngle,w=-T[1]/180*Math.PI):(_=S.r0,x=S.r,w=T[0])}else{var M=i;a?(_=M.x,x=M.x+M.width,w=d.x):(_=M.y+M.height,x=M.y,w=d.y)}var A=x===_?0:(w-_)/(x-_);l&&(A=1-A);var N=Ce(h)?h(g):c*A+f,P=m.getSymbolPath(),I=P.getTextContent();m.attr({scaleX:0,scaleY:0}),m.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:N}),I&&I.animateFrom({style:{opacity:0}},{duration:300,delay:N}),P.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(_W(r)){var o=r.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new rt({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var c=sue(l);c>=0&&(jr(s,Ar(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:c,defaultText:function(h,f,d){return d!=null?uW(o,d):Uf(o,h)},enableTextSetter:!0},uue(a,n)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(r,n,i,a,o,s,l){var u=this._endLabel,c=this._polyline;if(u){r<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var h=i.getLayout("points"),f=i.hostModel,d=f.get("connectNulls"),g=s.get("precision"),m=s.get("distance")||0,y=l.getBaseAxis(),_=y.isHorizontal(),x=y.inverse,w=n.shape,S=x?_?w.x:w.y+w.height:_?w.x+w.width:w.y,T=(_?m:0)*(x?-1:1),M=(_?0:-m)*(x?-1:1),A=_?"x":"y",N=lue(h,S,A),P=N.range,I=P[1]-P[0],D=void 0;if(I>=1){if(I>1&&!d){var O=ZO(h,P[0]);u.attr({x:O[0]+T,y:O[1]+M}),o&&(D=f.getRawValue(P[0]))}else{var O=c.getPointOn(S,A);O&&u.attr({x:O[0]+T,y:O[1]+M});var j=f.getRawValue(P[0]),B=f.getRawValue(P[1]);o&&(D=gG(i,g,j,B,N.t))}a.lastFrameIndex=P[0]}else{var U=r===1||a.lastFrameIndex>0?P[0]:0,O=ZO(h,U);o&&(D=f.getRawValue(U)),u.attr({x:O[0]+T,y:O[1]+M})}if(o){var H=gd(u);typeof H.setLabelText=="function"&&H.setLabelText(D)}}},t.prototype._doUpdateAnimation=function(r,n,i,a,o,s,l){var u=this._polyline,c=this._polygon,h=r.hostModel,f=Qle(this._data,r,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),d=f.current,g=f.stackedOnCurrent,m=f.next,y=f.stackedOnNext;if(o&&(g=Ps(f.stackedOnCurrent,f.current,i,o,l),d=Ps(f.current,null,i,o,l),y=Ps(f.stackedOnNext,f.next,i,o,l),m=Ps(f.next,null,i,o,l)),UO(d,m)>3e3||c&&UO(g,y)>3e3){u.stopAnimation(),u.setShape({points:m}),c&&(c.stopAnimation(),c.setShape({points:m,stackedOnPoints:y}));return}u.shape.__points=f.current,u.shape.points=d;var _={shape:{points:m}};f.current!==d&&(_.shape.__points=f.next),u.stopAnimation(),ot(u,_,h),c&&(c.setShape({points:d,stackedOnPoints:g}),c.stopAnimation(),ot(c,{shape:{stackedOnPoints:y}},h),u.shape.points!==c.shape.points&&(c.shape.points=u.shape.points));for(var x=[],w=f.status,S=0;St&&(t=e[r]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,r=0;r10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),c=l.getExtent(),h=n.getDevicePixelRatio(),f=Math.abs(c[1]-c[0])*(h||1),d=Math.round(s/f);if(isFinite(d)&&d>1){a==="lttb"?t.setData(i.lttbDownSample(i.mapDimension(u.dim),1/d)):a==="minmax"&&t.setData(i.minmaxDownSample(i.mapDimension(u.dim),1/d));var g=void 0;ue(a)?g=hue[a]:Ce(a)&&(g=a),g&&t.setData(i.downSample(i.mapDimension(u.dim),1/d,g,fue))}}}}}function due(e){e.registerChartView(cue),e.registerSeriesModel($le),e.registerLayout(vm("line",!0)),e.registerVisual({seriesType:"line",reset:function(t){var r=t.getData(),n=t.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=r.getVisual("style").fill),r.setVisual("legendLineStyle",n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,xW("line"))}var bW=function(e){q(t,e);function t(r,n,i,a,o){var s=e.call(this,r,n,i)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return t.prototype.isHorizontal=function(){var r=this.position;return r==="top"||r==="bottom"},t.prototype.getGlobalExtent=function(r){var n=this.getExtent();return n[0]=this.toGlobalCoord(n[0]),n[1]=this.toGlobalCoord(n[1]),r&&n[0]>n[1]&&n.reverse(),n},t.prototype.pointToData=function(r,n){return this.coordToData(this.toLocalCoord(r[this.dim==="x"?0:1]),n)},t.prototype.setCategorySortInfo=function(r){if(this.type!=="category")return!1;this.model.option.categorySortInfo=r,this.scale.setSortInfo(r)},t}(Ki),eA=null;function vue(e){eA||(eA=e)}function pm(){return eA}var Pb="expandAxisBreak",wW="collapseAxisBreak",SW="toggleAxisBreak",UI="axisbreakchanged",pue={type:Pb,event:UI,update:"update",refineEvent:WI},gue={type:wW,event:UI,update:"update",refineEvent:WI},mue={type:SW,event:UI,update:"update",refineEvent:WI};function WI(e,t,r,n){var i=[];return E(e,function(a){i=i.concat(a.eventBreaks)}),{eventContent:{breaks:i}}}function yue(e){e.registerAction(pue,t),e.registerAction(gue,t),e.registerAction(mue,t);function t(r,n){var i=[],a=df(n,r);function o(s,l){E(a[s],function(u){var c=u.updateAxisBreaks(r);E(c.breaks,function(h){var f;i.push(Le((f={},f[l]=u.componentIndex,f),h))})})}return o("xAxisModels","xAxisIndex"),o("yAxisModels","yAxisIndex"),o("singleAxisModels","singleAxisIndex"),{eventBreaks:i}}}var Js=Math.PI,_ue=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],xue=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],Tc=He(),CW=He(),TW=function(){function e(t){this.recordMap={},this.resolveAxisNameOverlap=t}return e.prototype.ensureRecord=function(t){var r=t.axis.dim,n=t.componentIndex,i=this.recordMap,a=i[r]||(i[r]=[]);return a[n]||(a[n]={ready:{}})},e}();function bue(e,t,r,n){var i=r.axis,a=t.ensureRecord(r),o=[],s,l=ZI(e.axisName)&&Vf(e.nameLocation);E(n,function(g){var m=po(g);if(!(!m||m.label.ignore)){o.push(m);var y=a.transGroup;l&&(y.transform?fi(wv,y.transform):zc(wv),m.transform&&ci(wv,wv,m.transform),Ae.copy(i0,m.localRect),i0.applyTransform(wv),s?s.union(i0):Ae.copy(s=new Ae(0,0,0,0),i0))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",c=a.transGroup[u];if(o.sort(function(g,m){return Math.abs(g.label[u]-c)-Math.abs(m.label[u]-c)}),l&&s){var h=i.getExtent(),f=Math.min(h[0],h[1]),d=Math.max(h[0],h[1])-f;s.union(new Ae(f,0,d,1))}a.stOccupiedRect=s,a.labelInfoList=o}var wv=Ft(),i0=new Ae(0,0,0,0),MW=function(e,t,r,n,i,a){if(Vf(e.nameLocation)){var o=a.stOccupiedRect;o&&AW(Jse({},o,a.transGroup.transform),n,i)}else LW(a.labelInfoList,a.dirVec,n,i)};function AW(e,t,r){var n=new Pe;Ib(e,t,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&ZM(t,n)}function LW(e,t,r,n){for(var i=Pe.dot(n,t)>=0,a=0,o=e.length;a0?"top":"bottom",a="center"):cc(i-Js)?(o=n>0?"bottom":"top",a="center"):(o="middle",i>0&&i0?"right":"left":a=n>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:o}},e.makeAxisEventDataBase=function(t){var r={componentType:t.mainType,componentIndex:t.componentIndex};return r[t.mainType+"Index"]=t.componentIndex,r},e.isLabelSilent=function(t){var r=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||r&&r.show)},e}(),wue=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],Sue={axisLine:function(e,t,r,n,i,a,o){var s=n.get(["axisLine","show"]);if(s==="auto"&&(s=!0,e.raw.axisLineAutoShow!=null&&(s=!!e.raw.axisLineAutoShow)),!!s){var l=n.axis.getExtent(),u=a.transform,c=[l[0],0],h=[l[1],0],f=c[0]>h[0];u&&(Xt(c,c,u),Xt(h,h,u));var d=ee({lineCap:"round"},n.getModel(["axisLine","lineStyle"]).getLineStyle()),g={strokeContainThreshold:e.raw.strokeContainThreshold||5,silent:!0,z2:1,style:d};if(n.get(["axisLine","breakLine"])&&yx(n.axis.scale))pm().buildAxisBreakLine(n,i,a,g);else{var m=new cr(ee({shape:{x1:c[0],y1:c[1],x2:h[0],y2:h[1]}},g));Of(m.shape,m.style.lineWidth),m.anid="line",i.add(m)}var y=n.get(["axisLine","symbol"]);if(y!=null){var _=n.get(["axisLine","symbolSize"]);ue(y)&&(y=[y,y]),(ue(_)||nt(_))&&(_=[_,_]);var x=$c(n.get(["axisLine","symbolOffset"])||0,_),w=_[0],S=_[1];E([{rotate:e.rotation+Math.PI/2,offset:x[0],r:0},{rotate:e.rotation-Math.PI/2,offset:x[1],r:Math.sqrt((c[0]-h[0])*(c[0]-h[0])+(c[1]-h[1])*(c[1]-h[1]))}],function(T,M){if(y[M]!=="none"&&y[M]!=null){var A=dr(y[M],-w/2,-S/2,w,S,d.stroke,!0),N=T.r+T.offset,P=f?h:c;A.attr({rotation:T.rotate,x:P[0]+N*Math.cos(e.rotation),y:P[1]-N*Math.sin(e.rotation),silent:!0,z2:11}),i.add(A)}})}}},axisTickLabelEstimate:function(e,t,r,n,i,a,o,s){var l=YO(t,i,s);l&&$O(e,t,r,n,i,a,o,xa.estimate)},axisTickLabelDetermine:function(e,t,r,n,i,a,o,s){var l=YO(t,i,s);l&&$O(e,t,r,n,i,a,o,xa.determine);var u=Aue(e,i,a,n);Mue(e,t.labelLayoutList,u),Lue(e,i,a,n,e.tickDirection)},axisName:function(e,t,r,n,i,a,o,s){var l=r.ensureRecord(n);t.nameEl&&(i.remove(t.nameEl),t.nameEl=l.nameLayout=l.nameLocation=null);var u=e.axisName;if(ZI(u)){var c=e.nameLocation,h=e.nameDirection,f=n.getModel("nameTextStyle"),d=n.get("nameGap")||0,g=n.axis.getExtent(),m=n.axis.inverse?-1:1,y=new Pe(0,0),_=new Pe(0,0);c==="start"?(y.x=g[0]-m*d,_.x=-m):c==="end"?(y.x=g[1]+m*d,_.x=m):(y.x=(g[0]+g[1])/2,y.y=e.labelOffset+h*d,_.y=h);var x=Ft();_.transform(_s(x,x,e.rotation));var w=n.get("nameRotate");w!=null&&(w=w*Js/180);var S,T;Vf(c)?S=Nn.innerTextLayout(e.rotation,w??e.rotation,h):(S=Cue(e.rotation,c,w||0,g),T=e.raw.axisNameAvailableWidth,T!=null&&(T=Math.abs(T/Math.sin(S.rotation)),!isFinite(T)&&(T=null)));var M=f.getFont(),A=n.get("nameTruncate",!0)||{},N=A.ellipsis,P=mn(e.raw.nameTruncateMaxWidth,A.maxWidth,T),I=s.nameMarginLevel||0,D=new rt({x:y.x,y:y.y,rotation:S.rotation,silent:Nn.isLabelSilent(n),style:Lt(f,{text:u,font:M,overflow:"truncate",width:P,ellipsis:N,fill:f.getTextColor()||n.get(["axisLine","lineStyle","color"]),align:f.get("align")||S.textAlign,verticalAlign:f.get("verticalAlign")||S.textVerticalAlign}),z2:1});if(bs({el:D,componentModel:n,itemName:u}),D.__fullText=u,D.anid="name",n.get("triggerEvent")){var O=Nn.makeAxisEventDataBase(n);O.targetType="axisName",O.name=u,Re(D).eventData=O}a.add(D),D.updateTransform(),t.nameEl=D;var j=l.nameLayout=po({label:D,priority:D.z2,defaultAttr:{ignore:D.ignore},marginDefault:Vf(c)?_ue[I]:xue[I]});if(l.nameLocation=c,i.add(D),D.decomposeTransform(),e.shouldNameMoveOverlap&&j){var B=r.ensureRecord(n);r.resolveAxisNameOverlap(e,r,n,j,_,B)}}}};function $O(e,t,r,n,i,a,o,s){IW(t)||kue(e,t,i,s,n,o);var l=t.labelLayoutList;Iue(e,n,l,a),Due(n,e.rotation,l);var u=e.optionHideOverlap;Tue(n,l,u),u&&U8(gt(l,function(c){return c&&!c.label.ignore})),bue(e,r,n,l)}function Cue(e,t,r,n){var i=gk(r-e),a,o,s=n[0]>n[1],l=t==="start"&&!s||t!=="start"&&s;return cc(i-Js/2)?(o=l?"bottom":"top",a="center"):cc(i-Js*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",iJs/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function Tue(e,t,r){var n=e.axis,i=e.get(["axisLabel","customValues"]);if(zoe(n))return;function a(u,c,h){var f=po(t[c]),d=po(t[h]),g=n.scale;if(!(!f||!d)){if(u==null){if(!r&&i)return;var m=Tc(f.label).labelInfo.tick;if(lm(g)&&m.notNice||bn(g)&&m.offInterval){jh(f.label);return}}if(u===!1||f.suggestIgnore){jh(f.label);return}if(d.suggestIgnore){jh(d.label);return}var y=.1;if(!r){var _=[0,0,0,0];f=$M({marginForce:_},f),d=$M({marginForce:_},d)}Ib(f,d,null,{touchThreshold:y})&&jh(u?d.label:f.label)}}var o=e.get(["axisLabel","showMinLabel"]),s=e.get(["axisLabel","showMaxLabel"]),l=t.length;a(o,0,1),a(s,l-1,l-2)}function Mue(e,t,r){e.showMinorTicks||E(t,function(n){if(n&&n.label.ignore)for(var i=0;i=0&&w(M,S,T.getStore())})}var d=0;if(f(function(w,S,T){n.set(S.uid,1),(!i||!i.hasKey(S.uid))&&(o=!0),d+=T.count()}),(!i||i.keys().length!==n.keys().length)&&(o=!0),!o&&a!=null){t.liPosMinGap=a;return}HI(yu,d);var g=0;f(function(w,S,T){for(var M=0,A=T.count();M0&&x0?x8:Goe,r.serUids=n}var yu=HI({ctor:Kle},50);function Db(e){return function(t,r){var n=ln(t,{fromStat:{key:e}});if(Wi(n.w2))return[-n.w2/2,n.w2/2]}}function Ju(e){return e+Rx}function Yc(e,t){return e+Rx+t}function $I(e){return Bue(),{liPosMinGap:!bn(e.scale)}}var eo="bar",Tg="pictorialBar";function NW(e,t,r,n){DI(e,{key:t,seriesType:r,coordSysType:n,getMetrics:$I})}function PW(e){var t=e.scale.rawExtentInfo.makeRenderInfo().startValue;return t}var DW={left:0,right:0,top:0,bottom:0},Ux=["25%","25%"],ga="cartesian2d",Vue=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(r,n){var i=Wc(r.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&vo(r.outerBounds,i)},t.prototype.mergeOption=function(r,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&vo(this.option.outerBounds,r.outerBounds)},t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"15%",top:65,right:"10%",bottom:80,containLabel:!1,outerBoundsMode:"auto",outerBounds:DW,outerBoundsContain:"all",outerBoundsClampWidth:Ux[0],outerBoundsClampHeight:Ux[1],backgroundColor:K.color.transparent,borderWidth:1,borderColor:K.color.neutral30},t}(Xe),Gue=ld(),rA="__ec_stack_";function EW(e){return e.get("stack")||rA+e.seriesIndex}function Hue(e){if(bn(e.axis.scale)){for(var t=ln(e.axis),r=[],n=0;nw&&(w=x),w!==c&&(y.width=w,r-=w+u*w,n--)}}),c=(r-l)/(n+(n-1)*u),c=$e(c,0);var h=0,f;E(o,function(m){var y=s[m];y.width||(y.width=c),f=y,h+=y.width*(1+u)}),f&&(h-=f.width*u);var d={},g=-h/2;return E(o,function(m){var y=s[m];d[m]=d[m]||{bandWidth:t,offset:g,width:y.width},g+=y.width*(1+u)}),d}function jW(e){return{seriesType:e,overallReset:function(t){var r=Yc(e,ga);PI(t,r,function(n){var i=Uue(n,e);xc(n,r,function(a){var o=i.columnMap[EW(a)];a.getData().setLayout({bandWidth:o.bandWidth,offset:o.offset,size:o.width})})})}}}function OW(e){return{seriesType:e,plan:Zc(),reset:function(t){if(Eue(t)){var r=t.getData(),n=t.coordinateSystem,i=n.getBaseAxis(),a=n.getOtherAxis(i),o=r.getDimensionIndex(r.mapDimension(a.dim)),s=r.getDimensionIndex(r.mapDimension(i.dim)),l=t.get("showBackground",!0),u=r.mapDimension(a.dim),c=r.getCalculationInfo("stackResultDimension"),h=vs(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),d=a.toGlobalCoord(a.dataToCoord(PW(a))),g=zW(t),m=t.get("barMinHeight")||0,y=c&&r.getDimensionIndex(c),_=r.getLayout("size"),x=r.getLayout("offset");return{progress:function(w,S){for(var T=w.count,M=g&&Za(T*3),A=g&&l&&Za(T*3),N=g&&Za(T),P=n.master.getRect(),I=f?P.width:P.height,D,O=S.getStore(),j=0;(D=w.next())!=null;){var B=O.get(h?y:o,D),U=O.get(s,D),H=d,V=void 0;h&&(V=+B-O.get(o,D));var z=void 0,$=void 0,W=void 0,Z=void 0;if(f){var X=n.dataToPoint([B,U]);h&&(H=n.dataToPoint([V,U])[0]),z=H,$=X[1]+x,W=X[0]-H,Z=_,$t(W)y){w=(M+x)/2;break}T===1&&(S=A-g[0].tickValue)}w==null&&(x?x&&(w=g[g.length-1].coord):w=g[0].coord),s[d]=f.toGlobalCoord(w)}});else{var l=this.getData(),u=l.getLayout("offset"),c=l.getLayout("size"),h=a.getBaseAxis().isHorizontal()?0:1;s[h]+=u+c/2}return s}return[NaN,NaN]},t.prototype.__requireStartValue=function(r){return this.getBaseAxis()!==r},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",defaultBarGap:"10%"},t}(Tt);Tt.registerClass(Mg);var $ue=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(){return wo(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},t.prototype.__preparePipelineContext=function(r,n){var i=_G(this,r,n);return i.progressiveRender&&(i.large=!0),i},t.prototype.brushSelector=function(r,n,i){return i.rect(n.getItemLayout(r))},t.type="series."+eo,t.dependencies=["grid","polar"],t.defaultOption=zl(Mg.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:K.color.primary,borderWidth:2}},realtimeSort:!1}),t}(Mg),Yue=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e}(),Wx=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="sausage",n}return t.prototype.getDefaultShape=function(){return new Yue},t.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.max(n.r0||0,0),s=Math.max(n.r,0),l=(s-o)*.5,u=o+l,c=n.startAngle,h=n.endAngle,f=n.clockwise,d=Math.PI*2,g=f?h-cMath.PI/2&&cs)return!0;s=h}return!1},t.prototype._isOrderDifferentInView=function(r,n){for(var i=n.scale,a=i.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],i.getOrdinalMeta().categories.length-1);o<=s;++o)if(r.ordinalNumbers[o]!==i.getRawOrdinalNumber(o))return!0},t.prototype._updateSortWithinSameData=function(r,n,i,a){if(this._isOrderChangedWithinSameData(r,n,i)){var o=this._dataSort(r,i,n);this._isOrderDifferentInView(o,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:o}))}},t.prototype._dispatchInitSort=function(r,n,i){var a=n.baseAxis,o=this._dataSort(r,a,function(s){return r.get(r.mapDimension(n.otherAxis.dim),s)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},t.prototype.remove=function(r,n){this._clear(this._model),this._removeOnRenderedListener(n)},t.prototype.dispose=function(r,n){this._removeOnRenderedListener(n)},t.prototype._removeOnRenderedListener=function(r){this._onRendered&&(r.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(r){var n=this.group,i=this._data;r&&r.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl(function(a){Ko(a,r,Re(a).dataIndex)})):n.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type=eo,t}(xt),XO={cartesian2d:function(e,t){var r=t.width<0?-1:1,n=t.height<0?-1:1;r<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,a=e.y+e.height,o=_C(t.x,e.x),s=xC(t.x+t.width,i),l=_C(t.y,e.y),u=xC(t.y+t.height,a),c=si?s:o,t.y=h&&l>a?u:l,t.width=c?0:s-o,t.height=h?0:u-l,r<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height),c||h},polar:function(e,t){var r=t.r0<=t.r?1:-1;if(r<0){var n=t.r;t.r=t.r0,t.r0=n}var i=xC(t.r,e.r),a=_C(t.r0,e.r0);t.r=i,t.r0=a;var o=i-a<0;if(r<0){var n=t.r;t.r=t.r0,t.r0=n}return o}},qO={cartesian2d:function(e,t,r,n,i,a,o,s,l){var u=new Ye({shape:ee({},n),z2:1});if(u.__dataIndex=r,u.name="item",a){var c=u.shape,h=i?"height":"width";c[h]=0}return u},polar:function(e,t,r,n,i,a,o,s,l){var u=!i&&l?Wx:on,c=new u({shape:n,z2:1});c.name="item";var h=FW(i);if(c.calculateTextPosition=Xue(h,{isRoundCap:u===Wx}),a){var f=c.shape,d=i?"r":"endAngle",g={};f[d]=i?n.r0:n.startAngle,g[d]=n[d],(s?ot:Rt)(c,{shape:g},a)}return c}};function Jue(e,t){var r=e.get("realtimeSort",!0),n=t.getBaseAxis();if(r&&n.type==="category"&&t.type==="cartesian2d")return{baseAxis:n,otherAxis:t.getOtherAxis(n)}}function KO(e,t,r,n,i,a,o,s){var l,u;a?(u={x:n.x,width:n.width},l={y:n.y,height:n.height}):(u={y:n.y,height:n.height},l={x:n.x,width:n.width}),s||(o?ot:Rt)(r,{shape:l},t,i,null);var c=t?e.baseAxis.model:null;(o?ot:Rt)(r,{shape:u},c,i)}function JO(e,t){for(var r=0;r0?1:-1,o=n.height>0?1:-1;return{x:n.x+a*i/2,y:n.y+o*i/2,width:n.width-a*i,height:n.height-o*i}},polar:function(e,t,r){var n=e.getItemLayout(t);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function tce(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function FW(e){return function(t){var r=t?"Arc":"Angle";return function(n){switch(n){case"start":case"insideStart":case"end":case"insideEnd":return n+r;default:return n}}}(e)}function e5(e,t,r,n,i,a,o,s){var l=t.getItemVisual(r,"style");if(s){if(!a.get("roundCap")){var c=e.shape,h=$a(n.getModel("itemStyle"),c,!0);ee(c,h),e.setShape(c)}}else{var u=n.get(["itemStyle","borderRadius"])||0;e.setShape("r",u)}e.useStyle(l);var f=n.getShallow("cursor");f&&e.attr("cursor",f);var d=s?o?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":o?oce(i,a.coordinateSystem):sce(i,a.coordinateSystem),g=Ar(n);jr(e,g,{labelFetcher:a,labelDataIndex:r,defaultText:Uf(a.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var m=e.getTextContent();if(s&&m){var y=n.get(["label","position"]);e.textConfig.inside=y==="middle"?!0:null,que(e,y==="outside"?d:y,FW(o),n.get(["label","rotate"]))}vH(m,g,a.getRawValue(r),function(x){return uW(t,x)});var _=n.getModel(["emphasis"]);Vt(e,_.get("focus"),_.get("blurScope"),_.get("disabled")),Mr(e,n),tce(i)&&(e.style.fill="none",e.style.stroke="none",E(e.states,function(x){x.style&&(x.style.fill=x.style.stroke="none")}))}function rce(e,t){var r=e.get(["itemStyle","borderColor"]);if(!r||r==="none")return 0;var n=e.get(["itemStyle","borderWidth"])||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(n,i,a)}var nce=function(){function e(){}return e}(),t5=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="largeBar",n}return t.prototype.getDefaultShape=function(){return new nce},t.prototype.buildPath=function(r,n){for(var i=n.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,c=0;c=0?r:null},30,!1);function ice(e,t,r){for(var n=e.baseDimIdx,i=1-n,a=e.shape.points,o=e.largeDataIndices,s=[],l=[],u=e.barWidth,c=0,h=a.length/3;c=s[0]&&t<=s[0]+l[0]&&r>=s[1]&&r<=s[1]+l[1])return o[c]}return-1}function VW(e,t,r){if(Cc(r,"cartesian2d")){var n=t,i=r.getArea();return{x:e?n.x:i.x,y:e?i.y:n.y,width:e?n.width:i.width,height:e?i.height:n.height}}else{var i=r.getArea(),a=t;return{cx:i.cx,cy:i.cy,r0:e?i.r0:a.r0,r:e?i.r:a.r,startAngle:e?a.startAngle:0,endAngle:e?a.endAngle:Math.PI*2}}}function ace(e,t,r){var n=e.type==="polar"?on:Ye;return new n({shape:VW(t,r,e),silent:!0,z2:0})}function oce(e,t){if(e.height===0){var r=t.getOtherAxis(t.getBaseAxis());return r.inverse?"bottom":"top"}return e.height>0?"bottom":"top"}function sce(e,t){if(e.width===0){var r=t.getOtherAxis(t.getBaseAxis());return r.inverse?"left":"right"}return e.width>=0?"right":"left"}function lce(e){e.registerChartView(Kue),e.registerSeriesModel($ue),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,jW(eo)),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,OW(eo)),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,xW(eo)),e.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(t,r){var n=t.componentType||"series";r.eachComponent({mainType:n,query:t},function(i){t.sortInfo&&i.axis.setCategorySortInfo(t.sortInfo)})}),BW(e)}function gm(e){return{seriesType:e,reset:function(t,r){var n=r.findComponents({mainType:"legend"});if(!(!n||!n.length)){var i=t.getData();i.filterSelf(function(a){for(var o=i.getName(a),s=0;s=0},e.prototype.indexOfName=function(t){var r=this._getDataWithEncodedVisual();return r.indexOfName(t)},e.prototype.getItemVisual=function(t,r){var n=this._getDataWithEncodedVisual();return n.getItemVisual(t,r)},e}(),ml="pie",uce=He(),GW=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new Ld(de(this.getData,this),de(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return Ad(this,{coordDimensions:["value"],encodeDefaulter:Ze(nI,this)})},t.prototype.getDataParams=function(r){var n=this.getData(),i=uce(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=sG(o,n.hostModel.get("percentPrecision"))}var s=e.prototype.getDataParams.call(this,r);return s.percent=a[r]||0,s.$vars.push("percent"),s},t.prototype._defaultLabelLine=function(r){hc(r,"labelLine",["show"]);var n=r.labelLine,i=r.emphasis.labelLine;n.show=n.show&&r.label.show,i.show=i.show&&r.emphasis.label.show},t.type="series."+ml,t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"50%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,coordinateSystemUsage:"box",left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:30,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(Tt);ine({fullType:GW.type,getCoord2:function(e){return e.getShallow("center")}});var cce=Math.PI/180;function i5(e,t,r,n,i,a,o,s,l,u){if(e.length<2)return;function c(m){for(var y=m.rB,_=y*y,x=0;xr?_:y,T=Math.abs(w.label.y-r);if(T>=S.maxY){var M=w.label.x-t-w.len2*i,A=n+w.len,N=Math.abs(M)e.unconstrainedWidth?null:f:null;n.setStyle("width",d)}UW(a,n)}}}function UW(e,t){a5.rect=e,H8(a5,t,fce)}var fce={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},a5={};function bC(e){return e.position==="center"}function dce(e){var t=e.getData(),r=[],n,i,a=!1,o=(e.get("minShowLabelAngle")||0)*cce,s=t.getLayout("viewRect"),l=t.getLayout("r"),u=s.width,c=s.x,h=s.y,f=s.height;function d(M){M.ignore=!0}function g(M){if(!M.ignore)return!0;for(var A in M.states)if(M.states[A].ignore===!1)return!0;return!1}t.each(function(M){var A=t.getItemGraphicEl(M),N=A.shape,P=A.getTextContent(),I=A.getTextGuideLine(),D=t.getItemModel(M),O=D.getModel("label"),j=O.get("position")||D.get(["emphasis","label","position"]),B=O.get("distanceToLabelLine"),U=O.get("alignTo"),H=he(O.get("edgeDistance"),u),V=O.get("bleedMargin");V==null&&(V=Math.min(u,f)>200?10:2);var z=D.getModel("labelLine"),$=z.get("length");$=he($,u);var W=z.get("length2");if(W=he(W,u),Math.abs(N.endAngle-N.startAngle)0?"right":"left":X>0?"left":"right"}var tt=Math.PI,ht=0,jt=O.get("rotate");if(nt(jt))ht=jt*(tt/180);else if(j==="center")ht=0;else if(jt==="radial"||jt===!0){var bt=X<0?-Z+tt:-Z;ht=bt}else if(jt==="tangential"||jt==="tangential-noflip"&&j!=="outside"&&j!=="outer"){var ar=Math.atan2(X,re);ar<0&&(ar=tt*2+ar);var On=re>0;On&&jt!=="tangential-noflip"&&(ar=tt+ar),ht=ar-tt}if(a=!!ht,P.x=J,P.y=oe,P.rotation=ht,P.setStyle({verticalAlign:"middle"}),be){P.setStyle({align:De});var So=P.states.select;So&&(So.x+=P.x,So.y+=P.y)}else{var Qn=new Ae(0,0,0,0);UW(Qn,P),r.push({label:P,labelLine:I,position:j,len:$,len2:W,minTurnAngle:z.get("minTurnAngle"),maxSurfaceAngle:z.get("maxSurfaceAngle"),surfaceNormal:new Pe(X,re),linePoints:le,textAlign:De,labelDistance:B,labelAlignTo:U,edgeDistance:H,bleedMargin:V,rect:Qn,unconstrainedWidth:Qn.width,labelStyleWidth:P.style.width})}A.setTextConfig({inside:be})}}),!a&&e.get("avoidLabelOverlap")&&hce(r,n,i,l,u,f,c,h);for(var m=0;mz?(W=B+A*z/2,Z=W):(W=B+P,Z=$-P),n.setItemLayout(V,{angle:z,startAngle:W,endAngle:Z,clockwise:w,cx:o,cy:s,r0:u,r:S?ut(H,M,[u,l]):l}),B=$}),O0){for(var c=o.getItemLayout(0),h=1;isNaN(c&&c.startAngle)&&h=a.r0}},t.type=ml,t}(xt);function yce(e){return{seriesType:e,reset:function(t,r){var n=t.getData();n.filterSelf(function(i){var a=n.mapDimension("value"),o=n.get(a,i);return!(nt(o)&&!isNaN(o)&&o<0)})}}}function _ce(e){e.registerChartView(mce),e.registerSeriesModel(GW),LU(ml,e.registerAction),e.registerLayout(vce),e.registerProcessor(gm(ml)),e.registerProcessor(yce(ml))}var xce=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.hasSymbolVisual=!0,r}return t.prototype.getInitialData=function(r,n){return wo(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){var r=this.option.progressive;return r??(this.option.large?5e3:this.get("progressive"))},t.prototype.getProgressiveThreshold=function(){var r=this.option.progressiveThreshold;return r??(this.option.large?1e4:this.get("progressiveThreshold"))},t.prototype.brushSelector=function(r,n,i){return i.point(n.getItemLayout(r))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},t.type="series.scatter",t.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:K.color.primary}},universalTransition:{divideShape:"clone"}},t}(Tt),ZW=4,bce=function(){function e(){}return e}(),wce=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n._off=0,n.hoverDataIdx=-1,n}return t.prototype.getDefaultShape=function(){return new bce},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.beforeBrush=function(r){r&&!r.contentRetained&&this.reset()},t.prototype.buildPath=function(r,n){var i=n.points,a=n.size,o=this.symbolProxy,s=o.shape,l=r.getContext?r.getContext():r,u=l&&a[0]=0;u--){var c=u*2,h=a[c]-s/2,f=a[c+1]-l/2;if(r>=h&&n>=f&&r<=h+s&&n<=f+l)return u}return-1},t.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect();if(r=i[0],n=i[1],a.contain(r,n)){var o=this.hoverDataIdx=this.findDataIndex(r,n);return o>=0}return this.hoverDataIdx=-1,!1},t.prototype.getBoundingRect=function(){var r=this._rect;if(!r){for(var n=this.shape,i=n.points,a=n.size,o=a[0],s=a[1],l=1/0,u=1/0,c=-1/0,h=-1/0,f=0;f=0&&(u.dataIndex=h+(t.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),Cce=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=r.getData(),o=this._updateSymbolDraw(a,r);o.updateData(a,wC(r)),this._finished=!0},t.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),o=this._updateSymbolDraw(a,r);o.incrementalPrepareUpdate(a),this._finished=!1},t.prototype.incrementalRender=function(r,n,i){this._symbolDraw.incrementalUpdate(r,n.getData(),Qa(n),wC(n)),this._finished=r.end===n.getData().count()},t.prototype.updateTransform=function(r,n,i){var a=r.getData();if(this.group.dirty(),this._finished){var o=vm("").reset(r,n,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(wC(r))}else return{update:!0}},t.prototype.eachRendered=function(r){this._symbolDraw&&this._symbolDraw.eachRendered(r)},t.prototype._updateSymbolDraw=function(r,n){var i=this._symbolDraw,a=n.pipelineContext,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new Sce:new dm,this._isLargeDraw=o,this.group.removeAll()),this.group.add(i.group),i},t.prototype.remove=function(r,n){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type="scatter",t}(xt);function wC(e){return{clipShape:gW(e)}}var nA=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Kt).models[0]},t.type="cartesian2dAxis",t}(Xe);vr(nA,Td);var $W={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:"auto",onZeroAxisIndex:null,lineStyle:{color:K.color.axisLine,width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15],breakLine:!0},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12,color:K.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:K.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[K.color.backgroundTint,K.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:K.color.neutral00,borderColor:K.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},Tce=Ge({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},$W),YI=Ge({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:K.color.axisMinorSplitLine,width:1}}},$W),Mce=Ge({splitNumber:6,axisLabel:{rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},YI),Ace=Le({logBase:10},YI);const YW={category:Tce,value:YI,time:Mce,log:Ace};function Wf(e,t,r,n){E(g8,function(i,a){var o=Ge(Ge({},YW[a],!0),n,!0),s=function(l){q(u,l);function u(){var c=l!==null&&l.apply(this,arguments)||this;return c.type=t+"Axis."+a,c}return u.prototype.mergeDefaultAndTheme=function(c,h){var f=hg(this),d=f?Wc(c):{},g=h.getTheme();Ge(c,g.get(a+"Axis")),Ge(c,this.getDefaultOption()),c.type=s5(c),f&&vo(c,d,f)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=pg.createByAxisModel(this))},u.prototype.getCategories=function(c){var h=this.option;if(h.type==="category")return c?h.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.prototype.updateAxisBreaks=function(c){var h=pm();return h?h.updateModelAxisBreak(this,c):{breaks:[]}},u.type=t+"Axis."+a,u.defaultOption=o,u}(r);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+"Axis",s5)}function s5(e){return e.type||(e.data?"category":"value")}var Lce=function(){function e(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return e.prototype.getAxis=function(t){return this._axes[t]},e.prototype.getAxes=function(){return ae(this._dimList,function(t){return this._axes[t]},this)},e.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),gt(this.getAxes(),function(r){return r.scale.type===t})},e.prototype.addAxis=function(t){var r=t.dim;this._axes[r]=t,this._dimList.push(r)},e}(),p_=["x","y"];function l5(e){return(e.type==="interval"||e.type==="time")&&!yx(e)}var kce=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=ga,r.dimensions=p_,r}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!l5(r)||!l5(n))){var i=Px(r,null),a=Px(n,null),o=this.dataToPoint([i[0],a[0]]),s=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var c=(s[0]-o[0])/l,h=(s[1]-o[1])/u,f=o[0]-i[0]*c,d=o[1]-a[0]*h,g=this._transform=[c,0,0,h,f,d];this._invTransform=fi([],g)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(r){var n=this.getAxis("x"),i=this.getAxis("y");return n.contain(n.toLocalCoord(r[0]))&&i.contain(i.toLocalCoord(r[1]))},t.prototype.containData=function(r){return this.getAxis("x").containData(r[0])&&this.getAxis("y").containData(r[1])},t.prototype.containZone=function(r,n){var i=this.dataToPoint(r),a=this.dataToPoint(n),o=this.getArea(),s=new Ae(i[0],i[1],a[0]-i[0],a[1]-i[1]);return o.intersect(s)},t.prototype.dataToPoint=function(r,n,i){i=i||[];var a=r[0],o=r[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return Xt(i,r,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return i[0]=s.toGlobalCoord(s.dataToCoord(a,n)),i[1]=l.toGlobalCoord(l.dataToCoord(o,n)),i},t.prototype.clampData=function(r,n){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,o=i.getExtent(),s=a.getExtent(),l=i.parse(r[0]),u=a.parse(r[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),n[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),n},t.prototype.pointToData=function(r,n,i){if(i=i||[],this._invTransform)return Xt(i,r,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(r[0]),n),i[1]=o.coordToData(o.toLocalCoord(r[1]),n),i},t.prototype.getOtherAxis=function(r){return this.getAxis(r.dim==="x"?"y":"x")},t.prototype.getArea=function(r){r=r||0;var n=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),a=Math.min(n[0],n[1])-r,o=Math.min(i[0],i[1])-r,s=Math.max(n[0],n[1])-a+r,l=Math.max(i[0],i[1])-o+r;return new Ae(a,o,s,l)},t}(Lce);function XW(e,t){var r=e.scale,n=e.model,i=L8(r,n,n.ecModel,e,null),a=Ff(r),o=Ff(t)?t.intervalStub:t,s=a?r.intervalStub:r,l=r.base,u=o.getTicks(),c=o.getTicks({expandToNicedExtent:!0}),h=u.length-1,f,d,g;if(h===1)f=d=0,g=1;else if(h===2){var m=$t(u[0].value-u[1].value),y=$t(u[1].value-u[2].value);f=d=0,m===y?g=2:(g=1,m=A[1])return!0})):S[1]?(P=A[1],B(function(){if(z(),j=at(O-I*g,D),U(),N<=A[0])return!0})):B(function(){j=at(Bc(A[0]/I)*I,D),O=at(Ui(A[1]/I)*I,D);var X=uo((O-j)/I);if(X<=g){var re=g-X,J=void 0,oe=i.incl0||a;if(oe&&A[0]===0)J=[0,re];else if(oe&&A[1]===0)J=[re,0];else{var le=Ui(re/2);J=re%2===0?[le,le]:N+P=A[1])return!0}})}_8(r,S,M,[N,P],T,{interval:I,intervalCount:g,intervalPrecision:D,niceExtent:[j,O]})}var u5=[[3,1],[0,2]],Ice=function(){function e(t,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=p_,this._initCartesian(t,r,n),this.model=t}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(t,r){var n=this._axesMap;E(this._axesList,function(o){wc(o,Gf);var s=o.scale;bn(s)&&s.setSortInfo(o.model.get("categorySortInfo"))});function i(o){for(var s=Qe(o),l=[],u=s.length-1;u>=0;u--){var c=o[+s[u]];c.__alignTo?l.push(c):Hf(c)}E(l,function(h){Pce(h,h.__alignTo)?Hf(h):XW(h,h.__alignTo.scale)})}i(n.x),i(n.y);var a={};E(n.x,function(o){c5(n,"y",o,a)}),E(n.y,function(o){c5(n,"x",o,a)}),this.resize(this.model,r)},e.prototype.resize=function(t,r,n){var i=kr(t,r),a=this._rect=Bt(t.getBoxLayoutParams(),i.refContainer),o=this._axesMap,s=this._coordsList,l=t.get("containLabel");if(iA(o,a),!n){var u=Rce(a,s,o,l,r),c=void 0;if(l)aA?(aA(this._axesList,a),iA(o,a)):c=v5(a.clone(),"axisLabel",null,a,o,u,i);else{var h=jce(t,a,i),f=h.outerBoundsRect,d=h.parsedOuterBoundsContain,g=h.outerBoundsClamp;f&&(c=v5(f,d,g,a,o,u,i))}qW(a,o,xa.determine,null,c,i),E(this._coordsList,function(m){m.calcAffineTransform()})}},e.prototype.getAxis=function(t,r){var n=this._axesMap[t];if(n!=null)return n[r||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(t,r){if(t!=null&&r!=null){var n="x"+t+"y"+r;return this._coordsMap[n]}Ie(t)&&(r=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,a=this._coordsList;i=0;i--){var a=e[+t[i]];c8(a.scale)&&y8(a.model,a.type,!0)==null&&(a.model.get("alignTicks")&&a.model.get("interval")==null?n.push(a):r=a)}r||(r=n.pop()),r&&E(n,function(o){o.__alignTo=r})}function Pce(e,t){return yx(e.scale)||yx(t.scale)||t.scale.getTicks().length<2}function Dce(e,t){var r=e.getExtent(),n=r[0]+r[1];e.toGlobalCoord=e.dim==="x"?function(i){return i+t}:function(i){return n-i+t},e.toLocalCoord=e.dim==="x"?function(i){return i-t}:function(i){return n-i+t}}function iA(e,t){E(e.x,function(r){return d5(r,t.x,t.width)}),E(e.y,function(r){return d5(r,t.y,t.height)})}function d5(e,t,r){var n=[0,r],i=e.inverse?1:0;e.setExtent(n[i],n[1-i]),Dce(e,t)}var aA;function Ece(e){aA=e}function v5(e,t,r,n,i,a,o){qW(n,i,xa.estimate,t,!1,o);var s=[0,0,0,0];u(0),u(1),c(n,0,NaN),c(n,1,NaN);var l=ys(s,function(f){return f>0})==null;return gc(n,s,!0,!0,r),iA(i,n),l;function u(f){E(i[ze[f]],function(d){if(_g(d.model)){var g=a.ensureRecord(d.model),m=g.labelInfoList;if(m)for(var y=0;y0&&!tn(d)&&d>1e-4&&(f/=d),f}}function Rce(e,t,r,n,i){var a=new TW(Oce);return E(r,function(o){return E(o,function(s){if(_g(s.model)){var l=!n;s.axisBuilder=jue(e,t,s.model,i,a,l)}})}),a}function qW(e,t,r,n,i,a){var o=r===xa.determine;E(t,function(u){return E(u,function(c){_g(c.model)&&(Oue(c.axisBuilder,e,c.model),c.axisBuilder.build(o?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var s={x:0,y:0};l(0),l(1);function l(u){s[ze[1-u]]=e[nr[u]]<=a.refContainer[nr[u]]*.5?0:1-u===1?2:1}E(t,function(u,c){return E(u,function(h){_g(h.model)&&((n==="all"||o)&&h.axisBuilder.build({axisName:!0},{nameMarginLevel:s[c]}),o&&h.axisBuilder.build({axisLine:!0}))})})}function jce(e,t,r){var n,i=e.get("outerBoundsMode",!0);i==="same"?n=t.clone():(i==null||i==="auto")&&(n=Bt(e.get("outerBounds",!0)||DW,r.refContainer));var a=e.get("outerBoundsContain",!0),o;a==null||a==="auto"||Be(["all","axisLabel"],a)<0?o="all":o=a;var s=[cx(ye(e.get("outerBoundsClampWidth",!0),Ux[0]),t.width),cx(ye(e.get("outerBoundsClampHeight",!0),Ux[1]),t.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var Oce=function(e,t,r,n,i,a){var o=r.axis.dim==="x"?"y":"x";MW(e,t,r,n,i,a),Vf(e.nameLocation)||E(t.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&LW(s.labelInfoList,s.dirVec,n,i)})};function zce(e,t){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return Bce(r,e,t),r.seriesInvolved&&Vce(r,e),r}function Bce(e,t,r){var n=t.getComponent("tooltip"),i=t.getComponent("axisPointer"),a=i.get("link",!0)||[],o=[];E(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=Ag(s.model),u=e.coordSysAxesInfo[l]={};e.coordSysMap[l]=s;var c=s.model,h=c.getModel("tooltip",n);if(E(s.getAxes(),Ze(m,!1,null)),s.getTooltipAxes&&n&&h.get("show")){var f=h.get("trigger")==="axis",d=h.get(["axisPointer","type"])==="cross",g=s.getTooltipAxes(h.get(["axisPointer","axis"]));(f||d)&&E(g.baseAxes,Ze(m,d?"cross":!0,f)),d&&E(g.otherAxes,Ze(m,"cross",!1))}function m(y,_,x){var w=x.model.getModel("axisPointer",i),S=w.get("show");if(!(!S||S==="auto"&&!y&&!oA(w))){_==null&&(_=w.get("triggerTooltip")),w=y?Fce(x,h,i,t,y,_):w;var T=w.get("snap"),M=w.get("triggerEmphasis"),A=Ag(x.model),N=_||T||x.type==="category",P=e.axesInfo[A]={key:A,axis:x,coordSys:s,axisPointerModel:w,triggerTooltip:_,triggerEmphasis:M,involveSeries:N,snap:T,useHandle:oA(w),seriesModels:[],linkGroup:null};u[A]=P,e.seriesInvolved=e.seriesInvolved||N;var I=Gce(a,x);if(I!=null){var D=o[I]||(o[I]={axesInfo:{}});D.axesInfo[A]=P,D.mapper=a[I].mapper,P.linkGroup=D}}}})}function Fce(e,t,r,n,i,a){var o=t.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};E(s,function(f){l[f]=Se(o.get(f))}),l.snap=e.type!=="category"&&!!a,o.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),i==="cross"){var c=o.get(["label","show"]);if(u.show=c??!0,!a){var h=l.lineStyle=o.get("crossStyle");h&&Le(u,h.textStyle)}}return e.model.getModel("axisPointer",new Ke(l,r,n))}function Vce(e,t){t.eachSeries(function(r){var n=r.coordinateSystem,i=r.get(["tooltip","trigger"],!0),a=r.get(["tooltip","show"],!0);!n||!n.model||i==="none"||i===!1||i==="item"||a===!1||r.get(["axisPointer","show"],!0)===!1||E(e.coordSysAxesInfo[Ag(n.model)],function(o){var s=o.axis;n.getAxis(s.dim)===s&&(o.seriesModels.push(r),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=r.getData().count())})})}function Gce(e,t){for(var r=t.model,n=t.dim,i=0;i=0||e===t}function Hce(e){var t=XI(e);if(t){var r=t.axisPointerModel,n=t.axis.scale,i=r.option,a=r.get("status"),o=r.get("value");o!=null&&(o=n.parse(o));var s=oA(r);a==null&&(i.status=s?"show":"hide");var l=n.getExtent();(o==null||o>l[1])&&(o=l[1]),o0;return o&&s}var Kce=He();function m5(e,t,r,n){if(e instanceof bW){var i=e.scale.type;if(i!=="ordinal")return r}var a=e.model,o=a.get("jitter");if(!(o>0))return r;var s=a.get("jitterOverlap"),l=a.get("jitterMargin")||0,u=bn(e.scale)?ln(e).w:null;return s?r7(r,o,u,n):Jce(e,t,r,n,o,l)}function r7(e,t,r,n){if(r===null)return e+(Math.random()-.5)*t;var i=r-n*2,a=Math.min(Math.max(0,t),i);return e+(Math.random()-.5)*a}function Jce(e,t,r,n,i,a){var o=Kce(e);o.items||(o.items=[]);var s=o.items,l=y5(s,t,r,n,i,a,1),u=y5(s,t,r,n,i,a,-1),c=Math.abs(l-r)i/2||h&&f>h/2-n?r7(r,i,h,n):(s.push({fixedCoord:t,floatCoord:c,r:n}),c)}function y5(e,t,r,n,i,a,o){for(var s=r,l=0;li/2)return Number.MAX_VALUE;if(o===1&&g>s||o===-1&&g0&&!m.min?m.min=0:m.min!=null&&m.min<0&&!m.max&&(m.max=0);var y=u;m.color!=null&&(y=Le({color:m.color},u));var _=Ge(Se(m),{boundaryGap:r,splitNumber:n,clockwise:i,scale:a,axisLine:o,axisTick:s,axisLabel:l,name:m.text,showName:c,nameLocation:"end",nameGap:f,nameTextStyle:y,triggerEvent:d},!1);if(ue(h)){var x=_.name;_.name=h.replace("{value}",x??"")}else Ce(h)&&(_.name=h(_.name,_));var w=new Ke(_,null,this.ecModel);return vr(w,Td.prototype),w.mainType="radar",w.componentIndex=this.componentIndex,w.uid=Uc("ec_radar"),w},this);this._indicatorModels=g},t.prototype.getIndicatorModels=function(){return this._indicatorModels},t.type=n7,t.defaultOption={z:0,center:["50%","50%"],radius:"50%",startAngle:90,clockwise:!1,axisName:{show:!0,color:K.color.axisLabel},boundaryGap:[0,0],splitNumber:i7,axisNameGap:15,scale:!1,shape:"polygon",axisLine:Ge({lineStyle:{color:K.color.neutral20}},Sv.axisLine),axisLabel:u0(Sv.axisLabel,!1),axisTick:u0(Sv.axisTick,!1),splitLine:u0(Sv.splitLine,!0),splitArea:u0(Sv.splitArea,!0),indicator:[]},t}(Xe),she=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=this.group;a.removeAll(),this._buildAxes(r,i),this._buildSplitLineAndArea(r)},t.prototype._buildAxes=function(r,n){var i=r.coordinateSystem,a=i.getIndicatorAxes(),o=ae(a,function(s){var l=s.model.get("showName")?s.name:"",u=new Nn(s.model,n,{axisName:l,position:[i.cx,i.cy],rotation:s.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return u});E(o,function(s){s.build(),this.group.add(s.group)},this)},t.prototype._buildSplitLineAndArea=function(r){var n=r.coordinateSystem,i=n.getIndicatorAxes();if(!i.length)return;var a=r.get("shape"),o=r.getModel("splitLine"),s=r.getModel("splitArea"),l=o.getModel("lineStyle"),u=s.getModel("areaStyle"),c=o.get("show"),h=s.get("show"),f=l.get("color"),d=u.get("color"),g=ne(f)?f:[f],m=ne(d)?d:[d],y=[],_=[];function x(U,H,V){var z=V%H.length;return U[z]=U[z]||[],z}if(a==="circle")for(var w=i[0].getTicksCoords(),S=n.cx,T=n.cy,M=0;M3?1.4:o>1?1.2:1.1,c=a>0?u:1/u;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",r,{scale:c,originX:s,originY:l,isAvailableBehavior:null})}if(i){var h=Math.abs(a),f=(a>0?1:-1)*(h>3?.4:h>1?.15:.05);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:f,originX:s,originY:l,isAvailableBehavior:null})}}}},t.prototype._pinchHandler=function(r){if(!(b5(this._zr,"globalPan")||Cv(r))){var n=r.pinchScale>1?1.1:1/1.1;this._checkTriggerMoveZoom(this,"zoom",null,r,{scale:n,originX:r.pinchX,originY:r.pinchY,isAvailableBehavior:null})}},t.prototype._checkTriggerMoveZoom=function(r,n,i,a,o){r._checkPointer(a,o.originX,o.originY)&&(ls(a.event),a.__ecRoamConsumed=!0,w5(r,n,i,a,o))},t}(Xi);function Cv(e){return e.__ecRoamConsumed}var mhe=He();function Rb(e){var t=mhe(e);return t.roam=t.roam||{},t.uniform=t.uniform||{},t}function Tv(e,t,r,n){for(var i=Rb(e),a=i.roam,o=a[t]=a[t]||[],s=0;s=4&&(c={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(c&&s!=null&&l!=null&&(h=l7(c,{x:0,y:0,width:s,height:l}),!r.ignoreViewBox)){var d=i;i=new Me,i.add(d),d.scaleX=d.scaleY=h.scale,d.x=h.x,d.y=h.y}return!r.ignoreRootClip&&s!=null&&l!=null&&i.setClipPath(new Ye({shape:{x:0,y:0,width:s,height:l}})),{root:i,width:s,height:l,viewBoxRect:c,viewBoxTransform:h,named:a}},e.prototype._parseNode=function(t,r,n,i,a,o){var s=t.nodeName.toLowerCase(),l,u=i;if(s==="defs"&&(a=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")l=r;else{if(!a){var c=CC[s];if(c&&ge(CC,s)){l=c.call(this,t,r);var h=t.getAttribute("name");if(h){var f={name:h,namedFrom:null,svgNodeTagLower:s,el:l};n.push(f),s==="g"&&(u=f)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:l});r.add(l)}}var d=T5[s];if(d&&ge(T5,s)){var g=d.call(this,t),m=t.getAttribute("id");m&&(this._defs[m]=g)}}if(l&&l.isGroup)for(var y=t.firstChild;y;)y.nodeType===1?this._parseNode(y,l,n,u,a,o):y.nodeType===3&&o&&this._parseText(y,l),y=y.nextSibling},e.prototype._parseText=function(t,r){var n=new Rf({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});wi(r,n),ei(t,n,this._defsUsePending,!1,!1),bhe(n,r);var i=n.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,n.scaleX*=a/9,n.scaleY*=a/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var s=n.getBoundingRect();return this._textX+=s.width,r.add(n),n},e.internalField=function(){CC={g:function(t,r){var n=new Me;return wi(r,n),ei(t,n,this._defsUsePending,!1,!1),n},rect:function(t,r){var n=new Ye;return wi(r,n),ei(t,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(t.getAttribute("x")||"0"),y:parseFloat(t.getAttribute("y")||"0"),width:parseFloat(t.getAttribute("width")||"0"),height:parseFloat(t.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(t,r){var n=new bo;return wi(r,n),ei(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),n.silent=!0,n},line:function(t,r){var n=new cr;return wi(r,n),ei(t,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(t.getAttribute("x1")||"0"),y1:parseFloat(t.getAttribute("y1")||"0"),x2:parseFloat(t.getAttribute("x2")||"0"),y2:parseFloat(t.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(t,r){var n=new tm;return wi(r,n),ei(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),rx:parseFloat(t.getAttribute("rx")||"0"),ry:parseFloat(t.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(t,r){var n=t.getAttribute("points"),i;n&&(i=L5(n));var a=new sn({shape:{points:i||[]},silent:!0});return wi(r,a),ei(t,a,this._defsUsePending,!1,!1),a},polyline:function(t,r){var n=t.getAttribute("points"),i;n&&(i=L5(n));var a=new Zr({shape:{points:i||[]},silent:!0});return wi(r,a),ei(t,a,this._defsUsePending,!1,!1),a},image:function(t,r){var n=new Or;return wi(r,n),ei(t,n,this._defsUsePending,!1,!1),n.setStyle({image:t.getAttribute("xlink:href")||t.getAttribute("href"),x:+t.getAttribute("x"),y:+t.getAttribute("y"),width:+t.getAttribute("width"),height:+t.getAttribute("height")}),n.silent=!0,n},text:function(t,r){var n=t.getAttribute("x")||"0",i=t.getAttribute("y")||"0",a=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(o);var s=new Me;return wi(r,s),ei(t,s,this._defsUsePending,!1,!0),s},tspan:function(t,r){var n=t.getAttribute("x"),i=t.getAttribute("y");n!=null&&(this._textX=parseFloat(n)),i!=null&&(this._textY=parseFloat(i));var a=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0",s=new Me;return wi(r,s),ei(t,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(o),s},path:function(t,r){var n=t.getAttribute("d")||"",i=qG(n);return wi(r,i),ei(t,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),e}(),T5={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||"0",10),r=parseInt(e.getAttribute("y1")||"0",10),n=parseInt(e.getAttribute("x2")||"10",10),i=parseInt(e.getAttribute("y2")||"0",10),a=new Gc(t,r,n,i);return M5(e,a),A5(e,a),a},radialgradient:function(e){var t=parseInt(e.getAttribute("cx")||"0",10),r=parseInt(e.getAttribute("cy")||"0",10),n=parseInt(e.getAttribute("r")||"0",10),i=new Dk(t,r,n);return M5(e,i),A5(e,i),i}};function M5(e,t){var r=e.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(t.global=!0)}function A5(e,t){for(var r=e.firstChild;r;){if(r.nodeType===1&&r.nodeName.toLocaleLowerCase()==="stop"){var n=r.getAttribute("offset"),i=void 0;n&&n.indexOf("%")>0?i=parseInt(n,10)/100:n?i=parseFloat(n):i=0;var a={};s7(r,a,a);var o=a.stopColor||r.getAttribute("stop-color")||"#000000",s=a.stopOpacity||r.getAttribute("stop-opacity");if(s){var l=yn(o),u=l&&l[3];u&&(l[3]*=Xo(s),o=Oi(l,"rgba"))}t.colorStops.push({offset:i,color:o})}r=r.nextSibling}}function wi(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),Le(t.__inheritedStyle,e.__inheritedStyle))}function L5(e){for(var t=jb(e),r=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=jb(o);switch(i=i||Ft(),s){case"translate":_a(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":J1(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":_s(i,i,-parseFloat(l[0])*TC,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*TC);ci(i,[1,0,u,1,0,0],i);break;case"skewY":var c=Math.tan(parseFloat(l[0])*TC);ci(i,[1,c,0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5]);break}}t.setLocalTransform(i)}}var I5=/([^\s:;]+)\s*:\s*([^:;]+)/g;function s7(e,t,r){var n=e.getAttribute("style");if(n){I5.lastIndex=0;for(var i;(i=I5.exec(n))!=null;){var a=i[1],o=ge(Zx,a)?Zx[a]:null;o&&(t[o]=i[2]);var s=ge($x,a)?$x[a]:null;s&&(r[s]=i[2])}}}function Ahe(e,t,r){for(var n=0;n1e-6;Lv[0]=o?(i[0]-n.x)/a:i[0],Lv[1]=o?(i[1]-n.y)/a:i[1],Xt(Lv,Lv,e.mtRawInv);var s=Jhe(e,Lv);z5(t,s,a),E(r,function(l){l!==t&&z5(l,s.slice(),a)})}var Lv=[];function z5(e,t,r){var n=e.option;n.center=t,n.zoom=r}function tN(e,t){if(t){var r=t.min||0,n=t.max||1/0;e=Math.max(Math.min(n,e),r)}return e}function m7(e,t){var r=t.getShallow("nodeScaleRatio",!0)||1,n=e;return((n.zoom-1)*r+1)/(n.trans[go].scaleX||1)}function Bb(e,t,r,n,i,a,o,s){var l=qx(e);if(!l){r.disable();return}r.enable(ye(e.get("roam"),o),{api:t,zInfo:{component:e},triggerInfo:{roamTrigger:e.get("roamTrigger"),isInSelf:n,isInClip:function(c,h,f){return!i||i.contain(h,f)}}});function u(c){var h=e.mainType,f=Fk(Le({type:_7(h,e.subType,EG)},c));s&&(f.componentType=h),f[h+"Id"]=e.id,t.dispatchAction(f)}r.off("pan").off("zoom").on("pan",function(c){a&&a("pan"),u({dx:c.dx,dy:c.dy})}).on("zoom",function(c){a&&a("zoom"),u({zoom:c.scale,originX:c.originX,originY:c.originY})})}function y7(e){return function(t,r,n){return kC.copy(e.getBoundingRect()),kC.applyTransform(e.getComputedTransform()),kC.contain(r,n)}}var kC=new Ae(0,0,0,0);function rN(e,t,r){var n=_7(t,r,EG);e.registerAction({type:n,event:n,update:"none"},function(i,a,o){a.eachComponent(wk(i,t,r),function(s){d7(i,s),v7(i,s,a,o)})})}function _7(e,t,r){return(e!==fo?e:t==="map"?"geo":t)+r}function x7(e){return e.zoom!=null}function nN(e,t,r,n,i,a,o){var s=new Ob(null,g7(e.ecModel,t));return zb(s,r,n,i,a),o?Xx(s,o.x,o.y,o.width,o.height):Xx(s,r,n,i,a),QI(s,e),s}var iN=["rect","circle","line","ellipse","polygon","polyline","path"],efe=pe(iN),tfe=pe(iN.concat(["g"])),rfe=pe(iN.concat(["g"])),b7=He();function d0(e){var t=e.getItemStyle(),r=e.get("areaColor");return r!=null&&(t.fill=r),t}function B5(e){var t=e.style;t&&(t.stroke=t.stroke||t.fill,t.fill=null)}var w7=function(){function e(t){var r=this.group=new Me,n=this._transformGroup=new Me;r.add(n),this.uid=Uc("ec_map_draw"),this._controller=new qc(t.getZr()),n.add(this._regionsGroup=new Me),n.add(this._svgGroup=new Me)}return e.prototype.draw=function(t,r,n,i,a){var o=this,s=t.getData&&t.getData();_f(t)&&r.eachComponent({mainType:"series",subType:"map"},function(m){!s&&m.getHostGeoModel()===t&&(s=m.getData())});var l=t.coordinateSystem,u=l.view,c=this._regionsGroup,h=this._transformGroup,f=!c.childAt(0)||a,d;l.shouldClip()?(d=KI(null,u),this.group.setClipPath(new Ye({shape:d.clone()}))):this.group.removeClipPath(),Al(h,Ac,u,f?null:t);var g=s&&s.getVisual("visualMeta")&&s.getVisual("visualMeta").length>0;l.resourceType==="geoJSON"?this._buildGeoJSON(u,n,l,t,s,g):l.resourceType==="geoSVG"&&this._buildSVG(u,n,l,t,s,g),Bb(t,n,this._controller,function(m,y,_){return t.coordinateSystem.containPoint([y,_])},d,function(){o._mouseDownFlag=!1},!1,!0),this._updateMapSelectHandler(t,c,n,i)},e.prototype.__updateOnOwnRoam=function(t){Al(this._transformGroup,Ac,t.coordinateSystem.view,null)},e.prototype._buildGeoJSON=function(t,r,n,i,a,o){var s=this._regionsGroupByName=pe(),l=pe(),u=this._regionsGroup,c=n.projection,h=c&&c.stream,f=Tl(kg(null,t,Mc));function d(y,_){return _&&(y=_(y)),y&&Xt([],y,f)}function g(y){for(var _=[],x=!h&&c&&c.project,w=0;w=0)&&(c=e);var h=o?{normal:{align:"center",verticalAlign:"middle"}}:null;jr(r,Ar(i),{labelFetcher:c,labelDataIndex:u,defaultText:n},h);var f=r.getTextContent();if(f&&(b7(f).ignore=f.ignore,r.textConfig&&o)){var d=r.getBoundingRect().clone();r.textConfig.layoutRect=d,r.textConfig.position=[(o[0]-d.x)/d.width*100+"%",(o[1]-d.y)/d.height*100+"%"]}r.disableLabelAnimation=!0}else r.removeTextContent(),r.removeTextConfig(),r.disableLabelAnimation=null}function G5(e,t,r,n,i,a){t?t.setItemGraphicEl(a,r):Re(r).eventData={componentType:"geo",componentIndex:e.componentIndex,geoIndex:e.componentIndex,name:n,region:i&&i.option||{}}}function H5(e,t,r,n,i){t||bs({el:r,componentModel:e,itemName:n,itemTooltipOption:i.get("tooltip")})}function U5(e,t,r,n){t.highDownSilentOnTouch=!!e.get("selectedMode");var i=n.getModel("emphasis"),a=i.get("focus");return Vt(t,a,i.get("blurScope"),i.get("disabled")),_f(e)&&$te(t,e,r),a}function W5(e,t,r){var n=[],i;function a(){i=[]}function o(){i.length&&(n.push(i),i=[])}var s=t({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(l,u){isFinite(l)&&isFinite(u)&&i.push([l,u])},sphere:function(){}});return!r&&s.polygonStart(),E(e,function(l){s.lineStart();for(var u=0;u-1&&(i.style.stroke=i.style.fill,i.style.fill=K.color.neutral00,i.style.lineWidth=2),i},t.prototype.__ownRoamView=function(){return Kx(this)?this.coordinateSystem.view:null},t.type="series."+Lc,t.dependencies=["geo"],t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:K.color.tertiary},itemStyle:{borderWidth:.5,borderColor:K.color.border,areaColor:K.color.background},emphasis:{label:{show:!0,color:K.color.primary},itemStyle:{areaColor:K.color.highlight}},select:{label:{show:!0,color:K.color.primary},itemStyle:{color:K.color.highlight}},nameProperty:"name"},t}(Tt);function S7(e){return e.indexOf("i")===0}function Kx(e){return Ig(e.seriesGroup)===e&&!e.getHostGeoModel()}function Ig(e){return e.f[0]}function aN(e,t){var r={};return e.eachRawSeriesByType(Lc,function(n){var i=n.getHostGeoModel(),a=i?"o"+i.id:"i"+n.getMapType(),o=r[a]=r[a]||{f:[],r:[]};!e.isSeriesFiltered(n)&&!t&&o.f.push(n),o.r.push(n)}),r}var ife=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=Lc,r}return t.prototype.render=function(r,n,i,a){if(!(a&&a.type==="mapToggleSelect"&&a.from===this.uid)){var o=this.group;if(o.removeAll(),!r.getHostGeoModel()){var s=this._mapDraw;s&&a&&a.type==="geoRoam"&&s.resetForLabelLayout(),a&&a.type==="geoRoam"&&a.componentType==="series"&&a.seriesId===r.id?s&&o.add(s.group):Kx(r)?(s=s||(this._mapDraw=new w7(i)),o.add(s.group),s.draw(r,n,i,this,a)):this._clearMapDraw(),r.get("showLegendSymbol")&&n.getComponent("legend")&&this._renderSymbols(r)}}},t.prototype.__updateOnOwnRoam=function(r,n,i){var a=this._mapDraw;Kx(n)&&a&&a.__updateOnOwnRoam(n)},t.prototype.remove=function(){this._clearMapDraw(),this.group.removeAll()},t.prototype.dispose=function(){this._clearMapDraw()},t.prototype._clearMapDraw=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},t.prototype._renderSymbols=function(r){var n=r.originalData,i=this.group;n.each(n.mapDimension("value"),function(a,o){if(!isNaN(a)){var s=n.getItemLayout(o);if(!(!s||!s.point)){var l=s.point,u=s.offset,c=new bo({style:{fill:r.getData().getVisual("style").fill},shape:{cx:l[0]+u*9,cy:l[1],r:3},silent:!0,z2:8+(u?0:cd+1)});if(!u){var h=Ig(r.seriesGroup).getData(),f=n.getName(o),d=h.indexOfName(f),g=n.getItemModel(o),m=g.getModel("label"),y=h.getItemGraphicEl(d);jr(c,Ar(g),{labelFetcher:{getFormattedLabel:function(_,x){return r.getFormattedLabel(d,x)}},defaultText:f}),c.disableLabelAnimation=!0,m.get("position")||c.setTextConfig({position:"bottom"}),y.onHoverStateChange=function(_){vx(c,_)}}i.add(c)}}})},t.type=Lc,t}(xt),afe={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},C7=["lng","lat"],Z5=function(e){q(t,e);function t(r,n,i){var a=e.call(this)||this;a.dimensions=C7,a.type="geo",a._nameCoordMap=pe(),a.name=r;var o=i.projection,s=ps.load(n,i.nameMap,i.nameProperty),l=ps.getGeoResource(n);a.resourceType=l?l.type:null;var u=a.regions=s.regions,c=afe[l.type];a._clip=i.clip;var h=o?!1:c.invertLongitute;a.view=new Ob(h,g7(i.ecModel,i.api),a),a.map=n,a._regionsMap=s.regionsMap,a.regions=s.regions,a.projection=o;var f;if(o)for(var d=0;d1?(S.width=w,S.height=w/y):(S.height=w,S.width=w*y),S.y=x[1]-S.height/2,S.x=x[0]-S.width/2;else{var T=e.getBoxLayoutParams();T.aspect=y,S=Bt(T,m),S=zH(e,S,y)}Xx(r,S.x,S.y,S.width,S.height),QI(r,e)}function ofe(e,t){E(t.get("geoCoord"),function(r,n){e.addGeoCoord(n,r)})}var sfe=function(){function e(){this.dimensions=C7}return e.prototype.create=function(t,r){var n=[];function i(a){return{nameProperty:a.get("nameProperty"),aspectScale:a.get("aspectScale"),projection:a.get("projection"),clip:a.getShallow("clip",!0)}}return t.eachComponent("geo",function(a,o){var s=a.get("map"),l=new Z5(s+o,s,ee({nameMap:a.get("nameMap"),api:r,ecModel:t},i(a)));n.push(l),a.coordinateSystem=l,l.model=a,l.resize=Y5,l.resize(a,r)}),t.eachSeries(function(a){om({targetModel:a,coordSysType:"geo",coordSysProvider:function(){var o=a.subType===Lc?a.getHostGeoModel():a.getReferringComponents("geo",Kt).models[0];return o&&o.coordinateSystem},allowNotFound:!0})}),E(aN(t,!0),function(a,o){if(S7(o)){var s=a.r[0],l=[];E(a.r,function(f){l.push(f.get("nameMap")),f.seriesGroup=null});var u=o.slice(1),c=new Z5(u,u,ee({nameMap:q1(l),api:r,ecModel:t},i(s))),h;E(a.r,function(f){h=ye(h,f.get("scaleLimit"))}),n.push(c),c.resize=Y5,c.resize(s,r),E(a.r,function(f){f.coordinateSystem=c,ofe(c,f)})}}),n},e.prototype.getFilledRegions=function(t,r,n,i){for(var a=(t||[]).slice(),o=pe(),s=0;s=0;o--){var s=i[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},r.push(s)}}function yfe(e,t){var r=e.isExpand?e.children:[],n=e.parentNode.children,i=e.hierNode.i?n[e.hierNode.i-1]:null;if(r.length){xfe(e);var a=(r[0].hierNode.prelim+r[r.length-1].hierNode.prelim)/2;i?(e.hierNode.prelim=i.hierNode.prelim+t(e,i),e.hierNode.modifier=e.hierNode.prelim-a):e.hierNode.prelim=a}else i&&(e.hierNode.prelim=i.hierNode.prelim+t(e,i));e.parentNode.hierNode.defaultAncestor=bfe(e,i,e.parentNode.hierNode.defaultAncestor||n[0],t)}function _fe(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function X5(e){return arguments.length?e:Cfe}function Jv(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function xfe(e){for(var t=e.children,r=t.length,n=0,i=0;--r>=0;){var a=t[r];a.hierNode.prelim+=n,a.hierNode.modifier+=n,i+=a.hierNode.change,n+=a.hierNode.shift+i}}function bfe(e,t,r,n){if(t){for(var i=e,a=e,o=a.parentNode.children[0],s=t,l=i.hierNode.modifier,u=a.hierNode.modifier,c=o.hierNode.modifier,h=s.hierNode.modifier;s=IC(s),a=NC(a),s&&a;){i=IC(i),o=NC(o),i.hierNode.ancestor=e;var f=s.hierNode.prelim+h-a.hierNode.prelim-u+n(s,a);f>0&&(Sfe(wfe(s,e,r),e,f),u+=f,l+=f),h+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,c+=o.hierNode.modifier}s&&!IC(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=h-l),a&&!NC(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,r=e)}return r}function IC(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function NC(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function wfe(e,t,r){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:r}function Sfe(e,t,r){var n=r/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=n,t.hierNode.shift+=r,t.hierNode.modifier+=r,t.hierNode.prelim+=r,e.hierNode.change+=n}function Cfe(e,t){return e.parentNode===t.parentNode?1:2}var Bi=He();function A7(e){var t=e.mainData,r=e.datas;r||(r={main:t},e.datasAttr={main:"data"}),e.datas=e.mainData=null,L7(t,r,e),E(r,function(n){E(t.TRANSFERABLE_METHODS,function(i){n.wrapMethod(i,Ze(Tfe,e))})}),t.wrapMethod("cloneShallow",Ze(Afe,e)),E(t.CHANGABLE_METHODS,function(n){t.wrapMethod(n,Ze(Mfe,e))}),an(r[t.dataType]===t)}function Tfe(e,t){if(Ife(this)){var r=ee({},Bi(this).datas);r[this.dataType]=t,L7(t,r,e)}else oN(t,this.dataType,Bi(this).mainData,e);return t}function Mfe(e,t){return e.struct&&e.struct.update(),t}function Afe(e,t){return E(Bi(t).datas,function(r,n){r!==t&&oN(r.cloneShallow(),n,t,e)}),t}function Lfe(e){var t=Bi(this).mainData;return e==null||t==null?t:Bi(t).datas[e]}function kfe(){var e=Bi(this).mainData;return e==null?[{data:e}]:ae(Qe(Bi(e).datas),function(t){return{type:t,data:Bi(e).datas[t]}})}function Ife(e){return Bi(e).mainData===e}function L7(e,t,r){Bi(e).datas={},E(t,function(n,i){oN(n,i,e,r)})}function oN(e,t,r,n){Bi(r).datas[t]=e,Bi(e).mainData=r,e.dataType=t,n.struct&&(e[n.structAttr]=n.struct,n.struct[n.datasAttr[t]]=e),e.getLinkedData=Lfe,e.getLinkedDataAll=kfe}var Nfe=function(){function e(t,r){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=t||"",this.hostTree=r}return e.prototype.isRemoved=function(){return this.dataIndex<0},e.prototype.eachNode=function(t,r,n){Ce(t)&&(n=r,r=t,t=null),t=t||{},ue(t)&&(t={order:t});var i=t.order||"preorder",a=this[t.attr||"children"],o;i==="preorder"&&(o=r.call(n,this));for(var s=0;!o&&sr&&(r=i.height)}this.height=r+1},e.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var r=0,n=this.children,i=n.length;r=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,r)},e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},e.prototype.getModel=function(t){if(!(this.dataIndex<0)){var r=this.hostTree,n=r.data.getItemModel(this.dataIndex);return n.getModel(t)}},e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(t,r){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,r)},e.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},e.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,r=0;r=0){var n=r.getData().tree.root,i=e.targetNode;if(ue(i)&&(i=n.getNodeById(i)),i&&n.contains(i))return{node:i};var a=e.targetNodeId;if(a!=null&&(i=n.getNodeById(a)))return{node:i}}}function k7(e){for(var t=[];e;)e=e.parentNode,e&&t.push(e);return t.reverse()}function lN(e,t){var r=k7(e);return Be(r,t)>=0}function Fb(e,t){for(var r=[];e;){var n=e.dataIndex;r.push({name:e.name,dataIndex:n,value:t.getRawValue(n)}),e=e.parentNode}return r.reverse(),r}var kc="tree",Dfe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.hasSymbolVisual=!0,r.ignoreStyleOnData=!0,r}return t.prototype.getInitialData=function(r){var n={name:r.name,children:r.data},i=r.leaves||{},a=new Ke(i,this,this.ecModel),o=sN.createTree(n,this,s);function s(h){h.wrapMethod("getItemModel",function(f,d){var g=o.getNodeByDataIndex(d);return g&&g.children.length&&g.isExpand||(f.parentModel=a),f})}var l=0;o.eachNode("preorder",function(h){h.depth>l&&(l=h.depth)});var u=r.expandAndCollapse,c=u&&r.initialTreeDepth>=0?r.initialTreeDepth:l;return o.root.eachNode("preorder",function(h){var f=h.hostTree.data.getRawDataItem(h.dataIndex);h.isExpand=f&&f.collapsed!=null?!f.collapsed:h.depth<=c}),o.data},t.prototype.getOrient=function(){var r=this.get("orient");return r==="horizontal"?r="LR":r==="vertical"&&(r="TB"),r},t.prototype.formatTooltip=function(r,n,i){for(var a=this.getData().tree,o=a.root.children[0],s=a.getNodeByDataIndex(r),l=s.getValue(),u=s.name;s&&s!==o;)u=s.parentNode.name+"."+u,s=s.parentNode;return _r("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},t.prototype.getDataParams=function(r){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treeAncestors=Fb(i,this),n.collapsed=!i.isExpand,n},t.prototype.__ownRoamView=function(){return this.coordinateSystem},t.type="series."+kc,t.layoutMode="box",t.defaultOption={z:2,coordinateSystemUsage:"box",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,roamTrigger:"global",nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:K.color.borderTint,width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t}(Tt),Efe=function(){function e(){this.parentPoint=[],this.childPoints=[]}return e}(),Rfe=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultStyle=function(){return{stroke:K.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new Efe},t.prototype.buildPath=function(r,n){var i=n.childPoints,a=i.length,o=n.parentPoint,s=i[0],l=i[a-1];if(a===1){r.moveTo(o[0],o[1]),r.lineTo(s[0],s[1]);return}var u=n.orient,c=u==="TB"||u==="BT"?0:1,h=1-c,f=he(n.forkPosition,1),d=[];d[c]=o[c],d[h]=o[h]+(l[h]-o[h])*f,r.moveTo(o[0],o[1]),r.lineTo(d[0],d[1]),r.moveTo(s[0],s[1]),d[c]=s[c],r.lineTo(d[0],d[1]),d[c]=l[c],r.lineTo(d[0],d[1]),r.lineTo(l[0],l[1]);for(var g=1;gx.x,T||(S=S-Math.PI));var A=T?"left":"right",N=s.getModel("label"),P=N.get("rotate"),I=P*(Math.PI/180),D=y.getTextContent();D&&(y.setTextConfig({position:N.get("position")||A,rotation:P==null?-S:I,origin:"center"}),D.setStyle("verticalAlign","middle"))}var O=s.get(["emphasis","focus"]),j=O==="relative"?Nf(o.getAncestorsIndices(),o.getDescendantIndices()):O==="ancestor"?o.getAncestorsIndices():O==="descendant"?o.getDescendantIndices():null;j&&(Re(r).focus=j),Ofe(i,o,c,r,g,d,m,n),r.__edge&&(r.onHoverStateChange=function(B){if(B!=="blur"){var U=o.parentNode&&e.getItemGraphicEl(o.parentNode.dataIndex);U&&U.hoverState===em||vx(r.__edge,B)}})}function Ofe(e,t,r,n,i,a,o,s){var l=t.getModel(),u=e.get("edgeShape"),c=e.get("layout"),h=e.getOrient(),f=e.get(["lineStyle","curveness"]),d=e.get("edgeForkPosition"),g=l.getModel("lineStyle").getLineStyle(),m=n.__edge;if(u==="curve")t.parentNode&&t.parentNode!==r&&(m||(m=n.__edge=new fd({shape:cA(c,h,f,i,i)})),ot(m,{shape:cA(c,h,f,a,o)},e));else if(u==="polyline"&&c==="orthogonal"&&t!==r&&t.children&&t.children.length!==0&&t.isExpand===!0){for(var y=t.children,_=[],x=0;x=0;a--)r.push(i[a])}}function Bfe(e,t){e.eachSeriesByType("tree",function(r){Ffe(r,t)})}function Ffe(e,t){var r=kr(e,t).refContainer,n=Bt(e.getBoxLayoutParams(),r);e.layoutInfo=n;var i=e.get("layout"),a=0,o=0,s=null;i==="radial"?(a=2*Math.PI,o=Math.min(n.height,n.width)/2,s=X5(function(S,T){return(S.parentNode===T.parentNode?1:2)/S.depth})):(a=n.width,o=n.height,s=X5());var l=e.getData().tree.root,u=l.children[0];if(u){mfe(l),zfe(u,yfe,s),l.hierNode.modifier=-u.hierNode.prelim,kv(u,_fe);var c=u,h=u,f=u;kv(u,function(S){var T=S.getLayout().x;Th.getLayout().x&&(h=S),S.depth>f.depth&&(f=S)});var d=c===h?1:s(c,h)/2,g=d-c.getLayout().x,m=0,y=0,_=0,x=0;if(i==="radial")m=a/(h.getLayout().x+d+g),y=o/(f.depth-1||1),kv(u,function(S){_=(S.getLayout().x+g)*m,x=(S.depth-1)*y;var T=Jv(_,x);S.setLayout({x:T.x,y:T.y,rawX:_,rawY:x},!0)});else{var w=e.getOrient();w==="RL"||w==="LR"?(y=o/(h.getLayout().x+d+g),m=a/(f.depth-1||1),kv(u,function(S){x=(S.getLayout().x+g)*y,_=w==="LR"?(S.depth-1)*m:a-(S.depth-1)*m,S.setLayout({x:_,y:x},!0)})):(w==="TB"||w==="BT")&&(m=a/(h.getLayout().x+d+g),y=o/(f.depth-1||1),kv(u,function(S){_=(S.getLayout().x+g)*m,x=w==="TB"?(S.depth-1)*y:o-(S.depth-1)*y,S.setLayout({x:_,y:x},!0)}))}}}function Vfe(e){e.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(t,r){r.eachComponent({mainType:fo,subType:kc,query:t},function(n){var i=t.dataIndex,a=n.getData().tree,o=a.getNodeByDataIndex(i);o.isExpand=!o.isExpand})}),rN(e,fo,kc)}var Gfe=Lr(kc,Hfe);function Hfe(e){e.eachSeriesByType(kc,function(t){var r=t.getData(),n=r.tree;n.eachNode(function(i){var a=i.getModel(),o=a.getModel("itemStyle").getItemStyle(),s=r.ensureUniqueItemVisual(i.dataIndex,"style");ee(s,o)})})}function Ufe(e){e.registerChartView(jfe),e.registerSeriesModel(Dfe),e.registerLayout(Bfe),e.registerVisual(Gfe),Vfe(e)}var e3=["treemapZoomToNode","treemapRender","treemapMove"];function Wfe(e){for(var t=0;t1;)a=a.parentNode;var o=MM(e.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var Zfe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.preventUsingHoverLayer=!0,r}return t.prototype.getInitialData=function(r,n){var i={name:r.name,children:r.data};P7(i);var a=r.levels||[],o=this.designatedVisualItemStyle={},s=new Ke({itemStyle:o},this,n);a=r.levels=$fe(a,n);var l=ae(a||[],function(h){return new Ke(h,s,n)},this),u=sN.createTree(i,this,c);function c(h){h.wrapMethod("getItemModel",function(f,d){var g=u.getNodeByDataIndex(d),m=g?l[g.depth]:null;return f.parentModel=m||s,f})}return u.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(r,n,i){var a=this.getData(),o=this.getRawValue(r),s=a.getName(r);return _r("nameValue",{name:s,value:o})},t.prototype.getDataParams=function(r){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treeAncestors=Fb(i,this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(r){this.layoutInfo=this.layoutInfo||{},ee(this.layoutInfo,r)},t.prototype.mapIdToIndex=function(r){var n=this._idIndexMap;n||(n=this._idIndexMap=pe(),this._idIndexMapCount=0);var i=n.get(r);return i==null&&n.set(r,i=this._idIndexMapCount++),i},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(r){r?this._viewRoot=r:r=this._viewRoot;var n=this.getRawData().tree.root;(!r||r!==n&&!n.contains(r))&&(this._viewRoot=n)},t.prototype.enableAriaDecal=function(){N7(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,coordinateSystemUsage:"box",left:K.size.l,top:K.size.xxxl,right:K.size.l,bottom:K.size.xxxl,sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.32*.32,scaleLimit:{max:5,min:.2},roam:!0,roamTrigger:"global",nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",bottom:K.size.m,emptyItemWidth:25,itemStyle:{color:K.color.backgroundShade,textStyle:{color:K.color.secondary}},emphasis:{itemStyle:{color:K.color.background}}},label:{show:!0,distance:0,padding:5,position:"inside",color:K.color.neutral00,overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:K.color.neutral00,borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},t}(Tt);function P7(e){var t=0;E(e.children,function(n){P7(n);var i=n.value;ne(i)&&(i=i[0]),t+=i});var r=e.value;ne(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),ne(e.value)?e.value[0]=r:e.value=r}function $fe(e,t){var r=kt(t.get("color")),n=kt(t.get(["aria","decal","decals"]));if(r){e=e||[];var i,a;E(e,function(s){var l=new Ke(s),u=l.get("color"),c=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(i=!0),(l.get(["itemStyle","decal"])||c&&c!=="none")&&(a=!0)});var o=e[0]||(e[0]={});return i||(o.color=r.slice()),!a&&n&&(o.decal=n.slice()),e}}var Yfe=8,t3=8,PC=5,Xfe=function(){function e(t){this.group=new Me,t.add(this.group)}return e.prototype.render=function(t,r,n,i){var a=t.getModel("breadcrumb"),o=this.group;if(o.removeAll(),!(!a.get("show")||!n)){var s=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=s.getModel("textStyle"),c=l.getModel(["itemStyle","textStyle"]),h=kr(t,r).refContainer,f={left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},d={emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]},g=Bt(f,h);this._prepare(n,d,u),this._renderContent(t,d,g,s,l,u,c,i),_b(o,f,h)}},e.prototype._prepare=function(t,r,n){for(var i=t;i;i=i.parentNode){var a=Cr(i.getModel().get("name"),""),o=n.getTextRect(a),s=Math.max(o.width+Yfe*2,r.emptyItemWidth);r.totalWidth+=s+t3,r.renderList.push({node:i,text:a,width:s})}},e.prototype._renderContent=function(t,r,n,i,a,o,s,l){for(var u=0,c=r.emptyItemWidth,h=t.get(["breadcrumb","height"]),f=r.totalWidth,d=r.renderList,g=a.getModel("itemStyle").getItemStyle(),m=d.length-1;m>=0;m--){var y=d[m],_=y.node,x=y.width,w=y.text;f>n.width&&(f-=x-c,x=c,w=null);var S=new sn({shape:{points:qfe(u,0,x,h,m===d.length-1,m===0)},style:Le(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new rt({style:Lt(o,{text:w})}),textConfig:{position:"inside"},z2:cd*1e4,onclick:Ze(l,_)});S.disableLabelAnimation=!0,S.getTextContent().ensureState("emphasis").style=Lt(s,{text:w}),S.ensureState("emphasis").style=g,Vt(S,a.get("focus"),a.get("blurScope"),a.get("disabled")),this.group.add(S),Kfe(S,t,_),u+=x+t3}},e.prototype.remove=function(){this.group.removeAll()},e}();function qfe(e,t,r,n,i,a){var o=[[i?e:e-PC,t],[e+r,t],[e+r,t+n],[i?e:e-PC,t+n]];return!a&&o.splice(2,0,[e+r+PC,t+n/2]),!i&&o.push([e,t+n/2]),o}function Kfe(e,t,r){Re(e).eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:r&&r.dataIndex,name:r&&r.name},treePathInfo:r&&Fb(r,t)}}var Jfe=function(){function e(){this._storage=[],this._elExistsMap={}}return e.prototype.add=function(t,r,n,i,a){return this._elExistsMap[t.id]?!1:(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:r,duration:n,delay:i,easing:a}),!0)},e.prototype.finished=function(t){return this._finishedCallback=t,this},e.prototype.start=function(){for(var t=this,r=this._storage.length,n=function(){r--,r<=0&&(t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},i=0,a=this._storage.length;i=0;l--){var u=i[n==="asc"?o-l-1:l].getValue();u/r*ts[1]&&(s[1]=u)})),{sum:n,dataExtent:s}}function lde(e,t,r){for(var n=0,i=1/0,a=0,o=void 0,s=e.length;an&&(n=o));var l=e.area*e.area,u=t*t*r;return l?Pg(u*n/l,l/(u*i)):1/0}function r3(e,t,r,n,i){var a=t===r.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=r[s[a]],c=t?e.area/t:0;(i||c>r[l[o]])&&(c=r[l[o]]);for(var h=0,f=e.length;hag&&(c=ag),i=l}ci3||Math.abs(r.dy)>i3)){var n=this.seriesModel.getData().tree.root;if(!n)return;var i=n.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+r.dx,y:i.y+r.dy,width:i.width,height:i.height}})}},t.prototype._onZoom=function(r){var n=r.originX,i=r.originY,a=r.scale,o=this.seriesModel;if(this._state!=="animating"){var s=o.getData().tree.root;if(!s)return;var l=s.getLayout();if(!l)return;var u=new Ae(l.x,l.y,l.width,l.height),c=o.layoutInfo,h=O7(c,l),f=h*a;f=z7(f,o);var d=f/h;n-=c.x,i-=c.y;var g=Ft();_a(g,g,[-n,-i]),J1(g,g,[d,d]),_a(g,g,[n,i]),u.applyTransform(g),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:u.x,y:u.y,width:u.width,height:u.height}})}},t.prototype._initEvents=function(r){var n=this;r.on("click",function(i){if(n._state==="ready"){var a=n.seriesModel.get("nodeClick",!0);if(a){var o=n.findTarget(i.offsetX,i.offsetY);if(o){var s=o.node;if(s.getLayout().isLeafRoot)n._rootToNode(o);else if(a==="zoomToNode")n._zoomToNode(o);else if(a==="link"){var l=s.hostTree.data.getItemModel(s.dataIndex),u=l.get("link",!0),c=l.get("target",!0)||"blank";u&&xx(u,c)}}}}},this)},t.prototype._renderBreadcrumb=function(r,n,i){var a=this;i||(i=r.get("leafDepth",!0)!=null?{node:r.getViewRoot()}:this.findTarget(n.getWidth()/2,n.getHeight()/2),i||(i={node:r.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new Xfe(this.group))).render(r,n,i.node,function(o){a._state!=="animating"&&(lN(r.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=Iv(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(r){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:r.node})},t.prototype._rootToNode=function(r){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:r.node})},t.prototype.findTarget=function(r,n){var i,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(o){var s=this._storage.background[o.getRawIndex()];if(s){var l=s.transformCoordToLocal(r,n),u=s.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)i={node:o,offsetX:l[0],offsetY:l[1]};else return!1}},this),i},t.type="treemap",t}(xt);function Iv(){return{nodeGroup:[],background:[],content:[]}}function pde(e,t,r,n,i,a,o,s,l,u){if(!o)return;var c=o.getLayout(),h=e.getData(),f=o.getModel();if(h.setItemGraphicEl(o.dataIndex,null),!c||!c.isInView)return;var d=c.width,g=c.height,m=c.borderWidth,y=c.invisible,_=o.getRawIndex(),x=s&&s.getRawIndex(),w=o.viewChildren,S=c.upperHeight,T=w&&w.length,M=f.getModel("itemStyle"),A=f.getModel(["emphasis","itemStyle"]),N=f.getModel(["blur","itemStyle"]),P=f.getModel(["select","itemStyle"]),I=M.get("borderRadius")||0,D=oe("nodeGroup",hA);if(!D)return;if(l.add(D),D.x=c.x||0,D.y=c.y||0,D.markRedraw(),Qx(D).nodeWidth=d,Qx(D).nodeHeight=g,c.isAboveViewRoot)return D;var O=oe("background",n3,u,fde);O&&W(D,O,T&&c.upperLabelHeight);var j=f.getModel("emphasis"),B=j.get("focus"),U=j.get("blurScope"),H=j.get("disabled"),V=B==="ancestor"?o.getAncestorsIndices():B==="descendant"?o.getDescendantIndices():B;if(T)lg(D)&&Bu(D,!1),O&&(Bu(O,!H),h.setItemGraphicEl(o.dataIndex,O),pM(O,V,U));else{var z=oe("content",n3,u,dde);z&&Z(D,z),O.disableMorphing=!0,O&&lg(O)&&Bu(O,!1),Bu(D,!H),h.setItemGraphicEl(o.dataIndex,D);var $=f.getShallow("cursor");$&&z.attr("cursor",$),pM(D,V,U)}return D;function W(be,ve,Ne){var _e=Re(ve);if(_e.dataIndex=o.dataIndex,_e.seriesIndex=e.seriesIndex,ve.setShape({x:0,y:0,width:d,height:g,r:I}),y)X(ve);else{ve.invisible=!1;var ke=o.getVisual("style"),ct=ke.stroke,Fe=s3(M);Fe.fill=ct;var tt=Mu(A);tt.fill=A.get("borderColor");var ht=Mu(N);ht.fill=N.get("borderColor");var jt=Mu(P);if(jt.fill=P.get("borderColor"),Ne){var bt=d-2*m;re(ve,ct,ke.opacity,{x:m,y:0,width:bt,height:S})}else ve.removeTextContent();ve.setStyle(Fe),ve.ensureState("emphasis").style=tt,ve.ensureState("blur").style=ht,ve.ensureState("select").style=jt,pc(ve)}be.add(ve)}function Z(be,ve){var Ne=Re(ve);Ne.dataIndex=o.dataIndex,Ne.seriesIndex=e.seriesIndex;var _e=Math.max(d-2*m,0),ke=Math.max(g-2*m,0);if(ve.culling=!0,ve.setShape({x:m,y:m,width:_e,height:ke,r:I}),y)X(ve);else{ve.invisible=!1;var ct=o.getVisual("style"),Fe=ct.fill,tt=s3(M);tt.fill=Fe,tt.decal=ct.decal;var ht=Mu(A),jt=Mu(N),bt=Mu(P);re(ve,Fe,ct.opacity,null),ve.setStyle(tt),ve.ensureState("emphasis").style=ht,ve.ensureState("blur").style=jt,ve.ensureState("select").style=bt,pc(ve)}be.add(ve)}function X(be){!be.invisible&&a.push(be)}function re(be,ve,Ne,_e){var ke=f.getModel(_e?o3:a3),ct=Cr(f.get("name"),null),Fe=ke.getShallow("show");jr(be,Ar(f,_e?o3:a3),{defaultText:Fe?ct:null,inheritColor:ve,defaultOpacity:Ne,labelFetcher:e,labelDataIndex:o.dataIndex});var tt=be.getTextContent();if(tt){var ht=tt.style,jt=qg(ht.padding||0);_e&&(be.setTextConfig({layoutRect:_e}),tt.disableLabelLayout=!0),tt.beforeUpdate=function(){var ar=Math.max((_e?_e.width:be.shape.width)-jt[1]-jt[3],0),On=Math.max((_e?_e.height:be.shape.height)-jt[0]-jt[2],0);(ht.width!==ar||ht.height!==On)&&tt.setStyle({width:ar,height:On})},ht.truncateMinChar=2,ht.lineOverflow="truncate",J(ht,_e,c);var bt=tt.getState("emphasis");J(bt?bt.style:null,_e,c)}}function J(be,ve,Ne){var _e=be?be.text:null;if(!ve&&Ne.isLeafRoot&&_e!=null){var ke=e.get("drillDownIcon",!0);be.text=ke?ke+" "+_e:_e}}function oe(be,ve,Ne,_e){var ke=x!=null&&r[be][x],ct=i[be];return ke?(r[be][x]=null,le(ct,ke)):y||(ke=new ve,ke instanceof Zi&&(ke.z2=gde(Ne,_e)),De(ct,ke)),t[be][_]=ke}function le(be,ve){var Ne=be[_]={};ve instanceof hA?(Ne.oldX=ve.x,Ne.oldY=ve.y):Ne.oldShape=ee({},ve.shape)}function De(be,ve){var Ne=be[_]={},_e=o.parentNode,ke=ve instanceof Me;if(_e&&(!n||n.direction==="drillDown")){var ct=0,Fe=0,tt=i.background[_e.getRawIndex()];!n&&tt&&tt.oldShape&&(ct=tt.oldShape.width,Fe=tt.oldShape.height),ke?(Ne.oldX=0,Ne.oldY=Fe):Ne.oldShape={x:ct,y:Fe,width:0,height:0}}Ne.fadein=!ke}}function gde(e,t){return e*hde+t}var Dg=E,mde=Ie,e1=-1,Rr=function(){function e(t){var r=t.mappingMethod,n=t.type,i=this.option=Se(t);this.type=n,this.mappingMethod=r,this._normalizeData=xde[r];var a=e.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(DC(i),yde(i)):r==="category"?i.categories?_de(i):DC(i,!0):(an(r!=="linear"||i.dataExtent),DC(i))}return e.prototype.mapValueToVisual=function(t){var r=this._normalizeData(t);return this._normalizedToVisual(r,t)},e.prototype.getNormalizer=function(){return de(this._normalizeData,this)},e.listVisualTypes=function(){return Qe(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(t,r,n){Ie(t)?E(t,r,n):r.call(n,t)},e.mapVisual=function(t,r,n){var i,a=ne(t)?[]:Ie(t)?{}:(i=!0,null);return e.eachVisual(t,function(o,s){var l=r.call(n,o,s);i?a=l:a[s]=l}),a},e.retrieveVisuals=function(t){var r={},n;return t&&Dg(e.visualHandlers,function(i,a){t.hasOwnProperty(a)&&(r[a]=t[a],n=!0)}),n?r:null},e.prepareVisualTypes=function(t){if(ne(t))t=t.slice();else if(mde(t)){var r=[];Dg(t,function(n,i){r.push(i)}),t=r}else return[];return t.sort(function(n,i){return i==="color"&&n!=="color"&&n.indexOf("color")===0?1:-1}),t},e.dependsOn=function(t,r){return r==="color"?!!(t&&t.indexOf(r)===0):t===r},e.findPieceIndex=function(t,r,n){for(var i,a=1/0,o=0,s=r.length;o=0;a--)n[a]==null&&(delete r[t[a]],t.pop())}function DC(e,t){var r=e.visual,n=[];Ie(r)?Dg(r,function(a){n.push(a)}):r!=null&&n.push(r);var i={color:1,symbol:1};!t&&n.length===1&&!i.hasOwnProperty(e.type)&&(n[1]=n[0]),B7(e,n)}function v0(e){return{applyVisual:function(t,r,n){var i=this.mapValueToVisual(t);n("color",e(r("color"),i))},_normalizedToVisual:fA([0,1])}}function l3(e){var t=this.option.visual;return t[Math.round(ut(e,[0,1],[0,t.length-1],!0))]||{}}function Nv(e){return function(t,r,n){n(e,this.mapValueToVisual(t))}}function Qv(e){var t=this.option.visual;return t[this.option.loop&&e!==e1?e%t.length:e]}function Au(){return this.option.visual[0]}function fA(e){return{linear:function(t){return ut(t,e,this.option.visual,!0)},category:Qv,piecewise:function(t,r){var n=dA.call(this,r);return n==null&&(n=ut(t,e,this.option.visual,!0)),n},fixed:Au}}function dA(e){var t=this.option,r=t.pieceList;if(t.hasSpecialVisual){var n=Rr.findPieceIndex(e,r),i=r[n];if(i&&i.visual)return i.visual[this.type]}}function B7(e,t){return e.visual=t,e.type==="color"&&(e.parsedVisual=ae(t,function(r){var n=yn(r);return n||[0,0,0,1]})),t}var xde={linear:function(e){return ut(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,r=Rr.findPieceIndex(e,t,!0);if(r!=null)return ut(r,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return t??e1},fixed:Yt};function p0(e,t,r){return e?t<=r:t=r.length||m===r[m.depth]){var _=Mde(i,l,m,y,g,n);V7(m,_,r,n)}})}}}function Sde(e,t,r){var n=ee({},t),i=r.designatedVisualItemStyle;return E(["color","colorAlpha","colorSaturation"],function(a){i[a]=t[a];var o=e.get(a);i[a]=null,o!=null&&(n[a]=o)}),n}function u3(e){var t=EC(e,"color");if(t){var r=EC(e,"colorAlpha"),n=EC(e,"colorSaturation");return n&&(t=qo(t,null,null,n)),r&&(t=tg(t,r)),t}}function Cde(e,t){return t!=null?qo(t,null,null,e):null}function EC(e,t){var r=e[t];if(r!=null&&r!=="none")return r}function Tde(e,t,r,n,i,a){if(!(!a||!a.length)){var o=RC(t,"color")||i.color!=null&&i.color!=="none"&&(RC(t,"colorAlpha")||RC(t,"colorSaturation"));if(o){var s=t.get("visualMin"),l=t.get("visualMax"),u=r.dataExtent.slice();s!=null&&su[1]&&(u[1]=l);var c=t.get("colorMappingBy"),h={type:o.name,dataExtent:u,visual:o.range};h.type==="color"&&(c==="index"||c==="id")?(h.mappingMethod="category",h.loop=!0):h.mappingMethod="linear";var f=new Rr(h);return F7(f).drColorMappingBy=c,f}}}function RC(e,t){var r=e.get(t);return ne(r)&&r.length?{name:t,range:r}:null}function Mde(e,t,r,n,i,a){var o=ee({},t);if(i){var s=i.type,l=s==="color"&&F7(i).drColorMappingBy,u=l==="index"?n:l==="id"?a.mapIdToIndex(r.getId()):r.getValue(e.get("visualDimension"));o[s]=i.mapValueToVisual(u)}return o}function Ade(e){e.registerSeriesModel(Zfe),e.registerChartView(vde),e.registerVisual(wde),e.registerLayout(nde),Wfe(e)}function Ch(e){return"_EC_"+e}var Lde=function(){function e(t){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=t||!1}return e.prototype.isDirected=function(){return this._directed},e.prototype.addNode=function(t,r){t=t==null?""+r:""+t;var n=this._nodesMap;if(!n[Ch(t)]){var i=new Lu(t,r);return i.hostGraph=this,this.nodes.push(i),n[Ch(t)]=i,i}},e.prototype.getNodeByIndex=function(t){var r=this.data.getRawIndex(t);return this.nodes[r]},e.prototype.getNodeById=function(t){return this._nodesMap[Ch(t)]},e.prototype.addEdge=function(t,r,n){var i=this._nodesMap,a=this._edgesMap;if(nt(t)&&(t=this.nodes[t]),nt(r)&&(r=this.nodes[r]),t instanceof Lu||(t=i[Ch(t)]),r instanceof Lu||(r=i[Ch(r)]),!(!t||!r)){var o=t.id+"-"+r.id,s=new G7(t,r,n);return s.hostGraph=this,this._directed&&(t.outEdges.push(s),r.inEdges.push(s)),t.edges.push(s),t!==r&&r.edges.push(s),this.edges.push(s),a[o]=s,s}},e.prototype.getEdgeByIndex=function(t){var r=this.edgeData.getRawIndex(t);return this.edges[r]},e.prototype.getEdge=function(t,r){t instanceof Lu&&(t=t.id),r instanceof Lu&&(r=r.id);var n=this._edgesMap;return this._directed?n[t+"-"+r]:n[t+"-"+r]||n[r+"-"+t]},e.prototype.eachNode=function(t,r){for(var n=this.nodes,i=n.length,a=0;a=0&&t.call(r,n[a],a)},e.prototype.eachEdge=function(t,r){for(var n=this.edges,i=n.length,a=0;a=0&&n[a].node1.dataIndex>=0&&n[a].node2.dataIndex>=0&&t.call(r,n[a],a)},e.prototype.breadthFirstTraverse=function(t,r,n,i){if(r instanceof Lu||(r=this._nodesMap[Ch(r)]),!!r){for(var a=n==="out"?"outEdges":n==="in"?"inEdges":"edges",o=0;o=0&&l.node2.dataIndex>=0});for(var a=0,o=i.length;a=0&&!t.hasKey(g)&&(t.set(g,!0),o.push(d.node1))}for(l=0;l=0&&!t.hasKey(w)&&(t.set(w,!0),s.push(x.node2))}}}return{edge:t.keys(),node:r.keys()}},e}(),G7=function(){function e(t,r,n){this.dataIndex=-1,this.node1=t,this.node2=r,this.dataIndex=n??-1}return e.prototype.getModel=function(t){if(!(this.dataIndex<0)){var r=this.hostGraph,n=r.edgeData.getItemModel(this.dataIndex);return n.getModel(t)}},e.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},e.prototype.getTrajectoryDataIndices=function(){var t=pe(),r=pe();t.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],a=0;a=0&&!t.hasKey(h)&&(t.set(h,!0),n.push(c.node1))}for(a=0;a=0&&!t.hasKey(m)&&(t.set(m,!0),i.push(g.node2))}return{edge:t.keys(),node:r.keys()}},e}();function H7(e,t){return{getValue:function(r){var n=this[e][t];return n.getStore().get(n.getDimensionIndex(r||"value"),this.dataIndex)},setVisual:function(r,n){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,r,n)},getVisual:function(r){return this[e][t].getItemVisual(this.dataIndex,r)},setLayout:function(r,n){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,r,n)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}vr(Lu,H7("hostGraph","data"));vr(G7,H7("hostGraph","edgeData"));function cN(e,t,r,n,i){for(var a=new Lde(n),o=0;o "+f)),u++)}var d=r.get("coordinateSystem"),g;if(d==="cartesian2d"||d==="polar"||d==="matrix")g=wo(e,r);else{var m=yd.get(d),y=m?m.dimensions||[]:[];Be(y,"value")<0&&y.concat(["value"]);var _=wd(e,{coordDimensions:y,encodeDefine:r.getEncode()}).dimensions;g=new _n(_,r),g.initData(e)}var x=new _n(["value"],r);return x.initData(l,s),i&&i(g,x),A7({mainData:g,struct:a,structAttr:"graph",datas:{node:g,edge:x},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var vA="-->",Vb=function(e){return e.get("autoCurveness")||null},U7=function(e,t){var r=Vb(e),n=20,i=[];if(nt(r))n=r;else if(ne(r)){e.__curvenessList=r;return}t>n&&(n=t);var a=n%2?n+2:n+3;i=[];for(var o=0;o "),value:o.value,noValue:o.value==null})}var h=yU({series:this,dataIndex:r,multipleSeries:n});return h},t.prototype._updateCategoriesData=function(){var r=ae(this.option.categories||[],function(i){return i.value!=null?i:ee({value:0},i)}),n=new _n(["value"],this);n.initData(r),this._categoriesData=n,this._categoriesModels=n.mapArray(function(i){return n.getItemModel(i)})},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},t.prototype.__ownRoamView=function(){var r=this.coordinateSystem;return f7(r)&&r},t.type="series."+En,t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:K.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:K.color.primary}}},t}(Tt);function g0(e){return e instanceof Array||(e=[e,e]),e}var Ede=Lr(En,Rde);function Rde(e){e.eachSeriesByType(En,function(t){var r=t.getGraph(),n=t.getEdgeData(),i=g0(t.get("edgeSymbol")),a=g0(t.get("edgeSymbolSize"));n.setVisual("fromSymbol",i&&i[0]),n.setVisual("toSymbol",i&&i[1]),n.setVisual("fromSymbolSize",a&&a[0]),n.setVisual("toSymbolSize",a&&a[1]),n.setVisual("style",t.getModel("lineStyle").getLineStyle()),n.each(function(o){var s=n.getItemModel(o),l=r.getEdgeByIndex(o),u=g0(s.getShallow("symbol",!0)),c=g0(s.getShallow("symbolSize",!0)),h=s.getModel("lineStyle").getLineStyle(),f=n.ensureUniqueItemVisual(o,"style");switch(ee(f,h),f.stroke){case"source":{var d=l.node1.getVisual("style");f.stroke=d&&d.fill;break}case"target":{var d=l.node2.getVisual("style");f.stroke=d&&d.fill;break}}u[0]&&l.setVisual("fromSymbol",u[0]),u[1]&&l.setVisual("toSymbol",u[1]),c[0]&&l.setVisual("fromSymbolSize",c[0]),c[1]&&l.setVisual("toSymbolSize",c[1])})})}function Z7(e){var t=e.coordinateSystem;if(!(t&&t.type!=="view")){var r=e.getGraph();r.eachNode(function(n){var i=n.getModel();n.setLayout([+i.get("x"),+i.get("y")])}),fN(r,e)}}function fN(e,t){e.eachEdge(function(r,n){var i=qn(r.getModel().get(["lineStyle","curveness"]),-hN(r,t,n,!0),0),a=qa(r.node1.getLayout()),o=qa(r.node2.getLayout()),s=[a,o];+i&&s.push([(a[0]+o[0])/2-(a[1]-o[1])*i,(a[1]+o[1])/2-(o[0]-a[0])*i]),r.setLayout(s)})}var jde=Lr(En,Ode);function Ode(e,t){e.eachSeriesByType(En,function(r){var n=r.get("layout"),i=r.coordinateSystem;if(i&&i.type!=="view"){var a=r.getData(),o=[];E(i.dimensions,function(f){o=o.concat(a.mapDimensionsAll(f))});for(var s=0;s0&&(T[0]=-T[0],T[1]=-T[1]);var A=S[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var N=-Math.atan2(S[1],S[0]);h[0].8?"left":f[0]<-.8?"right":"center",m=f[1]>.8?"top":f[1]<-.8?"bottom":"middle";break;case"start":a.x=-f[0]*_+c[0],a.y=-f[1]*x+c[1],g=f[0]>.8?"right":f[0]<-.8?"left":"center",m=f[1]>.8?"bottom":f[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=_*A+c[0],a.y=c[1]+P,g=S[0]<0?"right":"left",a.originX=-_*A,a.originY=-P;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=M[0],a.y=M[1]+P,g="center",a.originY=-P;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-_*A+h[0],a.y=h[1]+P,g=S[0]>=0?"right":"left",a.originX=_*A,a.originY=-P;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||m,align:a.__align||g})}},t}(Me),pN=function(){function e(t){this.group=new Me,this._LineCtor=t||vN}return e.prototype.updateData=function(t){var r=this;this._progressiveEls=null;var n=this,i=n.group,a=n._lineData;n._lineData=t,a||i.removeAll();var o=p3(t);t.diff(a).add(function(s){r._doAdd(t,s,o)}).update(function(s,l){r._doUpdate(a,t,l,s,o)}).remove(function(s){i.remove(a.getItemGraphicEl(s))}).execute()},e.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl(function(r,n){r.updateLayout(t,n)},this)},e.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=p3(t),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r,n){this._progressiveEls=[];function i(l){!l.isGroup&&!$de(l)&&(l.incremental=n,l.ensureState("emphasis").hoverLayer=vd)}for(var a=t.start;a0}function p3(e){var t=e.hostModel,r=t.getModel("emphasis");return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:r.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:r.get("disabled"),blurScope:r.get("blurScope"),focus:r.get("focus"),labelStatesModels:Ar(t)}}function g3(e){return isNaN(e[0])||isNaN(e[1])}function FC(e){return e&&!g3(e[0])&&!g3(e[1])}var VC=[],GC=[],HC=[],Mh=Gr,UC=cl,m3=Math.abs;function y3(e,t,r){for(var n=e[0],i=e[1],a=e[2],o=1/0,s,l=r*r,u=.1,c=.1;c<=.9;c+=.1){VC[0]=Mh(n[0],i[0],a[0],c),VC[1]=Mh(n[1],i[1],a[1],c);var h=m3(UC(VC,t)-l);h=0?s=s+u:s=s-u:g>=0?s=s-u:s=s+u}return s}function WC(e,t){var r=[],n=Qp,i=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge(function(s,l){var u=s.getLayout(),c=s.getVisual("fromSymbol"),h=s.getVisual("toSymbol");u.__original||(u.__original=[qa(u[0]),qa(u[1])],u[2]&&u.__original.push(qa(u[2])));var f=u.__original;if(u[2]!=null){if(Kr(i[0],f[0]),Kr(i[1],f[2]),Kr(i[2],f[1]),c&&c!=="none"){var d=tp(s.node1),g=y3(i,f[0],d*t);n(i[0][0],i[1][0],i[2][0],g,r),i[0][0]=r[3],i[1][0]=r[4],n(i[0][1],i[1][1],i[2][1],g,r),i[0][1]=r[3],i[1][1]=r[4]}if(h&&h!=="none"){var d=tp(s.node2),g=y3(i,f[1],d*t);n(i[0][0],i[1][0],i[2][0],g,r),i[1][0]=r[1],i[2][0]=r[2],n(i[0][1],i[1][1],i[2][1],g,r),i[1][1]=r[1],i[2][1]=r[2]}Kr(u[0],i[0]),Kr(u[1],i[2]),Kr(u[2],i[1])}else{if(Kr(a[0],f[0]),Kr(a[1],f[1]),Ys(o,a[1],a[0]),Oc(o,o),c&&c!=="none"){var d=tp(s.node1);K_(a[0],a[0],o,d*t)}if(h&&h!=="none"){var d=tp(s.node2);K_(a[1],a[1],o,-d*t)}Kr(u[0],a[0]),Kr(u[1],a[1])}})}var q7=He();function Yde(e){if(e)return q7(e).bridge}function _3(e,t){e&&(q7(e).bridge=t)}var Xde=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=En,r}return t.prototype.init=function(r,n){var i=new dm,a=new pN,o=this.group,s=new Me;this._controller=new qc(n.getZr()),s.add(i.group),s.add(a.group),o.add(s),this._symbolDraw=i,this._lineDraw=a,this._mainGroup=s,this._firstRender=!0},t.prototype.render=function(r,n,i){var a=this,o=qx(r),s=!1;this._model=r,this._api=i,this._active=!0;var l=this._mainGroup,u=this._getThumbnailInfo();u&&u.bridge.reset(i);var c=this._symbolDraw,h=this._lineDraw;o&&Al(l,go,o,this._firstRender?null:r),WC(r.getGraph(),ep(r));var f=r.getData();c.updateData(f);var d=r.getEdgeData();h.updateData(d),this._updateNodeAndLinkScale(),o&&Bb(r,i,this._controller,function(S,T,M){return r.coordinateSystem.containPoint([T,M])},null),clearTimeout(this._layoutTimeout);var g=r.forceLayout,m=r.get(["force","layoutAnimation"]);g&&(s=!0,this._startForceLayoutIteration(g,i,m));var y=r.get("layout");f.graph.eachNode(function(S){var T=S.dataIndex,M=S.getGraphicEl(),A=S.getModel();if(M){M.off("drag").off("dragend");var N=A.get("draggable");N&&M.on("drag",function(I){switch(y){case"force":g.warmUp(),!a._layouting&&a._startForceLayoutIteration(g,i,m),g.setFixed(T),f.setItemLayout(T,[M.x,M.y]);break;case"circular":f.setItemLayout(T,[M.x,M.y]),S.setLayout({fixed:!0},!0),dN(r,"symbolSize",S,[I.offsetX,I.offsetY]),a.updateLayout(r);break;case"none":default:f.setItemLayout(T,[M.x,M.y]),fN(r.getGraph(),r),a.updateLayout(r);break}}).on("dragend",function(){g&&g.setUnfixed(T)}),M.setDraggable(N,!!A.get("cursor"));var P=A.get(["emphasis","focus"]);P==="adjacency"&&(Re(M).focus=S.getAdjacentDataIndices())}}),f.graph.eachEdge(function(S){var T=S.getGraphicEl(),M=S.getModel().get(["emphasis","focus"]);T&&M==="adjacency"&&(Re(T).focus={edge:[S.dataIndex],node:[S.node1.dataIndex,S.node2.dataIndex]})});var _=r.get("layout")==="circular"&&r.get(["circular","rotateLabel"]),x=f.getLayout("cx"),w=f.getLayout("cy");f.graph.eachNode(function(S){$7(S,_,x,w)}),this._firstRender=!1,s||this._renderThumbnail(r,i,this._symbolDraw,this._lineDraw)},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose()},t.prototype._startForceLayoutIteration=function(r,n,i){var a=this,o=!1;(function s(){r.step(function(l){a.updateLayout(a._model),(l||!o)&&(o=!0,a._renderThumbnail(a._model,n,a._symbolDraw,a._lineDraw)),(a._layouting=!l)&&(i?a._layoutTimeout=setTimeout(s,16):s())})})()},t.prototype.__updateOnOwnRoam=function(r,n,i){var a=qx(n);!this._active||!a||(Al(this._mainGroup,go,a,null),x7(r)&&(this._updateNodeAndLinkScale(),WC(n.getGraph(),ep(n)),this._lineDraw.updateLayout(),i.updateLabelLayout()),this._updateThumbnailWindow())},t.prototype._updateNodeAndLinkScale=function(){var r=this._model,n=r.getData(),i=ep(r);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},t.prototype.updateLayout=function(r){this._active&&(WC(r.getGraph(),ep(r)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},t.prototype.remove=function(){this._active=!1,clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove(),this._controller&&this._controller.disable()},t.prototype._getThumbnailInfo=function(){var r=this._model,n=r.coordinateSystem;if(n.type==="view"){var i=Yde(r);if(i)return{bridge:i,coordSys:n}}},t.prototype._updateThumbnailWindow=function(){var r=this._getThumbnailInfo();r&&r.bridge.updateWindow(Yx(null,r.coordSys),this._api)},t.prototype._renderThumbnail=function(r,n,i,a){var o=this._getThumbnailInfo();if(o){var s=new Me,l=i.group.children(),u=a.group.children(),c=new Me,h=new Me;s.add(h),s.add(c);for(var f=0;f "),value:a.value,noValue:a.value==null})}return _r("nameValue",{name:a.name,value:a.value,noValue:a.value==null})},t.prototype.getDataParams=function(r,n){var i=e.prototype.getDataParams.call(this,r,n);if(n==="node"){var a=this.getData(),o=this.getGraph().getNodeByIndex(r);if(i.name==null&&(i.name=a.getName(r)),i.value==null){var s=o.getLayout().value;i.value=s}}return i},t.type="series."+Rg,t.defaultOption={z:2,coordinateSystem:"none",legendHoverLink:!0,colorBy:"data",left:0,top:0,right:0,bottom:0,width:null,height:null,center:["50%","50%"],radius:["70%","80%"],clockwise:!0,startAngle:90,endAngle:"auto",minAngle:0,padAngle:3,itemStyle:{borderRadius:[0,0,5,5]},lineStyle:{width:0,color:"source",opacity:.2},label:{show:!0,position:"outside",distance:5},emphasis:{focus:"adjacency",lineStyle:{opacity:.5}}},t}(Tt),x3=function(e){q(t,e);function t(r,n,i){var a=e.call(this)||this;Re(a).dataType="node",a.z2=2;var o=new rt;return a.setTextContent(o),a.updateData(r,n,i,!0),a}return t.prototype.updateData=function(r,n,i,a){var o=this,s=r.graph.getNodeByIndex(n),l=r.hostModel,u=s.getModel(),c=u.getModel("emphasis"),h=r.getItemLayout(n),f=ee($a(u.getModel("itemStyle"),h,!0),h),d=this;if(isNaN(f.startAngle)){d.setShape(f);return}a?d.setShape(f):ot(d,{shape:f},l,n);var g=ee($a(u.getModel("itemStyle"),h,!0),h);o.setShape(g),o.useStyle(r.getItemVisual(n,"style")),Mr(o,u),this._updateLabel(l,u,s),r.setItemGraphicEl(n,d),Mr(d,u,"itemStyle");var m=c.get("focus");Vt(this,m==="adjacency"?s.getAdjacentDataIndices():m,c.get("blurScope"),c.get("disabled"))},t.prototype._updateLabel=function(r,n,i){var a=this.getTextContent(),o=i.getLayout(),s=(o.startAngle+o.endAngle)/2,l=Math.cos(s),u=Math.sin(s),c=n.getModel("label");a.ignore=!c.get("show");var h=Ar(n),f=i.getVisual("style");jr(a,h,{labelFetcher:{getFormattedLabel:function(x,w,S,T,M,A){return r.getFormattedLabel(x,w,"node",T,qn(M,h.normal&&h.normal.get("formatter"),n.get("name")),A)}},labelDataIndex:i.dataIndex,defaultText:i.dataIndex+"",inheritColor:f.fill,defaultOpacity:f.opacity,defaultOutsidePosition:"startArc"});var d=c.get("position")||"outside",g=c.get("distance")||0,m;d==="outside"?m=o.r+g:m=(o.r+o.r0)/2,this.textConfig={inside:d!=="outside"};var y=d!=="outside"?c.get("align")||"center":l>0?"left":"right",_=d!=="outside"?c.get("verticalAlign")||"middle":u>0?"top":"bottom";a.attr({x:l*m+o.cx,y:u*m+o.cy,rotation:0,style:{align:y,verticalAlign:_}})},t}(on),rve=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;return Re(o).dataType="edge",o.updateData(r,n,i,a,!0),o}return t.prototype.buildPath=function(r,n){r.moveTo(n.s1[0],n.s1[1]);var i=.7,a=n.clockwise;r.arc(n.cx,n.cy,n.r,n.sStartAngle,n.sEndAngle,!a),r.bezierCurveTo((n.cx-n.s2[0])*i+n.s2[0],(n.cy-n.s2[1])*i+n.s2[1],(n.cx-n.t1[0])*i+n.t1[0],(n.cy-n.t1[1])*i+n.t1[1],n.t1[0],n.t1[1]),r.arc(n.cx,n.cy,n.r,n.tStartAngle,n.tEndAngle,!a),r.bezierCurveTo((n.cx-n.t2[0])*i+n.t2[0],(n.cy-n.t2[1])*i+n.t2[1],(n.cx-n.s1[0])*i+n.s1[0],(n.cy-n.s1[1])*i+n.s1[1],n.s1[0],n.s1[1]),r.closePath()},t.prototype.updateData=function(r,n,i,a,o){var s=r.hostModel,l=n.graph.getEdgeByIndex(i),u=l.getLayout(),c=l.node1.getModel(),h=n.getItemModel(l.dataIndex),f=h.getModel("lineStyle"),d=h.getModel("emphasis"),g=d.get("focus"),m=ee($a(c.getModel("itemStyle"),u,!0),u),y=this;if(isNaN(m.sStartAngle)||isNaN(m.tStartAngle)){y.setShape(m);return}o?(y.setShape(m),b3(y,l,r,f)):($i(y),b3(y,l,r,f),ot(y,{shape:m},s,i)),Vt(this,g==="adjacency"?l.getAdjacentDataIndices():g,d.get("blurScope"),d.get("disabled")),Mr(y,h,"lineStyle"),n.setItemGraphicEl(l.dataIndex,y)},t}(Je);function b3(e,t,r,n){var i=t.node1,a=t.node2,o=e.style;e.setStyle(n.getLineStyle());var s=n.get("color");switch(s){case"source":o.fill=r.getItemVisual(i.dataIndex,"style").fill,o.decal=i.getVisual("style").decal;break;case"target":o.fill=r.getItemVisual(a.dataIndex,"style").fill,o.decal=a.getVisual("style").decal;break;case"gradient":var l=r.getItemVisual(i.dataIndex,"style").fill,u=r.getItemVisual(a.dataIndex,"style").fill;if(ue(l)&&ue(u)){var c=e.shape,h=(c.s1[0]+c.s2[0])/2,f=(c.s1[1]+c.s2[1])/2,d=(c.t1[0]+c.t2[0])/2,g=(c.t1[1]+c.t2[1])/2;o.fill=new Gc(h,f,d,g,[{offset:0,color:l},{offset:1,color:u}],!0)}break}}var nve=Math.PI/180,ive=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=Rg,r}return t.prototype.init=function(r,n){},t.prototype.render=function(r,n,i){var a=r.getData(),o=this._data,s=this.group,l=-r.get("startAngle")*nve;if(a.diff(o).add(function(c){var h=a.getItemLayout(c);if(h){var f=new x3(a,c,l);Re(f).dataIndex=c,s.add(f)}}).update(function(c,h){var f=o.getItemGraphicEl(h),d=a.getItemLayout(c);if(!d){f&&Ko(f,r,h);return}f?f.updateData(a,c,l):f=new x3(a,c,l),s.add(f)}).remove(function(c){var h=o.getItemGraphicEl(c);h&&Ko(h,r,c)}).execute(),!o){var u=r.get("center");this.group.scaleX=.01,this.group.scaleY=.01,this.group.originX=he(u[0],i.getWidth()),this.group.originY=he(u[1],i.getHeight()),Rt(this.group,{scaleX:1,scaleY:1},r)}this._data=a,this.renderEdges(r,l)},t.prototype.renderEdges=function(r,n){var i=r.getData(),a=r.getEdgeData(),o=this._edgeData,s=this.group;a.diff(o).add(function(l){var u=new rve(i,a,l,n);Re(u).dataIndex=l,s.add(u)}).update(function(l,u){var c=o.getItemGraphicEl(u);c.updateData(i,a,l,n),s.add(c)}).remove(function(l){var u=o.getItemGraphicEl(l);u&&Ko(u,r,l)}).execute(),this._edgeData=a},t.prototype.dispose=function(){},t.type=Rg,t}(xt),ZC=Math.PI/180,ave=Lr(Rg,ove);function ove(e,t){e.eachSeriesByType(Rg,function(r){sve(r,t)})}function sve(e,t){var r=e.getData(),n=r.graph,i=e.getEdgeData(),a=i.count();if(a){var o=OH(e,t),s=o.cx,l=o.cy,u=o.r,c=o.r0,h=Math.max((e.get("padAngle")||0)*ZC,0),f=Math.max((e.get("minAngle")||0)*ZC,0),d=-e.get("startAngle")*ZC,g=d+Math.PI*2,m=e.get("clockwise"),y=m?1:-1,_=[d,g];hb(_,!m);var x=_[0],w=_[1],S=w-x,T=r.getSum("value")===0&&i.getSum("value")===0,M=[],A=0;n.eachEdge(function(z){var $=T?1:z.getValue("value");T&&($>0||f)&&(A+=2);var W=z.node1.dataIndex,Z=z.node2.dataIndex;M[W]=(M[W]||0)+$,M[Z]=(M[Z]||0)+$});var N=0;if(n.eachNode(function(z){var $=z.getValue("value");isNaN($)||(M[z.dataIndex]=Math.max($,M[z.dataIndex]||0)),!T&&(M[z.dataIndex]>0||f)&&A++,N+=M[z.dataIndex]||0}),!(A===0||N===0)){h*A>=Math.abs(S)&&(h=Math.max(0,(Math.abs(S)-f*A)/A)),(h+f)*A>=Math.abs(S)&&(f=(Math.abs(S)-h*A)/A);var P=(S-h*A*y)/N,I=0,D=0,O=0;n.eachNode(function(z){var $=M[z.dataIndex]||0,W=P*(N?$:1)*y;Math.abs(W)D){var B=I/D;n.eachNode(function(z){var $=z.getLayout().angle;Math.abs($)>=f?z.setLayout({angle:$*B,ratio:B},!0):z.setLayout({angle:f,ratio:f===0?1:$/f},!0)})}else n.eachNode(function(z){if(!j){var $=z.getLayout().angle,W=Math.min($/O,1),Z=W*I;$-Zf&&f>0){var W=j?1:Math.min($/O,1),Z=$-f,X=Math.min(Z,Math.min(U,I*W));U-=X,z.setLayout({angle:$-X,ratio:($-X)/$},!0)}else f>0&&z.setLayout({angle:f,ratio:$===0?1:f/$},!0)}});var H=x,V=[];n.eachNode(function(z){var $=Math.max(z.getLayout().angle,f);z.setLayout({cx:s,cy:l,r0:c,r:u,startAngle:H,endAngle:H+$*y,clockwise:m},!0),V[z.dataIndex]=H,H+=($+h)*y}),n.eachEdge(function(z){var $=T?1:z.getValue("value"),W=P*(N?$:1)*y,Z=z.node1.dataIndex,X=V[Z]||0,re=Math.abs((z.node1.getLayout().ratio||1)*W),J=X+re*y,oe=[s+c*Math.cos(X),l+c*Math.sin(X)],le=[s+c*Math.cos(J),l+c*Math.sin(J)],De=z.node2.dataIndex,be=V[De]||0,ve=Math.abs((z.node2.getLayout().ratio||1)*W),Ne=be+ve*y,_e=[s+c*Math.cos(be),l+c*Math.sin(be)],ke=[s+c*Math.cos(Ne),l+c*Math.sin(Ne)];z.setLayout({s1:oe,s2:le,sStartAngle:X,sEndAngle:J,t1:_e,t2:ke,tStartAngle:be,tEndAngle:Ne,cx:s,cy:l,r:c,value:$,clockwise:m}),V[Z]=J,V[De]=Ne})}}}function lve(e){e.registerChartView(ive),e.registerSeriesModel(tve),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,ave),e.registerProcessor(gm("chord"))}var uve=function(){function e(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return e}(),cve=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="pointer",n}return t.prototype.getDefaultShape=function(){return new uve},t.prototype.buildPath=function(r,n){var i=Math.cos,a=Math.sin,o=n.r,s=n.width,l=n.angle,u=n.x-i(l)*s*(s>=o/3?1:2),c=n.y-a(l)*s*(s>=o/3?1:2);l=n.angle-Math.PI/2,r.moveTo(u,c),r.lineTo(n.x+i(l)*s,n.y+a(l)*s),r.lineTo(n.x+i(n.angle)*o,n.y+a(n.angle)*o),r.lineTo(n.x-i(l)*s,n.y-a(l)*s),r.lineTo(u,c)},t}(Je);function hve(e,t){var r=e.get("center"),n=t.getWidth(),i=t.getHeight(),a=Math.min(n,i),o=he(r[0],t.getWidth()),s=he(r[1],t.getHeight()),l=he(e.get("radius"),a/2);return{cx:o,cy:s,r:l}}function m0(e,t){var r=e==null?"":e+"";return t&&(ue(t)?r=t.replace("{value}",r):Ce(t)&&(r=t(e))),r}var fve=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){this.group.removeAll();var a=r.get(["axisLine","lineStyle","color"]),o=hve(r,i);this._renderMain(r,n,i,a,o),this._data=r.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(r,n,i,a,o){var s=this.group,l=r.get("clockwise"),u=-r.get("startAngle")/180*Math.PI,c=-r.get("endAngle")/180*Math.PI,h=r.getModel("axisLine"),f=h.get("roundCap"),d=f?Wx:on,g=h.get("show"),m=h.getModel("lineStyle"),y=m.get("width"),_=[u,c];hb(_,!l),u=_[0],c=_[1];for(var x=c-u,w=u,S=[],T=0;g&&T=P&&(I===0?0:a[I-1][0])Math.PI/2&&(J+=Math.PI)):re==="tangential"?J=-N-Math.PI/2:nt(re)&&(J=re*Math.PI/180),J===0?h.add(new rt({style:Lt(w,{text:$,x:Z,y:X,verticalAlign:U<-.8?"top":U>.8?"bottom":"middle",align:B<-.4?"left":B>.4?"right":"center"},{inheritColor:W}),silent:!0})):h.add(new rt({style:Lt(w,{text:$,x:Z,y:X,verticalAlign:"middle",align:"center"},{inheritColor:W}),silent:!0,originX:Z,originY:X,rotation:J}))}if(x.get("show")&&H!==S){var V=x.get("distance");V=V?V+c:c;for(var oe=0;oe<=T;oe++){B=Math.cos(N),U=Math.sin(N);var le=new cr({shape:{x1:B*(g-V)+f,y1:U*(g-V)+d,x2:B*(g-A-V)+f,y2:U*(g-A-V)+d},silent:!0,style:O});O.stroke==="auto"&&le.setStyle({stroke:a((H+oe/T)/S)}),h.add(le),N+=I}N-=I}else N+=P}},t.prototype._renderPointer=function(r,n,i,a,o,s,l,u,c){var h=this.group,f=this._data,d=this._progressEls,g=[],m=r.get(["pointer","show"]),y=r.getModel("progress"),_=y.get("show"),x=r.getData(),w=x.mapDimension("value"),S=+r.get("min"),T=+r.get("max"),M=[S,T],A=[s,l];function N(I,D){var O=x.getItemModel(I),j=O.getModel("pointer"),B=he(j.get("width"),o.r),U=he(j.get("length"),o.r),H=r.get(["pointer","icon"]),V=j.get("offsetCenter"),z=he(V[0],o.r),$=he(V[1],o.r),W=j.get("keepAspect"),Z;return H?Z=dr(H,z-B/2,$-U,B,U,null,W):Z=new cve({shape:{angle:-Math.PI/2,width:B,r:U,x:z,y:$}}),Z.rotation=-(D+Math.PI/2),Z.x=o.cx,Z.y=o.cy,Z}function P(I,D){var O=y.get("roundCap"),j=O?Wx:on,B=y.get("overlap"),U=B?y.get("width"):c/x.count(),H=B?o.r-U:o.r-(I+1)*U,V=B?o.r:o.r-I*U,z=new j({shape:{startAngle:s,endAngle:D,cx:o.cx,cy:o.cy,clockwise:u,r0:H,r:V}});return B&&(z.z2=ut(x.get(w,I),[S,T],[100,0],!0)),z}(_||m)&&(x.diff(f).add(function(I){var D=x.get(w,I);if(m){var O=N(I,s);Rt(O,{rotation:-((isNaN(+D)?A[0]:ut(D,M,A,!0))+Math.PI/2)},r),h.add(O),x.setItemGraphicEl(I,O)}if(_){var j=P(I,s),B=y.get("clip");Rt(j,{shape:{endAngle:ut(D,M,A,B)}},r),h.add(j),hM(r.seriesIndex,x.dataType,I,j),g[I]=j}}).update(function(I,D){var O=x.get(w,I);if(m){var j=f.getItemGraphicEl(D),B=j?j.rotation:s,U=N(I,B);U.rotation=B,ot(U,{rotation:-((isNaN(+O)?A[0]:ut(O,M,A,!0))+Math.PI/2)},r),h.add(U),x.setItemGraphicEl(I,U)}if(_){var H=d[D],V=H?H.shape.endAngle:s,z=P(I,V),$=y.get("clip");ot(z,{shape:{endAngle:ut(O,M,A,$)}},r),h.add(z),hM(r.seriesIndex,x.dataType,I,z),g[I]=z}}).execute(),x.each(function(I){var D=x.getItemModel(I),O=D.getModel("emphasis"),j=O.get("focus"),B=O.get("blurScope"),U=O.get("disabled"),H=a(ut(x.get(w,I),M,[0,1],!0));if(m){var V=x.getItemGraphicEl(I),z=x.getItemVisual(I,"style"),$=z.fill;if(V instanceof Or){var W=V.style;V.useStyle(ee({image:W.image,x:W.x,y:W.y,width:W.width,height:W.height},z))}else V.useStyle(z),V.type!=="pointer"&&V.setColor($);V.setStyle(D.getModel(["pointer","itemStyle"]).getItemStyle()),V.style.fill==="auto"&&V.setStyle("fill",H),V.z2EmphasisLift=0,Mr(V,D),Vt(V,j,B,U)}if(_){var Z=g[I];Z.useStyle(x.getItemVisual(I,"style")),Z.setStyle(D.getModel(["progress","itemStyle"]).getItemStyle()),Z.style.fill==="auto"&&Z.setStyle("fill",H),Z.z2EmphasisLift=0,Mr(Z,D),Vt(Z,j,B,U)}}),this._progressEls=g)},t.prototype._renderAnchor=function(r,n){var i=r.getModel("anchor"),a=i.get("show");if(a){var o=i.get("size"),s=i.get("icon"),l=i.get("offsetCenter"),u=i.get("keepAspect"),c=dr(s,n.cx-o/2+he(l[0],n.r),n.cy-o/2+he(l[1],n.r),o,o,null,u);c.z2=i.get("showAbove")?1:0,c.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(c)}},t.prototype._renderTitleAndDetail=function(r,n,i,a,o){var s=this,l=r.getData(),u=l.mapDimension("value"),c=+r.get("min"),h=+r.get("max"),f=new Me,d=[],g=[],m=r.isAnimationEnabled(),y=r.get(["pointer","showAbove"]);l.diff(this._data).add(function(_){d[_]=new rt({silent:!0}),g[_]=new rt({silent:!0})}).update(function(_,x){d[_]=s._titleEls[x],g[_]=s._detailEls[x]}).execute(),l.each(function(_){var x=l.getItemModel(_),w=l.get(u,_),S=new Me,T=a(ut(w,[c,h],[0,1],!0)),M=x.getModel("title");if(M.get("show")){var A=M.get("offsetCenter"),N=o.cx+he(A[0],o.r),P=o.cy+he(A[1],o.r),I=d[_];I.attr({z2:y?0:2,style:Lt(M,{x:N,y:P,text:l.getName(_),align:"center",verticalAlign:"middle"},{inheritColor:T})}),S.add(I)}var D=x.getModel("detail");if(D.get("show")){var O=D.get("offsetCenter"),j=o.cx+he(O[0],o.r),B=o.cy+he(O[1],o.r),U=he(D.get("width"),o.r),H=he(D.get("height"),o.r),V=r.get(["progress","show"])?l.getItemVisual(_,"style").fill:T,I=g[_],z=D.get("formatter");I.attr({z2:y?0:2,style:Lt(D,{x:j,y:B,text:m0(w,z),width:isNaN(U)?null:U,height:isNaN(H)?null:H,align:"center",verticalAlign:"middle"},{inheritColor:V})}),vH(I,{normal:D},w,function(W){return m0(W,z)}),m&&pH(I,_,l,r,{getFormattedLabel:function(W,Z,X,re,J,oe){return m0(oe?oe.interpolatedValue:w,z)}}),S.add(I)}f.add(S)}),this.group.add(f),this._titleEls=d,this._detailEls=g},t.type="gauge",t}(xt),dve=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.visualStyleAccessPath="itemStyle",r}return t.prototype.getInitialData=function(r,n){return Ad(this,["value"])},t.type="series.gauge",t.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,K.color.neutral10]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:K.color.axisTick,width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:K.color.axisTickMinor,width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:K.color.axisLabel,fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:K.color.neutral00,borderWidth:0,borderColor:K.color.theme[0]}},title:{show:!0,offsetCenter:[0,"20%"],color:K.color.secondary,fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:K.color.transparent,borderWidth:0,borderColor:K.color.neutral40,width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:K.color.primary,fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t}(Tt);function vve(e){e.registerChartView(fve),e.registerSeriesModel(dve)}var Zf="funnel",pve=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new Ld(de(this.getData,this),de(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.getInitialData=function(r,n){return Ad(this,{coordDimensions:["value"],encodeDefaulter:Ze(nI,this)})},t.prototype._defaultLabelLine=function(r){hc(r,"labelLine",["show"]);var n=r.labelLine,i=r.emphasis.labelLine;n.show=n.show&&r.label.show,i.show=i.show&&r.emphasis.label.show},t.prototype.getDataParams=function(r){var n=this.getData(),i=e.prototype.getDataParams.call(this,r),a=n.mapDimension("value"),o=n.getSum(a);return i.percent=o?+(n.get(a,r)/o*100).toFixed(2):0,i.$vars.push("percent"),i},t.type="series."+Zf,t.defaultOption={coordinateSystemUsage:"box",z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:65,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:K.color.neutral00,borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:K.color.primary}}},t}(Tt),gve=["itemStyle","opacity"],mve=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=i,o=new Zr,s=new rt;return a.setTextContent(s),i.setTextGuideLine(o),i.updateData(r,n,!0),i}return t.prototype.updateData=function(r,n,i){var a=this,o=r.hostModel,s=r.getItemModel(n),l=r.getItemLayout(n),u=s.getModel("emphasis"),c=s.get(gve);c=c??1,i||$i(a),a.useStyle(r.getItemVisual(n,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,Rt(a,{style:{opacity:c}},o,n)):ot(a,{style:{opacity:c},shape:{points:l.points}},o,n),Mr(a,s),this._updateLabel(r,n),Vt(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},t.prototype._updateLabel=function(r,n){var i=this,a=this.getTextGuideLine(),o=i.getTextContent(),s=r.hostModel,l=r.getItemModel(n),u=r.getItemLayout(n),c=u.label,h=r.getItemVisual(n,"style"),f=h.fill;jr(o,Ar(l),{labelFetcher:r.hostModel,labelDataIndex:n,defaultOpacity:h.opacity,defaultText:r.getName(n)},{normal:{align:c.textAlign,verticalAlign:c.verticalAlign}});var d=l.getModel("label"),g=d.get("color"),m=g==="inherit"?f:null;i.setTextConfig({local:!0,inside:!!c.inside,insideStroke:m,outsideFill:m});var y=c.linePoints;a.setShape({points:y}),i.textGuideLineConfig={anchor:y?new Pe(y[0][0],y[0][1]):null},ot(o,{style:{x:c.x,y:c.y}},s,n),o.attr({rotation:c.rotation,originX:c.x,originY:c.y,z2:10}),RI(i,jI(l),{stroke:f})},t}(sn),yve=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=Zf,r.ignoreLabelLineUpdate=!0,r}return t.prototype.render=function(r,n,i){var a=r.getData(),o=this._data,s=this.group;a.diff(o).add(function(l){var u=new mve(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var c=o.getItemGraphicEl(u);c.updateData(a,l),s.add(c),a.setItemGraphicEl(l,c)}).remove(function(l){var u=o.getItemGraphicEl(l);Ko(u,r,l)}).execute(),this._data=a},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type=Zf,t}(xt);function _ve(e,t){for(var r=e.mapDimension("value"),n=e.mapArray(r,function(l){return l}),i=[],a=t==="ascending",o=0,s=e.count();o-1&&(o="left"),r&&Be(["left","right"],o)>-1&&(o="bottom")),o==="left"?(m=(u[3][0]+u[0][0])/2,y=(u[3][1]+u[0][1])/2,_=m-w,f=_-5,h="right"):o==="right"?(m=(u[1][0]+u[2][0])/2,y=(u[1][1]+u[2][1])/2,_=m+w,f=_+5,h="left"):o==="top"?(m=(u[3][0]+u[0][0])/2,y=(u[3][1]+u[0][1])/2,x=y-w,d=x-5,h="center"):o==="bottom"?(m=(u[1][0]+u[2][0])/2,y=(u[1][1]+u[2][1])/2,x=y+w,d=x+5,h="center"):o==="rightTop"?(m=r?u[3][0]:u[1][0],y=r?u[3][1]:u[1][1],r?(x=y-w,d=x-5,h="center"):(_=m+w,f=_+5,h="top")):o==="rightBottom"?(m=u[2][0],y=u[2][1],r?(x=y+w,d=x+5,h="center"):(_=m+w,f=_+5,h="bottom")):o==="leftTop"?(m=u[0][0],y=r?u[0][1]:u[1][1],r?(x=y-w,d=x-5,h="center"):(_=m-w,f=_-5,h="right")):o==="leftBottom"?(m=r?u[1][0]:u[3][0],y=r?u[1][1]:u[2][1],r?(x=y+w,d=x+5,h="center"):(_=m-w,f=_-5,h="right")):(m=(u[1][0]+u[2][0])/2,y=(u[1][1]+u[2][1])/2,r?(x=y+w,d=x+5,h="center"):(_=m+w,f=_+5,h="left")),r?(_=m,f=_):(x=y,d=x),g=[[m,y],[_,x]]}l.label={linePoints:g,x:f,y:d,verticalAlign:"middle",textAlign:h,inside:c}})}var bve=Lr(Zf,wve);function wve(e,t){e.eachSeriesByType(Zf,function(r){var n=r.getData(),i=n.mapDimension("value"),a=r.get("sort"),o=kr(r,t),s=Bt(r.getBoxLayoutParams(),o.refContainer),l=K7(r),u=s.width,c=s.height,h=_ve(n,a),f=s.x,d=s.y,g=l?[he(r.get("minSize"),c),he(r.get("maxSize"),c)]:[he(r.get("minSize"),u),he(r.get("maxSize"),u)],m=n.getDataExtent(i),y=r.get("min"),_=r.get("max");y==null&&(y=Math.min(m[0],0)),_==null&&(_=m[1]);var x=r.get("funnelAlign"),w=r.get("gap"),S=l?u:c,T=(S-w*(n.count()-1))/n.count(),M=function(U,H){if(l){var V=n.get(i,U)||0,z=ut(V,[y,_],g,!0),$=void 0;switch(x){case"top":$=d;break;case"center":$=d+(c-z)/2;break;case"bottom":$=d+(c-z);break}return[[H,$],[H,$+z]]}var W=n.get(i,U)||0,Z=ut(W,[y,_],g,!0),X;switch(x){case"left":X=f;break;case"center":X=f+(u-Z)/2;break;case"right":X=f+u-Z;break}return[[X,H],[X+Z,H]]};a==="ascending"&&(T=-T,w=-w,l?f+=u:d+=c,h=h.reverse());for(var A=0;Ajve)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);i.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!(this._mouseDownPoint||!YC(this,"mousemove"))){var t=this._model,r=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),n=r.behavior;n==="jump"&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand(n==="none"?null:{axisExpandWindow:r.axisExpandWindow,animation:n==="jump"?null:{duration:0}})}}};function YC(e,t){var r=e._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===t}var t1="parallel",mA=t1,Bve=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(){e.prototype.init.apply(this,arguments),this.mergeOption({})},t.prototype.mergeOption=function(r){var n=this.option;r&&Ge(n,r,!0),this._initDimensions()},t.prototype.contains=function(r,n){var i=r.get("parallelIndex");return i!=null&&n.getComponent("parallel",i)===this},t.prototype.setAxisExpand=function(r){E(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(n){r.hasOwnProperty(n)&&(this.option[n]=r[n])},this)},t.prototype._initDimensions=function(){var r=this.dimensions=[],n=this.parallelAxisIndex=[],i=gt(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);E(i,function(a){r.push("dim"+a.get("dim")),n.push(a.componentIndex)})},t.type=mA,t.dependencies=["parallelAxis"],t.layoutMode="box",t.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},t}(Xe),Fve=function(e){q(t,e);function t(r,n,i,a,o){var s=e.call(this,r,n,i)||this;return s.type=a||"value",s.axisIndex=o,s}return t.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},t}(Ki);function Ll(e,t,r,n,i,a){e=e||0;var o=Su(r[1],-r[0]);if(i!=null&&(i=Ah(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(Su(t[1],-t[0]));s=Ah(s,[0,o]),i=a=Ah(s,[i,a]),n=0}t[0]=Ah(t[0],r),t[1]=Ah(t[1],r);var l=XC(t,n);t[n]+=e;var u=i||0,c=r.slice();l.sign<0?c[0]=Su(c[0],u):c[1]=Su(c[1],-u),t[n]=Ah(t[n],c);var h;return h=XC(t,n),i!=null&&(h.sign!==l.sign||h.spana&&(t[1-n]=Su(t[n],h.sign*a)),t}function XC(e,t){var r=e[t]-e[1-t];return{span:Math.abs(r),sign:r>0?-1:r<0?1:t?-1:1}}function Ah(e,t){return Math.min(t[1]!=null?t[1]:1/0,Math.max(t[0]!=null?t[0]:-1/0,e))}var Vve=function(){function e(t,r,n){this.type=t1,this._axesMap=pe(),this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,r,n)}return e.prototype._init=function(t,r,n){var i=t.dimensions,a=t.parallelAxisIndex;E(i,function(o,s){var l=a[s],u=r.getComponent("parallelAxis",l),c=um(u),h=this._axesMap.set(o,new Fve(o,Sd(u,c,!1),[0,0],c,l));h.onBand=hm(h.scale,u),h.inverse=u.get("inverse"),u.axis=h,h.model=u,h.coordinateSystem=u.coordinateSystem=this},this)},e.prototype.update=function(t,r){E(this.dimensions,function(n){var i=this._axesMap.get(n);wc(i,Gf),Hf(i)},this)},e.prototype.containPoint=function(t){var r=this._makeLayoutInfo(),n=r.axisBase,i=r.layoutBase,a=r.pixelDimIndex,o=t[1-a],s=t[a];return o>=n&&o<=n+r.axisLength&&s>=i&&s<=i+r.layoutLength},e.prototype.getModel=function(){return this._model},e.prototype.resize=function(t,r){var n=kr(t,r).refContainer;this._rect=Bt(t.getBoxLayoutParams(),n),this._layoutAxes()},e.prototype.getRect=function(){return this._rect},e.prototype._makeLayoutInfo=function(){var t=this._model,r=this._rect,n=["x","y"],i=["width","height"],a=t.get("layout"),o=a==="horizontal"?0:1,s=r[i[o]],l=[0,s],u=this.dimensions.length,c=y0(t.get("axisExpandWidth"),l),h=y0(t.get("axisExpandCount")||0,[0,u]),f=t.get("axisExpandable")&&u>3&&u>h&&h>1&&c>0&&s>0,d=t.get("axisExpandWindow"),g;if(d)g=y0(d[1]-d[0],l),d[1]=d[0]+g;else{g=y0(c*(h-1),l);var m=t.get("axisExpandCenter")||Ui(u/2);d=[c*m-g/2],d[1]=d[0]+g}var y=(s-g)/(u-h);y<3&&(y=0);var _=[Ui(at(d[0]/c,1))+1,Bc(at(d[1]/c,1))-1],x=y/c*d[0];return{layout:a,pixelDimIndex:o,layoutBase:r[n[o]],layoutLength:s,axisBase:r[n[1-o]],axisLength:r[i[1-o]],axisExpandable:f,axisExpandWidth:c,axisCollapseWidth:y,axisExpandWindow:d,axisCount:u,winInnerIndices:_,axisExpandWindow0Pos:x}},e.prototype._layoutAxes=function(){var t=this._rect,r=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;r.each(function(o){var s=[0,i.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),E(n,function(o,s){var l=(i.axisExpandable?Hve:Gve)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},c={horizontal:ux/2,vertical:0},h=[u[a].x+t.x,u[a].y+t.y],f=c[a],d=Ft();_s(d,d,f),_a(d,d,h),this._axesLayout[o]={position:h,rotation:f,transform:d,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},e.prototype.getAxis=function(t){return this._axesMap.get(t)},e.prototype.dataToPoint=function(t,r){return this.axisCoordToPoint(this._axesMap.get(r).dataToCoord(t),r)},e.prototype.eachActiveState=function(t,r,n,i){n==null&&(n=0),i==null&&(i=t.count());var a=this._axesMap,o=this.dimensions,s=[],l=[];E(o,function(y){s.push(t.mapDimension(y)),l.push(a.get(y).model)});for(var u=this.hasAxisBrushed(),c=n;ca*(1-h[0])?(u="jump",l=s-a*(1-h[2])):(l=s-a*h[1])>=0&&(l=s-a*(1-h[1]))<=0&&(l=0),l*=r.axisExpandWidth/c,l?Ll(l,i,o,"all"):u="none";else{var d=i[1]-i[0],g=o[1]*s/d;i=[$e(0,g-d/2)],i[1]=_t(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:u}},e}();function y0(e,t){return _t($e(e,t[0]),t[1])}function Gve(e,t){var r=t.layoutLength/(t.axisCount-1);return{position:r*e,axisNameAvailableWidth:r,axisLabelShow:!0}}function Hve(e,t){var r=t.layoutLength,n=t.axisExpandWidth,i=t.axisCount,a=t.axisCollapseWidth,o=t.winInnerIndices,s,l=a,u=!1,c;return e=0;i--)Hr(n[i])},t.prototype.getActiveState=function(r){var n=this.activeIntervals;if(!n.length)return"normal";if(r==null||isNaN(+r))return"inactive";if(n.length===1){var i=n[0];if(i[0]<=r&&r<=i[1])return"active"}else for(var a=0,o=n.length;aYve}function i9(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function a9(e,t,r,n){var i=new Me;return i.add(new Ye({name:"main",style:xN(r),silent:!0,draggable:!0,cursor:"move",drift:Ze(M3,e,t,i,["n","s","w","e"]),ondragend:Ze(Nc,t,{isEnd:!0})})),E(n,function(a){i.add(new Ye({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Ze(M3,e,t,i,a),ondragend:Ze(Nc,t,{isEnd:!0})}))}),i}function o9(e,t,r,n){var i=n.brushStyle.lineWidth||0,a=$f(i,Xve),o=r[0][0],s=r[1][0],l=o-i/2,u=s-i/2,c=r[0][1],h=r[1][1],f=c-a+i/2,d=h-a+i/2,g=c-o,m=h-s,y=g+i,_=m+i;Eo(e,t,"main",o,s,g,m),n.transformable&&(Eo(e,t,"w",l,u,a,_),Eo(e,t,"e",f,u,a,_),Eo(e,t,"n",l,u,y,a),Eo(e,t,"s",l,d,y,a),Eo(e,t,"nw",l,u,a,a),Eo(e,t,"ne",f,u,a,a),Eo(e,t,"sw",l,d,a,a),Eo(e,t,"se",f,d,a,a))}function xA(e,t){var r=t.__brushOption,n=r.transformable,i=t.childAt(0);i.useStyle(xN(r)),i.attr({silent:!n,cursor:n?"move":"default"}),E([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=t.childOfName(a.join("")),s=a.length===1?bA(e,a[0]):tpe(e,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?Kve[s]+"-resize":null})})}function Eo(e,t,r,n,i,a,o){var s=t.childOfName(r);s&&s.setShape(npe(bN(e,t,[[n,i],[n+a,i+o]])))}function xN(e){return Le({strokeNoScale:!0},e.brushStyle)}function s9(e,t,r,n){var i=[jg(e,r),jg(t,n)],a=[$f(e,r),$f(t,n)];return[[i[0],a[0]],[i[1],a[1]]]}function epe(e){return Xu(e.group)}function bA(e,t){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=pb(r[t],epe(e));return n[i]}function tpe(e,t){var r=[bA(e,t[0]),bA(e,t[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function M3(e,t,r,n,i,a){var o=r.__brushOption,s=e.toRectRange(o.range),l=l9(t,i,a);E(n,function(u){var c=qve[u];s[c[0]][c[1]]+=l[c[0]]}),o.range=e.fromRectRange(s9(s[0][0],s[1][0],s[0][1],s[1][1])),mN(t,r),Nc(t,{isEnd:!1})}function rpe(e,t,r,n){var i=t.__brushOption.range,a=l9(e,r,n);E(i,function(o){o[0]+=a[0],o[1]+=a[1]}),mN(e,t),Nc(e,{isEnd:!1})}function l9(e,t,r){var n=e.group,i=n.transformCoordToLocal(t,r),a=n.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function bN(e,t,r){var n=n9(e,t);return n&&n!==Ic?n.clipPath(r,e._transform):Se(r)}function npe(e){var t=jg(e[0][0],e[1][0]),r=jg(e[0][1],e[1][1]),n=$f(e[0][0],e[1][0]),i=$f(e[0][1],e[1][1]);return{x:t,y:r,width:n-t,height:i-r}}function ipe(e,t,r){if(!(!e._brushType||ope(e,t.offsetX,t.offsetY))){var n=e._zr,i=e._covers,a=_N(e,t,r);if(!e._dragging)for(var o=0;on.getWidth()||r<0||r>n.getHeight()}var Gb={lineX:k3(0),lineY:k3(1),rect:{createCover:function(e,t){function r(n){return n}return a9({toRectRange:r,fromRectRange:r},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=i9(e);return s9(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,r,n){o9(e,t,r,n)},updateCommon:xA,contain:SA},polygon:{createCover:function(e,t){var r=new Me;return r.add(new Zr({name:"main",style:xN(t),silent:!0})),r},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new sn({name:"main",draggable:!0,drift:Ze(rpe,e,t),ondragend:Ze(Nc,e,{isEnd:!0})}))},updateCoverShape:function(e,t,r,n){t.childAt(0).setShape({points:bN(e,t,r)})},updateCommon:xA,contain:SA}};function k3(e){return{createCover:function(t,r){return a9({toRectRange:function(n){var i=[n,[0,100]];return e&&i.reverse(),i},fromRectRange:function(n){return n[e]}},t,r,[[["w"],["e"]],[["n"],["s"]]][e])},getCreatingRange:function(t){var r=i9(t),n=jg(r[0][e],r[1][e]),i=$f(r[0][e],r[1][e]);return[n,i]},updateCoverShape:function(t,r,n,i){var a,o=n9(t,r);if(o!==Ic&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(e);else{var s=t._zr;a=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[n,a];e&&l.reverse(),o9(t,r,l,i)},updateCommon:xA,contain:SA}}function c9(e){return e=wN(e),function(t){return Ok(t,e)}}function h9(e,t){return e=wN(e),function(r){var n=t??r,i=n?e.width:e.height,a=n?e.x:e.y;return[a,a+(i||0)]}}function f9(e,t,r){var n=wN(e);return function(i,a){return n.contain(a[0],a[1])&&!a7(i,t,r)}}function wN(e){return Ae.create(e)}var spe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){e.prototype.init.apply(this,arguments),(this._brushController=new gN(n.getZr())).on("brush",de(this._onBrush,this))},t.prototype.render=function(r,n,i,a){if(!lpe(r,n,a)){this.axisModel=r,this.api=i,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Me,this.group.add(this._axisGroup),!!r.get("show")){var s=cpe(r,n),l=s.coordinateSystem,u=r.getAreaSelectStyle(),c=u.width,h=r.axis.dim,f=l.getAxisLayout(h),d=ee({strokeContainThreshold:c},f),g=new Nn(r,i,d);g.build(),this._axisGroup.add(g.group),this._refreshBrushController(d,u,r,s,c,i),im(o,this._axisGroup,r)}}},t.prototype._refreshBrushController=function(r,n,i,a,o,s){var l=i.axis.getExtent(),u=l[1]-l[0],c=Math.min(30,Math.abs(u)*.1),h=Ae.create({x:l[0],y:-o/2,width:u,height:o});h.x-=c,h.width+=2*c,this._brushController.mount({enableGlobalPan:!0,rotation:r.rotation,x:r.position[0],y:r.position[1]}).setPanels([{panelId:"pl",clipPath:c9(h),isTargetByCursor:f9(h,s,a),getLinearBrushOtherExtent:h9(h,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(upe(i))},t.prototype._onBrush=function(r){var n=r.areas,i=this.axisModel,a=i.axis,o=ae(n,function(s){return[a.coordToData(s.range[0],!0),a.coordToData(s.range[1],!0)]});(!i.option.realtime===r.isEnd||r.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:o})},t.prototype.dispose=function(){this._brushController.dispose()},t.type="parallelAxis",t}(It);function lpe(e,t,r){return r&&r.type==="axisAreaSelect"&&t.findComponents({mainType:"parallelAxis",query:r})[0]===e}function upe(e){var t=e.axis;return ae(e.activeIntervals,function(r){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(r[0],!0),t.dataToCoord(r[1],!0)]}})}function cpe(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}var hpe={type:"axisAreaSelect",event:"axisAreaSelected"};function fpe(e){e.registerAction(hpe,function(t,r){r.eachComponent({mainType:"parallelAxis",query:t},function(n){n.axis.model.setActiveIntervals(t.intervals)})}),e.registerAction("parallelAxisExpand",function(t,r){r.eachComponent({mainType:"parallel",query:t},function(n){n.setAxisExpand(t)})})}var dpe={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function d9(e){e.registerComponentView(Ove),e.registerComponentModel(Bve),e.registerCoordinateSystem("parallel",Wve),e.registerPreprocessor(Dve),e.registerComponentModel(yA),e.registerComponentView(spe),Wf(e,"parallel",yA,dpe),fpe(e)}function vpe(e){We(d9),e.registerChartView(Tve),e.registerSeriesModel(Lve),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,Pve)}var gs="sankey",ppe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(r,n){var i=r.edges||r.links||[],a=r.data||r.nodes||[],o=r.levels||[];this.levelModels=[];for(var s=this.levelModels,l=0;l=0&&(s[o[l].depth]=new Ke(o[l],this,n));var u=cN(a,i,this,!0,c);return u.data;function c(h,f){h.wrapMethod("getItemModel",function(d,g){var m=d.parentModel,y=m.getData().getItemLayout(g);if(y){var _=y.depth,x=m.levelModels[_];x&&(d.parentModel=x)}return d}),f.wrapMethod("getItemModel",function(d,g){var m=d.parentModel,y=m.getGraph().getEdgeByIndex(g),_=y.node1.getLayout();if(_){var x=_.depth,w=m.levelModels[x];w&&(d.parentModel=w)}return d})}},t.prototype.setNodePosition=function(r,n){var i=this.option.data||this.option.nodes,a=i[r];a.localX=n[0],a.localY=n[1]},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(r,n,i){function a(d){return isNaN(d)||d==null}if(i==="edge"){var o=this.getDataParams(r,i),s=o.data,l=o.value,u=s.source+" -- "+s.target;return _r("nameValue",{name:u,value:l,noValue:a(l)})}else{var c=this.getGraph().getNodeByIndex(r),h=c.getLayout().value,f=this.getDataParams(r,i).data.name;return _r("nameValue",{name:f!=null?f+"":null,value:h,noValue:a(h)})}},t.prototype.optionUpdated=function(){},t.prototype.getDataParams=function(r,n){var i=e.prototype.getDataParams.call(this,r,n);if(i.value==null&&n==="node"){var a=this.getGraph().getNodeByIndex(r),o=a.getLayout().value;i.value=o}return i},t.prototype.__ownRoamView=function(){return this.coordinateSystem},t.type="series."+gs,t.layoutMode="box",t.defaultOption={z:2,coordinateSystemUsage:"box",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,roam:!1,roamTrigger:"global",center:null,zoom:1,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:K.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:K.color.primary}},animationEasing:"linear",animationDuration:1e3},t}(Tt),gpe=function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return e}(),mpe=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new gpe},t.prototype.buildPath=function(r,n){var i=n.extent;r.moveTo(n.x1,n.y1),r.bezierCurveTo(n.cpx1,n.cpy1,n.cpx2,n.cpy2,n.x2,n.y2),n.orient==="vertical"?(r.lineTo(n.x2+i,n.y2),r.bezierCurveTo(n.cpx2+i,n.cpy2,n.cpx1+i,n.cpy1,n.x1+i,n.y1)):(r.lineTo(n.x2,n.y2+i),r.bezierCurveTo(n.cpx2,n.cpy2+i,n.cpx1,n.cpy1+i,n.x1,n.y1+i)),r.closePath()},t.prototype.highlight=function(){hs(this)},t.prototype.downplay=function(){fs(this)},t}(Je),ype=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=gs,r._mainGroup=new Me,r}return t.prototype.init=function(r,n){this._controller=new qc(n.getZr()),this.group.add(this._mainGroup),this._firstRender=!0},t.prototype.render=function(r,n,i){var a=r.getGraph(),o=this._mainGroup,s=r.layoutInfo,l=s.width,u=s.height,c=r.getData(),h=r.getData("edge"),f=r.get("orient");o.removeAll(),o.x=s.x,o.y=s.y,this._updateViewCoordSys(r,i),Bb(r,i,this._controller,y7(o),null),a.eachEdge(function(d){var g=new mpe,m=Re(g);m.dataIndex=d.dataIndex,m.seriesIndex=r.seriesIndex,m.dataType="edge";var y=d.getModel(),_=y.getModel("lineStyle"),x=_.get("curveness"),w=d.node1.getLayout(),S=d.node1.getModel(),T=S.get("localX"),M=S.get("localY"),A=d.node2.getLayout(),N=d.node2.getModel(),P=N.get("localX"),I=N.get("localY"),D=d.getLayout(),O,j,B,U,H,V,z,$;g.shape.extent=Math.max(1,D.dy),g.shape.orient=f,f==="vertical"?(O=(T!=null?T*l:w.x)+D.sy,j=(M!=null?M*u:w.y)+w.dy,B=(P!=null?P*l:A.x)+D.ty,U=I!=null?I*u:A.y,H=O,V=j*(1-x)+U*x,z=B,$=j*x+U*(1-x)):(O=(T!=null?T*l:w.x)+w.dx,j=(M!=null?M*u:w.y)+D.sy,B=P!=null?P*l:A.x,U=(I!=null?I*u:A.y)+D.ty,H=O*(1-x)+B*x,V=j,z=O*x+B*(1-x),$=U),g.setShape({x1:O,y1:j,x2:B,y2:U,cpx1:H,cpy1:V,cpx2:z,cpy2:$}),g.useStyle(_.getItemStyle()),I3(g.style,f,d);var W=""+y.get("value"),Z=Ar(y,"edgeLabel");jr(g,Z,{labelFetcher:{getFormattedLabel:function(J,oe,le,De,be,ve){return r.getFormattedLabel(J,oe,"edge",De,qn(be,Z.normal&&Z.normal.get("formatter"),W),ve)}},labelDataIndex:d.dataIndex,defaultText:W}),g.setTextConfig({position:"inside"});var X=y.getModel("emphasis");Mr(g,y,"lineStyle",function(J){var oe=J.getItemStyle();return I3(oe,f,d),oe}),o.add(g),h.setItemGraphicEl(d.dataIndex,g);var re=X.get("focus");Vt(g,re==="adjacency"?d.getAdjacentDataIndices():re==="trajectory"?d.getTrajectoryDataIndices():re,X.get("blurScope"),X.get("disabled"))}),a.eachNode(function(d){var g=d.getLayout(),m=d.getModel(),y=m.get("localX"),_=m.get("localY"),x=m.getModel("emphasis"),w=m.get(["itemStyle","borderRadius"])||0,S=new Ye({shape:{x:y!=null?y*l:g.x,y:_!=null?_*u:g.y,width:g.dx,height:g.dy,r:w},style:m.getModel("itemStyle").getItemStyle(),z2:10});jr(S,Ar(m),{labelFetcher:{getFormattedLabel:function(M,A){return r.getFormattedLabel(M,A,"node")}},labelDataIndex:d.dataIndex,defaultText:d.id}),S.disableLabelAnimation=!0,S.setStyle("fill",d.getVisual("color")),S.setStyle("decal",d.getVisual("style").decal),Mr(S,m),o.add(S),c.setItemGraphicEl(d.dataIndex,S),Re(S).dataType="node";var T=x.get("focus");Vt(S,T==="adjacency"?d.getAdjacentDataIndices():T==="trajectory"?d.getTrajectoryDataIndices():T,x.get("blurScope"),x.get("disabled"))}),c.eachItemGraphicEl(function(d,g){var m=c.getItemModel(g);m.get("draggable")&&(d.drift=function(y,_){this.shape.x+=y,this.shape.y+=_,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:r.id,dataIndex:c.getRawIndex(g),localX:this.shape.x/l,localY:this.shape.y/u})},d.draggable=!0,d.cursor="move")}),!this._data&&r.isAnimationEnabled()&&o.setClipPath(_pe(o.getBoundingRect(),r,function(){o.removeClipPath()})),this._data=r.getData(),this._firstRender=!1},t.prototype.__updateOnOwnRoam=function(r,n,i){Al(this.group,go,n.coordinateSystem,null)},t.prototype.dispose=function(){this._controller&&this._controller.dispose()},t.prototype._updateViewCoordSys=function(r,n){var i=r.layoutInfo,a=r.coordinateSystem=nN(r,n,i.x,i.y,i.width,i.height);Al(this.group,go,a,this._firstRender?null:r)},t.type=gs,t}(xt);function I3(e,t,r){switch(e.fill){case"source":e.fill=r.node1.getVisual("color"),e.decal=r.node1.getVisual("style").decal;break;case"target":e.fill=r.node2.getVisual("color"),e.decal=r.node2.getVisual("style").decal;break;case"gradient":var n=r.node1.getVisual("color"),i=r.node2.getVisual("color");ue(n)&&ue(i)&&(e.fill=new Gc(0,0,+(t==="horizontal"),+(t==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function _pe(e,t,r){var n=new Ye({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Rt(n,{shape:{width:e.width+20}},t,r),n}var xpe=Lr(gs,bpe);function bpe(e,t){e.eachSeriesByType(gs,function(r){var n=r.get("nodeWidth"),i=r.get("nodeGap"),a=kr(r,t).refContainer,o=Bt(r.getBoxLayoutParams(),a);r.layoutInfo=o;var s=o.width,l=o.height,u=r.getGraph(),c=u.nodes,h=u.edges;Spe(c);var f=gt(c,function(y){return y.getLayout().value===0}),d=f.length!==0?0:r.get("layoutIterations"),g=r.get("orient"),m=r.get("nodeAlign");wpe(c,h,n,i,s,l,d,g,m)})}function wpe(e,t,r,n,i,a,o,s,l){Cpe(e,t,r,i,a,s,l),Lpe(e,t,a,i,n,o,s),Ope(e,s)}function Spe(e){E(e,function(t){var r=yl(t.outEdges,r1),n=yl(t.inEdges,r1),i=t.getValue()||0,a=Math.max(r,n,i);t.setLayout({value:a},!0)})}function Cpe(e,t,r,n,i,a,o){for(var s=[],l=[],u=[],c=[],h=0,f=0;f=0;_&&y.depth>d&&(d=y.depth),m.setLayout({depth:_?y.depth:h},!0),a==="vertical"?m.setLayout({dy:r},!0):m.setLayout({dx:r},!0);for(var x=0;xh-1?d:h-1;o&&o!=="left"&&Tpe(e,o,a,A);var N=a==="vertical"?(i-r)/A:(n-r)/A;Ape(e,N,a)}function v9(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return t.depth!=null&&t.depth>=0}function Tpe(e,t,r,n){if(t==="right"){for(var i=[],a=e,o=0;a.length;){for(var s=0;s0;a--)l*=.99,Npe(s,l,o),qC(s,i,r,n,o),jpe(s,l,o),qC(s,i,r,n,o)}function kpe(e,t){var r=[],n=t==="vertical"?"y":"x",i=aM(e,function(a){return a.getLayout()[n]});return Hr(i.keys),E(i.keys,function(a){r.push(i.buckets.get(a))}),r}function Ipe(e,t,r,n,i,a){var o=1/0;E(e,function(s){var l=s.length,u=0;E(s,function(h){u+=h.getLayout().value});var c=a==="vertical"?(n-(l-1)*i)/u:(r-(l-1)*i)/u;c0&&(s=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]+l.getLayout()[f]+t;var g=i==="vertical"?n:r;if(u=c-t-g,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),c=s;for(var d=h-2;d>=0;--d)l=o[d],u=l.getLayout()[a]+l.getLayout()[f]+t-c,u>0&&(s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]}})}function Npe(e,t,r){E(e.slice().reverse(),function(n){E(n,function(i){if(i.outEdges.length){var a=yl(i.outEdges,Ppe,r)/yl(i.outEdges,r1);if(isNaN(a)){var o=i.outEdges.length;a=o?yl(i.outEdges,Dpe,r)/o:0}if(r==="vertical"){var s=i.getLayout().x+(a-kl(i,r))*t;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-kl(i,r))*t;i.setLayout({y:l},!0)}}})})}function Ppe(e,t){return kl(e.node2,t)*e.getValue()}function Dpe(e,t){return kl(e.node2,t)}function Epe(e,t){return kl(e.node1,t)*e.getValue()}function Rpe(e,t){return kl(e.node1,t)}function kl(e,t){return t==="vertical"?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function r1(e){return e.getValue()}function yl(e,t,r){for(var n=0,i=e.length,a=-1;++ao&&(o=l)}),E(n,function(s){var l=new Rr({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:t.get("color")}),u=l.mapValueToVisual(s.getLayout().value),c=s.getModel().get(["itemStyle","color"]);c!=null?(s.setVisual("color",c),s.setVisual("style",{fill:c})):(s.setVisual("color",u),s.setVisual("style",{fill:u}))})}i.length&&E(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function Fpe(e){e.registerChartView(ype),e.registerSeriesModel(ppe),e.registerLayout(xpe),e.registerVisual(zpe),e.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(t,r){r.eachComponent({mainType:fo,subType:gs,query:t},function(n){n.setNodePosition(t.dataIndex,[t.localX,t.localY])})}),rN(e,fo,gs)}var p9=function(){function e(){}return e.prototype._hasEncodeRule=function(t){var r=this.getEncode();return r&&r.get(t)!=null},e.prototype.getInitialData=function(t,r){var n,i=r.getComponent("xAxis",this.get("xAxisIndex")),a=r.getComponent("yAxis",this.get("yAxisIndex")),o=i.get("type"),s=a.get("type"),l,u=t.layout;o==="category"?(u="horizontal",n=i.getOrdinalMeta(),l=!this._hasEncodeRule("x")):s==="category"&&(u="vertical",n=a.getOrdinalMeta(),l=!this._hasEncodeRule("y")),u||(u=s==="time"?"vertical":"horizontal"),this._layout=u;var c=["x","y"],h=u==="horizontal"?0:1,f=this._baseAxisDim=c[h],d=c[1-h],g=[i,a],m=g[h].get("type"),y=g[1-h].get("type"),_=t.data;if(_&&l){var x=[];E(_,function(T,M){var A;ne(T)?(A=T.slice(),T.unshift(M)):ne(T.value)?(A=ee({},T),A.value=A.value.slice(),T.value.unshift(M)):A=T,x.push(A)}),t.data=x}var w=this.defaultValueDimensions,S=[{name:f,type:Nx(m),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:d,type:Nx(y),dimsDef:w.slice()}];return Ad(this,{coordDimensions:S,dimensionsCount:w.length+1,encodeDefaulter:Ze(UH,S,this)})},e.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},e.prototype.getWhiskerBoxesLayout=function(){return this._layout},e}();function n1(e,t){for(var r=t.ends.length,n=0,i=0;im){var S=[_,w];n.push(S)}}}return{boxData:r,outliers:n}}var Jpe={type:"echarts:boxplot",transform:function(t){var r=t.upstream;if(r.sourceFormat!==Wr){var n="";pt(n)}var i=Kpe(r.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function Qpe(e){e.registerSeriesModel(g9),e.registerChartView(Vpe),e.registerLayout(Zpe),e.registerTransform(Jpe),qpe(e)}var Il="candlestick",y9=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],r}return t.prototype.getShadowDim=function(){return"open"},t.prototype.brushSelector=function(r,n,i){var a=n.getItemLayout(r);return a&&i.rect(a.brushRect)},t.type="series."+Il,t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},t}(Tt);vr(y9,p9,!0);var ege=["itemStyle","borderColor"],tge=["itemStyle","borderColor0"],rge=["itemStyle","borderColorDoji"],nge=["itemStyle","color"],ige=["itemStyle","color0"];function SN(e,t){return t.get(e>0?nge:ige)}function CN(e,t){return t.get(e===0?rge:e>0?ege:tge)}var age={seriesType:Il,plan:Zc(),performRawSeries:!0,reset:function(e,t){if(!t.isSeriesFiltered(e)){var r=e.pipelineContext.large;return!r&&{progress:function(n,i){for(var a;(a=n.next())!=null;){var o=i.getItemModel(a),s=i.getItemLayout(a).sign,l=o.getItemStyle();l.fill=SN(s,o),l.stroke=CN(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");ee(u,l)}}}}}},oge=["color","borderColor"],sge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(r),this._isLargeDraw?this._renderLarge(r):this._renderNormal(r)},t.prototype.incrementalPrepareRender=function(r,n,i){this._clear(),this._updateDrawMode(r)},t.prototype.incrementalRender=function(r,n,i,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(r,n):this._incrementalRenderNormal(r,n)},t.prototype.eachRendered=function(r){Ol(this._progressiveEls||this.group,r)},t.prototype._updateDrawMode=function(r){var n=r.pipelineContext.large;(this._isLargeDraw==null||n!==this._isLargeDraw)&&(this._isLargeDraw=n,this._clear())},t.prototype._renderNormal=function(r){var n=r.getData(),i=this._data,a=this.group,o=n.getLayout("isSimpleBox"),s=r.get("clip",!0),l=r.coordinateSystem,u=l.getArea&&l.getArea(),c=s&&Sc(l,!1,r);this._data||a.removeAll();var h=P3(r);n.diff(i).add(function(f){if(n.hasValue(f)){var d=n.getItemLayout(f),g=s?n1(u,d):wg;if(g===Cg)return;var m=KC(d,f,h,!0);Rt(m,{shape:{points:d.ends}},r,f),tf(g===Sg,m,c),JC(m,n,f,o),a.add(m),n.setItemGraphicEl(f,m)}}).update(function(f,d){var g=i.getItemGraphicEl(d);if(!n.hasValue(f)){a.remove(g);return}var m=n.getItemLayout(f),y=s?n1(u,m):wg;if(y===Cg){a.remove(g);return}g?(ot(g,{shape:{points:m.ends}},r,f),$i(g)):g=KC(m,f,h),JC(g,n,f,o),tf(y===Sg,g,c),a.add(g),n.setItemGraphicEl(f,g)}).remove(function(f){var d=i.getItemGraphicEl(f);d&&a.remove(d)}).execute(),this._data=n},t.prototype._renderLarge=function(r){this._clear(),D3(r,this.group);var n=r.get("clip",!0)?Sc(r.coordinateSystem,!1,r):null;tf(!!n,this.group,n)},t.prototype._incrementalRenderNormal=function(r,n){for(var i=n.getData(),a=i.getLayout("isSimpleBox"),o=P3(n),s;(s=r.next())!=null;){var l=i.getItemLayout(s),u=KC(l,s,o);JC(u,i,s,a),u.incremental=Qa(n),this.group.add(u),this._progressiveEls.push(u)}},t.prototype._incrementalRenderLarge=function(r,n){D3(n,this.group,this._progressiveEls,!0)},t.prototype.remove=function(r){this._clear()},t.prototype._clear=function(){this.group.removeAll(),tf(!1,this.group,null),this._data=null},t.type=Il,t}(xt),lge=function(){function e(){}return e}(),uge=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="normalCandlestickBox",n}return t.prototype.getDefaultShape=function(){return new lge},t.prototype.buildPath=function(r,n){var i=n.points;this.__simpleBox?(r.moveTo(i[4][0],i[4][1]),r.lineTo(i[6][0],i[6][1])):(r.moveTo(i[0][0],i[0][1]),r.lineTo(i[1][0],i[1][1]),r.lineTo(i[2][0],i[2][1]),r.lineTo(i[3][0],i[3][1]),r.closePath(),r.moveTo(i[4][0],i[4][1]),r.lineTo(i[5][0],i[5][1]),r.moveTo(i[6][0],i[6][1]),r.lineTo(i[7][0],i[7][1]))},t}(Je);function KC(e,t,r,n){var i=e.ends;return new uge({shape:{points:n?cge(i,r,e):i},z2:100})}function JC(e,t,r,n){var i=t.getItemModel(r);e.useStyle(t.getItemVisual(r,"style")),e.style.strokeNoScale=!0;var a=i.getShallow("cursor");a&&e.attr("cursor",a),e.__simpleBox=n,Mr(e,i);var o=t.getItemLayout(r).sign;E(e.states,function(l,u){var c=i.getModel(u),h=SN(o,c),f=CN(o,c)||h,d=l.style||(l.style={});h&&(d.fill=h),f&&(d.stroke=f)});var s=i.getModel("emphasis");Vt(e,s.get("focus"),s.get("blurScope"),s.get("disabled"))}function cge(e,t,r){return ae(e,function(n){return n=n.slice(),n[t]=r.initBaseline,n})}function P3(e){return e.getWhiskerBoxesLayout()==="horizontal"?1:0}var hge=function(){function e(){}return e}(),QC=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n.type="largeCandlestickBox",n}return t.prototype.getDefaultShape=function(){return new hge},t.prototype.buildPath=function(r,n){for(var i=n.points,a=0;aT?D[a]:I[a],ends:B,brushRect:$(M,A,w)})}function V(Z,X){var re=[];return re[i]=X,re[a]=Z,isNaN(X)||isNaN(Z)?[NaN,NaN]:t.dataToPoint(re)}function z(Z,X,re){var J=X.slice(),oe=X.slice();J[i]=s_(J[i]+n/2,1,!1),oe[i]=s_(oe[i]-n/2,1,!0),re?Z.push(J,oe):Z.push(oe,J)}function $(Z,X,re){var J=V(Z,re),oe=V(X,re);return J[i]-=n/2,oe[i]-=n/2,{x:J[0],y:J[1],width:a?n:oe[0]-J[0],height:a?oe[1]-J[1]:n}}function W(Z){return Z[i]=s_(Z[i],1),Z}}function g(m,y){for(var _=Za(m.count*4),x=0,w,S=[],T=[],M,A=y.getStore(),N=!!e.get(["itemStyle","borderColorDoji"]);(M=m.next())!=null;){var P=A.get(s,M),I=A.get(u,M),D=A.get(c,M),O=A.get(h,M),j=A.get(f,M);if(isNaN(P)||isNaN(O)||isNaN(j)){_[x++]=NaN,x+=3;continue}_[x++]=E3(A,M,I,D,c,N),S[i]=P,S[a]=O,w=t.dataToPoint(S,null,T),_[x++]=w?w[0]:NaN,_[x++]=w?w[1]:NaN,S[a]=j,w=t.dataToPoint(S,null,T),_[x++]=w?w[1]:NaN}y.setLayout("largePoints",_)}}};function E3(e,t,r,n,i,a){var o;return r>n?o=-1:r0?e.get(i,t-1)<=n?1:-1:1,o}function pge(e,t){var r=e.getBaseAxis(),n=ln(r,{fromStat:{key:Ju(Il)},min:1}).w,i=he(ye(e.get("barMaxWidth"),n),n),a=he(ye(e.get("barMinWidth"),1),n),o=e.get("barWidth");return o!=null?he(o,n):$e(_t(n/2,i),a)}function gge(e){dge(e,function(){var t=Ju(Il);DI(e,{key:t,seriesType:Il,getMetrics:$I}),kb(t,Db(t))})}function mge(e){e.registerChartView(sge),e.registerSeriesModel(y9),e.registerPreprocessor(fge),e.registerVisual(age),e.registerLayout(vge),gge(e)}function R3(e,t){var r=t.rippleEffectColor||t.color;e.eachChild(function(n){n.attr({z:t.z,zlevel:t.zlevel,style:{stroke:t.brushType==="stroke"?r:null,fill:t.brushType==="fill"?r:null}})})}var yge=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=new fm(r,n),o=new Me;return i.add(a),i.add(o),i.updateData(r,n),i}return t.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},t.prototype.startEffectAnimation=function(r){for(var n=r.symbolType,i=r.color,a=r.rippleNumber,o=this.childAt(1),s=0;s0&&(s=this._getLineLength(a)/c*1e3),s!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var f=void 0;Ce(h)?f=h(i):f=h,a.__t>0&&(f=-s*a.__t),this._animateSymbol(a,s,f,l,u)}this._period=s,this._loop=l,this._roundTrip=u}},t.prototype._animateSymbol=function(r,n,i,a,o){if(n>0){r.__t=0;var s=this,l=r.animate("",a).when(o?n*2:n,{__t:o?2:1}).delay(i).during(function(){s._updateSymbolPosition(r)});a||l.done(function(){s.remove(r)}),l.start()}},t.prototype._getLineLength=function(r){return Ho(r.__p1,r.__cp1)+Ho(r.__cp1,r.__p2)},t.prototype._updateAnimationPoints=function(r,n){r.__p1=n[0],r.__p2=n[1],r.__cp1=n[2]||[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]},t.prototype.updateData=function(r,n,i){this.childAt(0).updateData(r,n,i),this._updateEffectSymbol(r,n)},t.prototype._updateSymbolPosition=function(r){var n=r.__p1,i=r.__p2,a=r.__cp1,o=r.__t<=1?r.__t:2-r.__t,s=[r.x,r.y],l=s.slice(),u=Gr,c=U2;s[0]=u(n[0],a[0],i[0],o),s[1]=u(n[1],a[1],i[1],o);var h=r.__t<=1?c(n[0],a[0],i[0],o):c(i[0],a[0],n[0],1-o),f=r.__t<=1?c(n[1],a[1],i[1],o):c(i[1],a[1],n[1],1-o);r.rotation=-Math.atan2(f,h)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(r.__lastT!==void 0&&r.__lastT=0&&!(a[l]<=n);l--);l=Math.min(l,o-2)}else{for(l=s;ln);l++);l=Math.min(l-1,o-2)}var c=(n-a[l])/(a[l+1]-a[l]),h=i[l],f=i[l+1];r.x=h[0]*(1-c)+c*f[0],r.y=h[1]*(1-c)+c*f[1];var d=r.__t<=1?f[0]-h[0]:h[0]-f[0],g=r.__t<=1?f[1]-h[1]:h[1]-f[1];r.rotation=-Math.atan2(g,d)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=n,r.ignore=!1}},t}(_9),Sge=function(){function e(){this.polyline=!1,this.curveness=0,this.segs=[]}return e}(),Cge=function(e){q(t,e);function t(r){var n=e.call(this,r)||this;return n._off=0,n.hoverDataIdx=-1,n}return t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.beforeBrush=function(r){r&&!r.contentRetained&&this.reset()},t.prototype.getDefaultStyle=function(){return{stroke:K.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new Sge},t.prototype.buildPath=function(r,n){var i=n.segs,a=n.curveness,o;if(n.polyline)for(o=this._off;o0){r.moveTo(i[o++],i[o++]);for(var l=1;l0){var d=(u+h)/2-(c-f)*a,g=(c+f)/2-(h-u)*a;r.quadraticCurveTo(d,g,h,f)}else r.lineTo(h,f)}this.incremental&&(this._off=o,this.notClear=!0)},t.prototype.findDataIndex=function(r,n){var i=this.shape,a=i.segs,o=i.curveness,s=this.style.lineWidth;if(i.polyline)for(var l=0,u=0;u0)for(var h=a[u++],f=a[u++],d=1;d0){var y=(h+g)/2-(f-m)*o,_=(f+m)/2-(g-h)*o;if(AG(h,f,y,_,g,m,s,r,n))return l}else if(Fs(h,f,g,m,s,r,n))return l;l++}return-1},t.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect();if(r=i[0],n=i[1],a.contain(r,n)){var o=this.hoverDataIdx=this.findDataIndex(r,n);return o>=0}return this.hoverDataIdx=-1,!1},t.prototype.getBoundingRect=function(){var r=this._rect;if(!r){for(var n=this.shape,i=n.segs,a=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u0&&(o.dataIndex=l+t.__startIndex)})},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),b9={seriesType:"lines",plan:Zc(),reset:function(e){var t=e.coordinateSystem;if(t){var r=e.get("polyline"),n=e.pipelineContext.large;return{progress:function(i,a){var o=[];if(n){var s=void 0,l=i.end-i.start;if(r){for(var u=0,c=i.start;c0&&c&&u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)}),o.updateData(a);var h=r.get("clip",!0)&&Sc(r.coordinateSystem,!1,r);h?this.group.setClipPath(h):this.group.removeClipPath(),this._lastZlevel=s,this._finished=!0},t.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),o=this._updateLineDraw(a,r);o.incrementalPrepareUpdate(a),this._clearLayer(i),this._finished=!1},t.prototype.incrementalRender=function(r,n,i){this._lineDraw.incrementalUpdate(r,n.getData(),Qa(n)),this._finished=r.end===n.getData().count()},t.prototype.eachRendered=function(r){this._lineDraw&&this._lineDraw.eachRendered(r)},t.prototype.updateTransform=function(r,n,i){var a=r.getData(),o=this._lineDraw;if(!this._finished||!o||!o.updateLayout)return{update:!0};var s=b9.reset(r,n,i);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),o.updateLayout(),this._clearLayer(i)},t.prototype._updateLineDraw=function(r,n){var i=this._lineDraw,a=this._showEffect(n),o=!!n.get("polyline"),s=n.pipelineContext,l=s.large;return(!i||a!==this._hasEffet||o!==this._isPolyline||l!==this._isLargeDraw)&&(i&&i.remove(),i=this._lineDraw=l?new Tge:new pN(o?a?wge:x9:a?_9:vN),this._hasEffet=a,this._isPolyline=o,this._isLargeDraw=l),this.group.add(i.group),i},t.prototype._showEffect=function(r){return!!r.get(["effect","show"])},t.prototype._clearLayer=function(r){var n=xM(r);n&&this._lastZlevel!=null&&n.getLayer(this._lastZlevel).clear(!0)},t.prototype.remove=function(r,n){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(n)},t.prototype.dispose=function(r,n){this.remove(r,n)},t.type="lines",t}(xt),Age=typeof Uint32Array>"u"?Array:Uint32Array,Lge=typeof Float64Array>"u"?Array:Float64Array;function O3(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=ae(t,function(r){var n=[r[0].coord,r[1].coord],i={coords:n};return r[0].name&&(i.fromName=r[0].name),r[1].name&&(i.toName=r[1].name),q1([i,r[0],r[1]])}))}var kge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.visualStyleAccessPath="lineStyle",r.visualDrawType="stroke",r}return t.prototype.init=function(r){r.data=r.data||[],O3(r);var n=this._processFlatCoordsArray(r.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(r.data=new Float32Array(n.count)),e.prototype.init.apply(this,arguments)},t.prototype.mergeOption=function(r){if(O3(r),r.data){var n=this._processFlatCoordsArray(r.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(r.data=new Float32Array(n.count))}e.prototype.mergeOption.apply(this,arguments)},t.prototype.appendData=function(r){var n=this._processFlatCoordsArray(r.data);n.flatCoords&&(this._flatCoords?(this._flatCoords=Nf(this._flatCoords,n.flatCoords),this._flatCoordsOffset=Nf(this._flatCoordsOffset,n.flatCoordsOffset)):(this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset),r.data=new Float32Array(n.count)),this.getRawData().appendData(r.data)},t.prototype._getCoordsFromItemModel=function(r){var n=this.getData().getItemModel(r),i=n.option instanceof Array?n.option:n.getShallow("coords");return i},t.prototype.getLineCoordsCount=function(r){return this._flatCoordsOffset?this._flatCoordsOffset[r*2+1]:this._getCoordsFromItemModel(r).length},t.prototype.getLineCoords=function(r,n){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[r*2],a=this._flatCoordsOffset[r*2+1],o=0;o ")}return _r("nameValue",{name:l,value:o,noValue:o==null||isNaN(o)})},t.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},t.prototype.getProgressive=function(){var r=this.option.progressive;return r??(this.option.large?1e4:this.get("progressive"))},t.prototype.getProgressiveThreshold=function(){var r=this.option.progressiveThreshold;return r??(this.option.large?2e4:this.get("progressiveThreshold"))},t.prototype.getZLevelKey=function(){var r=this.getModel("effect"),n=r.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:r.get("show")&&n>0?n+"":""},t.type="series.lines",t.dependencies=["grid","polar","geo","calendar"],t.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},t}(Tt);function _0(e){return e instanceof Array||(e=[e,e]),e}var Ige={seriesType:"lines",reset:function(e){var t=_0(e.get("symbol")),r=_0(e.get("symbolSize")),n=e.getData();n.setVisual("fromSymbol",t&&t[0]),n.setVisual("toSymbol",t&&t[1]),n.setVisual("fromSymbolSize",r&&r[0]),n.setVisual("toSymbolSize",r&&r[1]);function i(a,o){var s=a.getItemModel(o),l=_0(s.getShallow("symbol",!0)),u=_0(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:n.hasItemOption?i:null}}};function Nge(e){e.registerChartView(Mge),e.registerSeriesModel(kge),e.registerLayout(b9),e.registerVisual(Ige)}var Pge=256,Dge=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=Er.createCanvas();this.canvas=t}return e.prototype.update=function(t,r,n,i,a,o){var s=this._getBrush(),l=this._getGradient(a,"inRange"),u=this._getGradient(a,"outOfRange"),c=this.pointSize+this.blurSize,h=this.canvas,f=h.getContext("2d"),d=t.length;h.width=r,h.height=n;for(var g=0;g0){var O=o(w)?l:u;w>0&&(w=w*I+N),T[M++]=O[D],T[M++]=O[D+1],T[M++]=O[D+2],T[M++]=O[D+3]*w*256}else M+=4}return f.putImageData(S,0,0),h},e.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=Er.createCanvas()),r=this.pointSize+this.blurSize,n=r*2;t.width=n,t.height=n;var i=t.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor=K.color.neutral99,i.beginPath(),i.arc(-r,r,this.pointSize,0,Math.PI*2,!0),i.closePath(),i.fill(),t},e.prototype._getGradient=function(t,r){for(var n=this._gradientPixels,i=n[r]||(n[r]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],o=0,s=0;s<256;s++)t[r](s/255,!0,a),i[o++]=a[0],i[o++]=a[1],i[o++]=a[2],i[o++]=a[3];return i},e}();function Ege(e,t,r){var n=e[1]-e[0];t=ae(t,function(o){return{interval:[(o.interval[0]-e[0])/n,(o.interval[1]-e[0])/n]}});var i=t.length,a=0;return function(o){var s;for(s=a;s=0;s--){var l=t[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}return s>=0&&s=t[0]&&n<=t[1]}}var jge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a;n.eachComponent("visualMap",function(s){s.eachTargetSeries(function(l){l===r&&(a=s)})}),this._progressiveEls=null,this.group.removeAll();var o=r.coordinateSystem;o.type==="cartesian2d"||o.type==="calendar"||o.type==="matrix"?this._renderOnGridLike(r,i,0,r.getData().count()):zO(o)&&this._renderOnGeo(o,r,a,i)},t.prototype.incrementalPrepareRender=function(r,n,i){this.group.removeAll()},t.prototype.incrementalRender=function(r,n,i,a){var o=n.coordinateSystem;o&&(zO(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnGridLike(n,a,r.start,r.end,!0)))},t.prototype.eachRendered=function(r){Ol(this._progressiveEls||this.group,r)},t.prototype._renderOnGridLike=function(r,n,i,a,o){var s=r.coordinateSystem,l=Cc(s,"cartesian2d"),u=Cc(s,"matrix"),c,h,f,d;if(l){var g=s.getAxis("x"),m=s.getAxis("y");c=ln(g).w+.5,h=ln(m).w+.5,f=g.scale.getExtent(),d=m.scale.getExtent()}for(var y=this.group,_=r.getData(),x=r.getModel(["emphasis","itemStyle"]).getItemStyle(),w=r.getModel(["blur","itemStyle"]).getItemStyle(),S=r.getModel(["select","itemStyle"]).getItemStyle(),T=r.get(["itemStyle","borderRadius"]),M=Ar(r),A=r.getModel("emphasis"),N=A.get("focus"),P=A.get("blurScope"),I=A.get("disabled"),D=l||u?[_.mapDimension("x"),_.mapDimension("y"),_.mapDimension("value")]:[_.mapDimension("time"),_.mapDimension("value")],O=i;Of[1]||Hd[1])continue;var V=s.dataToPoint([U,H]);j=new Ye({shape:{x:V[0]-c/2,y:V[1]-h/2,width:c,height:h},style:B})}else if(u){var z=s.dataToLayout([_.get(D[0],O),_.get(D[1],O)]).rect;if(tn(z.x))continue;j=new Ye({z2:1,shape:z,style:B})}else{if(isNaN(_.get(D[1],O)))continue;var $=s.dataToLayout([_.get(D[0],O)]),z=$.contentRect||$.rect;if(tn(z.x)||tn(z.y))continue;j=new Ye({z2:1,shape:z,style:B})}if(_.hasItemOption){var W=_.getItemModel(O),Z=W.getModel("emphasis");x=Z.getModel("itemStyle").getItemStyle(),w=W.getModel(["blur","itemStyle"]).getItemStyle(),S=W.getModel(["select","itemStyle"]).getItemStyle(),T=W.get(["itemStyle","borderRadius"]),N=Z.get("focus"),P=Z.get("blurScope"),I=Z.get("disabled"),M=Ar(W)}j.shape.r=T;var X=r.getRawValue(O),re="-";X&&X[2]!=null&&(re=X[2]+""),jr(j,M,{labelFetcher:r,labelDataIndex:O,defaultOpacity:B.opacity,defaultText:re}),j.ensureState("emphasis").style=x,j.ensureState("blur").style=w,j.ensureState("select").style=S,Vt(j,N,P,I),j.incremental=Qa(r,o),o&&(j.states.emphasis.hoverLayer=vd),y.add(j),_.setItemGraphicEl(O,j),this._progressiveEls&&this._progressiveEls.push(j)}},t.prototype._renderOnGeo=function(r,n,i,a){var o=i.targetVisuals.inRange,s=i.targetVisuals.outOfRange,l=n.getData(),u=this._hmLayer||this._hmLayer||new Dge;u.blurSize=n.get("blurSize"),u.pointSize=n.get("pointSize"),u.minOpacity=n.get("minOpacity"),u.maxOpacity=n.get("maxOpacity");var c=r.getViewRect().clone(),h=r.getRoamTransform();c.applyTransform(h);var f=Math.max(c.x,0),d=Math.max(c.y,0),g=Math.min(c.width+c.x,a.getWidth()),m=Math.min(c.height+c.y,a.getHeight()),y=g-f,_=m-d,x=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],w=l.mapArray(x,function(A,N,P){var I=r.dataToPoint([A,N]);return I[0]-=f,I[1]-=d,I.push(P),I}),S=i.getExtent(),T=i.type==="visualMap.continuous"?Rge(S,i.option.range):Ege(S,i.getPieceList(),i.option.selected);u.update(w,y,_,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},T);var M=new Or({style:{width:y,height:_,x:f,y:d,image:u.canvas},silent:!0});this.group.add(M)},t.type="heatmap",t}(xt),Oge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(r,n){return wo(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var r=yd.get(this.get("coordinateSystem"));if(r&&r.dimensions)return r.dimensions[0]==="lng"&&r.dimensions[1]==="lat"},t.type="series.heatmap",t.dependencies=["grid","geo","calendar","matrix"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:K.color.primary}}},t}(Tt);function zge(e){e.registerChartView(jge),e.registerSeriesModel(Oge)}var Bge=["itemStyle","borderWidth"],z3=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],tT=new bo,Fge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=Tg,r}return t.prototype.render=function(r,n,i){var a=this.group,o=r.getData(),s=this._data,l=r.coordinateSystem,u=l.getBaseAxis(),c=u.isHorizontal(),h=l.master.getRect(),f={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:r,coordSys:l,coordSysExtent:[[h.x,h.x+h.width],[h.y,h.y+h.height]],isHorizontal:c,valueDim:z3[+c],categoryDim:z3[1-+c]};o.diff(s).add(function(g){if(o.hasValue(g)){var m=F3(o,g),y=B3(o,g,m,f),_=V3(o,f,y);o.setItemGraphicEl(g,_),a.add(_),H3(_,f,y)}}).update(function(g,m){var y=s.getItemGraphicEl(m);if(!o.hasValue(g)){a.remove(y);return}var _=F3(o,g),x=B3(o,g,_,f),w=A9(o,x);y&&w!==y.__pictorialShapeStr&&(a.remove(y),o.setItemGraphicEl(g,null),y=null),y?$ge(y,f,x):y=V3(o,f,x,!0),o.setItemGraphicEl(g,y),y.__pictorialSymbolMeta=x,a.add(y),H3(y,f,x)}).remove(function(g){var m=s.getItemGraphicEl(g);m&&G3(s,g,m.__pictorialSymbolMeta.animationModel,m)}).execute();var d=r.get("clip",!0)?Sc(r.coordinateSystem,!1,r):null;return d?a.setClipPath(d):a.removeClipPath(),this._data=o,this.group},t.prototype.remove=function(r,n){var i=this.group,a=this._data;r.get("animation")?a&&a.eachItemGraphicEl(function(o){G3(a,Re(o).dataIndex,r,o)}):i.removeAll()},t.type=Tg,t}(xt);function B3(e,t,r,n){var i=e.getItemLayout(t),a=r.get("symbolRepeat"),o=r.get("symbolClip"),s=r.get("symbolPosition")||"start",l=r.get("symbolRotate"),u=(l||0)*Math.PI/180||0,c=r.get("symbolPatternSize")||2,h=r.isAnimationEnabled(),f={dataIndex:t,layout:i,itemModel:r,symbolType:e.getItemVisual(t,"symbol")||"circle",style:e.getItemVisual(t,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:r.get("symbolRepeatDirection"),symbolPatternSize:c,rotation:u,animationModel:h?r:null,hoverScale:h&&r.get(["emphasis","scale"]),z2:r.getShallow("z",!0)||0};Vge(r,a,i,n,f),Gge(e,t,i,a,o,f.boundingLength,f.pxSign,c,n,f),Hge(r,f.symbolScale,u,n,f);var d=f.symbolSize,g=$c(r.get("symbolOffset"),d);return Uge(r,d,i,a,o,g,s,f.valueLineWidth,f.boundingLength,f.repeatCutLength,n,f),f}function Vge(e,t,r,n,i){var a=n.valueDim,o=e.get("symbolBoundingData"),s=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),l=s.toGlobalCoord(s.dataToCoord(0)),u=1-+(r[a.wh]<=0),c;if(ne(o)){var h=[rT(s,o[0])-l,rT(s,o[1])-l];h[1]=0?1:-1:c>0?1:-1}function rT(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function Gge(e,t,r,n,i,a,o,s,l,u){var c=l.valueDim,h=l.categoryDim,f=Math.abs(r[h.wh]),d=e.getItemVisual(t,"symbolSize"),g;ne(d)?g=d.slice():d==null?g=["100%","100%"]:g=[d,d],g[h.index]=he(g[h.index],f),g[c.index]=he(g[c.index],n?f:Math.abs(a)),u.symbolSize=g;var m=u.symbolScale=[g[0]/s,g[1]/s];m[c.index]*=(l.isHorizontal?-1:1)*o}function Hge(e,t,r,n,i){var a=e.get(Bge)||0;a&&(tT.attr({scaleX:t[0],scaleY:t[1],rotation:r}),tT.updateTransform(),a/=tT.getLineScale(),a*=t[n.valueDim.index]),i.valueLineWidth=a||0}function Uge(e,t,r,n,i,a,o,s,l,u,c,h){var f=c.categoryDim,d=c.valueDim,g=h.pxSign,m=Math.max(t[d.index]+s,0),y=m;if(n){var _=Math.abs(l),x=mn(e.get("symbolMargin"),"15%")+"",w=!1;x.lastIndexOf("!")===x.length-1&&(w=!0,x=x.slice(0,x.length-1));var S=he(x,t[d.index]),T=Math.max(m+S*2,0),M=w?0:S*2,A=yk(n),N=A?n:U3((_+M)/T),P=_-N*m;S=P/2/(w?N:Math.max(N-1,1)),T=m+S*2,M=w?0:S*2,!A&&n!=="fixed"&&(N=u?U3((Math.abs(u)+M)/T):0),y=N*T-M,h.repeatTimes=N,h.symbolMargin=S}var I=g*(y/2),D=h.pathPosition=[];D[f.index]=r[f.wh]/2,D[d.index]=o==="start"?I:o==="end"?l-I:l/2,a&&(D[0]+=a[0],D[1]+=a[1]);var O=h.bundlePosition=[];O[f.index]=r[f.xy],O[d.index]=r[d.xy];var j=h.barRectShape=ee({},r);j[d.wh]=g*Math.max(Math.abs(r[d.wh]),Math.abs(D[d.index]+I)),j[f.wh]=r[f.wh];var B=h.clipShape={};B[f.xy]=-r[f.xy],B[f.wh]=c.ecSize[f.wh],B[d.xy]=0,B[d.wh]=r[d.wh]}function w9(e){var t=e.symbolPatternSize,r=dr(e.symbolType,-t/2,-t/2,t,t);return r.attr({culling:!0}),r.type!=="image"&&r.setStyle({strokeNoScale:!0}),r}function S9(e,t,r,n){var i=e.__pictorialBundle,a=r.symbolSize,o=r.valueLineWidth,s=r.pathPosition,l=t.valueDim,u=r.repeatTimes||0,c=0,h=a[t.valueDim.index]+o+r.symbolMargin*2;for(TN(e,function(m){m.__pictorialAnimationIndex=c,m.__pictorialRepeatTimes=u,c0:_<0)&&(x=u-1-m),y[l.index]=h*(x-u/2+.5)+s[l.index],{x:y[0],y:y[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation}}}function C9(e,t,r,n){var i=e.__pictorialBundle,a=e.__pictorialMainPath;a?xf(a,null,{x:r.pathPosition[0],y:r.pathPosition[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation},r,n):(a=e.__pictorialMainPath=w9(r),i.add(a),xf(a,{x:r.pathPosition[0],y:r.pathPosition[1],scaleX:0,scaleY:0,rotation:r.rotation},{scaleX:r.symbolScale[0],scaleY:r.symbolScale[1]},r,n))}function T9(e,t,r){var n=ee({},t.barRectShape),i=e.__pictorialBarRect;i?xf(i,null,{shape:n},t,r):(i=e.__pictorialBarRect=new Ye({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,e.add(i))}function M9(e,t,r,n){if(r.symbolClip){var i=e.__pictorialClipPath,a=ee({},r.clipShape),o=t.valueDim,s=r.animationModel,l=r.dataIndex;if(i)ot(i,{shape:a},s,l);else{a[o.wh]=0,i=new Ye({shape:a}),e.__pictorialBundle.setClipPath(i),e.__pictorialClipPath=i;var u={};u[o.wh]=r.clipShape[o.wh],Hc[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function F3(e,t){var r=e.getItemModel(t);return r.getAnimationDelayParams=Wge,r.isAnimationEnabled=Zge,r}function Wge(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function Zge(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function V3(e,t,r,n){var i=new Me,a=new Me;return i.add(a),i.__pictorialBundle=a,a.x=r.bundlePosition[0],a.y=r.bundlePosition[1],r.symbolRepeat?S9(i,t,r):C9(i,t,r),T9(i,r,n),M9(i,t,r,n),i.__pictorialShapeStr=A9(e,r),i.__pictorialSymbolMeta=r,i}function $ge(e,t,r){var n=r.animationModel,i=r.dataIndex,a=e.__pictorialBundle;ot(a,{x:r.bundlePosition[0],y:r.bundlePosition[1]},n,i),r.symbolRepeat?S9(e,t,r,!0):C9(e,t,r,!0),T9(e,r,!0),M9(e,t,r,!0)}function G3(e,t,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];TN(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),E(a,function(o){Ml(o,{scaleX:0,scaleY:0},r,t,function(){n.parent&&n.parent.remove(n)})}),e.setItemGraphicEl(t,null)}function A9(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function TN(e,t,r){E(e.__pictorialBundle.children(),function(n){n!==e.__pictorialBarRect&&t.call(r,n)})}function xf(e,t,r,n,i,a){t&&e.attr(t),n.symbolClip&&!i?r&&e.attr(r):r&&Hc[i?"updateProps":"initProps"](e,r,n.animationModel,n.dataIndex,a)}function H3(e,t,r){var n=r.dataIndex,i=r.itemModel,a=i.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),c=a.get("focus"),h=a.get("blurScope"),f=a.get("scale");TN(e,function(m){if(m instanceof Or){var y=m.style;m.useStyle(ee({image:y.image,x:y.x,y:y.y,width:y.width,height:y.height},r.style))}else m.useStyle(r.style);var _=m.ensureState("emphasis");_.style=o,f&&(_.scaleX=m.scaleX*1.1,_.scaleY=m.scaleY*1.1),m.ensureState("blur").style=s,m.ensureState("select").style=l,u&&(m.cursor=u),m.z2=r.z2});var d=t.valueDim.posDesc[+(r.boundingLength>0)],g=e.__pictorialBarRect;g.ignoreClip=!0,jr(g,Ar(i),{labelFetcher:t.seriesModel,labelDataIndex:n,defaultText:Uf(t.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:d}),Vt(e,c,h,a.get("disabled"))}function U3(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}var Yge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.hasSymbolVisual=!0,r.defaultSymbol="roundRect",r}return t.prototype.getInitialData=function(r){return r.stack=null,e.prototype.getInitialData.apply(this,arguments)},t.type="series."+Tg,t.dependencies=["grid"],t.defaultOption=zl(Mg.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:K.color.primary}}}),t}(Mg);function Xge(e){e.registerChartView(Fge),e.registerSeriesModel(Yge),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,jW(Tg)),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,OW(Tg)),BW(e)}var nT=2,Yf="themeRiver",qge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new Ld(de(this.getData,this),de(this.getRawData,this))},t.prototype.fixData=function(r){var n=r.length,i={},a=aM(r,function(f){return i.hasOwnProperty(f[0]+"")||(i[f[0]+""]=-1),f[2]}),o=[];a.buckets.each(function(f,d){o.push({name:d,dataList:f})});for(var s=o.length,l=0;la&&(a=s),n.push(s)}for(var u=0;ua&&(a=h)}return{y0:i,max:a}}function rme(e){e.registerChartView(Kge),e.registerSeriesModel(qge),e.registerLayout(Qge),e.registerProcessor(gm(Yf))}var nme=2,ime=4,Z3=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;o.z2=nme,o.textConfig={inside:!0},Re(o).seriesIndex=n.seriesIndex;var s=new rt({z2:ime,silent:r.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,r,n,i,a),o}return t.prototype.updateData=function(r,n,i,a,o){this.node=n,n.piece=this,i=i||this._seriesModel,a=a||this._ecModel;var s=this;Re(s).dataIndex=n.dataIndex;var l=n.getModel(),u=l.getModel("emphasis"),c=n.getLayout(),h=ee({},c);h.label=null;var f=n.getVisual("style");f.lineJoin="bevel";var d=n.getVisual("decal");d&&(f.decal=Bf(d,o));var g=$a(l.getModel("itemStyle"),h,!0);ee(h,g),E(Dn,function(x){var w=s.ensureState(x),S=l.getModel([x,"itemStyle"]);w.style=S.getItemStyle();var T=$a(S,h);T&&(w.shape=T)}),r?(s.setShape(h),s.shape.r=c.r0,Rt(s,{shape:{r:c.r}},i,n.dataIndex)):(ot(s,{shape:h},i),$i(s)),s.useStyle(f),this._updateLabel(i);var m=l.getShallow("cursor");m&&s.attr("cursor",m),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var y=u.get("focus"),_=y==="relative"?Nf(n.getAncestorsIndices(),n.getDescendantIndices()):y==="ancestor"?n.getAncestorsIndices():y==="descendant"?n.getDescendantIndices():y;Vt(this,_,u.get("blurScope"),u.get("disabled"))},t.prototype._updateLabel=function(r){var n=this,i=this.node.getModel(),a=i.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.endAngle)/2,u=Math.cos(l),c=Math.sin(l),h=this,f=h.getTextContent(),d=this.node.dataIndex,g=a.get("minAngle")/180*Math.PI,m=a.get("show")&&!(g!=null&&Math.abs(s)B&&!cc(H-B)&&H0?(o.virtualPiece?o.virtualPiece.updateData(!1,x,r,n,i):(o.virtualPiece=new Z3(x,r,n,i),c.add(o.virtualPiece)),w.piece.off("click"),o.virtualPiece.on("click",function(S){o._rootToNode(w.parentNode)})):o.virtualPiece&&(c.remove(o.virtualPiece),o.virtualPiece=null)}},t.prototype._initEvents=function(){var r=this;this.group.off("click"),this.group.on("click",function(n){var i=!1,a=r.seriesModel.getViewRoot();a.eachNode(function(o){if(!i&&o.piece&&o.piece===n.target){var s=o.getModel().get("nodeClick");if(s==="rootToNode")r._rootToNode(o);else if(s==="link"){var l=o.getModel(),u=l.get("link");if(u){var c=l.get("target",!0)||"_blank";xx(u,c)}}i=!0}})})},t.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:CA,from:this.uid,seriesId:this.seriesModel.id,targetNode:r})},t.prototype.containPoint=function(r,n){var i=n.getData(),a=i.getItemLayout(0);if(a){var o=r[0]-a.cx,s=r[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},t.type=Pc,t}(xt),ume=Lr(Pc,cme);function cme(e){var t={};function r(n,i,a){if(n.depth===0)return K.color.neutral50;for(var o=n;o&&o.depth>1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",t);return n.depth>1&&ue(s)&&(s=nx(s,(n.depth-1)/(a-1)*.5)),s}e.eachSeriesByType(Pc,function(n){var i=n.getData(),a=i.tree;a.eachNode(function(o){var s=o.getModel(),l=s.getModel("itemStyle").getItemStyle();l.fill||(l.fill=r(o,n,a.root.height));var u=i.ensureUniqueItemVisual(o.dataIndex,"style");ee(u,l)})})}var Y3=Math.PI/180,hme=Lr(Pc,fme);function fme(e,t){e.eachSeriesByType(Pc,function(r){var n=r.get("center"),i=r.get("radius");ne(i)||(i=[0,i]),ne(n)||(n=[n,n]);var a=t.getWidth(),o=t.getHeight(),s=Math.min(a,o),l=he(n[0],a),u=he(n[1],o),c=he(i[0],s/2),h=he(i[1],s/2),f=-r.get("startAngle")*Y3,d=r.get("minAngle")*Y3,g=r.getData().tree.root,m=r.getViewRoot(),y=m.depth,_=r.get("sort");_!=null&&k9(m,_);var x=0;E(m.children,function(U){!isNaN(U.getValue())&&x++});var w=m.getValue(),S=Math.PI/(w||x)*2,T=m.depth>0,M=m.height-(T?-1:1),A=(h-c)/(M||1),N=r.get("clockwise"),P=r.get("stillShowZeroSum"),I=N?1:-1,D=function(U,H){if(U){var V=H;if(U!==g){var z=U.getValue(),$=w===0&&P?S:z*S;$n[1]&&n.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:n[1],r0:n[0]},api:{coord:function(i){var a=t.dataToRadius(i[0]),o=r.dataToAngle(i[1]),s=e.coordToPoint([a,o]);return s.push(a,o*Math.PI/180),s},size:de(Sme,e)}}}function Tme(e){var t=e.getRect(),r=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:r.start,end:r.end,weeks:r.weeks,dayCount:r.allDay}},api:{coord:function(n,i){return e.dataToPoint(n,i)},layout:function(n,i){return e.dataToLayout(n,i)}}}}function Mme(e){var t=e.getRect();return{coordSys:{type:"matrix",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(r,n){return e.dataToPoint(r,n)},layout:function(r,n){return e.dataToLayout(r,n)}}}}var I9={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},q3=Qe(I9);Hi(us,function(e,t){return e[t]=1,e},{});us.join(", ");var i1=["","style","shape","extra"],Xf=He();function MN(e,t,r,n,i){var a=e+"Animation",o=dd(e,n,i)||{},s=Xf(t).userDuring;return o.duration>0&&(o.during=s?de(Nme,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),ee(o,r[a]),o}function y_(e,t,r,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=r.isAnimationEnabled(),l=Xf(e),u=t.style;l.userDuring=t.during;var c={},h={};if(Dme(e,t,h),e.type==="compound")for(var f=e.shape.paths,d=t.shape.paths,g=0;g0&&e.animateFrom(y,_)}else Lme(e,t,i||0,r,c);N9(e,t),u?e.dirty():e.markRedraw()}function N9(e,t){for(var r=Xf(e).leaveToProps,n=0;n0&&e.animateFrom(i,a)}}function kme(e,t){ge(t,"silent")&&(e.silent=t.silent),ge(t,"ignore")&&(e.ignore=t.ignore),e instanceof Zi&&ge(t,"invisible")&&(e.invisible=t.invisible),e instanceof Je&&ge(t,"autoBatch")&&(e.autoBatch=t.autoBatch)}var ja={},Ime={setTransform:function(e,t){return ja.el[e]=t,this},getTransform:function(e){return ja.el[e]},setShape:function(e,t){var r=ja.el,n=r.shape||(r.shape={});return n[e]=t,r.dirtyShape&&r.dirtyShape(),this},getShape:function(e){var t=ja.el.shape;if(t)return t[e]},setStyle:function(e,t){var r=ja.el,n=r.style;return n&&(n[e]=t,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(e){var t=ja.el.style;if(t)return t[e]},setExtra:function(e,t){var r=ja.el.extra||(ja.el.extra={});return r[e]=t,this},getExtra:function(e){var t=ja.el.extra;if(t)return t[e]}};function Nme(){var e=this,t=e.el;if(t){var r=Xf(t).userDuring,n=e.userDuring;if(r!==n){e.el=e.userDuring=null;return}ja.el=t,n(Ime)}}function K3(e,t,r,n){var i=r[e];if(i){var a=t[e],o;if(a){var s=r.transition,l=i.transition;if(l)if(!o&&(o=n[e]={}),Qu(l))ee(o,a);else for(var u=kt(l),c=0;c=0){!o&&(o=n[e]={});for(var d=Qe(a),c=0;c=0)){var f=e.getAnimationStyleProps(),d=f?f.style:null;if(d){!a&&(a=n.style={});for(var g=Qe(r),u=0;u=0?t.getStore().get(z,H):void 0}var $=t.get(V.name,H),W=V&&V.ordinalMeta;return W?W.categories[$]:$}function A(U,H){H==null&&(H=c);var V=t.getItemVisual(H,"style"),z=V&&V.fill,$=V&&V.opacity,W=w(H,Qs).getItemStyle();z!=null&&(W.fill=z),$!=null&&(W.opacity=$);var Z={inheritColor:ue(z)?z:K.color.neutral99},X=S(H,Qs),re=Lt(X,null,Z,!1,!0);re.text=X.getShallow("show")?ye(e.getFormattedLabel(H,Qs),Uf(t,H)):null;var J=px(X,Z,!1);return I(U,W),W=FO(W,re,J),U&&P(W,U),W.legacy=!0,W}function N(U,H){H==null&&(H=c);var V=w(H,es).getItemStyle(),z=S(H,es),$=Lt(z,null,null,!0,!0);$.text=z.getShallow("show")?qn(e.getFormattedLabel(H,es),e.getFormattedLabel(H,Qs),Uf(t,H)):null;var W=px(z,null,!0);return I(U,V),V=FO(V,$,W),U&&P(V,U),V.legacy=!0,V}function P(U,H){for(var V in H)ge(H,V)&&(U[V]=H[V])}function I(U,H){U&&(U.textFill&&(H.textFill=U.textFill),U.textPosition&&(H.textPosition=U.textPosition))}function D(U,H){if(H==null&&(H=c),ge(X3,U)){var V=t.getItemVisual(H,"style");return V?V[X3[U]]:null}if(ge(pme,U))return t.getItemVisual(H,U)}function O(U){if(o.type==="cartesian2d"){var H=o.getBaseAxis();return Hue(Le({axis:H},U))}}function j(){return r.getCurrentSeriesIndices()}function B(U){return Vk(U,r)}}function Ume(e){var t={};return E(e.dimensions,function(r){var n=e.getDimensionInfo(r);if(!n.isExtraCoord){var i=n.coordDim,a=t[i]=t[i]||[];a[n.coordDimIndex]=e.getDimensionIndex(r)}}),t}function sT(e,t,r,n,i,a,o){if(!n){a.remove(t);return}var s=NN(e,t,r,n,i,a);return s&&o.setItemGraphicEl(r,s),s&&Vt(s,n.focus,n.blurScope,n.emphasisDisabled),s}function NN(e,t,r,n,i,a){var o=-1,s=t;t&&R9(t,n,i)&&(o=Be(a.childrenRef(),t),t=null);var l=!t,u=t;u?u.clearStates():(u=kN(n),s&&Fme(s,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),n.tooltipDisabled&&(u.tooltipDisabled=!0),Si.normal.cfg=Si.normal.conOpt=Si.emphasis.cfg=Si.emphasis.conOpt=Si.blur.cfg=Si.blur.conOpt=Si.select.cfg=Si.select.conOpt=null,Si.isLegacy=!1,Zme(u,r,n,i,l,Si),Wme(u,r,n,i,l),IN(e,u,r,n,Si,i,l),ge(n,"info")&&(Qo(u).info=n.info);for(var c=0;c=0?a.replaceAt(u,o):a.add(u),u}function R9(e,t,r){var n=Qo(e),i=t.type,a=t.shape,o=t.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&Kme(a)&&j9(a)!==n.customPathData||i==="image"&&ge(o,"image")&&o.image!==n.customImagePath}function Wme(e,t,r,n,i){var a=r.clipPath;if(a===!1)e&&e.getClipPath()&&e.removeClipPath();else if(a){var o=e.getClipPath();o&&R9(o,a,n)&&(o=null),o||(o=kN(a),e.setClipPath(o)),IN(null,o,t,a,null,n,i)}}function Zme(e,t,r,n,i,a){if(!(e.isGroup||e.type==="compoundPath")){Q3(r,null,a),Q3(r,es,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(o!=null||s!=null||u!=null||l!=null){var c=e.getTextContent();if(o===!1)c&&e.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},c?c.clearStates():(c=kN(o),e.setTextContent(c)),IN(null,c,t,o,null,n,i);for(var h=o&&o.style,f=0;f=c;d--){var g=t.childAt(d);Yme(t,g,i)}}}function Yme(e,t,r){t&&Hb(t,Qo(e).option,r)}function Xme(e){new ds(e.oldChildren,e.newChildren,ez,ez,e).add(tz).update(tz).remove(qme).execute()}function ez(e,t){var r=e&&e.name;return r??zme+t}function tz(e,t){var r=this.context,n=e!=null?r.newChildren[e]:null,i=t!=null?r.oldChildren[t]:null;NN(r.api,i,r.dataIndex,n,r.seriesModel,r.group)}function qme(e){var t=this.context,r=t.oldChildren[e];r&&Hb(r,Qo(r).option,t.seriesModel)}function j9(e){return e&&(e.pathData||e.d)}function Kme(e){return e&&(ge(e,"pathData")||ge(e,"d"))}function Jme(e){e.registerChartView(Vme),e.registerSeriesModel(gme)}var Pu=He(),rz=Se,lT=de,DN=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(t,r,n,i){var a=r.get("value"),o=r.get("status");if(this._axisModel=t,this._axisPointerModel=r,this._api=n,!(!i&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,t,r,n);var c=u.graphicKey;c!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=c;var h=this._moveAnimation=this.determineAnimation(t,r);if(!s)s=this._group=new Me,this.createPointerEl(s,u,t,r),this.createLabelEl(s,u,t,r),n.getZr().add(s);else{var f=Ze(nz,r,h);this.updatePointerEl(s,u,f),this.updateLabelEl(s,u,f,r)}az(s,r,!0),this._renderHandle(a)}},e.prototype.remove=function(t){this.clear(t)},e.prototype.dispose=function(t){this.clear(t)},e.prototype.determineAnimation=function(t,r){var n=r.get("animation"),i=t.axis,a=i.type==="category",o=r.get("snap");if(!o&&!a)return!1;if(n==="auto"||n==null){var s=this.animationThreshold;if(a&&ln(i).w>s)return!0;if(o){var l=XI(t).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return n===!0},e.prototype.makeElOption=function(t,r,n,i,a){},e.prototype.createPointerEl=function(t,r,n,i){var a=r.pointer;if(a){var o=Pu(t).pointerEl=new Hc[a.type](rz(r.pointer));t.add(o)}},e.prototype.createLabelEl=function(t,r,n,i){if(r.label){var a=Pu(t).labelEl=new rt(rz(r.label));t.add(a),iz(a,i)}},e.prototype.updatePointerEl=function(t,r,n){var i=Pu(t).pointerEl;i&&r.pointer&&(i.setStyle(r.pointer.style),n(i,{shape:r.pointer.shape}))},e.prototype.updateLabelEl=function(t,r,n,i){var a=Pu(t).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),iz(a,i))},e.prototype._renderHandle=function(t){if(!(this._dragging||!this.updateHandleTransform)){var r=this._axisPointerModel,n=this._api.getZr(),i=this._handle,a=r.getModel("handle"),o=r.get("status");if(!a.get("show")||!o||o==="hide"){i&&n.remove(i),this._handle=null;return}var s;this._handle||(s=!0,i=this._handle=pd(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){ls(u.event)},onmousedown:lT(this._onHandleDragMove,this,0,0),drift:lT(this._onHandleDragMove,this),ondragend:lT(this._onHandleDragEnd,this)}),n.add(i)),az(i,r,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");ne(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,_d(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},e.prototype._moveHandleToValue=function(t,r){nz(this._axisPointerModel,!r&&this._moveAnimation,this._handle,uT(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(t,r){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(uT(n),[t,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(uT(i)),Pu(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){var t=this._handle;if(t){var r=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:r.cursorPoint[0],y:r.cursorPoint[1],tooltipOption:r.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){this._dragging=!1;var t=this._handle;if(t){var r=this._axisPointerModel.get("value");this._moveHandleToValue(r),this._api.dispatchAction({type:"hideTip"})}},e.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var r=t.getZr(),n=this._group,i=this._handle;r&&n&&(this._lastGraphicKey=null,n&&r.remove(n),i&&r.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),dg(this,"_doDispatchAxisPointer")},e.prototype.doClear=function(){},e.prototype.buildLabel=function(t,r,n){return n=n||0,{x:t[n],y:t[1-n],width:r[n],height:r[1-n]}},e}();function nz(e,t,r,n){O9(Pu(r).lastProp,n)||(Pu(r).lastProp=n,t?ot(r,n,e):(r.stopAnimation(),r.attr(n)))}function O9(e,t){if(Ie(e)&&Ie(t)){var r=!0;return E(t,function(n,i){r=r&&O9(e[i],n)}),!!r}else return e===t}function iz(e,t){e[t.get(["label","show"])?"show":"hide"]()}function uT(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function az(e,t,r){var n=t.get("z"),i=t.get("zlevel");e&&e.traverse(function(a){a.type!=="group"&&(n!=null&&(a.z=n),i!=null&&(a.zlevel=i),a.silent=r)})}function EN(e){var t=e.get("type"),r=e.getModel(t+"Style"),n;return t==="line"?(n=r.getLineStyle(),n.fill=null):t==="shadow"&&(n=r.getAreaStyle(),n.stroke=null),n}function z9(e,t,r,n,i){var a=r.get("value"),o=B9(a,t.axis,t.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=md(s.get("padding")||0),u=s.getFont(),c=tb(o,u),h=i.position,f=c.width+l[1]+l[3],d=c.height+l[0]+l[2],g=i.align;g==="right"&&(h[0]-=f),g==="center"&&(h[0]-=f/2);var m=i.verticalAlign;m==="bottom"&&(h[1]-=d),m==="middle"&&(h[1]-=d/2),Qme(h,f,d,n);var y=s.get("backgroundColor");(!y||y==="auto")&&(y=t.get(["axisLine","lineStyle","color"])),e.label={x:h[0],y:h[1],style:Lt(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:y}),z2:10}}function Qme(e,t,r,n){var i=n.getWidth(),a=n.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+r,a)-r,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function B9(e,t,r,n,i){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:i.precision}),o=i.formatter;if(o){var s={value:Ex(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};E(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,h=u&&u.getDataParams(c);h&&s.seriesData.push(h)}),ue(o)?a=o.replace("{value}",a):Ce(o)&&(a=o(s))}return a}function RN(e,t,r){var n=Ft();return _s(n,n,r.rotation),_a(n,n,r.position),pa([e.dataToCoord(t),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function F9(e,t,r,n,i,a){var o=Nn.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),z9(t,n,i,a,{position:RN(n.axis,e,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function jN(e,t,r){return r=r||0,{x1:e[r],y1:e[1-r],x2:t[r],y2:t[1-r]}}function V9(e,t,r){return r=r||0,{x:e[r],y:e[1-r],width:t[r],height:t[1-r]}}function oz(e,t,r,n,i,a){return{cx:e,cy:t,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}function ON(e,t,r){return ln(e,{fromStat:{sers:ae(t,function(n){return r.getSeriesByIndex(n.seriesIndex)})},min:1}).w}function zN(e,t,r){return[$e(_t(t[0],t[1]),e-r/2),_t(e+r/2,$e(t[0],t[1]))]}var eye=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis,l=s.grid,u=a.get("type"),c=s.getGlobalExtent(),h=sz(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var d=EN(a),g=tye[u](s,f,c,h,a.get("seriesDataIndices"),a.ecModel);g.style=d,r.graphicKey=g.type,r.pointer=g}var m=Hx(l.getRect(),i);F9(n,r,m,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=Hx(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=RN(n.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(r,n,i,a){var o=i.axis,s=o.grid,l=o.getGlobalExtent(!0),u=sz(s,o).getOtherAxis(o).getGlobalExtent(),c=o.dim==="x"?0:1,h=[r.x,r.y];h[c]+=n[c],h[c]=_t(l[1],h[c]),h[c]=$e(l[0],h[c]);var f=(u[1]+u[0])/2,d=[f,f];d[c]=h[c];var g=[{verticalAlign:"middle"},{align:"center"}];return{x:h[0],y:h[1],rotation:r.rotation,cursorPoint:d,tooltipOption:g[c]}},t}(DN);function sz(e,t){var r={};return r[t.dim+"AxisIndex"]=t.index,e.getCartesian(r)}var tye={line:function(e,t,r,n){var i=jN([t,n[0]],[t,n[1]],lz(e));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(e,t,r,n,i,a){var o=ON(e,i,a),s=n[1]-n[0],l=zN(t,r,o),u=l[0],c=l[1];return{type:"Rect",shape:V9([u,n[0]],[c-u,s],lz(e))}}};function lz(e){return e.dim==="x"?0:1}var rye=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:K.color.border,width:1,type:"dashed"},shadowStyle:{color:K.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:K.color.neutral00,padding:[5,7,5,7],backgroundColor:K.color.accent60,borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:K.color.accent40,throttle:40}},t}(Xe),Zo=He(),nye=E;function G9(e,t,r){if(!et.node){var n=t.getZr();Zo(n).records||(Zo(n).records={}),iye(n,t);var i=Zo(n).records[e]||(Zo(n).records[e]={});i.handler=r}}function iye(e,t){if(Zo(e).initialized)return;Zo(e).initialized=!0,r("click",Ze(cT,"click")),r("mousemove",Ze(cT,"mousemove")),r("mousewheel",Ze(cT,"mousewheel")),r("globalout",oye);function r(n,i){e.on(n,function(a){var o=sye(t);nye(Zo(e).records,function(s){s&&i(s,a,o.dispatchAction)}),aye(o.pendings,t)})}}function aye(e,t){var r=e.showTip.length,n=e.hideTip.length,i;r?i=e.showTip[r-1]:n&&(i=e.hideTip[n-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}function oye(e,t,r){e.handler("leave",null,r)}function cT(e,t,r,n){t.handler(e,r,n)}function sye(e){var t={showTip:[],hideTip:[]},r=function(n){var i=t[n.type];i?i.push(n):(n.dispatchAction=r,e.dispatchAction(n))};return{dispatchAction:r,pendings:t}}function AA(e,t){if(!et.node){var r=t.getZr(),n=(Zo(r).records||{})[e];n&&(Zo(r).records[e]=null)}}var lye=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=n.getComponent("tooltip"),o=r.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click|mousewheel";G9("axisPointer",i,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},t.prototype.remove=function(r,n){AA("axisPointer",n)},t.prototype.dispose=function(r,n){AA("axisPointer",n)},t.type="axisPointer",t}(It);function H9(e,t){var r=[],n=e.seriesIndex,i;if(n==null||!(i=t.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=fc(a,e);if(o==null||o<0||ne(o))return{point:[]};var s=a.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)r=i.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(e.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u),h=c.dim,f=u.dim,d=h==="x"||h==="radius"?1:0,g=a.mapDimension(f),m=[];m[d]=a.get(g,o),m[1-d]=a.get(a.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(m)||[]}else r=l.dataToPoint(a.getValues(ae(l.dimensions,function(_){return a.mapDimension(_)}),o))||[];else if(s){var y=s.getBoundingRect().clone();y.applyTransform(s.transform),r=[y.x+y.width/2,y.y+y.height/2]}return{point:r,el:s}}var uz=He();function uye(e,t,r){var n=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||de(r.dispatchAction,r),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){__(i)&&(i=H9({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=__(i),u=a.axesInfo,c=s.axesInfo,h=n==="leave"||__(i),f={},d={},g={list:[],map:{}},m={showPointer:Ze(hye,d),showTooltip:Ze(fye,g)};E(s.coordSysMap,function(_,x){var w=l||_.containPoint(i);E(s.coordSysAxesInfo[x],function(S,T){var M=S.axis,A=gye(u,S);if(!h&&w&&(!u||A)){var N=A&&A.value;N==null&&!l&&(N=M.pointToData(i)),N!=null&&cz(S,N,m,!1,f)}})});var y={};return E(c,function(_,x){var w=_.linkGroup;w&&!d[x]&&E(w.axesInfo,function(S,T){var M=d[T];if(S!==_&&M){var A=M.value;w.mapper&&(A=_.axis.scale.parse(w.mapper(A,hz(S),hz(_)))),y[_.key]=A}})}),E(y,function(_,x){cz(c[x],_,m,!0,f)}),dye(d,c,f),vye(g,i,e,o),pye(c,o,r),f}}function cz(e,t,r,n,i){var a=e.axis;if(!(a.scale.isBlank()||!a.containData(t))){if(!e.involveSeries){r.showPointer(e,t);return}var o=cye(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&ee(i,s[0]),!n&&e.snap&&a.containData(l)&&l!=null&&(t=l),r.showPointer(e,t,s),r.showTooltip(e,o,l)}}function cye(e,t){var r=t.axis,n=r.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return E(t.seriesModels,function(l,u){var c=l.getData().mapDimensionsAll(n),h,f;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(c,e,r);f=d.dataIndices,h=d.nestestValue}else{if(f=l.indicesOfNearest(n,c[0],e,r.type==="category"?.5:null),!f.length)return;h=l.getData().get(c[0],f[0])}if(Wi(h)){var g=e-h,m=Math.abs(g);m<=o&&((m=0&&s<0)&&(o=m,s=g,i=h,a.length=0),E(f,function(y){a.push({seriesIndex:l.seriesIndex,dataIndexInside:y,dataIndex:l.getData().getRawIndex(y)})}))}}),{payloadBatch:a,snapToValue:i}}function hye(e,t,r,n){e[t.key]={value:r,payloadBatch:n}}function fye(e,t,r,n){var i=r.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(!(!t.triggerTooltip||!i.length)){var l=t.coordSys.model,u=Ag(l),c=e.map[u];c||(c=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(c)),c.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function dye(e,t,r){var n=r.axesInfo=[];E(t,function(i,a){var o=i.axisPointerModel.option,s=e[a];s?(!i.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!i.useHandle&&(o.status="hide"),o.status==="show"&&n.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:o.value})})}function vye(e,t,r,n){if(__(t)||!e.list.length){n({type:"hideTip"});return}var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:r.tooltipOption,position:r.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}function pye(e,t,r){var n=r.getZr(),i="axisPointerLastHighlights",a=uz(n)[i]||{},o=uz(n)[i]={};E(e,function(c,h){var f=c.axisPointerModel.option;f.status==="show"&&c.triggerEmphasis&&E(f.seriesDataIndices,function(d){o[d.seriesIndex+"|"+d.dataIndex]=d})});var s=[],l=[];function u(c){return{seriesIndex:c.seriesIndex,dataIndex:c.dataIndex}}E(a,function(c,h){!o[h]&&l.push(u(c))}),E(o,function(c,h){!a[h]&&s.push(u(c))}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function gye(e,t){for(var r=0;r<(e||[]).length;r++){var n=e[r];if(t.axis.dim===n.axisDim&&t.axis.model.componentIndex===n.axisIndex)return n}}function hz(e){var t=e.axis.model,r={},n=r.axisDim=e.axis.dim;return r.axisIndex=r[n+"AxisIndex"]=t.componentIndex,r.axisName=r[n+"AxisName"]=t.name,r.axisId=r[n+"AxisId"]=t.id,r}function __(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function mm(e){Xc.registerAxisPointerClass("CartesianAxisPointer",eye),e.registerComponentModel(rye),e.registerComponentView(lye),e.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var r=t.axisPointer.link;r&&!ne(r)&&(t.axisPointer.link=[r])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,{overallReset:function(t,r){t.getComponent("axisPointer").coordSysAxesInfo=zce(t,r)}}),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},uye)}function mye(e){We(t7),We(mm)}var yye=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis;s.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=s.polar,u=s.getExtent(),c=l.getOtherAxis(s).getExtent(),h=s.dataToCoord(n),f=a.get("type");if(f&&f!=="none"){var d=EN(a),g=xye[f](s,l,h,u,c,a.get("seriesDataIndices"),a.ecModel);g.style=d,r.graphicKey=g.type,r.pointer=g}var m=a.get(["label","margin"]),y=_ye(n,i,a,l,m);z9(r,i,a,o,y)},t}(DN);function _ye(e,t,r,n,i){var a=t.axis,o=a.dataToCoord(e),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l=n.getRadiusAxis().getExtent(),u,c,h;if(a.dim==="radius"){var f=Ft();_s(f,f,s),_a(f,f,[n.cx,n.cy]),u=pa([o,-i],f);var d=t.getModel("axisLabel").get("rotate")||0,g=Nn.innerTextLayout(s,d*Math.PI/180,-1);c=g.textAlign,h=g.textVerticalAlign}else{var m=l[1];u=n.coordToPoint([m+i,o]);var y=n.cx,_=n.cy;c=Math.abs(u[0]-y)/m<.3?"center":u[0]>y?"left":"right",h=Math.abs(u[1]-_)/m<.3?"middle":u[1]>_?"top":"bottom"}return{position:u,align:c,verticalAlign:h}}var xye={line:function(e,t,r,n,i){return e.dim==="angle"?{type:"Line",shape:jN(t.coordToPoint([i[0],r]),t.coordToPoint([i[1],r]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r}}},shadow:function(e,t,r,n,i,a,o){var s=Math.PI/180,l=ON(e,a,o),u;if(e.dim==="angle")u=oz(t.cx,t.cy,i[0],i[1],(-r-l/2)*s,(-r+l/2)*s);else{var c=zN(r,n,l),h=c[0],f=c[1];u=oz(t.cx,t.cy,h,f,0,Math.PI*2)}return{type:"Sector",shape:u}}},ro="polar",fz=ro,bye=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.findAxisModel=function(r){var n,i=this.ecModel;return i.eachComponent(r,function(a){a.getCoordSysModel()===this&&(n=a)},this),n},t.type=ro,t.dependencies=["radiusAxis","angleAxis"],t.defaultOption={z:0,center:["50%","50%"],radius:"80%"},t}(Xe),BN=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",Kt).models[0]},t.type="polarAxis",t}(Xe);vr(BN,Td);var wye=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="angleAxis",t}(BN),Sye=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="radiusAxis",t}(BN),FN=function(e){q(t,e);function t(r,n){return e.call(this,"radius",r,n)||this}return t.prototype.pointToData=function(r,n){return this.polar.pointToData(r,n)[this.dim==="radius"?0:1]},t}(Ki);FN.prototype.dataToRadius=Ki.prototype.dataToCoord;FN.prototype.radiusToData=Ki.prototype.coordToData;var Cye=He(),VN=function(e){q(t,e);function t(r,n){return e.call(this,"angle",r,n||[0,360])||this}return t.prototype.pointToData=function(r,n){return this.polar.pointToData(r,n)[this.dim==="radius"?0:1]},t.prototype.calculateCategoryInterval=function(){var r=this,n=r.getLabelModel(),i=r.scale,a=i.getExtent(),o=i.count();if(a[1]-a[0]<1)return 0;var s=a[0],l=r.dataToCoord(s+1)-r.dataToCoord(s),u=Math.abs(l),c=tb(s==null?"":s+"",n.getFont(),"center","top"),h=Math.max(c.height,7),f=h/u;isNaN(f)&&(f=1/0);var d=Math.max(0,Math.floor(f)),g=Cye(r.model),m=g.lastAutoInterval,y=g.lastTickCount;return m!=null&&y!=null&&Math.abs(m-d)<=1&&Math.abs(y-o)<=1&&m>d?d=m:(g.lastTickCount=o,g.lastAutoInterval=d),d},t}(Ki);VN.prototype.dataToAngle=Ki.prototype.dataToCoord;VN.prototype.angleToData=Ki.prototype.coordToData;var U9=["radius","angle"],Tye=function(){function e(t){this.dimensions=U9,this.type=ro,this.cx=0,this.cy=0,this._radiusAxis=new FN,this._angleAxis=new VN,this.axisPointerEnabled=!0,this.name=t||"",this._radiusAxis.polar=this._angleAxis.polar=this}return e.prototype.containPoint=function(t){var r=this.pointToCoord(t);return this._radiusAxis.contain(r[0])&&this._angleAxis.contain(r[1])},e.prototype.containData=function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},e.prototype.getAxis=function(t){var r="_"+t+"Axis";return this[r]},e.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},e.prototype.getAxesByScale=function(t){var r=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===t&&r.push(n),i.scale.type===t&&r.push(i),r},e.prototype.getAngleAxis=function(){return this._angleAxis},e.prototype.getRadiusAxis=function(){return this._radiusAxis},e.prototype.getOtherAxis=function(t){var r=this._angleAxis;return t===r?this._radiusAxis:r},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},e.prototype.getTooltipAxes=function(t){var r=t!=null&&t!=="auto"?this.getAxis(t):this.getBaseAxis();return{baseAxes:[r],otherAxes:[this.getOtherAxis(r)]}},e.prototype.dataToPoint=function(t,r,n){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],r),this._angleAxis.dataToAngle(t[1],r)],n)},e.prototype.pointToData=function(t,r,n){n=n||[];var i=this.pointToCoord(t);return n[0]=this._radiusAxis.radiusToData(i[0],r),n[1]=this._angleAxis.angleToData(i[1],r),n},e.prototype.pointToCoord=function(t){var r=t[0]-this.cx,n=t[1]-this.cy,i=this.getAngleAxis(),a=i.getExtent(),o=Math.min(a[0],a[1]),s=Math.max(a[0],a[1]);i.inverse?o=s-360:s=o+360;var l=Math.sqrt(r*r+n*n);r/=l,n/=l;for(var u=Math.atan2(-n,r)/Math.PI*180,c=us;)u+=c*360;return[l,u]},e.prototype.coordToPoint=function(t,r){r=r||[];var n=t[0],i=t[1]/180*Math.PI;return r[0]=Math.cos(i)*n+this.cx,r[1]=-Math.sin(i)*n+this.cy,r},e.prototype.getArea=function(){var t=this.getAngleAxis(),r=this.getRadiusAxis(),n=r.getExtent().slice();n[0]>n[1]&&n.reverse();var i=t.getExtent(),a=Math.PI/180,o=1e-4;return{cx:this.cx,cy:this.cy,r0:n[0],r:n[1],startAngle:-i[0]*a,endAngle:-i[1]*a,clockwise:t.inverse,contain:function(s,l){var u=s-this.cx,c=l-this.cy,h=u*u+c*c,f=this.r,d=this.r0;return f!==d&&h-o<=f*f&&h+o>=d*d},x:this.cx-n[1],y:this.cy-n[1],width:n[1]*2,height:n[1]*2}},e.prototype.convertToPixel=function(t,r,n){var i=dz(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=dz(r);return i===this?this.pointToData(n):null},e}();function dz(e){var t=e.seriesModel,r=e.polarModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function Mye(e,t,r){var n=t.get("center"),i=kr(t,r).refContainer;e.cx=he(n[0],i.width)+i.x,e.cy=he(n[1],i.height)+i.y;var a=e.getRadiusAxis(),o=Math.min(i.width,i.height)/2,s=t.get("radius");s==null?s=[0,"100%"]:ne(s)||(s=[0,s]);var l=[he(s[0],o),he(s[1],o)];a.inverse?a.setExtent(l[1],l[0]):a.setExtent(l[0],l[1])}function Aye(e,t){var r=this,n=r.getAngleAxis(),i=r.getRadiusAxis();if(wc(n,Gf),wc(i,Gf),Hf(n),Hf(i),n.type==="category"&&!n.onBand){var a=n.getExtent(),o=360/n.scale.count();n.inverse?a[1]+=o:a[1]-=o,n.setExtent(a[0],a[1])}}function Lye(e){return e.mainType==="angleAxis"}function vz(e,t){var r;if(e.type=um(t),e.scale=Sd(t,e.type,!1),e.onBand=hm(e.scale,t),e.inverse=t.get("inverse"),Lye(t)){e.inverse=e.inverse!==t.get("clockwise");var n=t.get("startAngle"),i=(r=t.get("endAngle"))!==null&&r!==void 0?r:n+(e.inverse?-360:360);e.setExtent(n,i)}t.axis=e,e.model=t}var kye={dimensions:U9,create:function(e,t){var r=[];return e.eachComponent(fz,function(n,i){var a=new Tye(i+"");a.update=Aye;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");vz(o,l),vz(s,u),Mye(a,n,t),r.push(a),n.coordinateSystem=a,a.model=n}),e.eachSeries(function(n){if(n.get("coordinateSystem")===ro){var i=n.getReferringComponents(fz,Kt).models[0],a=n.coordinateSystem=i.coordinateSystem;a&&(bc(a.getRadiusAxis(),n,ro),bc(a.getAngleAxis(),n,ro))}}),r}},Iye=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function x0(e,t,r){t[1]>t[0]&&(t=t.slice().reverse());var n=e.coordToPoint([t[0],r]),i=e.coordToPoint([t[1],r]);return{x1:n[0],y1:n[1],x2:i[0],y2:i[1]}}function b0(e){var t=e.getRadiusAxis();return t.inverse?0:1}function pz(e){var t=e[0],r=e[e.length-1];t&&r&&Math.abs(Math.abs(t.coord-r.coord)-360)<1e-4&&e.pop()}var Nye=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.axisPointerClass="PolarAxisPointer",r}return t.prototype.render=function(r,n){if(this.group.removeAll(),!!r.get("show")){var i=r.axis,a=i.polar,o=a.getRadiusAxis().getExtent(),s=i.getTicksCoords({breakTicks:"none"}),l=i.getMinorTicksCoords(),u=[];E(i.getViewLabels(),function(c){if(!c.tick.offInterval){c=Se(c);var h=i.scale;c.coord=i.dataToCoord(Cd(h,c.tick)),u.push(c)}}),pz(u),pz(s),E(Iye,function(c){r.get([c,"show"])&&(!i.scale.isBlank()||c==="axisLine")&&Pye[c](this.group,r,a,s,l,o,u)},this)}},t.type="angleAxis",t}(Xc),Pye={axisLine:function(e,t,r,n,i,a){var o=t.getModel(["axisLine","lineStyle"]),s=r.getAngleAxis(),l=Math.PI/180,u=s.getExtent(),c=b0(r),h=c?0:1,f,d=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[h]===0?f=new Hc[d]({shape:{cx:r.cx,cy:r.cy,r:a[c],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):f=new hd({shape:{cx:r.cx,cy:r.cy,r:a[c],r0:a[h]},style:o.getLineStyle(),z2:1,silent:!0}),f.style.fill=null,e.add(f)},axisTick:function(e,t,r,n,i,a){var o=t.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[b0(r)],u=ae(n,function(c){return new cr({shape:x0(r,[l,l+s],c.coord)})});e.add(ii(u,{style:Le(o.getModel("lineStyle").getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])})}))},minorTick:function(e,t,r,n,i,a){if(i.length){for(var o=t.getModel("axisTick"),s=t.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[b0(r)],c=[],h=0;h_?"left":"right",S=Math.abs(y[1]-x)/m<.3?"middle":y[1]>x?"top":"bottom";if(s&&s[g]){var T=s[g];Ie(T)&&T.textStyle&&(d=new Ke(T.textStyle,l,l.ecModel))}var M=new rt({silent:Nn.isLabelSilent(t),style:Lt(d,{x:y[0],y:y[1],fill:d.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:h.formattedLabel,align:w,verticalAlign:S})});if(e.add(M),bs({el:M,componentModel:t,itemName:h.formattedLabel,formatterParamsExtra:{isTruncated:function(){return M.isTruncated},value:h.rawLabel,tickIndex:f}}),c){var A=Nn.makeAxisEventDataBase(t);A.targetType="axisLabel",A.value=h.rawLabel,Re(M).eventData=A}},this)},splitLine:function(e,t,r,n,i,a){var o=t.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],h=0;h=0?"p":"n",P=w;_&&(n[a][A]||(n[a][A]={p:w,n:w}),P=n[a][A][N]);var I=void 0,D=void 0,O=void 0,j=void 0;if(c.dim==="radius"){var B=c.dataToCoord(M)-w,U=e.dataToCoord(A);$t(B)=j})}}function Vye(e,t){var r=Yc(t,ro),n=ln(e,{fromStat:{key:r},min:1}).w,i=n,a=0,o="20%",s="30%",l={};xc(e,r,function(y){var _=W9(y);l[_]||a++,l[_]=l[_]||{width:0,maxWidth:0};var x=he(y.get("barWidth"),n),w=he(y.get("barMaxWidth"),n),S=y.get("barGap"),T=y.get("barCategoryGap");x&&!l[_].width&&(x=_t(i,x),l[_].width=x,i-=x),w&&(l[_].maxWidth=w),S!=null&&(s=S),T!=null&&(o=T)});var u={},c=he(o,n),h=he(s,1),f=(i-c)/(a+(a-1)*h);f=$e(f,0),E(l,function(y,_){var x=y.maxWidth;x&&x=r.y&&t[1]<=r.y+r.height:n.contain(n.toLocalCoord(t[1]))&&t[0]>=r.y&&t[0]<=r.y+r.height},e.prototype.pointToData=function(t,r,n){n=n||[];var i=this.getAxis();return n[0]=i.coordToData(i.toLocalCoord(t[i.orient==="horizontal"?0:1])),n},e.prototype.dataToPoint=function(t,r,n){var i=this.getAxis(),a=this.getRect();n=n||[];var o=i.orient==="horizontal"?0:1;return t instanceof Array&&(t=t[0]),n[o]=i.toGlobalCoord(i.dataToCoord(+t)),n[1-o]=o===0?a.y+a.height/2:a.x+a.width/2,n},e.prototype.convertToPixel=function(t,r,n){var i=gz(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=gz(r);return i===this?this.pointToData(n):null},e}();function gz(e){var t=e.seriesModel,r=e.singleAxisModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function Jye(e,t){var r=[];return e.eachComponent(lA,function(n,i){var a=new Kye(n,e,t);a.name="single_"+i,a.resize(n,t),n.coordinateSystem=a,r.push(a)}),e.eachSeries(function(n){if(n.get("coordinateSystem")===Xce){var i=n.getReferringComponents(lA,Kt).models[0],a=n.coordinateSystem=i&&i.coordinateSystem;a&&bc(a.getAxis(),n,Eb)}}),r}var Qye={create:Jye,dimensions:Z9},mz=["x","y"],e0e=["width","height"],t0e=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis,l=s.coordinateSystem,u=s1(s),c=w0(l,u),h=w0(l,1-u),f=l.dataToPoint(n)[0],d=a.get("type");if(d&&d!=="none"){var g=EN(a),m=r0e[d](s,f,c,h,a.get("seriesDataIndices"),a.ecModel);m.style=g,r.graphicKey=m.type,r.pointer=m}var y=LA(i);F9(n,r,y,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=LA(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=RN(n.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(r,n,i,a){var o=i.axis,s=o.coordinateSystem,l=s1(o),u=w0(s,l),c=[r.x,r.y];c[l]+=n[l],c[l]=Math.min(u[1],c[l]),c[l]=Math.max(u[0],c[l]);var h=w0(s,1-l),f=(h[1]+h[0])/2,d=[f,f];return d[l]=c[l],{x:c[0],y:c[1],rotation:r.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}},t}(DN),r0e={line:function(e,t,r,n){var i=jN([t,n[0]],[t,n[1]],s1(e));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(e,t,r,n,i,a){var o=ON(e,i,a),s=n[1]-n[0],l=zN(t,r,o),u=l[0],c=l[1];return{type:"Rect",shape:V9([u,n[0]],[c-u,s],s1(e))}}};function s1(e){return e.isHorizontal()?0:1}function w0(e,t){var r=e.getRect();return[r[mz[t]],r[mz[t]]+r[e0e[t]]]}var n0e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="single",t}(It);function i0e(e){We(mm),Xc.registerAxisPointerClass("SingleAxisPointer",t0e),e.registerComponentView(n0e),e.registerComponentView(Yye),e.registerComponentModel(g_),Wf(e,"single",g_,g_.defaultOption),e.registerCoordinateSystem("single",Qye)}var a0e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n,i){var a=Wc(r);e.prototype.init.apply(this,arguments),yz(r,a)},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),yz(this.option,r)},t.prototype.getCellSize=function(){return this.option.cellSize},t.type="calendar",t.layoutMode="box",t.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:K.color.axisLine,width:1,type:"solid"}},itemStyle:{color:K.color.neutral00,borderWidth:1,borderColor:K.color.neutral10},dayLabel:{show:!0,firstDay:0,position:"start",margin:K.size.s,color:K.color.secondary},monthLabel:{show:!0,position:"start",margin:K.size.s,align:"center",formatter:null,color:K.color.secondary},yearLabel:{show:!0,position:null,margin:K.size.xl,formatter:null,color:K.color.quaternary,fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},t}(Xe);function yz(e,t){var r=e.cellSize,n;ne(r)?n=r:n=e.cellSize=[r,r],n.length===1&&(n[1]=n[0]);var i=ae([0,1],function(a){return one(t,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});vo(e,t,{type:"box",ignoreSize:i})}var o0e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=this.group;a.removeAll();var o=r.coordinateSystem,s=o.getRangeInfo(),l=o.getOrient(),u=n.getLocaleModel();this._renderDayRect(r,s,a),this._renderLines(r,s,l,a),this._renderYearText(r,s,l,a),this._renderMonthText(r,u,l,a),this._renderWeekText(r,u,s,l,a)},t.prototype._renderDayRect=function(r,n,i){for(var a=r.coordinateSystem,o=r.getModel("itemStyle").getItemStyle(),s=a.getCellWidth(),l=a.getCellHeight(),u=n.start.time;u<=n.end.time;u=a.getNextNDay(u,1).time){var c=a.dataToCalendarLayout([u],!1).tl,h=new Ye({shape:{x:c[0],y:c[1],width:s,height:l},cursor:"default",style:o});i.add(h)}},t.prototype._renderLines=function(r,n,i,a){var o=this,s=r.coordinateSystem,l=r.getModel(["splitLine","lineStyle"]).getLineStyle(),u=r.get(["splitLine","show"]),c=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var h=n.start,f=0;h.time<=n.end.time;f++){g(h.formatedDate),f===0&&(h=s.getDateInfo(n.start.y+"-"+n.start.m));var d=h.date;d.setMonth(d.getMonth()+1),h=s.getDateInfo(d)}g(s.getNextNDay(n.end.time,1).formatedDate);function g(m){o._firstDayOfMonth.push(s.getDateInfo(m)),o._firstDayPoints.push(s.dataToCalendarLayout([m],!1).tl);var y=o._getLinePointsOfOneWeek(r,m,i);o._tlpoints.push(y[0]),o._blpoints.push(y[y.length-1]),u&&o._drawSplitline(y,l,a)}u&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,c,i),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,c,i),l,a)},t.prototype._getEdgesPoints=function(r,n,i){var a=[r[0].slice(),r[r.length-1].slice()],o=i==="horizontal"?0:1;return a[0][o]=a[0][o]-n/2,a[1][o]=a[1][o]+n/2,a},t.prototype._drawSplitline=function(r,n,i){var a=new Zr({z2:20,shape:{points:r},style:n});i.add(a)},t.prototype._getLinePointsOfOneWeek=function(r,n,i){for(var a=r.coordinateSystem,o=a.getDateInfo(n),s=[],l=0;l<7;l++){var u=a.getNextNDay(o.time,l),c=a.dataToCalendarLayout([u.time],!1);s[2*u.day]=c.tl,s[2*u.day+1]=c[i==="horizontal"?"bl":"tr"]}return s},t.prototype._formatterLabel=function(r,n){return ue(r)&&r?AH(r,n):Ce(r)?r(n):n.nameMap},t.prototype._yearTextPositionControl=function(r,n,i,a,o){var s=n[0],l=n[1],u=["center","bottom"];a==="bottom"?(l+=o,u=["center","top"]):a==="left"?s-=o:a==="right"?(s+=o,u=["center","top"]):l-=o;var c=0;return(a==="left"||a==="right")&&(c=Math.PI/2),{rotation:c,x:s,y:l,style:{align:u[0],verticalAlign:u[1]}}},t.prototype._renderYearText=function(r,n,i,a){var o=r.getModel("yearLabel");if(o.get("show")){var s=o.get("margin"),l=o.get("position");l||(l=i!=="horizontal"?"top":"left");var u=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],c=(u[0][0]+u[1][0])/2,h=(u[0][1]+u[1][1])/2,f=i==="horizontal"?0:1,d={top:[c,u[f][1]],bottom:[c,u[1-f][1]],left:[u[1-f][0],h],right:[u[f][0],h]},g=n.start.y;+n.end.y>+n.start.y&&(g=g+"-"+n.end.y);var m=o.get("formatter"),y={start:n.start.y,end:n.end.y,nameMap:g},_=this._formatterLabel(m,y),x=new rt({z2:30,style:Lt(o,{text:_}),silent:o.get("silent")});x.attr(this._yearTextPositionControl(x,d[l],i,l,s)),a.add(x)}},t.prototype._monthTextPositionControl=function(r,n,i,a,o){var s="left",l="top",u=r[0],c=r[1];return i==="horizontal"?(c=c+o,n&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,n&&(l="middle"),a==="start"&&(s="right")),{x:u,y:c,align:s,verticalAlign:l}},t.prototype._renderMonthText=function(r,n,i,a){var o=r.getModel("monthLabel");if(o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),u=o.get("position"),c=o.get("align"),h=[this._tlpoints,this._blpoints];(!s||ue(s))&&(s&&(n=wM(s)||n),s=n.get(["time","monthAbbr"])||[]);var f=u==="start"?0:1,d=i==="horizontal"?0:1;l=u==="start"?-l:l;for(var g=c==="center",m=o.get("silent"),y=0;y=a.start.time&&i.times.end.time&&r.reverse(),r},e.prototype._getRangeInfo=function(t){var r=[this.getDateInfo(t[0]),this.getDateInfo(t[1])],n;r[0].time>r[1].time&&(n=!0,r.reverse());var i=Math.floor(r[1].time/hT)-Math.floor(r[0].time/hT)+1,a=new Date(r[0].time),o=a.getDate(),s=r[1].date.getDate();a.setDate(o+i-1);var l=a.getDate();if(l!==s)for(var u=a.getTime()-r[1].time>0?1:-1;(l=a.getDate())!==s&&(a.getTime()-r[1].time)*u>0;)i-=u,a.setDate(l-u);var c=Math.floor((i+r[0].day+6)/7),h=n?-c+1:c-1;return n&&r.reverse(),{range:[r[0].formatedDate,r[1].formatedDate],start:r[0],end:r[1],allDay:i,weeks:c,nthWeek:h,fweek:r[0].day,lweek:r[1].day}},e.prototype._getDateByWeeksAndDay=function(t,r,n){var i=this._getRangeInfo(n);if(t>i.weeks||t===0&&ri.lweek)return null;var a=(t-1)*7-i.fweek+r,o=new Date(i.start.time);return o.setDate(+i.start.d+a),this.getDateInfo(o)},e.create=function(t,r){var n=[];return t.eachComponent("calendar",function(i){var a=new e(i,t,r);n.push(a),i.coordinateSystem=a}),t.eachComponent(function(i,a){om({targetModel:a,coordSysType:"calendar",coordSysProvider:EH})}),n},e.dimensions=["time","value"],e}();function fT(e){var t=e.calendarModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}function l0e(e){e.registerComponentModel(a0e),e.registerComponentView(o0e),e.registerCoordinateSystem("calendar",s0e)}var Fo={level:1,leaf:2,nonLeaf:3},ts={none:0,all:1,body:2,corner:3};function kA(e,t,r){var n=t[ze[r]].getCell(e);return!n&&nt(e)&&e<0&&(n=t[ze[1-r]].getUnitLayoutInfo(r,Math.round(e))),n}function $9(e){var t=e||[];return t[0]=t[0]||[],t[1]=t[1]||[],t[0][0]=t[0][1]=t[1][0]=t[1][1]=NaN,t}function Y9(e,t,r,n,i){_z(e[0],t,i,r,n,0),_z(e[1],t,i,r,n,1)}function _z(e,t,r,n,i,a){e[0]=1/0,e[1]=-1/0;var o=n[a],s=ne(o)?o:[o],l=s.length,u=!!r;if(l>=1?(xz(e,t,s,u,i,a,0),l>1&&xz(e,t,s,u,i,a,l-1)):e[0]=e[1]=NaN,u){var c=-i[ze[1-a]].getLocatorCount(a),h=i[ze[a]].getLocatorCount(a)-1;r===ts.body?c=$e(0,c):r===ts.corner&&(h=_t(-1,h)),h=t[0]&&e[0]<=t[1]}function Sz(e,t){e.id.set(t[0][0],t[1][0]),e.span.set(t[0][1]-e.id.x+1,t[1][1]-e.id.y+1)}function h0e(e,t){e[0][0]=t[0][0],e[0][1]=t[0][1],e[1][0]=t[1][0],e[1][1]=t[1][1]}function Cz(e,t,r,n){var i=kA(t[n][0],r,n),a=kA(t[n][1],r,n);e[ze[n]]=e[nr[n]]=NaN,i&&a&&(e[ze[n]]=i.xy,e[nr[n]]=a.xy+a.wh-i.xy)}function Pv(e,t,r,n){return e[ze[t]]=r,e[ze[1-t]]=n,e}function f0e(e){return e&&(e.type===Fo.leaf||e.type===Fo.nonLeaf)?e:null}function l1(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var Tz=function(){function e(t,r){this._cells=[],this._levels=[],this.dim=t,this.dimIdx=t==="x"?0:1,this._model=r,this._uniqueValueGen=d0e(t);var n=r.get("data",!0),i=r.get("length",!0);if(n!=null&&!ne(n)&&(n=[]),n)this._initByDimModelData(n);else if(i!=null){n=Array(i);for(var a=0;a=1,w=r[ze[n]],S=a.getLocatorCount(n)-1,T=new fl;for(o.resetLayoutIterator(T,n);T.next();)M(T.item);for(a.resetLayoutIterator(T,n);T.next();)M(T.item);function M(A){tn(A.wh)&&(A.wh=_),A.xy=w,A.id[ze[n]]===S&&!x&&(A.wh=r[ze[n]]+r[nr[n]]-A.xy),w+=A.wh}}function Pz(e,t){for(var r=t[ze[e]].resetCellIterator();r.next();){var n=r.item;u1(n.rect,e,n.id,n.span,t),u1(n.rect,1-e,n.id,n.span,t),n.type===Fo.nonLeaf&&(n.xy=n.rect[ze[e]],n.wh=n.rect[nr[e]])}}function Dz(e,t){e.travelExistingCells(function(r){var n=r.span;if(n){var i=r.spanRect,a=r.id;u1(i,0,a,n,t),u1(i,1,a,n,t)}})}function u1(e,t,r,n,i){e[nr[t]]=0;var a=r[ze[t]],o=a<0?i[ze[1-t]]:i[ze[t]],s=o.getUnitLayoutInfo(t,r[ze[t]]);if(e[ze[t]]=s.xy,e[nr[t]]=s.wh,n[ze[t]]>1){var l=o.getUnitLayoutInfo(t,r[ze[t]]+n[ze[t]]-1);e[nr[t]]=l.xy+l.wh-s.xy}}function M0e(e,t,r){var n=cx(e,r[nr[t]]);return NA(n,r[nr[t]])}function NA(e,t){return Math.max(Math.min(e,ye(t,1/0)),0)}function pT(e){var t=e.matrixModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}var Jr={inBody:1,inCorner:2,outside:3},Ea={x:null,y:null,point:[]};function Ez(e,t,r,n,i){var a=r[ze[t]],o=r[ze[1-t]],s=a.getUnitLayoutInfo(t,a.getLocatorCount(t)-1),l=a.getUnitLayoutInfo(t,0),u=o.getUnitLayoutInfo(t,-o.getLocatorCount(t)),c=o.shouldShow()?o.getUnitLayoutInfo(t,-1):null,h=e.point[t]=n[t];if(!l&&!c){e[ze[t]]=Jr.outside;return}if(i===ts.body){l?(e[ze[t]]=Jr.inBody,h=_t(s.xy+s.wh,$e(l.xy,h)),e.point[t]=h):e[ze[t]]=Jr.outside;return}else if(i===ts.corner){c?(e[ze[t]]=Jr.inCorner,h=_t(c.xy+c.wh,$e(u.xy,h)),e.point[t]=h):e[ze[t]]=Jr.outside;return}var f=l?l.xy:c?c.xy+c.wh:NaN,d=u?u.xy:f,g=s?s.xy+s.wh:f;if(hg){if(!i){e[ze[t]]=Jr.outside;return}h=g}e.point[t]=h,e[ze[t]]=f<=h&&h<=g?Jr.inBody:d<=h&&h<=f?Jr.inCorner:Jr.outside}function Rz(e,t,r,n){var i=1-r;if(e[ze[r]]!==Jr.outside)for(n[ze[r]].resetCellIterator(vT);vT.next();){var a=vT.item;if(Oz(e.point[r],a.rect,r)&&Oz(e.point[i],a.rect,i)){t[r]=a.ordinal,t[i]=a.id[ze[i]];return}}}function jz(e,t,r,n){if(e[ze[r]]!==Jr.outside){var i=e[ze[r]]===Jr.inCorner?n[ze[1-r]]:n[ze[r]];for(i.resetLayoutIterator(A0,r);A0.next();)if(A0e(e.point[r],A0.item)){t[r]=A0.item.id[ze[r]];return}}}function A0e(e,t){return t.xy<=e&&e<=t.xy+t.wh}function Oz(e,t,r){return t[ze[r]]<=e&&e<=t[ze[r]]+t[nr[r]]}function L0e(e){e.registerComponentModel(m0e),e.registerComponentView(w0e),e.registerCoordinateSystem("matrix",T0e)}function k0e(e,t){var r=e.existing;if(t.id=e.keyInfo.id,!t.type&&r&&(t.type=r.type),t.parentId==null){var n=t.parentOption;n?t.parentId=n.id:r&&(t.parentId=r.parentId)}t.parentOption=null}function zz(e,t){var r;return E(t,function(n){e[n]!=null&&e[n]!=="auto"&&(r=!0)}),r}function I0e(e,t,r){var n=ee({},r),i=e[t],a=r.$action||"merge";a==="merge"?i?(Ge(i,n,!0),vo(i,n,{ignoreSize:!0}),BH(r,i),L0(r,i),L0(r,i,"shape"),L0(r,i,"style"),L0(r,i,"extra"),r.clipPath=i.clipPath):e[t]=n:a==="replace"?e[t]=n:a==="remove"&&i&&(e[t]=null)}var q9=["transition","enterFrom","leaveTo"],N0e=q9.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function L0(e,t,r){if(r&&(!e[r]&&t[r]&&(e[r]={}),e=e[r],t=t[r]),!(!e||!t))for(var n=r?q9:N0e,i=0;i=0;c--){var h=i[c],f=Cr(h.id,null),d=f!=null?o.get(f):null;if(d){var g=d.parent,_=ki(g),x=g===a?{width:s,height:l}:{width:_.width,height:_.height},w={},S=_b(d,h,x,null,{hv:h.hv,boundingMode:h.bounding},w);if(!ki(d).isNew&&S){for(var T=h.transition,M={},A=0;A=0)?M[N]=P:d[N]=P}ot(d,M,r,0)}else d.attr(w)}}},t.prototype._clear=function(){var r=this,n=this._elMap;n.each(function(i){x_(i,ki(i).option,n,r._lastGraphicModel)}),this._elMap=pe()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(It);function PA(e){var t=ge(Bz,e)?Bz[e]:ug(e),r=new t({});return ki(r).type=e,r}function Fz(e,t,r,n){var i=PA(r);return t.add(i),n.set(e,i),ki(i).id=e,ki(i).isNew=!0,i}function x_(e,t,r,n){var i=e&&e.parent;i&&(e.type==="group"&&e.traverse(function(a){x_(a,t,r,n)}),Hb(e,t,n),r.removeKey(ki(e).id))}function Vz(e,t,r,n){e.isGroup||E([["cursor",Zi.prototype.cursor],["zlevel",n||0],["z",r||0],["z2",0]],function(i){var a=i[0];ge(t,a)?e[a]=ye(t[a],i[1]):e[a]==null&&(e[a]=i[1])}),E(Qe(t),function(i){if(i.indexOf("on")===0){var a=t[i];e[i]=Ce(a)?a:null}}),ge(t,"draggable")&&(e.draggable=t.draggable),t.name!=null&&(e.name=t.name),t.id!=null&&(e.id=t.id)}function R0e(e){return e=ee({},e),E(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(RH),function(t){delete e[t]}),e}function j0e(e,t,r){var n=Re(e).eventData;!e.silent&&!e.ignore&&!n&&(n=Re(e).eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name}),n&&(n.info=r.info)}function O0e(e){e.registerComponentModel(D0e),e.registerComponentView(E0e),e.registerPreprocessor(function(t){var r=t.graphic;ne(r)?!r[0]||!r[0].elements?t.graphic=[{elements:r}]:t.graphic=[t.graphic[0]]:r&&!r.elements&&(t.graphic=[{elements:[r]}])})}var Gz=["x","y","radius","angle","single"],z0e=He(),B0e=["cartesian2d","polar","singleAxis"];function F0e(e){var t=e.get("coordinateSystem");return Be(B0e,t)>=0}function el(e){return e+"Axis"}function V0e(e,t){var r=pe(),n=[],i=pe();e.eachComponent({mainType:"dataZoom",query:t},function(c){i.get(c.uid)||s(c)});var a;do a=!1,e.eachComponent("dataZoom",o);while(a);function o(c){!i.get(c.uid)&&l(c)&&(s(c),a=!0)}function s(c){i.set(c.uid,!0),n.push(c),u(c)}function l(c){var h=!1;return c.eachTargetAxis(function(f,d){var g=r.get(f);g&&g[d]&&(h=!0)}),h}function u(c){c.eachTargetAxis(function(h,f){(r.get(h)||r.set(h,[]))[f]=!0})}return n}function K9(e){var t=e.ecModel,r={infoList:[],infoMap:pe()};return e.eachTargetAxis(function(n,i){var a=t.getComponent(el(n),i);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=r.infoMap.get(s);l||(l={model:o,axisModels:[]},r.infoList.push(l),r.infoMap.set(s,l)),l.axisModels.push(a)}}}),r}function J9(e){var t=z0e(DU(e));return t.axisProxyMap||(t.axisProxyMap=pe())}function c1(e){if(e)return J9(e.ecModel).get(e.uid)}function G0e(e,t){J9(e.ecModel).set(e.uid,t)}function Q9(e,t){var r=t.getAxisModel().axis.__alignTo;return r&&e.getAxisProxy(r.dim,r.model.componentIndex)?c1(r.model):null}var gT=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},e}(),Og=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._autoThrottle=!0,r._noTarget=!0,r._rangePropMode=["percent","percent"],r}return t.prototype.init=function(r,n,i){var a=Hz(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},t.prototype.mergeOption=function(r){var n=Hz(r);Ge(this.option,r,!0),Ge(this.settledOption,n,!0),this._doInit(n)},t.prototype._doInit=function(r){var n=this.option;this._setDefaultThrottle(r),this._updateRangeUse(r);var i=this.settledOption;E([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(n[a[0]]=i[a[0]]=null)},this),this._resetTarget()},t.prototype._resetTarget=function(){var r=this.get("orient",!0),n=this._targetAxisInfoMap=pe(),i=this._fillSpecifiedTargetAxis(n);i?this._orient=r||this._makeAutoOrientByTargetAxis():(this._orient=r||"horizontal",this._fillAutoTargetAxisByOrient(n,this._orient)),this._noTarget=!0,n.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},t.prototype._fillSpecifiedTargetAxis=function(r){var n=!1;return E(Gz,function(i){var a=this.getReferringComponents(el(i),kee);if(a.specified){n=!0;var o=new gT;E(a.models,function(s){o.add(s.componentIndex)}),r.set(i,o)}},this),n},t.prototype._fillAutoTargetAxisByOrient=function(r,n){var i=this.ecModel,a=!0;if(a){var o=n==="vertical"?"y":"x",s=i.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=i.findComponents({mainType:"singleAxis",filter:function(c){return c.get("orient",!0)===n}});l(s,"single")}function l(u,c){var h=u[0];if(h){var f=new gT;if(f.add(h.componentIndex),r.set(c,f),a=!1,c==="x"||c==="y"){var d=h.getReferringComponents("grid",Kt).models[0];d&&E(u,function(g){h.componentIndex!==g.componentIndex&&d===g.getReferringComponents("grid",Kt).models[0]&&f.add(g.componentIndex)})}}}a&&E(Gz,function(u){if(a){var c=i.findComponents({mainType:el(u),filter:function(f){return f.get("type",!0)==="category"}});if(c[0]){var h=new gT;h.add(c[0].componentIndex),r.set(u,h),a=!1}}},this)},t.prototype._makeAutoOrientByTargetAxis=function(){var r;return this.eachTargetAxis(function(n){!r&&(r=n)},this),r==="y"?"vertical":"horizontal"},t.prototype._setDefaultThrottle=function(r){if(r.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var n=this.ecModel.option;this.option.throttle=n.animation&&n.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(r){var n=this._rangePropMode,i=this.get("rangeMode");E([["start","startValue"],["end","endValue"]],function(a,o){var s=r[a[0]]!=null,l=r[a[1]]!=null;s&&!l?n[o]="percent":!s&&l?n[o]="value":i?n[o]=i[o]:s&&(n[o]="percent")})},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var r;return this.eachTargetAxis(function(n,i){r==null&&(r=this.ecModel.getComponent(el(n),i))},this),r},t.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(i,a){E(i.indexList,function(o){r.call(n,a,o)})})},t.prototype.getAxisProxy=function(r,n){return c1(this.getAxisModel(r,n))},t.prototype.getAxisModel=function(r,n){var i=this._targetAxisInfoMap.get(r);if(i&&i.indexMap[n])return this.ecModel.getComponent(el(r),n)},t.prototype.setRawRange=function(r){var n=this.option,i=this.settledOption;E([["start","startValue"],["end","endValue"]],function(a){(r[a[0]]!=null||r[a[1]]!=null)&&(n[a[0]]=i[a[0]]=r[a[0]],n[a[1]]=i[a[1]]=r[a[1]])},this),this._updateRangeUse(r)},t.prototype.setCalculatedRange=function(r){var n=this.option;E(["start","startValue","end","endValue"],function(i){n[i]=r[i]})},t.prototype.getPercentRange=function(){var r=this.findRepresentativeAxisProxy();if(r)return r.getWindow().percent},t.prototype.getValueRange=function(r,n){if(r==null&&n==null){var i=this.findRepresentativeAxisProxy();if(i)return i.getWindow().value}else return this.getAxisProxy(r,n).getWindow().value},t.prototype.findRepresentativeAxisProxy=function(r){if(r)return c1(r);for(var n,i=this._targetAxisInfoMap.keys(),a=0;ao[1];if(w&&!S&&!T)return!0;w&&(y=!0),S&&(g=!0),T&&(m=!0)}return y&&g&&m})}else E(c,function(d){if(a==="empty")l.setData(u=u.map(d,function(m){return s(m)?m:NaN}));else{var g={};g[d]=o,u.selectRange(g)}});E(c,function(d){u.setApproximateExtent(o,d)})}});function s(l){return l>=o[0]&&l<=o[1]}},e.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},r=this._dataZoomModel,n=this._extent;E(["min","max"],function(i){var a=r.get(i+"Span"),o=r.get(i+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=ut(n[0]+o,n,[0,100],!0):a!=null&&(o=ut(a,[0,100],n,!0)-n[0]),t[i+"Span"]=a,t[i+"ValueSpan"]=o},this)},e}(),Z0e={dirtyOnOverallProgress:!0,getTargetSeries:function(e){function t(i){e.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=e.getComponent(el(o),s);i(o,s,l,a)})})}var r=[];t(function(i,a,o,s){if(!c1(o)){var l=new W0e(i,a,s,e);r.push(l),G0e(o,l)}});var n=pe();return E(r,function(i){E(i.getTargetSeriesModels(),function(a){n.set(a.uid,a)})}),n},overallReset:function(e,t){e.eachComponent("dataZoom",function(r){var n=[];r.eachTargetAxis(function(i,a){var o=r.getAxisProxy(i,a),s=Q9(r,o);s?n.push([o,s]):o.reset(r,null)}),E(n,function(i){i[0].reset(r,i[1].getWindow().percentInverted)}),r.eachTargetAxis(function(i,a){r.getAxisProxy(i,a).filterData(r,t)})}),e.eachComponent("dataZoom",function(r){var n=r.findRepresentativeAxisProxy();if(n){var i=n.getWindow(),a=i.percent,o=i.value;r.setCalculatedRange({start:a[0],end:a[1],startValue:o[0],endValue:o[1]})}})}};function $0e(e){e.registerAction("dataZoom",function(t,r){var n=V0e(r,t);E(n,function(i){i.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}var Y0e=ld();function WN(e){Y0e(e,function(){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,Z0e),$0e(e),e.registerSubTypeDefaulter("dataZoom",function(){return"slider"})})}function X0e(e){e.registerComponentModel(H0e),e.registerComponentView(U0e),WN(e)}var no=function(){function e(){}return e}(),eZ={};function Oh(e,t){eZ[e]=t}function tZ(e){return eZ[e]}var q0e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n,i){var a=i.getTheme().get("toolbox"),o=a?a.feature:null;o&&(this._themeFeatureOption=ee({},o),a.feature={}),e.prototype.init.call(this,r,n,i),o&&(a.feature=o)},t.prototype.optionUpdated=function(){E(this.option.feature,function(r,n){var i=this._themeFeatureOption,a=tZ(n);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(this.ecModel)),i&&i[n]&&(Ge(r,i[n]),i[n]=null),Ge(r,a.defaultOption))},this)},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:K.color.border,borderRadius:0,borderWidth:0,padding:K.size.m,itemSize:15,itemGap:K.size.s,showTitle:!0,iconStyle:{borderColor:K.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:K.color.accent70}},tooltip:{show:!1,position:"bottom"}},t}(Xe);function rZ(e,t){var r=md(t.get("padding")),n=t.getItemStyle(["color","opacity"]);n.fill=t.get("backgroundColor");var i=new Ye({shape:{x:e.x-r[3],y:e.y-r[0],width:e.width+r[1]+r[3],height:e.height+r[0]+r[2],r:t.get("borderRadius")},style:n,silent:!0,z2:-1});return i}var K0e=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(r,n,i,a){var o=this.group;if(o.removeAll(),!r.get("show"))return;var s=+r.get("itemSize"),l=r.get("orient")==="vertical",u=r.get("feature")||{},c=this._features||(this._features=pe()),h=[];E(u,function(x,w){h.push(w)}),new ds(this._featureNames||[],h).add(f).update(f).remove(Ze(f,null)).execute(),this._featureNames=gt(h,function(x){return c.hasKey(x)});function f(x,w){var S=x!=null&&w==null,T=x!=null&&w!=null,M=x==null,A=S||T?h[x]:h[w],N=u[A],P=S||T?new Ke(N,r,n):null,I=P&&P.get("show"),D;if(S){if(!I)return;if(J0e(A))D={onclick:P.option.onclick,featureName:A};else{var O=tZ(A);if(!O)return;D=new O}c.set(A,D)}else D=c.get(A);if(M||!I){Uz(D)&&D.dispose&&D.dispose(n,i),c.removeKey(A);return}a&&a.newTitle!=null&&a.featureName===A&&(N.title=a.newTitle),S&&(D.uid=Uc("toolbox-feature")),D.model=P,D.ecModel=n,D.api=i,d(P,D,A),P.setIconStatus=function(j,B){var U=this.option,H=this.iconPaths;U.iconStatus=U.iconStatus||{},U.iconStatus[j]=B,H[j]&&(B==="emphasis"?hs:fs)(H[j])},Uz(D)&&D.render&&D.render(P,n,i,a)}function d(x,w,S){var T=x.getModel("iconStyle"),M=x.getModel(["emphasis","iconStyle"]),A=w instanceof no&&w.getIcons?w.getIcons():x.get("icon"),N=x.get("title")||{},P,I;ue(A)?(P={},P[S]=A):P=A,ue(N)?(I={},I[S]=N):I=N;var D=x.iconPaths={};E(P,function(O,j){var B=pd(O,{},{x:-s/2,y:-s/2,width:s,height:s});B.setStyle(T.getItemStyle());var U=B.ensureState("emphasis");U.style=M.getItemStyle();var H=new rt({style:{text:I[j],align:M.get("textAlign"),borderRadius:M.get("textBorderRadius"),padding:M.get("textPadding"),fill:null,font:Vk({fontStyle:M.get("textFontStyle"),fontFamily:M.get("textFontFamily"),fontSize:M.get("textFontSize"),fontWeight:M.get("textFontWeight")},n)},ignore:!0});B.setTextContent(H),bs({el:B,componentModel:r,itemName:j,formatterParamsExtra:{title:I[j]}}),B.__title=I[j],B.on("mouseover",function(){var V=M.getItemStyle(),z=l?r.get("right")==null&&r.get("left")!=="right"?"right":"left":r.get("bottom")==null&&r.get("top")!=="bottom"?"bottom":"top";H.setStyle({fill:M.get("textFill")||V.fill||V.stroke||K.color.neutral99,backgroundColor:M.get("textBackgroundColor")}),B.setTextConfig({position:M.get("textPosition")||z}),H.ignore=!r.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){x.get(["iconStatus",j])!=="emphasis"&&i.leaveEmphasis(this),H.hide()}),(x.get(["iconStatus",j])==="emphasis"?hs:fs)(B),o.add(B),B.on("click",de(w.onclick,w,n,i,j)),D[j]=B})}var g=kr(r,i).refContainer,m=r.getBoxLayoutParams(),y=r.get("padding"),_=Bt(m,g,y);qu(r.get("orient"),o,r.get("itemGap"),_.width,_.height),_b(o,m,g,y),o.add(rZ(o.getBoundingRect(),r)),l||o.eachChild(function(x){var w=x.__title,S=x.ensureState("emphasis"),T=S.textConfig||(S.textConfig={}),M=x.getTextContent(),A=M&&M.ensureState("emphasis");if(A&&!Ce(A)&&w){var N=A.style||(A.style={}),P=tb(w,rt.makeFont(N)),I=x.x+o.x,D=x.y+o.y+s,O=!1;D+P.height>i.getHeight()&&(T.position="top",O=!0);var j=O?-5-P.height:s+10;I+P.width/2>i.getWidth()?(T.position=["100%",j],N.align="right"):I-P.width/2<0&&(T.position=[0,j],N.align="left")}})},t.prototype.updateView=function(r,n,i,a){E(this._features,function(o){o&&o instanceof no&&o.updateView&&o.updateView(o.model,n,i,a)})},t.prototype.dispose=function(r,n){E(this._features,function(i){i&&i instanceof no&&i.dispose&&i.dispose(r,n)})},t.type="toolbox",t}(It);function J0e(e){return e.indexOf("my")===0}function Uz(e){return e instanceof no}var Q0e=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(r,n){var i=this.model,a=i.get("name")||r.get("title.0.text")||"echarts",o=n.getZr().painter.getType()==="svg",s=o?"svg":i.get("type",!0)||"png",l=n.getConnectedDataURL({type:s,backgroundColor:i.get("backgroundColor",!0)||r.get("backgroundColor")||K.color.neutral00,connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=et.browser;if(typeof MouseEvent=="function"&&(u.newEdge||!u.ie&&!u.edge)){var c=document.createElement("a");c.download=a+"."+s,c.target="_blank",c.href=l;var h=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(h)}else if(window.navigator.msSaveOrOpenBlob||o){var f=l.split(","),d=f[0].indexOf("base64")>-1,g=o?decodeURIComponent(f[1]):f[1];d&&(g=window.atob(g));var m=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var y=g.length,_=new Uint8Array(y);y--;)_[y]=g.charCodeAt(y);var x=new Blob([_]);window.navigator.msSaveOrOpenBlob(x,m)}else{var w=document.createElement("iframe");document.body.appendChild(w);var S=w.contentWindow,T=S.document;T.open("image/svg+xml","replace"),T.write(g),T.close(),S.focus(),T.execCommand("SaveAs",!0,m),document.body.removeChild(w)}}else{var M=i.get("lang"),A='',N=window.open();N.document.write(A),N.document.title=a}},t.getDefaultOption=function(r){var n={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:r.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:K.color.neutral00,name:"",excludeComponents:["toolbox"],lang:r.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},t}(no),Wz="__ec_magicType_stack__",e_e=[["line","bar"],["stack"]],t_e=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getIcons=function(){var r=this.model,n=r.get("icon"),i={};return E(r.get("type"),function(a){n[a]&&(i[a]=n[a])}),i},t.getDefaultOption=function(r){var n={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:r.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return n},t.prototype.onclick=function(r,n,i){var a=this.model,o=a.get(["seriesIndex",i]);if(Zz[i]){var s={series:[]},l=function(h){var f=h.subType,d=h.id,g=Zz[i](f,d,h,a);g&&(Le(g,h.option),s.series.push(g));var m=h.coordinateSystem;if(m&&m.type==="cartesian2d"&&(i==="line"||i==="bar")){var y=m.getAxesByScale("ordinal")[0];if(y){var _=y.dim,x=_+"Axis",w=h.getReferringComponents(x,Kt).models[0],S=w.componentIndex;s[x]=s[x]||[];for(var T=0;T<=S;T++)s[x][S]=s[x][S]||{};s[x][S].boundaryGap=i==="bar"}}};E(e_e,function(h){Be(h,i)>=0&&E(h,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(i,"emphasis"),r.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,c=i;i==="stack"&&(u=Ge({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",i])!=="emphasis"&&(c="tiled")),n.dispatchAction({type:"changeMagicType",currentType:c,newOption:s,newTitle:u,featureName:"magicType"})}},t}(no),Zz={line:function(e,t,r,n){if(e==="bar")return Ge({id:t,type:"line",data:r.get("data"),stack:r.get("stack"),markPoint:r.get("markPoint"),markLine:r.get("markLine")},n.get(["option","line"])||{},!0)},bar:function(e,t,r,n){if(e==="line")return Ge({id:t,type:"bar",data:r.get("data"),stack:r.get("stack"),markPoint:r.get("markPoint"),markLine:r.get("markLine")},n.get(["option","bar"])||{},!0)},stack:function(e,t,r,n){var i=r.get("stack")===Wz;if(e==="line"||e==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),Ge({id:t,stack:i?"":Wz},n.get(["option","stack"])||{},!0)}};wa({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)});var Ub=new Array(60).join("-"),qf=" ";function r_e(e){var t={},r=[],n=[];return e.eachRawSeries(function(i){var a=i.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=zue(o);t[s]||(t[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},n.push({axisDim:o.dim,axisIndex:o.index})),t[s].series.push(i)}else r.push(i)}else r.push(i)}),{seriesGroupByCategoryAxis:t,other:r,meta:n}}function n_e(e){var t=[];return E(e,function(r,n){var i=r.categoryAxis,a=r.valueAxis,o=a.dim,s=[" "].concat(ae(r.series,function(d){return d.name})),l=[i.model.getCategories()];E(r.series,function(d){var g=d.getRawData();l.push(d.getRawData().mapArray(g.mapDimension(o),function(m){return m}))});for(var u=[s.join(qf)],c=0;c=0)return!0}var DA=new RegExp("["+qf+"]+","g");function s_e(e){for(var t=e.split(/\n+/g),r=h1(t.shift()).split(DA),n=[],i=ae(r,function(l){return{name:l,data:[]}}),a=0;a=0;a--){var o=r[a];if(o[i])break}if(a<0){var s=e.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(s){var l=s.getPercentRange();r[0][i]={dataZoomId:i,start:l[0],end:l[1]}}}}),r.push(t)}function d_e(e){var t=ZN(e),r=t[t.length-1];t.length>1&&t.pop();var n={};return nZ(r,function(i,a){for(var o=t.length-1;o>=0;o--)if(i=t[o][a],i){n[a]=i;break}}),n}function v_e(e){iZ(e).snapshots=null}function p_e(e){return ZN(e).length}function ZN(e){var t=iZ(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var g_e=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(r,n){v_e(r),n.dispatchAction({type:"restore",from:this.uid})},t.getDefaultOption=function(r){var n={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:r.getLocaleModel().get(["toolbox","restore","title"])};return n},t}(no);wa({type:"restore",event:"restore",update:"prepareAndUpdate"},function(e,t){t.resetOption("recreate")});var m_e=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],$N=function(){function e(t,r,n){var i=this;this._targetInfoList=[];var a=$z(r,t);E(y_e,function(o,s){(!n||!n.include||Be(n.include,s)>=0)&&o(a,i._targetInfoList)})}return e.prototype.setOutputRanges=function(t,r){return this.matchOutputRanges(t,r,function(n,i,a){if((n.coordRanges||(n.coordRanges=[])).push(i),!n.coordRange){n.coordRange=i;var o=mT[n.brushType](0,a,i);n.__rangeOffset={offset:Kz[n.brushType](o.values,n.range,[1,1]),xyMinMax:o.xyMinMax}}}),t},e.prototype.matchOutputRanges=function(t,r,n){E(t,function(i){var a=this.findTargetInfo(i,r);a&&a!==!0&&E(a.coordSyses,function(o){var s=mT[i.brushType](1,o,i.range,!0);n(i,s.values,o,r)})},this)},e.prototype.setInputRanges=function(t,r){E(t,function(n){var i=this.findTargetInfo(n,r);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=mT[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?Kz[n.brushType](a.values,o.offset,__e(a.xyMinMax,o.xyMinMax)):a.values}},this)},e.prototype.makePanelOpts=function(t,r){return ae(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:r?r(n):null,clipPath:c9(i),isTargetByCursor:f9(i,t,n.coordSysModel),getLinearBrushOtherExtent:h9(i)}})},e.prototype.controlSeries=function(t,r,n){var i=this.findTargetInfo(t,n);return i===!0||i&&Be(i.coordSyses,r.coordinateSystem)>=0},e.prototype.findTargetInfo=function(t,r){for(var n=this._targetInfoList,i=$z(r,t),a=0;ae[1]&&e.reverse(),e}function $z(e,t){return df(e,t,{includeMainTypes:m_e})}var y_e={grid:function(e,t){var r=e.xAxisModels,n=e.yAxisModels,i=e.gridModels,a=pe(),o={},s={};!r&&!n&&!i||(E(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),E(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),E(i,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,c=[];E(u.getCartesians(),function(h,f){(Be(r,h.getAxis("x").model)>=0||Be(n,h.getAxis("y").model)>=0)&&c.push(h)}),t.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:c[0],coordSyses:c,getPanelRect:Xz.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(e,t){E(e.geoModels,function(r){var n=r.coordinateSystem;t.push({panelId:"geo--"+r.id,geoModel:r,coordSysModel:r,coordSys:n,coordSyses:[n],getPanelRect:Xz.geo})})}},Yz=[function(e,t){var r=e.xAxisModel,n=e.yAxisModel,i=e.gridModel;return!i&&r&&(i=r.axis.grid.model),!i&&n&&(i=n.axis.grid.model),i&&i===t.gridModel},function(e,t){var r=e.geoModel;return r&&r===t.geoModel}],Xz={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys.view,t=u7(null,e);return N6(t,t,Yx(null,e)),t}},mT={lineX:Ze(qz,0),lineY:Ze(qz,1),rect:function(e,t,r,n){var i=e?t.pointToData([r[0][0],r[1][0]],n):t.dataToPoint([r[0][0],r[1][0]],n),a=e?t.pointToData([r[0][1],r[1][1]],n):t.dataToPoint([r[0][1],r[1][1]],n),o=[EA([i[0],a[0]]),EA([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(e,t,r,n){var i=[Qr(),Qr()],a=ae(r,function(o){var s=e?t.pointToData(o,n):t.dataToPoint(o,n);return i[0][0]=Math.min(i[0][0],s[0]),i[1][0]=Math.min(i[1][0],s[1]),i[0][1]=Math.max(i[0][1],s[0]),i[1][1]=Math.max(i[1][1],s[1]),s});return{values:a,xyMinMax:i}}};function qz(e,t,r,n){var i=r.getAxis(["x","y"][e]),a=EA(ae([0,1],function(s){return t?i.coordToData(i.toLocalCoord(n[s]),!0):i.toGlobalCoord(i.dataToCoord(n[s]))})),o=[];return o[e]=a,o[1-e]=[NaN,NaN],{values:a,xyMinMax:o}}var Kz={lineX:Ze(Jz,0),lineY:Ze(Jz,1),rect:function(e,t,r){return[[e[0][0]-r[0]*t[0][0],e[0][1]-r[0]*t[0][1]],[e[1][0]-r[1]*t[1][0],e[1][1]-r[1]*t[1][1]]]},polygon:function(e,t,r){return ae(e,function(n,i){return[n[0]-r[0]*t[i][0],n[1]-r[1]*t[i][1]]})}};function Jz(e,t,r,n){return[t[0]-n[e]*r[0],t[1]-n[e]*r[1]]}function __e(e,t){var r=Qz(e),n=Qz(t),i=[r[0]/n[0],r[1]/n[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function Qz(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var RA=E,x_e=Cee("toolbox-dataZoom_"),b_e={x:"width",y:"height"},w_e=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(r,n,i,a){this._brushController||(this._brushController=new gN(i.getZr()),this._brushController.on("brush",de(this._onBrush,this)).mount()),T_e(r,n,this,a,i),C_e(r,n)},t.prototype.onclick=function(r,n,i){S_e[i].call(this)},t.prototype.dispose=function(r,n){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(r){var n=r.areas;if(!r.isEnd||!n.length)return;var i={},a=this.ecModel;this._brushController.updateCovers([]);var o=new $N(YN(this.model),a,{include:["grid"]});o.matchOutputRanges(n,a,function(u,c,h){if(h.type==="cartesian2d"){var f=h.master.getRect().clone(),d=u.brushType;d==="rect"?(s("x",h,f,c[0]),s("y",h,f,c[1])):s({lineX:"x",lineY:"y"}[d],h,f,c)}}),f_e(a,i),this._dispatchZoomAction(i);function s(u,c,h,f){var d=c.getAxis(u),g=d.model,m=l(u,g,a),y=m.findRepresentativeAxisProxy(g).getMinMaxSpan(),_=d.scale.getExtent();(y.minValueSpan!=null||y.maxValueSpan!=null)&&(f=Ll(0,f.slice(),_,0,y.minValueSpan,y.maxValueSpan));var x=pk(_,h[b_e[u]],.5);m&&(i[m.id]={dataZoomId:m.id,startValue:isFinite(x)?at(f[0],x):f[0],endValue:isFinite(x)?at(f[1],x):f[1]})}function l(u,c,h){var f;return h.eachComponent({mainType:"dataZoom",subType:"select"},function(d){var g=d.getAxisModel(u,c.componentIndex);g&&(f=d)}),f}},t.prototype._dispatchZoomAction=function(r){var n=[];RA(r,function(i,a){n.push(Se(i))}),n.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:n})},t.getDefaultOption=function(r){var n={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:r.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:K.color.backgroundTint}};return n},t}(no),S_e={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(d_e(this.ecModel))}};function YN(e){var t={xAxisIndex:e.get("xAxisIndex",!0),yAxisIndex:e.get("yAxisIndex",!0),xAxisId:e.get("xAxisId",!0),yAxisId:e.get("yAxisId",!0)};return t.xAxisIndex==null&&t.xAxisId==null&&(t.xAxisIndex="all"),t.yAxisIndex==null&&t.yAxisId==null&&(t.yAxisIndex="all"),t}function C_e(e,t){e.setIconStatus("back",p_e(t)>1?"emphasis":"normal")}function T_e(e,t,r,n,i){var a=r._isZoomActive;n&&n.type==="takeGlobalCursor"&&(a=n.key==="dataZoomSelect"?n.dataZoomSelectActive:!1),r._isZoomActive=a,e.setIconStatus("zoom",a?"emphasis":"normal");var o=new $N(YN(e),t,{include:["grid"]}),s=o.makePanelOpts(i,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});r._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:e.getModel("brushStyle").getItemStyle()}:!1)}fne("dataZoom",function(e){var t=e.getComponent("toolbox",0),r=["feature","dataZoom"];if(!t||t.get(r)==null)return;var n=t.getModel(r),i=[],a=YN(n),o=df(e,a);RA(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),RA(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,c){var h=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:x_e+u+h};f[c]=h,i.push(f)}return i});function M_e(e){e.registerComponentModel(q0e),e.registerComponentView(K0e),Oh("saveAsImage",Q0e),Oh("magicType",t_e),Oh("dataView",c_e),Oh("dataZoom",w_e),Oh("restore",g_e),We(X0e)}var A_e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click|mousewheel",alwaysShowContent:!1,renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,displayTransition:!0,enterable:!1,backgroundColor:K.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:K.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:K.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:K.color.tertiary,fontSize:14}},t}(Xe);function aZ(e){var t=e.get("confine");return t!=null?!!t:e.get("renderMode")==="richText"}function oZ(e){if(et.domSupported){for(var t=document.documentElement.style,r=0,n=e.length;r-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var c=u*Math.PI/180,h=o+i,f=h*Math.abs(Math.cos(c))+h*Math.abs(Math.sin(c)),d=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-h)/2)*100)/100;s+=";"+a+":-"+d+"px";var g=t+" solid "+i+"px;",m=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+g,"border-right:"+g,"background-color:"+n+";"];return'
'}function E_e(e,t,r){var n="cubic-bezier(0.23,1,0.32,1)",i="",a="";return r&&(i=" "+e/2+"s "+n,a="opacity"+i+",visibility"+i),t||(i=" "+e+"s "+n,a+=(a.length?",":"")+(et.transformSupported?""+XN+i:",left"+i+",top"+i)),I_e+":"+a}function e4(e,t,r){var n=e.toFixed(0)+"px",i=t.toFixed(0)+"px";if(!et.transformSupported)return r?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=et.transform3dSupported,o="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return r?"top:0;left:0;"+XN+":"+o+";":[["top",0],["left",0],[sZ,o]]}function R_e(e){var t=[],r=e.get("fontSize"),n=e.getTextColor();n&&t.push("color:"+n),t.push("font:"+e.getFont());var i=ye(e.get("lineHeight"),Math.round(r*3/2));r&&t.push("line-height:"+i+"px");var a=e.get("textShadowColor"),o=e.get("textShadowBlur")||0,s=e.get("textShadowOffsetX")||0,l=e.get("textShadowOffsetY")||0;return a&&o&&t.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),E(["decoration","align"],function(u){var c=e.get(u);c&&t.push("text-"+u+":"+c)}),t.join(";")}function j_e(e,t,r,n){var i=[],a=e.get("transitionDuration"),o=e.get("backgroundColor"),s=e.get("shadowBlur"),l=e.get("shadowColor"),u=e.get("shadowOffsetX"),c=e.get("shadowOffsetY"),h=e.getModel("textStyle"),f=mU(e,"html"),d=u+"px "+c+"px "+s+"px "+l;return i.push("box-shadow:"+d),t&&a>0&&i.push(E_e(a,r,n)),o&&i.push("background-color:"+o),E(["width","color","radius"],function(g){var m="border-"+g,y=eI(m),_=e.get(y);_!=null&&i.push(m+":"+_+(g==="color"?"":"px"))}),i.push(R_e(h)),f!=null&&i.push("padding:"+md(f).join("px ")+"px"),i.join(";")+";"}function t4(e,t,r,n,i){var a=t&&t.painter;if(r){var o=a&&a.getViewportRoot();o&&zJ(e,o,r,n,i)}else{e[0]=n,e[1]=i;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var O_e=function(){function e(t,r){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,et.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=t.getZr(),a=r.appendTo,o=a&&(ue(a)?document.querySelector(a):lc(a)?a:Ce(a)&&a(t.getDom()));t4(this._styleCoord,i,o,t.getWidth()/2,t.getHeight()/2),(o||t.getDom()).appendChild(n),this._api=t,this._container=o;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=i.handler,c=i.painter.getViewportRoot();Mi(c,l,!0),u.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return e.prototype.update=function(t){if(!this._container){var r=this._api.getDom(),n=k_e(r,"position"),i=r.style;i.position!=="absolute"&&n!=="absolute"&&(i.position="relative")}var a=t.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this._enableDisplayTransition=t.get("displayTransition")&&t.get("transitionDuration")>0,this.el.className=t.get("className")||""},e.prototype.show=function(t,r){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,a=this._styleCoord;n.innerHTML?i.cssText=N_e+j_e(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+e4(a[0],a[1],!0)+("border-color:"+yc(r)+";")+(t.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(t,r,n,i,a){var o=this.el;if(t==null){o.innerHTML="";return}var s="";if(ue(a)&&n.get("trigger")==="item"&&!aZ(n)&&(s=D_e(n,i,a)),ue(t))o.innerHTML=t+s;else if(t){o.innerHTML="",ne(t)||(t=[t]);for(var l=0;l=0?this._tryShow(a,o):i==="leave"&&this._hide(o))},this))},t.prototype._keepShow=function(){var r=this._tooltipModel,n=this._ecModel,i=this._api,a=r.get("triggerOn");if(r.get("trigger")!=="axis"&&(this._lastDataByCoordSys=null,this._cbParamsList=null),this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&o.manuallyShowTip(r,n,i,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(r,n,i,a){if(!(a.from===this.uid||et.node||!i.getDom())){var o=i4(a,i);this._ticket="";var s=a.dataByCoordSys,l=U_e(a,n,i);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var c=B_e;c.x=a.x,c.y=a.y,c.update(),Re(c).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:c},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(r,n,i,a))return;var h=H9(a,n),f=h.point[0],d=h.point[1];f!=null&&d!=null&&this._tryShow({offsetX:f,offsetY:d,target:h.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(i.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:i.getZr().findHover(a.x,a.y).target},o))}},t.prototype.manuallyHideTip=function(r,n,i,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,this._cbParamsList=null,a.from!==this.uid&&this._hide(i4(a,i))},t.prototype._manuallyAxisShowTip=function(r,n,i,a){var o=a.seriesIndex,s=a.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=n.getSeriesByIndex(o);if(u){var c=u.getData(),h=Ev([c.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},t.prototype._tryShow=function(r,n){var i=r.target,a=this._tooltipModel;if(a){this._lastX=r.offsetX,this._lastY=r.offsetY;var o=r.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,r);else if(i){var s=Re(i);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null,this._cbParamsList=null;var l,u;Vu(i,function(c){if(c.tooltipDisabled)return l=u=null,!0;l||u||(Re(c).dataIndex!=null?l=c:Re(c).tooltipConfig!=null&&(u=c))},!0),l?this._showSeriesItemTooltip(r,l,n):u?this._showComponentItemTooltip(r,u,n):this._hide(n)}else this._lastDataByCoordSys=null,this._cbParamsList=null,this._hide(n)}},t.prototype._showOrMove=function(r,n){var i=r.get("showDelay");n=de(n,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(n,i):n()},t.prototype._showAxisTooltip=function(r,n){var i=this._ecModel,a=this._tooltipModel,o=[n.offsetX,n.offsetY],s=Ev([n.tooltipOption],a),l=this._renderMode,u=[],c=_r("section",{blocks:[],noHeader:!0}),h=[],f=new $S;E(r,function(x){E(x.dataByAxis,function(w){var S=i.getComponent(w.axisDim+"Axis",w.axisIndex),T=w.value,M=S.axis,A=M.scale.parse(T);if(!(!S||T==null)){var N=B9(T,M,i,w.seriesDataIndices,w.valueLabelOpt),P=_r("section",{header:N,noHeader:!oi(N),sortBlocks:!0,blocks:[]});c.blocks.push(P),E(w.seriesDataIndices,function(I){var D=i.getSeriesByIndex(I.seriesIndex),O=I.dataIndexInside,j=D.getDataParams(O);if(!(j.dataIndex<0)){j.axisDim=w.axisDim,j.axisIndex=w.axisIndex,j.axisType=w.axisType,j.axisId=w.axisId,j.axisValue=Ex(S.axis,{value:A}),j.axisValueLabel=N,j.marker=f.makeTooltipMarker("item",yc(j.color),l);var B=hj(D.formatTooltip(O,!0,null)),U=B.frag;if(U){var H=Ev([D],a).get("valueFormatter");P.blocks.push(H?ee({valueFormatter:H},U):U)}B.text&&h.push(B.text),u.push(j)}})}})}),c.blocks.reverse(),h.reverse();var d=n.position,g=s.get("order"),m=mj(c,f,l,g,i.get("useUTC"),s.get("textStyle"));m&&h.unshift(m);var y=l==="richText"?` + +`:"
",_=h.join(y);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,u)?this._updatePosition(s,d,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,_,u,Math.random()+"",o[0],o[1],d,null,f)})},t.prototype._showSeriesItemTooltip=function(r,n,i){var a=this._ecModel,o=Re(n),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,c=o.dataIndex,h=o.dataType,f=u.getData(h),d=this._renderMode,g=r.positionDefault,m=Ev([f.getItemModel(c),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,g?{position:g}:null),y=m.get("trigger");if(!(y!=null&&y!=="item")){var _=u.getDataParams(c,h),x=new $S;_.marker=x.makeTooltipMarker("item",yc(_.color),d);var w=hj(u.formatTooltip(c,!1,h)),S=m.get("order"),T=m.get("valueFormatter"),M=w.frag,A=M?mj(T?ee({valueFormatter:T},M):M,x,d,S,a.get("useUTC"),m.get("textStyle")):w.text,N="item_"+u.name+"_"+c;this._showOrMove(m,function(){this._showTooltipContent(m,A,_,N,r.offsetX,r.offsetY,r.position,r.target,x)}),i({type:"showTip",dataIndexInside:c,dataIndex:f.getRawIndex(c),seriesIndex:s,from:this.uid})}},t.prototype._showComponentItemTooltip=function(r,n,i){var a=this._renderMode==="html",o=Re(n),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(ue(l)){var c=l;l={content:c,formatter:c},u=!0}u&&a&&l.content&&(l=Se(l),l.content=gn(l.content));var h=[l],f=this._ecModel.getComponent(o.componentMainType,o.componentIndex);f&&h.push(f),h.push({formatter:l.content});var d=r.positionDefault,g=Ev(h,this._tooltipModel,d?{position:d}:null),m=g.get("content"),y=Math.random()+"",_=new $S;this._showOrMove(g,function(){var x=Se(g.get("formatterParams")||{});this._showTooltipContent(g,m,x,y,r.offsetX,r.offsetY,r.position,n,_)}),i({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(r,n,i,a,o,s,l,u,c){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var h=this._tooltipContent;h.setEnterable(r.get("enterable"));var f=r.get("formatter");l=l||r.get("position");var d=n,g=this._getNearestPoint([o,s],i,r.get("trigger"),r.get("borderColor"),r.get("defaultBorderColor",!0)),m=g.color;if(f)if(ue(f)){var y=r.ecModel.get("useUTC"),_=ne(i)?i[0]:i,x=_&&_.axisType&&_.axisType.indexOf("time")>=0;d=f,x&&(d=am(_.axisValue,d,y)),d=tI(d,i,!0)}else if(Ce(f)){var w=de(function(S,T){S===this._ticket&&(h.setContent(T,c,r,m,l),this._updatePosition(r,l,o,s,h,i,u))},this);this._ticket=a,d=f(i,a,w)}else d=f;h.setContent(d,c,r,m,l),h.show(r,m),this._updatePosition(r,l,o,s,h,i,u)}},t.prototype._getNearestPoint=function(r,n,i,a,o){if(i==="axis"||ne(n))return{color:a||o};if(!ne(n))return{color:a||n.color||n.borderColor}},t.prototype._updatePosition=function(r,n,i,a,o,s,l){var u=this._api.getWidth(),c=this._api.getHeight();n=n||r.get("position");var h=o.getSize(),f=r.get("align"),d=r.get("verticalAlign"),g=l&&l.getBoundingRect().clone();if(l&&g.applyTransform(l.transform),Ce(n)&&(n=n([i,a],s,o.el,g,{viewSize:[u,c],contentSize:h.slice()})),ne(n))i=he(n[0],u),a=he(n[1],c);else if(Ie(n)){var m=n;m.width=h[0],m.height=h[1];var y=Bt(m,{width:u,height:c});i=y.x,a=y.y,f=null,d=null}else if(ue(n)&&l){var _=H_e(n,g,h,r.get("borderWidth"));i=_[0],a=_[1]}else{var _=V_e(i,a,o,u,c,f?null:20,d?null:20);i=_[0],a=_[1]}if(f&&(i-=a4(f)?h[0]/2:f==="right"?h[0]:0),d&&(a-=a4(d)?h[1]/2:d==="bottom"?h[1]:0),aZ(r)){var _=G_e(i,a,o,u,c);i=_[0],a=_[1]}o.moveTo(i,a)},t.prototype._updateContentNotChangedOnAxis=function(r,n){var i=this._lastDataByCoordSys,a=this._cbParamsList,o=!!i&&i.length===r.length;return o&&E(i,function(s,l){var u=s.dataByAxis||[],c=r[l]||{},h=c.dataByAxis||[];o=o&&u.length===h.length,o&&E(u,function(f,d){var g=h[d]||{},m=f.seriesDataIndices||[],y=g.seriesDataIndices||[];o=o&&f.value===g.value&&f.axisType===g.axisType&&f.axisId===g.axisId&&m.length===y.length,o&&E(m,function(_,x){var w=y[x];o=o&&_.seriesIndex===w.seriesIndex&&_.dataIndex===w.dataIndex}),a&&E(f.seriesDataIndices,function(_){var x=_.seriesIndex,w=n[x],S=a[x];w&&S&&S.data!==w.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=n,!!o},t.prototype._hide=function(r){this._lastDataByCoordSys=null,this._cbParamsList=null,r({type:"hideTip",from:this.uid})},t.prototype.dispose=function(r,n){et.node||!n.getDom()||(dg(this,"_updatePosition"),this._tooltipContent.dispose(),AA("itemTooltip",n),this._tooltipContent=null,this._tooltipModel=null,this._lastDataByCoordSys=null,this._cbParamsList=null)},t.type="tooltip",t}(It);function Ev(e,t,r){var n=t.ecModel,i;r?(i=new Ke(r,n,n),i=new Ke(t.option,i,n)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof Ke&&(o=o.get("tooltip",!0)),ue(o)&&(o={formatter:o}),o&&(i=new Ke(o,i,n)))}return i}function i4(e,t){return e.dispatchAction||de(t.dispatchAction,t)}function V_e(e,t,r,n,i,a,o){var s=r.getSize(),l=s[0],u=s[1];return a!=null&&(e+l+a+2>n?e-=l+a:e+=a),o!=null&&(t+u+o>i?t-=u+o:t+=o),[e,t]}function G_e(e,t,r,n,i){var a=r.getSize(),o=a[0],s=a[1];return e=Math.min(e+o,n)-o,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function H_e(e,t,r,n){var i=r[0],a=r[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,u=t.width,c=t.height;switch(e){case"inside":s=t.x+u/2-i/2,l=t.y+c/2-a/2;break;case"top":s=t.x+u/2-i/2,l=t.y-a-o;break;case"bottom":s=t.x+u/2-i/2,l=t.y+c+o;break;case"left":s=t.x-i-o,l=t.y+c/2-a/2;break;case"right":s=t.x+u+o,l=t.y+c/2-a/2}return[s,l]}function a4(e){return e==="center"||e==="middle"}function U_e(e,t,r){var n=bk(e).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=sd(t,i,n.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var c=Re(u).tooltipConfig;if(c&&c.name===e.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}function W_e(e){We(mm),e.registerComponentModel(A_e),e.registerComponentView(F_e),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Yt),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Yt)}var Z_e=["rect","polygon","keep","clear"];function $_e(e,t){var r=kt(e?e.brush:[]);if(r.length){var n=[];E(r,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(n=n.concat(u))});var i=e&&e.toolbox;ne(i)&&(i=i[0]),i||(i={feature:{}},e.toolbox=[i]);var a=i.feature||(i.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,n),ob(s,function(l){return l+""},null),t&&!s.length&&s.push.apply(s,Z_e)}}var o4=E;function s4(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function jA(e,t,r){var n={};return o4(t,function(a){var o=n[a]=i();o4(e[a],function(s,l){if(Rr.isValidType(l)){var u={type:l,visual:s};r&&r(u,a),o[l]=new Rr(u),l==="opacity"&&(u=Se(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new Rr(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function uZ(e,t,r){var n;E(r,function(i){t.hasOwnProperty(i)&&s4(t[i])&&(n=!0)}),n&&E(r,function(i){t.hasOwnProperty(i)&&s4(t[i])?e[i]=Se(t[i]):delete e[i]})}function Y_e(e,t,r,n,i,a){var o={};E(e,function(h){var f=Rr.prepareVisualTypes(t[h]);o[h]=f});var s;function l(h){return hI(r,s,h)}function u(h,f){AU(r,s,h,f)}r.each(c);function c(h,f){s=h;var d=r.getRawDataItem(s);if(!(d&&d.visualMap===!1))for(var g=n.call(i,h),m=t[g],y=o[g],_=0,x=y.length;_t[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&f4(t)}};function f4(e){return new Ae(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var nxe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){this.ecModel=r,this.api=n,this.model,(this._brushController=new gN(n.getZr())).on("brush",de(this._onBrush,this)).mount()},t.prototype.render=function(r,n,i,a){this.model=r,this._updateController(r,n,i,a)},t.prototype.updateTransform=function(r,n,i,a){cZ(n),this._updateController(r,n,i,a)},t.prototype.updateVisual=function(r,n,i,a){this.updateTransform(r,n,i,a)},t.prototype.updateView=function(r,n,i,a){this._updateController(r,n,i,a)},t.prototype._updateController=function(r,n,i,a){(!a||a.$from!==r.id)&&this._brushController.setPanels(r.brushTargetManager.makePanelOpts(i)).enableBrush(r.brushOption).updateCovers(r.areas.slice())},t.prototype.dispose=function(){this._brushController.dispose()},t.prototype._onBrush=function(r){var n=this.model.id,i=this.model.brushTargetManager.setOutputRanges(r.areas,this.ecModel);(!r.isEnd||r.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:n,areas:Se(i),$from:n}),r.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:n,areas:Se(i),$from:n})},t.type="brush",t}(It),ixe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.areas=[],r.brushOption={},r}return t.prototype.optionUpdated=function(r,n){var i=this.option;!n&&uZ(i,r,["inBrush","outOfBrush"]);var a=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:this.option.defaultOutOfBrushColor},a.hasOwnProperty("liftZ")||(a.liftZ=5)},t.prototype.setAreas=function(r){r&&(this.areas=ae(r,function(n){return d4(this.option,n)},this))},t.prototype.setBrushOption=function(r){this.brushOption=d4(this.option,r),this.brushType=this.brushOption.brushType},t.type="brush",t.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],t.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:K.color.backgroundTint,borderColor:K.color.borderTint},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:K.color.disabled},t}(Xe);function d4(e,t){return Ge({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new Ke(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var axe=["rect","polygon","lineX","lineY","keep","clear"],oxe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(r,n,i){var a,o,s;n.eachComponent({mainType:"brush"},function(l){a=l.brushType,o=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=a,this._brushMode=o,E(r.get("type",!0),function(l){r.setIconStatus(l,(l==="keep"?o==="multiple":l==="clear"?s:l===a)?"emphasis":"normal")})},t.prototype.updateView=function(r,n,i){this.render(r,n,i)},t.prototype.getIcons=function(){var r=this.model,n=r.get("icon",!0),i={};return E(r.get("type",!0),function(a){n[a]&&(i[a]=n[a])}),i},t.prototype.onclick=function(r,n,i){var a=this._brushType,o=this._brushMode;i==="clear"?(n.dispatchAction({type:"axisAreaSelect",intervals:[]}),n.dispatchAction({type:"brush",command:"clear",areas:[]})):n.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:i==="keep"?a:a===i?!1:i,brushMode:i==="keep"?o==="multiple"?"single":"multiple":o}})},t.getDefaultOption=function(r){var n={show:!0,type:axe.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:r.getLocaleModel().get(["toolbox","brush","title"])};return n},t}(no);function sxe(e){e.registerComponentView(nxe),e.registerComponentModel(ixe),e.registerPreprocessor($_e),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,K_e),e.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(t,r){r.eachComponent({mainType:"brush",query:t},function(n){n.setAreas(t.areas)})}),e.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},Yt),e.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},Yt),Oh("brush",oxe)}var lxe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.layoutMode={type:"box",ignoreSize:!0},r}return t.type="title",t.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:"center",top:K.size.m,backgroundColor:K.color.transparent,borderColor:K.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:K.color.primary},subtextStyle:{fontSize:12,color:K.color.quaternary}},t}(Xe),uxe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){if(this.group.removeAll(),!!r.get("show")){var a=this.group,o=r.getModel("textStyle"),s=r.getModel("subtextStyle"),l=r.get("textAlign"),u=ye(r.get("textBaseline"),r.get("textVerticalAlign")),c=new rt({style:Lt(o,{text:r.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),h=c.getBoundingRect(),f=r.get("subtext"),d=new rt({style:Lt(s,{text:f,fill:s.getTextColor(),y:h.height+r.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),g=r.get("link"),m=r.get("sublink"),y=r.get("triggerEvent",!0);c.silent=!g&&!y,d.silent=!m&&!y,g&&c.on("click",function(){xx(g,"_"+r.get("target"))}),m&&d.on("click",function(){xx(m,"_"+r.get("subtarget"))}),Re(c).eventData=Re(d).eventData=y?{componentType:"title",componentIndex:r.componentIndex}:null,a.add(c),f&&a.add(d);var _=a.getBoundingRect(),x=r.getBoxLayoutParams();x.width=_.width,x.height=_.height;var w=kr(r,i),S=Bt(x,w.refContainer,r.get("padding"));l||(l=r.get("left")||r.get("right"),l==="middle"&&(l="center"),l==="right"?S.x+=S.width:l==="center"&&(S.x+=S.width/2)),u||(u=r.get("top")||r.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?S.y+=S.height:u==="middle"&&(S.y+=S.height/2),u=u||"top"),a.x=S.x,a.y=S.y,a.markRedraw();var T={align:l,verticalAlign:u};c.setStyle(T),d.setStyle(T),_=a.getBoundingRect();var M=S.margin,A=r.getItemStyle(["color","opacity"]);A.fill=r.get("backgroundColor");var N=new Ye({shape:{x:_.x-M[3],y:_.y-M[0],width:_.width+M[1]+M[3],height:_.height+M[0]+M[2],r:r.get("borderRadius")},style:A,subPixelOptimize:!0,silent:!0});a.add(N)}},t.type="title",t}(It);function cxe(e){e.registerComponentModel(lxe),e.registerComponentView(uxe)}var v4=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.layoutMode="box",r}return t.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i),this._initData()},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),this._initData()},t.prototype.setCurrentIndex=function(r){r==null&&(r=this.option.currentIndex);var n=this._data.count();this.option.loop?r=(r%n+n)%n:(r>=n&&(r=n-1),r<0&&(r=0)),this.option.currentIndex=r},t.prototype.getCurrentIndex=function(){return this.option.currentIndex},t.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},t.prototype.setPlayState=function(r){this.option.autoPlay=!!r},t.prototype.getPlayState=function(){return!!this.option.autoPlay},t.prototype._initData=function(){var r=this.option,n=r.data||[],i=r.axisType,a=this._names=[],o;i==="category"?(o=[],E(n,function(u,c){var h=Cr(od(u),""),f;Ie(u)?(f=Se(u),f.value=c):f=c,o.push(f),a.push(h)})):o=n;var s={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new _n([{name:"value",type:s}],this);l.initData(o,a)},t.prototype.getData=function(){return this._data},t.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},t.type="timeline",t.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:K.size.m,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:K.color.secondary},data:[]},t}(Xe),hZ=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="timeline.slider",t.defaultOption=zl(v4.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:K.color.border,borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:K.color.accent10},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:K.color.tertiary},itemStyle:{color:K.color.accent20,borderWidth:0},checkpointStyle:{symbol:"circle",symbolSize:15,color:K.color.accent50,borderColor:K.color.accent50,borderWidth:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0, 0, 0, 0)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10.6699C11.5 9.90014 12.3333 9.41887 13 9.80371L20.5 14.1338C21.1667 14.5187 21.1667 15.4813 20.5 15.8662L13 20.1963C12.3333 20.5811 11.5 20.0999 11.5 19.3301V10.6699Z",stopIcon:"path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10C12.3284 10 13 10.6716 13 11.5V18.5C13 19.3284 12.3284 20 11.5 20C10.6716 20 10 19.3284 10 18.5V11.5C10 10.6716 10.6716 10 11.5 10ZM18.5 10C19.3284 10 20 10.6716 20 11.5V18.5C20 19.3284 19.3284 20 18.5 20C17.6716 20 17 19.3284 17 18.5V11.5C17 10.6716 17.6716 10 18.5 10Z",nextIcon:"path://M0.838834 18.7383C0.253048 18.1525 0.253048 17.2028 0.838834 16.617L7.55635 9.89949L0.838834 3.18198C0.253048 2.59619 0.253048 1.64645 0.838834 1.06066C1.42462 0.474874 2.37437 0.474874 2.96015 1.06066L10.7383 8.83883L10.8412 8.95277C11.2897 9.50267 11.2897 10.2963 10.8412 10.8462L10.7383 10.9602L2.96015 18.7383C2.37437 19.3241 1.42462 19.3241 0.838834 18.7383Z",prevIcon:"path://M10.9602 1.06066C11.5459 1.64645 11.5459 2.59619 10.9602 3.18198L4.24264 9.89949L10.9602 16.617C11.5459 17.2028 11.5459 18.1525 10.9602 18.7383C10.3744 19.3241 9.42462 19.3241 8.83883 18.7383L1.06066 10.9602L0.957771 10.8462C0.509245 10.2963 0.509245 9.50267 0.957771 8.95277L1.06066 8.83883L8.83883 1.06066C9.42462 0.474874 10.3744 0.474874 10.9602 1.06066Z",prevBtnSize:18,nextBtnSize:18,color:K.color.accent50,borderColor:K.color.accent50,borderWidth:0},emphasis:{label:{show:!0,color:K.color.accent60},itemStyle:{color:K.color.accent60,borderColor:K.color.accent60},controlStyle:{color:K.color.accent70,borderColor:K.color.accent70}},progress:{lineStyle:{color:K.color.accent30},itemStyle:{color:K.color.accent40}},data:[]}),t}(v4);vr(hZ,bb.prototype);var hxe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="timeline",t}(It),fxe=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this,r,n,i)||this;return o.type=a||"value",o}return t.prototype.getLabelModel=function(){return this.model.getModel("label")},t.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},t}(Ki),_T=Math.PI,p4=He(),dxe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(r,n){this.api=n},t.prototype.render=function(r,n,i){if(this.model=r,this.api=i,this.ecModel=n,this.group.removeAll(),r.get("show",!0)){var a=this._layout(r,i),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,r);r.formatTooltip=function(u){var c=l.scale.getLabel({value:u});return _r("nameValue",{noName:!0,value:c})},E(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,o,l,r)},this),this._renderAxisLabel(a,s,l,r),this._position(a,r)}this._doPlayStop(),this._updateTicksStatus()},t.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},t.prototype.dispose=function(){this._clearTimer()},t.prototype._layout=function(r,n){var i=r.get(["label","position"]),a=r.get("orient"),o=vxe(r,n),s;i==null||i==="auto"?s=a==="horizontal"?o.y+o.height/2=0||s==="+"?"left":"right"},u={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:_T/2},h=a==="vertical"?o.height:o.width,f=r.getModel("controlStyle"),d=f.get("show",!0),g=d?f.get("itemSize"):0,m=d?f.get("itemGap"):0,y=g+m,_=r.get(["label","rotate"])||0;_=_*_T/180;var x,w,S,T=f.get("position",!0),M=d&&f.get("showPlayBtn",!0),A=d&&f.get("showPrevBtn",!0),N=d&&f.get("showNextBtn",!0),P=0,I=h;T==="left"||T==="bottom"?(M&&(x=[0,0],P+=y),A&&(w=[P,0],P+=y),N&&(S=[I-g,0],I-=y)):(M&&(x=[I-g,0],I-=y),A&&(w=[0,0],P+=y),N&&(S=[I-g,0],I-=y));var D=[P,I];return r.get("inverse")&&D.reverse(),{viewRect:o,mainLength:h,orient:a,rotation:c[a],labelRotation:_,labelPosOpt:s,labelAlign:r.get(["label","align"])||l[a],labelBaseline:r.get(["label","verticalAlign"])||r.get(["label","baseline"])||u[a],playPosition:x,prevBtnPosition:w,nextBtnPosition:S,axisExtent:D,controlSize:g,controlGap:m}},t.prototype._position=function(r,n){var i=this._mainGroup,a=this._labelGroup,o=r.viewRect;if(r.orient==="vertical"){var s=Ft(),l=o.x,u=o.y+o.height;_a(s,s,[-l,-u]),_s(s,s,-_T/2),_a(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var c=x(o),h=x(i.getBoundingRect()),f=x(a.getBoundingRect()),d=[i.x,i.y],g=[a.x,a.y];g[0]=d[0]=c[0][0];var m=r.labelPosOpt;if(m==null||ue(m)){var y=m==="+"?0:1;w(d,h,c,1,y),w(g,f,c,1,1-y)}else{var y=m>=0?0:1;w(d,h,c,1,y),g[1]=d[1]+m}i.setPosition(d),a.setPosition(g),i.rotation=a.rotation=r.rotation,_(i),_(a);function _(S){S.originX=c[0][0]-S.x,S.originY=c[1][0]-S.y}function x(S){return[[S.x,S.x+S.width],[S.y,S.y+S.height]]}function w(S,T,M,A,N){S[A]+=M[A][N]-T[A][N]}},t.prototype._createAxis=function(r,n){var i=n.getData(),a=n.get("axisType")||n.get("type");a!=="category"&&a!=="time"&&(a="value");var o=Sd(n,a,!1);o.getTicks=function(){return i.mapArray(["value"],function(u){return{value:u}})};var s=i.getDataExtent("value");o.setExtent(s[0],s[1]),I8(o,{fixMinMax:[!0,!0]});var l=new fxe("value",o,r.axisExtent,a);return l.model=n,l},t.prototype._createGroup=function(r){var n=this[r]=new Me;return this.group.add(n),n},t.prototype._renderAxisLine=function(r,n,i,a){var o=i.getExtent();if(a.get(["lineStyle","show"])){var s=new cr({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:ee({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(s);var l=this._progressLine=new cr({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:Le({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});n.add(l)}},t.prototype._renderAxisTick=function(r,n,i,a){var o=this,s=a.getData(),l=i.scale.getTicks();this._tickSymbols=[],E(l,function(u){var c=i.dataToCoord(u.value),h=s.getItemModel(u.value),f=h.getModel("itemStyle"),d=h.getModel(["emphasis","itemStyle"]),g=h.getModel(["progress","itemStyle"]),m={x:c,y:0,onclick:de(o._changeTimeline,o,u.value)},y=g4(h,f,n,m);y.ensureState("emphasis").style=d.getItemStyle(),y.ensureState("progress").style=g.getItemStyle(),vl(y);var _=Re(y);h.get("tooltip")?(_.dataIndex=u.value,_.dataModel=a):_.dataIndex=_.dataModel=null,o._tickSymbols.push(y)})},t.prototype._renderAxisLabel=function(r,n,i,a){var o=this,s=i.getLabelModel();if(s.get("show")){var l=a.getData(),u=i.getViewLabels();this._tickLabels=[],E(u,function(c){if(!c.tick.offInterval){var h=c.tick.value,f=l.getItemModel(h),d=f.getModel("label"),g=f.getModel(["emphasis","label"]),m=f.getModel(["progress","label"]),y=i.dataToCoord(h),_=new rt({x:y,y:0,rotation:r.labelRotation-r.rotation,onclick:de(o._changeTimeline,o,h),silent:!1,style:Lt(d,{text:c.formattedLabel,align:r.labelAlign,verticalAlign:r.labelBaseline})});_.ensureState("emphasis").style=Lt(g),_.ensureState("progress").style=Lt(m),n.add(_),vl(_),p4(_).dataIndex=h,o._tickLabels.push(_)}})}},t.prototype._renderControl=function(r,n,i,a){var o=r.controlSize,s=r.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),c=a.getPlayState(),h=a.get("inverse",!0);f(r.nextBtnPosition,"next",de(this._changeTimeline,this,h?"-":"+")),f(r.prevBtnPosition,"prev",de(this._changeTimeline,this,h?"+":"-")),f(r.playPosition,c?"stop":"play",de(this._handlePlayClick,this,!c),!0);function f(d,g,m,y){if(d){var _=lo(ye(a.get(["controlStyle",g+"BtnSize"]),o),o),x=[0,-_/2,_,_],w=pxe(a,g+"Icon",x,{x:d[0],y:d[1],originX:o/2,originY:0,rotation:y?-s:0,rectHover:!0,style:l,onclick:m});w.ensureState("emphasis").style=u,n.add(w),vl(w)}}},t.prototype._renderCurrentPointer=function(r,n,i,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,c={onCreate:function(h){h.draggable=!0,h.drift=de(u._handlePointerDrag,u),h.ondragend=de(u._handlePointerDragend,u),m4(h,u._progressLine,s,i,a,!0)},onUpdate:function(h){m4(h,u._progressLine,s,i,a)}};this._currentPointer=g4(l,l,this._mainGroup,{},this._currentPointer,c)},t.prototype._handlePlayClick=function(r){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:r,from:this.uid})},t.prototype._handlePointerDrag=function(r,n,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},t.prototype._handlePointerDragend=function(r){this._pointerChangeTimeline([r.offsetX,r.offsetY],!0)},t.prototype._pointerChangeTimeline=function(r,n){var i=this._toAxisCoord(r)[0],a=this._axis,o=Hr(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(s[o]=+s[o].toFixed(g)),[s,d]}var P0={min:Ze(N0,"min"),max:Ze(N0,"max"),average:Ze(N0,"average"),median:Ze(N0,"median")};function zg(e,t){if(t){var r=e.getData(),n=e.coordinateSystem,i=n&&n.dimensions;if(!bxe(t)&&!ne(t.coord)&&ne(i)){var a=fZ(t,r,n,e);if(t=Se(t),t.type&&P0[t.type]&&a.baseAxis&&a.valueAxis){var o=Be(i,a.baseAxis.dim),s=Be(i,a.valueAxis.dim),l=P0[t.type](r,a.valueAxis.dim,a.baseDataDim,a.valueDataDim,o,s);t.coord=l[0],t.value=l[1]}else t.coord=[t.xAxis!=null?t.xAxis:t.radiusAxis,t.yAxis!=null?t.yAxis:t.angleAxis]}if(t.coord==null||!ne(i)){t.coord=[];var u=e.getBaseAxis();if(u&&t.type&&P0[t.type]){var c=n.getOtherAxis(u);c&&(t.value=f1(r,r.mapDimension(c.dim),t.type))}}else for(var h=t.coord,f=0;f<2;f++)P0[h[f]]&&(h[f]=f1(r,r.mapDimension(i[f]),h[f]));return t}}function fZ(e,t,r,n){var i={};return e.valueIndex!=null||e.valueDim!=null?(i.valueDataDim=e.valueIndex!=null?t.getDimension(e.valueIndex):e.valueDim,i.valueAxis=r.getAxis(wxe(n,i.valueDataDim)),i.baseAxis=r.getOtherAxis(i.valueAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim)):(i.baseAxis=n.getBaseAxis(),i.valueAxis=r.getOtherAxis(i.baseAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim),i.valueDataDim=t.mapDimension(i.valueAxis.dim)),i}function wxe(e,t){var r=e.getData().getDimensionInfo(t);return r&&r.coordDim}function Bg(e,t){return e&&e.containData&&t.coord&&!zA(t)?e.containData(t.coord):!0}function Sxe(e,t,r){return e&&e.containZone&&t.coord&&r.coord&&!zA(t)&&!zA(r)?e.containZone(t.coord,r.coord):!0}function dZ(e,t){return e?function(r,n,i,a){var o=a<2?r.coord&&r.coord[a]:r.value;return pl(o,t[a])}:function(r,n,i,a){return pl(r.value,t[a])}}function f1(e,t,r){if(r==="average"){var n=0,i=0;return e.each(t,function(a,o){isNaN(a)||(n+=a,i++)}),n/i}else return r==="median"?e.getMedian(t):e.getDataExtent(t)[r==="max"?1:0]}var xT=He(),KN=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.init=function(){this.markerGroupMap=pe()},t.prototype.render=function(r,n,i){var a=this,o=this.markerGroupMap;o.each(function(s){xT(s).keep=!1}),n.eachSeries(function(s){var l=mo.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!xT(s).keep&&a.group.remove(s.group)}),Cxe(n,o,this.type)},t.prototype.markKeep=function(r){xT(r).keep=!0},t.prototype.toggleBlurSeries=function(r,n){var i=this;E(r,function(a){var o=mo.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?VG(l):Ik(l))})}})},t.type="marker",t}(It);function Cxe(e,t,r){e.eachSeries(function(n){var i=mo.getMarkerModelFromSeries(n,r),a=t.get(n.id);if(i&&a&&a.group){var o=mc(i),s=o.z,l=o.zlevel;gb(a.group,s,l)}})}function _4(e,t,r){var n=t.coordinateSystem,i=r.getWidth(),a=r.getHeight(),o=n&&n.getArea&&n.getArea();e.each(function(s){var l=e.getItemModel(s),u=l.get("relativeTo")==="coordinate",c=u?o?o.width:0:i,h=u?o?o.height:0:a,f=u&&o?o.x:0,d=u&&o?o.y:0,g,m=he(l.get("x"),c)+f,y=he(l.get("y"),h)+d;if(!isNaN(m)&&!isNaN(y))g=[m,y];else if(t.getMarkerPosition)g=t.getMarkerPosition(e.getValues(e.dimensions,s));else if(n){var _=e.get(n.dimensions[0],s),x=e.get(n.dimensions[1],s);g=n.dataToPoint([_,x])}isNaN(m)||(g[0]=m),isNaN(y)||(g[1]=y),e.setItemLayout(s,g)})}var Txe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=mo.getMarkerModelFromSeries(a,"markPoint");o&&(_4(o.getData(),a,i),this.markerGroupMap.get(a.id).updateLayout())},this)},t.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new dm),h=Mxe(o,r,n);n.setData(h),_4(n.getData(),r,a),h.each(function(f){var d=h.getItemModel(f),g=d.getShallow("symbol"),m=d.getShallow("symbolSize"),y=d.getShallow("symbolRotate"),_=d.getShallow("symbolOffset"),x=d.getShallow("symbolKeepAspect");if(Ce(g)||Ce(m)||Ce(y)||Ce(_)){var w=n.getRawValue(f),S=n.getDataParams(f);Ce(g)&&(g=g(w,S)),Ce(m)&&(m=m(w,S)),Ce(y)&&(y=y(w,S)),Ce(_)&&(_=_(w,S))}var T=d.getModel("itemStyle").getItemStyle(),M=d.get("z2"),A=sm(l,"color");T.fill||(T.fill=A),h.setItemVisual(f,{z2:ye(M,0),symbol:g,symbolSize:m,symbolRotate:y,symbolOffset:_,symbolKeepAspect:x,style:T})}),c.updateData(h),this.group.add(c.group),h.eachItemGraphicEl(function(f){f.traverse(function(d){Re(d).dataModel=n})}),this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markPoint",t}(KN);function Mxe(e,t,r){var n;e?n=ae(e&&e.dimensions,function(s){var l=t.getData(),u=l.getDimensionInfo(l.mapDimension(s))||{};return ee(ee({},u),{name:s,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new _n(n,r),a=ae(r.get("data"),Ze(zg,t));e&&(a=gt(a,Ze(Bg,e)));var o=dZ(!!e,n);return i.initData(a,null,o),i}function Axe(e){e.registerComponentModel(xxe),e.registerComponentView(Txe),e.registerPreprocessor(function(t){qN(t.series,"markPoint")&&(t.markPoint=t.markPoint||{})})}var Lxe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.createMarkerModelFromSeries=function(r,n,i){return new t(r,n,i)},t.type="markLine",t.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},t}(mo),D0=He(),kxe=function(e,t,r,n){var i=e.getData(),a;if(ne(n))a=n;else{var o=n.type;if(o==="min"||o==="max"||o==="average"||o==="median"||n.xAxis!=null||n.yAxis!=null){var s=void 0,l=void 0;if(n.yAxis!=null||n.xAxis!=null)s=t.getAxis(n.yAxis!=null?"y":"x"),l=mn(n.yAxis,n.xAxis);else{var u=fZ(n,i,t,e);s=u.valueAxis;var c=TI(i,u.valueDataDim);l=f1(i,c,o)}var h=s.dim==="x"?0:1,f=1-h,d=Se(n),g={coord:[]};d.type=null,d.coord=[],d.coord[f]=-1/0,g.coord[f]=1/0;var m=r.get("precision");m>=0&&nt(l)&&(l=+l.toFixed(Math.min(m,20))),d.coord[h]=g.coord[h]=l,a=[d,g,{type:o,valueIndex:n.valueIndex,value:l}]}else a=[]}var y=[zg(e,a[0]),zg(e,a[1]),ee({},a[2])];return y[2].type=y[2].type||null,Ge(y[2],y[0]),Ge(y[2],y[1]),y};function d1(e){return!isNaN(e)&&!isFinite(e)}function x4(e,t,r,n){var i=1-e,a=n.dimensions[e];return d1(t[i])&&d1(r[i])&&t[e]===r[e]&&n.getAxis(a).containData(t[e])}function Ixe(e,t){if(e.type==="cartesian2d"){var r=t[0].coord,n=t[1].coord;if(r&&n&&(x4(1,r,n,e)||x4(0,r,n,e)))return!0}return Bg(e,t[0])&&Bg(e,t[1])}function bT(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=he(o.get("x"),i.getWidth()),u=he(o.get("y"),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition)s=n.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=a.dimensions,h=e.get(c[0],t),f=e.get(c[1],t);s=a.dataToPoint([h,f])}if(Cc(a,"cartesian2d")){var d=a.getAxis("x"),g=a.getAxis("y"),c=a.dimensions;d1(e.get(c[0],t))?s[0]=d.toGlobalCoord(d.getExtent()[r?0:1]):d1(e.get(c[1],t))&&(s[1]=g.toGlobalCoord(g.getExtent()[r?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}e.setItemLayout(t,s)}var Nxe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=mo.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=D0(o).from,u=D0(o).to;l.each(function(c){bT(l,c,!0,a,i),bT(u,c,!1,a,i)}),s.each(function(c){s.setItemLayout(c,[l.getItemLayout(c),u.getItemLayout(c)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},t.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new pN);this.group.add(c.group);var h=Pxe(o,r,n),f=h.from,d=h.to,g=h.line;D0(n).from=f,D0(n).to=d,n.setData(g);var m=n.get("symbol"),y=n.get("symbolSize"),_=n.get("symbolRotate"),x=n.get("symbolOffset");ne(m)||(m=[m,m]),ne(y)||(y=[y,y]),ne(_)||(_=[_,_]),ne(x)||(x=[x,x]),h.from.each(function(S){w(f,S,!0),w(d,S,!1)}),g.each(function(S){var T=g.getItemModel(S),M=T.getModel("lineStyle").getLineStyle();g.setItemLayout(S,[f.getItemLayout(S),d.getItemLayout(S)]);var A=T.get("z2");M.stroke==null&&(M.stroke=f.getItemVisual(S,"style").fill),g.setItemVisual(S,{z2:ye(A,0),fromSymbolKeepAspect:f.getItemVisual(S,"symbolKeepAspect"),fromSymbolOffset:f.getItemVisual(S,"symbolOffset"),fromSymbolRotate:f.getItemVisual(S,"symbolRotate"),fromSymbolSize:f.getItemVisual(S,"symbolSize"),fromSymbol:f.getItemVisual(S,"symbol"),toSymbolKeepAspect:d.getItemVisual(S,"symbolKeepAspect"),toSymbolOffset:d.getItemVisual(S,"symbolOffset"),toSymbolRotate:d.getItemVisual(S,"symbolRotate"),toSymbolSize:d.getItemVisual(S,"symbolSize"),toSymbol:d.getItemVisual(S,"symbol"),style:M})}),c.updateData(g),h.line.eachItemGraphicEl(function(S){Re(S).dataModel=n,S.traverse(function(T){Re(T).dataModel=n})});function w(S,T,M){var A=S.getItemModel(T);bT(S,T,M,r,a);var N=A.getModel("itemStyle").getItemStyle();N.fill==null&&(N.fill=sm(l,"color")),S.setItemVisual(T,{symbolKeepAspect:A.get("symbolKeepAspect"),symbolOffset:ye(A.get("symbolOffset",!0),x[M?0:1]),symbolRotate:ye(A.get("symbolRotate",!0),_[M?0:1]),symbolSize:ye(A.get("symbolSize"),y[M?0:1]),symbol:ye(A.get("symbol",!0),m[M?0:1]),style:N})}this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markLine",t}(KN);function Pxe(e,t,r){var n;e?n=ae(e&&e.dimensions,function(u){var c=t.getData(),h=c.getDimensionInfo(c.mapDimension(u))||{};return ee(ee({},h),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new _n(n,r),a=new _n(n,r),o=new _n([],r),s=ae(r.get("data"),Ze(kxe,t,e,r));e&&(s=gt(s,Ze(Ixe,e)));var l=dZ(!!e,n);return i.initData(ae(s,function(u){return u[0]}),null,l),a.initData(ae(s,function(u){return u[1]}),null,l),o.initData(ae(s,function(u){return u[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function Dxe(e){e.registerComponentModel(Lxe),e.registerComponentView(Nxe),e.registerPreprocessor(function(t){qN(t.series,"markLine")&&(t.markLine=t.markLine||{})})}var Exe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.createMarkerModelFromSeries=function(r,n,i){return new t(r,n,i)},t.type="markArea",t.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},t}(mo),E0=He(),Rxe=function(e,t,r,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=zg(e,i),s=zg(e,a),l=o.coord,u=s.coord;l[0]=mn(l[0],-1/0),l[1]=mn(l[1],-1/0),u[0]=mn(u[0],1/0),u[1]=mn(u[1],1/0);var c=q1([{},o,s]);return c.coord=[o.coord,s.coord],c.x0=o.x,c.y0=o.y,c.x1=s.x,c.y1=s.y,c}};function v1(e){return!isNaN(e)&&!isFinite(e)}function b4(e,t,r,n){var i=1-e;return v1(t[i])&&v1(r[i])}function jxe(e,t){var r=t.coord[0],n=t.coord[1],i={coord:r,x:t.x0,y:t.y0},a={coord:n,x:t.x1,y:t.y1};return Cc(e,"cartesian2d")?r&&n&&(b4(1,r,n)||b4(0,r,n))?!0:Sxe(e,i,a):Bg(e,i)||Bg(e,a)}function w4(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=he(o.get(r[0]),i.getWidth()),u=he(o.get(r[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition){var c=e.getValues(["x0","y0"],t),h=e.getValues(["x1","y1"],t),f=a.clampData(c),d=a.clampData(h),g=[];r[0]==="x0"?g[0]=f[0]>d[0]?h[0]:c[0]:g[0]=f[0]>d[0]?c[0]:h[0],r[1]==="y0"?g[1]=f[1]>d[1]?h[1]:c[1]:g[1]=f[1]>d[1]?c[1]:h[1],s=n.getMarkerPosition(g,r,!0)}else{var m=e.get(r[0],t),y=e.get(r[1],t),_=[m,y];a.clampData&&a.clampData(_,_),s=a.dataToPoint(_,!0)}if(Cc(a,"cartesian2d")){var x=a.getAxis("x"),w=a.getAxis("y"),m=e.get(r[0],t),y=e.get(r[1],t);v1(m)?s[0]=x.toGlobalCoord(x.getExtent()[r[0]==="x0"?0:1]):v1(y)&&(s[1]=w.toGlobalCoord(w.getExtent()[r[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var S4=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],Oxe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=mo.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=ae(S4,function(h){return w4(s,l,h,a,i)});s.setItemLayout(l,u);var c=s.getItemGraphicEl(l);c.setShape("points",u)})}},this)},t.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,{group:new Me});this.group.add(c.group),this.markKeep(c);var h=zxe(o,r,n);n.setData(h),h.each(function(f){var d=ae(S4,function(I){return w4(h,f,I,r,a)}),g=o.getAxis("x").scale,m=o.getAxis("y").scale,y=g.getExtent(),_=m.getExtent(),x=[g.parse(h.get("x0",f)),g.parse(h.get("x1",f))],w=[m.parse(h.get("y0",f)),m.parse(h.get("y1",f))];Hr(x),Hr(w);var S=!(y[0]>x[1]||y[1]w[1]||_[1]=0},t.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",bottom:K.size.m,align:"auto",backgroundColor:K.color.transparent,borderColor:K.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:K.color.disabled,inactiveBorderColor:K.color.disabled,inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:K.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:K.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:K.color.tertiary,borderWidth:1,borderColor:K.color.border},emphasis:{selectorLabel:{show:!0,color:K.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t}(Xe),kh=Ze,FA=E,R0=Me,vZ=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.newlineDisabled=!1,r}return t.prototype.init=function(){this.group.add(this._contentGroup=new R0),this.group.add(this._selectorGroup=new R0),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(r,n,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),u=r.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,r,n,i,l,s,u);var c=kr(r,i).refContainer,h=r.getBoxLayoutParams(),f=r.get("padding"),d=Bt(h,c,f),g=this.layoutInner(r,o,d,a,l,u),m=Bt(Le({width:g.width,height:g.height},h),c,f);this.group.x=m.x-g.x,this.group.y=m.y-g.y,this.group.markRedraw(),this.group.add(this._backgroundEl=rZ(g,r))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(r,n,i,a,o,s,l){var u=this.getContentGroup(),c=pe(),h=n.get("selectedMode"),f=n.get("triggerEvent"),d=[];i.eachRawSeries(function(g){!g.get("legendHoverLink")&&d.push(g.id)}),FA(n.getData(),function(g,m){var y=this,_=g.get("name");if(!this.newlineDisabled&&(_===""||_===` +`)){var x=new R0;x.newline=!0,u.add(x);return}var w=i.getSeriesByName(_)[0];if(!c.get(_))if(w){var S=w.getData(),T=S.getVisual("legendLineStyle")||{},M=S.getVisual("legendIcon"),A=S.getVisual("style"),N=this._createItem(w,_,m,g,n,r,T,A,M,h,a);N.on("click",kh(C4,_,null,a,d)).on("mouseover",kh(VA,w.name,null,a,d)).on("mouseout",kh(GA,w.name,null,a,d)),i.ssr&&N.eachChild(function(P){var I=Re(P);I.seriesIndex=w.seriesIndex,I.dataIndex=m,I.ssrType="legend"}),f&&N.eachChild(function(P){y.packEventData(P,n,w,m,_)}),c.set(_,!0)}else i.eachRawSeries(function(P){var I=this;if(!c.get(_)&&P.legendVisualProvider){var D=P.legendVisualProvider;if(!D.containName(_))return;var O=D.indexOfName(_),j=D.getItemVisual(O,"style"),B=D.getItemVisual(O,"legendIcon"),U=yn(j.fill);U&&U[3]===0&&(U[3]=.2,j=ee(ee({},j),{fill:Oi(U,"rgba")}));var H=this._createItem(P,_,m,g,n,r,{},j,B,h,a);H.on("click",kh(C4,null,_,a,d)).on("mouseover",kh(VA,null,_,a,d)).on("mouseout",kh(GA,null,_,a,d)),i.ssr&&H.eachChild(function(V){var z=Re(V);z.seriesIndex=P.seriesIndex,z.dataIndex=m,z.ssrType="legend"}),f&&H.eachChild(function(V){I.packEventData(V,n,P,m,_)}),c.set(_,!0)}},this)},this),o&&this._createSelector(o,n,a,s,l)},t.prototype.packEventData=function(r,n,i,a,o){var s={componentType:"legend",componentIndex:n.componentIndex,dataIndex:a,value:o,seriesIndex:i.seriesIndex};Re(r).eventData=s},t.prototype._createSelector=function(r,n,i,a,o){var s=this.getSelectorGroup();FA(r,function(u){var c=u.type,h=new rt({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:c==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(h);var f=n.getModel("selectorLabel"),d=n.getModel(["emphasis","selectorLabel"]);jr(h,{normal:f,emphasis:d},{defaultText:u.title}),vl(h)})},t.prototype._createItem=function(r,n,i,a,o,s,l,u,c,h,f){var d=r.visualDrawType,g=o.get("itemWidth"),m=o.get("itemHeight"),y=o.isSelected(n),_=a.get("symbolRotate"),x=a.get("symbolKeepAspect"),w=a.get("icon");c=w||c||"roundRect";var S=Vxe(c,a,l,u,d,y,f),T=new R0,M=a.getModel("textStyle");if(Ce(r.getLegendIcon)&&(!w||w==="inherit"))T.add(r.getLegendIcon({itemWidth:g,itemHeight:m,icon:c,iconRotate:_,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:x}));else{var A=w==="inherit"&&r.getData().getVisual("symbol")?_==="inherit"?r.getData().getVisual("symbolRotate"):_:0;T.add(Gxe({itemWidth:g,itemHeight:m,icon:c,iconRotate:A,itemStyle:S.itemStyle,symbolKeepAspect:x}))}var N=s==="left"?g+5:-5,P=s,I=o.get("formatter"),D=n;ue(I)&&I?D=I.replace("{name}",n??""):Ce(I)&&(D=I(n));var O=y?M.getTextColor():a.get("inactiveColor");T.add(new rt({style:Lt(M,{text:D,x:N,y:m/2,fill:O,align:P,verticalAlign:"middle"},{inheritColor:O})}));var j=new Ye({shape:T.getBoundingRect(),style:{fill:"transparent"}}),B=a.getModel("tooltip");return B.get("show")&&bs({el:j,componentModel:o,itemName:n,itemTooltipOption:B.option}),T.add(j),T.eachChild(function(U){U.silent=!0}),j.silent=!h,this.getContentGroup().add(T),vl(T),T.__legendDataIndex=i,T},t.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();qu(r.get("orient"),l,r.get("itemGap"),i.width,i.height);var c=l.getBoundingRect(),h=[-c.x,-c.y];if(u.markRedraw(),l.markRedraw(),o){qu("horizontal",u,r.get("selectorItemGap",!0));var f=u.getBoundingRect(),d=[-f.x,-f.y],g=r.get("selectorButtonGap",!0),m=r.getOrient().index,y=m===0?"width":"height",_=m===0?"height":"width",x=m===0?"y":"x";s==="end"?d[m]+=c[y]+g:h[m]+=f[y]+g,d[1-m]+=c[_]/2-f[_]/2,u.x=d[0],u.y=d[1],l.x=h[0],l.y=h[1];var w={x:0,y:0};return w[y]=c[y]+g+f[y],w[_]=Math.max(c[_],f[_]),w[x]=Math.min(0,f[x]+d[1-m]),w}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(It);function Vxe(e,t,r,n,i,a,o){function s(y,_){y.lineWidth==="auto"&&(y.lineWidth=_.lineWidth>0?2:0),FA(y,function(x,w){y[w]==="inherit"&&(y[w]=_[w])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),c=e.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?n.decal:Bf(h,o),u.fill==="inherit"&&(u.fill=n[i]),u.stroke==="inherit"&&(u.stroke=n[c]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?n:r).opacity),s(u,n);var f=t.getModel("lineStyle"),d=f.getLineStyle();if(s(d,r),u.fill==="auto"&&(u.fill=n.fill),u.stroke==="auto"&&(u.stroke=n.fill),d.stroke==="auto"&&(d.stroke=n.fill),!a){var g=t.get("inactiveBorderWidth"),m=u[c];u.lineWidth=g==="auto"?n.lineWidth>0&&m?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),d.stroke=f.get("inactiveColor"),d.lineWidth=f.get("inactiveWidth")}return{itemStyle:u,lineStyle:d}}function Gxe(e){var t=e.icon||"roundRect",r=dr(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return r.setStyle(e.itemStyle),r.rotation=(e.iconRotate||0)*Math.PI/180,r.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf("empty")>-1&&(r.style.stroke=r.style.fill,r.style.fill=K.color.neutral00,r.style.lineWidth=2),r}function C4(e,t,r,n){GA(e,t,r,n),r.dispatchAction({type:"legendToggleSelect",name:e??t}),VA(e,t,r,n)}function VA(e,t,r,n){r.usingTHL()||r.dispatchAction({type:"highlight",seriesName:e,name:t,excludeSeriesId:n})}function GA(e,t,r,n){r.usingTHL()||r.dispatchAction({type:"downplay",seriesName:e,name:t,excludeSeriesId:n})}function jv(e,t,r){var n=e==="allSelect"||e==="inverseSelect",i={},a=[];r.eachComponent({mainType:"legend",query:t},function(s){n?s[e]():s[e](t.name),T4(s,i),a.push(s.componentIndex)});var o={};return r.eachComponent("legend",function(s){E(i,function(l,u){s[l?"select":"unSelect"](u)}),T4(s,o)}),n?{selected:o,legendIndex:a}:{name:t.name,selected:o}}function T4(e,t){var r=t||{};return E(e.getData(),function(n){var i=n.get("name");if(!(i===` +`||i==="")){var a=e.isSelected(i);ge(r,i)?r[i]=r[i]&&a:r[i]=a}}),r}function Hxe(e){e.registerAction("legendToggleSelect","legendselectchanged",Ze(jv,"toggleSelected")),e.registerAction("legendAllSelect","legendselectall",Ze(jv,"allSelect")),e.registerAction("legendInverseSelect","legendinverseselect",Ze(jv,"inverseSelect")),e.registerAction("legendSelect","legendselected",Ze(jv,"select")),e.registerAction("legendUnSelect","legendunselected",Ze(jv,"unSelect"))}var Uxe=Qg(Wxe);function Wxe(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.filterSeries(function(r){for(var n=0;ni[o],y=[-d.x,-d.y];n||(y[a]=c[u]);var _=[0,0],x=[-g.x,-g.y],w=ye(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(m){var S=r.get("pageButtonPosition",!0);S==="end"?x[a]+=i[o]-g[o]:_[a]+=g[o]+w}x[1-a]+=d[s]/2-g[s]/2,c.setPosition(y),h.setPosition(_),f.setPosition(x);var T={x:0,y:0};if(T[o]=m?i[o]:d[o],T[s]=Math.max(d[s],g[s]),T[l]=Math.min(0,g[l]+x[1-a]),h.__rectSize=i[o],m){var M={x:0,y:0};M[o]=Math.max(i[o]-g[o]-w,0),M[s]=T[s],h.setClipPath(new Ye({shape:M})),h.__rectSize=M[o]}else f.eachChild(function(N){N.attr({invisible:!0,silent:!0})});var A=this._getPageInfo(r);return A.pageIndex!=null&&ot(c,{x:A.contentPosition[0],y:A.contentPosition[1]},m?r:null),this._updatePageInfoView(r,A),T},t.prototype._pageGo=function(r,n,i){var a=this._getPageInfo(n)[r];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:n.id})},t.prototype._updatePageInfoView=function(r,n){var i=this._controllerGroup;E(["pagePrev","pageNext"],function(c){var h=c+"DataIndex",f=n[h]!=null,d=i.childOfName(c);d&&(d.setStyle("fill",f?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),d.cursor=f?"pointer":"default")});var a=i.childOfName("pageText"),o=r.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,u=n.pageCount;a&&o&&a.setStyle("text",ue(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},t.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,o=r.getOrient().index,s=wT[o],l=ST[o],u=this._findTargetItemIndex(n),c=i.children(),h=c[u],f=c.length,d=f?1:0,g={contentPosition:[i.x,i.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return g;var m=S(h);g.contentPosition[o]=-m.s;for(var y=u+1,_=m,x=m,w=null;y<=f;++y)w=S(c[y]),(!w&&x.e>_.s+a||w&&!T(w,_.s))&&(x.i>_.i?_=x:_=w,_&&(g.pageNextDataIndex==null&&(g.pageNextDataIndex=_.i),++g.pageCount)),x=w;for(var y=u-1,_=m,x=m,w=null;y>=-1;--y)w=S(c[y]),(!w||!T(x,w.s))&&_.i=A&&M.s<=A+a}},t.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,i=this.getContentGroup(),a;return i.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===r&&(n=s)}),n??a},t.type="legend.scroll",t}(vZ);function Yxe(e){e.registerAction("legendScroll","legendscroll",function(t,r){var n=t.scrollDataIndex;n!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:t},function(i){i.setScrollDataIndex(n)})})}function Xxe(e){We(pZ),e.registerComponentModel(Zxe),e.registerComponentView($xe),Yxe(e)}function qxe(e){We(pZ),We(Xxe)}var Kxe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="dataZoom.inside",t.defaultOption=zl(Og.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(Og),JN=He();function Jxe(e,t,r){JN(e).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(t.uid);i&&(i.getRange=r)})}function Qxe(e,t){for(var r=JN(e).coordSysRecordMap,n=r.keys(),i=0;ia[i+n]&&(n=h),o=o&&c.get("preventDefaultMouseMove",!0),s=ye(c.get("cursorGrab",!0),s),l=ye(c.get("cursorGrabbing",!0),l)}),{controlType:n,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o,api:r,zInfo:{component:t.model},triggerInfo:{roamTrigger:null,isInSelf:t.containsPoint},cursorGrab:s,cursorGrabbing:l}}}function i1e(e){e.registerUpdateLifecycle("coordsys:aftercreate",function(t,r){var n=JN(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=pe());i.each(function(a){a.dataZoomInfoMap=null}),t.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=K9(a);E(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,e1e(r,s.model)),c=u.dataZoomInfoMap||(u.dataZoomInfoMap=pe());c.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),i.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){gZ(i,a);return}var c=n1e(l,a,r);o.enable(c.controlType,c.opt),_d(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var a1e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="dataZoom.inside",r}return t.prototype.render=function(r,n,i){if(e.prototype.render.apply(this,arguments),r.noTarget()){this._clear();return}this.range=r.getPercentRange(),Jxe(i,r,{pan:de(CT.pan,this),zoom:de(CT.zoom,this),scrollMove:de(CT.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){Qxe(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(UN),CT={zoom:function(e,t,r,n){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=TT[t](null,[n.originX,n.originY],o,r,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/n.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Ll(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:L4(function(e,t,r,n,i,a){var o=TT[n]([a.oldX,a.oldY],[a.newX,a.newY],t,i,r);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:L4(function(e,t,r,n,i,a){var o=TT[n]([0,0],[a.scrollDelta,a.scrollDelta],t,i,r);return o.signal*(e[1]-e[0])*a.scrollDelta})};function L4(e){return function(t,r,n,i){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s){var l=e(o,s,t,r,n,i);if(Ll(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var TT={grid:function(e,t,r,n,i){var a=r.axis,o={},s=i.model.coordinateSystem.getRect();return e=e||[0,0],a.dim==="x"?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,r,n,i){var a=r.axis,o={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),r.mainType==="radiusAxis"?(o.pixel=t[0]-e[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,r,n,i){var a=r.axis,o=i.model.coordinateSystem.getRect(),s={};return e=e||[0,0],a.orient==="horizontal"?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function mZ(e){WN(e),e.registerComponentModel(Kxe),e.registerComponentView(a1e),i1e(e)}var o1e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=zl(Og.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:K.color.accent10,borderRadius:0,backgroundColor:K.color.transparent,dataBackground:{lineStyle:{color:K.color.accent30,width:.5},areaStyle:{color:K.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:K.color.accent40,width:.5},areaStyle:{color:K.color.accent20,opacity:.3}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:K.color.neutral00,borderColor:K.color.accent20},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:K.color.accent40,opacity:.5},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:K.color.tertiary},brushSelect:!0,brushStyle:{color:K.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:K.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}(Og),Ov=Ye,s1e=1,MT=30,l1e=7,zv="horizontal",k4="vertical",u1e=5,c1e=["line","bar","candlestick","scatter"],h1e={easing:"cubicOut",duration:100,delay:0},f1e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._displayables={},r}return t.prototype.init=function(r,n){this.api=n,this._onBrush=de(this._onBrush,this),this._onBrushEnd=de(this._onBrushEnd,this)},t.prototype.render=function(r,n,i,a){if(e.prototype.render.apply(this,arguments),_d(this,"_dispatchZoomAction",r.get("throttle"),"fixRate"),this._orient=r.getOrient(),r.get("show")===!1){this.group.removeAll();return}if(r.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){dg(this,"_dispatchZoomAction");var r=this.api.getZr();r.off("mousemove",this._onBrush),r.off("mouseup",this._onBrushEnd)},t.prototype._buildView=function(){var r=this.group;r.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var n=this._displayables.sliderGroup=new Me;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),r.add(n),this._positionGroup()},t.prototype._resetLocation=function(){var r=this.dataZoomModel,n=this.api,i=r.get("brushSelect"),a=i?l1e:0,o=kr(r,n).refContainer,s=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===zv?{right:o.width-s.x-s.width,top:o.height-MT-l-a,width:s.width,height:MT}:{right:l,top:s.y,width:MT,height:s.height},c=Wc(r.option);E(["right","top","width","height"],function(f){c[f]==="ph"&&(c[f]=u[f])});var h=Bt(c,o);this._location={x:h.x,y:h.y},this._size=[h.width,h.height],this._orient===k4&&this._size.reverse()},t.prototype._positionGroup=function(){var r=this.group,n=this._location,i=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(i===zv&&!o?{scaleY:l?1:-1,scaleX:1}:i===zv&&o?{scaleY:l?1:-1,scaleX:-1}:i===k4&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=r.getBoundingRect([s]),c=isNaN(u.x)?0:u.x,h=isNaN(u.y)?0:u.y;r.x=n.x-c,r.y=n.y-h,r.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var r=this.dataZoomModel,n=this._size,i=this._displayables.sliderGroup,a=r.get("brushSelect");i.add(new Ov({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new Ov({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:de(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),i.add(o)},t.prototype._renderDataShadow=function(){var r=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!r)return;var n=this._size,i=this._shadowSize||[],a=r.series,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():r.otherDim;if(l==null)return;var u=this._shadowPolygonPts,c=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||n[0]!==i[0]||n[1]!==i[1]){var h=o.getDataExtent(r.thisDim),f=o.getDataExtent(l),d=(f[1]-f[0])*.3;f=[f[0]-d,f[1]+d];var g=[0,n[1]],m=[0,n[0]],y=[[n[0],0],[0,0]],_=[],x=m[1]/Math.max(1,o.count()-1),w=n[0]/(h[1]-h[0]),S=r.thisAxis.type==="time",T=-x,M=Math.round(o.count()/n[0]),A;o.each([r.thisDim,l],function(O,j,B){if(M>0&&B%M){S||(T+=x);return}T=S?(+O-h[0])*w:T+x;var U=j==null||isNaN(j)||j==="",H=U?0:ut(j,f,g,!0);U&&!A&&B?(y.push([y[y.length-1][0],0]),_.push([_[_.length-1][0],0])):!U&&A&&(y.push([T,0]),_.push([T,0])),U||(y.push([T,H]),_.push([T,H])),A=U}),u=this._shadowPolygonPts=y,c=this._shadowPolylinePts=_}this._shadowData=o,this._shadowDim=l,this._shadowSize=[n[0],n[1]];var N=this.dataZoomModel;function P(O){var j=N.getModel(O?"selectedDataBackground":"dataBackground"),B=new Me,U=new sn({shape:{points:u},segmentIgnoreThreshold:1,style:j.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),H=new Zr({shape:{points:c},segmentIgnoreThreshold:1,style:j.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return B.add(U),B.add(H),B}for(var I=0;I<3;I++){var D=P(I===1);this._displayables.sliderGroup.add(D),this._displayables.dataShadowSegs.push(D)}},t.prototype._prepareDataShadowInfo=function(){var r=this.dataZoomModel,n=r.get("showDataShadow");if(n!==!1){var i,a=this.ecModel;return r.eachTargetAxis(function(o,s){var l=r.getAxisProxy(o,s).getTargetSeriesModels();E(l,function(u){if(!i&&!(n!==!0&&Be(c1e,u.get("type"))<0)){var c=a.getComponent(el(o),s).axis,h=d1e(o),f,d=u.coordinateSystem;h!=null&&d.getOtherAxis&&(f=d.getOtherAxis(c).inverse),h=u.getData().mapDimension(h);var g=u.getData().mapDimension(o);i={thisAxis:c,series:u,thisDim:g,otherDim:h,otherAxisInverse:f}}},this)},this),i}},t.prototype._renderHandle=function(){var r=this.group,n=this._displayables,i=n.handles=[null,null],a=n.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,c=l.get("borderRadius")||0,h=l.get("brushSelect"),f=n.filler=new Ov({silent:h,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(f),o.add(new Ov({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:c},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:s1e,fill:K.color.transparent}})),E([0,1],function(w){var S=l.get("handleIcon");!Cx[S]&&S.indexOf("path://")<0&&S.indexOf("image://")<0&&(S="path://"+S);var T=dr(S,-1,0,2,2,null,!0);T.attr({cursor:v1e(this._orient),draggable:!0,drift:de(this._onDragMove,this,w),ondragend:de(this._onDragEnd,this),onmouseover:de(this._onOverDataInfoTriggerArea,this,!0),onmouseout:de(this._onOverDataInfoTriggerArea,this,!1),z2:5});var M=T.getBoundingRect(),A=l.get("handleSize");this._handleHeight=he(A,this._size[1]),this._handleWidth=M.width/M.height*this._handleHeight,T.setStyle(l.getModel("handleStyle").getItemStyle()),T.style.strokeNoScale=!0,T.rectHover=!0,T.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),vl(T);var N=l.get("handleColor");N!=null&&(T.style.fill=N),o.add(i[w]=T);var P=l.getModel("textStyle"),I=l.get("handleLabel")||{},D=I.show||!1;r.add(a[w]=new rt({silent:!0,invisible:!D,style:Lt(P,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:P.getTextColor(),font:P.getFont()}),z2:10}))},this);var d=f;if(h){var g=he(l.get("moveHandleSize"),s[1]),m=n.moveHandle=new Ye({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:g}}),y=g*.8,_=n.moveHandleIcon=dr(l.get("moveHandleIcon"),-y/2,-y/2,y,y,K.color.neutral00,!0);_.silent=!0,_.y=s[1]+g/2-.5,m.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var x=Math.min(s[1]/2,Math.max(g,10));d=n.moveZone=new Ye({invisible:!0,shape:{y:s[1]-x,height:g+x}}),d.on("mouseover",function(){u.enterEmphasis(m)}).on("mouseout",function(){u.leaveEmphasis(m)}),o.add(m),o.add(_),o.add(d)}d.attr({draggable:!0,cursor:"grab",drift:de(this._onActualMoveZoneDrift,this),ondragstart:de(this._onActualMoveZoneDragStart,this),ondragend:de(this._onActualMoveZoneDragEnd,this),onmouseover:de(this._onOverDataInfoTriggerArea,this,!0),onmouseout:de(this._onOverDataInfoTriggerArea,this,!1)})},t.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),n=this._getViewExtent();this._handleEnds=[ut(r[0],[0,100],n,!0),ut(r[1],[0,100],n,!0)]},t.prototype._updateInterval=function(r,n){var i=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=i.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];Ll(n,a,o,i.get("zoomLock")?"all":r,s.minSpan!=null?ut(s.minSpan,l,o,!0):null,s.maxSpan!=null?ut(s.maxSpan,l,o,!0):null);var u=this._range,c=this._range=Hr([ut(a[0],o,l,!0),ut(a[1],o,l,!0)]);return!u||u[0]!==c[0]||u[1]!==c[1]},t.prototype._updateView=function(r){var n=this._displayables,i=this._handleEnds,a=Hr(i.slice()),o=this._size;E([0,1],function(d){var g=n.handles[d],m=this._handleHeight;g.attr({scaleX:m/2,scaleY:m/2,x:i[d]+(d?-1:1),y:o[1]/2-m/2})},this),n.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};n.moveHandle&&(n.moveHandle.setShape(s),n.moveZone.setShape(s),n.moveZone.getBoundingRect(),n.moveHandleIcon&&n.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=n.dataShadowSegs,u=[0,a[0],a[1],o[0]],c=0;cn[0]||i[1]<0||i[1]>n[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",i[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(r){var n=r.offsetX,i=r.offsetY;this._brushStart=new Pe(n,i),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(r){if(this._brushing){var n=this._displayables.brushRect;if(this._brushing=!1,!!n){n.attr("ignore",!0);var i=n.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(i.width)<5)){var o=this._getViewExtent(),s=[0,100],l=this._handleEnds=[i.x,i.x+i.width],u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();Ll(0,l,o,0,u.minSpan!=null?ut(u.minSpan,s,o,!0):null,u.maxSpan!=null?ut(u.maxSpan,s,o,!0):null),this._range=Hr([ut(l[0],o,s,!0),ut(l[1],o,s,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(r){this._brushing&&(ls(r.event),this._updateBrushRect(r.offsetX,r.offsetY))},t.prototype._updateBrushRect=function(r,n){var i=this._displayables,a=this.dataZoomModel,o=i.brushRect;o||(o=i.brushRect=new Ov({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(r,n),c=l.transformCoordToLocal(s.x,s.y),h=this._size;u[0]=Math.max(Math.min(h[0],u[0]),0),o.setShape({x:c[0],y:0,width:u[0]-c[0],height:h[1]})},t.prototype._dispatchZoomAction=function(r){var n=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:r?h1e:null,start:n[0],end:n[1]})},t.prototype._findCoordRect=function(){var r,n=K9(this.dataZoomModel).infoList;if(!r&&n.length){var i=n[0].model.coordinateSystem;r=i.getRect&&i.getRect()}if(!r){var a=this.api.getWidth(),o=this.api.getHeight();r={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return r},t.type="dataZoom.slider",t}(UN);function I4(e,t,r,n){var i=e.get("labelFormatter"),a=e.get("labelPrecision");(a==null||a==="auto")&&(a=r.valuePrecision);var o=r.value[t],s=o==null||isNaN(o)?"":bn(n)||lm(n)?n.getLabel({value:Math.round(o)}):isFinite(a)?at(o,a,!0):o+"";return Ce(i)?i(o,s):ue(i)?i.replace("{value}",s):s}function d1e(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}function v1e(e){return e==="vertical"?"ns-resize":"ew-resize"}function yZ(e){e.registerComponentModel(o1e),e.registerComponentView(f1e),WN(e)}function p1e(e){We(mZ),We(yZ)}var _Z={get:function(e,t,r){var n=Se((g1e[e]||{})[t]);return r&&ne(n)?n[n.length-1]:n}},g1e={color:{active:["#006edd","#e0ffff"],inactive:[K.color.transparent]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},N4=Rr.mapVisual,m1e=Rr.eachVisual,y1e=ne,AT=E,_1e=Hr,x1e=ut,p1=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.stateList=["inRange","outOfRange"],r.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],r.layoutMode={type:"box",ignoreSize:!0},r.dataBound=[-1/0,1/0],r.targetVisuals={},r.controllerVisuals={},r}return t.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i)},t.prototype.optionUpdated=function(r,n){var i=this.option;!n&&uZ(i,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(r){var n=this.stateList;r=de(r,this),this.controllerVisuals=jA(this.option.controller,n,r),this.targetVisuals=jA(this.option.target,n,r)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var r=this,n=this.option.seriesTargets;if(n){var i=[];return AT(n,function(l){if(l.seriesIndex!=null)i.push(l.seriesIndex);else if(l.seriesId!=null){var u;r.ecModel.eachSeries(function(c){c.id===l.seriesId&&(u=c)}),u&&i.push(u.componentIndex)}}),i}var a=this.option.seriesId,o=this.option.seriesIndex;o==null&&a==null&&(o="all");var s=sd(this.ecModel,"series",{index:o,id:a},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return ae(s,function(l){return l.componentIndex})},t.prototype.eachTargetSeries=function(r,n){E(this.getTargetSeriesIndices(),function(i){var a=this.ecModel.getSeriesByIndex(i);a&&r.call(n,a)},this)},t.prototype.isTargetSeries=function(r){var n=!1;return this.eachTargetSeries(function(i){i===r&&(n=!0)}),n},t.prototype.formatValueText=function(r,n,i){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;i=i||["<",">"],ne(r)&&(r=r.slice(),u=!0);var c=n?r:u?[h(r[0]),h(r[1])]:h(r);if(ue(l))return l.replace("{value}",u?c[0]:c).replace("{value2}",u?c[1]:c);if(Ce(l))return u?l(r[0],r[1]):l(r);if(u)return r[0]===s[0]?i[0]+" "+c[1]:r[1]===s[1]?i[1]+" "+c[0]:c[0]+" - "+c[1];return c;function h(f){return f===s[0]?"min":f===s[1]?"max":(+f).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var r=this.option,n=_1e([r.min,r.max]);this._dataExtent=n},t.prototype.getDimension=function(r){var n=this,i=this.option.seriesTargets;if(i){var a=ys(i,function(o){return o.seriesIndex!=null&&o.seriesIndex===r||o.seriesId!=null&&o.seriesId===n.ecModel.getSeriesByIndex(r).id});if(a)return a.dimension}return this.option.dimension},t.prototype.getDataDimensionIndex=function(r){var n=r.hostModel.seriesIndex,i=this.getDimension(n);if(i!=null)return r.getDimensionIndex(i);for(var a=r.dimensions,o=a.length-1;o>=0;o--){var s=a[o],l=r.getDimensionInfo(s);if(!l.isCalculationCoord)return l.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var r=this.ecModel,n=this.option,i={inRange:n.inRange,outOfRange:n.outOfRange},a=n.target||(n.target={}),o=n.controller||(n.controller={});Ge(a,i),Ge(o,i);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),c.call(this,o);function l(h){y1e(n.color)&&!h.inRange&&(h.inRange={color:n.color.slice().reverse()}),h.inRange=h.inRange||{color:r.get("gradientColor")}}function u(h,f,d){var g=h[f],m=h[d];g&&!m&&(m=h[d]={},AT(g,function(y,_){if(Rr.isValidType(_)){var x=_Z.get(_,"inactive",s);x!=null&&(m[_]=x,_==="color"&&!m.hasOwnProperty("opacity")&&!m.hasOwnProperty("colorAlpha")&&(m.opacity=[0,0]))}}))}function c(h){var f=(h.inRange||{}).symbol||(h.outOfRange||{}).symbol,d=(h.inRange||{}).symbolSize||(h.outOfRange||{}).symbolSize,g=this.get("inactiveColor"),m=this.getItemSymbol(),y=m||"roundRect";AT(this.stateList,function(_){var x=this.itemSize,w=h[_];w||(w=h[_]={color:s?g:[g]}),w.symbol==null&&(w.symbol=f&&Se(f)||(s?y:[y])),w.symbolSize==null&&(w.symbolSize=d&&Se(d)||(s?x[0]:[x[0],x[0]])),w.symbol=N4(w.symbol,function(M){return M==="none"?y:M});var S=w.symbolSize;if(S!=null){var T=-1/0;m1e(S,function(M){M>T&&(T=M)}),w.symbolSize=N4(S,function(M){return x1e(M,[0,T],[0,x[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(r){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(r){return null},t.prototype.getVisualMeta=function(r){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:K.color.transparent,borderColor:K.color.borderTint,contentColor:K.color.theme[0],inactiveColor:K.color.disabled,borderWidth:0,padding:K.size.m,textGap:10,precision:0,textStyle:{color:K.color.secondary}},t}(Xe),P4=[20,140],b1e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.optionUpdated=function(r,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(i){i.mappingMethod="linear",i.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var r=this.itemSize;(r[0]==null||isNaN(r[0]))&&(r[0]=P4[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=P4[1])},t.prototype._resetRange=function(){var r=this.getExtent(),n=this.option.range;!n||n.auto?(r.auto=1,this.option.range=r):ne(n)&&(n[0]>n[1]&&n.reverse(),n[0]=Math.max(n[0],r[0]),n[1]=Math.min(n[1],r[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),E(this.stateList,function(r){var n=this.option.controller[r].symbolSize;n&&n[0]!==n[1]&&(n[0]=n[1]/3)},this)},t.prototype.setSelected=function(r){this.option.range=r.slice(),this._resetRange()},t.prototype.getSelected=function(){var r=this.getExtent(),n=Hr((this.get("range")||[]).slice());return n[0]>r[1]&&(n[0]=r[1]),n[1]>r[1]&&(n[1]=r[1]),n[0]=i[1]||r<=n[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(r){var n=[];return this.eachTargetSeries(function(i){var a=[],o=i.getData();o.each(this.getDataDimensionIndex(o),function(s,l){r[0]<=s&&s<=r[1]&&a.push(l)},this),n.push({seriesId:i.id,dataIndex:a})},this),n},t.prototype.getVisualMeta=function(r){var n=D4(this,"outOfRange",this.getExtent()),i=D4(this,"inRange",this.option.range.slice()),a=[];function o(d,g){a.push({value:d,color:r(d,g)})}for(var s=0,l=0,u=i.length,c=n.length;lr[1])break;a.push({color:this.getControllerVisual(l,"color",n),offset:s/i})}return a.push({color:this.getControllerVisual(r[1],"color",n),offset:1}),a},t.prototype._createBarPoints=function(r,n){var i=this.visualMapModel.itemSize;return[[i[0]-n[0],r[0]],[i[0],r[0]],[i[0],r[1]],[i[0]-n[1],r[1]]]},t.prototype._createBarGroup=function(r){var n=this._orient,i=this.visualMapModel.get("inverse");return new Me(n==="horizontal"&&!i?{scaleX:r==="bottom"?1:-1,rotation:Math.PI/2}:n==="horizontal"&&i?{scaleX:r==="bottom"?-1:1,rotation:-Math.PI/2}:n==="vertical"&&!i?{scaleX:r==="left"?1:-1,scaleY:-1}:{scaleX:r==="left"?1:-1})},t.prototype._updateHandle=function(r,n){if(this._useHandle){var i=this._shapes,a=this.visualMapModel,o=i.handleThumbs,s=i.handleLabels,l=a.itemSize,u=a.getExtent(),c=this._applyTransform("left",i.mainGroup);w1e([0,1],function(h){var f=o[h];f.setStyle("fill",n.handlesColor[h]),f.y=r[h];var d=Oa(r[h],[0,l[1]],u,!0),g=this.getControllerVisual(d,"symbolSize");f.scaleX=f.scaleY=g/l[0],f.x=l[0]-g/2;var m=pa(i.handleLabelPoints[h],Xu(f,this.group));if(this._orient==="horizontal"){var y=c==="left"||c==="top"?(l[0]-g)/2:(l[0]-g)/-2;m[1]+=y}s[h].setStyle({x:m[0],y:m[1],text:a.formatValueText(this._dataInterval[h]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",i.mainGroup):"center"})},this)}},t.prototype._showIndicator=function(r,n,i,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],c=this._shapes,h=c.indicator;if(h){h.attr("invisible",!1);var f={convertOpacityToAlpha:!0},d=this.getControllerVisual(r,"color",f),g=this.getControllerVisual(r,"symbolSize"),m=Oa(r,s,u,!0),y=l[0]-g/2,_={x:h.x,y:h.y};h.y=m,h.x=y;var x=pa(c.indicatorLabelPoint,Xu(h,this.group)),w=c.indicatorLabel;w.attr("invisible",!1);var S=this._applyTransform("left",c.mainGroup),T=this._orient,M=T==="horizontal";w.setStyle({text:(i||"")+o.formatValueText(n),verticalAlign:M?S:"middle",align:M?"center":S});var A={x:y,y:m,style:{fill:d}},N={style:{x:x[0],y:x[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var P={duration:100,easing:"cubicInOut",additive:!0};h.x=_.x,h.y=_.y,h.animateTo(A,P),w.animateTo(N,P)}else h.attr(A),w.attr(N);this._firstShowIndicator=!1;var I=this._shapes.handleLabels;if(I)for(var D=0;Do[1]&&(h[1]=1/0),n&&(h[0]===-1/0?this._showIndicator(c,h[1],"< ",l):h[1]===1/0?this._showIndicator(c,h[0],"> ",l):this._showIndicator(c,c,"≈ ",l));var f=this._hoverLinkDataIndices,d=[];(n||O4(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(h));var g=Aee(f,d);this._dispatchHighDown("downplay",b_(g[0],i)),this._dispatchHighDown("highlight",b_(g[1],i))}},t.prototype._hoverLinkFromSeriesMouseOver=function(r){var n;if(Vu(r.target,function(l){var u=Re(l);if(u.dataIndex!=null)return n=u,!0},!0),!!n){var i=this.ecModel.getSeriesByIndex(n.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(i)){var o=i.getData(n.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),n.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},t.prototype._hideIndicator=function(){var r=this._shapes;r.indicator&&r.indicator.attr("invisible",!0),r.indicatorLabel&&r.indicatorLabel.attr("invisible",!0);var n=this._shapes.handleLabels;if(n)for(var i=0;i=0&&(a.dimension=o,n.push(a))}}),e.getData().setVisual("visualMeta",n)}}];function I1e(e,t,r,n){for(var i=t.targetVisuals[n],a=Rr.prepareVisualTypes(i),o={color:sm(e.getData(),"color")},s=0,l=a.length;s0:t.splitNumber>0)||t.calculable)?"continuous":"piecewise"}),e.registerAction(A1e,L1e),E(k1e,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(N1e))}function SZ(e){e.registerComponentModel(b1e),e.registerComponentView(T1e),wZ(e)}var P1e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._pieceList=[],r}return t.prototype.optionUpdated=function(r,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],D1e[this._mode].call(this,this._pieceList),this._resetSelected(r,n);var a=this.option.categories;this.resetVisual(function(o,s){i==="categories"?(o.mappingMethod="category",o.categories=Se(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=ae(this._pieceList,function(l){return l=Se(l),s!=="inRange"&&(l.visual=null),l}))})},t.prototype.completeVisualOption=function(){var r=this.option,n={},i=Rr.listVisualTypes(),a=this.isCategory();E(r.pieces,function(s){E(i,function(l){s.hasOwnProperty(l)&&(n[l]=1)})}),E(n,function(s,l){var u=!1;E(this.stateList,function(c){u=u||o(r,c,l)||o(r.target,c,l)},this),!u&&E(this.stateList,function(c){(r[c]||(r[c]={}))[l]=_Z.get(l,c==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(r,n){var i=this.option,a=this._pieceList,o=(n?i:r).selected||{};if(i.selected=o,E(a,function(l,u){var c=this.getSelectedMapKey(l);o.hasOwnProperty(c)||(o[c]=!0)},this),i.selectedMode==="single"){var s=!1;E(a,function(l,u){var c=this.getSelectedMapKey(l);o[c]&&(s?o[c]=!1:s=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get("itemSymbol")},t.prototype.getSelectedMapKey=function(r){return this._mode==="categories"?r.value+"":r.index+""},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var r=this.option;return r.pieces&&r.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(r){this.option.selected=Se(r)},t.prototype.getValueState=function(r){var n=Rr.findPieceIndex(r,this._pieceList);return n!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[n])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(r){var n=[],i=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var c=Rr.findPieceIndex(l,i);c===r&&o.push(u)},this),n.push({seriesId:a.id,dataIndex:o})},this),n},t.prototype.getRepresentValue=function(r){var n;if(this.isCategory())n=r.value;else if(r.value!=null)n=r.value;else{var i=r.interval||[];n=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return n},t.prototype.getVisualMeta=function(r){if(this.isCategory())return;var n=[],i=["",""],a=this;function o(c,h){var f=a.getRepresentValue({interval:c});h||(h=a.getValueState(f));var d=r(f,h);c[0]===-1/0?i[0]=d:c[1]===1/0?i[1]=d:n.push({value:c[0],color:d},{value:c[1],color:d})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return E(s,function(c){var h=c.interval;h&&(h[0]>u&&o([u,h[0]],"outOfRange"),o(h.slice()),u=h[1])},this),{stops:n,outerColors:i}},t.type="visualMap.piecewise",t.defaultOption=zl(p1.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(p1),D1e={splitNumber:function(e){var t=this.option,r=Math.min(t.precision,20),n=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var a=(n[1]-n[0])/i;+a.toFixed(r)!==a&&r<5;)r++;t.precision=r,a=+a.toFixed(r),t.minOpen&&e.push({interval:[-1/0,n[0]],close:[0,0]});for(var o=0,s=n[0];o","≥"][n[0]]];r.text=r.text||this.formatValueText(r.value!=null?r.value:r.interval,!1,i)},this)}};function V4(e,t){var r=e.inverse;(e.orient==="vertical"?!r:r)&&t.reverse()}var E1e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.doRender=function(){var r=this.group;r.removeAll();var n=this.visualMapModel,i=n.get("textGap"),a=n.textStyleModel,o=this._getItemAlign(),s=n.itemSize,l=this._getViewData(),u=l.endsText,c=mn(n.get("showLabel",!0),!u),h=!n.get("selectedMode");u&&this._renderEndsText(r,u[0],s,c,o),E(l.viewPieceList,function(f){var d=f.piece,g=new Me;g.onclick=de(this._onItemClick,this,d),this._enableHoverLink(g,f.indexInModelPieceList);var m=n.getRepresentValue(d);if(this._createItemSymbol(g,m,[0,0,s[0],s[1]],h),c){var y=this.visualMapModel.getValueState(m),_=a.get("align")||o;g.add(new rt({style:Lt(a,{x:_==="right"?-i:s[0]+i,y:s[1]/2,text:d.text,verticalAlign:a.get("verticalAlign")||"middle",align:_,opacity:ye(a.get("opacity"),y==="outOfRange"?.5:1)}),silent:h}))}r.add(g)},this),u&&this._renderEndsText(r,u[1],s,c,o),qu(n.get("orient"),r,n.get("itemGap")),this.renderBackground(r),this.positionGroup(r)},t.prototype._enableHoverLink=function(r,n){var i=this;r.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=i.visualMapModel;s.option.hoverLink&&i.api.dispatchAction({type:o,batch:b_(s.findTargetDataIndices(n),s)})}},t.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return bZ(r,this.api,r.itemSize);var i=n.align;return(!i||i==="auto")&&(i="left"),i},t.prototype._renderEndsText=function(r,n,i,a,o){if(n){var s=new Me,l=this.visualMapModel.textStyleModel;s.add(new rt({style:Lt(l,{x:a?o==="right"?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:a?o:"center",text:n})})),r.add(s)}},t.prototype._getViewData=function(){var r=this.visualMapModel,n=ae(r.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),i=r.get("text"),a=r.get("orient"),o=r.get("inverse");return(a==="horizontal"?o:!o)?n.reverse():i&&(i=i.slice().reverse()),{viewPieceList:n,endsText:i}},t.prototype._createItemSymbol=function(r,n,i,a){var o=dr(this.getControllerVisual(n,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(n,"color"));o.silent=a,r.add(o)},t.prototype._onItemClick=function(r){var n=this.visualMapModel,i=n.option,a=i.selectedMode;if(a){var o=Se(i.selected),s=n.getSelectedMapKey(r);a==="single"||a===!0?(o[s]=!0,E(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},t.type="visualMap.piecewise",t}(xZ);function CZ(e){e.registerComponentModel(P1e),e.registerComponentView(E1e),wZ(e)}function R1e(e){We(SZ),We(CZ)}var j1e=function(){function e(t){this._thumbnailModel=t}return e.prototype.reset=function(t){this._renderVersion=t.getECUpdateCycleVersion()},e.prototype.renderContent=function(t){var r=t.api.getViewOfComponentModel(this._thumbnailModel);r&&(t.group.silent=!0,r.renderContent({group:t.group,targetTrans:t.targetTrans,z2Range:hH(t.group),roamType:t.roamType,viewportRect:t.viewportRect,renderVersion:this._renderVersion}))},e.prototype.updateWindow=function(t,r){var n=r.getViewOfComponentModel(this._thumbnailModel);n&&n.updateWindow({targetTrans:t,renderVersion:this._renderVersion})},e}(),O1e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.preventAutoZ=!0,r}return t.prototype.optionUpdated=function(r,n){this._updateBridge()},t.prototype._updateBridge=function(){var r=this._birdge=this._birdge||new j1e(this);if(this._target=null,this.ecModel.eachSeries(function(i){_3(i,null)}),this.shouldShow()){var n=this.getTarget();_3(n.baseMapProvider,r)}},t.prototype.shouldShow=function(){return this.getShallow("show",!0)},t.prototype.getBridge=function(){return this._birdge},t.prototype.getTarget=function(){if(this._target)return this._target;var r=this.getReferringComponents("series",{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];return r?r.subType!=="graph"&&(r=null):r=this.ecModel.queryComponents({mainType:"series",subType:"graph"})[0],this._target={baseMapProvider:r},this._target},t.type="thumbnail",t.layoutMode="box",t.dependencies=["series","geo"],t.defaultOption={show:!0,right:1,bottom:1,height:"25%",width:"25%",itemStyle:{borderColor:K.color.border,borderWidth:2},windowStyle:{borderWidth:1,color:K.color.neutral30,borderColor:K.color.neutral40,opacity:.3},z:10},t}(Xe),z1e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){if(this._api=i,this._model=r,this._coordSys||(this._coordSys=new Ob),!this._isEnabled()){this._clear();return}this._renderVersion=i.getECUpdateCycleVersion();var a=this.group;a.removeAll();var o=r.getModel("itemStyle"),s=o.getItemStyle();s.fill==null&&(s.fill=n.get("backgroundColor")||K.color.neutral00);var l=kr(r,i).refContainer,u=Bt(jH(r,!0),l),c=s.lineWidth||0,h=this._contentRect=gc(u.clone(),c/2,!0,!0),f=new Me;a.add(f),f.setClipPath(new Ye({shape:h.plain()}));var d=this._targetGroup=new Me;f.add(d);var g=u.plain();g.r=o.getShallow("borderRadius",!0),a.add(this._bgRect=new Ye({style:s,shape:g,silent:!1,cursor:"grab"}));var m=r.getModel("windowStyle"),y=m.getShallow("borderRadius",!0);f.add(this._windowRect=new Ye({shape:{x:0,y:0,width:0,height:0,r:y},style:m.getItemStyle(),silent:!1,cursor:"grab"})),this._dealRenderContent(),this._dealUpdateWindow(),H4(r,this)},t.prototype.renderContent=function(r){this._bridgeRendered=r,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),H4(this._model,this))},t.prototype._dealRenderContent=function(){var r=this._bridgeRendered;if(!(!r||r.renderVersion!==this._renderVersion)){var n=this._targetGroup,i=this._coordSys,a=this._contentRect;if(n.removeAll(),!!r){var o=r.group,s=o.getBoundingRect();n.add(o),this._bgRect.z2=r.z2Range.min-10,zb(i,s.x,s.y,s.width,s.height);var l=Bt({left:"center",top:"center",aspect:s.width/s.height},a);Xx(i,l.x,l.y,l.width,l.height),kg(o,i,Mc),o.dirty(),this._windowRect.z2=r.z2Range.max+10,this._resetRoamController(r.roamType)}}},t.prototype.updateWindow=function(r){var n=this._bridgeRendered;n&&n.renderVersion===r.renderVersion&&(n.targetTrans=r.targetTrans),this._isEnabled()&&this._dealUpdateWindow()},t.prototype._dealUpdateWindow=function(){var r=this._bridgeRendered;if(!(!r||r.renderVersion!==this._renderVersion)){var n=fi([],r.targetTrans),i=ci([],Yx(null,this._coordSys),n);this._transThisToTarget=fi([],i);var a=r.viewportRect;a?a=a.clone():a=new Ae(0,0,this._api.getWidth(),this._api.getHeight()),a.applyTransform(i);var o=this._windowRect,s=o.shape.r;o.setShape(Le({r:s},a))}},t.prototype._resetRoamController=function(r){var n=this,i=this._api,a=this._roamController;if(a||(a=this._roamController=new qc(i.getZr())),!r||!this._isEnabled()){a.disable();return}a.enable(r,{api:i,zInfo:{component:this._model},triggerInfo:{roamTrigger:null,isInSelf:function(o,s,l){return n._contentRect.contain(s,l)}}}),a.off("pan").off("zoom").on("pan",de(this._onPan,this)).on("zoom",de(this._onZoom,this))},t.prototype._onPan=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=Xt([],[r.oldX,r.oldY],n),a=Xt([],[r.oldX-r.dx,r.oldY-r.dy],n);this._api.dispatchAction(G4(this._model.getTarget().baseMapProvider,{dx:a[0]-i[0],dy:a[1]-i[1]}))}},t.prototype._onZoom=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=Xt([],[r.originX,r.originY],n);this._api.dispatchAction(G4(this._model.getTarget().baseMapProvider,{zoom:1/r.scale,originX:i[0],originY:i[1]}))}},t.prototype._isEnabled=function(){var r=this._model;if(!r||!r.shouldShow())return!1;var n=r.getTarget().baseMapProvider;return!!n},t.prototype._clear=function(){this.group.removeAll(),this._bridgeRendered=null,this._roamController&&this._roamController.disable()},t.prototype.remove=function(){this._clear()},t.prototype.dispose=function(){this._clear()},t.type="thumbnail",t}(It);function G4(e,t){var r=e.mainType==="series"?e.subType+"Roam":e.mainType+"Roam",n={type:r};return n[e.mainType+"Id"]=e.id,ee(n,t),n}function H4(e,t){var r=mc(e);gb(t.group,r.z,r.zlevel)}function B1e(e){e.registerComponentModel(O1e),e.registerComponentView(z1e)}var F1e={label:{enabled:!0},decal:{show:!1}},U4=He(),W4=He(),V1e=Qg(G1e);function G1e(e,t){var r=e.getModel("aria");if(!r.get("enabled"))return;var n=W4(e).scope||(W4(e).scope={}),i=Se(F1e);Ge(i.label,e.getLocaleModel().get("aria"),!1),Ge(r.option,i,!1),a(),o();function a(){var c=r.getModel("decal"),h=c.get("show");if(h){var f=pe();e.eachSeries(function(d){d.isColorBySeries()||(U4(d).scope=f.get(d.type)||f.set(d.type,{}))}),e.eachSeries(function(d){if(Ce(d.enableAriaDecal)){d.enableAriaDecal();return}var g=d.getData();if(d.isColorBySeries()){var w=MM(d.ecModel,d.name,n,e.getSeriesCount()),S=g.getVisual("decal");g.setVisual("decal",T(S,w))}else{var m=d.getRawData(),y={},_=U4(d).scope;g.each(function(M){var A=g.getRawIndex(M);y[A]=M});var x=m.count();m.each(function(M){var A=y[M],N=m.getName(M)||M+"",P=MM(d.ecModel,N,_,x),I=g.getItemVisual(A,"decal");g.setItemVisual(A,"decal",T(I,P))})}function T(M,A){var N=M?ee(ee({},A),M):A;return N.dirty=!0,N}})}}function o(){var c=t.getZr().dom;if(c){var h=e.getLocaleModel().get("aria"),f=r.getModel("label");if(f.option=Le(f.option,h),!!f.get("enabled")){if(c.setAttribute("role","img"),f.get("description")){c.setAttribute("aria-label",f.get("description"));return}var d=e.getSeriesCount(),g=f.get(["data","maxCount"])||10,m=f.get(["series","maxCount"])||10,y=Math.min(d,m),_;if(!(d<1)){var x=l();if(x){var w=f.get(["general","withTitle"]);_=s(w,{title:x})}else _=f.get(["general","withoutTitle"]);var S=[],T=d>1?f.get(["series","multiple","prefix"]):f.get(["series","single","prefix"]);_+=s(T,{seriesCount:d}),e.eachSeries(function(P,I){if(I1?f.get(["series","multiple",j]):f.get(["series","single",j]),D=s(D,{seriesId:P.seriesIndex,seriesName:P.get("name"),seriesType:u(P.subType)});var B=P.getData();if(B.count()>g){var U=f.get(["data","partialData"]);D+=s(U,{displayCnt:g})}else D+=f.get(["data","allData"]);for(var H=f.get(["data","separator","middle"]),V=f.get(["data","separator","end"]),z=f.get(["data","excludeDimensionId"]),$=[],W=0;W":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},W1e=function(){function e(t){var r=this._condVal=ue(t)?new RegExp(t):S6(t)?t:null;if(r==null){var n="";pt(n)}}return e.prototype.evaluate=function(t){var r=typeof t;return ue(r)?this._condVal.test(t):nt(r)?this._condVal.test(t+""):!1},e}(),Z1e=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),$1e=function(){function e(){}return e.prototype.evaluate=function(){for(var t=this.children,r=0;r2&&n.push(i),i=[j,B]}function c(j,B,U,H){rf(j,U)&&rf(B,H)||i.push(j,B,U,H,U,H)}function h(j,B,U,H,V,z){var $=Math.abs(B-j),W=Math.tan($/4)*4/3,Z=BN:D2&&n.push(i),n}function UA(e,t,r,n,i,a,o,s,l,u){if(rf(e,r)&&rf(t,n)&&rf(i,o)&&rf(a,s)){l.push(o,s);return}var c=2/u,h=c*c,f=o-e,d=s-t,g=Math.sqrt(f*f+d*d);f/=g,d/=g;var m=r-e,y=n-t,_=i-o,x=a-s,w=m*m+y*y,S=_*_+x*x;if(w=0&&N=0){l.push(o,s);return}var P=[],I=[];Cl(e,r,i,o,.5,P),Cl(t,n,a,s,.5,I),UA(P[0],I[0],P[1],I[1],P[2],I[2],P[3],I[3],l,u),UA(P[4],I[4],P[5],I[5],P[6],I[6],P[7],I[7],l,u)}function sbe(e,t){var r=HA(e),n=[];t=t||1;for(var i=0;i0)for(var u=0;uMath.abs(u),h=MZ([l,u],c?0:1,t),f=(c?s:u)/h.length,d=0;di,o=MZ([n,i],a?0:1,t),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",h=e[s]/o.length,f=0;f1?null:new Pe(m*l+e,m*u+t)}function cbe(e,t,r){var n=new Pe;Pe.sub(n,r,t),n.normalize();var i=new Pe;Pe.sub(i,e,t);var a=i.dot(n);return a}function Nh(e,t){var r=e[e.length-1];r&&r[0]===t[0]&&r[1]===t[1]||e.push(t)}function hbe(e,t,r){for(var n=e.length,i=[],a=0;ao?(u.x=c.x=s+a/2,u.y=l,c.y=l+o):(u.y=c.y=l+o/2,u.x=s,c.x=s+a),hbe(t,u,c)}function g1(e,t,r,n){if(r===1)n.push(t);else{var i=Math.floor(r/2),a=e(t);g1(e,a[0],i,n),g1(e,a[1],r-i,n)}return n}function fbe(e,t){for(var r=[],n=0;n0;u/=2){var c=0,h=0;(e&u)>0&&(c=1),(t&u)>0&&(h=1),s+=u*u*(3*c^h),h===0&&(c===1&&(e=u-1-e,t=u-1-t),l=e,e=t,t=l)}return s}function _1(e){var t=1/0,r=1/0,n=-1/0,i=-1/0,a=ae(e,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),h=l.y+l.height/2+(u?u[5]:0);return t=Math.min(c,t),r=Math.min(h,r),n=Math.max(c,n),i=Math.max(h,i),[c,h]}),o=ae(a,function(s,l){return{cp:s,z:bbe(s[0],s[1],t,r,n,i),path:e[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function kZ(e){return pbe(e.path,e.count)}function WA(){return{fromIndividuals:[],toIndividuals:[],count:0}}function wbe(e,t,r){var n=[];function i(T){for(var M=0;M=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var Cbe={clone:function(e){for(var t=[],r=1-Math.pow(1-e.path.style.opacity,1/e.count),n=0;n0))return;var s=n.getModel("universalTransition").get("delay"),l=ee({setToFinal:!0},o),u,c;eB(e)&&(u=e,c=t),eB(t)&&(u=t,c=e);function h(_,x,w,S,T){var M=_.many,A=_.one;if(M.length===1&&!T){var N=x?M[0]:A,P=x?A:M[0];if(m1(N))h({many:[N],one:P},!0,w,S,!0);else{var I=s?Le({delay:s(w,S)},l):l;eP(N,P,I),a(N,P,N,P,I)}}else for(var D=Le({dividePath:Cbe[r],individualDelay:s&&function(V,z,$,W){return s(V+w,S)}},l),O=x?wbe(M,A,D):Sbe(A,M,D),j=O.fromIndividuals,B=O.toIndividuals,U=j.length,H=0;Ht.length,d=u?tB(c,u):tB(f?t:e,[f?e:t]),g=0,m=0;mIZ))for(var a=n.getIndices(),o=0;o0&&M.group.traverse(function(N){N instanceof Je&&!N.animators.length&&N.animateFrom({style:{opacity:0}},A)})})}function oB(e){var t=e.getModel("universalTransition").get("seriesKey");return t||e.id}function sB(e){return ne(e)?e.sort().join(","):e}function Vs(e){if(e.hostModel)return e.hostModel.getModel("universalTransition").get("divideShape")}function Nbe(e,t){var r=pe(),n=pe(),i=pe();return E(e.oldSeries,function(a,o){var s=e.oldDataGroupIds[o],l=e.oldData[o],u=oB(a),c=sB(u);n.set(c,{dataGroupId:s,data:l}),ne(u)&&E(u,function(h){i.set(h,{key:c,dataGroupId:s,data:l})})}),E(t.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=oB(a),u=sB(l),c=n.get(u);if(c)r.set(u,{oldSeries:[{dataGroupId:c.dataGroupId,divide:Vs(c.data),data:c.data}],newSeries:[{dataGroupId:o,divide:Vs(s),data:s}]});else if(ne(l)){var h=[];E(l,function(g){var m=n.get(g);m.data&&h.push({dataGroupId:m.dataGroupId,divide:Vs(m.data),data:m.data})}),h.length&&r.set(u,{oldSeries:h,newSeries:[{dataGroupId:o,data:s,divide:Vs(s)}]})}else{var f=i.get(l);if(f){var d=r.get(f.key);d||(d={oldSeries:[{dataGroupId:f.dataGroupId,data:f.data,divide:Vs(f.data)}],newSeries:[]},r.set(f.key,d)),d.newSeries.push({dataGroupId:o,data:s,divide:Vs(s)})}}}}),r}function lB(e,t){for(var r=0;r=0&&i.push({dataGroupId:t.oldDataGroupIds[s],data:t.oldData[s],divide:Vs(t.oldData[s]),groupIdDim:o.dimension})}),E(kt(e.to),function(o){var s=lB(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:t.oldDataGroupIds[s],data:l,divide:Vs(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&NZ(i,a,n)}function Dbe(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){E(kt(n.seriesTransition),function(i){E(kt(i.to),function(a){for(var o=n.updatedSeries,s=0;ss.vmin?n+=s.vmin-i+(t-s.vmin)/(s.vmax-s.vmin)*s.gapReal:n+=t-i,i=s.vmax,a=!1;break}n+=s.vmin-i+s.gapReal,i=s.vmax}return a&&(n+=t-i),n},transformOut:function(t,r){if(r&&r.depth===Jo)return t;for(var n=uB,i=cB,a=!0,o=0,s=0;su?o=l.vmin+(t-u)/(c-u)*(l.vmax-l.vmin):o=i+t-n,i=l.vmax,a=!1;break}n=c,i=l.vmax}return a&&(o=i+t-n),o}},e}();function Rbe(e,t){return new Ebe(e,t)}var uB=0,cB=0;function jbe(e,t){var r=0,n={tpAbs:{span:0,val:0},tpPrct:{span:0,val:0}},i=function(){return{has:!1,span:NaN,inExtFrac:NaN,val:NaN}},a={S:{tpAbs:i(),tpPrct:i()},E:{tpAbs:i(),tpPrct:i()}};E(e.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=tP(s,t);if(u){var c=u.vmin!==s.vmin,h=u.vmax!==s.vmax,f=u.vmax-u.vmin;if(!(c&&h))if(c||h){var d=c?"S":"E";a[d][l.type].has=!0,a[d][l.type].span=f,a[d][l.type].inExtFrac=f/(s.vmax-s.vmin),a[d][l.type].val=l.val}else n[l.type].span+=f,n[l.type].val+=l.val}});var o=r*(0+(t[1]-t[0])+(n.tpAbs.val-n.tpAbs.span)+(a.S.tpAbs.has?(a.S.tpAbs.val-a.S.tpAbs.span)*a.S.tpAbs.inExtFrac:0)+(a.E.tpAbs.has?(a.E.tpAbs.val-a.E.tpAbs.span)*a.E.tpAbs.inExtFrac:0)-n.tpPrct.span-(a.S.tpPrct.has?a.S.tpPrct.span*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.span*a.E.tpPrct.inExtFrac:0))/(1-n.tpPrct.val-(a.S.tpPrct.has?a.S.tpPrct.val*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.val*a.E.tpPrct.inExtFrac:0));E(e.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(s.gapReal=r!==0?$e(o,0)*l.val/r:0),l.type==="tpAbs"&&(s.gapReal=l.val),s.gapReal==null&&(s.gapReal=0)})}function Obe(e,t,r,n,i,a){e!=="no"&&E(r,function(o){var s=tP(o,a);if(s)for(var l=t.length-1;l>=0;l--){var u=t[l],c=n(u),h=i*3/4;c>s.vmin-h&&ct[0]&&r=0&&o<1-1e-5}E(e,function(o){if(!(!o||o.start==null||o.end==null)&&!o.isExpanded){var s={breakOption:Se(o),vmin:t.parse(o.start),vmax:t.parse(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if(ue(o.gap)){var u=oi(o.gap);if(u.match(/%$/)){var c=parseFloat(u)/100;i(c)||(c=0),s.gapParsed.type="tpPrct",s.gapParsed.val=c,l=!0}}if(!l){var h=t.parse(o.gap);(!isFinite(h)||h<0)&&(h=0),s.gapParsed.type="tpAbs",s.gapParsed.val=h}}if(s.vmin===s.vmax&&(s.gapParsed.type="tpAbs",s.gapParsed.val=0),r&&r.noNegative&&E(["vmin","vmax"],function(d){s[d]<0&&(s[d]=0)}),s.vmin>s.vmax){var f=s.vmax;s.vmax=s.vmin,s.vmin=f}n.push(s)}}),n.sort(function(o,s){return o.vmin-s.vmin});var a=-1/0;return E(n,function(o,s){a>o.vmin&&(n[s]=null),a=o.vmax}),{breaks:gt(n,function(o){return!!o})}}function rP(e,t){return $A(t)===$A(e)}function $A(e){return e.start+"_\0_"+e.end}function Bbe(e,t,r){var n=[];E(e,function(a,o){var s=t(a);s&&s.type==="vmin"&&n.push([o])}),E(e,function(a,o){var s=t(a);if(s&&s.type==="vmax"){var l=ys(n,function(u){return rP(t(e[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return E(n,function(a){a.length===2&&i.push(r?a:[e[a[0]],e[a[1]]])}),i}function Fbe(e,t,r,n){if(t.break){var i=t.break.parsedBreak,a=ys(r,function(c){return rP(c.breakOption,t.break.parsedBreak.breakOption)}),o={lookup:n,depth:Jo},s=e.transformOut(i.vmin,o),l=e.transformOut(i.vmax,o),u={vmin:s,vmax:l,breakOption:i.breakOption,gapParsed:Se(a.gapParsed),gapReal:i.gapReal};return{tickVal:u[t.break.type],vBreak:{type:t.break.type,parsedBreak:u}}}}function Vbe(e,t,r,n,i){i.original=ZA(e,t,r);var a=i.transformed=ZA(e,t,r),o=i.lookup;a.breaks=ae(a.breaks,function(s,l){var u={depth:Jo},c=t.transformIn(s.vmin,u),h=t.transformIn(s.vmax,u),f={type:s.gapParsed.type,val:s.gapParsed.type==="tpAbs"?t.transformIn(s.vmin+s.gapParsed.val,u)-c:s.gapParsed.val};return o.from[n+l]=c,o.to[n+l]=s.vmin,o.from[n+l+1]=h,o.to[n+l+1]=s.vmax,{vmin:c,vmax:h,gapParsed:f,gapReal:s.gapReal,breakOption:s.breakOption}})}var Gbe={vmin:"start",vmax:"end"};function Hbe(e,t){return t&&(e=e||{},e.break={type:Gbe[t.type],start:t.parsedBreak.vmin,end:t.parsedBreak.vmax}),e}function Ube(){Hre({createBreakScaleMapper:Rbe,pruneTicksByBreak:Obe,addBreaksToTicks:zbe,parseAxisBreakOption:ZA,identifyAxisBreak:rP,serializeAxisBreakIdentifier:$A,retrieveAxisBreakPairs:Bbe,getTicksBreakOutwardTransform:Fbe,parseAxisBreakOptionInwardTransform:Vbe,makeAxisLabelFormatterParamBreak:Hbe})}var hB=He();function Wbe(e,t){var r=ys(e,function(n){return hr().identifyAxisBreak(n.parsedBreak.breakOption,t.breakOption)});return r||e.push(r={zigzagRandomList:[],parsedBreak:t,shouldRemove:!1}),r}function Zbe(e){E(e,function(t){return t.shouldRemove=!0})}function $be(e){for(var t=e.length-1;t>=0;t--)e[t].shouldRemove&&e.splice(t,1)}function Ybe(e,t,r,n,i){var a=r.axis;if(a.scale.isBlank()||!hr())return;var o=hr().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(P){return P.break},!1);if(!o.length)return;var s=r.getModel("breakArea"),l=s.get("zigzagAmplitude"),u=s.get("zigzagMinSpan"),c=s.get("zigzagMaxSpan");u=Math.max(2,u||0),c=Math.max(u,c||0);var h=s.get("expandOnClick"),f=s.get("zigzagZ"),d=s.getModel("itemStyle"),g=d.getItemStyle(),m=g.stroke,y=g.lineWidth,_=g.lineDash,x=g.fill,w=new Me({ignoreModelZ:!0}),S=a.isHorizontal(),T=hB(t).visualList||(hB(t).visualList=[]);Zbe(T);for(var M=function(P){var I=o[P][0].break.parsedBreak,D=[];D[0]=a.toGlobalCoord(a.dataToCoord(I.vmin,!0)),D[1]=a.toGlobalCoord(a.dataToCoord(I.vmax,!0)),D[1]=z;le&&(re=z);var De=[],be=[];De[H]=D,be[H]=O,!oe&&!le&&(De[H]+=X?-l:l,be[H]-=X?l:-l),De[V]=re,be[V]=re,W.push(De),Z.push(be);var ve=void 0;if(Jx[1]&&x.reverse(),{coordPair:x,brkId:hr().serializeAxisBreakIdentifier(_.breakOption)}});l.sort(function(y,_){return y.coordPair[0]-_.coordPair[0]});for(var u=o[0],c=null,h=0;h=0?l[0].width:l[1].width),f=(h+c.x)/2-u.x,d=Math.min(f,f-c.x),g=Math.max(f,f-c.x),m=g<0?g:d>0?d:0;s=(f-m)/c.x}var y=new Pe,_=new Pe;Pe.scale(y,n,-s),Pe.scale(_,n,1-s),ZM(r[0],y),ZM(r[1],_)}function Kbe(e,t){var r={breaks:[]};return E(t.breaks,function(n){if(n){var i=ys(e.get("breaks",!0),function(s){return hr().identifyAxisBreak(s,n)});if(i){var a=t.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===Pb?!0:a===wW?!1:a===SW?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),r}function Jbe(){vue({adjustBreakLabelPair:qbe,buildAxisBreakLine:Xbe,rectCoordBuildBreakAxis:Ybe,updateModelAxisBreak:Kbe})}function Qbe(e){yue(e),Ube(),Jbe()}function ewe(){Ece(twe)}function twe(e,t){E(e,function(r){if(!r.model.get(["axisLabel","inside"])){var n=rwe(r);if(n){var i=r.isHorizontal()?"height":"width",a=r.model.get(["axisLabel","margin"]);t[i]-=n[i]+a,r.position==="top"?t.y+=n.height+a:r.position==="left"&&(t.x+=n.width+a)}}})}function rwe(e){var t=e.model,r=e.scale;if(!t.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof yg?i=r.count():(n=r.getTicks(),i=n.length);var o=e.getLabelModel(),s=cm(e),l,u=1;i>40&&(u=Math.ceil(i/40));for(var c=0;c1&&arguments[1]!==void 0?arguments[1]:60,i=null;return function(){for(var a=this,o=arguments.length,s=new Array(o),l=0;l12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function _we(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function xwe(e){return e==="ROUTER"||e==="ROUTER_LATE"?30:e==="REPEATER"||e==="TRACKER"?25:e==="CLIENT_MUTE"?7:e==="CLIENT_BASE"?12:15}function bwe({nodes:e,edges:t,selectedNodeId:r,onSelectNode:n}){const i=G.useRef(null),[a,o]=G.useState("connected"),s=G.useMemo(()=>{const y=new Set;return t.forEach(_=>{y.add(_.from_node),y.add(_.to_node)}),y},[t]),l=G.useMemo(()=>{let y=e;return a==="connected"?y=y.filter(_=>s.has(_.node_num)):a==="infra"&&(y=y.filter(_=>vB.includes(_.role))),y},[e,a,s]),u=G.useMemo(()=>new Map(l.map(y=>[y.node_num,y])),[l]),c=G.useMemo(()=>t.filter(y=>u.has(y.from_node)&&u.has(y.to_node)),[t,u]),h=G.useMemo(()=>{const y=new Set;return r!==null&&c.forEach(_=>{_.from_node===r&&y.add(_.to_node),_.to_node===r&&y.add(_.from_node)}),y},[r,c]),f=G.useMemo(()=>{const y=l.map(x=>{const w=_we(x.latitude),S=dB[w%dB.length],T=vB.includes(x.role),M=x.node_num===r,A=h.has(x.node_num),N=r===null||M||A;return{id:String(x.node_num),name:x.short_name,value:x.node_num,symbolSize:xwe(x.role),itemStyle:{color:T?S:"#111827",borderColor:S,borderWidth:T?0:2,opacity:N?1:.15},label:{show:!0,position:"bottom",distance:5,fontSize:10,fontFamily:"JetBrains Mono, monospace",color:N?"#94a3b8":"#94a3b820"},nodeNum:x.node_num,longName:x.long_name,role:x.role}}),_=c.map(x=>{const w=r===null||x.from_node===r||x.to_node===r;return{source:String(x.from_node),target:String(x.to_node),value:x.snr,lineStyle:{color:ywe(x.snr),width:w&&r!==null?2:1,opacity:r===null?.4:w?.6:.04}}});return{nodes:y,links:_}},[l,c,r,h]),d=G.useMemo(()=>({backgroundColor:"#111827",tooltip:{trigger:"item",backgroundColor:"#1e293b",borderColor:"#334155",textStyle:{color:"#e2e8f0",fontFamily:"JetBrains Mono, monospace",fontSize:11},formatter:y=>{if(y.data&&y.data.longName){const _=y.data;return`${_.name}
${_.longName}
Role: ${_.role}`}return""}},series:[{type:"graph",layout:"force",roam:!0,draggable:!0,animation:!1,data:f.nodes,links:f.links,force:{repulsion:200,edgeLength:[80,120],gravity:.1},emphasis:{focus:"adjacency",blurScope:"coordinateSystem",scale:1.1,lineStyle:{width:2}},blur:{itemStyle:{opacity:.15},lineStyle:{opacity:.04}},label:{show:!0,position:"bottom",distance:5,fontSize:10,fontFamily:"JetBrains Mono, monospace"},edgeLabel:{show:!1},edgeSymbol:["none","none"]}]}),[f]),g=G.useCallback(y=>{if(y.data&&"nodeNum"in y.data){const _=y.data.nodeNum;n(r===_?null:_??null)}},[r,n]),m=G.useMemo(()=>({click:g}),[g]);return G.useEffect(()=>{var _;const y=(_=i.current)==null?void 0:_.getEchartsInstance();y&&y.setOption(d,{notMerge:!1,lazyUpdate:!0})},[d]),v.jsxs("div",{className:"relative bg-bg-card border border-border overflow-hidden",children:[v.jsx(mwe,{ref:i,option:d,style:{height:"540px",width:"100%"},onEvents:m,opts:{renderer:"canvas"}}),v.jsxs("div",{className:"absolute top-4 left-4 flex items-center gap-2 bg-bg-card/90 backdrop-blur-sm border border-border rounded px-3 py-2",children:[v.jsx(JL,{size:14,className:"text-slate-500"}),v.jsx("div",{className:"flex gap-1",children:[{key:"connected",label:"Connected"},{key:"infra",label:"Infra"},{key:"all",label:"All"}].map(({key:y,label:_})=>v.jsx("button",{onClick:()=>o(y),className:`px-2 py-1 text-xs rounded transition-colors ${a===y?"bg-accent text-white":"bg-bg-hover text-slate-400 hover:text-slate-200"}`,children:_},y))}),v.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[l.length," nodes • ",c.length," edges"]})]}),v.jsxs("div",{className:"absolute bottom-4 left-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[v.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Edge Quality (SNR)"}),v.jsx("div",{className:"space-y-1",children:[{label:"Excellent (>12)",color:"#22c55e"},{label:"Good (8-12)",color:"#4ade80"},{label:"Fair (5-8)",color:"#f59e0b"},{label:"Marginal (3-5)",color:"#f97316"},{label:"Poor (<3)",color:"#ef4444"}].map(y=>v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-4 h-0.5",style:{backgroundColor:y.color}}),v.jsx("span",{className:"text-xs text-slate-500",children:y.label})]},y.label))})]}),v.jsxs("div",{className:"absolute bottom-4 right-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[v.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Node Type"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-3 h-3 rounded-full bg-sky-400"}),v.jsx("span",{className:"text-xs text-slate-500",children:"Infrastructure"})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-900 border-2 border-sky-400"}),v.jsx("span",{className:"text-xs text-slate-500",children:"Client"})]})]})]})]})}function EZ(e,t){const r=G.useRef(t);G.useEffect(function(){t!==r.current&&e.attributionControl!=null&&(r.current!=null&&e.attributionControl.removeAttribution(r.current),t!=null&&e.attributionControl.addAttribution(t)),r.current=t},[e,t])}function wwe(e,t,r){t.center!==r.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==r.radius&&e.setRadius(t.radius)}const Swe=1;function Cwe(e){return Object.freeze({__version:Swe,map:e})}function RZ(e,t){return Object.freeze({...e,...t})}const jZ=G.createContext(null),OZ=jZ.Provider;function Yb(){const e=G.useContext(jZ);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function Twe(e){function t(r,n){const{instance:i,context:a}=e(r).current;return G.useImperativeHandle(n,()=>i),r.children==null?null:bf.createElement(OZ,{value:a},r.children)}return G.forwardRef(t)}function Mwe(e){function t(r,n){const[i,a]=G.useState(!1),{instance:o}=e(r,a).current;G.useImperativeHandle(n,()=>o),G.useEffect(function(){i&&o.update()},[o,i,r.children]);const s=o._contentNode;return s?BV.createPortal(r.children,s):null}return G.forwardRef(t)}function Awe(e){function t(r,n){const{instance:i}=e(r).current;return G.useImperativeHandle(n,()=>i),null}return G.forwardRef(t)}function oP(e,t){const r=G.useRef();G.useEffect(function(){return t!=null&&e.instance.on(t),r.current=t,function(){r.current!=null&&e.instance.off(r.current),r.current=null}},[e,t])}function Xb(e,t){const r=e.pane??t.pane;return r?{...e,pane:r}:e}function Lwe(e,t){return function(n,i){const a=Yb(),o=e(Xb(n,a),a);return EZ(a.map,n.attribution),oP(o.current,n.eventHandlers),t(o.current,a,n,i),o}}var qA={exports:{}};/* @preserve + * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com + * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade + */(function(e,t){(function(r,n){n(t)})(G$,function(r){var n="1.9.4";function i(p){var b,C,k,R;for(C=1,k=arguments.length;C"u"||!L||!L.Mixin)){p=w(p)?p:[p];for(var b=0;b0?Math.floor(p):Math.ceil(p)};z.prototype={clone:function(){return new z(this.x,this.y)},add:function(p){return this.clone()._add(W(p))},_add:function(p){return this.x+=p.x,this.y+=p.y,this},subtract:function(p){return this.clone()._subtract(W(p))},_subtract:function(p){return this.x-=p.x,this.y-=p.y,this},divideBy:function(p){return this.clone()._divideBy(p)},_divideBy:function(p){return this.x/=p,this.y/=p,this},multiplyBy:function(p){return this.clone()._multiplyBy(p)},_multiplyBy:function(p){return this.x*=p,this.y*=p,this},scaleBy:function(p){return new z(this.x*p.x,this.y*p.y)},unscaleBy:function(p){return new z(this.x/p.x,this.y/p.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=$(this.x),this.y=$(this.y),this},distanceTo:function(p){p=W(p);var b=p.x-this.x,C=p.y-this.y;return Math.sqrt(b*b+C*C)},equals:function(p){return p=W(p),p.x===this.x&&p.y===this.y},contains:function(p){return p=W(p),Math.abs(p.x)<=Math.abs(this.x)&&Math.abs(p.y)<=Math.abs(this.y)},toString:function(){return"Point("+f(this.x)+", "+f(this.y)+")"}};function W(p,b,C){return p instanceof z?p:w(p)?new z(p[0],p[1]):p==null?p:typeof p=="object"&&"x"in p&&"y"in p?new z(p.x,p.y):new z(p,b,C)}function Z(p,b){if(p)for(var C=b?[p,b]:p,k=0,R=C.length;k=this.min.x&&C.x<=this.max.x&&b.y>=this.min.y&&C.y<=this.max.y},intersects:function(p){p=X(p);var b=this.min,C=this.max,k=p.min,R=p.max,F=R.x>=b.x&&k.x<=C.x,Y=R.y>=b.y&&k.y<=C.y;return F&&Y},overlaps:function(p){p=X(p);var b=this.min,C=this.max,k=p.min,R=p.max,F=R.x>b.x&&k.xb.y&&k.y=b.lat&&R.lat<=C.lat&&k.lng>=b.lng&&R.lng<=C.lng},intersects:function(p){p=J(p);var b=this._southWest,C=this._northEast,k=p.getSouthWest(),R=p.getNorthEast(),F=R.lat>=b.lat&&k.lat<=C.lat,Y=R.lng>=b.lng&&k.lng<=C.lng;return F&&Y},overlaps:function(p){p=J(p);var b=this._southWest,C=this._northEast,k=p.getSouthWest(),R=p.getNorthEast(),F=R.lat>b.lat&&k.latb.lng&&k.lng1,we=function(){var p=!1;try{var b=Object.defineProperty({},"passive",{get:function(){p=!0}});window.addEventListener("testPassiveEventSupport",h,b),window.removeEventListener("testPassiveEventSupport",h,b)}catch{}return p}(),Jt=function(){return!!document.createElement("canvas").getContext}(),wn=!!(document.createElementNS&&tt("svg").createSVGRect),mi=!!wn&&function(){var p=document.createElement("div");return p.innerHTML="",(p.firstChild&&p.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Ji=!wn&&function(){try{var p=document.createElement("div");p.innerHTML='';var b=p.firstChild;return b.style.behavior="url(#default#VML)",b&&typeof b.adj=="object"}catch{return!1}}(),Fl=navigator.platform.indexOf("Mac")===0,te=navigator.platform.indexOf("Linux")===0;function st(p){return navigator.userAgent.toLowerCase().indexOf(p)>=0}var xe={ie:bt,ielt9:ar,edge:On,webkit:Qn,android:So,android23:kd,androidStock:xm,opera:Jc,chrome:Id,gecko:Nd,safari:bm,phantom:Pd,opera12:Dd,win:qb,ie3d:Pt,webkit3d:Ed,gecko3d:wm,any3d:Kb,mobile:Ve,mobileWebkit:Jb,mobileWebkit3d:Qb,msPointer:Co,pointer:$r,touch:Cm,touchNative:Sm,mobileOpera:Tm,mobileGecko:Mm,retina:Am,passiveEvents:we,canvas:Jt,svg:wn,vml:Ji,inlineSvg:mi,mac:Fl,linux:te},ft=xe.msPointer?"MSPointerDown":"pointerdown",or=xe.msPointer?"MSPointerMove":"pointermove",Ca=xe.msPointer?"MSPointerUp":"pointerup",ws=xe.msPointer?"MSPointerCancel":"pointercancel",Qc={touchstart:ft,touchmove:or,touchend:Ca,touchcancel:ws},Rd={touchstart:Dm,touchmove:Vl,touchend:Vl,touchcancel:Vl},To={},jd=!1;function Lm(p,b,C){return b==="touchstart"&&Pm(),Rd[b]?(C=Rd[b].bind(this,C),p.addEventListener(Qc[b],C,!1),C):(console.warn("wrong event specified:",b),h)}function km(p,b,C){if(!Qc[b]){console.warn("wrong event specified:",b);return}p.removeEventListener(Qc[b],C,!1)}function Im(p){To[p.pointerId]=p}function Nm(p){To[p.pointerId]&&(To[p.pointerId]=p)}function Od(p){delete To[p.pointerId]}function Pm(){jd||(document.addEventListener(ft,Im,!0),document.addEventListener(or,Nm,!0),document.addEventListener(Ca,Od,!0),document.addEventListener(ws,Od,!0),jd=!0)}function Vl(p,b){if(b.pointerType!==(b.MSPOINTER_TYPE_MOUSE||"mouse")){b.touches=[];for(var C in To)b.touches.push(To[C]);b.changedTouches=[b],p(b)}}function Dm(p,b){b.MSPOINTER_TYPE_TOUCH&&b.pointerType===b.MSPOINTER_TYPE_TOUCH&&Yr(b),Vl(p,b)}function Em(p){var b={},C,k;for(k in p)C=p[k],b[k]=C&&C.bind?C.bind(p):C;return p=b,b.type="dblclick",b.detail=2,b.isTrusted=!1,b._simulated=!0,b}var zd=200;function Rm(p,b){p.addEventListener("dblclick",b);var C=0,k;function R(F){if(F.detail!==1){k=F.detail;return}if(!(F.pointerType==="mouse"||F.sourceCapabilities&&!F.sourceCapabilities.firesTouchEvents)){var Y=vP(F);if(!(Y.some(function(ie){return ie instanceof HTMLLabelElement&&ie.attributes.for})&&!Y.some(function(ie){return ie instanceof HTMLInputElement||ie instanceof HTMLSelectElement}))){var Q=Date.now();Q-C<=zd?(k++,k===2&&b(Em(F))):k=1,C=Q}}}return p.addEventListener("click",R),{dblclick:b,simDblclick:R}}function Ot(p,b){p.removeEventListener("dblclick",b.dblclick),p.removeEventListener("click",b.simDblclick)}var mt=zm(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Mt=zm(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),cP=Mt==="webkitTransition"||Mt==="OTransition"?Mt+"End":"transitionend";function hP(p){return typeof p=="string"?document.getElementById(p):p}function Bd(p,b){var C=p.style[b]||p.currentStyle&&p.currentStyle[b];if((!C||C==="auto")&&document.defaultView){var k=document.defaultView.getComputedStyle(p,null);C=k?k[b]:null}return C==="auto"?null:C}function At(p,b,C){var k=document.createElement(p);return k.className=b||"",C&&C.appendChild(k),k}function Qt(p){var b=p.parentNode;b&&b.removeChild(p)}function jm(p){for(;p.firstChild;)p.removeChild(p.firstChild)}function eh(p){var b=p.parentNode;b&&b.lastChild!==p&&b.appendChild(p)}function th(p){var b=p.parentNode;b&&b.firstChild!==p&&b.insertBefore(p,b.firstChild)}function ew(p,b){if(p.classList!==void 0)return p.classList.contains(b);var C=Om(p);return C.length>0&&new RegExp("(^|\\s)"+b+"(\\s|$)").test(C)}function lt(p,b){if(p.classList!==void 0)for(var C=g(b),k=0,R=C.length;k0?2*window.devicePixelRatio:1;function gP(p){return xe.edge?p.wheelDeltaY/2:p.deltaY&&p.deltaMode===0?-p.deltaY/YZ:p.deltaY&&p.deltaMode===1?-p.deltaY*20:p.deltaY&&p.deltaMode===2?-p.deltaY*60:p.deltaX||p.deltaZ?0:p.wheelDelta?(p.wheelDeltaY||p.wheelDelta)/2:p.detail&&Math.abs(p.detail)<32765?-p.detail*20:p.detail?p.detail/-32765*60:0}function fw(p,b){var C=b.relatedTarget;if(!C)return!0;try{for(;C&&C!==p;)C=C.parentNode}catch{return!1}return C!==p}var XZ={__proto__:null,on:it,off:Gt,stopPropagation:Ul,disableScrollPropagation:hw,disableClickPropagation:Hd,preventDefault:Yr,stop:Wl,getPropagationPath:vP,getMousePosition:pP,getWheelDelta:gP,isExternalTarget:fw,addListener:it,removeListener:Gt},mP=V.extend({run:function(p,b,C,k){this.stop(),this._el=p,this._inProgress=!0,this._duration=C||.25,this._easeOutPower=1/Math.max(k||.5,.2),this._startPos=Hl(p),this._offset=b.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=D(this._animate,this),this._step()},_step:function(p){var b=+new Date-this._startTime,C=this._duration*1e3;bthis.options.maxZoom)?this.setZoom(p):this},panInsideBounds:function(p,b){this._enforcingBounds=!0;var C=this.getCenter(),k=this._limitCenter(C,this._zoom,J(p));return C.equals(k)||this.panTo(k,b),this._enforcingBounds=!1,this},panInside:function(p,b){b=b||{};var C=W(b.paddingTopLeft||b.padding||[0,0]),k=W(b.paddingBottomRight||b.padding||[0,0]),R=this.project(this.getCenter()),F=this.project(p),Y=this.getPixelBounds(),Q=X([Y.min.add(C),Y.max.subtract(k)]),ie=Q.getSize();if(!Q.contains(F)){this._enforcingBounds=!0;var ce=F.subtract(Q.getCenter()),Ee=Q.extend(F).getSize().subtract(ie);R.x+=ce.x<0?-Ee.x:Ee.x,R.y+=ce.y<0?-Ee.y:Ee.y,this.panTo(this.unproject(R),b),this._enforcingBounds=!1}return this},invalidateSize:function(p){if(!this._loaded)return this;p=i({animate:!1,pan:!0},p===!0?{animate:!0}:p);var b=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var C=this.getSize(),k=b.divideBy(2).round(),R=C.divideBy(2).round(),F=k.subtract(R);return!F.x&&!F.y?this:(p.animate&&p.pan?this.panBy(F):(p.pan&&this._rawPanBy(F),this.fire("move"),p.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:b,newSize:C}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(p){if(p=this._locateOptions=i({timeout:1e4,watch:!1},p),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var b=o(this._handleGeolocationResponse,this),C=o(this._handleGeolocationError,this);return p.watch?this._locationWatchId=navigator.geolocation.watchPosition(b,C,p):navigator.geolocation.getCurrentPosition(b,C,p),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(p){if(this._container._leaflet_id){var b=p.code,C=p.message||(b===1?"permission denied":b===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:b,message:"Geolocation error: "+C+"."})}},_handleGeolocationResponse:function(p){if(this._container._leaflet_id){var b=p.coords.latitude,C=p.coords.longitude,k=new oe(b,C),R=k.toBounds(p.coords.accuracy*2),F=this._locateOptions;if(F.setView){var Y=this.getBoundsZoom(R);this.setView(k,F.maxZoom?Math.min(Y,F.maxZoom):Y)}var Q={latlng:k,bounds:R,timestamp:p.timestamp};for(var ie in p.coords)typeof p.coords[ie]=="number"&&(Q[ie]=p.coords[ie]);this.fire("locationfound",Q)}},addHandler:function(p,b){if(!b)return this;var C=this[p]=new b(this);return this._handlers.push(C),this.options[p]&&C.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Qt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(O(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var p;for(p in this._layers)this._layers[p].remove();for(p in this._panes)Qt(this._panes[p]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(p,b){var C="leaflet-pane"+(p?" leaflet-"+p.replace("Pane","")+"-pane":""),k=At("div",C,b||this._mapPane);return p&&(this._panes[p]=k),k},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var p=this.getPixelBounds(),b=this.unproject(p.getBottomLeft()),C=this.unproject(p.getTopRight());return new re(b,C)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(p,b,C){p=J(p),C=W(C||[0,0]);var k=this.getZoom()||0,R=this.getMinZoom(),F=this.getMaxZoom(),Y=p.getNorthWest(),Q=p.getSouthEast(),ie=this.getSize().subtract(C),ce=X(this.project(Q,k),this.project(Y,k)).getSize(),Ee=xe.any3d?this.options.zoomSnap:1,qe=ie.x/ce.x,dt=ie.y/ce.y,Sn=b?Math.max(qe,dt):Math.min(qe,dt);return k=this.getScaleZoom(Sn,k),Ee&&(k=Math.round(k/(Ee/100))*(Ee/100),k=b?Math.ceil(k/Ee)*Ee:Math.floor(k/Ee)*Ee),Math.max(R,Math.min(F,k))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new z(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(p,b){var C=this._getTopLeftPoint(p,b);return new Z(C,C.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(p){return this.options.crs.getProjectedBounds(p===void 0?this.getZoom():p)},getPane:function(p){return typeof p=="string"?this._panes[p]:p},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(p,b){var C=this.options.crs;return b=b===void 0?this._zoom:b,C.scale(p)/C.scale(b)},getScaleZoom:function(p,b){var C=this.options.crs;b=b===void 0?this._zoom:b;var k=C.zoom(p*C.scale(b));return isNaN(k)?1/0:k},project:function(p,b){return b=b===void 0?this._zoom:b,this.options.crs.latLngToPoint(le(p),b)},unproject:function(p,b){return b=b===void 0?this._zoom:b,this.options.crs.pointToLatLng(W(p),b)},layerPointToLatLng:function(p){var b=W(p).add(this.getPixelOrigin());return this.unproject(b)},latLngToLayerPoint:function(p){var b=this.project(le(p))._round();return b._subtract(this.getPixelOrigin())},wrapLatLng:function(p){return this.options.crs.wrapLatLng(le(p))},wrapLatLngBounds:function(p){return this.options.crs.wrapLatLngBounds(J(p))},distance:function(p,b){return this.options.crs.distance(le(p),le(b))},containerPointToLayerPoint:function(p){return W(p).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(p){return W(p).add(this._getMapPanePos())},containerPointToLatLng:function(p){var b=this.containerPointToLayerPoint(W(p));return this.layerPointToLatLng(b)},latLngToContainerPoint:function(p){return this.layerPointToContainerPoint(this.latLngToLayerPoint(le(p)))},mouseEventToContainerPoint:function(p){return pP(p,this._container)},mouseEventToLayerPoint:function(p){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(p))},mouseEventToLatLng:function(p){return this.layerPointToLatLng(this.mouseEventToLayerPoint(p))},_initContainer:function(p){var b=this._container=hP(p);if(b){if(b._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");it(b,"scroll",this._onScroll,this),this._containerId=l(b)},_initLayout:function(){var p=this._container;this._fadeAnimated=this.options.fadeAnimation&&xe.any3d,lt(p,"leaflet-container"+(xe.touch?" leaflet-touch":"")+(xe.retina?" leaflet-retina":"")+(xe.ielt9?" leaflet-oldie":"")+(xe.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var b=Bd(p,"position");b!=="absolute"&&b!=="relative"&&b!=="fixed"&&b!=="sticky"&&(p.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var p=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),xr(this._mapPane,new z(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(lt(p.markerPane,"leaflet-zoom-hide"),lt(p.shadowPane,"leaflet-zoom-hide"))},_resetView:function(p,b,C){xr(this._mapPane,new z(0,0));var k=!this._loaded;this._loaded=!0,b=this._limitZoom(b),this.fire("viewprereset");var R=this._zoom!==b;this._moveStart(R,C)._move(p,b)._moveEnd(R),this.fire("viewreset"),k&&this.fire("load")},_moveStart:function(p,b){return p&&this.fire("zoomstart"),b||this.fire("movestart"),this},_move:function(p,b,C,k){b===void 0&&(b=this._zoom);var R=this._zoom!==b;return this._zoom=b,this._lastCenter=p,this._pixelOrigin=this._getNewPixelOrigin(p),k?C&&C.pinch&&this.fire("zoom",C):((R||C&&C.pinch)&&this.fire("zoom",C),this.fire("move",C)),this},_moveEnd:function(p){return p&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return O(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(p){xr(this._mapPane,this._getMapPanePos().subtract(p))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(p){this._targets={},this._targets[l(this._container)]=this;var b=p?Gt:it;b(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&b(window,"resize",this._onResize,this),xe.any3d&&this.options.transform3DLimit&&(p?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){O(this._resizeRequest),this._resizeRequest=D(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var p=this._getMapPanePos();Math.max(Math.abs(p.x),Math.abs(p.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(p,b){for(var C=[],k,R=b==="mouseout"||b==="mouseover",F=p.target||p.srcElement,Y=!1;F;){if(k=this._targets[l(F)],k&&(b==="click"||b==="preclick")&&this._draggableMoved(k)){Y=!0;break}if(k&&k.listens(b,!0)&&(R&&!fw(F,p)||(C.push(k),R))||F===this._container)break;F=F.parentNode}return!C.length&&!Y&&!R&&this.listens(b,!0)&&(C=[this]),C},_isClickDisabled:function(p){for(;p&&p!==this._container;){if(p._leaflet_disable_click)return!0;p=p.parentNode}},_handleDOMEvent:function(p){var b=p.target||p.srcElement;if(!(!this._loaded||b._leaflet_disable_events||p.type==="click"&&this._isClickDisabled(b))){var C=p.type;C==="mousedown"&&ow(b),this._fireDOMEvent(p,C)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(p,b,C){if(p.type==="click"){var k=i({},p);k.type="preclick",this._fireDOMEvent(k,k.type,C)}var R=this._findEventTargets(p,b);if(C){for(var F=[],Y=0;Y0?Math.round(p-b)/2:Math.max(0,Math.ceil(p))-Math.max(0,Math.floor(b))},_limitZoom:function(p){var b=this.getMinZoom(),C=this.getMaxZoom(),k=xe.any3d?this.options.zoomSnap:1;return k&&(p=Math.round(p/k)*k),Math.max(b,Math.min(C,p))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){pr(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(p,b){var C=this._getCenterOffset(p)._trunc();return(b&&b.animate)!==!0&&!this.getSize().contains(C)?!1:(this.panBy(C,b),!0)},_createAnimProxy:function(){var p=this._proxy=At("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(p),this.on("zoomanim",function(b){var C=mt,k=this._proxy.style[C];Gl(this._proxy,this.project(b.center,b.zoom),this.getZoomScale(b.zoom,1)),k===this._proxy.style[C]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Qt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var p=this.getCenter(),b=this.getZoom();Gl(this._proxy,this.project(p,b),this.getZoomScale(b,1))},_catchTransitionEnd:function(p){this._animatingZoom&&p.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(p,b,C){if(this._animatingZoom)return!0;if(C=C||{},!this._zoomAnimated||C.animate===!1||this._nothingToAnimate()||Math.abs(b-this._zoom)>this.options.zoomAnimationThreshold)return!1;var k=this.getZoomScale(b),R=this._getCenterOffset(p)._divideBy(1-1/k);return C.animate!==!0&&!this.getSize().contains(R)?!1:(D(function(){this._moveStart(!0,C.noMoveStart||!1)._animateZoom(p,b,!0)},this),!0)},_animateZoom:function(p,b,C,k){this._mapPane&&(C&&(this._animatingZoom=!0,this._animateToCenter=p,this._animateToZoom=b,lt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:p,zoom:b,noUpdate:k}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&pr(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function qZ(p,b){return new wt(p,b)}var Qi=B.extend({options:{position:"topright"},initialize:function(p){m(this,p)},getPosition:function(){return this.options.position},setPosition:function(p){var b=this._map;return b&&b.removeControl(this),this.options.position=p,b&&b.addControl(this),this},getContainer:function(){return this._container},addTo:function(p){this.remove(),this._map=p;var b=this._container=this.onAdd(p),C=this.getPosition(),k=p._controlCorners[C];return lt(b,"leaflet-control"),C.indexOf("bottom")!==-1?k.insertBefore(b,k.firstChild):k.appendChild(b),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Qt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(p){this._map&&p&&p.screenX>0&&p.screenY>0&&this._map.getContainer().focus()}}),Ud=function(p){return new Qi(p)};wt.include({addControl:function(p){return p.addTo(this),this},removeControl:function(p){return p.remove(),this},_initControlPos:function(){var p=this._controlCorners={},b="leaflet-",C=this._controlContainer=At("div",b+"control-container",this._container);function k(R,F){var Y=b+R+" "+b+F;p[R+F]=At("div",Y,C)}k("top","left"),k("top","right"),k("bottom","left"),k("bottom","right")},_clearControlPos:function(){for(var p in this._controlCorners)Qt(this._controlCorners[p]);Qt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var yP=Qi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(p,b,C,k){return C1,this._baseLayersList.style.display=p?"":"none"),this._separator.style.display=b&&p?"":"none",this},_onLayerChange:function(p){this._handlingClick||this._update();var b=this._getLayer(l(p.target)),C=b.overlay?p.type==="add"?"overlayadd":"overlayremove":p.type==="add"?"baselayerchange":null;C&&this._map.fire(C,b)},_createRadioElement:function(p,b){var C='",k=document.createElement("div");return k.innerHTML=C,k.firstChild},_addItem:function(p){var b=document.createElement("label"),C=this._map.hasLayer(p.layer),k;p.overlay?(k=document.createElement("input"),k.type="checkbox",k.className="leaflet-control-layers-selector",k.defaultChecked=C):k=this._createRadioElement("leaflet-base-layers_"+l(this),C),this._layerControlInputs.push(k),k.layerId=l(p.layer),it(k,"click",this._onInputClick,this);var R=document.createElement("span");R.innerHTML=" "+p.name;var F=document.createElement("span");b.appendChild(F),F.appendChild(k),F.appendChild(R);var Y=p.overlay?this._overlaysList:this._baseLayersList;return Y.appendChild(b),this._checkDisabledLayers(),b},_onInputClick:function(){if(!this._preventClick){var p=this._layerControlInputs,b,C,k=[],R=[];this._handlingClick=!0;for(var F=p.length-1;F>=0;F--)b=p[F],C=this._getLayer(b.layerId).layer,b.checked?k.push(C):b.checked||R.push(C);for(F=0;F=0;R--)b=p[R],C=this._getLayer(b.layerId).layer,b.disabled=C.options.minZoom!==void 0&&kC.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var p=this._section;this._preventClick=!0,it(p,"click",Yr),this.expand();var b=this;setTimeout(function(){Gt(p,"click",Yr),b._preventClick=!1})}}),KZ=function(p,b,C){return new yP(p,b,C)},dw=Qi.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(p){var b="leaflet-control-zoom",C=At("div",b+" leaflet-bar"),k=this.options;return this._zoomInButton=this._createButton(k.zoomInText,k.zoomInTitle,b+"-in",C,this._zoomIn),this._zoomOutButton=this._createButton(k.zoomOutText,k.zoomOutTitle,b+"-out",C,this._zoomOut),this._updateDisabled(),p.on("zoomend zoomlevelschange",this._updateDisabled,this),C},onRemove:function(p){p.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(p){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(p.shiftKey?3:1))},_createButton:function(p,b,C,k,R){var F=At("a",C,k);return F.innerHTML=p,F.href="#",F.title=b,F.setAttribute("role","button"),F.setAttribute("aria-label",b),Hd(F),it(F,"click",Wl),it(F,"click",R,this),it(F,"click",this._refocusOnMap,this),F},_updateDisabled:function(){var p=this._map,b="leaflet-disabled";pr(this._zoomInButton,b),pr(this._zoomOutButton,b),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||p._zoom===p.getMinZoom())&&(lt(this._zoomOutButton,b),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||p._zoom===p.getMaxZoom())&&(lt(this._zoomInButton,b),this._zoomInButton.setAttribute("aria-disabled","true"))}});wt.mergeOptions({zoomControl:!0}),wt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new dw,this.addControl(this.zoomControl))});var JZ=function(p){return new dw(p)},_P=Qi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(p){var b="leaflet-control-scale",C=At("div",b),k=this.options;return this._addScales(k,b+"-line",C),p.on(k.updateWhenIdle?"moveend":"move",this._update,this),p.whenReady(this._update,this),C},onRemove:function(p){p.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(p,b,C){p.metric&&(this._mScale=At("div",b,C)),p.imperial&&(this._iScale=At("div",b,C))},_update:function(){var p=this._map,b=p.getSize().y/2,C=p.distance(p.containerPointToLatLng([0,b]),p.containerPointToLatLng([this.options.maxWidth,b]));this._updateScales(C)},_updateScales:function(p){this.options.metric&&p&&this._updateMetric(p),this.options.imperial&&p&&this._updateImperial(p)},_updateMetric:function(p){var b=this._getRoundNum(p),C=b<1e3?b+" m":b/1e3+" km";this._updateScale(this._mScale,C,b/p)},_updateImperial:function(p){var b=p*3.2808399,C,k,R;b>5280?(C=b/5280,k=this._getRoundNum(C),this._updateScale(this._iScale,k+" mi",k/C)):(R=this._getRoundNum(b),this._updateScale(this._iScale,R+" ft",R/b))},_updateScale:function(p,b,C){p.style.width=Math.round(this.options.maxWidth*C)+"px",p.innerHTML=b},_getRoundNum:function(p){var b=Math.pow(10,(Math.floor(p)+"").length-1),C=p/b;return C=C>=10?10:C>=5?5:C>=3?3:C>=2?2:1,b*C}}),QZ=function(p){return new _P(p)},e$='',vw=Qi.extend({options:{position:"bottomright",prefix:''+(xe.inlineSvg?e$+" ":"")+"Leaflet"},initialize:function(p){m(this,p),this._attributions={}},onAdd:function(p){p.attributionControl=this,this._container=At("div","leaflet-control-attribution"),Hd(this._container);for(var b in p._layers)p._layers[b].getAttribution&&this.addAttribution(p._layers[b].getAttribution());return this._update(),p.on("layeradd",this._addAttribution,this),this._container},onRemove:function(p){p.off("layeradd",this._addAttribution,this)},_addAttribution:function(p){p.layer.getAttribution&&(this.addAttribution(p.layer.getAttribution()),p.layer.once("remove",function(){this.removeAttribution(p.layer.getAttribution())},this))},setPrefix:function(p){return this.options.prefix=p,this._update(),this},addAttribution:function(p){return p?(this._attributions[p]||(this._attributions[p]=0),this._attributions[p]++,this._update(),this):this},removeAttribution:function(p){return p?(this._attributions[p]&&(this._attributions[p]--,this._update()),this):this},_update:function(){if(this._map){var p=[];for(var b in this._attributions)this._attributions[b]&&p.push(b);var C=[];this.options.prefix&&C.push(this.options.prefix),p.length&&C.push(p.join(", ")),this._container.innerHTML=C.join(' ')}}});wt.mergeOptions({attributionControl:!0}),wt.addInitHook(function(){this.options.attributionControl&&new vw().addTo(this)});var t$=function(p){return new vw(p)};Qi.Layers=yP,Qi.Zoom=dw,Qi.Scale=_P,Qi.Attribution=vw,Ud.layers=KZ,Ud.zoom=JZ,Ud.scale=QZ,Ud.attribution=t$;var Ma=B.extend({initialize:function(p){this._map=p},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Ma.addTo=function(p,b){return p.addHandler(b,this),this};var r$={Events:H},xP=xe.touch?"touchstart mousedown":"mousedown",Ss=V.extend({options:{clickTolerance:3},initialize:function(p,b,C,k){m(this,k),this._element=p,this._dragStartTarget=b||p,this._preventOutline=C},enable:function(){this._enabled||(it(this._dragStartTarget,xP,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ss._dragging===this&&this.finishDrag(!0),Gt(this._dragStartTarget,xP,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(p){if(this._enabled&&(this._moved=!1,!ew(this._element,"leaflet-zoom-anim"))){if(p.touches&&p.touches.length!==1){Ss._dragging===this&&this.finishDrag();return}if(!(Ss._dragging||p.shiftKey||p.which!==1&&p.button!==1&&!p.touches)&&(Ss._dragging=this,this._preventOutline&&ow(this._element),nw(),Fd(),!this._moving)){this.fire("down");var b=p.touches?p.touches[0]:p,C=fP(this._element);this._startPoint=new z(b.clientX,b.clientY),this._startPos=Hl(this._element),this._parentScale=sw(C);var k=p.type==="mousedown";it(document,k?"mousemove":"touchmove",this._onMove,this),it(document,k?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(p){if(this._enabled){if(p.touches&&p.touches.length>1){this._moved=!0;return}var b=p.touches&&p.touches.length===1?p.touches[0]:p,C=new z(b.clientX,b.clientY)._subtract(this._startPoint);!C.x&&!C.y||Math.abs(C.x)+Math.abs(C.y)F&&(Y=Q,F=ie);F>C&&(b[Y]=1,gw(p,b,C,k,Y),gw(p,b,C,Y,R))}function o$(p,b){for(var C=[p[0]],k=1,R=0,F=p.length;kb&&(C.push(p[k]),R=k);return Rb.max.x&&(C|=2),p.yb.max.y&&(C|=8),C}function s$(p,b){var C=b.x-p.x,k=b.y-p.y;return C*C+k*k}function Wd(p,b,C,k){var R=b.x,F=b.y,Y=C.x-R,Q=C.y-F,ie=Y*Y+Q*Q,ce;return ie>0&&(ce=((p.x-R)*Y+(p.y-F)*Q)/ie,ce>1?(R=C.x,F=C.y):ce>0&&(R+=Y*ce,F+=Q*ce)),Y=p.x-R,Q=p.y-F,k?Y*Y+Q*Q:new z(R,F)}function _i(p){return!w(p[0])||typeof p[0][0]!="object"&&typeof p[0][0]<"u"}function AP(p){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),_i(p)}function LP(p,b){var C,k,R,F,Y,Q,ie,ce;if(!p||p.length===0)throw new Error("latlngs not passed");_i(p)||(console.warn("latlngs are not flat! Only the first ring will be used"),p=p[0]);var Ee=le([0,0]),qe=J(p),dt=qe.getNorthWest().distanceTo(qe.getSouthWest())*qe.getNorthEast().distanceTo(qe.getNorthWest());dt<1700&&(Ee=pw(p));var Sn=p.length,zr=[];for(C=0;Ck){ie=(F-k)/R,ce=[Q.x-ie*(Q.x-Y.x),Q.y-ie*(Q.y-Y.y)];break}var zn=b.unproject(W(ce));return le([zn.lat+Ee.lat,zn.lng+Ee.lng])}var l$={__proto__:null,simplify:SP,pointToSegmentDistance:CP,closestPointOnSegment:i$,clipSegment:MP,_getEdgeIntersection:Vm,_getBitCode:Zl,_sqClosestPointOnSegment:Wd,isFlat:_i,_flat:AP,polylineCenter:LP},mw={project:function(p){return new z(p.lng,p.lat)},unproject:function(p){return new oe(p.y,p.x)},bounds:new Z([-180,-90],[180,90])},yw={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Z([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(p){var b=Math.PI/180,C=this.R,k=p.lat*b,R=this.R_MINOR/C,F=Math.sqrt(1-R*R),Y=F*Math.sin(k),Q=Math.tan(Math.PI/4-k/2)/Math.pow((1-Y)/(1+Y),F/2);return k=-C*Math.log(Math.max(Q,1e-10)),new z(p.lng*b*C,k)},unproject:function(p){for(var b=180/Math.PI,C=this.R,k=this.R_MINOR/C,R=Math.sqrt(1-k*k),F=Math.exp(-p.y/C),Y=Math.PI/2-2*Math.atan(F),Q=0,ie=.1,ce;Q<15&&Math.abs(ie)>1e-7;Q++)ce=R*Math.sin(Y),ce=Math.pow((1-ce)/(1+ce),R/2),ie=Math.PI/2-2*Math.atan(F*ce)-Y,Y+=ie;return new oe(Y*b,p.x*b/C)}},u$={__proto__:null,LonLat:mw,Mercator:yw,SphericalMercator:Ne},c$=i({},be,{code:"EPSG:3395",projection:yw,transformation:function(){var p=.5/(Math.PI*yw.R);return ke(p,.5,-p,.5)}()}),kP=i({},be,{code:"EPSG:4326",projection:mw,transformation:ke(1/180,1,-1/180,.5)}),h$=i({},De,{projection:mw,transformation:ke(1,0,-1,0),scale:function(p){return Math.pow(2,p)},zoom:function(p){return Math.log(p)/Math.LN2},distance:function(p,b){var C=b.lng-p.lng,k=b.lat-p.lat;return Math.sqrt(C*C+k*k)},infinite:!0});De.Earth=be,De.EPSG3395=c$,De.EPSG3857=ct,De.EPSG900913=Fe,De.EPSG4326=kP,De.Simple=h$;var ea=V.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(p){return p.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(p){return p&&p.removeLayer(this),this},getPane:function(p){return this._map.getPane(p?this.options[p]||p:this.options.pane)},addInteractiveTarget:function(p){return this._map._targets[l(p)]=this,this},removeInteractiveTarget:function(p){return delete this._map._targets[l(p)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(p){var b=p.target;if(b.hasLayer(this)){if(this._map=b,this._zoomAnimated=b._zoomAnimated,this.getEvents){var C=this.getEvents();b.on(C,this),this.once("remove",function(){b.off(C,this)},this)}this.onAdd(b),this.fire("add"),b.fire("layeradd",{layer:this})}}});wt.include({addLayer:function(p){if(!p._layerAdd)throw new Error("The provided object is not a Layer.");var b=l(p);return this._layers[b]?this:(this._layers[b]=p,p._mapToAdd=this,p.beforeAdd&&p.beforeAdd(this),this.whenReady(p._layerAdd,p),this)},removeLayer:function(p){var b=l(p);return this._layers[b]?(this._loaded&&p.onRemove(this),delete this._layers[b],this._loaded&&(this.fire("layerremove",{layer:p}),p.fire("remove")),p._map=p._mapToAdd=null,this):this},hasLayer:function(p){return l(p)in this._layers},eachLayer:function(p,b){for(var C in this._layers)p.call(b,this._layers[C]);return this},_addLayers:function(p){p=p?w(p)?p:[p]:[];for(var b=0,C=p.length;bthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&b[0]instanceof oe&&b[0].equals(b[C-1])&&b.pop(),b},_setLatLngs:function(p){Ao.prototype._setLatLngs.call(this,p),_i(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return _i(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var p=this._renderer._bounds,b=this.options.weight,C=new z(b,b);if(p=new Z(p.min.subtract(C),p.max.add(C)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(p))){if(this.options.noClip){this._parts=this._rings;return}for(var k=0,R=this._rings.length,F;kp.y!=R.y>p.y&&p.x<(R.x-k.x)*(p.y-k.y)/(R.y-k.y)+k.x&&(b=!b);return b||Ao.prototype._containsPoint.call(this,p,!0)}});function _$(p,b){return new ih(p,b)}var Lo=Mo.extend({initialize:function(p,b){m(this,b),this._layers={},p&&this.addData(p)},addData:function(p){var b=w(p)?p:p.features,C,k,R;if(b){for(C=0,k=b.length;C0&&R.push(R[0].slice()),R}function ah(p,b){return p.feature?i({},p.feature,{geometry:b}):$m(b)}function $m(p){return p.type==="Feature"||p.type==="FeatureCollection"?p:{type:"Feature",properties:{},geometry:p}}var ww={toGeoJSON:function(p){return ah(this,{type:"Point",coordinates:bw(this.getLatLng(),p)})}};Gm.include(ww),_w.include(ww),Hm.include(ww),Ao.include({toGeoJSON:function(p){var b=!_i(this._latlngs),C=Zm(this._latlngs,b?1:0,!1,p);return ah(this,{type:(b?"Multi":"")+"LineString",coordinates:C})}}),ih.include({toGeoJSON:function(p){var b=!_i(this._latlngs),C=b&&!_i(this._latlngs[0]),k=Zm(this._latlngs,C?2:b?1:0,!0,p);return b||(k=[k]),ah(this,{type:(C?"Multi":"")+"Polygon",coordinates:k})}}),rh.include({toMultiPoint:function(p){var b=[];return this.eachLayer(function(C){b.push(C.toGeoJSON(p).geometry.coordinates)}),ah(this,{type:"MultiPoint",coordinates:b})},toGeoJSON:function(p){var b=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(b==="MultiPoint")return this.toMultiPoint(p);var C=b==="GeometryCollection",k=[];return this.eachLayer(function(R){if(R.toGeoJSON){var F=R.toGeoJSON(p);if(C)k.push(F.geometry);else{var Y=$m(F);Y.type==="FeatureCollection"?k.push.apply(k,Y.features):k.push(Y)}}}),C?ah(this,{geometries:k,type:"GeometryCollection"}):{type:"FeatureCollection",features:k}}});function PP(p,b){return new Lo(p,b)}var x$=PP,Ym=ea.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(p,b,C){this._url=p,this._bounds=J(b),m(this,C)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(lt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Qt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(p){return this.options.opacity=p,this._image&&this._updateOpacity(),this},setStyle:function(p){return p.opacity&&this.setOpacity(p.opacity),this},bringToFront:function(){return this._map&&eh(this._image),this},bringToBack:function(){return this._map&&th(this._image),this},setUrl:function(p){return this._url=p,this._image&&(this._image.src=p),this},setBounds:function(p){return this._bounds=J(p),this._map&&this._reset(),this},getEvents:function(){var p={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(p.zoomanim=this._animateZoom),p},setZIndex:function(p){return this.options.zIndex=p,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var p=this._url.tagName==="IMG",b=this._image=p?this._url:At("img");if(lt(b,"leaflet-image-layer"),this._zoomAnimated&<(b,"leaflet-zoom-animated"),this.options.className&<(b,this.options.className),b.onselectstart=h,b.onmousemove=h,b.onload=o(this.fire,this,"load"),b.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(b.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),p){this._url=b.src;return}b.src=this._url,b.alt=this.options.alt},_animateZoom:function(p){var b=this._map.getZoomScale(p.zoom),C=this._map._latLngBoundsToNewLayerBounds(this._bounds,p.zoom,p.center).min;Gl(this._image,C,b)},_reset:function(){var p=this._image,b=new Z(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),C=b.getSize();xr(p,b.min),p.style.width=C.x+"px",p.style.height=C.y+"px"},_updateOpacity:function(){yi(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var p=this.options.errorOverlayUrl;p&&this._url!==p&&(this._url=p,this._image.src=p)},getCenter:function(){return this._bounds.getCenter()}}),b$=function(p,b,C){return new Ym(p,b,C)},DP=Ym.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var p=this._url.tagName==="VIDEO",b=this._image=p?this._url:At("video");if(lt(b,"leaflet-image-layer"),this._zoomAnimated&<(b,"leaflet-zoom-animated"),this.options.className&<(b,this.options.className),b.onselectstart=h,b.onmousemove=h,b.onloadeddata=o(this.fire,this,"load"),p){for(var C=b.getElementsByTagName("source"),k=[],R=0;R0?k:[b.src];return}w(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(b.style,"objectFit")&&(b.style.objectFit="fill"),b.autoplay=!!this.options.autoplay,b.loop=!!this.options.loop,b.muted=!!this.options.muted,b.playsInline=!!this.options.playsInline;for(var F=0;FR?(b.height=R+"px",lt(p,F)):pr(p,F),this._containerWidth=this._container.offsetWidth},_animateZoom:function(p){var b=this._map._latLngToNewLayerPoint(this._latlng,p.zoom,p.center),C=this._getAnchor();xr(this._container,b.add(C))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var p=this._map,b=parseInt(Bd(this._container,"marginBottom"),10)||0,C=this._container.offsetHeight+b,k=this._containerWidth,R=new z(this._containerLeft,-C-this._containerBottom);R._add(Hl(this._container));var F=p.layerPointToContainerPoint(R),Y=W(this.options.autoPanPadding),Q=W(this.options.autoPanPaddingTopLeft||Y),ie=W(this.options.autoPanPaddingBottomRight||Y),ce=p.getSize(),Ee=0,qe=0;F.x+k+ie.x>ce.x&&(Ee=F.x+k-ce.x+ie.x),F.x-Ee-Q.x<0&&(Ee=F.x-Q.x),F.y+C+ie.y>ce.y&&(qe=F.y+C-ce.y+ie.y),F.y-qe-Q.y<0&&(qe=F.y-Q.y),(Ee||qe)&&(this.options.keepInView&&(this._autopanning=!0),p.fire("autopanstart").panBy([Ee,qe]))}},_getAnchor:function(){return W(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),C$=function(p,b){return new Xm(p,b)};wt.mergeOptions({closePopupOnClick:!0}),wt.include({openPopup:function(p,b,C){return this._initOverlay(Xm,p,b,C).openOn(this),this},closePopup:function(p){return p=arguments.length?p:this._popup,p&&p.close(),this}}),ea.include({bindPopup:function(p,b){return this._popup=this._initOverlay(Xm,this._popup,p,b),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(p){return this._popup&&(this instanceof Mo||(this._popup._source=this),this._popup._prepareOpen(p||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(p){return this._popup&&this._popup.setContent(p),this},getPopup:function(){return this._popup},_openPopup:function(p){if(!(!this._popup||!this._map)){Wl(p);var b=p.layer||p.target;if(this._popup._source===b&&!(b instanceof Cs)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(p.latlng);return}this._popup._source=b,this.openPopup(p.latlng)}},_movePopup:function(p){this._popup.setLatLng(p.latlng)},_onKeyPress:function(p){p.originalEvent.keyCode===13&&this._openPopup(p)}});var qm=Aa.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(p){Aa.prototype.onAdd.call(this,p),this.setOpacity(this.options.opacity),p.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(p){Aa.prototype.onRemove.call(this,p),p.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var p=Aa.prototype.getEvents.call(this);return this.options.permanent||(p.preclick=this.close),p},_initLayout:function(){var p="leaflet-tooltip",b=p+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=At("div",b),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(p){var b,C,k=this._map,R=this._container,F=k.latLngToContainerPoint(k.getCenter()),Y=k.layerPointToContainerPoint(p),Q=this.options.direction,ie=R.offsetWidth,ce=R.offsetHeight,Ee=W(this.options.offset),qe=this._getAnchor();Q==="top"?(b=ie/2,C=ce):Q==="bottom"?(b=ie/2,C=0):Q==="center"?(b=ie/2,C=ce/2):Q==="right"?(b=0,C=ce/2):Q==="left"?(b=ie,C=ce/2):Y.xthis.options.maxZoom||Ck?this._retainParent(R,F,Y,k):!1)},_retainChildren:function(p,b,C,k){for(var R=2*p;R<2*p+2;R++)for(var F=2*b;F<2*b+2;F++){var Y=new z(R,F);Y.z=C+1;var Q=this._tileCoordsToKey(Y),ie=this._tiles[Q];if(ie&&ie.active){ie.retain=!0;continue}else ie&&ie.loaded&&(ie.retain=!0);C+1this.options.maxZoom||this.options.minZoom!==void 0&&R1){this._setView(p,C);return}for(var qe=R.min.y;qe<=R.max.y;qe++)for(var dt=R.min.x;dt<=R.max.x;dt++){var Sn=new z(dt,qe);if(Sn.z=this._tileZoom,!!this._isValidTile(Sn)){var zr=this._tiles[this._tileCoordsToKey(Sn)];zr?zr.current=!0:Y.push(Sn)}}if(Y.sort(function(zn,sh){return zn.distanceTo(F)-sh.distanceTo(F)}),Y.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var xi=document.createDocumentFragment();for(dt=0;dtC.max.x)||!b.wrapLat&&(p.yC.max.y))return!1}if(!this.options.bounds)return!0;var k=this._tileCoordsToBounds(p);return J(this.options.bounds).overlaps(k)},_keyToBounds:function(p){return this._tileCoordsToBounds(this._keyToTileCoords(p))},_tileCoordsToNwSe:function(p){var b=this._map,C=this.getTileSize(),k=p.scaleBy(C),R=k.add(C),F=b.unproject(k,p.z),Y=b.unproject(R,p.z);return[F,Y]},_tileCoordsToBounds:function(p){var b=this._tileCoordsToNwSe(p),C=new re(b[0],b[1]);return this.options.noWrap||(C=this._map.wrapLatLngBounds(C)),C},_tileCoordsToKey:function(p){return p.x+":"+p.y+":"+p.z},_keyToTileCoords:function(p){var b=p.split(":"),C=new z(+b[0],+b[1]);return C.z=+b[2],C},_removeTile:function(p){var b=this._tiles[p];b&&(Qt(b.el),delete this._tiles[p],this.fire("tileunload",{tile:b.el,coords:this._keyToTileCoords(p)}))},_initTile:function(p){lt(p,"leaflet-tile");var b=this.getTileSize();p.style.width=b.x+"px",p.style.height=b.y+"px",p.onselectstart=h,p.onmousemove=h,xe.ielt9&&this.options.opacity<1&&yi(p,this.options.opacity)},_addTile:function(p,b){var C=this._getTilePos(p),k=this._tileCoordsToKey(p),R=this.createTile(this._wrapCoords(p),o(this._tileReady,this,p));this._initTile(R),this.createTile.length<2&&D(o(this._tileReady,this,p,null,R)),xr(R,C),this._tiles[k]={el:R,coords:p,current:!0},b.appendChild(R),this.fire("tileloadstart",{tile:R,coords:p})},_tileReady:function(p,b,C){b&&this.fire("tileerror",{error:b,tile:C,coords:p});var k=this._tileCoordsToKey(p);C=this._tiles[k],C&&(C.loaded=+new Date,this._map._fadeAnimated?(yi(C.el,0),O(this._fadeFrame),this._fadeFrame=D(this._updateOpacity,this)):(C.active=!0,this._pruneTiles()),b||(lt(C.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:C.el,coords:p})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),xe.ielt9||!this._map._fadeAnimated?D(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(p){return p.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(p){var b=new z(this._wrapX?c(p.x,this._wrapX):p.x,this._wrapY?c(p.y,this._wrapY):p.y);return b.z=p.z,b},_pxBoundsToTileRange:function(p){var b=this.getTileSize();return new Z(p.min.unscaleBy(b).floor(),p.max.unscaleBy(b).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var p in this._tiles)if(!this._tiles[p].loaded)return!1;return!0}});function A$(p){return new $d(p)}var oh=$d.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(p,b){this._url=p,b=m(this,b),b.detectRetina&&xe.retina&&b.maxZoom>0?(b.tileSize=Math.floor(b.tileSize/2),b.zoomReverse?(b.zoomOffset--,b.minZoom=Math.min(b.maxZoom,b.minZoom+1)):(b.zoomOffset++,b.maxZoom=Math.max(b.minZoom,b.maxZoom-1)),b.minZoom=Math.max(0,b.minZoom)):b.zoomReverse?b.minZoom=Math.min(b.maxZoom,b.minZoom):b.maxZoom=Math.max(b.minZoom,b.maxZoom),typeof b.subdomains=="string"&&(b.subdomains=b.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(p,b){return this._url===p&&b===void 0&&(b=!0),this._url=p,b||this.redraw(),this},createTile:function(p,b){var C=document.createElement("img");return it(C,"load",o(this._tileOnLoad,this,b,C)),it(C,"error",o(this._tileOnError,this,b,C)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(C.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(C.referrerPolicy=this.options.referrerPolicy),C.alt="",C.src=this.getTileUrl(p),C},getTileUrl:function(p){var b={r:xe.retina?"@2x":"",s:this._getSubdomain(p),x:p.x,y:p.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var C=this._globalTileRange.max.y-p.y;this.options.tms&&(b.y=C),b["-y"]=C}return x(this._url,i(b,this.options))},_tileOnLoad:function(p,b){xe.ielt9?setTimeout(o(p,this,null,b),0):p(null,b)},_tileOnError:function(p,b,C){var k=this.options.errorTileUrl;k&&b.getAttribute("src")!==k&&(b.src=k),p(C,b)},_onTileRemove:function(p){p.tile.onload=null},_getZoomForUrl:function(){var p=this._tileZoom,b=this.options.maxZoom,C=this.options.zoomReverse,k=this.options.zoomOffset;return C&&(p=b-p),p+k},_getSubdomain:function(p){var b=Math.abs(p.x+p.y)%this.options.subdomains.length;return this.options.subdomains[b]},_abortLoading:function(){var p,b;for(p in this._tiles)if(this._tiles[p].coords.z!==this._tileZoom&&(b=this._tiles[p].el,b.onload=h,b.onerror=h,!b.complete)){b.src=T;var C=this._tiles[p].coords;Qt(b),delete this._tiles[p],this.fire("tileabort",{tile:b,coords:C})}},_removeTile:function(p){var b=this._tiles[p];if(b)return b.el.setAttribute("src",T),$d.prototype._removeTile.call(this,p)},_tileReady:function(p,b,C){if(!(!this._map||C&&C.getAttribute("src")===T))return $d.prototype._tileReady.call(this,p,b,C)}});function jP(p,b){return new oh(p,b)}var OP=oh.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(p,b){this._url=p;var C=i({},this.defaultWmsParams);for(var k in b)k in this.options||(C[k]=b[k]);b=m(this,b);var R=b.detectRetina&&xe.retina?2:1,F=this.getTileSize();C.width=F.x*R,C.height=F.y*R,this.wmsParams=C},onAdd:function(p){this._crs=this.options.crs||p.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var b=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[b]=this._crs.code,oh.prototype.onAdd.call(this,p)},getTileUrl:function(p){var b=this._tileCoordsToNwSe(p),C=this._crs,k=X(C.project(b[0]),C.project(b[1])),R=k.min,F=k.max,Y=(this._wmsVersion>=1.3&&this._crs===kP?[R.y,R.x,F.y,F.x]:[R.x,R.y,F.x,F.y]).join(","),Q=oh.prototype.getTileUrl.call(this,p);return Q+y(this.wmsParams,Q,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+Y},setParams:function(p,b){return i(this.wmsParams,p),b||this.redraw(),this}});function L$(p,b){return new OP(p,b)}oh.WMS=OP,jP.wms=L$;var ko=ea.extend({options:{padding:.1},initialize:function(p){m(this,p),l(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),lt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var p={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(p.zoomanim=this._onAnimZoom),p},_onAnimZoom:function(p){this._updateTransform(p.center,p.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(p,b){var C=this._map.getZoomScale(b,this._zoom),k=this._map.getSize().multiplyBy(.5+this.options.padding),R=this._map.project(this._center,b),F=k.multiplyBy(-C).add(R).subtract(this._map._getNewPixelOrigin(p,b));xe.any3d?Gl(this._container,F,C):xr(this._container,F)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var p in this._layers)this._layers[p]._reset()},_onZoomEnd:function(){for(var p in this._layers)this._layers[p]._project()},_updatePaths:function(){for(var p in this._layers)this._layers[p]._update()},_update:function(){var p=this.options.padding,b=this._map.getSize(),C=this._map.containerPointToLayerPoint(b.multiplyBy(-p)).round();this._bounds=new Z(C,C.add(b.multiplyBy(1+p*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),zP=ko.extend({options:{tolerance:0},getEvents:function(){var p=ko.prototype.getEvents.call(this);return p.viewprereset=this._onViewPreReset,p},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ko.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var p=this._container=document.createElement("canvas");it(p,"mousemove",this._onMouseMove,this),it(p,"click dblclick mousedown mouseup contextmenu",this._onClick,this),it(p,"mouseout",this._handleMouseOut,this),p._leaflet_disable_events=!0,this._ctx=p.getContext("2d")},_destroyContainer:function(){O(this._redrawRequest),delete this._ctx,Qt(this._container),Gt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var p;this._redrawBounds=null;for(var b in this._layers)p=this._layers[b],p._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ko.prototype._update.call(this);var p=this._bounds,b=this._container,C=p.getSize(),k=xe.retina?2:1;xr(b,p.min),b.width=k*C.x,b.height=k*C.y,b.style.width=C.x+"px",b.style.height=C.y+"px",xe.retina&&this._ctx.scale(2,2),this._ctx.translate(-p.min.x,-p.min.y),this.fire("update")}},_reset:function(){ko.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(p){this._updateDashArray(p),this._layers[l(p)]=p;var b=p._order={layer:p,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=b),this._drawLast=b,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(p){this._requestRedraw(p)},_removePath:function(p){var b=p._order,C=b.next,k=b.prev;C?C.prev=k:this._drawLast=k,k?k.next=C:this._drawFirst=C,delete p._order,delete this._layers[l(p)],this._requestRedraw(p)},_updatePath:function(p){this._extendRedrawBounds(p),p._project(),p._update(),this._requestRedraw(p)},_updateStyle:function(p){this._updateDashArray(p),this._requestRedraw(p)},_updateDashArray:function(p){if(typeof p.options.dashArray=="string"){var b=p.options.dashArray.split(/[, ]+/),C=[],k,R;for(R=0;R')}}catch{}return function(p){return document.createElement("<"+p+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),k$={_initContainer:function(){this._container=At("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ko.prototype._update.call(this),this.fire("update"))},_initPath:function(p){var b=p._container=Yd("shape");lt(b,"leaflet-vml-shape "+(this.options.className||"")),b.coordsize="1 1",p._path=Yd("path"),b.appendChild(p._path),this._updateStyle(p),this._layers[l(p)]=p},_addPath:function(p){var b=p._container;this._container.appendChild(b),p.options.interactive&&p.addInteractiveTarget(b)},_removePath:function(p){var b=p._container;Qt(b),p.removeInteractiveTarget(b),delete this._layers[l(p)]},_updateStyle:function(p){var b=p._stroke,C=p._fill,k=p.options,R=p._container;R.stroked=!!k.stroke,R.filled=!!k.fill,k.stroke?(b||(b=p._stroke=Yd("stroke")),R.appendChild(b),b.weight=k.weight+"px",b.color=k.color,b.opacity=k.opacity,k.dashArray?b.dashStyle=w(k.dashArray)?k.dashArray.join(" "):k.dashArray.replace(/( *, *)/g," "):b.dashStyle="",b.endcap=k.lineCap.replace("butt","flat"),b.joinstyle=k.lineJoin):b&&(R.removeChild(b),p._stroke=null),k.fill?(C||(C=p._fill=Yd("fill")),R.appendChild(C),C.color=k.fillColor||k.color,C.opacity=k.fillOpacity):C&&(R.removeChild(C),p._fill=null)},_updateCircle:function(p){var b=p._point.round(),C=Math.round(p._radius),k=Math.round(p._radiusY||C);this._setPath(p,p._empty()?"M0 0":"AL "+b.x+","+b.y+" "+C+","+k+" 0,"+65535*360)},_setPath:function(p,b){p._path.v=b},_bringToFront:function(p){eh(p._container)},_bringToBack:function(p){th(p._container)}},Km=xe.vml?Yd:tt,Xd=ko.extend({_initContainer:function(){this._container=Km("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Km("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Qt(this._container),Gt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ko.prototype._update.call(this);var p=this._bounds,b=p.getSize(),C=this._container;(!this._svgSize||!this._svgSize.equals(b))&&(this._svgSize=b,C.setAttribute("width",b.x),C.setAttribute("height",b.y)),xr(C,p.min),C.setAttribute("viewBox",[p.min.x,p.min.y,b.x,b.y].join(" ")),this.fire("update")}},_initPath:function(p){var b=p._path=Km("path");p.options.className&<(b,p.options.className),p.options.interactive&<(b,"leaflet-interactive"),this._updateStyle(p),this._layers[l(p)]=p},_addPath:function(p){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(p._path),p.addInteractiveTarget(p._path)},_removePath:function(p){Qt(p._path),p.removeInteractiveTarget(p._path),delete this._layers[l(p)]},_updatePath:function(p){p._project(),p._update()},_updateStyle:function(p){var b=p._path,C=p.options;b&&(C.stroke?(b.setAttribute("stroke",C.color),b.setAttribute("stroke-opacity",C.opacity),b.setAttribute("stroke-width",C.weight),b.setAttribute("stroke-linecap",C.lineCap),b.setAttribute("stroke-linejoin",C.lineJoin),C.dashArray?b.setAttribute("stroke-dasharray",C.dashArray):b.removeAttribute("stroke-dasharray"),C.dashOffset?b.setAttribute("stroke-dashoffset",C.dashOffset):b.removeAttribute("stroke-dashoffset")):b.setAttribute("stroke","none"),C.fill?(b.setAttribute("fill",C.fillColor||C.color),b.setAttribute("fill-opacity",C.fillOpacity),b.setAttribute("fill-rule",C.fillRule||"evenodd")):b.setAttribute("fill","none"))},_updatePoly:function(p,b){this._setPath(p,ht(p._parts,b))},_updateCircle:function(p){var b=p._point,C=Math.max(Math.round(p._radius),1),k=Math.max(Math.round(p._radiusY),1)||C,R="a"+C+","+k+" 0 1,0 ",F=p._empty()?"M0 0":"M"+(b.x-C)+","+b.y+R+C*2+",0 "+R+-C*2+",0 ";this._setPath(p,F)},_setPath:function(p,b){p._path.setAttribute("d",b)},_bringToFront:function(p){eh(p._path)},_bringToBack:function(p){th(p._path)}});xe.vml&&Xd.include(k$);function FP(p){return xe.svg||xe.vml?new Xd(p):null}wt.include({getRenderer:function(p){var b=p.options.renderer||this._getPaneRenderer(p.options.pane)||this.options.renderer||this._renderer;return b||(b=this._renderer=this._createRenderer()),this.hasLayer(b)||this.addLayer(b),b},_getPaneRenderer:function(p){if(p==="overlayPane"||p===void 0)return!1;var b=this._paneRenderers[p];return b===void 0&&(b=this._createRenderer({pane:p}),this._paneRenderers[p]=b),b},_createRenderer:function(p){return this.options.preferCanvas&&BP(p)||FP(p)}});var VP=ih.extend({initialize:function(p,b){ih.prototype.initialize.call(this,this._boundsToLatLngs(p),b)},setBounds:function(p){return this.setLatLngs(this._boundsToLatLngs(p))},_boundsToLatLngs:function(p){return p=J(p),[p.getSouthWest(),p.getNorthWest(),p.getNorthEast(),p.getSouthEast()]}});function I$(p,b){return new VP(p,b)}Xd.create=Km,Xd.pointsToPath=ht,Lo.geometryToLayer=Um,Lo.coordsToLatLng=xw,Lo.coordsToLatLngs=Wm,Lo.latLngToCoords=bw,Lo.latLngsToCoords=Zm,Lo.getFeature=ah,Lo.asFeature=$m,wt.mergeOptions({boxZoom:!0});var GP=Ma.extend({initialize:function(p){this._map=p,this._container=p._container,this._pane=p._panes.overlayPane,this._resetStateTimeout=0,p.on("unload",this._destroy,this)},addHooks:function(){it(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Gt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Qt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(p){if(!p.shiftKey||p.which!==1&&p.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Fd(),nw(),this._startPoint=this._map.mouseEventToContainerPoint(p),it(document,{contextmenu:Wl,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(p){this._moved||(this._moved=!0,this._box=At("div","leaflet-zoom-box",this._container),lt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(p);var b=new Z(this._point,this._startPoint),C=b.getSize();xr(this._box,b.min),this._box.style.width=C.x+"px",this._box.style.height=C.y+"px"},_finish:function(){this._moved&&(Qt(this._box),pr(this._container,"leaflet-crosshair")),Vd(),iw(),Gt(document,{contextmenu:Wl,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(p){if(!(p.which!==1&&p.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var b=new re(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(b).fire("boxzoomend",{boxZoomBounds:b})}},_onKeyDown:function(p){p.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});wt.addInitHook("addHandler","boxZoom",GP),wt.mergeOptions({doubleClickZoom:!0});var HP=Ma.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(p){var b=this._map,C=b.getZoom(),k=b.options.zoomDelta,R=p.originalEvent.shiftKey?C-k:C+k;b.options.doubleClickZoom==="center"?b.setZoom(R):b.setZoomAround(p.containerPoint,R)}});wt.addInitHook("addHandler","doubleClickZoom",HP),wt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var UP=Ma.extend({addHooks:function(){if(!this._draggable){var p=this._map;this._draggable=new Ss(p._mapPane,p._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),p.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),p.on("zoomend",this._onZoomEnd,this),p.whenReady(this._onZoomEnd,this))}lt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){pr(this._map._container,"leaflet-grab"),pr(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var p=this._map;if(p._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var b=J(this._map.options.maxBounds);this._offsetLimit=X(this._map.latLngToContainerPoint(b.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(b.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;p.fire("movestart").fire("dragstart"),p.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(p){if(this._map.options.inertia){var b=this._lastTime=+new Date,C=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(C),this._times.push(b),this._prunePositions(b)}this._map.fire("move",p).fire("drag",p)},_prunePositions:function(p){for(;this._positions.length>1&&p-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var p=this._map.getSize().divideBy(2),b=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=b.subtract(p).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(p,b){return p-(p-b)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var p=this._draggable._newPos.subtract(this._draggable._startPos),b=this._offsetLimit;p.xb.max.x&&(p.x=this._viscousLimit(p.x,b.max.x)),p.y>b.max.y&&(p.y=this._viscousLimit(p.y,b.max.y)),this._draggable._newPos=this._draggable._startPos.add(p)}},_onPreDragWrap:function(){var p=this._worldWidth,b=Math.round(p/2),C=this._initialWorldOffset,k=this._draggable._newPos.x,R=(k-b+C)%p+b-C,F=(k+b+C)%p-b-C,Y=Math.abs(R+C)0?F:-F))-b;this._delta=0,this._startTime=null,Y&&(p.options.scrollWheelZoom==="center"?p.setZoom(b+Y):p.setZoomAround(this._lastMousePos,b+Y))}});wt.addInitHook("addHandler","scrollWheelZoom",ZP);var N$=600;wt.mergeOptions({tapHold:xe.touchNative&&xe.safari&&xe.mobile,tapTolerance:15});var $P=Ma.extend({addHooks:function(){it(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Gt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(p){if(clearTimeout(this._holdTimeout),p.touches.length===1){var b=p.touches[0];this._startPos=this._newPos=new z(b.clientX,b.clientY),this._holdTimeout=setTimeout(o(function(){this._cancel(),this._isTapValid()&&(it(document,"touchend",Yr),it(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",b))},this),N$),it(document,"touchend touchcancel contextmenu",this._cancel,this),it(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function p(){Gt(document,"touchend",Yr),Gt(document,"touchend touchcancel",p)},_cancel:function(){clearTimeout(this._holdTimeout),Gt(document,"touchend touchcancel contextmenu",this._cancel,this),Gt(document,"touchmove",this._onMove,this)},_onMove:function(p){var b=p.touches[0];this._newPos=new z(b.clientX,b.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(p,b){var C=new MouseEvent(p,{bubbles:!0,cancelable:!0,view:window,screenX:b.screenX,screenY:b.screenY,clientX:b.clientX,clientY:b.clientY});C._simulated=!0,b.target.dispatchEvent(C)}});wt.addInitHook("addHandler","tapHold",$P),wt.mergeOptions({touchZoom:xe.touch,bounceAtZoomLimits:!0});var YP=Ma.extend({addHooks:function(){lt(this._map._container,"leaflet-touch-zoom"),it(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){pr(this._map._container,"leaflet-touch-zoom"),Gt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(p){var b=this._map;if(!(!p.touches||p.touches.length!==2||b._animatingZoom||this._zooming)){var C=b.mouseEventToContainerPoint(p.touches[0]),k=b.mouseEventToContainerPoint(p.touches[1]);this._centerPoint=b.getSize()._divideBy(2),this._startLatLng=b.containerPointToLatLng(this._centerPoint),b.options.touchZoom!=="center"&&(this._pinchStartLatLng=b.containerPointToLatLng(C.add(k)._divideBy(2))),this._startDist=C.distanceTo(k),this._startZoom=b.getZoom(),this._moved=!1,this._zooming=!0,b._stop(),it(document,"touchmove",this._onTouchMove,this),it(document,"touchend touchcancel",this._onTouchEnd,this),Yr(p)}},_onTouchMove:function(p){if(!(!p.touches||p.touches.length!==2||!this._zooming)){var b=this._map,C=b.mouseEventToContainerPoint(p.touches[0]),k=b.mouseEventToContainerPoint(p.touches[1]),R=C.distanceTo(k)/this._startDist;if(this._zoom=b.getScaleZoom(R,this._startZoom),!b.options.bounceAtZoomLimits&&(this._zoomb.getMaxZoom()&&R>1)&&(this._zoom=b._limitZoom(this._zoom)),b.options.touchZoom==="center"){if(this._center=this._startLatLng,R===1)return}else{var F=C._add(k)._divideBy(2)._subtract(this._centerPoint);if(R===1&&F.x===0&&F.y===0)return;this._center=b.unproject(b.project(this._pinchStartLatLng,this._zoom).subtract(F),this._zoom)}this._moved||(b._moveStart(!0,!1),this._moved=!0),O(this._animRequest);var Y=o(b._move,b,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=D(Y,this,!0),Yr(p)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,O(this._animRequest),Gt(document,"touchmove",this._onTouchMove,this),Gt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});wt.addInitHook("addHandler","touchZoom",YP),wt.BoxZoom=GP,wt.DoubleClickZoom=HP,wt.Drag=UP,wt.Keyboard=WP,wt.ScrollWheelZoom=ZP,wt.TapHold=$P,wt.TouchZoom=YP,r.Bounds=Z,r.Browser=xe,r.CRS=De,r.Canvas=zP,r.Circle=_w,r.CircleMarker=Hm,r.Class=B,r.Control=Qi,r.DivIcon=RP,r.DivOverlay=Aa,r.DomEvent=XZ,r.DomUtil=$Z,r.Draggable=Ss,r.Evented=V,r.FeatureGroup=Mo,r.GeoJSON=Lo,r.GridLayer=$d,r.Handler=Ma,r.Icon=nh,r.ImageOverlay=Ym,r.LatLng=oe,r.LatLngBounds=re,r.Layer=ea,r.LayerGroup=rh,r.LineUtil=l$,r.Map=wt,r.Marker=Gm,r.Mixin=r$,r.Path=Cs,r.Point=z,r.PolyUtil=n$,r.Polygon=ih,r.Polyline=Ao,r.Popup=Xm,r.PosAnimation=mP,r.Projection=u$,r.Rectangle=VP,r.Renderer=ko,r.SVG=Xd,r.SVGOverlay=EP,r.TileLayer=oh,r.Tooltip=qm,r.Transformation=_e,r.Util=j,r.VideoOverlay=DP,r.bind=o,r.bounds=X,r.canvas=BP,r.circle=m$,r.circleMarker=g$,r.control=Ud,r.divIcon=M$,r.extend=i,r.featureGroup=d$,r.geoJSON=PP,r.geoJson=x$,r.gridLayer=A$,r.icon=v$,r.imageOverlay=b$,r.latLng=le,r.latLngBounds=J,r.layerGroup=f$,r.map=qZ,r.marker=p$,r.point=W,r.polygon=_$,r.polyline=y$,r.popup=C$,r.rectangle=I$,r.setOptions=m,r.stamp=l,r.svg=FP,r.svgOverlay=S$,r.tileLayer=jP,r.tooltip=T$,r.transformation=ke,r.version=n,r.videoOverlay=w$;var P$=window.L;r.noConflict=function(){return window.L=P$,this},window.L=r})})(qA,qA.exports);var Kc=qA.exports;const zZ=JA(Kc);function ym(e,t,r){return Object.freeze({instance:e,context:t,container:r})}function sP(e,t){return t==null?function(n,i){const a=G.useRef();return a.current||(a.current=e(n,i)),a}:function(n,i){const a=G.useRef();a.current||(a.current=e(n,i));const o=G.useRef(n),{instance:s}=a.current;return G.useEffect(function(){o.current!==n&&(t(s,n,o.current),o.current=n)},[s,n,i]),a}}function BZ(e,t){G.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var a;(a=t.layerContainer)==null||a.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function kwe(e){return function(r){const n=Yb(),i=e(Xb(r,n),n);return EZ(n.map,r.attribution),oP(i.current,r.eventHandlers),BZ(i.current,n),i}}function Iwe(e,t){const r=G.useRef();G.useEffect(function(){if(t.pathOptions!==r.current){const i=t.pathOptions??{};e.instance.setStyle(i),r.current=i}},[e,t])}function Nwe(e){return function(r){const n=Yb(),i=e(Xb(r,n),n);return oP(i.current,r.eventHandlers),BZ(i.current,n),Iwe(i.current,r),i}}function FZ(e,t){const r=sP(e),n=Lwe(r,t);return Mwe(n)}function VZ(e,t){const r=sP(e,t),n=Nwe(r);return Twe(n)}function Pwe(e,t){const r=sP(e,t),n=kwe(r);return Awe(n)}function Dwe(e,t,r){const{opacity:n,zIndex:i}=t;n!=null&&n!==r.opacity&&e.setOpacity(n),i!=null&&i!==r.zIndex&&e.setZIndex(i)}function Ewe(){return Yb().map}const Rwe=VZ(function({center:t,children:r,...n},i){const a=new Kc.CircleMarker(t,n);return ym(a,RZ(i,{overlayContainer:a}))},wwe);function KA(){return KA=Object.assign||function(e){for(var t=1;t(d==null?void 0:d.map)??null,[d]);const m=G.useCallback(_=>{if(_!==null&&d===null){const x=new Kc.Map(_,c);r!=null&&u!=null?x.setView(r,u):e!=null&&x.fitBounds(e,t),l!=null&&x.whenReady(l),g(Cwe(x))}},[]);G.useEffect(()=>()=>{d==null||d.map.remove()},[d]);const y=d?bf.createElement(OZ,{value:d},n):o??null;return bf.createElement("div",KA({},f,{ref:m}),y)}const Owe=G.forwardRef(jwe),zwe=VZ(function({positions:t,...r},n){const i=new Kc.Polyline(t,r);return ym(i,RZ(n,{overlayContainer:i}))},function(t,r,n){r.positions!==n.positions&&t.setLatLngs(r.positions)}),Bwe=FZ(function(t,r){const n=new Kc.Popup(t,r.overlayContainer);return ym(n,r)},function(t,r,{position:n},i){G.useEffect(function(){const{instance:o}=t;function s(u){u.popup===o&&(o.update(),i(!0))}function l(u){u.popup===o&&i(!1)}return r.map.on({popupopen:s,popupclose:l}),r.overlayContainer==null?(n!=null&&o.setLatLng(n),o.openOn(r.map)):r.overlayContainer.bindPopup(o),function(){var c;r.map.off({popupopen:s,popupclose:l}),(c=r.overlayContainer)==null||c.unbindPopup(),r.map.removeLayer(o)}},[t,r,i,n])}),Fwe=Pwe(function({url:t,...r},n){const i=new Kc.TileLayer(t,Xb(r,n));return ym(i,n)},function(t,r,n){Dwe(t,r,n);const{url:i}=r;i!=null&&i!==n.url&&t.setUrl(i)}),Vwe=FZ(function(t,r){const n=new Kc.Tooltip(t,r.overlayContainer);return ym(n,r)},function(t,r,{position:n},i){G.useEffect(function(){const o=r.overlayContainer;if(o==null)return;const{instance:s}=t,l=c=>{c.tooltip===s&&(n!=null&&s.setLatLng(n),s.update(),i(!0))},u=c=>{c.tooltip===s&&i(!1)};return o.on({tooltipopen:l,tooltipclose:u}),o.bindTooltip(s),function(){o.off({tooltipopen:l,tooltipclose:u}),o._map!=null&&o.unbindTooltip()}},[t,r,i,n])}),Gwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",Hwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",Uwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC";delete zZ.Icon.Default.prototype._getIconUrl;zZ.Icon.Default.mergeOptions({iconUrl:Gwe,iconRetinaUrl:Hwe,shadowUrl:Uwe});const pB=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],Wwe=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function Zwe(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function $we(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function Ywe(e){if(!e)return"Unknown";const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/6e4),a=Math.floor(n/36e5),o=Math.floor(n/864e5);return i<1?"Just now":i<60?`${i}m ago`:a<24?`${a}h ago`:`${o}d ago`}function Xwe({bounds:e}){const t=Ewe();return G.useEffect(()=>{e&&t.fitBounds(e,{padding:[50,50]})},[t,e]),null}function qwe({node:e}){const t=e.latitude!==null&&e.longitude!==null,r=e.battery_level!==null?e.battery_level>100||e.voltage&&e.voltage>4.1?"USB ⚡":`${e.battery_level.toFixed(0)}%`:"Unknown";return v.jsxs("div",{className:"min-w-[200px]",children:[v.jsx("div",{className:"font-semibold text-slate-800",children:e.short_name}),v.jsx("div",{className:"text-xs text-slate-600 mb-2",children:e.long_name}),v.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[v.jsx("div",{className:"text-slate-500",children:"Role"}),v.jsx("div",{className:"text-slate-700 font-medium",children:e.role}),v.jsx("div",{className:"text-slate-500",children:"Hardware"}),v.jsx("div",{className:"text-slate-700",children:e.hardware||"Unknown"}),v.jsx("div",{className:"text-slate-500",children:"Battery"}),v.jsx("div",{className:"text-slate-700",children:r}),v.jsx("div",{className:"text-slate-500",children:"Last Heard"}),v.jsx("div",{className:"text-slate-700",children:Ywe(e.last_heard)})]}),t&&v.jsxs("div",{className:"mt-3 pt-2 border-t border-slate-200 flex gap-2",children:[v.jsxs("a",{href:`https://www.google.com/maps?q=${e.latitude},${e.longitude}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-blue-600 hover:text-blue-800",children:[v.jsx(kf,{size:10}),"Google Maps"]}),v.jsxs("a",{href:`https://www.openstreetmap.org/?mlat=${e.latitude}&mlon=${e.longitude}&zoom=14`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-blue-600 hover:text-blue-800",children:[v.jsx(kf,{size:10}),"OSM"]})]})]})}function Kwe({nodes:e,edges:t,selectedNodeId:r,onSelectNode:n}){const i=G.useMemo(()=>e.filter(h=>h.latitude!==null&&h.longitude!==null),[e]),a=e.length-i.length,o=G.useMemo(()=>new Map(i.map(h=>[h.node_num,h])),[i]),s=G.useMemo(()=>t.filter(h=>o.has(h.from_node)&&o.has(h.to_node)),[t,o]),l=G.useMemo(()=>{if(i.length===0)return null;const h=i.map(d=>d.latitude),f=i.map(d=>d.longitude);return[[Math.min(...h),Math.min(...f)],[Math.max(...h),Math.max(...f)]]},[i]),u=[43.6,-114.4],c=G.useMemo(()=>{const h=new Set;return r!==null&&t.forEach(f=>{f.from_node===r&&h.add(f.to_node),f.to_node===r&&h.add(f.from_node)}),h},[r,t]);return v.jsxs("div",{className:"relative bg-bg-card border border-border overflow-hidden",children:[v.jsxs(Owe,{center:u,zoom:7,style:{width:"100%",height:"540px"},className:"z-0",children:[v.jsx(Fwe,{url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",attribution:'© OpenStreetMap, © CARTO'}),v.jsx(Xwe,{bounds:l}),s.map((h,f)=>{const d=o.get(h.from_node),g=o.get(h.to_node),m=r===null||h.from_node===r||h.to_node===r;return v.jsx(zwe,{positions:[[d.latitude,d.longitude],[g.latitude,g.longitude]],color:Zwe(h.snr),weight:m&&r!==null?2.5:1.5,opacity:r===null?.3:m?.6:.08},f)}),i.map(h=>{const f=h.node_num===r,d=c.has(h.node_num),g=r===null||f||d,m=Wwe.includes(h.role),y=$we(h.latitude),_=pB[y%pB.length];return v.jsxs(Rwe,{center:[h.latitude,h.longitude],radius:m?8:5,fillColor:m?_:"#111827",fillOpacity:g?.9:.2,stroke:!0,color:f?"#ffffff":_,weight:f?3:m?0:2,opacity:g?1:.3,eventHandlers:{click:()=>n(f?null:h.node_num)},children:[v.jsx(Vwe,{direction:"top",offset:[0,-8],children:v.jsx("span",{className:"font-mono text-xs",children:h.short_name})}),v.jsx(Bwe,{children:v.jsx(qwe,{node:h})})]},h.node_num)})]}),v.jsxs("div",{className:"absolute bottom-4 left-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded px-3 py-2 text-xs text-slate-400 flex items-center gap-2",children:[v.jsx(nd,{size:12}),v.jsxs("span",{children:["Showing ",i.length," of ",e.length," nodes",a>0&&v.jsxs("span",{className:"text-slate-500",children:[" (",a," without coordinates)"]})]})]})]})}const gB=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],Jwe=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function mB(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function Qwe(e){return e>12?"excellent":e>8?"good":e>5?"fair":e>3?"marginal":"poor"}function eSe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function tSe(e){return["Northern ID","Central ID","SW Idaho","SC Idaho"][e]||"Unknown"}function rSe(e){if(!e)return"Unknown";const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/6e4),a=Math.floor(n/36e5),o=Math.floor(n/864e5);return i<1?"Just now":i<60?`${i}m ago`:a<24?`${a}h ago`:`${o}d ago`}function nSe(e){if(!e)return"bg-slate-500";const t=new Date(e),n=(new Date().getTime()-t.getTime())/36e5;return n<1?"bg-green-500":n<24?"bg-amber-500":"bg-slate-500"}function iSe({node:e,edges:t,nodes:r,onSelectNode:n}){const i=G.useMemo(()=>{if(!e)return[];const h=new Map(r.map(d=>[d.node_num,d])),f=[];return t.forEach(d=>{if(d.from_node===e.node_num){const g=h.get(d.to_node);g&&f.push({node:g,snr:d.snr,quality:d.quality})}else if(d.to_node===e.node_num){const g=h.get(d.from_node);g&&f.push({node:g,snr:d.snr,quality:d.quality})}}),f.sort((d,g)=>g.snr-d.snr)},[e,t,r]);if(!e)return v.jsxs("div",{className:"w-[250px] flex-shrink-0 bg-bg-card border-l border-border p-4 flex flex-col items-center justify-center h-[540px]",children:[v.jsx("div",{className:"w-12 h-12 rounded-full bg-bg-hover border border-border flex items-center justify-center mb-3",children:v.jsx(Gi,{size:24,className:"text-slate-500"})}),v.jsx("p",{className:"text-sm text-slate-500 text-center",children:"Click a node to inspect"})]});const a=Jwe.includes(e.role),o=eSe(e.latitude),s=gB[o%gB.length],l=e.latitude!==null&&e.longitude!==null,u=e.battery_level!==null?e.battery_level>100||e.voltage&&e.voltage>4.1?"USB":`${e.battery_level.toFixed(0)}%`:"—",c=e.battery_level!==null&&(e.battery_level>100||e.voltage&&e.voltage>4.1);return v.jsxs("div",{className:"w-[250px] flex-shrink-0 bg-bg-card border-l border-border flex flex-col h-[540px] overflow-hidden",children:[v.jsxs("div",{className:"p-4 border-b border-border",children:[v.jsx("div",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-mono mb-2",style:{backgroundColor:`${s}20`,color:s},children:e.node_id_hex}),v.jsx("div",{className:"font-mono text-lg text-slate-100",children:e.short_name}),v.jsx("div",{className:"text-xs text-slate-500 truncate",children:e.long_name})]}),v.jsxs("div",{className:"p-4 border-b border-border grid grid-cols-2 gap-3",children:[v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Role"}),v.jsx("div",{className:`text-sm font-medium ${a?"text-accent":"text-slate-300"}`,children:e.role})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Region"}),v.jsx("div",{className:"text-sm text-slate-300",children:tSe(o)})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Battery"}),v.jsxs("div",{className:"text-sm text-slate-300 flex items-center gap-1",children:[c&&v.jsx(If,{size:12,className:"text-amber-400"}),u]})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Status"}),v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${nSe(e.last_heard)}`}),v.jsx("span",{className:"text-sm text-slate-300",children:rSe(e.last_heard)})]})]}),v.jsxs("div",{className:"col-span-2",children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Hardware"}),v.jsx("div",{className:"text-sm text-slate-300 font-mono truncate",children:e.hardware||"Unknown"})]})]}),l&&v.jsxs("div",{className:"px-4 py-3 border-b border-border flex gap-3",children:[v.jsxs("a",{href:`https://www.google.com/maps?q=${e.latitude},${e.longitude}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-sky-400 hover:text-sky-300",children:[v.jsx(kf,{size:10}),"Google Maps"]}),v.jsxs("a",{href:`https://www.openstreetmap.org/?mlat=${e.latitude}&mlon=${e.longitude}&zoom=14`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-sky-400 hover:text-sky-300",children:[v.jsx(kf,{size:10}),"OSM"]})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto",children:[v.jsxs("div",{className:"px-4 py-2 text-xs text-slate-500 font-medium sticky top-0 bg-bg-card border-b border-border",children:["Neighbors (",i.length,")"]}),i.length>0?v.jsx("div",{className:"divide-y divide-border",children:i.map(h=>v.jsxs("button",{onClick:()=>n(h.node.node_num),className:"w-full px-4 py-2 text-left hover:bg-bg-hover transition-colors flex items-center gap-2",style:{borderLeftWidth:3,borderLeftColor:mB(h.snr)},children:[v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"text-sm text-slate-200 font-mono truncate",children:h.node.short_name}),v.jsx("div",{className:"text-xs text-slate-500 truncate",children:h.node.long_name})]}),v.jsxs("div",{className:"text-right flex-shrink-0",children:[v.jsxs("div",{className:"text-xs font-mono",style:{color:mB(h.snr)},children:[h.snr.toFixed(1)," dB"]}),v.jsx("div",{className:"text-xs text-slate-500",children:Qwe(h.snr)})]})]},h.node.node_num))}):v.jsx("div",{className:"px-4 py-6 text-center text-sm text-slate-500",children:"No known neighbors"})]})]})}const yB=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function aSe(e){if(!e)return"bg-slate-500";const t=new Date(e),n=(new Date().getTime()-t.getTime())/36e5;return n<1?"bg-green-500":n<24?"bg-amber-500":"bg-slate-500"}function oSe(e){if(!e)return"—";const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/6e4),a=Math.floor(n/36e5),o=Math.floor(n/864e5);return i<1?"Just now":i<60?`${i}m ago`:a<24?`${a}h ago`:`${o}d ago`}function sSe(e){return e.battery_level===null?"—":e.battery_level>100||e.voltage&&e.voltage>4.1?"USB ⚡":`${e.battery_level.toFixed(0)}%`}function _B(e){return e===null?"—":e>46?"Northern":e>44.5?"Central":e>43?"SW Idaho":"SC Idaho"}function lSe({nodes:e,selectedNodeId:t,onSelectNode:r}){const[n,i]=G.useState(""),[a,o]=G.useState("short_name"),[s,l]=G.useState("asc"),[u,c]=G.useState("all"),h=G.useMemo(()=>{let g=[...e];if(u==="infra"?g=g.filter(m=>yB.includes(m.role)):u==="online"&&(g=g.filter(m=>{if(!m.last_heard)return!1;const y=new Date(m.last_heard);return(new Date().getTime()-y.getTime())/36e5<1})),n){const m=n.toLowerCase();g=g.filter(y=>y.short_name.toLowerCase().includes(m)||y.long_name.toLowerCase().includes(m)||y.role.toLowerCase().includes(m)||_B(y.latitude).toLowerCase().includes(m))}return g.sort((m,y)=>{let _="",x="";switch(a){case"short_name":_=m.short_name.toLowerCase(),x=y.short_name.toLowerCase();break;case"role":_=m.role,x=y.role;break;case"battery_level":_=m.battery_level??-1,x=y.battery_level??-1;break;case"last_heard":_=m.last_heard?new Date(m.last_heard).getTime():0,x=y.last_heard?new Date(y.last_heard).getTime():0;break;case"hardware":_=m.hardware.toLowerCase(),x=y.hardware.toLowerCase();break}return _x?s==="asc"?1:-1:0}),g},[e,n,a,s,u]),f=g=>{a===g?l(s==="asc"?"desc":"asc"):(o(g),l("asc"))},d=({field:g})=>a!==g?null:s==="asc"?v.jsx(MK,{size:14,className:"inline ml-1"}):v.jsx(Rl,{size:14,className:"inline ml-1"});return v.jsxs("div",{className:"bg-bg-card border border-border overflow-hidden",children:[v.jsxs("div",{className:"p-3 border-b border-border flex items-center gap-3",children:[v.jsxs("div",{className:"relative flex-1 max-w-xs",children:[v.jsx(W1,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),v.jsx("input",{type:"text",placeholder:"Search nodes...",value:n,onChange:g=>i(g.target.value),className:"w-full pl-9 pr-3 py-1.5 bg-bg-hover border border-border rounded text-sm text-slate-200 placeholder-slate-500 focus:outline-none focus:border-accent"})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(JL,{size:14,className:"text-slate-500 mr-1"}),["all","infra","online"].map(g=>v.jsx("button",{onClick:()=>c(g),className:`px-2 py-1 text-xs rounded transition-colors ${u===g?"bg-accent text-white":"bg-bg-hover text-slate-400 hover:text-slate-200"}`,children:g==="all"?"All":g==="infra"?"Infra":"Online"},g))]}),v.jsxs("div",{className:"text-xs text-slate-500 ml-auto",children:[h.length," of ",e.length," nodes"]})]}),v.jsxs("div",{className:"overflow-x-auto",children:[v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"bg-bg-hover text-slate-400 text-xs",children:[v.jsx("th",{className:"w-8 px-3 py-2"}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("short_name"),children:["Name ",v.jsx(d,{field:"short_name"})]}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("role"),children:["Role ",v.jsx(d,{field:"role"})]}),v.jsx("th",{className:"px-3 py-2 text-left",children:"Region"}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("battery_level"),children:[v.jsx("span",{title:"Battery percent (4.20V = 100%, 3.60V ~ 30% warning, 3.30V ~ 3% critical). USB ⚡ = USB-powered (>100% or >4.1V); no battery management applies.",children:"Battery"})," ",v.jsx(d,{field:"battery_level"})]}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("last_heard"),children:[v.jsx("span",{title:"Status dot: green = heard in the last hour; amber = within 24h; slate = offline (past the configured threshold). See Reference → Mesh Health for thresholds by node type.",children:"Last Heard"})," ",v.jsx(d,{field:"last_heard"})]}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("hardware"),children:["Hardware ",v.jsx(d,{field:"hardware"})]})]})}),v.jsx("tbody",{className:"divide-y divide-border",children:h.slice(0,100).map(g=>{const m=yB.includes(g.role),y=g.node_num===t;return v.jsxs("tr",{onClick:()=>r(g.node_num),className:`cursor-pointer transition-colors ${y?"bg-accent/10":"hover:bg-bg-hover"}`,children:[v.jsx("td",{className:"px-3 py-2",children:v.jsx("div",{className:`w-2 h-2 rounded-full ${aSe(g.last_heard)}`})}),v.jsxs("td",{className:"px-3 py-2",children:[v.jsx("div",{className:"font-mono text-slate-200",children:g.short_name}),v.jsx("div",{className:"text-xs text-slate-500 truncate max-w-[200px]",children:g.long_name})]}),v.jsx("td",{className:"px-3 py-2",children:v.jsx("span",{className:`inline-block px-1.5 py-0.5 rounded text-xs font-medium ${m?"bg-cyan-500/20 text-accent":"bg-slate-500/20 text-slate-400"}`,children:g.role})}),v.jsx("td",{className:"px-3 py-2 text-slate-400",children:_B(g.latitude)}),v.jsx("td",{className:"px-3 py-2 font-mono text-slate-300",children:sSe(g)}),v.jsx("td",{className:"px-3 py-2 text-slate-400",children:oSe(g.last_heard)}),v.jsx("td",{className:"px-3 py-2 font-mono text-xs text-slate-400 truncate max-w-[150px]",children:g.hardware||"—"})]},g.node_num)})})]}),h.length>100&&v.jsxs("div",{className:"px-3 py-2 text-xs text-slate-500 text-center border-t border-border",children:["Showing first 100 of ",h.length," nodes"]}),h.length===0&&v.jsx("div",{className:"px-3 py-8 text-sm text-slate-500 text-center",children:"No nodes match your filters"})]})]})}function uSe(){const[e,t]=G.useState([]),[r,n]=G.useState([]),[i,a]=G.useState([]),[o,s]=G.useState(null),[l,u]=G.useState("topo"),[c,h]=G.useState(!0),[f,d]=G.useState(null);G.useEffect(()=>{document.title="Mesh — MeshAI",Promise.all([FK(),VK(),WK()]).then(([y,_,x])=>{t(y),n(_),a(x),h(!1)}).catch(y=>{d(y.message),h(!1)})},[]);const g=G.useMemo(()=>e.find(y=>y.node_num===o)||null,[e,o]),m=G.useCallback(y=>{s(y)},[]);return c?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading mesh data..."})}):f?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsxs("div",{className:"text-red-400",children:["Error: ",f]})}):v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"text-sm text-slate-400",children:[e.length," nodes • ",r.length," edges"]}),v.jsxs("div",{className:"flex items-center bg-bg-card border border-border p-1",children:[v.jsxs("button",{onClick:()=>u("topo"),className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${l==="topo"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:[v.jsx(s6,{size:14}),v.jsx("span",{title:"Force-directed graph of nodes + neighbor links. Edge weight reflects SNR; node color reflects status (green = active, amber = stale, slate = offline).",children:"Topology"})]}),v.jsxs("button",{onClick:()=>u("geo"),className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${l==="geo"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:[v.jsx(EK,{size:14}),v.jsx("span",{title:"Nodes plotted by lat/lon on a basemap. Nodes without a reported position are clustered at the top edge.",children:"Geographic"})]})]})]}),v.jsxs("div",{className:"flex gap-0",children:[v.jsx("div",{className:"flex-1 min-w-0",children:l==="topo"?v.jsx(bwe,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:m}):v.jsx(Kwe,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:m})}),v.jsx(iSe,{node:g,edges:r,nodes:e,onSelectNode:m})]}),v.jsx(lSe,{nodes:e,selectedNodeId:o,onSelectNode:m})]})}function lP({label:e,value:t,onChange:r,helper:n,info:i,roleFilter:a,valueType:o="short_name"}){const[s,l]=G.useState([]),[u,c]=G.useState(!0),[h,f]=G.useState(""),[d,g]=G.useState(!1);G.useEffect(()=>{fetch("/api/nodes").then(S=>S.json()).then(S=>{l(S),c(!1)}).catch(()=>{l([]),c(!1)})},[]);const m=G.useMemo(()=>{let S=s;if(a&&(S=S.filter(T=>a==="ROUTER"||a==="infrastructure"?T.is_infrastructure||T.role==="ROUTER"||T.role==="ROUTER_CLIENT"||T.role==="REPEATER":T.role===a)),h.trim()){const T=h.toLowerCase();S=S.filter(M=>{var A,N,P,I;return((A=M.short_name)==null?void 0:A.toLowerCase().includes(T))||((N=M.long_name)==null?void 0:N.toLowerCase().includes(T))||((P=M.role)==null?void 0:P.toLowerCase().includes(T))||((I=M.node_id_hex)==null?void 0:I.toLowerCase().includes(T))})}return S.sort((T,M)=>(T.short_name||"").localeCompare(M.short_name||""))},[s,h,a]),y=S=>{switch(o){case"node_num":return String(S.node_num);case"node_id_hex":return S.node_id_hex;default:return S.short_name||String(S.node_num)}},_=S=>{const T=y(S);return t.includes(T)},x=S=>{const T=y(S);t.includes(T)?r(t.filter(M=>M!==T)):r([...t,T])},w=S=>{const T=[S.short_name];return S.long_name&&S.long_name!==S.short_name&&T.push(`— ${S.long_name}`),S.role&&T.push(`(${S.role})`),T.join(" ")};return!u&&s.length===0?v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),v.jsx("input",{type:"text",value:t.join(", "),onChange:S=>r(S.target.value.split(",").map(T=>T.trim()).filter(Boolean)),placeholder:"Enter node IDs separated by commas",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]}):v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),t.length>0&&v.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.map(S=>{const T=s.find(M=>y(M)===S);return v.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-accent/20 text-accent rounded text-sm",children:[T?T.short_name:S,v.jsx("button",{type:"button",onClick:()=>r(t.filter(M=>M!==S)),className:"hover:text-white",children:v.jsx(ya,{size:14})})]},S)})}),v.jsxs("div",{className:"relative",children:[v.jsxs("div",{className:"relative",children:[v.jsx(W1,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),v.jsx("input",{type:"text",value:h,onChange:S=>f(S.target.value),onFocus:()=>g(!0),placeholder:u?"Loading nodes...":"Search nodes...",className:"w-full pl-9 pr-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent"})]}),d&&!u&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>g(!1)}),v.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 z-50 max-h-64 overflow-y-auto bg-[#0a0e17] border border-[#1e2a3a] shadow-xl",children:m.length===0?v.jsx("div",{className:"p-3 text-sm text-slate-500 text-center",children:"No nodes found"}):m.map(S=>v.jsxs("button",{type:"button",onClick:()=>x(S),className:`w-full flex items-center gap-2 px-3 py-2 text-left text-sm hover:bg-[#1e2a3a] ${_(S)?"bg-accent/10":""}`,children:[v.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center ${_(S)?"bg-accent border-accent":"border-slate-600"}`,children:_(S)&&v.jsx(ao,{size:12,className:"text-white"})}),v.jsx("span",{className:"text-slate-200",children:w(S)})]},S.node_num))})]})]}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function uP(e){const[t,r]=G.useState([]),[n,i]=G.useState(!0);G.useEffect(()=>{fetch("/api/channels").then(f=>f.json()).then(f=>{r(f),i(!1)}).catch(()=>{r([]),i(!1)})},[]);const a=f=>{const d=f.role==="PRIMARY"?"Primary":f.role==="SECONDARY"?"Secondary":"";return`${f.index}: ${f.name}${d?` (${d})`:""}`};if(!n&&t.length===0)return e.mode==="single"?v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),v.jsx("input",{type:"number",value:e.value,onChange:f=>e.onChange(Number(f.target.value)),min:e.includeDisabled?-1:0,max:7,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),e.helper&&v.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]}):v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),v.jsx("input",{type:"text",value:e.value.join(", "),onChange:f=>{const d=f.target.value.split(",").map(g=>parseInt(g.trim())).filter(g=>!isNaN(g));e.onChange(d)},placeholder:"Enter channel numbers separated by commas",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),e.helper&&v.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]});if(e.mode==="single"){const{value:f,onChange:d,label:g,helper:m,includeDisabled:y}=e,_=t.filter(x=>x.enabled);return v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:g}),v.jsxs("select",{value:f,onChange:x=>d(Number(x.target.value)),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:[y&&v.jsx("option",{value:-1,children:"Disabled"}),_.map(x=>v.jsx("option",{value:x.index,children:a(x)},x.index))]}),m&&v.jsx("p",{className:"text-xs text-slate-600",children:m})]})}const{value:o,onChange:s,label:l,helper:u}=e,c=t.filter(f=>f.enabled),h=f=>{o.includes(f)?s(o.filter(d=>d!==f)):s([...o,f].sort((d,g)=>d-g))};return v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:l}),v.jsxs("div",{className:"border border-[#1e2a3a] p-2 space-y-1",children:[c.map(f=>v.jsxs("label",{onClick:()=>h(f.index),className:"flex items-center gap-2 p-2 rounded hover:bg-[#0a0e17] cursor-pointer",children:[v.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center ${o.includes(f.index)?"bg-accent border-accent":"border-slate-600"}`,children:o.includes(f.index)&&v.jsx(ao,{size:12,className:"text-white"})}),v.jsx("span",{className:"text-sm text-slate-200",children:a(f)})]},f.index)),c.length===0&&v.jsx("div",{className:"text-sm text-slate-500 p-2",children:"No channels available"})]}),u&&v.jsx("p",{className:"text-xs text-slate-600",children:u})]})}const xB=[{key:"bot",label:"Bot",icon:wK},{key:"connection",label:"Connection",icon:Z1},{key:"response",label:"Response",icon:QL},{key:"history",label:"History",icon:n6},{key:"memory",label:"Memory",icon:SK},{key:"context",label:"Context",icon:KL},{key:"commands",label:"Commands",icon:c6},{key:"llm",label:"LLM",icon:r6},{key:"weather",label:"Weather",icon:sc},{key:"meshmonitor",label:"MeshMonitor",icon:Gi},{key:"knowledge",label:"Knowledge",icon:e6},{key:"mesh_sources",label:"Mesh Sources",icon:a6},{key:"mesh_intelligence",label:"Intelligence",icon:rd},{key:"dashboard",label:"Dashboard",icon:o6}],Kn={bot:"Identity and behavior settings for the bot on the mesh network.",connection:"How MeshAI connects to your Meshtastic radio.",response:"Controls how quickly and how much the bot responds on the mesh.",history:"Conversation history storage and cleanup.",memory:"Short-term conversation memory management. Controls how the bot maintains context within a conversation.",context:"Passive channel monitoring. The bot listens to mesh channels and uses recent messages as context when responding.",commands:"Mesh commands available via the configured prefix. Toggle individual commands on or off.",llm:"AI model configuration. MeshAI uses an LLM to understand questions and generate responses.",weather:"Weather data for the !weather command. This is separate from NWS environmental alerts.",meshmonitor:"AIDA MeshMonitor integration. An additional data source for mesh network monitoring.",knowledge:"Knowledge base for answering questions from stored documents. Connects to Qdrant vector database or local SQLite.",mesh_sources:"Data sources for mesh network information. MeshAI can pull data from multiple sources simultaneously and merge them into a unified view.",mesh_intelligence:"Advanced mesh analysis: health scoring, region management, and automated alerting. The intelligence engine monitors your mesh and detects problems automatically.",dashboard:"Web dashboard settings. You're looking at it right now."},cSe=[{name:"help",description:"Show available commands and usage"},{name:"health",description:"Mesh network health overview with status dots"},{name:"status",description:"Quick mesh status summary"},{name:"region",description:"List regions or get detailed region breakdown"},{name:"neighbors",description:"Show top infrastructure neighbors with signal quality"},{name:"ping",description:"Test bot responsiveness"},{name:"clear",description:"Clear your conversation history"},{name:"reset",description:"Reset conversation context"},{name:"sub",description:"Subscribe to scheduled reports or alerts"},{name:"unsub",description:"Remove a subscription"},{name:"mysubs",description:"List your active subscriptions"},{name:"alerts",description:"Active NWS weather alerts for mesh area"},{name:"solar",description:"Space weather and HF propagation conditions"},{name:"hf",description:"HF radio propagation (alias for !solar)"},{name:"fire",description:"Active wildfires near the mesh"},{name:"avy",description:"Avalanche advisories for configured zones"},{name:"hotspots",description:"NASA FIRMS satellite fire detections"},{name:"streams",description:"USGS stream gauge readings"},{name:"roads",description:"Road conditions and closures"},{name:"traffic",description:"Traffic flow on monitored corridors"}],hSe=[{value:"US-AL",label:"Alabama"},{value:"US-AK",label:"Alaska"},{value:"US-AZ",label:"Arizona"},{value:"US-AR",label:"Arkansas"},{value:"US-CA",label:"California"},{value:"US-CO",label:"Colorado"},{value:"US-CT",label:"Connecticut"},{value:"US-DE",label:"Delaware"},{value:"US-FL",label:"Florida"},{value:"US-GA",label:"Georgia"},{value:"US-HI",label:"Hawaii"},{value:"US-ID",label:"Idaho"},{value:"US-IL",label:"Illinois"},{value:"US-IN",label:"Indiana"},{value:"US-IA",label:"Iowa"},{value:"US-KS",label:"Kansas"},{value:"US-KY",label:"Kentucky"},{value:"US-LA",label:"Louisiana"},{value:"US-ME",label:"Maine"},{value:"US-MD",label:"Maryland"},{value:"US-MA",label:"Massachusetts"},{value:"US-MI",label:"Michigan"},{value:"US-MN",label:"Minnesota"},{value:"US-MS",label:"Mississippi"},{value:"US-MO",label:"Missouri"},{value:"US-MT",label:"Montana"},{value:"US-NE",label:"Nebraska"},{value:"US-NV",label:"Nevada"},{value:"US-NH",label:"New Hampshire"},{value:"US-NJ",label:"New Jersey"},{value:"US-NM",label:"New Mexico"},{value:"US-NY",label:"New York"},{value:"US-NC",label:"North Carolina"},{value:"US-ND",label:"North Dakota"},{value:"US-OH",label:"Ohio"},{value:"US-OK",label:"Oklahoma"},{value:"US-OR",label:"Oregon"},{value:"US-PA",label:"Pennsylvania"},{value:"US-RI",label:"Rhode Island"},{value:"US-SC",label:"South Carolina"},{value:"US-SD",label:"South Dakota"},{value:"US-TN",label:"Tennessee"},{value:"US-TX",label:"Texas"},{value:"US-UT",label:"Utah"},{value:"US-VT",label:"Vermont"},{value:"US-VA",label:"Virginia"},{value:"US-WA",label:"Washington"},{value:"US-WV",label:"West Virginia"},{value:"US-WI",label:"Wisconsin"},{value:"US-WY",label:"Wyoming"}];function yo({info:e,link:t,linkText:r="Learn more"}){const[n,i]=G.useState(!1),a=G.useRef(null);return G.useEffect(()=>{if(!n)return;function o(l){a.current&&!a.current.contains(l.target)&&i(!1)}const s=setTimeout(()=>document.addEventListener("mousedown",o),0);return()=>{clearTimeout(s),document.removeEventListener("mousedown",o)}},[n]),v.jsxs("div",{className:"relative inline-block",ref:a,children:[v.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),i(!n)},className:"ml-1.5 w-4 h-4 rounded-full bg-slate-700 hover:bg-slate-600 text-slate-400 hover:text-slate-200 inline-flex items-center justify-center text-xs transition-colors",title:"More info",children:"?"}),n&&v.jsxs("div",{className:"absolute left-0 top-6 z-50 w-72 p-3 bg-[#1a2332] border border-[#2a3a4a] shadow-xl text-xs text-slate-300 leading-relaxed",children:[v.jsx("button",{type:"button",onClick:()=>i(!1),className:"absolute top-1 right-1 w-5 h-5 rounded hover:bg-slate-700 text-slate-500 hover:text-slate-300 inline-flex items-center justify-center transition-colors","aria-label":"Close",children:v.jsx(ya,{size:12})}),v.jsx("div",{className:"pr-4",children:e}),t&&v.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"mt-2 flex items-center gap-1 text-accent hover:underline",onClick:o=>o.stopPropagation(),children:[r," ",v.jsx(kf,{size:10})]})]})]})}function Jn({text:e}){return v.jsx("p",{className:"text-sm text-slate-500 mb-6 pb-4 border-b border-[#1e2a3a]",children:e})}function vt({label:e,value:t,onChange:r,type:n="text",placeholder:i="",helper:a="",info:o="",infoLink:s=""}){const[l,u]=G.useState(!1),c=n==="password";return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&v.jsx(yo,{info:o,link:s})]}),v.jsxs("div",{className:"relative",children:[v.jsx("input",{type:c&&!l?"password":"text",value:t,onChange:h=>r(h.target.value),placeholder:i,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"}),c&&v.jsx("button",{type:"button",onClick:()=>u(!l),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-300",children:l?v.jsx(i6,{size:16}):v.jsx(KL,{size:16})})]}),a&&v.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function Ue({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s="",infoLink:l=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&v.jsx(yo,{info:s,link:l})]}),v.jsx("input",{type:"number",value:t,onChange:u=>r(Number(u.target.value)),min:n,max:i,step:a,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),o&&v.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function fr({label:e,checked:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){return v.jsxs("div",{className:"flex items-center justify-between py-2",children:[v.jsxs("div",{children:[v.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&v.jsx(yo,{info:i,link:a})]}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]}),v.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:v.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function Fn({label:e,value:t,onChange:r,options:n,helper:i="",info:a="",infoLink:o=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&v.jsx(yo,{info:a,link:o})]}),v.jsx("select",{value:t,onChange:s=>r(s.target.value),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:n.map(s=>v.jsx("option",{value:s.value,children:s.label},s.value))}),i&&v.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function fSe({label:e,value:t,onChange:r,rows:n=4,helper:i="",info:a="",infoLink:o=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&v.jsx(yo,{info:a,link:o})]}),v.jsx("textarea",{value:t,onChange:s=>r(s.target.value),rows:n,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent resize-y"}),i&&v.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function zo({label:e,value:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){const[o,s]=G.useState(t.join(", "));G.useEffect(()=>{s(t.join(", "))},[t]);const l=()=>{const u=o.split(",").map(c=>c.trim()).filter(Boolean);r(u)};return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&v.jsx(yo,{info:i,link:a})]}),v.jsx("input",{type:"text",value:o,onChange:u=>s(u.target.value),onBlur:l,placeholder:"item1, item2, item3",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function dSe({label:e,value:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){const[o,s]=G.useState(t.join(", "));G.useEffect(()=>{s(t.join(", "))},[t]);const l=()=>{const u=o.split(",").map(c=>parseInt(c.trim(),10)).filter(c=>!isNaN(c));r(u)};return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&v.jsx(yo,{info:i,link:a})]}),v.jsx("input",{type:"text",value:o,onChange:u=>s(u.target.value),onBlur:l,placeholder:"0, 1, 2",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function dn({label:e,description:t,checked:r,onChange:n,threshold:i,onThresholdChange:a,thresholdLabel:o,thresholdMin:s,thresholdMax:l,thresholdStep:u=1,thresholdSuffix:c=""}){return v.jsxs("div",{className:"border border-[#1e2a3a] p-3 space-y-2",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"flex-1",children:[v.jsx("span",{className:"text-sm text-slate-300",children:e}),v.jsx("p",{className:"text-xs text-slate-600",children:t})]}),v.jsx("button",{type:"button",onClick:()=>n(!r),className:`relative w-11 h-6 rounded-full transition-colors flex-shrink-0 ml-3 ${r?"bg-accent":"bg-[#1e2a3a]"}`,children:v.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${r?"translate-x-5":""}`})})]}),r&&i!==void 0&&a&&v.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-[#1e2a3a]",children:[v.jsxs("span",{className:"text-xs text-slate-500",children:[o||"Threshold",":"]}),v.jsx("input",{type:"number",value:i,onChange:h=>a(Number(h.target.value)),min:s,max:l,step:u,className:"w-20 px-2 py-1 bg-[#0a0e17] border border-[#1e2a3a] rounded text-xs text-slate-200 font-mono"}),c&&v.jsx("span",{className:"text-xs text-slate-500",children:c})]})]})}function vSe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Jn,{text:Kn.bot}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(vt,{label:"Bot Name",value:e.name,onChange:r=>t({...e,name:r}),helper:"Name the bot responds to on the mesh",info:"When someone sends a message containing this name, the bot will respond. Also used as the sender name in broadcasts. Changing this requires a restart."}),v.jsx(vt,{label:"Owner",value:e.owner,onChange:r=>t({...e,owner:r}),helper:"Your callsign or identifier",info:"Identifies the bot operator. Shown in !help responses and used for admin-level commands."})]}),v.jsx(fr,{label:"Respond to DMs",checked:e.respond_to_dms,onChange:r=>t({...e,respond_to_dms:r}),helper:"Reply when someone sends a direct message",info:"When enabled, the bot responds to direct messages from any node. When disabled, the bot only responds to channel messages that mention its name."}),v.jsx(fr,{label:"Filter BBS Protocols",checked:e.filter_bbs_protocols,onChange:r=>t({...e,filter_bbs_protocols:r}),helper:"Ignore BBS bulletin board traffic",info:"Filters out automated BBS protocol messages (advBBS, MAIL*, BOARD*) so the bot doesn't try to respond to machine-to-machine traffic."})]})}function pSe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Jn,{text:Kn.connection}),v.jsx(Fn,{label:"Connection Type",value:e.type,onChange:r=>t({...e,type:r}),options:[{value:"serial",label:"Serial (USB)"},{value:"tcp",label:"TCP (Network)"}],helper:"Serial for USB-connected radios, TCP for network or meshtasticd",info:"Serial: direct USB connection to a Meshtastic radio. TCP: connect over the network to a radio's IP or to meshtasticd running on another machine."}),e.type==="serial"?v.jsx(vt,{label:"Serial Port",value:e.serial_port,onChange:r=>t({...e,serial_port:r}),placeholder:"/dev/ttyUSB0",helper:"Device path for your USB radio",info:"Usually /dev/ttyUSB0 on Linux or /dev/ttyACM0. Check with 'ls /dev/tty*' after plugging in your radio."}):v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(vt,{label:"TCP Host",value:e.tcp_host,onChange:r=>t({...e,tcp_host:r}),placeholder:"192.168.1.100",helper:"IP address or hostname of the radio/meshtasticd"}),v.jsx(Ue,{label:"TCP Port",value:e.tcp_port,onChange:r=>t({...e,tcp_port:r}),min:1,max:65535,helper:"Default 4403 for meshtasticd"})]})]})}function gSe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Jn,{text:Kn.response}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ue,{label:"Delay Min (sec)",value:e.delay_min,onChange:r=>t({...e,delay_min:r}),min:0,step:.1,helper:"Minimum wait before responding",info:"Adds a random delay between min and max before the bot sends a response. Prevents the bot from appearing to respond instantly, which can feel unnatural on a radio network."}),v.jsx(Ue,{label:"Delay Max (sec)",value:e.delay_max,onChange:r=>t({...e,delay_max:r}),min:0,step:.1,helper:"Maximum wait before responding",info:"Also prevents collisions with other traffic by staggering transmissions."})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ue,{label:"Max Length",value:e.max_length,onChange:r=>t({...e,max_length:r}),min:50,max:500,helper:"Maximum characters per response message",info:"Meshtastic packets have limited size. This caps how long each message chunk can be. The bot will split longer responses into multiple messages up to Max Messages."}),v.jsx(Ue,{label:"Max Messages",value:e.max_messages,onChange:r=>t({...e,max_messages:r}),min:1,max:10,helper:"Maximum chunks per response",info:"If a response is longer than Max Length, the bot splits it into this many chunks at most. Higher values = more complete answers but more airtime used."})]})]})}function mSe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Jn,{text:Kn.history}),v.jsx(vt,{label:"Database Path",value:e.database,onChange:r=>t({...e,database:r}),helper:"SQLite file for storing conversation history",info:"Path to the SQLite database file. Created automatically if it doesn't exist. Stores all conversation history for context."}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ue,{label:"Max Messages Per User",value:e.max_messages_per_user,onChange:r=>t({...e,max_messages_per_user:r}),min:0,helper:"History limit per user (0 = unlimited)",info:"Limits how many messages are stored per user. Older messages are pruned when the limit is reached. Set to 0 for no limit."}),v.jsx(Ue,{label:"Conversation Timeout (sec)",value:e.conversation_timeout,onChange:r=>t({...e,conversation_timeout:r}),min:0,helper:"Seconds before context resets",info:"If a user doesn't message for this long, their next message starts a new conversation context. The bot won't remember the previous topic."})]}),v.jsx(fr,{label:"Auto Cleanup",checked:e.auto_cleanup,onChange:r=>t({...e,auto_cleanup:r}),helper:"Automatically prune old conversations"}),e.auto_cleanup&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ue,{label:"Cleanup Interval (hours)",value:e.cleanup_interval_hours,onChange:r=>t({...e,cleanup_interval_hours:r}),min:1,helper:"Hours between cleanup runs"}),v.jsx(Ue,{label:"Max Age (days)",value:e.max_age_days,onChange:r=>t({...e,max_age_days:r}),min:1,helper:"Delete conversations older than this"})]})]})}function ySe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Jn,{text:Kn.memory}),v.jsx(fr,{label:"Enable Memory",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Keep conversation context between messages"}),e.enabled&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ue,{label:"Window Size",value:e.window_size,onChange:r=>t({...e,window_size:r}),min:1,helper:"Recent message pairs kept in full",info:"The bot keeps this many recent exchanges (user message + bot response pairs) as full text in context. Older messages are summarized to save token space."}),v.jsx(Ue,{label:"Summarize Threshold",value:e.summarize_threshold,onChange:r=>t({...e,summarize_threshold:r}),min:1,helper:"Messages before older context is summarized",info:"When the conversation exceeds this many messages, older ones outside the window are compressed into a summary by the LLM."})]})]})}function _Se({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Jn,{text:Kn.context}),v.jsx(fr,{label:"Enable Passive Context",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Listen to channel traffic for context",info:"When enabled, the bot monitors mesh channels and includes recent messages in its context. This lets the bot reference things other people said on the channel."}),e.enabled&&v.jsxs(v.Fragment,{children:[v.jsx(uP,{label:"Observe Channels",value:e.observe_channels,onChange:r=>t({...e,observe_channels:r}),helper:"Channels to monitor (empty = all)",info:"Meshtastic channels to listen on. Leave empty to monitor all channels.",mode:"multi"}),v.jsx(lP,{label:"Ignore Nodes",value:e.ignore_nodes,onChange:r=>t({...e,ignore_nodes:r}),helper:"Nodes to exclude from context",info:"Messages from these nodes won't be included in passive context. Useful for filtering out noisy automated nodes."}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ue,{label:"Max Age (sec)",value:e.max_age,onChange:r=>t({...e,max_age:r}),min:0,helper:"Ignore messages older than this"}),v.jsx(Ue,{label:"Max Context Items",value:e.max_context_items,onChange:r=>t({...e,max_context_items:r}),min:1,helper:"Maximum recent messages to include"})]})]})]})}function xSe({data:e,onChange:t}){const r=new Set(e.disabled_commands.map(i=>i.toLowerCase())),n=i=>{const a=i.toLowerCase();r.has(a)?t({...e,disabled_commands:e.disabled_commands.filter(o=>o.toLowerCase()!==a)}):t({...e,disabled_commands:[...e.disabled_commands,i]})};return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Jn,{text:Kn.commands}),v.jsx(fr,{label:"Enable Commands",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Allow !commands on the mesh"}),e.enabled&&v.jsxs(v.Fragment,{children:[v.jsx(vt,{label:"Command Prefix",value:e.prefix,onChange:i=>t({...e,prefix:i}),helper:"Character that triggers commands (e.g. ! for !help)",info:"Users type this character followed by the command name. Only single characters recommended."}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Available Commands",v.jsx(yo,{info:"Toggle commands on or off. Disabled commands won't respond when users invoke them."})]}),v.jsx("div",{className:"grid gap-1",children:cSe.map(i=>{const a=!r.has(i.name.toLowerCase());return v.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#0a0e17] border border-[#1e2a3a] rounded hover:border-[#2a3a4a] transition-colors",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsxs("code",{className:"text-accent text-sm",children:["!",i.name]}),v.jsx("span",{className:"text-xs text-slate-500",children:i.description})]}),v.jsx("button",{type:"button",onClick:()=>n(i.name),className:`relative w-9 h-5 rounded-full transition-colors ${a?"bg-accent":"bg-[#1e2a3a]"}`,children:v.jsx("span",{className:`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white transition-transform ${a?"translate-x-4":""}`})})]},i.name)})})]})]})]})}function bSe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Jn,{text:Kn.llm}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Fn,{label:"Backend",value:e.backend,onChange:r=>t({...e,backend:r}),options:[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"google",label:"Google (Gemini)"}],helper:"LLM provider to use",info:"OpenAI: GPT models (gpt-4o, gpt-4o-mini). Anthropic: Claude models (claude-sonnet-4-20250514). Google: Gemini models. Can also point to compatible APIs like Ollama, LM Studio, or Open WebUI by changing the Base URL."}),v.jsx(vt,{label:"Model",value:e.model,onChange:r=>t({...e,model:r}),placeholder:"gpt-4o-mini",helper:"Specific model name",info:"The specific model to use. Common choices: gpt-4o-mini (fast, cheap), gpt-4o (better, costs more), claude-sonnet-4-20250514 (Anthropic equivalent). For local models via Ollama, use the model name you pulled (e.g. llama3.1)."})]}),v.jsx(vt,{label:"API Key",value:e.api_key,onChange:r=>t({...e,api_key:r}),type:"password",helper:"Supports ${ENV_VAR} syntax",info:"Your API key from the provider. You can also use ${ENV_VAR} syntax to read from an environment variable instead of storing the key in the config file."}),v.jsx(vt,{label:"Base URL",value:e.base_url,onChange:r=>t({...e,base_url:r}),placeholder:"https://api.openai.com/v1",helper:"API endpoint (change for local LLMs)",info:"Default API endpoint for the selected backend. Change this to point to a local LLM server (Ollama at http://localhost:11434/v1, Open WebUI, LM Studio, etc.) or a proxy."}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ue,{label:"Timeout (sec)",value:e.timeout,onChange:r=>t({...e,timeout:r}),min:5,max:120,helper:"Maximum seconds to wait for response"}),v.jsx(Ue,{label:"Max Response Tokens",value:e.max_response_tokens,onChange:r=>t({...e,max_response_tokens:r}),min:100,helper:"Token limit for LLM responses"})]}),v.jsx(fr,{label:"Use System Prompt",checked:e.use_system_prompt,onChange:r=>t({...e,use_system_prompt:r}),helper:"Enable custom system instructions"}),e.use_system_prompt&&v.jsx(fSe,{label:"System Prompt",value:e.system_prompt,onChange:r=>t({...e,system_prompt:r}),rows:6,helper:"Instructions that shape the bot's personality",info:"Instructions that shape the bot's personality and behavior. The bot always follows these instructions. MeshAI adds mesh health data and environmental context automatically — you don't need to include those here."}),v.jsx(fr,{label:"Web Search",checked:e.web_search,onChange:r=>t({...e,web_search:r}),helper:"Enable web search tool (Open WebUI feature)"}),v.jsx(fr,{label:"Google Grounding",checked:e.google_grounding,onChange:r=>t({...e,google_grounding:r}),helper:"Ground responses in web search (Gemini only)"})]})}function wSe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Jn,{text:Kn.weather}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Fn,{label:"Primary Provider",value:e.primary,onChange:r=>t({...e,primary:r}),options:[{value:"openmeteo",label:"Open-Meteo"},{value:"wttr",label:"wttr.in"},{value:"llm",label:"LLM"}],helper:"Main weather data source"}),v.jsx(Fn,{label:"Fallback Provider",value:e.fallback,onChange:r=>t({...e,fallback:r}),options:[{value:"openmeteo",label:"Open-Meteo"},{value:"wttr",label:"wttr.in"},{value:"llm",label:"LLM"},{value:"none",label:"None"}],helper:"Backup if primary fails"})]}),v.jsx(vt,{label:"Default Location",value:e.default_location,onChange:r=>t({...e,default_location:r}),placeholder:"Your city, state",helper:"Location when none specified"})]})}function SSe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Jn,{text:Kn.meshmonitor}),v.jsx(fr,{label:"Enable MeshMonitor",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Connect to AIDA MeshMonitor instance",info:"MeshMonitor by Yeraze provides node data, battery info, telemetry, and auto-responder patterns. MeshAI uses this as a data source and avoids duplicate responses."}),e.enabled&&v.jsxs(v.Fragment,{children:[v.jsx(vt,{label:"URL",value:e.url,onChange:r=>t({...e,url:r}),placeholder:"http://192.168.1.100:8080",helper:"MeshMonitor API endpoint",info:"Full URL to your MeshMonitor instance. Usually runs on port 8080."}),v.jsx(fr,{label:"Inject Into Prompt",checked:e.inject_into_prompt,onChange:r=>t({...e,inject_into_prompt:r}),helper:"Tell LLM about MeshMonitor commands",info:"Adds MeshMonitor's auto-responder patterns to the LLM context so it knows what commands MeshMonitor handles."}),v.jsx(Ue,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:r=>t({...e,refresh_interval:r}),min:10,helper:"How often to fetch patterns"}),v.jsx(fr,{label:"Polite Mode",checked:e.polite_mode,onChange:r=>t({...e,polite_mode:r}),helper:"Reduce polling frequency",info:"Reduces polling frequency for shared instances to be a good neighbor."})]})]})}function CSe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Jn,{text:Kn.knowledge}),v.jsx(fr,{label:"Enable Knowledge Base",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Answer questions from stored documents",info:"Uses RAG (Retrieval-Augmented Generation) to answer questions from a knowledge base. Supports Qdrant vector database or local SQLite with FTS5."}),e.enabled&&v.jsxs(v.Fragment,{children:[v.jsx(Fn,{label:"Backend",value:e.backend,onChange:r=>t({...e,backend:r}),options:[{value:"auto",label:"Auto (Qdrant -> SQLite)"},{value:"qdrant",label:"Qdrant"},{value:"sqlite",label:"SQLite"}],helper:"Knowledge storage backend",info:"Auto tries Qdrant first, falls back to SQLite. Qdrant provides hybrid search with dense+sparse embeddings. SQLite uses FTS5 keyword search."}),(e.backend==="qdrant"||e.backend==="auto")&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(vt,{label:"Qdrant Host",value:e.qdrant_host,onChange:r=>t({...e,qdrant_host:r}),helper:"Qdrant server hostname",info:"IP or hostname of your Qdrant vector database server."}),v.jsx(Ue,{label:"Qdrant Port",value:e.qdrant_port,onChange:r=>t({...e,qdrant_port:r}),helper:"Default 6333"})]}),v.jsx(vt,{label:"Collection",value:e.qdrant_collection,onChange:r=>t({...e,qdrant_collection:r}),helper:"Qdrant collection name"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(vt,{label:"TEI Host",value:e.tei_host,onChange:r=>t({...e,tei_host:r}),helper:"Text Embeddings Inference host",info:"TEI service for generating dense embeddings. Uses BAAI/bge-m3 model."}),v.jsx(Ue,{label:"TEI Port",value:e.tei_port,onChange:r=>t({...e,tei_port:r}),helper:"Default 8090"})]}),v.jsx(fr,{label:"Use Sparse Embeddings",checked:e.use_sparse,onChange:r=>t({...e,use_sparse:r}),helper:"Enable hybrid search with sparse vectors",info:"Combines dense embeddings with sparse (keyword-based) embeddings using Reciprocal Rank Fusion for better search results."})]}),v.jsx(vt,{label:"SQLite DB Path",value:e.db_path,onChange:r=>t({...e,db_path:r}),helper:"Local knowledge database file"}),v.jsx(Ue,{label:"Top K Results",value:e.top_k,onChange:r=>t({...e,top_k:r}),min:1,max:20,helper:"Number of documents to retrieve"})]})]})}function TSe({source:e,onChange:t,onDelete:r}){const[n,i]=G.useState(!1),a={meshview:"Web-based mesh monitoring tool. Enter the full URL of a MeshView instance. No API key typically required.",meshmonitor:"AIDA MeshMonitor API. Provides node data and network statistics. Requires API token.",mqtt:"Subscribe directly to a Meshtastic MQTT broker for real-time packet data. This is push-based (instant) vs the polling approach of MeshView/MeshMonitor."};return v.jsxs("div",{className:"border border-[#1e2a3a] overflow-hidden",children:[v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>i(!n),children:[v.jsxs("div",{className:"flex items-center gap-3",children:[n?v.jsx(Rl,{size:16}):v.jsx(wl,{size:16}),v.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`}),v.jsx("span",{className:"font-mono text-sm text-slate-200",children:e.name||"Unnamed Source"}),v.jsx("span",{className:"text-xs text-slate-500 bg-[#1e2a3a] px-2 py-0.5 rounded",children:e.type})]}),v.jsx("button",{onClick:o=>{o.stopPropagation(),r()},className:"p-1 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",children:v.jsx(Yg,{size:14})})]}),n&&v.jsxs("div",{className:"p-4 space-y-4 border-t border-[#1e2a3a]",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(vt,{label:"Name",value:e.name,onChange:o=>t({...e,name:o}),helper:"Friendly name for this source"}),v.jsx(Fn,{label:"Type",value:e.type,onChange:o=>t({...e,type:o}),options:[{value:"meshview",label:"MeshView"},{value:"meshmonitor",label:"MeshMonitor"},{value:"mqtt",label:"MQTT Broker"}],info:a[e.type]||""})]}),e.type!=="mqtt"&&v.jsx(vt,{label:"URL",value:e.url,onChange:o=>t({...e,url:o}),helper:"Full URL including protocol"}),e.type==="meshmonitor"&&v.jsx(vt,{label:"API Token",value:e.api_token,onChange:o=>t({...e,api_token:o}),type:"password",helper:"Bearer token for authentication"}),e.type==="mqtt"&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(vt,{label:"Host",value:e.host||"",onChange:o=>t({...e,host:o}),helper:"MQTT broker hostname"}),v.jsx(Ue,{label:"Port",value:e.port||1883,onChange:o=>t({...e,port:o}),min:1,max:65535,helper:"1883 plain, 8883 TLS"})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(vt,{label:"Username",value:e.username||"",onChange:o=>t({...e,username:o})}),v.jsx(vt,{label:"Password",value:e.password||"",onChange:o=>t({...e,password:o}),type:"password"})]}),v.jsx(vt,{label:"Topic Root",value:e.topic_root||"msh/US",onChange:o=>t({...e,topic_root:o}),helper:"Base topic to subscribe to"}),v.jsx(fr,{label:"Use TLS",checked:e.use_tls||!1,onChange:o=>t({...e,use_tls:o}),helper:"Encrypt MQTT connection"})]}),v.jsx(Ue,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:o=>t({...e,refresh_interval:o}),min:10,helper:"Polling frequency"}),v.jsx(fr,{label:"Enabled",checked:e.enabled,onChange:o=>t({...e,enabled:o})}),v.jsx(fr,{label:"Polite Mode",checked:e.polite_mode,onChange:o=>t({...e,polite_mode:o}),helper:"Reduce polling for shared instances"})]})]})}function MSe({data:e,onChange:t}){const r=()=>{t([...e,{name:"New Source",type:"meshview",url:"",api_token:"",refresh_interval:30,polite_mode:!1,enabled:!0,host:"",port:1883,username:"",password:"",topic_root:"msh/US",use_tls:!1}])};return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Jn,{text:Kn.mesh_sources}),e.map((n,i)=>v.jsx(TSe,{source:n,onChange:a=>{const o=[...e];o[i]=a,t(o)},onDelete:()=>{confirm(`Delete source "${n.name}"?`)&&t(e.filter((a,o)=>o!==i))}},i)),v.jsxs("button",{onClick:r,className:"w-full py-2 border border-dashed border-[#1e2a3a] text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[v.jsx(id,{size:16})," Add Source"]})]})}function ASe({data:e,onChange:t}){const[r,n]=G.useState(null);return v.jsxs("div",{className:"space-y-6",children:[v.jsx(Jn,{text:Kn.mesh_intelligence}),v.jsx(fr,{label:"Enable Mesh Intelligence",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Activate health scoring and alerting"}),e.enabled&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ue,{label:"Locality Radius (miles)",value:e.locality_radius_miles,onChange:i=>t({...e,locality_radius_miles:i}),min:1,step:.5,helper:"Region assignment radius",info:"Nodes within this distance of a region anchor point are assigned to that region."}),v.jsx(Ue,{label:"Offline Threshold (hours)",value:e.offline_threshold_hours,onChange:i=>t({...e,offline_threshold_hours:i}),min:1,helper:"Time until node marked offline",info:"A node is considered offline after not being heard for this many hours."})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ue,{label:"Packet Threshold",value:e.packet_threshold,onChange:i=>t({...e,packet_threshold:i}),min:0,helper:"Min packets per 24h to flag",info:"Minimum packets per 24 hours. Nodes below this are flagged as low activity."}),v.jsx(Ue,{label:"Battery Warning %",value:e.battery_warning_percent,onChange:i=>t({...e,battery_warning_percent:i}),min:1,max:100,helper:"Global battery warning level"})]}),v.jsx(lP,{label:"Critical Nodes",value:e.critical_nodes,onChange:i=>t({...e,critical_nodes:i}),helper:"Critical infrastructure nodes",info:"Nodes that get priority alerting when they go offline.",roleFilter:"infrastructure"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(uP,{label:"Alert Channel",value:e.alert_channel,onChange:i=>t({...e,alert_channel:i}),helper:"Channel for broadcast alerts",info:"Meshtastic channel for broadcast alerts. Select Disabled to turn off channel broadcasting.",mode:"single",includeDisabled:!0}),v.jsx(Ue,{label:"Alert Cooldown (min)",value:e.alert_cooldown_minutes,onChange:i=>t({...e,alert_cooldown_minutes:i}),min:1,helper:"Min time between repeat alerts",info:"Minimum minutes between repeated alerts for the same condition. Uses scaling cooldown (12h, 24h, 48h)."})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Regions",v.jsx(yo,{info:"Regions group mesh nodes by geographic area. Each region has an anchor point (lat/lon) and nodes within the region radius are automatically assigned. Regions enable localized reports, alerts, and health scoring."})]}),e.regions.map((i,a)=>v.jsxs("div",{className:"border border-[#1e2a3a] overflow-hidden",children:[v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>n(r===a?null:a),children:[v.jsxs("div",{className:"flex items-center gap-3",children:[r===a?v.jsx(Rl,{size:16}):v.jsx(wl,{size:16}),v.jsx("span",{className:"font-medium text-slate-200",children:i.name||"Unnamed Region"}),v.jsx("span",{className:"text-xs text-slate-500",children:i.local_name})]}),v.jsx("button",{onClick:o=>{if(o.stopPropagation(),confirm(`Delete region "${i.name||"Unnamed Region"}"?`)){const s=e.regions.filter((l,u)=>u!==a);t({...e,regions:s})}},className:"p-1 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",children:v.jsx(Yg,{size:14})})]}),r===a&&v.jsxs("div",{className:"p-4 space-y-3 border-t border-[#1e2a3a]",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(vt,{label:"Name",value:i.name,onChange:o=>{const s=[...e.regions];s[a]={...i,name:o},t({...e,regions:s})}}),v.jsx(vt,{label:"Local Name",value:i.local_name,onChange:o=>{const s=[...e.regions];s[a]={...i,local_name:o},t({...e,regions:s})}})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ue,{label:"Latitude",value:i.lat,onChange:o=>{const s=[...e.regions];s[a]={...i,lat:o},t({...e,regions:s})},step:1e-4}),v.jsx(Ue,{label:"Longitude",value:i.lon,onChange:o=>{const s=[...e.regions];s[a]={...i,lon:o},t({...e,regions:s})},step:1e-4})]}),v.jsx(vt,{label:"Description",value:i.description,onChange:o=>{const s=[...e.regions];s[a]={...i,description:o},t({...e,regions:s})}}),v.jsx(zo,{label:"Aliases",value:i.aliases,onChange:o=>{const s=[...e.regions];s[a]={...i,aliases:o},t({...e,regions:s})}}),v.jsx(zo,{label:"Cities",value:i.cities,onChange:o=>{const s=[...e.regions];s[a]={...i,cities:o},t({...e,regions:s})}})]})]},a)),v.jsxs("button",{onClick:()=>{const i={name:"",local_name:"",lat:0,lon:0,description:"",aliases:[],cities:[]};t({...e,regions:[...e.regions,i]}),n(e.regions.length)},className:"w-full py-2 border border-dashed border-[#1e2a3a] text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[v.jsx(id,{size:16})," Add Region"]})]}),v.jsxs("div",{className:"space-y-3",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Rules",v.jsx(yo,{info:"Configure which conditions trigger alerts. Each rule can have an optional threshold value."})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Infrastructure"}),v.jsx(dn,{label:"Infra Offline",description:"Alert when an infrastructure node (router/repeater) goes offline",checked:e.alert_rules.infra_offline,onChange:i=>t({...e,alert_rules:{...e.alert_rules,infra_offline:i}})}),v.jsx(dn,{label:"Infra Recovery",description:"Alert when an offline infrastructure node comes back online",checked:e.alert_rules.infra_recovery,onChange:i=>t({...e,alert_rules:{...e.alert_rules,infra_recovery:i}})}),v.jsx(dn,{label:"New Router",description:"Alert when a new router/repeater appears on the mesh",checked:e.alert_rules.new_router,onChange:i=>t({...e,alert_rules:{...e.alert_rules,new_router:i}})}),v.jsx(dn,{label:"Feeder Offline",description:"Alert when a data source (MeshView/MeshMonitor) stops responding",checked:e.alert_rules.feeder_offline,onChange:i=>t({...e,alert_rules:{...e.alert_rules,feeder_offline:i}})}),v.jsx(dn,{label:"Single Gateway",description:"Alert when an infrastructure node has only one connection path",checked:e.alert_rules.infra_single_gateway,onChange:i=>t({...e,alert_rules:{...e.alert_rules,infra_single_gateway:i}})}),v.jsx(dn,{label:"Region Blackout",description:"Alert when all infrastructure in a region goes offline",checked:e.alert_rules.region_total_blackout,onChange:i=>t({...e,alert_rules:{...e.alert_rules,region_total_blackout:i}})})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Power"}),v.jsx(dn,{label:"Battery Warning",description:"Alert when infra node battery drops below warning threshold",checked:e.alert_rules.battery_warning,onChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_warning:i}}),threshold:e.alert_rules.battery_warning_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_warning_threshold:i}}),thresholdLabel:"Below",thresholdMin:10,thresholdMax:90,thresholdSuffix:"%"}),v.jsx(dn,{label:"Battery Critical",description:"Alert at critical battery level",checked:e.alert_rules.battery_critical,onChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_critical:i}}),threshold:e.alert_rules.battery_critical_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_critical_threshold:i}}),thresholdLabel:"Below",thresholdMin:5,thresholdMax:50,thresholdSuffix:"%"}),v.jsx(dn,{label:"Battery Emergency",description:"Alert at emergency battery level",checked:e.alert_rules.battery_emergency,onChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_emergency:i}}),threshold:e.alert_rules.battery_emergency_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_emergency_threshold:i}}),thresholdLabel:"Below",thresholdMin:1,thresholdMax:25,thresholdSuffix:"%"}),v.jsx(dn,{label:"Battery Trend Declining",description:"Alert when battery shows a declining trend over 7 days",checked:e.alert_rules.battery_trend_declining,onChange:i=>t({...e,alert_rules:{...e.alert_rules,battery_trend_declining:i}})}),v.jsx(dn,{label:"Power Source Change",description:"Alert when a node switches between battery and USB power",checked:e.alert_rules.power_source_change,onChange:i=>t({...e,alert_rules:{...e.alert_rules,power_source_change:i}})}),v.jsx(dn,{label:"Solar Not Charging",description:"Alert when a solar-powered node isn't charging during daylight",checked:e.alert_rules.solar_not_charging,onChange:i=>t({...e,alert_rules:{...e.alert_rules,solar_not_charging:i}})})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Utilization"}),v.jsx(dn,{label:"High Utilization",description:"Alert when channel utilization stays high for extended periods",checked:e.alert_rules.sustained_high_util,onChange:i=>t({...e,alert_rules:{...e.alert_rules,sustained_high_util:i}}),threshold:e.alert_rules.high_util_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,high_util_threshold:i}}),thresholdLabel:"Above",thresholdMin:5,thresholdMax:50,thresholdSuffix:`% for ${e.alert_rules.high_util_hours}h`}),v.jsx(dn,{label:"Packet Flood",description:"Alert when a single node sends excessive packets",checked:e.alert_rules.packet_flood,onChange:i=>t({...e,alert_rules:{...e.alert_rules,packet_flood:i}}),threshold:e.alert_rules.packet_flood_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,packet_flood_threshold:i}}),thresholdLabel:"Over",thresholdMin:100,thresholdMax:2e3,thresholdSuffix:"pkts/24h"})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Health Scores"}),v.jsx(dn,{label:"Mesh Score Alert",description:"Alert when overall mesh health score drops below threshold",checked:e.alert_rules.mesh_score_alert,onChange:i=>t({...e,alert_rules:{...e.alert_rules,mesh_score_alert:i}}),threshold:e.alert_rules.mesh_score_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,mesh_score_threshold:i}}),thresholdLabel:"Below",thresholdMin:30,thresholdMax:90,thresholdSuffix:"/100"}),v.jsx(dn,{label:"Region Score Alert",description:"Alert when a region's health score drops below threshold",checked:e.alert_rules.region_score_alert,onChange:i=>t({...e,alert_rules:{...e.alert_rules,region_score_alert:i}}),threshold:e.alert_rules.region_score_threshold,onThresholdChange:i=>t({...e,alert_rules:{...e.alert_rules,region_score_threshold:i}}),thresholdLabel:"Below",thresholdMin:30,thresholdMax:90,thresholdSuffix:"/100"})]})]})]})]})}function LSe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Jn,{text:Kn.dashboard}),v.jsx(fr,{label:"Enable Dashboard",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Run the web dashboard"}),e.enabled&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(vt,{label:"Host",value:e.host,onChange:r=>t({...e,host:r}),placeholder:"0.0.0.0",helper:"Network bind address",info:"0.0.0.0 = accessible from any device on the network. 127.0.0.1 = only accessible from this machine."}),v.jsx(Ue,{label:"Port",value:e.port,onChange:r=>t({...e,port:r}),min:1,max:65535,helper:"Dashboard URL port",info:"Port number for the web dashboard URL. You access the dashboard at http://your-ip:port"})]})]})}function kSe(){var P;const[e,t]=G.useState(null),[r,n]=G.useState(null),[i,a]=G.useState("bot"),[o,s]=G.useState(!0),[l,u]=G.useState(!1),[c,h]=G.useState(null),[f,d]=G.useState(null),[g,m]=G.useState(!1),[y,_]=G.useState(!1),x=G.useCallback(async()=>{try{const I=await fetch("/api/config");if(!I.ok)throw new Error("Failed to fetch config");const D=await I.json();t(D),n(JSON.parse(JSON.stringify(D))),_(!1),h(null)}catch(I){h(I instanceof Error?I.message:"Unknown error")}finally{s(!1)}},[]);G.useEffect(()=>{document.title="Config — MeshAI",x()},[x]),G.useEffect(()=>{e&&r&&_(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);const w=async()=>{if(e){u(!0),h(null),d(null);try{const I=e[i],D=await fetch(`/api/config/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)}),O=await D.json();if(!D.ok)throw new Error(O.detail||"Save failed");d(`${i} saved successfully`),n(JSON.parse(JSON.stringify(e))),_(!1),O.restart_required&&(m(!0),qK(Array.isArray(O.changed_keys)?O.changed_keys:[])),setTimeout(()=>d(null),3e3)}catch(I){h(I instanceof Error?I.message:"Save failed")}finally{u(!1)}}},S=()=>{r&&(t(JSON.parse(JSON.stringify(r))),_(!1))},T=async()=>{try{await fetch("/api/restart",{method:"POST"}),m(!1),d("Restart initiated")}catch{h("Restart failed")}},M=(I,D)=>{e&&t({...e,[I]:D})};if(o)return v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading configuration..."})});if(!e)return v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-red-400",children:"Failed to load configuration"})});const A=()=>{switch(i){case"bot":return v.jsx(vSe,{data:e.bot,onChange:I=>M("bot",I)});case"connection":return v.jsx(pSe,{data:e.connection,onChange:I=>M("connection",I)});case"response":return v.jsx(gSe,{data:e.response,onChange:I=>M("response",I)});case"history":return v.jsx(mSe,{data:e.history,onChange:I=>M("history",I)});case"memory":return v.jsx(ySe,{data:e.memory,onChange:I=>M("memory",I)});case"context":return v.jsx(_Se,{data:e.context,onChange:I=>M("context",I)});case"commands":return v.jsx(xSe,{data:e.commands,onChange:I=>M("commands",I)});case"llm":return v.jsx(bSe,{data:e.llm,onChange:I=>M("llm",I)});case"weather":return v.jsx(wSe,{data:e.weather,onChange:I=>M("weather",I)});case"meshmonitor":return v.jsx(SSe,{data:e.meshmonitor,onChange:I=>M("meshmonitor",I)});case"knowledge":return v.jsx(CSe,{data:e.knowledge,onChange:I=>M("knowledge",I)});case"mesh_sources":return v.jsx(MSe,{data:e.mesh_sources,onChange:I=>M("mesh_sources",I)});case"mesh_intelligence":return v.jsx(ASe,{data:e.mesh_intelligence,onChange:I=>M("mesh_intelligence",I)});case"dashboard":return v.jsx(LSe,{data:e.dashboard,onChange:I=>M("dashboard",I)});default:return null}},N=((P=xB.find(I=>I.key===i))==null?void 0:P.label)||i;return v.jsxs("div",{className:"flex gap-6 h-[calc(100vh-8rem)]",children:[v.jsx("div",{className:"w-48 flex-shrink-0 space-y-1",children:xB.map(({key:I,label:D,icon:O})=>v.jsxs("button",{onClick:()=>a(I),className:`w-full flex items-center gap-2 px-3 py-2 rounded text-sm transition-colors ${i===I?"bg-accent text-white":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover"}`,children:[v.jsx(O,{size:16}),v.jsx("span",{children:D}),y&&i===I&&v.jsx("span",{className:"ml-auto w-2 h-2 bg-amber-500 rounded-full"})]},I))}),v.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[v.jsxs("div",{className:"flex items-center justify-between mb-6",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(l6,{size:20,className:"text-slate-500"}),v.jsx("h2",{className:"text-lg font-semibold text-slate-200",children:N})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[y&&v.jsxs("button",{onClick:S,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm text-slate-400 hover:text-slate-200 bg-bg-hover rounded transition-colors",children:[v.jsx(H1,{size:14}),"Discard"]}),v.jsxs("button",{onClick:w,disabled:l||!y,className:"flex items-center gap-1.5 px-4 py-1.5 text-sm bg-accent text-white rounded hover:bg-accent/80 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[l?v.jsx(qp,{size:14,className:"animate-spin"}):v.jsx(ek,{size:14}),"Save"]})]})]}),g&&v.jsxs("div",{className:"flex items-center justify-between p-3 mb-4 bg-amber-500/10 border border-amber-500/30",children:[v.jsxs("div",{className:"flex items-center gap-2 text-amber-400",children:[v.jsx(oo,{size:16}),v.jsx("span",{className:"text-sm",children:"Restart required for changes to take effect"})]}),v.jsx("button",{onClick:T,className:"px-3 py-1 text-sm bg-amber-500 text-white rounded hover:bg-amber-600 transition-colors",children:"Restart Now"})]}),c&&v.jsxs("div",{className:"flex items-center gap-2 p-3 mb-4 bg-red-500/10 border border-red-500/30 text-red-400",children:[v.jsx(ya,{size:16}),v.jsx("span",{className:"text-sm",children:c})]}),f&&v.jsxs("div",{className:"flex items-center gap-2 p-3 mb-4 bg-green-500/10 border border-green-500/30 text-green-400",children:[v.jsx(ao,{size:16}),v.jsx("span",{className:"text-sm",children:f})]}),v.jsx("div",{className:"flex-1 overflow-y-auto pr-2",children:v.jsx("div",{className:"bg-bg-card border border-border p-6",children:A()})})]})]})}function ISe({feed:e}){const t=e.is_loaded?e.consecutive_errors>0?"bg-amber-500":"bg-green-500":"bg-red-500",r=e.is_loaded?e.consecutive_errors>0?`${e.consecutive_errors} errors`:"Healthy":"Not loaded",n=e.last_fetch?new Date(e.last_fetch*1e3).toLocaleTimeString():"Never";return v.jsxs("div",{className:"bg-bg-hover p-4",children:[v.jsxs("div",{className:"flex items-center justify-between mb-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${t}`}),v.jsx("span",{className:"text-sm font-medium text-white uppercase",children:e.source})]}),v.jsx("span",{className:"text-xs text-[#777]",children:r})]}),v.jsxs("div",{className:"text-xs font-mono text-[#666] space-y-1",children:[v.jsxs("div",{children:["Events: ",e.event_count]}),v.jsxs("div",{children:["Last fetch: ",n]}),e.last_error&&v.jsx("div",{className:"text-accent truncate",children:e.last_error})]})]})}function NSe({event:e}){const t=e.severity.toLowerCase(),r=t==="extreme"||t==="severe"||t==="immediate"?{bg:"bg-red-500/10",border:"border-red-500",Icon:os,color:"text-red-500"}:t==="moderate"||t==="warning"||t==="priority"?{bg:"bg-accent/10",border:"border-amber-500",Icon:oo,color:"text-accent"}:{bg:"bg-sky-400/10",border:"border-sky-400",Icon:V1,color:"text-sky-400"},n=r.Icon;return v.jsx("div",{className:`p-3 ${r.bg} border-l-2 ${r.border}`,children:v.jsxs("div",{className:"flex items-start gap-3",children:[v.jsx(n,{size:16,className:r.color}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[v.jsx("span",{className:"text-sm font-medium text-white",children:e.event_type}),v.jsx("span",{className:`text-xs px-1.5 py-0.5 ${r.bg} ${r.color}`,children:e.severity})]}),v.jsx("div",{className:"text-sm font-sans text-[#e0e0e0]",children:e.headline})]})]})})}function GZ({value:e,onChange:t,disabled:r,centralDisabled:n}){const i="px-2 py-1 text-xs transition-colors";return v.jsxs("div",{className:`flex border border-border overflow-hidden ${r?"opacity-40":""}`,children:[v.jsx("button",{type:"button",disabled:r,onClick:()=>t("native"),className:`${i} ${e==="native"?"bg-accent text-white":"text-[#777] hover:text-white"}`,children:"native"}),v.jsx("button",{type:"button",disabled:r||n,title:n?"Central not available for this adapter":"",onClick:()=>{n||t("central")},className:`${i} ${n?"text-[#666] cursor-not-allowed":e==="central"?"bg-accent text-white":"text-[#777] hover:text-white"}`,children:"central"})]})}function PSe({title:e,subtitle:t,enabled:r,onEnabled:n,feedSource:i,onFeedSource:a,hasCentral:o,nativeOnly:s,hasKey:l,health:u,events:c,children:h}){const f=s||!o;return v.jsxs("div",{className:"border border-border p-4 space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{children:[v.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:e}),t&&v.jsx("p",{className:"text-xs text-[#666]",children:t})]}),v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("span",{className:"text-[10px] uppercase tracking-wide text-[#666]",children:"source"}),v.jsx(GZ,{value:i,onChange:a,disabled:!r,centralDisabled:f})]}),v.jsx(fr,{label:"",checked:r,onChange:n})]})]}),!l&&v.jsx("div",{className:"text-xs text-accent bg-accent/10 p-2",children:"API key not configured — contact admin"}),s&&v.jsx("div",{className:"text-[11px] text-[#666]",children:"Central not available for this adapter — native only"}),v.jsx("div",{className:r?"space-y-3":"space-y-3 opacity-40 pointer-events-none select-none",children:h}),(u||c&&c.length>0)&&v.jsxs("div",{className:"pt-2 border-t border-border space-y-3",children:[v.jsx("div",{className:"text-[10px] uppercase tracking-wide text-[#666]",children:"Live status"}),u?v.jsx(ISe,{feed:u}):v.jsx("div",{className:"text-xs text-[#666]",children:"No status reported."}),c&&c.length>0&&v.jsx("div",{className:"space-y-2",children:c.slice(0,5).map((d,g)=>v.jsx(NSe,{event:d},g))})]})]})}const Es={nws:{label:"NWS Weather Alerts",subtitle:"National Weather Service alerts",health:"nws",hasCentral:!0,nativeOnly:!1,hasKey:!0},fires:{label:"NIFC Fire Perimeters",subtitle:"Active wildfires (National Interagency Fire Center)",health:"nifc",hasCentral:!0,nativeOnly:!1,hasKey:!0},firms:{label:"NASA FIRMS Hotspots",subtitle:"Satellite thermal-anomaly detections",health:"firms",hasCentral:!0,nativeOnly:!1,hasKey:!1},swpc:{label:"NOAA Space Weather (SWPC)",subtitle:"Solar indices, geomagnetic storms",health:"swpc",hasCentral:!0,nativeOnly:!1,hasKey:!0},ducting:{label:"Tropospheric Ducting",subtitle:"VHF/UHF extended-range conditions",health:"ducting",hasCentral:!1,nativeOnly:!0,hasKey:!0},traffic:{label:"TomTom Traffic",subtitle:"Traffic flow on monitored corridors",health:"traffic",hasCentral:!0,nativeOnly:!1,hasKey:!0},roads511:{label:"511 Road Conditions",subtitle:"State DOT road events and closures",health:"roads511",hasCentral:!0,nativeOnly:!1,hasKey:!1},wzdx:{label:"WZDx Work Zones",subtitle:"Planned road work and construction events from ITD",health:"roads511",hasCentral:!0,nativeOnly:!1,hasKey:!0},usgs_quake:{label:"USGS Earthquakes",subtitle:"Seismic events from the USGS feed",health:"usgs_quake",hasCentral:!0,nativeOnly:!1,hasKey:!0},usgs:{label:"USGS Stream Gauges",subtitle:"River and stream water levels",health:"usgs",hasCentral:!0,nativeOnly:!1,hasKey:!0},avalanche:{label:"Avalanche Advisories",subtitle:"Backcountry avalanche danger ratings",health:"avalanche",hasCentral:!0,nativeOnly:!1,hasKey:!0},satpass:{label:"Satellite Passes",subtitle:"Observer pass alerts via Central",health:"satpass",hasCentral:!0,nativeOnly:!1,hasKey:!0}},ET=[{key:"central",label:"Central",icon:jK,adapters:[]},{key:"weather",label:"Weather",icon:sc,adapters:["nws"]},{key:"fire",label:"Fire",icon:F1,adapters:["fires","firms"]},{key:"rf",label:"RF Propagation",icon:Gi,adapters:["swpc","ducting"]},{key:"roads",label:"Roads",icon:z1,adapters:["traffic","roads511","wzdx"]},{key:"geohazards",label:"Geohazards",icon:G1,adapters:["usgs_quake","usgs","avalanche"]},{key:"tracking",label:"Tracking",icon:U1,adapters:["satpass"]},{key:"mesh",label:"Mesh Health",icon:rd,adapters:[]}];function DSe(){var Mm,Am;const[e,t]=G.useState(null),[r,n]=G.useState(""),[i,a]=G.useState(null),[o,s]=G.useState([]),[l,u]=G.useState(!0),[c,h]=G.useState(!1),[f,d]=G.useState(null),[g,m]=G.useState(null),[y,_]=G.useState(!1),[x,w]=G.useState("weather"),[S,T]=G.useState("nws"),[M,A]=G.useState({allowed_incident_types:["WF"],freshness_seconds:0,cooldown_seconds:28800,broadcast_on_acres:!0,broadcast_on_contained:!0}),[N,P]=G.useState(""),[I,D]=G.useState({digest_enabled:!0,digest_schedule:["06:00","18:00"],digest_timezone:"America/Boise"}),[O,j]=G.useState(""),[B,U]=G.useState({min_magnitude:4,drop_non_present:!0,drop_zero_magnitude:!0}),[H,V]=G.useState(""),[z,$]=G.useState({min_severity:"None",enabled_categories:["incident","closure"],enabled_sub_types:["accident","road_closed","closure","lane_closed","vehicle_on_fire","flooding","debris"]}),[W,Z]=G.useState(""),[X,re]=G.useState({broadcast:!1,min_severity:"Minor",sub_types:["road_works","lane_closed","road_closed"]}),[J,oe]=G.useState(""),[le,De]=G.useState({broadcast_severities:["Extreme","Severe"],duplicate_allowed_after_seconds:3600}),[be,ve]=G.useState(""),[Ne,_e]=G.useState({min_danger_level:3}),[ke,ct]=G.useState(""),[Fe,tt]=G.useState({geomag_kp_floor:7,flare_class_floor:"X1",proton_pfu_floor:10}),[ht,jt]=G.useState(""),[bt,ar]=G.useState({observers:[],min_elevation:30,norad_ids:[]}),[On,Qn]=G.useState("");G.useEffect(()=>{document.title="Environment — MeshAI",(async()=>{var we,Jt,wn,mi,Ji,Fl,te,st,xe,ft,or,Ca,ws,Qc,Rd,To,jd,Lm,km,Im,Nm,Od,Pm,Vl,Dm,Em;try{const Rm=await(await fetch("/api/config/environmental")).json();t(Rm),n(JSON.stringify(Rm));try{const Ot=await fetch("/api/adapter-config/wfigs");if(Ot.ok){const mt=await Ot.json(),Mt={allowed_incident_types:((we=mt.allowed_incident_types)==null?void 0:we.value)??["WF"],freshness_seconds:((Jt=mt.freshness_seconds)==null?void 0:Jt.value)??0,cooldown_seconds:((wn=mt.cooldown_seconds)==null?void 0:wn.value)??28800,broadcast_on_acres:((mi=mt.broadcast_on_acres)==null?void 0:mi.value)??!0,broadcast_on_contained:((Ji=mt.broadcast_on_contained)==null?void 0:Ji.value)??!0};A(Mt),P(JSON.stringify(Mt))}}catch{}try{const Ot=await fetch("/api/adapter-config/fires");if(Ot.ok){const mt=await Ot.json(),Mt={digest_enabled:((Fl=mt.digest_enabled)==null?void 0:Fl.value)??!0,digest_schedule:((te=mt.digest_schedule)==null?void 0:te.value)??["06:00","18:00"],digest_timezone:((st=mt.digest_timezone)==null?void 0:st.value)??"America/Boise"};D(Mt),j(JSON.stringify(Mt))}}catch{}try{const Ot=await fetch("/api/adapter-config/tomtom_incidents");if(Ot.ok){const mt=await Ot.json(),Mt={min_magnitude:((xe=mt.min_magnitude)==null?void 0:xe.value)??4,drop_non_present:((ft=mt.drop_non_present)==null?void 0:ft.value)??!0,drop_zero_magnitude:((or=mt.drop_zero_magnitude)==null?void 0:or.value)??!0};U(Mt),V(JSON.stringify(Mt))}}catch{}try{const Ot=await fetch("/api/adapter-config/itd_511");if(Ot.ok){const mt=await Ot.json(),Mt={min_severity:((Ca=mt.min_severity)==null?void 0:Ca.value)??"None",enabled_categories:((ws=mt.enabled_categories)==null?void 0:ws.value)??["incident","closure"],enabled_sub_types:((Qc=mt.enabled_sub_types)==null?void 0:Qc.value)??["accident","road_closed","closure","lane_closed","vehicle_on_fire","flooding","debris"]};$(Mt),Z(JSON.stringify(Mt))}}catch{}try{const Ot=await fetch("/api/adapter-config/wzdx");if(Ot.ok){const mt=await Ot.json(),Mt={broadcast:((Rd=mt.broadcast)==null?void 0:Rd.value)??!1,min_severity:((To=mt.min_severity)==null?void 0:To.value)??"Minor",sub_types:((jd=mt.sub_types)==null?void 0:jd.value)??["road_works","lane_closed","road_closed"]};re(Mt),oe(JSON.stringify(Mt))}}catch{}try{const Ot=await fetch("/api/adapter-config/nws");if(Ot.ok){const mt=await Ot.json(),Mt={broadcast_severities:((Lm=mt.broadcast_severities)==null?void 0:Lm.value)??["Extreme","Severe"],duplicate_allowed_after_seconds:((km=mt.duplicate_allowed_after_seconds)==null?void 0:km.value)??3600};De(Mt),ve(JSON.stringify(Mt))}}catch{}try{const Ot=await fetch("/api/adapter-config/avalanche");if(Ot.ok){const Mt={min_danger_level:((Im=(await Ot.json()).min_danger_level)==null?void 0:Im.value)??3};_e(Mt),ct(JSON.stringify(Mt))}}catch{}try{const Ot=await fetch("/api/adapter-config/swpc");if(Ot.ok){const mt=await Ot.json(),Mt={geomag_kp_floor:((Nm=mt.geomag_kp_floor)==null?void 0:Nm.value)??7,flare_class_floor:((Od=mt.flare_class_floor)==null?void 0:Od.value)??"X1",proton_pfu_floor:((Pm=mt.proton_pfu_floor)==null?void 0:Pm.value)??10};tt(Mt),jt(JSON.stringify(Mt))}}catch{}try{const Ot=await fetch("/api/adapter-config/satpass");if(Ot.ok){const mt=await Ot.json(),Mt={observers:((Vl=mt.observers)==null?void 0:Vl.value)??[],min_elevation:((Dm=mt.min_elevation)==null?void 0:Dm.value)??30,norad_ids:((Em=mt.norad_ids)==null?void 0:Em.value)??[]};ar(Mt),Qn(JSON.stringify(Mt))}}catch{}}catch(zd){d(zd instanceof Error?zd.message:"Failed to load config")}finally{u(!1)}})()},[]),G.useEffect(()=>{const we=async()=>{try{a(await d6()),s(await v6())}catch{}};we();const Jt=setInterval(we,3e4);return()=>clearInterval(Jt)},[]);const So=e!==null&&JSON.stringify(e)!==r,kd=JSON.stringify(M)!==N,_m=JSON.stringify(I)!==O,xm=JSON.stringify(B)!==H,Jc=JSON.stringify(z)!==W,Id=JSON.stringify(X)!==J,Nd=JSON.stringify(le)!==be,bm=JSON.stringify(Ne)!==ke,Pd=JSON.stringify(Fe)!==ht,Dd=JSON.stringify(bt)!==On,qb=So||kd||_m||xm||Jc||Id||Nd||bm||Pd||Dd,Pt=async(we,Jt,wn)=>{const mi=await fetch(`/api/adapter-config/${we}/${Jt}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:wn})});if(!mi.ok){const Ji=await mi.json().catch(()=>({}));throw new Error(Ji.detail||`Failed to save ${we}.${Jt}`)}},Ed=async()=>{if(e){h(!0),d(null),m(null);try{if(So){const we=await fetch("/api/config/environmental",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Jt=await we.json();if(!we.ok)throw new Error(Jt.detail||"Save failed");n(JSON.stringify(e)),Jt.restart_required&&_(!0)}if(kd){const we=JSON.parse(N);M.freshness_seconds!==we.freshness_seconds&&await Pt("wfigs","freshness_seconds",M.freshness_seconds),JSON.stringify(M.allowed_incident_types)!==JSON.stringify(we.allowed_incident_types)&&await Pt("wfigs","allowed_incident_types",M.allowed_incident_types),M.cooldown_seconds!==we.cooldown_seconds&&await Pt("wfigs","cooldown_seconds",M.cooldown_seconds),M.broadcast_on_acres!==we.broadcast_on_acres&&await Pt("wfigs","broadcast_on_acres",M.broadcast_on_acres),M.broadcast_on_contained!==we.broadcast_on_contained&&await Pt("wfigs","broadcast_on_contained",M.broadcast_on_contained),P(JSON.stringify(M))}if(_m){const we=JSON.parse(O);I.digest_enabled!==we.digest_enabled&&await Pt("fires","digest_enabled",I.digest_enabled),JSON.stringify(I.digest_schedule)!==JSON.stringify(we.digest_schedule)&&await Pt("fires","digest_schedule",I.digest_schedule),I.digest_timezone!==we.digest_timezone&&await Pt("fires","digest_timezone",I.digest_timezone),j(JSON.stringify(I))}if(xm){const we=JSON.parse(H);B.min_magnitude!==we.min_magnitude&&await Pt("tomtom_incidents","min_magnitude",B.min_magnitude),B.drop_non_present!==we.drop_non_present&&await Pt("tomtom_incidents","drop_non_present",B.drop_non_present),B.drop_zero_magnitude!==we.drop_zero_magnitude&&await Pt("tomtom_incidents","drop_zero_magnitude",B.drop_zero_magnitude),V(JSON.stringify(B))}if(Jc){const we=JSON.parse(W);z.min_severity!==we.min_severity&&await Pt("itd_511","min_severity",z.min_severity),JSON.stringify(z.enabled_categories)!==JSON.stringify(we.enabled_categories)&&await Pt("itd_511","enabled_categories",z.enabled_categories),JSON.stringify(z.enabled_sub_types)!==JSON.stringify(we.enabled_sub_types)&&await Pt("itd_511","enabled_sub_types",z.enabled_sub_types),Z(JSON.stringify(z))}if(Id){const we=JSON.parse(J);X.broadcast!==we.broadcast&&await Pt("wzdx","broadcast",X.broadcast),X.min_severity!==we.min_severity&&await Pt("wzdx","min_severity",X.min_severity),JSON.stringify(X.sub_types)!==JSON.stringify(we.sub_types)&&await Pt("wzdx","sub_types",X.sub_types),oe(JSON.stringify(X))}if(Nd){const we=JSON.parse(be);JSON.stringify(le.broadcast_severities)!==JSON.stringify(we.broadcast_severities)&&await Pt("nws","broadcast_severities",le.broadcast_severities),le.duplicate_allowed_after_seconds!==we.duplicate_allowed_after_seconds&&await Pt("nws","duplicate_allowed_after_seconds",le.duplicate_allowed_after_seconds),ve(JSON.stringify(le))}if(bm){const we=JSON.parse(ke);Ne.min_danger_level!==we.min_danger_level&&await Pt("avalanche","min_danger_level",Ne.min_danger_level),ct(JSON.stringify(Ne))}if(Pd){const we=JSON.parse(ht);Fe.geomag_kp_floor!==we.geomag_kp_floor&&await Pt("swpc","geomag_kp_floor",Fe.geomag_kp_floor),Fe.flare_class_floor!==we.flare_class_floor&&await Pt("swpc","flare_class_floor",Fe.flare_class_floor),Fe.proton_pfu_floor!==we.proton_pfu_floor&&await Pt("swpc","proton_pfu_floor",Fe.proton_pfu_floor),jt(JSON.stringify(Fe))}if(Dd){const we=JSON.parse(On);JSON.stringify(bt.observers)!==JSON.stringify(we.observers)&&await Pt("satpass","observers",bt.observers),bt.min_elevation!==we.min_elevation&&await Pt("satpass","min_elevation",bt.min_elevation),JSON.stringify(bt.norad_ids)!==JSON.stringify(we.norad_ids)&&await Pt("satpass","norad_ids",bt.norad_ids),Qn(JSON.stringify(bt))}m("Config saved"),setTimeout(()=>m(null),3e3)}catch(we){d(we instanceof Error?we.message:"Save failed")}finally{h(!1)}}},wm=()=>{e&&t(JSON.parse(r)),A(JSON.parse(N||JSON.stringify(M))),D(JSON.parse(O||JSON.stringify(I))),U(JSON.parse(H||JSON.stringify(B))),$(JSON.parse(W||JSON.stringify(z))),re(JSON.parse(J||JSON.stringify(X))),De(JSON.parse(be||JSON.stringify(le))),_e(JSON.parse(ke||JSON.stringify(Ne))),tt(JSON.parse(ht||JSON.stringify(Fe))),ar(JSON.parse(On||JSON.stringify(bt)))},Kb=async()=>{try{await fetch("/api/restart",{method:"POST"}),_(!1),m("Restart initiated")}catch{d("Restart failed")}},Ve=we=>e&&t({...e,...we});if(l)return v.jsx("div",{className:"flex items-center justify-center h-64 text-[#777]",children:"Loading environmental config…"});if(!e)return v.jsx("div",{className:"flex items-center justify-center h-64 text-red-400",children:f||"No config"});const Jb=we=>i==null?void 0:i.feeds.find(Jt=>Jt.source===Es[we].health),Qb=we=>o.filter(Jt=>Jt.source===Es[we].health),Co=ET.find(we=>we.key===x),$r=Co.adapters.length===0?null:S&&Co.adapters.includes(S)?S:Co.adapters[0],Sm=we=>{var Jt,wn,mi,Ji,Fl;switch(we){case"nws":return v.jsxs(v.Fragment,{children:[v.jsx(zo,{label:"NWS Zones",value:e.nws_zones,onChange:te=>Ve({nws_zones:te}),helper:"Zone IDs like IDZ016, IDZ030",infoLink:"https://www.weather.gov/pimar/PubZone"}),e.nws.feed_source!=="central"&&v.jsxs(v.Fragment,{children:[v.jsx(vt,{label:"User Agent",value:e.nws.user_agent,onChange:te=>Ve({nws:{...e.nws,user_agent:te}}),placeholder:"(MeshAI, you@email.com)",helper:"Format: (app_name, contact_email)"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ue,{label:"Tick Seconds",value:e.nws.tick_seconds,onChange:te=>Ve({nws:{...e.nws,tick_seconds:te}}),min:30}),v.jsx(Fn,{label:"Min Severity",value:e.nws.severity_min,onChange:te=>Ve({nws:{...e.nws,severity_min:te}}),options:[{value:"minor",label:"Minor"},{value:"moderate",label:"Moderate"},{value:"severe",label:"Severe"},{value:"extreme",label:"Extreme"}]})]})]}),e.nws.feed_source==="central"&&v.jsxs("div",{className:"border-t border-border pt-4 mt-4",children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Broadcast Filters"}),v.jsxs("div",{className:"mb-3",children:[v.jsx("div",{className:"text-xs font-sans text-[#777] mb-2",children:"Severities to broadcast"}),v.jsx("div",{className:"flex gap-6",children:["Extreme","Severe","Moderate","Minor"].map(te=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:le.broadcast_severities.includes(te),onChange:st=>{const xe=le.broadcast_severities;De({...le,broadcast_severities:st.target.checked?[...xe,te]:xe.filter(ft=>ft!==te)})},className:"w-4 h-4 accent-[#f59e0b]"}),v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:te})]},te))})]}),v.jsx(Ue,{label:"Re-broadcast Cooldown (seconds)",value:le.duplicate_allowed_after_seconds,onChange:te=>De({...le,duplicate_allowed_after_seconds:te}),min:0,helper:"Minimum seconds before the same alert ID can be re-broadcast"})]})]});case"swpc":return v.jsx("div",{className:"space-y-6",children:v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Broadcast Thresholds"}),v.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[v.jsx(Fn,{label:"Geomag Kp Floor",value:String(Fe.geomag_kp_floor),onChange:te=>tt({...Fe,geomag_kp_floor:Number(te)}),options:[{value:"5",label:"5 — G1 Minor"},{value:"6",label:"6 — G2 Moderate"},{value:"7",label:"7 — G3 Strong"},{value:"8",label:"8 — G4 Severe"},{value:"9",label:"9 — G5 Extreme"}],helper:"Kp at or above this triggers geomag broadcast"}),v.jsx(Fn,{label:"Flare Class Floor",value:Fe.flare_class_floor,onChange:te=>tt({...Fe,flare_class_floor:te}),options:[{value:"M1",label:"M1 — R1 Minor"},{value:"M5",label:"M5 — R2 Moderate"},{value:"X1",label:"X1 — R3 Strong"},{value:"X10",label:"X10 — R4 Severe"}],helper:"X-ray flare class floor for broadcast"}),v.jsx(Fn,{label:"Proton pfu Floor",value:String(Fe.proton_pfu_floor),onChange:te=>tt({...Fe,proton_pfu_floor:Number(te)}),options:[{value:"10",label:"10 — S1 Minor"},{value:"100",label:"100 — S2 Moderate"},{value:"1000",label:"1000 — S3 Strong"},{value:"10000",label:"10000 — S4 Severe"}],helper:"Proton flux (pfu) at ≥10 MeV for broadcast"})]})]})});case"ducting":return v.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[v.jsx(Ue,{label:"Tick Seconds",value:e.ducting.tick_seconds,onChange:te=>Ve({ducting:{...e.ducting,tick_seconds:te}}),min:60}),v.jsx(Ue,{label:"Latitude",value:e.ducting.latitude,onChange:te=>Ve({ducting:{...e.ducting,latitude:te}}),step:.01}),v.jsx(Ue,{label:"Longitude",value:e.ducting.longitude,onChange:te=>Ve({ducting:{...e.ducting,longitude:te}}),step:.01})]});case"fires":return v.jsxs("div",{className:"space-y-6",children:[e.fires.feed_source!=="central"&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ue,{label:"Tick Seconds",value:e.fires.tick_seconds,onChange:te=>Ve({fires:{...e.fires,tick_seconds:te}}),min:60}),v.jsx(Fn,{label:"State",value:e.fires.state,onChange:te=>Ve({fires:{...e.fires,state:te}}),options:hSe})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Incident Types"}),v.jsx("div",{className:"flex gap-6",children:[["WF","Wildfire"],["RX","Prescribed Burn"],["OTHER","Other"]].map(([te,st])=>{var xe;return v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:((xe=M.allowed_incident_types)==null?void 0:xe.includes(te))??te==="WF",onChange:ft=>{const or=M.allowed_incident_types??["WF"];A({...M,allowed_incident_types:ft.target.checked?[...or,te]:or.filter(Ca=>Ca!==te)})},className:"w-4 h-4 accent-[#f59e0b]"}),v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:st})]},te)})})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Broadcast Triggers"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:"Broadcast on acres increase"}),v.jsx("input",{type:"checkbox",checked:M.broadcast_on_acres,onChange:te=>A({...M,broadcast_on_acres:te.target.checked}),className:"w-4 h-4 accent-[#f59e0b]"})]}),v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:"Broadcast on containment increase"}),v.jsx("input",{type:"checkbox",checked:M.broadcast_on_contained,onChange:te=>A({...M,broadcast_on_contained:te.target.checked}),className:"w-4 h-4 accent-[#f59e0b]"})]})]})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ue,{label:"Update Cooldown (hours)",value:Math.round(M.cooldown_seconds/3600),onChange:te=>A({...M,cooldown_seconds:te*3600}),min:0,helper:"Minimum hours between updates for the same fire"}),v.jsx(Ue,{label:"Freshness Window (hours)",value:Math.round(M.freshness_seconds/3600),onChange:te=>A({...M,freshness_seconds:te*3600}),min:0,helper:"0 = always broadcast regardless of event age"})]})]});case"avalanche":return v.jsxs("div",{className:"space-y-6",children:[e.avalanche.feed_source!=="central"&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ue,{label:"Tick Seconds",value:e.avalanche.tick_seconds,onChange:te=>Ve({avalanche:{...e.avalanche,tick_seconds:te}}),min:60}),v.jsx(dSe,{label:"Season Months",value:e.avalanche.season_months,onChange:te=>Ve({avalanche:{...e.avalanche,season_months:te}}),helper:"e.g., 12, 1, 2, 3, 4"})]}),v.jsx(zo,{label:"Center IDs",value:e.avalanche.center_ids,onChange:te=>Ve({avalanche:{...e.avalanche,center_ids:te}}),helper:"e.g., SNFAC",infoLink:"https://avalanche.org/avalanche-centers/"}),v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Broadcast Settings"}),v.jsx("div",{className:"grid grid-cols-2 gap-4",children:v.jsx(Fn,{label:"Min Danger Level",value:String(Ne.min_danger_level),onChange:te=>_e({...Ne,min_danger_level:Number(te)}),options:[{value:"3",label:"3 — Considerable"},{value:"4",label:"4 — High"},{value:"5",label:"5 — Extreme"}],helper:"Minimum avalanche danger level to broadcast"})})]})]});case"usgs":return v.jsxs(v.Fragment,{children:[v.jsx(Ue,{label:"Tick Seconds",value:e.usgs.tick_seconds,onChange:te=>Ve({usgs:{...e.usgs,tick_seconds:te}}),min:900,helper:"Minimum 15 min (900s). tick_seconds is the native-mode poll interval; ignored when this adapter is set to feed_source=central."}),v.jsx(zo,{label:"Site IDs",value:e.usgs.sites,onChange:te=>Ve({usgs:{...e.usgs,sites:te}}),helper:"USGS gauge site numbers",infoLink:"https://waterdata.usgs.gov/nwis"})]});case"usgs_quake":return v.jsxs("div",{className:"space-y-6",children:[e.usgs_quake.feed_source!=="central"&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ue,{label:"Tick Seconds",value:e.usgs_quake.tick_seconds,onChange:te=>Ve({usgs_quake:{...e.usgs_quake,tick_seconds:te}}),min:60}),v.jsx(vt,{label:"Region Tag",value:e.usgs_quake.region,onChange:te=>Ve({usgs_quake:{...e.usgs_quake,region:te}})})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Magnitude Thresholds"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ue,{label:"Global Floor",value:e.usgs_quake.global_mag_floor,onChange:te=>Ve({usgs_quake:{...e.usgs_quake,global_mag_floor:te}}),step:.1,min:0,helper:"Broadcast anywhere at or above this magnitude"}),v.jsx(Ue,{label:"Regional Floor",value:e.usgs_quake.regional_mag_floor,onChange:te=>Ve({usgs_quake:{...e.usgs_quake,regional_mag_floor:te}}),step:.1,min:0,helper:"Reduced floor within regional radius"}),v.jsx(Ue,{label:"Regional Radius (mi)",value:e.usgs_quake.regional_radius_mi,onChange:te=>Ve({usgs_quake:{...e.usgs_quake,regional_radius_mi:te}}),min:50,helper:"Radius around region centroid for reduced floor"}),v.jsx(Ue,{label:"Escalation Floor",value:e.usgs_quake.escalate_mag_floor,onChange:te=>Ve({usgs_quake:{...e.usgs_quake,escalate_mag_floor:te}}),step:.1,min:0,helper:"Magnitude at which broadcast uses warning emoji"})]})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"PAGER Alert Levels"}),v.jsx("div",{className:"text-xs text-[#666] mb-2",children:"Broadcast at any magnitude when USGS PAGER alert reaches these levels"}),v.jsx("div",{className:"flex gap-6",children:["green","yellow","orange","red"].map(te=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:(e.usgs_quake.broadcast_pager_alerts??[]).includes(te),onChange:st=>{const xe=e.usgs_quake.broadcast_pager_alerts??[];Ve({usgs_quake:{...e.usgs_quake,broadcast_pager_alerts:st.target.checked?[...xe,te]:xe.filter(ft=>ft!==te)}})},className:"w-4 h-4 accent-[#f59e0b]"}),v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0] capitalize",children:te})]},te))})]})]});case"traffic":return v.jsxs(v.Fragment,{children:[v.jsx(vt,{label:"API Key",value:e.traffic.api_key,onChange:te=>Ve({traffic:{...e.traffic,api_key:te}}),type:"password",helper:"developer.tomtom.com"}),v.jsx(Ue,{label:"Tick Seconds",value:e.traffic.tick_seconds,onChange:te=>Ve({traffic:{...e.traffic,tick_seconds:te}}),min:60}),v.jsx("div",{className:"text-xs text-[#666] mt-2",children:"Corridors:"}),(e.traffic.corridors||[]).map((te,st)=>v.jsxs("div",{className:"grid grid-cols-4 gap-2 items-end",children:[v.jsx(vt,{label:"Name",value:te.name,onChange:xe=>{const ft=[...e.traffic.corridors];ft[st]={...te,name:xe},Ve({traffic:{...e.traffic,corridors:ft}})}}),v.jsx(Ue,{label:"Lat",value:te.lat,onChange:xe=>{const ft=[...e.traffic.corridors];ft[st]={...te,lat:xe},Ve({traffic:{...e.traffic,corridors:ft}})},step:.01}),v.jsx(Ue,{label:"Lon",value:te.lon,onChange:xe=>{const ft=[...e.traffic.corridors];ft[st]={...te,lon:xe},Ve({traffic:{...e.traffic,corridors:ft}})},step:.01}),v.jsx("button",{onClick:()=>Ve({traffic:{...e.traffic,corridors:e.traffic.corridors.filter((xe,ft)=>ft!==st)}}),className:"px-2 py-2 text-xs text-red-400 hover:text-red-300 border border-red-400/30",children:"Remove"})]},st)),v.jsx("button",{onClick:()=>Ve({traffic:{...e.traffic,corridors:[...e.traffic.corridors||[],{name:"",lat:0,lon:0}]}}),className:"text-xs text-accent hover:underline",children:"+ Add Corridor"}),v.jsxs("div",{className:"border-t border-border pt-4 mt-4",children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Broadcast Filters"}),v.jsx("div",{className:"grid grid-cols-2 gap-4",children:v.jsxs("div",{children:[v.jsx("label",{className:"text-xs font-sans text-[#777] mb-1 block",children:"Minimum Magnitude"}),v.jsxs("select",{value:B.min_magnitude,onChange:te=>U({...B,min_magnitude:parseInt(te.target.value)}),className:"w-full bg-[#0d0d0d] border border-border px-3 py-2 text-sm",children:[v.jsx("option",{value:1,children:"1 — Minor (all)"}),v.jsx("option",{value:2,children:"2 — Moderate (yellow+)"}),v.jsx("option",{value:3,children:"3 — Major (orange+)"}),v.jsx("option",{value:4,children:"4 — Severe (red only)"})]}),v.jsx("p",{className:"text-xs text-[#666] mt-1",children:"Drop TomTom incidents below this severity level"})]})}),v.jsxs("div",{className:"mt-3 space-y-2",children:[v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:"Drop non-present time validity"}),v.jsx("input",{type:"checkbox",checked:B.drop_non_present,onChange:te=>U({...B,drop_non_present:te.target.checked}),className:"w-4 h-4 accent-[#f59e0b]"})]}),v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:"Drop zero-magnitude events"}),v.jsx("input",{type:"checkbox",checked:B.drop_zero_magnitude,onChange:te=>U({...B,drop_zero_magnitude:te.target.checked}),className:"w-4 h-4 accent-[#f59e0b]"})]})]})]})]});case"roads511":return v.jsxs(v.Fragment,{children:[v.jsx(vt,{label:"Base URL",value:e.roads511.base_url,onChange:te=>Ve({roads511:{...e.roads511,base_url:te}}),placeholder:"https://511.yourstate.gov/api/v2"}),v.jsx(vt,{label:"API Key",value:e.roads511.api_key,onChange:te=>Ve({roads511:{...e.roads511,api_key:te}}),type:"password",helper:"Leave empty if not required"}),v.jsx(Ue,{label:"Tick Seconds",value:e.roads511.tick_seconds,onChange:te=>Ve({roads511:{...e.roads511,tick_seconds:te}}),min:60}),v.jsx(zo,{label:"Endpoints",value:e.roads511.endpoints,onChange:te=>Ve({roads511:{...e.roads511,endpoints:te}}),helper:"e.g., /get/event"}),v.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((te,st)=>{var xe;return v.jsx(Ue,{label:te,value:((xe=e.roads511.bbox)==null?void 0:xe[st])??0,onChange:ft=>{const or=[...e.roads511.bbox||[0,0,0,0]];or[st]=ft,Ve({roads511:{...e.roads511,bbox:or}})},step:.01},te)})}),v.jsxs("div",{className:"border-t border-border pt-4 mt-4",children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Broadcast Filters"}),v.jsx("div",{className:"grid grid-cols-2 gap-4",children:v.jsxs("div",{children:[v.jsx("label",{className:"text-xs font-sans text-[#777] mb-1 block",children:"Minimum Severity"}),v.jsxs("select",{value:z.min_severity,onChange:te=>$({...z,min_severity:te.target.value}),className:"w-full bg-[#0d0d0d] border border-border px-3 py-2 text-sm",children:[v.jsx("option",{value:"None",children:"None (all)"}),v.jsx("option",{value:"Minor",children:"Minor+"}),v.jsx("option",{value:"Major",children:"Major only"})]}),v.jsx("p",{className:"text-xs text-[#666] mt-1",children:"Drop ITD 511 events below this severity"})]})}),v.jsxs("div",{className:"mt-4",children:[v.jsx("div",{className:"text-xs font-sans text-[#777] mb-2",children:"Categories"}),v.jsx("div",{className:"flex gap-6",children:[["incident","Incident"],["closure","Closure"],["special_event","Special Event"]].map(([te,st])=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:z.enabled_categories.includes(te),onChange:xe=>{const ft=z.enabled_categories;$({...z,enabled_categories:xe.target.checked?[...ft,te]:ft.filter(or=>or!==te)})},className:"w-4 h-4 accent-[#f59e0b]"}),v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:st})]},te))})]}),v.jsxs("div",{className:"mt-4",children:[v.jsx("div",{className:"text-xs font-sans text-[#777] mb-2",children:"Sub-types"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:[["accident","Crash"],["road_closed","Road Closed"],["lane_closed","Lane Closure"],["vehicle_on_fire","Vehicle Fire"],["flooding","Flooding"],["debris","Debris"],["road_works","Road Works"],["disabled_vehicle","Disabled Vehicle"]].map(([te,st])=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:z.enabled_sub_types.includes(te),onChange:xe=>{const ft=z.enabled_sub_types;$({...z,enabled_sub_types:xe.target.checked?[...ft,te]:ft.filter(or=>or!==te)})},className:"w-4 h-4 accent-[#f59e0b]"}),v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:st})]},te))})]})]})]});case"wzdx":return v.jsxs(v.Fragment,{children:[((Jt=e.wzdx)==null?void 0:Jt.feed_source)!=="central"&&v.jsxs(v.Fragment,{children:[v.jsx(vt,{label:"Base URL",value:((wn=e.wzdx)==null?void 0:wn.base_url)??"",onChange:te=>Ve({wzdx:{...e.wzdx,base_url:te}}),placeholder:"https://511.yourstate.gov/api/v2"}),v.jsx(vt,{label:"API Key",value:((mi=e.wzdx)==null?void 0:mi.api_key)??"",onChange:te=>Ve({wzdx:{...e.wzdx,api_key:te}}),type:"password",helper:"Leave empty if not required"}),v.jsx(Ue,{label:"Tick Seconds",value:((Ji=e.wzdx)==null?void 0:Ji.tick_seconds)??300,onChange:te=>Ve({wzdx:{...e.wzdx,tick_seconds:te}}),min:60}),v.jsx(zo,{label:"Endpoints",value:((Fl=e.wzdx)==null?void 0:Fl.endpoints)??["/get/event"],onChange:te=>Ve({wzdx:{...e.wzdx,endpoints:te}}),helper:"e.g., /get/event"}),v.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((te,st)=>{var xe,ft;return v.jsx(Ue,{label:te,value:((ft=(xe=e.wzdx)==null?void 0:xe.bbox)==null?void 0:ft[st])??0,onChange:or=>{var ws;const Ca=[...((ws=e.wzdx)==null?void 0:ws.bbox)||[0,0,0,0]];Ca[st]=or,Ve({wzdx:{...e.wzdx,bbox:Ca}})},step:.01},te)})}),v.jsx("div",{className:"text-xs text-[#666]",children:"Bounding box [W,S,E,N] geographic filter"})]}),v.jsxs("div",{className:"border-t border-border pt-4 mt-4",children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Broadcast Settings"}),v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:"Broadcast work zone events"}),v.jsx("input",{type:"checkbox",checked:X.broadcast,onChange:te=>re({...X,broadcast:te.target.checked}),className:"w-4 h-4 accent-[#f59e0b]"})]}),X.broadcast?v.jsxs("div",{className:"space-y-3 mt-3",children:[v.jsxs("div",{children:[v.jsx("label",{className:"text-xs font-sans text-[#777] mb-1 block",children:"Min Severity"}),v.jsxs("select",{value:X.min_severity,onChange:te=>re({...X,min_severity:te.target.value}),className:"w-full bg-[#0d0d0d] border border-border px-3 py-2 text-sm",children:[v.jsx("option",{value:"None",children:"None (all)"}),v.jsx("option",{value:"Minor",children:"Minor+"}),v.jsx("option",{value:"Major",children:"Major only"})]})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs font-sans text-[#777] mb-2",children:"Sub-types"}),v.jsx("div",{className:"flex gap-6",children:[["road_works","Road Works"],["lane_closed","Lane Closure"],["road_closed","Road Closed"]].map(([te,st])=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:X.sub_types.includes(te),onChange:xe=>{const ft=X.sub_types;re({...X,sub_types:xe.target.checked?[...ft,te]:ft.filter(or=>or!==te)})},className:"w-4 h-4 accent-[#f59e0b]"}),v.jsx("span",{className:"text-sm font-sans text-[#e0e0e0]",children:st})]},te))})]})]}):v.jsxs("p",{className:"text-xs text-[#666] mt-2",children:["Work zone events stored for LLM context only ","—"," no mesh broadcasts."]})]})]});case"firms":return v.jsxs(v.Fragment,{children:[v.jsx(vt,{label:"MAP Key",value:e.firms.map_key,onChange:te=>Ve({firms:{...e.firms,map_key:te}}),type:"password",helper:"firms.modaps.eosdis.nasa.gov/api/area/",infoLink:"https://firms.modaps.eosdis.nasa.gov/api/area/"}),v.jsx(Ue,{label:"Tick Seconds",value:e.firms.tick_seconds,onChange:te=>Ve({firms:{...e.firms,tick_seconds:te}}),min:300}),v.jsx(Fn,{label:"Satellite Source",value:e.firms.source,onChange:te=>Ve({firms:{...e.firms,source:te}}),options:[{value:"VIIRS_SNPP_NRT",label:"VIIRS SNPP (NRT)"},{value:"VIIRS_NOAA20_NRT",label:"VIIRS NOAA-20 (NRT)"},{value:"MODIS_NRT",label:"MODIS (NRT)"}]}),v.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[v.jsx(Ue,{label:"Day Range",value:e.firms.day_range,onChange:te=>Ve({firms:{...e.firms,day_range:te}}),min:1,max:10}),v.jsx(Fn,{label:"Min Confidence",value:e.firms.confidence_min,onChange:te=>Ve({firms:{...e.firms,confidence_min:te}}),options:[{value:"low",label:"Low"},{value:"nominal",label:"Nominal"},{value:"high",label:"High"}]}),v.jsx(Ue,{label:"Proximity (km)",value:e.firms.proximity_km,onChange:te=>Ve({firms:{...e.firms,proximity_km:te}}),step:.5})]}),v.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((te,st)=>{var xe;return v.jsx(Ue,{label:te,value:((xe=e.firms.bbox)==null?void 0:xe[st])??0,onChange:ft=>{const or=[...e.firms.bbox||[0,0,0,0]];or[st]=ft,Ve({firms:{...e.firms,bbox:or}})},step:.01},te)})})]});case"satpass":return v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] font-sans font-medium uppercase tracking-widest text-[#666] mb-3",children:"Pass Filters"}),v.jsx("div",{className:"grid grid-cols-2 gap-4",children:v.jsx(Ue,{label:"Min Elevation (deg)",value:bt.min_elevation,onChange:te=>ar({...bt,min_elevation:te}),min:0,max:90,helper:"Minimum max elevation for a pass to be broadcast"})})]}),v.jsx(zo,{label:"Observer Locations",value:bt.observers,onChange:te=>ar({...bt,observers:te}),helper:"Observer names to include (empty = all)"}),v.jsx(zo,{label:"NORAD IDs",value:bt.norad_ids,onChange:te=>ar({...bt,norad_ids:te}),helper:"NORAD catalog IDs to track (empty = all)"})]})}},Cm=e,Tm=(we,Jt)=>{const wn=e[we]||{};Ve({[we]:{...wn,...Jt}})};return v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("h1",{className:"text-xl font-semibold text-white",children:"Environment"}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(fr,{label:"Feeds Enabled",checked:e.enabled,onChange:we=>Ve({enabled:we})}),qb&&v.jsxs(v.Fragment,{children:[v.jsxs("button",{onClick:wm,className:"flex items-center gap-1 px-3 py-1.5 text-sm text-[#777] hover:text-white border border-border",children:[v.jsx(H1,{size:14})," Discard"]}),v.jsxs("button",{onClick:Ed,disabled:c,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-accent text-white disabled:opacity-50",children:[v.jsx(ek,{size:14})," ",c?"Saving…":"Save"]})]})]})]}),f&&v.jsx("div",{className:"text-sm text-red-400 bg-red-500/10 p-3",children:f}),g&&v.jsx("div",{className:"text-sm text-green-400 bg-green-500/10 p-3",children:g}),y&&v.jsxs("div",{className:"flex items-center justify-between text-sm text-accent bg-accent/10 border border-accent/30 p-3",children:[v.jsxs("span",{className:"flex items-center gap-2",children:[v.jsx(qp,{size:14})," A restart is required for some changes to take effect."]}),v.jsx("button",{onClick:Kb,className:"px-3 py-1 bg-accent/20 hover:bg-amber-500/30",children:"Restart now"})]}),v.jsx("div",{className:"flex gap-1 border-b border-border overflow-x-auto",children:ET.map(({key:we,label:Jt,icon:wn})=>v.jsxs("button",{onClick:()=>{w(we);const mi=ET.find(Ji=>Ji.key===we);T(mi.adapters[0]??null)},className:`flex items-center gap-2 px-4 py-2 text-sm whitespace-nowrap border-b-2 -mb-px transition-colors ${x===we?"border-accent text-accent":"border-transparent text-[#777] hover:text-white"}`,children:[v.jsx(wn,{size:15})," ",Jt]},we))}),x==="central"&&e.central&&v.jsxs("div",{className:"border border-border p-4 space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{children:[v.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:"Central Connection"}),v.jsx("p",{className:"text-xs text-[#666]",children:'NATS JetStream source for any adapter set to "central"'})]}),v.jsx(fr,{label:"",checked:!!e.central.enabled,onChange:we=>Ve({central:{...e.central,enabled:we}})})]}),v.jsxs("div",{className:e.central.enabled?"space-y-3":"space-y-3 opacity-40 pointer-events-none select-none",children:[v.jsx(vt,{label:"URL",value:e.central.url||"",onChange:we=>Ve({central:{...e.central,url:we}}),placeholder:"nats://central.echo6.mesh:4222"}),v.jsx(vt,{label:"Durable",value:e.central.durable||"",onChange:we=>Ve({central:{...e.central,durable:we}}),placeholder:"meshai-v04"}),v.jsx(vt,{label:"Region",value:e.central.region||"",onChange:we=>Ve({central:{...e.central,region:we}}),placeholder:"us.id",helper:"Central v0.9.20 region token (dotted, e.g. 'us.id'). Empty = bare wildcards (all-US firehose). Each adapter is either Central or native, never both — see Reference → OR-not-AND Architecture for why."})]})]}),x==="mesh"&&v.jsxs("div",{className:"border border-border p-4 space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{children:[v.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:"Mesh Health"}),v.jsx("p",{className:"text-xs text-[#666]",children:"Node/infra telemetry — sourced from the mesh, not an environmental feed."})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("span",{className:"text-[10px] uppercase tracking-wide text-[#666]",children:"source"}),v.jsx(GZ,{value:"native",onChange:()=>{},disabled:!1,centralDisabled:!0})]})]}),v.jsx("div",{className:"text-[11px] text-[#666]",children:"Central not available — reserved for a future migration."})]}),Co.adapters.length>0&&$r&&v.jsxs(v.Fragment,{children:[Co.adapters.length>1&&v.jsx("div",{className:"flex gap-1",children:Co.adapters.map(we=>v.jsx("button",{onClick:()=>T(we),className:`px-3 py-1.5 text-sm ${$r===we?"bg-bg-hover text-white":"text-[#777] hover:text-white"}`,children:Es[we].label},we))}),v.jsx(PSe,{title:Es[$r].label,subtitle:Es[$r].subtitle,enabled:((Mm=Cm[$r])==null?void 0:Mm.enabled)??!1,onEnabled:we=>Tm($r,{enabled:we}),feedSource:((Am=Cm[$r])==null?void 0:Am.feed_source)??"native",onFeedSource:we=>Tm($r,{feed_source:we}),hasCentral:Es[$r].hasCentral,nativeOnly:Es[$r].nativeOnly,hasKey:Es[$r].hasKey,health:Jb($r),events:Qb($r),children:Sm($r)})]})]})}const bB={infra_offline:h6,infra_recovery:Z1,battery_warning:Kw,battery_critical:Kw,battery_emergency:Kw,hf_blackout:If,uhf_ducting:Gi,weather_warning:sc,weather_watch:sc,new_router:Gi,packet_flood:oo,sustained_high_util:oo,region_blackout:os,default:Xp};function ESe(e){return bB[e]||bB.default}function HZ(e){switch(e==null?void 0:e.toLowerCase()){case"immediate":return{bg:"bg-red-500/10",border:"border-red-500",badge:"bg-red-500/20 text-red-400",iconColor:"text-red-500"};case"priority":return{bg:"bg-amber-500/10",border:"border-amber-500",badge:"bg-amber-500/20 text-amber-400",iconColor:"text-amber-500"};case"routine":default:return{bg:"bg-[#f59e0b]/10",border:"border-[#f59e0b]",badge:"bg-[#f59e0b]/20 text-[#f59e0b]",iconColor:"text-[#f59e0b]"}}}function RSe(e){const t=typeof e=="number"?new Date(e*1e3):new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/1e3),a=Math.floor(i/60),o=Math.floor(a/60),s=Math.floor(o/24);return i<60?"Just now":a<60?`${a}m ago`:o<24?`${o}h ago`:`${s}d ago`}function jSe(e){return(typeof e=="number"?new Date(e*1e3):new Date(e)).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}function OSe(e){return e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/3600)}h ${Math.floor(e%3600/60)}m`:`${Math.floor(e/86400)}d`}function zSe({alert:e,onAcknowledge:t}){var i;const r=HZ(e.severity),n=ESe(e.type);return v.jsx("div",{className:`p-4 ${r.bg} border-l-4 ${r.border}`,children:v.jsxs("div",{className:"flex items-start gap-3",children:[v.jsx(n,{size:20,className:r.iconColor}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[v.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${r.badge}`,children:(i=e.severity)==null?void 0:i.toUpperCase()}),v.jsx("span",{className:"text-xs text-slate-500",children:e.type})]}),v.jsx("div",{className:"text-sm text-slate-200",children:e.message}),v.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-slate-500",children:[v.jsxs("span",{className:"flex items-center gap-1",children:[v.jsx(oc,{size:12}),e.timestamp?RSe(e.timestamp):"Just now"]}),e.scope_value&&v.jsxs("span",{children:[e.scope_type,": ",e.scope_value]})]})]}),v.jsx("button",{onClick:()=>t(e),className:"px-3 py-1 text-xs text-slate-400 hover:text-slate-200 border border-border rounded hover:bg-bg-hover transition-colors",children:"Acknowledge"})]})})}function BSe({history:e,typeFilter:t,severityFilter:r,onTypeFilterChange:n,onSeverityFilterChange:i,page:a,totalPages:o,onPageChange:s}){const l=["all","infra_offline","infra_recovery","battery_warning","battery_critical","hf_blackout","uhf_ducting","weather_warning","new_router","packet_flood"],u=["all","immediate","priority","routine"];return v.jsxs("div",{className:"bg-bg-card border border-border",children:[v.jsxs("div",{className:"p-4 border-b border-border flex items-center gap-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(JL,{size:14,className:"text-slate-400"}),v.jsx("span",{className:"text-sm text-slate-400",children:"Filter:"})]}),v.jsx("select",{value:t,onChange:c=>n(c.target.value),className:"bg-bg border border-border rounded px-3 py-1.5 text-sm text-slate-200 focus:outline-none focus:border-[#f59e0b]",children:l.map(c=>v.jsx("option",{value:c,children:c==="all"?"All Types":c.replace(/_/g," ")},c))}),v.jsx("select",{value:r,onChange:c=>i(c.target.value),className:"bg-bg border border-border rounded px-3 py-1.5 text-sm text-slate-200 focus:outline-none focus:border-[#f59e0b]",children:u.map(c=>v.jsx("option",{value:c,children:c==="all"?"All Severities":c.charAt(0).toUpperCase()+c.slice(1)},c))})]}),v.jsx("div",{className:"overflow-x-auto",children:v.jsxs("table",{className:"w-full",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"border-b border-border",children:[v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Time"}),v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Type"}),v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Severity"}),v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Message"}),v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Duration"})]})}),v.jsx("tbody",{children:e.length>0?e.map((c,h)=>{const f=HZ(c.severity);return v.jsxs("tr",{className:"border-b border-border hover:bg-bg-hover",children:[v.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono whitespace-nowrap",children:jSe(c.timestamp)}),v.jsx("td",{className:"p-4 text-sm text-slate-300",children:c.type.replace(/_/g," ")}),v.jsx("td",{className:"p-4",children:v.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${f.badge}`,children:c.severity})}),v.jsx("td",{className:"p-4 text-sm text-slate-200 max-w-md truncate",children:c.message}),v.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono",children:c.duration?OSe(c.duration):"-"})]},c.id||h)}):v.jsx("tr",{children:v.jsx("td",{colSpan:5,className:"p-8 text-center text-slate-500",children:"No alert history available"})})})]})}),o>1&&v.jsxs("div",{className:"p-4 border-t border-border flex items-center justify-between",children:[v.jsxs("span",{className:"text-sm text-slate-400",children:["Page ",a," of ",o]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("button",{onClick:()=>s(a-1),disabled:a<=1,className:"p-2 text-slate-400 hover:text-slate-200 disabled:opacity-50 disabled:cursor-not-allowed",children:v.jsx(TK,{size:16})}),v.jsx("button",{onClick:()=>s(a+1),disabled:a>=o,className:"p-2 text-slate-400 hover:text-slate-200 disabled:opacity-50 disabled:cursor-not-allowed",children:v.jsx(wl,{size:16})})]})]})]})}function FSe({subscription:e,nodes:t}){const r=o=>{const s=t.find(l=>l.node_id_hex===o||String(l.node_num)===o||l.short_name===o);return s?s.long_name&&s.long_name!==s.short_name?`${s.short_name} (${s.long_name})`:s.short_name:o},n=()=>{if(e.sub_type==="alerts")return"Real-time";const o=e.schedule_time||"0000",s=parseInt(o.slice(0,2)),l=o.slice(2),u=s>=12?"PM":"AM";let h=`${s%12||12}:${l} ${u}`;return e.sub_type==="weekly"&&e.schedule_day&&(h+=` ${e.schedule_day.charAt(0).toUpperCase()}${e.schedule_day.slice(1)}`),h},a=(()=>{switch(e.sub_type){case"alerts":return Xp;case"daily":return oc;case"weekly":return oc;default:return Xp}})();return v.jsx("div",{className:"p-4 bg-bg-hover border border-border",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"w-10 h-10 bg-[#f59e0b]/10 flex items-center justify-center",children:v.jsx(a,{size:18,className:"text-[#f59e0b]"})}),v.jsxs("div",{className:"flex-1",children:[v.jsxs("div",{className:"text-sm text-slate-200 font-medium",children:[e.sub_type.charAt(0).toUpperCase()+e.sub_type.slice(1),e.scope_type!=="mesh"&&e.scope_value&&v.jsxs("span",{className:"text-slate-400 font-normal ml-2",children:["(",e.scope_type,": ",e.scope_value,")"]})]}),v.jsxs("div",{className:"text-xs text-slate-500 mt-0.5",children:[n()," • ",r(e.user_id)]})]}),v.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`})]})})}function VSe(){const[e,t]=G.useState([]),[r,n]=G.useState([]),[i,a]=G.useState([]),[o,s]=G.useState([]),[l,u]=G.useState(!0),[c,h]=G.useState(null),[f,d]=G.useState("all"),[g,m]=G.useState("all"),[y,_]=G.useState(1),[x,w]=G.useState(1),S=20,[T,M]=G.useState(new Set),{lastAlert:A}=rk();G.useEffect(()=>{document.title="Alerts — MeshAI"},[]),G.useEffect(()=>{Promise.all([f6().catch(()=>[]),mE(S,0).catch(()=>({items:[],total:0})),HK().catch(()=>[]),fetch("/api/nodes").then(I=>I.json()).catch(()=>[])]).then(([I,D,O,j])=>{t(I),Array.isArray(D)?(n(D),w(1)):(n(D.items||[]),w(Math.ceil((D.total||0)/S))),a(O),s(j),u(!1)}).catch(I=>{h(I.message),u(!1)})},[]),G.useEffect(()=>{A&&t(I=>I.some(O=>O.type===A.type&&O.message===A.message)?I:[A,...I])},[A]),G.useEffect(()=>{const I=(y-1)*S;mE(S,I,f,g).then(D=>{Array.isArray(D)?(n(D),w(1)):(n(D.items||[]),w(Math.ceil((D.total||0)/S)))}).catch(()=>{})},[y,f,g]);const N=G.useCallback(I=>{const D=`${I.type}-${I.message}-${I.timestamp}`;M(O=>new Set([...O,D]))},[]),P=e.filter(I=>{const D=`${I.type}-${I.message}-${I.timestamp}`;return!T.has(D)});return l?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading alerts..."})}):c?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsxs("div",{className:"text-red-400",children:["Error: ",c]})}):v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"bg-bg-card border border-border p-6",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[v.jsx(oo,{size:14}),"Active Alerts (",P.length,")"]}),P.length>0?v.jsx("div",{className:"space-y-3",children:P.map((I,D)=>v.jsx(zSe,{alert:I,onAcknowledge:N},`${I.type}-${I.timestamp}-${D}`))}):v.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-8",children:[v.jsx(qL,{size:20,className:"text-green-500"}),v.jsx("span",{children:"No active alerts — all systems nominal"})]})]}),v.jsxs("div",{children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[v.jsx(oc,{size:14}),"Alert History"]}),v.jsx(BSe,{history:r,typeFilter:f,severityFilter:g,onTypeFilterChange:I=>{d(I),_(1)},onSeverityFilterChange:I=>{m(I),_(1)},page:y,totalPages:x,onPageChange:_})]}),v.jsxs("div",{className:"bg-bg-card border border-border p-6",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[v.jsx(zK,{size:14}),"Mesh Subscriptions (",i.length,")"]}),i.length>0?v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:i.map(I=>v.jsx(FSe,{subscription:I,nodes:o},I.id))}):v.jsxs("div",{className:"text-slate-500 py-4",children:[v.jsx("p",{children:"No active subscriptions."}),v.jsxs("p",{className:"text-xs mt-2",children:["Manage subscriptions via ",v.jsx("code",{className:"text-[#f59e0b]",children:"!subscribe"})," on mesh. Broadcasts arrive with one of three prefixes — ",v.jsx("strong",{children:"New:"})," (first sight), ",v.jsx("strong",{children:"Update:"})," (material change), or ",v.jsx("strong",{children:"Active:"})," (clock-driven reminder while the event is still live). See ",v.jsx("a",{href:"/reference#broadcast-types",className:"text-[#f59e0b] hover:underline",children:"Broadcast Types"})," and ",v.jsx("a",{href:"/reference#reminders",className:"text-[#f59e0b] hover:underline",children:"Reminder System"})," in Reference."]})]})]})]})}const w_=[{value:"routine",label:"Routine",description:"Informational, no time pressure (ducting, new node, weather advisory, battery declining)"},{value:"priority",label:"Priority",description:"Needs attention soon (severe weather, fire nearby, node offline, HF blackout)"},{value:"immediate",label:"Immediate",description:"Act now, drop everything (fire at infrastructure, extreme weather, region blackout)"}],wB=[{id:"mesh_health",name:"Mesh Health Monitoring",description:"Infrastructure problems - offline nodes, low battery, channel congestion",rule:{name:"Mesh Health Monitoring",enabled:!0,trigger_type:"condition",categories:["infra_offline","critical_node_down","infra_recovery","battery_warning","battery_critical","battery_emergency","high_utilization","packet_flood","mesh_score_low"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:30,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"weather_fire",name:"Weather & Fire Alerts",description:"Environmental threats - severe weather, nearby wildfires, new ignitions, flooding",rule:{name:"Weather & Fire Alerts",enabled:!0,trigger_type:"condition",categories:["weather_warning","fire_proximity","new_ignition","stream_flood_warning"],min_severity:"priority",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:15,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"rf_conditions",name:"RF Conditions",description:"Propagation changes - solar events, HF blackouts, tropospheric ducting",rule:{name:"RF Conditions",enabled:!0,trigger_type:"condition",categories:["hf_blackout","tropospheric_ducting","geomagnetic_storm"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:60,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"road_traffic",name:"Road & Traffic",description:"Road closures and severe congestion",rule:{name:"Road & Traffic",enabled:!0,trigger_type:"condition",categories:["road_closure","traffic_congestion"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:30,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"everything_critical",name:"Everything Critical",description:"All emergency-level events regardless of type",rule:{name:"Everything Critical",enabled:!0,trigger_type:"condition",categories:[],min_severity:"immediate",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:5,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"morning_briefing",name:"Morning Briefing",description:"Daily health and conditions summary at 7am",rule:{name:"Morning Briefing",enabled:!0,trigger_type:"schedule",categories:[],min_severity:"routine",schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"mesh_health_summary",custom_message:"",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:0,node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}}];function j0(e){if(!e)return"Never";const r=Date.now()/1e3-e;return r<60?"Just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:r<604800?`${Math.floor(r/86400)}d ago`:new Date(e*1e3).toLocaleDateString()}function Ri({info:e}){const[t,r]=G.useState(!1);return v.jsxs("div",{className:"relative inline-block",children:[v.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),r(!t)},className:"ml-1.5 w-4 h-4 rounded-full bg-slate-700 hover:bg-slate-600 text-slate-400 hover:text-slate-200 inline-flex items-center justify-center text-xs transition-colors",title:"More info",children:"?"}),t&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>r(!1)}),v.jsx("div",{className:"absolute left-0 top-6 z-50 w-72 p-3 bg-[#1a2332] border border-[#2a3a4a] shadow-xl text-xs text-slate-300 leading-relaxed",children:e})]})]})}function Gs({label:e,value:t,onChange:r,type:n="text",placeholder:i="",helper:a="",info:o=""}){const[s,l]=G.useState(!1),u=n==="password";return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&v.jsx(Ri,{info:o})]}),v.jsxs("div",{className:"relative",children:[v.jsx("input",{type:u&&!s?"password":"text",value:t,onChange:c=>r(c.target.value),placeholder:i,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"}),u&&v.jsx("button",{type:"button",onClick:()=>l(!s),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-300",children:s?v.jsx(i6,{size:16}):v.jsx(KL,{size:16})})]}),a&&v.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function Fg({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&v.jsx(Ri,{info:s})]}),v.jsx("input",{type:"number",value:t,onChange:l=>r(Number(l.target.value)),min:n,max:i,step:a,className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent"}),o&&v.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function x1({label:e,checked:t,onChange:r,helper:n="",info:i=""}){return v.jsxs("div",{className:"flex items-center justify-between py-2",children:[v.jsxs("div",{children:[v.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&v.jsx(Ri,{info:i})]}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]}),v.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:v.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function kp({label:e,value:t,onChange:r,helper:n="",info:i=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&v.jsx(Ri,{info:i})]}),v.jsx("input",{type:"time",value:t,onChange:a=>r(a.target.value),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent"}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function S_({label:e,value:t,onChange:r,placeholder:n="Add item...",helper:i="",info:a=""}){const[o,s]=G.useState(""),l=()=>{o.trim()&&!t.includes(o.trim())&&(r([...t,o.trim()]),s(""))},u=c=>{r(t.filter((h,f)=>f!==c))};return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&v.jsx(Ri,{info:a})]}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx("input",{type:"text",value:o,onChange:c=>s(c.target.value),onKeyDown:c=>c.key==="Enter"&&(c.preventDefault(),l()),className:"flex-1 px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent",placeholder:n}),v.jsx("button",{type:"button",onClick:l,className:"px-3 py-2 bg-accent hover:bg-accent/80 rounded text-sm text-white transition-colors",children:v.jsx(id,{size:16})})]}),t.length>0&&v.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:t.map((c,h)=>v.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-[#1e2a3a] rounded text-sm text-slate-300",children:[c,v.jsx("button",{type:"button",onClick:()=>u(h),className:"text-slate-500 hover:text-red-400",children:v.jsx(ya,{size:14})})]},h))}),i&&v.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function UZ({value:e,onChange:t}){const[r,n]=G.useState(!1),i=w_.find(a=>a.value===e)||w_[0];return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Severity Threshold",v.jsx(Ri,{info:"Only alerts at or above this severity trigger this rule. ROUTINE = informational, PRIORITY = needs attention, IMMEDIATE = act now."})]}),v.jsxs("div",{className:"relative",children:[v.jsxs("button",{type:"button",onClick:()=>n(!r),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-left flex items-center justify-between hover:border-accent transition-colors",children:[v.jsxs("div",{children:[v.jsx("span",{className:"text-slate-200",children:i.label}),v.jsxs("span",{className:"text-slate-500 ml-2",children:["- ",i.description]})]}),v.jsx(Rl,{size:16,className:`text-slate-500 transition-transform ${r?"rotate-180":""}`})]}),r&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>n(!1)}),v.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 z-50 bg-[#0a0e17] border border-[#1e2a3a] shadow-xl overflow-hidden",children:w_.map(a=>v.jsxs("button",{type:"button",onClick:()=>{t(a.value),n(!1)},className:`w-full px-3 py-2.5 text-left text-sm hover:bg-[#1e2a3a] transition-colors ${e===a.value?"bg-accent/10":""}`,children:[v.jsx("div",{className:"font-medium text-slate-200",children:a.label}),v.jsx("div",{className:"text-xs text-slate-500",children:a.description})]},a.value))})]})]}),v.jsx("p",{className:"text-xs text-slate-600",children:'Lower = more notifications. "Warning" recommended for most rules.'})]})}function O0({rule:e}){const[t,r]=G.useState(!1),[n,i]=G.useState(null),a=async()=>{r(!0),i(null);try{let s={type:e.delivery_type};e.delivery_type==="mesh_broadcast"?s.channel_index=e.broadcast_channel:e.delivery_type==="mesh_dm"?s.node_ids=e.node_ids:e.delivery_type==="email"?s={type:"email",smtp_host:e.smtp_host,smtp_port:e.smtp_port,smtp_user:e.smtp_user,smtp_password:e.smtp_password,smtp_tls:e.smtp_tls,from_address:e.from_address,recipients:e.recipients}:e.delivery_type==="webhook"&&(s={type:"webhook",url:e.webhook_url,headers:e.webhook_headers});const u=await(await fetch("/api/notifications/channels/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).json();i(u)}catch(s){i({success:!1,message:"Test failed",error:s instanceof Error?s.message:"Unknown error",details:{}})}finally{r(!1)}};if(!e.delivery_type)return null;const o={mesh_broadcast:v.jsx(Gi,{size:14}),mesh_dm:v.jsx(QL,{size:14}),email:v.jsx(DK,{size:14}),webhook:v.jsx(NK,{size:14})}[e.delivery_type]||v.jsx(Z1,{size:14});return v.jsxs("div",{className:"space-y-2",children:[v.jsx("button",{type:"button",onClick:a,disabled:t,className:"flex items-center gap-2 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",children:t?v.jsxs(v.Fragment,{children:[v.jsx(qp,{size:14,className:"animate-spin"}),"Testing..."]}):v.jsxs(v.Fragment,{children:[o,"Test Channel"]})}),n&&v.jsx("div",{className:`p-2 rounded text-xs ${n.success?"bg-green-500/10 border border-green-500/30 text-green-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:v.jsxs("div",{className:"flex items-start gap-2",children:[n.success?v.jsx(ao,{size:14,className:"mt-0.5 flex-shrink-0"}):v.jsx(ya,{size:14,className:"mt-0.5 flex-shrink-0"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium",children:n.message}),n.error&&v.jsx("div",{className:"mt-1 text-red-300",children:n.error})]})]})})]})}function GSe({rule:e,ruleIndex:t,categories:r,regions:n,onChange:i,onDelete:a,onDuplicate:o,onTest:s}){var O,j,B,U,H;const[l,u]=G.useState(!e.name),[c,h]=G.useState(!1),[f,d]=G.useState(null),[g,m]=G.useState(null);G.useEffect(()=>{var V;e.name&&t>=0&&(fetch(`/api/notifications/rules/${t}/stats`).then(z=>z.json()).then(z=>d(z)).catch(()=>{}),(V=e.categories)!=null&&V.length&&fetch("/api/notifications/rules/sources",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({categories:e.categories})}).then(z=>z.json()).then(z=>m(z)).catch(()=>{}))},[e.name,t,e.categories]);const y=[{value:"",label:"(None)",description:"Rule matches but does not deliver"},{value:"mesh_broadcast",label:"Mesh Broadcast",description:"Send to a mesh radio channel"},{value:"mesh_dm",label:"Mesh DM",description:"Direct message to specific nodes"},{value:"email",label:"Email",description:"Send via SMTP"},{value:"webhook",label:"Webhook",description:"POST to any URL"}],_=[{value:"daily",label:"Daily"},{value:"twice_daily",label:"Twice Daily"},{value:"weekly",label:"Weekly"}],x=[{value:"mesh_health_summary",label:"Mesh Health Summary",description:"Current health score, pillar breakdown, problem nodes"},{value:"rf_propagation_report",label:"RF Propagation Report",description:"Solar indices, Kp, ducting conditions"},{value:"alerts_digest",label:"Active Alerts Digest",description:"Summary of all active environmental alerts"},{value:"environmental_conditions",label:"Environmental Conditions",description:"Full conditions: weather, fire, streams, roads"},{value:"custom",label:"Custom Message",description:"Write your own with template tokens"}],w=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],S=V=>{const z=e.categories||[];z.includes(V)?i({...e,categories:z.filter($=>$!==V)}):i({...e,categories:[...z,V]})},T=(V,z)=>{const $=e.categories||[];if(z==="add"){const W=Array.from(new Set([...$,...V]));i({...e,categories:W})}else{const W=new Set(V);i({...e,categories:$.filter(Z=>!W.has(Z))})}},M=V=>{const z=e.region_scope||[];z.includes(V)?i({...e,region_scope:z.filter($=>$!==V)}):i({...e,region_scope:[...z,V]})},A=V=>{const z=e.schedule_days||[];z.includes(V)?i({...e,schedule_days:z.filter($=>$!==V)}):i({...e,schedule_days:[...z,V]})},N=async()=>{h(!0),await s(),h(!1)},P=()=>{if(e.trigger_type==="schedule")return"[Scheduled report preview would appear here]";const V=e.categories||[];if(V.length===0&&r.length>0)return r[0].example_message||"Alert notification";const z=r.find($=>V.includes($.id));return(z==null?void 0:z.example_message)||"Alert notification"},I=()=>{var z,$,W,Z,X,re,J,oe;const V=[];if(e.trigger_type==="schedule"){const le=((z=_.find(be=>be.value===e.schedule_frequency))==null?void 0:z.label)||e.schedule_frequency,De=(($=x.find(be=>be.value===e.message_type))==null?void 0:$.label)||e.message_type;V.push(`${le} at ${e.schedule_time||"??:??"}`),V.push(De)}else{const le=((W=e.categories)==null?void 0:W.length)||0,De=le===0?"All":r.filter(ve=>{var Ne;return(Ne=e.categories)==null?void 0:Ne.includes(ve.id)}).map(ve=>ve.name).slice(0,2).join(", ")+(le>2?` +${le-2}`:""),be=((Z=w_.find(ve=>ve.value===e.min_severity))==null?void 0:Z.label)||e.min_severity;V.push(`${De} at ${be}+`)}if(!e.delivery_type)V.push("No delivery");else{const le=((X=y.find(be=>be.value===e.delivery_type))==null?void 0:X.label)||e.delivery_type;let De="";if(e.delivery_type==="mesh_broadcast")De=`Ch ${e.broadcast_channel}`;else if(e.delivery_type==="mesh_dm")De=`${((re=e.node_ids)==null?void 0:re.length)||0} nodes`;else if(e.delivery_type==="email")De=(J=e.recipients)!=null&&J.length?e.recipients[0]+(e.recipients.length>1?` +${e.recipients.length-1}`:""):"no recipients";else if(e.delivery_type==="webhook")try{De=new URL(e.webhook_url).hostname}catch{De=((oe=e.webhook_url)==null?void 0:oe.slice(0,20))||"no URL"}V.push(`${le}${De?` (${De})`:""}`)}return V.join(" -> ")},D=()=>{var z;if(!g||!((z=e.categories)!=null&&z.length))return null;const V=new Map;for(const[,$]of Object.entries(g)){const W=V.get($.source);W?(W.events+=$.active_events,W.enabled=W.enabled&&$.enabled):V.set($.source,{enabled:$.enabled,events:$.active_events})}return Array.from(V.entries()).map(([$,{enabled:W,events:Z}])=>v.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs ${W?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,title:W?`${Z} active`:"Not enabled",children:[W?v.jsx(Z1,{size:10}):v.jsx(h6,{size:10}),$.toUpperCase(),W&&Z>0&&` (${Z})`]},$))};return v.jsxs("div",{className:`border overflow-hidden ${e.enabled?"border-[#1e2a3a]":"border-slate-700 opacity-60"}`,children:[v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>u(!l),children:[v.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[l?v.jsx(Rl,{size:16,className:"text-slate-500 flex-shrink-0"}):v.jsx(wl,{size:16,className:"text-slate-500 flex-shrink-0"}),v.jsx("button",{onClick:V=>{V.stopPropagation(),i({...e,enabled:!e.enabled})},className:`w-2 h-2 rounded-full flex-shrink-0 ${e.enabled?"bg-green-500":"bg-slate-500"}`,title:e.enabled?"Enabled":"Disabled"}),e.trigger_type==="schedule"?v.jsx(oc,{size:14,className:"text-[#f59e0b] flex-shrink-0"}):v.jsx(If,{size:14,className:"text-yellow-400 flex-shrink-0"}),v.jsx("span",{className:"font-medium text-slate-200 truncate",title:e.name||void 0,children:e.name||"New Rule"}),!l&&v.jsx("span",{className:`text-xs truncate hidden sm:block ${e.delivery_type?"text-slate-500":"text-amber-400"}`,children:I()})]}),v.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[!l&&(()=>{const V="hidden sm:inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs mr-2";if(!e.enabled)return v.jsx("span",{className:`${V} bg-slate-800 text-slate-500`,children:"Disabled"});if(!f)return null;const z=f.fire_count||0,$=f.last_fired,W=Date.now()/1e3-7*86400;return z>0&&$&&$>=W?v.jsx("span",{className:`${V} bg-green-500/10 text-green-400`,title:`Last fired ${j0($)}`,children:"Active"}):z>0&&$?v.jsx("span",{className:`${V} bg-yellow-500/10 text-yellow-400`,title:`Last fired ${j0($)}`,children:"Idle (no recent activity)"}):v.jsx("span",{className:`${V} bg-slate-800 text-slate-400`,children:"No activity yet"})})(),!l&&v.jsx("div",{className:"hidden md:flex items-center gap-1 mr-2",children:D()}),v.jsx("button",{onClick:V=>{V.stopPropagation(),N()},disabled:c||!e.name,className:"p-1.5 text-[#f59e0b] hover:text-[#d97706] hover:bg-[#f59e0b]/10 rounded disabled:opacity-50",title:"Test rule",children:v.jsx(E2,{size:14})}),v.jsx("button",{onClick:V=>{V.stopPropagation(),o()},className:"p-1.5 text-slate-400 hover:text-slate-200 hover:bg-slate-500/10 rounded",title:"Duplicate",children:v.jsx(kK,{size:14})}),v.jsx("button",{onClick:V=>{V.stopPropagation(),a()},className:"p-1.5 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",title:"Delete",children:v.jsx(Yg,{size:14})})]})]}),!l&&e.name&&v.jsxs("div",{className:"px-3 pb-2 pt-0 bg-[#0a0e17] flex items-center gap-2 flex-wrap text-xs",children:[!e.delivery_type&&v.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 bg-amber-500/10 text-amber-400 rounded",children:[v.jsx(os,{size:10}),"No delivery method"]}),(f==null?void 0:f.fire_count)!==void 0&&f.fire_count>0&&v.jsxs("span",{className:"text-slate-500",children:["Fired ",f.fire_count,"x"]})]}),l&&v.jsxs("div",{className:"p-4 space-y-6 border-t border-[#1e2a3a]",children:[v.jsx(Gs,{label:"Rule Name",value:e.name,onChange:V=>i({...e,name:V}),placeholder:"e.g., Emergency Broadcast, Daily Health Report",helper:"A descriptive name for this rule"}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Trigger Type"}),v.jsxs("div",{className:"flex gap-2",children:[v.jsxs("button",{type:"button",onClick:()=>i({...e,trigger_type:"condition"}),className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 border transition-colors ${e.trigger_type!=="schedule"?"bg-accent/10 border-accent text-accent":"bg-[#0a0e17] border-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:[v.jsx(If,{size:16}),v.jsx("span",{children:"Condition"})]}),v.jsxs("button",{type:"button",onClick:()=>i({...e,trigger_type:"schedule"}),className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 border transition-colors ${e.trigger_type==="schedule"?"bg-accent/10 border-accent text-accent":"bg-[#0a0e17] border-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:[v.jsx(oc,{size:16}),v.jsx("span",{children:"Schedule"})]})]}),v.jsx("p",{className:"text-xs text-slate-600",children:e.trigger_type==="schedule"?"Send reports on a schedule (daily briefings, weekly digests)":"React to alert conditions (fires, outages, weather warnings)"})]}),e.trigger_type!=="schedule"&&v.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] border border-[#1e2a3a]",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[v.jsx(oo,{size:14}),"WHEN (Condition)"]}),v.jsx(UZ,{value:e.min_severity,onChange:V=>i({...e,min_severity:V})}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Categories",v.jsx(Ri,{info:"Select which types of alerts trigger this rule. Leave all unchecked to match ALL categories. Categories are grouped by family — use the 'All' / 'Clear' buttons in each header to bulk-toggle."})]}),v.jsx("div",{className:"text-xs text-slate-500 mb-2",children:(((O=e.categories)==null?void 0:O.length)||0)===0?"All categories (none selected)":`${(j=e.categories)==null?void 0:j.length} selected`}),v.jsx(HSe,{categories:r,selected:e.categories||[],onToggle:S,onSelectMany:T})]}),g&&Object.keys(g).length>0&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Data Sources"}),v.jsx("div",{className:"flex flex-wrap gap-2",children:D()})]})]}),e.trigger_type==="schedule"&&v.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] border border-[#1e2a3a]",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[v.jsx(CK,{size:14}),"WHEN (Schedule)"]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Frequency"}),v.jsx("select",{value:e.schedule_frequency||"daily",onChange:V=>i({...e,schedule_frequency:V.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:_.map(V=>v.jsx("option",{value:V.value,children:V.label},V.value))})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(kp,{label:"Time",value:e.schedule_time||"07:00",onChange:V=>i({...e,schedule_time:V})}),e.schedule_frequency==="twice_daily"&&v.jsx(kp,{label:"Second Time",value:e.schedule_time_2||"19:00",onChange:V=>i({...e,schedule_time_2:V})})]}),e.schedule_frequency==="weekly"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Days"}),v.jsx("div",{className:"flex flex-wrap gap-2",children:w.map(V=>{var z;return v.jsx("button",{type:"button",onClick:()=>A(V),className:`px-3 py-1.5 rounded text-sm capitalize transition-colors ${(z=e.schedule_days)!=null&&z.includes(V)?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:V.slice(0,3)},V)})})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Report Type"}),v.jsx("select",{value:e.message_type||"mesh_health_summary",onChange:V=>i({...e,message_type:V.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:x.map(V=>v.jsx("option",{value:V.value,children:V.label},V.value))}),v.jsx("p",{className:"text-xs text-slate-600",children:(B=x.find(V=>V.value===e.message_type))==null?void 0:B.description})]}),e.message_type==="custom"&&v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Custom Message",v.jsx(Ri,{info:"Available tokens: {MESH_SCORE}, {NODE_COUNT}, {NODES_ONLINE}, {ACTIVE_ALERTS}, {KP}, {SFI}, {DATE}, {TIME}"})]}),v.jsx("textarea",{value:e.custom_message||"",onChange:V=>i({...e,custom_message:V.target.value}),rows:4,placeholder:"Good morning! Mesh health: {MESH_SCORE}/100 with {NODE_COUNT} nodes online.",className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 font-mono focus:outline-none focus:border-accent placeholder-slate-600"})]})]}),v.jsxs("div",{className:"space-y-2 p-4 bg-[#0a0e17] border border-[#1e2a3a]",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[v.jsx(nd,{size:14}),"REGIONS",v.jsx(Ri,{info:"Limit this rule to alerts from specific regions. Empty selection = all regions (backward compatible). Region names come from /api/regions."})]}),v.jsx("div",{className:"text-xs text-slate-500",children:(((U=e.region_scope)==null?void 0:U.length)||0)===0?"All regions (none selected)":`${e.region_scope.length} of ${n.length} selected`}),n.length===0?v.jsx("div",{className:"text-xs text-slate-600 italic",children:"No regions configured."}):v.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(V=>{const z=(e.region_scope||[]).includes(V.name);return v.jsx("button",{type:"button",onClick:()=>M(V.name),className:`px-3 py-1.5 rounded text-sm transition-colors ${z?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,title:V.local_name||V.name,children:V.local_name||V.name},V.name)})})]}),v.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] border border-[#1e2a3a]",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[v.jsx(E2,{size:14}),"SEND VIA"]}),v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Delivery Method",v.jsx(Ri,{info:"Where this notification gets delivered. Select (None) to save the rule without delivery - it will match conditions but won't send until you configure a delivery method."})]}),v.jsx("select",{value:e.delivery_type||"",onChange:V=>i({...e,delivery_type:V.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:y.map(V=>v.jsx("option",{value:V.value,children:V.label},V.value))}),v.jsx("p",{className:"text-xs text-slate-600",children:(H=y.find(V=>V.value===(e.delivery_type||"")))==null?void 0:H.description})]}),!e.delivery_type&&v.jsxs("div",{className:"flex items-start gap-2 p-3 bg-amber-500/10 border border-amber-500/20",children:[v.jsx(os,{size:16,className:"text-amber-400 mt-0.5 flex-shrink-0"}),v.jsx("div",{className:"text-sm text-amber-300",children:"Rule will log matches but not deliver until a delivery method is configured."})]}),e.delivery_type==="mesh_broadcast"&&v.jsxs(v.Fragment,{children:[v.jsx(uP,{label:"Broadcast Channel",value:e.broadcast_channel??0,onChange:V=>i({...e,broadcast_channel:V}),helper:"Select the mesh radio channel",mode:"single"}),v.jsx(O0,{rule:e})]}),e.delivery_type==="mesh_dm"&&v.jsxs(v.Fragment,{children:[v.jsx(lP,{label:"Recipient Nodes",value:e.node_ids||[],onChange:V=>i({...e,node_ids:V}),helper:"Nodes that receive direct messages",valueType:"node_id_hex"}),v.jsx(O0,{rule:e})]}),e.delivery_type==="email"&&v.jsxs("div",{className:"space-y-4",children:[v.jsx(S_,{label:"Recipients",value:e.recipients||[],onChange:V=>i({...e,recipients:V}),placeholder:"email@example.com",helper:"Email addresses to receive alerts"}),v.jsxs("details",{className:"group",children:[v.jsxs("summary",{className:"flex items-center gap-2 cursor-pointer text-sm text-slate-400 hover:text-slate-200",children:[v.jsx(wl,{size:14,className:"group-open:rotate-90 transition-transform"}),"SMTP Configuration"]}),v.jsxs("div",{className:"mt-4 space-y-4 pl-6 border-l border-[#1e2a3a]",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Gs,{label:"SMTP Host",value:e.smtp_host||"",onChange:V=>i({...e,smtp_host:V}),placeholder:"smtp.gmail.com"}),v.jsx(Fg,{label:"SMTP Port",value:e.smtp_port??587,onChange:V=>i({...e,smtp_port:V}),min:1,max:65535})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Gs,{label:"Username",value:e.smtp_user||"",onChange:V=>i({...e,smtp_user:V})}),v.jsx(Gs,{label:"Password",value:e.smtp_password||"",onChange:V=>i({...e,smtp_password:V}),type:"password",info:"Gmail users: use an App Password from myaccount.google.com/apppasswords"})]}),v.jsx(x1,{label:"Use TLS",checked:e.smtp_tls??!0,onChange:V=>i({...e,smtp_tls:V})}),v.jsx(Gs,{label:"From Address",value:e.from_address||"",onChange:V=>i({...e,from_address:V}),placeholder:"alerts@yourdomain.com"})]})]}),v.jsx(O0,{rule:e})]}),e.delivery_type==="webhook"&&v.jsxs(v.Fragment,{children:[v.jsx(Gs,{label:"Webhook URL",value:e.webhook_url||"",onChange:V=>i({...e,webhook_url:V}),placeholder:"https://discord.com/api/webhooks/...",helper:"POST alert as JSON",info:"Works with Discord webhooks, ntfy.sh, Slack, Home Assistant, Pushover, or any HTTP POST endpoint."}),v.jsx(O0,{rule:e})]})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Fg,{label:"Cooldown (minutes)",value:e.cooldown_minutes??10,onChange:V=>i({...e,cooldown_minutes:V}),min:0,helper:"Min time between repeat sends",info:"Prevents alert spam. Same condition won't re-trigger this rule within this window."})," "]}),f&&v.jsxs("div",{className:"flex items-center gap-4 text-xs text-slate-500",children:[v.jsxs("span",{children:["Last fired: ",j0(f.last_fired)]}),v.jsxs("span",{children:["Last tested: ",j0(f.last_test)]}),v.jsxs("span",{children:["Total fires: ",f.fire_count]})]}),e.trigger_type!=="schedule"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Example Message"}),v.jsx("div",{className:"p-3 bg-[#1e2a3a]/50 border border-[#1e2a3a]",children:v.jsx("p",{className:"text-sm text-slate-300 font-mono",children:P()})}),v.jsx("p",{className:"text-xs text-slate-600",children:"This is an example of what this rule would send."})]})]})]})}const C_=[{key:"mesh_health",label:"Mesh Health",Icon:rd},{key:"weather",label:"Weather",Icon:sc},{key:"fire",label:"Fire",Icon:F1},{key:"rf_propagation",label:"RF Propagation",Icon:Gi},{key:"roads",label:"Roads",Icon:z1},{key:"avalanche",label:"Avalanche",Icon:OK},{key:"satpass",label:"Satellite Passes",Icon:U1},{key:"seismic",label:"Seismic",Icon:G1},{key:"tracking",label:"Tracking",Icon:nd}];function HSe({categories:e,selected:t,onToggle:r,onSelectMany:n}){const i=new Set(C_.map(f=>f.key)),a=new Map;C_.forEach(f=>a.set(f.key,[]));const o=[];for(const f of e){const d=f.toggle;d&&i.has(d)?a.get(d).push(f):o.push(f)}const s=new Set;for(const[f,d]of a)d.some(g=>t.includes(g.id))&&s.add(f);o.some(f=>t.includes(f.id))&&s.add("other");const[l,u]=G.useState(s),c=f=>{u(d=>{const g=new Set(d);return g.has(f)?g.delete(f):g.add(f),g})},h=(f,d,g,m)=>{if(!m.length)return null;const y=l.has(f),_=m.map(w=>w.id),x=_.filter(w=>t.includes(w)).length;return v.jsxs("div",{className:"border border-[#1e2a3a] rounded",children:[v.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 bg-[#0d1420]",children:[v.jsxs("button",{type:"button",onClick:()=>c(f),className:"flex items-center gap-2 text-sm text-slate-200 flex-1 min-w-0",children:[y?v.jsx(Rl,{size:14,className:"text-slate-500 flex-shrink-0"}):v.jsx(wl,{size:14,className:"text-slate-500 flex-shrink-0"}),g&&v.jsx(g,{size:14,className:"text-slate-400 flex-shrink-0"}),v.jsxs("span",{className:"truncate",children:[d," (",m.length,")"]}),x>0&&v.jsxs("span",{className:"ml-1 text-xs text-accent",children:[x," selected"]})]}),v.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[v.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),n(_,"add")},className:"text-xs px-2 py-0.5 rounded text-slate-400 hover:text-accent hover:bg-accent/10",title:"Select all in family",children:"All"}),v.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),n(_,"remove")},className:"text-xs px-2 py-0.5 rounded text-slate-400 hover:text-red-400 hover:bg-red-500/10",title:"Clear family",children:"Clear"})]})]}),y&&v.jsx("div",{className:"p-1 space-y-1",children:m.map(w=>v.jsxs("label",{onClick:()=>r(w.id),className:"flex items-start gap-2 p-2 rounded hover:bg-[#1e2a3a]/50 cursor-pointer",children:[v.jsx("div",{className:`w-4 h-4 mt-0.5 rounded border flex items-center justify-center flex-shrink-0 ${t.includes(w.id)?"bg-accent border-accent":"border-slate-600"}`,children:t.includes(w.id)&&v.jsx(ao,{size:12,className:"text-white"})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"text-sm text-slate-200",children:w.name}),v.jsx("div",{className:"text-xs text-slate-500",children:w.description})]})]},w.id))})]},f)};return v.jsxs("div",{className:"max-h-96 overflow-y-auto border border-[#1e2a3a] p-2 space-y-2",children:[C_.map(f=>h(f.key,f.label,f.Icon,a.get(f.key)||[])),h("other","Other",null,o)]})}const SB=["digest","mesh_broadcast","mesh_dm","email","webhook"],USe=["routine","priority","immediate"];function WSe({toggles:e,onChange:t}){const[r,n]=G.useState(null),i=(a,o)=>t({...e,[a]:{...e[a]||{},name:a,...o}});return v.jsxs("div",{className:"space-y-3 mb-8",children:[v.jsxs("div",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Master Toggles",v.jsx(Ri,{info:"Per-family notification policy: enable a family, set its severity threshold, choose which channels fire at each severity, and scope to regions (PagerDuty/Grafana-style)."})]}),v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:C_.map(({key:a,label:o,Icon:s})=>{const l=e[a]||{},u=r===a,c=Object.values(l.severity_channels||{}).reduce((f,d)=>f+((d==null?void 0:d.length)||0),0),h=(l.regions||[]).length;return v.jsxs("div",{className:"border border-[#1e2a3a] p-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("button",{type:"button",onClick:()=>n(u?null:a),className:"flex items-center gap-2 text-sm text-slate-200",children:[v.jsx(s,{size:15})," ",o,u?v.jsx(Rl,{size:14}):v.jsx(wl,{size:14})]}),v.jsx(x1,{label:"",checked:!!l.enabled,onChange:f=>i(a,{enabled:f})})]}),!u&&v.jsx("div",{className:"text-xs text-slate-600 mt-1",children:l.enabled?`${h||"all"} region${h===1?"":"s"}, ${c} channel${c===1?"":"s"} at ${l.min_severity||"priority"}+`:"OFF"}),u&&v.jsxs("div",{className:`mt-3 space-y-3 ${l.enabled?"":"opacity-40 pointer-events-none select-none"}`,children:[v.jsx(UZ,{value:l.min_severity||"priority",onChange:f=>i(a,{min_severity:f})}),v.jsx("div",{className:"text-xs text-slate-500",children:"Severity → channels"}),v.jsxs("table",{className:"text-xs w-full",children:[v.jsx("thead",{children:v.jsxs("tr",{children:[v.jsx("th",{}),SB.map(f=>v.jsx("th",{className:"text-slate-500 font-normal px-1",children:f.replace("_"," ")},f))]})}),v.jsx("tbody",{children:USe.map(f=>v.jsxs("tr",{children:[v.jsx("td",{className:"text-slate-400 pr-2",children:f}),SB.map(d=>{var m;const g=(((m=l.severity_channels)==null?void 0:m[f])||[]).includes(d);return v.jsx("td",{className:"text-center",children:v.jsx("input",{type:"checkbox",checked:g,onChange:y=>{const _={...l.severity_channels||{}},x=new Set(_[f]||[]);y.target.checked?x.add(d):x.delete(d),_[f]=Array.from(x),i(a,{severity_channels:_})}})},d)})]},f))})]}),v.jsx(S_,{label:"Regions (empty = all)",value:l.regions||[],onChange:f=>i(a,{regions:f}),placeholder:"Add region..."})," ",v.jsx("div",{className:"text-xs text-slate-500 pt-1",children:"Channel config"}),v.jsx(Fg,{label:"Broadcast channel",value:l.broadcast_channel??0,onChange:f=>i(a,{broadcast_channel:f})}),v.jsx(S_,{label:"DM node IDs",value:l.node_ids||[],onChange:f=>i(a,{node_ids:f}),placeholder:"!nodeid"}),v.jsx(S_,{label:"Email recipients",value:l.recipients||[],onChange:f=>i(a,{recipients:f}),placeholder:"ops@example.com"}),v.jsx(Gs,{label:"SMTP host",value:l.smtp_host||"",onChange:f=>i(a,{smtp_host:f}),placeholder:"smtp.example.com"}),v.jsx(Fg,{label:"SMTP port",value:l.smtp_port??587,onChange:f=>i(a,{smtp_port:f})}),v.jsx(Gs,{label:"Webhook URL",value:l.webhook_url||"",onChange:f=>i(a,{webhook_url:f}),placeholder:"https://..."})]})]},a)})})]})}function ZSe(){var z,$,W;const[e,t]=G.useState(null),[r,n]=G.useState(null),[i,a]=G.useState([]),[o,s]=G.useState([]),[l,u]=G.useState(!0),[c,h]=G.useState(!1),[f,d]=G.useState(null),[g,m]=G.useState(null),[y,_]=G.useState(null),[x,w]=G.useState({open:!1,ruleIndex:-1,loading:!1,action:""}),[S,T]=G.useState(!1),[M,A]=G.useState(!1),N=G.useCallback(async()=>{try{const[Z,X,re]=await Promise.all([fetch("/api/config/notifications"),fetch("/api/notifications/categories"),fetch("/api/regions")]);if(!Z.ok)throw new Error("Failed to fetch notifications config");const J=await Z.json(),oe=await X.json(),le=re.ok?await re.json():[];t(J),n(JSON.parse(JSON.stringify(J))),a(oe),s(Array.isArray(le)?le:[]),A(!1),d(null)}catch(Z){d(Z instanceof Error?Z.message:"Unknown error")}finally{u(!1)}},[]);G.useEffect(()=>{document.title="Notifications - MeshAI",N()},[N]),G.useEffect(()=>{e&&r&&A(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);const P=async()=>{if(e){h(!0),d(null),m(null);try{const Z=await fetch("/api/config/notifications",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),X=await Z.json();if(!Z.ok)throw new Error(X.detail||"Save failed");m("Notifications config saved successfully"),n(JSON.parse(JSON.stringify(e))),A(!1),setTimeout(()=>m(null),3e3)}catch(Z){d(Z instanceof Error?Z.message:"Save failed")}finally{h(!1)}}},I=()=>{r&&(t(JSON.parse(JSON.stringify(r))),A(!1))},D=()=>({name:"",enabled:!0,trigger_type:"condition",categories:[],min_severity:"routine",schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"19:00",schedule_days:["monday"],message_type:"mesh_health_summary",custom_message:"",delivery_type:"",broadcast_channel:0,node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{},cooldown_minutes:10,region_scope:[]}),O=()=>{e&&t({...e,rules:[...e.rules||[],D()]})},j=Z=>{if(!e)return;const X=wB.find(re=>re.id===Z);X&&(t({...e,rules:[...e.rules||[],{...D(),...X.rule}]}),T(!1))},B=Z=>{if(!e)return;const X=e.rules[Z],re={...JSON.parse(JSON.stringify(X)),name:`${X.name} (copy)`},J=[...e.rules];J.splice(Z+1,0,re),t({...e,rules:J})},U=async Z=>{w({open:!0,ruleIndex:Z,loading:!0,action:""});try{const re=await(await fetch(`/api/notifications/rules/${Z}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"preview"})})).json();_(re),w(J=>({...J,loading:!1}))}catch{_({success:!1,message:"Failed to get preview"}),w(X=>({...X,loading:!1}))}},H=async Z=>{const X=x.ruleIndex;w(re=>({...re,loading:!0,action:Z}));try{const J=await(await fetch(`/api/notifications/rules/${X}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:Z})})).json();_(J),w(oe=>({...oe,loading:!1}))}catch{_({success:!1,message:`Failed to ${Z}`}),w(re=>({...re,loading:!1}))}},V=()=>{w({open:!1,ruleIndex:-1,loading:!1,action:""}),_(null)};return l?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading notifications config..."})}):e?v.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[x.open&&v.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:v.jsxs("div",{className:"bg-[#1a2332] border border-[#2a3a4a] shadow-xl max-w-2xl w-full mx-4 max-h-[85vh] overflow-auto",children:[v.jsxs("div",{className:"p-4 border-b border-[#2a3a4a] flex items-center justify-between sticky top-0 bg-[#1a2332]",children:[v.jsx("h3",{className:"text-lg font-semibold",children:"Test Notification Rule"}),v.jsx("button",{onClick:V,className:"text-slate-500 hover:text-slate-300",children:v.jsx(ya,{size:20})})]}),v.jsx("div",{className:"p-4 space-y-4",children:x.loading?v.jsxs("div",{className:"flex items-center justify-center py-8",children:[v.jsx(qp,{size:20,className:"animate-spin text-slate-400 mr-2"}),v.jsx("div",{className:"text-slate-400",children:x.action?`${x.action.replace("_"," ").replace("send ","Sending ")}...`:"Loading current data..."})]}):y?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:"Current Data"}),y.live_data_summary&&y.live_data_summary.length>0?v.jsx("div",{className:"p-3 bg-slate-800/50 rounded space-y-1",children:y.live_data_summary.map((Z,X)=>v.jsx("div",{className:`text-sm font-mono ${Z.startsWith("[!]")?"text-amber-400":""}`,children:Z},X))}):v.jsx("div",{className:"p-3 bg-slate-800/50 rounded text-sm text-slate-500",children:"No live data available for this rule's categories"})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:"Rule Matching"}),v.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[y.conditions_matched&&y.conditions_matched>0?v.jsxs("span",{className:"px-2 py-1 bg-green-500/20 text-green-400 rounded text-sm",children:[y.conditions_matched," condition",y.conditions_matched!==1?"s":""," match - this rule WOULD fire"]}):v.jsx("span",{className:"px-2 py-1 bg-slate-700 text-slate-400 rounded text-sm",children:"No conditions trigger this rule right now"}),y.conditions_below_threshold&&y.conditions_below_threshold>0&&v.jsxs("span",{className:"px-2 py-1 bg-yellow-500/20 text-yellow-400 rounded text-sm",children:[y.conditions_below_threshold," below threshold"]})]}),y.conditions_below_threshold&&y.conditions_below_threshold>0&&v.jsxs("div",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-sm space-y-2",children:[v.jsx("div",{className:"text-yellow-300",children:y.below_threshold_summary}),y.below_threshold_events&&y.below_threshold_events.length>0&&v.jsx("div",{className:"space-y-1 text-yellow-200/80",children:y.below_threshold_events.slice(0,3).map((Z,X)=>v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-yellow-500/20 rounded",children:Z.severity}),v.jsx("span",{children:Z.headline})]},X))}),y.suggestion&&v.jsxs("div",{className:"text-yellow-400 text-xs mt-2",children:["Tip: ",y.suggestion]})]})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:y.is_example?"Example Messages":"Messages That Would Fire"}),(z=y.preview_messages)==null?void 0:z.map((Z,X)=>v.jsx("div",{className:"p-3 bg-slate-800 rounded text-sm font-mono break-words",children:Z},X))]}),y.delivered!==void 0&&y.delivery_result&&v.jsx("div",{className:`p-3 rounded text-sm ${y.delivered?"bg-green-500/10 border border-green-500/30 text-green-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:v.jsxs("div",{className:"flex items-start gap-2",children:[y.delivered?v.jsx(ao,{size:16,className:"mt-0.5"}):v.jsx(ya,{size:16,className:"mt-0.5"}),v.jsxs("div",{children:[v.jsx("div",{children:y.delivery_result}),y.delivery_error&&v.jsx("div",{className:"mt-1 text-red-300",children:y.delivery_error})]})]})}),y.message&&!y.preview_messages&&v.jsx("div",{className:`p-3 rounded text-sm ${y.success?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,children:y.message})]}):null}),v.jsxs("div",{className:"p-4 border-t border-[#2a3a4a] flex justify-between sticky bottom-0 bg-[#1a2332]",children:[v.jsx("button",{onClick:V,className:"px-4 py-2 text-slate-400 hover:text-slate-200",children:"Close"}),y&&!y.delivered&&v.jsx("div",{className:"flex gap-2",children:y.delivery_method?v.jsxs(v.Fragment,{children:[y.live_data_summary&&y.live_data_summary.length>0&&v.jsx("button",{onClick:()=>H("send_status"),disabled:x.loading,className:"px-3 py-2 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",title:"Send current conditions summary",children:"Send Current Conditions"}),v.jsx("button",{onClick:()=>H("send_test"),disabled:x.loading,className:"px-3 py-2 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",title:"Send example alert message",children:"Send Example Alert"}),y.can_send_live&&v.jsx("button",{onClick:()=>H("send_live"),disabled:x.loading,className:"px-3 py-2 bg-accent hover:bg-accent/80 rounded text-sm disabled:opacity-50",title:"Send actual live alert",children:"Send Live Alert"})]}):v.jsx("span",{className:"px-3 py-2 text-amber-400 text-sm",children:"Configure a delivery method to send test messages"})})]})]})}),v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("div",{children:v.jsx("p",{className:"text-sm text-slate-500",children:"Alert delivery and scheduled reports. Rules define what triggers a notification and where it gets sent."})}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("button",{onClick:N,className:"p-2 text-slate-400 hover:text-slate-200 hover:bg-bg-hover rounded transition-colors",title:"Refresh",children:v.jsx(qp,{size:18})}),v.jsxs("button",{onClick:I,disabled:!M,className:"flex items-center gap-2 px-3 py-2 text-slate-400 hover:text-slate-200 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[v.jsx(H1,{size:16}),"Discard"]}),v.jsxs("button",{onClick:P,disabled:c||!M,className:"flex items-center gap-2 px-4 py-2 bg-accent hover:bg-accent/80 disabled:bg-slate-700 disabled:cursor-not-allowed rounded text-white transition-colors",children:[v.jsx(ek,{size:16}),c?"Saving...":"Save"]})]})]}),f&&v.jsx("div",{className:"p-3 text-sm bg-red-500/10 text-red-400 border border-red-500/20",children:f}),g&&v.jsxs("div",{className:"p-3 text-sm bg-green-500/10 text-green-400 border border-green-500/20",children:[v.jsx(ao,{size:14,className:"inline mr-2"}),g]}),v.jsxs("div",{className:"bg-bg-card border border-border p-6 space-y-6",children:[v.jsx(x1,{label:"Enable Notifications",checked:e.enabled,onChange:Z=>t({...e,enabled:Z}),helper:"Master switch for all notification delivery",info:"When disabled, no alerts or scheduled messages will be delivered. Alerts still get recorded to history."}),e.enabled&&v.jsxs(v.Fragment,{children:[" ",v.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] border border-[#1e2a3a]",children:[v.jsx("div",{className:"flex items-center gap-2",children:v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Cold-start grace"})}),v.jsx(Fg,{label:"Grace period (seconds)",value:e.cold_start_grace_seconds??60,onChange:Z=>t({...e,cold_start_grace_seconds:Z}),min:0,max:600,helper:"Suppress broadcasts for this many seconds after the first event arrives",info:"When meshai starts seeing events for the first time, suppress mesh broadcasts for this many seconds to absorb any JetStream backlog. Persistence rows still get written; only broadcasts are suppressed."})]}),v.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] border border-[#1e2a3a]",children:[v.jsx("div",{className:"flex items-center gap-2",children:v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Band Conditions (HF propagation)"})}),v.jsx(x1,{label:"Enable scheduled band-conditions broadcasts",checked:e.band_conditions_enabled??!0,onChange:Z=>t({...e,band_conditions_enabled:Z}),helper:"3x/day HF propagation summary (Day/Night ratings per band group). The daily fire digest (twice-daily LLM summary of active fires + the last 24h of growth/spotting) is configured separately under Adapter Config -> fires.digest_*. See Reference -> Fire Tracker (Fusion) and Reference -> Broadcast Types for the New/Update/Active prefix system.",info:"Source priority: (1) recent SWPC readings persisted locally; (2) HamQSL.com fallback; (3) silent skip if both fail. Persistence rows are written either way for an audit trail."}),(e.band_conditions_enabled??!0)&&v.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[v.jsx(kp,{label:"Slot 1",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[0]||"06:00",onChange:Z=>{const X=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];X[0]=Z,t({...e,band_conditions_schedule:X})},helper:"Morning (default 06:00 MT)"}),v.jsx(kp,{label:"Slot 2",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[1]||"14:00",onChange:Z=>{const X=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];X[1]=Z,t({...e,band_conditions_schedule:X})},helper:"Afternoon (default 14:00 MT)"}),v.jsx(kp,{label:"Slot 3",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[2]||"22:00",onChange:Z=>{const X=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];X[2]=Z,t({...e,band_conditions_schedule:X})},helper:"Night (default 22:00 MT)"})]}),v.jsx("p",{className:"text-xs text-slate-600",children:"All times are Mountain Time (America/Boise). DST handled automatically."})]}),e.toggles&&v.jsx(WSe,{toggles:e.toggles,onChange:Z=>t({...e,toggles:Z})}),v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Notification Rules",v.jsx(Ri,{info:"Each rule is self-contained: define what triggers it (condition or schedule), where to send it (mesh, email, webhook), and behavior settings."})]}),v.jsxs("span",{className:"text-xs text-slate-500",children:[(($=e.rules)==null?void 0:$.length)||0," rule",(((W=e.rules)==null?void 0:W.length)||0)!==1?"s":""]})]}),(e.rules||[]).map((Z,X)=>v.jsx(GSe,{rule:Z,ruleIndex:X,categories:i,regions:o,onChange:re=>{const J=[...e.rules||[]];J[X]=re,t({...e,rules:J})},onDelete:()=>{confirm(`Delete rule "${Z.name||"New Rule"}"?`)&&t({...e,rules:(e.rules||[]).filter((re,J)=>J!==X)})},onDuplicate:()=>B(X),onTest:()=>U(X)},X)),v.jsxs("div",{className:"flex gap-2",children:[v.jsxs("button",{onClick:O,className:"flex-1 py-3 border border-dashed border-[#1e2a3a] text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[v.jsx(id,{size:16})," Add Rule"]}),v.jsxs("div",{className:"relative",children:[v.jsxs("button",{onClick:()=>T(!S),className:"py-3 px-4 border border-dashed border-[#1e2a3a] text-slate-500 hover:text-slate-300 hover:border-accent flex items-center gap-2 transition-colors",children:[v.jsx(a6,{size:16})," Add from Template"]}),S&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>T(!1)}),v.jsxs("div",{className:"absolute right-0 top-full mt-2 z-50 w-80 bg-[#1a2332] border border-[#2a3a4a] shadow-xl overflow-hidden",children:[v.jsx("div",{className:"p-2 border-b border-[#2a3a4a] text-xs text-slate-500 uppercase",children:"Rule Templates"}),wB.map(Z=>v.jsxs("button",{onClick:()=>j(Z.id),className:"w-full p-3 text-left hover:bg-[#2a3a4a] transition-colors",children:[v.jsx("div",{className:"font-medium text-slate-200",children:Z.name}),v.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:Z.description})]},Z.id))]})]})]})]})]})]})]})]}):v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-red-400",children:"Failed to load notifications config"})})}const CB=[{id:"stream-gauges",label:"Stream Gauges",icon:B1},{id:"wildfire",label:"Wildfire",icon:F1},{id:"firms",label:"Satellite Fire Detection (FIRMS)",icon:U1},{id:"fire-tracker",label:"Fire Tracker (Fusion)",icon:IK},{id:"weather-alerts",label:"Weather Alerts",icon:AK},{id:"solar",label:"Solar & Geomagnetic",icon:u6},{id:"ducting",label:"Tropospheric Ducting",icon:Gi},{id:"avalanche",label:"Avalanche Danger",icon:G1},{id:"traffic",label:"Traffic Flow",icon:z1},{id:"roads-511",label:"Road Conditions (511)",icon:t6},{id:"mesh-health",label:"Mesh Health",icon:rd},{id:"broadcast-types",label:"Broadcast Types",icon:E2},{id:"reminders",label:"Reminder System",icon:oc},{id:"notifications",label:"Notifications",icon:Xp},{id:"commands",label:"Commands",icon:c6},{id:"llm-dm",label:"LLM DM Queries",icon:QL},{id:"or-not-and",label:"OR-not-AND Architecture",icon:s6},{id:"adapter-config",label:"Adapter Config & CODE Rule",icon:tk},{id:"curation",label:"Curation: Gauges & Towns",icon:n6},{id:"schema",label:"Schema Migrations",icon:PK},{id:"api",label:"API Reference",icon:LK}];function er({color:e}){const t={green:"bg-green-500",yellow:"bg-yellow-500",orange:"bg-orange-500",red:"bg-red-500",black:"bg-slate-800 border border-slate-600"};return v.jsx("span",{className:`inline-block w-3 h-3 rounded-full ${t[e]}`})}function St({headers:e,rows:t}){return v.jsx("div",{className:"overflow-x-auto my-4",children:v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{children:v.jsx("tr",{className:"bg-[#1a2332] border-b border-[#2a3a4a]",children:e.map((r,n)=>v.jsx("th",{className:"px-4 py-2 text-left text-slate-400 font-medium",children:r},n))})}),v.jsx("tbody",{children:t.map((r,n)=>v.jsx("tr",{className:`border-b border-[#1e2a3a] ${n%2===0?"bg-[#0d1219]":"bg-[#0a0e17]"}`,children:r.map((i,a)=>v.jsx("td",{className:"px-4 py-2 text-slate-300",children:i},a))},n))})]})})}function zt({href:e,children:t}){return v.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-1",children:[t," ",v.jsx(kf,{size:12})]})}function fe({children:e}){return v.jsx("h3",{className:"text-lg font-semibold text-slate-200 mt-6 mb-3",children:e})}function Rs({children:e}){return v.jsx("h4",{className:"text-base font-medium text-slate-300 mt-4 mb-2",children:e})}function se({children:e}){return v.jsx("code",{className:"font-mono text-accent bg-[#1a2332] px-1 rounded",children:e})}function gr({id:e,title:t,children:r}){return v.jsxs("section",{id:e,className:"mb-12 scroll-mt-6",children:[v.jsx("h2",{className:"text-2xl font-bold text-slate-100 mb-4 pb-2 border-b border-[#2a3a4a]",children:t}),v.jsx("div",{className:"text-slate-300 leading-relaxed space-y-4",children:r})]})}function $Se(){const e=td(),[t,r]=G.useState(""),[n,i]=G.useState("stream-gauges"),a=G.useRef(null);G.useEffect(()=>{const l=e.hash.replace("#","");if(l&&CB.find(u=>u.id===l)){i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth"})}},[e.hash]);const o=CB.filter(l=>l.label.toLowerCase().includes(t.toLowerCase())),s=l=>{i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth"}),window.history.replaceState(null,"",`#${l}`)};return v.jsxs("div",{className:"flex h-full -m-6",children:[v.jsxs("aside",{className:"w-64 flex-shrink-0 bg-bg-card border-r border-border overflow-y-auto",children:[v.jsx("div",{className:"p-4 border-b border-border",children:v.jsxs("div",{className:"relative",children:[v.jsx(W1,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),v.jsx("input",{type:"text",value:t,onChange:l=>r(l.target.value),placeholder:"Search topics...",className:"w-full pl-9 pr-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent placeholder-slate-600"})]})}),v.jsx("nav",{className:"py-2",children:o.map(l=>{const u=l.icon,c=n===l.id;return v.jsxs("button",{onClick:()=>s(l.id),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm text-left transition-colors ${c?"text-accent bg-accent/10 border-l-2 border-accent":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover border-l-2 border-transparent"}`,children:[v.jsx(u,{size:16}),l.label]},l.id)})})]}),v.jsx("div",{ref:a,className:"flex-1 overflow-y-auto p-6",children:v.jsxs("div",{className:"max-w-4xl",children:[v.jsx("p",{className:"text-slate-400 mb-8",children:"Everything you need to understand and configure MeshAI's monitoring and alerting systems."}),v.jsxs(gr,{id:"stream-gauges",title:"Stream Gauges",children:[v.jsx(fe,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI watches river and stream levels at gauges you configure. Each gauge reports two things:"}),v.jsxs("p",{children:[v.jsx("strong",{children:"Water Level (Gage Height)"}),` — how high the water is, measured in feet. Important: this is NOT the depth of the river. It's the height above a fixed measuring point that's different at every gauge. A reading of "10 feet" at one gauge means something completely different than "10 feet" at another. You can only compare readings from the SAME gauge over time.`]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Flow (Discharge)"}),` — how much water is moving past the gauge, in cubic feet per second (CFS). Think of it as the river's "throughput." For scale:`]}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"A small creek: 50-200 CFS"}),v.jsx("li",{children:"A mid-size river: 1,000-5,000 CFS"}),v.jsx("li",{children:"A big river in spring runoff: 10,000+ CFS"})]}),v.jsx(fe,{children:"When Does It Flood?"}),v.jsxs("p",{children:["Flood levels are set by the ",v.jsx("strong",{children:"National Weather Service"}),', not USGS. NWS looks at each specific gauge location and decides "at what water level does the road flood? At what level do buildings get water?" Those levels are different everywhere.']}),v.jsxs("p",{children:[v.jsx("strong",{children:"Action Stage"})," — water is rising, time to start paying attention. Usually still inside the riverbanks."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Minor Flood"})," — low-lying roads start getting water on them. NWS issues a Flood Advisory."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Moderate Flood"})," — water in buildings near the river. Some people need to evacuate. NWS issues a Flood Warning."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Major Flood"})," — widespread flooding. Many people evacuating. Serious property damage."]}),v.jsx("p",{children:"MeshAI automatically looks up the flood levels for your gauge from NWS when you add a site. Some remote gauges don't have flood levels assigned — for those, you set them manually if you know what water levels cause problems in your area."}),v.jsx(fe,{children:"Low Water / Drought"}),v.jsx("p",{children:`There's no official "drought stage" for most gauges. If you need to monitor low water (irrigation, fish habitat), set a manual low-water threshold based on what you know about your local river.`}),v.jsx(fe,{children:"Setting It Up"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Find your gauge at ",v.jsx(zt,{href:"https://waterdata.usgs.gov/nwis",children:"waterdata.usgs.gov/nwis"})]}),v.jsxs("li",{children:["Copy the site number (like ",v.jsx(se,{children:"13090500"}),")"]}),v.jsx("li",{children:"Add it in Config → Environmental → USGS"}),v.jsx("li",{children:"MeshAI auto-fills the gauge name and flood levels from NWS"})]}),v.jsx("p",{children:"If NWS flood levels don't populate, your gauge may not have them. Set manual thresholds if you know your local conditions."}),v.jsx(fe,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(zt,{href:"https://waterdata.usgs.gov/nwis",children:"USGS Water Data"})," — find gauges near you"]}),v.jsxs("li",{children:[v.jsx(zt,{href:"https://water.noaa.gov",children:"NWS Water Prediction Service"})," — flood forecasts and thresholds"]}),v.jsxs("li",{children:[v.jsx(zt,{href:"https://www.usgs.gov/special-topics/water-science-school/science/how-streamflow-measured",children:"Understanding Streamflow"})," — USGS explainer"]})]})]}),v.jsxs(gr,{id:"wildfire",title:"Wildfire",children:[v.jsx(fe,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI tracks active wildfire perimeters from the National Interagency Fire Center (NIFC). For each fire, you see the name, size, how much is contained, and how far it is from your mesh nodes."}),v.jsx(fe,{children:"Fire Size — How Big Is It?"}),v.jsx(St,{headers:["Size","What That Means"],rows:[["10 acres","Small fire. Usually handled quickly by initial crews."],["100 acres","Notable fire. Active firefighting effort."],["1,000 acres","Large fire. Major resources being deployed."],["10,000+ acres","Very large fire. Multiple teams, aircraft, heavy equipment."],["100,000+ acres","Mega-fire. These make the national news."]]}),v.jsx("p",{children:"For reference, 1,000 acres is about 1.5 square miles."}),v.jsx(fe,{children:"Containment — Is It Under Control?"}),v.jsx("p",{children:"Containment means the percentage of the fire's edge where firefighters have built a control line (a cleared strip to stop the fire from spreading further). It does NOT mean the fire is out inside that line."}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"0-30%"})," — Essentially uncontrolled. The fire goes where it wants."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"50%"})," — Good progress, but half the edge can still grow."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"80%+"})," — Well controlled. Major growth unlikely."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"100%"}),' — The edge is fully controlled. But the fire may STILL be actively burning inside. "100% contained" does NOT mean "out."']})]}),v.jsx(fe,{children:"How Far Away Should I Worry?"}),v.jsx(St,{headers:["Distance","What To Do"],rows:[[v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"red"})," Under 5 km (3 miles)"]}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Immediate threat."})," This is evacuation-order range. Embers can fly this far in wind."]})],[v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"orange"})," 5-15 km (3-10 miles)"]}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Prepare."})," The fire could reach you in hours under bad conditions. Have a plan."]})],[v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"yellow"})," 15-30 km (10-20 miles)"]}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Watch."})," Smoke is likely. Wind shifts could change things fast."]})],[v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"green"})," Over 30 km (20 miles)"]}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Awareness."})," Keep an eye on it, but no immediate threat."]})]]}),v.jsx("p",{children:"How fast can a fire travel? In grass with wind: up to 14 mph. In heavy timber: 1-6 mph. A fire 10 miles away could theoretically reach you in 1-2 hours under worst-case conditions, but typical spread is much slower."}),v.jsx(fe,{children:"Which Matters More — Size or Distance?"}),v.jsxs("p",{children:[v.jsx("strong",{children:"Distance is the immediate concern."})," A small uncontained fire 10 km away is more dangerous right now than a huge fire 50 km away. But big fires have more energy and can grow fast under wind shifts — keep watching them."]}),v.jsx(fe,{children:"Setting It Up"}),v.jsxs("p",{children:["Just configure your state code (like ",v.jsx(se,{children:"US-ID"})," for Idaho) in Config → Environmental → Fires. MeshAI polls NIFC every 10 minutes for active fires in that state and computes the distance to your mesh nodes automatically."]}),v.jsx(fe,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(zt,{href:"https://inciweb.nwcg.gov",children:"InciWeb"})," — detailed incident information"]}),v.jsxs("li",{children:[v.jsx(zt,{href:"https://data-nifc.opendata.arcgis.com",children:"NIFC Fire Map"})," — raw perimeter data"]}),v.jsxs("li",{children:[v.jsx(zt,{href:"https://www.ready.gov/wildfires",children:"Ready.gov Wildfires"})," — preparedness guide"]})]})]}),v.jsxs(gr,{id:"firms",title:"Satellite Fire Detection (FIRMS)",children:[v.jsx(fe,{children:"What You're Looking At"}),v.jsx("p",{children:`NASA's VIIRS satellites orbit the Earth and look for heat signatures on the ground. When they see something hot — a fire, a factory, a sunlit building — they flag it as a "hotspot." MeshAI checks these detections for your area.`}),v.jsxs("p",{children:[v.jsx("strong",{children:"Why this matters"}),": satellite hotspots show up ",v.jsx("strong",{children:"hours before"})," official fire perimeters are mapped. If a new fire starts near your mesh, the satellite might see it before anyone on the ground reports it."]}),v.jsx(fe,{children:"Confidence — Is It Really a Fire?"}),v.jsx("p",{children:"Each detection gets a confidence rating:"}),v.jsx(St,{headers:["Confidence","What It Means"],rows:[["High","Almost certainly a real fire. Strong heat signature."],["Nominal","Probably a real fire. Most actual fires get this rating."],["Low","Maybe a fire, maybe not. Could be a hot roof, sun reflecting off water, a factory, or a gas flare. Lots of false alarms."]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Recommendation"}),`: Set the filter to "Nominal + High." If you include "Low" you'll get alerts for every hot parking lot on a summer day.`]}),v.jsx(fe,{children:"FRP — How Intense Is It?"}),v.jsx("p",{children:'FRP (Fire Radiative Power) measures the heat output in megawatts. Think of it as "how hot is this thing":'}),v.jsx(St,{headers:["FRP","What It Probably Is"],rows:[["Under 5 MW","Hot surface, small agricultural burn, gas flare, or warm ground"],["5-50 MW","An actual fire — brush fire, grass fire, typical wildfire"],["50-300 MW","Intense fire — trees fully burning, active fire front"],["Over 300 MW","Extreme fire — major wildfire in full force"]]}),v.jsx("p",{children:"Setting the minimum FRP to 5 MW filters out most industrial and agricultural false alarms."}),v.jsx(fe,{children:"New Ignition Detection"}),v.jsxs("p",{children:["MeshAI cross-references satellite hotspots against known NIFC fire perimeters. If a hotspot is NOT near any known fire, it gets flagged as a ",v.jsx("strong",{children:"potential new ignition"})," — maybe a new fire just started. These get elevated priority regardless of confidence level."]}),v.jsx(fe,{children:"Timing"}),v.jsxs("p",{children:["Satellite data arrives ",v.jsx("strong",{children:"1-3 hours"})," after the satellite passes overhead. Each location gets observed about ",v.jsx("strong",{children:"6 times per day"}),` across all satellites, so there are multi-hour gaps. This is not real-time — it's "pretty recent."`]}),v.jsx(fe,{children:"Getting an API Key"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Go to ",v.jsx(zt,{href:"https://firms.modaps.eosdis.nasa.gov/api/area/",children:"FIRMS API page"})]}),v.jsx("li",{children:'Click "Get MAP_KEY"'}),v.jsx("li",{children:"Register for a free Earthdata account"}),v.jsx("li",{children:"Your key arrives by email"}),v.jsx("li",{children:"Enter it in Config → Environmental → FIRMS"})]}),v.jsx(fe,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(zt,{href:"https://firms.modaps.eosdis.nasa.gov",children:"FIRMS Fire Map"})," — see hotspots on a map"]}),v.jsxs("li",{children:[v.jsx(zt,{href:"https://earthdata.nasa.gov/data/tools/firms/faq",children:"FIRMS FAQ"})," — how it works"]})]})]}),v.jsxs(gr,{id:"fire-tracker",title:"Fire Tracker (Fusion)",children:[v.jsx("p",{children:"FIRMS hotspots are fast but noisy; WFIGS incidents are accurate but slow. The Fire Tracker fuses both feeds and a per-pixel attribution graph so a single fire's name, declared acreage, real-time perimeter movement, and spotting events all land as separate broadcasts on the mesh."}),v.jsx(fe,{children:"What you'll see on the mesh"}),v.jsx("p",{children:"Six fire-family alert categories, in order of when they fire during an incident's lifecycle:"}),v.jsx(St,{headers:["Category","Severity","Trigger","Example broadcast"],rows:[[v.jsx(se,{children:"unattributed_hotspot_cluster"}),"Priority","3+ FIRMS pixels within 1 mi over 60 min, no WFIGS match — possible new ignition before NIFC declares it",v.jsx("span",{className:"text-amber-300",children:"🔥 Possible new fire: 3 hotspots within 1 mi @ 42.93,-114.45 (combined 78 MW)"})],[v.jsx(se,{children:"wildfire_declared"}),"Priority","WFIGS first-sight of a new IRWIN incident — the official 'this is a fire and here is its name' record",v.jsx("span",{className:"text-amber-300",children:"🔥 New: Cache Peak Fire (WF), 3 mi N of Almo: 250 ac, 0% contained"})],[v.jsx(se,{children:"wildfire_growth"}),"Priority","Per-pass centroid drift >= 0.5 mi (configurable) between consecutive satellite passes — the fire's footprint moved",v.jsx("span",{className:"text-amber-300",children:"🔥 Cache Peak Fire moving NE 1.2 mi/h, ~3 mi from Almo"})],[v.jsx(se,{children:"wildfire_spotting"}),"Immediate","FIRMS pixel attributed to a tracked fire but >= 1.5 mi (configurable) outside its prior-pass convex-hull perimeter — ember spread",v.jsx("span",{className:"text-amber-300",children:"🔥 Possible spotting 2.1 mi NE of Cache Peak Fire perimeter"})],[v.jsx(se,{children:"wildfire_incident"}),"Priority","WFIGS acreage or containment increased on a fire already broadcast once (the Update path; the New path uses wildfire_declared)",v.jsx("span",{className:"text-amber-300",children:"🔥 Update: Cache Peak Fire: 1,847 ac, 23% contained"})],[v.jsx(se,{children:"wildfire_halted"}),"Routine","No FIRMS pixels attributed for 12+ hours (configurable) — fire stalled or out",v.jsx("span",{className:"text-amber-300",children:"🔥 Cache Peak Fire no growth in 14h"})]]}),v.jsx(fe,{children:"Daily LLM digest"}),v.jsxs("p",{children:["Twice a day (default 06:00 and 18:00 Mountain Time) the bot runs an LLM summary across every active fire and the last 24 h of growth + spotting events, then broadcasts one terse line to the mesh. Shape:"," ",v.jsx("span",{className:"text-amber-300",children:'"Fires today: Cache Peak 1,847 ac +200 NE; Twin Peaks 320 ac stable; possible new fire 15 mi from Cache Peak."'})," ","Configure the schedule and timezone under ",v.jsx(se,{children:"fires.digest_*"})," ","keys on the Adapter Config page."]}),v.jsx(fe,{children:"How attribution works"}),v.jsxs("p",{children:["When a FIRMS hotspot lands, the bot walks every active fire (those not yet tombstoned) and matches by Haversine distance to that fire's running centroid. If the pixel is within the fire's ",v.jsx(se,{children:"spread_radius_mi"})," ","(default 5 mi, per-fire override available) the pixel is attributed and appended to that fire's growth history. The centroid then re-computes as the median of the last 24 h of attributed pixels, so single-pixel outliers don't drag the perimeter around."]}),v.jsxs("p",{children:["Pixels that match no fire feed the cluster detector instead: if at least"," ",v.jsx(se,{children:"cluster_min_pixels"})," (default 3) lie within"," ",v.jsx(se,{children:"cluster_max_radius_mi"})," (default 1.0) over"," ",v.jsx(se,{children:"cluster_time_window_minutes"})," (default 60), the bot fires a single ",v.jsx(se,{children:"unattributed_hotspot_cluster"})," broadcast and marks the member pixels so a fourth arrival doesn't re-fire the same cluster."]}),v.jsx(fe,{children:"How movement is computed"}),v.jsxs("p",{children:["Each VIIRS pass groups pixels into a ",v.jsx(se,{children:"pass_id"})," (satellite + 90-min bucket). When a pixel from a different bucket arrives, the prior pass closes: its convex hull becomes the perimeter, its median centroid becomes the comparison anchor, and the bot computes drift (Haversine to the previous pass's centroid), an 8-way compass bearing, and a wall-clock mi/h speed. If drift ≥ ",v.jsx(se,{children:"growth_drift_threshold_mi"})," the"," ",v.jsx(se,{children:"wildfire_growth"})," broadcast fires."]}),v.jsx(fe,{children:"How spotting is detected"}),v.jsxs("p",{children:["Once a pass closes its perimeter (a GeoJSON polygon stored on the fire), every subsequent attributed pixel runs a point-in-polygon test. Pixels outside the polygon with a vertex distance ≥"," ",v.jsx(se,{children:"spotting_distance_threshold_mi"})," (default 1.5) fire the"," ",v.jsx(se,{children:"wildfire_spotting"})," broadcast at ",v.jsx("em",{children:"immediate"})," severity — spread beyond the existing perimeter is the most actionable fire signal we emit. A per-fire cooldown (",v.jsx(se,{children:"spotting_cooldown_seconds"}),", default 1 h) prevents an ember burst in the same area from spamming the mesh."]}),v.jsx(fe,{children:"Tunable knobs (Adapter Config → fires)"}),v.jsx(St,{headers:["Key","Default","What it does"],rows:[[v.jsx(se,{children:"spread_radius_mi_default"}),"5.0 mi","Attribution radius for FIRMS → fire matching. Per-fire override in the fires.spread_radius_mi column."],[v.jsx(se,{children:"growth_drift_threshold_mi"}),"0.5 mi","Per-pass centroid drift at or above this fires wildfire_growth."],[v.jsx(se,{children:"halt_passes_threshold"}),"2","Consecutive empty satellite passes before wildfire_halted (documented; the time gate below is the operational rule)."],[v.jsx(se,{children:"halt_minimum_seconds"}),"43,200 (12 h)","Minimum elapsed seconds since the most recent attributed pixel before wildfire_halted can fire."],[v.jsx(se,{children:"spotting_distance_threshold_mi"}),"1.5 mi","Distance from prior-pass perimeter that fires wildfire_spotting."],[v.jsx(se,{children:"spotting_cooldown_seconds"}),"3,600 (1 h)","Minimum seconds between consecutive spotting broadcasts per fire."],[v.jsx(se,{children:"digest_enabled"}),"true","Master toggle for the twice-daily digest."],[v.jsx(se,{children:"digest_schedule"}),'["06:00","18:00"]',"Local-time slots for the digest."],[v.jsx(se,{children:"digest_timezone"}),"America/Boise","IANA tz for digest_schedule."],[v.jsx(se,{children:"digest_max_chars"}),"200","Hard cap on the digest wire (the LLM is told to fit; the chunker enforces)."]]})]}),v.jsxs(gr,{id:"weather-alerts",title:"Weather Alerts",children:[v.jsx(fe,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI watches for NWS (National Weather Service) alerts affecting your area — warnings, watches, and advisories."}),v.jsx(fe,{children:"Alert Severity — How Serious Is It?"}),v.jsx(St,{headers:["Severity","What It Means","Example"],rows:[["Extreme","Life-threatening. The most serious events.","Tornado Emergency, Hurricane Warning, Tsunami Warning"],["Severe","Dangerous. Take protective action.","Tornado Warning, Flash Flood Warning, Blizzard Warning, Red Flag Warning"],["Moderate","Be prepared. Could become dangerous.","Winter Weather Advisory, Wind Advisory, Flood Watch, Heat Advisory"],["Minor","Good to know. Probably won't hurt anyone.","Special Weather Statement, Air Quality Alert"]]}),v.jsx(fe,{children:"When Should I Act? (Urgency)"}),v.jsx(St,{headers:["Urgency","What It Means"],rows:[["Immediate","Do something NOW"],["Expected","Do something within the hour"],["Future","Coming in the next several hours"],["Past","It's over — NWS is clearing the alert"]]}),v.jsx(fe,{children:"How Sure Are They? (Certainty)"}),v.jsx(St,{headers:["Certainty","What It Means"],rows:[["Observed","It's happening right now. Verified."],["Likely","More than 50% chance"],["Possible","Could happen, but less than 50%"],["Unlikely","Probably won't, but mentioned for awareness"]]}),v.jsx(fe,{children:"These Are Separate Scales"}),v.jsx("p",{children:'A single alert has all three. A hurricane warning for next week is "Severe + Future + Likely." A tornado spotted on the ground is "Extreme + Immediate + Observed." An air quality advisory is "Minor + Expected + Possible."'}),v.jsx(fe,{children:"What Minimum Severity Should I Set?"}),v.jsx(St,{headers:["Setting","What You Get","What You Miss"],rows:[["Minor","Everything — high volume","Nothing"],[v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Moderate"})," ✓"]}),"Watches, Advisories, and Warnings","Special Weather Statements"],["Severe","Only Warnings — things happening NOW","Watches (which give you hours of advance warning)"],["Extreme","Only the rarest events","Most Tornado and Severe Thunderstorm Warnings"]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Moderate is recommended."})," It catches Watches (advance warning that conditions may worsen) and Advisories (conditions exist but aren't severe) while filtering out the informational stuff."]}),v.jsx(fe,{children:"Finding Your NWS Zone"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Go to ",v.jsx(zt,{href:"https://www.weather.gov",children:"weather.gov"})]}),v.jsx("li",{children:"Enter your location"}),v.jsxs("li",{children:["Find your zone code at ",v.jsx(zt,{href:"https://www.weather.gov/pimar/PubZone",children:"NWS Zone Map"})]}),v.jsxs("li",{children:["Zone codes look like: ",v.jsx(se,{children:"IDZ016"}),", ",v.jsx(se,{children:"UTZ040"}),", etc."]})]}),v.jsx(fe,{children:"The User-Agent Field"}),v.jsx("p",{children:"NWS wants to know who's using their API — not for approval, just so they can contact you if something breaks. You make it up:"}),v.jsx("p",{children:v.jsx(se,{children:"(meshai, you@email.com)"})}),v.jsx("p",{children:"No registration. No waiting. Just type it in."}),v.jsx(fe,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(zt,{href:"https://alerts.weather.gov",children:"NWS Active Alerts"})," — see current alerts"]}),v.jsxs("li",{children:[v.jsx(zt,{href:"https://www.weather.gov/documentation/services-web-api",children:"NWS API Docs"})," — technical details"]})]})]}),v.jsxs(gr,{id:"solar",title:"Solar & Geomagnetic Conditions",children:[v.jsx(fe,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI tracks space weather — solar activity and its effects on Earth's magnetic field. This matters for radio operators because the sun directly controls how well HF radio works, and major solar events can affect all radio communications."}),v.jsx(fe,{children:"Solar Flux Index (SFI)"}),v.jsx("p",{children:'Think of SFI as a "how active is the sun" number. Higher = better for HF radio, but also higher risk of solar flares.'}),v.jsx(St,{headers:["SFI","What It Means for You"],rows:[["Below 70","Quiet sun. Higher HF bands (10m, 15m) are probably dead. Stick to lower bands."],["70-90","Getting better. Some openings on 15m and above, but inconsistent."],["90-120","Good. Most HF bands work. Reliable contacts on 20m and 15m."],["120-170","Great. All HF bands open. 10m works for worldwide contacts."],["Above 170","Excellent. Best HF conditions — but watch for flares."]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Quick rule"}),": SFI above 90 and Kp below 4 = good day for HF radio."]}),v.jsx(fe,{children:"Kp Index"}),v.jsx("p",{children:"Kp measures how disturbed Earth's magnetic field is, on a 0-9 scale. Higher = more disturbance = worse for HF radio but better for aurora viewing."}),v.jsx(St,{headers:["Kp","What It Means for You"],rows:[["0-2","Quiet. Best HF conditions."],["3","Slightly unsettled. You probably won't notice."],["4","Active. Some noise and fading on HF, especially if you're at higher latitudes."],[v.jsx("strong",{children:"5"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Minor storm (G1)."})," HF noticeably degraded. Aurora visible at high latitudes (~60°N)."]})],[v.jsx("strong",{children:"6"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Moderate storm (G2)."})," HF getting rough. Aurora moving south (~55°N)."]})],[v.jsx("strong",{children:"7"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Strong storm (G3)."})," HF unreliable for 1-2 days. Aurora at mid-latitudes."]})],[v.jsx("strong",{children:"8-9"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Severe/Extreme storm."})," HF may black out completely. Aurora visible at very low latitudes. Power grid stress possible."]})]]}),v.jsx(fe,{children:"R / S / G Scales"}),v.jsx("p",{children:"NOAA's shorthand for three types of space weather events:"}),v.jsx(Rs,{children:"R (Radio Blackouts) — from solar flares:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"R1-R2: Brief HF disruption. You might not notice."}),v.jsx("li",{children:"R3: HF goes out for about an hour on the sunlit side of Earth."}),v.jsx("li",{children:"R4-R5: HF dead for hours. Serious."})]}),v.jsx(Rs,{children:"S (Solar Radiation Storms) — from energetic particles:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"Mostly affects polar regions and satellites"}),v.jsx("li",{children:"S3+: Polar HF goes out entirely"})]}),v.jsx(Rs,{children:"G (Geomagnetic Storms) — from solar wind disturbances:"}),v.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:v.jsx("li",{children:"Same as the Kp scale: G1 = Kp 5, up to G5 = Kp 9"})}),v.jsx(fe,{children:"Bz — The Storm Predictor"}),v.jsx("p",{children:"Bz measures the direction of the solar wind's magnetic field. When it points south (negative values), the solar wind can dump energy into Earth's magnetic field, causing storms."}),v.jsx(St,{headers:["Bz","What It Means"],rows:[["Positive","All good. Solar wind bouncing off."],["0 to -5","Slight coupling. Nothing dramatic."],["-5 to -10","Things starting to pick up. Storm possible."],["Below -10","Storm likely. Kp will start climbing."],["Below -20","Severe storm probable."]]}),v.jsx("p",{children:"Bz can change fast — minute to minute. What matters is whether it stays negative for hours, not brief dips."}),v.jsx(fe,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(zt,{href:"https://www.swpc.noaa.gov",children:"SWPC Space Weather Dashboard"})," — live data"]}),v.jsxs("li",{children:[v.jsx(zt,{href:"https://www.swpc.noaa.gov/noaa-scales-explanation",children:"NOAA Space Weather Scales"})," — what R/S/G mean"]}),v.jsxs("li",{children:[v.jsx(zt,{href:"https://www.hamqsl.com/solar.html",children:"HamQSL Solar Page"})," — ham-friendly display"]}),v.jsxs("li",{children:[v.jsx(zt,{href:"https://www.swpc.noaa.gov/products/planetary-k-index",children:"Planetary K-Index"})," — live Kp"]})]})]}),v.jsxs(gr,{id:"ducting",title:"Tropospheric Ducting",children:[v.jsx(fe,{children:"What You're Looking At"}),v.jsx("p",{children:'Sometimes the atmosphere creates an invisible "pipe" that traps radio signals and carries them much farther than normal. This is called tropospheric ducting. It mostly affects VHF and UHF frequencies.'}),v.jsx("p",{children:"MeshAI watches for these conditions by analyzing weather data (temperature and humidity at different altitudes) over your mesh area."}),v.jsx(fe,{children:"How Do I Know If Ducting Is Happening?"}),v.jsx("p",{children:'MeshAI reports a "condition" based on the atmospheric profile:'}),v.jsx(St,{headers:["Condition","What It Means"],rows:[["Normal","Standard propagation. Nothing unusual."],["Super-refraction","Slightly enhanced range. You might hear a few more distant stations than usual."],["Surface Duct","Radio signals trapped near the ground. You may hear stations hundreds of km away that you've never heard before."],["Elevated Duct",'Same effect but the "pipe" is up in the atmosphere. Affects signals passing through that altitude.']]}),v.jsx(fe,{children:"What You'll Actually Notice"}),v.jsx("p",{children:"When ducting happens on your mesh:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"Distant repeaters you've never heard suddenly come in"}),v.jsx("li",{children:"Nodes appear from far outside your normal range"}),v.jsx("li",{children:"You hear FM radio stations from other cities"}),v.jsx("li",{children:"ADS-B flight tracking range gets much longer"}),v.jsx("li",{children:"There might be interference from distant stations on your frequency"})]}),v.jsx(fe,{children:"The dM/dz Number"}),v.jsx("p",{children:`The dashboard shows a "dM/dz" value in "M-units/km." You don't need to understand the math — just know:`}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Around 118"})," = normal atmosphere"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Below 79"})," = enhanced propagation starting"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Below 0 (negative)"})," = ducting is happening"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Below -50"})," = strong ducting — classic VHF/UHF DX event"]})]}),v.jsx(fe,{children:"When Does Ducting Happen?"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"Under high-pressure weather systems (clear, stable air)"}),v.jsx("li",{children:"When warm air sits on top of cool air (temperature inversion)"}),v.jsx("li",{children:"Most common in late summer and early fall"}),v.jsx("li",{children:"Strongest along coastlines and over water"}),v.jsx("li",{children:"In mountain valleys: cold air pooling in fall/winter can create surface ducts"})]}),v.jsx(fe,{children:"Setting It Up"}),v.jsx("p",{children:"Just configure the latitude and longitude of the center of your mesh area in Config → Environmental → Ducting. MeshAI checks the atmospheric conditions there every 3 hours using free weather model data. No API key needed."}),v.jsx(fe,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(zt,{href:"https://dxinfocentre.com/tropo.html",children:"Tropo Forecast Maps (Hepburn)"})," — 6-day tropo prediction"]}),v.jsxs("li",{children:[v.jsx(zt,{href:"https://dxmaps.com",children:"DX Maps"})," — real-time VHF/UHF propagation reports"]}),v.jsxs("li",{children:[v.jsx(zt,{href:"https://en.wikipedia.org/wiki/Tropospheric_propagation",children:"Wikipedia: Tropospheric Propagation"})," — background"]})]})]}),v.jsxs(gr,{id:"avalanche",title:"Avalanche Danger",children:[v.jsx(fe,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI pulls avalanche forecasts from your regional avalanche center during winter months. The danger scale has 5 levels and it's the same across all of North America."}),v.jsx(fe,{children:"The Danger Scale"}),v.jsx(St,{headers:["Level","Name","Color","What To Do"],rows:[["1","Low",v.jsx(er,{color:"green"}),"Generally safe. Normal caution in steep terrain."],["2","Moderate",v.jsx(er,{color:"yellow"}),"Be careful on specific terrain features. Evaluate conditions."],["3","Considerable",v.jsx(er,{color:"orange"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"DANGEROUS."}),` This is where most people die in avalanches — they see "3 out of 5" and think it's fine. It's not. Use extreme caution.`]})],["4","High",v.jsx(er,{color:"red"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Very dangerous."})," Stay off anything steep."]})],["5","Extreme",v.jsx(er,{color:"black"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Don't go out."})," Avalanches are happening on their own."]})]]}),v.jsx(fe,{children:"The Most Important Thing to Know"}),v.jsxs("p",{children:[v.jsx("strong",{children:"Level 3 (Considerable) kills more people than any other level."}),' People look at "3 out of 5" and think "middle of the road, probably okay." In reality, the risk roughly doubles at each step up the scale. Level 3 is where dangerous conditions overlap with people thinking they can handle it.']}),v.jsx(fe,{children:"Seasonal"}),v.jsx("p",{children:'MeshAI only checks avalanche conditions during winter months (configurable, default December through April). Outside season, it shows "off season" and saves API calls.'}),v.jsx(fe,{children:"Finding Your Avalanche Center"}),v.jsxs("p",{children:["Go to ",v.jsx(zt,{href:"https://avalanche.org/avalanche-centers/",children:"avalanche.org/avalanche-centers/"})," for a map. Common center codes:"]}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(se,{children:"SNFAC"})," — Sawtooth (central Idaho)"]}),v.jsxs("li",{children:[v.jsx(se,{children:"UAC"})," — Utah"]}),v.jsxs("li",{children:[v.jsx(se,{children:"NWAC"})," — Cascades/Olympics (WA/OR)"]}),v.jsxs("li",{children:[v.jsx(se,{children:"CAIC"})," — Colorado"]}),v.jsxs("li",{children:[v.jsx(se,{children:"SAC"})," — Sierra Nevada (CA)"]}),v.jsxs("li",{children:[v.jsx(se,{children:"GNFAC"})," — Gallatin (SW Montana)"]})]}),v.jsx(fe,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(zt,{href:"https://avalanche.org",children:"Avalanche.org"})," — US forecasts"]}),v.jsxs("li",{children:[v.jsx(zt,{href:"https://avalanche.org/avalanche-encyclopedia/human/resources/north-american-public-avalanche-danger-scale/",children:"Avalanche Danger Scale"})," — full scale explanation"]}),v.jsxs("li",{children:[v.jsx(zt,{href:"https://kbyg.org",children:"Know Before You Go"})," — avalanche awareness"]})]})]}),v.jsxs(gr,{id:"traffic",title:"Traffic Flow",children:[v.jsx(fe,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI monitors traffic speed on road segments you configure, using data from TomTom (real vehicles with navigation apps reporting their speed)."}),v.jsx(fe,{children:"Speed Ratio — The Key Number"}),v.jsx("p",{children:'MeshAI compares current speed to "free-flow speed" (what traffic normally does when the road is empty). The ratio tells you how congested it is:'}),v.jsx(St,{headers:["Ratio","What It Means"],rows:[[v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"green"})," Above 85%"]}),"Normal. Traffic flowing fine."],[v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"yellow"})," 65-85%"]}),"Slow. Heavier than usual but moving."],[v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"orange"})," 40-65%"]}),"Congested. Significant delays."],[v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"red"})," Below 40%"]}),"Gridlock. Barely moving."]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Note"}),`: "free-flow speed" is NOT the speed limit. It's what traffic actually does on that road when nobody's in the way. Drivers often exceed speed limits on open highways.`]}),v.jsx(fe,{children:"Confidence — Can You Trust the Data?"}),v.jsx("p",{children:"TomTom's confidence score tells you how much of the reading comes from real vehicles right now vs historical averages:"}),v.jsx(St,{headers:["Confidence","What It Means"],rows:[["Above 0.9","Very reliable — lots of real-time probe data"],["0.7-0.9","Good — mix of real-time and historical"],["Below 0.7",v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Unreliable"})," — mostly guessing from historical patterns. Don't alert on this."]})]]}),v.jsx("p",{children:"Set minimum confidence to 0.7 to avoid false congestion alerts at night or on rural roads where few probe vehicles drive."}),v.jsx(fe,{children:"Setting Up Corridors"}),v.jsx("p",{children:'Each "corridor" is a point on a road you want to monitor. To add one:'}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"Go to Google Maps, find the road"}),v.jsx("li",{children:`Right-click the road → "What's here?" → copy the coordinates`}),v.jsx("li",{children:"Add the corridor in Config with a name and those coordinates"}),v.jsx("li",{children:"TomTom finds the nearest road segment automatically"})]}),v.jsx(fe,{children:"Getting an API Key"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Sign up at ",v.jsx(zt,{href:"https://developer.tomtom.com",children:"developer.tomtom.com"})," (free)"]}),v.jsx("li",{children:"Create an app → get your API key"}),v.jsx("li",{children:"Free tier: 2,500 requests/day (plenty for 5-10 corridors)"})]}),v.jsx(fe,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(zt,{href:"https://developer.tomtom.com",children:"TomTom Developer Portal"})," — API docs and key signup"]}),v.jsxs("li",{children:[v.jsx(zt,{href:"https://www.tomtom.com/traffic-index/",children:"TomTom Traffic Index"})," — city congestion rankings"]})]})]}),v.jsxs(gr,{id:"roads-511",title:"Road Conditions (511)",children:[v.jsx(fe,{children:"What You're Looking At"}),v.jsx("p",{children:"511 systems report road closures, construction, weather events, mountain pass conditions, and incidents. Every state runs their own 511 system — there is no national API."}),v.jsx(fe,{children:"Setting It Up"}),v.jsx("p",{children:"You need to find YOUR state's 511 developer API. MeshAI does not include a default URL because every state is different. Some states have free public APIs, some require registration, and some don't have developer APIs at all."}),v.jsx("p",{children:"Configure in Config → Environmental → 511:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Base URL"})," — your state's API endpoint"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"API Key"})," — if required by your state"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Endpoints"})," — which data feeds to poll (varies by state)"]})]}),v.jsx(fe,{children:"Learn More"}),v.jsx("p",{children:"Check your state's 511 or DOT website for developer information."})]}),v.jsxs(gr,{id:"mesh-health",title:"Mesh Health",children:[v.jsx(fe,{children:"Health Score"}),v.jsx("p",{children:"MeshAI computes a 0-100 health score for your mesh network by looking at five areas, each weighted differently:"}),v.jsx(St,{headers:["Pillar","Weight","What It Measures"],rows:[[v.jsx("strong",{children:"Infrastructure"}),"30%","Are your routers online?"],[v.jsx("strong",{children:"Utilization"}),"25%","Is the radio channel congested?"],[v.jsx("strong",{children:"Coverage"}),"20%","Do nodes have redundant paths to gateways?"],[v.jsx("strong",{children:"Behavior"}),"15%","Are any nodes flooding the channel?"],[v.jsx("strong",{children:"Power"}),"10%","Are battery-powered nodes running low?"]]}),v.jsx("p",{children:"The overall score is the weighted sum:"}),v.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"Score = (Infrastructure × 30%) + (Utilization × 25%) + (Coverage × 20%) + (Behavior × 15%) + (Power × 10%)"}),v.jsx(fe,{children:"How Each Pillar Is Calculated"}),v.jsx(Rs,{children:"Infrastructure (30%)"}),v.jsx("p",{children:"This is the simplest pillar — what percentage of your infrastructure nodes are currently online?"}),v.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"(routers online ÷ total routers) × 100"}),v.jsxs("p",{children:["Only nodes with the ",v.jsx(se,{children:"ROUTER"}),", ",v.jsx(se,{children:"ROUTER_LATE"}),", or ",v.jsx(se,{children:"ROUTER_CLIENT"})," role count as infrastructure. Regular client nodes going offline doesn't affect this score. If you have 5 routers and 3 are online, infrastructure scores 60."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Special case:"})," If you have no routers at all (all clients), this pillar scores 100. You're not penalized for not having infrastructure — you just don't have any to track."]}),v.jsx(Rs,{children:"Utilization (25%)"}),v.jsxs("p",{children:["MeshAI reads the channel utilization that each router reports in its telemetry — this is the firmware's own measurement of how busy the radio channel is. MeshAI uses the ",v.jsx("strong",{children:"highest"})," value from any infrastructure node because the busiest router is the bottleneck for the whole mesh."]}),v.jsx("p",{children:v.jsx("strong",{children:"How it works:"})}),v.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-4",children:[v.jsxs("li",{children:["Collect ",v.jsx(se,{children:"channel_utilization"})," from all infrastructure nodes that report it"]}),v.jsx("li",{children:"If no infra nodes have telemetry, try all nodes"}),v.jsxs("li",{children:["Use the ",v.jsx("strong",{children:"maximum"})," value for scoring (busiest node = bottleneck)"]}),v.jsx("li",{children:"If no nodes report utilization (older firmware), fall back to packet count estimate"})]}),v.jsxs("p",{className:"mt-4",children:[v.jsx("strong",{children:"Fallback method"})," (when telemetry unavailable): estimates from packet counts using 200ms/packet airtime. This is less accurate — it assumes MediumFast preset and sums packets across all nodes."]}),v.jsx(St,{headers:["Channel Utilization","Score","What It Means"],rows:[["Under 20%","100","Channel is clear — this is the goal"],["20-25%","75-100","Slight degradation, occasional collisions"],["25-35%","50-75","Severe degradation — firmware throttling active"],["35-45%","25-50","Mesh struggling badly — reliability dropping"],["Over 45%","0-25","Mesh is effectively unusable"]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Special case:"})," If no utilization data is available (no telemetry and no packet data), this pillar scores 100. You're not penalized for missing data."]}),v.jsx(Rs,{children:"Coverage (20%)"}),v.jsx("p",{children:'Measures gateway redundancy — how many of your data sources can "see" each node. A node reported by all 3 of your gateways has full coverage. A node only seen by 1 gateway is a single point of failure.'}),v.jsxs("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:["coverage_ratio = average_gateways_per_node ÷ total_sources",v.jsx("br",{}),"single_gw_penalty = (single_gateway_nodes ÷ total_nodes) × 40"]}),v.jsx("p",{children:"If a node is seen by 2 out of 3 sources, its coverage ratio is 0.67. Infrastructure nodes with only single-gateway coverage get an extra penalty — they're critical but have no backup path."}),v.jsx(St,{headers:["Coverage Ratio","Base Score","After Penalty"],rows:[["100% (all sources)","100","100 minus single-gw penalty"],["70-99%","90","Minus penalties"],["50-69%","70","Minus penalties"],["Under 50%","50 or less","Heavy penalty"]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Special case:"})," With only 1 data source, this pillar can't score well — there's no redundancy to measure. Coverage becomes meaningful when you have 2+ sources (MeshMonitor + MQTT, multiple gateways, etc.)."]}),v.jsx(Rs,{children:"Behavior (15%)"}),v.jsx("p",{children:"Counts how many nodes are sending an unusually high number of non-text packets. This catches firmware bugs, stuck transmitters, and misconfigured nodes that are flooding the channel."}),v.jsxs("p",{children:[v.jsx("strong",{children:"What counts as flooding:"})," More than 500 non-text packets in 24 hours. Text messages don't count — the behavior pillar only flags telemetry, position, and routing packet floods."]}),v.jsx(St,{headers:["Flagged Nodes","Score"],rows:[["0","100"],["1","80"],["2-3","60"],["4-5","40"],["6+","20"]]}),v.jsx("p",{children:"A single misbehaving node only drops the score to 80. It takes multiple problem nodes to seriously hurt the behavior pillar."}),v.jsx(Rs,{children:"Power (10%)"}),v.jsx("p",{children:"Measures what fraction of battery-powered nodes are below the warning threshold (default 20%)."}),v.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"100 × (1 − low_battery_nodes ÷ total_battery_nodes)"}),v.jsx("p",{children:"If 2 out of 10 battery nodes are below 20%, power scores 80."}),v.jsxs("p",{children:[v.jsx("strong",{children:"Important:"})," USB-powered nodes are excluded from this calculation. Many nodes report 100% battery even when running on wall power with no battery installed. Only nodes actually running on batteries affect this pillar."]}),v.jsx(fe,{children:"Health Tiers"}),v.jsx(St,{headers:["Score","Tier","What It Means"],rows:[["90-100",v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"green"})," Healthy"]}),"Everything's working well."],["75-89",v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"yellow"})," Slight degradation"]}),"Some issues but the mesh is functional."],["50-74",v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"orange"})," Unhealthy"]}),"Multiple problems. Reliability is affected."],["25-49",v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"red"})," Warning"]}),"Significant issues. The mesh is struggling."],["0-24",v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"black"})," Critical"]}),"Major failures. Barely functional."]]}),v.jsx(fe,{children:"Channel Utilization — Is the Radio Channel Full?"}),v.jsx("p",{children:"Meshtastic radios share one LoRa channel. If too many nodes are transmitting too often, they step on each other and messages get lost."}),v.jsx(St,{headers:["Utilization","What's Happening"],rows:[[v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"green"})," Under 25%"]}),"Healthy. The firmware itself starts throttling above 25% to protect the channel — so under 25% is the target."],[v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"yellow"})," 25-40%"]}),"Getting busy. Common on larger meshes. Worth watching."],[v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"orange"})," 40-50%"]}),"Congested. The firmware throttles GPS updates above 40%. Messages are colliding and retrying."],[v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"red"})," Over 50%"]}),"Serious problem. More time is spent retrying than communicating. Mesh reliability drops fast."],[v.jsxs(v.Fragment,{children:[v.jsx(er,{color:"black"})," Over 65%"]}),"Documented failure point on busy LONG_FAST meshes. The mesh becomes unusable."]]}),v.jsx(fe,{children:"Packet Flooding"}),v.jsx("p",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-yellow-200",children:v.jsx("strong",{children:'⚠️ "Packet flooding" means a node sending too many RADIO PACKETS. This has nothing to do with water flooding.'})}),v.jsx("p",{children:"A normal Meshtastic node sends a packet every few minutes (announcing itself, reporting telemetry, updating position). If a node starts blasting packets every few seconds, something is wrong — firmware bug, stuck transmitter, or misconfiguration."}),v.jsx(St,{headers:["Packets per Minute","What It Means"],rows:[["1-5","Normal"],["5-10","Elevated — might be someone chatting a lot"],["10-20","Suspicious — worth investigating"],["Over 30","Something is broken. This node is actively hurting the mesh."]]}),v.jsx(fe,{children:"Battery Levels"}),v.jsx("p",{children:"Most Meshtastic radios (T-Beam, RAK4631, Heltec V3) use a single lithium battery cell. The voltage tells you how much charge is left:"}),v.jsx(St,{headers:["Voltage","Charge","What To Do"],rows:[["4.20V","100%","Full"],["3.80V","~60%","Fine"],[v.jsx("strong",{children:"3.60V"}),v.jsx("strong",{children:"~30%"}),v.jsx(v.Fragment,{children:v.jsx("strong",{children:"⚠️ Warning — charge it soon"})})],[v.jsx("strong",{children:"3.50V"}),v.jsx("strong",{children:"~15%"}),v.jsx(v.Fragment,{children:v.jsx("strong",{children:"🔴 Low — charge it now"})})],[v.jsx("strong",{children:"3.40V"}),v.jsx("strong",{children:"~7%"}),v.jsx(v.Fragment,{children:v.jsx("strong",{children:"⚫ About to die"})})],["3.30V","~3%","Device shutting down"]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"USB-powered nodes"})," report 100% battery even if there's no battery installed. Battery alerts only matter for nodes actually running on battery power."]}),v.jsx(fe,{children:"Node Offline Detection"}),v.jsx("p",{children:`MeshAI marks a node as "offline" when it hasn't been heard for a configurable time period. Different node types need different thresholds:`}),v.jsx(St,{headers:["Node Type","Recommended Threshold","Why"],rows:[["Fixed infrastructure (wall power)",v.jsx("strong",{children:"2 hours"}),"These should always be transmitting. 2 hours of silence means something is wrong."],["Fixed client (wall power)","2-4 hours","Same logic, slightly more lenient."],["Mobile / vehicle","4-8 hours","They go behind mountains, into garages, out of range. Normal."],["Solar-powered","12-24 hours","May shut down at night when solar stops charging."]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Rule of thumb"}),`: set the threshold to about 4× the node's beacon interval. Too tight and nodes will constantly flap "offline/online" from normal gaps. Too loose and real outages go unnoticed.`]})]}),v.jsxs(gr,{id:"broadcast-types",title:"Broadcast Types",children:[v.jsx("p",{children:"Every broadcast the bot sends to the mesh carries a one-word prefix that tells you what kind of update it is. Three types:"}),v.jsx(St,{headers:["Prefix","What it means","When you see it"],rows:[[v.jsx(se,{children:"New:"}),"The first time the bot has ever broadcast about this event","Cache Peak Fire's WFIGS first-sight; FIRMS cluster's first 3-pixel detection; first NWS warning for a CAP id"],[v.jsx(se,{children:"Update:"}),"A material change on something the bot already announced","Cache Peak Fire's acreage grew; ITD 511 work zone's lane status changed; quake event's magnitude was revised"],[v.jsx(se,{children:"Active:"}),"A clock-driven reminder that an already-announced event is still live","Cache Peak Fire is still burning 8 hours later; an SWPC G3 storm is still in progress"]]}),v.jsx("p",{children:"The bot tracks first-broadcast time and last-broadcast time separately on every event row, so a New: prefix is only emitted once even after a container restart. Update: respects per-adapter cooldowns (WFIGS is 8 h by default; ITD 511 is per-incident). Active: is the reminder system, covered in the next section."})]}),v.jsxs(gr,{id:"reminders",title:"Reminder System",children:[v.jsxs("p",{children:["Some events stay live for days. A wildfire doesn't go out because WFIGS stopped publishing updates; a geomagnetic storm doesn't end because SWPC went quiet on the wire. The reminder system fires a clock-driven"," ",v.jsx(se,{children:"Active:"}),"-prefixed re-broadcast on a human-scale cadence so an operator who came on shift after the original announcement still sees the event."]}),v.jsx(fe,{children:"Cadences"}),v.jsx(St,{headers:["Adapter","Reminder cadence","Termination"],rows:[[v.jsxs(v.Fragment,{children:[v.jsx(se,{children:"wfigs"})," (wildfires)"]}),"Every 8 h while the fire is still active","WFIGS publishes a tombstone (incident closed) → fires.tombstoned_at is stamped → reminder loop stops"],[v.jsxs(v.Fragment,{children:[v.jsx(se,{children:"swpc"})," (space weather)"]}),"Every 8 h while a Kp >= floor / X-class flare / proton-storm event is ongoing","The next SWPC envelope shows the storm has subsided"],[v.jsx(se,{children:"itd_511_work_zone"}),"Per-zone, configurable in the rule UI","WZDx publishes the zone with end_date in the past"]]}),v.jsx(fe,{children:"The tombstone"}),v.jsxs("p",{children:["When a WFIGS update declares an incident closed, the bot stamps"," ",v.jsx(se,{children:"fires.tombstoned_at"})," with the close time. The reminder scheduler treats ",v.jsx(se,{children:"tombstoned_at IS NOT NULL"}),` as "stop broadcasting Active: for this fire," and the LLM context layer treats it as "this fire is in the closed-out archive." A subsequent FIRMS pixel inside that fire's spread radius does not re-open it — closure is authoritative from NIFC.`]}),v.jsx(fe,{children:"Turning reminders off"}),v.jsxs("p",{children:["Per-adapter on/off lives in ",v.jsx(se,{children:"adapter_meta.reminder_enabled"})," ","and is exposed on the Adapter Config page. The reminders themselves flow through the same dispatcher gates as everything else, so they still respect cooldowns, the cold-start grace window, and your notification rules."]})]}),v.jsxs(gr,{id:"notifications",title:"Notifications",children:[v.jsx(fe,{children:"How It Works"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Something happens"})," — a fire is detected, weather warning issued, node goes offline, etc."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"MeshAI checks your rules"})," — does this event match any of your notification rules? Is it severe enough?"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"If a rule matches"})," — MeshAI sends the notification through whatever delivery method that rule is configured for."]})]}),v.jsx(fe,{children:"Building Rules"}),v.jsx("p",{children:"Each rule answers three questions:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"WHEN"})," does it trigger? (which categories, what severity)"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"WHERE"})," does it send? (mesh broadcast, email, webhook, etc.)"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"HOW OFTEN"})," at most? (cooldown period)"]})]}),v.jsx("p",{children:'Use "Add from Template" to start with a pre-built rule and customize it, or build from scratch with "Add Rule."'}),v.jsx(fe,{children:"Severity Levels — What Should I Set?"}),v.jsx(St,{headers:["Level","When It's Used","Notification Volume"],rows:[["Info","Routine stuff (ducting detected, new router appeared)","High — lots of messages"],["Advisory","Worth knowing (weather advisory, slow traffic, battery declining)","Moderate"],["Watch","Pay attention (fire within 50km, weather watch, stream rising)","Low-moderate"],[v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Warning"})," ✓"]}),"Take action (fire within 15km, severe weather, critical battery)","Low — recommended for most rules"],["Emergency","Life safety (extreme weather, fire at infrastructure, total blackout)","Very rare"]]}),v.jsxs("p",{children:[v.jsx("strong",{children:'"Warning" is the sweet spot for most rules.'})," You get alerted when something actually needs your attention without being overwhelmed by every minor event."]}),v.jsx(fe,{children:"Webhook — The Swiss Army Knife"}),v.jsx("p",{children:"A webhook sends your alert as an HTTP POST to any URL. This one delivery method works with:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Discord"})," — use a Discord webhook URL"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Slack"})," — use a Slack incoming webhook URL"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"ntfy.sh"})," — POST to ",v.jsx(se,{children:"https://ntfy.sh/your-topic"})]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Pushover"})," — POST to the Pushover API"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Home Assistant"})," — POST to an automation webhook URL"]}),v.jsx("li",{children:"Anything else that accepts HTTP POST"})]}),v.jsx("p",{children:"MeshAI doesn't need to know what's on the other end. Give it the URL and it works."})]}),v.jsxs(gr,{id:"commands",title:"Commands",children:[v.jsxs("p",{children:["All commands use the ",v.jsx(se,{children:"!"})," prefix (configurable). Send these as a direct message to MeshAI on your mesh."]}),v.jsx(fe,{children:"Basic Commands"}),v.jsx(St,{headers:["Command","What It Does"],rows:[[v.jsx(se,{children:"!help"}),"Shows all available commands"],[v.jsx(se,{children:"!ping"}),"Tests if the bot is alive"],[v.jsx(se,{children:"!status"}),"Quick mesh summary (nodes online, health score)"],[v.jsx(se,{children:"!health"}),"Detailed health report with pillar scores"],[v.jsx(se,{children:"!weather"}),"Current weather for your area"]]}),v.jsx(fe,{children:"Environmental Commands"}),v.jsx(St,{headers:["Command","What It Does"],rows:[[v.jsx(se,{children:"!alerts"}),"Active NWS weather alerts for your area"],[v.jsxs(v.Fragment,{children:[v.jsx(se,{children:"!solar"})," (or ",v.jsx(se,{children:"!hf"}),")"]}),"Current solar indices and RF conditions"],[v.jsx(se,{children:"!fire"}),"Active wildfires near your mesh"],[v.jsx(se,{children:"!avy"}),'Avalanche advisory (seasonal — shows "off season" in summer)'],[v.jsxs(v.Fragment,{children:[v.jsx(se,{children:"!streams"})," (or ",v.jsx(se,{children:"!gauges"}),")"]}),"Stream gauge readings"],[v.jsxs(v.Fragment,{children:[v.jsx(se,{children:"!roads"})," (or ",v.jsx(se,{children:"!traffic"}),")"]}),"Road conditions and traffic flow"],[v.jsx(se,{children:"!hotspots"}),"Satellite fire detections"]]}),v.jsx(fe,{children:"Subscription Commands"}),v.jsx(St,{headers:["Command","What It Does"],rows:[[v.jsx(se,{children:"!subscribe"}),"Lists all alert categories you can subscribe to"],[v.jsx(se,{children:"!subscribe fire_proximity"}),"Subscribe to a specific category"],[v.jsx(se,{children:"!subscribe all"}),"Subscribe to everything"],[v.jsx(se,{children:"!unsubscribe fire_proximity"}),"Unsubscribe from a category"],[v.jsx(se,{children:"!subscriptions"}),"Shows what you're currently subscribed to"]]}),v.jsx(fe,{children:"Conversational"}),v.jsxs("p",{children:[`Bang commands are the short, predictable interface. For anything that doesn't map cleanly to a single command — "how's the mesh doing?", "is there any ducting?", "why didn\\'t I hear about anything today?" — you can DM the bot in plain English. The LLM DM path covers the same data the commands cover, plus the dispatcher drop audit, with honest "no data" answers when a feed is quiet. Full catalog under`," ",v.jsx("a",{href:"#llm-dm",className:"text-accent hover:underline",children:"LLM DM Queries"}),"."]})]}),v.jsxs(gr,{id:"llm-dm",title:"LLM DM (Natural-Language Queries)",children:[v.jsxs("p",{children:["Bang commands like ",v.jsx(se,{children:"!fire"})," are short and predictable — the right tool on a mesh-constrained interface. For anything else, you can DM the bot in plain English and it will answer from the same live environmental data the broadcast pipeline uses. Both paths work; pick whichever fits the question."]}),v.jsx(fe,{children:"What it can answer"}),v.jsx("p",{children:"When you DM the bot a question, the env_reporter layer assembles up to seven data blocks and injects them into the LLM's system prompt. Each block maps to one adapter:"}),v.jsx(St,{headers:["Adapter block","Example question that hits it","What you get back"],rows:[[v.jsx(se,{children:"build_fires_detail"}),'"are there any fires near me?"',"Active WFIGS-declared fires, acreage, containment, declared_at, county/state"],[v.jsx(se,{children:"build_alerts_detail"}),'"any weather alerts?"',"Active NWS CAP alerts: type, severity, area, expiry"],[v.jsx(se,{children:"build_quakes_detail"}),'"any earthquakes nearby?"',"USGS quakes in the last 24h: magnitude, depth, place"],[v.jsx(se,{children:"build_traffic_detail"}),'"how is traffic on I-84?" / "any road closures?"',"TomTom + ITD 511 active incidents"],[v.jsx(se,{children:"build_gauges_detail"}),'"what is the snake river level?"',"USGS NWIS latest readings + flood stages"],[v.jsx(se,{children:"build_swpc_detail"}),'"what are the band conditions?" / "any space weather?"',"Recent SWPC events + band-conditions ratings"],[v.jsx(se,{children:"build_drop_audit"}),`"why didn't I hear about anything today?"`,"Event log: what envelopes the dispatcher filtered, by adapter + category"]]}),v.jsx(fe,{children:"The grounding rule"}),v.jsxs("p",{children:["The bot is told to answer ",v.jsx("em",{children:"only"}),' from the blocks in the system prompt. If a block is empty (no recent quakes, no active NWS alerts), the response is honest about it: "No active weather alerts right now," not a fabricated "144 earthquakes worldwide in the past 24 hours." That clamp closes the failure mode where the LLM defaulted to its training data when local tables were quiet.']}),v.jsx(fe,{children:"Excluding an adapter from LLM context"}),v.jsxs("p",{children:["The ",v.jsx(se,{children:"include_in_llm_context"})," toggle on each adapter's row in Adapter Config decides whether that adapter's ",v.jsx(se,{children:"build_*"})," ","block lands in the system prompt. Turn an adapter off here if you don't want the bot's natural-language answers to draw on it (e.g. you ingest TomTom for situational awareness but don't want it cited in DM answers). Broadcasts are unaffected — this toggle gates LLM context only."]}),v.jsx(fe,{children:"What it can't answer"}),v.jsx("p",{children:`The bot has no general internet access. Questions that need data the env_reporter doesn't carry ("what's the weather forecast tomorrow", "who's the current president") fall back to whatever the configured LLM backend knows from training. The grounding clamp keeps the bot from inventing local data, but it can't keep the LLM from speculating about non-local topics.`})]}),v.jsxs(gr,{id:"or-not-and",title:"OR-not-AND Architecture",children:[v.jsx("p",{children:"Every environmental adapter pulls its data from one of two places:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Central"})," (canonical) — Central polls the upstream feed once on behalf of the whole fleet and re-publishes normalized envelopes over NATS JetStream. MeshAI subscribes. One Central poll, one canonical normalization, many subscribers."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Native"})," — MeshAI polls the upstream feed directly. Stays around for adapters Central doesn't carry yet (currently Tropospheric Ducting and Avalanche Center advisories) and for operators who don't run Central."]})]}),v.jsx(fe,{children:"Why mutually exclusive"}),v.jsxs("p",{children:["An adapter is set to ",v.jsx("strong",{children:"either"})," Central ",v.jsx("strong",{children:"or"})," ","native, never both. Running both at the same time is what the codebase calls the ",v.jsx("em",{children:"AND-mode anti-pattern"}),": two independent poll loops on the same upstream feed, duplicate broadcasts, duplicate cursor state, no shared dedup. The Spokane-class leak (cross-state broadcasts that escaped the bbox filter in May 2026) was caused by an inadvertent AND-mode on the traffic adapter; the fix made the gate enforce mutual exclusion at boot and on every config save."]}),v.jsx(fe,{children:"The per-adapter source toggle"}),v.jsxs("p",{children:["Set ",v.jsx(se,{children:"feed_source"})," on each adapter's row in Environment:"]}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(se,{children:"central"})," — disable the native poll loop, subscribe to the matching Central subject pattern."]}),v.jsxs("li",{children:[v.jsx(se,{children:"native"})," — disable the Central subscription for this adapter, run the native poller."]})]}),v.jsxs("p",{children:["On the GUI, adapters with ",v.jsx("em",{children:"no Central counterpart yet"}),` show their Central button disabled with a "native only" tooltip. That's not an AND state; the adapter is still single-source, just locked to native by upstream availability.`]}),v.jsx(fe,{children:"Where this surfaces in tooltips"}),v.jsxs("p",{children:[`You'll see "AND-model anti-pattern" referenced in two places: the USGS-lookup button on Gauge Sites (disabled when the USGS adapter is on Central, because doing a one-off direct USGS poll from the GUI while the runtime is on Central is precisely the AND-mode this rule forbids) and the env_routes 404 response on`," ",v.jsxs(se,{children:["/api/env/usgs/lookup/","{site_id}"]})," in central-feed mode. Both surfaces refuse to fall back to a direct upstream call; the right answer is to enter values manually or source them from Central."]})]}),v.jsxs(gr,{id:"adapter-config",title:"Adapter Config & the CODE Rule",children:[v.jsx("p",{children:"The Adapter Config page is the single hub for ~50 GUI-editable knobs across the 13 adapters that touch the broadcast pipeline. Changes take effect on the next handler call — no container restart needed for most keys."}),v.jsx(fe,{children:"The CONFIG-vs-CODE rule"}),v.jsx("p",{children:"Not everything tunable becomes a GUI row. The codebase splits along one rule:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"CONFIG"})," (lives on this page) — where you send (channels), how often (cadences, schedules), thresholds (magnitude floors, severity gates, distance radii, cooldown durations, freshness windows), curation data (which sites, states, codes), toggles (enabled, include_in_llm_context)."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"CODE"})," (stays in the handlers, not on the GUI) — sentence templates, emoji choices, mapping / translation functions (TomTom icon_map, ITD sub_type_map, Central adapter_map and category_map), rendering logic (anchor priority order, expires-buckets formatting, threshold-state labels), heuristic logic (band_conditions Kp/SFI → Good/Fair/Poor function)."]})]}),v.jsx("p",{children:"If you find yourself wanting to add a wire-string template or an emoji to the GUI, stop — that's CODE. If you want to change a threshold or a curation list, the GUI is the right place."}),v.jsx(fe,{children:"Restart-required vs live"}),v.jsx("p",{children:"Most keys take effect on the next handler call (the env_store re-reads from the database). A short list requires a container restart, because they govern startup-only wiring:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Anything under the ",v.jsx(se,{children:"environmental"})," section on the Config page (feed_source, central URL, etc.). The Spokane-fix gate runs at env_store boot and at CentralConsumer subscribe — both happen only at startup."]}),v.jsx("li",{children:"The LLM backend swap (Google → Anthropic → OpenAI)."}),v.jsx("li",{children:"The dispatcher cold-start grace window."})]}),v.jsx("p",{children:`When you save one of those keys via the GUI, a yellow Restart-Required banner surfaces at the top of the page with a "Restart now" button. Until you click it, the on-disk config and the running config intentionally disagree — that's the OR-not-AND gate refusing to transition mid-flight.`}),v.jsxs(fe,{children:["The ",v.jsx(se,{children:"include_in_llm_context"})," toggle"]}),v.jsxs("p",{children:[`Each adapter's card on Adapter Config carries a per-adapter "LLM context" switch. When off, that adapter's `,v.jsx(se,{children:"build_*"})," ","env_reporter block is skipped during system-prompt assembly. Broadcasts are unaffected; this toggle is purely about what the LLM sees when you DM it. See the LLM DM section above for the seven adapter blocks this gates."]})]}),v.jsxs(gr,{id:"curation",title:"Curation: Gauge Sites & Town Anchors",children:[v.jsx("p",{children:"Two curation tables drive the broadcast text the bot puts on the mesh. Both are CRUD UIs with per-row enable/disable; both fall through to fallback chains when a row is missing or disabled."}),v.jsx(fe,{children:"Gauge Sites"}),v.jsx("p",{children:"Stream gauge thresholds for the USGS NWIS handler. Each row pairs a USGS site_id with a human gauge name, lat/lon, and four NWS-AHPS flood thresholds in feet: Action, Minor, Moderate, Major. The handler compares an incoming gauge reading to those thresholds and emits the right broadcast severity."}),v.jsxs("p",{children:[v.jsx("strong",{children:"USGS lookup button"})," — when you add a new row in native-feed mode, the lookup queries the USGS Site Service plus NWS NWPS to auto-populate name, coordinates, and flood stages. In central-feed mode the button is disabled with a tooltip: a one-off direct USGS poll from the GUI while the runtime is on Central is the AND-mode anti-pattern the architecture forbids. Enter values manually or pull them from Central."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Disabled rows"})," are ignored at dispatch time. The corresponding gauge still ingests into ",v.jsx(se,{children:"gauge_readings"})," ","(so historical queries still work), it just doesn't broadcast."]}),v.jsx(fe,{children:"Town Anchors"}),v.jsxs("p",{children:['Lookup table for the "X mi ',"<","bearing",">"," of ","<","town",">",'" suffix in broadcast text. When a fire or NWS alert renders, the bot walks an anchor chain to figure out where to say it is:']}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsx("li",{children:'Photon nearest-town lookup (the WFIGS path uses this — produces "near Long Creek Summit Home" style anchors)'}),v.jsx("li",{children:"Town Anchors table (your curated list)"}),v.jsx("li",{children:"Landclass label (county / federal-land identifier)"}),v.jsx("li",{children:"County + state fallback"}),v.jsx("li",{children:"Bare lat/lon coords"})]}),v.jsx("p",{children:'Each row carries a name (lowercased on save), state, lat/lon, and an enable flag. The "lowercased on save" rule keeps "Almo" / "ALMO" / "almo" from being three distinct rows. Disabled rows fall through to the next anchor in the chain — the broadcast text still goes out, it just uses a different anchor.'}),v.jsxs("p",{children:["Example broadcast text rendered from a Town Anchors row:"," ",v.jsx("span",{className:"text-amber-300",children:'"🔥 New: Cache Peak Fire (WF), 3 mi N of Almo: 250 ac, 0% contained, @ 42.118,-113.643"'})]})]}),v.jsxs(gr,{id:"schema",title:"Schema Migrations",children:[v.jsxs("p",{children:["MeshAI persists state in a single SQLite database (",v.jsx(se,{children:"/data/meshai.sqlite"}),") with WAL journaling. Schema migrations live in ",v.jsx(se,{children:"meshai/persistence/migrations/v*.sql"})," ","and apply automatically on container start. The runner reads the migrations directory, sorts by version, and applies anything past the current ",v.jsx(se,{children:"schema_meta.version"})," in order. Idempotent re-runs are no-ops."]}),v.jsx(fe,{children:"v0.6 + v0.7 additions"}),v.jsx(St,{headers:["Migration","What it added"],rows:[[v.jsx(se,{children:"v11"}),"first_broadcast_at + last_broadcast_at split + reminder_enabled per adapter (the schema basis for New / Update / Active)"],[v.jsx(se,{children:"v12"}),"fires.tombstoned_at (WFIGS closure stamp; terminates the reminder loop)"],[v.jsx(se,{children:"v13"}),"Fire Tracker Phase 1 — fire_pixels table + spread_radius_mi + current_centroid_lat/lon + last_hotspot_at; firms_pixels attributed_at + cluster_broadcast_at"],[v.jsx(se,{children:"v14"}),"Fire Tracker Phase 2 — fire_passes table (per-satellite-pass centroid + drift) + last_pass_id + halt_broadcast_at on fires"],[v.jsx(se,{children:"v15"}),"Fire Tracker Phase 3 — fire_passes.perimeter_geojson (convex hull) + fires.last_spotting_broadcast_at"],[v.jsx(se,{children:"v16"}),"Fire Tracker Phase 4 — fire_digest_broadcasts table (idempotent twice-daily LLM digest)"]]}),v.jsx(fe,{children:"When migrations fail"}),v.jsxs("p",{children:["A migration failure leaves the database at the prior version and raises in the runner. Container logs surface the SQL error;"," ",v.jsx(se,{children:"schema_meta.version"})," tells you where the last successful migration stopped. Re-running the container after the underlying issue is fixed picks up from there."]})]}),v.jsxs(gr,{id:"api",title:"API Reference",children:[v.jsxs("p",{children:["MeshAI's REST API is available at ",v.jsx(se,{children:"http://your-host:8080"}),". All endpoints return JSON."]}),v.jsx(fe,{children:"System"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/status"})," — version, uptime, node count"]}),v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/channels"})," — radio channel list"]}),v.jsxs("li",{children:[v.jsx(se,{children:"POST /api/restart"})," — restart the bot"]})]}),v.jsx(fe,{children:"Mesh Data"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/health"})," — health score and pillars"]}),v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/nodes"})," — all nodes with positions and telemetry"]}),v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/edges"})," — neighbor links with signal quality"]}),v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/regions"})," — region summaries"]}),v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/sources"})," — data source health"]})]}),v.jsx(fe,{children:"Configuration"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/config"})," — full config"]}),v.jsxs("li",{children:[v.jsxs(se,{children:["GET /api/config/","{section}"]})," — one section"]}),v.jsxs("li",{children:[v.jsxs(se,{children:["PUT /api/config/","{section}"]})," — update a section"]})]}),v.jsx(fe,{children:"Environmental"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/env/status"})," — per-feed health"]}),v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/env/active"})," — all active events"]}),v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/env/swpc"})," — solar/geomagnetic data"]}),v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/env/ducting"})," — atmospheric profile"]}),v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/env/fires"})," — wildfire perimeters"]}),v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/env/hotspots"})," — satellite fire detections"]})]}),v.jsx(fe,{children:"Alerts"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/alerts/active"})," — current alerts"]}),v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/alerts/history"})," — past alerts"]}),v.jsxs("li",{children:[v.jsx(se,{children:"GET /api/notifications/categories"})," — available alert categories"]})]}),v.jsx(fe,{children:"Real-time"}),v.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:v.jsxs("li",{children:[v.jsx(se,{children:"ws://your-host:8080/ws/live"})," — WebSocket for live updates"]})})]})]})})]})}const YSe=1500;function XSe(){const[e,t]=G.useState({}),[r,n]=G.useState({}),[i,a]=G.useState(!0),[o,s]=G.useState(null),[l,u]=G.useState({}),[c,h]=G.useState({}),[f,d]=G.useState({}),g=G.useCallback(async()=>{a(!0),s(null);try{const[S,T]=await Promise.all([fetch("/api/adapter-config"),fetch("/api/adapter-meta")]);if(!S.ok)throw new Error(`GET /adapter-config: ${S.status}`);if(!T.ok)throw new Error(`GET /adapter-meta: ${T.status}`);t(await S.json()),n(await T.json())}catch(S){s(String(S))}finally{a(!1)}},[]);G.useEffect(()=>{g()},[g]);const m=G.useCallback((S,T,M)=>{h(A=>({...A,[S]:T})),M&&d(A=>({...A,[S]:M})),T==="saved"&&setTimeout(()=>{h(A=>A[S]==="saved"?{...A,[S]:"idle"}:A)},YSe)},[]),y=G.useCallback(async(S,T,M)=>{const A=`${S}.${T}`;m(A,"saving");try{const N=await fetch(`/api/adapter-config/${S}/${T}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:M})});if(!N.ok){const D=(await N.json().catch(()=>({}))).detail||N.statusText;m(A,"error",String(D));return}const P=await N.json();t(I=>({...I,[S]:(I[S]||[]).map(D=>D.key===T?P:D)})),m(A,"saved")}catch(N){m(A,"error",String(N))}},[m]),_=G.useCallback(async(S,T)=>{const M=`${S}.${T}`;m(M,"saving");try{const A=await fetch(`/api/adapter-config/${S}/${T}/reset`,{method:"POST"});if(!A.ok){m(M,"error",`reset failed (${A.status})`);return}const N=await A.json();t(P=>({...P,[S]:(P[S]||[]).map(I=>I.key===T?N:I)})),m(M,"saved")}catch(A){m(M,"error",String(A))}},[m]),x=G.useCallback(async(S,T)=>{const M=`meta:${S}`;m(M,"saving");try{const A=await fetch(`/api/adapter-meta/${S}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(!A.ok){const P=await A.json().catch(()=>({}));m(M,"error",String(P.detail||A.statusText));return}const N=await A.json();n(P=>({...P,[S]:N})),m(M,"saved")}catch(A){m(M,"error",String(A))}},[m]);if(i)return v.jsxs("div",{className:"p-6 flex items-center gap-2 text-[#777]",children:[v.jsx($g,{className:"w-5 h-5 animate-spin"})," Loading adapter config…"]});if(o)return v.jsxs("div",{className:"p-6 text-red-400",children:[v.jsx(os,{className:"w-5 h-5 inline mr-2"}),"Failed to load: ",o]});const w=Array.from(new Set([...Object.keys(r),...Object.keys(e)])).sort();return v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsxs("div",{className:"flex items-center gap-2 text-white",children:[v.jsx(tk,{className:"w-5 h-5"}),v.jsx("h1",{className:"text-xl font-semibold",children:"Adapter Config"}),v.jsxs("span",{className:"text-xs text-[#666] ml-2",children:[Object.values(e).reduce((S,T)=>S+T.length,0)," settings across ",w.length," adapters"]})]}),v.jsxs("p",{className:"text-xs text-[#777] max-w-3xl",children:["Per-adapter tunables (thresholds, freshness windows, toggles, curation lists). Changes take effect on the next handler call -- no container restart needed. Sentence templates, emoji, and translation maps live in code by design — see the CODE rule under ",v.jsx("a",{href:"/reference#adapter-config",className:"text-accent hover:underline",children:"Adapter Config & the CODE Rule"})," in Reference. The ",v.jsx("strong",{children:"LLM context"})," toggle on each card gates whether that adapter's data lands in the system prompt when you DM the bot; broadcasts are unaffected."]}),w.map(S=>{const T=r[S]||{display_name:S,include_in_llm_context:!0,description:""},M=e[S]||[],A=l[S]??!1,N=`meta:${S}`,P=c[N]||"idle";return v.jsxs("div",{className:"bg-bg-card border border-border",children:[v.jsxs("div",{className:"p-4 flex items-start gap-4",children:[v.jsx("button",{onClick:()=>u(I=>({...I,[S]:!I[S]})),className:"text-[#777] hover:text-white","aria-label":"toggle expand",children:A?v.jsx(Rl,{className:"w-5 h-5"}):v.jsx(wl,{className:"w-5 h-5"})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("h2",{className:"text-base font-semibold text-white",children:T.display_name}),v.jsx("code",{className:"text-xs text-[#666]",children:S}),M.length>0&&v.jsxs("span",{className:"text-xs text-[#777] ml-1",children:["(",M.length," settings)"]}),M.length===0&&v.jsx("span",{className:"text-xs text-[#666] ml-1 italic",children:"(meta only)"})]}),T.description&&v.jsx("p",{className:"text-xs text-[#777] mt-1",children:T.description})]}),v.jsxs("label",{className:"flex items-center gap-2 text-xs text-[#e0e0e0] select-none",children:[v.jsx("input",{type:"checkbox",checked:T.include_in_llm_context,onChange:I=>x(S,{include_in_llm_context:I.target.checked}),className:"w-4 h-4 accent-[#f59e0b]"}),"LLM context",v.jsx(WZ,{status:P,error:f[N]})]})]}),A&&M.length>0&&v.jsx("div",{className:"border-t border-border divide-y divide-border",children:M.map(I=>v.jsx(qSe,{row:I,status:c[`${S}.${I.key}`]||"idle",error:f[`${S}.${I.key}`],onCommit:D=>y(S,I.key,D),onReset:()=>_(S,I.key)},I.key))})]},S)})]})}function qSe({row:e,status:t,error:r,onCommit:n,onReset:i}){const[a,o]=G.useState(RT(e));G.useEffect(()=>{o(RT(e))},[e.value,e.type]);const s=a!==RT(e),l=JSON.stringify(e.value)===JSON.stringify(e.default),u=()=>{const c=KSe(a,e.type);c.error||c.changed(e.value)&&n(c.value)};return v.jsxs("div",{className:"px-6 py-3 flex items-start gap-4",children:[v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("code",{className:"text-sm font-mono text-accent",children:e.key}),v.jsxs("span",{className:"text-xs text-[#666]",children:["[",e.type,"]"]}),!l&&v.jsx("span",{className:"text-xs text-accent",children:"edited"})]}),e.description&&v.jsx("p",{className:"text-xs text-[#777] mt-1",children:e.description})]}),v.jsxs("div",{className:"flex items-center gap-2 min-w-[280px] justify-end",children:[e.type==="bool"?v.jsx("input",{type:"checkbox",checked:e.value===!0,onChange:c=>n(c.target.checked),className:"w-5 h-5 accent-[#f59e0b]"}):e.type==="json"?v.jsx("textarea",{className:"w-72 h-20 bg-[#0d0d0d] border border-border px-2 py-1 text-xs font-mono text-white",value:a,onChange:c=>o(c.target.value),onBlur:u}):v.jsx("input",{type:e.type==="int"||e.type==="float"?"number":"text",step:e.type==="float"?"any":"1",className:"w-48 bg-[#0d0d0d] border border-border px-2 py-1 text-sm text-white",value:a,onChange:c=>o(c.target.value),onBlur:u,onKeyDown:c=>{c.key==="Enter"&&c.target.blur()}}),v.jsx(WZ,{status:t,error:r,dirty:s}),v.jsx("button",{onClick:i,disabled:l,className:"text-[#777] hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",title:"Reset to default",children:v.jsx(H1,{className:"w-4 h-4"})})]})]})}function WZ({status:e,error:t,dirty:r}){return e==="saving"?v.jsx($g,{className:"w-4 h-4 text-accent animate-spin"}):e==="saved"?v.jsx(ao,{className:"w-4 h-4 text-green-500"}):e==="error"?v.jsx("span",{title:t,className:"text-red-400 cursor-help",children:v.jsx(os,{className:"w-4 h-4"})}):r?v.jsx("span",{className:"w-2 h-2 bg-accent rounded-full",title:"unsaved"}):v.jsx("span",{className:"w-4 h-4"})}function RT(e){return e.type==="bool"?String(e.value===!0):e.type==="json"?JSON.stringify(e.value,null,2):e.value===null||e.value===void 0?"":String(e.value)}function KSe(e,t){if(t==="int"){const r=Number(e);return!Number.isFinite(r)||!Number.isInteger(r)?{error:"expected integer",value:null,changed:()=>!1}:{error:null,value:r,changed:n=>n!==r}}if(t==="float"){const r=Number(e);return Number.isFinite(r)?{error:null,value:r,changed:n=>n!==r}:{error:"expected number",value:null,changed:()=>!1}}if(t==="str")return{error:null,value:e,changed:r=>r!==e};if(t==="json")try{const r=JSON.parse(e);return{error:null,value:r,changed:n=>JSON.stringify(n)!==JSON.stringify(r)}}catch{return{error:"invalid JSON",value:null,changed:()=>!1}}return{error:null,value:e,changed:()=>!0}}const jT={site_id:"",gauge_name:"",lat:0,lon:0,action_ft:null,flood_minor_ft:null,flood_moderate_ft:null,flood_major_ft:null,enabled:!0,updated_at:0};function JSe(){const[e,t]=G.useState([]),[r,n]=G.useState(!0),[i,a]=G.useState(null),[o,s]=G.useState(null),[l,u]=G.useState(jT),[c,h]=G.useState(!1),[f,d]=G.useState("unknown"),g=G.useCallback(async()=>{n(!0),a(null);try{const S=await fetch("/api/gauge-sites");if(!S.ok)throw new Error(`GET: ${S.status}`);t(await S.json())}catch(S){a(String(S))}finally{n(!1)}},[]);G.useEffect(()=>{g()},[g]),G.useEffect(()=>{fetch("/api/config/environmental").then(S=>S.json()).then(S=>{var T;return d(((T=S==null?void 0:S.usgs)==null?void 0:T.feed_source)||"unknown")}).catch(()=>d("unknown"))},[]);const m=S=>{s(S.site_id),u({...S}),h(!1)},y=()=>{h(!0),s(null),u({...jT})},_=()=>{s(null),h(!1),u(jT)},x=async()=>{try{const S=c?"/api/gauge-sites":`/api/gauge-sites/${o}`,M=await fetch(S,{method:c?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!M.ok){const A=await M.json().catch(()=>({}));alert(`save failed: ${A.detail||M.statusText}`);return}_(),g()}catch(S){alert(String(S))}},w=async S=>{if(!confirm(`Delete ${S}?`))return;const T=await fetch(`/api/gauge-sites/${S}`,{method:"DELETE"});if(!T.ok){alert(`delete failed: ${T.status}`);return}g()};return r?v.jsxs("div",{className:"p-6 text-slate-400",children:[v.jsx($g,{className:"w-5 h-5 animate-spin inline mr-2"}),"Loading…"]}):i?v.jsxs("div",{className:"p-6 text-red-400",children:["Load failed: ",i]}):v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(B1,{className:"w-5 h-5 text-accent"}),v.jsx("h1",{className:"text-xl font-semibold text-slate-100",children:"Gauge Sites"}),v.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[e.length," sites"]}),v.jsxs("button",{onClick:y,className:"ml-auto flex items-center gap-1 px-3 py-1 bg-[#f59e0b] hover:bg-[#d97706] text-black font-sans font-medium text-sm",children:[v.jsx(id,{className:"w-4 h-4"})," Add site"]})]}),v.jsx("p",{className:"text-xs text-slate-400 max-w-3xl",children:"NWS-AHPS stream gauge thresholds for the USGS NWIS handler. Each row pairs a USGS site_id with a human gauge name, lat/lon, and four flood thresholds (Action / Minor / Moderate / Major, all in feet). Disabled rows still ingest into gauge_readings -- they don't broadcast. The USGS lookup button auto-populates name + coords + thresholds from USGS Site Service + NWS NWPS when this adapter is on native feed_source; Central-feed mode disables it (see Reference → OR-not-AND for why). Changes take effect on the next event."}),c&&v.jsx(TB,{draft:l,setDraft:u,onSave:x,onCancel:_,adding:!0,feedSource:f}),v.jsx("div",{className:"bg-bg-card border border-border overflow-x-auto",children:v.jsxs("table",{className:"w-full text-sm text-slate-200",children:[v.jsx("thead",{className:"bg-[#161616] border-b border-border",children:v.jsxs("tr",{children:[v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-left",children:"Site ID"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-left",children:"Name"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-right",children:"Lat,Lon"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-right",children:"Action"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-right",children:"Minor"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-right",children:"Moderate"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-right",children:"Major"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-center",children:"On"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666]"})]})}),v.jsx("tbody",{className:"divide-y divide-border",children:e.map(S=>o===S.site_id?v.jsx("tr",{className:"bg-bg-card border-b border-border hover:bg-bg-hover",children:v.jsx("td",{colSpan:9,className:"px-3 py-2",children:v.jsx(TB,{draft:l,setDraft:u,onSave:x,onCancel:_,feedSource:f})})},S.site_id):v.jsxs("tr",{className:"hover:bg-bg-hover",children:[v.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:S.site_id}),v.jsx("td",{className:"px-3 py-2",children:S.gauge_name}),v.jsxs("td",{className:"px-3 py-2 text-right text-xs",children:[S.lat.toFixed(3),",",S.lon.toFixed(3)]}),v.jsx("td",{className:"px-3 py-2 text-right",children:S.action_ft??"-"}),v.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_minor_ft??"-"}),v.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_moderate_ft??"-"}),v.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_major_ft??"-"}),v.jsx("td",{className:"px-3 py-2 text-center",children:S.enabled?v.jsx(ao,{className:"w-4 h-4 text-emerald-400 inline"}):v.jsx(ya,{className:"w-4 h-4 text-slate-500 inline"})}),v.jsxs("td",{className:"px-3 py-2 text-right",children:[v.jsx("button",{onClick:()=>m(S),className:"text-accent hover:text-accent text-xs mr-3",children:"Edit"}),v.jsx("button",{onClick:()=>w(S.site_id),className:"text-red-400 hover:text-red-300",children:v.jsx(Yg,{className:"w-4 h-4 inline"})})]})]},S.site_id))})]})})]})}function TB({draft:e,setDraft:t,onSave:r,onCancel:n,adding:i,feedSource:a}){const o=(g,m)=>t({...e,[g]:m}),[s,l]=G.useState(!1),[u,c]=G.useState(null),h=a!=="native"||!e.site_id.trim(),f=a!=="native"?"USGS lookup not available in central-feed mode (would be AND-model anti-pattern). Enter values manually.":e.site_id.trim()?"Auto-populate from USGS / NWS NWPS":"Enter a site_id first",d=async()=>{if(!h){l(!0),c(null);try{const g=e.site_id.replace(/^USGS-/i,""),m=await fetch(`/api/env/usgs/lookup/${encodeURIComponent(g)}`);if(m.status===404){const x=await m.json().catch(()=>({}));c(x.detail||"Lookup unavailable -- enter values manually"),l(!1);return}if(!m.ok){c(`Lookup failed (${m.status})`),l(!1);return}const y=await m.json(),_={...e};y.name&&!_.gauge_name&&(_.gauge_name=y.name),typeof y.lat=="number"&&(_.lat=y.lat),typeof y.lon=="number"&&(_.lon=y.lon),typeof y.action_ft=="number"&&(_.action_ft=y.action_ft),typeof y.flood_minor_ft=="number"&&(_.flood_minor_ft=y.flood_minor_ft),typeof y.flood_moderate_ft=="number"&&(_.flood_moderate_ft=y.flood_moderate_ft),typeof y.flood_major_ft=="number"&&(_.flood_major_ft=y.flood_major_ft),t(_)}catch(g){c(String(g))}finally{l(!1)}}};return v.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 p-3 bg-[#1a1a1a]",children:[v.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Site ID",v.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[v.jsx("input",{className:"flex-1 bg-bg border border-border px-2 py-1 text-slate-100 font-mono text-xs",value:e.site_id,onChange:g=>o("site_id",g.target.value),disabled:!i}),v.jsxs("button",{type:"button",onClick:d,disabled:h||s,title:f,className:"px-2 py-1 bg-bg-hover hover:bg-[#333] disabled:opacity-30 disabled:cursor-not-allowed text-xs text-slate-100 flex items-center gap-1",children:[s?v.jsx($g,{className:"w-3 h-3 animate-spin"}):v.jsx(W1,{className:"w-3 h-3"}),"USGS lookup"]})]}),u&&v.jsx("span",{className:"text-amber-400 text-xs mt-1 block",children:u})]}),v.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Gauge name",v.jsx("input",{className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.gauge_name,onChange:g=>o("gauge_name",g.target.value)})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Lat",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.lat,onChange:g=>o("lat",parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Lon",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.lon,onChange:g=>o("lon",parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Action ft",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.action_ft??"",onChange:g=>o("action_ft",g.target.value===""?null:parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Minor flood ft",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.flood_minor_ft??"",onChange:g=>o("flood_minor_ft",g.target.value===""?null:parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Moderate flood ft",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.flood_moderate_ft??"",onChange:g=>o("flood_moderate_ft",g.target.value===""?null:parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Major flood ft",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.flood_major_ft??"",onChange:g=>o("flood_major_ft",g.target.value===""?null:parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-300 col-span-2 flex items-center gap-2 mt-2",children:[v.jsx("input",{type:"checkbox",checked:e.enabled,onChange:g=>o("enabled",g.target.checked),className:"accent-[#f59e0b]"}),"Enabled"]}),v.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-2 mt-2",children:[v.jsx("button",{onClick:n,className:"px-3 py-1 text-slate-300 hover:bg-bg-hover text-sm",children:"Cancel"}),v.jsx("button",{onClick:r,className:"px-3 py-1 bg-[#f59e0b] hover:bg-[#d97706] text-black font-sans font-medium text-sm",children:"Save"})]})]})}const OT={anchor_id:0,name:"",lat:0,lon:0,state:"ID",enabled:!0,updated_at:0};function QSe(){const[e,t]=G.useState([]),[r,n]=G.useState(!0),[i,a]=G.useState(null),[o,s]=G.useState(null),[l,u]=G.useState(!1),[c,h]=G.useState(OT),f=G.useCallback(async()=>{n(!0),a(null);try{const x=await fetch("/api/town-anchors");if(!x.ok)throw new Error(`GET: ${x.status}`);t(await x.json())}catch(x){a(String(x))}finally{n(!1)}},[]);G.useEffect(()=>{f()},[f]);const d=x=>{s(x.anchor_id),h({...x}),u(!1)},g=()=>{u(!0),s(null),h({...OT})},m=()=>{s(null),u(!1),h(OT)},y=async()=>{const x=l?"/api/town-anchors":`/api/town-anchors/${o}`,S=await fetch(x,{method:l?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!S.ok){const T=await S.json().catch(()=>({}));alert(`save failed: ${T.detail||S.statusText}`);return}m(),f()},_=async x=>{if(!confirm(`Delete anchor ${x}?`))return;const w=await fetch(`/api/town-anchors/${x}`,{method:"DELETE"});if(!w.ok){alert(`delete failed: ${w.status}`);return}f()};return r?v.jsxs("div",{className:"p-6 text-slate-400",children:[v.jsx($g,{className:"w-5 h-5 animate-spin inline mr-2"}),"Loading…"]}):i?v.jsxs("div",{className:"p-6 text-red-400",children:["Load failed: ",i]}):v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(nd,{className:"w-5 h-5 text-accent"}),v.jsx("h1",{className:"text-xl font-semibold text-slate-100",children:"Town Anchors"}),v.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[e.length," towns"]}),v.jsxs("button",{onClick:g,className:"ml-auto flex items-center gap-1 px-3 py-1 bg-[#f59e0b] hover:bg-[#d97706] text-black font-sans font-medium text-sm",children:[v.jsx(id,{className:"w-4 h-4"})," Add town"]})]}),v.jsx("p",{className:"text-xs text-slate-400 max-w-3xl",children:`Lookup table for the "X mi of " suffix in the bot's broadcast text. When a fire or NWS alert renders, the bot walks: Photon nearest-town → this table → landclass → county/state → bare coords. Disabled rows fall through to the next anchor in the chain; the broadcast still goes out, it just uses a different anchor. Example: "3 mi N of Almo". See Reference → Curation: Gauges & Towns for the full chain.`}),l&&v.jsx(MB,{draft:c,setDraft:h,onSave:y,onCancel:m,adding:!0}),v.jsx("div",{className:"bg-bg-card border border-border overflow-x-auto",children:v.jsxs("table",{className:"w-full text-sm text-slate-200",children:[v.jsx("thead",{className:"bg-[#161616] border-b border-border",children:v.jsxs("tr",{children:[v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-left",children:"Name"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-right",children:"Lat"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-right",children:"Lon"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-center",children:"State"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666] text-center",children:"On"}),v.jsx("th",{className:"px-3 py-2 font-sans text-[9px] uppercase tracking-widest text-[#666]"})]})}),v.jsx("tbody",{className:"divide-y divide-border",children:e.map(x=>o===x.anchor_id?v.jsx("tr",{className:"bg-bg-card border-b border-border hover:bg-bg-hover",children:v.jsx("td",{colSpan:6,className:"px-3 py-2",children:v.jsx(MB,{draft:c,setDraft:h,onSave:y,onCancel:m})})},x.anchor_id):v.jsxs("tr",{className:"hover:bg-bg-hover",children:[v.jsx("td",{className:"px-3 py-2 capitalize",children:x.name}),v.jsx("td",{className:"px-3 py-2 text-right text-xs",children:x.lat.toFixed(4)}),v.jsx("td",{className:"px-3 py-2 text-right text-xs",children:x.lon.toFixed(4)}),v.jsx("td",{className:"px-3 py-2 text-center text-xs",children:x.state||"-"}),v.jsx("td",{className:"px-3 py-2 text-center",children:x.enabled?v.jsx(ao,{className:"w-4 h-4 text-emerald-400 inline"}):v.jsx(ya,{className:"w-4 h-4 text-slate-500 inline"})}),v.jsxs("td",{className:"px-3 py-2 text-right",children:[v.jsx("button",{onClick:()=>d(x),className:"text-accent hover:text-accent text-xs mr-3",children:"Edit"}),v.jsx("button",{onClick:()=>_(x.anchor_id),className:"text-red-400 hover:text-red-300",children:v.jsx(Yg,{className:"w-4 h-4 inline"})})]})]},x.anchor_id))})]})})]})}function MB({draft:e,setDraft:t,onSave:r,onCancel:n,adding:i}){const a=(o,s)=>t({...e,[o]:s});return v.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 p-3 bg-[#1a1a1a]",children:[v.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Name (lowercased on save)",v.jsx("input",{className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.name,onChange:o=>a("name",o.target.value),disabled:!i})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["State",v.jsx("input",{className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.state??"",onChange:o=>a("state",o.target.value)})]}),v.jsxs("label",{className:"text-xs text-slate-400 flex items-center gap-2",children:[v.jsx("input",{type:"checkbox",checked:e.enabled,onChange:o=>a("enabled",o.target.checked),className:"accent-[#f59e0b] mt-4"}),"Enabled"]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Lat",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.lat,onChange:o=>a("lat",parseFloat(o.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Lon",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-bg border border-border px-2 py-1 text-slate-100",value:e.lon,onChange:o=>a("lon",parseFloat(o.target.value))})]}),v.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-2 mt-2",children:[v.jsx("button",{onClick:n,className:"px-3 py-1 text-slate-300 hover:bg-bg-hover text-sm",children:"Cancel"}),v.jsx("button",{onClick:r,className:"px-3 py-1 bg-[#f59e0b] hover:bg-[#d97706] text-black font-sans font-medium text-sm",children:"Save"})]})]})}function eCe(){return v.jsx(XK,{children:v.jsx(eJ,{children:v.jsxs(oK,{children:[v.jsx(na,{path:"/",element:v.jsx(uJ,{})}),v.jsx(na,{path:"/mesh",element:v.jsx(uSe,{})}),v.jsx(na,{path:"/environment",element:v.jsx(DSe,{})}),v.jsx(na,{path:"/config",element:v.jsx(kSe,{})}),v.jsx(na,{path:"/alerts",element:v.jsx(VSe,{})}),v.jsx(na,{path:"/notifications",element:v.jsx(ZSe,{})}),v.jsx(na,{path:"/reference",element:v.jsx($Se,{})}),v.jsx(na,{path:"/adapter-config",element:v.jsx(XSe,{})}),v.jsx(na,{path:"/gauge-sites",element:v.jsx(JSe,{})}),v.jsx(na,{path:"/town-anchors",element:v.jsx(QSe,{})})]})})})}zT.createRoot(document.getElementById("root")).render(v.jsx(bf.StrictMode,{children:v.jsx(dK,{children:v.jsx(eCe,{})})})); diff --git a/meshai/dashboard/static/index.html b/meshai/dashboard/static/index.html index ec194d0..3677340 100644 --- a/meshai/dashboard/static/index.html +++ b/meshai/dashboard/static/index.html @@ -8,8 +8,8 @@ - - + +